LavaPack.loadBundle([[1,{"../ui/contexts/i18n":4047,"../ui/helpers/utils/i18n-helper":4095,"prop-types":3032,react:3177},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"I18nContext",{enumerable:!0,get:function(){return a.I18nContext}}),r.LegacyI18nProvider=r.I18nProvider=void 0;var n,i=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var r=u(t);if(r&&r.has(e))return r.get(e);var n={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if("default"!==o&&Object.prototype.hasOwnProperty.call(e,o)){var s=i?Object.getOwnPropertyDescriptor(e,o):null;s&&(s.get||s.set)?Object.defineProperty(n,o,s):n[o]=e[o]}n.default=e,r&&r.set(e,n);return n}(e("react")),o=(n=e("prop-types"))&&n.__esModule?n:{default:n},s=e("../ui/helpers/utils/i18n-helper"),a=e("../ui/contexts/i18n");function u(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(u=function(e){return e?r:t})(e)}function c(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(r!==undefined){var n=r.call(e,t||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const l=e=>{const{currentLocale:t,current:r,en:n}=e,o=(0,i.useMemo)((()=>(e,...i)=>(0,s.getMessage)(t,r,e,...i)||(0,s.getMessage)(t,n,e,...i)),[t,r,n]);return i.default.createElement(a.I18nContext.Provider,{value:o},e.children)};r.I18nProvider=l,l.propTypes={currentLocale:o.default.string,current:o.default.object,en:o.default.object,children:o.default.node},l.defaultProps={children:undefined};class d extends i.Component{getChildContext(){return{t:this.context}}render(){return this.props.children}}r.LegacyI18nProvider=d,c(d,"propTypes",{children:o.default.node}),c(d,"defaultProps",{children:undefined}),c(d,"contextType",a.I18nContext),c(d,"childContextTypes",{t:o.default.func})}}},{package:"$root$",file:".storybook/i18n.js"}],[1200,{"./token":1201,"@babel/runtime/helpers/assertThisInitialized":176,"@babel/runtime/helpers/asyncToGenerator":177,"@babel/runtime/helpers/classCallCheck":178,"@babel/runtime/helpers/createClass":180,"@babel/runtime/helpers/getPrototypeOf":183,"@babel/runtime/helpers/inherits":184,"@babel/runtime/helpers/interopRequireDefault":186,"@babel/runtime/helpers/possibleConstructorReturn":196,"@babel/runtime/regenerator":205,"deep-equal":2077,"eth-block-tracker":1205,"ethjs-contract":2270,"ethjs-query":2274,"human-standard-token-abi":1216,"safe-event-emitter":3209},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){var n=e("@babel/runtime/helpers/interopRequireDefault"),i=n(e("@babel/runtime/regenerator")),o=n(e("@babel/runtime/helpers/asyncToGenerator")),s=n(e("@babel/runtime/helpers/classCallCheck")),a=n(e("@babel/runtime/helpers/createClass")),u=n(e("@babel/runtime/helpers/possibleConstructorReturn")),c=n(e("@babel/runtime/helpers/getPrototypeOf")),l=n(e("@babel/runtime/helpers/assertThisInitialized")),d=n(e("@babel/runtime/helpers/inherits")),f=e("ethjs-query"),h=e("ethjs-contract"),p=e("./token"),m=e("eth-block-tracker"),g=e("human-standard-token-abi"),y=e("safe-event-emitter"),v=e("deep-equal"),b=function(e){function t(){var e,r=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};(0,s.default)(this,t),(e=(0,u.default)(this,(0,c.default)(t).call(this))).includeFailedTokens=r.includeFailedTokens||!1,e.userAddress=r.userAddress||"0x0",e.provider=r.provider;var n=r.pollingInterval||4e3;e.blockTracker=new m({provider:e.provider,pollingInterval:n}),e.eth=new f(e.provider),e.contract=new h(e.eth),e.TokenContract=e.contract(g);var i=r.tokens||[];return e.balanceDecimals=r.balanceDecimals,e.tokens=i.map((function(t){return e.createTokenFrom(t,e.balanceDecimals)})),e._oldBalances=[],Promise.all(e.tokens.map((function(e){return e.update()}))).then((function(t){e._update(t)})).catch((function(t){e.emit("error",t)})),e.updateBalances=e.updateBalances.bind((0,l.default)(e)),e.running=!0,e.blockTracker.on("latest",e.updateBalances),e}var r;return(0,d.default)(t,e),(0,a.default)(t,[{key:"serialize",value:function(){return this.tokens.map((function(e){return e.serialize()}))}},{key:"updateBalances",value:(r=(0,o.default)(i.default.mark((function e(){var t;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,Promise.all(this.tokens.map((function(e){return e.updateBalance()})));case 3:t=this.serialize(),this._update(t),e.next=10;break;case 7:e.prev=7,e.t0=e.catch(0),this.emit("error",e.t0);case 10:case"end":return e.stop()}}),e,this,[[0,7]])}))),function(){return r.apply(this,arguments)})},{key:"createTokenFrom",value:function(e,t){var r=this.userAddress,n=e.address,i=e.symbol,o=e.balance,s=e.decimals,a=this.TokenContract.at(n);return new p({address:n,symbol:i,balance:o,decimals:s,contract:a,owner:r,throwOnBalanceError:!1===this.includeFailedTokens,balanceDecimals:t})}},{key:"add",value:function(e){var t=this,r=this.createTokenFrom(e);this.tokens.push(r),r.update().then((function(){t._update(t.serialize())})).catch((function(e){t.emit("error",e)}))}},{key:"stop",value:function(){this.running=!1,this.blockTracker.removeListener("latest",this.updateBalances)}},{key:"_update",value:function(e){this.running&&!v(e,this._oldBalances)&&(this._oldBalances=e,this.emit("update",e))}}]),t}(y);t.exports=b}}},{package:"@metamask/eth-token-tracker",file:"node_modules/@metamask/eth-token-tracker/dist/index.js"}],[1201,{"./util":1202,"@babel/runtime/helpers/asyncToGenerator":177,"@babel/runtime/helpers/classCallCheck":178,"@babel/runtime/helpers/createClass":180,"@babel/runtime/helpers/interopRequireDefault":186,"@babel/runtime/helpers/toConsumableArray":201,"@babel/runtime/regenerator":205,ethjs:1208},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){var n=e("@babel/runtime/helpers/interopRequireDefault"),i=n(e("@babel/runtime/helpers/toConsumableArray")),o=n(e("@babel/runtime/regenerator")),s=n(e("@babel/runtime/helpers/asyncToGenerator")),a=n(e("@babel/runtime/helpers/classCallCheck")),u=n(e("@babel/runtime/helpers/createClass")),c=e("ethjs").BN,l=e("./util");function d(e,t){return"string"==typeof e&&(e.startsWith("0x")||Number.isNaN(parseInt(e,t)))}var f=function(){function e(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{},r=t.address,n=t.symbol,i=t.balance,o=t.decimals,s=t.contract,u=t.owner,l=t.throwOnBalanceError,f=t.balanceDecimals;if((0,a.default)(this,e),!s)throw new Error("Missing requried 'contract' parameter");if(!u)throw new Error("Missing requried 'owner' parameter");if(this.isLoading=!(r&&n&&i&&o),this.address=r||"0x0",this.symbol=n,this.throwOnBalanceError=l,this.balanceDecimals=f,i){if(d(i,16))throw new Error("Invalid 'balance' option provided; must be non-prefixed hex string if given as string")}else i="0";if(o&&d(o,10))throw new Error("Invalid 'decimals' option provided; must be non-prefixed hex string if given as string");this.balance=new c(i,16),this.decimals=o?new c(o):undefined,this.owner=u,this.contract=s}var t,r,n,f,h;return(0,u.default)(e,[{key:"update",value:(h=(0,s.default)(o.default.mark((function e(){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Promise.all([this.symbol||this.updateSymbol(),this.updateBalance(),this.decimals||this.updateDecimals()]);case 2:return this.isLoading=!1,e.abrupt("return",this.serialize());case 4:case"end":return e.stop()}}),e,this)}))),function(){return h.apply(this,arguments)})},{key:"serialize",value:function(){return{address:this.address,symbol:this.symbol,balance:this.balance.toString(10),decimals:this.decimals?parseInt(this.decimals.toString()):0,string:this.stringify(),balanceError:this.balanceError?this.balanceError:null}}},{key:"stringify",value:function(){return l.stringifyBalance(this.balance,this.decimals||new c(0),this.balanceDecimals)}},{key:"updateSymbol",value:(f=(0,s.default)(o.default.mark((function e(){var t;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.updateValue("symbol");case 2:return t=e.sent,this.symbol=t||"TKN",e.abrupt("return",this.symbol);case 5:case"end":return e.stop()}}),e,this)}))),function(){return f.apply(this,arguments)})},{key:"updateBalance",value:(n=(0,s.default)(o.default.mark((function e(){var t;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.updateValue("balance");case 2:return t=e.sent,this.balance=t,e.abrupt("return",this.balance);case 5:case"end":return e.stop()}}),e,this)}))),function(){return n.apply(this,arguments)})},{key:"updateDecimals",value:(r=(0,s.default)(o.default.mark((function e(){var t;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.decimals===undefined){e.next=2;break}return e.abrupt("return",this.decimals);case 2:return e.next=4,this.updateValue("decimals");case 4:return(t=e.sent)&&(this.decimals=t),e.abrupt("return",this.decimals);case 7:case"end":return e.stop()}}),e,this)}))),function(){return r.apply(this,arguments)})},{key:"updateValue",value:(t=(0,s.default)(o.default.mark((function e(t){var r,n,s,a,u;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n=[],e.t0=t,e.next="balance"===e.t0?4:7;break;case 4:return r="balanceOf",n=[this.owner],e.abrupt("break",8);case 7:r=t;case 8:return e.prev=8,e.next=11,(a=this.contract)[r].apply(a,(0,i.default)(n));case 11:s=e.sent,"balance"===t&&(this.balanceError=null),e.next=22;break;case 15:if(e.prev=15,e.t1=e.catch(8),console.warn("failed to load ".concat(t," for token at ").concat(this.address)),"balance"!==t){e.next=22;break}if(this.balanceError=e.t1,!this.throwOnBalanceError){e.next=22;break}throw e.t1;case 22:if(!s){e.next=26;break}return u=s[0],this[t]=u,e.abrupt("return",u);case 26:return e.abrupt("return",this[t]);case 27:case"end":return e.stop()}}),e,this,[[8,15]])}))),function(e){return t.apply(this,arguments)})}]),e}();t.exports=f}}},{package:"@metamask/eth-token-tracker",file:"node_modules/@metamask/eth-token-tracker/dist/token.js"}],[1202,{ethjs:1208},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){var n=new(0,e("ethjs").BN)(0);t.exports={stringifyBalance:function(e,t){var r=arguments.length>2&&arguments[2]!==undefined?arguments[2]:3;if(e.eq(n))return"0";var i=parseInt(t.toString());if(0===i)return e.toString();var o=e.toString(),s=o.length,a=s-i,u="";if(a<=0){for(;u.length<=-1*a;)u+="0",s++;o=u+o,a=1}var c=o.substr(0,s-i);if(0===r)return c;var l=o.substr(a,r);if(/0+$/.test(l)){var d=o.substr(a).replace(/0+$/,"");return d.length>0&&(d=".".concat(d)),"".concat(c).concat(d)}return"".concat(c,".").concat(l)}}}}},{package:"@metamask/eth-token-tracker",file:"node_modules/@metamask/eth-token-tracker/dist/util.js"}],[1203,{},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){!function(t,r){function n(e,t){if(!e)throw new Error(t||"Assertion failed")}function i(e,t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}function o(e,t,r){if(o.isBN(e))return e;this.negative=0,this.words=null,this.length=0,this.red=null,null!==e&&("le"!==t&&"be"!==t||(r=t,t=10),this._init(e||0,t||10,r||"be"))}var s;"object"==typeof t?t.exports=o:r.BN=o,o.BN=o,o.wordSize=26;try{s=e("buf"+"fer").Buffer}catch(e){}function a(e,t,r){for(var n=0,i=Math.min(e.length,r),o=t;o<i;o++){var s=e.charCodeAt(o)-48;n<<=4,n|=s>=49&&s<=54?s-49+10:s>=17&&s<=22?s-17+10:15&s}return n}function u(e,t,r,n){for(var i=0,o=Math.min(e.length,r),s=t;s<o;s++){var a=e.charCodeAt(s)-48;i*=n,i+=a>=49?a-49+10:a>=17?a-17+10:a}return i}o.isBN=function(e){return e instanceof o||null!==e&&"object"==typeof e&&e.constructor.wordSize===o.wordSize&&Array.isArray(e.words)},o.max=function(e,t){return e.cmp(t)>0?e:t},o.min=function(e,t){return e.cmp(t)<0?e:t},o.prototype._init=function(e,t,r){if("number"==typeof e)return this._initNumber(e,t,r);if("object"==typeof e)return this._initArray(e,t,r);"hex"===t&&(t=16),n(t===(0|t)&&t>=2&&t<=36);var i=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&i++,16===t?this._parseHex(e,i):this._parseBase(e,t,i),"-"===e[0]&&(this.negative=1),this.strip(),"le"===r&&this._initArray(this.toArray(),t,r)},o.prototype._initNumber=function(e,t,r){e<0&&(this.negative=1,e=-e),e<67108864?(this.words=[67108863&e],this.length=1):e<4503599627370496?(this.words=[67108863&e,e/67108864&67108863],this.length=2):(n(e<9007199254740992),this.words=[67108863&e,e/67108864&67108863,1],this.length=3),"le"===r&&this._initArray(this.toArray(),t,r)},o.prototype._initArray=function(e,t,r){if(n("number"==typeof e.length),e.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(e.length/3),this.words=new Array(this.length);for(var i=0;i<this.length;i++)this.words[i]=0;var o,s,a=0;if("be"===r)for(i=e.length-1,o=0;i>=0;i-=3)s=e[i]|e[i-1]<<8|e[i-2]<<16,this.words[o]|=s<<a&67108863,this.words[o+1]=s>>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);else if("le"===r)for(i=0,o=0;i<e.length;i+=3)s=e[i]|e[i+1]<<8|e[i+2]<<16,this.words[o]|=s<<a&67108863,this.words[o+1]=s>>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);return this.strip()},o.prototype._parseHex=function(e,t){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var r=0;r<this.length;r++)this.words[r]=0;var n,i,o=0;for(r=e.length-6,n=0;r>=t;r-=6)i=a(e,r,r+6),this.words[n]|=i<<o&67108863,this.words[n+1]|=i>>>26-o&4194303,(o+=24)>=26&&(o-=26,n++);r+6!==t&&(i=a(e,t,r+6),this.words[n]|=i<<o&67108863,this.words[n+1]|=i>>>26-o&4194303),this.strip()},o.prototype._parseBase=function(e,t,r){this.words=[0],this.length=1;for(var n=0,i=1;i<=67108863;i*=t)n++;n--,i=i/t|0;for(var o=e.length-r,s=o%n,a=Math.min(o,o-s)+r,c=0,l=r;l<a;l+=n)c=u(e,l,l+n,t),this.imuln(i),this.words[0]+c<67108864?this.words[0]+=c:this._iaddn(c);if(0!==s){var d=1;for(c=u(e,l,e.length,t),l=0;l<s;l++)d*=t;this.imuln(d),this.words[0]+c<67108864?this.words[0]+=c:this._iaddn(c)}},o.prototype.copy=function(e){e.words=new Array(this.length);for(var t=0;t<this.length;t++)e.words[t]=this.words[t];e.length=this.length,e.negative=this.negative,e.red=this.red},o.prototype.clone=function(){var e=new o(null);return this.copy(e),e},o.prototype._expand=function(e){for(;this.length<e;)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 c=["","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],d=[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 f(e,t,r){r.negative=t.negative^e.negative;var n=e.length+t.length|0;r.length=n,n=n-1|0;var i=0|e.words[0],o=0|t.words[0],s=i*o,a=67108863&s,u=s/67108864|0;r.words[0]=a;for(var c=1;c<n;c++){for(var l=u>>>26,d=67108863&u,f=Math.min(c,t.length-1),h=Math.max(0,c-e.length+1);h<=f;h++){var p=c-h|0;l+=(s=(i=0|e.words[p])*(o=0|t.words[h])+d)/67108864|0,d=67108863&s}r.words[c]=0|d,u=0|l}return 0!==u?r.words[c]=0|u:r.length--,r.strip()}o.prototype.toString=function(e,t){var r;if(t=0|t||1,16===(e=e||10)||"hex"===e){r="";for(var i=0,o=0,s=0;s<this.length;s++){var a=this.words[s],u=(16777215&(a<<i|o)).toString(16);r=0!==(o=a>>>24-i&16777215)||s!==this.length-1?c[6-u.length]+u+r:u+r,(i+=2)>=26&&(i-=26,s--)}for(0!==o&&(r=o.toString(16)+r);r.length%t!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(e===(0|e)&&e>=2&&e<=36){var f=l[e],h=d[e];r="";var p=this.clone();for(p.negative=0;!p.isZero();){var m=p.modn(h).toString(e);r=(p=p.idivn(h)).isZero()?m+r:c[f-m.length]+m+r}for(this.isZero()&&(r="0"+r);r.length%t!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}n(!1,"Base should be between 2 and 36")},o.prototype.toNumber=function(){var e=this.words[0];return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},o.prototype.toJSON=function(){return this.toString(16)},o.prototype.toBuffer=function(e,t){return n(void 0!==s),this.toArrayLike(s,e,t)},o.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)},o.prototype.toArrayLike=function(e,t,r){var i=this.byteLength(),o=r||Math.max(1,i);n(i<=o,"byte array longer than desired length"),n(o>0,"Requested array length <= 0"),this.strip();var s,a,u="le"===t,c=new e(o),l=this.clone();if(u){for(a=0;!l.isZero();a++)s=l.andln(255),l.iushrn(8),c[a]=s;for(;a<o;a++)c[a]=0}else{for(a=0;a<o-i;a++)c[a]=0;for(a=0;!l.isZero();a++)s=l.andln(255),l.iushrn(8),c[o-a-1]=s}return c},Math.clz32?o.prototype._countBits=function(e){return 32-Math.clz32(e)}:o.prototype._countBits=function(e){var t=e,r=0;return t>=4096&&(r+=13,t>>>=13),t>=64&&(r+=7,t>>>=7),t>=8&&(r+=4,t>>>=4),t>=2&&(r+=2,t>>>=2),r+t},o.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,r=0;return 0==(8191&t)&&(r+=13,t>>>=13),0==(127&t)&&(r+=7,t>>>=7),0==(15&t)&&(r+=4,t>>>=4),0==(3&t)&&(r+=2,t>>>=2),0==(1&t)&&r++,r},o.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},o.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;t<this.length;t++){var r=this._zeroBits(this.words[t]);if(e+=r,26!==r)break}return e},o.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},o.prototype.toTwos=function(e){return 0!==this.negative?this.abs().inotn(e).iaddn(1):this.clone()},o.prototype.fromTwos=function(e){return this.testn(e-1)?this.notn(e).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(e){for(;this.length<e.length;)this.words[this.length++]=0;for(var t=0;t<e.length;t++)this.words[t]=this.words[t]|e.words[t];return this.strip()},o.prototype.ior=function(e){return n(0==(this.negative|e.negative)),this.iuor(e)},o.prototype.or=function(e){return this.length>e.length?this.clone().ior(e):e.clone().ior(this)},o.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},o.prototype.iuand=function(e){var t;t=this.length>e.length?e:this;for(var r=0;r<t.length;r++)this.words[r]=this.words[r]&e.words[r];return this.length=t.length,this.strip()},o.prototype.iand=function(e){return n(0==(this.negative|e.negative)),this.iuand(e)},o.prototype.and=function(e){return this.length>e.length?this.clone().iand(e):e.clone().iand(this)},o.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},o.prototype.iuxor=function(e){var t,r;this.length>e.length?(t=this,r=e):(t=e,r=this);for(var n=0;n<r.length;n++)this.words[n]=t.words[n]^r.words[n];if(this!==t)for(;n<t.length;n++)this.words[n]=t.words[n];return this.length=t.length,this.strip()},o.prototype.ixor=function(e){return n(0==(this.negative|e.negative)),this.iuxor(e)},o.prototype.xor=function(e){return this.length>e.length?this.clone().ixor(e):e.clone().ixor(this)},o.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},o.prototype.inotn=function(e){n("number"==typeof e&&e>=0);var t=0|Math.ceil(e/26),r=e%26;this._expand(t),r>0&&t--;for(var i=0;i<t;i++)this.words[i]=67108863&~this.words[i];return r>0&&(this.words[i]=~this.words[i]&67108863>>26-r),this.strip()},o.prototype.notn=function(e){return this.clone().inotn(e)},o.prototype.setn=function(e,t){n("number"==typeof e&&e>=0);var r=e/26|0,i=e%26;return this._expand(r+1),this.words[r]=t?this.words[r]|1<<i:this.words[r]&~(1<<i),this.strip()},o.prototype.iadd=function(e){var t,r,n;if(0!==this.negative&&0===e.negative)return this.negative=0,t=this.isub(e),this.negative^=1,this._normSign();if(0===this.negative&&0!==e.negative)return e.negative=0,t=this.isub(e),e.negative=1,t._normSign();this.length>e.length?(r=this,n=e):(r=e,n=this);for(var i=0,o=0;o<n.length;o++)t=(0|r.words[o])+(0|n.words[o])+i,this.words[o]=67108863&t,i=t>>>26;for(;0!==i&&o<r.length;o++)t=(0|r.words[o])+i,this.words[o]=67108863&t,i=t>>>26;if(this.length=r.length,0!==i)this.words[this.length]=i,this.length++;else if(r!==this)for(;o<r.length;o++)this.words[o]=r.words[o];return this},o.prototype.add=function(e){var t;return 0!==e.negative&&0===this.negative?(e.negative=0,t=this.sub(e),e.negative^=1,t):0===e.negative&&0!==this.negative?(this.negative=0,t=e.sub(this),this.negative=1,t):this.length>e.length?this.clone().iadd(e):e.clone().iadd(this)},o.prototype.isub=function(e){if(0!==e.negative){e.negative=0;var t=this.iadd(e);return e.negative=1,t._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var r,n,i=this.cmp(e);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(r=this,n=e):(r=e,n=this);for(var o=0,s=0;s<n.length;s++)o=(t=(0|r.words[s])-(0|n.words[s])+o)>>26,this.words[s]=67108863&t;for(;0!==o&&s<r.length;s++)o=(t=(0|r.words[s])+o)>>26,this.words[s]=67108863&t;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(e){return this.clone().isub(e)};var h=function(e,t,r){var n,i,o,s=e.words,a=t.words,u=r.words,c=0,l=0|s[0],d=8191&l,f=l>>>13,h=0|s[1],p=8191&h,m=h>>>13,g=0|s[2],y=8191&g,v=g>>>13,b=0|s[3],w=8191&b,M=b>>>13,_=0|s[4],O=8191&_,E=_>>>13,T=0|s[5],j=8191&T,k=T>>>13,x=0|s[6],S=8191&x,C=x>>>13,A=0|s[7],I=8191&A,D=A>>>13,P=0|s[8],N=8191&P,B=P>>>13,R=0|s[9],L=8191&R,$=R>>>13,U=0|a[0],F=8191&U,z=U>>>13,H=0|a[1],W=8191&H,V=H>>>13,Z=0|a[2],q=8191&Z,G=Z>>>13,K=0|a[3],X=8191&K,J=K>>>13,Y=0|a[4],Q=8191&Y,ee=Y>>>13,te=0|a[5],re=8191&te,ne=te>>>13,ie=0|a[6],oe=8191&ie,se=ie>>>13,ae=0|a[7],ue=8191&ae,ce=ae>>>13,le=0|a[8],de=8191&le,fe=le>>>13,he=0|a[9],pe=8191&he,me=he>>>13;r.negative=e.negative^t.negative,r.length=19;var ge=(c+(n=Math.imul(d,F))|0)+((8191&(i=(i=Math.imul(d,z))+Math.imul(f,F)|0))<<13)|0;c=((o=Math.imul(f,z))+(i>>>13)|0)+(ge>>>26)|0,ge&=67108863,n=Math.imul(p,F),i=(i=Math.imul(p,z))+Math.imul(m,F)|0,o=Math.imul(m,z);var ye=(c+(n=n+Math.imul(d,W)|0)|0)+((8191&(i=(i=i+Math.imul(d,V)|0)+Math.imul(f,W)|0))<<13)|0;c=((o=o+Math.imul(f,V)|0)+(i>>>13)|0)+(ye>>>26)|0,ye&=67108863,n=Math.imul(y,F),i=(i=Math.imul(y,z))+Math.imul(v,F)|0,o=Math.imul(v,z),n=n+Math.imul(p,W)|0,i=(i=i+Math.imul(p,V)|0)+Math.imul(m,W)|0,o=o+Math.imul(m,V)|0;var ve=(c+(n=n+Math.imul(d,q)|0)|0)+((8191&(i=(i=i+Math.imul(d,G)|0)+Math.imul(f,q)|0))<<13)|0;c=((o=o+Math.imul(f,G)|0)+(i>>>13)|0)+(ve>>>26)|0,ve&=67108863,n=Math.imul(w,F),i=(i=Math.imul(w,z))+Math.imul(M,F)|0,o=Math.imul(M,z),n=n+Math.imul(y,W)|0,i=(i=i+Math.imul(y,V)|0)+Math.imul(v,W)|0,o=o+Math.imul(v,V)|0,n=n+Math.imul(p,q)|0,i=(i=i+Math.imul(p,G)|0)+Math.imul(m,q)|0,o=o+Math.imul(m,G)|0;var be=(c+(n=n+Math.imul(d,X)|0)|0)+((8191&(i=(i=i+Math.imul(d,J)|0)+Math.imul(f,X)|0))<<13)|0;c=((o=o+Math.imul(f,J)|0)+(i>>>13)|0)+(be>>>26)|0,be&=67108863,n=Math.imul(O,F),i=(i=Math.imul(O,z))+Math.imul(E,F)|0,o=Math.imul(E,z),n=n+Math.imul(w,W)|0,i=(i=i+Math.imul(w,V)|0)+Math.imul(M,W)|0,o=o+Math.imul(M,V)|0,n=n+Math.imul(y,q)|0,i=(i=i+Math.imul(y,G)|0)+Math.imul(v,q)|0,o=o+Math.imul(v,G)|0,n=n+Math.imul(p,X)|0,i=(i=i+Math.imul(p,J)|0)+Math.imul(m,X)|0,o=o+Math.imul(m,J)|0;var we=(c+(n=n+Math.imul(d,Q)|0)|0)+((8191&(i=(i=i+Math.imul(d,ee)|0)+Math.imul(f,Q)|0))<<13)|0;c=((o=o+Math.imul(f,ee)|0)+(i>>>13)|0)+(we>>>26)|0,we&=67108863,n=Math.imul(j,F),i=(i=Math.imul(j,z))+Math.imul(k,F)|0,o=Math.imul(k,z),n=n+Math.imul(O,W)|0,i=(i=i+Math.imul(O,V)|0)+Math.imul(E,W)|0,o=o+Math.imul(E,V)|0,n=n+Math.imul(w,q)|0,i=(i=i+Math.imul(w,G)|0)+Math.imul(M,q)|0,o=o+Math.imul(M,G)|0,n=n+Math.imul(y,X)|0,i=(i=i+Math.imul(y,J)|0)+Math.imul(v,X)|0,o=o+Math.imul(v,J)|0,n=n+Math.imul(p,Q)|0,i=(i=i+Math.imul(p,ee)|0)+Math.imul(m,Q)|0,o=o+Math.imul(m,ee)|0;var Me=(c+(n=n+Math.imul(d,re)|0)|0)+((8191&(i=(i=i+Math.imul(d,ne)|0)+Math.imul(f,re)|0))<<13)|0;c=((o=o+Math.imul(f,ne)|0)+(i>>>13)|0)+(Me>>>26)|0,Me&=67108863,n=Math.imul(S,F),i=(i=Math.imul(S,z))+Math.imul(C,F)|0,o=Math.imul(C,z),n=n+Math.imul(j,W)|0,i=(i=i+Math.imul(j,V)|0)+Math.imul(k,W)|0,o=o+Math.imul(k,V)|0,n=n+Math.imul(O,q)|0,i=(i=i+Math.imul(O,G)|0)+Math.imul(E,q)|0,o=o+Math.imul(E,G)|0,n=n+Math.imul(w,X)|0,i=(i=i+Math.imul(w,J)|0)+Math.imul(M,X)|0,o=o+Math.imul(M,J)|0,n=n+Math.imul(y,Q)|0,i=(i=i+Math.imul(y,ee)|0)+Math.imul(v,Q)|0,o=o+Math.imul(v,ee)|0,n=n+Math.imul(p,re)|0,i=(i=i+Math.imul(p,ne)|0)+Math.imul(m,re)|0,o=o+Math.imul(m,ne)|0;var _e=(c+(n=n+Math.imul(d,oe)|0)|0)+((8191&(i=(i=i+Math.imul(d,se)|0)+Math.imul(f,oe)|0))<<13)|0;c=((o=o+Math.imul(f,se)|0)+(i>>>13)|0)+(_e>>>26)|0,_e&=67108863,n=Math.imul(I,F),i=(i=Math.imul(I,z))+Math.imul(D,F)|0,o=Math.imul(D,z),n=n+Math.imul(S,W)|0,i=(i=i+Math.imul(S,V)|0)+Math.imul(C,W)|0,o=o+Math.imul(C,V)|0,n=n+Math.imul(j,q)|0,i=(i=i+Math.imul(j,G)|0)+Math.imul(k,q)|0,o=o+Math.imul(k,G)|0,n=n+Math.imul(O,X)|0,i=(i=i+Math.imul(O,J)|0)+Math.imul(E,X)|0,o=o+Math.imul(E,J)|0,n=n+Math.imul(w,Q)|0,i=(i=i+Math.imul(w,ee)|0)+Math.imul(M,Q)|0,o=o+Math.imul(M,ee)|0,n=n+Math.imul(y,re)|0,i=(i=i+Math.imul(y,ne)|0)+Math.imul(v,re)|0,o=o+Math.imul(v,ne)|0,n=n+Math.imul(p,oe)|0,i=(i=i+Math.imul(p,se)|0)+Math.imul(m,oe)|0,o=o+Math.imul(m,se)|0;var Oe=(c+(n=n+Math.imul(d,ue)|0)|0)+((8191&(i=(i=i+Math.imul(d,ce)|0)+Math.imul(f,ue)|0))<<13)|0;c=((o=o+Math.imul(f,ce)|0)+(i>>>13)|0)+(Oe>>>26)|0,Oe&=67108863,n=Math.imul(N,F),i=(i=Math.imul(N,z))+Math.imul(B,F)|0,o=Math.imul(B,z),n=n+Math.imul(I,W)|0,i=(i=i+Math.imul(I,V)|0)+Math.imul(D,W)|0,o=o+Math.imul(D,V)|0,n=n+Math.imul(S,q)|0,i=(i=i+Math.imul(S,G)|0)+Math.imul(C,q)|0,o=o+Math.imul(C,G)|0,n=n+Math.imul(j,X)|0,i=(i=i+Math.imul(j,J)|0)+Math.imul(k,X)|0,o=o+Math.imul(k,J)|0,n=n+Math.imul(O,Q)|0,i=(i=i+Math.imul(O,ee)|0)+Math.imul(E,Q)|0,o=o+Math.imul(E,ee)|0,n=n+Math.imul(w,re)|0,i=(i=i+Math.imul(w,ne)|0)+Math.imul(M,re)|0,o=o+Math.imul(M,ne)|0,n=n+Math.imul(y,oe)|0,i=(i=i+Math.imul(y,se)|0)+Math.imul(v,oe)|0,o=o+Math.imul(v,se)|0,n=n+Math.imul(p,ue)|0,i=(i=i+Math.imul(p,ce)|0)+Math.imul(m,ue)|0,o=o+Math.imul(m,ce)|0;var Ee=(c+(n=n+Math.imul(d,de)|0)|0)+((8191&(i=(i=i+Math.imul(d,fe)|0)+Math.imul(f,de)|0))<<13)|0;c=((o=o+Math.imul(f,fe)|0)+(i>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,n=Math.imul(L,F),i=(i=Math.imul(L,z))+Math.imul($,F)|0,o=Math.imul($,z),n=n+Math.imul(N,W)|0,i=(i=i+Math.imul(N,V)|0)+Math.imul(B,W)|0,o=o+Math.imul(B,V)|0,n=n+Math.imul(I,q)|0,i=(i=i+Math.imul(I,G)|0)+Math.imul(D,q)|0,o=o+Math.imul(D,G)|0,n=n+Math.imul(S,X)|0,i=(i=i+Math.imul(S,J)|0)+Math.imul(C,X)|0,o=o+Math.imul(C,J)|0,n=n+Math.imul(j,Q)|0,i=(i=i+Math.imul(j,ee)|0)+Math.imul(k,Q)|0,o=o+Math.imul(k,ee)|0,n=n+Math.imul(O,re)|0,i=(i=i+Math.imul(O,ne)|0)+Math.imul(E,re)|0,o=o+Math.imul(E,ne)|0,n=n+Math.imul(w,oe)|0,i=(i=i+Math.imul(w,se)|0)+Math.imul(M,oe)|0,o=o+Math.imul(M,se)|0,n=n+Math.imul(y,ue)|0,i=(i=i+Math.imul(y,ce)|0)+Math.imul(v,ue)|0,o=o+Math.imul(v,ce)|0,n=n+Math.imul(p,de)|0,i=(i=i+Math.imul(p,fe)|0)+Math.imul(m,de)|0,o=o+Math.imul(m,fe)|0;var Te=(c+(n=n+Math.imul(d,pe)|0)|0)+((8191&(i=(i=i+Math.imul(d,me)|0)+Math.imul(f,pe)|0))<<13)|0;c=((o=o+Math.imul(f,me)|0)+(i>>>13)|0)+(Te>>>26)|0,Te&=67108863,n=Math.imul(L,W),i=(i=Math.imul(L,V))+Math.imul($,W)|0,o=Math.imul($,V),n=n+Math.imul(N,q)|0,i=(i=i+Math.imul(N,G)|0)+Math.imul(B,q)|0,o=o+Math.imul(B,G)|0,n=n+Math.imul(I,X)|0,i=(i=i+Math.imul(I,J)|0)+Math.imul(D,X)|0,o=o+Math.imul(D,J)|0,n=n+Math.imul(S,Q)|0,i=(i=i+Math.imul(S,ee)|0)+Math.imul(C,Q)|0,o=o+Math.imul(C,ee)|0,n=n+Math.imul(j,re)|0,i=(i=i+Math.imul(j,ne)|0)+Math.imul(k,re)|0,o=o+Math.imul(k,ne)|0,n=n+Math.imul(O,oe)|0,i=(i=i+Math.imul(O,se)|0)+Math.imul(E,oe)|0,o=o+Math.imul(E,se)|0,n=n+Math.imul(w,ue)|0,i=(i=i+Math.imul(w,ce)|0)+Math.imul(M,ue)|0,o=o+Math.imul(M,ce)|0,n=n+Math.imul(y,de)|0,i=(i=i+Math.imul(y,fe)|0)+Math.imul(v,de)|0,o=o+Math.imul(v,fe)|0;var je=(c+(n=n+Math.imul(p,pe)|0)|0)+((8191&(i=(i=i+Math.imul(p,me)|0)+Math.imul(m,pe)|0))<<13)|0;c=((o=o+Math.imul(m,me)|0)+(i>>>13)|0)+(je>>>26)|0,je&=67108863,n=Math.imul(L,q),i=(i=Math.imul(L,G))+Math.imul($,q)|0,o=Math.imul($,G),n=n+Math.imul(N,X)|0,i=(i=i+Math.imul(N,J)|0)+Math.imul(B,X)|0,o=o+Math.imul(B,J)|0,n=n+Math.imul(I,Q)|0,i=(i=i+Math.imul(I,ee)|0)+Math.imul(D,Q)|0,o=o+Math.imul(D,ee)|0,n=n+Math.imul(S,re)|0,i=(i=i+Math.imul(S,ne)|0)+Math.imul(C,re)|0,o=o+Math.imul(C,ne)|0,n=n+Math.imul(j,oe)|0,i=(i=i+Math.imul(j,se)|0)+Math.imul(k,oe)|0,o=o+Math.imul(k,se)|0,n=n+Math.imul(O,ue)|0,i=(i=i+Math.imul(O,ce)|0)+Math.imul(E,ue)|0,o=o+Math.imul(E,ce)|0,n=n+Math.imul(w,de)|0,i=(i=i+Math.imul(w,fe)|0)+Math.imul(M,de)|0,o=o+Math.imul(M,fe)|0;var ke=(c+(n=n+Math.imul(y,pe)|0)|0)+((8191&(i=(i=i+Math.imul(y,me)|0)+Math.imul(v,pe)|0))<<13)|0;c=((o=o+Math.imul(v,me)|0)+(i>>>13)|0)+(ke>>>26)|0,ke&=67108863,n=Math.imul(L,X),i=(i=Math.imul(L,J))+Math.imul($,X)|0,o=Math.imul($,J),n=n+Math.imul(N,Q)|0,i=(i=i+Math.imul(N,ee)|0)+Math.imul(B,Q)|0,o=o+Math.imul(B,ee)|0,n=n+Math.imul(I,re)|0,i=(i=i+Math.imul(I,ne)|0)+Math.imul(D,re)|0,o=o+Math.imul(D,ne)|0,n=n+Math.imul(S,oe)|0,i=(i=i+Math.imul(S,se)|0)+Math.imul(C,oe)|0,o=o+Math.imul(C,se)|0,n=n+Math.imul(j,ue)|0,i=(i=i+Math.imul(j,ce)|0)+Math.imul(k,ue)|0,o=o+Math.imul(k,ce)|0,n=n+Math.imul(O,de)|0,i=(i=i+Math.imul(O,fe)|0)+Math.imul(E,de)|0,o=o+Math.imul(E,fe)|0;var xe=(c+(n=n+Math.imul(w,pe)|0)|0)+((8191&(i=(i=i+Math.imul(w,me)|0)+Math.imul(M,pe)|0))<<13)|0;c=((o=o+Math.imul(M,me)|0)+(i>>>13)|0)+(xe>>>26)|0,xe&=67108863,n=Math.imul(L,Q),i=(i=Math.imul(L,ee))+Math.imul($,Q)|0,o=Math.imul($,ee),n=n+Math.imul(N,re)|0,i=(i=i+Math.imul(N,ne)|0)+Math.imul(B,re)|0,o=o+Math.imul(B,ne)|0,n=n+Math.imul(I,oe)|0,i=(i=i+Math.imul(I,se)|0)+Math.imul(D,oe)|0,o=o+Math.imul(D,se)|0,n=n+Math.imul(S,ue)|0,i=(i=i+Math.imul(S,ce)|0)+Math.imul(C,ue)|0,o=o+Math.imul(C,ce)|0,n=n+Math.imul(j,de)|0,i=(i=i+Math.imul(j,fe)|0)+Math.imul(k,de)|0,o=o+Math.imul(k,fe)|0;var Se=(c+(n=n+Math.imul(O,pe)|0)|0)+((8191&(i=(i=i+Math.imul(O,me)|0)+Math.imul(E,pe)|0))<<13)|0;c=((o=o+Math.imul(E,me)|0)+(i>>>13)|0)+(Se>>>26)|0,Se&=67108863,n=Math.imul(L,re),i=(i=Math.imul(L,ne))+Math.imul($,re)|0,o=Math.imul($,ne),n=n+Math.imul(N,oe)|0,i=(i=i+Math.imul(N,se)|0)+Math.imul(B,oe)|0,o=o+Math.imul(B,se)|0,n=n+Math.imul(I,ue)|0,i=(i=i+Math.imul(I,ce)|0)+Math.imul(D,ue)|0,o=o+Math.imul(D,ce)|0,n=n+Math.imul(S,de)|0,i=(i=i+Math.imul(S,fe)|0)+Math.imul(C,de)|0,o=o+Math.imul(C,fe)|0;var Ce=(c+(n=n+Math.imul(j,pe)|0)|0)+((8191&(i=(i=i+Math.imul(j,me)|0)+Math.imul(k,pe)|0))<<13)|0;c=((o=o+Math.imul(k,me)|0)+(i>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,n=Math.imul(L,oe),i=(i=Math.imul(L,se))+Math.imul($,oe)|0,o=Math.imul($,se),n=n+Math.imul(N,ue)|0,i=(i=i+Math.imul(N,ce)|0)+Math.imul(B,ue)|0,o=o+Math.imul(B,ce)|0,n=n+Math.imul(I,de)|0,i=(i=i+Math.imul(I,fe)|0)+Math.imul(D,de)|0,o=o+Math.imul(D,fe)|0;var Ae=(c+(n=n+Math.imul(S,pe)|0)|0)+((8191&(i=(i=i+Math.imul(S,me)|0)+Math.imul(C,pe)|0))<<13)|0;c=((o=o+Math.imul(C,me)|0)+(i>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,n=Math.imul(L,ue),i=(i=Math.imul(L,ce))+Math.imul($,ue)|0,o=Math.imul($,ce),n=n+Math.imul(N,de)|0,i=(i=i+Math.imul(N,fe)|0)+Math.imul(B,de)|0,o=o+Math.imul(B,fe)|0;var Ie=(c+(n=n+Math.imul(I,pe)|0)|0)+((8191&(i=(i=i+Math.imul(I,me)|0)+Math.imul(D,pe)|0))<<13)|0;c=((o=o+Math.imul(D,me)|0)+(i>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,n=Math.imul(L,de),i=(i=Math.imul(L,fe))+Math.imul($,de)|0,o=Math.imul($,fe);var De=(c+(n=n+Math.imul(N,pe)|0)|0)+((8191&(i=(i=i+Math.imul(N,me)|0)+Math.imul(B,pe)|0))<<13)|0;c=((o=o+Math.imul(B,me)|0)+(i>>>13)|0)+(De>>>26)|0,De&=67108863;var Pe=(c+(n=Math.imul(L,pe))|0)+((8191&(i=(i=Math.imul(L,me))+Math.imul($,pe)|0))<<13)|0;return c=((o=Math.imul($,me))+(i>>>13)|0)+(Pe>>>26)|0,Pe&=67108863,u[0]=ge,u[1]=ye,u[2]=ve,u[3]=be,u[4]=we,u[5]=Me,u[6]=_e,u[7]=Oe,u[8]=Ee,u[9]=Te,u[10]=je,u[11]=ke,u[12]=xe,u[13]=Se,u[14]=Ce,u[15]=Ae,u[16]=Ie,u[17]=De,u[18]=Pe,0!==c&&(u[19]=c,r.length++),r};function p(e,t,r){return(new m).mulp(e,t,r)}function m(e,t){this.x=e,this.y=t}Math.imul||(h=f),o.prototype.mulTo=function(e,t){var r,n=this.length+e.length;return r=10===this.length&&10===e.length?h(this,e,t):n<63?f(this,e,t):n<1024?function(e,t,r){r.negative=t.negative^e.negative,r.length=e.length+t.length;for(var n=0,i=0,o=0;o<r.length-1;o++){var s=i;i=0;for(var a=67108863&n,u=Math.min(o,t.length-1),c=Math.max(0,o-e.length+1);c<=u;c++){var l=o-c,d=(0|e.words[l])*(0|t.words[c]),f=67108863&d;a=67108863&(f=f+a|0),i+=(s=(s=s+(d/67108864|0)|0)+(f>>>26)|0)>>>26,s&=67108863}r.words[o]=a,n=s,s=i}return 0!==n?r.words[o]=n:r.length--,r.strip()}(this,e,t):p(this,e,t),r},m.prototype.makeRBT=function(e){for(var t=new Array(e),r=o.prototype._countBits(e)-1,n=0;n<e;n++)t[n]=this.revBin(n,r,e);return t},m.prototype.revBin=function(e,t,r){if(0===e||e===r-1)return e;for(var n=0,i=0;i<t;i++)n|=(1&e)<<t-i-1,e>>=1;return n},m.prototype.permute=function(e,t,r,n,i,o){for(var s=0;s<o;s++)n[s]=t[e[s]],i[s]=r[e[s]]},m.prototype.transform=function(e,t,r,n,i,o){this.permute(o,e,t,r,n,i);for(var s=1;s<i;s<<=1)for(var a=s<<1,u=Math.cos(2*Math.PI/a),c=Math.sin(2*Math.PI/a),l=0;l<i;l+=a)for(var d=u,f=c,h=0;h<s;h++){var p=r[l+h],m=n[l+h],g=r[l+h+s],y=n[l+h+s],v=d*g-f*y;y=d*y+f*g,g=v,r[l+h]=p+g,n[l+h]=m+y,r[l+h+s]=p-g,n[l+h+s]=m-y,h!==a&&(v=u*d-c*f,f=u*f+c*d,d=v)}},m.prototype.guessLen13b=function(e,t){var r=1|Math.max(t,e),n=1&r,i=0;for(r=r/2|0;r;r>>>=1)i++;return 1<<i+1+n},m.prototype.conjugate=function(e,t,r){if(!(r<=1))for(var n=0;n<r/2;n++){var i=e[n];e[n]=e[r-n-1],e[r-n-1]=i,i=t[n],t[n]=-t[r-n-1],t[r-n-1]=-i}},m.prototype.normalize13b=function(e,t){for(var r=0,n=0;n<t/2;n++){var i=8192*Math.round(e[2*n+1]/t)+Math.round(e[2*n]/t)+r;e[n]=67108863&i,r=i<67108864?0:i/67108864|0}return e},m.prototype.convert13b=function(e,t,r,i){for(var o=0,s=0;s<t;s++)o+=0|e[s],r[2*s]=8191&o,o>>>=13,r[2*s+1]=8191&o,o>>>=13;for(s=2*t;s<i;++s)r[s]=0;n(0===o),n(0==(-8192&o))},m.prototype.stub=function(e){for(var t=new Array(e),r=0;r<e;r++)t[r]=0;return t},m.prototype.mulp=function(e,t,r){var n=2*this.guessLen13b(e.length,t.length),i=this.makeRBT(n),o=this.stub(n),s=new Array(n),a=new Array(n),u=new Array(n),c=new Array(n),l=new Array(n),d=new Array(n),f=r.words;f.length=n,this.convert13b(e.words,e.length,s,n),this.convert13b(t.words,t.length,c,n),this.transform(s,o,a,u,n,i),this.transform(c,o,l,d,n,i);for(var h=0;h<n;h++){var p=a[h]*l[h]-u[h]*d[h];u[h]=a[h]*d[h]+u[h]*l[h],a[h]=p}return this.conjugate(a,u,n),this.transform(a,u,f,o,n,i),this.conjugate(f,o,n),this.normalize13b(f,n),r.negative=e.negative^t.negative,r.length=e.length+t.length,r.strip()},o.prototype.mul=function(e){var t=new o(null);return t.words=new Array(this.length+e.length),this.mulTo(e,t)},o.prototype.mulf=function(e){var t=new o(null);return t.words=new Array(this.length+e.length),p(this,e,t)},o.prototype.imul=function(e){return this.clone().mulTo(e,this)},o.prototype.imuln=function(e){n("number"==typeof e),n(e<67108864);for(var t=0,r=0;r<this.length;r++){var i=(0|this.words[r])*e,o=(67108863&i)+(67108863&t);t>>=26,t+=i/67108864|0,t+=o>>>26,this.words[r]=67108863&o}return 0!==t&&(this.words[r]=t,this.length++),this},o.prototype.muln=function(e){return this.clone().imuln(e)},o.prototype.sqr=function(){return this.mul(this)},o.prototype.isqr=function(){return this.imul(this.clone())},o.prototype.pow=function(e){var t=function(e){for(var t=new Array(e.bitLength()),r=0;r<t.length;r++){var n=r/26|0,i=r%26;t[r]=(e.words[n]&1<<i)>>>i}return t}(e);if(0===t.length)return new o(1);for(var r=this,n=0;n<t.length&&0===t[n];n++,r=r.sqr());if(++n<t.length)for(var i=r.sqr();n<t.length;n++,i=i.sqr())0!==t[n]&&(r=r.mul(i));return r},o.prototype.iushln=function(e){n("number"==typeof e&&e>=0);var t,r=e%26,i=(e-r)/26,o=67108863>>>26-r<<26-r;if(0!==r){var s=0;for(t=0;t<this.length;t++){var a=this.words[t]&o,u=(0|this.words[t])-a<<r;this.words[t]=u|s,s=a>>>26-r}s&&(this.words[t]=s,this.length++)}if(0!==i){for(t=this.length-1;t>=0;t--)this.words[t+i]=this.words[t];for(t=0;t<i;t++)this.words[t]=0;this.length+=i}return this.strip()},o.prototype.ishln=function(e){return n(0===this.negative),this.iushln(e)},o.prototype.iushrn=function(e,t,r){var i;n("number"==typeof e&&e>=0),i=t?(t-t%26)/26:0;var o=e%26,s=Math.min((e-o)/26,this.length),a=67108863^67108863>>>o<<o,u=r;if(i-=s,i=Math.max(0,i),u){for(var c=0;c<s;c++)u.words[c]=this.words[c];u.length=s}if(0===s);else if(this.length>s)for(this.length-=s,c=0;c<this.length;c++)this.words[c]=this.words[c+s];else this.words[0]=0,this.length=1;var l=0;for(c=this.length-1;c>=0&&(0!==l||c>=i);c--){var d=0|this.words[c];this.words[c]=l<<26-o|d>>>o,l=d&a}return u&&0!==l&&(u.words[u.length++]=l),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},o.prototype.ishrn=function(e,t,r){return n(0===this.negative),this.iushrn(e,t,r)},o.prototype.shln=function(e){return this.clone().ishln(e)},o.prototype.ushln=function(e){return this.clone().iushln(e)},o.prototype.shrn=function(e){return this.clone().ishrn(e)},o.prototype.ushrn=function(e){return this.clone().iushrn(e)},o.prototype.testn=function(e){n("number"==typeof e&&e>=0);var t=e%26,r=(e-t)/26,i=1<<t;return!(this.length<=r)&&!!(this.words[r]&i)},o.prototype.imaskn=function(e){n("number"==typeof e&&e>=0);var t=e%26,r=(e-t)/26;if(n(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==t&&r++,this.length=Math.min(r,this.length),0!==t){var i=67108863^67108863>>>t<<t;this.words[this.length-1]&=i}return this.strip()},o.prototype.maskn=function(e){return this.clone().imaskn(e)},o.prototype.iaddn=function(e){return n("number"==typeof e),n(e<67108864),e<0?this.isubn(-e):0!==this.negative?1===this.length&&(0|this.words[0])<e?(this.words[0]=e-(0|this.words[0]),this.negative=0,this):(this.negative=0,this.isubn(e),this.negative=1,this):this._iaddn(e)},o.prototype._iaddn=function(e){this.words[0]+=e;for(var t=0;t<this.length&&this.words[t]>=67108864;t++)this.words[t]-=67108864,t===this.length-1?this.words[t+1]=1:this.words[t+1]++;return this.length=Math.max(this.length,t+1),this},o.prototype.isubn=function(e){if(n("number"==typeof e),n(e<67108864),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var t=0;t<this.length&&this.words[t]<0;t++)this.words[t]+=67108864,this.words[t+1]-=1;return this.strip()},o.prototype.addn=function(e){return this.clone().iaddn(e)},o.prototype.subn=function(e){return this.clone().isubn(e)},o.prototype.iabs=function(){return this.negative=0,this},o.prototype.abs=function(){return this.clone().iabs()},o.prototype._ishlnsubmul=function(e,t,r){var i,o,s=e.length+r;this._expand(s);var a=0;for(i=0;i<e.length;i++){o=(0|this.words[i+r])+a;var u=(0|e.words[i])*t;a=((o-=67108863&u)>>26)-(u/67108864|0),this.words[i+r]=67108863&o}for(;i<this.length-r;i++)a=(o=(0|this.words[i+r])+a)>>26,this.words[i+r]=67108863&o;if(0===a)return this.strip();for(n(-1===a),a=0,i=0;i<this.length;i++)a=(o=-(0|this.words[i])+a)>>26,this.words[i]=67108863&o;return this.negative=1,this.strip()},o.prototype._wordDiv=function(e,t){var r=(this.length,e.length),n=this.clone(),i=e,s=0|i.words[i.length-1];0!==(r=26-this._countBits(s))&&(i=i.ushln(r),n.iushln(r),s=0|i.words[i.length-1]);var a,u=n.length-i.length;if("mod"!==t){(a=new o(null)).length=u+1,a.words=new Array(a.length);for(var c=0;c<a.length;c++)a.words[c]=0}var l=n.clone()._ishlnsubmul(i,1,u);0===l.negative&&(n=l,a&&(a.words[u]=1));for(var d=u-1;d>=0;d--){var f=67108864*(0|n.words[i.length+d])+(0|n.words[i.length+d-1]);for(f=Math.min(f/s|0,67108863),n._ishlnsubmul(i,f,d);0!==n.negative;)f--,n.negative=0,n._ishlnsubmul(i,1,d),n.isZero()||(n.negative^=1);a&&(a.words[d]=f)}return a&&a.strip(),n.strip(),"div"!==t&&0!==r&&n.iushrn(r),{div:a||null,mod:n}},o.prototype.divmod=function(e,t,r){return n(!e.isZero()),this.isZero()?{div:new o(0),mod:new o(0)}:0!==this.negative&&0===e.negative?(a=this.neg().divmod(e,t),"mod"!==t&&(i=a.div.neg()),"div"!==t&&(s=a.mod.neg(),r&&0!==s.negative&&s.iadd(e)),{div:i,mod:s}):0===this.negative&&0!==e.negative?(a=this.divmod(e.neg(),t),"mod"!==t&&(i=a.div.neg()),{div:i,mod:a.mod}):0!=(this.negative&e.negative)?(a=this.neg().divmod(e.neg(),t),"div"!==t&&(s=a.mod.neg(),r&&0!==s.negative&&s.isub(e)),{div:a.div,mod:s}):e.length>this.length||this.cmp(e)<0?{div:new o(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new o(this.modn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new o(this.modn(e.words[0]))}:this._wordDiv(e,t);var i,s,a},o.prototype.div=function(e){return this.divmod(e,"div",!1).div},o.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},o.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},o.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var r=0!==t.div.negative?t.mod.isub(e):t.mod,n=e.ushrn(1),i=e.andln(1),o=r.cmp(n);return o<0||1===i&&0===o?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},o.prototype.modn=function(e){n(e<=67108863);for(var t=(1<<26)%e,r=0,i=this.length-1;i>=0;i--)r=(t*r+(0|this.words[i]))%e;return r},o.prototype.idivn=function(e){n(e<=67108863);for(var t=0,r=this.length-1;r>=0;r--){var i=(0|this.words[r])+67108864*t;this.words[r]=i/e|0,t=i%e}return this.strip()},o.prototype.divn=function(e){return this.clone().idivn(e)},o.prototype.egcd=function(e){n(0===e.negative),n(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var i=new o(1),s=new o(0),a=new o(0),u=new o(1),c=0;t.isEven()&&r.isEven();)t.iushrn(1),r.iushrn(1),++c;for(var l=r.clone(),d=t.clone();!t.isZero();){for(var f=0,h=1;0==(t.words[0]&h)&&f<26;++f,h<<=1);if(f>0)for(t.iushrn(f);f-- >0;)(i.isOdd()||s.isOdd())&&(i.iadd(l),s.isub(d)),i.iushrn(1),s.iushrn(1);for(var p=0,m=1;0==(r.words[0]&m)&&p<26;++p,m<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(a.isOdd()||u.isOdd())&&(a.iadd(l),u.isub(d)),a.iushrn(1),u.iushrn(1);t.cmp(r)>=0?(t.isub(r),i.isub(a),s.isub(u)):(r.isub(t),a.isub(i),u.isub(s))}return{a:a,b:u,gcd:r.iushln(c)}},o.prototype._invmp=function(e){n(0===e.negative),n(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var i,s=new o(1),a=new o(0),u=r.clone();t.cmpn(1)>0&&r.cmpn(1)>0;){for(var c=0,l=1;0==(t.words[0]&l)&&c<26;++c,l<<=1);if(c>0)for(t.iushrn(c);c-- >0;)s.isOdd()&&s.iadd(u),s.iushrn(1);for(var d=0,f=1;0==(r.words[0]&f)&&d<26;++d,f<<=1);if(d>0)for(r.iushrn(d);d-- >0;)a.isOdd()&&a.iadd(u),a.iushrn(1);t.cmp(r)>=0?(t.isub(r),s.isub(a)):(r.isub(t),a.isub(s))}return(i=0===t.cmpn(1)?s:a).cmpn(0)<0&&i.iadd(e),i},o.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone(),r=e.clone();t.negative=0,r.negative=0;for(var n=0;t.isEven()&&r.isEven();n++)t.iushrn(1),r.iushrn(1);for(;;){for(;t.isEven();)t.iushrn(1);for(;r.isEven();)r.iushrn(1);var i=t.cmp(r);if(i<0){var o=t;t=r,r=o}else if(0===i||0===r.cmpn(1))break;t.isub(r)}return r.iushln(n)},o.prototype.invm=function(e){return this.egcd(e).a.umod(e)},o.prototype.isEven=function(){return 0==(1&this.words[0])},o.prototype.isOdd=function(){return 1==(1&this.words[0])},o.prototype.andln=function(e){return this.words[0]&e},o.prototype.bincn=function(e){n("number"==typeof e);var t=e%26,r=(e-t)/26,i=1<<t;if(this.length<=r)return this._expand(r+1),this.words[r]|=i,this;for(var o=i,s=r;0!==o&&s<this.length;s++){var a=0|this.words[s];o=(a+=o)>>>26,a&=67108863,this.words[s]=a}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(e){var t,r=e<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this.strip(),this.length>1)t=1;else{r&&(e=-e),n(e<=67108863,"Number is too big");var i=0|this.words[0];t=i===e?0:i<e?-1:1}return 0!==this.negative?0|-t:t},o.prototype.cmp=function(e){if(0!==this.negative&&0===e.negative)return-1;if(0===this.negative&&0!==e.negative)return 1;var t=this.ucmp(e);return 0!==this.negative?0|-t:t},o.prototype.ucmp=function(e){if(this.length>e.length)return 1;if(this.length<e.length)return-1;for(var t=0,r=this.length-1;r>=0;r--){var n=0|this.words[r],i=0|e.words[r];if(n!==i){n<i?t=-1:n>i&&(t=1);break}}return t},o.prototype.gtn=function(e){return 1===this.cmpn(e)},o.prototype.gt=function(e){return 1===this.cmp(e)},o.prototype.gten=function(e){return this.cmpn(e)>=0},o.prototype.gte=function(e){return this.cmp(e)>=0},o.prototype.ltn=function(e){return-1===this.cmpn(e)},o.prototype.lt=function(e){return-1===this.cmp(e)},o.prototype.lten=function(e){return this.cmpn(e)<=0},o.prototype.lte=function(e){return this.cmp(e)<=0},o.prototype.eqn=function(e){return 0===this.cmpn(e)},o.prototype.eq=function(e){return 0===this.cmp(e)},o.red=function(e){return new _(e)},o.prototype.toRed=function(e){return n(!this.red,"Already a number in reduction context"),n(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},o.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},o.prototype._forceRed=function(e){return this.red=e,this},o.prototype.forceRed=function(e){return n(!this.red,"Already a number in reduction context"),this._forceRed(e)},o.prototype.redAdd=function(e){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},o.prototype.redIAdd=function(e){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},o.prototype.redSub=function(e){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},o.prototype.redISub=function(e){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},o.prototype.redShl=function(e){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},o.prototype.redMul=function(e){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},o.prototype.redIMul=function(e){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},o.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},o.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},o.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},o.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},o.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},o.prototype.redPow=function(e){return n(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var g={k256:null,p224:null,p192:null,p25519:null};function y(e,t){this.name=e,this.p=new o(t,16),this.n=this.p.bitLength(),this.k=new o(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function v(){y.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function b(){y.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function w(){y.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function M(){y.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function _(e){if("string"==typeof e){var t=o._prime(e);this.m=t.p,this.prime=t}else n(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function O(e){_.call(this,e),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new o(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}y.prototype._tmp=function(){var e=new o(null);return e.words=new Array(Math.ceil(this.n/13)),e},y.prototype.ireduce=function(e){var t,r=e;do{this.split(r,this.tmp),t=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(t>this.n);var n=t<this.n?-1:r.ucmp(this.p);return 0===n?(r.words[0]=0,r.length=1):n>0?r.isub(this.p):r.strip(),r},y.prototype.split=function(e,t){e.iushrn(this.n,0,t)},y.prototype.imulK=function(e){return e.imul(this.k)},i(v,y),v.prototype.split=function(e,t){for(var r=4194303,n=Math.min(e.length,9),i=0;i<n;i++)t.words[i]=e.words[i];if(t.length=n,e.length<=9)return e.words[0]=0,void(e.length=1);var o=e.words[9];for(t.words[t.length++]=o&r,i=10;i<e.length;i++){var s=0|e.words[i];e.words[i-10]=(s&r)<<4|o>>>22,o=s}o>>>=22,e.words[i-10]=o,0===o&&e.length>10?e.length-=10:e.length-=9},v.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var t=0,r=0;r<e.length;r++){var n=0|e.words[r];t+=977*n,e.words[r]=67108863&t,t=64*n+(t/67108864|0)}return 0===e.words[e.length-1]&&(e.length--,0===e.words[e.length-1]&&e.length--),e},i(b,y),i(w,y),i(M,y),M.prototype.imulK=function(e){for(var t=0,r=0;r<e.length;r++){var n=19*(0|e.words[r])+t,i=67108863&n;n>>>=26,e.words[r]=i,t=n}return 0!==t&&(e.words[e.length++]=t),e},o._prime=function(e){if(g[e])return g[e];var t;if("k256"===e)t=new v;else if("p224"===e)t=new b;else if("p192"===e)t=new w;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new M}return g[e]=t,t},_.prototype._verify1=function(e){n(0===e.negative,"red works only with positives"),n(e.red,"red works only with red numbers")},_.prototype._verify2=function(e,t){n(0==(e.negative|t.negative),"red works only with positives"),n(e.red&&e.red===t.red,"red works only with red numbers")},_.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):e.umod(this.m)._forceRed(this)},_.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},_.prototype.add=function(e,t){this._verify2(e,t);var r=e.add(t);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},_.prototype.iadd=function(e,t){this._verify2(e,t);var r=e.iadd(t);return r.cmp(this.m)>=0&&r.isub(this.m),r},_.prototype.sub=function(e,t){this._verify2(e,t);var r=e.sub(t);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},_.prototype.isub=function(e,t){this._verify2(e,t);var r=e.isub(t);return r.cmpn(0)<0&&r.iadd(this.m),r},_.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},_.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},_.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},_.prototype.isqr=function(e){return this.imul(e,e.clone())},_.prototype.sqr=function(e){return this.mul(e,e)},_.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(n(t%2==1),3===t){var r=this.m.add(new o(1)).iushrn(2);return this.pow(e,r)}for(var i=this.m.subn(1),s=0;!i.isZero()&&0===i.andln(1);)s++,i.iushrn(1);n(!i.isZero());var a=new o(1).toRed(this),u=a.redNeg(),c=this.m.subn(1).iushrn(1),l=this.m.bitLength();for(l=new o(2*l*l).toRed(this);0!==this.pow(l,c).cmp(u);)l.redIAdd(u);for(var d=this.pow(l,i),f=this.pow(e,i.addn(1).iushrn(1)),h=this.pow(e,i),p=s;0!==h.cmp(a);){for(var m=h,g=0;0!==m.cmp(a);g++)m=m.redSqr();n(g<p);var y=this.pow(d,new o(1).iushln(p-g-1));f=f.redMul(y),d=y.redSqr(),h=h.redMul(d),p=g}return f},_.prototype.invm=function(e){var t=e._invmp(this.m);return 0!==t.negative?(t.negative=0,this.imod(t).redNeg()):this.imod(t)},_.prototype.pow=function(e,t){if(t.isZero())return new o(1);if(0===t.cmpn(1))return e.clone();var r=new Array(16);r[0]=new o(1).toRed(this),r[1]=e;for(var n=2;n<r.length;n++)r[n]=this.mul(r[n-1],e);var i=r[0],s=0,a=0,u=t.bitLength()%26;for(0===u&&(u=26),n=t.length-1;n>=0;n--){for(var c=t.words[n],l=u-1;l>=0;l--){var d=c>>l&1;i!==r[0]&&(i=this.sqr(i)),0!==d||0!==s?(s<<=1,s|=d,(4===++a||0===n&&0===l)&&(i=this.mul(i,r[s]),a=0,s=0)):a=0}u=26}return i},_.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},_.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},o.mont=function(e){return new O(e)},i(O,_),O.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},O.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},O.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var r=e.imul(t),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),o=i;return i.cmp(this.m)>=0?o=i.isub(this.m):i.cmpn(0)<0&&(o=i.iadd(this.m)),o._forceRed(this)},O.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new o(0)._forceRed(this);var r=e.mul(t),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),s=i;return i.cmp(this.m)>=0?s=i.isub(this.m):i.cmpn(0)<0&&(s=i.iadd(this.m)),s._forceRed(this)},O.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(void 0===t||t,this)}}},{package:"@metamask/eth-token-tracker>ethjs>bn.js",file:"node_modules/@metamask/eth-token-tracker/node_modules/bn.js/lib/bn.js"}],[1204,{"eth-query":2166,pify:1217,"safe-event-emitter":3209},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){e("eth-query"),e("pify");const n=e("safe-event-emitter"),i=(e,t)=>e+t,o=["sync","latest"];function s(e){return Number.parseInt(e,16)}t.exports=class extends n{constructor(e={}){super(),this._blockResetDuration=e.blockResetDuration||2e4,this._blockResetTimeout,this._currentBlock=null,this._isRunning=!1,this._onNewListener=this._onNewListener.bind(this),this._onRemoveListener=this._onRemoveListener.bind(this),this._resetCurrentBlock=this._resetCurrentBlock.bind(this),this._setupInternalEvents()}isRunning(){return this._isRunning}getCurrentBlock(){return this._currentBlock}async getLatestBlock(){if(this._currentBlock)return this._currentBlock;return await new Promise((e=>this.once("latest",e)))}removeAllListeners(e){e?super.removeAllListeners(e):super.removeAllListeners(),this._setupInternalEvents(),this._onRemoveListener()}_start(){}_end(){}_setupInternalEvents(){this.removeListener("newListener",this._onNewListener),this.removeListener("removeListener",this._onRemoveListener),this.on("newListener",this._onNewListener),this.on("removeListener",this._onRemoveListener)}_onNewListener(e,t){o.includes(e)&&this._maybeStart()}_onRemoveListener(e,t){this._getBlockTrackerEventCount()>0||this._maybeEnd()}_maybeStart(){this._isRunning||(this._isRunning=!0,this._cancelBlockResetTimeout(),this._start())}_maybeEnd(){this._isRunning&&(this._isRunning=!1,this._setupBlockResetTimeout(),this._end())}_getBlockTrackerEventCount(){return o.map((e=>this.listenerCount(e))).reduce(i)}_newPotentialLatest(e){const t=this._currentBlock;t&&s(e)<=s(t)||this._setCurrentBlock(e)}_setCurrentBlock(e){const t=this._currentBlock;this._currentBlock=e,this.emit("latest",e),this.emit("sync",{oldBlock:t,newBlock:e})}_setupBlockResetTimeout(){this._cancelBlockResetTimeout(),this._blockResetTimeout=setTimeout(this._resetCurrentBlock,this._blockResetDuration),this._blockResetTimeout.unref&&this._blockResetTimeout.unref()}_cancelBlockResetTimeout(){clearTimeout(this._blockResetTimeout)}_resetCurrentBlock(){this._currentBlock=null}}}}},{package:"@metamask/eth-token-tracker>eth-block-tracker",file:"node_modules/@metamask/eth-token-tracker/node_modules/eth-block-tracker/src/base.js"}],[1205,{"./base":1204,pify:1217},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){const n=e("pify"),i=e("./base");function o(e,t){return new Promise((r=>{const n=setTimeout(r,e);n.unref&&t&&n.unref()}))}t.exports=class extends i{constructor(e={}){if(!e.provider)throw new Error("PollingBlockTracker - no provider specified.");const t=e.pollingInterval||2e4,r=e.retryTimeout||t/10,n=e.keepEventLoopActive===undefined||e.keepEventLoopActive,i=e.setSkipCacheFlag||!1;super(Object.assign({blockResetDuration:t},e)),this._provider=e.provider,this._pollingInterval=t,this._retryTimeout=r,this._keepEventLoopActive=n,this._setSkipCacheFlag=i}async checkForLatestBlock(){return await this._updateLatestBlock(),await this.getLatestBlock()}_start(){this._performSync().catch((e=>this.emit("error",e)))}async _performSync(){for(;this._isRunning;)try{await this._updateLatestBlock(),await o(this._pollingInterval,!this._keepEventLoopActive)}catch(e){const t=new Error(`PollingBlockTracker - encountered an error while attempting to update latest block:\n${e.stack}`);try{this.emit("error",t)}catch(e){console.error(t)}await o(this._retryTimeout,!this._keepEventLoopActive)}}async _updateLatestBlock(){const e=await this._fetchLatestBlock();this._newPotentialLatest(e)}async _fetchLatestBlock(){const e={jsonrpc:"2.0",id:1,method:"eth_blockNumber",params:[]};this._setSkipCacheFlag&&(e.skipCache=!0);const t=await n((t=>this._provider.sendAsync(e,t)))();if(t.error)throw new Error(`PollingBlockTracker - encountered error fetching block:\n${t.error}`);return t.result}}}}},{package:"@metamask/eth-token-tracker>eth-block-tracker",file:"node_modules/@metamask/eth-token-tracker/node_modules/eth-block-tracker/src/polling.js"}],[1206,{"./utils/index.js":1207,buffer:1943},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){(function(r){(function(){var n=e("./utils/index.js"),i=n.uint256Coder,o=(n.coderBoolean,n.coderFixedBytes,n.coderAddress,n.coderDynamicBytes,n.coderString,n.coderArray,n.paramTypePart,n.getParamCoder);function s(){}function a(e,t){if(e.length!==t.length)throw new Error("[ethjs-abi] while encoding params, types/values mismatch, Your contract requires "+e.length+" types (arguments), and you passed in "+t.length);var n=[];function s(e){return parseInt(32*Math.ceil(e/32))}e.forEach((function(e,r){var i=o(e);n.push({dynamic:i.dynamic,value:i.encode(t[r])})}));var a=0,u=0;n.forEach((function(e){e.dynamic?(a+=32,u+=s(e.value.length)):a+=s(e.value.length)}));var c=0,l=a,d=new r(a+u);return n.forEach((function(e,t){e.dynamic?(i.encode(l).copy(d,c),c+=32,e.value.copy(d,l),l+=s(e.value.length)):(e.value.copy(d,c),c+=s(e.value.length))})),"0x"+d.toString("hex")}function u(e,t,r){var a=!(arguments.length>3&&arguments[3]!==undefined)||arguments[3];arguments.length<3&&(r=t,t=e,e=[]),r=n.hexOrBuffer(r);var u=new s,c=0;return t.forEach((function(t,n){var s=o(t);if(s.dynamic){var l=i.decode(r,c),d=s.decode(r,l.value.toNumber());c+=l.consumed}else{d=s.decode(r,c);c+=d.consumed}a&&(u[n]=d.value),e[n]&&(u[e[n]]=d.value)})),u}function c(e){var t=e.name+"("+n.getKeys(e.inputs,"type").join(",")+")";return"0x"+new r(n.keccak256(t),"hex").slice(0,4).toString("hex")}function l(e,t){var r=a(n.getKeys(e.inputs,"type"),t).substring(2);return""+c(e)+r}function d(e){var t=e.name+"("+n.getKeys(e.inputs,"type").join(",")+")";return"0x"+n.keccak256(t)}function f(e,t,i){var s=!(arguments.length>3&&arguments[3]!==undefined)||arguments[3],a=e.inputs.filter((function(e){return!e.indexed})),c=n.getKeys(a,"name",!0),l=n.getKeys(a,"type"),d=u(c,l,n.hexOrBuffer(t),s),f=e.anonymous?0:1;return e.inputs.filter((function(e){return e.indexed})).map((function(e,t){var n=new r(i[t+f].slice(2),"hex"),s=o(e.type);d[e.name]=s.decode(n,0).value})),d._eventName=e.name,d}function h(e,t){var r=!(arguments.length>2&&arguments[2]!==undefined)||arguments[2];if(e&&t.topics[0]===d(e))return f(e,t.data,t.topics,r)}t.exports={encodeParams:a,decodeParams:u,encodeMethod:l,decodeMethod:function(e,t){return u(n.getKeys(e.outputs,"name",!0),n.getKeys(e.outputs,"type"),n.hexOrBuffer(t))},encodeEvent:function(e,t){return l(e,t)},decodeEvent:f,decodeLogItem:h,logDecoder:function(e){var t=!(arguments.length>1&&arguments[1]!==undefined)||arguments[1],r={};return e.filter((function(e){return"event"===e.type})).map((function(e){r[d(e)]=e})),function(e){return e.map((function(e){return h(r[e.topics[0]],e,t)})).filter((function(e){return e}))}},eventSignature:d,encodeSignature:c}}).call(this)}).call(this,e("buffer").Buffer)}}},{package:"@metamask/eth-token-tracker>ethjs>ethjs-abi",file:"node_modules/@metamask/eth-token-tracker/node_modules/ethjs-abi/lib/index.js"}],[1207,{"bn.js":1203,buffer:1943,"js-sha3":2716,"number-to-bn":2994},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){(function(r){(function(){var n=e("bn.js"),i=e("number-to-bn"),o=e("js-sha3").keccak_256;function s(e){for(var t=e,r=t[0];t.length>0&&"0"===r.toString();)r=(t=t.slice(1))[0];return t}function a(e){var t=e.toString(16);return t.length%2&&(t="0"+t),s(new r(t,"hex"))}function u(e,t){return!("string"!=typeof e||!e.match(/^0x[0-9A-Fa-f]*$/))&&(!t||e.length===2+2*t)}function c(e,t){var n=e;if(!r.isBuffer(n)){if(!u(n)){var i=new Error(t?"[ethjs-abi] invalid "+t:"[ethjs-abi] invalid hex or buffer, must be a prefixed alphanumeric even length hex string");throw i.reason="[ethjs-abi] invalid hex string, hex must be prefixed and alphanumeric (e.g. 0x023..)",i.value=n,i}(n=n.substring(2)).length%2&&(n="0"+n),n=new r(n,"hex")}return n}function l(e,t){return{encode:function(n){var o=n;return"object"==typeof o&&o.toString&&(o.toTwos||o.dividedToIntegerBy)&&(o=o.toString(10).split(".")[0]),"string"!=typeof o&&"number"!=typeof o||(o=String(o).split(".")[0]),o=(o=i(o)).toTwos(8*e).maskn(8*e),t&&(o=o.fromTwos(8*e).toTwos(256)),o.toArrayLike(r,"be",32)},decode:function(r,i){var o=32-e,s=new n(r.slice(i+o,i+32));return s=t?s.fromTwos(8*e):s.maskn(8*e),{consumed:32,value:new n(s.toString(10))}}}}var d=l(32,!1),f={encode:function(e){return d.encode(e?1:0)},decode:function(e,t){var r=d.decode(e,t);return{consumed:r.consumed,value:!r.value.isZero()}}};function h(e){return{encode:function(e){var t=e;if(32===(t=c(t)).length)return t;var n=new r(32);return n.fill(0),t.copy(n),n},decode:function(t,r){if(0!==t.length&&t.length<r+32)throw new Error("[ethjs-abi] while decoding fixed bytes, invalid bytes data length: "+e);return{consumed:32,value:"0x"+t.slice(r,r+e).toString("hex")}}}}var p={encode:function(e){var t=e,n=new r(32);if(!u(t,20))throw new Error("[ethjs-abi] while encoding address, invalid address value, not alphanumeric 20 byte hex string");return t=c(t),n.fill(0),t.copy(n,12),n},decode:function(e,t){if(0===e.length)return{consumed:32,value:"0x"};if(0!==e.length&&e.length<t+32)throw new Error("[ethjs-abi] while decoding address data, invalid address data, invalid byte length "+e.length);return{consumed:32,value:"0x"+e.slice(t+12,t+32).toString("hex")}}};function m(e){var t=parseInt(32*Math.ceil(e.length/32)),n=new r(t-e.length);return n.fill(0),r.concat([d.encode(e.length),e,n])}function g(e,t){if(0!==e.length&&e.length<t+32)throw new Error("[ethjs-abi] while decoding dynamic bytes data, invalid bytes length: "+e.length+" should be less than "+(t+32));var r=d.decode(e,t).value;if(r=r.toNumber(),0!==e.length&&e.length<t+32+r)throw new Error("[ethjs-abi] while decoding dynamic bytes data, invalid bytes length: "+e.length+" should be less than "+(t+32+r));return{consumed:parseInt(32+32*Math.ceil(r/32),10),value:e.slice(t+32,t+32+r)}}var y={encode:function(e){return m(c(e))},decode:function(e,t){var r=g(e,t);return r.value="0x"+r.value.toString("hex"),r},dynamic:!0},v={encode:function(e){return m(new r(e,"utf8"))},decode:function(e,t){var r=g(e,t);return r.value=r.value.toString("utf8"),r},dynamic:!0};function b(e,t){return{encode:function(n){var i=new r(0),o=t;if(!Array.isArray(n))throw new Error("[ethjs-abi] while encoding array, invalid array data, not type Object (Array)");if(-1===o&&(o=n.length,i=d.encode(o)),o!==n.length)throw new Error("[ethjs-abi] while encoding array, size mismatch array length "+o+" does not equal "+n.length);return n.forEach((function(t){i=r.concat([i,e.encode(t)])})),i},decode:function(r,n){var i,o=t,s=n,a=0;-1===o&&(o=(i=d.decode(r,s)).value.toNumber(),a+=i.consumed,s+=i.consumed);for(var u=[],c=0;c<o;c++){var l=e.decode(r,s);a+=l.consumed,s+=l.consumed,u.push(l.value)}return{consumed:a,value:u}},dynamic:-1===t}}var w=new RegExp(/^((u?int|bytes)([0-9]*)|(address|bool|string)|(\[([0-9]*)\]))/);t.exports={BN:n,bnToBuffer:a,isHexString:u,hexOrBuffer:c,hexlify:function(e){return"number"==typeof e?"0x"+a(new n(e)).toString("hex"):e.mod||e.modulo?"0x"+a(e).toString("hex"):"0x"+c(e).toString("hex")},stripZeros:s,keccak256:o,getKeys:function(e,t,r){var n=[];if(!Array.isArray(e))throw new Error("[ethjs-abi] while getting keys, invalid params value "+JSON.stringify(e));for(var i=0;i<e.length;i++){var o=e[i][t];if(r&&!o)o="";else if("string"!=typeof o)throw new Error("[ethjs-abi] while getKeys found invalid ABI data structure, type value not string");n.push(o)}return n},numberToBN:i,coderNumber:l,uint256Coder:d,coderBoolean:f,coderFixedBytes:h,coderAddress:p,coderDynamicBytes:y,coderString:v,coderArray:b,paramTypePart:w,getParamCoder:function(e){for(var t=e,r=null,n="[ethjs-abi] while getting param coder (getParamCoder) type value "+JSON.stringify(t)+" is either invalid or unsupported by ethjs-abi.";t;){var i=t.match(w);if(!i)throw new Error(n);t=t.substring(i[0].length);var o=i[2]||i[4]||i[5];switch(o){case"int":case"uint":if(r)throw new Error(n);var s=parseInt(i[3]||256);if(0===s||s>256||s%8!=0)throw new Error("[ethjs-abi] while getting param coder for type "+t+", invalid "+o+"<N> width: "+t);r=l(s/8,"int"===o);break;case"bool":if(r)throw new Error(n);r=f;break;case"string":if(r)throw new Error(n);r=v;break;case"bytes":if(r)throw new Error(n);if(i[3]){var a=parseInt(i[3]);if(0===a||a>32)throw new Error("[ethjs-abi] while getting param coder for prefix bytes, invalid type "+t+", size "+a+" should be 0 or greater than 32");r=h(a)}else r=y;break;case"address":if(r)throw new Error(n);r=p;break;case"[]":if(!r||r.dynamic)throw new Error(n);r=b(r,-1);break;default:if(!r||r.dynamic)throw new Error(n);r=b(r,parseInt(i[6]))}}if(!r)throw new Error(n);return r}}}).call(this)}).call(this,e("buffer").Buffer)}}},{package:"@metamask/eth-token-tracker>ethjs>ethjs-abi",file:"node_modules/@metamask/eth-token-tracker/node_modules/ethjs-abi/lib/utils/index.js"}],[1208,{"./lib/getTransactionSuccess.js":1209,"bn.js":1203,buffer:1943,"ethjs-abi":1206,"ethjs-contract":1212,"ethjs-filter":2271,"ethjs-provider-http":2273,"ethjs-query":1215,"ethjs-unit":2277,"ethjs-util":2279,"js-sha3":2716,"number-to-bn":2994},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){(function(r){(function(){var n=e("ethjs-query"),i=e("ethjs-filter"),o=e("ethjs-contract"),s=e("ethjs-provider-http"),a=e("ethjs-abi"),u=e("ethjs-unit"),c=e("js-sha3").keccak_256,l=e("number-to-bn"),d=e("bn.js"),f=e("ethjs-util"),h=e("./lib/getTransactionSuccess.js");function p(e,t){if(!(this instanceof p))throw new Error('[ethjs] the Eth object requires you construct it with the "new" flag (i.e. `const eth = new Eth(...);`).');var r=this;r.options=t||{};var s=new n(e,r.options.query);Object.keys(Object.getPrototypeOf(s)).forEach((function(e){r[e]=function(){for(var t=arguments.length,r=Array(t),n=0;n<t;n++)r[n]=arguments[n];return s[e].apply(s,r)}})),r.filter=new i(s,r.options.query),r.contract=new o(s,r.options.query),r.currentProvider=s.rpc.currentProvider,r.setProvider=s.setProvider,r.getTransactionSuccess=h(r)}t.exports=p,p.BN=d,p.isAddress=function(e){return f.isHexString(e,20)},p.keccak256=function(e){return"0x"+c(e)},p.Buffer=r,p.isHexString=f.isHexString,p.fromWei=u.fromWei,p.toWei=u.toWei,p.toBN=l,p.abi=a,p.fromAscii=f.fromAscii,p.toAscii=f.toAscii,p.fromUtf8=f.fromUtf8,p.toUtf8=f.toUtf8,p.HttpProvider=s}).call(this)}).call(this,e("buffer").Buffer)}}},{package:"@metamask/eth-token-tracker>ethjs",file:"node_modules/@metamask/eth-token-tracker/node_modules/ethjs/lib/index.js"}],[1209,{},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){t.exports=function(e){return function(t,r){var n=0,i=e.options.timeout||8e5,o=e.options.interval||7e3,s=new Promise((function(r,s){var a=setInterval((function(){(e.getTransactionReceipt(t,(function(e,t){e&&(clearInterval(a),s(e)),!e&&t&&(clearInterval(a),r(t))})),n>=i)&&(clearInterval(a),s("Receipt timeout waiting for tx hash: "+t));n+=o}),o)}));return r&&s.then((function(e){return r(null,e)})).catch((function(e){return r(e,null)})),r?null:s}}}}},{package:"@metamask/eth-token-tracker>ethjs",file:"node_modules/@metamask/eth-token-tracker/node_modules/ethjs/lib/lib/getTransactionSuccess.js"}],[1210,{"./has-tx-object":1211,"babel-runtime/core-js/json/stringify":1722,"babel-runtime/core-js/object/assign":1723,"babel-runtime/helpers/asyncToGenerator":1731,"babel-runtime/regenerator":1848,"ethjs-abi":1213,"ethjs-filter":2271,"ethjs-util":2279,"js-sha3":2716,"promise-to-callback":3028},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){var n=a(e("babel-runtime/regenerator")),i=a(e("babel-runtime/core-js/json/stringify")),o=a(e("babel-runtime/helpers/asyncToGenerator")),s=a(e("babel-runtime/core-js/object/assign"));function a(e){return e&&e.__esModule?e:{default:e}}var u=e("ethjs-abi"),c=e("ethjs-filter"),l=e("ethjs-util").getKeys,d=e("js-sha3").keccak_256,f=e("./has-tx-object"),h=e("promise-to-callback");function p(e){return e.filter((function(e){return("function"===e.type||"event"===e.type)&&e.name.length>0}))}t.exports=function(){var e=(a=(0,o.default)(n.default.mark((function e(t){var o,a,c,l,d,h=t.methodObject,p=t.methodArgs;return n.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o="call",a={},f(p)&&(a=p.pop()),(c=(0,s.default)({},r.defaultTxObject,a,{to:r.address})).data=u.encodeMethod(h,p),!1===h.constant&&(o="sendTransaction"),e.next=8,r.query[o](c);case 8:if(l=e.sent,"call"!==o){e.next=19;break}return e.prev=10,d=u.decodeMethod(h,l),e.abrupt("return",d);case 15:throw e.prev=15,e.t0=e.catch(10),new Error("[ethjs-contract] while formatting incoming raw call data "+(0,i.default)(l)+" "+e.t0);case 19:return e.abrupt("return",l);case 20:case"end":return e.stop()}}),e,this,[[10,15]])}))),function(e){return a.apply(this,arguments)}),t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{},r=this;var a;function m(e){return function(){var t=[].slice.call(arguments),n=l(e.inputs,"type",!1),i="0x"+d(e.name+"("+n.join(",")+")"),o=[i],a=(0,s.default)({},t[0])||{},c=(0,s.default)({},t[0]||{},{to:r.address,topics:o}),f=(0,s.default)({},a,{decoder:function(t){return u.decodeEvent(e,t,o)},defaultFilterObject:c});return new r.filters.Filter(f)}}function g(t){return function(){var r=void 0,n=[].slice.call(arguments);"function"==typeof n[n.length-1]&&(r=n.pop());var i=e({methodObject:t,methodArgs:n});return r?h(i)(r):i}}r.abi=t.contractABI||[],r.query=t.query,r.address=t.address||"0x",r.bytecode=t.contractBytecode||"0x",r.defaultTxObject=t.contractDefaultTxObject||{},r.filters=new c(r.query),p(r.abi).forEach((function(e){"function"===e.type?r[e.name]=g(e):"event"===e.type&&(r[e.name]=m(e))}))}}}},{package:"@metamask/eth-token-tracker>ethjs>ethjs-contract",file:"node_modules/@metamask/eth-token-tracker/node_modules/ethjs/node_modules/ethjs-contract/lib/contract.js"}],[1211,{"babel-runtime/core-js/object/keys":1726},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){var n,i=e("babel-runtime/core-js/object/keys"),o=(n=i)&&n.__esModule?n:{default:n};var s=["from","to","data","value","gasPrice","gas"];t.exports=function(e){if(!Array.isArray(e)||0===e.length)return!1;var t=e[e.length-1];if(!t)return!1;if("object"!=typeof t)return!1;if(0===(0,o.default)(t).length)return!0;var r=(0,o.default)(t);if(s.some((function(e){return r.includes(e)})))return!0;return!1}}}},{package:"@metamask/eth-token-tracker>ethjs>ethjs-contract",file:"node_modules/@metamask/eth-token-tracker/node_modules/ethjs/node_modules/ethjs-contract/lib/has-tx-object.js"}],[1212,{"./contract":1210,"./has-tx-object":1211,"babel-runtime/core-js/object/assign":1723,"ethjs-abi":1213,"ethjs-filter":2271,"ethjs-util":2279,"js-sha3":2716},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){var n,i=e("babel-runtime/core-js/object/assign"),o=(n=i)&&n.__esModule?n:{default:n};var s=e("ethjs-abi"),a=(e("js-sha3").keccak_256,e("ethjs-filter"),e("ethjs-util").getKeys),u=e("./contract"),c=e("./has-tx-object");function l(e){return e.filter((function(e){return"constructor"===e.type}))[0]}t.exports=function(e){return function(t,r,n){if(!Array.isArray(t))throw new Error("[ethjs-contract] Contract ABI must be type Array, got type "+typeof t);if(void 0!==r&&"string"!=typeof r)throw new Error("[ethjs-contract] Contract bytecode must be type String, got type "+typeof r);if(void 0!==n&&"object"!=typeof n)throw new Error("[ethjs-contract] Contract default tx object must be type Object, got type "+typeof t);var i={at:function(i){return new u({address:i,query:e,contractBytecode:r,contractDefaultTxObject:n,contractABI:t})},new:function(){var i={},u=null,d=[].slice.call(arguments);"function"==typeof d[d.length-1]&&(u=d.pop()),c(d)&&(i=d.pop());var f=l(t),h=(0,o.default)({},n,i);if(r&&(h.data=r),f){var p=s.encodeParams(a(f.inputs,"type"),d).substring(2);h.data=""+h.data+p}return u?e.sendTransaction(h,u):e.sendTransaction(h)}};return i}}}}},{package:"@metamask/eth-token-tracker>ethjs>ethjs-contract",file:"node_modules/@metamask/eth-token-tracker/node_modules/ethjs/node_modules/ethjs-contract/lib/index.js"}],[1213,{"./utils/index.js":1214,buffer:1943},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){(function(r){(function(){var n=e("./utils/index.js"),i=n.uint256Coder,o=(n.coderBoolean,n.coderFixedBytes,n.coderAddress,n.coderDynamicBytes,n.coderString,n.coderArray,n.paramTypePart,n.getParamCoder);function s(){}function a(e,t){if(e.length!==t.length)throw new Error("[ethjs-abi] while encoding params, types/values mismatch, Your contract requires "+e.length+" types (arguments), and you passed in "+t.length);var n=[];function s(e){return parseInt(32*Math.ceil(e/32))}e.forEach((function(e,r){var i=o(e);n.push({dynamic:i.dynamic,value:i.encode(t[r])})}));var a=0,u=0;n.forEach((function(e){e.dynamic?(a+=32,u+=s(e.value.length)):a+=s(e.value.length)}));var c=0,l=a,d=new r(a+u);return n.forEach((function(e,t){e.dynamic?(i.encode(l).copy(d,c),c+=32,e.value.copy(d,l),l+=s(e.value.length)):(e.value.copy(d,c),c+=s(e.value.length))})),"0x"+d.toString("hex")}function u(e,t,r){var a=!(arguments.length>3&&arguments[3]!==undefined)||arguments[3];arguments.length<3&&(r=t,t=e,e=[]),r=n.hexOrBuffer(r);var u=new s,c=0;return t.forEach((function(t,n){var s=o(t);if(s.dynamic){var l=i.decode(r,c),d=s.decode(r,l.value.toNumber());c+=l.consumed}else{d=s.decode(r,c);c+=d.consumed}a&&(u[n]=d.value),e[n]&&(u[e[n]]=d.value)})),u}function c(e,t){var i=e.name+"("+n.getKeys(e.inputs,"type").join(",")+")";return""+("0x"+new r(n.keccak256(i),"hex").slice(0,4).toString("hex"))+a(n.getKeys(e.inputs,"type"),t).substring(2)}function l(e){var t=e.name+"("+n.getKeys(e.inputs,"type").join(",")+")";return"0x"+n.keccak256(t)}function d(e,t,i){var s=!(arguments.length>3&&arguments[3]!==undefined)||arguments[3],a=e.inputs.filter((function(e){return!e.indexed})),c=n.getKeys(a,"name",!0),l=n.getKeys(a,"type"),d=u(c,l,n.hexOrBuffer(t),s),f=e.anonymous?0:1;return e.inputs.filter((function(e){return e.indexed})).map((function(e,t){var n=new r(i[t+f].slice(2),"hex"),s=o(e.type);d[e.name]=s.decode(n,0).value})),d._eventName=e.name,d}function f(e,t){var r=!(arguments.length>2&&arguments[2]!==undefined)||arguments[2];if(e&&t.topics[0]===l(e))return d(e,t.data,t.topics,r)}t.exports={encodeParams:a,decodeParams:u,encodeMethod:c,decodeMethod:function(e,t){return u(n.getKeys(e.outputs,"name",!0),n.getKeys(e.outputs,"type"),n.hexOrBuffer(t))},encodeEvent:function(e,t){return c(e,t)},decodeEvent:d,decodeLogItem:f,logDecoder:function(e){var t=!(arguments.length>1&&arguments[1]!==undefined)||arguments[1],r={};return e.filter((function(e){return"event"===e.type})).map((function(e){r[l(e)]=e})),function(e){return e.map((function(e){return f(r[e.topics[0]],e,t)})).filter((function(e){return e}))}},eventSignature:l}}).call(this)}).call(this,e("buffer").Buffer)}}},{package:"@metamask/eth-token-tracker>ethjs>ethjs-contract>ethjs-abi",file:"node_modules/@metamask/eth-token-tracker/node_modules/ethjs/node_modules/ethjs-contract/node_modules/ethjs-abi/lib/index.js"}],[1214,{"bn.js":1203,buffer:1943,"js-sha3":2716,"number-to-bn":2994},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){(function(r){(function(){var n=e("bn.js"),i=e("number-to-bn"),o=e("js-sha3").keccak_256;function s(e){for(var t=e,r=t[0];t.length>0&&"0"===r.toString();)r=(t=t.slice(1))[0];return t}function a(e){var t=e.toString(16);return t.length%2&&(t="0"+t),s(new r(t,"hex"))}function u(e,t){return!("string"!=typeof e||!e.match(/^0x[0-9A-Fa-f]*$/))&&(!t||e.length===2+2*t)}function c(e,t){var n=e;if(!r.isBuffer(n)){if(!u(n)){var i=new Error(t?"[ethjs-abi] invalid "+t:"[ethjs-abi] invalid hex or buffer, must be a prefixed alphanumeric even length hex string");throw i.reason="[ethjs-abi] invalid hex string, hex must be prefixed and alphanumeric (e.g. 0x023..)",i.value=n,i}(n=n.substring(2)).length%2&&(n="0"+n),n=new r(n,"hex")}return n}function l(e,t){return{encode:function(n){var o=n;return"object"==typeof o&&o.toString&&(o.toTwos||o.dividedToIntegerBy)&&(o=o.toString(10).split(".")[0]),"string"!=typeof o&&"number"!=typeof o||(o=String(o).split(".")[0]),o=(o=i(o)).toTwos(8*e).maskn(8*e),t&&(o=o.fromTwos(8*e).toTwos(256)),o.toArrayLike(r,"be",32)},decode:function(r,i){var o=32-e,s=new n(r.slice(i+o,i+32));return s=t?s.fromTwos(8*e):s.maskn(8*e),{consumed:32,value:new n(s.toString(10))}}}}var d=l(32,!1),f={encode:function(e){return d.encode(e?1:0)},decode:function(e,t){var r=d.decode(e,t);return{consumed:r.consumed,value:!r.value.isZero()}}};function h(e){return{encode:function(e){var t=e;if(32===(t=c(t)).length)return t;var n=new r(32);return n.fill(0),t.copy(n),n},decode:function(t,r){if(0!==t.length&&t.length<r+32)throw new Error("[ethjs-abi] while decoding fixed bytes, invalid bytes data length: "+e);return{consumed:32,value:"0x"+t.slice(r,r+e).toString("hex")}}}}var p={encode:function(e){var t=e,n=new r(32);if(!u(t,20))throw new Error("[ethjs-abi] while encoding address, invalid address value, not alphanumeric 20 byte hex string");return t=c(t),n.fill(0),t.copy(n,12),n},decode:function(e,t){if(0===e.length)return{consumed:32,value:"0x"};if(0!==e.length&&e.length<t+32)throw new Error("[ethjs-abi] while decoding address data, invalid address data, invalid byte length "+e.length);return{consumed:32,value:"0x"+e.slice(t+12,t+32).toString("hex")}}};function m(e){var t=parseInt(32*Math.ceil(e.length/32)),n=new r(t-e.length);return n.fill(0),r.concat([d.encode(e.length),e,n])}function g(e,t){if(0!==e.length&&e.length<t+32)throw new Error("[ethjs-abi] while decoding dynamic bytes data, invalid bytes length: "+e.length+" should be less than "+(t+32));var r=d.decode(e,t).value;if(r=r.toNumber(),0!==e.length&&e.length<t+32+r)throw new Error("[ethjs-abi] while decoding dynamic bytes data, invalid bytes length: "+e.length+" should be less than "+(t+32+r));return{consumed:parseInt(32+32*Math.ceil(r/32),10),value:e.slice(t+32,t+32+r)}}var y={encode:function(e){return m(c(e))},decode:function(e,t){var r=g(e,t);return r.value="0x"+r.value.toString("hex"),r},dynamic:!0},v={encode:function(e){return m(new r(e,"utf8"))},decode:function(e,t){var r=g(e,t);return r.value=r.value.toString("utf8"),r},dynamic:!0};function b(e,t){return{encode:function(n){var i=new r(0),o=t;if(!Array.isArray(n))throw new Error("[ethjs-abi] while encoding array, invalid array data, not type Object (Array)");if(-1===o&&(o=n.length,i=d.encode(o)),o!==n.length)throw new Error("[ethjs-abi] while encoding array, size mismatch array length "+o+" does not equal "+n.length);return n.forEach((function(t){i=r.concat([i,e.encode(t)])})),i},decode:function(r,n){var i,o=t,s=n,a=0;-1===o&&(o=(i=d.decode(r,s)).value.toNumber(),a+=i.consumed,s+=i.consumed);for(var u=[],c=0;c<o;c++){var l=e.decode(r,s);a+=l.consumed,s+=l.consumed,u.push(l.value)}return{consumed:a,value:u}},dynamic:-1===t}}var w=new RegExp(/^((u?int|bytes)([0-9]*)|(address|bool|string)|(\[([0-9]*)\]))/);t.exports={BN:n,bnToBuffer:a,isHexString:u,hexOrBuffer:c,hexlify:function(e){return"number"==typeof e?"0x"+a(new n(e)).toString("hex"):e.mod||e.modulo?"0x"+a(e).toString("hex"):"0x"+c(e).toString("hex")},stripZeros:s,keccak256:o,getKeys:function(e,t,r){var n=[];if(!Array.isArray(e))throw new Error("[ethjs-abi] while getting keys, invalid params value "+JSON.stringify(e));for(var i=0;i<e.length;i++){var o=e[i][t];if(r&&!o)o="";else if("string"!=typeof o)throw new Error("[ethjs-abi] while getKeys found invalid ABI data structure, type value not string");n.push(o)}return n},numberToBN:i,coderNumber:l,uint256Coder:d,coderBoolean:f,coderFixedBytes:h,coderAddress:p,coderDynamicBytes:y,coderString:v,coderArray:b,paramTypePart:w,getParamCoder:function(e){for(var t=e,r=null,n="[ethjs-abi] while getting param coder (getParamCoder) type value "+JSON.stringify(t)+" is either invalid or unsupported by ethjs-abi.";t;){var i=t.match(w);if(!i)throw new Error(n);t=t.substring(i[0].length);var o=i[2]||i[4]||i[5];switch(o){case"int":case"uint":if(r)throw new Error(n);var s=parseInt(i[3]||256);if(0===s||s>256||s%8!=0)throw new Error("[ethjs-abi] while getting param coder for type "+t+", invalid "+o+"<N> width: "+t);r=l(s/8,"int"===o);break;case"bool":if(r)throw new Error(n);r=f;break;case"string":if(r)throw new Error(n);r=v;break;case"bytes":if(r)throw new Error(n);if(i[3]){var a=parseInt(i[3]);if(0===a||a>32)throw new Error("[ethjs-abi] while getting param coder for prefix bytes, invalid type "+t+", size "+a+" should be 0 or greater than 32");r=h(a)}else r=y;break;case"address":if(r)throw new Error(n);r=p;break;case"[]":if(!r||r.dynamic)throw new Error(n);r=b(r,-1);break;default:if(!r||r.dynamic)throw new Error(n);r=b(r,parseInt(i[6]))}}if(!r)throw new Error(n);return r}}}).call(this)}).call(this,e("buffer").Buffer)}}},{package:"@metamask/eth-token-tracker>ethjs>ethjs-contract>ethjs-abi",file:"node_modules/@metamask/eth-token-tracker/node_modules/ethjs/node_modules/ethjs-contract/node_modules/ethjs-abi/lib/utils/index.js"}],[1215,{"babel-runtime/core-js/json/stringify":1722,"babel-runtime/core-js/object/assign":1723,"babel-runtime/core-js/object/define-property":1725,"babel-runtime/core-js/object/keys":1726,"babel-runtime/helpers/asyncToGenerator":1731,"babel-runtime/regenerator":1848,"ethjs-format":2272,"ethjs-rpc":2275,"promise-to-callback":3028},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){var n=c(e("babel-runtime/regenerator")),i=c(e("babel-runtime/core-js/json/stringify")),o=c(e("babel-runtime/helpers/asyncToGenerator")),s=c(e("babel-runtime/core-js/object/define-property")),a=c(e("babel-runtime/core-js/object/keys")),u=c(e("babel-runtime/core-js/object/assign"));function c(e){return e&&e.__esModule?e:{default:e}}var l=e("ethjs-format"),d=e("ethjs-rpc"),f=e("promise-to-callback");function h(e,t){var r=this,n=t||{};if(!(this instanceof h))throw new Error('[ethjs-query] the Eth object requires the "new" flag in order to function normally (i.e. `const eth = new Eth(provider);`).');if("object"!=typeof e)throw new Error("[ethjs-query] the Eth object requires that the first input 'provider' must be an object, got '"+typeof e+"' (i.e. 'const eth = new Eth(provider);')");r.options=(0,u.default)({debug:n.debug||!1,logger:n.logger||console,jsonSpace:n.jsonSpace||0}),r.rpc=new d(e),r.setProvider=r.rpc.setProvider}function p(e,t){return function(){var r,s=(r=(0,o.default)(n.default.mark((function r(){var o,s;return n.default.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(!(d.length<t[2])){r.next=2;break}throw new Error("[ethjs-query] method '"+h+"' requires at least "+t[2]+" input (format type "+t[0][0]+"), "+d.length+" provided. For more information visit: https://github.com/ethereum/wiki/wiki/JSON-RPC#"+e.toLowerCase());case 2:if(!(d.length>t[0].length)){r.next=4;break}throw new Error("[ethjs-query] method '"+h+"' requires at most "+t[0].length+" params, "+d.length+" provided '"+(0,i.default)(d,null,c.options.jsonSpace)+"'. For more information visit: https://github.com/ethereum/wiki/wiki/JSON-RPC#"+e.toLowerCase());case 4:t[3]&&d.length<t[3]&&d.push("latest"),this.log("attempting method formatting for '"+h+"' with inputs "+(0,i.default)(d,null,this.options.jsonSpace)),r.prev=6,u=l.formatInputs(e,d),this.log("method formatting success for '"+h+"' with formatted result: "+(0,i.default)(u,null,this.options.jsonSpace)),r.next=14;break;case 11:throw r.prev=11,r.t0=r.catch(6),new Error("[ethjs-query] while formatting inputs '"+(0,i.default)(d,null,this.options.jsonSpace)+"' for method '"+h+"' error: "+r.t0);case 14:return r.next=16,this.rpc.sendAsync({method:e,params:u});case 16:return o=r.sent,r.prev=17,this.log("attempting method formatting for '"+h+"' with raw outputs: "+(0,i.default)(o,null,this.options.jsonSpace)),s=l.formatOutputs(e,o),this.log("method formatting success for '"+h+"' formatted result: "+(0,i.default)(s,null,this.options.jsonSpace)),r.abrupt("return",s);case 24:throw r.prev=24,r.t1=r.catch(17),new Error("[ethjs-query] while formatting outputs from RPC '"+(0,i.default)(o,null,this.options.jsonSpace)+"' for method '"+h+"' "+r.t1);case 28:case"end":return r.stop()}}),r,this,[[6,11],[17,24]])}))),function(){return r.apply(this,arguments)}),a=null,u=null,c=this,d=[].slice.call(arguments),h=e.replace("eth_","");d.length>0&&"function"==typeof d[d.length-1]&&(a=d.pop());var p=s.call(this);return a?f(p)(a):p}}t.exports=h,h.prototype.log=function(e){this.options.debug&&this.options.logger.log("[ethjs-query log] "+e)},(0,a.default)(l.schema.methods).forEach((function(e){(0,s.default)(h.prototype,e.replace("eth_",""),{enumerable:!0,value:p(e,l.schema.methods[e])})}))}}},{package:"@metamask/eth-token-tracker>ethjs>ethjs-query",file:"node_modules/@metamask/eth-token-tracker/node_modules/ethjs/node_modules/ethjs-query/lib/index.js"}],[1216,{},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){t.exports=[{constant:!0,inputs:[],name:"name",outputs:[{name:"",type:"string"}],payable:!1,type:"function"},{constant:!1,inputs:[{name:"_spender",type:"address"},{name:"_value",type:"uint256"}],name:"approve",outputs:[{name:"success",type:"bool"}],payable:!1,type:"function"},{constant:!0,inputs:[],name:"totalSupply",outputs:[{name:"",type:"uint256"}],payable:!1,type:"function"},{constant:!1,inputs:[{name:"_from",type:"address"},{name:"_to",type:"address"},{name:"_value",type:"uint256"}],name:"transferFrom",outputs:[{name:"success",type:"bool"}],payable:!1,type:"function"},{constant:!0,inputs:[],name:"decimals",outputs:[{name:"",type:"uint8"}],payable:!1,type:"function"},{constant:!0,inputs:[],name:"version",outputs:[{name:"",type:"string"}],payable:!1,type:"function"},{constant:!0,inputs:[{name:"_owner",type:"address"}],name:"balanceOf",outputs:[{name:"balance",type:"uint256"}],payable:!1,type:"function"},{constant:!0,inputs:[],name:"symbol",outputs:[{name:"",type:"string"}],payable:!1,type:"function"},{constant:!1,inputs:[{name:"_to",type:"address"},{name:"_value",type:"uint256"}],name:"transfer",outputs:[{name:"success",type:"bool"}],payable:!1,type:"function"},{constant:!1,inputs:[{name:"_spender",type:"address"},{name:"_value",type:"uint256"},{name:"_extraData",type:"bytes"}],name:"approveAndCall",outputs:[{name:"success",type:"bool"}],payable:!1,type:"function"},{constant:!0,inputs:[{name:"_owner",type:"address"},{name:"_spender",type:"address"}],name:"allowance",outputs:[{name:"remaining",type:"uint256"}],payable:!1,type:"function"},{inputs:[{name:"_initialAmount",type:"uint256"},{name:"_tokenName",type:"string"},{name:"_decimalUnits",type:"uint8"},{name:"_tokenSymbol",type:"string"}],type:"constructor"},{payable:!1,type:"fallback"},{anonymous:!1,inputs:[{indexed:!0,name:"_from",type:"address"},{indexed:!0,name:"_to",type:"address"},{indexed:!1,name:"_value",type:"uint256"}],name:"Transfer",type:"event"},{anonymous:!1,inputs:[{indexed:!0,name:"_owner",type:"address"},{indexed:!0,name:"_spender",type:"address"},{indexed:!1,name:"_value",type:"uint256"}],name:"Approval",type:"event"}]}}},{package:"@metamask/eth-token-tracker>human-standard-token-abi",file:"node_modules/@metamask/eth-token-tracker/node_modules/human-standard-token-abi/index.js"}],[1217,{},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){const n=(e,t)=>function(){const r=t.promiseModule,n=new Array(arguments.length);for(let e=0;e<arguments.length;e++)n[e]=arguments[e];return new r(((r,i)=>{t.errorFirst?n.push((function(e,n){if(t.multiArgs){const t=new Array(arguments.length-1);for(let e=1;e<arguments.length;e++)t[e-1]=arguments[e];e?(t.unshift(e),i(t)):r(t)}else e?i(e):r(n)})):n.push((function(e){if(t.multiArgs){const e=new Array(arguments.length-1);for(let t=0;t<arguments.length;t++)e[t]=arguments[t];r(e)}else r(e)})),e.apply(this,n)}))};t.exports=(e,t)=>{t=Object.assign({exclude:[/.+(Sync|Stream)$/],errorFirst:!0,promiseModule:Promise},t);const r=e=>{const r=t=>"string"==typeof t?e===t:t.test(e);return t.include?t.include.some(r):!t.exclude.some(r)};let i;i="function"==typeof e?function(){return t.excludeMain?e.apply(this,arguments):n(e,t).apply(this,arguments)}:Object.create(Object.getPrototypeOf(e));for(const o in e){const s=e[o];i[o]="function"==typeof s&&r(o)?n(s,t):s}return i}}}},{package:"@metamask/eth-token-tracker>eth-block-tracker>pify",file:"node_modules/@metamask/eth-token-tracker/node_modules/pify/index.js"}],[1242,{},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){t.exports=["#01888C","#FC7500","#034F5D","#F73F01","#FC1960","#C7144C","#F3C100","#1598F2","#2465E1","#F19E02"]}}},{package:"@metamask/jazzicon",file:"node_modules/@metamask/jazzicon/colors.js"}],[1243,{"./colors":1242,"./paper":1244,color:1991,"mersenne-twister":2949},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){var n,i=e("mersenne-twister"),o=e("./paper"),s=e("color"),a=e("./colors"),u="http://www.w3.org/2000/svg";function c(e,t,r,i,o){var s=t/2,a=document.createElementNS(u,"rect");a.setAttributeNS(null,"x","0"),a.setAttributeNS(null,"y","0"),a.setAttributeNS(null,"width",t),a.setAttributeNS(null,"height",t);var c=n.random(),d=2*Math.PI*c,f=t/i*n.random()+r*t/i,h="translate("+Math.cos(d)*f+" "+Math.sin(d)*f+")"+" "+("rotate("+(360*c+180*n.random()).toFixed(1)+" "+s+" "+s+")");a.setAttributeNS(null,"transform",h);var p=l(e);a.setAttributeNS(null,"fill",p),o.appendChild(a)}function l(e){n.random();var t=Math.floor(e.length*n.random());return e.splice(t,1)[0]}t.exports=function(e,t){n=new i(t);var r=function(e,t){var r=30*t.random()-15;return e.map((function(e){var t=s(e);return t.rotate(r),t.hexString()}))}(a.slice(),n),d=o(e,l(r)).container,f=document.createElementNS(u,"svg");f.setAttributeNS(null,"x","0"),f.setAttributeNS(null,"y","0"),f.setAttributeNS(null,"width",e),f.setAttributeNS(null,"height",e),d.appendChild(f);for(var h=0;h<3;h++)c(r,e,h,3,f);return d}}}},{package:"@metamask/jazzicon",file:"node_modules/@metamask/jazzicon/index.js"}],[1244,{},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){t.exports=function(e,t){var r=document.createElement("div");return r.style.borderRadius="50px",r.style.overflow="hidden",r.style.padding="0px",r.style.margin="0px",r.style.width=e+"px",r.style.height=e+"px",r.style.display="inline-block",r.style.background=t,{container:r}}}}},{package:"@metamask/jazzicon",file:"node_modules/@metamask/jazzicon/paper.js"}],[1277,{},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){t.exports={positions:[[111.024597,52.604599,46.225899],[114.025002,87.673302,58.9818],[66.192001,80.898003,55.394299],[72.113297,35.491798,30.871401],[97.804497,116.560997,73.978798],[16.7623,58.010899,58.078201],[52.608898,30.3641,42.556099],[106.881401,31.945499,46.9133],[113.484596,38.6049,49.121498],[108.6633,43.2332,46.315399],[101.216599,15.9822,46.308201],[16.6605,-16.2883,93.618698],[40.775002,-10.2288,85.276398],[23.926901,-2.5103,86.736504],[11.1691,-7.0037,99.377602],[9.5692,-34.393902,141.671997],[12.596,7.1655,88.740997],[61.180901,8.8142,76.996803],[39.719501,-28.927099,88.963799],[13.7962,-68.575699,132.057007],[15.2674,-62.32,129.688004],[14.8446,-52.6096,140.113007],[12.8917,-49.771599,144.740997],[35.604198,-71.758003,81.063904],[47.462502,-68.606102,63.369701],[38.2486,-64.730202,38.909901],[-12.8917,-49.771599,144.740997],[-13.7962,-68.575699,132.057007],[17.802099,-71.758003,81.063904],[19.1243,-69.0168,49.420101],[38.2486,-66.275597,17.776199],[12.8928,-36.703499,141.671997],[109.283997,-93.589897,27.824301],[122.117996,-36.8894,35.025002],[67.7668,-30.197001,78.417801],[33.180698,101.851997,25.3186],[9.4063,-35.589802,150.722],[-9.5692,-34.393902,141.671997],[-9.4063,-35.589802,150.722],[11.4565,-37.899399,150.722],[-12.596,7.1655,88.740997],[-11.1691,-7.0037,99.377602],[70.236504,62.836201,-3.9475],[47.263401,54.293999,-27.414801],[28.7302,91.731102,-24.972601],[69.167603,6.5862,-12.7757],[28.7302,49.1003,-48.3596],[31.903,5.692,-47.821999],[35.075802,-34.432899,-16.280899],[115.284103,48.681499,48.684101],[110.842796,28.4821,49.176201],[-19.1243,-69.0168,49.420101],[-38.2486,-66.275597,17.776199],[-111.024597,52.604599,46.225899],[-72.113297,35.491798,30.871401],[-66.192001,80.898003,55.394299],[-114.025002,87.673302,58.9818],[-97.804497,116.560997,73.978798],[-52.608898,30.3641,42.556099],[-16.7623,58.010899,58.078201],[-106.881401,31.945499,46.9133],[-108.6633,43.2332,46.315399],[-113.484596,38.6049,49.121498],[-101.216599,15.9822,46.308201],[-16.6605,-16.2883,93.618698],[-23.926901,-2.5103,86.736504],[-40.775002,-10.2288,85.276398],[-61.180901,8.8142,76.996803],[-39.719501,-28.927099,88.963799],[-14.8446,-52.6096,140.113007],[-15.2674,-62.32,129.688004],[-47.462502,-68.606102,63.369701],[-35.604198,-71.758003,81.063904],[-38.2486,-64.730202,38.909901],[-17.802099,-71.758003,81.063904],[-12.8928,-36.703499,141.671997],[-67.7668,-30.197001,78.417801],[-122.117996,-36.8894,35.025002],[-109.283997,-93.589897,27.824301],[-33.180698,101.851997,25.3186],[-11.4565,-37.899399,150.722],[-70.236504,62.836201,-3.9475],[-28.7302,91.731102,-24.972601],[-47.263401,54.293999,-27.414801],[-69.167603,6.5862,-12.7757],[-28.7302,49.1003,-48.3596],[-31.903,5.692,-47.821999],[-35.075802,-34.432899,-16.280899],[-115.284103,48.681499,48.684101],[-110.842796,28.4821,49.176201]],chunks:[{color:[119,57,0],faces:[[0,1,2],[2,3,0],[4,5,2],[6,3,2],[2,5,6],[7,8,9],[10,3,6],[10,50,7],[7,3,10],[7,9,3],[49,0,9],[3,9,0],[53,54,55],[55,56,53],[57,56,55],[58,59,55],[55,54,58],[60,61,62],[63,58,54],[63,60,89],[60,63,54],[60,54,61],[88,61,53],[54,53,61],[2,1,4],[55,59,57]]},{color:[36,51,67],faces:[[11,12,13],[64,65,66]]},{color:[228,116,36],faces:[[14,15,11],[11,16,14],[17,12,18],[41,64,37],[67,68,66]]},{color:[192,172,157],faces:[[19,20,21],[21,22,19],[20,19,23],[23,24,20],[23,25,24],[19,22,26],[26,27,19],[23,28,29],[23,29,30],[25,23,30],[29,51,52],[52,30,29],[27,26,69],[69,70,27],[70,71,72],[72,27,70],[72,71,73],[51,74,72],[52,51,72],[73,52,72],[19,27,74],[74,28,19],[51,29,28],[28,74,51],[74,27,72],[28,23,19]]},{color:[214,194,178],faces:[[21,20,24],[24,31,21],[69,71,70],[71,69,75]]},{color:[228,119,25],faces:[[31,24,18],[6,5,16],[16,17,6],[24,32,33],[33,34,24],[5,4,35],[75,68,71],[58,67,40],[40,59,58],[71,76,77],[77,78,71]]},{color:[205,98,0],faces:[[24,34,18],[16,13,12],[12,17,16],[13,16,11],[71,68,76],[40,67,66],[66,65,40],[65,64,40]]},{color:[0,0,0],faces:[[36,15,37],[37,38,36],[31,39,22],[22,21,31],[31,15,36],[36,39,31],[75,69,26],[26,80,75],[75,80,38],[38,37,75],[38,80,39],[39,36,38],[39,80,26],[26,22,39]]},{color:[247,132,25],faces:[[17,33,10],[17,18,34],[34,33,17],[10,6,17],[11,15,31],[31,18,11],[18,12,11],[14,16,40],[40,41,14],[59,5,35],[35,79,59],[67,63,77],[67,77,76],[76,68,67],[63,67,58],[64,68,75],[75,37,64],[68,64,66],[14,41,37],[37,15,14],[5,59,40],[40,16,5]]},{color:[225,119,25],faces:[[35,4,42],[4,1,42],[42,43,44],[44,35,42],[45,43,42],[42,10,45],[30,32,24],[24,25,30],[30,33,32],[33,30,10],[44,43,46],[43,45,47],[47,46,43],[48,47,45],[45,30,48],[30,45,10],[49,42,0],[8,7,42],[50,42,7],[50,10,42],[1,0,42],[42,9,8],[42,49,9],[64,41,40],[57,59,79],[79,81,57],[57,81,56],[82,79,35],[35,44,82],[81,79,82],[82,83,81],[84,63,81],[81,83,84],[44,46,85],[85,82,44],[52,73,71],[71,78,52],[52,78,77],[77,63,52],[82,85,83],[83,85,86],[86,84,83],[87,52,84],[84,86,87],[52,63,84],[88,53,81],[62,81,60],[89,60,81],[89,81,63],[56,81,53],[81,62,61],[81,61,88],[48,87,86],[86,47,48],[47,86,85],[85,46,47],[48,30,52],[52,87,48]]}]}}}},{package:"@metamask/logo",file:"node_modules/@metamask/logo/fox.json"}],[1278,{"./fox.json":1277,"./util":1279},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){const n=e("./fox.json"),{calculateSizingOptions:i,createLogoViewer:o,loadModelFromJson:s,createModelRenderer:a,createNode:u,setAttribute:c,setGradientDefinitions:l,setMaskDefinitions:d}=e("./util");t.exports=function(e={}){const t=e.cameraDistance||400,{height:r,width:f}=i(e),h=e.meshJson||n,p=u("svg");c(p,"width",`${f}px`),c(p,"height",`${r}px`),document.body.appendChild(p),l(p,h.gradients),d({container:p,masks:h.masks,height:r,width:f});const m=s(h),g=a(p,t,m);return o(p,((e,t)=>{const r=p.getBoundingClientRect();g(r,e,t)}),Object.assign({cameraDistance:t},e))}}}},{package:"@metamask/logo",file:"node_modules/@metamask/logo/index.js"}],[1279,{"gl-mat4/invert":2500,"gl-mat4/lookAt":2501,"gl-mat4/multiply":2502,"gl-mat4/perspective":2503,"gl-mat4/rotate":2504,"gl-vec3/transformMat4":2505},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){const n=e("gl-mat4/perspective"),i=e("gl-mat4/multiply"),o=e("gl-mat4/lookAt"),s=e("gl-mat4/invert"),a=e("gl-mat4/rotate"),u=e("gl-vec3/transformMat4"),c="http://www.w3.org/2000/svg",l=function(...e){for(;this.lastChild;)this.removeChild(this.lastChild);e.length>0&&this.append(...e)};function d(e,t){const r=t.positions;let n=0;for(let t=0;t<r.length;++t){const i=r[t];for(let t=0;t<3;++t)e[n]=i[t],n+=1}}function f(e,t){const r=[],n=e.chunks.map(((n,i)=>{const{faces:o}=n;return o.map((o=>{const s=new b(t(n,{gradients:e.gradients,index:i,masks:e.masks}),o);return r.push(s),s}))}));return{polygons:r,polygonsByChunk:n}}function h(e,{gradients:t={},index:r,masks:n}){const i=y("polygon");if(e.gradient&&e.color)throw new Error(`Both gradient and color for chunk '${r}'. These options are mutually exclusive.`);if(e.gradient){const r=e.gradient;if(!t[r])throw new Error(`Gradient ID not found: '${r}'`);v(i,"fill",`url('#${r}')`),v(i,"stroke",`url('#${r}')`)}else{const t="string"==typeof e.color?e.color:`rgb(${e.color})`;v(i,"fill",t),v(i,"stroke",t)}if(e.mask){if(!n[e.mask])throw new Error(`Mask ID not found: '${e.mask}'`);v(i,"mask",`url('#${e.mask}')`)}return v(i,"points","0,0, 10,0, 0,10"),i}function p(e){const t=new Float32Array(3),r=new Float32Array([0,1,0]),c=new Float32Array(16),l=new Float32Array(16),d=o(new Float32Array(16),new Float32Array([0,0,e]),t,r),f=s(new Float32Array(16),d),h=new Float32Array(16),p=new Float32Array(3),m=new Float32Array(16),g=new Float32Array([1,0,0]),y=new Float32Array([0,1,0]),v=new Float32Array([0,0,1]);return(e,b,w)=>{const M=e.width,_=e.height;if(n(c,Math.PI/4,M/_,100,1e3),s(h,c),p[0]=b[0],p[1]=b[1],p[2]=1.2,u(p,p,h),u(p,p,f),o(l,t,p,r),w){const e=Date.now()/1e3;a(l,l,.1+.2*Math.sin(e/3),g),a(l,l,.03*Math.sin(e/2)-.1,v),a(l,l,.5+.2*Math.sin(e/3),y)}return i(m,c,d),i(m,m,l),m}}function m(e,t){return t.zIndex-e.zIndex}function g(e,t,r){const n=[];return i=>{let o;const s=i.width,a=i.height;for(n.length=0,o=0;o<t.length;++o){const e=t[o],{indices:i}=e,u=i[0],c=i[1],l=i[2],d=r[3*u],f=r[3*u+1],h=r[3*c],p=r[3*c+1],m=r[3*l];if((h-d)*(r[3*l+1]-f)-(p-f)*(m-d)<0)continue;const g=[];let y=-Infinity,b=Infinity;const w=e.svg;for(let e=0;e<3;++e){const t=i[e];g.push(`${.5*s*(1-r[3*t])},${.5*a*(1-r[3*t+1])}`);const n=r[3*t+2];y=Math.max(y,n),b=Math.min(b,n)}e.zIndex=y+.25*b;const M=g.join(" ");-1===M.indexOf("NaN")&&v(w,"points",M),n.push(e)}n.sort(m);const u=n.map((e=>e.svg)),c=e.getElementsByTagName("defs"),d=e.getElementsByTagName("mask");e.replaceChildren?e.replaceChildren(...c,...d,...u):l.bind(e)(...c,...d,...u)}}function y(e){return document.createElementNS(c,e)}function v(e,t,r){e.setAttributeNS(null,t,r)}function b(e,t){this.svg=e,this.indices=t,this.zIndex=0}t.exports={calculateSizingOptions:function(e={}){let t=e.width||400,r=e.height||400;e.pxNotRatio||(t=Math.floor(window.innerWidth*(e.width||.25)),r=Math.floor(window.innerHeight*e.height||t),"minWidth"in e&&t<e.minWidth&&(t=e.minWidth,r=Math.floor(e.minWidth*e.height/e.width)));return{width:t,height:r}},createLogoViewer:function(e,t,{followMouse:r=!1,followMotion:n=!1,slowDrift:i=!1,lazyRender:o=!0}={}){let s=!0;const a={x:0,y:0},u=[0,0],c=.3,l=()=>{!function(){const e=.7;u[0]=e*u[0]+c*a.x,u[1]=e*u[1]+c*a.y+.085}(),t(u,i)};function d(t){const r=e.getBoundingClientRect();a.x=1-2*(t.x-r.left)/r.width,a.y=1-2*(t.y-r.top)/r.height}function f(){s=!0}window.addEventListener("mousemove",(function(e){s||f(),r&&(d({x:e.clientX,y:e.clientY}),l())})),window.addEventListener("deviceorientation",(function(e){if(s||f(),n){const t=10;d({x:200+e.gamma*t,y:-300+e.beta*t}),l()}})),o?l():function e(){s&&(window.requestAnimationFrame(e),l())}();return{container:e,lookAt:d,setFollowMouse:function(e){r=e},setFollowMotion:function(e){n=e},stopAnimation:function(){s=!1},startAnimation:f,lookAtAndRender:function(e){d(e),u[0]=a.x,u[1]=a.y+.085/c,l()},renderCurrentScene:l}},createModelRenderer:function(e,t,r){const{updatePositions:n,transformed:i,polygons:o}=r;for(const t of o)e.appendChild(t.svg);const s=p(t),a=g(e,o,i);return(t,r,u)=>{const c=s(t,r,u);n(c),a(t,e,o,i)}},loadModelFromJson:function(e,t=h){const r=e.positions.length,n=new Float32Array(3*r),i=new Float32Array(3*r),{polygons:o,polygonsByChunk:s}=f(e,t);d(n,e);const a=function(e,t,r){return n=>{const i=n[0],o=n[1],s=n[2],a=n[3],u=n[4],c=n[5],l=n[6],d=n[7],f=n[8],h=n[9],p=n[10],m=n[11],g=n[12],y=n[13],v=n[14],b=n[15];for(let n=0;n<r;++n){const r=e[3*n],w=e[3*n+1],M=e[3*n+2],_=r*a+w*d+M*m+b;t[3*n]=(r*i+w*u+M*f+g)/_,t[3*n+1]=(r*o+w*c+M*h+y)/_,t[3*n+2]=(r*s+w*l+M*p+v)/_}}}(n,i,r);return{updatePositions:a,positions:n,transformed:i,polygons:o,polygonsByChunk:s}},positionsFromModel:d,createPolygonsFromModelJson:f,createStandardModelPolygon:h,createMatrixComputer:p,compareZ:m,createFaceUpdater:g,createNode:y,setAttribute:v,setGradientDefinitions:function(e,t){if(!t||0===Object.keys(t).length)return;const r=y("defs"),n=["x1","x2","y1","y2"],i=["cx","cy","fr","fx","fy","r"],o=["gradientTransform","gradientUnits","spreadMethod","stops","type"],s=[...n,...o],a=[...i,...o];for(const[e,o]of Object.entries(t)){let t;if("linear"===o.type){t=y("linearGradient");const e=Object.keys(o).find((e=>!s.includes(e)));if(e)throw new Error(`Unsupported linear gradient attribute: '${e}'`);if(n.some((e=>o[e]!==undefined))){const e=n.filter((e=>o[e]===undefined));if(e.length>0)throw new Error(`Missing coordinate attributes: '${e.join(", ")}'`);for(const e of n){if("string"!=typeof o[e])throw new Error(`Type of '${e}' option expected to be 'string'. Instead received type '${typeof o[e]}'`);v(t,e,o[e])}}}else{if("radial"!==o.type)throw new Error(`Unsupported gradient type: '${o.type}'`);{t=y("radialGradient");const e=i.filter((e=>o[e]!==undefined)),r=Object.keys(o).find((e=>!a.includes(e)));if(r)throw new Error(`Unsupported radial gradient attribute: '${r}'`);if(e.length>0)for(const r of e){if("string"!=typeof o[r])throw new Error(`Type of '${r}' option expected to be 'string'. Instead received type '${typeof o[r]}'`);v(t,r,o[r])}}}if(v(t,"id",e),o.gradientUnits!==undefined){if(!["userSpaceOnUse","objectBoundingBox"].includes(o.gradientUnits))throw new Error(`Unrecognized value for 'gradientUnits' attribute: '${o.gradientUnits}'`);v(t,"gradientUnits",o.gradientUnits)}if(o.gradientTransform!==undefined){if("string"!=typeof o.gradientTransform)throw new Error(`Type of 'gradientTransform' option expected to be 'string'. Instead received type '${typeof o.gradientTransform}'`);v(t,"gradientTransform",o.gradientTransform)}if(o.spreadMethod!==undefined){if(!["pad","reflect","repeat"].includes(o.spreadMethod))throw new Error(`Unrecognized value for 'spreadMethod' attribute: '${o.spreadMethod}'`);v(t,"spreadMethod",o.spreadMethod)}if(o.stops!==undefined){if(!Array.isArray(o.stops))throw new Error("The 'stop' attribute must be an array");for(const e of o.stops){if("object"!=typeof e)throw new Error(`Each entry in the 'stop' attribute must be an object. Instead received type '${typeof e}'`);const r=y("stop");e.offset!==undefined&&v(r,"offset",e.offset),e["stop-color"]!==undefined&&v(r,"stop-color",e["stop-color"]),e["stop-opacity"]!==undefined&&v(r,"stop-opacity",e["stop-opacity"]),t.appendChild(r)}}r.appendChild(t)}e.appendChild(r)},setMaskDefinitions:function({container:e,masks:t,height:r,width:n}){if(!t||0===Object.keys(t).length)return;for(const[i,o]of Object.entries(t)){const t=y("mask");v(t,"id",i);const s=y("rect");v(s,"width",1.5*n),v(s,"height",1.5*r),v(s,"x",`-${Math.floor(n/4)}`),v(s,"y",`-${Math.floor(r/4)}`),v(s,"fill",o.color),t.appendChild(s),e.appendChild(t)}},svgElementToSvgImageContent:function(e){const t=e.innerHTML;return`<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"> <svg width="521px" height="521px" version="1.1" baseProfile="full" xmlns="${c}" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:ev="http://www.w3.org/2001/xml-events">`+t+"</svg>"},Polygon:b}}}},{package:"@metamask/logo",file:"node_modules/@metamask/logo/util.js"}],[1390,{},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){function n(e){var t=e.getBoundingClientRect();return{width:t.width,height:t.height,top:t.top,right:t.right,bottom:t.bottom,left:t.left,x:t.left,y:t.top}}function i(e){if(null==e)return window;if("[object Window]"!==e.toString()){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function o(e){var t=i(e);return{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function s(e){return e instanceof i(e).Element||e instanceof Element}function a(e){return e instanceof i(e).HTMLElement||e instanceof HTMLElement}function u(e){return"undefined"!=typeof ShadowRoot&&(e instanceof i(e).ShadowRoot||e instanceof ShadowRoot)}function c(e){return e?(e.nodeName||"").toLowerCase():null}function l(e){return((s(e)?e.ownerDocument:e.document)||window.document).documentElement}function d(e){return n(l(e)).left+o(e).scrollLeft}function f(e){return i(e).getComputedStyle(e)}function h(e){var t=f(e),r=t.overflow,n=t.overflowX,i=t.overflowY;return/auto|scroll|overlay|hidden/.test(r+i+n)}function p(e,t,r){void 0===r&&(r=!1);var s,u,f=l(t),p=n(e),m=a(t),g={scrollLeft:0,scrollTop:0},y={x:0,y:0};return(m||!m&&!r)&&(("body"!==c(t)||h(f))&&(g=(s=t)!==i(s)&&a(s)?{scrollLeft:(u=s).scrollLeft,scrollTop:u.scrollTop}:o(s)),a(t)?((y=n(t)).x+=t.clientLeft,y.y+=t.clientTop):f&&(y.x=d(f))),{x:p.left+g.scrollLeft-y.x,y:p.top+g.scrollTop-y.y,width:p.width,height:p.height}}function m(e){var t=n(e),r=e.offsetWidth,i=e.offsetHeight;return Math.abs(t.width-r)<=1&&(r=t.width),Math.abs(t.height-i)<=1&&(i=t.height),{x:e.offsetLeft,y:e.offsetTop,width:r,height:i}}function g(e){return"html"===c(e)?e:e.assignedSlot||e.parentNode||(u(e)?e.host:null)||l(e)}function y(e){return["html","body","#document"].indexOf(c(e))>=0?e.ownerDocument.body:a(e)&&h(e)?e:y(g(e))}function v(e,t){var r;void 0===t&&(t=[]);var n=y(e),o=n===(null==(r=e.ownerDocument)?void 0:r.body),s=i(n),a=o?[s].concat(s.visualViewport||[],h(n)?n:[]):n,u=t.concat(a);return o?u:u.concat(v(g(a)))}function b(e){return["table","td","th"].indexOf(c(e))>=0}function w(e){return a(e)&&"fixed"!==f(e).position?e.offsetParent:null}function M(e){for(var t=i(e),r=w(e);r&&b(r)&&"static"===f(r).position;)r=w(r);return r&&("html"===c(r)||"body"===c(r)&&"static"===f(r).position)?t:r||function(e){var t=-1!==navigator.userAgent.toLowerCase().indexOf("firefox");if(-1!==navigator.userAgent.indexOf("Trident")&&a(e)&&"fixed"===f(e).position)return null;for(var r=g(e);a(r)&&["html","body"].indexOf(c(r))<0;){var n=f(r);if("none"!==n.transform||"none"!==n.perspective||"paint"===n.contain||-1!==["transform","perspective"].indexOf(n.willChange)||t&&"filter"===n.willChange||t&&n.filter&&"none"!==n.filter)return r;r=r.parentNode}return null}(e)||t}Object.defineProperty(r,"__esModule",{value:!0});var _="top",O="bottom",E="right",T="left",j="auto",k=[_,O,E,T],x="start",S="end",C="viewport",A="popper",I=k.reduce((function(e,t){return e.concat([t+"-"+x,t+"-"+S])}),[]),D=[].concat(k,[j]).reduce((function(e,t){return e.concat([t,t+"-"+x,t+"-"+S])}),[]),P=["beforeRead","read","afterRead","beforeMain","main","afterMain","beforeWrite","write","afterWrite"];function N(e){var t=new Map,r=new Set,n=[];function i(e){r.add(e.name),[].concat(e.requires||[],e.requiresIfExists||[]).forEach((function(e){if(!r.has(e)){var n=t.get(e);n&&i(n)}})),n.push(e)}return e.forEach((function(e){t.set(e.name,e)})),e.forEach((function(e){r.has(e.name)||i(e)})),n}function B(e){return e.split("-")[0]}var R=Math.max,L=Math.min,$=Math.round;function U(e,t){var r=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(r&&u(r)){var n=t;do{if(n&&e.isSameNode(n))return!0;n=n.parentNode||n.host}while(n)}return!1}function F(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function z(e,t){return t===C?F(function(e){var t=i(e),r=l(e),n=t.visualViewport,o=r.clientWidth,s=r.clientHeight,a=0,u=0;return n&&(o=n.width,s=n.height,/^((?!chrome|android).)*safari/i.test(navigator.userAgent)||(a=n.offsetLeft,u=n.offsetTop)),{width:o,height:s,x:a+d(e),y:u}}(e)):a(t)?function(e){var t=n(e);return t.top=t.top+e.clientTop,t.left=t.left+e.clientLeft,t.bottom=t.top+e.clientHeight,t.right=t.left+e.clientWidth,t.width=e.clientWidth,t.height=e.clientHeight,t.x=t.left,t.y=t.top,t}(t):F(function(e){var t,r=l(e),n=o(e),i=null==(t=e.ownerDocument)?void 0:t.body,s=R(r.scrollWidth,r.clientWidth,i?i.scrollWidth:0,i?i.clientWidth:0),a=R(r.scrollHeight,r.clientHeight,i?i.scrollHeight:0,i?i.clientHeight:0),u=-n.scrollLeft+d(e),c=-n.scrollTop;return"rtl"===f(i||r).direction&&(u+=R(r.clientWidth,i?i.clientWidth:0)-s),{width:s,height:a,x:u,y:c}}(l(e)))}function H(e,t,r){var n="clippingParents"===t?function(e){var t=v(g(e)),r=["absolute","fixed"].indexOf(f(e).position)>=0&&a(e)?M(e):e;return s(r)?t.filter((function(e){return s(e)&&U(e,r)&&"body"!==c(e)})):[]}(e):[].concat(t),i=[].concat(n,[r]),o=i[0],u=i.reduce((function(t,r){var n=z(e,r);return t.top=R(n.top,t.top),t.right=L(n.right,t.right),t.bottom=L(n.bottom,t.bottom),t.left=R(n.left,t.left),t}),z(e,o));return u.width=u.right-u.left,u.height=u.bottom-u.top,u.x=u.left,u.y=u.top,u}function W(e){return e.split("-")[1]}function V(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function Z(e){var t,r=e.reference,n=e.element,i=e.placement,o=i?B(i):null,s=i?W(i):null,a=r.x+r.width/2-n.width/2,u=r.y+r.height/2-n.height/2;switch(o){case _:t={x:a,y:r.y-n.height};break;case O:t={x:a,y:r.y+r.height};break;case E:t={x:r.x+r.width,y:u};break;case T:t={x:r.x-n.width,y:u};break;default:t={x:r.x,y:r.y}}var c=o?V(o):null;if(null!=c){var l="y"===c?"height":"width";switch(s){case x:t[c]=t[c]-(r[l]/2-n[l]/2);break;case S:t[c]=t[c]+(r[l]/2-n[l]/2)}}return t}function q(e){return Object.assign({},{top:0,right:0,bottom:0,left:0},e)}function G(e,t){return t.reduce((function(t,r){return t[r]=e,t}),{})}function K(e,t){void 0===t&&(t={});var r=t,i=r.placement,o=void 0===i?e.placement:i,a=r.boundary,u=void 0===a?"clippingParents":a,c=r.rootBoundary,d=void 0===c?C:c,f=r.elementContext,h=void 0===f?A:f,p=r.altBoundary,m=void 0!==p&&p,g=r.padding,y=void 0===g?0:g,v=q("number"!=typeof y?y:G(y,k)),b=h===A?"reference":A,w=e.elements.reference,M=e.rects.popper,T=e.elements[m?b:h],j=H(s(T)?T:T.contextElement||l(e.elements.popper),u,d),x=n(w),S=Z({reference:x,element:M,strategy:"absolute",placement:o}),I=F(Object.assign({},M,S)),D=h===A?I:x,P={top:j.top-D.top+v.top,bottom:D.bottom-j.bottom+v.bottom,left:j.left-D.left+v.left,right:D.right-j.right+v.right},N=e.modifiersData.offset;if(h===A&&N){var B=N[o];Object.keys(P).forEach((function(e){var t=[E,O].indexOf(e)>=0?1:-1,r=[_,O].indexOf(e)>=0?"y":"x";P[e]+=B[r]*t}))}return P}var X={placement:"bottom",modifiers:[],strategy:"absolute"};function J(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return!t.some((function(e){return!(e&&"function"==typeof e.getBoundingClientRect)}))}function Y(e){void 0===e&&(e={});var t=e,r=t.defaultModifiers,n=void 0===r?[]:r,i=t.defaultOptions,o=void 0===i?X:i;return function(e,t,r){void 0===r&&(r=o);var i,a,u={placement:"bottom",orderedModifiers:[],options:Object.assign({},X,o),modifiersData:{},elements:{reference:e,popper:t},attributes:{},styles:{}},c=[],l=!1,d={state:u,setOptions:function(r){f(),u.options=Object.assign({},o,u.options,r),u.scrollParents={reference:s(e)?v(e):e.contextElement?v(e.contextElement):[],popper:v(t)};var i=function(e){var t=N(e);return P.reduce((function(e,r){return e.concat(t.filter((function(e){return e.phase===r})))}),[])}(function(e){var t=e.reduce((function(e,t){var r=e[t.name];return e[t.name]=r?Object.assign({},r,t,{options:Object.assign({},r.options,t.options),data:Object.assign({},r.data,t.data)}):t,e}),{});return Object.keys(t).map((function(e){return t[e]}))}([].concat(n,u.options.modifiers)));return u.orderedModifiers=i.filter((function(e){return e.enabled})),u.orderedModifiers.forEach((function(e){var t=e.name,r=e.options,n=void 0===r?{}:r,i=e.effect;if("function"==typeof i){var o=i({state:u,name:t,instance:d,options:n}),s=function(){};c.push(o||s)}})),d.update()},forceUpdate:function(){if(!l){var e=u.elements,t=e.reference,r=e.popper;if(J(t,r)){u.rects={reference:p(t,M(r),"fixed"===u.options.strategy),popper:m(r)},u.reset=!1,u.placement=u.options.placement,u.orderedModifiers.forEach((function(e){return u.modifiersData[e.name]=Object.assign({},e.data)}));for(var n=0;n<u.orderedModifiers.length;n++)if(!0!==u.reset){var i=u.orderedModifiers[n],o=i.fn,s=i.options,a=void 0===s?{}:s,c=i.name;"function"==typeof o&&(u=o({state:u,options:a,name:c,instance:d})||u)}else u.reset=!1,n=-1}}},update:(i=function(){return new Promise((function(e){d.forceUpdate(),e(u)}))},function(){return a||(a=new Promise((function(e){Promise.resolve().then((function(){a=undefined,e(i())}))}))),a}),destroy:function(){f(),l=!0}};if(!J(e,t))return d;function f(){c.forEach((function(e){return e()})),c=[]}return d.setOptions(r).then((function(e){!l&&r.onFirstUpdate&&r.onFirstUpdate(e)})),d}}var Q={passive:!0};var ee={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:function(e){var t=e.state,r=e.instance,n=e.options,o=n.scroll,s=void 0===o||o,a=n.resize,u=void 0===a||a,c=i(t.elements.popper),l=[].concat(t.scrollParents.reference,t.scrollParents.popper);return s&&l.forEach((function(e){e.addEventListener("scroll",r.update,Q)})),u&&c.addEventListener("resize",r.update,Q),function(){s&&l.forEach((function(e){e.removeEventListener("scroll",r.update,Q)})),u&&c.removeEventListener("resize",r.update,Q)}},data:{}};var te={name:"popperOffsets",enabled:!0,phase:"read",fn:function(e){var t=e.state,r=e.name;t.modifiersData[r]=Z({reference:t.rects.reference,element:t.rects.popper,strategy:"absolute",placement:t.placement})},data:{}},re={top:"auto",right:"auto",bottom:"auto",left:"auto"};function ne(e){var t,r=e.popper,n=e.popperRect,o=e.placement,s=e.offsets,a=e.position,u=e.gpuAcceleration,c=e.adaptive,d=e.roundOffsets,h=!0===d?function(e){var t=e.x,r=e.y,n=window.devicePixelRatio||1;return{x:$($(t*n)/n)||0,y:$($(r*n)/n)||0}}(s):"function"==typeof d?d(s):s,p=h.x,m=void 0===p?0:p,g=h.y,y=void 0===g?0:g,v=s.hasOwnProperty("x"),b=s.hasOwnProperty("y"),w=T,j=_,k=window;if(c){var x=M(r),S="clientHeight",C="clientWidth";x===i(r)&&"static"!==f(x=l(r)).position&&(S="scrollHeight",C="scrollWidth"),o===_&&(j=O,y-=x[S]-n.height,y*=u?1:-1),o===T&&(w=E,m-=x[C]-n.width,m*=u?1:-1)}var A,I=Object.assign({position:a},c&&re);return u?Object.assign({},I,((A={})[j]=b?"0":"",A[w]=v?"0":"",A.transform=(k.devicePixelRatio||1)<2?"translate("+m+"px, "+y+"px)":"translate3d("+m+"px, "+y+"px, 0)",A)):Object.assign({},I,((t={})[j]=b?y+"px":"",t[w]=v?m+"px":"",t.transform="",t))}var ie={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:function(e){var t=e.state,r=e.options,n=r.gpuAcceleration,i=void 0===n||n,o=r.adaptive,s=void 0===o||o,a=r.roundOffsets,u=void 0===a||a,c={placement:B(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:i};null!=t.modifiersData.popperOffsets&&(t.styles.popper=Object.assign({},t.styles.popper,ne(Object.assign({},c,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:s,roundOffsets:u})))),null!=t.modifiersData.arrow&&(t.styles.arrow=Object.assign({},t.styles.arrow,ne(Object.assign({},c,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:u})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})},data:{}};var oe={name:"applyStyles",enabled:!0,phase:"write",fn:function(e){var t=e.state;Object.keys(t.elements).forEach((function(e){var r=t.styles[e]||{},n=t.attributes[e]||{},i=t.elements[e];a(i)&&c(i)&&(Object.assign(i.style,r),Object.keys(n).forEach((function(e){var t=n[e];!1===t?i.removeAttribute(e):i.setAttribute(e,!0===t?"":t)})))}))},effect:function(e){var t=e.state,r={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,r.popper),t.styles=r,t.elements.arrow&&Object.assign(t.elements.arrow.style,r.arrow),function(){Object.keys(t.elements).forEach((function(e){var n=t.elements[e],i=t.attributes[e]||{},o=Object.keys(t.styles.hasOwnProperty(e)?t.styles[e]:r[e]).reduce((function(e,t){return e[t]="",e}),{});a(n)&&c(n)&&(Object.assign(n.style,o),Object.keys(i).forEach((function(e){n.removeAttribute(e)})))}))}},requires:["computeStyles"]};var se={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:function(e){var t=e.state,r=e.options,n=e.name,i=r.offset,o=void 0===i?[0,0]:i,s=D.reduce((function(e,r){return e[r]=function(e,t,r){var n=B(e),i=[T,_].indexOf(n)>=0?-1:1,o="function"==typeof r?r(Object.assign({},t,{placement:e})):r,s=o[0],a=o[1];return s=s||0,a=(a||0)*i,[T,E].indexOf(n)>=0?{x:a,y:s}:{x:s,y:a}}(r,t.rects,o),e}),{}),a=s[t.placement],u=a.x,c=a.y;null!=t.modifiersData.popperOffsets&&(t.modifiersData.popperOffsets.x+=u,t.modifiersData.popperOffsets.y+=c),t.modifiersData[n]=s}},ae={left:"right",right:"left",bottom:"top",top:"bottom"};function ue(e){return e.replace(/left|right|bottom|top/g,(function(e){return ae[e]}))}var ce={start:"end",end:"start"};function le(e){return e.replace(/start|end/g,(function(e){return ce[e]}))}function de(e,t){void 0===t&&(t={});var r=t,n=r.placement,i=r.boundary,o=r.rootBoundary,s=r.padding,a=r.flipVariations,u=r.allowedAutoPlacements,c=void 0===u?D:u,l=W(n),d=l?a?I:I.filter((function(e){return W(e)===l})):k,f=d.filter((function(e){return c.indexOf(e)>=0}));0===f.length&&(f=d);var h=f.reduce((function(t,r){return t[r]=K(e,{placement:r,boundary:i,rootBoundary:o,padding:s})[B(r)],t}),{});return Object.keys(h).sort((function(e,t){return h[e]-h[t]}))}var fe={name:"flip",enabled:!0,phase:"main",fn:function(e){var t=e.state,r=e.options,n=e.name;if(!t.modifiersData[n]._skip){for(var i=r.mainAxis,o=void 0===i||i,s=r.altAxis,a=void 0===s||s,u=r.fallbackPlacements,c=r.padding,l=r.boundary,d=r.rootBoundary,f=r.altBoundary,h=r.flipVariations,p=void 0===h||h,m=r.allowedAutoPlacements,g=t.options.placement,y=B(g),v=u||(y===g||!p?[ue(g)]:function(e){if(B(e)===j)return[];var t=ue(e);return[le(e),t,le(t)]}(g)),b=[g].concat(v).reduce((function(e,r){return e.concat(B(r)===j?de(t,{placement:r,boundary:l,rootBoundary:d,padding:c,flipVariations:p,allowedAutoPlacements:m}):r)}),[]),w=t.rects.reference,M=t.rects.popper,k=new Map,S=!0,C=b[0],A=0;A<b.length;A++){var I=b[A],D=B(I),P=W(I)===x,N=[_,O].indexOf(D)>=0,R=N?"width":"height",L=K(t,{placement:I,boundary:l,rootBoundary:d,altBoundary:f,padding:c}),$=N?P?E:T:P?O:_;w[R]>M[R]&&($=ue($));var U=ue($),F=[];if(o&&F.push(L[D]<=0),a&&F.push(L[$]<=0,L[U]<=0),F.every((function(e){return e}))){C=I,S=!1;break}k.set(I,F)}if(S)for(var z=function(e){var t=b.find((function(t){var r=k.get(t);if(r)return r.slice(0,e).every((function(e){return e}))}));if(t)return C=t,"break"},H=p?3:1;H>0;H--){if("break"===z(H))break}t.placement!==C&&(t.modifiersData[n]._skip=!0,t.placement=C,t.reset=!0)}},requiresIfExists:["offset"],data:{_skip:!1}};function he(e,t,r){return R(e,L(t,r))}var pe={name:"preventOverflow",enabled:!0,phase:"main",fn:function(e){var t=e.state,r=e.options,n=e.name,i=r.mainAxis,o=void 0===i||i,s=r.altAxis,a=void 0!==s&&s,u=r.boundary,c=r.rootBoundary,l=r.altBoundary,d=r.padding,f=r.tether,h=void 0===f||f,p=r.tetherOffset,g=void 0===p?0:p,y=K(t,{boundary:u,rootBoundary:c,padding:d,altBoundary:l}),v=B(t.placement),b=W(t.placement),w=!b,j=V(v),k="x"===j?"y":"x",S=t.modifiersData.popperOffsets,C=t.rects.reference,A=t.rects.popper,I="function"==typeof g?g(Object.assign({},t.rects,{placement:t.placement})):g,D={x:0,y:0};if(S){if(o||a){var P="y"===j?_:T,N="y"===j?O:E,$="y"===j?"height":"width",U=S[j],F=S[j]+y[P],z=S[j]-y[N],H=h?-A[$]/2:0,Z=b===x?C[$]:A[$],q=b===x?-A[$]:-C[$],G=t.elements.arrow,X=h&&G?m(G):{width:0,height:0},J=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:{top:0,right:0,bottom:0,left:0},Y=J[P],Q=J[N],ee=he(0,C[$],X[$]),te=w?C[$]/2-H-ee-Y-I:Z-ee-Y-I,re=w?-C[$]/2+H+ee+Q+I:q+ee+Q+I,ne=t.elements.arrow&&M(t.elements.arrow),ie=ne?"y"===j?ne.clientTop||0:ne.clientLeft||0:0,oe=t.modifiersData.offset?t.modifiersData.offset[t.placement][j]:0,se=S[j]+te-oe-ie,ae=S[j]+re-oe;if(o){var ue=he(h?L(F,se):F,U,h?R(z,ae):z);S[j]=ue,D[j]=ue-U}if(a){var ce="x"===j?_:T,le="x"===j?O:E,de=S[k],fe=de+y[ce],pe=de-y[le],me=he(h?L(fe,se):fe,de,h?R(pe,ae):pe);S[k]=me,D[k]=me-de}}t.modifiersData[n]=D}},requiresIfExists:["offset"]};var me={name:"arrow",enabled:!0,phase:"main",fn:function(e){var t,r=e.state,n=e.name,i=e.options,o=r.elements.arrow,s=r.modifiersData.popperOffsets,a=B(r.placement),u=V(a),c=[T,E].indexOf(a)>=0?"height":"width";if(o&&s){var l=function(e,t){return q("number"!=typeof(e="function"==typeof e?e(Object.assign({},t.rects,{placement:t.placement})):e)?e:G(e,k))}(i.padding,r),d=m(o),f="y"===u?_:T,h="y"===u?O:E,p=r.rects.reference[c]+r.rects.reference[u]-s[u]-r.rects.popper[c],g=s[u]-r.rects.reference[u],y=M(o),v=y?"y"===u?y.clientHeight||0:y.clientWidth||0:0,b=p/2-g/2,w=l[f],j=v-d[c]-l[h],x=v/2-d[c]/2+b,S=he(w,x,j),C=u;r.modifiersData[n]=((t={})[C]=S,t.centerOffset=S-x,t)}},effect:function(e){var t=e.state,r=e.options.element,n=void 0===r?"[data-popper-arrow]":r;null!=n&&("string"!=typeof n||(n=t.elements.popper.querySelector(n)))&&U(t.elements.popper,n)&&(t.elements.arrow=n)},requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function ge(e,t,r){return void 0===r&&(r={x:0,y:0}),{top:e.top-t.height-r.y,right:e.right-t.width+r.x,bottom:e.bottom-t.height+r.y,left:e.left-t.width-r.x}}function ye(e){return[_,E,O,T].some((function(t){return e[t]>=0}))}var ve={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:function(e){var t=e.state,r=e.name,n=t.rects.reference,i=t.rects.popper,o=t.modifiersData.preventOverflow,s=K(t,{elementContext:"reference"}),a=K(t,{altBoundary:!0}),u=ge(s,n),c=ge(a,i,o),l=ye(u),d=ye(c);t.modifiersData[r]={referenceClippingOffsets:u,popperEscapeOffsets:c,isReferenceHidden:l,hasPopperEscaped:d},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":l,"data-popper-escaped":d})}},be=Y({defaultModifiers:[ee,te,ie,oe]}),we=[ee,te,ie,oe,se,fe,pe,me,ve],Me=Y({defaultModifiers:we});r.applyStyles=oe,r.arrow=me,r.computeStyles=ie,r.createPopper=Me,r.createPopperLite=be,r.defaultModifiers=we,r.detectOverflow=K,r.eventListeners=ee,r.flip=fe,r.hide=ve,r.offset=se,r.popperGenerator=Y,r.popperOffsets=te,r.preventOverflow=pe}}},{package:"@popperjs/core",file:"node_modules/@popperjs/core/dist/cjs/popper.js"}],[1391,{"./redux-toolkit.cjs.development.js":1392},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){t.exports=e("./redux-toolkit.cjs.development.js")}}},{package:"@reduxjs/toolkit",file:"node_modules/@reduxjs/toolkit/dist/index.js"}],[1392,{immer:2694,redux:3194,"redux-thunk":3193,reselect:1393},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){function n(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}var i,o=this&&this.__extends||(i=function(e,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},i(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){n(this,constructor,e)}i(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),s=this&&this.__generator||function(e,t){var r,n,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(o){return function(a){return function(o){if(r)throw new TypeError("Generator is already executing.");for(;s;)try{if(r=1,n&&(i=2&o[0]?n.return:o[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,o[1])).done)return i;switch(n=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,n=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!(i=s.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){s.label=o[1];break}if(6===o[0]&&s.label<i[1]){s.label=i[1],i=o;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(o);break}i[2]&&s.ops.pop(),s.trys.pop();continue}o=t.call(e,s)}catch(e){o=[6,e],n=0}finally{r=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,a])}}},a=this&&this.__spreadArray||function(e,t){for(var r=0,n=t.length,i=e.length;r<n;r++,i++)e[i]=t[r];return e},u=Object.create,c=Object.defineProperty,l=Object.defineProperties,d=Object.getOwnPropertyDescriptor,f=Object.getOwnPropertyDescriptors,h=Object.getOwnPropertyNames,p=Object.getOwnPropertySymbols,m=Object.getPrototypeOf,g=Object.prototype.hasOwnProperty,y=Object.prototype.propertyIsEnumerable,v=function(e,t,r){return t in e?c(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r},b=function(e,t){for(var r in t||(t={}))g.call(t,r)&&v(e,r,t[r]);if(p)for(var n=0,i=p(t);n<i.length;n++){r=i[n];y.call(t,r)&&v(e,r,t[r])}return e},w=function(e,t){return l(e,f(t))},M=function(e){return c(e,"__esModule",{value:!0})},_=function(e,t,r){if(t&&"object"==typeof t||"function"==typeof t)for(var n=function(n){g.call(e,n)||"default"===n||c(e,n,{get:function(){return t[n]},enumerable:!(r=d(t,n))||r.enumerable})},i=0,o=h(t);i<o.length;i++){n(o[i])}return e},O=function(e){return _(M(c(null!=e?u(m(e)):{},"default",e&&e.__esModule&&"default"in e?{get:function(){return e.default},enumerable:!0}:{value:e,enumerable:!0})),e)};M(r),function(e,t){for(var r in t)c(e,r,{get:t[r],enumerable:!0})}(r,{MiddlewareArray:function(){return B},configureStore:function(){return X},createAction:function(){return J},createAsyncThunk:function(){return ye},createDraftSafeSelector:function(){return S},createEntityAdapter:function(){return de},createImmutableStateInvariantMiddleware:function(){return W},createNextState:function(){return T.default},createReducer:function(){return re},createSelector:function(){return j.createSelector},createSerializableStateInvariantMiddleware:function(){return q},createSlice:function(){return ne},current:function(){return T.current},findNonSerializableValue:function(){return Z},freeze:function(){return T.freeze},getDefaultMiddleware:function(){return K},getType:function(){return Q},isAllOf:function(){return Me},isAnyOf:function(){return we},isAsyncThunkAction:function(){return xe},isDraft:function(){return T.isDraft},isFulfilled:function(){return ke},isImmutableDefault:function(){return U},isPending:function(){return Ee},isPlain:function(){return V},isPlainObject:function(){return D},isRejected:function(){return Te},isRejectedWithValue:function(){return je},miniSerializeError:function(){return ge},nanoid:function(){return fe},original:function(){return T.original},unwrapResult:function(){return ve}});var E=O(e("immer"));_(r,O(e("redux")));var T=O(e("immer")),j=O(e("reselect")),k=O(e("immer")),x=O(e("reselect")),S=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=x.createSelector.apply(void 0,e),n=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];return r.apply(void 0,a([(0,k.isDraft)(e)?(0,k.current)(e):e],t))};return n},C=O(e("redux")),A=O(e("redux")),I="undefined"!=typeof window&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(0!==arguments.length)return"object"==typeof arguments[0]?A.compose:A.compose.apply(null,arguments)};"undefined"!=typeof window&&window.__REDUX_DEVTOOLS_EXTENSION__&&window.__REDUX_DEVTOOLS_EXTENSION__;function D(e){if("object"!=typeof e||null===e)return!1;for(var t=e;null!==Object.getPrototypeOf(t);)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}var P=O(e("redux-thunk"));function N(e,t){var r=0;return{measureTime:function(e){var t=Date.now();try{return e()}finally{var n=Date.now();r+=n-t}},warnIfExceeded:function(){r>e&&console.warn(t+" took "+r+"ms, which is more than the warning threshold of "+e+"ms. \nIf your state or actions are very large, you may want to disable the middleware as it might cause too much of a slowdown in development mode. See https://redux-toolkit.js.org/api/getDefaultMiddleware for instructions.\nIt is disabled in production builds, so you don't need to worry about that.")}}}var B=function(e){function t(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];var i=e.apply(this,r)||this;return Object.setPrototypeOf(i,t.prototype),i}return o(t,e),Object.defineProperty(t,Symbol.species,{get:function(){return t},enumerable:!1,configurable:!0}),n(t.prototype,"concat",(function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return e.prototype.concat.apply(this,t)})),n(t.prototype,"prepend",(function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];return 1===e.length&&Array.isArray(e[0])?new(t.bind.apply(t,a([void 0],e[0].concat(this)))):new(t.bind.apply(t,a([void 0],e.concat(this))))})),t}(Array),R="Invariant failed";function L(e,t){if(!e)throw new Error(R+": "+(t||""))}function $(e,t,r,n){return JSON.stringify(e,function(e,t){var r=[],n=[];t||(t=function(e,t){return r[0]===t?"[Circular ~]":"[Circular ~."+n.slice(0,r.indexOf(t)).join(".")+"]"});return function(i,o){if(r.length>0){var s=r.indexOf(this);~s?r.splice(s+1):r.push(this),~s?n.splice(s,Infinity,i):n.push(i),~r.indexOf(o)&&(o=t.call(this,i,o))}else r.push(o);return null==e?o:e.call(this,i,o)}}(t,n),r)}function U(e){return"object"!=typeof e||null==e||Object.isFrozen(e)}function F(e,t,r){var n=z(e,t,r);return{detectMutations:function(){return H(e,t,n,r)}}}function z(e,t,r,n){void 0===t&&(t=[]),void 0===n&&(n="");var i={value:r};if(!e(r))for(var o in i.children={},r){var s=n?n+"."+o:o;t.length&&-1!==t.indexOf(s)||(i.children[o]=z(e,t,r[o],s))}return i}function H(e,t,r,n,i,o){void 0===t&&(t=[]),void 0===i&&(i=!1),void 0===o&&(o="");var s=r?r.value:void 0,a=s===n;if(i&&!a&&!Number.isNaN(n))return{wasMutated:!0,path:o};if(e(s)||e(n))return{wasMutated:!1};var u={};for(var c in r.children)u[c]=!0;for(var c in n)u[c]=!0;for(var c in u){var l=o?o+"."+c:c;if(!t.length||-1===t.indexOf(l)){var d=H(e,t,r.children[c],n[c],a,l);if(d.wasMutated)return d}}return{wasMutated:!1}}function W(e){void 0===e&&(e={});var t=e.isImmutable,r=void 0===t?U:t,n=e.ignoredPaths,i=e.warnAfter,o=void 0===i?32:i,s=e.ignore;n=n||s;var a=F.bind(null,r,n);return function(e){var t,r=e.getState,n=r(),i=a(n);return function(e){return function(s){var u=N(o,"ImmutableStateInvariantMiddleware");u.measureTime((function(){n=r(),t=i.detectMutations(),i=a(n),L(!t.wasMutated,"A state mutation was detected between dispatches, in the path '"+(t.path||"")+"'.  This may cause incorrect behavior. (https://redux.js.org/style-guide/style-guide#do-not-mutate-state)")}));var c=e(s);return u.measureTime((function(){n=r(),t=i.detectMutations(),i=a(n),t.wasMutated&&L(!t.wasMutated,"A state mutation was detected inside a dispatch, in the path: "+(t.path||"")+". Take a look at the reducer(s) handling the action "+$(s)+". (https://redux.js.org/style-guide/style-guide#do-not-mutate-state)")})),u.warnIfExceeded(),c}}}}function V(e){var t=typeof e;return"undefined"===t||null===e||"string"===t||"boolean"===t||"number"===t||Array.isArray(e)||D(e)}function Z(e,t,r,n,i){var o;if(void 0===t&&(t=""),void 0===r&&(r=V),void 0===i&&(i=[]),!r(e))return{keyPath:t||"<root>",value:e};if("object"!=typeof e||null===e)return!1;for(var s=null!=n?n(e):Object.entries(e),a=i.length>0,u=0,c=s;u<c.length;u++){var l=c[u],d=l[0],f=l[1],h=t?t+"."+d:d;if(!(a&&i.indexOf(h)>=0)){if(!r(f))return{keyPath:h,value:f};if("object"==typeof f&&(o=Z(f,h,r,n,i)))return o}}return!1}function q(e){void 0===e&&(e={});var t=e.isSerializable,r=void 0===t?V:t,n=e.getEntries,i=e.ignoredActions,o=void 0===i?[]:i,s=e.ignoredActionPaths,a=void 0===s?["meta.arg","meta.baseQueryMeta"]:s,u=e.ignoredPaths,c=void 0===u?[]:u,l=e.warnAfter,d=void 0===l?32:l,f=e.ignoreState,h=void 0!==f&&f;return function(e){return function(t){return function(i){if(o.length&&-1!==o.indexOf(i.type))return t(i);var s=N(d,"SerializableStateInvariantMiddleware");s.measureTime((function(){var e=Z(i,"",r,n,a);if(e){var t=e.keyPath,o=e.value;console.error("A non-serializable value was detected in an action, in the path: `"+t+"`. Value:",o,"\nTake a look at the logic that dispatched this action: ",i,"\n(See https://redux.js.org/faq/actions#why-should-type-be-a-string-or-at-least-serializable-why-should-my-action-types-be-constants)","\n(To allow non-serializable values see: https://redux-toolkit.js.org/usage/usage-guide#working-with-non-serializable-data)")}}));var u=t(i);return h||(s.measureTime((function(){var t=Z(e.getState(),"",r,n,c);if(t){var o=t.keyPath,s=t.value;console.error("A non-serializable value was detected in the state, in the path: `"+o+"`. Value:",s,"\nTake a look at the reducer(s) handling this action type: "+i.type+".\n(See https://redux.js.org/faq/organizing-state#can-i-put-functions-promises-or-other-non-serializable-items-in-my-store-state)")}})),s.warnIfExceeded()),u}}}}function G(e){return"boolean"==typeof e}function K(e){void 0===e&&(e={});var t=e.thunk,r=void 0===t||t,n=e.immutableCheck,i=void 0===n||n,o=e.serializableCheck,s=void 0===o||o,a=new B;if(r&&(G(r)?a.push(P.default):a.push(P.default.withExtraArgument(r.extraArgument))),i){var u={};G(i)||(u=i),a.unshift(W(u))}if(s){var c={};G(s)||(c=s),a.push(q(c))}return a}function X(e){var t,r=function(e){return K(e)},n=e||{},i=n.reducer,o=void 0===i?void 0:i,s=n.middleware,u=void 0===s?r():s,c=n.devTools,l=void 0===c||c,d=n.preloadedState,f=void 0===d?void 0:d,h=n.enhancers,p=void 0===h?void 0:h;if("function"==typeof o)t=o;else{if(!D(o))throw new Error('"reducer" is a required argument, and must be a function or an object of functions that can be passed to combineReducers');t=(0,C.combineReducers)(o)}var m=u;if("function"==typeof m&&(m=m(r),!Array.isArray(m)))throw new Error("when using a middleware builder function, an array of middleware must be returned");if(m.some((function(e){return"function"!=typeof e})))throw new Error("each middleware provided to configureStore must be a function");var g=C.applyMiddleware.apply(void 0,m),y=C.compose;l&&(y=I(b({trace:!0},"object"==typeof l&&l)));var v=[g];Array.isArray(p)?v=a([g],p):"function"==typeof p&&(v=p(v));var w=y.apply(void 0,v);return(0,C.createStore)(t,f,w)}function J(e,t){function r(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];if(t){var i=t.apply(void 0,r);if(!i)throw new Error("prepareAction did not return an object");return b(b({type:e,payload:i.payload},"meta"in i&&{meta:i.meta}),"error"in i&&{error:i.error})}return{type:e,payload:r[0]}}return r.toString=function(){return""+e},r.type=e,r.match=function(t){return t.type===e},r}function Y(e){return["type","payload","error","meta"].indexOf(e)>-1}function Q(e){return""+e}var ee=O(e("immer"));function te(e){var t,r={},n=[],i={addCase:function(e,o){if(n.length>0)throw new Error("`builder.addCase` should only be called before calling `builder.addMatcher`");if(t)throw new Error("`builder.addCase` should only be called before calling `builder.addDefaultCase`");var s="string"==typeof e?e:e.type;if(s in r)throw new Error("addCase cannot be called with two reducers for the same action type");return r[s]=o,i},addMatcher:function(e,r){if(t)throw new Error("`builder.addMatcher` should only be called before calling `builder.addDefaultCase`");return n.push({matcher:e,reducer:r}),i},addDefaultCase:function(e){if(t)throw new Error("`builder.addDefaultCase` can only be called once");return t=e,i}};return e(i),[r,n,t]}function re(e,t,r,n){void 0===r&&(r=[]);var i="function"==typeof t?te(t):[t,r,n],o=i[0],s=i[1],u=i[2],c=(0,ee.default)(e,(function(){}));return function(e,t){void 0===e&&(e=c);var r=a([o[t.type]],s.filter((function(e){return(0,e.matcher)(t)})).map((function(e){return e.reducer})));return 0===r.filter((function(e){return!!e})).length&&(r=[u]),r.reduce((function(e,r){if(r){var n;if((0,ee.isDraft)(e))return void 0===(n=r(e,t))?e:n;if((0,ee.isDraftable)(e))return(0,ee.default)(e,(function(e){return r(e,t)}));if(void 0===(n=r(e,t))){if(null===e)return e;throw Error("A case reducer on a non-draftable value must not return undefined")}return n}return e}),e)}}function ne(e){var t=e.name,r=e.initialState;if(!t)throw new Error("`name` is a required option for createSlice");var n=e.reducers||{},i="function"==typeof e.extraReducers?te(e.extraReducers):[e.extraReducers],o=i[0],s=void 0===o?{}:o,a=i[1],u=void 0===a?[]:a,c=i[2],l=void 0===c?void 0:c,d=Object.keys(n),f={},h={},p={};d.forEach((function(e){var r,i,o=n[e],s=t+"/"+e;"reducer"in o?(r=o.reducer,i=o.prepare):r=o,f[e]=r,h[s]=r,p[e]=i?J(s,i):J(s)}));var m=re(r,b(b({},s),h),u,l);return{name:t,reducer:m,actions:p,caseReducers:f}}var ie=O(e("immer"));function oe(e){return function(t,r){function n(e){return D(t=e)&&"string"==typeof t.type&&Object.keys(t).every(Y);var t}var i=function(t){n(r)?e(r.payload,t):e(r,t)};return(0,ie.isDraft)(t)?(i(t),t):(0,ie.default)(t,i)}}function se(e,t){var r=t(e);return void 0===r&&console.warn("The entity passed to the `selectId` implementation returned undefined.","You should probably provide your own `selectId` implementation.","The entity that was passed:",e,"The `selectId` implementation:",t.toString()),r}function ae(e){return Array.isArray(e)||(e=Object.values(e)),e}function ue(e,t,r){for(var n=[],i=[],o=0,s=e=ae(e);o<s.length;o++){var a=s[o],u=se(a,t);u in r.entities?i.push({id:u,changes:a}):n.push(a)}return[n,i]}function ce(e){function t(t,r){var n=se(t,e);n in r.entities||(r.ids.push(n),r.entities[n]=t)}function r(e,r){for(var n=0,i=e=ae(e);n<i.length;n++){t(i[n],r)}}function n(t,r){var n=se(t,e);n in r.entities||r.ids.push(n),r.entities[n]=t}function i(e,t){var r=!1;e.forEach((function(e){e in t.entities&&(delete t.entities[e],r=!0)})),r&&(t.ids=t.ids.filter((function(e){return e in t.entities})))}function o(t,r){var n={},i={};if(t.forEach((function(e){e.id in r.entities&&(i[e.id]={id:e.id,changes:b(b({},i[e.id]?i[e.id].changes:null),e.changes)})})),(t=Object.values(i)).length>0){var o=t.filter((function(t){return function(t,r,n){var i=n.entities[r.id],o=Object.assign({},i,r.changes),s=se(o,e),a=s!==r.id;return a&&(t[r.id]=s,delete n.entities[r.id]),n.entities[s]=o,a}(n,t,r)})).length>0;o&&(r.ids=r.ids.map((function(e){return n[e]||e})))}}function s(t,n){var i=ue(t,e,n),s=i[0];o(i[1],n),r(s,n)}return{removeAll:(a=function(e){Object.assign(e,{ids:[],entities:{}})},u=oe((function(e,t){return a(t)})),function(e){return u(e,void 0)}),addOne:oe(t),addMany:oe(r),setOne:oe(n),setMany:oe((function(e,t){for(var r=0,i=e=ae(e);r<i.length;r++){n(i[r],t)}})),setAll:oe((function(e,t){e=ae(e),t.ids=[],t.entities={},r(e,t)})),updateOne:oe((function(e,t){return o([e],t)})),updateMany:oe(o),upsertOne:oe((function(e,t){return s([e],t)})),upsertMany:oe(s),removeOne:oe((function(e,t){return i([e],t)})),removeMany:oe(i)};var a,u}function le(e,t){var r=ce(e);function n(t,r){var n=(t=ae(t)).filter((function(t){return!(se(t,e)in r.entities)}));0!==n.length&&a(n,r)}function i(e,t){0!==(e=ae(e)).length&&a(e,t)}function o(t,r){var n=[];t.forEach((function(t){return function(t,r,n){if(!(r.id in n.entities))return!1;var i=n.entities[r.id],o=Object.assign({},i,r.changes),s=se(o,e);return delete n.entities[r.id],t.push(o),s!==r.id}(n,t,r)})),0!==n.length&&a(n,r)}function s(t,r){var i=ue(t,e,r),s=i[0];o(i[1],r),n(s,r)}function a(r,n){r.forEach((function(t){n.entities[e(t)]=t}));var i=Object.values(n.entities);i.sort(t);var o=i.map(e);(function(e,t){if(e.length!==t.length)return!1;for(var r=0;r<e.length&&r<t.length;r++)if(e[r]!==t[r])return!1;return!0})(n.ids,o)||(n.ids=o)}return{removeOne:r.removeOne,removeMany:r.removeMany,removeAll:r.removeAll,addOne:oe((function(e,t){return n([e],t)})),updateOne:oe((function(e,t){return o([e],t)})),upsertOne:oe((function(e,t){return s([e],t)})),setOne:oe((function(e,t){return i([e],t)})),setMany:oe(i),setAll:oe((function(e,t){e=ae(e),t.entities={},t.ids=[],n(e,t)})),addMany:oe(n),updateMany:oe(o),upsertMany:oe(s)}}function de(e){void 0===e&&(e={});var t=b({sortComparer:!1,selectId:function(e){return e.id}},e),r=t.selectId,n=t.sortComparer,i={getInitialState:function(e){return void 0===e&&(e={}),Object.assign({ids:[],entities:{}},e)}},o={getSelectors:function(e){var t=function(e){return e.ids},r=function(e){return e.entities},n=S(t,r,(function(e,t){return e.map((function(e){return t[e]}))})),i=function(e,t){return t},o=function(e,t){return e[t]},s=S(t,(function(e){return e.length}));if(!e)return{selectIds:t,selectEntities:r,selectAll:n,selectTotal:s,selectById:S(r,i,o)};var a=S(e,r);return{selectIds:S(e,t),selectEntities:a,selectAll:S(e,n),selectTotal:S(e,s),selectById:S(a,i,o)}}},s=n?le(r,n):ce(r);return b(b(b({selectId:r,sortComparer:n},i),o),s)}var fe=function(e){void 0===e&&(e=21);for(var t="",r=e;r--;)t+="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW"[64*Math.random()|0];return t},he=["name","message","stack","code"],pe=function(e,t){this.payload=e,this.meta=t},me=function(e,t){this.payload=e,this.meta=t},ge=function(e){if("object"==typeof e&&null!==e){for(var t={},r=0,n=he;r<n.length;r++){var i=n[r];"string"==typeof e[i]&&(t[i]=e[i])}return t}return{message:String(e)}};function ye(e,t,r){var n=J(e+"/fulfilled",(function(e,t,r,n){return{payload:e,meta:w(b({},n||{}),{arg:r,requestId:t,requestStatus:"fulfilled"})}})),i=J(e+"/pending",(function(e,t,r){return{payload:void 0,meta:w(b({},r||{}),{arg:t,requestId:e,requestStatus:"pending"})}})),o=J(e+"/rejected",(function(e,t,n,i,o){return{payload:i,error:(r&&r.serializeError||ge)(e||"Rejected"),meta:w(b({},o||{}),{arg:n,requestId:t,rejectedWithValue:!!i,requestStatus:"rejected",aborted:"AbortError"===(null==e?void 0:e.name),condition:"ConditionError"===(null==e?void 0:e.name)})}})),a=!1,u="undefined"!=typeof AbortController?AbortController:function(){function e(){this.signal={aborted:!1,addEventListener:function(){},dispatchEvent:function(){return!1},onabort:function(){},removeEventListener:function(){}}}return e.prototype.abort=function(){a||(a=!0,console.info("This platform does not implement AbortController. \nIf you want to use the AbortController to react to `abort` events, please consider importing a polyfill like 'abortcontroller-polyfill/dist/abortcontroller-polyfill-only'."))},e}();return Object.assign((function(e){return function(a,c,l){var d,f,h=(null!=(d=null==r?void 0:r.idGenerator)?d:fe)(),p=new u,m=new Promise((function(e,t){return p.signal.addEventListener("abort",(function(){return t({name:"AbortError",message:f||"Aborted"})}))})),g=!1;var y=function(){return u=this,d=null,f=function(){var u,d,f;return s(this,(function(s){switch(s.label){case 0:if(s.trys.push([0,2,,3]),r&&r.condition&&!1===r.condition(e,{getState:c,extra:l}))throw{name:"ConditionError",message:"Aborted due to condition callback returning false."};return g=!0,a(i(h,e,null==(u=null==r?void 0:r.getPendingMeta)?void 0:u.call(r,{requestId:h,arg:e},{getState:c,extra:l}))),[4,Promise.race([m,Promise.resolve(t(e,{dispatch:a,getState:c,extra:l,requestId:h,signal:p.signal,rejectWithValue:function(e,t){return new pe(e,t)},fulfillWithValue:function(e,t){return new me(e,t)}})).then((function(t){if(t instanceof pe)throw t;return t instanceof me?n(t.payload,h,e,t.meta):n(t,h,e)}))])];case 1:return d=s.sent(),[3,3];case 2:return f=s.sent(),d=f instanceof pe?o(null,h,e,f.payload,f.meta):o(f,h,e),[3,3];case 3:return r&&!r.dispatchConditionRejection&&o.match(d)&&d.meta.condition||a(d),[2,d]}}))},new Promise((function(e,t){var r=function(e){try{i(f.next(e))}catch(e){t(e)}},n=function(e){try{i(f.throw(e))}catch(e){t(e)}},i=function(t){return t.done?e(t.value):Promise.resolve(t.value).then(r,n)};i((f=f.apply(u,d)).next())}));var u,d,f}();return Object.assign(y,{abort:function(e){g&&(f=e,p.abort())},requestId:h,arg:e,unwrap:function(){return y.then(ve)}})}}),{pending:i,rejected:o,fulfilled:n,typePrefix:e})}function ve(e){if(e.meta&&e.meta.rejectedWithValue)throw e.payload;if(e.error)throw e.error;return e.payload}var be=function(e,t){return(r=e)&&"function"==typeof r.match?e.match(t):e(t);var r};function we(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return function(t){return e.some((function(e){return be(e,t)}))}}function Me(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return function(t){return e.every((function(e){return be(e,t)}))}}function _e(e,t){if(!e||!e.meta)return!1;var r="string"==typeof e.meta.requestId,n=t.indexOf(e.meta.requestStatus)>-1;return r&&n}function Oe(e){return"function"==typeof e[0]&&"pending"in e[0]&&"fulfilled"in e[0]&&"rejected"in e[0]}function Ee(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return 0===e.length?function(e){return _e(e,["pending"])}:Oe(e)?function(t){var r=e.map((function(e){return e.pending}));return we.apply(void 0,r)(t)}:Ee()(e[0])}function Te(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return 0===e.length?function(e){return _e(e,["rejected"])}:Oe(e)?function(t){var r=e.map((function(e){return e.rejected}));return we.apply(void 0,r)(t)}:Te()(e[0])}function je(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=function(e){return e&&e.meta&&e.meta.rejectedWithValue};return 0===e.length||Oe(e)?function(t){return Me(Te.apply(void 0,e),r)(t)}:je()(e[0])}function ke(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return 0===e.length?function(e){return _e(e,["fulfilled"])}:Oe(e)?function(t){var r=e.map((function(e){return e.fulfilled}));return we.apply(void 0,r)(t)}:ke()(e[0])}function xe(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return 0===e.length?function(e){return _e(e,["pending","fulfilled","rejected"])}:Oe(e)?function(t){for(var r=[],n=0,i=e;n<i.length;n++){var o=i[n];r.push(o.pending,o.rejected,o.fulfilled)}return we.apply(void 0,r)(t)}:xe()(e[0])}(0,E.enableES5)()}}},{package:"@reduxjs/toolkit",file:"node_modules/@reduxjs/toolkit/dist/redux-toolkit.cjs.development.js"}],[1393,{},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){function n(e,t){return e===t}function i(e,t,r){if(null===t||null===r||t.length!==r.length)return!1;for(var n=t.length,i=0;i<n;i++)if(!e(t[i],r[i]))return!1;return!0}function o(e){var t=arguments.length>1&&arguments[1]!==undefined?arguments[1]:n,r=null,o=null;return function(){return i(t,r,arguments)||(o=e.apply(null,arguments)),r=arguments,o}}function s(e){var t=Array.isArray(e[0])?e[0]:e;if(!t.every((function(e){return"function"==typeof e}))){var r=t.map((function(e){return typeof e})).join(", ");throw new Error("Selector creators expect all input-selectors to be functions, "+"instead received the following types: ["+r+"]")}return t}function a(e){for(var t=arguments.length,r=Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];return function(){for(var t=arguments.length,n=Array(t),i=0;i<t;i++)n[i]=arguments[i];var o=0,a=n.pop(),u=s(n),c=e.apply(undefined,[function(){return o++,a.apply(null,arguments)}].concat(r)),l=e((function(){for(var e=[],t=u.length,r=0;r<t;r++)e.push(u[r].apply(null,arguments));return c.apply(null,e)}));return l.resultFunc=a,l.dependencies=u,l.recomputations=function(){return o},l.resetRecomputations=function(){return o=0},l}}r.__esModule=!0,r.defaultMemoize=o,r.createSelectorCreator=a,r.createStructuredSelector=function(e){var t=arguments.length>1&&arguments[1]!==undefined?arguments[1]:u;if("object"!=typeof e)throw new Error("createStructuredSelector expects first argument to be an object "+"where each property is a selector, instead received a "+typeof e);var r=Object.keys(e);return t(r.map((function(t){return e[t]})),(function(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];return t.reduce((function(e,t,n){return e[r[n]]=t,e}),{})}))};var u=r.createSelector=a(o)}}},{package:"@reduxjs/toolkit>reselect",file:"node_modules/@reduxjs/toolkit/node_modules/reselect/lib/index.js"}],[1487,{"./wordLists":1492,"change-case":1971,"fast-check":2479},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){n===undefined&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){n===undefined&&(n=r),e[n]=t[r]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&n(t,e,r);return i(t,e),t},s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(r,"__esModule",{value:!0}),r.Abi=r.ConstructorEntry=r.FallbackEntry=r.ReceiveEntry=r.FunctionEntry=r.ErrorEntry=r.EventEntry=r.EventParameter=r.Parameter=void 0;const a=o(e("fast-check")),u=e("change-case"),c=s(e("./wordLists"));r.Parameter=()=>a.tuple(a.record({name:v()}),_()).map((([{name:e},t])=>Object.assign({name:e},t)));r.EventParameter=()=>a.tuple(a.record({name:v(),indexed:a.boolean()}),_()).map((([{name:e,indexed:t},r])=>Object.assign({name:e,indexed:t},r)));r.EventEntry=()=>a.record({type:a.constant("event"),name:b(),inputs:a.array((0,r.EventParameter)(),{maxLength:10}).filter((e=>{if(e.filter((({indexed:e})=>e)).length>3)return!1;const t=e.map((({name:e})=>e)).filter((e=>""!==e));return t.length===new Set(t).size})),anonymous:a.boolean()});r.ErrorEntry=()=>a.record({type:a.constant("error"),name:w(),inputs:a.array((0,r.Parameter)(),{maxLength:10}).filter((e=>{const t=e.map((({name:e})=>e)).filter((e=>""!==e));return t.length===new Set(t).size}))});r.FunctionEntry=()=>a.tuple(a.record({type:a.constant("function")},{withDeletedKeys:!0}),a.record({name:M(),inputs:a.array((0,r.Parameter)(),{maxLength:10})}),a.record({outputs:a.array((0,r.Parameter)(),{maxLength:10})},{withDeletedKeys:!0}),a.tuple(a.oneof(a.constant("pure"),a.constant("view"),a.constant("nonpayable"),a.constant("payable")),a.boolean(),a.boolean()).map((([e,t,r])=>{const n={stateMutability:e},i={payable:"payable"===e,constant:"view"===e||"pure"===e};return t&&r?Object.assign(Object.assign({},n),i):r?n:i}))).map((e=>e.reduce(((e,t)=>Object.assign(Object.assign({},e),t)),{}))).filter((e=>{const{inputs:t,outputs:r=[]}=e,n=[...t,...r].map((({name:e})=>e)).filter((e=>""!==e));return n.length===new Set(n).size}));r.ReceiveEntry=()=>a.record({type:a.constant("receive"),stateMutability:a.constant("payable")});r.FallbackEntry=()=>a.tuple(a.record({type:a.constant("fallback")}),a.tuple(a.oneof(a.constant("nonpayable"),a.constant("payable")),a.boolean(),a.boolean()).map((([e,t,r])=>{const n={stateMutability:e},i={payable:"payable"===e};return t&&r?Object.assign(Object.assign({},n),i):r?n:i}))).map((([{type:e},t])=>Object.assign({type:e},t)));r.ConstructorEntry=()=>a.tuple(a.record({type:a.constant("constructor"),inputs:a.array((0,r.Parameter)(),{maxLength:10}).filter((e=>{const t=e.map((({name:e})=>e)).filter((e=>""!==e));return t.length===new Set(t).size}))}),a.tuple(a.oneof(a.constant("nonpayable"),a.constant("payable")),a.boolean(),a.boolean()).map((([e,t,r])=>{const n={stateMutability:e},i={payable:"payable"===e};return t&&r?Object.assign(Object.assign({},n),i):r?n:i}))).map((([{type:e,inputs:t},r])=>Object.assign({type:e,inputs:t},r)));var l,d;r.Abi=()=>a.tuple((0,r.ConstructorEntry)(),(0,r.FallbackEntry)(),(0,r.ReceiveEntry)(),a.array(a.oneof((0,r.FunctionEntry)(),(0,r.EventEntry)(),(0,r.ErrorEntry)()))).chain((([e,t,r,n])=>a.shuffledSubarray([e,t,r,...n]))),function(e){e.Bytes=()=>a.nat(31).map((e=>32-e)),e.Bits=()=>e.Bytes().map((e=>8*e)),e.DecimalPlaces=()=>a.nat(79).map((e=>(e+17)%80+1)),e.Precision=()=>a.tuple(e.Bits(),e.DecimalPlaces())}(l||(l={})),function(e){e.Uint=()=>l.Bits().map((e=>`uint${e}`)),e.Int=()=>l.Bits().map((e=>`int${e}`)),e.Address=()=>a.constant("address"),e.Bool=()=>a.constant("bool"),e.Fixed=()=>l.Precision().map((([e,t])=>`fixed${e}x${t}`)),e.Ufixed=()=>l.Precision().map((([e,t])=>`ufixed${e}x${t}`)),e.BytesM=()=>l.Bytes().map((e=>`bytes${e}`)),e.Function=()=>a.constant("function"),e.Bytes=()=>a.constant("bytes"),e.String=()=>a.constant("string"),e.Tuple=()=>a.constant("tuple")}(d||(d={}));const f=()=>a.oneof(d.Uint(),d.Int(),d.Address(),d.Bool(),d.Fixed(),d.Ufixed(),d.BytesM(),d.Function(),d.Bytes(),d.String(),d.Tuple()),h=a.memo((e=>0===e?f():a.oneof(f(),p(e>3?3:e),m(e)))),p=a.memo((e=>a.tuple(h(e-1),a.integer({min:1,max:256})).map((([e,t])=>`${e}[${t}]`)))),m=a.memo((e=>h(e-1).map((e=>`${e}[]`)))),g=new Set(["Error","Panic","_","abi","abstract","addmod","address","after","alias","anonymous","apply","as","assembly","assert","auto","block","blockhash","bool","break","byte","bytes","calldata","case","catch","constant","constructor","continue","contract","copyof","days","default","define","delete","ecrecover","else","emit","enum","error","ether","event","external","fallback","false","final","finney","fixed","for","from","function","gasleft","gwei","hours","if","immutable","implements","import","in","indexed","inline","int","interface","internal","is","keccak256","let","library","log0","log1","log2","log3","log4","macro","mapping","match","memory","minutes","modifier","msg","mulmod","mutable","new","now","null","of","override","partial","payable","pragma","private","promise","public","pure","receive","reference","relocatable","require","return","returns","revert","ripemd160","sealed","seconds","selfdestruct","sha256","sha3","sizeof","static","storage","string","struct","suicide","super","supports","switch","szabo","this","throw","true","try","tx","type","typedef","typeof","ufixed","uint","unchecked","using","var","view","virtual","weeks","wei","while","years"]),y=(e=["noun"],t=u.camelCase)=>{const r=e.map((e=>a.constantFrom(...c.default[e])));return a.tuple(...r).map((e=>t(e.join(" ")))).filter((e=>!g.has(e)))},v=()=>a.oneof({arbitrary:y(["noun"]),weight:9},{arbitrary:a.constant(""),weight:1}),b=()=>y(["verb","noun"],u.pascalCase),w=()=>y(["noun","noun"],u.pascalCase),M=()=>y(["verb","noun"]),_=()=>h().chain((e=>e.startsWith("tuple")?a.record({type:a.constant(e),components:a.array((0,r.Parameter)().filter((({name:e})=>""!==e)),{minLength:1,maxLength:5}).filter((e=>{const t=e.map((({name:e})=>e)).filter((e=>""!==e));return t.length===new Set(t).size}))}):a.record({type:a.constant(e)})))}}},{package:"@truffle/codec>@truffle/abi-utils",file:"node_modules/@truffle/abi-utils/dist/lib/arbitrary.js"}],[1488,{"./arbitrary":1487,"./normalize":1489,"./signature":1490,"./types":1491},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){n===undefined&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){n===undefined&&(n=r),e[n]=t[r]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)},s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&n(t,e,r);return i(t,e),t};Object.defineProperty(r,"__esModule",{value:!0}),r.Arbitrary=void 0,o(e("./types"),r),o(e("./normalize"),r),o(e("./signature"),r);const a=s(e("./arbitrary"));r.Arbitrary=a}}},{package:"@truffle/codec>@truffle/abi-utils",file:"node_modules/@truffle/abi-utils/dist/lib/index.js"}],[1489,{},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.normalizeEntry=r.normalize=void 0;r.normalize=e=>e.map(r.normalizeEntry);r.normalizeEntry=e=>{if("event"===e.type||"error"===e.type)return e;const t=Object.assign(Object.assign(Object.assign({},e),n(e)),{type:e.type||"function"});return"function"===t.type&&(t.outputs=t.outputs||[]),delete t.payable,delete t.constant,t};const n=({stateMutability:e,payable:t,constant:r})=>e?{stateMutability:e}:{stateMutability:t?"payable":r?"view":"nonpayable"}}}},{package:"@truffle/codec>@truffle/abi-utils",file:"node_modules/@truffle/abi-utils/dist/lib/normalize.js"}],[1490,{"web3-utils":3381},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.abiSelector=r.abiTypeSignature=r.abiTupleSignature=r.abiSignature=r.ShortSelectorSize=void 0;const n=e("web3-utils");function i(e){return e.name+o(e.inputs)}function o(e){return"("+e.map(s).join(",")+")"}function s(e){const t=e.type.match(/^tuple(.*)/);if(null===t)return e.type;{const r=t[1];return o(e.components)+r}}r.ShortSelectorSize=4,r.abiSignature=i,r.abiTupleSignature=o,r.abiTypeSignature=s,r.abiSelector=function(e){const t=i(e),o=(0,n.soliditySha3)({type:"string",value:t});switch(e.type){case"event":return o;case"function":case"error":return o.slice(0,2+2*r.ShortSelectorSize)}}}}},{package:"@truffle/codec>@truffle/abi-utils",file:"node_modules/@truffle/abi-utils/dist/lib/signature.js"}],[1491,{},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0})}}},{package:"@truffle/codec>@truffle/abi-utils",file:"node_modules/@truffle/abi-utils/dist/lib/types.js"}],[1492,{},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.default={noun:["driver","protocol","bandwidth","panel","microchip","program","port","card","array","interface","system","sensor","firewall","pixel","alarm","feed","monitor","application","transmitter","bus","circuit","capacitor","matrix"],verb:["bypass","hack","override","compress","copy","navigate","index","connect","generate","quantify","calculate","synthesize","input","transmit","program","reboot","parse","handle","circumvent","cross","fumble","tweak","swap"]}}}},{package:"@truffle/codec>@truffle/abi-utils",file:"node_modules/@truffle/abi-utils/dist/lib/wordLists.js"}],[1493,{"./opcodes":1494,buffer:1943,cbor:1958},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){(function(t){(function(){var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){n===undefined&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){n===undefined&&(n=r),e[n]=t[r]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&n(t,e,r);return i(t,e),t};Object.defineProperty(r,"__esModule",{value:!0}),r.parseCode=void 0;const s=e("./opcodes"),a=o(e("cbor"));function u(e){try{a.decodeFirstSync(t.from(e))}catch(e){return!1}return!0}r.parseCode=function(e,{maxInstructionCount:r,attemptStripMetadata:n}={}){let i=new Uint8Array((e.slice(2).match(/(..?)/g)||[]).map((e=>parseInt(e,16))));if(n&&i.length>=2){let e=!1;const t=(i[i.length-2]<<8)+i[i.length-1];if(t+2<=i.length){u(i.subarray(-(t+2),-2))&&(i=i.subarray(0,-(t+2)),e=!0)}if(!e){const e=11;if(e<=i.length){u(i.subarray(-e))&&(i=i.subarray(0,-e))}}}let o=[];r===undefined&&(r=Infinity);for(let e=0;e<i.length&&o.length<r;e++){let r={pc:e,name:(0,s.parseOpcode)(i[e])};if("PUSH"===r.name.slice(0,4)){const n=i[e]-96+1;let o=i.subarray(e+1,e+n+1);o.length<n&&(o=Uint8Array.from([...o,...new Uint8Array(n-o.length)])),r.pushData=`0x${t.from(o).toString("hex")}`,e+=n}o.push(r)}return o}}).call(this)}).call(this,e("buffer").Buffer)}}},{package:"@truffle/decoder>@truffle/source-map-utils>@truffle/code-utils",file:"node_modules/@truffle/code-utils/dist/src/index.js"}],[1494,{},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.parseOpcode=void 0;const n={0:"STOP",1:"ADD",2:"MUL",3:"SUB",4:"DIV",5:"SDIV",6:"MOD",7:"SMOD",8:"ADDMOD",9:"MULMOD",10:"EXP",11:"SIGNEXTEND",16:"LT",17:"GT",18:"SLT",19:"SGT",20:"EQ",21:"ISZERO",22:"AND",23:"OR",24:"XOR",25:"NOT",26:"BYTE",27:"SHL",28:"SHR",29:"SAR",32:"SHA3",48:"ADDRESS",49:"BALANCE",50:"ORIGIN",51:"CALLER",52:"CALLVALUE",53:"CALLDATALOAD",54:"CALLDATASIZE",55:"CALLDATACOPY",56:"CODESIZE",57:"CODECOPY",58:"GASPRICE",59:"EXTCODESIZE",60:"EXTCODECOPY",61:"RETURNDATASIZE",62:"RETURNDATACOPY",63:"EXTCODEHASH",64:"BLOCKHASH",65:"COINBASE",66:"TIMESTAMP",67:"NUMBER",68:"PREVRANDAO|DIFFICULTY",69:"GASLIMIT",70:"CHAINID",71:"SELFBALANCE",72:"BASEFEE",80:"POP",81:"MLOAD",82:"MSTORE",83:"MSTORE8",84:"SLOAD",85:"SSTORE",86:"JUMP",87:"JUMPI",88:"PC",89:"MSIZE",90:"GAS",91:"JUMPDEST",96:"PUSH1",97:"PUSH2",98:"PUSH3",99:"PUSH4",100:"PUSH5",101:"PUSH6",102:"PUSH7",103:"PUSH8",104:"PUSH9",105:"PUSH10",106:"PUSH11",107:"PUSH12",108:"PUSH13",109:"PUSH14",110:"PUSH15",111:"PUSH16",112:"PUSH17",113:"PUSH18",114:"PUSH19",115:"PUSH20",116:"PUSH21",117:"PUSH22",118:"PUSH23",119:"PUSH24",120:"PUSH25",121:"PUSH26",122:"PUSH27",123:"PUSH28",124:"PUSH29",125:"PUSH30",126:"PUSH31",127:"PUSH32",128:"DUP1",129:"DUP2",130:"DUP3",131:"DUP4",132:"DUP5",133:"DUP6",134:"DUP7",135:"DUP8",136:"DUP9",137:"DUP10",138:"DUP11",139:"DUP12",140:"DUP13",141:"DUP14",142:"DUP15",143:"DUP16",144:"SWAP1",145:"SWAP2",146:"SWAP3",147:"SWAP4",148:"SWAP5",149:"SWAP6",150:"SWAP7",151:"SWAP8",152:"SWAP9",153:"SWAP10",154:"SWAP11",155:"SWAP12",156:"SWAP13",157:"SWAP14",158:"SWAP15",159:"SWAP16",160:"LOG0",161:"LOG1",162:"LOG2",163:"LOG3",164:"LOG4",240:"CREATE",241:"CALL",242:"CALLCODE",243:"RETURN",244:"DELEGATECALL",245:"CREATE2",250:"STATICCALL",253:"REVERT",254:"INVALID",255:"SELFDESTRUCT"};r.parseOpcode=e=>e in n?n[e]:"INVALID"}}},{package:"@truffle/decoder>@truffle/source-map-utils>@truffle/code-utils",file:"node_modules/@truffle/code-utils/dist/src/opcodes.js"}],[1495,{"../../ast":1508,"../../common":1519,"../../contexts/import":1527,"../../conversion":1531,"../../evm":1536,"../../format":1541,"../import":1499,"../utils":1502,"./utils":1496,debug:2075,"lodash/partition":2935,"web3-utils":3381},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){n===undefined&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){n===undefined&&(n=r),e[n]=t[r]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&n(t,e,r);return i(t,e),t},s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(r,"__esModule",{value:!0}),r.getEventAllocations=r.getReturndataAllocations=r.getCalldataAllocations=r.abiSizeInfo=r.getAbiAllocations=r.FallbackOutputAllocation=r.Utils=void 0;const a=(0,s(e("debug")).default)("codec:abi-data:allocate");r.Utils=o(e("./utils"));const u=o(e("../import")),c=o(e("../utils")),l=s(e("web3-utils")),d=o(e("../../evm")),f=o(e("../../common")),h=o(e("../../conversion")),p=o(e("../../ast")),m=e("../../contexts/import"),g=o(e("../../format")),y=s(e("lodash/partition"));function v(e,t,r){return b(e.id,e.memberTypes,t,r)}function b(e,t,r,n,i=0){let o=!1;if(e in n)return n;let s=Object.assign({},n),a=[];for(const n of t){let t,u;if(({size:t,dynamic:u,allocations:s}=w(n.type,r,s)),t===undefined)return s[e]=null,s;let c={location:"abi",start:i,length:t};a.push({name:n.name,type:n.type,pointer:c}),i+=t,o=o||u}return s[e]={members:a,length:o?d.Utils.WORD_SIZE:i,dynamic:o},s}function w(e,t,r){switch(e.typeClass){case"bool":case"address":case"contract":case"int":case"uint":case"fixed":case"ufixed":case"enum":case"userDefinedValueType":return{size:d.Utils.WORD_SIZE,dynamic:!1,allocations:r};case"string":return{size:d.Utils.WORD_SIZE,dynamic:!0,allocations:r};case"bytes":return{size:d.Utils.WORD_SIZE,dynamic:"dynamic"===e.kind,allocations:r};case"mapping":return{allocations:r};case"function":switch(e.visibility){case"external":return{size:d.Utils.WORD_SIZE,dynamic:!1,allocations:r};case"internal":return{allocations:r}}case"array":switch(e.kind){case"dynamic":return{size:d.Utils.WORD_SIZE,dynamic:!0,allocations:r};case"static":if(e.length.isZero())return{size:0,dynamic:!1,allocations:r};const{size:n,dynamic:i,allocations:o}=w(e.baseType,t,r);return{size:e.length.toNumber()*n,dynamic:i,allocations:o}}case"struct":{let n=r,i=n[e.id];if(i===undefined){const o=t[e.id];if(!o)throw new f.UnknownUserDefinedTypeError(e.id,g.Types.typeString(e));n=v(o,t,r),i=n[o.id]}return null!==i?{size:i.length,dynamic:i.dynamic,allocations:n}:{allocations:n}}case"tuple":{let n=0,i=!1;for(let o of e.memberTypes){let{size:e,dynamic:s}=w(o.type,t,r);n+=e,i=i||s}return{size:n,dynamic:i,allocations:r}}}}function M(e,t,r,n,i,o,s,u,l){let f,h,m,g,y,v=undefined;switch(a("allocating calldata and returndata"),e.type){case"constructor":if(!u)return undefined;y=(u.binary.length-2)/2,t&&(v=t.nodes.find((t=>c.definitionMatchesAbi(e,t,r))));break;case"function":if(y=d.Utils.SELECTOR_SIZE,t){const n=t.linearizedBaseContracts;a("linearized: %O",n),v=A(n,r,(t=>c.definitionMatchesAbi(e,t,r)),t).node,a("found node: %o",Boolean(v))}}if(v)switch(v.nodeType){case"FunctionDefinition":f=v.parameters.parameters,h=v.returnParameters.parameters;break;case"VariableDeclaration":({inputs:f,outputs:h}=p.Utils.getterParameters(v,r))}else f=undefined,h=undefined;switch(m=e.inputs,e.type){case"function":g=e.outputs;break;case"constructor":g=[]}let{allocation:b,mode:w}=_(f,m,n,i,o,s,y),{allocation:M,mode:O}=_(h,g,n,i,o,s);a("modes: %s in, %s out",w,O);let E,T=b.members.map((e=>Object.assign(Object.assign({},e),{pointer:{location:"calldata",start:e.pointer.start,length:e.pointer.length}}))),j=M.members.map((e=>Object.assign(Object.assign({},e),{pointer:{location:"returndata",start:e.pointer.start,length:e.pointer.length}}))),x={abi:e,offset:y,arguments:T,allocationMode:w};switch(e.type){case"function":E={selector:new Uint8Array,arguments:j,allocationMode:O,kind:"return"};break;case"constructor":E=k(l,t,r,O)}return{input:x,output:E}}function _(e,t,r,n,i,o,s=0){let c,l,d=e?"full":"abi";if("full"===d){let t="-1";c=e.map((e=>({name:e.name,type:p.Import.definitionToType(e,i,o)}))),a("parameterTypes: %O",c);try{l=b(t,c,r,n,s)[t]}catch(e){a("falling back to ABI due to exception!"),d="abi"}}if("abi"===d){let e="-1";c=t.map((e=>({name:e.name,type:u.abiParameterToType(e)}))),l=b(e,c,r,n,s)[e]}return{allocation:l,mode:d}}function O(e,t,r,n,i,o,s){let l,d,f,h,g,v,w=undefined,M=undefined,_="full";if(a("allocating ABI: %O",e),t&&(w=t.nodes.find((t=>c.definitionMatchesAbi(e,t,r))),!w)){a("didn't find node in base contract...");let n=t.linearizedBaseContracts.slice();if(n.shift(),a("checking contracts: %o",n),w=A(n,r,(t=>c.definitionMatchesAbi(e,t,r))).node,w)return a("bailing out for later handling!"),a("ABI: %O",e),undefined}if(w?(a("found node"),M=p.Import.definitionToStoredType(t,o,s),f=(0,m.makeTypeId)(w.id,o)):(a("falling back to ABI because no node"),_="abi"),"full"===_){d=w.id.toString(),l=w.parameters.parameters.map((e=>({type:p.Import.definitionToType(e,o,s),name:e.name,indexed:e.indexed}))),[h,g]=(0,y.default)(l,(e=>e.indexed));try{v=b(d,g,n,i)[d]}catch(e){_="abi"}}"abi"===_&&(d="-1",l=e.inputs.map((e=>({type:u.abiParameterToType(e),name:e.name,indexed:e.indexed}))),[h,g]=(0,y.default)(l,(e=>e.indexed)),v=b(d,g,n,i)[d]);const O=v.members.map((e=>Object.assign(Object.assign({},e),{pointer:{location:"eventdata",start:e.pointer.start,length:e.pointer.length}}))),E=e.anonymous?0:1,T=h.map((({type:e,name:t},r)=>({type:e,name:t,pointer:{location:"eventtopic",topic:E+r}})));let j=[];for(let e of l){let t=e.indexed?T:O;j.push(t.shift())}return{abi:e,contextHash:undefined,definedIn:M,id:f,arguments:j,allocationMode:_,anonymous:e.anonymous}}function E(e,t,r,n,i,o,s){let a=undefined,u=undefined,l=undefined;const f=e.inputs;if(t){l=t.parameters.parameters,a=(0,m.makeTypeId)(t.id,o);let e=null;for(const n of Object.values(r))if("ContractDefinition"===n.nodeType&&n.nodes.some((e=>e.id===t.id))){e=n;break}u=null===e?null:p.Import.definitionToStoredType(e,o,s)}const{allocation:g,mode:y}=_(l,f,n,i,o,s,d.Utils.SELECTOR_SIZE),v=g.members.map((e=>Object.assign(Object.assign({},e),{pointer:{location:"returndata",start:e.pointer.start,length:e.pointer.length}})));return{kind:"revert",selector:h.toBytes(c.abiSelector(e)),abi:e,id:a,definedIn:u,arguments:v,allocationMode:y}}function T(e,t,r,n,i,o,s,u,l){let d={constructorAllocation:undefined,functionAllocations:{}};if(!e)return d.constructorAllocation=j(r,t,i,n),d;for(let f of e)if(!c.abiEntryIsObviouslyIllTyped(f)&&!c.abiEntryHasStorageParameters(f))switch(f.type){case"constructor":d.constructorAllocation=M(f,t,i,o,s,u,l,r,n),a("constructor alloc: %O",d.constructorAllocation);break;case"function":d.functionAllocations[c.abiSelector(f)]=M(f,t,i,o,s,u,l,r,n)}return d.constructorAllocation||(d.constructorAllocation=j(r,t,i,n),a("default constructor alloc: %O",d.constructorAllocation)),d}function j(e,t,r,n){if(!e)return undefined;return{input:{offset:(e.binary.length-2)/2,abi:c.DEFAULT_CONSTRUCTOR_ABI,arguments:[],allocationMode:"full"},output:k(n,t,r,"full")}}function k(e,t,r,n){if(!e)return{selector:new Uint8Array,allocationMode:"abi",kind:"bytecode",delegatecallGuard:!1};const{immutableReferences:i,compilationId:o,compiler:s,contractKind:u,binary:c}=e;let l;if("full"===n&&i)if(t){a("allocating immutables"),l=[];for(const[e,u]of Object.entries(i)){if(0===u.length)continue;const i=parseInt(e),{node:c,contract:d}=A(t.linearizedBaseContracts,r,(e=>e.id===i),t);if(!c||"VariableDeclaration"!==c.nodeType){a("didn't find definition for %d!",i),n="abi",l=undefined;break}const f=p.Import.definitionToStoredType(d,o,s),h=p.Import.definitionToType(c,o,s);l.push({name:c.name,definedIn:f,type:h,pointer:{location:"returndata",start:u[0].start,length:u[0].length}})}}else Object.entries(i).length>0&&(a("immutables but no node!"),n="abi");else a("no immutables");let f=!1;if("library"===u){const e="0x"+(96+d.Utils.ADDRESS_SIZE-1).toString(16)+"..".repeat(d.Utils.ADDRESS_SIZE);c.startsWith(e)&&(f=!0)}return{selector:new Uint8Array,allocationMode:n,kind:"bytecode",immutables:l,delegatecallGuard:f}}function x(e,t,r,n,i,o,s){let a=Boolean(t&&t.usedErrors);if(a){const e=t.usedErrors.map((e=>r[e]));let u;try{u=e.map((e=>p.Utils.definitionToAbi(e,r)))}catch(e){a=!1}if(a)return t.usedErrors.map((e=>r[e])).map(((e,t)=>E(u[t],e,r,n,i,o,s)))}return!a&&e?e.filter((e=>"error"===e.type)).filter((e=>!c.abiEntryIsObviouslyIllTyped(e))).map((e=>E(e,undefined,r,n,i,o,s))):[]}function S(e,t){let r={};for(const e of t){const t=c.abiSignature(e.abi),n=l.default.soliditySha3({type:"string",value:t}).slice(0,2+2*d.Utils.SELECTOR_SIZE);r[n]?e.id!==undefined?(r[n]=r[n].filter((({abi:r,id:n})=>!(c.abiSignature(r)===t&&(n===undefined||n===e.id)))),r[n].push(e)):r[n].some((({abi:e})=>c.abiSignature(e)===t))||r[n].push(e):r[n]=[e]}for(const t of e){const e=c.abiSignature(t.abi),n=l.default.soliditySha3({type:"string",value:e}).slice(0,2+2*d.Utils.SELECTOR_SIZE);r[n]?(r[n]=r[n].filter((({abi:r,id:n})=>!(c.abiSignature(r)===e&&(n===undefined||n===t.id)))),r[n].unshift(t)):r[n]=[t]}return r}function C(e,t,r,n,i,o,s){return e?e.filter((e=>"event"===e.type)).filter((e=>!c.abiEntryIsObviouslyIllTyped(e))).map((e=>({selector:c.abiSelector(e),anonymous:e.anonymous,topics:c.topicsCount(e),allocation:O(e,t,r,n,i,o,s)}))):[]}function A(e,t,r,n){return e.reduce(((e,i)=>{if(e!==undefined)return e;a("searching contract %d",i);let o=n&&i===n.id?n:t[i];if(o===undefined||"ContractDefinition"!==o.nodeType)return a("bad contract node!"),null;const s=o.nodes.find(r);return s?(a("found node: %o",s),{node:s,contract:o}):undefined}),undefined)||{node:undefined,contract:undefined}}function I(e,t,r){return e?e.context:t+":"+r}function D(e){return e.startsWith("0x")}r.FallbackOutputAllocation={kind:"returnmessage",selector:new Uint8Array,allocationMode:"full"},r.getAbiAllocations=function(e){let t={};for(const r of Object.values(e))if("struct"===r.typeClass)try{t=v(r,e,t)}catch(e){}return t},r.abiSizeInfo=function(e,t){let{size:r,dynamic:n}=w(e,null,t);return{size:r,dynamic:n}},r.getCalldataAllocations=function(e,t,r,n){let i={constructorAllocations:{},functionAllocations:{}};for(let o of e){const e=T(o.abi,o.contractNode,o.constructorContext,o.deployedContext,t[o.compilationId],r,n,o.compilationId,o.compiler);o.constructorContext&&(i.constructorAllocations[o.constructorContext.context]=e.constructorAllocation),o.deployedContext&&(i.functionAllocations[o.deployedContext.context]=e.functionAllocations,i.constructorAllocations[o.deployedContext.context]=e.constructorAllocation)}return i},r.getReturndataAllocations=function(e,t,r,n){let i=[].concat(...e.map((({deployedContext:e,constructorContext:t})=>[e,t]))).filter((e=>e)).map((e=>e.context));i.push("");let o={},s={};for(const a of e){const e=x(a.abi,a.contractNode,t[a.compilationId],r,n,a.compilationId,a.compiler),u=[a.deployedContext,a.constructorContext].filter((e=>e)).map((e=>e.context)),c=i.filter((e=>!u.includes(e)));for(const t of u)o[t]=e;for(const t of c)s[t]===undefined&&(s[t]=[]),s[t]=s[t].concat(e)}let u=Object.assign({},...i.map((e=>({[e]:{}}))));for(const t of e){const e=[t.deployedContext,t.constructorContext].filter((e=>e)).map((e=>e.context));for(const t of e)u[t]=S(o[t]||[],s[t]||[]),a("allocations: %O",u[t])}return u[""]=S([],s[""]||[]),a("error allocations: %O",u),u},r.getEventAllocations=function(e,t,r,n,i=!1){let o={},s={},u={},c={};for(const{abi:i,deployedContext:s,constructorContext:a,contractNode:c,compilationId:l,compiler:d}of e){if(!s&&!a&&!c)continue;const e=C(i,c,t[l],r,n,l,d),f=I(s||a,c?c.id:undefined,l);o[f]===undefined&&(o[f]={});for(const t of e)o[f][t.selector]={context:s||a,contractNode:c,allocationTemporary:t,compilationId:l};s&&a&&(u[s.context]=a.context,u[a.context]=s.context)}for(let r in o){s[r]={};for(let n in o[r]){let{context:i,contractNode:u,allocationTemporary:c,compilationId:l}=o[r][n];a("allocationTemporary: %O",c);let d=c.allocation?[c]:[];if(s[r][n]={context:i,contractNode:u,allocationsTemporary:d},u){a("contract Id: %d",u.id),a("base contracts: %o",u.linearizedBaseContracts);let i=u.linearizedBaseContracts.slice();i.shift();for(let u of i){a("checking baseId: %d",u);let i=t[l][u];if(!i||"ContractDefinition"!==i.nodeType){a("failed to find node for baseId: %d",u);break}let c=e.find((e=>e.compilationId===l&&e.contractNode&&e.contractNode.id===u));if(!c){a("failed to find contract info for baseId: %d",u);break}let d=I(c.deployedContext||c.constructorContext,u,l);if(o[d][n]!==undefined){let e=o[d][n].allocationTemporary;a("(probably) pushing inherited alloc from baseId: %d",u),e.allocation&&s[r][n].allocationsTemporary.push(e)}}}}}for(let e in s){if(!D(e))continue;let t=D(l=e)?l:undefined;for(let e in s[t]){let{allocationsTemporary:r,context:n}=s[t][e];for(let{anonymous:o,topics:s,allocation:a}of r){let r=n.contractKind;if("library"!==r&&(r="contract"),a=Object.assign(Object.assign({},a),{contextHash:t}),c[s]===undefined&&(c[s]={bySelector:{},anonymous:{contract:{},library:{}}}),o){if(c[s].anonymous[r][t]===undefined&&(c[s].anonymous[r][t]=[]),c[s].anonymous[r][t].push(a),i&&t in u&&"library"!==r){const e=u[t];c[s].anonymous[r][e]===undefined&&(c[s].anonymous[r][e]=[]),c[s].anonymous[r][e].push(a)}}else if(c[s].bySelector[e]===undefined&&(c[s].bySelector[e]={contract:{},library:{}}),c[s].bySelector[e][r][t]===undefined&&(c[s].bySelector[e][r][t]=[]),c[s].bySelector[e][r][t].push(a),i&&t in u&&"library"!==r){const n=u[t];c[s].bySelector[e][r][n]===undefined&&(c[s].bySelector[e][r][n]=[]),c[s].bySelector[e][r][n].push(a)}}}}var l;return c}}}},{package:"@truffle/codec",file:"node_modules/@truffle/codec/dist/lib/abi-data/allocate/index.js"}],[1496,{"../../compilations":1521,"../../contexts":1528,"@truffle/abi-utils":1488,"@truffle/compile-common":1634,debug:2075},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){n===undefined&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){n===undefined&&(n=r),e[n]=t[r]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&n(t,e,r);return i(t,e),t},s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(r,"__esModule",{value:!0}),r.collectAllocationInfo=void 0;const a=(0,s(e("debug")).default)("codec:abi-data:allocate:utils"),u=o(e("../../compilations")),c=e("@truffle/compile-common"),l=o(e("../../contexts")),d=o(e("@truffle/abi-utils"));r.collectAllocationInfo=function(e){let t={},r={},n=[];for(const r of e)for(const e of r.contracts){const i=u.Utils.getContractNode(e,r);let o=undefined,s=undefined;const a=c.Shims.NewToLegacy.forBytecode(e.deployedBytecode),d=c.Shims.NewToLegacy.forBytecode(e.bytecode);a&&"0x"!==a&&(o=l.Utils.makeContext(e,i,r),t[o.context]=o),d&&"0x"!==d&&(s=l.Utils.makeContext(e,i,r,!0),t[s.context]=s),n.push({contract:e,node:i,deployedContext:o,constructorContext:s,compilationId:r.id})}a("known contexts: %o",Object.keys(t)),t=l.Utils.normalizeContexts(t),r=Object.assign({},...Object.values(t).map((e=>e.isConstructor?{}:{[e.context]:e})));for(const e of n)e.deployedContext&&(e.deployedContext=t[e.deployedContext.context]),e.constructorContext&&(e.constructorContext=t[e.constructorContext.context]);const i=n.map((({contract:{abi:e,compiler:t,immutableReferences:r},compilationId:n,node:i,deployedContext:o,constructorContext:s})=>({abi:d.normalize(e),compilationId:n,compiler:t,contractNode:i,deployedContext:o,constructorContext:s,immutableReferences:r})));return{contexts:t,deployedContexts:r,contractsAndContexts:n,allocationInfo:i}}}}},{package:"@truffle/codec",file:"node_modules/@truffle/codec/dist/lib/abi-data/allocate/utils.js"}],[1497,{"../../basic":1514,"../../bytes":1517,"../../conversion":1531,"../../errors":1534,"../../evm":1536,"../../format":1541,"../../read":1553,"../allocate":1495,debug:2075},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){n===undefined&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){n===undefined&&(n=r),e[n]=t[r]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&n(t,e,r);return i(t,e),t},s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(r,"__esModule",{value:!0}),r.decodeAbiReferenceStatic=r.decodeAbiReferenceByAddress=r.decodeAbi=void 0;const a=(0,s(e("debug")).default)("codec:abi-data:decode"),u=s(e("../../read")),c=o(e("../../conversion")),l=o(e("../../basic")),d=o(e("../../bytes")),f=o(e("../../format")),h=o(e("../../evm")),p=e("../allocate"),m=e("../../errors");function*g(e,t,r,n={}){if(f.Types.isReferenceType(e)||"tuple"===e.typeClass){let i;try{i=(0,p.abiSizeInfo)(e,r.allocations.abi).dynamic}catch(t){return(0,m.handleDecodingError)(e,t,n.strictAbiMode)}return i?yield*y(e,t,r,n):yield*v(e,t,r,n)}return a("pointer %o",t),yield*l.Decode.decodeBasic(e,t,r,n)}function*y(e,t,r,n={}){let{strictAbiMode:i,abiPointerBase:o,lengthOverride:s}=n;o=o||0;const{allocations:{abi:l},state:f}=r;a("pointer %o",t);const y="stack"===t.location||"stackliteral"===t.location?"calldata":t.location;let M;"stack"!==t.location&&"stackliteral"!==t.location&&(s=undefined);try{M=yield*(0,u.default)(t,f)}catch(t){return(0,m.handleDecodingError)(e,t,i)}let _,O=c.toBN(M);a("rawValue: %O",M),a("rawValueAsBN: %O",O);try{_=O.toNumber()}catch(t){let r={kind:"OverlargePointersNotImplementedError",pointerAsBN:O};if(i)throw new m.StopDecodingError(r);return{type:e,kind:"error",error:r}}let E,T,j,k,x,S=_+o;a("startPosition %d",S);try{({dynamic:E,size:T}=(0,p.abiSizeInfo)(e,l))}catch(t){return(0,m.handleDecodingError)(e,t,i)}if(!E){let t={location:y,start:S,length:T};return yield*v(e,t,r,n)}switch(e.typeClass){case"bytes":case"string":if(s!==undefined)k=s;else{try{x=yield*(0,u.default)({location:y,start:S,length:h.Utils.WORD_SIZE},f)}catch(t){return(0,m.handleDecodingError)(e,t,i)}k=c.toBN(x),S+=h.Utils.WORD_SIZE}if(i&&k.gtn(f[y].length))throw new m.StopDecodingError({kind:"OverlongArrayOrStringStrictModeError",lengthAsBN:k,dataLength:f[y].length});try{j=k.toNumber()}catch(t){return{type:e,kind:"error",error:{kind:"OverlongArraysAndStringsNotImplementedError",lengthAsBN:k}}}let t={location:y,start:S,length:j};return yield*d.Decode.decodeBytes(e,t,r,n);case"array":if("static"===e.kind)k=e.length;else if(s!==undefined)a("override: %o",s),k=s;else{try{x=yield*(0,u.default)({location:y,start:S,length:h.Utils.WORD_SIZE},f)}catch(t){return(0,m.handleDecodingError)(e,t,i)}k=c.toBN(x),S+=h.Utils.WORD_SIZE}if(i&&k.gtn(f[y].length))throw new m.StopDecodingError({kind:"OverlongArraysAndStringsNotImplementedError",lengthAsBN:k,dataLength:f[y].length});try{j=k.toNumber()}catch(t){return{type:e,kind:"error",error:{kind:"OverlongArraysAndStringsNotImplementedError",lengthAsBN:k}}}let o;try{o=(0,p.abiSizeInfo)(e.baseType,l).size}catch(t){return(0,m.handleDecodingError)(e,t,i)}let v=[];for(let t=0;t<j;t++)v.push(yield*g(e.baseType,{location:y,start:S+t*o,length:o},r,Object.assign(Object.assign({},n),{abiPointerBase:S})));return{type:e,kind:"value",value:v};case"struct":return yield*b(e,y,S,r,n);case"tuple":return yield*w(e,y,S,r,n)}}function*v(e,t,r,n={}){a("static"),a("pointer %o",t);const i=t.location;switch(e.typeClass){case"array":const o=e.length;let s,a;try{s=o.toNumber()}catch(t){let r={kind:"OverlongArraysAndStringsNotImplementedError",lengthAsBN:o};if(n.strictAbiMode)throw new m.StopDecodingError(r);return{type:e,kind:"error",error:r}}try{a=(0,p.abiSizeInfo)(e.baseType,r.allocations.abi).size}catch(t){return(0,m.handleDecodingError)(e,t,n.strictAbiMode)}let u=[];for(let o=0;o<s;o++)u.push(yield*g(e.baseType,{location:i,start:t.start+o*a,length:a},r,n));return{type:e,kind:"value",value:u};case"struct":return yield*b(e,i,t.start,r,n);case"tuple":return yield*w(e,i,t.start,r,n)}}function*b(e,t,r,n,i={}){const{allocations:{abi:o}}=n,s="calldata"===t?"calldata":null,a=o[e.id];if(!a){let t={kind:"UserDefinedTypeNotFoundError",type:e};if(i.strictAbiMode||i.allowRetry)throw new m.StopDecodingError(t,!0);return{type:e,kind:"error",error:t}}let u=[];for(let e=0;e<a.members.length;e++){const o=a.members[e],c=o.pointer,l={location:t,start:r+c.start,length:c.length};let d=o.name,h=f.Types.specifyLocation(o.type,s);u.push({name:d,value:yield*g(h,l,n,Object.assign(Object.assign({},i),{abiPointerBase:r}))})}return{type:e,kind:"value",value:u}}function*w(e,t,r,n,i={}){let o=[],s=r;for(const{name:a,type:u}of e.memberTypes){const e=(0,p.abiSizeInfo)(u,n.allocations.abi).size,c={location:t,start:s,length:e};o.push({name:a,value:yield*g(u,c,n,Object.assign(Object.assign({},i),{abiPointerBase:r}))}),s+=e}return{type:e,kind:"value",value:o}}r.decodeAbi=g,r.decodeAbiReferenceByAddress=y,r.decodeAbiReferenceStatic=v}}},{package:"@truffle/codec",file:"node_modules/@truffle/codec/dist/lib/abi-data/decode/index.js"}],[1498,{"../../basic":1514,"../../bytes":1517,"../../conversion":1531,"../../evm":1536,"../allocate":1495,debug:2075,"lodash/sum":2939},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){n===undefined&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){n===undefined&&(n=r),e[n]=t[r]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&n(t,e,r);return i(t,e),t},s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(r,"__esModule",{value:!0}),r.encodeTupleAbiWithSelector=r.encodeTupleAbi=r.encodeAbi=void 0;(0,s(e("debug")).default)("codec:abi-data:encode");const a=o(e("../../conversion")),u=o(e("../../basic")),c=o(e("../../bytes")),l=o(e("../../evm")),d=e("../allocate"),f=s(e("lodash/sum"));function h(e,t){if("error"===e.kind)return undefined;let r;switch(e.type.typeClass){case"mapping":case"magic":case"type":return undefined;case"bytes":switch(e.type.kind){case"static":return u.Encode.encodeBasic(e);case"dynamic":return r=c.Encode.encodeBytes(e),p(r)}case"string":return r=c.Encode.encodeBytes(e),p(r);case"function":switch(e.type.visibility){case"internal":return undefined;case"external":return u.Encode.encodeBasic(e)}case"array":{let r=e;if(r.reference!==undefined)return undefined;let n=m(r.value,t);switch(e.type.kind){case"static":return n;case"dynamic":let e=new Uint8Array(l.Utils.WORD_SIZE+n.length);e.set(n,l.Utils.WORD_SIZE);let t=a.toBytes(r.value.length,l.Utils.WORD_SIZE);return e.set(t),e}}case"struct":{let r=e;return r.reference!==undefined?undefined:m(r.value.map((({value:e})=>e)),t)}case"tuple":return m(e.value.map((({value:e})=>e)),t);default:return u.Encode.encodeBasic(e)}}function p(e){let t=e.length,r=l.Utils.WORD_SIZE*Math.ceil(t/l.Utils.WORD_SIZE),n=new Uint8Array(l.Utils.WORD_SIZE+r);n.set(e,l.Utils.WORD_SIZE);let i=a.toBytes(t,l.Utils.WORD_SIZE);return n.set(i),n}function m(e,t){let r=e.map((e=>h(e,t)));if(r.some((e=>e===undefined)))return undefined;let n=e.map((e=>(0,d.abiSizeInfo)(e.type,t))),i=[],o=[],s=(0,f.default)(n.map((e=>e.size)));for(let t=0;t<e.length;t++){let e,u;n[t].dynamic?(e=a.toBytes(s,l.Utils.WORD_SIZE),u=r[t]):(e=r[t],u=new Uint8Array),i.push(e),o.push(u),s+=u.length}let u=new Uint8Array(s),c=0;for(let e of i)u.set(e,c),c+=e.length;for(let e of o)u.set(e,c),c+=e.length;return u}r.encodeAbi=h,r.encodeTupleAbi=m,r.encodeTupleAbiWithSelector=function(e,t,r){const n=m(e,r);if(!n)return undefined;const i=new Uint8Array(t.length+n.length);return i.set(t),i.set(n,t.length),i}}}},{package:"@truffle/codec",file:"node_modules/@truffle/codec/dist/lib/abi-data/encode/index.js"}],[1499,{"bn.js":1586,debug:2075},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(r,"__esModule",{value:!0}),r.abiParameterToType=void 0;(0,n(e("debug")).default)("codec:abi-data:import");const i=n(e("bn.js"));r.abiParameterToType=function e(t){let r=t.type,n=t.internalType,o=r.match(/(.*)\[(\d*)\]$/);if(o){let r=o[1],s=o[2],a=e(Object.assign(Object.assign({},t),{type:r}));if(""===s)return{typeClass:"array",kind:"dynamic",baseType:a,typeHint:n};return{typeClass:"array",kind:"static",length:new i.default(s),baseType:a,typeHint:n}}let s=r.match(/^([^0-9]+)/)[1];switch(s){case"uint":case"int":{let e=r.match(/^u?int([0-9]+)/)[1];return{typeClass:s,bits:parseInt(e),typeHint:n}}case"bytes":let i=r.match(/^bytes([0-9]*)/)[1];return""===i?{typeClass:s,kind:"dynamic",typeHint:n}:{typeClass:s,kind:"static",length:parseInt(i),typeHint:n};case"address":return{typeClass:s,kind:"general",typeHint:n};case"string":case"bool":return{typeClass:s,typeHint:n};case"fixed":case"ufixed":{let[e,t,i]=r.match(/^u?fixed([0-9]+)x([0-9]+)/);return{typeClass:s,bits:parseInt(t),places:parseInt(i),typeHint:n}}case"function":return{typeClass:s,visibility:"external",kind:"general",typeHint:n};case"tuple":return{typeClass:s,memberTypes:t.components.map((t=>({name:t.name||undefined,type:e(t)}))),typeHint:n}}}}}},{package:"@truffle/codec",file:"node_modules/@truffle/codec/dist/lib/abi-data/import/index.js"}],[1500,{"./allocate":1495,"./decode":1497,"./encode":1498,"./import":1499,"./types":1501,"./utils":1502},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){n===undefined&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){n===undefined&&(n=r),e[n]=t[r]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&n(t,e,r);return i(t,e),t},s=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(r,"__esModule",{value:!0}),r.Utils=r.Import=r.Decode=r.Encode=r.Allocate=void 0;const a=o(e("./allocate"));r.Allocate=a;const u=o(e("./encode"));r.Encode=u;const c=o(e("./decode"));r.Decode=c;const l=o(e("./import"));r.Import=l,s(e("./types"),r);const d=o(e("./utils"));r.Utils=d}}},{package:"@truffle/codec",file:"node_modules/@truffle/codec/dist/lib/abi-data/index.js"}],[1501,{},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0})}}},{package:"@truffle/codec",file:"node_modules/@truffle/codec/dist/lib/abi-data/types.js"}],[1502,{"../ast":1508,"@truffle/abi-utils":1488,debug:2075},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){n===undefined&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){n===undefined&&(n=r),e[n]=t[r]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&n(t,e,r);return i(t,e),t},s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(r,"__esModule",{value:!0}),r.abiEntryHasStorageParameters=r.abiEntryIsObviouslyIllTyped=r.topicsCount=r.definitionMatchesAbi=r.abisMatch=r.abiHasPayableFallback=r.computeSelectors=r.DEFAULT_CONSTRUCTOR_ABI=r.abiSelector=r.abiTupleSignature=r.abiTypeSignature=r.abiSignature=void 0;(0,s(e("debug")).default)("codec:abi-data:utils");const a=o(e("../ast")),u=e("@truffle/abi-utils");function c(e,t){if(!e||!t)return!1;if(e.type!==t.type)return!1;switch(e.type){case"function":case"event":case"error":return(0,u.abiSignature)(e)===(0,u.abiSignature)(t);case"constructor":return(0,u.abiTupleSignature)(e.inputs)===(0,u.abiTupleSignature)(t.inputs);case"fallback":case"receive":return!0}}function l(e){const t=e.type.match(/^([a-z]*)/)[1],r=!["uint","int","fixed","ufixed","bool","address","bytes","string","function","tuple"].includes(t);return e.components&&e.components.some(l)||r}Object.defineProperty(r,"abiSignature",{enumerable:!0,get:function(){return u.abiSignature}}),Object.defineProperty(r,"abiTypeSignature",{enumerable:!0,get:function(){return u.abiTypeSignature}}),Object.defineProperty(r,"abiTupleSignature",{enumerable:!0,get:function(){return u.abiTupleSignature}}),Object.defineProperty(r,"abiSelector",{enumerable:!0,get:function(){return u.abiSelector}}),r.DEFAULT_CONSTRUCTOR_ABI={type:"constructor",inputs:[],stateMutability:"nonpayable"},r.computeSelectors=function(e){return e===undefined?undefined:Object.assign({},...e.filter((e=>"function"===e.type)).map((e=>({[(0,u.abiSelector)(e)]:e}))))},r.abiHasPayableFallback=function(e){return e===undefined?undefined:e.some((e=>("fallback"===e.type||"receive"===e.type)&&"payable"===e.stateMutability))},r.abisMatch=c,r.definitionMatchesAbi=function(e,t,r){try{return c(e,a.Utils.definitionToAbi(t,r))}catch(e){return!1}},r.topicsCount=function(e){let t=e.anonymous?0:1;return e.inputs.filter((({indexed:e})=>e)).length+t},r.abiEntryIsObviouslyIllTyped=function(e){switch(e.type){case"fallback":case"receive":return!1;case"constructor":case"event":case"error":return e.inputs.some(l);case"function":return e.inputs.some(l)||e.outputs.some(l)}},r.abiEntryHasStorageParameters=function(e){const t=e=>e.type.endsWith(" storage");return"function"===e.type&&(e.inputs.some(t)||e.outputs.some(t))}}}},{package:"@truffle/codec",file:"node_modules/@truffle/codec/dist/lib/abi-data/utils.js"}],[1503,{"./common":1519,"./conversion":1531,"./format":1541,debug:2075},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){n===undefined&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){n===undefined&&(n=r),e[n]=t[r]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&n(t,e,r);return i(t,e),t},s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(r,"__esModule",{value:!0}),r.abifyReturndataDecoding=r.abifyLogDecoding=r.abifyCalldataDecoding=r.abifyResult=r.abifyType=void 0;(0,s(e("debug")).default)("codec:abify");const a=o(e("./format")),u=o(e("./common")),c=o(e("./conversion"));function l(e,t){switch(e.typeClass){case"mapping":case"magic":case"type":case"options":return undefined;case"address":case"contract":return{typeClass:"address",kind:"general",typeHint:a.Types.typeString(e)};case"function":switch(e.visibility){case"external":return{typeClass:"function",visibility:"external",kind:"general",typeHint:a.Types.typeString(e)};case"internal":return undefined}break;case"struct":{const r=a.Types.fullType(e,t);if(!r.memberTypes){let t=a.Types.typeString(e);throw new u.UnknownUserDefinedTypeError(e.id,t)}const n=r.memberTypes.map((({name:e,type:r})=>({name:e,type:l(r,t)})));return{typeClass:"tuple",typeHint:a.Types.typeString(r),memberTypes:n}}case"enum":{const r=a.Types.fullType(e,t);if(!r.options){let t=a.Types.typeString(e);throw new u.UnknownUserDefinedTypeError(e.id,t)}let n=r.options.length;return{typeClass:"uint",bits:8*Math.ceil(Math.log2(n)/8),typeHint:a.Types.typeString(r)}}case"userDefinedValueType":{const r=a.Types.fullType(e,t);if(!r.underlyingType){let t=a.Types.typeString(e);throw new u.UnknownUserDefinedTypeError(e.id,t)}const n=l(r.underlyingType,t);return Object.assign(Object.assign({},n),{typeHint:a.Types.typeStringWithoutLocation(e)})}case"array":return Object.assign(Object.assign({},e),{typeHint:a.Types.typeString(e),baseType:l(e.baseType,t)});default:return e}}function d(e,t){switch(e.type.typeClass){case"mapping":case"magic":case"type":return undefined;case"address":return Object.assign(Object.assign({},e),{type:l(e.type,t)});case"contract":{let r=e;switch(r.kind){case"value":return{type:l(e.type,t),kind:"value",value:{asAddress:r.value.address,rawAsHex:r.value.rawAddress}};case"error":return"ContractPaddingError"===r.error.kind?{type:l(e.type,t),kind:"error",error:{kind:"AddressPaddingError",paddingType:r.error.paddingType,raw:r.error.raw}}:Object.assign(Object.assign({},r),{type:l(e.type,t)})}break}case"function":switch(e.type.visibility){case"external":{let r=e;return Object.assign(Object.assign({},r),{type:l(e.type,t)})}case"internal":return undefined}break;case"struct":{let r=e;switch(r.kind){case"value":if(r.reference!==undefined)return undefined;let n=r.value.map((({name:e,value:r})=>({name:e,value:d(r,t)})));return{kind:"value",type:l(e.type,t),value:n};case"error":return Object.assign(Object.assign({},r),{type:l(e.type,t)})}}case"userDefinedValueType":{const r=e;switch(r.kind){case"value":return d(r.value,t);case"error":return Object.assign(Object.assign({},r),{type:l(e.type,t)})}break}case"enum":{let r=e,n=l(e.type,t);switch(r.kind){case"value":return{type:n,kind:"value",value:{asBN:r.value.numericAsBN.clone()}};case"error":switch(r.error.kind){case"EnumOutOfRangeError":return{type:n,kind:"value",value:{asBN:r.error.rawAsBN.clone()}};case"EnumPaddingError":return{type:n,kind:"error",error:{kind:"UintPaddingError",paddingType:r.error.paddingType,raw:r.error.raw}};case"EnumNotFoundDecodingError":let e=r.error.rawAsBN.clone();return e.bitLength()<=n.bits?{type:n,kind:"value",value:{asBN:e}}:{type:n,kind:"error",error:{kind:"UintPaddingError",paddingType:"left",raw:c.toHexString(e)}};default:return{type:n,kind:"error",error:r.error}}}}case"array":{let r=e;switch(r.kind){case"value":if(r.reference!==undefined)return undefined;let n=r.value.map((e=>d(e,t)));return{kind:"value",type:l(e.type,t),value:n};case"error":return Object.assign(Object.assign({},r),{type:l(e.type,t)})}}default:return e}}r.abifyType=l,r.abifyResult=d,r.abifyCalldataDecoding=function(e,t){if("abi"===e.decodingMode)return e;switch(e.kind){case"function":case"constructor":return Object.assign(Object.assign({},e),{decodingMode:"abi",arguments:e.arguments.map((e=>Object.assign(Object.assign({},e),{value:d(e.value,t)})))});default:return Object.assign(Object.assign({},e),{decodingMode:"abi"})}},r.abifyLogDecoding=function(e,t){return"abi"===e.decodingMode?e:Object.assign(Object.assign({},e),{decodingMode:"abi",arguments:e.arguments.map((e=>Object.assign(Object.assign({},e),{value:d(e.value,t)})))})},r.abifyReturndataDecoding=function(e,t){if("abi"===e.decodingMode)return e;switch(e.kind){case"return":case"revert":return Object.assign(Object.assign({},e),{decodingMode:"abi",arguments:e.arguments.map((e=>Object.assign(Object.assign({},e),{value:d(e.value,t)})))});case"bytecode":return Object.assign(Object.assign({},e),{decodingMode:"abi",immutables:undefined});default:return Object.assign(Object.assign({},e),{decodingMode:"abi"})}}}}},{package:"@truffle/codec",file:"node_modules/@truffle/codec/dist/lib/abify.js"}],[1504,{"../../basic":1514,"../../bytes":1517,"../../conversion":1531,"../../errors":1534,"../../read":1553,debug:2075},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){n===undefined&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){n===undefined&&(n=r),e[n]=t[r]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&n(t,e,r);return i(t,e),t},s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(r,"__esModule",{value:!0}),r.decodeConstant=void 0;const a=(0,s(e("debug")).default)("codec:ast:decode"),u=s(e("../../read")),c=o(e("../../conversion")),l=o(e("../../basic")),d=o(e("../../bytes")),f=e("../../errors");r.decodeConstant=function*(e,t,r){if(a("pointer %o",t),"bytes"===e.typeClass&&"static"===e.kind){const n=e.length;let i;try{i=yield*(0,u.default)(t,r.state)}catch(t){return(0,f.handleDecodingError)(e,t)}a("got word: %O",i);const o=i.slice(-n);return{type:e,kind:"value",value:{asHex:c.toHexString(o,n,!0)}}}return a("not a static bytes"),"bytes"===e.typeClass||"string"===e.typeClass?yield*d.Decode.decodeBytes(e,t,r):yield*l.Decode.decodeBasic(e,t,r)}}}},{package:"@truffle/codec",file:"node_modules/@truffle/codec/dist/lib/ast-constant/decode/index.js"}],[1505,{"./decode":1504,"./read":1506},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){n===undefined&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){n===undefined&&(n=r),e[n]=t[r]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&n(t,e,r);return i(t,e),t};Object.defineProperty(r,"__esModule",{value:!0}),r.Decode=r.Read=void 0;const s=o(e("./read"));r.Read=s;const a=o(e("./decode"));r.Decode=a}}},{package:"@truffle/codec",file:"node_modules/@truffle/codec/dist/lib/ast-constant/index.js"}],[1506,{"../../ast":1508,"../../conversion":1531,"../../errors":1534,"../../evm":1536,debug:2075},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){n===undefined&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){n===undefined&&(n=r),e[n]=t[r]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&n(t,e,r);return i(t,e),t},s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(r,"__esModule",{value:!0}),r.readDefinition=void 0;const a=(0,s(e("debug")).default)("codec:ast:read"),u=o(e("../../conversion")),c=o(e("../../evm")),l=o(e("../../ast")),d=e("../../errors");r.readDefinition=function(e){const t=e.definition;switch(a("definition %o",t),l.Utils.typeClass(t)){case"rational":let e=l.Utils.rationalValue(t);return u.toBytes(e,c.Utils.WORD_SIZE);case"stringliteral":return u.toBytes(t.hexValue);default:throw a("unsupported constant definition type"),new d.DecodingError({kind:"UnsupportedConstantError",definition:t})}}}}},{package:"@truffle/codec",file:"node_modules/@truffle/codec/dist/lib/ast-constant/read/index.js"}],[1507,{"../../compiler":1524,"../../contexts/import":1527,"../utils":1510,"bn.js":1586,debug:2075},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){n===undefined&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){n===undefined&&(n=r),e[n]=t[r]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&n(t,e,r);return i(t,e),t},s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(r,"__esModule",{value:!0}),r.definitionToStoredType=r.definitionToType=void 0;const a=(0,s(e("debug")).default)("codec:ast:import"),u=s(e("bn.js")),c=o(e("../../compiler")),l=o(e("../utils")),d=e("../../contexts/import");function f(e,t,r,n){let i=l.typeClass(e),o=l.typeStringWithoutLocation(e);switch(i){case"bool":return{typeClass:i,typeHint:o};case"address":switch(c.Utils.solidityFamily(r)){case"unknown":case"pre-0.5.0":return{typeClass:i,kind:"general",typeHint:o};default:return{typeClass:i,kind:"specific",payable:"t_address_payable"===l.typeIdentifier(e)}}break;case"uint":case"int":return{typeClass:i,bits:8*l.specifiedSize(e),typeHint:o};case"fixed":case"ufixed":return{typeClass:i,bits:8*l.specifiedSize(e),places:l.decimalPlaces(e),typeHint:o};case"string":if(null===n)return{typeClass:i,typeHint:o};return{typeClass:i,location:n||l.referenceType(e),typeHint:o};case"bytes":{let t=l.specifiedSize(e);if(null!==t)return{typeClass:i,kind:"static",length:t,typeHint:o};if(null===n)return{typeClass:i,kind:"dynamic",typeHint:o};return{typeClass:i,kind:"dynamic",location:n||l.referenceType(e),typeHint:o}}case"array":{let s=f(l.baseDefinition(e),t,r,n),a=n||l.referenceType(e);if(l.isDynamicArray(e))return null!==n?{typeClass:i,baseType:s,kind:"dynamic",location:a,typeHint:o}:{typeClass:i,baseType:s,kind:"dynamic",typeHint:o};{let t=new u.default(l.staticLengthAsString(e));return null!==n?{typeClass:i,baseType:s,kind:"static",length:t,location:a,typeHint:o}:{typeClass:i,baseType:s,kind:"static",length:t,typeHint:o}}}case"mapping":{let o=f(l.keyDefinition(e),t,r,null);a("definition: %O",e);let s=f(l.valueDefinition(e),t,r,n);return null===n?{typeClass:i,keyType:o,valueType:s}:{typeClass:i,keyType:o,valueType:s,location:"storage"}}case"function":{let n=l.visibility(e),o=l.mutability(e),[s,a]=l.parameters(e)||[[],[]],u=s.map((e=>f(e,t,r))),c=a.map((e=>f(e,t,r)));switch(n){case"internal":return{typeClass:i,visibility:n,mutability:o,inputParameterTypes:u,outputParameterTypes:c};case"external":return{typeClass:i,visibility:n,kind:"specific",mutability:o,inputParameterTypes:u,outputParameterTypes:c}}break}case"struct":{let r,s,a=(0,d.makeTypeId)(l.typeId(e),t),u=o.match(/struct (.*)/)[1];if(u.includes(".")?[r,s]=u.split("."):s=u,null===n)return r?{typeClass:i,kind:"local",id:a,typeName:s,definingContractName:r}:{typeClass:i,kind:"global",id:a,typeName:s};let c=n||l.referenceType(e);return r?{typeClass:i,kind:"local",id:a,typeName:s,definingContractName:r,location:c}:{typeClass:i,kind:"global",id:a,typeName:s,location:c}}case"enum":{let r,n,s=(0,d.makeTypeId)(l.typeId(e),t),a=o.match(/enum (.*)/)[1];return a.includes(".")?[r,n]=a.split("."):n=a,r?{typeClass:i,kind:"local",id:s,typeName:n,definingContractName:r}:{typeClass:i,kind:"global",id:s,typeName:n}}case"userDefinedValueType":{let r,n,s=(0,d.makeTypeId)(l.typeId(e),t);return o.includes(".")?[r,n]=o.split("."):n=o,r?{typeClass:i,kind:"local",id:s,typeName:n,definingContractName:r}:{typeClass:i,kind:"global",id:s,typeName:n}}case"contract":return{typeClass:i,kind:"native",id:(0,d.makeTypeId)(l.typeId(e),t),typeName:o.match(/(contract|library|interface) (.*)/)[2],contractKind:l.contractKind(e)};case"magic":return{typeClass:i,variable:l.typeIdentifier(e).match(/^t_magic_(.*)$/)[1]}}}function h(e,t,r,n){switch(e.nodeType){case"StructDefinition":{const{id:i,typeName:o,definingContractName:s,definingContract:a}=p(e,t,r,n),u=e.members.map((e=>({name:e.name,type:f(e,t,r,null)})));return a?{typeClass:"struct",kind:"local",id:i,typeName:o,definingContractName:s,definingContract:a,memberTypes:u}:{typeClass:"struct",kind:"global",id:i,typeName:o,memberTypes:u}}case"EnumDefinition":{const{id:i,typeName:o,definingContractName:s,definingContract:a}=p(e,t,r,n),u=e.members.map((e=>e.name));return a?{typeClass:"enum",kind:"local",id:i,typeName:o,definingContractName:s,definingContract:a,options:u}:{typeClass:"enum",kind:"global",id:i,typeName:o,options:u}}case"UserDefinedValueTypeDefinition":{const{id:i,typeName:o,definingContractName:s,definingContract:a}=p(e,t,r,n);let u=f(e.underlyingType,t,r,null);return a?{typeClass:"userDefinedValueType",kind:"local",id:i,typeName:o,definingContractName:s,definingContract:a,underlyingType:u}:{typeClass:"userDefinedValueType",kind:"global",id:i,typeName:o,underlyingType:u}}case"ContractDefinition":return{typeClass:"contract",kind:"native",id:(0,d.makeTypeId)(e.id,t),typeName:e.name,contractKind:e.contractKind,payable:l.isContractPayable(e)}}}function p(e,t,r,n){const i=(0,d.makeTypeId)(e.id,t);let o,s;e.canonicalName?e.canonicalName.includes(".")?[o,s]=e.canonicalName.split("."):s=e.canonicalName:s=e.name;let a=undefined;if(n){let e=Object.values(n).find((e=>"ContractDefinition"===e.nodeType&&e.nodes.some((e=>(0,d.makeTypeId)(e.id,t)===i))));e&&(a=h(e,t,r),o||(o=e.name))}return{definingContract:a,definingContractName:o,typeName:s,id:i}}r.definitionToType=f,r.definitionToStoredType=h}}},{package:"@truffle/codec",file:"node_modules/@truffle/codec/dist/lib/ast/import/index.js"}],[1508,{"./import":1507,"./types":1509,"./utils":1510},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){n===undefined&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){n===undefined&&(n=r),e[n]=t[r]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)},s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&n(t,e,r);return i(t,e),t};Object.defineProperty(r,"__esModule",{value:!0}),r.Import=r.Utils=void 0,o(e("./types"),r);const a=s(e("./utils"));r.Utils=a;const u=s(e("./import"));r.Import=u}}},{package:"@truffle/codec",file:"node_modules/@truffle/codec/dist/lib/ast/index.js"}],[1509,{},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0})}}},{package:"@truffle/codec",file:"node_modules/@truffle/codec/dist/lib/ast/types.js"}],[1510,{"../common":1519,"bn.js":1586,debug:2075,"lodash/cloneDeep":2905},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){n===undefined&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){n===undefined&&(n=r),e[n]=t[r]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&n(t,e,r);return i(t,e),t},s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(r,"__esModule",{value:!0}),r.getterParameters=r.definitionToAbi=r.isContractPayable=r.mutability=r.functionClass=r.functionKind=r.parameters=r.valueDefinition=r.keyDefinition=r.baseDefinition=r.rationalValue=r.regularizeTypeIdentifier=r.spliceLocation=r.isSimpleConstant=r.stackSize=r.contractKind=r.referenceType=r.isReference=r.isEnum=r.isMapping=r.isStruct=r.staticLengthAsString=r.staticLength=r.isDynamicArray=r.isArray=r.decimalPlaces=r.specifiedSize=r.visibility=r.typeId=r.typeClassLongForm=r.typeClass=r.typeStringWithoutLocation=r.typeString=r.typeIdentifier=void 0;const a=(0,s(e("debug")).default)("codec:ast:utils"),u=o(e("../common")),c=s(e("bn.js")),l=s(e("lodash/cloneDeep"));function d(e){return e.typeDescriptions.typeIdentifier}function f(e){return e.typeDescriptions.typeString}function h(e){return"YulTypedName"===e.nodeType?"bytes32":f(e).replace(/ (storage|memory|calldata)( slice)?$/,"")}function p(e){return"YulTypedName"===e.nodeType?"bytes":d(e).match(/t_([^$_0-9]+)/)[1]}function m(e){return d(e).match(/t_([^$_]+)/)[1]}function g(e){return a("definition %O",e),parseInt(d(e).match(/\$(\d+)(_(storage|memory|calldata)(_ptr(_slice)?)?)?$/)[1])}function y(e){return e.typeName?e.typeName.visibility:e.visibility}function v(e){return null!=d(e).match(/^t_array/)}function b(e){return v(e)&&null!=d(e).match(/\$dyn_(storage|memory|calldata)(_ptr(_slice)?)?$/)}function w(e){return parseInt(M(e))}function M(e){return d(e).match(/\$(\d+)_(storage|memory|calldata)(_ptr(_slice)?)?$/)[1]}function _(e){return null!=d(e).match(/_(memory|storage|calldata)(_ptr(_slice)?)?$/)}function O(e){return d(e).match(/_([^_]+)(_ptr(_slice)?)?$/)[1]}function E(e){return e.replace(/(_(storage|memory|calldata))((_slice)?_ptr)?$/,"$1_ptr")}function T(e,t){let r;switch(p(e)){case"mapping":if(e.keyType)return e.keyType;if(e.typeName&&e.typeName.keyType)return e.typeName.keyType;let n=e.referencedDeclaration;if(a("baseDeclarationId %d",n),n!==undefined){let e=t[n].definition;return e.keyType||e.typeName.keyType}let i=d(e).match(/^t_mapping\$_(.*?)_\$_/)[1];i=E(i);let o=f(e).match(/mapping\((.*?) => .*\)( storage)?$/)[1];return r=(0,l.default)(e),r.typeDescriptions={typeIdentifier:i,typeString:o},r;case"array":return r=(0,l.default)(e),r.typeDescriptions={typeIdentifier:"t_uint256",typeString:"uint256"},r;default:a("unrecognized index access!")}}function j(e){return"FunctionDefinition"!==e.nodeType?undefined:e.kind!==undefined?e.kind:e.isConstructor?"constructor":""===e.name?"fallback":"function"}function k(e){return"FunctionDefinition"!==(e=e.typeName||e).nodeType&&"FunctionTypeName"!==e.nodeType?undefined:e.stateMutability!==undefined?e.stateMutability:e.payable?"payable":e.constant?"view":"nonpayable"}function x(e,t){return e.map((e=>S(e,t)))}function S(e,t){let r,n=e.name,i=h(e);if("array"===p(e)){let r=S(e.typeName?e.typeName.baseType:e.baseType,t),o=b(e)?"[]":`[${w(e)}]`;const s={name:n,type:r.type+o,components:r.components,internalType:i};return"indexed"in e?Object.assign(Object.assign({},s),{indexed:e.indexed}):s}let o=C(e,t);if("struct"===p(e)){let n=g(e),i=t[n];if(i===undefined){let t=f(e);throw new u.UnknownUserDefinedTypeError(n.toString(),t)}r=x(i.members,t)}const s={name:n,type:o,components:r,internalType:i};return"indexed"in e?Object.assign(Object.assign({},s),{indexed:e.indexed}):s}function C(e,t){let r=m(e);switch(r){case"contract":return"address";case"struct":return"tuple";case"enum":{const r=g(e),n=t[r];if(n===undefined){const t=f(e);throw new u.UnknownUserDefinedTypeError(r.toString(),t)}const i=n.members.length;return`uint${8*Math.ceil(Math.log2(i)/8)}`}case"userDefinedValueType":{const r=g(e),n=t[r];if(n===undefined){const t=f(e);throw new u.UnknownUserDefinedTypeError(r.toString(),t)}return C(n.underlyingType,t)}default:return r}}function A(e,t){let r=e.typeName||e,n=[];for(;"array"===p(r)||"mapping"===p(r);){let e=T(r);switch(n.push(Object.assign(Object.assign({},e),{name:""})),p(r)){case"array":r=r.baseType;break;case"mapping":r=r.valueType}}if("struct"===p(r)){let e=g(r),i=t[e];if(i===undefined){let t=f(r);throw new u.UnknownUserDefinedTypeError(e.toString(),t)}return{inputs:n,outputs:i.members.filter((e=>"array"!==p(e)&&"mapping"!==p(e)))}}return{inputs:n,outputs:[Object.assign(Object.assign({},r),{name:""})]}}r.typeIdentifier=d,r.typeString=f,r.typeStringWithoutLocation=h,r.typeClass=p,r.typeClassLongForm=m,r.typeId=g,r.visibility=y,r.specifiedSize=function(e){if("YulTypedName"===e.nodeType)return 32;let t=d(e).match(/t_[a-z]+([0-9]+)/);if(!t)return null;let r=parseInt(t[1]);switch(p(e)){case"int":case"uint":case"fixed":case"ufixed":return r/8;case"bytes":return r;default:a("Unknown type for size specification: %s",d(e))}},r.decimalPlaces=function(e){return parseInt(d(e).match(/t_[a-z]+[0-9]+x([0-9]+)/)[1])},r.isArray=v,r.isDynamicArray=b,r.staticLength=w,r.staticLengthAsString=M,r.isStruct=function(e){return null!=d(e).match(/^t_struct/)},r.isMapping=function(e){return null!=d(e).match(/^t_mapping/)},r.isEnum=function(e){return null!=d(e).match(/^t_enum/)},r.isReference=_,r.referenceType=O,r.contractKind=function(e){return f(e).split(" ")[0]},r.stackSize=function(e){if("function"===p(e)&&"external"===y(e))return 2;if(_(e)&&"calldata"===O(e)){if("string"===p(e)||"bytes"===p(e))return 2;if(b(e))return 2}return 1},r.isSimpleConstant=function(e){return["stringliteral","rational"].includes(p(e))},r.spliceLocation=function(e,t){return a("definition %O",e),Object.assign(Object.assign({},e),{typeDescriptions:Object.assign(Object.assign({},e.typeDescriptions),{typeIdentifier:e.typeDescriptions.typeIdentifier.replace(/_(storage|memory|calldata)(?=((_slice)?_ptr)?$)/,"_"+t)})})},r.regularizeTypeIdentifier=E,r.rationalValue=function(e){let t=d(e),r=t.match(/_(\d+)_by_1$/)[1];return null!=t.match(/_minus_/)?new c.default(r).neg():new c.default(r)},r.baseDefinition=function(e){if(e.typeName&&e.typeName.baseType)return e.typeName.baseType;if(e.baseType)return e.baseType;let t=d(e).match(/^t_array\$_(.*)_\$/)[1];t=E(t);let r=(0,l.default)(e);return r.typeDescriptions.typeIdentifier=t,r},r.keyDefinition=T,r.valueDefinition=function(e,t){let r;if(e.valueType)return e.valueType;if(e.typeName&&e.typeName.valueType)return e.typeName.valueType;let n=e.referencedDeclaration;if(a("baseDeclarationId %d",n),n!==undefined){let e=t[n].definition;return e.valueType||e.typeName.valueType}let i=d(e).match(/^t_mapping\$_.*?_\$_(.*)_\$/)[1];i=E(i);let o=f(e).match(/mapping\(.*? => (.*)\)( storage)?$/)[1];return r=(0,l.default)(e),r.typeDescriptions={typeIdentifier:i,typeString:o},r},r.parameters=function(e){let t=e.typeName||e;return t.parameterTypes&&t.returnParameterTypes?[t.parameterTypes.parameters,t.returnParameterTypes.parameters]:undefined},r.functionKind=j,r.functionClass=function(e){const t=d(e).match(/^t_function_([^_]+)_/);return t?t[1]:undefined},r.mutability=k,r.isContractPayable=function(e){return e.nodes.some((e=>"FunctionDefinition"===e.nodeType&&("fallback"===j(e)||"receive"===j(e))&&"payable"===k(e)))},r.definitionToAbi=function(e,t){switch(e.nodeType){case"FunctionDefinition":return"public"===e.visibility||"external"===e.visibility?function(e,t){let r,n=j(e),i=k(e),o="payable"===i;switch(n){case"function":let n=e.name,s=x(e.returnParameters.parameters,t);return r=x(e.parameters.parameters,t),{type:"function",name:n,inputs:r,outputs:s,stateMutability:i};case"constructor":return r=x(e.parameters.parameters,t),{type:"constructor",inputs:r,stateMutability:i,payable:o};case"fallback":return{type:"fallback",stateMutability:i,payable:o};case"receive":return{type:"receive",stateMutability:i,payable:o}}}(e,t):undefined;case"EventDefinition":return function(e,t){let r=x(e.parameters.parameters,t),n=e.name,i=e.anonymous;return{type:"event",inputs:r,name:n,anonymous:i}}(e,t);case"ErrorDefinition":return function(e,t){let r=x(e.parameters.parameters,t),n=e.name;return{type:"error",inputs:r,name:n}}(e,t);case"VariableDeclaration":return"public"===e.visibility?function(e,t){a("getter node: %O",e);let r=e.name,{inputs:n,outputs:i}=A(e,t),o=x(n,t),s=x(i,t);return{type:"function",name:r,inputs:o,outputs:s,stateMutability:"view"}}(e,t):undefined;default:return undefined}},r.getterParameters=A}}},{package:"@truffle/codec",file:"node_modules/@truffle/codec/dist/lib/ast/utils.js"}],[1511,{"../../common":1519,"../../evm":1536,"../../format":1541,debug:2075},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){n===undefined&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){n===undefined&&(n=r),e[n]=t[r]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&n(t,e,r);return i(t,e),t},s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(r,"__esModule",{value:!0}),r.byteLength=void 0;(0,s(e("debug")).default)("codec:basic:allocate");const a=o(e("../../common")),u=o(e("../../evm")),c=o(e("../../format"));r.byteLength=function e(t,r){switch(t.typeClass){case"bool":return 1;case"address":case"contract":return u.Utils.ADDRESS_SIZE;case"int":case"uint":case"fixed":case"ufixed":return t.bits/8;case"function":switch(t.visibility){case"internal":return 2*u.Utils.PC_SIZE;case"external":return u.Utils.ADDRESS_SIZE+u.Utils.SELECTOR_SIZE}case"bytes":return t.length;case"enum":{const e=r[t.id];if(!e||!e.options)throw new a.UnknownUserDefinedTypeError(t.id,c.Types.typeString(t));const n=e.options.length;return Math.ceil(Math.log2(n)/8)}case"userDefinedValueType":{const n=r[t.id];if(!n||!n.underlyingType)throw new a.UnknownUserDefinedTypeError(t.id,c.Types.typeString(t));const{underlyingType:i}=n;return e(i,r)}}}}}},{package:"@truffle/codec",file:"node_modules/@truffle/codec/dist/lib/basic/allocate/index.js"}],[1512,{"../../contexts":1528,"../../conversion":1531,"../../errors":1534,"../../evm":1536,"../../format":1541,"../../read":1553,"../allocate":1511,debug:2075},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){n===undefined&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){n===undefined&&(n=r),e[n]=t[r]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&n(t,e,r);return i(t,e),t},s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(r,"__esModule",{value:!0}),r.checkPaddingLeft=r.decodeExternalFunction=r.decodeContract=r.decodeBasic=void 0;const a=(0,s(e("debug")).default)("codec:basic:decode"),u=s(e("../../read")),c=o(e("../../conversion")),l=o(e("../../format")),d=o(e("../../contexts")),f=o(e("../../evm")),h=e("../../errors"),p=e("../allocate");function*m(e,t){return(yield*g(e,t)).contractInfo}function*g(e,t){let r=f.Utils.toAddress(e),n=c.toHexString(e),i=yield{type:"code",address:r},o=c.toHexString(i),s=d.Utils.findContext(t.contexts,o);return null!==s?{context:s,contractInfo:{kind:"known",address:r,rawAddress:n,class:d.Import.contextToType(s)}}:{context:s,contractInfo:{kind:"unknown",address:r,rawAddress:n}}}function*y(e,t,r){let{contractInfo:n,context:i}=yield*g(e,r),o=c.toHexString(t);if("unknown"===n.kind)return{kind:"unknown",contract:n,selector:o};let s=i.abi!==undefined?i.abi[o]:undefined;return s===undefined?{kind:"invalid",contract:n,selector:o}:{kind:"known",contract:n,selector:o,abi:s}}function v(e,t,r,n){const i=(0,p.byteLength)(t,n),o=_(t,r);if("permissive"!==r)return M(e,i,o);switch(t.typeClass){case"bool":case"enum":case"function":return M(e,i,o);default:return!0}}function b(e,t,r,n){return w(e,(0,p.byteLength)(t,n),_(t,r))}function w(e,t,r){return"right"===r?e.slice(0,t):e.slice(-t)}function M(e,t,r){switch(r){case"left":return E(e,t);case"right":return function(e,t){return e.slice(t).every((e=>0===e))}(e,t);case"signed":return T(e,t);case"signedOrLeft":return T(e,t)||E(e,t)}}function _(e,t){switch(t){case"right":return"right";case"default":case"permissive":return O(e);case"zero":{const t=O(e);return"signed"===t?"left":t}case"defaultOrZero":{const t=O(e);return"signed"===t?"signedOrLeft":t}}}function O(e){switch(e.typeClass){case"bytes":return"right";case"int":case"fixed":return"signed";case"function":if("external"===e.visibility)return"right";default:return"left"}}function E(e,t){return e.slice(0,-t).every((e=>0===e))}function T(e,t){let r=e.slice(0,-t),n=128&e.slice(-t)[0]?255:0;return r.every((e=>e===n))}r.decodeBasic=function*e(t,r,n,i={}){const{state:o}=n,{strictAbiMode:s}=i,p=i.paddingMode||"default";let g,O;try{g=yield*(0,u.default)(r,o)}catch(e){return a("segfault, pointer %o, state: %O",r,o),(0,h.handleDecodingError)(t,e,s)}switch(O=g,a("type %O",t),a("pointer %o",r),t.typeClass){case"userDefinedValueType":{const o=l.Types.fullType(t,n.userDefinedTypes);if(!o.underlyingType){const e={kind:"UserDefinedTypeNotFoundError",type:o};if(s||i.allowRetry)throw new h.StopDecodingError(e,!0);return{type:o,kind:"error",error:e}}const a=yield*e(o.underlyingType,r,n,i);switch(a.kind){case"value":return{type:o,kind:"value",value:a};case"error":return{type:o,kind:"error",error:{kind:"WrappedError",error:a}}}break}case"bool":{if(!v(g,t,p)){let e={kind:"BoolPaddingError",paddingType:_(t,p),raw:c.toHexString(g)};if(s)throw new h.StopDecodingError(e);return{type:t,kind:"error",error:e}}g=b(g,t,p);const e=c.toBN(g);if(e.eqn(0))return{type:t,kind:"value",value:{asBoolean:!1}};if(e.eqn(1))return{type:t,kind:"value",value:{asBoolean:!0}};{let r={kind:"BoolOutOfRangeError",rawAsBN:e};if(s)throw new h.StopDecodingError(r);return{type:t,kind:"error",error:r}}}case"uint":if(!v(g,t,p)){let e={kind:"UintPaddingError",paddingType:_(t,p),raw:c.toHexString(g)};if(s)throw new h.StopDecodingError(e);return{type:t,kind:"error",error:e}}return g=b(g,t,p),{type:t,kind:"value",value:{asBN:c.toBN(g),rawAsBN:c.toBN(O)}};case"int":if(!v(g,t,p)){let e={kind:"IntPaddingError",paddingType:_(t,p),raw:c.toHexString(g)};if(s)throw new h.StopDecodingError(e);return{type:t,kind:"error",error:e}}return g=b(g,t,p),{type:t,kind:"value",value:{asBN:c.toSignedBN(g),rawAsBN:c.toSignedBN(O)}};case"address":if(!v(g,t,p)){let e={kind:"AddressPaddingError",paddingType:_(t,p),raw:c.toHexString(g)};if(s)throw new h.StopDecodingError(e);return{type:t,kind:"error",error:e}}return g=b(g,t,p),{type:t,kind:"value",value:{asAddress:f.Utils.toAddress(g),rawAsHex:c.toHexString(O)}};case"contract":if(!v(g,t,p)){let e={kind:"ContractPaddingError",paddingType:_(t,p),raw:c.toHexString(g)};if(s)throw new h.StopDecodingError(e);return{type:t,kind:"error",error:e}}g=b(g,t,p);return{type:l.Types.fullType(t,n.userDefinedTypes),kind:"value",value:yield*m(g,n)};case"bytes":let o=t;if(!v(g,t,p)){let e={kind:"BytesPaddingError",paddingType:_(t,p),raw:c.toHexString(g)};if(s)throw new h.StopDecodingError(e);return{type:o,kind:"error",error:e}}return g=b(g,t,p),{type:o,kind:"value",value:{asHex:c.toHexString(g),rawAsHex:c.toHexString(O)}};case"function":switch(t.visibility){case"external":if(!v(g,t,p)){const e={kind:"FunctionExternalNonStackPaddingError",paddingType:_(t,p),raw:c.toHexString(g)};if(s)throw new h.StopDecodingError(e);return{type:t,kind:"error",error:e}}g=b(g,t,p);const e=g.slice(0,f.Utils.ADDRESS_SIZE),r=g.slice(f.Utils.ADDRESS_SIZE,f.Utils.ADDRESS_SIZE+f.Utils.SELECTOR_SIZE);return{type:t,kind:"value",value:yield*y(e,r,n)};case"internal":if(!v(g,t,p)){const e={kind:"FunctionInternalPaddingError",paddingType:_(t,p),raw:c.toHexString(g)};if(s)throw new h.StopDecodingError(e);return{type:t,kind:"error",error:e}}g=b(g,t,p);return function(e,t,r,n,i){const o=c.toBN(t).toNumber(),s=c.toBN(r).toNumber(),a=d.Import.contextToType(n.currentContext);if(!n.internalFunctionsTable)return{type:e,kind:"value",value:{kind:"unknown",context:a,deployedProgramCounter:o,constructorProgramCounter:s}};if(0===o&&0===s)return{type:e,kind:"value",value:{kind:"exception",context:a,deployedProgramCounter:o,constructorProgramCounter:s}};if(0===o&&0!==s){const t={kind:"MalformedInternalFunctionError",context:a,deployedProgramCounter:0,constructorProgramCounter:s};if(i)throw new h.StopDecodingError(t);return{type:e,kind:"error",error:t}}if(n.currentContext.isConstructor&&0===s){const t={kind:"DeployedFunctionInConstructorError",context:a,deployedProgramCounter:o,constructorProgramCounter:0};if(i)throw new h.StopDecodingError(t);return{type:e,kind:"error",error:t}}const u=n.currentContext.isConstructor?s:o,l=n.internalFunctionsTable[u];if(!l){const t={kind:"NoSuchInternalFunctionError",context:a,deployedProgramCounter:o,constructorProgramCounter:s};if(i)throw new h.StopDecodingError(t);return{type:e,kind:"error",error:t}}if(l.isDesignatedInvalid)return{type:e,kind:"value",value:{kind:"exception",context:a,deployedProgramCounter:o,constructorProgramCounter:s}};const p=l.name,m=l.mutability,g=f.Import.functionTableEntryToType(l),y=f.Import.makeInternalFunctionId(l);return{type:e,kind:"value",value:{kind:"function",context:a,deployedProgramCounter:o,constructorProgramCounter:s,name:p,id:y,definedIn:g,mutability:m}}}(t,g.slice(-f.Utils.PC_SIZE),g.slice(2*-f.Utils.PC_SIZE,-f.Utils.PC_SIZE),n,s)}break;case"enum":{let e=c.toBN(g);const r=l.Types.fullType(t,n.userDefinedTypes);if(!r.options){let t={kind:"EnumNotFoundDecodingError",type:r,rawAsBN:e};if(s||i.allowRetry)throw new h.StopDecodingError(t,!0);return{type:r,kind:"error",error:t}}const o=r.options.length,a=Math.ceil(Math.log2(o)/8),u=_(t,p);if(!M(g,a,u)){let e={kind:"EnumPaddingError",type:r,paddingType:u,raw:c.toHexString(g)};if(s)throw new h.StopDecodingError(e);return{type:t,kind:"error",error:e}}if(g=w(g,a,u),e=c.toBN(g),e.ltn(o)){return{type:r,kind:"value",value:{name:r.options[e.toNumber()],numericAsBN:e}}}{let t={kind:"EnumOutOfRangeError",type:r,rawAsBN:e};if(s)throw new h.StopDecodingError(t);return{type:r,kind:"error",error:t}}}case"fixed":{if(!v(g,t,p)){let e={kind:"FixedPaddingError",paddingType:_(t,p),raw:c.toHexString(g)};if(s)throw new h.StopDecodingError(e);return{type:t,kind:"error",error:e}}g=b(g,t,p);let e=c.toSignedBN(g),r=c.toSignedBN(O);return{type:t,kind:"value",value:{asBig:c.shiftBigDown(c.toBig(e),t.places),rawAsBig:c.shiftBigDown(c.toBig(r),t.places)}}}case"ufixed":{if(!v(g,t,p)){let e={kind:"UfixedPaddingError",paddingType:_(t,p),raw:c.toHexString(g)};if(s)throw new h.StopDecodingError(e);return{type:t,kind:"error",error:e}}g=b(g,t,p);let e=c.toBN(g),r=c.toBN(O);return{type:t,kind:"value",value:{asBig:c.shiftBigDown(c.toBig(e),t.places),rawAsBig:c.shiftBigDown(c.toBig(r),t.places)}}}}},r.decodeContract=m,r.decodeExternalFunction=y,r.checkPaddingLeft=E}}},{package:"@truffle/codec",file:"node_modules/@truffle/codec/dist/lib/basic/decode/index.js"}],[1513,{"../../conversion":1531,"../../evm":1536},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){n===undefined&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){n===undefined&&(n=r),e[n]=t[r]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&n(t,e,r);return i(t,e),t};Object.defineProperty(r,"__esModule",{value:!0}),r.encodeBasic=void 0;const s=o(e("../../conversion")),a=o(e("../../evm"));r.encodeBasic=function e(t){let r;switch(t.type.typeClass){case"userDefinedValueType":return e(t.value);case"uint":case"int":return s.toBytes(t.value.asBN,a.Utils.WORD_SIZE);case"enum":return s.toBytes(t.value.numericAsBN,a.Utils.WORD_SIZE);case"bool":return r=new Uint8Array(a.Utils.WORD_SIZE),t.value.asBoolean&&(r[a.Utils.WORD_SIZE-1]=1),r;case"bytes":if("static"===t.type.kind){r=s.toBytes(t.value.asHex);let e=new Uint8Array(a.Utils.WORD_SIZE);return e.set(r),e}case"address":return s.toBytes(t.value.asAddress,a.Utils.WORD_SIZE);case"contract":return s.toBytes(t.value.address,a.Utils.WORD_SIZE);case"function":if("external"===t.type.visibility){let e=t,r=new Uint8Array(a.Utils.WORD_SIZE),n=s.toBytes(e.value.contract.address),i=s.toBytes(e.value.selector);return r.set(n),r.set(i,a.Utils.ADDRESS_SIZE),r}break;case"fixed":case"ufixed":let n=t.value.asBig,i=s.shiftBigUp(n,t.type.places);return s.toBytes(i,a.Utils.WORD_SIZE)}}}}},{package:"@truffle/codec",file:"node_modules/@truffle/codec/dist/lib/basic/encode/index.js"}],[1514,{"./allocate":1511,"./decode":1512,"./encode":1513},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){n===undefined&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){n===undefined&&(n=r),e[n]=t[r]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&n(t,e,r);return i(t,e),t};Object.defineProperty(r,"__esModule",{value:!0}),r.Allocate=r.Encode=r.Decode=void 0;const s=o(e("./decode"));r.Decode=s;const a=o(e("./encode"));r.Encode=a;const u=o(e("./allocate"));r.Allocate=u}}},{package:"@truffle/codec",file:"node_modules/@truffle/codec/dist/lib/basic/index.js"}],[1515,{"../../conversion":1531,"../../errors":1534,"../../read":1553,debug:2075,utf8:3349},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){n===undefined&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){n===undefined&&(n=r),e[n]=t[r]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&n(t,e,r);return i(t,e),t},s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(r,"__esModule",{value:!0}),r.decodeString=r.decodeBytes=void 0;const a=(0,s(e("debug")).default)("codec:bytes:decode"),u=s(e("../../read")),c=o(e("../../conversion")),l=e("../../errors"),d=s(e("utf8"));function f(e){let t=String.fromCharCode.apply(undefined,e);try{return{kind:"valid",asString:d.default.decode(t)}}catch(t){return{kind:"malformed",asHex:c.toHexString(e)}}}r.decodeBytes=function*(e,t,r,n={}){const{state:i}=r,{strictAbiMode:o}=n;let s;try{s=yield*(0,u.default)(t,i)}catch(r){return a("segfault, pointer %o, state: %O",t,i),(0,l.handleDecodingError)(e,r,o)}switch(a("type %O",e),a("pointer %o",t),e.typeClass){case"bytes":return{type:e,kind:"value",value:{asHex:c.toHexString(s)}};case"string":return{type:e,kind:"value",value:f(s)}}},r.decodeString=f}}},{package:"@truffle/codec",file:"node_modules/@truffle/codec/dist/lib/bytes/decode/index.js"}],[1516,{"../../conversion":1531},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){n===undefined&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){n===undefined&&(n=r),e[n]=t[r]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&n(t,e,r);return i(t,e),t};Object.defineProperty(r,"__esModule",{value:!0}),r.encodeBytes=void 0;const s=o(e("../../conversion"));r.encodeBytes=function(e){switch(e.type.typeClass){case"bytes":return s.toBytes(e.value.asHex);case"string":{let t=e;switch(t.value.kind){case"valid":return s.stringToBytes(t.value.asString);case"malformed":return s.toBytes(t.value.asHex)}}}}}}},{package:"@truffle/codec",file:"node_modules/@truffle/codec/dist/lib/bytes/encode/index.js"}],[1517,{"./decode":1515,"./encode":1516,"./read":1518},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){n===undefined&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){n===undefined&&(n=r),e[n]=t[r]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&n(t,e,r);return i(t,e),t};Object.defineProperty(r,"__esModule",{value:!0}),r.Encode=r.Decode=r.Read=void 0;const s=o(e("./read"));r.Read=s;const a=o(e("./decode"));r.Decode=a;const u=o(e("./encode"));r.Encode=u}}},{package:"@truffle/codec",file:"node_modules/@truffle/codec/dist/lib/bytes/index.js"}],[1518,{"../../errors":1534,"../../evm":1536},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){n===undefined&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){n===undefined&&(n=r),e[n]=t[r]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&n(t,e,r);return i(t,e),t};Object.defineProperty(r,"__esModule",{value:!0}),r.readBytes=r.readCode=void 0;const s=o(e("../../evm")),a=e("../../errors");function u(e,t){let r=t[e.location];const{start:n,length:i}=e;if(!Number.isSafeInteger(n+i))throw new a.DecodingError({kind:"ReadErrorBytes",location:e.location,start:n,length:i});var o=new Uint8Array(i);if(o.fill(0),n>=r.length)return o;let s;s=n+i-r.length>0?r.length-n:i;let u=new Uint8Array(r.buffer,n,s);return o.set(u),o}r.readCode=function*(e,t){let r=t.code;if(!r){const e=s.Utils.toAddress(t.specials.this);if(r=yield{type:"code",address:e},null===r)throw new a.DecodingError({kind:"CodeNotSuppliedError",address:e})}return u(e,Object.assign(Object.assign({},t),{code:r}))},r.readBytes=u}}},{package:"@truffle/codec",file:"node_modules/@truffle/codec/dist/lib/bytes/read/index.js"}],[1519,{"./types":1520},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){n===undefined&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){n===undefined&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(r,"__esModule",{value:!0}),i(e("./types"),r)}}},{package:"@truffle/codec",file:"node_modules/@truffle/codec/dist/lib/common/index.js"}],[1520,{},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.UnknownUserDefinedTypeError=void 0;class n extends Error{constructor(e,t){super(`Cannot locate definition for ${t} (ID ${e})`),this.name="UnknownUserDefinedTypeError",this.id=e,this.typeString=t}}r.UnknownUserDefinedTypeError=n}}},{package:"@truffle/codec",file:"node_modules/@truffle/codec/dist/lib/common/types.js"}],[1521,{"./types":1522,"./utils":1523},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){n===undefined&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){n===undefined&&(n=r),e[n]=t[r]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)},s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&n(t,e,r);return i(t,e),t};Object.defineProperty(r,"__esModule",{value:!0}),r.Utils=void 0,o(e("./types"),r);const a=s(e("./utils"));r.Utils=a}}},{package:"@truffle/codec",file:"node_modules/@truffle/codec/dist/lib/compilations/index.js"}],[1522,{},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0})}}},{package:"@truffle/codec",file:"node_modules/@truffle/codec/dist/lib/compilations/types.js"}],[1523,{"../ast":1508,"../errors":1534,"../format":1541,"@truffle/compile-common":1634,debug:2075},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){n===undefined&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){n===undefined&&(n=r),e[n]=t[r]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&n(t,e,r);return i(t,e),t},s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(r,"__esModule",{value:!0}),r.findRepeatCompilationIds=r.infoToCompilations=r.findCompilationAndContract=r.collectUserDefinedTypesAndTaggedOutputs=r.simpleShimSourceMap=r.getContractNode=r.shimContracts=r.shimArtifacts=r.shimCompilation=r.shimCompilations=void 0;const a=(0,s(e("debug")).default)("codec:compilations:utils"),u=o(e("../ast")),c=e("@truffle/compile-common"),l=o(e("../format")),d=e("../errors");function f(e,t="shimmedcompilation"){return e.map(((e,r)=>h(e,`${t}Number(${r})`)))}function h(e,t="shimmedcompilation"){return Object.assign(Object.assign({},m(e.contracts,{files:e.sourceIndexes,sources:e.sources,shimmedCompilationId:t,compiler:e.compiler})),{compiler:e.compiler})}function p(e,t,r="shimmedcompilation"){return[m(e,{files:t,shimmedCompilationId:r})]}function m(e,t={}){const{files:r,sources:n}=t,i=t.shimmedCompilationId||"shimmedcompilation";let o,s,u=[],c=[],l=!1;for(let t of e){let{contractName:e,bytecode:i,sourceMap:o,deployedBytecode:s,deployedSourceMap:d,immutableReferences:f,sourcePath:h,source:p,ast:m,abi:_,compiler:O,generatedSources:E,deployedGeneratedSources:T,metadata:j}=t;t.contract_name&&(e=t.contract_name),a("contractName: %s",e);let k={contractName:e,bytecode:i,sourceMap:o,deployedBytecode:s,deployedSourceMap:d,immutableReferences:f,abi:_,generatedSources:v(E,O),deployedGeneratedSources:v(T,O),compiler:O},x={sourcePath:h,source:p,ast:m,compiler:O,language:b(m,O,h)};if(j)try{const e=JSON.parse(j),t=e.settings.viaIR;k.settings={viaIR:t},x.settings={viaIR:t}}catch(e){}if((r||n)&&h){a("inputSources: %O",n),a("files: %O",r),a("sourcePath: %O",h);const e=n?n.findIndex((e=>e.sourcePath===h)):r.indexOf(h);n||(x.id=e.toString(),c[e]=x),a("files || inputSources; index: %d",e),k.primarySourceId=e.toString()}else{let e,t;if(x.ast?e=g(x.ast):O&&"vyper"===O.name&&(e=0),e===undefined&&(o||d)){e=y(M(d||o))}({index:e,needsAdding:t,unreliableSourceOrder:l}=w(x,e,c,l)),t&&(x.id=e.toString(),c[e]=x,a("else; index: %d",e)),k.primarySourceId=e.toString(),a("(no index unless mentioned)")}u.push(k)}if(!n&&!r)for(let e of u){const{generatedSources:t,deployedGeneratedSources:r}=e;for(let e in t)e in c&&(l=!0);for(let e in r)e in c&&(l=!0)}return t.compiler?o=t.compiler:!l&&u.length>0&&(o=u[0].compiler),t.settings?s=t.settings:!l&&u.length>0&&(s=u[0].settings),n&&(c=n.map((({sourcePath:e,contents:t,ast:r,language:n},i)=>({sourcePath:e,source:t,ast:r,language:n,id:i.toString(),compiler:o})))),{id:i,unreliableSourceOrder:l,sources:c,contracts:u,compiler:o,settings:s}}function g(e){return Array.isArray(e)&&(e=e[0]),e?parseInt(e.src.split(":")[2]):undefined}function y(e){return e?parseInt(e.match(/^[^:]*:[^:]*:([^:]*):/)[1]||"0"):0}function v(e,t){if(!e)return[];if(!function(e){return e.length>0&&!e.includes(undefined)&&(e[0].contents!==undefined||e[0].name!==undefined)}(e))return e;let r=[];for(let n of e)r[n.id]={id:n.id.toString(),sourcePath:n.name,source:n.contents,ast:n.ast,compiler:t,language:n.language};return r}function b(e,t,r){return e?"SourceUnit"===e.nodeType?"Solidity":e.nodeType&&e.nodeType.startsWith("Yul")?"Yul":Array.isArray(e)||"Module"===e.ast_type?"Vyper":void 0:t?"vyper"===t.name?"Vyper":"solc"===t.name?r&&r.endsWith(".yul")?"Yul":"Solidity":undefined:undefined}function w(e,t,r,n){a("sourcePath: %s",e.sourcePath),a("given index: %d",t),a("sources: %o",r.map((e=>e.sourcePath)));const i=r.findIndex((t=>t&&(t.sourcePath===e.sourcePath||!e.sourcePath&&!t.sourcePath&&t.source===e.source)));return-1===i?((n||t===undefined||t in r)&&(a("collision!"),n=!0),n&&(t=r.length),{index:t,needsAdding:!0,unreliableSourceOrder:n}):(a("already present, not adding"),{index:i,needsAdding:!1,unreliableSourceOrder:n})}function M(e){if(e===undefined)return undefined;if("object"==typeof e)return e.pc_pos_map_compressed;try{return JSON.parse(e).pc_pos_map_compressed}catch(t){return e}}r.shimCompilations=f,r.shimCompilation=h,r.shimArtifacts=p,r.shimContracts=m,r.getContractNode=function(e,t){const{contractName:r,sourceMap:n,deployedSourceMap:i,primarySourceId:o}=e,{unreliableSourceOrder:s,sources:a}=t;let u;if(o!==undefined)u=[a.find((e=>e&&e.id===o))];else if(s||!i&&!n)u=a;else{u=[a[y(M(i||n))]]}return u.reduce(((e,t)=>e||!t?e:t.ast&&"Solidity"===t.language?t.ast.nodes.find((e=>"ContractDefinition"===e.nodeType&&e.name===r)):undefined),undefined)},r.simpleShimSourceMap=M,r.collectUserDefinedTypesAndTaggedOutputs=function(e){let t={},r={};for(const n of e){t[n.id]={},r[n.id]={compiler:n.compiler,types:{}};for(const e of n.sources){if(!e)continue;const{ast:i,compiler:o,language:s}=e;if("Solidity"===s&&i)for(const e of i.nodes){if("StructDefinition"===e.nodeType||"EnumDefinition"===e.nodeType||"UserDefinedValueTypeDefinition"===e.nodeType||"ContractDefinition"===e.nodeType){t[n.id][e.id]=e;const i=u.Import.definitionToStoredType(e,n.id,o,t[n.id]);r[n.id].types[i.id]=i}else"EventDefinition"!==e.nodeType&&"ErrorDefinition"!==e.nodeType||(t[n.id][e.id]=e);if("ContractDefinition"===e.nodeType)for(const i of e.nodes)if("StructDefinition"===i.nodeType||"EnumDefinition"===i.nodeType||"UserDefinedValueTypeDefinition"===i.nodeType){t[n.id][i.id]=i;const e=u.Import.definitionToStoredType(i,n.id,o,t[n.id]);r[n.id].types[e.id]=e}else"EventDefinition"!==i.nodeType&&"ErrorDefinition"!==i.nodeType||(t[n.id][i.id]=i)}}}return{definitions:t,typesByCompilation:r,types:l.Types.forgetCompilations(r)}},r.findCompilationAndContract=function(e,t){const r=c.Shims.NewToLegacy.forBytecode(t.deployedBytecode),n=c.Shims.NewToLegacy.forBytecode(t.bytecode);let i,o=!1;for(const s of e)for(const e of s.contracts){if(e.contractName===(t.contractName||t.contract_name))if(n){if(c.Shims.NewToLegacy.forBytecode(e.bytecode)===n)return{compilation:s,contract:e}}else if(r){if(c.Shims.NewToLegacy.forBytecode(e.deployedBytecode)===r)return{compilation:s,contract:e}}else i?o||(o=!0):i={compilation:s,contract:e}}if(i&&!o)return i;const s={contractName:t.contractName||t.contract_name,abi:t.abi};return{compilation:{id:"defaultCompilation",sources:[],contracts:[s]},contract:s}},r.infoToCompilations=function(e,t){if(!e)throw new d.NoProjectInfoError;return Boolean(e.compilations)?e.compilations:function(e){return Boolean(e.commonCompilations)}(e)?f(e.commonCompilations,t):function(e){return Boolean(e.artifacts)}(e)?p(e.artifacts,undefined,t):void 0},r.findRepeatCompilationIds=function(e){let t=new Set;for(let r=0;r<e.length;r++)for(let n=r+1;n<e.length;n++)e[r].id===e[n].id&&t.add(e[r].id);return t}}}},{package:"@truffle/codec",file:"node_modules/@truffle/codec/dist/lib/compilations/utils.js"}],[1524,{"./types":1525,"./utils":1526},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){n===undefined&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){n===undefined&&(n=r),e[n]=t[r]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)},s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&n(t,e,r);return i(t,e),t};Object.defineProperty(r,"__esModule",{value:!0}),r.Utils=void 0,o(e("./types"),r);const a=s(e("./utils"));r.Utils=a}}},{package:"@truffle/codec",file:"node_modules/@truffle/codec/dist/lib/compiler/index.js"}],[1525,{},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0})}}},{package:"@truffle/codec",file:"node_modules/@truffle/codec/dist/lib/compiler/types.js"}],[1526,{debug:2075,semver:1615},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(r,"__esModule",{value:!0}),r.solidityFamily=void 0;(0,n(e("debug")).default)("codec:compiler:utils");const i=n(e("semver"));r.solidityFamily=function(e){return e&&"solc"===e.name?i.default.satisfies(e.version,">=0.8.9",{includePrerelease:!0})?"0.8.9+":i.default.satisfies(e.version,">=0.8.7",{includePrerelease:!0})?"0.8.7+":i.default.satisfies(e.version,"~0.8 || >=0.8.0",{includePrerelease:!0})?"0.8.x":i.default.satisfies(e.version,"~0.5 || >=0.5.0",{includePrerelease:!0})?"0.5.x":"pre-0.5.0":"unknown"}}}},{package:"@truffle/codec",file:"node_modules/@truffle/codec/dist/lib/compiler/utils.js"}],[1527,{},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){function n(e,t){return`${t}:${e}`}Object.defineProperty(r,"__esModule",{value:!0}),r.makeTypeId=r.contextToType=void 0,r.contextToType=function(e){return e.contractId!==undefined?{typeClass:"contract",kind:"native",id:n(e.contractId,e.compilationId),typeName:e.contractName,contractKind:e.contractKind,payable:e.payable}:{typeClass:"contract",kind:"foreign",typeName:e.contractName,contractKind:e.contractKind,payable:e.payable}},r.makeTypeId=n}}},{package:"@truffle/codec",file:"node_modules/@truffle/codec/dist/lib/contexts/import/index.js"}],[1528,{"./import":1527,"./types":1529,"./utils":1530},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){n===undefined&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){n===undefined&&(n=r),e[n]=t[r]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)},s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&n(t,e,r);return i(t,e),t};Object.defineProperty(r,"__esModule",{value:!0}),r.Utils=r.Import=void 0,o(e("./types"),r);const a=s(e("./import"));r.Import=a;const u=s(e("./utils"));r.Utils=u}}},{package:"@truffle/codec",file:"node_modules/@truffle/codec/dist/lib/contexts/index.js"}],[1529,{},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0})}}},{package:"@truffle/codec",file:"node_modules/@truffle/codec/dist/lib/contexts/types.js"}],[1530,{"../abi-data/utils":1502,"../conversion":1531,"../evm":1536,"@truffle/abi-utils":1488,"@truffle/compile-common":1634,cbor:1958,debug:2075,"lodash/escapeRegExp":2907},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){n===undefined&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){n===undefined&&(n=r),e[n]=t[r]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&n(t,e,r);return i(t,e),t},s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(r,"__esModule",{value:!0}),r.makeContext=r.normalizeContexts=r.matchContext=r.findContext=void 0;const a=(0,s(e("debug")).default)("codec:contexts:utils"),u=o(e("../evm")),c=o(e("../conversion")),l=s(e("lodash/escapeRegExp")),d=o(e("cbor")),f=e("@truffle/compile-common"),h=o(e("@truffle/abi-utils")),p=o(e("../abi-data/utils"));function m(e,t){const{binary:r,compiler:n,isConstructor:i}=e,o=t.length-r.length;if(!(i||n!=undefined&&"vyper"===n.name)&&0!==o||o<0||o%(2*u.Utils.WORD_SIZE)!=0)return!1;for(let e=0;e<r.length;e++)if("."!==r[e]&&r[e].toLowerCase()!==t[e].toLowerCase())return!1;return!0}function g(e){a("extracting cbor segement of %s",e);const t=e.slice(2).slice(-4);if(t.length<4)return null;const r=parseInt(t,16),n=e.length-4,i=n-2*r;if(i<2)return null;const o=e.slice(i,n);return{cborStart:i,cborLength:r,cborEnd:n,cborLengthHex:t,cbor:o,cborSegment:o+t}}function y(e){if("object"!=typeof e||null===e)return undefined;if(e instanceof Map||(e=new Map(Object.entries(e))),!e.has("solc"))return undefined;const t=e.get("solc");return"string"==typeof t?{name:"solc",version:t}:t instanceof Uint8Array&&3===t.length?{name:"solc",version:t.join(".")}:undefined}function v(e,t){if(t)return t.contractKind;if(e.deployedBytecode){const t=f.Shims.NewToLegacy.forBytecode(e.deployedBytecode),r="0x"+(96+u.Utils.ADDRESS_SIZE-1).toString(16)+"00".repeat(u.Utils.ADDRESS_SIZE);return t.startsWith(r)?"library":"contract"}return"contract"}r.findContext=function(e,t){const r=Object.values(e).filter((e=>m(e,t)));return r.find((e=>!r.some((t=>e.compilationId===t.compilationId&&e.linearizedBaseContracts&&t.contractId!==undefined&&e.linearizedBaseContracts.slice(1).includes(t.contractId)))))||null},r.matchContext=m,r.normalizeContexts=function(e){a("normalizing contexts");let t=Object.assign({},...Object.entries(e).map((([e,t])=>({[e]:Object.assign({},t)}))));a("contexts cloned");const r=2*u.Utils.ADDRESS_SIZE;let n=Object.values(t).filter((e=>"library"===e.contractKind)).map((e=>e.contractName)).filter((e=>e.length>=r-3)).sort(((e,t)=>t.length-e.length));a("names sorted");let i=n.map((e=>new RegExp((0,l.default)("__"+e),"g")));a("regexps prepared");const o=".".repeat(r);for(let e of i)for(let r of Object.values(t))r.binary=r.binary.replace(e,o);a("long replacements complete");const s=new RegExp("_.{"+(r-2)+"}_","g");for(let e of Object.values(t))e.binary=e.binary.replace(s,o);a("short replacements complete");const c=(96+u.Utils.ADDRESS_SIZE-1).toString(16);for(let e of Object.values(t))"library"!==e.contractKind||e.isConstructor||(e.binary=e.binary.replace("0x"+c+"00".repeat(u.Utils.ADDRESS_SIZE),"0x"+c+o));a("extra library replacements complete");for(let e of Object.values(t))if(e.immutableReferences)for(let t of Object.values(e.immutableReferences))for(let{start:r,length:n}of t){let t=2+2*r,i=2+2*(r+n);e.binary=e.binary.slice(0,t)+"..".repeat(n)+e.binary.slice(i)}a("immutables complete");let f={},h={};for(const[e,r]of Object.entries(t)){const t=g(r.binary);if(f[e]=t,t)try{const r=d.decodeFirstSync(t.cbor);h[e]=r}catch(e){}}a("intial cbor processing complete");for(let[e,r]of Object.entries(t))!r.compiler&&e in h&&(r.compiler=y(h[e]));a("versions complete");const p=Object.entries(f).filter((([e,t])=>e in h&&function(e){if("object"!=typeof e||null===e)return!1;e instanceof Map||(e=new Map(Object.entries(e)));return["bzzr0","bzzr1","ipfs"].some((t=>e.has(t)))}(h[e]))).map((([e,t])=>t)).map((e=>({input:new RegExp(e.cborSegment,"g"),output:"..".repeat(e.cborLength)+e.cborLengthHex})));for(let e of Object.values(t))for(let{input:t,output:r}of p)e.binary=e.binary.replace(t,r);return a("external wildcards complete"),t},r.makeContext=function(e,t,r,n=!1){const i=h.normalize(e.abi),o=n?e.bytecode:e.deployedBytecode,s=f.Shims.NewToLegacy.forBytecode(o),l=c.toHexString(u.Utils.keccak256({type:"string",value:s}));a("hash: %s",l);const d=i.find((e=>"fallback"===e.type))||null,m=i.find((e=>"receive"===e.type))||null;return{context:l,contractName:e.contractName,binary:s,contractId:t?t.id:undefined,linearizedBaseContracts:t?t.linearizedBaseContracts:undefined,contractKind:v(e,t),immutableReferences:n?undefined:e.immutableReferences,isConstructor:n,abi:p.computeSelectors(i),payable:p.abiHasPayableFallback(i),fallbackAbi:{fallback:d,receive:m},compiler:r.compiler||e.compiler,compilationId:r.id}}}}},{package:"@truffle/codec",file:"node_modules/@truffle/codec/dist/lib/contexts/utils.js"}],[1531,{"big.js":1585,"bn.js":1586,debug:2075,utf8:3349},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(r,"__esModule",{value:!0}),r.cleanBool=r.countDecimalPlaces=r.shiftBigDown=r.shiftBigUp=r.stringToBytes=r.toBytes=r.toHexString=r.toBig=r.toBigInt=r.toSignedBN=r.isBig=r.toBN=void 0;const i=(0,n(e("debug")).default)("codec:conversion"),o=n(e("bn.js")),s=n(e("big.js")),a=n(e("utf8"));function u(e){return e===undefined?undefined:"string"==typeof e?new o.default(e,16):"bigint"==typeof e?new o.default(e.toString(16),16):"number"==typeof e||o.default.isBN(e)?new o.default(e):c(e)?new o.default(e.toFixed()):"function"==typeof e.reduce?e.reduce(((e,t)=>e.shln(8).addn(t)),new o.default(0)):void 0}function c(e){return"object"==typeof e&&null!==e&&(1===e.s||-1===e.s)&&"number"==typeof e.e&&Array.isArray(e.c)&&!e.isFinite}function l(e,t=0){if("bigint"==typeof e&&(e=e.toString(16)),"string"==typeof e){let r=e;if(r.startsWith("0x")&&(r=r.slice(2)),""===r)return new Uint8Array(0);r.length%2==1&&(r=`0${r}`);let n=new Uint8Array(r.match(/.{2}/g).map((e=>parseInt(e,16))));if(n.length<t){let e=n;n=new Uint8Array(t),n.set(e,t-e.length)}return n}return"number"==typeof e?e=new o.default(e):c(e)&&(e=new o.default(e.toFixed())),e.toTwos(8*t).toArrayLike(Uint8Array,"be",t)}r.toBN=u,r.isBig=c,r.toSignedBN=function(e){return e[0]<128?u(e):u(e.map((e=>255-e))).addn(1).neg()},r.toBigInt=function(e){return e.isNeg()?-BigInt("0x"+e.neg().toString(16)):BigInt("0x"+e.toString(16))},r.toBig=function(e){return new s.default(e.toString())},r.toHexString=function(e,t=0,r=!1){if((o.default.isBN(e)||"bigint"==typeof e||"number"==typeof e||c(e))&&(e=l(e)),e.length<t){let n=e;e=new Uint8Array(t),r?e.set(n):e.set(n,t-n.length)}return i("bytes: %o",e),`0x${e.reduce(((e,t)=>{return`${e}${r=t.toString(16),`${"00".slice(0,2-r.length)}${r}`}`;var r}),"")}`},r.toBytes=l,r.stringToBytes=function(e){e=a.default.encode(e);let t=new Uint8Array(e.length);for(let r=0;r<e.length;r++)t[r]=e.charCodeAt(r);return t},r.shiftBigUp=function(e,t){let r=new s.default(e);return r.e+=t,r},r.shiftBigDown=function(e,t){let r=new s.default(e);return r.e-=t,r},r.countDecimalPlaces=function(e){return Math.max(0,e.c.length-e.e-1)},r.cleanBool=function(e){switch(e.kind){case"value":return e;case"error":return"BoolOutOfRangeError"===e.error.kind?{type:e.type,kind:"value",value:{asBoolean:!0}}:e}}}}},{package:"@truffle/codec",file:"node_modules/@truffle/codec/dist/lib/conversion.js"}],[1532,{"./abi-data":1500,"./abify":1503,"./ast":1508,"./contexts":1528,"./conversion":1531,"./decode":1533,"./errors":1534,"./evm":1536,"./read":1553,"./topic":1568,debug:2075,"web3-utils":3381},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){n===undefined&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){n===undefined&&(n=r),e[n]=t[r]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&n(t,e,r);return i(t,e),t},s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(r,"__esModule",{value:!0}),r.decodeRevert=r.decodeReturndata=r.decodeEvent=r.decodeCalldata=r.decodeVariable=void 0;const a=(0,s(e("debug")).default)("codec:core"),u=o(e("./ast")),c=o(e("./abi-data")),l=o(e("./topic")),d=o(e("./evm")),f=o(e("./contexts")),h=e("./abify"),p=o(e("./conversion")),m=e("./errors"),g=s(e("./read")),y=s(e("./decode")),v=s(e("web3-utils"));r.decodeVariable=function*(e,t,r,n){let i=r.currentContext.compiler,o=u.Import.definitionToType(e,n,i);return yield*(0,y.default)(o,t,r)},r.decodeCalldata=function*(e,t){const r=e.currentContext;if(null===r)return t?{kind:"create",decodingMode:"full",bytecode:p.toHexString(e.state.calldata),interpretations:{}}:{kind:"unknown",decodingMode:"full",data:p.toHexString(e.state.calldata),interpretations:{}};const n=r.context,i=f.Import.contextToType(r);t=r.isConstructor;const o=e.allocations.calldata;let s,u;if(t)s=(o.constructorAllocations[n]||{input:undefined}).input;else{let t=yield*(0,g.default)({location:"calldata",start:0,length:d.Utils.SELECTOR_SIZE},e.state);u=p.toHexString(t),s=((o.functionAllocations[n]||{})[u]||{input:undefined}).input}if(s===undefined){let t=null;return t=0===e.state.calldata.length&&r.fallbackAbi.receive||r.fallbackAbi.fallback,{kind:"message",class:i,abi:t,data:p.toHexString(e.state.calldata),decodingMode:"full",interpretations:{}}}let c=s.allocationMode;a("calldata decoding mode: %s",c);let l=[];for(const t of s.arguments){let r,n="full"===c?t.type:(0,h.abifyType)(t.type,e.userDefinedTypes);try{r=yield*(0,y.default)(n,t.pointer,e,{abiPointerBase:s.offset,allowRetry:"full"===c})}catch(n){if(!(n instanceof m.StopDecodingError&&n.allowRetry&&"full"===c))throw n;a("problem! retrying as ABI"),a("error: %O",n),c="abi",l=l.map((t=>Object.assign(Object.assign({},t),{value:(0,h.abifyResult)(t.value,e.userDefinedTypes)}))),r=yield*(0,y.default)((0,h.abifyType)(t.type,e.userDefinedTypes),t.pointer,e,{abiPointerBase:s.offset})}const i=t.name;l.push(i?{name:i,value:r}:{value:r})}return t?{kind:"constructor",class:i,arguments:l,abi:s.abi,bytecode:p.toHexString(e.state.calldata.slice(0,s.offset)),decodingMode:c,interpretations:{}}:{kind:"function",class:i,abi:s.abi,arguments:l,selector:u,decodingMode:c,interpretations:{}}},r.decodeEvent=function*(e,t,r={}){const n=e.allocations.event,i=r.extras||"off";let o,s,u,v,b,w;const M=e.state.eventtopics.length;if(!n[M])return a("no allocations for that topic count!"),[];let _,O,E,T,j;if(M>0?(o=yield*(0,g.default)({location:"eventtopic",topic:0},e.state),s=p.toHexString(o),n[M].bySelector[s]?({contract:u,library:v}=n[M].bySelector[s]):(a("no allocations for that selector!"),u={},v={})):(u={},v={}),({contract:b,library:w}=n[M].anonymous),null!==t){const r=yield{type:"code",address:t},n=p.toHexString(r);_=f.Utils.findContext(e.contexts,n)}else _=e.currentContext;const k=(_||{context:undefined}).context;if(k){O=u[k]||[],E=b[k]||[],T=[].concat(...Object.entries(u).filter((([e,t])=>e!==k)).map((([e,t])=>t))),j=[].concat(...Object.entries(b).filter((([e,t])=>e!==k)).map((([e,t])=>t)))}else a("couldn't find context"),O=[],E=[],T=[].concat(...Object.values(u)),j=[].concat(...Object.values(b));const x=[].concat(...Object.values(v)),S=[].concat(...Object.values(w)),C=O.concat(x),A=E.concat(S),I=C.concat(A),D=T.concat(j),P=I.concat([null],D);let N=[];e:for(const t of P){if(a("trying allocation: %O",t),null===t)switch(i){case"on":continue e;case"off":break e;case"necessary":if(N.length>0)break e;continue e}if(r.name!==undefined&&t.abi.name!==r.name)continue;let n=t.allocationMode;const o=t.contextHash,u=e.contexts[o],p=f.Import.contextToType(u),g=t.definedIn;let v=[];for(const r of t.arguments){let t,i="full"===n?r.type:(0,h.abifyType)(r.type,e.userDefinedTypes);try{t=yield*(0,y.default)(i,r.pointer,e,{strictAbiMode:!0,allowRetry:"full"===n})}catch(i){if(!(i instanceof m.StopDecodingError&&i.allowRetry&&"full"===n)){a("rejected due to exception on first try: %O",i);continue e}n="abi",v=v.map((t=>Object.assign(Object.assign({},t),{value:(0,h.abifyResult)(t.value,e.userDefinedTypes)})));try{t=yield*(0,y.default)((0,h.abifyType)(r.type,e.userDefinedTypes),r.pointer,e,{strictAbiMode:!0})}catch(e){a("rejected due to exception on retry");continue e}}const o=r.name,s="eventtopic"===r.pointer.location;v.push(o?{name:o,indexed:s,value:t}:{indexed:s,value:t})}if(!r.disableChecks){const t=v.filter((e=>!e.indexed)).map((e=>e.value)),r=c.Encode.encodeTupleAbi(t,e.allocations.abi),n=e.state.eventdata;if(!d.Utils.equalData(r,n)){a("rejected due to [non-indexed] mismatch");continue}}const b=v.filter((e=>e.indexed)).map((e=>e.value)).map(l.Encode.encodeTopic),w=e.state.eventtopics,M=t.anonymous?0:1;for(let e=0;e<b.length;e++)if(!d.Utils.equalData(b[e],w[e+M])){a("rejected due to indexed mismatch");continue e}let _;if(a("allocation accepted!"),_=t.abi.anonymous?{kind:"anonymous",definedIn:g,class:p,abi:t.abi,arguments:v,decodingMode:n,interpretations:{}}:{kind:"event",definedIn:g,class:p,abi:t.abi,arguments:v,selector:s,decodingMode:n,interpretations:{}},N.push(_),r.id&&t.id===r.id)return[_]}return N};const b=p.toBytes(v.default.soliditySha3({type:"string",value:"Error(string)"})).subarray(0,d.Utils.SELECTOR_SIZE),w=p.toBytes(v.default.soliditySha3({type:"string",value:"Panic(uint256)"})).subarray(0,d.Utils.SELECTOR_SIZE),M=[{kind:"revert",allocationMode:"full",selector:b,abi:{name:"Error",type:"error",inputs:[{name:"",type:"string",internalType:"string"}]},definedIn:null,arguments:[{name:"",pointer:{location:"returndata",start:b.length,length:d.Utils.WORD_SIZE},type:{typeClass:"string",typeHint:"string"}}]},{kind:"revert",allocationMode:"full",selector:w,abi:{name:"Panic",type:"error",inputs:[{name:"",type:"uint256",internalType:"uint256"}]},definedIn:null,arguments:[{name:"",pointer:{location:"returndata",start:w.length,length:d.Utils.WORD_SIZE},type:{typeClass:"uint",bits:8*d.Utils.WORD_SIZE,typeHint:"uint256"}}]}],_=[{kind:"failure",allocationMode:"full",selector:new Uint8Array,arguments:[]},{kind:"selfdestruct",allocationMode:"full",selector:new Uint8Array,arguments:[]}];function*O(e,t,r,n){let i;const o=p.toHexString(e.state.returndata.slice(0,4)),s=(e.currentContext||{context:""}).context,u=((e.allocations.returndata||{[s]:{}})[s]||{[o]:[]})[o]||[];if(null===t)i=[...M,...u,..._];else switch(t.kind){case"return":i=[t,...M,...u,..._];break;case"bytecode":i=[...M,...u,..._,t];break;case"returnmessage":i=[...M,...u,t,..._]}let l=[];e:for(const t of i){a("trying allocation: %O",t);let i=e.state.returndata;const o=i.subarray(0,t.selector.length);if(!d.Utils.equalData(o,t.selector))continue;if(i=i.subarray(t.selector.length),r!==undefined){const e=["return","selfdestruct","bytecode","returnmessage"],n=["failure","revert"];if(r){if(!e.includes(t.kind))continue}else if(!n.includes(t.kind))continue}if("bytecode"===t.kind){const t=yield*E(e);t&&l.push(t);continue}if("returnmessage"===t.kind){const r={kind:"returnmessage",status:!0,data:p.toHexString(e.state.returndata),decodingMode:t.allocationMode,interpretations:{}};l.push(r);continue}let s=t.allocationMode,u=[];for(const r of t.arguments){let n,i="full"===s?r.type:(0,h.abifyType)(r.type,e.userDefinedTypes);try{n=yield*(0,y.default)(i,r.pointer,e,{abiPointerBase:t.selector.length,strictAbiMode:!0,allowRetry:"full"===s}),a("value on first try: %O",n)}catch(i){if(!(i instanceof m.StopDecodingError&&i.allowRetry&&"full"===s)){a("rejected due to exception on first try: %O",i);continue e}a("retry!"),s="abi",u=u.map((t=>Object.assign(Object.assign({},t),{value:(0,h.abifyResult)(t.value,e.userDefinedTypes)})));try{n=yield*(0,y.default)((0,h.abifyType)(r.type,e.userDefinedTypes),r.pointer,e,{abiPointerBase:t.selector.length,strictAbiMode:!0}),a("value on retry: %O",n)}catch(e){a("rejected due to exception on retry");continue e}}const o=r.name;u.push(o?{name:o,value:n}:{value:n})}a("decodedArguments: %O",u);const f=u.map((e=>e.value)),g=c.Encode.encodeTupleAbi(f,e.allocations.abi);if(!d.Utils.equalData(g,i)){a("rejected due to mismatch");continue}let v;switch(a("allocation accepted!"),t.kind){case"return":v={kind:"return",status:!0,arguments:u,decodingMode:s,interpretations:{}};break;case"revert":v={kind:"revert",abi:t.abi,definedIn:t.definedIn,status:!1,arguments:u,decodingMode:s,interpretations:{}};break;case"selfdestruct":v={kind:"selfdestruct",status:!0,decodingMode:s,interpretations:{}};break;case"failure":v={kind:"failure",status:!1,decodingMode:s,interpretations:{}}}if(l.push(v),n&&"revert"===t.kind&&t.id===n)return[v]}return l}function*E(e){let t="full";const r=p.toHexString(e.state.returndata),n=f.Utils.findContext(e.contexts,r);if(!n)return{kind:"unknownbytecode",status:!0,decodingMode:"full",bytecode:r,interpretations:{}};const i=f.Import.contextToType(n),o=e.allocations.calldata.constructorAllocations[n.context].output;let s;if(a("bytecode allocation: %O",o),o.immutables){s=[];for(const r of o.immutables){const n=r.type;let i;try{i=yield*(0,y.default)(n,r.pointer,e,{allowRetry:!0,strictAbiMode:!0,paddingMode:"defaultOrZero"})}catch(e){if(e instanceof m.StopDecodingError&&e.allowRetry){t="abi",s=undefined;break}return null}s.push({name:r.name,class:r.definedIn,value:i})}}let u={kind:"bytecode",status:!0,decodingMode:t,bytecode:r,immutables:s,class:i,interpretations:{}};return o.delegatecallGuard&&(u.address=v.default.toChecksumAddress(r.slice(4,4+2*d.Utils.ADDRESS_SIZE))),u}r.decodeReturndata=O,r.decodeRevert=function(e){return O({allocations:{},state:{storage:{},returndata:e}},null,!1).next().value}}}},{package:"@truffle/codec",file:"node_modules/@truffle/codec/dist/lib/core.js"}],[1533,{"./abi-data":1500,"./ast-constant":1505,"./basic":1514,"./compiler":1524,"./format":1541,"./memory":1552,"./special":1555,"./stack":1558,"./storage":1562,"./topic":1568,debug:2075},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){n===undefined&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){n===undefined&&(n=r),e[n]=t[r]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&n(t,e,r);return i(t,e),t},s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(r,"__esModule",{value:!0});const a=(0,s(e("debug")).default)("codec:decode"),u=o(e("./ast-constant")),c=o(e("./abi-data")),l=o(e("./compiler")),d=o(e("./format")),f=o(e("./basic")),h=o(e("./memory")),p=o(e("./special")),m=o(e("./stack")),g=o(e("./storage")),y=o(e("./topic"));r.default=function*(e,t,r,n={}){return d.Utils.Circularity.tie(yield*function*(e,t,r,n={}){switch(a("type %O",e),a("pointer %O",t),t.location){case"storage":return yield*g.Decode.decodeStorage(e,t,r);case"stack":return yield*m.Decode.decodeStack(e,t,r);case"stackliteral":return yield*m.Decode.decodeLiteral(e,t,r);case"definition":return yield*u.Decode.decodeConstant(e,t,r);case"special":return yield*p.Decode.decodeSpecial(e,t,r);case"calldata":case"eventdata":case"returndata":return yield*c.Decode.decodeAbi(e,t,r,n);case"eventtopic":return yield*y.Decode.decodeTopic(e,t,r,n);case"code":case"nowhere":return yield*f.Decode.decodeBasic(e,t,r,Object.assign(Object.assign({},n),{paddingMode:"defaultOrZero"}));case"memory":switch(l.Utils.solidityFamily(r.currentContext.compiler)){case"0.5.x":case"0.8.x":case"0.8.7+":return yield*h.Decode.decodeMemory(e,t,r,Object.assign(Object.assign({},n),{paddingMode:"right"}));default:return yield*h.Decode.decodeMemory(e,t,r,n)}}}(e,t,r,n))}}}},{package:"@truffle/codec",file:"node_modules/@truffle/codec/dist/lib/decode.js"}],[1534,{"./format":1541},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){n===undefined&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){n===undefined&&(n=r),e[n]=t[r]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&n(t,e,r);return i(t,e),t};Object.defineProperty(r,"__esModule",{value:!0}),r.RepeatCompilationIdError=r.NoProjectInfoError=r.handleDecodingError=r.StopDecodingError=r.DecodingError=void 0;const s=o(e("./format"));class a extends Error{constructor(e){super(s.Utils.Exception.message(e)),this.error=e,this.name="DecodingError"}}r.DecodingError=a;class u extends Error{constructor(e,t){super(`Stopping decoding: ${e.kind}`),this.error=e,this.allowRetry=Boolean(t)}}r.StopDecodingError=u,r.handleDecodingError=function(e,t,r=!1){if(t instanceof a){if(r)throw new u(t.error);return{type:e,kind:"error",error:t.error}}throw t};class c extends Error{constructor(){super("No project information specified."),this.name="NoProjectInfoError"}}r.NoProjectInfoError=c;class l extends Error{constructor(e){super(`Compilation id(s) ${e.join(", ")} repeated or already in use.`),this.ids=e,this.name="RepeatCompilationIdError"}}r.RepeatCompilationIdError=l}}},{package:"@truffle/codec",file:"node_modules/@truffle/codec/dist/lib/errors.js"}],[1535,{"../../contexts/import":1527},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.makeInternalFunctionId=r.functionTableEntryToType=void 0;const n=e("../../contexts/import");r.functionTableEntryToType=function(e){return null===e.contractNode?null:{typeClass:"contract",kind:"native",id:(0,n.makeTypeId)(e.contractId,e.compilationId),typeName:e.contractName,contractKind:e.contractKind,payable:e.contractPayable}},r.makeInternalFunctionId=function(e){return`${e.compilationId}:${e.id}`}}}},{package:"@truffle/codec",file:"node_modules/@truffle/codec/dist/lib/evm/import/index.js"}],[1536,{"./import":1535,"./types":1537,"./utils":1538},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){n===undefined&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){n===undefined&&(n=r),e[n]=t[r]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)},s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&n(t,e,r);return i(t,e),t};Object.defineProperty(r,"__esModule",{value:!0}),r.Import=r.Utils=void 0,o(e("./types"),r);const a=s(e("./utils"));r.Utils=a;const u=s(e("./import"));r.Import=u}}},{package:"@truffle/codec",file:"node_modules/@truffle/codec/dist/lib/evm/index.js"}],[1537,{},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0})}}},{package:"@truffle/codec",file:"node_modules/@truffle/codec/dist/lib/evm/types.js"}],[1538,{"../conversion":1531,"@truffle/abi-utils":1488,"bn.js":1586,debug:2075,"web3-utils":3381},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){n===undefined&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){n===undefined&&(n=r),e[n]=t[r]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&n(t,e,r);return i(t,e),t},s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(r,"__esModule",{value:!0}),r.toAddress=r.equalData=r.keccak256=r.ZERO_ADDRESS=r.MAX_WORD=r.PC_SIZE=r.SELECTOR_SIZE=r.ADDRESS_SIZE=r.WORD_SIZE=void 0;const a=(0,s(e("debug")).default)("codec:evm:utils"),u=s(e("bn.js")),c=s(e("web3-utils")),l=o(e("../conversion")),d=e("@truffle/abi-utils");r.WORD_SIZE=32,r.ADDRESS_SIZE=20,r.SELECTOR_SIZE=d.ShortSelectorSize,r.PC_SIZE=4,r.MAX_WORD=new u.default(-1).toTwos(8*r.WORD_SIZE),r.ZERO_ADDRESS="0x"+"00".repeat(r.ADDRESS_SIZE),r.keccak256=function(...e){const t=c.default.soliditySha3(...e);let r;return a("rawSha %o",t),r=null===t?"":t.replace(/0x/,""),l.toBN(r)},r.equalData=function(e,t){if(!e||!t)return!1;if(e.length!==t.length)return!1;for(let r=0;r<e.length;r++)if(e[r]!==t[r])return!1;return!0},r.toAddress=function(e){if("string"==typeof e){let t=e;return t.startsWith("0x")&&(t=t.slice(2)),t.length<2*r.ADDRESS_SIZE&&(t=t.padStart(2*r.ADDRESS_SIZE,"0")),t.length>2*r.ADDRESS_SIZE&&(t="0x"+t.slice(t.length-2*r.ADDRESS_SIZE)),c.default.toChecksumAddress(t)}return e.length>r.ADDRESS_SIZE&&(e=e.slice(e.length-r.ADDRESS_SIZE,e.length)),c.default.toChecksumAddress(l.toHexString(e,r.ADDRESS_SIZE))}}}},{package:"@truffle/codec",file:"node_modules/@truffle/codec/dist/lib/evm/utils.js"}],[1539,{"./conversion":1531,"./format":1541,"./format/utils/inspect":1546,buffer:1943,debug:2075,os:3006,util:1949},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){(function(t){(function(){var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){n===undefined&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){n===undefined&&(n=r),e[n]=t[r]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&n(t,e,r);return i(t,e),t},s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(r,"__esModule",{value:!0}),r.formatFunctionLike=r.ReturndataDecodingInspector=r.LogDecodingInspector=r.containsDeliberateReadError=r.CalldataDecodingInspector=r.nativizeEventArgs=r.nativizeReturn=r.nativize=r.nativizeAccessList=r.unsafeNativizeVariables=r.unsafeNativize=r.ResultInspector=void 0;(0,s(e("debug")).default)("codec:export");const a=s(e("os")),u=s(e("util")),c=o(e("./format")),l=o(e("./conversion")),d=e("./format/utils/inspect");function f(e,r=(e=>e)){switch(e.kind){case"error":switch(e.error.kind){case"IndexedReferenceTypeError":return e.error.raw;case"EnumOutOfRangeError":return r(l.toBigInt(e.error.rawAsBN));default:return undefined}case"value":switch(e.type.typeClass){case"uint":case"int":const n=e.value.asBN;return r(l.toBigInt(n));case"enum":const i=e.value.numericAsBN;return r(l.toBigInt(i));case"bool":return e.value.asBoolean;case"bytes":const o=e.value.asHex;return"0x"!==o?o:null;case"address":return e.value.asAddress;case"contract":return e.value.address;case"string":{const r=e;switch(r.value.kind){case"valid":return r.value.asString;case"malformed":return t.from(r.value.asHex.slice(2),"hex").toString()}}case"userDefinedValueType":return f(e.value,r);case"array":return e.value.map((e=>f(e,r)));case"tuple":case"struct":const s=[],a=e.value;for(const{name:e,value:t}of a){const n=f(t,r);s.push(n),e&&(s[e]=n)}return s;case"function":switch(e.type.visibility){case"external":const t=e;return t.value.contract.address.toLowerCase()+t.value.selector.slice(2);case"internal":return undefined}default:return undefined}}}Object.defineProperty(r,"ResultInspector",{enumerable:!0,get:function(){return d.ResultInspector}}),Object.defineProperty(r,"unsafeNativize",{enumerable:!0,get:function(){return d.unsafeNativize}}),Object.defineProperty(r,"unsafeNativizeVariables",{enumerable:!0,get:function(){return d.unsafeNativizeVariables}}),Object.defineProperty(r,"nativizeAccessList",{enumerable:!0,get:function(){return d.nativizeAccessList}}),r.nativize=function(e,t={}){const r=t.numberFormatter||(e=>e);if("ethers"===(t.format||"ethers"))return f(e,r)},r.nativizeReturn=function(e,t={}){const r=t.numberFormatter||(e=>e);if("ethers"===(t.format||"ethers"))return function(e,t=(e=>e)){if("return"!==e.kind)return undefined;if(1===e.arguments.length)return f(e.arguments[0].value,t);const r={};for(let n=0;n<e.arguments.length;n++){const{name:i,value:o}=e.arguments[n],s=f(o,t);r[n]=s,i&&(r[i]=s)}return r}(e,r)},r.nativizeEventArgs=function(e,t={}){const r=t.numberFormatter||(e=>e);if("ethers"===(t.format||"ethers"))return function(e,t=(e=>e)){const r={};for(let n=0;n<e.arguments.length;n++){const{name:i,value:o}=e.arguments[n],s=f(o,t);r[n]=s,i&&(r[i]=s)}return r.__length__=e.arguments.length,r}(e,r)};class h{constructor(e){this.decoding=e}inspect(e,t){return this[u.default.inspect.custom].bind(this)(e,t)}[u.default.inspect.custom](e,t){switch(this.decoding.kind){case"function":const e=`${this.decoding.class.typeName}.${this.decoding.abi.name}`;if(this.decoding.interpretations.multicall)return b(e,this.decoding.interpretations.multicall,t);if(this.decoding.interpretations.aggregate)return w(e,this.decoding.interpretations.aggregate,t);if(this.decoding.interpretations.tryAggregate){const{requireSuccess:r,calls:n}=this.decoding.interpretations.tryAggregate;return w(e,n,t,"requireSuccess",t.stylize(r.toString(),"number"))}if(this.decoding.interpretations.deadlinedMulticall){const{deadline:r,calls:n}=this.decoding.interpretations.deadlinedMulticall;return b(e,n,t,"deadline",t.stylize(r.toString(),"number"))}if(this.decoding.interpretations.specifiedBlockhashMulticall){const{specifiedBlockhash:r,calls:n}=this.decoding.interpretations.specifiedBlockhashMulticall;return b(e,n,t,"previousBlockhash",t.stylize(r,"number"))}return v(e,this.decoding.arguments,t);case"constructor":return v(`new ${this.decoding.class.typeName}`,this.decoding.arguments,t);case"message":const{data:r,abi:n}=this.decoding,i={kind:"value",type:{typeClass:"bytes",kind:"dynamic"},value:{asHex:r}};return n?v(`${this.decoding.class.typeName}.${n.type}`,[{value:i}],t,!0):`Sent raw data to ${this.decoding.class.typeName}: ${u.default.inspect(new d.ResultInspector(i),t)}`;case"unknown":return"Receiving contract could not be identified.";case"create":return"Created contract could not be identified."}}}r.CalldataDecodingInspector=h,r.containsDeliberateReadError=function e(t){switch(t.kind){case"value":switch(t.type.typeClass){case"struct":case"mapping":return t.value.some((({value:t})=>e(t)));case"array":return t.value.some(e);default:return!1}case"error":switch(t.error.kind){case"StorageNotSuppliedError":case"CodeNotSuppliedError":return!0;default:return!1}}};class p{constructor(e){this.decoding=e}inspect(e,t){return this[u.default.inspect.custom].bind(this)(e,t)}[u.default.inspect.custom](e,t){const r=`${this.decoding.definedIn?this.decoding.definedIn.typeName:this.decoding.class.typeName}.${this.decoding.abi.name}`;switch(this.decoding.kind){case"event":return v(r,this.decoding.arguments,t);case"anonymous":return v(`<anonymous> ${r}`,this.decoding.arguments,t)}}}r.LogDecodingInspector=p;class m{constructor(e){this.decoding=e}inspect(e,t){return this[u.default.inspect.custom].bind(this)(e,t)}[u.default.inspect.custom](e,t){switch(this.decoding.kind){case"return":return v("Returned values: ",this.decoding.arguments,t);case"returnmessage":const{data:e}=this.decoding,r={kind:"value",type:{typeClass:"bytes",kind:"dynamic"},value:{asHex:e}};return`Returned raw data: ${u.default.inspect(new d.ResultInspector(r),t)}`;case"selfdestruct":return"The contract self-destructed.";case"failure":return"The transaction reverted without a message.";case"revert":const n=this.decoding.definedIn?`${this.decoding.definedIn.typeName}.${this.decoding.abi.name}`:this.decoding.abi.name;return v(`Error thrown:${a.default.EOL}${n}`,this.decoding.arguments,t);case"bytecode":const i=this.decoding.class.contractKind||"contract",o=this.decoding.address!==undefined?`Returned bytecode for a ${i} ${this.decoding.class.typeName} at ${this.decoding.address}.`:`Returned bytecode for a ${i} ${this.decoding.class.typeName}.`;if(this.decoding.immutables&&this.decoding.immutables.length>0){const e=this.decoding.immutables.map((({name:e,class:{typeName:t}})=>`${t}.${e}: `)),r=Math.max(...e.map((e=>e.length))),n=e.map((e=>e.padStart(r))),i=this.decoding.immutables.map(((e,i)=>n[i]+function(e,t){const r=e.split(/\r?\n/);return[r[0],...g(r.slice(1),t)].join(a.default.EOL)}(u.default.inspect(new d.ResultInspector(e.value),t),r)));return`Immutable values:${a.default.EOL}${i.join(a.default.EOL)}`}return o;case"unknownbytecode":return"Bytecode was returned, but it could not be identified."}}}function g(e,t){return e.map((e=>" ".repeat(t)+e))}function y(e,t){const r=e.split(/\r?\n/);return r.length<2?e:[r[0],...g(r.slice(1,-1),t),r[r.length-1]].join(a.default.EOL)}function v(e,t,r,n=!1,i=2){if(0===t.length)return`${e}()`;let o=t.map((({name:e,indexed:o,value:s},a)=>y((e?`${e}: `:"")+(o?"<indexed> ":"")+u.default.inspect(new d.ResultInspector(s),r)+(n?"":` (type: ${c.Types.typeStringWithoutLocation(s.type)})`)+(a<t.length-1?",":""),i)));return y(`${e}(${a.default.EOL}${o.join(a.default.EOL)}${a.default.EOL})`,i)}function b(e,t,r,n,i){if(0===t.length)return`${e}()`;let o=t.map(((e,n)=>(null===e?"<decoding error>":u.default.inspect(new h(e),r))+(n<t.length-1?",":"")));return n&&o.unshift(`${n}: ${i},`),y(`${e}(${a.default.EOL}${o.join(a.default.EOL)}${a.default.EOL})`,2)}function w(e,t,r,n,i){if(0===t.length)return`${e}()`;let o=t.map((({address:e,decoding:n},i)=>(null===n?"<decoding error>":u.default.inspect(new h(n),r).replace(".",`(${r.stylize(e,"number")}).`))+(i<t.length-1?",":"")));return n&&o.unshift(`${n}: ${i},`),y(`${e}(${a.default.EOL}${o.join(a.default.EOL)}${a.default.EOL})`,2)}r.ReturndataDecodingInspector=m,r.formatFunctionLike=v}).call(this)}).call(this,e("buffer").Buffer)}}},{package:"@truffle/codec",file:"node_modules/@truffle/codec/dist/lib/export.js"}],[1540,{"./types":1542},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){n===undefined&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){n===undefined&&(n=r),e[n]=t[r]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&n(t,e,r);return i(t,e),t};Object.defineProperty(r,"__esModule",{value:!0}),r.Types=void 0;const s=o(e("./types"));r.Types=s}}},{package:"@truffle/codec",file:"node_modules/@truffle/codec/dist/lib/format/common.js"}],[1541,{"./common":1540,"./utils":1545},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){n===undefined&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){n===undefined&&(n=r),e[n]=t[r]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&n(t,e,r);return i(t,e),t};Object.defineProperty(r,"__esModule",{value:!0}),r.Utils=r.Types=void 0;const s=e("./common");Object.defineProperty(r,"Types",{enumerable:!0,get:function(){return s.Types}});const a=o(e("./utils"));r.Utils=a}}},{package:"@truffle/codec",file:"node_modules/@truffle/codec/dist/lib/format/index.js"}],[1542,{debug:2075},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(r,"__esModule",{value:!0}),r.isContractDefinedType=r.typeStringWithoutLocation=r.typeString=r.specifyLocation=r.fullType=r.isReferenceType=r.forgetCompilations=void 0;(0,n(e("debug")).default)("codec:format:types");function i(e){return!!["array","mapping","struct","string"].includes(e.typeClass)||"bytes"===e.typeClass&&"dynamic"===e.kind}function o(e,t){if(!i(e))return e;switch(e.typeClass){case"string":case"bytes":return Object.assign(Object.assign({},e),{location:t});case"array":return Object.assign(Object.assign({},e),{location:t,baseType:o(e.baseType,t)});case"mapping":let r="storage"===t?"storage":undefined;return Object.assign(Object.assign({},e),{location:r,valueType:o(e.valueType,r)});case"struct":let n=Object.assign(Object.assign({},e),{location:t});return n.memberTypes&&(n.memberTypes=n.memberTypes.map((({name:e,type:r})=>({name:e,type:o(r,t)})))),n}}function s(e){let t=a(e);return i(e)&&e.location?t+" "+e.location:t}function a(e){switch(e.typeClass){case"uint":return e.typeHint||`uint${e.bits}`;case"int":return e.typeHint||`int${e.bits}`;case"bool":return e.typeHint||"bool";case"bytes":if(e.typeHint)return e.typeHint;switch(e.kind){case"dynamic":return"bytes";case"static":return`bytes${e.length}`}case"address":switch(e.kind){case"general":return e.typeHint||"address";case"specific":return e.payable?"address payable":"address"}case"string":return e.typeHint||"string";case"fixed":return e.typeHint||`fixed${e.bits}x${e.places}`;case"ufixed":return e.typeHint||`ufixed${e.bits}x${e.places}`;case"array":if(e.typeHint)return e.typeHint;switch(e.kind){case"dynamic":return`${a(e.baseType)}[]`;case"static":return`${a(e.baseType)}[${e.length}]`}case"mapping":return`mapping(${a(e.keyType)} => ${a(e.valueType)})`;case"struct":case"enum":switch(e.kind){case"local":return`${e.typeClass} ${e.definingContractName}.${e.typeName}`;case"global":return`${e.typeClass} ${e.typeName}`}break;case"userDefinedValueType":switch(e.kind){case"local":return`${e.definingContractName}.${e.typeName}`;case"global":return`${e.typeName}`}break;case"tuple":return e.typeHint||"tuple("+e.memberTypes.map((e=>s(e.type))).join(",")+")";case"contract":return e.contractKind+" "+e.typeName;case"magic":return{message:"msg",transaction:"tx",block:"block"}[e.variable];case"type":return`type(${s(e.type)})`;case"function":let t;switch(e.visibility){case"external":if("general"===e.kind)return e.typeHint?e.typeHint:"function external";t=" external";break;case"internal":t=""}let r="nonpayable"===e.mutability?"":" "+e.mutability,n=e.inputParameterTypes.map(s).join(","),i=e.outputParameterTypes.map(s).join(",");return`function(${n})`+r+t+(""===i?"":` returns (${i})`);case"options":return"options"}}r.forgetCompilations=function(e){return Object.assign({},...Object.values(e).map((({types:e})=>e)))},r.isReferenceType=i,r.fullType=function(e,t){if(!["contract","enum","struct","userDefinedValueType"].includes(e.typeClass))return e;let r=t[e.id];if(!r)return e;let n=Object.assign(Object.assign({},e),r);return i(e)&&e.location!==undefined&&(n=o(n,e.location)),n},r.specifyLocation=o,r.typeString=s,r.typeStringWithoutLocation=a,r.isContractDefinedType=function(e){return["enum","struct","userDefinedValueType"].includes(e.typeClass)&&"local"===e.kind}}}},{package:"@truffle/codec",file:"node_modules/@truffle/codec/dist/lib/format/types.js"}],[1543,{debug:2075},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(r,"__esModule",{value:!0}),r.tie=void 0;(0,n(e("debug")).default)("codec:format:utils:circularity");function i(e){return o(e,[])}function o(e,t){if("error"===e.kind)return e;let r;switch(e.type.typeClass){case"array":const n=e;if(r=n.reference,r===undefined){let e=Object.assign(Object.assign({},n),{value:[...n.value]});for(let r=0;r<e.value.length;r++)e.value[r]=o(e.value[r],[e,...t]);return e}return Object.assign(Object.assign({},t[r-1]),{reference:r});case"struct":const s=e;if(r=s.reference,r===undefined){let e=Object.assign(Object.assign({},s),{value:s.value.map((e=>Object.assign({},e)))});for(let r=0;r<e.value.length;r++)e.value[r]=Object.assign(Object.assign({},e.value[r]),{value:o(e.value[r].value,[e,...t])});return e}return Object.assign(Object.assign({},t[r-1]),{reference:r});case"tuple":const a=e;let u=Object.assign({},a);return u.value=u.value.map((e=>Object.assign(Object.assign({},e),{value:i(e.value)}))),u;default:return e}}r.tie=i}}},{package:"@truffle/codec",file:"node_modules/@truffle/codec/dist/lib/format/utils/circularity.js"}],[1544,{"../../ast/utils":1510,"../common":1540,debug:2075},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){n===undefined&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){n===undefined&&(n=r),e[n]=t[r]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&n(t,e,r);return i(t,e),t},s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(r,"__esModule",{value:!0}),r.message=void 0;(0,s(e("debug")).default)("codec:format:utils:exception");const a=o(e("../common")),u=o(e("../../ast/utils"));function c(e){if(e.key!==undefined&&e.path!==undefined){let{type:t,value:r}=function(e){switch(e.type.typeClass){case"uint":return{type:"uint",value:e.value.asBN.toString()};case"int":return{type:"int",value:e.value.asBN.toString()};case"fixed":return{type:`fixed256x${e.type.places}`,value:e.value.asBig.toString()};case"ufixed":return{type:`ufixed256x${e.type.places}`,value:e.value.asBig.toString()};case"bool":return{type:"uint",value:e.value.asBoolean.toString()};case"bytes":switch(e.type.kind){case"static":return{type:"bytes32",value:e.value.asHex};case"dynamic":return{type:"bytes",value:e.value.asHex}}case"address":return{type:"address",value:e.value.asAddress};case"string":let t=e;switch(t.value.kind){case"valid":return{type:"string",value:t.value.asString};case"malformed":return{type:"bytes",value:t.value.asHex}}}}(e.key);return"keccak("+r+" as "+t+", "+c(e.path)+") + "+e.offset.toString()}if(e.path!==undefined){const t=c(e.path);return e.hashPath?"keccak("+t+")"+e.offset.toString():t+e.offset.toString()}return e.offset.toString()}r.message=function(e){switch(e.kind){case"UserDefinedTypeNotFoundError":let t=a.Types.isContractDefinedType(e.type)?e.type.definingContractName+"."+e.type.typeName:e.type.typeName;return`Unknown ${e.type.typeClass} type ${t} of id ${e.type.id}`;case"UnsupportedConstantError":return`Unsupported constant type ${u.typeClass(e.definition)}`;case"UnusedImmutableError":return"Cannot read unused immutable";case"ReadErrorStack":return`Can't read stack from position ${e.from} to ${e.to}`;case"ReadErrorBytes":return`Can't read ${e.length} bytes from ${e.location} starting at ${e.start}`;case"ReadErrorStorage":return e.range.length?`Can't read ${e.range.length} bytes from storage starting at index ${e.range.from.index} in ${c(e.range.from.slot)}`:`Can't read storage from index ${e.range.from.index} in ${c(e.range.from.slot)} to index ${e.range.to.index} in ${c(e.range.to.slot)}`;case"StorageNotSuppliedError":return`Unknown storage at slot ${e.slot.toString()}`;case"CodeNotSuppliedError":return`Unknown code for address ${e.address}`}}}}},{package:"@truffle/codec",file:"node_modules/@truffle/codec/dist/lib/format/utils/exception.js"}],[1545,{"./circularity":1543,"./exception":1544,"./inspect":1546},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){n===undefined&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){n===undefined&&(n=r),e[n]=t[r]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&n(t,e,r);return i(t,e),t};Object.defineProperty(r,"__esModule",{value:!0}),r.Circularity=r.Inspect=r.Exception=void 0;const s=o(e("./exception"));r.Exception=s;const a=o(e("./inspect"));r.Inspect=a;const u=o(e("./circularity"));r.Circularity=u}}},{package:"@truffle/codec",file:"node_modules/@truffle/codec/dist/lib/format/utils/index.js"}],[1546,{"../../conversion":1531,"../../evm/utils":1538,"../common":1540,"./exception":1544,buffer:1943,debug:2075,util:1949},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){(function(t){(function(){var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){n===undefined&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){n===undefined&&(n=r),e[n]=t[r]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&n(t,e,r);return i(t,e),t},s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(r,"__esModule",{value:!0}),r.nativizeAccessList=r.unsafeNativize=r.unsafeNativizeVariables=r.ResultInspector=void 0;const a=(0,s(e("debug")).default)("codec:format:utils:inspect"),u=s(e("util")),c=o(e("../common")),l=o(e("../../conversion")),d=o(e("../../evm/utils")),f=o(e("./exception"));class h{constructor(e){this.result=e}inspect(e,t){return this[u.default.inspect.custom].bind(this)(e,t)}[u.default.inspect.custom](e,r){switch(this.result.kind){case"value":switch(this.result.type.typeClass){case"uint":case"int":return r.stylize(this.result.value.asBN.toString(),"number");case"fixed":case"ufixed":return r.stylize(this.result.value.asBig.toString(),"number");case"bool":return u.default.inspect(this.result.value.asBoolean,r);case"bytes":let e=this.result.value.asHex;switch(this.result.type.kind){case"static":return r.stylize(e,"number");case"dynamic":return r.stylize(`hex'${e.slice(2)}'`,"string")}case"address":return r.stylize(this.result.value.asAddress,"number");case"string":{let e=this.result;switch(e.value.kind){case"valid":return u.default.inspect(e.value.asString,r);case"malformed":return u.default.inspect(t.from(e.value.asHex.slice(2),"hex").toString())}}case"array":{let e=this.result;return e.reference!==undefined?g(e.reference,r):u.default.inspect(e.value.map((e=>new h(e))),r)}case"mapping":return u.default.inspect(new Map(this.result.value.map((({key:e,value:t})=>[new h(e),new h(t)]))),r);case"struct":{let e=this.result;return e.reference!==undefined?g(e.reference,r):u.default.inspect(Object.assign({},...e.value.map((({name:e,value:t})=>({[e]:new h(t)})))),r)}case"userDefinedValueType":{const e=c.Types.typeStringWithoutLocation(this.result.type),t=this.result;return`${e}.wrap(${u.default.inspect(new h(t.value),r)})`}case"tuple":{let e=this.result;return e.value.every((({name:e})=>e))?u.default.inspect(Object.assign({},...e.value.map((({name:e,value:t})=>({[e]:new h(t)})))),r):u.default.inspect(e.value.map((({value:e})=>new h(e))),r)}case"type":switch(this.result.type.type.typeClass){case"contract":return u.default.inspect(Object.assign({},...this.result.value.map((({name:e,value:t})=>({[e]:new h(t)})))),r);case"enum":return m(this.result.type.type)}case"magic":return u.default.inspect(Object.assign({},...Object.entries(this.result.value).map((([e,t])=>({[e]:new h(t)})))),r);case"enum":return y(this.result);case"contract":return u.default.inspect(new p(this.result.value),r);case"function":switch(this.result.type.visibility){case"external":{let e,t=this.result,n=u.default.inspect(new p(t.value.contract),Object.assign(Object.assign({},function(e){const t=Object.assign({},e);return delete t.stylize,t}(r)),{colors:!1}));switch(t.value.kind){case"known":e=`[Function: ${t.value.abi.name} of`;break;case"invalid":case"unknown":e=`[Function: Unknown selector ${t.value.selector} of`}let i=`${n}]`,o=e.length+i.length+1>r.breakLength?"\n":" ";return r.stylize(e+o+i,"special")}case"internal":{let e=this.result;switch(e.value.kind){case"function":return e.value.definedIn?r.stylize(`[Function: ${e.value.definedIn.typeName}.${e.value.name}]`,"special"):r.stylize(`[Function: ${e.value.name}]`,"special");case"exception":return 0===e.value.deployedProgramCounter?r.stylize("[Function: <zero>]","special"):r.stylize("[Function: <uninitialized>]","special");case"unknown":let t="[Function: decoding not supported (raw info:",n=`deployed PC=${e.value.deployedProgramCounter}, constructor PC=${e.value.constructorProgramCounter})]`,i=t.length+n.length+1>r.breakLength?"\n":" ";return r.stylize(t+i+n,"special")}}}}case"error":{a("this.result: %O",this.result);let e=this.result;switch(e.error.kind){case"WrappedError":return u.default.inspect(new h(e.error.error),r);case"UintPaddingError":return`Uint has incorrect padding (expected padding: ${e.error.paddingType}) (raw value ${e.error.raw})`;case"IntPaddingError":return`Int has incorrect padding (expected padding: ${e.error.paddingType}) (raw value ${e.error.raw})`;case"UintPaddingError":return`Ufixed has (expected padding: ${e.error.paddingType}) (raw value ${e.error.raw})`;case"FixedPaddingError":return`Fixed has incorrect padding (expected padding: ${e.error.paddingType}) (raw value ${e.error.raw})`;case"BoolOutOfRangeError":return`Invalid boolean (numeric value ${e.error.rawAsBN.toString()})`;case"BoolPaddingError":return`Boolean has incorrect padding (expected padding: ${e.error.paddingType}) (raw value ${e.error.raw})`;case"BytesPaddingError":return`Bytestring has extra trailing bytes (padding error) (raw value ${e.error.raw})`;case"AddressPaddingError":return`Address has incorrect padding (expected padding: ${e.error.paddingType}) (raw value ${e.error.raw})`;case"EnumOutOfRangeError":return`Invalid ${m(e.error.type)} (numeric value ${e.error.rawAsBN.toString()})`;case"EnumPaddingError":return`Enum ${m(e.error.type)} has incorrect padding (expected padding: ${e.error.paddingType}) (raw value ${e.error.raw})`;case"EnumNotFoundDecodingError":return`Unknown enum type ${m(e.error.type)} of id ${e.error.type.id} (numeric value ${e.error.rawAsBN.toString()})`;case"ContractPaddingError":return`Contract address has incorrect padding (expected padding: ${e.error.paddingType}) (raw value ${e.error.raw})`;case"FunctionExternalNonStackPaddingError":return`External function has incorrect padding (expected padding: ${e.error.paddingType}) (raw value ${e.error.raw})`;case"FunctionExternalStackPaddingError":return`External function address or selector has extra leading bytes (padding error) (raw address ${e.error.rawAddress}, raw selector ${e.error.rawSelector})`;case"FunctionInternalPaddingError":return`Internal function has incorrect padding (expected padding: ${e.error.paddingType}) (raw value ${e.error.raw})`;case"NoSuchInternalFunctionError":return`Invalid function (Deployed PC=${e.error.deployedProgramCounter}, constructor PC=${e.error.constructorProgramCounter}) of contract ${e.error.context.typeName}`;case"DeployedFunctionInConstructorError":return`Deployed-style function (PC=${e.error.deployedProgramCounter}) in constructor`;case"MalformedInternalFunctionError":return`Malformed internal function w/constructor PC only (value: ${e.error.constructorProgramCounter})`;case"IndexedReferenceTypeError":let t=`Cannot decode indexed parameter of reference type ${e.error.type.typeClass}`,n=`(raw value ${e.error.raw})`;return t+(t.length+n.length+1>r.breakLength?"\n":" ")+n;case"OverlongArraysAndStringsNotImplementedError":return`Array or string is too long (length ${e.error.lengthAsBN.toString()}); decoding is not supported`;case"OverlargePointersNotImplementedError":return`Pointer is too large (value ${e.error.pointerAsBN.toString()}); decoding is not supported`;case"UserDefinedTypeNotFoundError":case"UnsupportedConstantError":case"UnusedImmutableError":case"ReadErrorStack":case"ReadErrorStorage":case"ReadErrorBytes":return f.message(e.error);case"StorageNotSuppliedError":case"CodeNotSuppliedError":return r.stylize("?","undefined")}}}}}r.ResultInspector=h;class p{constructor(e){this.value=e}inspect(e,t){return this[u.default.inspect.custom].bind(this)(e,t)}[u.default.inspect.custom](e,t){switch(this.value.kind){case"known":return t.stylize(this.value.address,"number")+` (${this.value.class.typeName})`;case"unknown":return t.stylize(this.value.address,"number")+" of unknown class"}}}function m(e){return("local"===e.kind?e.definingContractName+".":"")+e.typeName}function g(e,t){return t.stylize(`[Circular (=up ${e})]`,"special")}function y(e){switch(e.type.kind){case"local":return`${e.type.definingContractName}.${e.type.typeName}.${e.value.name}`;case"global":return`${e.type.typeName}.${e.value.name}`}}function v(e){return b(e,[])}function b(e,r){if("error"===e.kind)return a("ErrorResult: %O",e),"BoolOutOfRangeError"===e.error.kind||undefined;switch(e.type.typeClass){case"uint":case"int":return e.value.asBN.toNumber();case"bool":return e.value.asBoolean;case"bytes":return e.value.asHex;case"address":return e.value.asAddress;case"string":{let r=e;switch(r.value.kind){case"valid":return r.value.asString;case"malformed":return t.from(r.value.asHex.slice(2),"hex").toString()}}case"fixed":case"ufixed":return Number(e.value.asBig.toString());case"array":{let t=e;if(t.reference===undefined){let e=[...t.value];for(let t=0;t<e.length;t++)e[t]=b(e[t],[e,...r]);return e}return r[t.reference-1]}case"userDefinedValueType":return v(e.value);case"mapping":return Object.assign({},...e.value.map((({key:e,value:t})=>({[v(e).toString()]:v(t)}))));case"struct":{let t=e;if(t.reference===undefined){let t=Object.assign({},...e.value.map((({name:e,value:t})=>({[e]:t}))));for(let e in t)t[e]=b(t[e],[t,...r]);return t}return r[t.reference-1]}case"type":switch(e.type.type.typeClass){case"contract":return Object.assign({},...e.value.map((({name:e,value:t})=>({[e]:v(t)}))));case"enum":return Object.assign({},...e.value.map((e=>({[e.value.name]:v(e)}))))}case"tuple":return e.value.map((({value:e})=>v(e)));case"magic":return Object.assign({},...Object.entries(e.value).map((([e,t])=>({[e]:v(t)}))));case"enum":return y(e);case"contract":return e.value.address;case"function":switch(e.type.visibility){case"external":{let t=e;switch(t.value.kind){case"known":return`${t.value.contract.class.typeName}(${t.value.contract.address}).${t.value.abi.name}`;case"invalid":return`${t.value.contract.class.typeName}(${t.value.contract.address}).call(${t.value.selector}...)`;case"unknown":return`${t.value.contract.address}.call(${t.value.selector}...)`}}case"internal":{let t=e;switch(t.value.kind){case"function":return t.value.definedIn?`${t.value.definedIn.typeName}.${t.value.name}`:t.value.name;case"exception":return 0===t.value.deployedProgramCounter?"<zero>":"<uninitialized>";case"unknown":return"<decoding not supported>"}}}}}r.unsafeNativizeVariables=function(e){return Object.assign({},...Object.entries(e).map((([e,t])=>{try{return{[e]:v(t)}}catch(e){return undefined}})))},r.unsafeNativize=v,r.nativizeAccessList=function(e){return e.value.map((e=>{const t=e.value,r=t[0].value,n=t[1].value.value;return{address:r.value.asAddress,storageKeys:n.map((e=>l.toHexString(e.value.asBN,d.WORD_SIZE)))}}))}}).call(this)}).call(this,e("buffer").Buffer)}}},{package:"@truffle/codec",file:"node_modules/@truffle/codec/dist/lib/format/utils/inspect.js"}],[1547,{"./abi-data":1500,"./abify":1503,"./ast":1508,"./ast-constant":1505,"./basic":1514,"./bytes":1517,"./common":1519,"./compilations":1521,"./compiler":1524,"./contexts":1528,"./conversion":1531,"./core":1532,"./errors":1534,"./evm":1536,"./export":1539,"./format":1541,"./mapping-key":1549,"./memory":1552,"./special":1555,"./stack":1558,"./storage":1562,"./topic":1568,"./wrap":1577},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){n===undefined&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){n===undefined&&(n=r),e[n]=t[r]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&n(t,e,r);return i(t,e),t},s=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(r,"__esModule",{value:!0}),r.Wrap=r.Export=r.Evm=r.Conversion=r.Contexts=r.Compilations=r.Compiler=r.Ast=r.AstConstant=r.Storage=r.Stack=r.Special=r.Memory=r.MappingKey=r.Topic=r.AbiData=r.Bytes=r.Basic=r.abifyReturndataDecoding=r.abifyLogDecoding=r.abifyCalldataDecoding=r.RepeatCompilationIdError=r.NoProjectInfoError=r.StopDecodingError=r.DecodingError=r.decodeRevert=r.decodeReturndata=r.decodeCalldata=r.decodeEvent=r.decodeVariable=r.Format=void 0;const a=o(e("./format"));r.Format=a;var u=e("./core");Object.defineProperty(r,"decodeVariable",{enumerable:!0,get:function(){return u.decodeVariable}}),Object.defineProperty(r,"decodeEvent",{enumerable:!0,get:function(){return u.decodeEvent}}),Object.defineProperty(r,"decodeCalldata",{enumerable:!0,get:function(){return u.decodeCalldata}}),Object.defineProperty(r,"decodeReturndata",{enumerable:!0,get:function(){return u.decodeReturndata}}),Object.defineProperty(r,"decodeRevert",{enumerable:!0,get:function(){return u.decodeRevert}});var c=e("./errors");Object.defineProperty(r,"DecodingError",{enumerable:!0,get:function(){return c.DecodingError}}),Object.defineProperty(r,"StopDecodingError",{enumerable:!0,get:function(){return c.StopDecodingError}}),Object.defineProperty(r,"NoProjectInfoError",{enumerable:!0,get:function(){return c.NoProjectInfoError}}),Object.defineProperty(r,"RepeatCompilationIdError",{enumerable:!0,get:function(){return c.RepeatCompilationIdError}}),s(e("./common"),r);var l=e("./abify");Object.defineProperty(r,"abifyCalldataDecoding",{enumerable:!0,get:function(){return l.abifyCalldataDecoding}}),Object.defineProperty(r,"abifyLogDecoding",{enumerable:!0,get:function(){return l.abifyLogDecoding}}),Object.defineProperty(r,"abifyReturndataDecoding",{enumerable:!0,get:function(){return l.abifyReturndataDecoding}});const d=o(e("./basic"));r.Basic=d;const f=o(e("./bytes"));r.Bytes=f;const h=o(e("./abi-data"));r.AbiData=h;const p=o(e("./topic"));r.Topic=p;const m=o(e("./mapping-key"));r.MappingKey=m;const g=o(e("./memory"));r.Memory=g;const y=o(e("./special"));r.Special=y;const v=o(e("./stack"));r.Stack=v;const b=o(e("./storage"));r.Storage=b;const w=o(e("./ast-constant"));r.AstConstant=w;const M=o(e("./ast"));r.Ast=M;const _=o(e("./compiler"));r.Compiler=_;const O=o(e("./compilations"));r.Compilations=O;const E=o(e("./contexts"));r.Contexts=E;const T=o(e("./conversion"));r.Conversion=T;const j=o(e("./evm"));r.Evm=j;const k=o(e("./export"));r.Export=k;const x=o(e("./wrap"));r.Wrap=x}}},{package:"@truffle/codec",file:"node_modules/@truffle/codec/dist/lib/index.js"}],[1548,{"../../basic/encode":1513,"../../bytes/encode":1516,"../../conversion":1531,debug:2075},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){n===undefined&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){n===undefined&&(n=r),e[n]=t[r]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&n(t,e,r);return i(t,e),t},s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(r,"__esModule",{value:!0}),r.mappingKeyAsHex=r.encodeMappingKey=void 0;(0,s(e("debug")).default)("codec:mapping-key:encode");const a=o(e("../../conversion")),u=o(e("../../basic/encode")),c=o(e("../../bytes/encode"));function l(e){return"string"===e.type.typeClass||"bytes"===e.type.typeClass&&"dynamic"===e.type.kind?c.encodeBytes(e):u.encodeBasic(e)}r.encodeMappingKey=l,r.mappingKeyAsHex=function(e){return a.toHexString(l(e))}}}},{package:"@truffle/codec",file:"node_modules/@truffle/codec/dist/lib/mapping-key/encode/index.js"}],[1549,{"./encode":1548},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){n===undefined&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){n===undefined&&(n=r),e[n]=t[r]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&n(t,e,r);return i(t,e),t};Object.defineProperty(r,"__esModule",{value:!0}),r.Encode=void 0;const s=o(e("./encode"));r.Encode=s}}},{package:"@truffle/codec",file:"node_modules/@truffle/codec/dist/lib/mapping-key/index.js"}],[1550,{"../../evm":1536,debug:2075},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){n===undefined&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){n===undefined&&(n=r),e[n]=t[r]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&n(t,e,r);return i(t,e),t},s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(r,"__esModule",{value:!0}),r.isSkippedInMemoryStructs=r.getMemoryAllocations=void 0;(0,s(e("debug")).default)("codec:memory:allocate");const a=o(e("../../evm"));function u(e){return"mapping"===e.typeClass||"array"===e.typeClass&&u(e.baseType)}function c(e){let t=[],r=0;for(const{name:n,type:i}of e.memberTypes){const e=u(i)?0:a.Utils.WORD_SIZE;t.push({name:n,type:i,pointer:{location:"memory",start:r,length:e}}),r+=e}return{members:t}}r.getMemoryAllocations=function(e){let t={};for(const r of Object.values(e))"struct"===r.typeClass&&(t[r.id]=c(r));return t},r.isSkippedInMemoryStructs=u}}},{package:"@truffle/codec",file:"node_modules/@truffle/codec/dist/lib/memory/allocate/index.js"}],[1551,{"../../basic":1514,"../../bytes":1517,"../../conversion":1531,"../../errors":1534,"../../evm":1536,"../../format":1541,"../../read":1553,"../allocate":1550,debug:2075},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){n===undefined&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){n===undefined&&(n=r),e[n]=t[r]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&n(t,e,r);return i(t,e),t},s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(r,"__esModule",{value:!0}),r.decodeMemoryReferenceByAddress=r.decodeMemory=void 0;const a=(0,s(e("debug")).default)("codec:memory:decode"),u=s(e("../../read")),c=o(e("../../conversion")),l=o(e("../../format")),d=o(e("../../basic")),f=o(e("../../bytes")),h=o(e("../../evm")),p=e("../allocate"),m=e("../../errors");function*g(e,t,r,n={}){return l.Types.isReferenceType(e)?(0,p.isSkippedInMemoryStructs)(e)?function(e){switch(e.typeClass){case"mapping":case"array":return{type:e,kind:"value",value:[]}}}(e):yield*y(e,t,r,n):yield*d.Decode.decodeBasic(e,t,r,n)}function*y(e,t,r,n={}){const{state:i}=r,o=n.memoryVisited||[];let s;a("pointer %o",t);try{s=yield*(0,u.default)(t,i)}catch(t){return(0,m.handleDecodingError)(e,t)}let d,p=c.toBN(s);try{d=p.toNumber()}catch(t){return{type:e,kind:"error",error:{kind:"OverlargePointersNotImplementedError",pointerAsBN:p}}}const y=d;let v,b,w,M;switch(e.typeClass){case"bytes":case"string":try{v=yield*(0,u.default)({location:"memory",start:d,length:h.Utils.WORD_SIZE},i)}catch(t){return(0,m.handleDecodingError)(e,t)}b=c.toBN(v);try{w=b.toNumber()}catch(t){return{type:e,kind:"error",error:{kind:"OverlongArraysAndStringsNotImplementedError",lengthAsBN:b}}}let t={location:"memory",start:d+h.Utils.WORD_SIZE,length:w};return yield*f.Decode.decodeBytes(e,t,r);case"array":{if(M=o.indexOf(y),-1!==M)return{type:e,kind:"value",reference:M+1,value:[]};if("dynamic"===e.kind){try{v=yield*(0,u.default)({location:"memory",start:d,length:h.Utils.WORD_SIZE},i)}catch(t){return(0,m.handleDecodingError)(e,t)}b=c.toBN(v),d+=h.Utils.WORD_SIZE}else b=e.length;try{w=b.toNumber()}catch(t){return{type:e,kind:"error",error:{kind:"OverlongArraysAndStringsNotImplementedError",lengthAsBN:b}}}let t=[y,...o],n=e.baseType,s=[];for(let e=0;e<w;e++)s.push(yield*g(n,{location:"memory",start:d+e*h.Utils.WORD_SIZE,length:h.Utils.WORD_SIZE},r,{memoryVisited:t}));return{type:e,kind:"value",value:s}}case"struct":{if(M=o.indexOf(y),-1!==M)return{type:e,kind:"value",reference:M+1,value:[]};const{allocations:{memory:t}}=r,n=t[e.id];if(!n)return{type:e,kind:"error",error:{kind:"UserDefinedTypeNotFoundError",type:e}};a("structAllocation %O",n);let i=[y,...o],s=[];for(let e=0;e<n.members.length;e++){const t=n.members[e],o=t.pointer,a={location:"memory",start:d+o.start,length:o.length};let u=t.name,c=l.Types.specifyLocation(t.type,"memory");s.push({name:u,value:yield*g(c,a,r,{memoryVisited:i})})}return{type:e,kind:"value",value:s}}}}r.decodeMemory=g,r.decodeMemoryReferenceByAddress=y}}},{package:"@truffle/codec",file:"node_modules/@truffle/codec/dist/lib/memory/decode/index.js"}],[1552,{"./allocate":1550,"./decode":1551},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){n===undefined&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){n===undefined&&(n=r),e[n]=t[r]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&n(t,e,r);return i(t,e),t};Object.defineProperty(r,"__esModule",{value:!0}),r.Decode=r.Allocate=void 0;const s=o(e("./allocate"));r.Allocate=s;const a=o(e("./decode"));r.Decode=a}}},{package:"@truffle/codec",file:"node_modules/@truffle/codec/dist/lib/memory/index.js"}],[1553,{"./ast-constant/read":1506,"./bytes/read":1518,"./errors":1534,"./special/read":1556,"./stack/read":1559,"./storage/read":1563,"./topic/read":1569},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){n===undefined&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){n===undefined&&(n=r),e[n]=t[r]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&n(t,e,r);return i(t,e),t};Object.defineProperty(r,"__esModule",{value:!0});const s=o(e("./storage/read")),a=o(e("./stack/read")),u=o(e("./bytes/read")),c=o(e("./ast-constant/read")),l=o(e("./topic/read")),d=o(e("./special/read")),f=e("./errors");r.default=function*(e,t){switch(e.location){case"stack":return a.readStack(e,t);case"storage":return yield*s.readStorage(e,t);case"memory":case"calldata":case"eventdata":case"returndata":return u.readBytes(e,t);case"code":return yield*u.readCode(e,t);case"stackliteral":return a.readStackLiteral(e);case"definition":return c.readDefinition(e);case"special":return d.readSpecial(e,t);case"eventtopic":return l.readTopic(e,t);case"nowhere":throw new f.DecodingError({kind:"UnusedImmutableError"})}}}}},{package:"@truffle/codec",file:"node_modules/@truffle/codec/dist/lib/read.js"}],[1554,{"../../basic":1514,"../../bytes":1517,"../../compiler":1524,"../../evm":1536,debug:2075},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){n===undefined&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){n===undefined&&(n=r),e[n]=t[r]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&n(t,e,r);return i(t,e),t},s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(r,"__esModule",{value:!0}),r.decodeMagic=r.decodeSpecial=void 0;(0,s(e("debug")).default)("codec:special:decode");const a=o(e("../../basic")),u=o(e("../../bytes")),c=o(e("../../compiler")),l=o(e("../../evm"));function*d(e,t,r){let{state:n}=r;switch(t.special){case"msg":return{type:e,kind:"value",value:{data:yield*u.Decode.decodeBytes({typeClass:"bytes",kind:"dynamic",location:"calldata"},{location:"calldata",start:0,length:n.calldata.length},r),sig:yield*a.Decode.decodeBasic({typeClass:"bytes",kind:"static",length:l.Utils.SELECTOR_SIZE},{location:"calldata",start:0,length:l.Utils.SELECTOR_SIZE},r),sender:yield*a.Decode.decodeBasic(f(r.currentContext.compiler),{location:"special",special:"sender"},r),value:yield*a.Decode.decodeBasic({typeClass:"uint",bits:256},{location:"special",special:"value"},r)}};case"tx":return{type:e,kind:"value",value:{origin:yield*a.Decode.decodeBasic(f(r.currentContext.compiler),{location:"special",special:"origin"},r),gasprice:yield*a.Decode.decodeBasic({typeClass:"uint",bits:256},{location:"special",special:"gasprice"},r)}};case"block":let t={coinbase:yield*a.Decode.decodeBasic(h(r.currentContext.compiler),{location:"special",special:"coinbase"},r)};const i=["difficulty","gaslimit","number","timestamp"];(function(e){switch(c.Utils.solidityFamily(e)){case"unknown":case"pre-0.5.0":case"0.5.x":return!1;default:return!0}})(r.currentContext.compiler)&&i.push("chainid"),function(e){switch(c.Utils.solidityFamily(e)){case"unknown":case"pre-0.5.0":case"0.5.x":case"0.8.x":return!1;default:return!0}}(r.currentContext.compiler)&&i.push("basefee");for(let e of i)t[e]=yield*a.Decode.decodeBasic({typeClass:"uint",bits:256},{location:"special",special:e},r);return{type:e,kind:"value",value:t}}}function f(e){switch(c.Utils.solidityFamily(e)){case"unknown":case"pre-0.5.0":return{typeClass:"address",kind:"general"};case"0.5.x":return{typeClass:"address",kind:"specific",payable:!0};default:return{typeClass:"address",kind:"specific",payable:!1}}}function h(e){switch(c.Utils.solidityFamily(e)){case"unknown":case"pre-0.5.0":return{typeClass:"address",kind:"general"};case"0.5.x":case"0.8.x":case"0.8.7+":case"0.8.9+":return{typeClass:"address",kind:"specific",payable:!0}}}r.decodeSpecial=function*(e,t,r){return"magic"===e.typeClass?yield*d(e,t,r):yield*a.Decode.decodeBasic(e,t,r)},r.decodeMagic=d}}},{package:"@truffle/codec",file:"node_modules/@truffle/codec/dist/lib/special/decode/index.js"}],[1555,{"./decode":1554,"./read":1556},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){n===undefined&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){n===undefined&&(n=r),e[n]=t[r]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&n(t,e,r);return i(t,e),t};Object.defineProperty(r,"__esModule",{value:!0}),r.Read=r.Decode=void 0;const s=o(e("./decode"));r.Decode=s;const a=o(e("./read"));r.Read=a}}},{package:"@truffle/codec",file:"node_modules/@truffle/codec/dist/lib/special/index.js"}],[1556,{},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.readSpecial=void 0,r.readSpecial=function(e,t){return t.specials[e.special]}}}},{package:"@truffle/codec",file:"node_modules/@truffle/codec/dist/lib/special/read/index.js"}],[1557,{"../../abi-data":1500,"../../basic":1514,"../../conversion":1531,"../../errors":1534,"../../evm":1536,"../../format":1541,"../../memory":1552,"../../read":1553,"../../storage":1562,debug:2075},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){n===undefined&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){n===undefined&&(n=r),e[n]=t[r]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&n(t,e,r);return i(t,e),t},s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(r,"__esModule",{value:!0}),r.decodeLiteral=r.decodeStack=void 0;const a=(0,s(e("debug")).default)("codec:stack:decode"),u=o(e("../../abi-data")),c=o(e("../../conversion")),l=o(e("../../format")),d=s(e("../../read")),f=o(e("../../basic")),h=o(e("../../memory")),p=o(e("../../storage")),m=o(e("../../evm")),g=e("../../errors");function*y(e,t,r){if(a("type %O",e),a("pointer %o",t),l.Types.isReferenceType(e))switch(e.location){case"memory":return yield*h.Decode.decodeMemoryReferenceByAddress(e,t,r);case"storage":return yield*p.Decode.decodeStorageReferenceByAddress(e,t,r);case"calldata":if("bytes"===e.typeClass||"string"===e.typeClass||"array"===e.typeClass&&"dynamic"===e.kind){const n=c.toBN(t.literal.slice(m.Utils.WORD_SIZE)),i=t.literal.slice(0,m.Utils.WORD_SIZE);return yield*u.Decode.decodeAbiReferenceByAddress(e,{location:"stackliteral",literal:i},r,{abiPointerBase:0,lengthOverride:n})}return yield*u.Decode.decodeAbiReferenceByAddress(e,t,r,{abiPointerBase:0})}if("function"===e.typeClass&&"external"===e.visibility){let n=t.literal.slice(0,m.Utils.WORD_SIZE),i=t.literal.slice(-m.Utils.WORD_SIZE);if(!f.Decode.checkPaddingLeft(n,m.Utils.ADDRESS_SIZE)||!f.Decode.checkPaddingLeft(i,m.Utils.SELECTOR_SIZE))return{type:e,kind:"error",error:{kind:"FunctionExternalStackPaddingError",rawAddress:c.toHexString(n),rawSelector:c.toHexString(i)}};let o=i.slice(-m.Utils.SELECTOR_SIZE);return{type:e,kind:"value",value:yield*f.Decode.decodeExternalFunction(n,o,r)}}return yield*f.Decode.decodeBasic(e,t,r,{paddingMode:"permissive"})}r.decodeStack=function*(e,t,r){let n;try{n=yield*(0,d.default)(t,r.state)}catch(t){return(0,g.handleDecodingError)(e,t)}const i={location:"stackliteral",literal:n};return yield*y(e,i,r)},r.decodeLiteral=y}}},{package:"@truffle/codec",file:"node_modules/@truffle/codec/dist/lib/stack/decode/index.js"}],[1558,{"./decode":1557,"./read":1559},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){n===undefined&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){n===undefined&&(n=r),e[n]=t[r]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&n(t,e,r);return i(t,e),t};Object.defineProperty(r,"__esModule",{value:!0}),r.Read=r.Decode=void 0;const s=o(e("./decode"));r.Decode=s;const a=o(e("./read"));r.Read=a}}},{package:"@truffle/codec",file:"node_modules/@truffle/codec/dist/lib/stack/index.js"}],[1559,{"../../errors":1534,"../../evm":1536,debug:2075},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){n===undefined&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){n===undefined&&(n=r),e[n]=t[r]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&n(t,e,r);return i(t,e),t},s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(r,"__esModule",{value:!0}),r.readStackLiteral=r.readStack=void 0;(0,s(e("debug")).default)("codec:stack:read");const a=o(e("../../evm")),u=e("../../errors");r.readStack=function(e,t){let{from:r,to:n}=e,{stack:i}=t;if(r<0||n>=i.length)throw new u.DecodingError({kind:"ReadErrorStack",from:r,to:n});let o=i.slice(r,n+1),s=new Uint8Array(o.length*a.Utils.WORD_SIZE);for(let e=0;e<o.length;e++)s.set(o[e],e*a.Utils.WORD_SIZE);return s},r.readStackLiteral=function(e){return e.literal}}}},{package:"@truffle/codec",file:"node_modules/@truffle/codec/dist/lib/stack/read/index.js"}],[1560,{"../../ast":1508,"../../basic":1514,"../../common":1519,"../../compiler":1524,"../../evm":1536,"../../format":1541,"../utils":1565,"bn.js":1586,debug:2075,"lodash/partition":2935},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){n===undefined&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){n===undefined&&(n=r),e[n]=t[r]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&n(t,e,r);return i(t,e),t},s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(r,"__esModule",{value:!0}),r.storageSize=r.getStateAllocations=r.getStorageAllocations=r.UnknownBaseContractIdError=void 0;const a=(0,s(e("debug")).default)("codec:storage:allocate"),u=o(e("../../compiler")),c=o(e("../../common")),l=o(e("../../basic")),d=o(e("../utils")),f=o(e("../../ast")),h=o(e("../../evm")),p=o(e("../../format")),m=s(e("bn.js")),g=s(e("lodash/partition"));class y extends Error{constructor(e,t,r,n){super(`Cannot locate base contract ID ${n} of ${r} ${t} (ID ${e})`),this.name="UnknownBaseContractIdError",this.derivedId=e,this.derivedName=t,this.derivedKind=r,this.baseId=n}}function v(e,t,r,n){return b(e.id,e.memberTypes,t,r,n)}function b(e,t,r,n,i){let o=0,s=h.Utils.WORD_SIZE-1;if(e in n)return n;let a,u=Object.assign({},n),c=[];for(const e of t){let t,n;({size:t,allocations:u}=M(e.type,r,u,i)),(d.isWordsLength(t)?s<h.Utils.WORD_SIZE-1:t.bytes>s+1)&&(s=h.Utils.WORD_SIZE-1,o+=1),n=d.isWordsLength(t)?{from:{slot:{offset:new m.default(o)},index:0},to:{slot:{offset:new m.default(o+t.words-1)},index:h.Utils.WORD_SIZE-1}}:{from:{slot:{offset:new m.default(o)},index:s-(t.bytes-1)},to:{slot:{offset:new m.default(o)},index:s}},c.push({name:e.name,type:e.type,pointer:{location:"storage",range:n}}),d.isWordsLength(t)?(o+=t.words,s=h.Utils.WORD_SIZE-1):(s-=t.bytes,s<0&&(s=h.Utils.WORD_SIZE-1,o+=1))}return a=s===h.Utils.WORD_SIZE-1&&0!==o?{words:o}:{words:o+1},u[e]={members:c,size:a},u}function w(e,t,r,n,i,o,s,a={}){let u=Object.assign({},...Object.entries(a).map((([e,t])=>({[e]:Object.assign({},t)}))));t||(t={});let c=e.linearizedBaseContracts.slice().reverse(),l=[].concat(...c.map((t=>{let r=i[t];if(r===undefined)throw new y(e.id,e.name,e.contractKind,t);return(n=r,n.nodes.filter((e=>"VariableDeclaration"===e.nodeType&&e.stateVariable))).map((e=>({definition:e,definedIn:r})));var n})));const d=e=>e.constant||"constant"===e.mutability;let[h,p]=(0,g.default)(l,(e=>d(e.definition)));const m=e=>"immutable"===e.mutability||e.id.toString()in t;let[v,w]=(0,g.default)(p,(e=>m(e.definition)));const M=b("-1",w.map((e=>({name:e.definition.name,type:f.Import.definitionToType(e.definition,r,n)}))),o,s,n)[-1],_=w.map((({definition:e,definedIn:t},n)=>({definition:e,definedIn:t,compilationId:r,pointer:M.members[n].pointer})));let O=v.map((({definition:e,definedIn:n})=>{let i,o=t[e.id.toString()]||[];return i=0===o.length?{location:"nowhere"}:{location:"code",start:o[0].start,length:o[0].length},{definition:e,definedIn:n,compilationId:r,pointer:i}})),E=h.map((({definition:e,definedIn:t})=>({definition:e,definedIn:t,compilationId:r,pointer:{location:"definition",definition:e.value}}))),T=[];for(let e of l){let t=d(e.definition)?E:m(e.definition)?O:_;T.push(t.shift())}return u[r]||(u[r]={}),u[r][e.id]={members:T},u}function M(e,t,r,n){switch(e.typeClass){case"bytes":switch(e.kind){case"static":return{size:{bytes:l.Allocate.byteLength(e,t)},allocations:r};case"dynamic":return{size:{words:1},allocations:r}}case"string":case"mapping":return{size:{words:1},allocations:r};case"array":switch(e.kind){case"dynamic":return{size:{words:1},allocations:r};case"static":const n=e.length.toNumber();if(0===n)return{size:{words:1},allocations:r};let{size:i,allocations:o}=M(e.baseType,t,r);if(d.isWordsLength(i))return{size:{words:i.words*n},allocations:o};{const e=Math.floor(h.Utils.WORD_SIZE/i.bytes);a("length %o",n);return{size:{words:Math.ceil(n/e)},allocations:o}}}case"struct":{let n=r,i=n[e.id];if(i===undefined){const o=t[e.id];if(!o)throw new c.UnknownUserDefinedTypeError(e.id,p.Types.typeString(e));n=v(o,t,r),i=n[e.id]}return{size:i.size,allocations:n}}case"userDefinedValueType":if("0.8.7+"===u.Utils.solidityFamily(n))return{size:{words:1},allocations:r};default:return{size:{bytes:l.Allocate.byteLength(e,t)},allocations:r}}}r.UnknownBaseContractIdError=y,r.getStorageAllocations=function(e){let t={};for(const r of Object.values(e)){const{compiler:e,types:n}=r;for(const i of Object.values(r.types))if("struct"===i.typeClass)try{t=v(i,n,t,e)}catch(e){}}return t},r.getStateAllocations=function(e,t,r,n,i={}){let o=i;for(const i of e){let{contractNode:e,immutableReferences:s,compiler:a,compilationId:u}=i;try{o=w(e,s,u,a,t[u],r,n,o)}catch(e){}}return o},r.storageSize=function(e,t,r,n){return M(e,t,r,n).size}}}},{package:"@truffle/codec",file:"node_modules/@truffle/codec/dist/lib/storage/allocate/index.js"}],[1561,{"../../basic":1514,"../../bytes":1517,"../../conversion":1531,"../../errors":1534,"../../evm":1536,"../../format":1541,"../../read":1553,"../allocate":1560,"../utils":1565,"bn.js":1586,debug:2075},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){n===undefined&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){n===undefined&&(n=r),e[n]=t[r]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&n(t,e,r);return i(t,e),t},s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(r,"__esModule",{value:!0}),r.decodeStorageReference=r.decodeStorageReferenceByAddress=r.decodeStorage=void 0;const a=(0,s(e("debug")).default)("codec:storage:decode"),u=s(e("../../read")),c=o(e("../../conversion")),l=o(e("../../format")),d=o(e("../../basic")),f=o(e("../../bytes")),h=o(e("../utils")),p=o(e("../../evm")),m=e("../allocate"),g=s(e("bn.js")),y=e("../../errors");function*v(e,t,r){return l.Types.isReferenceType(e)?yield*b(e,t,r):yield*d.Decode.decodeBasic(e,t,r)}function*b(e,t,r){var n,i;const{state:o}=r,s=r.allocations.storage;switch(e.typeClass){case"array":{let l,d;switch(a("storage array! %o",t),e.kind){case"dynamic":a("dynamic array"),a("type %O",e);try{n=yield*(0,u.default)(t,o)}catch(t){return(0,y.handleDecodingError)(e,t)}l=c.toBN(n);break;case"static":a("static array"),l=e.length}try{i=l.toNumber()}catch(t){return{type:e,kind:"error",error:{kind:"OverlongArraysAndStringsNotImplementedError",lengthAsBN:l}}}a("length %o",i),a("about to determine baseSize");try{d=(0,m.storageSize)(e.baseType,r.userDefinedTypes,s,r.currentContext.compiler)}catch(t){return(0,y.handleDecodingError)(e,t)}a("baseSize %o",d);let f=[];if(h.isWordsLength(d)){let r={path:t.range.from.slot,offset:new g.default(0),hashPath:"dynamic"===e.kind};for(let e=0;e<i;e++){let e={from:{slot:{path:r.path,offset:r.offset.clone(),hashPath:r.hashPath},index:0},to:{slot:{path:r.path,offset:r.offset.addn(d.words-1),hashPath:r.hashPath},index:p.Utils.WORD_SIZE-1}};f.push(e),r.offset.iaddn(d.words)}}else{const r=Math.floor(p.Utils.WORD_SIZE/d.bytes);a("perWord %d",r);let n={slot:{path:t.range.from.slot,offset:new g.default(0),hashPath:"dynamic"===e.kind},index:p.Utils.WORD_SIZE-d.bytes};for(let e=0;e<i;e++){let e={from:{slot:{path:n.slot.path,offset:n.slot.offset.clone(),hashPath:n.slot.hashPath},index:n.index},length:d.bytes};f.push(e),n.index-=d.bytes,n.index<0&&(n.slot.offset.iaddn(1),n.index=p.Utils.WORD_SIZE-d.bytes)}}let b=[];for(let t of f)b.push(yield*v(e.baseType,{location:"storage",range:t},r));return{type:e,kind:"value",value:b}}case"bytes":case"string":{try{n=yield*(0,u.default)(t,o)}catch(t){return(0,y.handleDecodingError)(e,t)}let s=n[p.Utils.WORD_SIZE-1];if(s%2==0)return a("in-word; length %o",i=s/2),yield*f.Decode.decodeBytes(e,{location:"storage",range:{from:{slot:t.range.from.slot,index:0},to:{slot:t.range.from.slot,index:i-1}}},r);{let o=c.toBN(n).subn(1).divn(2);try{i=o.toNumber()}catch(t){return{type:e,kind:"error",error:{kind:"OverlongArraysAndStringsNotImplementedError",lengthAsBN:o}}}return a("new-word, length %o",i),yield*f.Decode.decodeBytes(e,{location:"storage",range:{from:{slot:{path:t.range.from.slot,offset:new g.default(0),hashPath:!0},index:0},length:i}},r)}}case"struct":{const n=e.id,i=s[n];if(!i)return{type:e,kind:"error",error:{kind:"UserDefinedTypeNotFoundError",type:e}};let o=[];const u=i.members;for(let i=0;i<u.length;i++){const s=u[i],c=s.pointer;a("pointer %O",t);const d={from:{slot:{path:t.range.from.slot,offset:c.range.from.slot.offset.clone()},index:c.range.from.index},to:{slot:{path:t.range.from.slot,offset:c.range.to.slot.offset.clone()},index:c.range.to.index}};let f=r.userDefinedTypes[n];if(!f)return{type:e,kind:"error",error:{kind:"UserDefinedTypeNotFoundError",type:e}};let h=f.memberTypes[i].type,p=l.Types.specifyLocation(h,"storage");o.push({name:s.name,value:yield*v(p,{location:"storage",range:d},r)})}return{type:e,kind:"value",value:o}}case"mapping":{a("decoding mapping");const n=e.valueType;let i;try{i=(0,m.storageSize)(n,r.userDefinedTypes,s,r.currentContext.compiler)}catch(t){return(0,y.handleDecodingError)(e,t)}let o=[];const u=t.range.from.slot;a("baseSlot %o",u),a("base slot address %o",h.slotAddress(u));const c=r.mappingKeys.filter((({path:e})=>h.slotAddress(u).eq(h.slotAddress(e))));for(const{key:e}of c){let t;t=h.isWordsLength(i)?{location:"storage",range:{from:{slot:{key:e,path:u,offset:new g.default(0)},index:0},to:{slot:{key:e,path:u,offset:new g.default(i.words-1)},index:p.Utils.WORD_SIZE-1}}}:{location:"storage",range:{from:{slot:{key:e,path:u,offset:new g.default(0)},index:p.Utils.WORD_SIZE-i.bytes},to:{slot:{key:e,path:u,offset:new g.default(0)},index:p.Utils.WORD_SIZE-1}}},o.push({key:e,value:yield*v(n,t,r)})}return{type:e,kind:"value",value:o}}}}r.decodeStorage=v,r.decodeStorageReferenceByAddress=function*(e,t,r){const n=r.allocations.storage;let i;try{i=yield*(0,u.default)(t,r.state)}catch(t){return(0,y.handleDecodingError)(e,t)}const o=c.toBN(i);let s;try{s=(0,m.storageSize)(e,r.userDefinedTypes,n,r.currentContext.compiler)}catch(t){return(0,y.handleDecodingError)(e,t)}const a=s.words,l={location:"storage",range:{from:{slot:{offset:o},index:0},to:{slot:{offset:o.addn(a-1)},index:p.Utils.WORD_SIZE-1}}};return yield*b(e,l,r)},r.decodeStorageReference=b}}},{package:"@truffle/codec",file:"node_modules/@truffle/codec/dist/lib/storage/decode/index.js"}],[1562,{"./allocate":1560,"./decode":1561,"./read":1563,"./types":1564,"./utils":1565},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){n===undefined&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){n===undefined&&(n=r),e[n]=t[r]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)},s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&n(t,e,r);return i(t,e),t};Object.defineProperty(r,"__esModule",{value:!0}),r.Read=r.Decode=r.Allocate=r.Utils=void 0,o(e("./types"),r);const a=s(e("./utils"));r.Utils=a;const u=s(e("./allocate"));r.Allocate=u;const c=s(e("./decode"));r.Decode=c;const l=s(e("./read"));r.Read=l}}},{package:"@truffle/codec",file:"node_modules/@truffle/codec/dist/lib/storage/index.js"}],[1563,{"../../conversion":1531,"../../errors":1534,"../../evm":1536,"../utils":1565,debug:2075},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){n===undefined&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){n===undefined&&(n=r),e[n]=t[r]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&n(t,e,r);return i(t,e),t},s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(r,"__esModule",{value:!0}),r.readStorage=r.readSlot=void 0;const a=(0,s(e("debug")).default)("codec:storage:read"),u=o(e("../../conversion")),c=o(e("../utils")),l=o(e("../../evm")),d=e("../../errors");function*f(e,t){const r=c.slotAddress(t);let n=e[u.toHexString(r,l.Utils.WORD_SIZE)];if(n===undefined&&(n=yield{type:"storage",slot:r},null===n))throw new d.DecodingError({kind:"StorageNotSuppliedError",slot:r});return n}r.readSlot=f,r.readStorage=function*(e,t){const{storage:r}=t,{range:n}=e;a("readRange %o",n);let{from:i,to:o,length:s}=n;i={slot:i.slot,index:i.index||0},s!==undefined&&(o={slot:{path:i.slot.path||undefined,offset:i.slot.offset.addn(Math.floor((i.index+s-1)/l.Utils.WORD_SIZE))},index:(i.index+s-1)%l.Utils.WORD_SIZE}),a("normalized readRange %o",{from:i,to:o});let u,c=o.slot.offset.sub(i.slot.offset).addn(1);try{u=c.toNumber()}catch(e){throw new d.DecodingError({kind:"ReadErrorStorage",range:n})}let h=new Uint8Array(u*l.Utils.WORD_SIZE);for(let e=0;e<u;e++){let t=i.slot.offset.addn(e);const n=yield*f(r,Object.assign(Object.assign({},i.slot),{offset:t}));h.set(n,e*l.Utils.WORD_SIZE)}return a("words %o",h),h=h.slice(i.index,(u-1)*l.Utils.WORD_SIZE+o.index+1),a("data: %o",h),h}}}},{package:"@truffle/codec",file:"node_modules/@truffle/codec/dist/lib/storage/read/index.js"}],[1564,{},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0})}}},{package:"@truffle/codec",file:"node_modules/@truffle/codec/dist/lib/storage/types.js"}],[1565,{"../evm":1536,"../mapping-key":1549,debug:2075},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){n===undefined&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){n===undefined&&(n=r),e[n]=t[r]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&n(t,e,r);return i(t,e),t},s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(r,"__esModule",{value:!0}),r.equalSlots=r.slotAddress=r.storageLengthToBytes=r.isWordsLength=void 0;const a=(0,s(e("debug")).default)("codec:storage:utils"),u=o(e("../evm")),c=o(e("../mapping-key"));function l(e){return e.words!==undefined}r.isWordsLength=l,r.storageLengthToBytes=function(e){return l(e)?(a("size.words %d",e.words),e.words*u.Utils.WORD_SIZE):e.bytes},r.slotAddress=function e(t){if(t.key!==undefined&&t.path!==undefined)return u.Utils.keccak256(c.Encode.mappingKeyAsHex(t.key),e(t.path)).add(t.offset);if(t.path!==undefined){const r=e(t.path);return(t.hashPath?u.Utils.keccak256(r):r).add(t.offset)}return t.offset},r.equalSlots=function e(t,r){return t&&r?!!t.offset.eq(r.offset)&&(t.hashPath===r.hashPath&&(!!e(t.path,r.path)&&(t.key&&r.key?u.Utils.equalData(c.Encode.encodeMappingKey(t.key),c.Encode.encodeMappingKey(r.key)):!t.key&&!r.key))):!t&&!r}}}},{package:"@truffle/codec",file:"node_modules/@truffle/codec/dist/lib/storage/utils.js"}],[1566,{"../../basic":1514,"../../conversion":1531,"../../format":1541,"../../read":1553,debug:2075},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){n===undefined&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){n===undefined&&(n=r),e[n]=t[r]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&n(t,e,r);return i(t,e),t},s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(r,"__esModule",{value:!0}),r.decodeTopic=void 0;(0,s(e("debug")).default)("codec:topic:decode");const a=s(e("../../read")),u=o(e("../../basic")),c=o(e("../../format")),l=o(e("../../conversion"));r.decodeTopic=function*(e,t,r,n={}){if(c.Types.isReferenceType(e)||"tuple"===e.typeClass){let n=yield*(0,a.default)(t,r.state);return{type:e,kind:"error",error:{kind:"IndexedReferenceTypeError",type:e,raw:l.toHexString(n)}}}return yield*u.Decode.decodeBasic(e,t,r,n)}}}},{package:"@truffle/codec",file:"node_modules/@truffle/codec/dist/lib/topic/decode/index.js"}],[1567,{"../../basic/encode":1513,"../../conversion":1531,"../../evm":1536,debug:2075},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){n===undefined&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){n===undefined&&(n=r),e[n]=t[r]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&n(t,e,r);return i(t,e),t},s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(r,"__esModule",{value:!0}),r.encodeTopic=void 0;const a=(0,s(e("debug")).default)("codec:topic:encode"),u=o(e("../../conversion")),c=o(e("../../evm")),l=o(e("../../basic/encode"));r.encodeTopic=function(e){return"error"===e.kind?(a("input: %O",e),"IndexedReferenceTypeError"===e.error.kind?u.toBytes(e.error.raw,c.Utils.WORD_SIZE):undefined):l.encodeBasic(e)}}}},{package:"@truffle/codec",file:"node_modules/@truffle/codec/dist/lib/topic/encode/index.js"}],[1568,{"./decode":1566,"./encode":1567,"./read":1569},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){n===undefined&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){n===undefined&&(n=r),e[n]=t[r]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&n(t,e,r);return i(t,e),t};Object.defineProperty(r,"__esModule",{value:!0}),r.Read=r.Encode=r.Decode=void 0;const s=o(e("./decode"));r.Decode=s;const a=o(e("./encode"));r.Encode=a;const u=o(e("./read"));r.Read=u}}},{package:"@truffle/codec",file:"node_modules/@truffle/codec/dist/lib/topic/index.js"}],[1569,{},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.readTopic=void 0,r.readTopic=function(e,t){return t.eventtopics[e.topic]}}}},{package:"@truffle/codec",file:"node_modules/@truffle/codec/dist/lib/topic/read/index.js"}],[1570,{"../evm/utils":1538,"./dispatch":1574,"./errors":1575,"./messages":1579,"./utils":1583,debug:2075,"web3-utils":3381},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){n===undefined&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){n===undefined&&(n=r),e[n]=t[r]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&n(t,e,r);return i(t,e),t},s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(r,"__esModule",{value:!0}),r.addressCases=void 0;(0,s(e("debug")).default)("codec:wrap:address");const a=e("./dispatch"),u=e("./errors"),c=o(e("./utils")),l=o(e("../evm/utils")),d=o(e("./messages")),f=s(e("web3-utils")),h=[function*(e,t,r){if("string"!=typeof t)throw new u.TypeMismatchError(e,t,r.name,1,"Input was not a string");if(!c.isHexString(t))throw new u.TypeMismatchError(e,t,r.name,1,"Input was not a 0x-prefixed hex string");return y(e,t,t,r.name)},function*(e,t,r){if("string"!=typeof t)throw new u.TypeMismatchError(e,t,r.name,1,"Input was not a string");if(!c.isPrefixlessHexString(t))throw new u.TypeMismatchError(e,t,r.name,1,"Input was not an unprefixed hex string");return y(e,"0x"+t,t,r.name)},function*(e,t,r){if("string"!=typeof t)throw new u.TypeMismatchError(e,t,r.name,1,"Input was not a string");const n={kind:"address",name:t},i=yield n;if("address"!==i.kind)throw new u.BadResponseTypeError(n,i);if(null===i.address)throw new u.TypeMismatchError(e,t,r.name,i.partiallyRecognized?5:3,i.reason);return g(e,i.address)}],p=[...h,function*(e,t,r){if(!c.isBoxedString(t))throw new u.TypeMismatchError(e,t,r.name,1,"Input was not a boxed string");return yield*(0,a.wrapWithCases)(e,t.valueOf(),r,h)},function*(e,t,r){if(!c.isContractInput(t))throw new u.TypeMismatchError(e,t,r.name,1,"Input was not a contract-like object");return y(e,t.address,t,r.name)},m,function*(e,t,r){if(!c.isWrappedResult(t))throw new u.TypeMismatchError(e,t,r.name,1,"Input was not a wrapped result");if("userDefinedValueType"!==t.type.typeClass)throw new u.TypeMismatchError(e,t,r.name,1,d.wrappedTypeMessage(t.type));if("value"!==t.kind)throw new u.TypeMismatchError(e,t,r.name,5,d.errorResultMessage);return yield*m(e,t.value,r)},function*(e,t,r){throw new u.TypeMismatchError(e,t,r.name,2,"Input was not recognizable as an address")}];function*m(e,t,r){if(!c.isWrappedResult(t))throw new u.TypeMismatchError(e,t,r.name,1,"Input was not a wrapped result");if("address"!==t.type.typeClass&&"contract"!==t.type.typeClass)throw new u.TypeMismatchError(e,t,r.name,5,d.wrappedTypeMessage(t.type));if("value"!==t.kind)throw new u.TypeMismatchError(e,t,r.name,5,d.errorResultMessage);let n;switch(t.type.typeClass){case"address":n=t.value.asAddress;break;case"contract":n=t.value.address}return g(e,n)}function g(e,t){switch(e.typeClass){case"address":return{type:e,kind:"value",value:{asAddress:t}};case"contract":return{type:e,kind:"value",value:{kind:"unknown",address:t}}}}function y(e,t,r,n){return g(e,function(e,t,r,n){if(!c.isByteString(e))throw new u.TypeMismatchError(t,r,n,5,d.notABytestringMessage("Address"));if(e.length!==2*l.ADDRESS_SIZE+2)throw new u.TypeMismatchError(t,r,n,5,d.wrongLengthMessage("address",l.ADDRESS_SIZE,(e.length-2)/2));if(!f.default.isAddress(e))throw new u.TypeMismatchError(t,r,n,6,d.checksumFailedMessage);return f.default.toChecksumAddress(e)}(t,e,r,n))}r.addressCases=[function*(e,t,r){if(!c.isTypeValueInput(t))throw new u.TypeMismatchError(e,t,r.name,1,"Input was not a type/value pair");if("address"!==t.type&&"contract"!==t.type)throw new u.TypeMismatchError(e,t,r.name,5,d.specifiedTypeMessage(t.type));return yield*(0,a.wrapWithCases)(e,t.value,Object.assign(Object.assign({},r),{loose:!0}),p)},...p]}}},{package:"@truffle/codec",file:"node_modules/@truffle/codec/dist/lib/wrap/address.js"}],[1571,{"./dispatch":1574,"./errors":1575,"./messages":1579,"./utils":1583,debug:2075},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){n===undefined&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){n===undefined&&(n=r),e[n]=t[r]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&n(t,e,r);return i(t,e),t},s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(r,"__esModule",{value:!0}),r.boolCases=void 0;(0,s(e("debug")).default)("codec:wrap:bool");const a=e("./dispatch"),u=e("./errors"),c=o(e("./utils")),l=o(e("./messages")),d=[function*(e,t,r){if("boolean"!=typeof t)throw new u.TypeMismatchError(e,t,r.name,1,"Input was not a boolean");return{type:e,kind:"value",value:{asBoolean:t}}},function*(e,t,r){if("string"!=typeof t)throw new u.TypeMismatchError(e,t,r.name,1,"Input was not a string");const n=t.toLowerCase();if(r.strictBooleans&&!["true","false","1","0"].includes(n))throw new u.TypeMismatchError(e,t,r.name,5,"Input was not 'true', 'false', '1', or '0'");const i=Boolean(t)&&!["false","0"].includes(n);return{type:e,kind:"value",value:{asBoolean:i}}},function*(e,t,n){if(!c.isBoxedPrimitive(t))throw new u.TypeMismatchError(e,t,n.name,1,"Input was not a boxed primitive");return yield*(0,a.wrapWithCases)(e,t.valueOf(),n,r.boolCases)},f,h,function*(e,t,r){if(!c.isWrappedResult(t))throw new u.TypeMismatchError(e,t,r.name,1,"Input was not a wrapped result");if("userDefinedValueType"!==t.type.typeClass)throw new u.TypeMismatchError(e,t,r.name,1,l.wrappedTypeMessage(t.type));if("value"!==t.kind)throw new u.TypeMismatchError(e,t,r.name,5,l.errorResultMessage);return yield*f(e,t.value,r)},function*(e,t,r){if(!c.isWrappedResult(t))throw new u.TypeMismatchError(e,t,r.name,1,"Input was not a wrapped result");if("userDefinedValueType"!==t.type.typeClass)throw new u.TypeMismatchError(e,t,r.name,1,l.wrappedTypeMessage(t.type));if("error"!==t.kind)throw new u.TypeMismatchError(e,t,r.name,1,"Input was a value rather than an error");if("WrappedError"!==t.error.kind)throw new u.TypeMismatchError(e,t,r.name,5,l.errorResultMessage);return yield*h(e,t.error.error,r)},function*(e,t,r){if(c.isWrappedResult(t))throw new u.TypeMismatchError(e,t,r.name,1,"Input was a wrapped result");if(c.isTypeValueInput(t))throw new u.TypeMismatchError(e,t,r.name,1,"Input was a type/value pair");if(r.strictBooleans)throw new u.TypeMismatchError(e,t,r.name,2,"Input was neither a boolean nor a boolean string");const n=Boolean(t);return{type:e,kind:"value",value:{asBoolean:n}}}];function*f(e,t,r){if(!c.isWrappedResult(t))throw new u.TypeMismatchError(e,t,r.name,1,"Input was not a wrapped result");if("bool"!==t.type.typeClass)throw new u.TypeMismatchError(e,t,r.name,5,l.wrappedTypeMessage(t.type));if("value"!==t.kind)throw new u.TypeMismatchError(e,t,r.name,1,l.errorResultMessage);return{type:e,kind:"value",value:{asBoolean:t.value.asBoolean}}}function*h(e,t,r){if(!c.isWrappedResult(t))throw new u.TypeMismatchError(e,t,r.name,1,"Input was not a wrapped result");if("bool"!==t.type.typeClass)throw new u.TypeMismatchError(e,t,r.name,5,l.wrappedTypeMessage(t.type));if("error"!==t.kind)throw new u.TypeMismatchError(e,t,r.name,1,"Input was a value rather than an error");if(!["BoolOutOfRangeError","BoolPaddingError"].includes(t.error.kind))throw new u.TypeMismatchError(e,t,r.name,5,l.errorResultMessage);return{type:e,kind:"value",value:{asBoolean:!0}}}r.boolCases=[function*(e,t,r){if(!c.isTypeValueInput(t))throw new u.TypeMismatchError(e,t,r.name,1,"Input was not a type/value pair");if("bool"!==t.type)throw new u.TypeMismatchError(e,t,r.name,5,l.specifiedTypeMessage(t.type));return yield*(0,a.wrapWithCases)(e,t.value,Object.assign(Object.assign({},r),{loose:!0}),d)},...d]}}},{package:"@truffle/codec",file:"node_modules/@truffle/codec/dist/lib/wrap/bool.js"}],[1572,{"../conversion":1531,"./dispatch":1574,"./errors":1575,"./messages":1579,"./utils":1583,"bn.js":1586,debug:2075},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){n===undefined&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){n===undefined&&(n=r),e[n]=t[r]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&n(t,e,r);return i(t,e),t},s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(r,"__esModule",{value:!0}),r.validateUint8ArrayLike=r.bytesCases=void 0;const a=(0,s(e("debug")).default)("codec:wrap:bytes"),u=e("./dispatch"),c=e("./errors"),l=o(e("../conversion")),d=o(e("./utils")),f=o(e("./messages")),h=s(e("bn.js")),p=[function*(e,t,r){if("string"!=typeof t)throw new c.TypeMismatchError(e,t,r.name,1,"Input was not a string");const n=d.removeUnderscoresHex(t);if(!d.isByteString(n))throw new c.TypeMismatchError(e,t,r.name,5,f.notABytestringMessage("Input"));const i=b(e,n,t,r.name);return{type:e,kind:"value",value:{asHex:i}}},function*(e,t,r){if(!r.loose||"static"===e.kind)throw new c.TypeMismatchError(e,t,r.name,1,f.looseModeOnlyMessage);if("string"!=typeof t)throw new c.TypeMismatchError(e,t,r.name,1,"Input was not a string");if(""===t.trim())throw new c.TypeMismatchError(e,t,r.name,5,f.notABytestringMessage("Input"));const n=d.removeUnderscoresNumeric(t);let i;try{i=BigInt(n)}catch(n){throw new c.TypeMismatchError(e,t,r.name,1,"Input string was not a byte string or integer string")}if(i<0)throw new c.TypeMismatchError(e,t,r.name,5,f.negativeBytesMessage);let o=l.toHexString(i);return o=w(o),{type:e,kind:"value",value:{asHex:o}}}],m=[...p,function*(e,t,r){if(!d.isBoxedString(t))throw new c.TypeMismatchError(e,t,r.name,1,"Input was not a boxed string");return yield*(0,u.wrapWithCases)(e,t.valueOf(),r,p)},function*(e,t,r){if(!d.isUint8ArrayLike(t))throw new c.TypeMismatchError(e,t,r.name,1,"Input was not a Uint8Array-like");v(t,e,r.name);let n=l.toHexString(new Uint8Array(t));return n=b(e,n,t,r.name),{type:e,kind:"value",value:{asHex:n}}},g,function*(e,t,r){if(!d.isWrappedResult(t))throw new c.TypeMismatchError(e,t,r.name,1,"Input was not a wrapped result");if("userDefinedValueType"!==t.type.typeClass)throw new c.TypeMismatchError(e,t,r.name,1,f.wrappedTypeMessage(t.type));if("value"!==t.kind)throw new c.TypeMismatchError(e,t,r.name,5,f.errorResultMessage);return yield*g(e,t.value,r)},function*(e,t,r){if(!d.isEncodingTextInput(t))throw new c.TypeMismatchError(e,t,r.name,1,"Input was not a in encoding/text form");if("utf8"!==t.encoding)throw new c.TypeMismatchError(e,t,r.name,5,`Unknown or unsupported text encoding ${t.encoding}`);let n;try{n=l.toHexString(l.stringToBytes(t.text))}catch(n){throw new c.TypeMismatchError(e,t,r.name,5,f.invalidUtf16Message)}return n=b(e,n,t,r.name),{type:e,kind:"value",value:{asHex:n}}},y,function*(e,t,r){if(!d.isBoxedNumber(t))throw new c.TypeMismatchError(e,t,r.name,1,"Input was not a boxed number");return yield*y(e,t.valueOf(),r)},function*(e,t,r){if(!r.loose||"static"===e.kind)throw new c.TypeMismatchError(e,t,r.name,1,f.looseModeOnlyMessage);if("bigint"!=typeof t)throw new c.TypeMismatchError(e,t,r.name,1,"Input was not a bigint");if(t<0)throw new c.TypeMismatchError(e,t,r.name,5,f.negativeBytesMessage);let n=l.toHexString(t);return n=w(n),{type:e,kind:"value",value:{asHex:n}}},function*(e,t,r){if(!r.loose||"static"===e.kind)throw new c.TypeMismatchError(e,t,r.name,1,f.looseModeOnlyMessage);if(!h.default.isBN(t))throw new c.TypeMismatchError(e,t,r.name,1,"Input was not a BN");if(t.isNeg())throw new c.TypeMismatchError(e,t,r.name,5,f.negativeBytesMessage);let n=l.toHexString(t);return n=w(n),{type:e,kind:"value",value:{asHex:n}}},function*(e,t,r){if(!r.loose||"static"===e.kind)throw new c.TypeMismatchError(e,t,r.name,1,f.looseModeOnlyMessage);if(!l.isBig(t))throw new c.TypeMismatchError(e,t,r.name,1,"Input was not a Big");if(0!==l.countDecimalPlaces(t))throw new c.TypeMismatchError(e,t,r.name,5,f.nonIntegerMessage);if(t.lt(0))throw new c.TypeMismatchError(e,t,r.name,5,f.negativeBytesMessage);let n=l.toHexString(t);return n=w(n),{type:e,kind:"value",value:{asHex:n}}},function*(e,t,r){if(!r.loose||"static"===e.kind)throw new c.TypeMismatchError(e,t,r.name,2,"Input was not a hex string, byte-array-alike, encoding/text pair, type/value pair, or wrapped bytestring");const n={kind:"integer",input:t},i=yield n;if("integer"!==i.kind)throw new c.BadResponseTypeError(n,i);if(null===i.value)throw new c.TypeMismatchError(e,t,r.name,i.partiallyRecognized?5:3,i.reason||"Input was not a hex string, byte-array-alike, encoding/text pair, type/value pair, integer input, or wrapped bytestring");if(i.value<0)throw new c.TypeMismatchError(e,t,r.name,5,f.negativeBytesMessage);let o=l.toHexString(i.value);return o=w(o),{type:e,kind:"value",value:{asHex:o}}}];function*g(e,t,r){if(!d.isWrappedResult(t))throw new c.TypeMismatchError(e,t,r.name,1,"Input was not a wrapped result");if("bytes"!==t.type.typeClass)throw new c.TypeMismatchError(e,t,r.name,5,f.wrappedTypeMessage(t.type));if("value"!==t.kind)throw new c.TypeMismatchError(e,t,r.name,5,f.errorResultMessage);if(!(r.loose||"dynamic"===t.type.kind&&"dynamic"===e.kind||"static"===t.type.kind&&"static"===e.kind&&t.type.length===e.length))throw new c.TypeMismatchError(e,t,r.name,5,f.wrappedTypeMessage(t.type));let n=t.value.asHex;return n=b(e,n,t,r.name),{type:e,kind:"value",value:{asHex:n}}}function*y(e,t,r){if(!r.loose||"static"===e.kind)throw new c.TypeMismatchError(e,t,r.name,1,f.looseModeOnlyMessage);if("number"!=typeof t)throw new c.TypeMismatchError(e,t,r.name,1,"Input was not a number");if(!Number.isInteger(t))throw new c.TypeMismatchError(e,t,r.name,5,f.nonIntegerMessage);if(!Number.isSafeInteger(t))throw new c.TypeMismatchError(e,t,r.name,5,f.nonSafeMessage);if(t<0)throw new c.TypeMismatchError(e,t,r.name,5,f.negativeBytesMessage);let n=l.toHexString(t);return n=w(n),{type:e,kind:"value",value:{asHex:n}}}function v(e,t,r){if(!(e instanceof Uint8Array)){if(!Number.isSafeInteger(e.length))throw new c.TypeMismatchError(t,e,r,5,"Input is byte-array-like, but its length is not a safe integer");if(e.length<0)throw new c.TypeMismatchError(t,e,r,5,"Input is byte-array-like, but its length is negative");for(let n=0;n<e.length;n++)if("number"!=typeof e[n]||e[n]<0||e[n]>=256||!Number.isInteger(e[n]))throw new c.TypeMismatchError(t,e,r,5,`Input is byte-array-like, but byte ${n} is not a 1-byte value (number from 0 to 255)`)}}function b(e,t,r,n){if(t=t.toLowerCase(),"static"===e.kind){if((t.length-2)/2>e.length)throw new c.TypeMismatchError(e,r,n,5,f.overlongMessage(e.length,(t.length-2)/2));t=t.padEnd(2*e.length+2,"00")}return t}function w(e){return"0x"===e?"0x00":e}r.bytesCases=[function*(e,t,r){if(!d.isTypeValueInput(t))throw new c.TypeMismatchError(e,t,r.name,1,"Input was not a type/value pair");if(!t.type.match(/^byte(s\d*)?$/))throw new c.TypeMismatchError(e,t,r.name,5,f.specifiedTypeMessage(t.type));a("input.type: %s",t.type);let n=null,i=t.type.match(/^bytes(\d+)$/);i?n=Number(i[1]):"byte"===t.type&&(n=1);if(a("length: %o",n),!(null===n&&"dynamic"===e.kind||"static"===e.kind&&n===e.length))throw new c.TypeMismatchError(e,t,r.name,5,f.specifiedTypeMessage(t.type));return yield*(0,u.wrapWithCases)(e,t.value,Object.assign(Object.assign({},r),{loose:!0}),m)},...m],r.validateUint8ArrayLike=v}}},{package:"@truffle/codec",file:"node_modules/@truffle/codec/dist/lib/wrap/bytes.js"}],[1573,{"../conversion":1531,"./dispatch":1574,"./errors":1575,"./messages":1579,"./utils":1583,"big.js":1585,"bn.js":1586,debug:2075},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){n===undefined&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){n===undefined&&(n=r),e[n]=t[r]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&n(t,e,r);return i(t,e),t},s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(r,"__esModule",{value:!0}),r.decimalCases=void 0;(0,s(e("debug")).default)("codec:wrap:decimal");const a=e("./dispatch"),u=e("./errors"),c=o(e("../conversion")),l=o(e("./utils")),d=o(e("./messages")),f=s(e("bn.js")),h=s(e("big.js")),p=[function*(e,t,r){if(!l.isWrappedResult(t))throw new u.TypeMismatchError(e,t,r.name,1,"Input was not a wrapped result");if("fixed"!==t.type.typeClass&&"ufixed"!==t.type.typeClass)throw new u.TypeMismatchError(e,t,r.name,5,d.wrappedTypeMessage(t.type));if("value"!==t.kind)throw new u.TypeMismatchError(e,t,r.name,5,d.errorResultMessage);if(!r.loose&&(t.type.typeClass!==e.typeClass||t.type.bits!==e.bits||t.type.places!==e.places))throw new u.TypeMismatchError(e,t,r.name,5,d.wrappedTypeMessage(t.type));const n=t.value.asBig.plus(0);return v(e,n,t,r.name),{type:e,kind:"value",value:{asBig:n}}},function*(e,t,r){if(!l.isWrappedResult(t))throw new u.TypeMismatchError(e,t,r.name,1,"Input was not a wrapped result");if("int"!==t.type.typeClass&&"uint"!==t.type.typeClass)throw new u.TypeMismatchError(e,t,r.name,5,d.wrappedTypeMessage(t.type));if("value"!==t.kind)throw new u.TypeMismatchError(e,t,r.name,5,d.errorResultMessage);if(!r.loose)throw new u.TypeMismatchError(e,t,r.name,5,d.wrappedTypeMessage(t.type));const n=c.toBig(t.value.asBN);return v(e,n,t,r.name),{type:e,kind:"value",value:{asBig:n}}},function*(e,t,r){if(!l.isWrappedResult(t))throw new u.TypeMismatchError(e,t,r.name,1,"Input was not a wrapped result");if("enum"!==t.type.typeClass)throw new u.TypeMismatchError(e,t,r.name,5,d.wrappedTypeMessage(t.type));if("value"!==t.kind)throw new u.TypeMismatchError(e,t,r.name,1,d.errorResultMessage);if(!r.loose)throw new u.TypeMismatchError(e,t,r.name,5,d.wrappedTypeMessage(t.type));const n=c.toBig(t.value.numericAsBN);return v(e,n,t,r.name),{type:e,kind:"value",value:{asBig:n}}}],m=[y,g,function*(e,t,r){if(!l.isBoxedNumber(t))throw new u.TypeMismatchError(e,t,r.name,1,"Input was not a boxed number");return yield*y(e,t.valueOf(),r)},function*(e,t,r){if(!l.isBoxedString(t))throw new u.TypeMismatchError(e,t,r.name,1,"Input was not a boxed string");return yield*g(e,t.valueOf(),r)},function*(e,t,r){if("bigint"!=typeof t)throw new u.TypeMismatchError(e,t,r.name,1,"Input was not a bigint");const n=c.toBig(t);return v(e,n,t,r.name),{type:e,kind:"value",value:{asBig:n}}},function*(e,t,r){if(!f.default.isBN(t))throw new u.TypeMismatchError(e,t,r.name,1,"Input was not a BN");const n=c.toBig(t);return v(e,n,t,r.name),{type:e,kind:"value",value:{asBig:n}}},function*(e,t,r){if(!c.isBig(t))throw new u.TypeMismatchError(e,t,r.name,1,"Input was not a Big");const n=t.plus(0);return v(e,n,t,r.name),{type:e,kind:"value",value:{asBig:n}}},...p,function*(e,t,r){if(!l.isWrappedResult(t))throw new u.TypeMismatchError(e,t,r.name,1,"Input was not a wrapped result");if("userDefinedValueType"!==t.type.typeClass)throw new u.TypeMismatchError(e,t,r.name,1,d.wrappedTypeMessage(t.type));if("value"!==t.kind)throw new u.TypeMismatchError(e,t,r.name,5,d.errorResultMessage);return yield*(0,a.wrapWithCases)(e,t.value,r,p)},function*(e,t,r){if(!l.isWrappedResult(t))throw new u.TypeMismatchError(e,t,r.name,1,"Input was not a wrapped result");if("enum"!==t.type.typeClass)throw new u.TypeMismatchError(e,t,r.name,5,d.wrappedTypeMessage(t.type));if("error"!==t.kind)throw new u.TypeMismatchError(e,t,r.name,1,"Wrapped result was a value rather than an error");if(!r.loose)throw new u.TypeMismatchError(e,t,r.name,5,d.wrappedTypeMessage(t.type));const n=t;if("EnumOutOfRangeError"!==n.error.kind)throw new u.TypeMismatchError(e,t,r.name,5,d.errorResultMessage);const i=c.toBig(n.error.rawAsBN);return v(e,i,t,r.name),{type:e,kind:"value",value:{asBig:i}}},function*(e,t,r){const n={kind:"decimal",input:t},i=yield n;if("decimal"!==i.kind)throw new u.BadResponseTypeError(n,i);if(null===i.value)throw new u.TypeMismatchError(e,t,r.name,i.partiallyRecognized?5:3,i.reason||d.unrecognizedNumberMessage(e));const o=i.value.plus(0);return v(e,o,t,r.name),{type:e,kind:"value",value:{asBig:o}}}];function*g(e,t,r){if("string"!=typeof t)throw new u.TypeMismatchError(e,t,r.name,1,"Input was not a string");const n=t.trim(),i=l.removeUnderscoresNoHex(n);let o;try{o=new h.default(i)}catch(n){throw new u.TypeMismatchError(e,t,r.name,5,d.nonNumericMessage)}return v(e,o,t,r.name),{type:e,kind:"value",value:{asBig:o}}}function*y(e,t,r){if("number"!=typeof t)throw new u.TypeMismatchError(e,t,r.name,1,"Input was not a number");if(!Number.isFinite(t))throw new u.TypeMismatchError(e,t,r.name,5,"Numeric value is not finite");if(!l.isSafeNumber(e,t))throw new u.TypeMismatchError(e,t,r.name,5,"Given number is outside the safe range for this data type (possible loss of precision); use a numeric string, bigint, or big number class instead");const n=new h.default(t);return v(e,n,t,r.name),{type:e,kind:"value",value:{asBig:n}}}function v(e,t,r,n){if(c.countDecimalPlaces(t)>e.places)throw new u.TypeMismatchError(e,r,n,5,d.tooPreciseMessage(e.places,c.countDecimalPlaces(t)));if(t.gt(l.maxValue(e))||t.lt(l.minValue(e)))throw new u.TypeMismatchError(e,r,n,5,d.outOfRangeMessage)}r.decimalCases=[function*(e,t,r){if(!l.isTypeValueInput(t))throw new u.TypeMismatchError(e,t,r.name,1,"Input was not a type/value pair");if(!t.type.match(/^u?fixed(\d+(x\d+)?)?$/)&&"decimal"!==t.type)throw new u.TypeMismatchError(e,t,r.name,5,d.specifiedTypeMessage(t.type));let n,i,o;if("decimal"===t.type)o="fixed",n=168,i=10;else{const[e,r,s,a,u,c]=t.type.match(/^(u?fixed)((\d+)(x(\d+))?)?$/);n=a?Number(a):128,i=c?Number(c):18,o=r}if(e.typeClass!==o||e.bits!==n||e.places!==i)throw new u.TypeMismatchError(e,t,r.name,5,d.specifiedTypeMessage(t.type));return yield*(0,a.wrapWithCases)(e,t.value,Object.assign(Object.assign({},r),{loose:!0}),m)},...m]}}},{package:"@truffle/codec",file:"node_modules/@truffle/codec/dist/lib/wrap/decimal.js"}],[1574,{"../format":1541,"./errors":1575,debug:2075},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){n===undefined&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){n===undefined&&(n=r),e[n]=t[r]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&n(t,e,r);return i(t,e),t},s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(r,"__esModule",{value:!0}),r.wrapWithCases=void 0;(0,s(e("debug")).default)("codec:wrap:dispatch");const a=o(e("../format")),u=e("./errors");r.wrapWithCases=function*(e,t,r,n){let i;const o=r.specificityFloor||0;for(const o of n)try{return yield*o(e,t,Object.assign(Object.assign({},r),{specificityFloor:0}))}catch(e){if(!(e instanceof u.TypeMismatchError))throw e;(!i||e.specificity>i.specificity)&&(i=e)}throw i&&i.specificity<o&&(i.specificity=o),i||new u.TypeMismatchError(e,t,r.name,o,`Input for ${r.name} was not recognizable as type ${a.Types.typeStringWithoutLocation(e)}`)}}}},{package:"@truffle/codec",file:"node_modules/@truffle/codec/dist/lib/wrap/dispatch.js"}],[1575,{"../format":1541},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){n===undefined&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){n===undefined&&(n=r),e[n]=t[r]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&n(t,e,r);return i(t,e),t};Object.defineProperty(r,"__esModule",{value:!0}),r.BadResponseTypeError=r.TypeMismatchError=r.NoUniqueBestOverloadError=r.NoOverloadsMatchedError=void 0;const s=o(e("../format"));class a extends Error{constructor(e,t,r){super("Arguments provided did not match any overload"),this.methods=e,this.inputs=t,this.userDefinedTypes=r,this.name="NoOverloadsMatchedError"}}r.NoOverloadsMatchedError=a;class u extends Error{constructor(e){super("Could not determine a unique best overload for the given arguments.  "+"Please specify the overload explicitly or give the arguments more explicit types."),this.resolutions=e,this.name="NoUniqueBestOverloadError"}}r.NoUniqueBestOverloadError=u;class c extends Error{constructor(e,t,r,n,i){super(`Could not interpret input for ${r} as type ${s.Types.typeString(e)}.  Reason: ${i}`),this.variableName=r,this.dataType=e,this.input=t,this.reason=i,this.specificity=n,this.name="TypeMismatchError"}}r.TypeMismatchError=c;class l extends Error{constructor(e,t){super(`Got response type ${t.kind} to request type ${e.kind}`),this.request=e,this.response=t,this.name="BadResponseTypeError"}}r.BadResponseTypeError=l}}},{package:"@truffle/codec",file:"node_modules/@truffle/codec/dist/lib/wrap/errors.js"}],[1576,{"../evm/utils":1538,"./address":1570,"./bytes":1572,"./dispatch":1574,"./errors":1575,"./messages":1579,"./utils":1583,debug:2075,"web3-utils":3381},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){n===undefined&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){n===undefined&&(n=r),e[n]=t[r]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&n(t,e,r);return i(t,e),t},s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(r,"__esModule",{value:!0}),r.functionExternalCases=void 0;(0,s(e("debug")).default)("codec:wrap:function");const a=e("./dispatch"),u=e("./errors"),c=o(e("./messages")),l=o(e("./utils")),d=o(e("../evm/utils")),f=s(e("web3-utils")),h=e("./address"),p=e("./bytes"),m=[function*(e,t,r){if(!l.isFunctionExternalInput(t))throw new u.TypeMismatchError(e,t,r.name,1,"Input was not an object with address & selector");const n=(yield*(0,a.wrapWithCases)({typeClass:"address",kind:"general"},t.address,Object.assign(Object.assign({},r),{name:`${r.name}.address`,specificityFloor:5}),h.addressCases)).value.asAddress,i=(yield*(0,a.wrapWithCases)({typeClass:"bytes",kind:"static",length:4},t.selector,Object.assign(Object.assign({},r),{name:`${r.name}.selector`,specificityFloor:5}),p.bytesCases)).value.asHex;return{type:e,kind:"value",value:{kind:"unknown",contract:{kind:"unknown",address:n},selector:i}}},function*(e,t,r){if("string"!=typeof t)throw new u.TypeMismatchError(e,t,r.name,1,"Input was not a string");if(!l.isByteString(t))throw new u.TypeMismatchError(e,t,r.name,5,"Input was a string, but not a valid even-length hex string");if(t.length!==2+2*(d.ADDRESS_SIZE+d.SELECTOR_SIZE))throw new u.TypeMismatchError(e,t,r.name,5,c.wrongLengthMessage("external function was given as a string but",d.ADDRESS_SIZE+d.SELECTOR_SIZE,(t.length-2)/2));let n=t.slice(0,2*d.ADDRESS_SIZE+2).toLowerCase();const i="0x"+t.slice(2*d.ADDRESS_SIZE+2).toLowerCase();return n=f.default.toChecksumAddress(n),{type:e,kind:"value",value:{kind:"unknown",contract:{kind:"unknown",address:n},selector:i}}},function*(e,t,r){if(!l.isWrappedResult(t))throw new u.TypeMismatchError(e,t,r.name,1,"Input was not a wrapped result");if("function"!==t.type.typeClass||"external"!==t.type.visibility)throw new u.TypeMismatchError(e,t,r.name,5,c.wrappedTypeMessage(t.type));if("value"!==t.kind)throw new u.TypeMismatchError(e,t,r.name,5,c.errorResultMessage);const n=t,i=n.value.contract.address,o=n.value.selector;return{type:e,kind:"value",value:{kind:"unknown",contract:{kind:"unknown",address:i},selector:o}}},function*(e,t,r){throw new u.TypeMismatchError(e,t,r.name,2,"Input should be one of: an object with address and selector; a 24-byte hex string; a type/value pair; or a wrapped external function")}];r.functionExternalCases=[function*(e,t,r){if(!l.isTypeValueInput(t))throw new u.TypeMismatchError(e,t,r.name,1,"Input was not a type/value pair");if("function"!==t.type)throw new u.TypeMismatchError(e,t,r.name,5,c.specifiedTypeMessage(t.type));return yield*(0,a.wrapWithCases)(e,t.value,Object.assign(Object.assign({},r),{loose:!0}),m)},...m]}}},{package:"@truffle/codec",file:"node_modules/@truffle/codec/dist/lib/wrap/function.js"}],[1577,{"./errors":1575,"./messages":1579,"./priority":1580,"./types":1582,"./wrap":1584,debug:2075},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){n===undefined&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){n===undefined&&(n=r),e[n]=t[r]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)},s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&n(t,e,r);return i(t,e),t},a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(r,"__esModule",{value:!0}),r.resolveAndWrap=r.wrapForMethod=r.wrapMultiple=r.Messages=r.wrap=r.BadResponseTypeError=r.TypeMismatchError=r.NoUniqueBestOverloadError=r.NoOverloadsMatchedError=void 0;const u=(0,a(e("debug")).default)("codec:wrap"),c=e("./priority"),l=e("./errors");Object.defineProperty(r,"NoOverloadsMatchedError",{enumerable:!0,get:function(){return l.NoOverloadsMatchedError}}),Object.defineProperty(r,"NoUniqueBestOverloadError",{enumerable:!0,get:function(){return l.NoUniqueBestOverloadError}}),Object.defineProperty(r,"TypeMismatchError",{enumerable:!0,get:function(){return l.TypeMismatchError}}),Object.defineProperty(r,"BadResponseTypeError",{enumerable:!0,get:function(){return l.BadResponseTypeError}}),o(e("./errors"),r);const d=e("./wrap");function*f(e,t,r){const n={typeClass:"tuple",memberTypes:e};u("wrapping multiple");return(yield*(0,d.wrap)(n,t,r)).value.map((({value:e})=>e))}function*h(e,t,r){return p(e,yield*m(e,t,r,!0))}function p(e,t){if(t.length>0&&"options"===t[t.length-1].type.typeClass){return{method:e,arguments:t.slice(0,-1),options:t[t.length-1].value}}return{method:e,arguments:t,options:{}}}function*m(e,t,{userDefinedTypes:r,allowOptions:n,allowJson:i,strictBooleans:o},s=!1){if(u("wrapping for method"),e.inputs.length===t.length)return u("no options"),yield*f(e.inputs,t,{userDefinedTypes:r,oldOptionsBehavior:!0,loose:s,name:"<arguments>",allowJson:i,strictBooleans:o});if(n&&e.inputs.length===t.length-1){u("options");const n=[...e.inputs,{name:"<options>",type:{typeClass:"options"}}];return yield*f(n,t,{userDefinedTypes:r,oldOptionsBehavior:!0,loose:s,name:"<arguments>",allowJson:i,strictBooleans:o})}{const r=n?` (or ${e.inputs.length+1} counting transaction options)`:"";throw new l.TypeMismatchError({typeClass:"tuple",memberTypes:e.inputs},t,"<arguments>",5,`Incorrect number of arguments (expected ${e.inputs.length}${r}, got ${t.length})`)}}Object.defineProperty(r,"wrap",{enumerable:!0,get:function(){return d.wrap}}),o(e("./types"),r),r.Messages=s(e("./messages")),r.wrapMultiple=f,r.wrapForMethod=h,r.resolveAndWrap=function*(e,t,{userDefinedTypes:r,allowOptions:n,allowJson:i,strictBooleans:o}){if(1===e.length)return yield*h(e[0],t,{userDefinedTypes:r,allowOptions:n,allowJson:i,strictBooleans:o});const s=e.filter((e=>e.inputs.length===t.length));let a=[],g={};if(n&&t.length>0){const n=t[t.length-1];let s=!0;try{g=(yield*(0,d.wrap)({typeClass:"options"},n,{name:"<options>",loose:!0,oldOptionsBehavior:!0,userDefinedTypes:r,allowJson:i,strictBooleans:o})).value}catch(e){if(!(e instanceof l.TypeMismatchError))throw e;s=!1}s&&(a=e.filter((e=>e.inputs.length===t.length-1)))}if(u("possibleMatches: %o",s),u("possibleMatchesWithOptions: %o",a),1===s.length&&0===a.length){u("only one possibility, no options");const e=s[0];return{method:e,arguments:yield*f(e.inputs,t,{userDefinedTypes:r,loose:!0,name:"<arguments>",allowJson:i,strictBooleans:o}),options:{}}}if(1===a.length&&0===s.length){u("only one possiblity, with options");const e=a[0];return{method:e,arguments:yield*f(e.inputs,t,{userDefinedTypes:r,loose:!0,name:"<arguments>",allowJson:i,strictBooleans:o}),options:g}}if(0===s.length&&0===a.length)throw u("no possibilities"),new l.NoOverloadsMatchedError(e,t,r);u("attempting overload resolution");let y=[];for(const s of e){let e;try{e=yield*m(s,t,{userDefinedTypes:r,allowOptions:n,allowJson:i,strictBooleans:o})}catch(e){u("failed: %O",s),u("because: %O",e);continue}u("adding: %O",s),y.push({method:s,arguments:e,options:{}})}switch(u("resolutions: %O",y),y=y.filter((e=>y.every((t=>!(0,c.isMoreSpecificMultiple)(t.arguments,e.arguments,r)||(0,c.isMoreSpecificMultiple)(e.arguments,t.arguments,r))))),u("resolutions remaining: %O",y),y.length){case 0:throw new l.NoOverloadsMatchedError(e,t,r);case 1:const{method:n,arguments:i}=y[0];return p(n,i);default:throw new l.NoUniqueBestOverloadError(y)}}}}},{package:"@truffle/codec",file:"node_modules/@truffle/codec/dist/lib/wrap/index.js"}],[1578,{"../conversion":1531,"../format":1541,"./bytes":1572,"./dispatch":1574,"./errors":1575,"./messages":1579,"./utils":1583,"big.js":1585,"bn.js":1586,debug:2075},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){n===undefined&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){n===undefined&&(n=r),e[n]=t[r]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&n(t,e,r);return i(t,e),t},s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(r,"__esModule",{value:!0}),r.integerCases=void 0;const a=(0,s(e("debug")).default)("codec:wrap:integer"),u=o(e("../format")),c=e("./dispatch"),l=e("./errors"),d=o(e("../conversion")),f=o(e("./utils")),h=o(e("./messages")),p=s(e("bn.js")),m=s(e("big.js")),g=e("./bytes"),y=[function*(e,t,r){if("string"!=typeof t)throw new l.TypeMismatchError(e,t,r.name,1,"Input was not a string");if(""===t.trim())throw new l.TypeMismatchError(e,t,r.name,5,"enum"===e.typeClass?h.badEnumMessage:h.nonNumericMessage);const n=f.removeUnderscoresNumeric(t);let i;try{const e=BigInt(n);i=d.toBN(e)}catch(n){throw new l.TypeMismatchError(e,t,r.name,1,"Input string was not an integer string")}return M(e,i,r,t)},function*(e,t,r){if("string"!=typeof t)throw new l.TypeMismatchError(e,t,r.name,1,"Input was not a string");if("enum"!==e.typeClass)throw new l.TypeMismatchError(e,t,r.name,1,h.nonNumericMessage);const n=u.Types.fullType(e,r.userDefinedTypes).options,i=t.split("."),o=i[i.length-1];let s;switch(a("components: %O",i),a("dataType: %O",e),a("options: %O",n),i.length){case 1:s=!0;break;case 2:s=i[0]===e.typeName;break;case 3:s="local"===e.kind&&i[0]===e.definingContractName&&i[1]===e.typeName;break;default:s=!1}a("matchingType: %O",s);const c=s?n.indexOf(o):-1;if(a("numeric: %d",c),-1===c)throw new l.TypeMismatchError(e,t,r.name,1,h.badEnumMessage);const d=new p.default(c);return{type:e,kind:"value",value:{numericAsBN:d,name:o}}},function*(e,t,r){if("string"!=typeof t)throw new l.TypeMismatchError(e,t,r.name,1,"Input was not a string");if(""===t.trim())throw new l.TypeMismatchError(e,t,r.name,1,"enum"===e.typeClass?h.badEnumMessage:h.nonNumericMessage);const n=f.removeUnderscoresNoHex(t);let[i,o,s]=n.match(/^(.*?)(|wei|gwei|shannon|finney|szabo|ether)\s*$/i);o=o.trim();let a;try{a=o.match(/^\s*$/)?new m.default(1):new m.default(o)}catch(e){a=null}if(null===a)throw new l.TypeMismatchError(e,t,r.name,1,"Input was not a string using scientific notation or units");const u={"":0,wei:0,gwei:9,shannon:9,szabo:12,finney:15,ether:18}[s.toLowerCase()],c=d.shiftBigUp(a,u);if(0!==d.countDecimalPlaces(c))throw new l.TypeMismatchError(e,t,r.name,5,""!==s?"Input numeric value was not an integral number of wei":h.nonIntegerMessage);const p=d.toBN(c);return M(e,p,r,t)},function*(e,t,r){if("string"!=typeof t)throw new l.TypeMismatchError(e,t,r.name,1,"Input was not a string");if(!t.match(/^\s*-/))throw new l.TypeMismatchError(e,t,r.name,1,"Input was not a negated numeric string");const n=f.removeUnderscoresNumeric(t);let i;const[o,s]=n.match(/^\s*-(.*)$/);try{const e=BigInt(s);i=d.toBN(e)}catch(e){i=null}if(null===i||""===s||s.match(/^(-|\s)/))throw new l.TypeMismatchError(e,t,r.name,1,h.nonNumericMessage);const a=i.neg();return M(e,a,r,t)},function*(e,t,r){if("string"!=typeof t)throw new l.TypeMismatchError(e,t,r.name,1,"Input was not a string");throw new l.TypeMismatchError(e,t,r.name,4,"enum"===e.typeClass?h.badEnumMessage:h.nonNumericMessage)}],v=[function*(e,t,r){if(!f.isWrappedResult(t))throw new l.TypeMismatchError(e,t,r.name,1,"Input was not a wrapped result");if("int"!==t.type.typeClass&&"uint"!==t.type.typeClass)throw new l.TypeMismatchError(e,t,r.name,5,h.wrappedTypeMessage(t.type));if("value"!==t.kind)throw new l.TypeMismatchError(e,t,r.name,5,h.errorResultMessage);if(!r.loose&&(t.type.typeClass!==e.typeClass||t.type.bits!==e.bits))throw new l.TypeMismatchError(e,t,r.name,5,h.wrappedTypeMessage(t.type));const n=t.value.asBN.clone();return M(e,n,r,t)},function*(e,t,r){if(!f.isWrappedResult(t))throw new l.TypeMismatchError(e,t,r.name,1,"Input was not a wrapped result");if("enum"!==t.type.typeClass)throw new l.TypeMismatchError(e,t,r.name,5,h.wrappedTypeMessage(t.type));if("value"!==t.kind)throw new l.TypeMismatchError(e,t,r.name,1,h.errorResultMessage);if(!r.loose&&("enum"!==e.typeClass||t.type.id!==e.id))throw new l.TypeMismatchError(e,t,r.name,5,h.wrappedTypeMessage(t.type));const n=t.value.numericAsBN.clone();return M(e,n,r,t)},function*(e,t,r){if(!f.isWrappedResult(t))throw new l.TypeMismatchError(e,t,r.name,1,"Input was not a wrapped result");if("fixed"!==t.type.typeClass&&"ufixed"!==t.type.typeClass)throw new l.TypeMismatchError(e,t,r.name,5,h.wrappedTypeMessage(t.type));if("value"!==t.kind)throw new l.TypeMismatchError(e,t,r.name,5,h.errorResultMessage);if(!r.loose)throw new l.TypeMismatchError(e,t,r.name,5,h.wrappedTypeMessage(t.type));const n=d.toBN(t.value.asBig);return M(e,n,r,t)}],b=[...y,w,function*(e,t,r){if(!f.isBoxedNumber(t))throw new l.TypeMismatchError(e,t,r.name,1,"Input was not a boxed number");return yield*w(e,t.valueOf(),r)},function*(e,t,r){if(!f.isBoxedString(t))throw new l.TypeMismatchError(e,t,r.name,1,"Input was not a boxed string");return yield*(0,c.wrapWithCases)(e,t.valueOf(),r,y)},function*(e,t,r){if("bigint"!=typeof t)throw new l.TypeMismatchError(e,t,r.name,1,"Input was not a bigint");const n=d.toBN(t);return M(e,n,r,t)},function*(e,t,r){if(!p.default.isBN(t))throw new l.TypeMismatchError(e,t,r.name,1,"Input was not a BN");const n=t.clone();return M(e,n,r,t)},function*(e,t,r){if(!d.isBig(t))throw new l.TypeMismatchError(e,t,r.name,1,"Input was not a Big");if(0!==d.countDecimalPlaces(t))throw new l.TypeMismatchError(e,t,r.name,5,h.nonIntegerMessage);const n=d.toBN(t);return M(e,n,r,t)},function*(e,t,r){if(!f.isUint8ArrayLike(t))throw new l.TypeMismatchError(e,t,r.name,1,"Input was not a Uint8Array-like");(0,g.validateUint8ArrayLike)(t,e,r.name);const n=d.toBN(new Uint8Array(t));return M(e,n,r,t)},...v,function*(e,t,r){if(!f.isWrappedResult(t))throw new l.TypeMismatchError(e,t,r.name,1,"Input was not a wrapped result");if("enum"!==t.type.typeClass)throw new l.TypeMismatchError(e,t,r.name,5,h.wrappedTypeMessage(t.type));if("error"!==t.kind)throw new l.TypeMismatchError(e,t,r.name,1,"Wrapped result was a value rather than an error");if(!r.loose&&("enum"!==e.typeClass||t.type.id!==e.id))throw new l.TypeMismatchError(e,t,r.name,5,h.wrappedTypeMessage(t.type));const n=t;if("EnumOutOfRangeError"!==n.error.kind)throw new l.TypeMismatchError(e,t,r.name,5,h.errorResultMessage);const i=n.error.rawAsBN.clone();return M(e,i,r,t)},function*(e,t,r){if(!f.isWrappedResult(t))throw new l.TypeMismatchError(e,t,r.name,1,"Input was not a wrapped result");if("userDefinedValueType"!==t.type.typeClass)throw new l.TypeMismatchError(e,t,r.name,1,h.wrappedTypeMessage(t.type));if("value"!==t.kind)throw new l.TypeMismatchError(e,t,r.name,5,h.errorResultMessage);return yield*(0,c.wrapWithCases)(e,t.value,r,v)},function*(e,t,r){const n={kind:"integer",input:t},i=yield n;if("integer"!==i.kind)throw new l.BadResponseTypeError(n,i);if(null===i.value)throw new l.TypeMismatchError(e,t,r.name,i.partiallyRecognized?5:3,i.reason||h.unrecognizedNumberMessage(e));const o=d.toBN(i.value);return M(e,o,r,t)}];function*w(e,t,r){if("number"!=typeof t)throw new l.TypeMismatchError(e,t,r.name,1,"Input was not a number");if(!Number.isInteger(t))throw new l.TypeMismatchError(e,t,r.name,5,h.nonIntegerMessage);if(!Number.isSafeInteger(t))throw new l.TypeMismatchError(e,t,r.name,5,h.nonSafeMessage);return M(e,new p.default(t),r,t)}function M(e,t,r,n){switch(e.typeClass){case"uint":if(t.isNeg()||t.bitLength()>e.bits)throw new l.TypeMismatchError(e,n,r.name,5,h.outOfRangeMessage);return{type:e,kind:"value",value:{asBN:t}};case"int":if(!t.isNeg()&&t.bitLength()>=e.bits||t.isNeg()&&t.neg().subn(1).bitLength()>=e.bits)throw new l.TypeMismatchError(e,n,r.name,5,h.outOfRangeMessage);return{type:e,kind:"value",value:{asBN:t}};case"enum":const i=u.Types.fullType(e,r.userDefinedTypes);if(t.isNeg()||t.gten(i.options.length))throw new l.TypeMismatchError(e,n,r.name,5,h.outOfRangeEnumMessage);return{type:e,kind:"value",value:{numericAsBN:t,name:i.options[t.toNumber()]}}}}r.integerCases=[function*(e,t,r){if(!f.isTypeValueInput(t))throw new l.TypeMismatchError(e,t,r.name,1,"Input was not a type/value pair");if(!t.type.match(/^u?int\d*$/))throw new l.TypeMismatchError(e,t,r.name,"enum"===e.typeClass?1:5,h.specifiedTypeMessage(t.type));const[n,i,o]=t.type.match(/^(u?int)(\d*)$/),s=o?Number(o):256,a="enum"!==e.typeClass?e.typeClass:"uint",d="enum"!==e.typeClass?e.bits:8*Math.ceil(Math.log2(u.Types.fullType(e,r.userDefinedTypes).options.length)/8);if(a!==i||d!==s)throw new l.TypeMismatchError(e,t,r.name,5,h.specifiedTypeMessage(t.type));return yield*(0,c.wrapWithCases)(e,t.value,Object.assign(Object.assign({},r),{loose:!0}),b)},function*(e,t,r){if(!f.isTypeValueInput(t))throw new l.TypeMismatchError(e,t,r.name,1,"Input was not a type/value pair");if("enum"!==t.type)throw new l.TypeMismatchError(e,t,r.name,"enum"===e.typeClass?5:1,h.specifiedTypeMessage(t.type));if("enum"!==e.typeClass)throw new l.TypeMismatchError(e,t,r.name,5,h.specifiedTypeMessage(t.type));return yield*(0,c.wrapWithCases)(e,t.value,Object.assign(Object.assign({},r),{loose:!0}),b)},...b]}}},{package:"@truffle/codec",file:"node_modules/@truffle/codec/dist/lib/wrap/integer.js"}],[1579,{"../format":1541,debug:2075},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){n===undefined&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){n===undefined&&(n=r),e[n]=t[r]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&n(t,e,r);return i(t,e),t},s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(r,"__esModule",{value:!0}),r.unrecognizedNumberMessage=r.wrongLengthMessage=r.notABytestringMessage=r.tooPreciseMessage=r.overlongMessage=r.specifiedTypeMessage=r.wrappedTypeMessage=r.negativeBytesMessage=r.looseModeOnlyMessage=r.invalidUtf16Message=r.checksumFailedMessage=r.outOfRangeEnumMessage=r.outOfRangeMessage=r.badEnumMessage=r.nonSafeMessage=r.nonNumericMessage=r.nonIntegerMessage=r.notAStringMessage=r.errorResultMessage=r.wrongArrayLengthMessage=void 0;(0,s(e("debug")).default)("codec:wrap:messages");const a=o(e("../format"));r.wrongArrayLengthMessage=function(e,t){return`Incorrect array length (expected ${e.toString()} entries, got ${t})`},r.errorResultMessage="Input is a wrapped result representing an error rather than a value",r.notAStringMessage="Input was not a string, type/value pair, or wrapped or boxed string",r.nonIntegerMessage="Input numeric value was not an integer",r.nonNumericMessage="Input string was not numeric",r.nonSafeMessage="Input number is not a Javascript safe integer",r.badEnumMessage="Input string was neither numeric nor a valid enum value",r.outOfRangeMessage="Input is outside the range of this numeric type",r.outOfRangeEnumMessage="Input is outside the range of this enum type",r.checksumFailedMessage="Address checksum failed (use all lowercase or all uppercase to circumvent)",r.invalidUtf16Message="Input string was not valid UTF-16",r.looseModeOnlyMessage="Numeric input for bytes is only allowed in loose mode and only for dynamic-length bytestrings",r.negativeBytesMessage="Input for bytes cannot be negative",r.wrappedTypeMessage=function(e){return`Input is a wrapped value of type ${a.Types.typeString(e)}`},r.specifiedTypeMessage=function(e){return`Input had type explicitly specified as ${e}`},r.overlongMessage=function(e,t){return`Input is too long for type (expected ${e} bytes, got ${t} bytes)`},r.tooPreciseMessage=function(e,t){return`Input has too many decimal places for type (expected ${e} decimal places, got ${t} decimal places)`},r.notABytestringMessage=function(e){return`${e} is not a valid bytestring (even-length hex string)`},r.wrongLengthMessage=function(e,t,r){return`Input ${e} was ${r} bytes instead of ${t} bytes`},r.unrecognizedNumberMessage=function(e){return`Input was not a number, big integer, numeric string, ${"enum"===e.typeClass?"enum value name, ":""}type/value pair, boxed number, ${"fixed"!==e.typeClass&&"ufixed"!==e.typeClass?"byte-array-like, ":""}wrapped number or enum, or recognized big number class`}}}},{package:"@truffle/codec",file:"node_modules/@truffle/codec/dist/lib/wrap/messages.js"}],[1580,{"../format":1541,"./utils":1583,debug:2075},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){n===undefined&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){n===undefined&&(n=r),e[n]=t[r]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&n(t,e,r);return i(t,e),t},s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(r,"__esModule",{value:!0}),r.isMoreSpecific=r.isMoreSpecificMultiple=void 0;const a=(0,s(e("debug")).default)("codec:wrap:priority"),u=o(e("../format")),c=e("./utils");function l(e,t,r,n=!1){"userDefinedValueType"===e.typeClass&&(e=d(e,r)),"userDefinedValueType"===t.typeClass&&(t=d(t,r));const i=[["options"],["array"],["struct","tuple"],["address","contract"],["bytes"],["function"],["uint","int","fixed","ufixed"],["enum"],["string"],["bool"]],o=i.findIndex((t=>t.includes(e.typeClass))),s=i.findIndex((e=>e.includes(t.typeClass)));if(o<s)return!0;if(s<o)return!1;switch(e.typeClass){case"options":case"string":case"bool":return!0;case"address":case"contract":return function(e,t){if("address"===e.typeClass&&"address"===t.typeClass){if("specific"===e.kind&&"specific"===t.kind)return e.payable||!t.payable;if("general"===t.kind)return!0}if("contract"===e.typeClass&&"contract"===t.typeClass&&"native"===e.kind&&"native"===t.kind)return e.id===t.id;if("contract"===e.typeClass&&"address"===t.typeClass)return"general"===t.kind||"specific"===t.kind&&!t.payable||"specific"===t.kind&&e.payable;return!1}(e,t);case"function":return function(e,t,r){switch(t.kind){case"general":return!0;case"specific":switch(e.kind){case"general":return!1;case"specific":if(n=e.mutability,i=t.mutability,n!==i&&("pure"!==n||"payable"===i)&&"nonpayable"!==i)return!1;if(e.outputParameterTypes.length!==t.outputParameterTypes.length)return!1;for(let n=0;n<e.outputParameterTypes.length;n++)if(!l(e.outputParameterTypes[n],t.outputParameterTypes[n],r))return!1;if(e.inputParameterTypes.length!==t.inputParameterTypes.length)return!1;for(let n=0;n<e.inputParameterTypes.length;n++)if(!l(t.inputParameterTypes[n],e.inputParameterTypes[n],r))return!1;return!0}}var n,i}(e,t,r);case"array":return function(e,t,r){return("dynamic"===e.kind&&"dynamic"===t.kind||"static"===e.kind&&"dynamic"===t.kind||"static"===e.kind&&"static"===t.kind&&e.length.eq(t.length))&&l(e.baseType,t.baseType,r)}(e,t,r);case"bytes":return function(e,t){return"dynamic"===e.kind&&"dynamic"===t.kind||"static"===e.kind&&"dynamic"===t.kind||"static"===e.kind&&"static"===t.kind&&e.length<=t.length}(e,t);case"uint":case"int":case"fixed":case"ufixed":return function(e,t){return(0,c.maxValue)(e).lte((0,c.maxValue)(t))&&(0,c.minValue)(e).gte((0,c.minValue)(t))&&(0,c.places)(e)<=(0,c.places)(t)&&!!("fixed"!==e.typeClass&&"ufixed"!==e.typeClass||"int"!==t.typeClass&&"uint"!==t.typeClass)}(e,t);case"enum":return function(e,t){return e.id===t.id}(e,t);case"struct":case"tuple":return function(e,t,r,n=!1){a("type1: %O",e),a("type2: %O",t);const i=u.Types.fullType(e,r),o=u.Types.fullType(t,r),s=i.memberTypes.map((e=>e.type)),c=o.memberTypes.map((e=>e.type));if(s.length!==c.length)return!1;for(let e=0;e<s.length;e++)if(!l(s[e],c[e],r))return!1;if(!n){a("checking by name");let e=i.memberTypes.map((e=>e.name)),t=o.memberTypes.map((e=>e.name));e.sort(),t.sort();let n=!0;for(let r=0;r<e.length;r++)if(!e[r]||!t[r]||e[r]!==t[r]){n=!1;break}if(n){a("names equal");for(let e=0;e<s.length;e++){const t=s[e],n=i.memberTypes[e].name,u=o.memberTypes.find((({name:e})=>e===n)).type;if(a("name: %s",n),a("type1: %O",t),a("type2: %O",u),!l(t,u,r))return a("returning false"),!1}a("name check ok")}}return!0}(e,t,r,n)}}function d(e,t){return u.Types.fullType(e,t).underlyingType}r.isMoreSpecificMultiple=function(e,t,r){return l({typeClass:"tuple",memberTypes:e},{typeClass:"tuple",memberTypes:t},r,!0)},r.isMoreSpecific=l}}},{package:"@truffle/codec",file:"node_modules/@truffle/codec/dist/lib/wrap/priority.js"}],[1581,{"../bytes/decode":1515,"./bytes":1572,"./dispatch":1574,"./errors":1575,"./messages":1579,"./utils":1583,debug:2075},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){n===undefined&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){n===undefined&&(n=r),e[n]=t[r]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&n(t,e,r);return i(t,e),t},s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(r,"__esModule",{value:!0}),r.stringCases=void 0;(0,s(e("debug")).default)("codec:wrap:string");const a=e("./dispatch"),u=e("./errors"),c=e("../bytes/decode"),l=e("./bytes"),d=o(e("./utils")),f=o(e("./messages")),h=[p,function*(e,t,r){if(!d.isBoxedString(t))throw new u.TypeMismatchError(e,t,r.name,1,"Input was not a boxed string");return yield*p(e,t.valueOf(),r)},function*(e,t,r){if(!d.isWrappedResult(t))throw new u.TypeMismatchError(e,t,r.name,1,"Input was not a wrapped result");if("string"!==t.type.typeClass)throw new u.TypeMismatchError(e,t,r.name,5,f.wrappedTypeMessage(t.type));if("value"!==t.kind)throw new u.TypeMismatchError(e,t,r.name,5,f.errorResultMessage);return{type:e,kind:"value",value:t.value}},function*(e,t,r){if(!d.isUint8ArrayLike(t))throw new u.TypeMismatchError(e,t,r.name,1,"Input was not a Uint8Array-like");(0,l.validateUint8ArrayLike)(t,e,r.name);const n=(0,c.decodeString)(new Uint8Array(t));return{type:e,kind:"value",value:n}},function*(e,t,r){throw new u.TypeMismatchError(e,t,r.name,2,f.notAStringMessage)}];function*p(e,t,r){if("string"!=typeof t)throw new u.TypeMismatchError(e,t,r.name,1,"Input was not a string");if(!d.isValidUtf16(t))throw new u.TypeMismatchError(e,t,r.name,5,f.invalidUtf16Message);return{type:e,kind:"value",value:{kind:"valid",asString:t}}}r.stringCases=[function*(e,t,r){if(!d.isTypeValueInput(t))throw new u.TypeMismatchError(e,t,r.name,1,"Input was not a type/value pair");if("string"!==t.type)throw new u.TypeMismatchError(e,t,r.name,5,f.specifiedTypeMessage(t.type));return yield*(0,a.wrapWithCases)(e,t.value,Object.assign(Object.assign({},r),{loose:!0}),h)},...h]}}},{package:"@truffle/codec",file:"node_modules/@truffle/codec/dist/lib/wrap/string.js"}],[1582,{},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0})}}},{package:"@truffle/codec",file:"node_modules/@truffle/codec/dist/lib/wrap/types.js"}],[1583,{"../conversion":1531,"big.js":1585,"lodash/isBoolean":2915,"lodash/isNumber":2923,"lodash/isString":2927,utf8:3349},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){n===undefined&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){n===undefined&&(n=r),e[n]=t[r]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&n(t,e,r);return i(t,e),t},s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(r,"__esModule",{value:!0}),r.removeUnderscoresHex=r.removeUnderscoresNoHex=r.removeUnderscoresNumeric=r.isValidUtf16=r.isBoxedPrimitive=r.isBoxedBoolean=r.isBoxedNumber=r.isBoxedString=r.isByteStringWithUnderscores=r.isByteString=r.isPrefixlessHexString=r.isHexString=r.base64Length=r.isBase64=r.isPlainObject=r.isUint8ArrayLike=r.isWrappedResult=r.isFunctionExternalInput=r.isContractInput=r.isEncodingTextInput=r.isTypeValueInput=r.isSafeNumber=r.minValue=r.maxValue=r.places=void 0;const a=s(e("big.js")),u=o(e("../conversion")),c=s(e("lodash/isBoolean")),l=s(e("lodash/isString")),d=s(e("lodash/isNumber")),f=s(e("utf8"));function h(e){switch(e.typeClass){case"int":case"uint":return 0;case"fixed":case"ufixed":return e.places}}function p(e){return(0,l.default)(e)&&"string"!=typeof e}function m(e){return(0,d.default)(e)&&"number"!=typeof e}function g(e){return(0,c.default)(e)&&"boolean"!=typeof e}function y(e){return b(e,/\d_\d/)}function v(e){return b(e,/[\da-f]_[\da-f]/i)}function b(e,t){let r;for(;r=e.match(t);)e=e.slice(0,r.index+1)+e.slice(r.index+2);return e}r.places=h,r.maxValue=function(e){let t=e.bits;"int"!==e.typeClass&&"fixed"!==e.typeClass||(t-=1);const r=new a.default(2).pow(t).minus(1);return u.shiftBigDown(r,h(e))},r.minValue=function(e){if("uint"===e.typeClass||"ufixed"===e.typeClass)return new a.default(0);const t=new a.default(0).minus(new a.default(2).pow(e.bits));return u.shiftBigDown(t,h(e))},r.isSafeNumber=function(e,t){const r=t*10**e.places;return Number.MIN_SAFE_INTEGER<=r&&r<=Number.MAX_SAFE_INTEGER},r.isTypeValueInput=function(e){return"object"==typeof e&&null!==e&&"string"==typeof e.type&&"value"in e&&2===Object.keys(e).length},r.isEncodingTextInput=function(e){return"object"==typeof e&&null!==e&&"string"==typeof e.encoding&&"string"==typeof e.text&&2===Object.keys(e).length},r.isContractInput=function(e){return("object"==typeof e||"function"==typeof e)&&null!==e&&"string"==typeof e.address&&!("selector"in e)},r.isFunctionExternalInput=function(e){return("object"==typeof e||"function"==typeof e)&&null!==e&&"address"in e&&"selector"in e},r.isWrappedResult=function(e){return"object"==typeof e&&null!==e&&"object"==typeof e.type&&null!==e.type&&"string"==typeof e.type.typeClass&&("value"===e.kind&&"object"==typeof e.value||"error"===e.kind&&"object"==typeof e.error)},r.isUint8ArrayLike=function(e){return e instanceof Uint8Array||"object"==typeof e&&null!==e&&"number"==typeof e.length},r.isPlainObject=function(e){return"object"==typeof e&&null!==e},r.isBase64=function(e){return Boolean(e.match(/^([A-Za-z0-9+/]{4})*([A-Za-z0-9+/]{2}([A-Za-z0-9+/]|=)=)?$/))},r.base64Length=function(e){const[t,r]=e.match(/(=*)$/);return 3*e.length/4-r.length},r.isHexString=function(e){return Boolean(e.match(/^0[xX][0-9a-fA-F]*$/))},r.isPrefixlessHexString=function(e){return Boolean(e.match(/^[0-9a-fA-F]*$/))},r.isByteString=function(e){return Boolean(e.match(/^0[xX]([0-9a-fA-F]{2})*$/))},r.isByteStringWithUnderscores=function(e){return Boolean(e.match(/^0[xX](([0-9a-fA-F]{2}_?)*([0-9a-fA-F]{2}))?$/))},r.isBoxedString=p,r.isBoxedNumber=m,r.isBoxedBoolean=g,r.isBoxedPrimitive=function(e){return p(e)||m(e)||g(e)},r.isValidUtf16=function(e){try{return f.default.encode(e),!0}catch(e){return!1}},r.removeUnderscoresNumeric=function(e){return e.match(/0x/i)?v(e):y(e)},r.removeUnderscoresNoHex=y,r.removeUnderscoresHex=v}}},{package:"@truffle/codec",file:"node_modules/@truffle/codec/dist/lib/wrap/utils.js"}],[1584,{"../conversion":1531,"../format":1541,"./address":1570,"./bool":1571,"./bytes":1572,"./decimal":1573,"./dispatch":1574,"./errors":1575,"./function":1576,"./integer":1578,"./messages":1579,"./string":1581,"./utils":1583,debug:2075},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){n===undefined&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){n===undefined&&(n=r),e[n]=t[r]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&n(t,e,r);return i(t,e),t},s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(r,"__esModule",{value:!0}),r.wrap=r.udvtCases=r.txOptionsCases=r.tupleCases=r.arrayCases=void 0;const a=(0,s(e("debug")).default)("codec:wrap:wrap"),u=o(e("../format")),c=e("./errors"),l=e("./dispatch"),d=o(e("./messages")),f=o(e("../conversion")),h=o(e("./utils")),p=e("./integer"),m=e("./decimal"),g=e("./bool"),y=e("./bytes"),v=e("./address"),b=e("./string"),w=e("./function"),M=[T,function*(e,t,r){if(!h.isWrappedResult(t))throw new c.TypeMismatchError(e,t,r.name,1,"Input was not a wrapped result");if("array"!==t.type.typeClass)throw new c.TypeMismatchError(e,t,r.name,5,d.wrappedTypeMessage(t.type));if("value"!==t.kind)throw new c.TypeMismatchError(e,t,r.name,5,d.errorResultMessage);if(!r.loose&&t.type.kind===e.kind)throw new c.TypeMismatchError(e,t,r.name,5,d.wrappedTypeMessage(t.type));const n=t.value;return yield*T(e,n,r)},function*(e,t,r){if(!r.allowJson)throw new c.TypeMismatchError(e,t,r.name,1,"JSON input must be explicitly enabled");if("string"!=typeof t)throw new c.TypeMismatchError(e,t,r.name,1,"Input was not a string");let n;try{n=JSON.parse(t)}catch(n){throw new c.TypeMismatchError(e,t,r.name,5,`Input was not valid JSON: ${n.message}`)}return yield*T(e,n,r)},function*(e,t,r){throw new c.TypeMismatchError(e,t,r.name,2,"Input was not an array, type/value pair or wrapped array")}];r.arrayCases=[function*(e,t,r){if(!h.isTypeValueInput(t))throw new c.TypeMismatchError(e,t,r.name,1,"Input was not a type/value pair");if("array"!==t.type)throw new c.TypeMismatchError(e,t,r.name,5,d.specifiedTypeMessage(t.type));return yield*(0,l.wrapWithCases)(e,t.value,r,M)},...M];const _=[j,function*(e,t,r){if(!h.isWrappedResult(t))throw new c.TypeMismatchError(e,t,r.name,1,"Input was not a wrapped result");if("tuple"!==t.type.typeClass&&"struct"!==t.type.typeClass)throw new c.TypeMismatchError(e,t,r.name,5,d.wrappedTypeMessage(t.type));if("value"!==t.kind)throw new c.TypeMismatchError(e,t,r.name,5,d.errorResultMessage);const n=t;return yield*j(e,n.value.map((({value:e})=>e)),r)},k,function*(e,t,r){if(!r.allowJson)throw new c.TypeMismatchError(e,t,r.name,1,"JSON input must be explicitly enabled");if("string"!=typeof t)throw new c.TypeMismatchError(e,t,r.name,1,"Input was not a string");let n;try{n=JSON.parse(t)}catch(n){throw new c.TypeMismatchError(e,t,r.name,5,`Input was not valid JSON: ${n.message}`)}return a("input is JSON"),a("parses to: %O",n),yield*(0,l.wrapWithCases)(e,n,r,[k,j])},function*(e,t,r){throw new c.TypeMismatchError(e,t,r.name,2,"Input was not an array, plain object, type/value pair or wrapped tuple or struct")}];r.tupleCases=[function*(e,t,r){if(!h.isTypeValueInput(t))throw new c.TypeMismatchError(e,t,r.name,1,"Input was not a type/value pair");if("tuple"!==t.type&&"struct"!==t.type)throw new c.TypeMismatchError(e,t,r.name,5,d.specifiedTypeMessage(t.type));return yield*(0,l.wrapWithCases)(e,t.value,r,_)},..._];const O=[function*(e,t,r){if(!h.isWrappedResult(t))throw new c.TypeMismatchError(e,t,r.name,1,"Input was not a wrapped result");if("options"!==t.type.typeClass)throw new c.TypeMismatchError(e,t,r.name,5,d.wrappedTypeMessage(t.type));if("value"!==t.kind)throw new c.TypeMismatchError(e,t,r.name,5,d.errorResultMessage);const n=t.value;return{type:e,kind:"value",value:n}},function*(e,t,n){if(!h.isPlainObject(t))throw new c.TypeMismatchError(e,t,n.name,1,"Input was not a non-null object");if(a("options input is object: %O",t),a("wrapOptions: %O",n),!n.loose&&h.isWrappedResult(t))throw new c.TypeMismatchError(e,t,n.name,1,"Input was a wrapped result");let i={};const o=["gas","gasPrice","value","nonce","maxFeePerGas","maxPriorityFeePerGas"],s=["type"],d=["from","to"],m=["data"],b=["overwrite"],w=["accessList"],M=[...o,...s,...d,...m,...b,...w,"privateFor"],_=Object.keys(t).find((e=>!M.includes(e))),O=Object.keys(t).find((e=>M.includes(e)));if(_!==undefined&&!n.oldOptionsBehavior)throw new c.TypeMismatchError(e,t,n.name,4,`Transaction options included unknown option ${_}`);if(n.oldOptionsBehavior&&O===undefined)throw new c.TypeMismatchError(e,t,n.name,4,"Transaction options included no recognized options");for(const e of o)if(t[e]!==undefined){const r=yield*(0,l.wrapWithCases)({typeClass:"uint",bits:256},t[e],Object.assign(Object.assign({},n),{name:`${n.name}.${e}`}),p.integerCases);i[e]=r.value.asBN}for(const r of s)if(t[r]!==undefined){const o=(yield*(0,l.wrapWithCases)({typeClass:"uint",bits:8},t[r],Object.assign(Object.assign({},n),{name:`${n.name}.${r}`}),p.integerCases)).value.asBN;if(o.gten(192))throw new c.TypeMismatchError(e,t,`${n.name}.type`,4,"Transaction types must be less than 0xc0");i[r]=f.toHexString(o)}for(const e of d)if(t[e]!==undefined){const r=yield*(0,l.wrapWithCases)({typeClass:"address",kind:"general"},t[e],Object.assign(Object.assign({},n),{name:`${n.name}.${e}`}),v.addressCases);i[e]=r.value.asAddress}for(const e of m)if(t[e]!==undefined){const r=yield*(0,l.wrapWithCases)({typeClass:"bytes",kind:"dynamic"},t[e],Object.assign(Object.assign({},n),{name:`${n.name}.${e}`}),y.bytesCases);i[e]=r.value.asHex}for(const e of b)if(t[e]!==undefined){const r=yield*(0,l.wrapWithCases)({typeClass:"bool"},t[e],Object.assign(Object.assign({},n),{name:`${n.name}.${e}`}),g.boolCases);i[e]=r.value.asBoolean}for(const e of w)if(t[e]!==undefined){const o=yield*(0,l.wrapWithCases)({typeClass:"array",kind:"dynamic",baseType:{typeClass:"tuple",memberTypes:[{name:"address",type:{typeClass:"address",kind:"general"}},{name:"storageKeys",type:{typeClass:"array",kind:"dynamic",baseType:{typeClass:"uint",bits:256}}}]}},t[e],Object.assign(Object.assign({},n),{name:`${n.name}.${e}`}),r.arrayCases);i[e]=u.Utils.Inspect.nativizeAccessList(o)}if(t.privateFor!==undefined){if(!Array.isArray(t.privateFor))throw new c.TypeMismatchError(e,t,`${n.name}.privateFor`,4,"Transaction option privateFor should be an array of base64-encoded bytestrings of 32 bytes");i.privateFor=t.privateFor.map(((r,i)=>{if(h.isBoxedString(r)&&(r=r.valueOf()),"string"!=typeof r)throw new c.TypeMismatchError(e,t,`${n.name}.privateFor`,4,`Public key at index ${i} is not a string`);if(!h.isBase64(r))throw new c.TypeMismatchError(e,t,`${n.name}.privateFor`,4,`Public key at index ${i} is not base64-encoded`);const o=h.base64Length(r);if(32!==o)throw new c.TypeMismatchError(e,t,`${n.name}.privateFor`,4,`Public key at index ${i} should encode a bytestring of 32 bytes; got ${o} bytes instead`);return r}))}return{type:e,kind:"value",value:i}},function*(e,t,r){throw new c.TypeMismatchError(e,t,r.name,2,"Transaction options input was not a plain object, type/value pair or wrapped options object")}];function*E(e,t,n){switch(n.name||(n=Object.assign(Object.assign({},n),{name:"<input>"})),e.typeClass){case"uint":case"int":case"enum":return yield*(0,l.wrapWithCases)(e,t,n,p.integerCases);case"fixed":case"ufixed":return yield*(0,l.wrapWithCases)(e,t,n,m.decimalCases);case"bool":return yield*(0,l.wrapWithCases)(e,t,n,g.boolCases);case"bytes":return yield*(0,l.wrapWithCases)(e,t,n,y.bytesCases);case"address":case"contract":return yield*(0,l.wrapWithCases)(e,t,n,v.addressCases);case"string":return yield*(0,l.wrapWithCases)(e,t,n,b.stringCases);case"function":if("internal"===e.visibility)throw new c.TypeMismatchError(e,t,n.name,5,"Wrapping/encoding for internal function pointers is not supported");return yield*(0,l.wrapWithCases)(e,t,n,w.functionExternalCases);case"array":return yield*(0,l.wrapWithCases)(e,t,n,r.arrayCases);case"struct":case"tuple":return yield*(0,l.wrapWithCases)(e,t,n,r.tupleCases);case"userDefinedValueType":return yield*(0,l.wrapWithCases)(e,t,n,r.udvtCases);case"options":return yield*(0,l.wrapWithCases)(e,t,n,r.txOptionsCases);default:throw new c.TypeMismatchError(e,t,n.name,5,`Wrapping/encoding for type ${u.Types.typeStringWithoutLocation(e)} is not supported`)}}function*T(e,t,r){if(!Array.isArray(t))throw new c.TypeMismatchError(e,t,r.name,1,"Input was not an array");if("static"===e.kind&&!e.length.eqn(t.length))throw new c.TypeMismatchError(e,t,r.name,5,d.wrongArrayLengthMessage(e.length,t.length));let n=[];for(let i=0;i<t.length;i++)n.push(yield*E(e.baseType,t[i],Object.assign(Object.assign({},r),{name:`${r.name}[${i}]`,specificityFloor:5})));return{type:e,kind:"value",value:n}}function*j(e,t,r){if(!Array.isArray(t))throw new c.TypeMismatchError(e,t,r.name,1,"Input was not an array");a("input is array");const n=x(e,r.userDefinedTypes);if(n.length!==t.length)throw a("input is wrong-length array"),new c.TypeMismatchError(e,t,r.name,5,d.wrongArrayLengthMessage(n.length,t.length));let i=[];for(let e=0;e<t.length;e++){const o=n[e].name;a("wrapping %s",o),i.push({name:o,value:yield*E(n[e].type,t[e],Object.assign(Object.assign({},r),{name:o?r.name.match(/^<.*>$/)?o:`${r.name}.${o}`:`${r.name}[${e}]`,specificityFloor:5}))})}return{type:e,kind:"value",value:i}}function*k(e,t,r){if(!h.isPlainObject(t))throw new c.TypeMismatchError(e,t,r.name,1,"Input was not a non-null object");if(!r.loose&&h.isTypeValueInput(t))throw new c.TypeMismatchError(e,t,r.name,1,"Input was a type/value pair");if(!r.loose&&h.isWrappedResult(t))throw new c.TypeMismatchError(e,t,r.name,1,"Input was a wrapped result");const n=x(e,r.userDefinedTypes);if(n.some((({name:e})=>!e)))throw new c.TypeMismatchError(e,t,r.name,4,"Plain object input is allowed only when all elements of tuple are named");let i=new Set(Object.keys(t)),o=[];for(let s=0;s<n.length;s++){const a=n[s].name;if(!(a in t))throw new c.TypeMismatchError(e,t,r.name,4,`Missing key from tuple or struct: ${a}`);i.delete(a),o.push({name:a,value:yield*E(n[s].type,t[a],Object.assign(Object.assign({},r),{name:`${r.name}.${a}`,specificityFloor:4}))})}if(!r.loose&&i.size>0){const n=i.values().next().value;throw new c.TypeMismatchError(e,t,r.name,4,`Unknown key ${n} included`)}return{type:e,kind:"value",value:o}}function x(e,t){switch(e.typeClass){case"tuple":return e.memberTypes;case"struct":return a("wrapping for struct %s",e.typeName),u.Types.fullType(e,t).memberTypes}}r.txOptionsCases=[function*(e,t,r){if(!h.isTypeValueInput(t))throw new c.TypeMismatchError(e,t,r.name,1,"Input was not a type/value pair");if("options"!==t.type)throw new c.TypeMismatchError(e,t,r.name,5,d.specifiedTypeMessage(t.type));return yield*(0,l.wrapWithCases)(e,t.value,Object.assign(Object.assign({},r),{loose:!0}),O)},...O],r.udvtCases=[function*(e,t,r){const{underlyingType:n}=u.Types.fullType(e,r.userDefinedTypes),i=yield*E(n,t,r);return{type:e,kind:"value",value:i}}],r.wrap=E}}},{package:"@truffle/codec",file:"node_modules/@truffle/codec/dist/lib/wrap/wrap.js"}],[1585,{},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){!function(e){var r,n=1e6,i=1e6,o="[big.js] ",s=o+"Invalid ",a=s+"decimal places",u=s+"rounding mode",c=o+"Division by zero",l={},d=void 0,f=/^-?(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i;function h(e,t,r,n){var i=e.c;if(r===d&&(r=e.constructor.RM),0!==r&&1!==r&&2!==r&&3!==r)throw Error(u);if(t<1)n=3===r&&(n||!!i[0])||0===t&&(1===r&&i[0]>=5||2===r&&(i[0]>5||5===i[0]&&(n||i[1]!==d))),i.length=1,n?(e.e=e.e-t+1,i[0]=1):i[0]=e.e=0;else if(t<i.length){if(n=1===r&&i[t]>=5||2===r&&(i[t]>5||5===i[t]&&(n||i[t+1]!==d||1&i[t-1]))||3===r&&(n||!!i[0]),i.length=t,n)for(;++i[--t]>9;)if(i[t]=0,0===t){++e.e,i.unshift(1);break}for(t=i.length;!i[--t];)i.pop()}return e}function p(e,t,r){var n=e.e,i=e.c.join(""),o=i.length;if(t)i=i.charAt(0)+(o>1?"."+i.slice(1):"")+(n<0?"e":"e+")+n;else if(n<0){for(;++n;)i="0"+i;i="0."+i}else if(n>0)if(++n>o)for(n-=o;n--;)i+="0";else n<o&&(i=i.slice(0,n)+"."+i.slice(n));else o>1&&(i=i.charAt(0)+"."+i.slice(1));return e.s<0&&r?"-"+i:i}l.abs=function(){var e=new this.constructor(this);return e.s=1,e},l.cmp=function(e){var t,r=this,n=r.c,i=(e=new r.constructor(e)).c,o=r.s,s=e.s,a=r.e,u=e.e;if(!n[0]||!i[0])return n[0]?o:i[0]?-s:0;if(o!=s)return o;if(t=o<0,a!=u)return a>u^t?1:-1;for(s=(a=n.length)<(u=i.length)?a:u,o=-1;++o<s;)if(n[o]!=i[o])return n[o]>i[o]^t?1:-1;return a==u?0:a>u^t?1:-1},l.div=function(e){var t=this,r=t.constructor,i=t.c,o=(e=new r(e)).c,s=t.s==e.s?1:-1,u=r.DP;if(u!==~~u||u<0||u>n)throw Error(a);if(!o[0])throw Error(c);if(!i[0])return e.s=s,e.c=[e.e=0],e;var l,f,p,m,g,y=o.slice(),v=l=o.length,b=i.length,w=i.slice(0,l),M=w.length,_=e,O=_.c=[],E=0,T=u+(_.e=t.e-e.e)+1;for(_.s=s,s=T<0?0:T,y.unshift(0);M++<l;)w.push(0);do{for(p=0;p<10;p++){if(l!=(M=w.length))m=l>M?1:-1;else for(g=-1,m=0;++g<l;)if(o[g]!=w[g]){m=o[g]>w[g]?1:-1;break}if(!(m<0))break;for(f=M==l?o:y;M;){if(w[--M]<f[M]){for(g=M;g&&!w[--g];)w[g]=9;--w[g],w[M]+=10}w[M]-=f[M]}for(;!w[0];)w.shift()}O[E++]=m?p:++p,w[0]&&m?w[M]=i[v]||0:w=[i[v]]}while((v++<b||w[0]!==d)&&s--);return O[0]||1==E||(O.shift(),_.e--,T--),E>T&&h(_,T,r.RM,w[0]!==d),_},l.eq=function(e){return 0===this.cmp(e)},l.gt=function(e){return this.cmp(e)>0},l.gte=function(e){return this.cmp(e)>-1},l.lt=function(e){return this.cmp(e)<0},l.lte=function(e){return this.cmp(e)<1},l.minus=l.sub=function(e){var t,r,n,i,o=this,s=o.constructor,a=o.s,u=(e=new s(e)).s;if(a!=u)return e.s=-u,o.plus(e);var c=o.c.slice(),l=o.e,d=e.c,f=e.e;if(!c[0]||!d[0])return d[0]?e.s=-u:c[0]?e=new s(o):e.s=1,e;if(a=l-f){for((i=a<0)?(a=-a,n=c):(f=l,n=d),n.reverse(),u=a;u--;)n.push(0);n.reverse()}else for(r=((i=c.length<d.length)?c:d).length,a=u=0;u<r;u++)if(c[u]!=d[u]){i=c[u]<d[u];break}if(i&&(n=c,c=d,d=n,e.s=-e.s),(u=(r=d.length)-(t=c.length))>0)for(;u--;)c[t++]=0;for(u=t;r>a;){if(c[--r]<d[r]){for(t=r;t&&!c[--t];)c[t]=9;--c[t],c[r]+=10}c[r]-=d[r]}for(;0===c[--u];)c.pop();for(;0===c[0];)c.shift(),--f;return c[0]||(e.s=1,c=[f=0]),e.c=c,e.e=f,e},l.mod=function(e){var t,r=this,n=r.constructor,i=r.s,o=(e=new n(e)).s;if(!e.c[0])throw Error(c);return r.s=e.s=1,t=1==e.cmp(r),r.s=i,e.s=o,t?new n(r):(i=n.DP,o=n.RM,n.DP=n.RM=0,r=r.div(e),n.DP=i,n.RM=o,this.minus(r.times(e)))},l.neg=function(){var e=new this.constructor(this);return e.s=-e.s,e},l.plus=l.add=function(e){var t,r,n,i=this,o=i.constructor;if(e=new o(e),i.s!=e.s)return e.s=-e.s,i.minus(e);var s=i.e,a=i.c,u=e.e,c=e.c;if(!a[0]||!c[0])return c[0]||(a[0]?e=new o(i):e.s=i.s),e;if(a=a.slice(),t=s-u){for(t>0?(u=s,n=c):(t=-t,n=a),n.reverse();t--;)n.push(0);n.reverse()}for(a.length-c.length<0&&(n=c,c=a,a=n),t=c.length,r=0;t;a[t]%=10)r=(a[--t]=a[t]+c[t]+r)/10|0;for(r&&(a.unshift(r),++u),t=a.length;0===a[--t];)a.pop();return e.c=a,e.e=u,e},l.pow=function(e){var t=this,r=new t.constructor("1"),n=r,o=e<0;if(e!==~~e||e<-1e6||e>i)throw Error(s+"exponent");for(o&&(e=-e);1&e&&(n=n.times(t)),e>>=1;)t=t.times(t);return o?r.div(n):n},l.prec=function(e,t){if(e!==~~e||e<1||e>n)throw Error(s+"precision");return h(new this.constructor(this),e,t)},l.round=function(e,t){if(e===d)e=0;else if(e!==~~e||e<-n||e>n)throw Error(a);return h(new this.constructor(this),e+this.e+1,t)},l.sqrt=function(){var e,t,r,n=this,i=n.constructor,s=n.s,a=n.e,u=new i("0.5");if(!n.c[0])return new i(n);if(s<0)throw Error(o+"No square root");0===(s=Math.sqrt(n+""))||s===1/0?((t=n.c.join("")).length+a&1||(t+="0"),a=((a+1)/2|0)-(a<0||1&a),e=new i(((s=Math.sqrt(t))==1/0?"5e":(s=s.toExponential()).slice(0,s.indexOf("e")+1))+a)):e=new i(s+""),a=e.e+(i.DP+=4);do{r=e,e=u.times(r.plus(n.div(r)))}while(r.c.slice(0,a).join("")!==e.c.slice(0,a).join(""));return h(e,(i.DP-=4)+e.e+1,i.RM)},l.times=l.mul=function(e){var t,r=this,n=r.constructor,i=r.c,o=(e=new n(e)).c,s=i.length,a=o.length,u=r.e,c=e.e;if(e.s=r.s==e.s?1:-1,!i[0]||!o[0])return e.c=[e.e=0],e;for(e.e=u+c,s<a&&(t=i,i=o,o=t,c=s,s=a,a=c),t=new Array(c=s+a);c--;)t[c]=0;for(u=a;u--;){for(a=0,c=s+u;c>u;)a=t[c]+o[u]*i[c-u-1]+a,t[c--]=a%10,a=a/10|0;t[c]=a}for(a?++e.e:t.shift(),u=t.length;!t[--u];)t.pop();return e.c=t,e},l.toExponential=function(e,t){var r=this,i=r.c[0];if(e!==d){if(e!==~~e||e<0||e>n)throw Error(a);for(r=h(new r.constructor(r),++e,t);r.c.length<e;)r.c.push(0)}return p(r,!0,!!i)},l.toFixed=function(e,t){var r=this,i=r.c[0];if(e!==d){if(e!==~~e||e<0||e>n)throw Error(a);for(e=e+(r=h(new r.constructor(r),e+r.e+1,t)).e+1;r.c.length<e;)r.c.push(0)}return p(r,!1,!!i)},l.toJSON=l.toString=function(){var e=this,t=e.constructor;return p(e,e.e<=t.NE||e.e>=t.PE,!!e.c[0])},l.toNumber=function(){var e=Number(p(this,!0,!0));if(!0===this.constructor.strict&&!this.eq(e.toString()))throw Error(o+"Imprecise conversion");return e},l.toPrecision=function(e,t){var r=this,i=r.constructor,o=r.c[0];if(e!==d){if(e!==~~e||e<1||e>n)throw Error(s+"precision");for(r=h(new i(r),e,t);r.c.length<e;)r.c.push(0)}return p(r,e<=r.e||r.e<=i.NE||r.e>=i.PE,!!o)},l.valueOf=function(){var e=this,t=e.constructor;if(!0===t.strict)throw Error(o+"valueOf disallowed");return p(e,e.e<=t.NE||e.e>=t.PE,!0)},r=function e(){function t(r){var n=this;if(!(n instanceof t))return r===d?e():new t(r);if(r instanceof t)n.s=r.s,n.e=r.e,n.c=r.c.slice();else{if("string"!=typeof r){if(!0===t.strict&&"bigint"!=typeof r)throw TypeError(s+"value");r=0===r&&1/r<0?"-0":String(r)}!function(e,t){var r,n,i;if(!f.test(t))throw Error(s+"number");e.s="-"==t.charAt(0)?(t=t.slice(1),-1):1,(r=t.indexOf("."))>-1&&(t=t.replace(".",""));(n=t.search(/e/i))>0?(r<0&&(r=n),r+=+t.slice(n+1),t=t.substring(0,n)):r<0&&(r=t.length);for(i=t.length,n=0;n<i&&"0"==t.charAt(n);)++n;if(n==i)e.c=[e.e=0];else{for(;i>0&&"0"==t.charAt(--i););for(e.e=r-n-1,e.c=[],r=0;n<=i;)e.c[r++]=+t.charAt(n++)}}(n,r)}n.constructor=t}return t.prototype=l,t.DP=20,t.RM=1,t.NE=-7,t.PE=21,t.strict=false,t.roundDown=0,t.roundHalfUp=1,t.roundHalfEven=2,t.roundUp=3,t}(),r.default=r.Big=r,"function"==typeof define&&define.amd?define((function(){return r})):void 0!==t&&t.exports?t.exports=r:e.Big=r}(this)}}},{package:"@truffle/codec>big.js",file:"node_modules/@truffle/codec/node_modules/big.js/big.js"}],[1586,{buffer:1942},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){!function(t,r){function n(e,t){if(!e)throw new Error(t||"Assertion failed")}function i(e,t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}function o(e,t,r){if(o.isBN(e))return e;this.negative=0,this.words=null,this.length=0,this.red=null,null!==e&&("le"!==t&&"be"!==t||(r=t,t=10),this._init(e||0,t||10,r||"be"))}var s;"object"==typeof t?t.exports=o:r.BN=o,o.BN=o,o.wordSize=26;try{s="undefined"!=typeof window&&void 0!==window.Buffer?window.Buffer:e("buffer").Buffer}catch(e){}function a(e,t){var r=e.charCodeAt(t);return r>=48&&r<=57?r-48:r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:void n(!1,"Invalid character in "+e)}function u(e,t,r){var n=a(e,r);return r-1>=t&&(n|=a(e,r-1)<<4),n}function c(e,t,r,i){for(var o=0,s=0,a=Math.min(e.length,r),u=t;u<a;u++){var c=e.charCodeAt(u)-48;o*=i,s=c>=49?c-49+10:c>=17?c-17+10:c,n(c>=0&&s<i,"Invalid character"),o+=s}return o}function l(e,t){e.words=t.words,e.length=t.length,e.negative=t.negative,e.red=t.red}if(o.isBN=function(e){return e instanceof o||null!==e&&"object"==typeof e&&e.constructor.wordSize===o.wordSize&&Array.isArray(e.words)},o.max=function(e,t){return e.cmp(t)>0?e:t},o.min=function(e,t){return e.cmp(t)<0?e:t},o.prototype._init=function(e,t,r){if("number"==typeof e)return this._initNumber(e,t,r);if("object"==typeof e)return this._initArray(e,t,r);"hex"===t&&(t=16),n(t===(0|t)&&t>=2&&t<=36);var i=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&(i++,this.negative=1),i<e.length&&(16===t?this._parseHex(e,i,r):(this._parseBase(e,t,i),"le"===r&&this._initArray(this.toArray(),t,r)))},o.prototype._initNumber=function(e,t,r){e<0&&(this.negative=1,e=-e),e<67108864?(this.words=[67108863&e],this.length=1):e<4503599627370496?(this.words=[67108863&e,e/67108864&67108863],this.length=2):(n(e<9007199254740992),this.words=[67108863&e,e/67108864&67108863,1],this.length=3),"le"===r&&this._initArray(this.toArray(),t,r)},o.prototype._initArray=function(e,t,r){if(n("number"==typeof e.length),e.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(e.length/3),this.words=new Array(this.length);for(var i=0;i<this.length;i++)this.words[i]=0;var o,s,a=0;if("be"===r)for(i=e.length-1,o=0;i>=0;i-=3)s=e[i]|e[i-1]<<8|e[i-2]<<16,this.words[o]|=s<<a&67108863,this.words[o+1]=s>>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);else if("le"===r)for(i=0,o=0;i<e.length;i+=3)s=e[i]|e[i+1]<<8|e[i+2]<<16,this.words[o]|=s<<a&67108863,this.words[o+1]=s>>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);return this._strip()},o.prototype._parseHex=function(e,t,r){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var n=0;n<this.length;n++)this.words[n]=0;var i,o=0,s=0;if("be"===r)for(n=e.length-1;n>=t;n-=2)i=u(e,t,n)<<o,this.words[s]|=67108863&i,o>=18?(o-=18,s+=1,this.words[s]|=i>>>26):o+=8;else for(n=(e.length-t)%2==0?t+1:t;n<e.length;n+=2)i=u(e,t,n)<<o,this.words[s]|=67108863&i,o>=18?(o-=18,s+=1,this.words[s]|=i>>>26):o+=8;this._strip()},o.prototype._parseBase=function(e,t,r){this.words=[0],this.length=1;for(var n=0,i=1;i<=67108863;i*=t)n++;n--,i=i/t|0;for(var o=e.length-r,s=o%n,a=Math.min(o,o-s)+r,u=0,l=r;l<a;l+=n)u=c(e,l,l+n,t),this.imuln(i),this.words[0]+u<67108864?this.words[0]+=u:this._iaddn(u);if(0!==s){var d=1;for(u=c(e,l,e.length,t),l=0;l<s;l++)d*=t;this.imuln(d),this.words[0]+u<67108864?this.words[0]+=u:this._iaddn(u)}this._strip()},o.prototype.copy=function(e){e.words=new Array(this.length);for(var t=0;t<this.length;t++)e.words[t]=this.words[t];e.length=this.length,e.negative=this.negative,e.red=this.red},o.prototype._move=function(e){l(e,this)},o.prototype.clone=function(){var e=new o(null);return this.copy(e),e},o.prototype._expand=function(e){for(;this.length<e;)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},"undefined"!=typeof Symbol&&"function"==typeof Symbol.for)try{o.prototype[Symbol.for("nodejs.util.inspect.custom")]=d}catch(e){o.prototype.inspect=d}else o.prototype.inspect=d;function d(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"}var f=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],h=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],p=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];o.prototype.toString=function(e,t){var r;if(t=0|t||1,16===(e=e||10)||"hex"===e){r="";for(var i=0,o=0,s=0;s<this.length;s++){var a=this.words[s],u=(16777215&(a<<i|o)).toString(16);o=a>>>24-i&16777215,(i+=2)>=26&&(i-=26,s--),r=0!==o||s!==this.length-1?f[6-u.length]+u+r:u+r}for(0!==o&&(r=o.toString(16)+r);r.length%t!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(e===(0|e)&&e>=2&&e<=36){var c=h[e],l=p[e];r="";var d=this.clone();for(d.negative=0;!d.isZero();){var m=d.modrn(l).toString(e);r=(d=d.idivn(l)).isZero()?m+r:f[c-m.length]+m+r}for(this.isZero()&&(r="0"+r);r.length%t!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}n(!1,"Base should be between 2 and 36")},o.prototype.toNumber=function(){var e=this.words[0];return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},o.prototype.toJSON=function(){return this.toString(16,2)},s&&(o.prototype.toBuffer=function(e,t){return this.toArrayLike(s,e,t)}),o.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)};function m(e,t,r){r.negative=t.negative^e.negative;var n=e.length+t.length|0;r.length=n,n=n-1|0;var i=0|e.words[0],o=0|t.words[0],s=i*o,a=67108863&s,u=s/67108864|0;r.words[0]=a;for(var c=1;c<n;c++){for(var l=u>>>26,d=67108863&u,f=Math.min(c,t.length-1),h=Math.max(0,c-e.length+1);h<=f;h++){var p=c-h|0;l+=(s=(i=0|e.words[p])*(o=0|t.words[h])+d)/67108864|0,d=67108863&s}r.words[c]=0|d,u=0|l}return 0!==u?r.words[c]=0|u:r.length--,r._strip()}o.prototype.toArrayLike=function(e,t,r){this._strip();var i=this.byteLength(),o=r||Math.max(1,i);n(i<=o,"byte array longer than desired length"),n(o>0,"Requested array length <= 0");var s=function(e,t){return e.allocUnsafe?e.allocUnsafe(t):new e(t)}(e,o);return this["_toArrayLike"+("le"===t?"LE":"BE")](s,i),s},o.prototype._toArrayLikeLE=function(e,t){for(var r=0,n=0,i=0,o=0;i<this.length;i++){var s=this.words[i]<<o|n;e[r++]=255&s,r<e.length&&(e[r++]=s>>8&255),r<e.length&&(e[r++]=s>>16&255),6===o?(r<e.length&&(e[r++]=s>>24&255),n=0,o=0):(n=s>>>24,o+=2)}if(r<e.length)for(e[r++]=n;r<e.length;)e[r++]=0},o.prototype._toArrayLikeBE=function(e,t){for(var r=e.length-1,n=0,i=0,o=0;i<this.length;i++){var s=this.words[i]<<o|n;e[r--]=255&s,r>=0&&(e[r--]=s>>8&255),r>=0&&(e[r--]=s>>16&255),6===o?(r>=0&&(e[r--]=s>>24&255),n=0,o=0):(n=s>>>24,o+=2)}if(r>=0)for(e[r--]=n;r>=0;)e[r--]=0},Math.clz32?o.prototype._countBits=function(e){return 32-Math.clz32(e)}:o.prototype._countBits=function(e){var t=e,r=0;return t>=4096&&(r+=13,t>>>=13),t>=64&&(r+=7,t>>>=7),t>=8&&(r+=4,t>>>=4),t>=2&&(r+=2,t>>>=2),r+t},o.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,r=0;return 0==(8191&t)&&(r+=13,t>>>=13),0==(127&t)&&(r+=7,t>>>=7),0==(15&t)&&(r+=4,t>>>=4),0==(3&t)&&(r+=2,t>>>=2),0==(1&t)&&r++,r},o.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},o.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;t<this.length;t++){var r=this._zeroBits(this.words[t]);if(e+=r,26!==r)break}return e},o.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},o.prototype.toTwos=function(e){return 0!==this.negative?this.abs().inotn(e).iaddn(1):this.clone()},o.prototype.fromTwos=function(e){return this.testn(e-1)?this.notn(e).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(e){for(;this.length<e.length;)this.words[this.length++]=0;for(var t=0;t<e.length;t++)this.words[t]=this.words[t]|e.words[t];return this._strip()},o.prototype.ior=function(e){return n(0==(this.negative|e.negative)),this.iuor(e)},o.prototype.or=function(e){return this.length>e.length?this.clone().ior(e):e.clone().ior(this)},o.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},o.prototype.iuand=function(e){var t;t=this.length>e.length?e:this;for(var r=0;r<t.length;r++)this.words[r]=this.words[r]&e.words[r];return this.length=t.length,this._strip()},o.prototype.iand=function(e){return n(0==(this.negative|e.negative)),this.iuand(e)},o.prototype.and=function(e){return this.length>e.length?this.clone().iand(e):e.clone().iand(this)},o.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},o.prototype.iuxor=function(e){var t,r;this.length>e.length?(t=this,r=e):(t=e,r=this);for(var n=0;n<r.length;n++)this.words[n]=t.words[n]^r.words[n];if(this!==t)for(;n<t.length;n++)this.words[n]=t.words[n];return this.length=t.length,this._strip()},o.prototype.ixor=function(e){return n(0==(this.negative|e.negative)),this.iuxor(e)},o.prototype.xor=function(e){return this.length>e.length?this.clone().ixor(e):e.clone().ixor(this)},o.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},o.prototype.inotn=function(e){n("number"==typeof e&&e>=0);var t=0|Math.ceil(e/26),r=e%26;this._expand(t),r>0&&t--;for(var i=0;i<t;i++)this.words[i]=67108863&~this.words[i];return r>0&&(this.words[i]=~this.words[i]&67108863>>26-r),this._strip()},o.prototype.notn=function(e){return this.clone().inotn(e)},o.prototype.setn=function(e,t){n("number"==typeof e&&e>=0);var r=e/26|0,i=e%26;return this._expand(r+1),this.words[r]=t?this.words[r]|1<<i:this.words[r]&~(1<<i),this._strip()},o.prototype.iadd=function(e){var t,r,n;if(0!==this.negative&&0===e.negative)return this.negative=0,t=this.isub(e),this.negative^=1,this._normSign();if(0===this.negative&&0!==e.negative)return e.negative=0,t=this.isub(e),e.negative=1,t._normSign();this.length>e.length?(r=this,n=e):(r=e,n=this);for(var i=0,o=0;o<n.length;o++)t=(0|r.words[o])+(0|n.words[o])+i,this.words[o]=67108863&t,i=t>>>26;for(;0!==i&&o<r.length;o++)t=(0|r.words[o])+i,this.words[o]=67108863&t,i=t>>>26;if(this.length=r.length,0!==i)this.words[this.length]=i,this.length++;else if(r!==this)for(;o<r.length;o++)this.words[o]=r.words[o];return this},o.prototype.add=function(e){var t;return 0!==e.negative&&0===this.negative?(e.negative=0,t=this.sub(e),e.negative^=1,t):0===e.negative&&0!==this.negative?(this.negative=0,t=e.sub(this),this.negative=1,t):this.length>e.length?this.clone().iadd(e):e.clone().iadd(this)},o.prototype.isub=function(e){if(0!==e.negative){e.negative=0;var t=this.iadd(e);return e.negative=1,t._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var r,n,i=this.cmp(e);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(r=this,n=e):(r=e,n=this);for(var o=0,s=0;s<n.length;s++)o=(t=(0|r.words[s])-(0|n.words[s])+o)>>26,this.words[s]=67108863&t;for(;0!==o&&s<r.length;s++)o=(t=(0|r.words[s])+o)>>26,this.words[s]=67108863&t;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(e){return this.clone().isub(e)};var g=function(e,t,r){var n,i,o,s=e.words,a=t.words,u=r.words,c=0,l=0|s[0],d=8191&l,f=l>>>13,h=0|s[1],p=8191&h,m=h>>>13,g=0|s[2],y=8191&g,v=g>>>13,b=0|s[3],w=8191&b,M=b>>>13,_=0|s[4],O=8191&_,E=_>>>13,T=0|s[5],j=8191&T,k=T>>>13,x=0|s[6],S=8191&x,C=x>>>13,A=0|s[7],I=8191&A,D=A>>>13,P=0|s[8],N=8191&P,B=P>>>13,R=0|s[9],L=8191&R,$=R>>>13,U=0|a[0],F=8191&U,z=U>>>13,H=0|a[1],W=8191&H,V=H>>>13,Z=0|a[2],q=8191&Z,G=Z>>>13,K=0|a[3],X=8191&K,J=K>>>13,Y=0|a[4],Q=8191&Y,ee=Y>>>13,te=0|a[5],re=8191&te,ne=te>>>13,ie=0|a[6],oe=8191&ie,se=ie>>>13,ae=0|a[7],ue=8191&ae,ce=ae>>>13,le=0|a[8],de=8191&le,fe=le>>>13,he=0|a[9],pe=8191&he,me=he>>>13;r.negative=e.negative^t.negative,r.length=19;var ge=(c+(n=Math.imul(d,F))|0)+((8191&(i=(i=Math.imul(d,z))+Math.imul(f,F)|0))<<13)|0;c=((o=Math.imul(f,z))+(i>>>13)|0)+(ge>>>26)|0,ge&=67108863,n=Math.imul(p,F),i=(i=Math.imul(p,z))+Math.imul(m,F)|0,o=Math.imul(m,z);var ye=(c+(n=n+Math.imul(d,W)|0)|0)+((8191&(i=(i=i+Math.imul(d,V)|0)+Math.imul(f,W)|0))<<13)|0;c=((o=o+Math.imul(f,V)|0)+(i>>>13)|0)+(ye>>>26)|0,ye&=67108863,n=Math.imul(y,F),i=(i=Math.imul(y,z))+Math.imul(v,F)|0,o=Math.imul(v,z),n=n+Math.imul(p,W)|0,i=(i=i+Math.imul(p,V)|0)+Math.imul(m,W)|0,o=o+Math.imul(m,V)|0;var ve=(c+(n=n+Math.imul(d,q)|0)|0)+((8191&(i=(i=i+Math.imul(d,G)|0)+Math.imul(f,q)|0))<<13)|0;c=((o=o+Math.imul(f,G)|0)+(i>>>13)|0)+(ve>>>26)|0,ve&=67108863,n=Math.imul(w,F),i=(i=Math.imul(w,z))+Math.imul(M,F)|0,o=Math.imul(M,z),n=n+Math.imul(y,W)|0,i=(i=i+Math.imul(y,V)|0)+Math.imul(v,W)|0,o=o+Math.imul(v,V)|0,n=n+Math.imul(p,q)|0,i=(i=i+Math.imul(p,G)|0)+Math.imul(m,q)|0,o=o+Math.imul(m,G)|0;var be=(c+(n=n+Math.imul(d,X)|0)|0)+((8191&(i=(i=i+Math.imul(d,J)|0)+Math.imul(f,X)|0))<<13)|0;c=((o=o+Math.imul(f,J)|0)+(i>>>13)|0)+(be>>>26)|0,be&=67108863,n=Math.imul(O,F),i=(i=Math.imul(O,z))+Math.imul(E,F)|0,o=Math.imul(E,z),n=n+Math.imul(w,W)|0,i=(i=i+Math.imul(w,V)|0)+Math.imul(M,W)|0,o=o+Math.imul(M,V)|0,n=n+Math.imul(y,q)|0,i=(i=i+Math.imul(y,G)|0)+Math.imul(v,q)|0,o=o+Math.imul(v,G)|0,n=n+Math.imul(p,X)|0,i=(i=i+Math.imul(p,J)|0)+Math.imul(m,X)|0,o=o+Math.imul(m,J)|0;var we=(c+(n=n+Math.imul(d,Q)|0)|0)+((8191&(i=(i=i+Math.imul(d,ee)|0)+Math.imul(f,Q)|0))<<13)|0;c=((o=o+Math.imul(f,ee)|0)+(i>>>13)|0)+(we>>>26)|0,we&=67108863,n=Math.imul(j,F),i=(i=Math.imul(j,z))+Math.imul(k,F)|0,o=Math.imul(k,z),n=n+Math.imul(O,W)|0,i=(i=i+Math.imul(O,V)|0)+Math.imul(E,W)|0,o=o+Math.imul(E,V)|0,n=n+Math.imul(w,q)|0,i=(i=i+Math.imul(w,G)|0)+Math.imul(M,q)|0,o=o+Math.imul(M,G)|0,n=n+Math.imul(y,X)|0,i=(i=i+Math.imul(y,J)|0)+Math.imul(v,X)|0,o=o+Math.imul(v,J)|0,n=n+Math.imul(p,Q)|0,i=(i=i+Math.imul(p,ee)|0)+Math.imul(m,Q)|0,o=o+Math.imul(m,ee)|0;var Me=(c+(n=n+Math.imul(d,re)|0)|0)+((8191&(i=(i=i+Math.imul(d,ne)|0)+Math.imul(f,re)|0))<<13)|0;c=((o=o+Math.imul(f,ne)|0)+(i>>>13)|0)+(Me>>>26)|0,Me&=67108863,n=Math.imul(S,F),i=(i=Math.imul(S,z))+Math.imul(C,F)|0,o=Math.imul(C,z),n=n+Math.imul(j,W)|0,i=(i=i+Math.imul(j,V)|0)+Math.imul(k,W)|0,o=o+Math.imul(k,V)|0,n=n+Math.imul(O,q)|0,i=(i=i+Math.imul(O,G)|0)+Math.imul(E,q)|0,o=o+Math.imul(E,G)|0,n=n+Math.imul(w,X)|0,i=(i=i+Math.imul(w,J)|0)+Math.imul(M,X)|0,o=o+Math.imul(M,J)|0,n=n+Math.imul(y,Q)|0,i=(i=i+Math.imul(y,ee)|0)+Math.imul(v,Q)|0,o=o+Math.imul(v,ee)|0,n=n+Math.imul(p,re)|0,i=(i=i+Math.imul(p,ne)|0)+Math.imul(m,re)|0,o=o+Math.imul(m,ne)|0;var _e=(c+(n=n+Math.imul(d,oe)|0)|0)+((8191&(i=(i=i+Math.imul(d,se)|0)+Math.imul(f,oe)|0))<<13)|0;c=((o=o+Math.imul(f,se)|0)+(i>>>13)|0)+(_e>>>26)|0,_e&=67108863,n=Math.imul(I,F),i=(i=Math.imul(I,z))+Math.imul(D,F)|0,o=Math.imul(D,z),n=n+Math.imul(S,W)|0,i=(i=i+Math.imul(S,V)|0)+Math.imul(C,W)|0,o=o+Math.imul(C,V)|0,n=n+Math.imul(j,q)|0,i=(i=i+Math.imul(j,G)|0)+Math.imul(k,q)|0,o=o+Math.imul(k,G)|0,n=n+Math.imul(O,X)|0,i=(i=i+Math.imul(O,J)|0)+Math.imul(E,X)|0,o=o+Math.imul(E,J)|0,n=n+Math.imul(w,Q)|0,i=(i=i+Math.imul(w,ee)|0)+Math.imul(M,Q)|0,o=o+Math.imul(M,ee)|0,n=n+Math.imul(y,re)|0,i=(i=i+Math.imul(y,ne)|0)+Math.imul(v,re)|0,o=o+Math.imul(v,ne)|0,n=n+Math.imul(p,oe)|0,i=(i=i+Math.imul(p,se)|0)+Math.imul(m,oe)|0,o=o+Math.imul(m,se)|0;var Oe=(c+(n=n+Math.imul(d,ue)|0)|0)+((8191&(i=(i=i+Math.imul(d,ce)|0)+Math.imul(f,ue)|0))<<13)|0;c=((o=o+Math.imul(f,ce)|0)+(i>>>13)|0)+(Oe>>>26)|0,Oe&=67108863,n=Math.imul(N,F),i=(i=Math.imul(N,z))+Math.imul(B,F)|0,o=Math.imul(B,z),n=n+Math.imul(I,W)|0,i=(i=i+Math.imul(I,V)|0)+Math.imul(D,W)|0,o=o+Math.imul(D,V)|0,n=n+Math.imul(S,q)|0,i=(i=i+Math.imul(S,G)|0)+Math.imul(C,q)|0,o=o+Math.imul(C,G)|0,n=n+Math.imul(j,X)|0,i=(i=i+Math.imul(j,J)|0)+Math.imul(k,X)|0,o=o+Math.imul(k,J)|0,n=n+Math.imul(O,Q)|0,i=(i=i+Math.imul(O,ee)|0)+Math.imul(E,Q)|0,o=o+Math.imul(E,ee)|0,n=n+Math.imul(w,re)|0,i=(i=i+Math.imul(w,ne)|0)+Math.imul(M,re)|0,o=o+Math.imul(M,ne)|0,n=n+Math.imul(y,oe)|0,i=(i=i+Math.imul(y,se)|0)+Math.imul(v,oe)|0,o=o+Math.imul(v,se)|0,n=n+Math.imul(p,ue)|0,i=(i=i+Math.imul(p,ce)|0)+Math.imul(m,ue)|0,o=o+Math.imul(m,ce)|0;var Ee=(c+(n=n+Math.imul(d,de)|0)|0)+((8191&(i=(i=i+Math.imul(d,fe)|0)+Math.imul(f,de)|0))<<13)|0;c=((o=o+Math.imul(f,fe)|0)+(i>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,n=Math.imul(L,F),i=(i=Math.imul(L,z))+Math.imul($,F)|0,o=Math.imul($,z),n=n+Math.imul(N,W)|0,i=(i=i+Math.imul(N,V)|0)+Math.imul(B,W)|0,o=o+Math.imul(B,V)|0,n=n+Math.imul(I,q)|0,i=(i=i+Math.imul(I,G)|0)+Math.imul(D,q)|0,o=o+Math.imul(D,G)|0,n=n+Math.imul(S,X)|0,i=(i=i+Math.imul(S,J)|0)+Math.imul(C,X)|0,o=o+Math.imul(C,J)|0,n=n+Math.imul(j,Q)|0,i=(i=i+Math.imul(j,ee)|0)+Math.imul(k,Q)|0,o=o+Math.imul(k,ee)|0,n=n+Math.imul(O,re)|0,i=(i=i+Math.imul(O,ne)|0)+Math.imul(E,re)|0,o=o+Math.imul(E,ne)|0,n=n+Math.imul(w,oe)|0,i=(i=i+Math.imul(w,se)|0)+Math.imul(M,oe)|0,o=o+Math.imul(M,se)|0,n=n+Math.imul(y,ue)|0,i=(i=i+Math.imul(y,ce)|0)+Math.imul(v,ue)|0,o=o+Math.imul(v,ce)|0,n=n+Math.imul(p,de)|0,i=(i=i+Math.imul(p,fe)|0)+Math.imul(m,de)|0,o=o+Math.imul(m,fe)|0;var Te=(c+(n=n+Math.imul(d,pe)|0)|0)+((8191&(i=(i=i+Math.imul(d,me)|0)+Math.imul(f,pe)|0))<<13)|0;c=((o=o+Math.imul(f,me)|0)+(i>>>13)|0)+(Te>>>26)|0,Te&=67108863,n=Math.imul(L,W),i=(i=Math.imul(L,V))+Math.imul($,W)|0,o=Math.imul($,V),n=n+Math.imul(N,q)|0,i=(i=i+Math.imul(N,G)|0)+Math.imul(B,q)|0,o=o+Math.imul(B,G)|0,n=n+Math.imul(I,X)|0,i=(i=i+Math.imul(I,J)|0)+Math.imul(D,X)|0,o=o+Math.imul(D,J)|0,n=n+Math.imul(S,Q)|0,i=(i=i+Math.imul(S,ee)|0)+Math.imul(C,Q)|0,o=o+Math.imul(C,ee)|0,n=n+Math.imul(j,re)|0,i=(i=i+Math.imul(j,ne)|0)+Math.imul(k,re)|0,o=o+Math.imul(k,ne)|0,n=n+Math.imul(O,oe)|0,i=(i=i+Math.imul(O,se)|0)+Math.imul(E,oe)|0,o=o+Math.imul(E,se)|0,n=n+Math.imul(w,ue)|0,i=(i=i+Math.imul(w,ce)|0)+Math.imul(M,ue)|0,o=o+Math.imul(M,ce)|0,n=n+Math.imul(y,de)|0,i=(i=i+Math.imul(y,fe)|0)+Math.imul(v,de)|0,o=o+Math.imul(v,fe)|0;var je=(c+(n=n+Math.imul(p,pe)|0)|0)+((8191&(i=(i=i+Math.imul(p,me)|0)+Math.imul(m,pe)|0))<<13)|0;c=((o=o+Math.imul(m,me)|0)+(i>>>13)|0)+(je>>>26)|0,je&=67108863,n=Math.imul(L,q),i=(i=Math.imul(L,G))+Math.imul($,q)|0,o=Math.imul($,G),n=n+Math.imul(N,X)|0,i=(i=i+Math.imul(N,J)|0)+Math.imul(B,X)|0,o=o+Math.imul(B,J)|0,n=n+Math.imul(I,Q)|0,i=(i=i+Math.imul(I,ee)|0)+Math.imul(D,Q)|0,o=o+Math.imul(D,ee)|0,n=n+Math.imul(S,re)|0,i=(i=i+Math.imul(S,ne)|0)+Math.imul(C,re)|0,o=o+Math.imul(C,ne)|0,n=n+Math.imul(j,oe)|0,i=(i=i+Math.imul(j,se)|0)+Math.imul(k,oe)|0,o=o+Math.imul(k,se)|0,n=n+Math.imul(O,ue)|0,i=(i=i+Math.imul(O,ce)|0)+Math.imul(E,ue)|0,o=o+Math.imul(E,ce)|0,n=n+Math.imul(w,de)|0,i=(i=i+Math.imul(w,fe)|0)+Math.imul(M,de)|0,o=o+Math.imul(M,fe)|0;var ke=(c+(n=n+Math.imul(y,pe)|0)|0)+((8191&(i=(i=i+Math.imul(y,me)|0)+Math.imul(v,pe)|0))<<13)|0;c=((o=o+Math.imul(v,me)|0)+(i>>>13)|0)+(ke>>>26)|0,ke&=67108863,n=Math.imul(L,X),i=(i=Math.imul(L,J))+Math.imul($,X)|0,o=Math.imul($,J),n=n+Math.imul(N,Q)|0,i=(i=i+Math.imul(N,ee)|0)+Math.imul(B,Q)|0,o=o+Math.imul(B,ee)|0,n=n+Math.imul(I,re)|0,i=(i=i+Math.imul(I,ne)|0)+Math.imul(D,re)|0,o=o+Math.imul(D,ne)|0,n=n+Math.imul(S,oe)|0,i=(i=i+Math.imul(S,se)|0)+Math.imul(C,oe)|0,o=o+Math.imul(C,se)|0,n=n+Math.imul(j,ue)|0,i=(i=i+Math.imul(j,ce)|0)+Math.imul(k,ue)|0,o=o+Math.imul(k,ce)|0,n=n+Math.imul(O,de)|0,i=(i=i+Math.imul(O,fe)|0)+Math.imul(E,de)|0,o=o+Math.imul(E,fe)|0;var xe=(c+(n=n+Math.imul(w,pe)|0)|0)+((8191&(i=(i=i+Math.imul(w,me)|0)+Math.imul(M,pe)|0))<<13)|0;c=((o=o+Math.imul(M,me)|0)+(i>>>13)|0)+(xe>>>26)|0,xe&=67108863,n=Math.imul(L,Q),i=(i=Math.imul(L,ee))+Math.imul($,Q)|0,o=Math.imul($,ee),n=n+Math.imul(N,re)|0,i=(i=i+Math.imul(N,ne)|0)+Math.imul(B,re)|0,o=o+Math.imul(B,ne)|0,n=n+Math.imul(I,oe)|0,i=(i=i+Math.imul(I,se)|0)+Math.imul(D,oe)|0,o=o+Math.imul(D,se)|0,n=n+Math.imul(S,ue)|0,i=(i=i+Math.imul(S,ce)|0)+Math.imul(C,ue)|0,o=o+Math.imul(C,ce)|0,n=n+Math.imul(j,de)|0,i=(i=i+Math.imul(j,fe)|0)+Math.imul(k,de)|0,o=o+Math.imul(k,fe)|0;var Se=(c+(n=n+Math.imul(O,pe)|0)|0)+((8191&(i=(i=i+Math.imul(O,me)|0)+Math.imul(E,pe)|0))<<13)|0;c=((o=o+Math.imul(E,me)|0)+(i>>>13)|0)+(Se>>>26)|0,Se&=67108863,n=Math.imul(L,re),i=(i=Math.imul(L,ne))+Math.imul($,re)|0,o=Math.imul($,ne),n=n+Math.imul(N,oe)|0,i=(i=i+Math.imul(N,se)|0)+Math.imul(B,oe)|0,o=o+Math.imul(B,se)|0,n=n+Math.imul(I,ue)|0,i=(i=i+Math.imul(I,ce)|0)+Math.imul(D,ue)|0,o=o+Math.imul(D,ce)|0,n=n+Math.imul(S,de)|0,i=(i=i+Math.imul(S,fe)|0)+Math.imul(C,de)|0,o=o+Math.imul(C,fe)|0;var Ce=(c+(n=n+Math.imul(j,pe)|0)|0)+((8191&(i=(i=i+Math.imul(j,me)|0)+Math.imul(k,pe)|0))<<13)|0;c=((o=o+Math.imul(k,me)|0)+(i>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,n=Math.imul(L,oe),i=(i=Math.imul(L,se))+Math.imul($,oe)|0,o=Math.imul($,se),n=n+Math.imul(N,ue)|0,i=(i=i+Math.imul(N,ce)|0)+Math.imul(B,ue)|0,o=o+Math.imul(B,ce)|0,n=n+Math.imul(I,de)|0,i=(i=i+Math.imul(I,fe)|0)+Math.imul(D,de)|0,o=o+Math.imul(D,fe)|0;var Ae=(c+(n=n+Math.imul(S,pe)|0)|0)+((8191&(i=(i=i+Math.imul(S,me)|0)+Math.imul(C,pe)|0))<<13)|0;c=((o=o+Math.imul(C,me)|0)+(i>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,n=Math.imul(L,ue),i=(i=Math.imul(L,ce))+Math.imul($,ue)|0,o=Math.imul($,ce),n=n+Math.imul(N,de)|0,i=(i=i+Math.imul(N,fe)|0)+Math.imul(B,de)|0,o=o+Math.imul(B,fe)|0;var Ie=(c+(n=n+Math.imul(I,pe)|0)|0)+((8191&(i=(i=i+Math.imul(I,me)|0)+Math.imul(D,pe)|0))<<13)|0;c=((o=o+Math.imul(D,me)|0)+(i>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,n=Math.imul(L,de),i=(i=Math.imul(L,fe))+Math.imul($,de)|0,o=Math.imul($,fe);var De=(c+(n=n+Math.imul(N,pe)|0)|0)+((8191&(i=(i=i+Math.imul(N,me)|0)+Math.imul(B,pe)|0))<<13)|0;c=((o=o+Math.imul(B,me)|0)+(i>>>13)|0)+(De>>>26)|0,De&=67108863;var Pe=(c+(n=Math.imul(L,pe))|0)+((8191&(i=(i=Math.imul(L,me))+Math.imul($,pe)|0))<<13)|0;return c=((o=Math.imul($,me))+(i>>>13)|0)+(Pe>>>26)|0,Pe&=67108863,u[0]=ge,u[1]=ye,u[2]=ve,u[3]=be,u[4]=we,u[5]=Me,u[6]=_e,u[7]=Oe,u[8]=Ee,u[9]=Te,u[10]=je,u[11]=ke,u[12]=xe,u[13]=Se,u[14]=Ce,u[15]=Ae,u[16]=Ie,u[17]=De,u[18]=Pe,0!==c&&(u[19]=c,r.length++),r};function y(e,t,r){r.negative=t.negative^e.negative,r.length=e.length+t.length;for(var n=0,i=0,o=0;o<r.length-1;o++){var s=i;i=0;for(var a=67108863&n,u=Math.min(o,t.length-1),c=Math.max(0,o-e.length+1);c<=u;c++){var l=o-c,d=(0|e.words[l])*(0|t.words[c]),f=67108863&d;a=67108863&(f=f+a|0),i+=(s=(s=s+(d/67108864|0)|0)+(f>>>26)|0)>>>26,s&=67108863}r.words[o]=a,n=s,s=i}return 0!==n?r.words[o]=n:r.length--,r._strip()}function v(e,t,r){return y(e,t,r)}function b(e,t){this.x=e,this.y=t}Math.imul||(g=m),o.prototype.mulTo=function(e,t){var r=this.length+e.length;return 10===this.length&&10===e.length?g(this,e,t):r<63?m(this,e,t):r<1024?y(this,e,t):v(this,e,t)},b.prototype.makeRBT=function(e){for(var t=new Array(e),r=o.prototype._countBits(e)-1,n=0;n<e;n++)t[n]=this.revBin(n,r,e);return t},b.prototype.revBin=function(e,t,r){if(0===e||e===r-1)return e;for(var n=0,i=0;i<t;i++)n|=(1&e)<<t-i-1,e>>=1;return n},b.prototype.permute=function(e,t,r,n,i,o){for(var s=0;s<o;s++)n[s]=t[e[s]],i[s]=r[e[s]]},b.prototype.transform=function(e,t,r,n,i,o){this.permute(o,e,t,r,n,i);for(var s=1;s<i;s<<=1)for(var a=s<<1,u=Math.cos(2*Math.PI/a),c=Math.sin(2*Math.PI/a),l=0;l<i;l+=a)for(var d=u,f=c,h=0;h<s;h++){var p=r[l+h],m=n[l+h],g=r[l+h+s],y=n[l+h+s],v=d*g-f*y;y=d*y+f*g,g=v,r[l+h]=p+g,n[l+h]=m+y,r[l+h+s]=p-g,n[l+h+s]=m-y,h!==a&&(v=u*d-c*f,f=u*f+c*d,d=v)}},b.prototype.guessLen13b=function(e,t){var r=1|Math.max(t,e),n=1&r,i=0;for(r=r/2|0;r;r>>>=1)i++;return 1<<i+1+n},b.prototype.conjugate=function(e,t,r){if(!(r<=1))for(var n=0;n<r/2;n++){var i=e[n];e[n]=e[r-n-1],e[r-n-1]=i,i=t[n],t[n]=-t[r-n-1],t[r-n-1]=-i}},b.prototype.normalize13b=function(e,t){for(var r=0,n=0;n<t/2;n++){var i=8192*Math.round(e[2*n+1]/t)+Math.round(e[2*n]/t)+r;e[n]=67108863&i,r=i<67108864?0:i/67108864|0}return e},b.prototype.convert13b=function(e,t,r,i){for(var o=0,s=0;s<t;s++)o+=0|e[s],r[2*s]=8191&o,o>>>=13,r[2*s+1]=8191&o,o>>>=13;for(s=2*t;s<i;++s)r[s]=0;n(0===o),n(0==(-8192&o))},b.prototype.stub=function(e){for(var t=new Array(e),r=0;r<e;r++)t[r]=0;return t},b.prototype.mulp=function(e,t,r){var n=2*this.guessLen13b(e.length,t.length),i=this.makeRBT(n),o=this.stub(n),s=new Array(n),a=new Array(n),u=new Array(n),c=new Array(n),l=new Array(n),d=new Array(n),f=r.words;f.length=n,this.convert13b(e.words,e.length,s,n),this.convert13b(t.words,t.length,c,n),this.transform(s,o,a,u,n,i),this.transform(c,o,l,d,n,i);for(var h=0;h<n;h++){var p=a[h]*l[h]-u[h]*d[h];u[h]=a[h]*d[h]+u[h]*l[h],a[h]=p}return this.conjugate(a,u,n),this.transform(a,u,f,o,n,i),this.conjugate(f,o,n),this.normalize13b(f,n),r.negative=e.negative^t.negative,r.length=e.length+t.length,r._strip()},o.prototype.mul=function(e){var t=new o(null);return t.words=new Array(this.length+e.length),this.mulTo(e,t)},o.prototype.mulf=function(e){var t=new o(null);return t.words=new Array(this.length+e.length),v(this,e,t)},o.prototype.imul=function(e){return this.clone().mulTo(e,this)},o.prototype.imuln=function(e){var t=e<0;t&&(e=-e),n("number"==typeof e),n(e<67108864);for(var r=0,i=0;i<this.length;i++){var o=(0|this.words[i])*e,s=(67108863&o)+(67108863&r);r>>=26,r+=o/67108864|0,r+=s>>>26,this.words[i]=67108863&s}return 0!==r&&(this.words[i]=r,this.length++),t?this.ineg():this},o.prototype.muln=function(e){return this.clone().imuln(e)},o.prototype.sqr=function(){return this.mul(this)},o.prototype.isqr=function(){return this.imul(this.clone())},o.prototype.pow=function(e){var t=function(e){for(var t=new Array(e.bitLength()),r=0;r<t.length;r++){var n=r/26|0,i=r%26;t[r]=e.words[n]>>>i&1}return t}(e);if(0===t.length)return new o(1);for(var r=this,n=0;n<t.length&&0===t[n];n++,r=r.sqr());if(++n<t.length)for(var i=r.sqr();n<t.length;n++,i=i.sqr())0!==t[n]&&(r=r.mul(i));return r},o.prototype.iushln=function(e){n("number"==typeof e&&e>=0);var t,r=e%26,i=(e-r)/26,o=67108863>>>26-r<<26-r;if(0!==r){var s=0;for(t=0;t<this.length;t++){var a=this.words[t]&o,u=(0|this.words[t])-a<<r;this.words[t]=u|s,s=a>>>26-r}s&&(this.words[t]=s,this.length++)}if(0!==i){for(t=this.length-1;t>=0;t--)this.words[t+i]=this.words[t];for(t=0;t<i;t++)this.words[t]=0;this.length+=i}return this._strip()},o.prototype.ishln=function(e){return n(0===this.negative),this.iushln(e)},o.prototype.iushrn=function(e,t,r){var i;n("number"==typeof e&&e>=0),i=t?(t-t%26)/26:0;var o=e%26,s=Math.min((e-o)/26,this.length),a=67108863^67108863>>>o<<o,u=r;if(i-=s,i=Math.max(0,i),u){for(var c=0;c<s;c++)u.words[c]=this.words[c];u.length=s}if(0===s);else if(this.length>s)for(this.length-=s,c=0;c<this.length;c++)this.words[c]=this.words[c+s];else this.words[0]=0,this.length=1;var l=0;for(c=this.length-1;c>=0&&(0!==l||c>=i);c--){var d=0|this.words[c];this.words[c]=l<<26-o|d>>>o,l=d&a}return u&&0!==l&&(u.words[u.length++]=l),0===this.length&&(this.words[0]=0,this.length=1),this._strip()},o.prototype.ishrn=function(e,t,r){return n(0===this.negative),this.iushrn(e,t,r)},o.prototype.shln=function(e){return this.clone().ishln(e)},o.prototype.ushln=function(e){return this.clone().iushln(e)},o.prototype.shrn=function(e){return this.clone().ishrn(e)},o.prototype.ushrn=function(e){return this.clone().iushrn(e)},o.prototype.testn=function(e){n("number"==typeof e&&e>=0);var t=e%26,r=(e-t)/26,i=1<<t;return!(this.length<=r)&&!!(this.words[r]&i)},o.prototype.imaskn=function(e){n("number"==typeof e&&e>=0);var t=e%26,r=(e-t)/26;if(n(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==t&&r++,this.length=Math.min(r,this.length),0!==t){var i=67108863^67108863>>>t<<t;this.words[this.length-1]&=i}return this._strip()},o.prototype.maskn=function(e){return this.clone().imaskn(e)},o.prototype.iaddn=function(e){return n("number"==typeof e),n(e<67108864),e<0?this.isubn(-e):0!==this.negative?1===this.length&&(0|this.words[0])<=e?(this.words[0]=e-(0|this.words[0]),this.negative=0,this):(this.negative=0,this.isubn(e),this.negative=1,this):this._iaddn(e)},o.prototype._iaddn=function(e){this.words[0]+=e;for(var t=0;t<this.length&&this.words[t]>=67108864;t++)this.words[t]-=67108864,t===this.length-1?this.words[t+1]=1:this.words[t+1]++;return this.length=Math.max(this.length,t+1),this},o.prototype.isubn=function(e){if(n("number"==typeof e),n(e<67108864),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var t=0;t<this.length&&this.words[t]<0;t++)this.words[t]+=67108864,this.words[t+1]-=1;return this._strip()},o.prototype.addn=function(e){return this.clone().iaddn(e)},o.prototype.subn=function(e){return this.clone().isubn(e)},o.prototype.iabs=function(){return this.negative=0,this},o.prototype.abs=function(){return this.clone().iabs()},o.prototype._ishlnsubmul=function(e,t,r){var i,o,s=e.length+r;this._expand(s);var a=0;for(i=0;i<e.length;i++){o=(0|this.words[i+r])+a;var u=(0|e.words[i])*t;a=((o-=67108863&u)>>26)-(u/67108864|0),this.words[i+r]=67108863&o}for(;i<this.length-r;i++)a=(o=(0|this.words[i+r])+a)>>26,this.words[i+r]=67108863&o;if(0===a)return this._strip();for(n(-1===a),a=0,i=0;i<this.length;i++)a=(o=-(0|this.words[i])+a)>>26,this.words[i]=67108863&o;return this.negative=1,this._strip()},o.prototype._wordDiv=function(e,t){var r=(this.length,e.length),n=this.clone(),i=e,s=0|i.words[i.length-1];0!==(r=26-this._countBits(s))&&(i=i.ushln(r),n.iushln(r),s=0|i.words[i.length-1]);var a,u=n.length-i.length;if("mod"!==t){(a=new o(null)).length=u+1,a.words=new Array(a.length);for(var c=0;c<a.length;c++)a.words[c]=0}var l=n.clone()._ishlnsubmul(i,1,u);0===l.negative&&(n=l,a&&(a.words[u]=1));for(var d=u-1;d>=0;d--){var f=67108864*(0|n.words[i.length+d])+(0|n.words[i.length+d-1]);for(f=Math.min(f/s|0,67108863),n._ishlnsubmul(i,f,d);0!==n.negative;)f--,n.negative=0,n._ishlnsubmul(i,1,d),n.isZero()||(n.negative^=1);a&&(a.words[d]=f)}return a&&a._strip(),n._strip(),"div"!==t&&0!==r&&n.iushrn(r),{div:a||null,mod:n}},o.prototype.divmod=function(e,t,r){return n(!e.isZero()),this.isZero()?{div:new o(0),mod:new o(0)}:0!==this.negative&&0===e.negative?(a=this.neg().divmod(e,t),"mod"!==t&&(i=a.div.neg()),"div"!==t&&(s=a.mod.neg(),r&&0!==s.negative&&s.iadd(e)),{div:i,mod:s}):0===this.negative&&0!==e.negative?(a=this.divmod(e.neg(),t),"mod"!==t&&(i=a.div.neg()),{div:i,mod:a.mod}):0!=(this.negative&e.negative)?(a=this.neg().divmod(e.neg(),t),"div"!==t&&(s=a.mod.neg(),r&&0!==s.negative&&s.isub(e)),{div:a.div,mod:s}):e.length>this.length||this.cmp(e)<0?{div:new o(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new o(this.modrn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new o(this.modrn(e.words[0]))}:this._wordDiv(e,t);var i,s,a},o.prototype.div=function(e){return this.divmod(e,"div",!1).div},o.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},o.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},o.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var r=0!==t.div.negative?t.mod.isub(e):t.mod,n=e.ushrn(1),i=e.andln(1),o=r.cmp(n);return o<0||1===i&&0===o?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},o.prototype.modrn=function(e){var t=e<0;t&&(e=-e),n(e<=67108863);for(var r=(1<<26)%e,i=0,o=this.length-1;o>=0;o--)i=(r*i+(0|this.words[o]))%e;return t?-i:i},o.prototype.modn=function(e){return this.modrn(e)},o.prototype.idivn=function(e){var t=e<0;t&&(e=-e),n(e<=67108863);for(var r=0,i=this.length-1;i>=0;i--){var o=(0|this.words[i])+67108864*r;this.words[i]=o/e|0,r=o%e}return this._strip(),t?this.ineg():this},o.prototype.divn=function(e){return this.clone().idivn(e)},o.prototype.egcd=function(e){n(0===e.negative),n(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var i=new o(1),s=new o(0),a=new o(0),u=new o(1),c=0;t.isEven()&&r.isEven();)t.iushrn(1),r.iushrn(1),++c;for(var l=r.clone(),d=t.clone();!t.isZero();){for(var f=0,h=1;0==(t.words[0]&h)&&f<26;++f,h<<=1);if(f>0)for(t.iushrn(f);f-- >0;)(i.isOdd()||s.isOdd())&&(i.iadd(l),s.isub(d)),i.iushrn(1),s.iushrn(1);for(var p=0,m=1;0==(r.words[0]&m)&&p<26;++p,m<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(a.isOdd()||u.isOdd())&&(a.iadd(l),u.isub(d)),a.iushrn(1),u.iushrn(1);t.cmp(r)>=0?(t.isub(r),i.isub(a),s.isub(u)):(r.isub(t),a.isub(i),u.isub(s))}return{a:a,b:u,gcd:r.iushln(c)}},o.prototype._invmp=function(e){n(0===e.negative),n(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var i,s=new o(1),a=new o(0),u=r.clone();t.cmpn(1)>0&&r.cmpn(1)>0;){for(var c=0,l=1;0==(t.words[0]&l)&&c<26;++c,l<<=1);if(c>0)for(t.iushrn(c);c-- >0;)s.isOdd()&&s.iadd(u),s.iushrn(1);for(var d=0,f=1;0==(r.words[0]&f)&&d<26;++d,f<<=1);if(d>0)for(r.iushrn(d);d-- >0;)a.isOdd()&&a.iadd(u),a.iushrn(1);t.cmp(r)>=0?(t.isub(r),s.isub(a)):(r.isub(t),a.isub(s))}return(i=0===t.cmpn(1)?s:a).cmpn(0)<0&&i.iadd(e),i},o.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone(),r=e.clone();t.negative=0,r.negative=0;for(var n=0;t.isEven()&&r.isEven();n++)t.iushrn(1),r.iushrn(1);for(;;){for(;t.isEven();)t.iushrn(1);for(;r.isEven();)r.iushrn(1);var i=t.cmp(r);if(i<0){var o=t;t=r,r=o}else if(0===i||0===r.cmpn(1))break;t.isub(r)}return r.iushln(n)},o.prototype.invm=function(e){return this.egcd(e).a.umod(e)},o.prototype.isEven=function(){return 0==(1&this.words[0])},o.prototype.isOdd=function(){return 1==(1&this.words[0])},o.prototype.andln=function(e){return this.words[0]&e},o.prototype.bincn=function(e){n("number"==typeof e);var t=e%26,r=(e-t)/26,i=1<<t;if(this.length<=r)return this._expand(r+1),this.words[r]|=i,this;for(var o=i,s=r;0!==o&&s<this.length;s++){var a=0|this.words[s];o=(a+=o)>>>26,a&=67108863,this.words[s]=a}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(e){var t,r=e<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this._strip(),this.length>1)t=1;else{r&&(e=-e),n(e<=67108863,"Number is too big");var i=0|this.words[0];t=i===e?0:i<e?-1:1}return 0!==this.negative?0|-t:t},o.prototype.cmp=function(e){if(0!==this.negative&&0===e.negative)return-1;if(0===this.negative&&0!==e.negative)return 1;var t=this.ucmp(e);return 0!==this.negative?0|-t:t},o.prototype.ucmp=function(e){if(this.length>e.length)return 1;if(this.length<e.length)return-1;for(var t=0,r=this.length-1;r>=0;r--){var n=0|this.words[r],i=0|e.words[r];if(n!==i){n<i?t=-1:n>i&&(t=1);break}}return t},o.prototype.gtn=function(e){return 1===this.cmpn(e)},o.prototype.gt=function(e){return 1===this.cmp(e)},o.prototype.gten=function(e){return this.cmpn(e)>=0},o.prototype.gte=function(e){return this.cmp(e)>=0},o.prototype.ltn=function(e){return-1===this.cmpn(e)},o.prototype.lt=function(e){return-1===this.cmp(e)},o.prototype.lten=function(e){return this.cmpn(e)<=0},o.prototype.lte=function(e){return this.cmp(e)<=0},o.prototype.eqn=function(e){return 0===this.cmpn(e)},o.prototype.eq=function(e){return 0===this.cmp(e)},o.red=function(e){return new j(e)},o.prototype.toRed=function(e){return n(!this.red,"Already a number in reduction context"),n(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},o.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},o.prototype._forceRed=function(e){return this.red=e,this},o.prototype.forceRed=function(e){return n(!this.red,"Already a number in reduction context"),this._forceRed(e)},o.prototype.redAdd=function(e){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},o.prototype.redIAdd=function(e){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},o.prototype.redSub=function(e){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},o.prototype.redISub=function(e){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},o.prototype.redShl=function(e){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},o.prototype.redMul=function(e){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},o.prototype.redIMul=function(e){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},o.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},o.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},o.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},o.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},o.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},o.prototype.redPow=function(e){return n(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var w={k256:null,p224:null,p192:null,p25519:null};function M(e,t){this.name=e,this.p=new o(t,16),this.n=this.p.bitLength(),this.k=new o(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function _(){M.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function O(){M.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function E(){M.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function T(){M.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function j(e){if("string"==typeof e){var t=o._prime(e);this.m=t.p,this.prime=t}else n(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function k(e){j.call(this,e),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new o(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}M.prototype._tmp=function(){var e=new o(null);return e.words=new Array(Math.ceil(this.n/13)),e},M.prototype.ireduce=function(e){var t,r=e;do{this.split(r,this.tmp),t=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(t>this.n);var n=t<this.n?-1:r.ucmp(this.p);return 0===n?(r.words[0]=0,r.length=1):n>0?r.isub(this.p):r.strip!==undefined?r.strip():r._strip(),r},M.prototype.split=function(e,t){e.iushrn(this.n,0,t)},M.prototype.imulK=function(e){return e.imul(this.k)},i(_,M),_.prototype.split=function(e,t){for(var r=4194303,n=Math.min(e.length,9),i=0;i<n;i++)t.words[i]=e.words[i];if(t.length=n,e.length<=9)return e.words[0]=0,void(e.length=1);var o=e.words[9];for(t.words[t.length++]=o&r,i=10;i<e.length;i++){var s=0|e.words[i];e.words[i-10]=(s&r)<<4|o>>>22,o=s}o>>>=22,e.words[i-10]=o,0===o&&e.length>10?e.length-=10:e.length-=9},_.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var t=0,r=0;r<e.length;r++){var n=0|e.words[r];t+=977*n,e.words[r]=67108863&t,t=64*n+(t/67108864|0)}return 0===e.words[e.length-1]&&(e.length--,0===e.words[e.length-1]&&e.length--),e},i(O,M),i(E,M),i(T,M),T.prototype.imulK=function(e){for(var t=0,r=0;r<e.length;r++){var n=19*(0|e.words[r])+t,i=67108863&n;n>>>=26,e.words[r]=i,t=n}return 0!==t&&(e.words[e.length++]=t),e},o._prime=function(e){if(w[e])return w[e];var t;if("k256"===e)t=new _;else if("p224"===e)t=new O;else if("p192"===e)t=new E;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new T}return w[e]=t,t},j.prototype._verify1=function(e){n(0===e.negative,"red works only with positives"),n(e.red,"red works only with red numbers")},j.prototype._verify2=function(e,t){n(0==(e.negative|t.negative),"red works only with positives"),n(e.red&&e.red===t.red,"red works only with red numbers")},j.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):(l(e,e.umod(this.m)._forceRed(this)),e)},j.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},j.prototype.add=function(e,t){this._verify2(e,t);var r=e.add(t);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},j.prototype.iadd=function(e,t){this._verify2(e,t);var r=e.iadd(t);return r.cmp(this.m)>=0&&r.isub(this.m),r},j.prototype.sub=function(e,t){this._verify2(e,t);var r=e.sub(t);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},j.prototype.isub=function(e,t){this._verify2(e,t);var r=e.isub(t);return r.cmpn(0)<0&&r.iadd(this.m),r},j.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},j.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},j.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},j.prototype.isqr=function(e){return this.imul(e,e.clone())},j.prototype.sqr=function(e){return this.mul(e,e)},j.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(n(t%2==1),3===t){var r=this.m.add(new o(1)).iushrn(2);return this.pow(e,r)}for(var i=this.m.subn(1),s=0;!i.isZero()&&0===i.andln(1);)s++,i.iushrn(1);n(!i.isZero());var a=new o(1).toRed(this),u=a.redNeg(),c=this.m.subn(1).iushrn(1),l=this.m.bitLength();for(l=new o(2*l*l).toRed(this);0!==this.pow(l,c).cmp(u);)l.redIAdd(u);for(var d=this.pow(l,i),f=this.pow(e,i.addn(1).iushrn(1)),h=this.pow(e,i),p=s;0!==h.cmp(a);){for(var m=h,g=0;0!==m.cmp(a);g++)m=m.redSqr();n(g<p);var y=this.pow(d,new o(1).iushln(p-g-1));f=f.redMul(y),d=y.redSqr(),h=h.redMul(d),p=g}return f},j.prototype.invm=function(e){var t=e._invmp(this.m);return 0!==t.negative?(t.negative=0,this.imod(t).redNeg()):this.imod(t)},j.prototype.pow=function(e,t){if(t.isZero())return new o(1).toRed(this);if(0===t.cmpn(1))return e.clone();var r=new Array(16);r[0]=new o(1).toRed(this),r[1]=e;for(var n=2;n<r.length;n++)r[n]=this.mul(r[n-1],e);var i=r[0],s=0,a=0,u=t.bitLength()%26;for(0===u&&(u=26),n=t.length-1;n>=0;n--){for(var c=t.words[n],l=u-1;l>=0;l--){var d=c>>l&1;i!==r[0]&&(i=this.sqr(i)),0!==d||0!==s?(s<<=1,s|=d,(4===++a||0===n&&0===l)&&(i=this.mul(i,r[s]),a=0,s=0)):a=0}u=26}return i},j.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},j.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},o.mont=function(e){return new k(e)},i(k,j),k.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},k.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},k.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var r=e.imul(t),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),o=i;return i.cmp(this.m)>=0?o=i.isub(this.m):i.cmpn(0)<0&&(o=i.iadd(this.m)),o._forceRed(this)},k.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new o(0)._forceRed(this);var r=e.mul(t),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),s=i;return i.cmp(this.m)>=0?s=i.isub(this.m):i.cmpn(0)<0&&(s=i.iadd(this.m)),s._forceRed(this)},k.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(void 0===t||t,this)}}},{package:"@truffle/codec>bn.js",file:"node_modules/@truffle/codec/node_modules/bn.js/lib/bn.js"}],[1587,{yallist:3391},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){const n=e("yallist"),i=Symbol("max"),o=Symbol("length"),s=Symbol("lengthCalculator"),a=Symbol("allowStale"),u=Symbol("maxAge"),c=Symbol("dispose"),l=Symbol("noDisposeOnSet"),d=Symbol("lruList"),f=Symbol("cache"),h=Symbol("updateAgeOnGet"),p=()=>1;const m=(e,t,r)=>{const n=e[f].get(t);if(n){const t=n.value;if(g(e,t)){if(v(e,n),!e[a])return undefined}else r&&(e[h]&&(n.value.now=Date.now()),e[d].unshiftNode(n));return t.value}},g=(e,t)=>{if(!t||!t.maxAge&&!e[u])return!1;const r=Date.now()-t.now;return t.maxAge?r>t.maxAge:e[u]&&r>e[u]},y=e=>{if(e[o]>e[i])for(let t=e[d].tail;e[o]>e[i]&&null!==t;){const r=t.prev;v(e,t),t=r}},v=(e,t)=>{if(t){const r=t.value;e[c]&&e[c](r.key,r.value),e[o]-=r.length,e[f].delete(r.key),e[d].removeNode(t)}};class b{constructor(e,t,r,n,i){this.key=e,this.value=t,this.length=r,this.now=n,this.maxAge=i||0}}const w=(e,t,r,n)=>{let i=r.value;g(e,i)&&(v(e,r),e[a]||(i=undefined)),i&&t.call(n,i.value,i.key,e)};t.exports=class{constructor(e){if("number"==typeof e&&(e={max:e}),e||(e={}),e.max&&("number"!=typeof e.max||e.max<0))throw new TypeError("max must be a non-negative number");this[i]=e.max||Infinity;const t=e.length||p;if(this[s]="function"!=typeof t?p:t,this[a]=e.stale||!1,e.maxAge&&"number"!=typeof e.maxAge)throw new TypeError("maxAge must be a number");this[u]=e.maxAge||0,this[c]=e.dispose,this[l]=e.noDisposeOnSet||!1,this[h]=e.updateAgeOnGet||!1,this.reset()}set max(e){if("number"!=typeof e||e<0)throw new TypeError("max must be a non-negative number");this[i]=e||Infinity,y(this)}get max(){return this[i]}set allowStale(e){this[a]=!!e}get allowStale(){return this[a]}set maxAge(e){if("number"!=typeof e)throw new TypeError("maxAge must be a non-negative number");this[u]=e,y(this)}get maxAge(){return this[u]}set lengthCalculator(e){"function"!=typeof e&&(e=p),e!==this[s]&&(this[s]=e,this[o]=0,this[d].forEach((e=>{e.length=this[s](e.value,e.key),this[o]+=e.length}))),y(this)}get lengthCalculator(){return this[s]}get length(){return this[o]}get itemCount(){return this[d].length}rforEach(e,t){t=t||this;for(let r=this[d].tail;null!==r;){const n=r.prev;w(this,e,r,t),r=n}}forEach(e,t){t=t||this;for(let r=this[d].head;null!==r;){const n=r.next;w(this,e,r,t),r=n}}keys(){return this[d].toArray().map((e=>e.key))}values(){return this[d].toArray().map((e=>e.value))}reset(){this[c]&&this[d]&&this[d].length&&this[d].forEach((e=>this[c](e.key,e.value))),this[f]=new Map,this[d]=new n,this[o]=0}dump(){return this[d].map((e=>!g(this,e)&&{k:e.key,v:e.value,e:e.now+(e.maxAge||0)})).toArray().filter((e=>e))}dumpLru(){return this[d]}set(e,t,r){if((r=r||this[u])&&"number"!=typeof r)throw new TypeError("maxAge must be a number");const n=r?Date.now():0,a=this[s](t,e);if(this[f].has(e)){if(a>this[i])return v(this,this[f].get(e)),!1;const s=this[f].get(e).value;return this[c]&&(this[l]||this[c](e,s.value)),s.now=n,s.maxAge=r,s.value=t,this[o]+=a-s.length,s.length=a,this.get(e),y(this),!0}const h=new b(e,t,a,n,r);return h.length>this[i]?(this[c]&&this[c](e,t),!1):(this[o]+=h.length,this[d].unshift(h),this[f].set(e,this[d].head),y(this),!0)}has(e){if(!this[f].has(e))return!1;const t=this[f].get(e).value;return!g(this,t)}get(e){return m(this,e,!0)}peek(e){return m(this,e,!1)}pop(){const e=this[d].tail;return e?(v(this,e),e.value):null}del(e){v(this,this[f].get(e))}load(e){this.reset();const t=Date.now();for(let r=e.length-1;r>=0;r--){const n=e[r],i=n.e||0;if(0===i)this.set(n.k,n.v);else{const e=i-t;e>0&&this.set(n.k,n.v,e)}}}prune(){this[f].forEach(((e,t)=>m(this,t,!1)))}}}}},{package:"@truffle/codec>semver>lru-cache",file:"node_modules/@truffle/codec/node_modules/lru-cache/index.js"}],[1588,{"../functions/cmp":1592,"../internal/debug":1617,"../internal/parse-options":1619,"../internal/re":1620,"./range":1589,"./semver":1590},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){const n=Symbol("SemVer ANY");class i{static get ANY(){return n}constructor(e,t){if(t=o(t),e instanceof i){if(e.loose===!!t.loose)return e;e=e.value}c("comparator",e,t),this.options=t,this.loose=!!t.loose,this.parse(e),this.semver===n?this.value="":this.value=this.operator+this.semver.version,c("comp",this)}parse(e){const t=this.options.loose?s[a.COMPARATORLOOSE]:s[a.COMPARATOR],r=e.match(t);if(!r)throw new TypeError(`Invalid comparator: ${e}`);this.operator=r[1]!==undefined?r[1]:"","="===this.operator&&(this.operator=""),r[2]?this.semver=new l(r[2],this.options.loose):this.semver=n}toString(){return this.value}test(e){if(c("Comparator.test",e,this.options.loose),this.semver===n||e===n)return!0;if("string"==typeof e)try{e=new l(e,this.options)}catch(e){return!1}return u(e,this.operator,this.semver,this.options)}intersects(e,t){if(!(e instanceof i))throw new TypeError("a Comparator is required");if(t&&"object"==typeof t||(t={loose:!!t,includePrerelease:!1}),""===this.operator)return""===this.value||new d(e.value,t).test(this.value);if(""===e.operator)return""===e.value||new d(this.value,t).test(e.semver);const r=!(">="!==this.operator&&">"!==this.operator||">="!==e.operator&&">"!==e.operator),n=!("<="!==this.operator&&"<"!==this.operator||"<="!==e.operator&&"<"!==e.operator),o=this.semver.version===e.semver.version,s=!(">="!==this.operator&&"<="!==this.operator||">="!==e.operator&&"<="!==e.operator),a=u(this.semver,"<",e.semver,t)&&(">="===this.operator||">"===this.operator)&&("<="===e.operator||"<"===e.operator),c=u(this.semver,">",e.semver,t)&&("<="===this.operator||"<"===this.operator)&&(">="===e.operator||">"===e.operator);return r||n||o&&s||a||c}}t.exports=i;const o=e("../internal/parse-options"),{re:s,t:a}=e("../internal/re"),u=e("../functions/cmp"),c=e("../internal/debug"),l=e("./semver"),d=e("./range")}}},{package:"@truffle/codec>semver",file:"node_modules/@truffle/codec/node_modules/semver/classes/comparator.js"}],[1589,{"../internal/debug":1617,"../internal/parse-options":1619,"../internal/re":1620,"./comparator":1588,"./semver":1590,"lru-cache":1587},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){class n{constructor(e,t){if(t=o(t),e instanceof n)return e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease?e:new n(e.raw,t);if(e instanceof s)return this.raw=e.value,this.set=[[e]],this.format(),this;if(this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease,this.raw=e,this.set=e.split("||").map((e=>this.parseRange(e.trim()))).filter((e=>e.length)),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${e}`);if(this.set.length>1){const e=this.set[0];if(this.set=this.set.filter((e=>!p(e[0]))),0===this.set.length)this.set=[e];else if(this.set.length>1)for(const e of this.set)if(1===e.length&&m(e[0])){this.set=[e];break}}this.format()}format(){return this.range=this.set.map((e=>e.join(" ").trim())).join("||").trim(),this.range}toString(){return this.range}parseRange(e){e=e.trim();const t=`parseRange:${Object.keys(this.options).join(",")}:${e}`,r=i.get(t);if(r)return r;const n=this.options.loose,o=n?c[l.HYPHENRANGELOOSE]:c[l.HYPHENRANGE];e=e.replace(o,k(this.options.includePrerelease)),a("hyphen replace",e),e=e.replace(c[l.COMPARATORTRIM],d),a("comparator trim",e);let u=(e=(e=(e=e.replace(c[l.TILDETRIM],f)).replace(c[l.CARETTRIM],h)).split(/\s+/).join(" ")).split(" ").map((e=>y(e,this.options))).join(" ").split(/\s+/).map((e=>j(e,this.options)));n&&(u=u.filter((e=>(a("loose invalid filter",e,this.options),!!e.match(c[l.COMPARATORLOOSE]))))),a("range list",u);const m=new Map,g=u.map((e=>new s(e,this.options)));for(const e of g){if(p(e))return[e];m.set(e.value,e)}m.size>1&&m.has("")&&m.delete("");const v=[...m.values()];return i.set(t,v),v}intersects(e,t){if(!(e instanceof n))throw new TypeError("a Range is required");return this.set.some((r=>g(r,t)&&e.set.some((e=>g(e,t)&&r.every((r=>e.every((e=>r.intersects(e,t)))))))))}test(e){if(!e)return!1;if("string"==typeof e)try{e=new u(e,this.options)}catch(e){return!1}for(let t=0;t<this.set.length;t++)if(x(this.set[t],e,this.options))return!0;return!1}}t.exports=n;const i=new(e("lru-cache"))({max:1e3}),o=e("../internal/parse-options"),s=e("./comparator"),a=e("../internal/debug"),u=e("./semver"),{re:c,t:l,comparatorTrimReplace:d,tildeTrimReplace:f,caretTrimReplace:h}=e("../internal/re"),p=e=>"<0.0.0-0"===e.value,m=e=>""===e.value,g=(e,t)=>{let r=!0;const n=e.slice();let i=n.pop();for(;r&&n.length;)r=n.every((e=>i.intersects(e,t))),i=n.pop();return r},y=(e,t)=>(a("comp",e,t),e=M(e,t),a("caret",e),e=b(e,t),a("tildes",e),e=O(e,t),a("xrange",e),e=T(e,t),a("stars",e),e),v=e=>!e||"x"===e.toLowerCase()||"*"===e,b=(e,t)=>e.trim().split(/\s+/).map((e=>w(e,t))).join(" "),w=(e,t)=>{const r=t.loose?c[l.TILDELOOSE]:c[l.TILDE];return e.replace(r,((t,r,n,i,o)=>{let s;return a("tilde",e,t,r,n,i,o),v(r)?s="":v(n)?s=`>=${r}.0.0 <${+r+1}.0.0-0`:v(i)?s=`>=${r}.${n}.0 <${r}.${+n+1}.0-0`:o?(a("replaceTilde pr",o),s=`>=${r}.${n}.${i}-${o} <${r}.${+n+1}.0-0`):s=`>=${r}.${n}.${i} <${r}.${+n+1}.0-0`,a("tilde return",s),s}))},M=(e,t)=>e.trim().split(/\s+/).map((e=>_(e,t))).join(" "),_=(e,t)=>{a("caret",e,t);const r=t.loose?c[l.CARETLOOSE]:c[l.CARET],n=t.includePrerelease?"-0":"";return e.replace(r,((t,r,i,o,s)=>{let u;return a("caret",e,t,r,i,o,s),v(r)?u="":v(i)?u=`>=${r}.0.0${n} <${+r+1}.0.0-0`:v(o)?u="0"===r?`>=${r}.${i}.0${n} <${r}.${+i+1}.0-0`:`>=${r}.${i}.0${n} <${+r+1}.0.0-0`:s?(a("replaceCaret pr",s),u="0"===r?"0"===i?`>=${r}.${i}.${o}-${s} <${r}.${i}.${+o+1}-0`:`>=${r}.${i}.${o}-${s} <${r}.${+i+1}.0-0`:`>=${r}.${i}.${o}-${s} <${+r+1}.0.0-0`):(a("no pr"),u="0"===r?"0"===i?`>=${r}.${i}.${o}${n} <${r}.${i}.${+o+1}-0`:`>=${r}.${i}.${o}${n} <${r}.${+i+1}.0-0`:`>=${r}.${i}.${o} <${+r+1}.0.0-0`),a("caret return",u),u}))},O=(e,t)=>(a("replaceXRanges",e,t),e.split(/\s+/).map((e=>E(e,t))).join(" ")),E=(e,t)=>{e=e.trim();const r=t.loose?c[l.XRANGELOOSE]:c[l.XRANGE];return e.replace(r,((r,n,i,o,s,u)=>{a("xRange",e,r,n,i,o,s,u);const c=v(i),l=c||v(o),d=l||v(s),f=d;return"="===n&&f&&(n=""),u=t.includePrerelease?"-0":"",c?r=">"===n||"<"===n?"<0.0.0-0":"*":n&&f?(l&&(o=0),s=0,">"===n?(n=">=",l?(i=+i+1,o=0,s=0):(o=+o+1,s=0)):"<="===n&&(n="<",l?i=+i+1:o=+o+1),"<"===n&&(u="-0"),r=`${n+i}.${o}.${s}${u}`):l?r=`>=${i}.0.0${u} <${+i+1}.0.0-0`:d&&(r=`>=${i}.${o}.0${u} <${i}.${+o+1}.0-0`),a("xRange return",r),r}))},T=(e,t)=>(a("replaceStars",e,t),e.trim().replace(c[l.STAR],"")),j=(e,t)=>(a("replaceGTE0",e,t),e.trim().replace(c[t.includePrerelease?l.GTE0PRE:l.GTE0],"")),k=e=>(t,r,n,i,o,s,a,u,c,l,d,f,h)=>`${r=v(n)?"":v(i)?`>=${n}.0.0${e?"-0":""}`:v(o)?`>=${n}.${i}.0${e?"-0":""}`:s?`>=${r}`:`>=${r}${e?"-0":""}`} ${u=v(c)?"":v(l)?`<${+c+1}.0.0-0`:v(d)?`<${c}.${+l+1}.0-0`:f?`<=${c}.${l}.${d}-${f}`:e?`<${c}.${l}.${+d+1}-0`:`<=${u}`}`.trim(),x=(e,t,r)=>{for(let r=0;r<e.length;r++)if(!e[r].test(t))return!1;if(t.prerelease.length&&!r.includePrerelease){for(let r=0;r<e.length;r++)if(a(e[r].semver),e[r].semver!==s.ANY&&e[r].semver.prerelease.length>0){const n=e[r].semver;if(n.major===t.major&&n.minor===t.minor&&n.patch===t.patch)return!0}return!1}return!0}}}},{package:"@truffle/codec>semver",file:"node_modules/@truffle/codec/node_modules/semver/classes/range.js"}],[1590,{"../internal/constants":1616,"../internal/debug":1617,"../internal/identifiers":1618,"../internal/parse-options":1619,"../internal/re":1620},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){const n=e("../internal/debug"),{MAX_LENGTH:i,MAX_SAFE_INTEGER:o}=e("../internal/constants"),{re:s,t:a}=e("../internal/re"),u=e("../internal/parse-options"),{compareIdentifiers:c}=e("../internal/identifiers");class l{constructor(e,t){if(t=u(t),e instanceof l){if(e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease)return e;e=e.version}else if("string"!=typeof e)throw new TypeError(`Invalid Version: ${e}`);if(e.length>i)throw new TypeError(`version is longer than ${i} characters`);n("SemVer",e,t),this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease;const r=e.trim().match(t.loose?s[a.LOOSE]:s[a.FULL]);if(!r)throw new TypeError(`Invalid Version: ${e}`);if(this.raw=e,this.major=+r[1],this.minor=+r[2],this.patch=+r[3],this.major>o||this.major<0)throw new TypeError("Invalid major version");if(this.minor>o||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>o||this.patch<0)throw new TypeError("Invalid patch version");r[4]?this.prerelease=r[4].split(".").map((e=>{if(/^[0-9]+$/.test(e)){const t=+e;if(t>=0&&t<o)return t}return e})):this.prerelease=[],this.build=r[5]?r[5].split("."):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(".")}`),this.version}toString(){return this.version}compare(e){if(n("SemVer.compare",this.version,this.options,e),!(e instanceof l)){if("string"==typeof e&&e===this.version)return 0;e=new l(e,this.options)}return e.version===this.version?0:this.compareMain(e)||this.comparePre(e)}compareMain(e){return e instanceof l||(e=new l(e,this.options)),c(this.major,e.major)||c(this.minor,e.minor)||c(this.patch,e.patch)}comparePre(e){if(e instanceof l||(e=new l(e,this.options)),this.prerelease.length&&!e.prerelease.length)return-1;if(!this.prerelease.length&&e.prerelease.length)return 1;if(!this.prerelease.length&&!e.prerelease.length)return 0;let t=0;do{const r=this.prerelease[t],i=e.prerelease[t];if(n("prerelease compare",t,r,i),r===undefined&&i===undefined)return 0;if(i===undefined)return 1;if(r===undefined)return-1;if(r!==i)return c(r,i)}while(++t)}compareBuild(e){e instanceof l||(e=new l(e,this.options));let t=0;do{const r=this.build[t],i=e.build[t];if(n("prerelease compare",t,r,i),r===undefined&&i===undefined)return 0;if(i===undefined)return 1;if(r===undefined)return-1;if(r!==i)return c(r,i)}while(++t)}inc(e,t){switch(e){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",t);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",t);break;case"prepatch":this.prerelease.length=0,this.inc("patch",t),this.inc("pre",t);break;case"prerelease":0===this.prerelease.length&&this.inc("patch",t),this.inc("pre",t);break;case"major":0===this.minor&&0===this.patch&&0!==this.prerelease.length||this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":0===this.patch&&0!==this.prerelease.length||this.minor++,this.patch=0,this.prerelease=[];break;case"patch":0===this.prerelease.length&&this.patch++,this.prerelease=[];break;case"pre":if(0===this.prerelease.length)this.prerelease=[0];else{let e=this.prerelease.length;for(;--e>=0;)"number"==typeof this.prerelease[e]&&(this.prerelease[e]++,e=-2);-1===e&&this.prerelease.push(0)}t&&(0===c(this.prerelease[0],t)?isNaN(this.prerelease[1])&&(this.prerelease=[t,0]):this.prerelease=[t,0]);break;default:throw new Error(`invalid increment argument: ${e}`)}return this.format(),this.raw=this.version,this}}t.exports=l}}},{package:"@truffle/codec>semver",file:"node_modules/@truffle/codec/node_modules/semver/classes/semver.js"}],[1591,{"./parse":1607},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){const n=e("./parse");t.exports=(e,t)=>{const r=n(e.trim().replace(/^[=v]+/,""),t);return r?r.version:null}}}},{package:"@truffle/codec>semver",file:"node_modules/@truffle/codec/node_modules/semver/functions/clean.js"}],[1592,{"./eq":1598,"./gt":1599,"./gte":1600,"./lt":1602,"./lte":1603,"./neq":1606},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){const n=e("./eq"),i=e("./neq"),o=e("./gt"),s=e("./gte"),a=e("./lt"),u=e("./lte");t.exports=(e,t,r,c)=>{switch(t){case"===":return"object"==typeof e&&(e=e.version),"object"==typeof r&&(r=r.version),e===r;case"!==":return"object"==typeof e&&(e=e.version),"object"==typeof r&&(r=r.version),e!==r;case"":case"=":case"==":return n(e,r,c);case"!=":return i(e,r,c);case">":return o(e,r,c);case">=":return s(e,r,c);case"<":return a(e,r,c);case"<=":return u(e,r,c);default:throw new TypeError(`Invalid operator: ${t}`)}}}}},{package:"@truffle/codec>semver",file:"node_modules/@truffle/codec/node_modules/semver/functions/cmp.js"}],[1593,{"../classes/semver":1590,"../internal/re":1620,"./parse":1607},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){const n=e("../classes/semver"),i=e("./parse"),{re:o,t:s}=e("../internal/re");t.exports=(e,t)=>{if(e instanceof n)return e;if("number"==typeof e&&(e=String(e)),"string"!=typeof e)return null;let r=null;if((t=t||{}).rtl){let t;for(;(t=o[s.COERCERTL].exec(e))&&(!r||r.index+r[0].length!==e.length);)r&&t.index+t[0].length===r.index+r[0].length||(r=t),o[s.COERCERTL].lastIndex=t.index+t[1].length+t[2].length;o[s.COERCERTL].lastIndex=-1}else r=e.match(o[s.COERCE]);return null===r?null:i(`${r[2]}.${r[3]||"0"}.${r[4]||"0"}`,t)}}}},{package:"@truffle/codec>semver",file:"node_modules/@truffle/codec/node_modules/semver/functions/coerce.js"}],[1594,{"../classes/semver":1590},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){const n=e("../classes/semver");t.exports=(e,t,r)=>{const i=new n(e,r),o=new n(t,r);return i.compare(o)||i.compareBuild(o)}}}},{package:"@truffle/codec>semver",file:"node_modules/@truffle/codec/node_modules/semver/functions/compare-build.js"}],[1595,{"./compare":1596},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){const n=e("./compare");t.exports=(e,t)=>n(e,t,!0)}}},{package:"@truffle/codec>semver",file:"node_modules/@truffle/codec/node_modules/semver/functions/compare-loose.js"}],[1596,{"../classes/semver":1590},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){const n=e("../classes/semver");t.exports=(e,t,r)=>new n(e,r).compare(new n(t,r))}}},{package:"@truffle/codec>semver",file:"node_modules/@truffle/codec/node_modules/semver/functions/compare.js"}],[1597,{"./eq":1598,"./parse":1607},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){const n=e("./parse"),i=e("./eq");t.exports=(e,t)=>{if(i(e,t))return null;{const r=n(e),i=n(t),o=r.prerelease.length||i.prerelease.length,s=o?"pre":"",a=o?"prerelease":"";for(const e in r)if(("major"===e||"minor"===e||"patch"===e)&&r[e]!==i[e])return s+e;return a}}}}},{package:"@truffle/codec>semver",file:"node_modules/@truffle/codec/node_modules/semver/functions/diff.js"}],[1598,{"./compare":1596},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){const n=e("./compare");t.exports=(e,t,r)=>0===n(e,t,r)}}},{package:"@truffle/codec>semver",file:"node_modules/@truffle/codec/node_modules/semver/functions/eq.js"}],[1599,{"./compare":1596},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){const n=e("./compare");t.exports=(e,t,r)=>n(e,t,r)>0}}},{package:"@truffle/codec>semver",file:"node_modules/@truffle/codec/node_modules/semver/functions/gt.js"}],[1600,{"./compare":1596},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){const n=e("./compare");t.exports=(e,t,r)=>n(e,t,r)>=0}}},{package:"@truffle/codec>semver",file:"node_modules/@truffle/codec/node_modules/semver/functions/gte.js"}],[1601,{"../classes/semver":1590},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){const n=e("../classes/semver");t.exports=(e,t,r,i)=>{"string"==typeof r&&(i=r,r=undefined);try{return new n(e instanceof n?e.version:e,r).inc(t,i).version}catch(e){return null}}}}},{package:"@truffle/codec>semver",file:"node_modules/@truffle/codec/node_modules/semver/functions/inc.js"}],[1602,{"./compare":1596},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){const n=e("./compare");t.exports=(e,t,r)=>n(e,t,r)<0}}},{package:"@truffle/codec>semver",file:"node_modules/@truffle/codec/node_modules/semver/functions/lt.js"}],[1603,{"./compare":1596},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){const n=e("./compare");t.exports=(e,t,r)=>n(e,t,r)<=0}}},{package:"@truffle/codec>semver",file:"node_modules/@truffle/codec/node_modules/semver/functions/lte.js"}],[1604,{"../classes/semver":1590},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){const n=e("../classes/semver");t.exports=(e,t)=>new n(e,t).major}}},{package:"@truffle/codec>semver",file:"node_modules/@truffle/codec/node_modules/semver/functions/major.js"}],[1605,{"../classes/semver":1590},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){const n=e("../classes/semver");t.exports=(e,t)=>new n(e,t).minor}}},{package:"@truffle/codec>semver",file:"node_modules/@truffle/codec/node_modules/semver/functions/minor.js"}],[1606,{"./compare":1596},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){const n=e("./compare");t.exports=(e,t,r)=>0!==n(e,t,r)}}},{package:"@truffle/codec>semver",file:"node_modules/@truffle/codec/node_modules/semver/functions/neq.js"}],[1607,{"../classes/semver":1590,"../internal/constants":1616,"../internal/parse-options":1619,"../internal/re":1620},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){const{MAX_LENGTH:n}=e("../internal/constants"),{re:i,t:o}=e("../internal/re"),s=e("../classes/semver"),a=e("../internal/parse-options");t.exports=(e,t)=>{if(t=a(t),e instanceof s)return e;if("string"!=typeof e)return null;if(e.length>n)return null;if(!(t.loose?i[o.LOOSE]:i[o.FULL]).test(e))return null;try{return new s(e,t)}catch(e){return null}}}}},{package:"@truffle/codec>semver",file:"node_modules/@truffle/codec/node_modules/semver/functions/parse.js"}],[1608,{"../classes/semver":1590},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){const n=e("../classes/semver");t.exports=(e,t)=>new n(e,t).patch}}},{package:"@truffle/codec>semver",file:"node_modules/@truffle/codec/node_modules/semver/functions/patch.js"}],[1609,{"./parse":1607},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){const n=e("./parse");t.exports=(e,t)=>{const r=n(e,t);return r&&r.prerelease.length?r.prerelease:null}}}},{package:"@truffle/codec>semver",file:"node_modules/@truffle/codec/node_modules/semver/functions/prerelease.js"}],[1610,{"./compare":1596},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){const n=e("./compare");t.exports=(e,t,r)=>n(t,e,r)}}},{package:"@truffle/codec>semver",file:"node_modules/@truffle/codec/node_modules/semver/functions/rcompare.js"}],[1611,{"./compare-build":1594},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){const n=e("./compare-build");t.exports=(e,t)=>e.sort(((e,r)=>n(r,e,t)))}}},{package:"@truffle/codec>semver",file:"node_modules/@truffle/codec/node_modules/semver/functions/rsort.js"}],[1612,{"../classes/range":1589},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){const n=e("../classes/range");t.exports=(e,t,r)=>{try{t=new n(t,r)}catch(e){return!1}return t.test(e)}}}},{package:"@truffle/codec>semver",file:"node_modules/@truffle/codec/node_modules/semver/functions/satisfies.js"}],[1613,{"./compare-build":1594},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){const n=e("./compare-build");t.exports=(e,t)=>e.sort(((e,r)=>n(e,r,t)))}}},{package:"@truffle/codec>semver",file:"node_modules/@truffle/codec/node_modules/semver/functions/sort.js"}],[1614,{"./parse":1607},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){const n=e("./parse");t.exports=(e,t)=>{const r=n(e,t);return r?r.version:null}}}},{package:"@truffle/codec>semver",file:"node_modules/@truffle/codec/node_modules/semver/functions/valid.js"}],[1615,{"./classes/comparator":1588,"./classes/range":1589,"./classes/semver":1590,"./functions/clean":1591,"./functions/cmp":1592,"./functions/coerce":1593,"./functions/compare":1596,"./functions/compare-build":1594,"./functions/compare-loose":1595,"./functions/diff":1597,"./functions/eq":1598,"./functions/gt":1599,"./functions/gte":1600,"./functions/inc":1601,"./functions/lt":1602,"./functions/lte":1603,"./functions/major":1604,"./functions/minor":1605,"./functions/neq":1606,"./functions/parse":1607,"./functions/patch":1608,"./functions/prerelease":1609,"./functions/rcompare":1610,"./functions/rsort":1611,"./functions/satisfies":1612,"./functions/sort":1613,"./functions/valid":1614,"./internal/constants":1616,"./internal/identifiers":1618,"./internal/re":1620,"./ranges/gtr":1621,"./ranges/intersects":1622,"./ranges/ltr":1623,"./ranges/max-satisfying":1624,"./ranges/min-satisfying":1625,"./ranges/min-version":1626,"./ranges/outside":1627,"./ranges/simplify":1628,"./ranges/subset":1629,"./ranges/to-comparators":1630,"./ranges/valid":1631},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){const n=e("./internal/re");t.exports={re:n.re,src:n.src,tokens:n.t,SEMVER_SPEC_VERSION:e("./internal/constants").SEMVER_SPEC_VERSION,SemVer:e("./classes/semver"),compareIdentifiers:e("./internal/identifiers").compareIdentifiers,rcompareIdentifiers:e("./internal/identifiers").rcompareIdentifiers,parse:e("./functions/parse"),valid:e("./functions/valid"),clean:e("./functions/clean"),inc:e("./functions/inc"),diff:e("./functions/diff"),major:e("./functions/major"),minor:e("./functions/minor"),patch:e("./functions/patch"),prerelease:e("./functions/prerelease"),compare:e("./functions/compare"),rcompare:e("./functions/rcompare"),compareLoose:e("./functions/compare-loose"),compareBuild:e("./functions/compare-build"),sort:e("./functions/sort"),rsort:e("./functions/rsort"),gt:e("./functions/gt"),lt:e("./functions/lt"),eq:e("./functions/eq"),neq:e("./functions/neq"),gte:e("./functions/gte"),lte:e("./functions/lte"),cmp:e("./functions/cmp"),coerce:e("./functions/coerce"),Comparator:e("./classes/comparator"),Range:e("./classes/range"),satisfies:e("./functions/satisfies"),toComparators:e("./ranges/to-comparators"),maxSatisfying:e("./ranges/max-satisfying"),minSatisfying:e("./ranges/min-satisfying"),minVersion:e("./ranges/min-version"),validRange:e("./ranges/valid"),outside:e("./ranges/outside"),gtr:e("./ranges/gtr"),ltr:e("./ranges/ltr"),intersects:e("./ranges/intersects"),simplifyRange:e("./ranges/simplify"),subset:e("./ranges/subset")}}}},{package:"@truffle/codec>semver",file:"node_modules/@truffle/codec/node_modules/semver/index.js"}],[1616,{},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){const n=Number.MAX_SAFE_INTEGER||9007199254740991;t.exports={SEMVER_SPEC_VERSION:"2.0.0",MAX_LENGTH:256,MAX_SAFE_INTEGER:n,MAX_SAFE_COMPONENT_LENGTH:16}}}},{package:"@truffle/codec>semver",file:"node_modules/@truffle/codec/node_modules/semver/internal/constants.js"}],[1617,{_process:3027},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){(function(e){(function(){const r="object"==typeof e&&e.env&&e.env.NODE_DEBUG&&/\bsemver\b/i.test(e.env.NODE_DEBUG)?(...e)=>console.error("SEMVER",...e):()=>{};t.exports=r}).call(this)}).call(this,e("_process"))}}},{package:"@truffle/codec>semver",file:"node_modules/@truffle/codec/node_modules/semver/internal/debug.js"}],[1618,{},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){const n=/^[0-9]+$/,i=(e,t)=>{const r=n.test(e),i=n.test(t);return r&&i&&(e=+e,t=+t),e===t?0:r&&!i?-1:i&&!r?1:e<t?-1:1};t.exports={compareIdentifiers:i,rcompareIdentifiers:(e,t)=>i(t,e)}}}},{package:"@truffle/codec>semver",file:"node_modules/@truffle/codec/node_modules/semver/internal/identifiers.js"}],[1619,{},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){const n=["includePrerelease","loose","rtl"];t.exports=e=>e?"object"!=typeof e?{loose:!0}:n.filter((t=>e[t])).reduce(((e,t)=>(e[t]=!0,e)),{}):{}}}},{package:"@truffle/codec>semver",file:"node_modules/@truffle/codec/node_modules/semver/internal/parse-options.js"}],[1620,{"./constants":1616,"./debug":1617},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){const{MAX_SAFE_COMPONENT_LENGTH:n}=e("./constants"),i=e("./debug"),o=(r=t.exports={}).re=[],s=r.src=[],a=r.t={};let u=0;const c=(e,t,r)=>{const n=u++;i(e,n,t),a[e]=n,s[n]=t,o[n]=new RegExp(t,r?"g":undefined)};c("NUMERICIDENTIFIER","0|[1-9]\\d*"),c("NUMERICIDENTIFIERLOOSE","[0-9]+"),c("NONNUMERICIDENTIFIER","\\d*[a-zA-Z-][a-zA-Z0-9-]*"),c("MAINVERSION",`(${s[a.NUMERICIDENTIFIER]})\\.(${s[a.NUMERICIDENTIFIER]})\\.(${s[a.NUMERICIDENTIFIER]})`),c("MAINVERSIONLOOSE",`(${s[a.NUMERICIDENTIFIERLOOSE]})\\.(${s[a.NUMERICIDENTIFIERLOOSE]})\\.(${s[a.NUMERICIDENTIFIERLOOSE]})`),c("PRERELEASEIDENTIFIER",`(?:${s[a.NUMERICIDENTIFIER]}|${s[a.NONNUMERICIDENTIFIER]})`),c("PRERELEASEIDENTIFIERLOOSE",`(?:${s[a.NUMERICIDENTIFIERLOOSE]}|${s[a.NONNUMERICIDENTIFIER]})`),c("PRERELEASE",`(?:-(${s[a.PRERELEASEIDENTIFIER]}(?:\\.${s[a.PRERELEASEIDENTIFIER]})*))`),c("PRERELEASELOOSE",`(?:-?(${s[a.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${s[a.PRERELEASEIDENTIFIERLOOSE]})*))`),c("BUILDIDENTIFIER","[0-9A-Za-z-]+"),c("BUILD",`(?:\\+(${s[a.BUILDIDENTIFIER]}(?:\\.${s[a.BUILDIDENTIFIER]})*))`),c("FULLPLAIN",`v?${s[a.MAINVERSION]}${s[a.PRERELEASE]}?${s[a.BUILD]}?`),c("FULL",`^${s[a.FULLPLAIN]}$`),c("LOOSEPLAIN",`[v=\\s]*${s[a.MAINVERSIONLOOSE]}${s[a.PRERELEASELOOSE]}?${s[a.BUILD]}?`),c("LOOSE",`^${s[a.LOOSEPLAIN]}$`),c("GTLT","((?:<|>)?=?)"),c("XRANGEIDENTIFIERLOOSE",`${s[a.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),c("XRANGEIDENTIFIER",`${s[a.NUMERICIDENTIFIER]}|x|X|\\*`),c("XRANGEPLAIN",`[v=\\s]*(${s[a.XRANGEIDENTIFIER]})(?:\\.(${s[a.XRANGEIDENTIFIER]})(?:\\.(${s[a.XRANGEIDENTIFIER]})(?:${s[a.PRERELEASE]})?${s[a.BUILD]}?)?)?`),c("XRANGEPLAINLOOSE",`[v=\\s]*(${s[a.XRANGEIDENTIFIERLOOSE]})(?:\\.(${s[a.XRANGEIDENTIFIERLOOSE]})(?:\\.(${s[a.XRANGEIDENTIFIERLOOSE]})(?:${s[a.PRERELEASELOOSE]})?${s[a.BUILD]}?)?)?`),c("XRANGE",`^${s[a.GTLT]}\\s*${s[a.XRANGEPLAIN]}$`),c("XRANGELOOSE",`^${s[a.GTLT]}\\s*${s[a.XRANGEPLAINLOOSE]}$`),c("COERCE",`${"(^|[^\\d])"+"(\\d{1,"}${n}})(?:\\.(\\d{1,${n}}))?(?:\\.(\\d{1,${n}}))?(?:$|[^\\d])`),c("COERCERTL",s[a.COERCE],!0),c("LONETILDE","(?:~>?)"),c("TILDETRIM",`(\\s*)${s[a.LONETILDE]}\\s+`,!0),r.tildeTrimReplace="$1~",c("TILDE",`^${s[a.LONETILDE]}${s[a.XRANGEPLAIN]}$`),c("TILDELOOSE",`^${s[a.LONETILDE]}${s[a.XRANGEPLAINLOOSE]}$`),c("LONECARET","(?:\\^)"),c("CARETTRIM",`(\\s*)${s[a.LONECARET]}\\s+`,!0),r.caretTrimReplace="$1^",c("CARET",`^${s[a.LONECARET]}${s[a.XRANGEPLAIN]}$`),c("CARETLOOSE",`^${s[a.LONECARET]}${s[a.XRANGEPLAINLOOSE]}$`),c("COMPARATORLOOSE",`^${s[a.GTLT]}\\s*(${s[a.LOOSEPLAIN]})$|^$`),c("COMPARATOR",`^${s[a.GTLT]}\\s*(${s[a.FULLPLAIN]})$|^$`),c("COMPARATORTRIM",`(\\s*)${s[a.GTLT]}\\s*(${s[a.LOOSEPLAIN]}|${s[a.XRANGEPLAIN]})`,!0),r.comparatorTrimReplace="$1$2$3",c("HYPHENRANGE",`^\\s*(${s[a.XRANGEPLAIN]})\\s+-\\s+(${s[a.XRANGEPLAIN]})\\s*$`),c("HYPHENRANGELOOSE",`^\\s*(${s[a.XRANGEPLAINLOOSE]})\\s+-\\s+(${s[a.XRANGEPLAINLOOSE]})\\s*$`),c("STAR","(<|>)?=?\\s*\\*"),c("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),c("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")}}},{package:"@truffle/codec>semver",file:"node_modules/@truffle/codec/node_modules/semver/internal/re.js"}],[1621,{"./outside":1627},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){const n=e("./outside");t.exports=(e,t,r)=>n(e,t,">",r)}}},{package:"@truffle/codec>semver",file:"node_modules/@truffle/codec/node_modules/semver/ranges/gtr.js"}],[1622,{"../classes/range":1589},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){const n=e("../classes/range");t.exports=(e,t,r)=>(e=new n(e,r),t=new n(t,r),e.intersects(t))}}},{package:"@truffle/codec>semver",file:"node_modules/@truffle/codec/node_modules/semver/ranges/intersects.js"}],[1623,{"./outside":1627},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){const n=e("./outside");t.exports=(e,t,r)=>n(e,t,"<",r)}}},{package:"@truffle/codec>semver",file:"node_modules/@truffle/codec/node_modules/semver/ranges/ltr.js"}],[1624,{"../classes/range":1589,"../classes/semver":1590},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){const n=e("../classes/semver"),i=e("../classes/range");t.exports=(e,t,r)=>{let o=null,s=null,a=null;try{a=new i(t,r)}catch(e){return null}return e.forEach((e=>{a.test(e)&&(o&&-1!==s.compare(e)||(o=e,s=new n(o,r)))})),o}}}},{package:"@truffle/codec>semver",file:"node_modules/@truffle/codec/node_modules/semver/ranges/max-satisfying.js"}],[1625,{"../classes/range":1589,"../classes/semver":1590},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){const n=e("../classes/semver"),i=e("../classes/range");t.exports=(e,t,r)=>{let o=null,s=null,a=null;try{a=new i(t,r)}catch(e){return null}return e.forEach((e=>{a.test(e)&&(o&&1!==s.compare(e)||(o=e,s=new n(o,r)))})),o}}}},{package:"@truffle/codec>semver",file:"node_modules/@truffle/codec/node_modules/semver/ranges/min-satisfying.js"}],[1626,{"../classes/range":1589,"../classes/semver":1590,"../functions/gt":1599},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){const n=e("../classes/semver"),i=e("../classes/range"),o=e("../functions/gt");t.exports=(e,t)=>{e=new i(e,t);let r=new n("0.0.0");if(e.test(r))return r;if(r=new n("0.0.0-0"),e.test(r))return r;r=null;for(let t=0;t<e.set.length;++t){const i=e.set[t];let s=null;i.forEach((e=>{const t=new n(e.semver.version);switch(e.operator){case">":0===t.prerelease.length?t.patch++:t.prerelease.push(0),t.raw=t.format();case"":case">=":s&&!o(t,s)||(s=t);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${e.operator}`)}})),!s||r&&!o(r,s)||(r=s)}return r&&e.test(r)?r:null}}}},{package:"@truffle/codec>semver",file:"node_modules/@truffle/codec/node_modules/semver/ranges/min-version.js"}],[1627,{"../classes/comparator":1588,"../classes/range":1589,"../classes/semver":1590,"../functions/gt":1599,"../functions/gte":1600,"../functions/lt":1602,"../functions/lte":1603,"../functions/satisfies":1612},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){const n=e("../classes/semver"),i=e("../classes/comparator"),{ANY:o}=i,s=e("../classes/range"),a=e("../functions/satisfies"),u=e("../functions/gt"),c=e("../functions/lt"),l=e("../functions/lte"),d=e("../functions/gte");t.exports=(e,t,r,f)=>{let h,p,m,g,y;switch(e=new n(e,f),t=new s(t,f),r){case">":h=u,p=l,m=c,g=">",y=">=";break;case"<":h=c,p=d,m=u,g="<",y="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(a(e,t,f))return!1;for(let r=0;r<t.set.length;++r){const n=t.set[r];let s=null,a=null;if(n.forEach((e=>{e.semver===o&&(e=new i(">=0.0.0")),s=s||e,a=a||e,h(e.semver,s.semver,f)?s=e:m(e.semver,a.semver,f)&&(a=e)})),s.operator===g||s.operator===y)return!1;if((!a.operator||a.operator===g)&&p(e,a.semver))return!1;if(a.operator===y&&m(e,a.semver))return!1}return!0}}}},{package:"@truffle/codec>semver",file:"node_modules/@truffle/codec/node_modules/semver/ranges/outside.js"}],[1628,{"../functions/compare.js":1596,"../functions/satisfies.js":1612},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){const n=e("../functions/satisfies.js"),i=e("../functions/compare.js");t.exports=(e,t,r)=>{const o=[];let s=null,a=null;const u=e.sort(((e,t)=>i(e,t,r)));for(const e of u){n(e,t,r)?(a=e,s||(s=e)):(a&&o.push([s,a]),a=null,s=null)}s&&o.push([s,null]);const c=[];for(const[e,t]of o)e===t?c.push(e):t||e!==u[0]?t?e===u[0]?c.push(`<=${t}`):c.push(`${e} - ${t}`):c.push(`>=${e}`):c.push("*");const l=c.join(" || "),d="string"==typeof t.raw?t.raw:String(t);return l.length<d.length?l:t}}}},{package:"@truffle/codec>semver",file:"node_modules/@truffle/codec/node_modules/semver/ranges/simplify.js"}],[1629,{"../classes/comparator.js":1588,"../classes/range.js":1589,"../functions/compare.js":1596,"../functions/satisfies.js":1612},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){const n=e("../classes/range.js"),i=e("../classes/comparator.js"),{ANY:o}=i,s=e("../functions/satisfies.js"),a=e("../functions/compare.js"),u=(e,t,r)=>{if(e===t)return!0;if(1===e.length&&e[0].semver===o){if(1===t.length&&t[0].semver===o)return!0;e=r.includePrerelease?[new i(">=0.0.0-0")]:[new i(">=0.0.0")]}if(1===t.length&&t[0].semver===o){if(r.includePrerelease)return!0;t=[new i(">=0.0.0")]}const n=new Set;let u,d,f,h,p,m,g;for(const t of e)">"===t.operator||">="===t.operator?u=c(u,t,r):"<"===t.operator||"<="===t.operator?d=l(d,t,r):n.add(t.semver);if(n.size>1)return null;if(u&&d){if(f=a(u.semver,d.semver,r),f>0)return null;if(0===f&&(">="!==u.operator||"<="!==d.operator))return null}for(const e of n){if(u&&!s(e,String(u),r))return null;if(d&&!s(e,String(d),r))return null;for(const n of t)if(!s(e,String(n),r))return!1;return!0}let y=!(!d||r.includePrerelease||!d.semver.prerelease.length)&&d.semver,v=!(!u||r.includePrerelease||!u.semver.prerelease.length)&&u.semver;y&&1===y.prerelease.length&&"<"===d.operator&&0===y.prerelease[0]&&(y=!1);for(const e of t){if(g=g||">"===e.operator||">="===e.operator,m=m||"<"===e.operator||"<="===e.operator,u)if(v&&e.semver.prerelease&&e.semver.prerelease.length&&e.semver.major===v.major&&e.semver.minor===v.minor&&e.semver.patch===v.patch&&(v=!1),">"===e.operator||">="===e.operator){if(h=c(u,e,r),h===e&&h!==u)return!1}else if(">="===u.operator&&!s(u.semver,String(e),r))return!1;if(d)if(y&&e.semver.prerelease&&e.semver.prerelease.length&&e.semver.major===y.major&&e.semver.minor===y.minor&&e.semver.patch===y.patch&&(y=!1),"<"===e.operator||"<="===e.operator){if(p=l(d,e,r),p===e&&p!==d)return!1}else if("<="===d.operator&&!s(d.semver,String(e),r))return!1;if(!e.operator&&(d||u)&&0!==f)return!1}return!(u&&m&&!d&&0!==f)&&(!(d&&g&&!u&&0!==f)&&(!v&&!y))},c=(e,t,r)=>{if(!e)return t;const n=a(e.semver,t.semver,r);return n>0?e:n<0||">"===t.operator&&">="===e.operator?t:e},l=(e,t,r)=>{if(!e)return t;const n=a(e.semver,t.semver,r);return n<0?e:n>0||"<"===t.operator&&"<="===e.operator?t:e};t.exports=(e,t,r={})=>{if(e===t)return!0;e=new n(e,r),t=new n(t,r);let i=!1;e:for(const n of e.set){for(const e of t.set){const t=u(n,e,r);if(i=i||null!==t,t)continue e}if(i)return!1}return!0}}}},{package:"@truffle/codec>semver",file:"node_modules/@truffle/codec/node_modules/semver/ranges/subset.js"}],[1630,{"../classes/range":1589},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){const n=e("../classes/range");t.exports=(e,t)=>new n(e,t).set.map((e=>e.map((e=>e.value)).join(" ").trim().split(" ")))}}},{package:"@truffle/codec>semver",file:"node_modules/@truffle/codec/node_modules/semver/ranges/to-comparators.js"}],[1631,{"../classes/range":1589},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){const n=e("../classes/range");t.exports=(e,t)=>{try{return new n(e,t).range||"*"}catch(e){return null}}}}},{package:"@truffle/codec>semver",file:"node_modules/@truffle/codec/node_modules/semver/ranges/valid.js"}],[1632,{},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.emptyWorkflowCompileResult=r.promoteCompileResult=void 0,r.promoteCompileResult=function(e){const{compilations:t}=e,r=t.flatMap((e=>e.contracts));return{compilations:t,contracts:r}},r.emptyWorkflowCompileResult=function(){return{compilations:[],contracts:[]}}}}},{package:"@truffle/codec>@truffle/compile-common",file:"node_modules/@truffle/compile-common/dist/src/compilations.js"}],[1633,{"@truffle/error":1651,colors:1997},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(r,"__esModule",{value:!0}),r.CompileError=void 0;const i=n(e("colors")),o=n(e("@truffle/error"));class s extends o.default{constructor(e){var t=e.trim()+"\n\n"+i.default.red("Compilation failed. See above.");super(e.trim()),this.message=t}}r.CompileError=s}}},{package:"@truffle/codec>@truffle/compile-common",file:"node_modules/@truffle/compile-common/dist/src/errors.js"}],[1634,{"./compilations":1632,"./errors":1633,"./shims":1637,"./sources":1638,"./types":1639},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){n===undefined&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){n===undefined&&(n=r),e[n]=t[r]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&n(t,e,r);return i(t,e),t},s=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(r,"__esModule",{value:!0}),r.Compilations=r.Errors=r.Sources=r.Shims=void 0,r.Shims=o(e("./shims")),r.Sources=o(e("./sources")),r.Errors=o(e("./errors")),r.Compilations=o(e("./compilations")),s(e("./types"),r)}}},{package:"@truffle/codec>@truffle/compile-common",file:"node_modules/@truffle/compile-common/dist/src/index.js"}],[1635,{},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){function n(e){const{contractName:t,contract_name:r,sourcePath:n,source:o,sourceMap:s,deployedSourceMap:a,legacyAST:u,ast:c,abi:l,metadata:d,bytecode:f,deployedBytecode:h,compiler:p,devdoc:m,userdoc:g,immutableReferences:y,generatedSources:v,deployedGeneratedSources:b,db:w}=e;return{contractName:r||t,sourcePath:n,source:o,sourceMap:s,deployedSourceMap:a,legacyAST:u,ast:c,abi:l,metadata:d,bytecode:f?i(f):undefined,deployedBytecode:h?i(h):undefined,compiler:p,devdoc:m,userdoc:g,immutableReferences:y,generatedSources:v,deployedGeneratedSources:b,db:w}}function i(e){if("object"==typeof e)return e;const t=[];return{bytes:e.slice(2).replace(/__[^_]+_*/g,((e,r)=>{const n=e.match(/__([^_]+)_*/);if(null===n)throw new Error("Could not extract link reference name");const i=n[1],o=e.length,s=r/2,a=o/2;return t.push({offsets:[s],name:i,length:a}),"0".repeat(o)})),linkReferences:t}}Object.defineProperty(r,"__esModule",{value:!0}),r.forBytecode=r.forContract=r.forContracts=void 0,r.forContracts=function(e){return Object.values(e).map(n)},r.forContract=n,r.forBytecode=i}}},{package:"@truffle/codec>@truffle/compile-common",file:"node_modules/@truffle/compile-common/dist/src/shims/LegacyToNew.js"}],[1636,{},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){function n(e){if(!e)return e;if("string"==typeof e)return e;let{bytes:t,linkReferences:r}=e;r=r||[];return t=r.map((({offsets:e,length:t,name:r})=>e.map((e=>({offset:e,length:t,name:r}))))).reduce(((e,t)=>[...e,...t]),[]).reduce(((e,{offset:t,name:r,length:n})=>{const i=2*n;let o=`__${r.slice(0,i-2)}`;for(;o.length<i;)o+="_";const s=2*t;return`${e.substring(0,s)}${o}${e.substring(s+i)}`}),t),`0x${t}`}Object.defineProperty(r,"__esModule",{value:!0}),r.forBytecode=r.forContract=void 0,r.forContract=function(e){const{contractName:t,sourcePath:r,source:i,sourceMap:o,deployedSourceMap:s,legacyAST:a,ast:u,abi:c,metadata:l,bytecode:d,deployedBytecode:f,compiler:h,devdoc:p,userdoc:m,immutableReferences:g,generatedSources:y,deployedGeneratedSources:v,db:b}=e;return{contract_name:t,sourcePath:r,source:i,sourceMap:o,deployedSourceMap:s,legacyAST:a,ast:u,abi:c,metadata:l,bytecode:n(d),deployedBytecode:n(f),unlinked_binary:n(d),compiler:h,devdoc:p,userdoc:m,immutableReferences:g,generatedSources:y,deployedGeneratedSources:v,db:b}},r.forBytecode=n}}},{package:"@truffle/codec>@truffle/compile-common",file:"node_modules/@truffle/compile-common/dist/src/shims/NewToLegacy.js"}],[1637,{"./LegacyToNew":1635,"./NewToLegacy":1636},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){n===undefined&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){n===undefined&&(n=r),e[n]=t[r]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&n(t,e,r);return i(t,e),t};Object.defineProperty(r,"__esModule",{value:!0}),r.NewToLegacy=r.LegacyToNew=void 0,r.LegacyToNew=o(e("./LegacyToNew")),r.NewToLegacy=o(e("./NewToLegacy"))}}},{package:"@truffle/codec>@truffle/compile-common",file:"node_modules/@truffle/compile-common/dist/src/shims/index.js"}],[1638,{path:3014},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){n===undefined&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){n===undefined&&(n=r),e[n]=t[r]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&n(t,e,r);return i(t,e),t};Object.defineProperty(r,"__esModule",{value:!0}),r.collectSources=void 0;const s=o(e("path"));function a(e){let t=e;return"\\"===s.sep&&(t=e.replace(/\\/g,"/")),t.length>=2&&":"===t[1]&&(t="/"+t,t=t.replace(":","")),t}function u(e,t,r){return t.endsWith(s.sep)||(t+=s.sep),e.startsWith(t)?r+e.slice(t.length):e}r.collectSources=function(e,t=[],r="",n="/"){return Object.entries(e).filter((([e,t])=>!s.isAbsolute(e)||e.startsWith(r))).map((([e,t])=>({originalSourcePath:e,contents:t,sourcePath:a(u(e,r,n))}))).map((({originalSourcePath:e,sourcePath:r,contents:n})=>({sources:{[r]:n},targets:t.includes(e)?[r]:[],originalSourcePaths:{[r]:e}}))).reduce(((e,t)=>({sources:Object.assign({},e.sources,t.sources),targets:[...e.targets,...t.targets],originalSourcePaths:Object.assign({},e.originalSourcePaths,t.originalSourcePaths)})),{sources:{},targets:[],originalSourcePaths:{}})}}}},{package:"@truffle/codec>@truffle/compile-common",file:"node_modules/@truffle/compile-common/dist/src/sources.js"}],[1639,{},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0})}}},{package:"@truffle/codec>@truffle/compile-common",file:"node_modules/@truffle/compile-common/dist/src/types.js"}],[1640,{"./errors":1641,"@truffle/abi-utils":1488,"@truffle/codec":1547,"@truffle/compile-common":1634,"@truffle/encoder":1647,"@truffle/source-map-utils":1652,"bn.js":1643,debug:2075,"web3-utils":3381},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){n===undefined&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){n===undefined&&(n=r),e[n]=t[r]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&n(t,e,r);return i(t,e),t},s=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))},a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(r,"__esModule",{value:!0}),r.ContractInstanceDecoder=r.ContractDecoder=r.ProjectDecoder=void 0;const u=(0,a(e("debug")).default)("decoder:decoders"),c=o(e("@truffle/abi-utils")),l=o(e("@truffle/codec")),d=e("@truffle/codec"),f=o(e("@truffle/encoder")),h=e("@truffle/encoder"),p=a(e("web3-utils")),m=a(e("bn.js")),g=e("./errors"),y=e("@truffle/compile-common"),v=e("@truffle/source-map-utils");r.ProjectDecoder=class{constructor(e,t,r){if(this.contexts={},this.deployedContexts={},this.contractsAndContexts=[],this.codeCache={},this.addProjectInfoNonce=0,!t)throw new g.NoProviderError;const n=l.Compilations.Utils.findRepeatCompilationIds(e);if(0!==n.size)throw new l.RepeatCompilationIdError([...n]);let i;this.providerAdapter=new h.ProviderAdapter(t),this.compilations=e,this.ensSettings=r||{},({definitions:this.referenceDeclarations,typesByCompilation:this.userDefinedTypesByCompilation,types:this.userDefinedTypes}=d.Compilations.Utils.collectUserDefinedTypesAndTaggedOutputs(this.compilations)),({contexts:this.contexts,deployedContexts:this.deployedContexts,contractsAndContexts:this.contractsAndContexts,allocationInfo:i}=d.AbiData.Allocate.Utils.collectAllocationInfo(this.compilations)),this.allocations={},this.allocations.abi=d.AbiData.Allocate.getAbiAllocations(this.userDefinedTypes),this.allocations.storage=d.Storage.Allocate.getStorageAllocations(this.userDefinedTypesByCompilation),this.allocations.calldata=d.AbiData.Allocate.getCalldataAllocations(i,this.referenceDeclarations,this.userDefinedTypes,this.allocations.abi),this.allocations.returndata=d.AbiData.Allocate.getReturndataAllocations(i,this.referenceDeclarations,this.userDefinedTypes,this.allocations.abi),this.allocations.event=d.AbiData.Allocate.getEventAllocations(i,this.referenceDeclarations,this.userDefinedTypes,this.allocations.abi),this.allocations.state=d.Storage.Allocate.getStateAllocations(i,this.referenceDeclarations,this.userDefinedTypes,this.allocations.storage),u("done with allocation")}addCompilations(e){return s(this,void 0,void 0,(function*(){const t=new Set(this.compilations.map((e=>e.id))),r=[...new Set(e.map((e=>e.id)))].filter((e=>t.has(e)));if(0!==r.length)throw new l.RepeatCompilationIdError(r);const n=l.Compilations.Utils.findRepeatCompilationIds(e);if(0!==n.size)throw new l.RepeatCompilationIdError([...n]);this.compilations=[...this.compilations,...e];const{definitions:i,typesByCompilation:o,types:s}=d.Compilations.Utils.collectUserDefinedTypesAndTaggedOutputs(e);Object.assign(this.referenceDeclarations,i),Object.assign(this.userDefinedTypesByCompilation,o),Object.assign(this.userDefinedTypes,s);const{contexts:a,deployedContexts:u,contractsAndContexts:c,allocationInfo:f}=d.AbiData.Allocate.Utils.collectAllocationInfo(e);this.contexts=Object.assign(a,this.contexts),Object.assign(this.deployedContexts,u),this.contractsAndContexts=[...this.contractsAndContexts,...c];const h=d.AbiData.Allocate.getAbiAllocations(s);Object.assign(this.allocations.abi,h);const p=d.Storage.Allocate.getStorageAllocations(o);Object.assign(this.allocations.storage,p);const m=d.Storage.Allocate.getStateAllocations(f,i,s,p);Object.assign(this.allocations.state,m);const g=d.AbiData.Allocate.getCalldataAllocations(f,i,s,h);Object.assign(this.allocations.calldata.constructorAllocations,g.constructorAllocations),Object.assign(this.allocations.calldata.functionAllocations,g.functionAllocations),this.allocations.returndata=d.AbiData.Allocate.getReturndataAllocations(f,i,s,this.allocations.abi),this.allocations.event=d.AbiData.Allocate.getEventAllocations(f,i,s,this.allocations.abi)}))}addAdditionalProjectInfo(e){return s(this,void 0,void 0,(function*(){const t=d.Compilations.Utils.infoToCompilations(e,`decoderAdditionalShimmedCompilationGroup(${this.addProjectInfoNonce})`);this.addProjectInfoNonce++,yield this.addCompilations(t)}))}getCode(e,t){return s(this,void 0,void 0,(function*(){if("pending"===t)return d.Conversion.toBytes(yield this.providerAdapter.getCode(e,t));if(this.codeCache[t]===undefined&&(this.codeCache[t]={}),this.codeCache[t][e]!==undefined)return this.codeCache[t][e];let r=d.Conversion.toBytes(yield this.providerAdapter.getCode(e,t));return this.codeCache[t][e]=r,r}))}regularizeBlock(e){return s(this,void 0,void 0,(function*(){return"number"==typeof e||"pending"===e?e:null===e?"pending":(yield this.providerAdapter.getBlockByNumber(e)).number}))}decodeTransaction(e){return s(this,void 0,void 0,(function*(){return yield this.decodeTransactionWithAdditionalContexts(e)}))}decodeTransactionWithAdditionalContexts(e,t={},r){return s(this,void 0,void 0,(function*(){const n=e.blockNumber,i=yield this.regularizeBlock(n),o=null===e.to,s=yield this.getContextByAddress(e.to,i,e.input,t);let a=this.allocations;s&&!(s.context in this.contexts)&&(a=Object.assign(Object.assign({},this.allocations),{calldata:Object.assign(Object.assign({},this.allocations.calldata),{functionAllocations:Object.assign({[s.context]:r},this.allocations.calldata.functionAllocations)})}));const u={state:{storage:{},calldata:d.Conversion.toBytes(e.input)},userDefinedTypes:this.userDefinedTypes,allocations:a,contexts:Object.assign(Object.assign({},this.deployedContexts),t),currentContext:s},c=(0,d.decodeCalldata)(u,o);let l=c.next();for(;!1===l.done;){let e,t=l.value;if("code"===t.type)e=yield this.getCode(t.address,i);l=c.next(e)}let f=l.value;return"function"===f.kind&&(f=yield this.withMulticallInterpretations(f,e,t,r)),f}))}decodeLog(e,t={}){return s(this,void 0,void 0,(function*(){return yield this.decodeLogWithAdditionalOptions(e,t)}))}decodeLogWithAdditionalOptions(e,t={},r={}){return s(this,void 0,void 0,(function*(){const n=e.blockNumber,i=yield this.regularizeBlock(n),o={state:{storage:{},eventdata:d.Conversion.toBytes(e.data),eventtopics:e.topics.map(d.Conversion.toBytes)},userDefinedTypes:this.userDefinedTypes,allocations:this.allocations,contexts:Object.assign(Object.assign({},this.deployedContexts),r)},s=(0,d.decodeEvent)(o,e.address,t);let a=s.next();for(;!1===a.done;){let e,t=a.value;if("code"===t.type)e=yield this.getCode(t.address,i);a=s.next(e)}return a.value}))}events(e={}){return s(this,void 0,void 0,(function*(){return yield this.eventsWithAdditionalContexts(e)}))}eventsWithAdditionalContexts(e={},t={}){return s(this,void 0,void 0,(function*(){let{address:r,name:n,fromBlock:i,toBlock:o}=e;i===undefined&&(i="latest"),o===undefined&&(o="latest");const a=yield this.regularizeBlock(i),c=yield this.regularizeBlock(o),l=yield this.providerAdapter.getPastLogs({address:r,fromBlock:a,toBlock:c});let d=yield Promise.all(l.map((r=>s(this,void 0,void 0,(function*(){return Object.assign(Object.assign({},r),{decodings:yield this.decodeLogWithAdditionalOptions(r,e,t)})})))));return u("events: %o",d),n!==undefined&&(d=d.filter((e=>e.decodings.length>0))),d}))}abifyCalldataDecoding(e){return l.abifyCalldataDecoding(e,this.userDefinedTypes)}abifyLogDecoding(e){return l.abifyLogDecoding(e,this.userDefinedTypes)}abifyReturndataDecoding(e){return l.abifyReturndataDecoding(e,this.userDefinedTypes)}getContextByAddress(e,t,r,n={}){return s(this,void 0,void 0,(function*(){let i;null!==e?i=d.Conversion.toHexString(yield this.getCode(e,t)):r&&(i=r);let o=Object.assign(Object.assign({},this.contexts),n);return d.Contexts.Utils.findContext(o,i)}))}forArtifact(e){return s(this,void 0,void 0,(function*(){let{compilation:t,contract:r}=d.Compilations.Utils.findCompilationAndContract(this.compilations,e);r=Object.assign(Object.assign({},r),{abi:e.abi});let n=new b(r,t,this,e);return yield n.init(),n}))}forInstance(e,t){return s(this,void 0,void 0,(function*(){let r=yield this.forArtifact(e);return yield r.forInstance(t)}))}forAddress(e,t="latest"){return s(this,void 0,void 0,(function*(){if(!p.default.isAddress(e))throw new g.InvalidAddressError(e);e=p.default.toChecksumAddress(e);const r=yield this.regularizeBlock(t),n=d.Conversion.toHexString(yield this.getCode(e,r)),i=this.contractsAndContexts.find((({deployedContext:e})=>e&&d.Contexts.Utils.matchContext(e,n)));if(!i)throw new g.ContractNotFoundError(undefined,undefined,n,e);const{contract:o,compilationId:s}=i,a=this.compilations.find((e=>e.id===s));let u=new b(o,a,this);return yield u.init(),yield u.forInstance(e)}))}getReferenceDeclarations(){return this.referenceDeclarations}getUserDefinedTypes(){return this.userDefinedTypes}getAllocations(){return this.allocations}getProviderAdapter(){return this.providerAdapter}getEnsSettings(){return this.ensSettings}getDeployedContexts(){return this.deployedContexts}withMulticallInterpretations(e,t,r={},n){return s(this,void 0,void 0,(function*(){return(e=Object.assign(Object.assign({},e),{interpretations:Object.assign({},e.interpretations)})).interpretations.multicall=yield this.interpretMulticall(e,t,r,n),e.interpretations.aggregate=yield this.interpretAggregate(e,t,r,n),e.interpretations.tryAggregate=yield this.interpretTryAggregate(e,t,r,n),e.interpretations.deadlinedMulticall=yield this.interpretDeadlinedMulticall(e,t,r,n),e.interpretations.specifiedBlockhashMulticall=yield this.interpretBlockhashedMulticall(e,t,r,n),e}))}interpretMulticall(e,t,r={},n){return s(this,void 0,void 0,(function*(){if("function"===e.kind&&"multicall"===e.abi.name&&1===e.abi.inputs.length&&"bytes[]"===e.abi.inputs[0].type&&"value"===e.arguments[0].value.kind){const i=e.arguments[0].value;return yield Promise.all(i.value.map((e=>s(this,void 0,void 0,(function*(){return yield this.interpretCallInMulti(e,t,r,n)})))))}return undefined}))}interpretCallInMulti(e,t,r={},n){return s(this,void 0,void 0,(function*(){switch(e.kind){case"value":return yield this.decodeTransactionWithAdditionalContexts(Object.assign(Object.assign({},t),{input:e.value.asHex}),r,n);case"error":return null}}))}interpretAggregate(e,t,r={},n){return s(this,void 0,void 0,(function*(){if("function"!==e.kind||"aggregate"!==e.abi.name&&"blockAndAggregate"!==e.abi.name||1!==e.abi.inputs.length||"tuple[]"!==e.abi.inputs[0].type||2!==e.abi.inputs[0].components.length||"address"!==e.abi.inputs[0].components[0].type||"bytes"!==e.abi.inputs[0].components[1].type||"value"!==e.arguments[0].value.kind)return undefined;{const i=e.arguments[0].value;return yield Promise.all(i.value.map((e=>s(this,void 0,void 0,(function*(){return yield this.interpretCallInAggregate(e,t,r,n)})))))}}))}interpretCallInAggregate(e,t,r={},n){return s(this,void 0,void 0,(function*(){switch(e.kind){case"value":const i=e.value[0].value,o=e.value[1].value;let s;switch(i.kind){case"value":s=i.value.asAddress;break;case"error":return{address:null,decoding:null}}switch(o.kind){case"value":return{address:s,decoding:yield this.decodeTransactionWithAdditionalContexts(Object.assign(Object.assign({},t),{input:o.value.asHex,to:s}),r,n)};case"error":return{address:s,decoding:null}}case"error":return{address:null,decoding:null}}}))}interpretTryAggregate(e,t,r={},n){return s(this,void 0,void 0,(function*(){if("function"!==e.kind||"tryAggregate"!==e.abi.name&&"tryBlockAndAggregate"!==e.abi.name||2!==e.abi.inputs.length||"bool"!==e.abi.inputs[0].type||"tuple[]"!==e.abi.inputs[1].type||2!==e.abi.inputs[1].components.length||"address"!==e.abi.inputs[1].components[0].type||"bytes"!==e.abi.inputs[1].components[1].type||"value"!==e.arguments[0].value.kind||"value"!==e.arguments[1].value.kind)return undefined;{const i=e.arguments[0].value,o=e.arguments[1].value;return{requireSuccess:i.value.asBoolean,calls:yield Promise.all(o.value.map((e=>s(this,void 0,void 0,(function*(){return yield this.interpretCallInAggregate(e,t,r,n)})))))}}}))}interpretDeadlinedMulticall(e,t,r={},n){return s(this,void 0,void 0,(function*(){if("function"===e.kind&&"multicall"===e.abi.name&&2===e.abi.inputs.length&&"uint256"===e.abi.inputs[0].type&&"bytes[]"===e.abi.inputs[1].type&&"value"===e.arguments[0].value.kind&&"value"===e.arguments[1].value.kind){const i=e.arguments[0].value,o=e.arguments[1].value;return{deadline:i.value.asBN,calls:yield Promise.all(o.value.map((e=>s(this,void 0,void 0,(function*(){return yield this.interpretCallInMulti(e,t,r,n)})))))}}return undefined}))}interpretBlockhashedMulticall(e,t,r={},n){return s(this,void 0,void 0,(function*(){if("function"===e.kind&&"multicall"===e.abi.name&&2===e.abi.inputs.length&&"bytes32"===e.abi.inputs[0].type&&"bytes[]"===e.abi.inputs[1].type&&"value"===e.arguments[0].value.kind&&"value"===e.arguments[1].value.kind){const i=e.arguments[0].value,o=e.arguments[1].value;return{specifiedBlockhash:i.value.asHex,calls:yield Promise.all(o.value.map((e=>s(this,void 0,void 0,(function*(){return yield this.interpretCallInMulti(e,t,r,n)})))))}}return undefined}))}};class b{constructor(e,t,r,n){if(this.artifact=n,this.contract=e,this.compilation=t,this.projectDecoder=r,this.providerAdapter=r.getProviderAdapter(),this.contexts=r.getDeployedContexts(),this.userDefinedTypes=this.projectDecoder.getUserDefinedTypes(),this.contractNode=d.Compilations.Utils.getContractNode(this.contract,this.compilation),this.allocations=this.projectDecoder.getAllocations(),this.contract.deployedBytecode&&"0x"!==this.contract.deployedBytecode){const e=d.Contexts.Utils.makeContext(this.contract,this.contractNode,this.compilation);this.contextHash=e.context}else{const e=this.projectDecoder.getReferenceDeclarations(),t=this.compilation.compiler||this.contract.compiler;this.noBytecodeAllocations=Object.values(d.AbiData.Allocate.getCalldataAllocations([{abi:c.normalize(this.contract.abi),compilationId:this.compilation.id,compiler:t,contractNode:this.contractNode,deployedContext:d.Contexts.Utils.makeContext(Object.assign(Object.assign({},this.contract),{deployedBytecode:"0x"}),this.contractNode,this.compilation)}],e,this.userDefinedTypes,this.allocations.abi).functionAllocations)[0]}this.contractNode&&this.allocations.state[this.compilation.id]&&this.allocations.state[this.compilation.id][this.contractNode.id]&&(this.stateVariableReferences=this.allocations.state[this.compilation.id][this.contractNode.id].members)}init(){return s(this,void 0,void 0,(function*(){this.contractNetwork=yield this.providerAdapter.getNetworkId()}))}get context(){return this.contexts[this.contextHash]}decodeReturnValue(e,t,r={}){return s(this,void 0,void 0,(function*(){return yield this.decodeReturnValueWithAdditionalContexts(e,t,r)}))}decodeReturnValueWithAdditionalContexts(e,t,r={},n={}){return s(this,void 0,void 0,(function*(){e=c.normalizeEntry(e);const i=r.block!==undefined?r.block:"latest",o=yield this.regularizeBlock(i),s=r.status,a=d.AbiData.Utils.abiSelector(e);let l;l=this.contextHash!==undefined?this.allocations.calldata.functionAllocations[this.contextHash][a].output:this.noBytecodeAllocations[a].output,u("this.allocations: %O",this.allocations);const f={state:{storage:{},returndata:d.Conversion.toBytes(t)},userDefinedTypes:this.userDefinedTypes,allocations:this.allocations,contexts:Object.assign(Object.assign({},this.contexts),n),currentContext:this.context},h=(0,d.decodeReturndata)(f,l,s);let p=h.next();for(;!1===p.done;){let e,t=p.value;if("code"===t.type)e=yield this.getCode(t.address,o);p=h.next(e)}return p.value}))}forInstance(e){return s(this,void 0,void 0,(function*(){let t=new w(this,e);return yield t.init(),t}))}getCode(e,t){return s(this,void 0,void 0,(function*(){return yield this.projectDecoder.getCode(e,t)}))}regularizeBlock(e){return s(this,void 0,void 0,(function*(){return yield this.projectDecoder.regularizeBlock(e)}))}decodeTransaction(e){return s(this,void 0,void 0,(function*(){return yield this.projectDecoder.decodeTransaction(e)}))}decodeLog(e,t={}){return s(this,void 0,void 0,(function*(){return yield this.projectDecoder.decodeLog(e,t)}))}events(e={}){return s(this,void 0,void 0,(function*(){return yield this.projectDecoder.events(e)}))}abifyCalldataDecoding(e){return this.projectDecoder.abifyCalldataDecoding(e)}abifyLogDecoding(e){return this.projectDecoder.abifyLogDecoding(e)}abifyReturndataDecoding(e){return this.projectDecoder.abifyReturndataDecoding(e)}getAllocations(){return this.allocations}getStateVariableReferences(){return this.stateVariableReferences}getProjectDecoder(){return this.projectDecoder}getNoBytecodeAllocations(){return this.noBytecodeAllocations}getContractInfo(){return{compilation:this.compilation,contract:this.contract,artifact:this.artifact,contractNode:this.contractNode,contractNetwork:this.contractNetwork,contextHash:this.contextHash}}}r.ContractDecoder=b;class w{constructor(e,t){if(this.contexts={},this.additionalContexts={},this.mappingKeys=[],this.storageCache={},this.contractDecoder=e,this.projectDecoder=this.contractDecoder.getProjectDecoder(),this.providerAdapter=this.projectDecoder.getProviderAdapter(),t!==undefined){if(!p.default.isAddress(t))throw new g.InvalidAddressError(t);this.contractAddress=p.default.toChecksumAddress(t)}let r;this.referenceDeclarations=this.projectDecoder.getReferenceDeclarations(),this.userDefinedTypes=this.projectDecoder.getUserDefinedTypes(),this.contexts=this.projectDecoder.getDeployedContexts(),({compilation:this.compilation,contract:this.contract,artifact:r,contractNode:this.contractNode,contractNetwork:this.contractNetwork,contextHash:this.contextHash}=this.contractDecoder.getContractInfo()),this.allocations=this.contractDecoder.getAllocations(),this.stateVariableReferences=this.contractDecoder.getStateVariableReferences(),this.contractAddress===undefined&&(this.contractAddress=r.networks[this.contractNetwork].address),this.compiler=this.compilation.compiler||this.contract.compiler}init(){var e,t,r,n;return s(this,void 0,void 0,(function*(){this.contractCode=d.Conversion.toHexString(yield this.getCode(this.contractAddress,yield this.providerAdapter.getBlockNumber()));const i=y.Shims.NewToLegacy.forBytecode(this.contract.deployedBytecode);if(!i||"0x"===i){const e=Object.assign(Object.assign({},this.contract),{deployedBytecode:this.contractCode}),t=d.Contexts.Utils.makeContext(e,this.contractNode,this.compilation);this.contextHash=t.context,this.additionalContexts={[t.context]:t},this.additionalContexts=d.Contexts.Utils.normalizeContexts(this.additionalContexts),this.contexts=Object.assign(Object.assign({},this.contexts),this.additionalContexts)}let{provider:o,registryAddress:s}=this.projectDecoder.getEnsSettings();o===undefined&&(o=this.providerAdapter.provider),this.encoder=yield f.forProjectInternal({provider:o,registryAddress:s,userDefinedTypes:this.userDefinedTypes,allocations:this.allocations,networkId:this.contractNetwork});const a=this.compilation.compiler||this.contract.compiler,u=(null===(t=null===(e=this.compilation)||void 0===e?void 0:e.settings)||void 0===t?void 0:t.viaIR)||(null===(n=null===(r=this.contract)||void 0===r?void 0:r.settings)||void 0===n?void 0:n.viaIR);if(!this.compilation.unreliableSourceOrder&&!u&&this.contract.deployedSourceMap&&"solc"===a.name&&this.compilation.sources.every((e=>!e||e.ast))){let e=this.compilation.sources.map((e=>e?e.ast:undefined)),t=v.getProcessedInstructionsForBinary(this.compilation.sources.map((e=>e?e.source:undefined)),this.contractCode,v.getHumanReadableSourceMap(this.contract.deployedSourceMap));try{this.internalFunctionsTable=v.getFunctionsByProgramCounter(t,e,e.map(v.makeOverlapFunction),this.compilation.id)}catch(e){}}}))}get context(){return this.contexts[this.contextHash]}checkAllocationSuccess(){if(!this.contractNode)throw new g.ContractBeingDecodedHasNoNodeError(this.contract.contractName,this.compilation.id);if(!this.stateVariableReferences)throw new g.ContractAllocationFailedError(this.contractNode.id,this.contract.contractName,this.compilation.id)}decodeVariable(e,t){return s(this,void 0,void 0,(function*(){const r={state:{storage:{},code:d.Conversion.toBytes(this.contractCode)},mappingKeys:this.mappingKeys,userDefinedTypes:this.userDefinedTypes,allocations:this.allocations,contexts:this.contexts,currentContext:this.context,internalFunctionsTable:this.internalFunctionsTable};u("this.contextHash: %s",this.contextHash);const n=l.decodeVariable(e.definition,e.pointer,r,this.compilation.id);let i=n.next();for(;!1===i.done;){let e,r=i.value;switch(r.type){case"storage":e=yield this.getStorage(this.contractAddress,r.slot,t);break;case"code":e=yield this.getCode(r.address,t)}i=n.next(e)}u("definedIn: %o",e.definedIn);let o=d.Ast.Import.definitionToStoredType(e.definedIn,this.compilation.id,this.compiler);return{name:e.definition.name,class:o,value:i.value}}))}state(e="latest"){return s(this,void 0,void 0,(function*(){let t=yield this.regularizeBlock(e);return{class:d.Contexts.Import.contextToType(this.context),address:this.contractAddress,code:this.contractCode,balanceAsBN:new m.default(yield this.providerAdapter.getBalance(this.contractAddress,t)),nonceAsBN:new m.default(yield this.providerAdapter.getTransactionCount(this.contractAddress,t))}}))}variables(e="latest"){return s(this,void 0,void 0,(function*(){this.checkAllocationSuccess();let t=yield this.regularizeBlock(e),r=[];for(const e of this.stateVariableReferences){u("about to decode %s",e.definition.name);const n=yield this.decodeVariable(e,t);u("decoded"),r.push(n)}return r}))}variable(e,t="latest"){return s(this,void 0,void 0,(function*(){this.checkAllocationSuccess();let r=yield this.regularizeBlock(t),n=this.findVariableByNameOrId(e);if(n===undefined)throw new g.VariableNotFoundError(e);return(yield this.decodeVariable(n,r)).value}))}findVariableByNameOrId(e){if("number"==typeof e||e.match(/[0-9]+/))return this.stateVariableReferences.find((({definition:t})=>t.id===e));if(e.includes(".")){let[t,r]=e.split(".");return this.stateVariableReferences.slice().reverse().find((({definition:e,definedIn:n})=>e.name===r&&n.name===t))}return this.stateVariableReferences.slice().reverse().find((({definition:t})=>t.name===e))}getStorage(e,t,r){return s(this,void 0,void 0,(function*(){if("pending"===r)return d.Conversion.toBytes(yield this.providerAdapter.getStorageAt(e,t,r),l.Evm.Utils.WORD_SIZE);if(this.storageCache[r]===undefined&&(this.storageCache[r]={}),this.storageCache[r][e]===undefined&&(this.storageCache[r][e]={}),this.storageCache[r][e][t.toString()]!==undefined)return this.storageCache[r][e][t.toString()];let n=d.Conversion.toBytes(yield this.providerAdapter.getStorageAt(e,t,r),l.Evm.Utils.WORD_SIZE);return this.storageCache[r][e][t.toString()]=n,n}))}getCode(e,t){return s(this,void 0,void 0,(function*(){return yield this.projectDecoder.getCode(e,t)}))}regularizeBlock(e){return s(this,void 0,void 0,(function*(){return yield this.projectDecoder.regularizeBlock(e)}))}watchMappingKey(e,...t){return s(this,void 0,void 0,(function*(){this.checkAllocationSuccess();let{slot:r}=yield this.constructSlot(e,...t);for(u("slot: %O",r);r!==undefined&&this.mappingKeys.every((e=>!d.Storage.Utils.equalSlots(e,r)));)r.key!==undefined&&(this.mappingKeys=[...this.mappingKeys,r]),r=r.path}))}unwatchMappingKey(e,...t){return s(this,void 0,void 0,(function*(){this.checkAllocationSuccess();let{slot:r}=yield this.constructSlot(e,...t);r!==undefined&&(this.mappingKeys=this.mappingKeys.filter((e=>{for(;e!==undefined;){if(d.Storage.Utils.equalSlots(e,r))return!1;e=e.path}return!0})))}))}decodeTransaction(e){return s(this,void 0,void 0,(function*(){return yield this.projectDecoder.decodeTransactionWithAdditionalContexts(e,this.additionalContexts,this.contractDecoder.getNoBytecodeAllocations())}))}decodeLog(e,t={}){return s(this,void 0,void 0,(function*(){return yield this.projectDecoder.decodeLogWithAdditionalOptions(e,t,this.additionalContexts)}))}decodeReturnValue(e,t,r={}){return s(this,void 0,void 0,(function*(){return yield this.contractDecoder.decodeReturnValueWithAdditionalContexts(e,t,r,this.additionalContexts)}))}abifyCalldataDecoding(e){return this.projectDecoder.abifyCalldataDecoding(e)}abifyLogDecoding(e){return this.projectDecoder.abifyLogDecoding(e)}abifyReturndataDecoding(e){return this.projectDecoder.abifyReturndataDecoding(e)}events(e={}){return s(this,void 0,void 0,(function*(){return yield this.projectDecoder.eventsWithAdditionalContexts(Object.assign({address:this.contractAddress},e),this.additionalContexts)}))}constructSlot(e,...t){return s(this,void 0,void 0,(function*(){if(0===t.length){let t=this.findVariableByNameOrId(e);if(!t)throw new g.VariableNotFoundError(e);let r=d.Ast.Import.definitionToType(t.definition,this.compilation.id,this.contract.compiler,"storage"),n=t.pointer;return"storage"!==n.location?{slot:undefined,type:undefined}:{slot:n.range.from.slot,type:r}}let r=t.slice(0,-1),{slot:n,type:i}=yield this.constructSlot(e,...r);if(n===undefined)return{slot:undefined,type:undefined};let o,s,a=t[t.length-1];switch(i.typeClass){case"array":const r=(yield this.encoder.wrapElementaryValue({typeClass:"uint",bits:256},a)).value.asBN;if("static"===i.kind&&r.gte(i.length))throw new g.ArrayIndexOutOfBoundsError(r,i.length,e,t);s=i.baseType;let u=d.Storage.Allocate.storageSize(s,this.userDefinedTypes,this.allocations.storage);if(!d.Storage.Utils.isWordsLength(u))return{slot:undefined,type:undefined};o={path:n,offset:r.muln(u.words),hashPath:"dynamic"===i.kind};break;case"mapping":let c=i.keyType;const l=yield this.encoder.wrapElementaryValue(c,a);s=i.valueType,o={path:n,key:l,offset:new m.default(0)};break;case"struct":let f=this.allocations.storage[i.id].members.find((({name:e})=>e===a));if(!f){const r="string"==typeof a?a:"specified by non-string argument";throw new g.MemberNotFoundError(r,i,e,t)}o={path:n,offset:f.pointer.range.from.slot.offset.clone()},s=f.type;break;default:return{slot:undefined,type:undefined}}return{slot:o,type:s}}))}}r.ContractInstanceDecoder=w}}},{package:"@truffle/decoder",file:"node_modules/@truffle/decoder/dist/decoders.js"}],[1641,{"@truffle/codec":1547},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.NoProviderError=r.ArrayIndexOutOfBoundsError=r.MemberNotFoundError=r.VariableNotFoundError=r.InvalidAddressError=r.ContractAllocationFailedError=r.ContractNotFoundError=r.ContractBeingDecodedHasNoNodeError=void 0;const n=e("@truffle/codec");class i extends Error{constructor(e,t){super(`Contract ${e} does not appear to have been compiled with Solidity (cannot locate contract node)`),this.contractName=e,this.compilationId=t,this.name="ContractBeingDecodedHasNoNodeError"}}r.ContractBeingDecodedHasNoNodeError=i;class o extends Error{constructor(e,t,r,n){let i;i=e?`Contract ${e} could not be found in the project information`:`Contract at ${n} could not be found in the project information`,super(i),this.contractName=e,this.bytecode=t,this.deployedBytecode=r,this.address=n,this.name="ContractNotFoundError"}}r.ContractNotFoundError=o;class s extends Error{constructor(e,t,r){super(`No allocation found for contract ID ${e} (${t}) in compilation ${r}`),this.id=e,this.contractName=t,this.compilationId=r,this.name="ContractAllocationFailedError"}}r.ContractAllocationFailedError=s;class a extends Error{constructor(e){super(`Invalid address ${e}`),this.address=e,this.name="InvalidAddressError"}}r.InvalidAddressError=a;class u extends Error{constructor(e){super(`No such variable ${e}`),this.nameOrId=e,this.name="VariableNotFoundError"}}r.VariableNotFoundError=u;class c extends Error{constructor(e,t,r,i){super(`Member ${e} does not exist on struct type ${n.Format.Types.typeStringWithoutLocation(t)} in attempting to access variable ${r}$, indexSequence ${i.join(", ")}`),this.memberName=e,this.structType=t,this.variable=r,this.indices=i,this.name="MemberNotFoundError"}}r.MemberNotFoundError=c;class l extends Error{constructor(e,t,r,n){super(`Index ${e} is out of bounds for array of length ${t} in attempting to access variable ${r}, index sequence ${n.join(", ")}`),this.index=e.clone(),this.length=t.clone(),this.variable=r,this.indices=n,this.name="ArrayIndexOutOfBoundsError"}}r.ArrayIndexOutOfBoundsError=l;class d extends Error{constructor(){super("No provider was given for the decoder to use."),this.name="NoProviderError"}}r.NoProviderError=d}}},{package:"@truffle/decoder",file:"node_modules/@truffle/decoder/dist/errors.js"}],[1642,{"./decoders":1640,"./errors":1641,"@truffle/codec":1547},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(r,"__esModule",{value:!0}),r.forAddress=r.forContractInstance=r.forContractAt=r.forArtifactAt=r.forDeployedContract=r.forDeployedArtifact=r.forContract=r.forArtifact=r.forProject=r.NoProviderError=r.VariableNotFoundError=r.InvalidAddressError=r.ContractAllocationFailedError=r.ContractNotFoundError=r.ContractBeingDecodedHasNoNodeError=r.ProjectDecoder=r.ContractInstanceDecoder=r.ContractDecoder=void 0;const i=e("./decoders");Object.defineProperty(r,"ContractDecoder",{enumerable:!0,get:function(){return i.ContractDecoder}}),Object.defineProperty(r,"ContractInstanceDecoder",{enumerable:!0,get:function(){return i.ContractInstanceDecoder}}),Object.defineProperty(r,"ProjectDecoder",{enumerable:!0,get:function(){return i.ProjectDecoder}});var o=e("./errors");Object.defineProperty(r,"ContractBeingDecodedHasNoNodeError",{enumerable:!0,get:function(){return o.ContractBeingDecodedHasNoNodeError}}),Object.defineProperty(r,"ContractNotFoundError",{enumerable:!0,get:function(){return o.ContractNotFoundError}}),Object.defineProperty(r,"ContractAllocationFailedError",{enumerable:!0,get:function(){return o.ContractAllocationFailedError}}),Object.defineProperty(r,"InvalidAddressError",{enumerable:!0,get:function(){return o.InvalidAddressError}}),Object.defineProperty(r,"VariableNotFoundError",{enumerable:!0,get:function(){return o.VariableNotFoundError}}),Object.defineProperty(r,"NoProviderError",{enumerable:!0,get:function(){return o.NoProviderError}});const s=e("@truffle/codec");function a(e){return n(this,void 0,void 0,(function*(){let t=s.Compilations.Utils.infoToCompilations(e.projectInfo),r=function(e){return e.ens?e.ens:{provider:e.provider}}(e);return new i.ProjectDecoder(t,e.provider,r)}))}function u(e,t){return n(this,void 0,void 0,(function*(){t.projectInfo||(t=Object.assign(Object.assign({},t),{projectInfo:{artifacts:[e]}}));let r=yield a(t);return yield r.forArtifact(e)}))}function c(e,t={}){return n(this,void 0,void 0,(function*(){return yield u(e,Object.assign({provider:e.web3.currentProvider},t))}))}function l(e,t,r={}){return n(this,void 0,void 0,(function*(){let n=yield c(e,r);return yield n.forInstance(t)}))}r.forProject=a,r.forArtifact=u,r.forContract=c,r.forDeployedArtifact=function(e,t){return n(this,void 0,void 0,(function*(){let r=yield u(e,t);return yield r.forInstance()}))},r.forDeployedContract=function(e,t={}){return n(this,void 0,void 0,(function*(){let r=yield c(e,t);return yield r.forInstance()}))},r.forArtifactAt=function(e,t,r){return n(this,void 0,void 0,(function*(){let n=yield u(e,r);return yield n.forInstance(t)}))},r.forContractAt=l,r.forContractInstance=function(e,t={}){return n(this,void 0,void 0,(function*(){return yield l(e.constructor,e.address,t)}))},r.forAddress=function(e,t={}){return n(this,void 0,void 0,(function*(){let r=yield a(t);return yield r.forAddress(e)}))}}}},{package:"@truffle/decoder",file:"node_modules/@truffle/decoder/dist/index.js"}],[1643,{buffer:1942},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){!function(t,r){function n(e,t){if(!e)throw new Error(t||"Assertion failed")}function i(e,t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}function o(e,t,r){if(o.isBN(e))return e;this.negative=0,this.words=null,this.length=0,this.red=null,null!==e&&("le"!==t&&"be"!==t||(r=t,t=10),this._init(e||0,t||10,r||"be"))}var s;"object"==typeof t?t.exports=o:r.BN=o,o.BN=o,o.wordSize=26;try{s="undefined"!=typeof window&&void 0!==window.Buffer?window.Buffer:e("buffer").Buffer}catch(e){}function a(e,t){var r=e.charCodeAt(t);return r>=48&&r<=57?r-48:r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:void n(!1,"Invalid character in "+e)}function u(e,t,r){var n=a(e,r);return r-1>=t&&(n|=a(e,r-1)<<4),n}function c(e,t,r,i){for(var o=0,s=0,a=Math.min(e.length,r),u=t;u<a;u++){var c=e.charCodeAt(u)-48;o*=i,s=c>=49?c-49+10:c>=17?c-17+10:c,n(c>=0&&s<i,"Invalid character"),o+=s}return o}function l(e,t){e.words=t.words,e.length=t.length,e.negative=t.negative,e.red=t.red}if(o.isBN=function(e){return e instanceof o||null!==e&&"object"==typeof e&&e.constructor.wordSize===o.wordSize&&Array.isArray(e.words)},o.max=function(e,t){return e.cmp(t)>0?e:t},o.min=function(e,t){return e.cmp(t)<0?e:t},o.prototype._init=function(e,t,r){if("number"==typeof e)return this._initNumber(e,t,r);if("object"==typeof e)return this._initArray(e,t,r);"hex"===t&&(t=16),n(t===(0|t)&&t>=2&&t<=36);var i=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&(i++,this.negative=1),i<e.length&&(16===t?this._parseHex(e,i,r):(this._parseBase(e,t,i),"le"===r&&this._initArray(this.toArray(),t,r)))},o.prototype._initNumber=function(e,t,r){e<0&&(this.negative=1,e=-e),e<67108864?(this.words=[67108863&e],this.length=1):e<4503599627370496?(this.words=[67108863&e,e/67108864&67108863],this.length=2):(n(e<9007199254740992),this.words=[67108863&e,e/67108864&67108863,1],this.length=3),"le"===r&&this._initArray(this.toArray(),t,r)},o.prototype._initArray=function(e,t,r){if(n("number"==typeof e.length),e.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(e.length/3),this.words=new Array(this.length);for(var i=0;i<this.length;i++)this.words[i]=0;var o,s,a=0;if("be"===r)for(i=e.length-1,o=0;i>=0;i-=3)s=e[i]|e[i-1]<<8|e[i-2]<<16,this.words[o]|=s<<a&67108863,this.words[o+1]=s>>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);else if("le"===r)for(i=0,o=0;i<e.length;i+=3)s=e[i]|e[i+1]<<8|e[i+2]<<16,this.words[o]|=s<<a&67108863,this.words[o+1]=s>>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);return this._strip()},o.prototype._parseHex=function(e,t,r){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var n=0;n<this.length;n++)this.words[n]=0;var i,o=0,s=0;if("be"===r)for(n=e.length-1;n>=t;n-=2)i=u(e,t,n)<<o,this.words[s]|=67108863&i,o>=18?(o-=18,s+=1,this.words[s]|=i>>>26):o+=8;else for(n=(e.length-t)%2==0?t+1:t;n<e.length;n+=2)i=u(e,t,n)<<o,this.words[s]|=67108863&i,o>=18?(o-=18,s+=1,this.words[s]|=i>>>26):o+=8;this._strip()},o.prototype._parseBase=function(e,t,r){this.words=[0],this.length=1;for(var n=0,i=1;i<=67108863;i*=t)n++;n--,i=i/t|0;for(var o=e.length-r,s=o%n,a=Math.min(o,o-s)+r,u=0,l=r;l<a;l+=n)u=c(e,l,l+n,t),this.imuln(i),this.words[0]+u<67108864?this.words[0]+=u:this._iaddn(u);if(0!==s){var d=1;for(u=c(e,l,e.length,t),l=0;l<s;l++)d*=t;this.imuln(d),this.words[0]+u<67108864?this.words[0]+=u:this._iaddn(u)}this._strip()},o.prototype.copy=function(e){e.words=new Array(this.length);for(var t=0;t<this.length;t++)e.words[t]=this.words[t];e.length=this.length,e.negative=this.negative,e.red=this.red},o.prototype._move=function(e){l(e,this)},o.prototype.clone=function(){var e=new o(null);return this.copy(e),e},o.prototype._expand=function(e){for(;this.length<e;)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},"undefined"!=typeof Symbol&&"function"==typeof Symbol.for)try{o.prototype[Symbol.for("nodejs.util.inspect.custom")]=d}catch(e){o.prototype.inspect=d}else o.prototype.inspect=d;function d(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"}var f=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],h=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],p=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];o.prototype.toString=function(e,t){var r;if(t=0|t||1,16===(e=e||10)||"hex"===e){r="";for(var i=0,o=0,s=0;s<this.length;s++){var a=this.words[s],u=(16777215&(a<<i|o)).toString(16);o=a>>>24-i&16777215,(i+=2)>=26&&(i-=26,s--),r=0!==o||s!==this.length-1?f[6-u.length]+u+r:u+r}for(0!==o&&(r=o.toString(16)+r);r.length%t!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(e===(0|e)&&e>=2&&e<=36){var c=h[e],l=p[e];r="";var d=this.clone();for(d.negative=0;!d.isZero();){var m=d.modrn(l).toString(e);r=(d=d.idivn(l)).isZero()?m+r:f[c-m.length]+m+r}for(this.isZero()&&(r="0"+r);r.length%t!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}n(!1,"Base should be between 2 and 36")},o.prototype.toNumber=function(){var e=this.words[0];return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},o.prototype.toJSON=function(){return this.toString(16,2)},s&&(o.prototype.toBuffer=function(e,t){return this.toArrayLike(s,e,t)}),o.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)};function m(e,t,r){r.negative=t.negative^e.negative;var n=e.length+t.length|0;r.length=n,n=n-1|0;var i=0|e.words[0],o=0|t.words[0],s=i*o,a=67108863&s,u=s/67108864|0;r.words[0]=a;for(var c=1;c<n;c++){for(var l=u>>>26,d=67108863&u,f=Math.min(c,t.length-1),h=Math.max(0,c-e.length+1);h<=f;h++){var p=c-h|0;l+=(s=(i=0|e.words[p])*(o=0|t.words[h])+d)/67108864|0,d=67108863&s}r.words[c]=0|d,u=0|l}return 0!==u?r.words[c]=0|u:r.length--,r._strip()}o.prototype.toArrayLike=function(e,t,r){this._strip();var i=this.byteLength(),o=r||Math.max(1,i);n(i<=o,"byte array longer than desired length"),n(o>0,"Requested array length <= 0");var s=function(e,t){return e.allocUnsafe?e.allocUnsafe(t):new e(t)}(e,o);return this["_toArrayLike"+("le"===t?"LE":"BE")](s,i),s},o.prototype._toArrayLikeLE=function(e,t){for(var r=0,n=0,i=0,o=0;i<this.length;i++){var s=this.words[i]<<o|n;e[r++]=255&s,r<e.length&&(e[r++]=s>>8&255),r<e.length&&(e[r++]=s>>16&255),6===o?(r<e.length&&(e[r++]=s>>24&255),n=0,o=0):(n=s>>>24,o+=2)}if(r<e.length)for(e[r++]=n;r<e.length;)e[r++]=0},o.prototype._toArrayLikeBE=function(e,t){for(var r=e.length-1,n=0,i=0,o=0;i<this.length;i++){var s=this.words[i]<<o|n;e[r--]=255&s,r>=0&&(e[r--]=s>>8&255),r>=0&&(e[r--]=s>>16&255),6===o?(r>=0&&(e[r--]=s>>24&255),n=0,o=0):(n=s>>>24,o+=2)}if(r>=0)for(e[r--]=n;r>=0;)e[r--]=0},Math.clz32?o.prototype._countBits=function(e){return 32-Math.clz32(e)}:o.prototype._countBits=function(e){var t=e,r=0;return t>=4096&&(r+=13,t>>>=13),t>=64&&(r+=7,t>>>=7),t>=8&&(r+=4,t>>>=4),t>=2&&(r+=2,t>>>=2),r+t},o.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,r=0;return 0==(8191&t)&&(r+=13,t>>>=13),0==(127&t)&&(r+=7,t>>>=7),0==(15&t)&&(r+=4,t>>>=4),0==(3&t)&&(r+=2,t>>>=2),0==(1&t)&&r++,r},o.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},o.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;t<this.length;t++){var r=this._zeroBits(this.words[t]);if(e+=r,26!==r)break}return e},o.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},o.prototype.toTwos=function(e){return 0!==this.negative?this.abs().inotn(e).iaddn(1):this.clone()},o.prototype.fromTwos=function(e){return this.testn(e-1)?this.notn(e).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(e){for(;this.length<e.length;)this.words[this.length++]=0;for(var t=0;t<e.length;t++)this.words[t]=this.words[t]|e.words[t];return this._strip()},o.prototype.ior=function(e){return n(0==(this.negative|e.negative)),this.iuor(e)},o.prototype.or=function(e){return this.length>e.length?this.clone().ior(e):e.clone().ior(this)},o.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},o.prototype.iuand=function(e){var t;t=this.length>e.length?e:this;for(var r=0;r<t.length;r++)this.words[r]=this.words[r]&e.words[r];return this.length=t.length,this._strip()},o.prototype.iand=function(e){return n(0==(this.negative|e.negative)),this.iuand(e)},o.prototype.and=function(e){return this.length>e.length?this.clone().iand(e):e.clone().iand(this)},o.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},o.prototype.iuxor=function(e){var t,r;this.length>e.length?(t=this,r=e):(t=e,r=this);for(var n=0;n<r.length;n++)this.words[n]=t.words[n]^r.words[n];if(this!==t)for(;n<t.length;n++)this.words[n]=t.words[n];return this.length=t.length,this._strip()},o.prototype.ixor=function(e){return n(0==(this.negative|e.negative)),this.iuxor(e)},o.prototype.xor=function(e){return this.length>e.length?this.clone().ixor(e):e.clone().ixor(this)},o.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},o.prototype.inotn=function(e){n("number"==typeof e&&e>=0);var t=0|Math.ceil(e/26),r=e%26;this._expand(t),r>0&&t--;for(var i=0;i<t;i++)this.words[i]=67108863&~this.words[i];return r>0&&(this.words[i]=~this.words[i]&67108863>>26-r),this._strip()},o.prototype.notn=function(e){return this.clone().inotn(e)},o.prototype.setn=function(e,t){n("number"==typeof e&&e>=0);var r=e/26|0,i=e%26;return this._expand(r+1),this.words[r]=t?this.words[r]|1<<i:this.words[r]&~(1<<i),this._strip()},o.prototype.iadd=function(e){var t,r,n;if(0!==this.negative&&0===e.negative)return this.negative=0,t=this.isub(e),this.negative^=1,this._normSign();if(0===this.negative&&0!==e.negative)return e.negative=0,t=this.isub(e),e.negative=1,t._normSign();this.length>e.length?(r=this,n=e):(r=e,n=this);for(var i=0,o=0;o<n.length;o++)t=(0|r.words[o])+(0|n.words[o])+i,this.words[o]=67108863&t,i=t>>>26;for(;0!==i&&o<r.length;o++)t=(0|r.words[o])+i,this.words[o]=67108863&t,i=t>>>26;if(this.length=r.length,0!==i)this.words[this.length]=i,this.length++;else if(r!==this)for(;o<r.length;o++)this.words[o]=r.words[o];return this},o.prototype.add=function(e){var t;return 0!==e.negative&&0===this.negative?(e.negative=0,t=this.sub(e),e.negative^=1,t):0===e.negative&&0!==this.negative?(this.negative=0,t=e.sub(this),this.negative=1,t):this.length>e.length?this.clone().iadd(e):e.clone().iadd(this)},o.prototype.isub=function(e){if(0!==e.negative){e.negative=0;var t=this.iadd(e);return e.negative=1,t._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var r,n,i=this.cmp(e);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(r=this,n=e):(r=e,n=this);for(var o=0,s=0;s<n.length;s++)o=(t=(0|r.words[s])-(0|n.words[s])+o)>>26,this.words[s]=67108863&t;for(;0!==o&&s<r.length;s++)o=(t=(0|r.words[s])+o)>>26,this.words[s]=67108863&t;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(e){return this.clone().isub(e)};var g=function(e,t,r){var n,i,o,s=e.words,a=t.words,u=r.words,c=0,l=0|s[0],d=8191&l,f=l>>>13,h=0|s[1],p=8191&h,m=h>>>13,g=0|s[2],y=8191&g,v=g>>>13,b=0|s[3],w=8191&b,M=b>>>13,_=0|s[4],O=8191&_,E=_>>>13,T=0|s[5],j=8191&T,k=T>>>13,x=0|s[6],S=8191&x,C=x>>>13,A=0|s[7],I=8191&A,D=A>>>13,P=0|s[8],N=8191&P,B=P>>>13,R=0|s[9],L=8191&R,$=R>>>13,U=0|a[0],F=8191&U,z=U>>>13,H=0|a[1],W=8191&H,V=H>>>13,Z=0|a[2],q=8191&Z,G=Z>>>13,K=0|a[3],X=8191&K,J=K>>>13,Y=0|a[4],Q=8191&Y,ee=Y>>>13,te=0|a[5],re=8191&te,ne=te>>>13,ie=0|a[6],oe=8191&ie,se=ie>>>13,ae=0|a[7],ue=8191&ae,ce=ae>>>13,le=0|a[8],de=8191&le,fe=le>>>13,he=0|a[9],pe=8191&he,me=he>>>13;r.negative=e.negative^t.negative,r.length=19;var ge=(c+(n=Math.imul(d,F))|0)+((8191&(i=(i=Math.imul(d,z))+Math.imul(f,F)|0))<<13)|0;c=((o=Math.imul(f,z))+(i>>>13)|0)+(ge>>>26)|0,ge&=67108863,n=Math.imul(p,F),i=(i=Math.imul(p,z))+Math.imul(m,F)|0,o=Math.imul(m,z);var ye=(c+(n=n+Math.imul(d,W)|0)|0)+((8191&(i=(i=i+Math.imul(d,V)|0)+Math.imul(f,W)|0))<<13)|0;c=((o=o+Math.imul(f,V)|0)+(i>>>13)|0)+(ye>>>26)|0,ye&=67108863,n=Math.imul(y,F),i=(i=Math.imul(y,z))+Math.imul(v,F)|0,o=Math.imul(v,z),n=n+Math.imul(p,W)|0,i=(i=i+Math.imul(p,V)|0)+Math.imul(m,W)|0,o=o+Math.imul(m,V)|0;var ve=(c+(n=n+Math.imul(d,q)|0)|0)+((8191&(i=(i=i+Math.imul(d,G)|0)+Math.imul(f,q)|0))<<13)|0;c=((o=o+Math.imul(f,G)|0)+(i>>>13)|0)+(ve>>>26)|0,ve&=67108863,n=Math.imul(w,F),i=(i=Math.imul(w,z))+Math.imul(M,F)|0,o=Math.imul(M,z),n=n+Math.imul(y,W)|0,i=(i=i+Math.imul(y,V)|0)+Math.imul(v,W)|0,o=o+Math.imul(v,V)|0,n=n+Math.imul(p,q)|0,i=(i=i+Math.imul(p,G)|0)+Math.imul(m,q)|0,o=o+Math.imul(m,G)|0;var be=(c+(n=n+Math.imul(d,X)|0)|0)+((8191&(i=(i=i+Math.imul(d,J)|0)+Math.imul(f,X)|0))<<13)|0;c=((o=o+Math.imul(f,J)|0)+(i>>>13)|0)+(be>>>26)|0,be&=67108863,n=Math.imul(O,F),i=(i=Math.imul(O,z))+Math.imul(E,F)|0,o=Math.imul(E,z),n=n+Math.imul(w,W)|0,i=(i=i+Math.imul(w,V)|0)+Math.imul(M,W)|0,o=o+Math.imul(M,V)|0,n=n+Math.imul(y,q)|0,i=(i=i+Math.imul(y,G)|0)+Math.imul(v,q)|0,o=o+Math.imul(v,G)|0,n=n+Math.imul(p,X)|0,i=(i=i+Math.imul(p,J)|0)+Math.imul(m,X)|0,o=o+Math.imul(m,J)|0;var we=(c+(n=n+Math.imul(d,Q)|0)|0)+((8191&(i=(i=i+Math.imul(d,ee)|0)+Math.imul(f,Q)|0))<<13)|0;c=((o=o+Math.imul(f,ee)|0)+(i>>>13)|0)+(we>>>26)|0,we&=67108863,n=Math.imul(j,F),i=(i=Math.imul(j,z))+Math.imul(k,F)|0,o=Math.imul(k,z),n=n+Math.imul(O,W)|0,i=(i=i+Math.imul(O,V)|0)+Math.imul(E,W)|0,o=o+Math.imul(E,V)|0,n=n+Math.imul(w,q)|0,i=(i=i+Math.imul(w,G)|0)+Math.imul(M,q)|0,o=o+Math.imul(M,G)|0,n=n+Math.imul(y,X)|0,i=(i=i+Math.imul(y,J)|0)+Math.imul(v,X)|0,o=o+Math.imul(v,J)|0,n=n+Math.imul(p,Q)|0,i=(i=i+Math.imul(p,ee)|0)+Math.imul(m,Q)|0,o=o+Math.imul(m,ee)|0;var Me=(c+(n=n+Math.imul(d,re)|0)|0)+((8191&(i=(i=i+Math.imul(d,ne)|0)+Math.imul(f,re)|0))<<13)|0;c=((o=o+Math.imul(f,ne)|0)+(i>>>13)|0)+(Me>>>26)|0,Me&=67108863,n=Math.imul(S,F),i=(i=Math.imul(S,z))+Math.imul(C,F)|0,o=Math.imul(C,z),n=n+Math.imul(j,W)|0,i=(i=i+Math.imul(j,V)|0)+Math.imul(k,W)|0,o=o+Math.imul(k,V)|0,n=n+Math.imul(O,q)|0,i=(i=i+Math.imul(O,G)|0)+Math.imul(E,q)|0,o=o+Math.imul(E,G)|0,n=n+Math.imul(w,X)|0,i=(i=i+Math.imul(w,J)|0)+Math.imul(M,X)|0,o=o+Math.imul(M,J)|0,n=n+Math.imul(y,Q)|0,i=(i=i+Math.imul(y,ee)|0)+Math.imul(v,Q)|0,o=o+Math.imul(v,ee)|0,n=n+Math.imul(p,re)|0,i=(i=i+Math.imul(p,ne)|0)+Math.imul(m,re)|0,o=o+Math.imul(m,ne)|0;var _e=(c+(n=n+Math.imul(d,oe)|0)|0)+((8191&(i=(i=i+Math.imul(d,se)|0)+Math.imul(f,oe)|0))<<13)|0;c=((o=o+Math.imul(f,se)|0)+(i>>>13)|0)+(_e>>>26)|0,_e&=67108863,n=Math.imul(I,F),i=(i=Math.imul(I,z))+Math.imul(D,F)|0,o=Math.imul(D,z),n=n+Math.imul(S,W)|0,i=(i=i+Math.imul(S,V)|0)+Math.imul(C,W)|0,o=o+Math.imul(C,V)|0,n=n+Math.imul(j,q)|0,i=(i=i+Math.imul(j,G)|0)+Math.imul(k,q)|0,o=o+Math.imul(k,G)|0,n=n+Math.imul(O,X)|0,i=(i=i+Math.imul(O,J)|0)+Math.imul(E,X)|0,o=o+Math.imul(E,J)|0,n=n+Math.imul(w,Q)|0,i=(i=i+Math.imul(w,ee)|0)+Math.imul(M,Q)|0,o=o+Math.imul(M,ee)|0,n=n+Math.imul(y,re)|0,i=(i=i+Math.imul(y,ne)|0)+Math.imul(v,re)|0,o=o+Math.imul(v,ne)|0,n=n+Math.imul(p,oe)|0,i=(i=i+Math.imul(p,se)|0)+Math.imul(m,oe)|0,o=o+Math.imul(m,se)|0;var Oe=(c+(n=n+Math.imul(d,ue)|0)|0)+((8191&(i=(i=i+Math.imul(d,ce)|0)+Math.imul(f,ue)|0))<<13)|0;c=((o=o+Math.imul(f,ce)|0)+(i>>>13)|0)+(Oe>>>26)|0,Oe&=67108863,n=Math.imul(N,F),i=(i=Math.imul(N,z))+Math.imul(B,F)|0,o=Math.imul(B,z),n=n+Math.imul(I,W)|0,i=(i=i+Math.imul(I,V)|0)+Math.imul(D,W)|0,o=o+Math.imul(D,V)|0,n=n+Math.imul(S,q)|0,i=(i=i+Math.imul(S,G)|0)+Math.imul(C,q)|0,o=o+Math.imul(C,G)|0,n=n+Math.imul(j,X)|0,i=(i=i+Math.imul(j,J)|0)+Math.imul(k,X)|0,o=o+Math.imul(k,J)|0,n=n+Math.imul(O,Q)|0,i=(i=i+Math.imul(O,ee)|0)+Math.imul(E,Q)|0,o=o+Math.imul(E,ee)|0,n=n+Math.imul(w,re)|0,i=(i=i+Math.imul(w,ne)|0)+Math.imul(M,re)|0,o=o+Math.imul(M,ne)|0,n=n+Math.imul(y,oe)|0,i=(i=i+Math.imul(y,se)|0)+Math.imul(v,oe)|0,o=o+Math.imul(v,se)|0,n=n+Math.imul(p,ue)|0,i=(i=i+Math.imul(p,ce)|0)+Math.imul(m,ue)|0,o=o+Math.imul(m,ce)|0;var Ee=(c+(n=n+Math.imul(d,de)|0)|0)+((8191&(i=(i=i+Math.imul(d,fe)|0)+Math.imul(f,de)|0))<<13)|0;c=((o=o+Math.imul(f,fe)|0)+(i>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,n=Math.imul(L,F),i=(i=Math.imul(L,z))+Math.imul($,F)|0,o=Math.imul($,z),n=n+Math.imul(N,W)|0,i=(i=i+Math.imul(N,V)|0)+Math.imul(B,W)|0,o=o+Math.imul(B,V)|0,n=n+Math.imul(I,q)|0,i=(i=i+Math.imul(I,G)|0)+Math.imul(D,q)|0,o=o+Math.imul(D,G)|0,n=n+Math.imul(S,X)|0,i=(i=i+Math.imul(S,J)|0)+Math.imul(C,X)|0,o=o+Math.imul(C,J)|0,n=n+Math.imul(j,Q)|0,i=(i=i+Math.imul(j,ee)|0)+Math.imul(k,Q)|0,o=o+Math.imul(k,ee)|0,n=n+Math.imul(O,re)|0,i=(i=i+Math.imul(O,ne)|0)+Math.imul(E,re)|0,o=o+Math.imul(E,ne)|0,n=n+Math.imul(w,oe)|0,i=(i=i+Math.imul(w,se)|0)+Math.imul(M,oe)|0,o=o+Math.imul(M,se)|0,n=n+Math.imul(y,ue)|0,i=(i=i+Math.imul(y,ce)|0)+Math.imul(v,ue)|0,o=o+Math.imul(v,ce)|0,n=n+Math.imul(p,de)|0,i=(i=i+Math.imul(p,fe)|0)+Math.imul(m,de)|0,o=o+Math.imul(m,fe)|0;var Te=(c+(n=n+Math.imul(d,pe)|0)|0)+((8191&(i=(i=i+Math.imul(d,me)|0)+Math.imul(f,pe)|0))<<13)|0;c=((o=o+Math.imul(f,me)|0)+(i>>>13)|0)+(Te>>>26)|0,Te&=67108863,n=Math.imul(L,W),i=(i=Math.imul(L,V))+Math.imul($,W)|0,o=Math.imul($,V),n=n+Math.imul(N,q)|0,i=(i=i+Math.imul(N,G)|0)+Math.imul(B,q)|0,o=o+Math.imul(B,G)|0,n=n+Math.imul(I,X)|0,i=(i=i+Math.imul(I,J)|0)+Math.imul(D,X)|0,o=o+Math.imul(D,J)|0,n=n+Math.imul(S,Q)|0,i=(i=i+Math.imul(S,ee)|0)+Math.imul(C,Q)|0,o=o+Math.imul(C,ee)|0,n=n+Math.imul(j,re)|0,i=(i=i+Math.imul(j,ne)|0)+Math.imul(k,re)|0,o=o+Math.imul(k,ne)|0,n=n+Math.imul(O,oe)|0,i=(i=i+Math.imul(O,se)|0)+Math.imul(E,oe)|0,o=o+Math.imul(E,se)|0,n=n+Math.imul(w,ue)|0,i=(i=i+Math.imul(w,ce)|0)+Math.imul(M,ue)|0,o=o+Math.imul(M,ce)|0,n=n+Math.imul(y,de)|0,i=(i=i+Math.imul(y,fe)|0)+Math.imul(v,de)|0,o=o+Math.imul(v,fe)|0;var je=(c+(n=n+Math.imul(p,pe)|0)|0)+((8191&(i=(i=i+Math.imul(p,me)|0)+Math.imul(m,pe)|0))<<13)|0;c=((o=o+Math.imul(m,me)|0)+(i>>>13)|0)+(je>>>26)|0,je&=67108863,n=Math.imul(L,q),i=(i=Math.imul(L,G))+Math.imul($,q)|0,o=Math.imul($,G),n=n+Math.imul(N,X)|0,i=(i=i+Math.imul(N,J)|0)+Math.imul(B,X)|0,o=o+Math.imul(B,J)|0,n=n+Math.imul(I,Q)|0,i=(i=i+Math.imul(I,ee)|0)+Math.imul(D,Q)|0,o=o+Math.imul(D,ee)|0,n=n+Math.imul(S,re)|0,i=(i=i+Math.imul(S,ne)|0)+Math.imul(C,re)|0,o=o+Math.imul(C,ne)|0,n=n+Math.imul(j,oe)|0,i=(i=i+Math.imul(j,se)|0)+Math.imul(k,oe)|0,o=o+Math.imul(k,se)|0,n=n+Math.imul(O,ue)|0,i=(i=i+Math.imul(O,ce)|0)+Math.imul(E,ue)|0,o=o+Math.imul(E,ce)|0,n=n+Math.imul(w,de)|0,i=(i=i+Math.imul(w,fe)|0)+Math.imul(M,de)|0,o=o+Math.imul(M,fe)|0;var ke=(c+(n=n+Math.imul(y,pe)|0)|0)+((8191&(i=(i=i+Math.imul(y,me)|0)+Math.imul(v,pe)|0))<<13)|0;c=((o=o+Math.imul(v,me)|0)+(i>>>13)|0)+(ke>>>26)|0,ke&=67108863,n=Math.imul(L,X),i=(i=Math.imul(L,J))+Math.imul($,X)|0,o=Math.imul($,J),n=n+Math.imul(N,Q)|0,i=(i=i+Math.imul(N,ee)|0)+Math.imul(B,Q)|0,o=o+Math.imul(B,ee)|0,n=n+Math.imul(I,re)|0,i=(i=i+Math.imul(I,ne)|0)+Math.imul(D,re)|0,o=o+Math.imul(D,ne)|0,n=n+Math.imul(S,oe)|0,i=(i=i+Math.imul(S,se)|0)+Math.imul(C,oe)|0,o=o+Math.imul(C,se)|0,n=n+Math.imul(j,ue)|0,i=(i=i+Math.imul(j,ce)|0)+Math.imul(k,ue)|0,o=o+Math.imul(k,ce)|0,n=n+Math.imul(O,de)|0,i=(i=i+Math.imul(O,fe)|0)+Math.imul(E,de)|0,o=o+Math.imul(E,fe)|0;var xe=(c+(n=n+Math.imul(w,pe)|0)|0)+((8191&(i=(i=i+Math.imul(w,me)|0)+Math.imul(M,pe)|0))<<13)|0;c=((o=o+Math.imul(M,me)|0)+(i>>>13)|0)+(xe>>>26)|0,xe&=67108863,n=Math.imul(L,Q),i=(i=Math.imul(L,ee))+Math.imul($,Q)|0,o=Math.imul($,ee),n=n+Math.imul(N,re)|0,i=(i=i+Math.imul(N,ne)|0)+Math.imul(B,re)|0,o=o+Math.imul(B,ne)|0,n=n+Math.imul(I,oe)|0,i=(i=i+Math.imul(I,se)|0)+Math.imul(D,oe)|0,o=o+Math.imul(D,se)|0,n=n+Math.imul(S,ue)|0,i=(i=i+Math.imul(S,ce)|0)+Math.imul(C,ue)|0,o=o+Math.imul(C,ce)|0,n=n+Math.imul(j,de)|0,i=(i=i+Math.imul(j,fe)|0)+Math.imul(k,de)|0,o=o+Math.imul(k,fe)|0;var Se=(c+(n=n+Math.imul(O,pe)|0)|0)+((8191&(i=(i=i+Math.imul(O,me)|0)+Math.imul(E,pe)|0))<<13)|0;c=((o=o+Math.imul(E,me)|0)+(i>>>13)|0)+(Se>>>26)|0,Se&=67108863,n=Math.imul(L,re),i=(i=Math.imul(L,ne))+Math.imul($,re)|0,o=Math.imul($,ne),n=n+Math.imul(N,oe)|0,i=(i=i+Math.imul(N,se)|0)+Math.imul(B,oe)|0,o=o+Math.imul(B,se)|0,n=n+Math.imul(I,ue)|0,i=(i=i+Math.imul(I,ce)|0)+Math.imul(D,ue)|0,o=o+Math.imul(D,ce)|0,n=n+Math.imul(S,de)|0,i=(i=i+Math.imul(S,fe)|0)+Math.imul(C,de)|0,o=o+Math.imul(C,fe)|0;var Ce=(c+(n=n+Math.imul(j,pe)|0)|0)+((8191&(i=(i=i+Math.imul(j,me)|0)+Math.imul(k,pe)|0))<<13)|0;c=((o=o+Math.imul(k,me)|0)+(i>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,n=Math.imul(L,oe),i=(i=Math.imul(L,se))+Math.imul($,oe)|0,o=Math.imul($,se),n=n+Math.imul(N,ue)|0,i=(i=i+Math.imul(N,ce)|0)+Math.imul(B,ue)|0,o=o+Math.imul(B,ce)|0,n=n+Math.imul(I,de)|0,i=(i=i+Math.imul(I,fe)|0)+Math.imul(D,de)|0,o=o+Math.imul(D,fe)|0;var Ae=(c+(n=n+Math.imul(S,pe)|0)|0)+((8191&(i=(i=i+Math.imul(S,me)|0)+Math.imul(C,pe)|0))<<13)|0;c=((o=o+Math.imul(C,me)|0)+(i>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,n=Math.imul(L,ue),i=(i=Math.imul(L,ce))+Math.imul($,ue)|0,o=Math.imul($,ce),n=n+Math.imul(N,de)|0,i=(i=i+Math.imul(N,fe)|0)+Math.imul(B,de)|0,o=o+Math.imul(B,fe)|0;var Ie=(c+(n=n+Math.imul(I,pe)|0)|0)+((8191&(i=(i=i+Math.imul(I,me)|0)+Math.imul(D,pe)|0))<<13)|0;c=((o=o+Math.imul(D,me)|0)+(i>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,n=Math.imul(L,de),i=(i=Math.imul(L,fe))+Math.imul($,de)|0,o=Math.imul($,fe);var De=(c+(n=n+Math.imul(N,pe)|0)|0)+((8191&(i=(i=i+Math.imul(N,me)|0)+Math.imul(B,pe)|0))<<13)|0;c=((o=o+Math.imul(B,me)|0)+(i>>>13)|0)+(De>>>26)|0,De&=67108863;var Pe=(c+(n=Math.imul(L,pe))|0)+((8191&(i=(i=Math.imul(L,me))+Math.imul($,pe)|0))<<13)|0;return c=((o=Math.imul($,me))+(i>>>13)|0)+(Pe>>>26)|0,Pe&=67108863,u[0]=ge,u[1]=ye,u[2]=ve,u[3]=be,u[4]=we,u[5]=Me,u[6]=_e,u[7]=Oe,u[8]=Ee,u[9]=Te,u[10]=je,u[11]=ke,u[12]=xe,u[13]=Se,u[14]=Ce,u[15]=Ae,u[16]=Ie,u[17]=De,u[18]=Pe,0!==c&&(u[19]=c,r.length++),r};function y(e,t,r){r.negative=t.negative^e.negative,r.length=e.length+t.length;for(var n=0,i=0,o=0;o<r.length-1;o++){var s=i;i=0;for(var a=67108863&n,u=Math.min(o,t.length-1),c=Math.max(0,o-e.length+1);c<=u;c++){var l=o-c,d=(0|e.words[l])*(0|t.words[c]),f=67108863&d;a=67108863&(f=f+a|0),i+=(s=(s=s+(d/67108864|0)|0)+(f>>>26)|0)>>>26,s&=67108863}r.words[o]=a,n=s,s=i}return 0!==n?r.words[o]=n:r.length--,r._strip()}function v(e,t,r){return y(e,t,r)}function b(e,t){this.x=e,this.y=t}Math.imul||(g=m),o.prototype.mulTo=function(e,t){var r=this.length+e.length;return 10===this.length&&10===e.length?g(this,e,t):r<63?m(this,e,t):r<1024?y(this,e,t):v(this,e,t)},b.prototype.makeRBT=function(e){for(var t=new Array(e),r=o.prototype._countBits(e)-1,n=0;n<e;n++)t[n]=this.revBin(n,r,e);return t},b.prototype.revBin=function(e,t,r){if(0===e||e===r-1)return e;for(var n=0,i=0;i<t;i++)n|=(1&e)<<t-i-1,e>>=1;return n},b.prototype.permute=function(e,t,r,n,i,o){for(var s=0;s<o;s++)n[s]=t[e[s]],i[s]=r[e[s]]},b.prototype.transform=function(e,t,r,n,i,o){this.permute(o,e,t,r,n,i);for(var s=1;s<i;s<<=1)for(var a=s<<1,u=Math.cos(2*Math.PI/a),c=Math.sin(2*Math.PI/a),l=0;l<i;l+=a)for(var d=u,f=c,h=0;h<s;h++){var p=r[l+h],m=n[l+h],g=r[l+h+s],y=n[l+h+s],v=d*g-f*y;y=d*y+f*g,g=v,r[l+h]=p+g,n[l+h]=m+y,r[l+h+s]=p-g,n[l+h+s]=m-y,h!==a&&(v=u*d-c*f,f=u*f+c*d,d=v)}},b.prototype.guessLen13b=function(e,t){var r=1|Math.max(t,e),n=1&r,i=0;for(r=r/2|0;r;r>>>=1)i++;return 1<<i+1+n},b.prototype.conjugate=function(e,t,r){if(!(r<=1))for(var n=0;n<r/2;n++){var i=e[n];e[n]=e[r-n-1],e[r-n-1]=i,i=t[n],t[n]=-t[r-n-1],t[r-n-1]=-i}},b.prototype.normalize13b=function(e,t){for(var r=0,n=0;n<t/2;n++){var i=8192*Math.round(e[2*n+1]/t)+Math.round(e[2*n]/t)+r;e[n]=67108863&i,r=i<67108864?0:i/67108864|0}return e},b.prototype.convert13b=function(e,t,r,i){for(var o=0,s=0;s<t;s++)o+=0|e[s],r[2*s]=8191&o,o>>>=13,r[2*s+1]=8191&o,o>>>=13;for(s=2*t;s<i;++s)r[s]=0;n(0===o),n(0==(-8192&o))},b.prototype.stub=function(e){for(var t=new Array(e),r=0;r<e;r++)t[r]=0;return t},b.prototype.mulp=function(e,t,r){var n=2*this.guessLen13b(e.length,t.length),i=this.makeRBT(n),o=this.stub(n),s=new Array(n),a=new Array(n),u=new Array(n),c=new Array(n),l=new Array(n),d=new Array(n),f=r.words;f.length=n,this.convert13b(e.words,e.length,s,n),this.convert13b(t.words,t.length,c,n),this.transform(s,o,a,u,n,i),this.transform(c,o,l,d,n,i);for(var h=0;h<n;h++){var p=a[h]*l[h]-u[h]*d[h];u[h]=a[h]*d[h]+u[h]*l[h],a[h]=p}return this.conjugate(a,u,n),this.transform(a,u,f,o,n,i),this.conjugate(f,o,n),this.normalize13b(f,n),r.negative=e.negative^t.negative,r.length=e.length+t.length,r._strip()},o.prototype.mul=function(e){var t=new o(null);return t.words=new Array(this.length+e.length),this.mulTo(e,t)},o.prototype.mulf=function(e){var t=new o(null);return t.words=new Array(this.length+e.length),v(this,e,t)},o.prototype.imul=function(e){return this.clone().mulTo(e,this)},o.prototype.imuln=function(e){var t=e<0;t&&(e=-e),n("number"==typeof e),n(e<67108864);for(var r=0,i=0;i<this.length;i++){var o=(0|this.words[i])*e,s=(67108863&o)+(67108863&r);r>>=26,r+=o/67108864|0,r+=s>>>26,this.words[i]=67108863&s}return 0!==r&&(this.words[i]=r,this.length++),t?this.ineg():this},o.prototype.muln=function(e){return this.clone().imuln(e)},o.prototype.sqr=function(){return this.mul(this)},o.prototype.isqr=function(){return this.imul(this.clone())},o.prototype.pow=function(e){var t=function(e){for(var t=new Array(e.bitLength()),r=0;r<t.length;r++){var n=r/26|0,i=r%26;t[r]=e.words[n]>>>i&1}return t}(e);if(0===t.length)return new o(1);for(var r=this,n=0;n<t.length&&0===t[n];n++,r=r.sqr());if(++n<t.length)for(var i=r.sqr();n<t.length;n++,i=i.sqr())0!==t[n]&&(r=r.mul(i));return r},o.prototype.iushln=function(e){n("number"==typeof e&&e>=0);var t,r=e%26,i=(e-r)/26,o=67108863>>>26-r<<26-r;if(0!==r){var s=0;for(t=0;t<this.length;t++){var a=this.words[t]&o,u=(0|this.words[t])-a<<r;this.words[t]=u|s,s=a>>>26-r}s&&(this.words[t]=s,this.length++)}if(0!==i){for(t=this.length-1;t>=0;t--)this.words[t+i]=this.words[t];for(t=0;t<i;t++)this.words[t]=0;this.length+=i}return this._strip()},o.prototype.ishln=function(e){return n(0===this.negative),this.iushln(e)},o.prototype.iushrn=function(e,t,r){var i;n("number"==typeof e&&e>=0),i=t?(t-t%26)/26:0;var o=e%26,s=Math.min((e-o)/26,this.length),a=67108863^67108863>>>o<<o,u=r;if(i-=s,i=Math.max(0,i),u){for(var c=0;c<s;c++)u.words[c]=this.words[c];u.length=s}if(0===s);else if(this.length>s)for(this.length-=s,c=0;c<this.length;c++)this.words[c]=this.words[c+s];else this.words[0]=0,this.length=1;var l=0;for(c=this.length-1;c>=0&&(0!==l||c>=i);c--){var d=0|this.words[c];this.words[c]=l<<26-o|d>>>o,l=d&a}return u&&0!==l&&(u.words[u.length++]=l),0===this.length&&(this.words[0]=0,this.length=1),this._strip()},o.prototype.ishrn=function(e,t,r){return n(0===this.negative),this.iushrn(e,t,r)},o.prototype.shln=function(e){return this.clone().ishln(e)},o.prototype.ushln=function(e){return this.clone().iushln(e)},o.prototype.shrn=function(e){return this.clone().ishrn(e)},o.prototype.ushrn=function(e){return this.clone().iushrn(e)},o.prototype.testn=function(e){n("number"==typeof e&&e>=0);var t=e%26,r=(e-t)/26,i=1<<t;return!(this.length<=r)&&!!(this.words[r]&i)},o.prototype.imaskn=function(e){n("number"==typeof e&&e>=0);var t=e%26,r=(e-t)/26;if(n(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==t&&r++,this.length=Math.min(r,this.length),0!==t){var i=67108863^67108863>>>t<<t;this.words[this.length-1]&=i}return this._strip()},o.prototype.maskn=function(e){return this.clone().imaskn(e)},o.prototype.iaddn=function(e){return n("number"==typeof e),n(e<67108864),e<0?this.isubn(-e):0!==this.negative?1===this.length&&(0|this.words[0])<=e?(this.words[0]=e-(0|this.words[0]),this.negative=0,this):(this.negative=0,this.isubn(e),this.negative=1,this):this._iaddn(e)},o.prototype._iaddn=function(e){this.words[0]+=e;for(var t=0;t<this.length&&this.words[t]>=67108864;t++)this.words[t]-=67108864,t===this.length-1?this.words[t+1]=1:this.words[t+1]++;return this.length=Math.max(this.length,t+1),this},o.prototype.isubn=function(e){if(n("number"==typeof e),n(e<67108864),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var t=0;t<this.length&&this.words[t]<0;t++)this.words[t]+=67108864,this.words[t+1]-=1;return this._strip()},o.prototype.addn=function(e){return this.clone().iaddn(e)},o.prototype.subn=function(e){return this.clone().isubn(e)},o.prototype.iabs=function(){return this.negative=0,this},o.prototype.abs=function(){return this.clone().iabs()},o.prototype._ishlnsubmul=function(e,t,r){var i,o,s=e.length+r;this._expand(s);var a=0;for(i=0;i<e.length;i++){o=(0|this.words[i+r])+a;var u=(0|e.words[i])*t;a=((o-=67108863&u)>>26)-(u/67108864|0),this.words[i+r]=67108863&o}for(;i<this.length-r;i++)a=(o=(0|this.words[i+r])+a)>>26,this.words[i+r]=67108863&o;if(0===a)return this._strip();for(n(-1===a),a=0,i=0;i<this.length;i++)a=(o=-(0|this.words[i])+a)>>26,this.words[i]=67108863&o;return this.negative=1,this._strip()},o.prototype._wordDiv=function(e,t){var r=(this.length,e.length),n=this.clone(),i=e,s=0|i.words[i.length-1];0!==(r=26-this._countBits(s))&&(i=i.ushln(r),n.iushln(r),s=0|i.words[i.length-1]);var a,u=n.length-i.length;if("mod"!==t){(a=new o(null)).length=u+1,a.words=new Array(a.length);for(var c=0;c<a.length;c++)a.words[c]=0}var l=n.clone()._ishlnsubmul(i,1,u);0===l.negative&&(n=l,a&&(a.words[u]=1));for(var d=u-1;d>=0;d--){var f=67108864*(0|n.words[i.length+d])+(0|n.words[i.length+d-1]);for(f=Math.min(f/s|0,67108863),n._ishlnsubmul(i,f,d);0!==n.negative;)f--,n.negative=0,n._ishlnsubmul(i,1,d),n.isZero()||(n.negative^=1);a&&(a.words[d]=f)}return a&&a._strip(),n._strip(),"div"!==t&&0!==r&&n.iushrn(r),{div:a||null,mod:n}},o.prototype.divmod=function(e,t,r){return n(!e.isZero()),this.isZero()?{div:new o(0),mod:new o(0)}:0!==this.negative&&0===e.negative?(a=this.neg().divmod(e,t),"mod"!==t&&(i=a.div.neg()),"div"!==t&&(s=a.mod.neg(),r&&0!==s.negative&&s.iadd(e)),{div:i,mod:s}):0===this.negative&&0!==e.negative?(a=this.divmod(e.neg(),t),"mod"!==t&&(i=a.div.neg()),{div:i,mod:a.mod}):0!=(this.negative&e.negative)?(a=this.neg().divmod(e.neg(),t),"div"!==t&&(s=a.mod.neg(),r&&0!==s.negative&&s.isub(e)),{div:a.div,mod:s}):e.length>this.length||this.cmp(e)<0?{div:new o(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new o(this.modrn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new o(this.modrn(e.words[0]))}:this._wordDiv(e,t);var i,s,a},o.prototype.div=function(e){return this.divmod(e,"div",!1).div},o.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},o.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},o.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var r=0!==t.div.negative?t.mod.isub(e):t.mod,n=e.ushrn(1),i=e.andln(1),o=r.cmp(n);return o<0||1===i&&0===o?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},o.prototype.modrn=function(e){var t=e<0;t&&(e=-e),n(e<=67108863);for(var r=(1<<26)%e,i=0,o=this.length-1;o>=0;o--)i=(r*i+(0|this.words[o]))%e;return t?-i:i},o.prototype.modn=function(e){return this.modrn(e)},o.prototype.idivn=function(e){var t=e<0;t&&(e=-e),n(e<=67108863);for(var r=0,i=this.length-1;i>=0;i--){var o=(0|this.words[i])+67108864*r;this.words[i]=o/e|0,r=o%e}return this._strip(),t?this.ineg():this},o.prototype.divn=function(e){return this.clone().idivn(e)},o.prototype.egcd=function(e){n(0===e.negative),n(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var i=new o(1),s=new o(0),a=new o(0),u=new o(1),c=0;t.isEven()&&r.isEven();)t.iushrn(1),r.iushrn(1),++c;for(var l=r.clone(),d=t.clone();!t.isZero();){for(var f=0,h=1;0==(t.words[0]&h)&&f<26;++f,h<<=1);if(f>0)for(t.iushrn(f);f-- >0;)(i.isOdd()||s.isOdd())&&(i.iadd(l),s.isub(d)),i.iushrn(1),s.iushrn(1);for(var p=0,m=1;0==(r.words[0]&m)&&p<26;++p,m<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(a.isOdd()||u.isOdd())&&(a.iadd(l),u.isub(d)),a.iushrn(1),u.iushrn(1);t.cmp(r)>=0?(t.isub(r),i.isub(a),s.isub(u)):(r.isub(t),a.isub(i),u.isub(s))}return{a:a,b:u,gcd:r.iushln(c)}},o.prototype._invmp=function(e){n(0===e.negative),n(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var i,s=new o(1),a=new o(0),u=r.clone();t.cmpn(1)>0&&r.cmpn(1)>0;){for(var c=0,l=1;0==(t.words[0]&l)&&c<26;++c,l<<=1);if(c>0)for(t.iushrn(c);c-- >0;)s.isOdd()&&s.iadd(u),s.iushrn(1);for(var d=0,f=1;0==(r.words[0]&f)&&d<26;++d,f<<=1);if(d>0)for(r.iushrn(d);d-- >0;)a.isOdd()&&a.iadd(u),a.iushrn(1);t.cmp(r)>=0?(t.isub(r),s.isub(a)):(r.isub(t),a.isub(s))}return(i=0===t.cmpn(1)?s:a).cmpn(0)<0&&i.iadd(e),i},o.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone(),r=e.clone();t.negative=0,r.negative=0;for(var n=0;t.isEven()&&r.isEven();n++)t.iushrn(1),r.iushrn(1);for(;;){for(;t.isEven();)t.iushrn(1);for(;r.isEven();)r.iushrn(1);var i=t.cmp(r);if(i<0){var o=t;t=r,r=o}else if(0===i||0===r.cmpn(1))break;t.isub(r)}return r.iushln(n)},o.prototype.invm=function(e){return this.egcd(e).a.umod(e)},o.prototype.isEven=function(){return 0==(1&this.words[0])},o.prototype.isOdd=function(){return 1==(1&this.words[0])},o.prototype.andln=function(e){return this.words[0]&e},o.prototype.bincn=function(e){n("number"==typeof e);var t=e%26,r=(e-t)/26,i=1<<t;if(this.length<=r)return this._expand(r+1),this.words[r]|=i,this;for(var o=i,s=r;0!==o&&s<this.length;s++){var a=0|this.words[s];o=(a+=o)>>>26,a&=67108863,this.words[s]=a}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(e){var t,r=e<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this._strip(),this.length>1)t=1;else{r&&(e=-e),n(e<=67108863,"Number is too big");var i=0|this.words[0];t=i===e?0:i<e?-1:1}return 0!==this.negative?0|-t:t},o.prototype.cmp=function(e){if(0!==this.negative&&0===e.negative)return-1;if(0===this.negative&&0!==e.negative)return 1;var t=this.ucmp(e);return 0!==this.negative?0|-t:t},o.prototype.ucmp=function(e){if(this.length>e.length)return 1;if(this.length<e.length)return-1;for(var t=0,r=this.length-1;r>=0;r--){var n=0|this.words[r],i=0|e.words[r];if(n!==i){n<i?t=-1:n>i&&(t=1);break}}return t},o.prototype.gtn=function(e){return 1===this.cmpn(e)},o.prototype.gt=function(e){return 1===this.cmp(e)},o.prototype.gten=function(e){return this.cmpn(e)>=0},o.prototype.gte=function(e){return this.cmp(e)>=0},o.prototype.ltn=function(e){return-1===this.cmpn(e)},o.prototype.lt=function(e){return-1===this.cmp(e)},o.prototype.lten=function(e){return this.cmpn(e)<=0},o.prototype.lte=function(e){return this.cmp(e)<=0},o.prototype.eqn=function(e){return 0===this.cmpn(e)},o.prototype.eq=function(e){return 0===this.cmp(e)},o.red=function(e){return new j(e)},o.prototype.toRed=function(e){return n(!this.red,"Already a number in reduction context"),n(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},o.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},o.prototype._forceRed=function(e){return this.red=e,this},o.prototype.forceRed=function(e){return n(!this.red,"Already a number in reduction context"),this._forceRed(e)},o.prototype.redAdd=function(e){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},o.prototype.redIAdd=function(e){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},o.prototype.redSub=function(e){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},o.prototype.redISub=function(e){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},o.prototype.redShl=function(e){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},o.prototype.redMul=function(e){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},o.prototype.redIMul=function(e){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},o.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},o.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},o.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},o.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},o.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},o.prototype.redPow=function(e){return n(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var w={k256:null,p224:null,p192:null,p25519:null};function M(e,t){this.name=e,this.p=new o(t,16),this.n=this.p.bitLength(),this.k=new o(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function _(){M.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function O(){M.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function E(){M.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function T(){M.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function j(e){if("string"==typeof e){var t=o._prime(e);this.m=t.p,this.prime=t}else n(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function k(e){j.call(this,e),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new o(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}M.prototype._tmp=function(){var e=new o(null);return e.words=new Array(Math.ceil(this.n/13)),e},M.prototype.ireduce=function(e){var t,r=e;do{this.split(r,this.tmp),t=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(t>this.n);var n=t<this.n?-1:r.ucmp(this.p);return 0===n?(r.words[0]=0,r.length=1):n>0?r.isub(this.p):r.strip!==undefined?r.strip():r._strip(),r},M.prototype.split=function(e,t){e.iushrn(this.n,0,t)},M.prototype.imulK=function(e){return e.imul(this.k)},i(_,M),_.prototype.split=function(e,t){for(var r=4194303,n=Math.min(e.length,9),i=0;i<n;i++)t.words[i]=e.words[i];if(t.length=n,e.length<=9)return e.words[0]=0,void(e.length=1);var o=e.words[9];for(t.words[t.length++]=o&r,i=10;i<e.length;i++){var s=0|e.words[i];e.words[i-10]=(s&r)<<4|o>>>22,o=s}o>>>=22,e.words[i-10]=o,0===o&&e.length>10?e.length-=10:e.length-=9},_.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var t=0,r=0;r<e.length;r++){var n=0|e.words[r];t+=977*n,e.words[r]=67108863&t,t=64*n+(t/67108864|0)}return 0===e.words[e.length-1]&&(e.length--,0===e.words[e.length-1]&&e.length--),e},i(O,M),i(E,M),i(T,M),T.prototype.imulK=function(e){for(var t=0,r=0;r<e.length;r++){var n=19*(0|e.words[r])+t,i=67108863&n;n>>>=26,e.words[r]=i,t=n}return 0!==t&&(e.words[e.length++]=t),e},o._prime=function(e){if(w[e])return w[e];var t;if("k256"===e)t=new _;else if("p224"===e)t=new O;else if("p192"===e)t=new E;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new T}return w[e]=t,t},j.prototype._verify1=function(e){n(0===e.negative,"red works only with positives"),n(e.red,"red works only with red numbers")},j.prototype._verify2=function(e,t){n(0==(e.negative|t.negative),"red works only with positives"),n(e.red&&e.red===t.red,"red works only with red numbers")},j.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):(l(e,e.umod(this.m)._forceRed(this)),e)},j.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},j.prototype.add=function(e,t){this._verify2(e,t);var r=e.add(t);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},j.prototype.iadd=function(e,t){this._verify2(e,t);var r=e.iadd(t);return r.cmp(this.m)>=0&&r.isub(this.m),r},j.prototype.sub=function(e,t){this._verify2(e,t);var r=e.sub(t);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},j.prototype.isub=function(e,t){this._verify2(e,t);var r=e.isub(t);return r.cmpn(0)<0&&r.iadd(this.m),r},j.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},j.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},j.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},j.prototype.isqr=function(e){return this.imul(e,e.clone())},j.prototype.sqr=function(e){return this.mul(e,e)},j.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(n(t%2==1),3===t){var r=this.m.add(new o(1)).iushrn(2);return this.pow(e,r)}for(var i=this.m.subn(1),s=0;!i.isZero()&&0===i.andln(1);)s++,i.iushrn(1);n(!i.isZero());var a=new o(1).toRed(this),u=a.redNeg(),c=this.m.subn(1).iushrn(1),l=this.m.bitLength();for(l=new o(2*l*l).toRed(this);0!==this.pow(l,c).cmp(u);)l.redIAdd(u);for(var d=this.pow(l,i),f=this.pow(e,i.addn(1).iushrn(1)),h=this.pow(e,i),p=s;0!==h.cmp(a);){for(var m=h,g=0;0!==m.cmp(a);g++)m=m.redSqr();n(g<p);var y=this.pow(d,new o(1).iushln(p-g-1));f=f.redMul(y),d=y.redSqr(),h=h.redMul(d),p=g}return f},j.prototype.invm=function(e){var t=e._invmp(this.m);return 0!==t.negative?(t.negative=0,this.imod(t).redNeg()):this.imod(t)},j.prototype.pow=function(e,t){if(t.isZero())return new o(1).toRed(this);if(0===t.cmpn(1))return e.clone();var r=new Array(16);r[0]=new o(1).toRed(this),r[1]=e;for(var n=2;n<r.length;n++)r[n]=this.mul(r[n-1],e);var i=r[0],s=0,a=0,u=t.bitLength()%26;for(0===u&&(u=26),n=t.length-1;n>=0;n--){for(var c=t.words[n],l=u-1;l>=0;l--){var d=c>>l&1;i!==r[0]&&(i=this.sqr(i)),0!==d||0!==s?(s<<=1,s|=d,(4===++a||0===n&&0===l)&&(i=this.mul(i,r[s]),a=0,s=0)):a=0}u=26}return i},j.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},j.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},o.mont=function(e){return new k(e)},i(k,j),k.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},k.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},k.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var r=e.imul(t),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),o=i;return i.cmp(this.m)>=0?o=i.isub(this.m):i.cmpn(0)<0&&(o=i.iadd(this.m)),o._forceRed(this)},k.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new o(0)._forceRed(this);var r=e.mul(t),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),s=i;return i.cmp(this.m)>=0?s=i.isub(this.m):i.cmpn(0)<0&&(s=i.iadd(this.m)),s._forceRed(this)},k.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(void 0===t||t,this)}}},{package:"@truffle/decoder>bn.js",file:"node_modules/@truffle/decoder/node_modules/bn.js/lib/bn.js"}],[1644,{debug:2075},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))},i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(r,"__esModule",{value:!0}),r.ProviderAdapter=void 0;(0,i(e("debug")).default)("decoder:adapter");const o=["latest","pending","genesis","earliest"],s=e=>{if("string"==typeof e&&o.includes(e))return"genesis"===e?"earliest":e;if("string"!=typeof e||isNaN(parseInt(e))){if("number"==typeof e)return`0x${e.toString(16)}`;throw new Error("The block specified must be a number or one of the strings 'latest',"+"'pending', or 'earliest'.")}return e.startsWith("0x")?e:`0x${parseInt(e).toString(16)}`},a=e=>Object.assign(Object.assign({},e),{number:parseInt(e.number),size:parseInt(e.size),gasLimit:parseInt(e.gasLimit),gasUsed:parseInt(e.gasUsed),timestamp:parseInt(e.timestamp)});r.ProviderAdapter=class{constructor(e){this.provider=e}sendRequest({method:e,params:t,formatOutput:r}){return n(this,void 0,void 0,(function*(){if(!this.provider)throw new Error("There is not a valid provider present.");let n;if("request"in this.provider)n=yield this.provider.request({method:e,params:t});else{const r=("sendAsync"in this.provider?this.provider.sendAsync:this.provider.send).bind(this.provider);n=yield new Promise(((n,i)=>r({jsonrpc:"2.0",id:(new Date).getTime(),method:e,params:t},((e,t)=>{if(e)return i(e);const{result:r}=t;n(r)}))))}return r?r(n):n}))}getCode(e,t){return n(this,void 0,void 0,(function*(){const r=s(t);return yield this.sendRequest({method:"eth_getCode",params:[e,r]})}))}getBlockByNumber(e){return n(this,void 0,void 0,(function*(){const t=s(e);return yield this.sendRequest({method:"eth_getBlockByNumber",params:[t,!1],formatOutput:a})}))}getPastLogs({address:e,fromBlock:t,toBlock:r}){return n(this,void 0,void 0,(function*(){return yield this.sendRequest({method:"eth_getLogs",params:[{fromBlock:t,toBlock:r,address:e}]})}))}getNetworkId(){return n(this,void 0,void 0,(function*(){return yield this.sendRequest({method:"net_version",params:[],formatOutput:e=>parseInt(e)})}))}getBlockNumber(){return n(this,void 0,void 0,(function*(){return yield this.sendRequest({method:"eth_blockNumber",params:[],formatOutput:e=>parseInt(e)})}))}getBalance(e,t){return n(this,void 0,void 0,(function*(){return yield this.sendRequest({method:"eth_getBalance",params:[e,s(t)],formatOutput:e=>parseInt(e).toString()})}))}getTransactionCount(e,t){return n(this,void 0,void 0,(function*(){return yield this.sendRequest({method:"eth_getTransactionCount",params:[e,s(t)],formatOutput:e=>parseInt(e).toString()})}))}getStorageAt(e,t,r){return n(this,void 0,void 0,(function*(){return yield this.sendRequest({method:"eth_getStorageAt",params:[e,`0x${t.toString(16)}`,s(r)]})}))}}}}},{package:"@truffle/decoder>@truffle/encoder",file:"node_modules/@truffle/encoder/dist/adapter.js"}],[1645,{"./adapter":1644,"./errors":1646,"./utils":1648,"@ensdomains/ensjs":297,"@ethersproject/address":403,"@ethersproject/bignumber":410,"@truffle/abi-utils":1488,"@truffle/codec":1547,"@truffle/compile-common":1634,"big.js":1649,debug:2075,"web3-utils":3381},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){n===undefined&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){n===undefined&&(n=r),e[n]=t[r]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&n(t,e,r);return i(t,e),t},s=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))},a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(r,"__esModule",{value:!0}),r.ContractInstanceEncoder=r.ContractEncoder=r.ProjectEncoder=void 0;const u=(0,a(e("debug")).default)("encoder:encoders"),c=e("@ethersproject/bignumber"),l=e("@ethersproject/address"),d=o(e("@truffle/codec")),f=o(e("@truffle/abi-utils")),h=a(e("big.js")),p=a(e("web3-utils")),m=e("./adapter"),g=o(e("./utils")),y=e("./errors"),v=e("@truffle/compile-common"),{default:b,getEnsAddress:w}=e("@ensdomains/ensjs"),M="Input value was not an integer";r.ProjectEncoder=class{constructor(e){if(this.registryAddress=undefined,this.ensCache={},this.contractsAndContexts=[],e.userDefinedTypes&&e.allocations)u("internal route!"),this.userDefinedTypes=e.userDefinedTypes,this.allocations=e.allocations;else{if(!e.compilations)throw new y.NoInternalInfoError;const t=d.Compilations.Utils.findRepeatCompilationIds(e.compilations);if(0!==t.size)throw new d.RepeatCompilationIdError([...t]);let r;this.compilations=e.compilations,({definitions:this.referenceDeclarations,types:this.userDefinedTypes}=d.Compilations.Utils.collectUserDefinedTypesAndTaggedOutputs(e.compilations)),({allocationInfo:r,contractsAndContexts:this.contractsAndContexts}=d.AbiData.Allocate.Utils.collectAllocationInfo(e.compilations)),this.allocations={},this.allocations.abi=d.AbiData.Allocate.getAbiAllocations(this.userDefinedTypes),this.allocations.calldata=d.AbiData.Allocate.getCalldataAllocations(r,this.referenceDeclarations,this.userDefinedTypes,this.allocations.abi)}this.provider=e.provider||null,u("provider: %o",this.provider),e.registryAddress!==undefined&&(this.registryAddress=e.registryAddress),u("registryAddress: %o",this.registryAddress),this.networkId=e.networkId||null}getAllocations(){return this.allocations}getUserDefinedTypes(){return this.userDefinedTypes}getNetworkId(){return this.networkId}getReferenceDeclarations(){return this.referenceDeclarations}init(){return s(this,void 0,void 0,(function*(){if(this.provider)if(u("provider given!"),this.registryAddress!==undefined)u("using custom registry address: %o",this.registryAddress),this.ens=new b({provider:this.provider,ensAddress:this.registryAddress});else{u("using default registry address");const e=yield new m.ProviderAdapter(this.provider).getNetworkId(),t=w(e);this.ens=t?new b({provider:this.provider,ensAddress:t}):null}else u("no provider given, ens off"),this.ens=null}))}wrapElementaryValue(e,t){return s(this,void 0,void 0,(function*(){return yield this.wrap(e,t)}))}wrap(e,t){return s(this,void 0,void 0,(function*(){return yield this.driveGenerator(d.Wrap.wrap(e,t,{userDefinedTypes:this.userDefinedTypes,loose:!0}))}))}wrapForTransaction(e,t,r={}){return s(this,void 0,void 0,(function*(){return u("wrapForTransaction"),yield this.driveGenerator(d.Wrap.wrapForMethod(e,t,Object.assign({userDefinedTypes:this.userDefinedTypes},r)))}))}resolveAndWrap(e,t,r={}){return s(this,void 0,void 0,(function*(){return yield this.driveGenerator(d.Wrap.resolveAndWrap(e,t,Object.assign({userDefinedTypes:this.userDefinedTypes},r)))}))}driveGenerator(e){return s(this,void 0,void 0,(function*(){let t,r=e.next();for(;!r.done;){const n=r.value;u("request: %O",n),t=yield this.respond(n),u("response: %O",t),r=e.next(t)}return u("returning: %O",r.value),r.value}))}respond(e){return s(this,void 0,void 0,(function*(){switch(e.kind){case"integer":return this.recognizeInteger(e.input);case"decimal":return this.recognizeDecimal(e.input);case"address":return yield this.recognizeAddress(e.name)}}))}encodeTxNoResolution(e,t,r={}){return s(this,void 0,void 0,(function*(){u("encoding transaction");const n=yield this.wrapForTransaction(e,t,r),i=d.AbiData.Encode.encodeTupleAbiWithSelector(n.arguments,d.Conversion.toBytes(n.method.selector),this.allocations.abi);let o=Object.assign(Object.assign({},n.options),{data:d.Conversion.toHexString(i)});return"constructor"===e.abi.type&&delete o.to,o}))}encodeTransaction(e,t,r={}){return s(this,void 0,void 0,(function*(){u("resolve & encode");const n=yield this.resolveAndWrap(e,t,r),i=d.AbiData.Encode.encodeTupleAbiWithSelector(n.arguments,d.Conversion.toBytes(n.method.selector),this.allocations.abi);return{tx:Object.assign(Object.assign({},n.options),{data:d.Conversion.toHexString(i)}),abi:n.method.abi}}))}recognizeInteger(e){if(g.isBigNumber(e))return e.isInteger()?{kind:"integer",value:BigInt(e.toFixed())}:{kind:"integer",value:null,reason:M,partiallyRecognized:!0};if(g.isEthersBigNumber(e)){const t=e.toHexString();return{kind:"integer",value:"-"===t[0]?-BigInt(t.slice(1)):BigInt(t)}}if(c.FixedNumber.isFixedNumber(e)){const t=e.toString(),r=new h.default(t);return 0===d.Conversion.countDecimalPlaces(r)?{kind:"integer",value:BigInt(r.toFixed())}:{kind:"integer",value:null,reason:M,partiallyRecognized:!0}}return{kind:"integer",value:null}}recognizeDecimal(e){return g.isBigNumber(e)?e.isFinite()?{kind:"decimal",value:new h.default(e.toFixed())}:{kind:"decimal",value:null,reason:"Input was not a finite value",partiallyRecognized:!0}:g.isEthersBigNumber(e)||c.FixedNumber.isFixedNumber(e)?{kind:"decimal",value:new h.default(e.toString())}:{kind:"decimal",value:null}}recognizeAddress(e){return s(this,void 0,void 0,(function*(){let t=null;try{return t=(0,l.getAddress)(e),{kind:"address",address:t}}catch(t){if(u("address error: %O",t),!t)throw t;switch(t.reason){case"bad address checksum":return{kind:"address",address:null,reason:d.Wrap.Messages.checksumFailedMessage,partiallyRecognized:!0};case"bad icap checksum":return{kind:"address",address:null,reason:"ICAP address had bad checksum",partiallyRecognized:!0};case"invalid address":const r=yield this.resolveENSName(e);return null!==r?{kind:"address",address:r}:{kind:"address",address:null,reason:"Input was not recognizable as an address or ENS name"};default:throw t}}}))}resolveENSName(e){return s(this,void 0,void 0,(function*(){if(null===this.ens)return null;if(e in this.ensCache)return this.ensCache[e];let t;try{t=yield this.ens.name(e).getAddress()}catch(e){t=null}return t===d.Evm.Utils.ZERO_ADDRESS&&(t=null),this.ensCache[e]=t,t}))}forArtifact(e){return s(this,void 0,void 0,(function*(){if(!this.compilations)throw new y.NoCompilationsForSpawnerError;let{compilation:t,contract:r}=d.Compilations.Utils.findCompilationAndContract(this.compilations,e);return r=Object.assign(Object.assign({},r),{abi:e.abi}),new _(this,t,r,e)}))}forContract(e){return s(this,void 0,void 0,(function*(){return yield this.forArtifact(e)}))}forInstance(e,t){return s(this,void 0,void 0,(function*(){const r=yield this.forArtifact(e);return yield r.forInstance(t)}))}forAddress(e,t="latest"){return s(this,void 0,void 0,(function*(){if(!this.compilations)throw new y.NoCompilationsForSpawnerError;if(null===this.provider)throw new y.NoNetworkError;if(!p.default.isAddress(e))throw new y.InvalidAddressError(e);e=p.default.toChecksumAddress(e);const r=yield new m.ProviderAdapter(this.provider).getCode(e,t),n=this.contractsAndContexts.find((({deployedContext:e})=>e&&d.Contexts.Utils.matchContext(e,r)));if(!n)throw new y.ContractNotFoundError(undefined,undefined,r,e);const{contract:i,compilationId:o}=n,s=this.compilations.find((e=>e.id===o));if(!s)throw new y.ContractNotFoundError(undefined,undefined,r,e);const a=new _(this,s,i);return yield a.forInstance(e)}))}};class _{constructor(e,t,r,n){this.projectEncoder=e,this.contract=r,this.abi=f.normalize(r.abi),this.artifact=n,this.compilation=t,this.contractNode=d.Compilations.Utils.getContractNode(this.contract,this.compilation);const i=this.projectEncoder.getNetworkId(),o=v.Shims.NewToLegacy.forBytecode(r.bytecode),s=v.Shims.NewToLegacy.forBytecode(r.deployedBytecode),a=null!==i&&(((n||{networks:{}}).networks||{})[i]||{links:{}}).links||{};if(this.constructorBinary=g.link(o,a),o&&"0x"!==o&&(this.constructorContextHash=d.Conversion.toHexString(d.Evm.Utils.keccak256({type:"string",value:o}))),s&&"0x"!==s)this.deployedContextHash=d.Conversion.toHexString(d.Evm.Utils.keccak256({type:"string",value:s}));else{const e=this.compilation.compiler||this.contract.compiler;this.noBytecodeAllocations=Object.values(d.AbiData.Allocate.getCalldataAllocations([{abi:this.abi,compilationId:this.compilation.id,compiler:e,contractNode:this.contractNode,deployedContext:d.Contexts.Utils.makeContext(Object.assign(Object.assign({},this.contract),{deployedBytecode:"0x"}),this.contractNode,this.compilation)}],this.projectEncoder.getReferenceDeclarations(),this.projectEncoder.getUserDefinedTypes(),this.projectEncoder.getAllocations().abi).functionAllocations)[0]}}getProjectEncoder(){return this.projectEncoder}wrapElementaryValue(e,t){return s(this,void 0,void 0,(function*(){return yield this.projectEncoder.wrapElementaryValue(e,t)}))}wrap(e,t){return s(this,void 0,void 0,(function*(){return yield this.projectEncoder.wrap(e,t)}))}wrapForTransaction(e,t,r={}){return s(this,void 0,void 0,(function*(){const n=this.getMethod(e);return yield this.projectEncoder.wrapForTransaction(n,t,r)}))}resolveAndWrap(e,t,r={}){return s(this,void 0,void 0,(function*(){const n=this.getAbis(e).map((e=>this.getMethod(e)));return yield this.projectEncoder.resolveAndWrap(n,t,r)}))}encodeTxNoResolution(e,t,r={}){return s(this,void 0,void 0,(function*(){const n=this.getMethod(e);return yield this.projectEncoder.encodeTxNoResolution(n,t,r)}))}encodeTransaction(e,t,r={}){return s(this,void 0,void 0,(function*(){const n=this.getAbis(e).map((e=>this.getMethod(e)));return yield this.projectEncoder.encodeTransaction(n,t,r)}))}encodeCreation(e,t={}){return s(this,void 0,void 0,(function*(){const r=this.getConstructorMethod();return yield this.projectEncoder.encodeTxNoResolution(r,e,t)}))}forInstance(e){return s(this,void 0,void 0,(function*(){if(e===undefined){const t=this.projectEncoder.getNetworkId();if(null===t)throw new y.NoNetworkError;if((e=((this.artifact||{networks:{}}).networks||{})[t].address)===undefined)throw new y.ContractNotDeployedError(this.contract.contractName,t)}return new O(this,e)}))}getAbis(e){const t="string"==typeof e?this.abi.filter((t=>"function"===t.type&&(t.name===e||d.AbiData.Utils.abiSignature(t)===e))):e;if("string"==typeof e&&0===t.length)throw new y.NoFunctionByThatNameError(e,this.contract.contractName);return t}getMethod(e){switch(e=f.normalizeEntry(e),u("got allocations"),e.type){case"constructor":return this.getConstructorMethod(e);case"function":const t=this.projectEncoder.getAllocations(),r=d.AbiData.Utils.abiSelector(e),n=(this.deployedContextHash?t.calldata.functionAllocations[this.deployedContextHash][r].input:this.noBytecodeAllocations[r].input).arguments.map((e=>({type:e.type,name:e.name||undefined})));return{name:e.name,selector:r,inputs:n,abi:e}}}getConstructorMethod(e){e||(e=this.getConstructorAbi());const t=this.projectEncoder.getAllocations();if(u("constructor binary: %s",this.constructorBinary),!this.constructorBinary||"0x"===this.constructorBinary)throw new y.NoBytecodeError(this.contract.contractName);if(!this.constructorBinary.match(/^0x([0-9a-fA-F]{2})+$/))throw new y.UnlinkedContractError(this.contract.contractName,this.artifact?this.artifact.bytecode:undefined);const r=t.calldata.constructorAllocations[this.constructorContextHash].input.arguments.map((e=>({type:e.type,name:e.name||undefined})));return{selector:this.constructorBinary,inputs:r,abi:e}}getConstructorAbi(){return this.abi.find((e=>"constructor"===e.type))||d.AbiData.Utils.DEFAULT_CONSTRUCTOR_ABI}}r.ContractEncoder=_;class O{constructor(e,t){if(this.contractEncoder=e,!p.default.isAddress(t))throw new y.InvalidAddressError(t);this.toAddress=p.default.toChecksumAddress(t)}wrapElementaryValue(e,t){return s(this,void 0,void 0,(function*(){return yield this.contractEncoder.wrapElementaryValue(e,t)}))}wrap(e,t){return s(this,void 0,void 0,(function*(){return yield this.contractEncoder.wrap(e,t)}))}wrapForTransaction(e,t,r={}){return s(this,void 0,void 0,(function*(){const n=yield this.contractEncoder.wrapForTransaction(e,t,r);return n.options.to||"function"!==e.type||(n.options.to=this.toAddress),n}))}resolveAndWrap(e,t,r={}){return s(this,void 0,void 0,(function*(){const n=yield this.contractEncoder.resolveAndWrap(e,t,r);return n.options.to=this.toAddress,n}))}encodeTxNoResolution(e,t,r={}){return s(this,void 0,void 0,(function*(){const n=yield this.contractEncoder.encodeTxNoResolution(e,t,r);return"function"===e.type?n.to=this.toAddress:"constructor"===e.type&&delete n.to,n}))}encodeTransaction(e,t,r={}){return s(this,void 0,void 0,(function*(){const n=yield this.contractEncoder.encodeTransaction(e,t,r);return n.tx.to=this.toAddress,n}))}encodeCreation(e,t={}){return s(this,void 0,void 0,(function*(){return yield this.contractEncoder.encodeCreation(e,t)}))}}r.ContractInstanceEncoder=O}}},{package:"@truffle/decoder>@truffle/encoder",file:"node_modules/@truffle/encoder/dist/encoders.js"}],[1646,{},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.ContractNotFoundError=r.NoNetworkError=r.NoBytecodeError=r.ContractNotDeployedError=r.UnlinkedContractError=r.InvalidAddressError=r.NoFunctionByThatNameError=r.NoCompilationsForSpawnerError=r.NoInternalInfoError=void 0;class n extends Error{constructor(){super("No compilations provided, but userDefinedTypes or allocations is missing"),this.name="NoInternalInfoError"}}r.NoInternalInfoError=n;class i extends Error{constructor(){super("Contract decoders cannot be spawned without compilations info"),this.name="NoCompilationsForSpawnerError"}}r.NoCompilationsForSpawnerError=i;class o extends Error{constructor(e,t){super(t?`Contract ${t} has no function with name or signature ${e}`:`This contract has no function with name or signature ${e}`),this.functionNameOrSig=e,this.contractName=t,this.name="NoFunctionByThatNameError"}}r.NoFunctionByThatNameError=o;class s extends Error{constructor(e){super(`Invalid address ${e}`),this.address=e,this.name="InvalidAddressError"}}r.InvalidAddressError=s;class a extends Error{constructor(e,t){super(`Contract ${e!==undefined?e+" ":""}has not had all its libraries linked`),this.contractName=e,this.bytecode=t,this.name="UnlinkedContractError"}}r.UnlinkedContractError=a;class u extends Error{constructor(e,t){super(`Contract ${e!==undefined?e+" ":""}has not been deployed to network ${t} with deployer; address must be given explicitly`),this.contractName=e,this.name="ContractNotDeployedError"}}r.ContractNotDeployedError=u;class c extends Error{constructor(e){super(`Contract ${e!==undefined?e+" ":""}has missing or empty constructor bytecode`),this.contractName=e,this.name="NoBytecodeError"}}r.NoBytecodeError=c;class l extends Error{constructor(){super("This operation requires a provider or network ID."),this.name="NoNetworkError"}}r.NoNetworkError=l;class d extends Error{constructor(e,t,r,n){let i;i=e?`Contract ${e} could not be found in the project information`:n?`Contract at ${n} could not be found in the project information`:"Contract could not be found in the project information",super(i),this.contractName=e,this.bytecode=t,this.deployedBytecode=r,this.name="ContractNotFoundError"}}r.ContractNotFoundError=d}}},{package:"@truffle/decoder>@truffle/encoder",file:"node_modules/@truffle/encoder/dist/errors.js"}],[1647,{"./adapter":1644,"./encoders":1645,"./errors":1646,"@truffle/codec":1547},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(r,"__esModule",{value:!0}),r.forContractInstance=r.forContractAt=r.forArtifactAt=r.forDeployedContract=r.forDeployedArtifact=r.forContract=r.forArtifact=r.forProjectInternal=r.forProject=r.ProviderAdapter=r.ContractNotDeployedError=r.ContractNotFoundError=r.UnlinkedContractError=r.NoInternalInfoError=r.InvalidAddressError=r.ContractInstanceEncoder=r.ContractEncoder=r.ProjectEncoder=void 0;const i=e("./encoders");Object.defineProperty(r,"ProjectEncoder",{enumerable:!0,get:function(){return i.ProjectEncoder}}),Object.defineProperty(r,"ContractEncoder",{enumerable:!0,get:function(){return i.ContractEncoder}}),Object.defineProperty(r,"ContractInstanceEncoder",{enumerable:!0,get:function(){return i.ContractInstanceEncoder}});var o=e("./errors");Object.defineProperty(r,"InvalidAddressError",{enumerable:!0,get:function(){return o.InvalidAddressError}}),Object.defineProperty(r,"NoInternalInfoError",{enumerable:!0,get:function(){return o.NoInternalInfoError}}),Object.defineProperty(r,"UnlinkedContractError",{enumerable:!0,get:function(){return o.UnlinkedContractError}}),Object.defineProperty(r,"ContractNotFoundError",{enumerable:!0,get:function(){return o.ContractNotFoundError}}),Object.defineProperty(r,"ContractNotDeployedError",{enumerable:!0,get:function(){return o.ContractNotDeployedError}});const s=e("./adapter");Object.defineProperty(r,"ProviderAdapter",{enumerable:!0,get:function(){return s.ProviderAdapter}});const a=e("@truffle/codec");function u(e){return n(this,void 0,void 0,(function*(){const t=a.Compilations.Utils.infoToCompilations(e.projectInfo),r=function(e){return e.ens?e.ens:{provider:e.provider}}(e),o=yield function(e){return n(this,void 0,void 0,(function*(){return e.networkId!==undefined?e.networkId:e.provider?yield new s.ProviderAdapter(e.provider).getNetworkId():null}))}(e),u=new i.ProjectEncoder(Object.assign({compilations:t,networkId:o},r));return yield u.init(),u}))}function c(e,t={}){return n(this,void 0,void 0,(function*(){t.projectInfo||(t=Object.assign(Object.assign({},t),{projectInfo:{artifacts:[e]}}));let r=yield u(t);return yield r.forArtifact(e)}))}function l(e,t={}){return n(this,void 0,void 0,(function*(){return yield c(e,Object.assign({provider:e.web3.currentProvider,networkId:parseInt(e.network_id)||undefined},t))}))}function d(e,t,r={}){return n(this,void 0,void 0,(function*(){return(yield l(e,r)).forInstance(t)}))}r.forProject=u,r.forProjectInternal=function(e){return n(this,void 0,void 0,(function*(){const t=new i.ProjectEncoder(e);return yield t.init(),t}))},r.forArtifact=c,r.forContract=l,r.forDeployedArtifact=function(e,t){return n(this,void 0,void 0,(function*(){let r=yield c(e,t);return yield r.forInstance()}))},r.forDeployedContract=function(e,t={}){return n(this,void 0,void 0,(function*(){const r=yield l(e,t);return yield r.forInstance()}))},r.forArtifactAt=function(e,t,r={}){return n(this,void 0,void 0,(function*(){let n=yield c(e,r);return yield n.forInstance(t)}))},r.forContractAt=d,r.forContractInstance=function(e,t={}){return n(this,void 0,void 0,(function*(){return d(e.constructor,e.address,t)}))}}}},{package:"@truffle/decoder>@truffle/encoder",file:"node_modules/@truffle/encoder/dist/index.js"}],[1648,{"@ethersproject/bignumber":410,"bignumber.js":1650,"lodash/escapeRegExp":2907},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(r,"__esModule",{value:!0}),r.link=r.isEthersBigNumber=r.isBigNumber=void 0;const i=n(e("bignumber.js")),o=e("@ethersproject/bignumber"),s=n(e("lodash/escapeRegExp"));r.isBigNumber=function(e){return i.default.isBigNumber(e)&&Boolean(e.toFixed)},r.isEthersBigNumber=function(e){return o.BigNumber.isBigNumber(e)&&Boolean(e.toHexString)},r.link=function(e,t){if(!e)return e;const r=Object.keys(t).sort(((e,t)=>t.length-e.length));for(const n of r){const r=t[n];e=e.replace(new RegExp(`__${(0,s.default)(n)}_*`,"g"),r.slice(2))}return e}}}},{package:"@truffle/decoder>@truffle/encoder",file:"node_modules/@truffle/encoder/dist/utils.js"}],[1649,{},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){!function(e){var r,n=1e6,i=1e6,o="[big.js] ",s=o+"Invalid ",a=s+"decimal places",u=s+"rounding mode",c=o+"Division by zero",l={},d=void 0,f=/^-?(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i;function h(e,t,r,n){var i=e.c;if(r===d&&(r=e.constructor.RM),0!==r&&1!==r&&2!==r&&3!==r)throw Error(u);if(t<1)n=3===r&&(n||!!i[0])||0===t&&(1===r&&i[0]>=5||2===r&&(i[0]>5||5===i[0]&&(n||i[1]!==d))),i.length=1,n?(e.e=e.e-t+1,i[0]=1):i[0]=e.e=0;else if(t<i.length){if(n=1===r&&i[t]>=5||2===r&&(i[t]>5||5===i[t]&&(n||i[t+1]!==d||1&i[t-1]))||3===r&&(n||!!i[0]),i.length=t,n)for(;++i[--t]>9;)if(i[t]=0,0===t){++e.e,i.unshift(1);break}for(t=i.length;!i[--t];)i.pop()}return e}function p(e,t,r){var n=e.e,i=e.c.join(""),o=i.length;if(t)i=i.charAt(0)+(o>1?"."+i.slice(1):"")+(n<0?"e":"e+")+n;else if(n<0){for(;++n;)i="0"+i;i="0."+i}else if(n>0)if(++n>o)for(n-=o;n--;)i+="0";else n<o&&(i=i.slice(0,n)+"."+i.slice(n));else o>1&&(i=i.charAt(0)+"."+i.slice(1));return e.s<0&&r?"-"+i:i}l.abs=function(){var e=new this.constructor(this);return e.s=1,e},l.cmp=function(e){var t,r=this,n=r.c,i=(e=new r.constructor(e)).c,o=r.s,s=e.s,a=r.e,u=e.e;if(!n[0]||!i[0])return n[0]?o:i[0]?-s:0;if(o!=s)return o;if(t=o<0,a!=u)return a>u^t?1:-1;for(s=(a=n.length)<(u=i.length)?a:u,o=-1;++o<s;)if(n[o]!=i[o])return n[o]>i[o]^t?1:-1;return a==u?0:a>u^t?1:-1},l.div=function(e){var t=this,r=t.constructor,i=t.c,o=(e=new r(e)).c,s=t.s==e.s?1:-1,u=r.DP;if(u!==~~u||u<0||u>n)throw Error(a);if(!o[0])throw Error(c);if(!i[0])return e.s=s,e.c=[e.e=0],e;var l,f,p,m,g,y=o.slice(),v=l=o.length,b=i.length,w=i.slice(0,l),M=w.length,_=e,O=_.c=[],E=0,T=u+(_.e=t.e-e.e)+1;for(_.s=s,s=T<0?0:T,y.unshift(0);M++<l;)w.push(0);do{for(p=0;p<10;p++){if(l!=(M=w.length))m=l>M?1:-1;else for(g=-1,m=0;++g<l;)if(o[g]!=w[g]){m=o[g]>w[g]?1:-1;break}if(!(m<0))break;for(f=M==l?o:y;M;){if(w[--M]<f[M]){for(g=M;g&&!w[--g];)w[g]=9;--w[g],w[M]+=10}w[M]-=f[M]}for(;!w[0];)w.shift()}O[E++]=m?p:++p,w[0]&&m?w[M]=i[v]||0:w=[i[v]]}while((v++<b||w[0]!==d)&&s--);return O[0]||1==E||(O.shift(),_.e--,T--),E>T&&h(_,T,r.RM,w[0]!==d),_},l.eq=function(e){return 0===this.cmp(e)},l.gt=function(e){return this.cmp(e)>0},l.gte=function(e){return this.cmp(e)>-1},l.lt=function(e){return this.cmp(e)<0},l.lte=function(e){return this.cmp(e)<1},l.minus=l.sub=function(e){var t,r,n,i,o=this,s=o.constructor,a=o.s,u=(e=new s(e)).s;if(a!=u)return e.s=-u,o.plus(e);var c=o.c.slice(),l=o.e,d=e.c,f=e.e;if(!c[0]||!d[0])return d[0]?e.s=-u:c[0]?e=new s(o):e.s=1,e;if(a=l-f){for((i=a<0)?(a=-a,n=c):(f=l,n=d),n.reverse(),u=a;u--;)n.push(0);n.reverse()}else for(r=((i=c.length<d.length)?c:d).length,a=u=0;u<r;u++)if(c[u]!=d[u]){i=c[u]<d[u];break}if(i&&(n=c,c=d,d=n,e.s=-e.s),(u=(r=d.length)-(t=c.length))>0)for(;u--;)c[t++]=0;for(u=t;r>a;){if(c[--r]<d[r]){for(t=r;t&&!c[--t];)c[t]=9;--c[t],c[r]+=10}c[r]-=d[r]}for(;0===c[--u];)c.pop();for(;0===c[0];)c.shift(),--f;return c[0]||(e.s=1,c=[f=0]),e.c=c,e.e=f,e},l.mod=function(e){var t,r=this,n=r.constructor,i=r.s,o=(e=new n(e)).s;if(!e.c[0])throw Error(c);return r.s=e.s=1,t=1==e.cmp(r),r.s=i,e.s=o,t?new n(r):(i=n.DP,o=n.RM,n.DP=n.RM=0,r=r.div(e),n.DP=i,n.RM=o,this.minus(r.times(e)))},l.neg=function(){var e=new this.constructor(this);return e.s=-e.s,e},l.plus=l.add=function(e){var t,r,n,i=this,o=i.constructor;if(e=new o(e),i.s!=e.s)return e.s=-e.s,i.minus(e);var s=i.e,a=i.c,u=e.e,c=e.c;if(!a[0]||!c[0])return c[0]||(a[0]?e=new o(i):e.s=i.s),e;if(a=a.slice(),t=s-u){for(t>0?(u=s,n=c):(t=-t,n=a),n.reverse();t--;)n.push(0);n.reverse()}for(a.length-c.length<0&&(n=c,c=a,a=n),t=c.length,r=0;t;a[t]%=10)r=(a[--t]=a[t]+c[t]+r)/10|0;for(r&&(a.unshift(r),++u),t=a.length;0===a[--t];)a.pop();return e.c=a,e.e=u,e},l.pow=function(e){var t=this,r=new t.constructor("1"),n=r,o=e<0;if(e!==~~e||e<-1e6||e>i)throw Error(s+"exponent");for(o&&(e=-e);1&e&&(n=n.times(t)),e>>=1;)t=t.times(t);return o?r.div(n):n},l.prec=function(e,t){if(e!==~~e||e<1||e>n)throw Error(s+"precision");return h(new this.constructor(this),e,t)},l.round=function(e,t){if(e===d)e=0;else if(e!==~~e||e<-n||e>n)throw Error(a);return h(new this.constructor(this),e+this.e+1,t)},l.sqrt=function(){var e,t,r,n=this,i=n.constructor,s=n.s,a=n.e,u=new i("0.5");if(!n.c[0])return new i(n);if(s<0)throw Error(o+"No square root");0===(s=Math.sqrt(n+""))||s===1/0?((t=n.c.join("")).length+a&1||(t+="0"),a=((a+1)/2|0)-(a<0||1&a),e=new i(((s=Math.sqrt(t))==1/0?"5e":(s=s.toExponential()).slice(0,s.indexOf("e")+1))+a)):e=new i(s+""),a=e.e+(i.DP+=4);do{r=e,e=u.times(r.plus(n.div(r)))}while(r.c.slice(0,a).join("")!==e.c.slice(0,a).join(""));return h(e,(i.DP-=4)+e.e+1,i.RM)},l.times=l.mul=function(e){var t,r=this,n=r.constructor,i=r.c,o=(e=new n(e)).c,s=i.length,a=o.length,u=r.e,c=e.e;if(e.s=r.s==e.s?1:-1,!i[0]||!o[0])return e.c=[e.e=0],e;for(e.e=u+c,s<a&&(t=i,i=o,o=t,c=s,s=a,a=c),t=new Array(c=s+a);c--;)t[c]=0;for(u=a;u--;){for(a=0,c=s+u;c>u;)a=t[c]+o[u]*i[c-u-1]+a,t[c--]=a%10,a=a/10|0;t[c]=a}for(a?++e.e:t.shift(),u=t.length;!t[--u];)t.pop();return e.c=t,e},l.toExponential=function(e,t){var r=this,i=r.c[0];if(e!==d){if(e!==~~e||e<0||e>n)throw Error(a);for(r=h(new r.constructor(r),++e,t);r.c.length<e;)r.c.push(0)}return p(r,!0,!!i)},l.toFixed=function(e,t){var r=this,i=r.c[0];if(e!==d){if(e!==~~e||e<0||e>n)throw Error(a);for(e=e+(r=h(new r.constructor(r),e+r.e+1,t)).e+1;r.c.length<e;)r.c.push(0)}return p(r,!1,!!i)},l.toJSON=l.toString=function(){var e=this,t=e.constructor;return p(e,e.e<=t.NE||e.e>=t.PE,!!e.c[0])},l.toNumber=function(){var e=Number(p(this,!0,!0));if(!0===this.constructor.strict&&!this.eq(e.toString()))throw Error(o+"Imprecise conversion");return e},l.toPrecision=function(e,t){var r=this,i=r.constructor,o=r.c[0];if(e!==d){if(e!==~~e||e<1||e>n)throw Error(s+"precision");for(r=h(new i(r),e,t);r.c.length<e;)r.c.push(0)}return p(r,e<=r.e||r.e<=i.NE||r.e>=i.PE,!!o)},l.valueOf=function(){var e=this,t=e.constructor;if(!0===t.strict)throw Error(o+"valueOf disallowed");return p(e,e.e<=t.NE||e.e>=t.PE,!0)},r=function e(){function t(r){var n=this;if(!(n instanceof t))return r===d?e():new t(r);if(r instanceof t)n.s=r.s,n.e=r.e,n.c=r.c.slice();else{if("string"!=typeof r){if(!0===t.strict&&"bigint"!=typeof r)throw TypeError(s+"value");r=0===r&&1/r<0?"-0":String(r)}!function(e,t){var r,n,i;if(!f.test(t))throw Error(s+"number");e.s="-"==t.charAt(0)?(t=t.slice(1),-1):1,(r=t.indexOf("."))>-1&&(t=t.replace(".",""));(n=t.search(/e/i))>0?(r<0&&(r=n),r+=+t.slice(n+1),t=t.substring(0,n)):r<0&&(r=t.length);for(i=t.length,n=0;n<i&&"0"==t.charAt(n);)++n;if(n==i)e.c=[e.e=0];else{for(;i>0&&"0"==t.charAt(--i););for(e.e=r-n-1,e.c=[],r=0;n<=i;)e.c[r++]=+t.charAt(n++)}}(n,r)}n.constructor=t}return t.prototype=l,t.DP=20,t.RM=1,t.NE=-7,t.PE=21,t.strict=false,t.roundDown=0,t.roundHalfUp=1,t.roundHalfEven=2,t.roundUp=3,t}(),r.default=r.Big=r,"function"==typeof define&&define.amd?define((function(){return r})):void 0!==t&&t.exports?t.exports=r:e.Big=r}(this)}}},{package:"@truffle/decoder>@truffle/encoder>big.js",file:"node_modules/@truffle/encoder/node_modules/big.js/big.js"}],[1650,{},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){!function(e){var r,n=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,i=Math.ceil,o=Math.floor,s="[BigNumber Error] ",a=s+"Number primitive has more than 15 significant digits: ",u=1e14,c=14,l=9007199254740991,d=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13],f=1e7,h=1e9;function p(e){var t=0|e;return e>0||e===t?t:t-1}function m(e){for(var t,r,n=1,i=e.length,o=e[0]+"";n<i;){for(t=e[n++]+"",r=c-t.length;r--;t="0"+t);o+=t}for(i=o.length;48===o.charCodeAt(--i););return o.slice(0,i+1||1)}function g(e,t){var r,n,i=e.c,o=t.c,s=e.s,a=t.s,u=e.e,c=t.e;if(!s||!a)return null;if(r=i&&!i[0],n=o&&!o[0],r||n)return r?n?0:-a:s;if(s!=a)return s;if(r=s<0,n=u==c,!i||!o)return n?0:!i^r?1:-1;if(!n)return u>c^r?1:-1;for(a=(u=i.length)<(c=o.length)?u:c,s=0;s<a;s++)if(i[s]!=o[s])return i[s]>o[s]^r?1:-1;return u==c?0:u>c^r?1:-1}function y(e,t,r,n){if(e<t||e>r||e!==o(e))throw Error(s+(n||"Argument")+("number"==typeof e?e<t||e>r?" out of range: ":" not an integer: ":" not a primitive number: ")+String(e))}function v(e){var t=e.c.length-1;return p(e.e/c)==t&&e.c[t]%2!=0}function b(e,t){return(e.length>1?e.charAt(0)+"."+e.slice(1):e)+(t<0?"e":"e+")+t}function w(e,t,r){var n,i;if(t<0){for(i=r+".";++t;i+=r);e=i+e}else if(++t>(n=e.length)){for(i=r,t-=n;--t;i+=r);e+=i}else t<n&&(e=e.slice(0,t)+"."+e.slice(t));return e}r=function e(t){var r,M,_,O,E,T,j,k,x,S,C=W.prototype={constructor:W,toString:null,valueOf:null},A=new W(1),I=20,D=4,P=-7,N=21,B=-1e7,R=1e7,L=!1,$=1,U=0,F={prefix:"",groupSize:3,secondaryGroupSize:0,groupSeparator:",",decimalSeparator:".",fractionGroupSize:0,fractionGroupSeparator:" ",suffix:""},z="0123456789abcdefghijklmnopqrstuvwxyz",H=!0;function W(e,t){var r,i,s,u,d,f,h,p,m=this;if(!(m instanceof W))return new W(e,t);if(null==t){if(e&&!0===e._isBigNumber)return m.s=e.s,void(!e.c||e.e>R?m.c=m.e=null:e.e<B?m.c=[m.e=0]:(m.e=e.e,m.c=e.c.slice()));if((f="number"==typeof e)&&0*e==0){if(m.s=1/e<0?(e=-e,-1):1,e===~~e){for(u=0,d=e;d>=10;d/=10,u++);return void(u>R?m.c=m.e=null:(m.e=u,m.c=[e]))}p=String(e)}else{if(!n.test(p=String(e)))return _(m,p,f);m.s=45==p.charCodeAt(0)?(p=p.slice(1),-1):1}(u=p.indexOf("."))>-1&&(p=p.replace(".","")),(d=p.search(/e/i))>0?(u<0&&(u=d),u+=+p.slice(d+1),p=p.substring(0,d)):u<0&&(u=p.length)}else{if(y(t,2,z.length,"Base"),10==t&&H)return G(m=new W(e),I+m.e+1,D);if(p=String(e),f="number"==typeof e){if(0*e!=0)return _(m,p,f,t);if(m.s=1/e<0?(p=p.slice(1),-1):1,W.DEBUG&&p.replace(/^0\.0*|\./,"").length>15)throw Error(a+e)}else m.s=45===p.charCodeAt(0)?(p=p.slice(1),-1):1;for(r=z.slice(0,t),u=d=0,h=p.length;d<h;d++)if(r.indexOf(i=p.charAt(d))<0){if("."==i){if(d>u){u=h;continue}}else if(!s&&(p==p.toUpperCase()&&(p=p.toLowerCase())||p==p.toLowerCase()&&(p=p.toUpperCase()))){s=!0,d=-1,u=0;continue}return _(m,String(e),f,t)}f=!1,(u=(p=M(p,t,10,m.s)).indexOf("."))>-1?p=p.replace(".",""):u=p.length}for(d=0;48===p.charCodeAt(d);d++);for(h=p.length;48===p.charCodeAt(--h););if(p=p.slice(d,++h)){if(h-=d,f&&W.DEBUG&&h>15&&(e>l||e!==o(e)))throw Error(a+m.s*e);if((u=u-d-1)>R)m.c=m.e=null;else if(u<B)m.c=[m.e=0];else{if(m.e=u,m.c=[],d=(u+1)%c,u<0&&(d+=c),d<h){for(d&&m.c.push(+p.slice(0,d)),h-=c;d<h;)m.c.push(+p.slice(d,d+=c));d=c-(p=p.slice(d)).length}else d-=h;for(;d--;p+="0");m.c.push(+p)}}else m.c=[m.e=0]}function V(e,t,r,n){var i,o,s,a,u;if(null==r?r=D:y(r,0,8),!e.c)return e.toString();if(i=e.c[0],s=e.e,null==t)u=m(e.c),u=1==n||2==n&&(s<=P||s>=N)?b(u,s):w(u,s,"0");else if(o=(e=G(new W(e),t,r)).e,a=(u=m(e.c)).length,1==n||2==n&&(t<=o||o<=P)){for(;a<t;u+="0",a++);u=b(u,o)}else if(t-=s,u=w(u,o,"0"),o+1>a){if(--t>0)for(u+=".";t--;u+="0");}else if((t+=o-a)>0)for(o+1==a&&(u+=".");t--;u+="0");return e.s<0&&i?"-"+u:u}function Z(e,t){for(var r,n=1,i=new W(e[0]);n<e.length;n++){if(!(r=new W(e[n])).s){i=r;break}t.call(i,r)&&(i=r)}return i}function q(e,t,r){for(var n=1,i=t.length;!t[--i];t.pop());for(i=t[0];i>=10;i/=10,n++);return(r=n+r*c-1)>R?e.c=e.e=null:r<B?e.c=[e.e=0]:(e.e=r,e.c=t),e}function G(e,t,r,n){var s,a,l,f,h,p,m,g=e.c,y=d;if(g){e:{for(s=1,f=g[0];f>=10;f/=10,s++);if((a=t-s)<0)a+=c,l=t,m=(h=g[p=0])/y[s-l-1]%10|0;else if((p=i((a+1)/c))>=g.length){if(!n)break e;for(;g.length<=p;g.push(0));h=m=0,s=1,l=(a%=c)-c+1}else{for(h=f=g[p],s=1;f>=10;f/=10,s++);m=(l=(a%=c)-c+s)<0?0:h/y[s-l-1]%10|0}if(n=n||t<0||null!=g[p+1]||(l<0?h:h%y[s-l-1]),n=r<4?(m||n)&&(0==r||r==(e.s<0?3:2)):m>5||5==m&&(4==r||n||6==r&&(a>0?l>0?h/y[s-l]:0:g[p-1])%10&1||r==(e.s<0?8:7)),t<1||!g[0])return g.length=0,n?(t-=e.e+1,g[0]=y[(c-t%c)%c],e.e=-t||0):g[0]=e.e=0,e;if(0==a?(g.length=p,f=1,p--):(g.length=p+1,f=y[c-a],g[p]=l>0?o(h/y[s-l]%y[l])*f:0),n)for(;;){if(0==p){for(a=1,l=g[0];l>=10;l/=10,a++);for(l=g[0]+=f,f=1;l>=10;l/=10,f++);a!=f&&(e.e++,g[0]==u&&(g[0]=1));break}if(g[p]+=f,g[p]!=u)break;g[p--]=0,f=1}for(a=g.length;0===g[--a];g.pop());}e.e>R?e.c=e.e=null:e.e<B&&(e.c=[e.e=0])}return e}function K(e){var t,r=e.e;return null===r?e.toString():(t=m(e.c),t=r<=P||r>=N?b(t,r):w(t,r,"0"),e.s<0?"-"+t:t)}return W.clone=e,W.ROUND_UP=0,W.ROUND_DOWN=1,W.ROUND_CEIL=2,W.ROUND_FLOOR=3,W.ROUND_HALF_UP=4,W.ROUND_HALF_DOWN=5,W.ROUND_HALF_EVEN=6,W.ROUND_HALF_CEIL=7,W.ROUND_HALF_FLOOR=8,W.EUCLID=9,W.config=W.set=function(e){var t,r;if(null!=e){if("object"!=typeof e)throw Error(s+"Object expected: "+e);if(e.hasOwnProperty(t="DECIMAL_PLACES")&&(y(r=e[t],0,h,t),I=r),e.hasOwnProperty(t="ROUNDING_MODE")&&(y(r=e[t],0,8,t),D=r),e.hasOwnProperty(t="EXPONENTIAL_AT")&&((r=e[t])&&r.pop?(y(r[0],-h,0,t),y(r[1],0,h,t),P=r[0],N=r[1]):(y(r,-h,h,t),P=-(N=r<0?-r:r))),e.hasOwnProperty(t="RANGE"))if((r=e[t])&&r.pop)y(r[0],-h,-1,t),y(r[1],1,h,t),B=r[0],R=r[1];else{if(y(r,-h,h,t),!r)throw Error(s+t+" cannot be zero: "+r);B=-(R=r<0?-r:r)}if(e.hasOwnProperty(t="CRYPTO")){if((r=e[t])!==!!r)throw Error(s+t+" not true or false: "+r);if(r){if("undefined"==typeof crypto||!crypto||!crypto.getRandomValues&&!crypto.randomBytes)throw L=!r,Error(s+"crypto unavailable");L=r}else L=r}if(e.hasOwnProperty(t="MODULO_MODE")&&(y(r=e[t],0,9,t),$=r),e.hasOwnProperty(t="POW_PRECISION")&&(y(r=e[t],0,h,t),U=r),e.hasOwnProperty(t="FORMAT")){if("object"!=typeof(r=e[t]))throw Error(s+t+" not an object: "+r);F=r}if(e.hasOwnProperty(t="ALPHABET")){if("string"!=typeof(r=e[t])||/^.?$|[+\-.\s]|(.).*\1/.test(r))throw Error(s+t+" invalid: "+r);H="0123456789"==r.slice(0,10),z=r}}return{DECIMAL_PLACES:I,ROUNDING_MODE:D,EXPONENTIAL_AT:[P,N],RANGE:[B,R],CRYPTO:L,MODULO_MODE:$,POW_PRECISION:U,FORMAT:F,ALPHABET:z}},W.isBigNumber=function(e){if(!e||!0!==e._isBigNumber)return!1;if(!W.DEBUG)return!0;var t,r,n=e.c,i=e.e,a=e.s;e:if("[object Array]"=={}.toString.call(n)){if((1===a||-1===a)&&i>=-h&&i<=h&&i===o(i)){if(0===n[0]){if(0===i&&1===n.length)return!0;break e}if((t=(i+1)%c)<1&&(t+=c),String(n[0]).length==t){for(t=0;t<n.length;t++)if((r=n[t])<0||r>=u||r!==o(r))break e;if(0!==r)return!0}}}else if(null===n&&null===i&&(null===a||1===a||-1===a))return!0;throw Error(s+"Invalid BigNumber: "+e)},W.maximum=W.max=function(){return Z(arguments,C.lt)},W.minimum=W.min=function(){return Z(arguments,C.gt)},W.random=(O=9007199254740992,E=Math.random()*O&2097151?function(){return o(Math.random()*O)}:function(){return 8388608*(1073741824*Math.random()|0)+(8388608*Math.random()|0)},function(e){var t,r,n,a,u,l=0,f=[],p=new W(A);if(null==e?e=I:y(e,0,h),a=i(e/c),L)if(crypto.getRandomValues){for(t=crypto.getRandomValues(new Uint32Array(a*=2));l<a;)(u=131072*t[l]+(t[l+1]>>>11))>=9e15?(r=crypto.getRandomValues(new Uint32Array(2)),t[l]=r[0],t[l+1]=r[1]):(f.push(u%1e14),l+=2);l=a/2}else{if(!crypto.randomBytes)throw L=!1,Error(s+"crypto unavailable");for(t=crypto.randomBytes(a*=7);l<a;)(u=281474976710656*(31&t[l])+1099511627776*t[l+1]+4294967296*t[l+2]+16777216*t[l+3]+(t[l+4]<<16)+(t[l+5]<<8)+t[l+6])>=9e15?crypto.randomBytes(7).copy(t,l):(f.push(u%1e14),l+=7);l=a/7}if(!L)for(;l<a;)(u=E())<9e15&&(f[l++]=u%1e14);for(a=f[--l],e%=c,a&&e&&(u=d[c-e],f[l]=o(a/u)*u);0===f[l];f.pop(),l--);if(l<0)f=[n=0];else{for(n=-1;0===f[0];f.splice(0,1),n-=c);for(l=1,u=f[0];u>=10;u/=10,l++);l<c&&(n-=c-l)}return p.e=n,p.c=f,p}),W.sum=function(){for(var e=1,t=arguments,r=new W(t[0]);e<t.length;)r=r.plus(t[e++]);return r},M=function(){var e="0123456789";function t(e,t,r,n){for(var i,o,s=[0],a=0,u=e.length;a<u;){for(o=s.length;o--;s[o]*=t);for(s[0]+=n.indexOf(e.charAt(a++)),i=0;i<s.length;i++)s[i]>r-1&&(null==s[i+1]&&(s[i+1]=0),s[i+1]+=s[i]/r|0,s[i]%=r)}return s.reverse()}return function(n,i,o,s,a){var u,c,l,d,f,h,p,g,y=n.indexOf("."),v=I,b=D;for(y>=0&&(d=U,U=0,n=n.replace(".",""),h=(g=new W(i)).pow(n.length-y),U=d,g.c=t(w(m(h.c),h.e,"0"),10,o,e),g.e=g.c.length),l=d=(p=t(n,i,o,a?(u=z,e):(u=e,z))).length;0==p[--d];p.pop());if(!p[0])return u.charAt(0);if(y<0?--l:(h.c=p,h.e=l,h.s=s,p=(h=r(h,g,v,b,o)).c,f=h.r,l=h.e),y=p[c=l+v+1],d=o/2,f=f||c<0||null!=p[c+1],f=b<4?(null!=y||f)&&(0==b||b==(h.s<0?3:2)):y>d||y==d&&(4==b||f||6==b&&1&p[c-1]||b==(h.s<0?8:7)),c<1||!p[0])n=f?w(u.charAt(1),-v,u.charAt(0)):u.charAt(0);else{if(p.length=c,f)for(--o;++p[--c]>o;)p[c]=0,c||(++l,p=[1].concat(p));for(d=p.length;!p[--d];);for(y=0,n="";y<=d;n+=u.charAt(p[y++]));n=w(n,l,u.charAt(0))}return n}}(),r=function(){function e(e,t,r){var n,i,o,s,a=0,u=e.length,c=t%f,l=t/f|0;for(e=e.slice();u--;)a=((i=c*(o=e[u]%f)+(n=l*o+(s=e[u]/f|0)*c)%f*f+a)/r|0)+(n/f|0)+l*s,e[u]=i%r;return a&&(e=[a].concat(e)),e}function t(e,t,r,n){var i,o;if(r!=n)o=r>n?1:-1;else for(i=o=0;i<r;i++)if(e[i]!=t[i]){o=e[i]>t[i]?1:-1;break}return o}function r(e,t,r,n){for(var i=0;r--;)e[r]-=i,i=e[r]<t[r]?1:0,e[r]=i*n+e[r]-t[r];for(;!e[0]&&e.length>1;e.splice(0,1));}return function(n,i,s,a,l){var d,f,h,m,g,y,v,b,w,M,_,O,E,T,j,k,x,S=n.s==i.s?1:-1,C=n.c,A=i.c;if(!(C&&C[0]&&A&&A[0]))return new W(n.s&&i.s&&(C?!A||C[0]!=A[0]:A)?C&&0==C[0]||!A?0*S:S/0:NaN);for(w=(b=new W(S)).c=[],S=s+(f=n.e-i.e)+1,l||(l=u,f=p(n.e/c)-p(i.e/c),S=S/c|0),h=0;A[h]==(C[h]||0);h++);if(A[h]>(C[h]||0)&&f--,S<0)w.push(1),m=!0;else{for(T=C.length,k=A.length,h=0,S+=2,(g=o(l/(A[0]+1)))>1&&(A=e(A,g,l),C=e(C,g,l),k=A.length,T=C.length),E=k,_=(M=C.slice(0,k)).length;_<k;M[_++]=0);x=A.slice(),x=[0].concat(x),j=A[0],A[1]>=l/2&&j++;do{if(g=0,(d=t(A,M,k,_))<0){if(O=M[0],k!=_&&(O=O*l+(M[1]||0)),(g=o(O/j))>1)for(g>=l&&(g=l-1),v=(y=e(A,g,l)).length,_=M.length;1==t(y,M,v,_);)g--,r(y,k<v?x:A,v,l),v=y.length,d=1;else 0==g&&(d=g=1),v=(y=A.slice()).length;if(v<_&&(y=[0].concat(y)),r(M,y,_,l),_=M.length,-1==d)for(;t(A,M,k,_)<1;)g++,r(M,k<_?x:A,_,l),_=M.length}else 0===d&&(g++,M=[0]);w[h++]=g,M[0]?M[_++]=C[E]||0:(M=[C[E]],_=1)}while((E++<T||null!=M[0])&&S--);m=null!=M[0],w[0]||w.splice(0,1)}if(l==u){for(h=1,S=w[0];S>=10;S/=10,h++);G(b,s+(b.e=h+f*c-1)+1,a,m)}else b.e=f,b.r=+m;return b}}(),T=/^(-?)0([xbo])(?=\w[\w.]*$)/i,j=/^([^.]+)\.$/,k=/^\.([^.]+)$/,x=/^-?(Infinity|NaN)$/,S=/^\s*\+(?=[\w.])|^\s+|\s+$/g,_=function(e,t,r,n){var i,o=r?t:t.replace(S,"");if(x.test(o))e.s=isNaN(o)?null:o<0?-1:1;else{if(!r&&(o=o.replace(T,(function(e,t,r){return i="x"==(r=r.toLowerCase())?16:"b"==r?2:8,n&&n!=i?e:t})),n&&(i=n,o=o.replace(j,"$1").replace(k,"0.$1")),t!=o))return new W(o,i);if(W.DEBUG)throw Error(s+"Not a"+(n?" base "+n:"")+" number: "+t);e.s=null}e.c=e.e=null},C.absoluteValue=C.abs=function(){var e=new W(this);return e.s<0&&(e.s=1),e},C.comparedTo=function(e,t){return g(this,new W(e,t))},C.decimalPlaces=C.dp=function(e,t){var r,n,i,o=this;if(null!=e)return y(e,0,h),null==t?t=D:y(t,0,8),G(new W(o),e+o.e+1,t);if(!(r=o.c))return null;if(n=((i=r.length-1)-p(this.e/c))*c,i=r[i])for(;i%10==0;i/=10,n--);return n<0&&(n=0),n},C.dividedBy=C.div=function(e,t){return r(this,new W(e,t),I,D)},C.dividedToIntegerBy=C.idiv=function(e,t){return r(this,new W(e,t),0,1)},C.exponentiatedBy=C.pow=function(e,t){var r,n,a,u,l,d,f,h,p=this;if((e=new W(e)).c&&!e.isInteger())throw Error(s+"Exponent not an integer: "+K(e));if(null!=t&&(t=new W(t)),l=e.e>14,!p.c||!p.c[0]||1==p.c[0]&&!p.e&&1==p.c.length||!e.c||!e.c[0])return h=new W(Math.pow(+K(p),l?2-v(e):+K(e))),t?h.mod(t):h;if(d=e.s<0,t){if(t.c?!t.c[0]:!t.s)return new W(NaN);(n=!d&&p.isInteger()&&t.isInteger())&&(p=p.mod(t))}else{if(e.e>9&&(p.e>0||p.e<-1||(0==p.e?p.c[0]>1||l&&p.c[1]>=24e7:p.c[0]<8e13||l&&p.c[0]<=9999975e7)))return u=p.s<0&&v(e)?-0:0,p.e>-1&&(u=1/u),new W(d?1/u:u);U&&(u=i(U/c+2))}for(l?(r=new W(.5),d&&(e.s=1),f=v(e)):f=(a=Math.abs(+K(e)))%2,h=new W(A);;){if(f){if(!(h=h.times(p)).c)break;u?h.c.length>u&&(h.c.length=u):n&&(h=h.mod(t))}if(a){if(0===(a=o(a/2)))break;f=a%2}else if(G(e=e.times(r),e.e+1,1),e.e>14)f=v(e);else{if(0===(a=+K(e)))break;f=a%2}p=p.times(p),u?p.c&&p.c.length>u&&(p.c.length=u):n&&(p=p.mod(t))}return n?h:(d&&(h=A.div(h)),t?h.mod(t):u?G(h,U,D,undefined):h)},C.integerValue=function(e){var t=new W(this);return null==e?e=D:y(e,0,8),G(t,t.e+1,e)},C.isEqualTo=C.eq=function(e,t){return 0===g(this,new W(e,t))},C.isFinite=function(){return!!this.c},C.isGreaterThan=C.gt=function(e,t){return g(this,new W(e,t))>0},C.isGreaterThanOrEqualTo=C.gte=function(e,t){return 1===(t=g(this,new W(e,t)))||0===t},C.isInteger=function(){return!!this.c&&p(this.e/c)>this.c.length-2},C.isLessThan=C.lt=function(e,t){return g(this,new W(e,t))<0},C.isLessThanOrEqualTo=C.lte=function(e,t){return-1===(t=g(this,new W(e,t)))||0===t},C.isNaN=function(){return!this.s},C.isNegative=function(){return this.s<0},C.isPositive=function(){return this.s>0},C.isZero=function(){return!!this.c&&0==this.c[0]},C.minus=function(e,t){var r,n,i,o,s=this,a=s.s;if(t=(e=new W(e,t)).s,!a||!t)return new W(NaN);if(a!=t)return e.s=-t,s.plus(e);var l=s.e/c,d=e.e/c,f=s.c,h=e.c;if(!l||!d){if(!f||!h)return f?(e.s=-t,e):new W(h?s:NaN);if(!f[0]||!h[0])return h[0]?(e.s=-t,e):new W(f[0]?s:3==D?-0:0)}if(l=p(l),d=p(d),f=f.slice(),a=l-d){for((o=a<0)?(a=-a,i=f):(d=l,i=h),i.reverse(),t=a;t--;i.push(0));i.reverse()}else for(n=(o=(a=f.length)<(t=h.length))?a:t,a=t=0;t<n;t++)if(f[t]!=h[t]){o=f[t]<h[t];break}if(o&&(i=f,f=h,h=i,e.s=-e.s),(t=(n=h.length)-(r=f.length))>0)for(;t--;f[r++]=0);for(t=u-1;n>a;){if(f[--n]<h[n]){for(r=n;r&&!f[--r];f[r]=t);--f[r],f[n]+=u}f[n]-=h[n]}for(;0==f[0];f.splice(0,1),--d);return f[0]?q(e,f,d):(e.s=3==D?-1:1,e.c=[e.e=0],e)},C.modulo=C.mod=function(e,t){var n,i,o=this;return e=new W(e,t),!o.c||!e.s||e.c&&!e.c[0]?new W(NaN):!e.c||o.c&&!o.c[0]?new W(o):(9==$?(i=e.s,e.s=1,n=r(o,e,0,3),e.s=i,n.s*=i):n=r(o,e,0,$),(e=o.minus(n.times(e))).c[0]||1!=$||(e.s=o.s),e)},C.multipliedBy=C.times=function(e,t){var r,n,i,o,s,a,l,d,h,m,g,y,v,b,w,M=this,_=M.c,O=(e=new W(e,t)).c;if(!(_&&O&&_[0]&&O[0]))return!M.s||!e.s||_&&!_[0]&&!O||O&&!O[0]&&!_?e.c=e.e=e.s=null:(e.s*=M.s,_&&O?(e.c=[0],e.e=0):e.c=e.e=null),e;for(n=p(M.e/c)+p(e.e/c),e.s*=M.s,(l=_.length)<(m=O.length)&&(v=_,_=O,O=v,i=l,l=m,m=i),i=l+m,v=[];i--;v.push(0));for(b=u,w=f,i=m;--i>=0;){for(r=0,g=O[i]%w,y=O[i]/w|0,o=i+(s=l);o>i;)r=((d=g*(d=_[--s]%w)+(a=y*d+(h=_[s]/w|0)*g)%w*w+v[o]+r)/b|0)+(a/w|0)+y*h,v[o--]=d%b;v[o]=r}return r?++n:v.splice(0,1),q(e,v,n)},C.negated=function(){var e=new W(this);return e.s=-e.s||null,e},C.plus=function(e,t){var r,n=this,i=n.s;if(t=(e=new W(e,t)).s,!i||!t)return new W(NaN);if(i!=t)return e.s=-t,n.minus(e);var o=n.e/c,s=e.e/c,a=n.c,l=e.c;if(!o||!s){if(!a||!l)return new W(i/0);if(!a[0]||!l[0])return l[0]?e:new W(a[0]?n:0*i)}if(o=p(o),s=p(s),a=a.slice(),i=o-s){for(i>0?(s=o,r=l):(i=-i,r=a),r.reverse();i--;r.push(0));r.reverse()}for((i=a.length)-(t=l.length)<0&&(r=l,l=a,a=r,t=i),i=0;t;)i=(a[--t]=a[t]+l[t]+i)/u|0,a[t]=u===a[t]?0:a[t]%u;return i&&(a=[i].concat(a),++s),q(e,a,s)},C.precision=C.sd=function(e,t){var r,n,i,o=this;if(null!=e&&e!==!!e)return y(e,1,h),null==t?t=D:y(t,0,8),G(new W(o),e,t);if(!(r=o.c))return null;if(n=(i=r.length-1)*c+1,i=r[i]){for(;i%10==0;i/=10,n--);for(i=r[0];i>=10;i/=10,n++);}return e&&o.e+1>n&&(n=o.e+1),n},C.shiftedBy=function(e){return y(e,-9007199254740991,l),this.times("1e"+e)},C.squareRoot=C.sqrt=function(){var e,t,n,i,o,s=this,a=s.c,u=s.s,c=s.e,l=I+4,d=new W("0.5");if(1!==u||!a||!a[0])return new W(!u||u<0&&(!a||a[0])?NaN:a?s:1/0);if(0==(u=Math.sqrt(+K(s)))||u==1/0?(((t=m(a)).length+c)%2==0&&(t+="0"),u=Math.sqrt(+t),c=p((c+1)/2)-(c<0||c%2),n=new W(t=u==1/0?"5e"+c:(t=u.toExponential()).slice(0,t.indexOf("e")+1)+c)):n=new W(u+""),n.c[0])for((u=(c=n.e)+l)<3&&(u=0);;)if(o=n,n=d.times(o.plus(r(s,o,l,1))),m(o.c).slice(0,u)===(t=m(n.c)).slice(0,u)){if(n.e<c&&--u,"9999"!=(t=t.slice(u-3,u+1))&&(i||"4999"!=t)){+t&&(+t.slice(1)||"5"!=t.charAt(0))||(G(n,n.e+I+2,1),e=!n.times(n).eq(s));break}if(!i&&(G(o,o.e+I+2,0),o.times(o).eq(s))){n=o;break}l+=4,u+=4,i=1}return G(n,n.e+I+1,D,e)},C.toExponential=function(e,t){return null!=e&&(y(e,0,h),e++),V(this,e,t,1)},C.toFixed=function(e,t){return null!=e&&(y(e,0,h),e=e+this.e+1),V(this,e,t)},C.toFormat=function(e,t,r){var n,i=this;if(null==r)null!=e&&t&&"object"==typeof t?(r=t,t=null):e&&"object"==typeof e?(r=e,e=t=null):r=F;else if("object"!=typeof r)throw Error(s+"Argument not an object: "+r);if(n=i.toFixed(e,t),i.c){var o,a=n.split("."),u=+r.groupSize,c=+r.secondaryGroupSize,l=r.groupSeparator||"",d=a[0],f=a[1],h=i.s<0,p=h?d.slice(1):d,m=p.length;if(c&&(o=u,u=c,c=o,m-=o),u>0&&m>0){for(o=m%u||u,d=p.substr(0,o);o<m;o+=u)d+=l+p.substr(o,u);c>0&&(d+=l+p.slice(o)),h&&(d="-"+d)}n=f?d+(r.decimalSeparator||"")+((c=+r.fractionGroupSize)?f.replace(new RegExp("\\d{"+c+"}\\B","g"),"$&"+(r.fractionGroupSeparator||"")):f):d}return(r.prefix||"")+n+(r.suffix||"")},C.toFraction=function(e){var t,n,i,o,a,u,l,f,h,p,g,y,v=this,b=v.c;if(null!=e&&(!(l=new W(e)).isInteger()&&(l.c||1!==l.s)||l.lt(A)))throw Error(s+"Argument "+(l.isInteger()?"out of range: ":"not an integer: ")+K(l));if(!b)return new W(v);for(t=new W(A),h=n=new W(A),i=f=new W(A),y=m(b),a=t.e=y.length-v.e-1,t.c[0]=d[(u=a%c)<0?c+u:u],e=!e||l.comparedTo(t)>0?a>0?t:h:l,u=R,R=1/0,l=new W(y),f.c[0]=0;p=r(l,t,0,1),1!=(o=n.plus(p.times(i))).comparedTo(e);)n=i,i=o,h=f.plus(p.times(o=h)),f=o,t=l.minus(p.times(o=t)),l=o;return o=r(e.minus(n),i,0,1),f=f.plus(o.times(h)),n=n.plus(o.times(i)),f.s=h.s=v.s,g=r(h,i,a*=2,D).minus(v).abs().comparedTo(r(f,n,a,D).minus(v).abs())<1?[h,i]:[f,n],R=u,g},C.toNumber=function(){return+K(this)},C.toPrecision=function(e,t){return null!=e&&y(e,1,h),V(this,e,t,2)},C.toString=function(e){var t,r=this,n=r.s,i=r.e;return null===i?n?(t="Infinity",n<0&&(t="-"+t)):t="NaN":(null==e?t=i<=P||i>=N?b(m(r.c),i):w(m(r.c),i,"0"):10===e&&H?t=w(m((r=G(new W(r),I+i+1,D)).c),r.e,"0"):(y(e,2,z.length,"Base"),t=M(w(m(r.c),i,"0"),10,e,n,!0)),n<0&&r.c[0]&&(t="-"+t)),t},C.valueOf=C.toJSON=function(){return K(this)},C._isBigNumber=!0,null!=t&&W.set(t),W}(),r.default=r.BigNumber=r,"function"==typeof define&&define.amd?define((function(){return r})):void 0!==t&&t.exports?t.exports=r:(e||(e="undefined"!=typeof self&&self?self:window),e.BigNumber=r)}(this)}}},{package:"@truffle/decoder>@truffle/encoder>bignumber.js",file:"node_modules/@truffle/encoder/node_modules/bignumber.js/bignumber.js"}],[1651,{},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){class n extends Error{constructor(e){super(e),this.name=this.constructor.name,this.stack=""}}t.exports=n}}},{package:"@truffle/codec>@truffle/compile-common>@truffle/error",file:"node_modules/@truffle/error/dist/src/index.js"}],[1652,{"@truffle/code-utils":1493,"@truffle/codec":1547,debug:2075,"json-pointer":2718,"node-interval-tree":2990,"web3-utils":3381},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){const n=e("debug")("source-map-utils"),i=e("@truffle/code-utils"),o=e("@truffle/codec"),s=e("web3-utils"),a=e("json-pointer"),u=e("node-interval-tree").default;var c={getCharacterOffsetToLineAndColumnMapping:function(e){var t=[];e=Array.from(e);var r=0,n=0;return e.forEach((function(e){"\n"===e?(r+=1,n=-1,t.push({line:r,column:0})):t.push({line:r,column:n}),n+=1})),t},getHumanReadableSourceMap:function(e){const t=e.split(";");let r={start:0,length:0,file:0},n=[];for(let e of t){let t=e.split(":");t[0]&&(r.start=parseInt(t[0])),t[1]&&(r.length=parseInt(t[1])),t[2]&&(r.file=parseInt(t[2])),t[3]&&(r.jump=t[3]),t[4]&&(r.modifierDepth=parseInt(t[4]));let i={start:r.start,length:r.length,file:r.file,jump:r.jump,modifierDepth:r.modifierDepth};n.push(i)}return n},getProcessedInstructionsForBinary:function(e,t,r){if(!e||!t)return[];let o;n("sourceMap: %O",r),r&&(o=r.length);let s=i.parseCode(t,{maxInstructionCount:o});r||(r=new Array(s.length)).fill({start:0,length:0,file:-1,jump:"-",modifierDepth:"0"});const a=e.map((e=>c.getCharacterOffsetToLineAndColumnMapping(e||"")));let u;return r[0]&&(u=r[0].file),n("primaryFile %o",u),s.map(((e,t)=>{const n=r[t]||{};return e.index=t,{instruction:e,instructionSourceMap:n}})).map((({instruction:e,instructionSourceMap:t})=>{({jump:e.jump,start:e.start=0,length:e.length=0,file:e.file=u,modifierDepth:e.modifierDepth=0}=t),-1===e.start&&-1===e.length&&(e.start=0,e.length=0);const r=a[e.file]||{};return e.range={start:r[e.start]||{line:null,column:null},end:r[e.start+e.length]||{line:null,column:null}},e}))},getFunctionsByProgramCounter:function(e,t,r,i){return Object.assign({},...e.filter((e=>"JUMPDEST"===e.name)).map((s=>{n("instruction %O",s);const u=s.file,l=r[u],d=t[u];if(!d)return c.isDesignatedInvalid(e,s.index,r)?{[s.pc]:{isDesignatedInvalid:!0}}:{};const f=c.getSourceRange(s);let{node:h,pointer:p}=c.findRange(l,f.start,f.length);if(p||(h=d),!h||"FunctionDefinition"!==h.nodeType)return c.isDesignatedInvalid(e,s.index,r,h)?{[s.pc]:{isDesignatedInvalid:!0}}:{};let m=p.replace(/\/nodes\/\d+$/,""),g=a.get(d,m);return"ContractDefinition"!==g.nodeType&&(m=null,g=null),{[s.pc]:{sourceIndex:u,compilationId:i,pointer:p,node:h,name:h.name,id:h.id,mutability:o.Ast.Utils.mutability(h),contractPointer:m,contractNode:g,contractName:g?g.name:null,contractId:g?g.id:null,contractKind:g?g.contractKind:null,contractPayable:g?o.Ast.Utils.isContractPayable(g):null,isDesignatedInvalid:!1}}})))},getSourceRange:function(e={}){return{start:e.start||0,length:e.length||0,lines:e.range||{start:{line:0,column:0},end:{line:0,column:0}}}},findRange:function(e,t,r){let n=t+r,i=e=>(e.match(/\//g)||[]).length;return e(t,r).filter((({range:e})=>t>=e[0]&&n<=e[1])).reduce(((e,t)=>i(t.pointer)>=i(e.pointer)?t:e),{pointer:""})},makeOverlapFunction:function(e){let t=new u,r=c.rangeNodes(e);for(let{range:e,node:n,pointer:i}of r){let[r,o]=e;t.insert(r,o,{range:e,node:n,pointer:i})}return(e,r)=>t.search(e,e+r)},rangeNodes:function(e,t=""){if(e instanceof Array)return[].concat(...e.map(((e,r)=>c.rangeNodes(e,`${t}/${r}`))));if(e instanceof Object){let r=[];return e.src!==undefined&&e.nodeType!==undefined&&r.push({pointer:t,node:e,range:c.getRange(e)}),r.concat(...Object.keys(e).map((r=>c.rangeNodes(e[r],`${t}/${r}`))))}return[]},getRange:function(e){let[t,r]=e.src.split(":").slice(0,2).map((e=>parseInt(e)));return[t,t+r]},isDesignatedInvalid:function(e,t,r,i=undefined){const a=[{name:"JUMPDEST"},{name:"PUSH32",pushData:s.soliditySha3({type:"string",value:"Panic(uint256)"}).slice(0,2+2*o.Evm.Utils.SELECTOR_SIZE).padEnd(2+2*o.Evm.Utils.WORD_SIZE,"00")},{name:"PUSH1",pushData:"0x00"},{name:"MSTORE"},{name:"PUSH1",pushData:"0x51"},{name:"PUSH1",pushData:"0x04"},{name:"MSTORE"},{name:"PUSH1",pushData:"0x24"},{name:"PUSH1",pushData:"0x00"},{name:"REVERT"}],u=(e,t,r)=>{for(let n=0;n<r.length;n++){const i=e[t+n],o=r[n];if(!i||i.name!==o.name)return!1;if(o.pushData&&i.pushData!==o.pushData)return!1}return!0};if(u(e,t,[{name:"JUMPDEST"},{name:"INVALID"}])||u(e,t,a))return!0;if(i&&"YulFunctionDefinition"===i.nodeType&&"panic_error_0x51"===i.name)return!0;const l=((e,t)=>{let r=t;if("JUMPDEST"!==e[r].name)return null;for(r++;e[r]&&e[r].name.match(/^PUSH\d*/);)if(r++,r>t+3)return null;return e[r]&&"JUMP"===e[r].name?r===t+1?null:(r--,parseInt(e[r].pushData)):null})(e,t);if(null!==l){const i=e.findIndex((e=>e.pc===l));if(-1!==i){if(u(e,i,a))return!0;n("indirect: %O",e.slice(t,t+4)),n("jumpAddress: %d",l),n("jumpIndex: %d",i),n("instr count: %d",e.length);const o=e[i],s=o.file;if(-1!==s){const e=r[s],t=c.getSourceRange(o),{node:n}=c.findRange(e,t.start,t.length);if(n&&"YulFunctionDefinition"===n.nodeType&&"panic_error_0x51"===n.name)return!0}}}return!1}};t.exports=c}}},{package:"@truffle/decoder>@truffle/source-map-utils",file:"node_modules/@truffle/source-map-utils/index.js"}],[1653,{"@zxing/library":1668},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){var n,i=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},n(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(r,"__esModule",{value:!0}),r.HTMLCanvasElementLuminanceSource=void 0;var o=e("@zxing/library"),s=function(e){function t(r){var n=e.call(this,r.width,r.height)||this;return n.canvas=r,n.buffer=t.makeBufferFromCanvasImageData(r),n}return i(t,e),t.makeBufferFromCanvasImageData=function(e){var r=e.getContext("2d");if(!r)throw new Error("Couldn't get canvas context.");var n=r.getImageData(0,0,e.width,e.height);return t.toGrayscaleBuffer(n.data,e.width,e.height)},t.toGrayscaleBuffer=function(e,t,r){for(var n=new Uint8ClampedArray(t*r),i=0,o=0,s=e.length;i<s;i+=4,o++){var a=void 0;if(0===e[i+3])a=255;else a=306*e[i]+601*e[i+1]+117*e[i+2]+512>>10;n[o]=a}return n},t.prototype.getRow=function(e,t){if(e<0||e>=this.getHeight())throw new o.IllegalArgumentException("Requested row is outside the image: "+e);var r=this.getWidth(),n=e*r;return null===t?t=this.buffer.slice(n,n+r):(t.length<r&&(t=new Uint8ClampedArray(r)),t.set(this.buffer.slice(n,n+r))),t},t.prototype.getMatrix=function(){return this.buffer},t.prototype.isCropSupported=function(){return!0},t.prototype.crop=function(t,r,n,i){return e.prototype.crop.call(this,t,r,n,i),this},t.prototype.isRotateSupported=function(){return!0},t.prototype.rotateCounterClockwise=function(){return this.rotate(-90),this},t.prototype.rotateCounterClockwise45=function(){return this.rotate(-45),this},t.prototype.invert=function(){return new o.InvertedLuminanceSource(this)},t.prototype.getTempCanvasElement=function(){if(null===this.tempCanvasElement){var e=this.canvas.ownerDocument.createElement("canvas");e.width=this.canvas.width,e.height=this.canvas.height,this.tempCanvasElement=e}return this.tempCanvasElement},t.prototype.rotate=function(e){var r=this.getTempCanvasElement();if(!r)throw new Error("Could not create a Canvas element.");var n=e*t.DEGREE_TO_RADIANS,i=this.canvas.width,o=this.canvas.height,s=Math.ceil(Math.abs(Math.cos(n))*i+Math.abs(Math.sin(n))*o),a=Math.ceil(Math.abs(Math.sin(n))*i+Math.abs(Math.cos(n))*o);r.width=s,r.height=a;var u=r.getContext("2d");if(!u)throw new Error("Could not create a Canvas Context element.");return u.translate(s/2,a/2),u.rotate(n),u.drawImage(this.canvas,i/-2,o/-2),this.buffer=t.makeBufferFromCanvasImageData(r),this},t.DEGREE_TO_RADIANS=Math.PI/180,t}(o.LuminanceSource);r.HTMLCanvasElementLuminanceSource=s}}},{package:"@zxing/browser",file:"node_modules/@zxing/browser/cjs/common/HTMLCanvasElementLuminanceSource.js"}],[1654,{},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0})}}},{package:"@zxing/browser",file:"node_modules/@zxing/browser/cjs/common/HTMLVisualMediaElement.js"}],[1655,{},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0})}}},{package:"@zxing/browser",file:"node_modules/@zxing/browser/cjs/common/IScannerControls.js"}],[1656,{},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){function n(){return"undefined"!=typeof navigator}Object.defineProperty(r,"__esModule",{value:!0}),r.canEnumerateDevices=r.hasNavigator=void 0,r.hasNavigator=n,r.canEnumerateDevices=function(){return!!(n()&&navigator.mediaDevices&&navigator.mediaDevices.enumerateDevices)}}}},{package:"@zxing/browser",file:"node_modules/@zxing/browser/cjs/common/navigator-utils.js"}],[1657,{"./common/HTMLCanvasElementLuminanceSource":1653,"./common/HTMLVisualMediaElement":1654,"./common/IScannerControls":1655,"./readers/BrowserAztecCodeReader":1658,"./readers/BrowserCodeReader":1659,"./readers/BrowserDatamatrixCodeReader":1660,"./readers/BrowserMultiFormatOneDReader":1661,"./readers/BrowserMultiFormatReader":1662,"./readers/BrowserPDF417Reader":1663,"./readers/BrowserQRCodeReader":1664,"./readers/IBrowserCodeReaderOptions":1665,"./writers/BrowserCodeSvgWriter":1666,"./writers/BrowserQRCodeSvgWriter":1667,"@zxing/library":1668},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){n===undefined&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){n===undefined&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||t.hasOwnProperty(r)||n(t,e,r)};Object.defineProperty(r,"__esModule",{value:!0});var o=e("@zxing/library");Object.defineProperty(r,"BarcodeFormat",{enumerable:!0,get:function(){return o.BarcodeFormat}}),i(e("./common/HTMLCanvasElementLuminanceSource"),r),i(e("./common/HTMLVisualMediaElement"),r),i(e("./common/IScannerControls"),r),i(e("./readers/BrowserAztecCodeReader"),r),i(e("./readers/BrowserMultiFormatOneDReader"),r),i(e("./readers/BrowserCodeReader"),r),i(e("./readers/BrowserDatamatrixCodeReader"),r),i(e("./readers/BrowserMultiFormatReader"),r),i(e("./readers/BrowserPDF417Reader"),r),i(e("./readers/BrowserQRCodeReader"),r),i(e("./readers/IBrowserCodeReaderOptions"),r),i(e("./writers/BrowserCodeSvgWriter"),r),i(e("./writers/BrowserQRCodeSvgWriter"),r)}}},{package:"@zxing/browser",file:"node_modules/@zxing/browser/cjs/index.js"}],[1658,{"./BrowserCodeReader":1659,"@zxing/library":1668},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){var n,i=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},n(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(r,"__esModule",{value:!0}),r.BrowserAztecCodeReader=void 0;var o=e("@zxing/library"),s=function(e){function t(t,r){return e.call(this,new o.AztecCodeReader,t,r)||this}return i(t,e),t}(e("./BrowserCodeReader").BrowserCodeReader);r.BrowserAztecCodeReader=s}}},{package:"@zxing/browser",file:"node_modules/@zxing/browser/cjs/readers/BrowserAztecCodeReader.js"}],[1659,{"../common/HTMLCanvasElementLuminanceSource":1653,"../common/navigator-utils":1656,"@zxing/library":1668},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){var n=this&&this.__assign||function(){return n=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},n.apply(this,arguments)},i=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))},o=this&&this.__generator||function(e,t){var r,n,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(o){return function(a){return function(o){if(r)throw new TypeError("Generator is already executing.");for(;s;)try{if(r=1,n&&(i=2&o[0]?n.return:o[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,o[1])).done)return i;switch(n=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,n=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!(i=s.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){s.label=o[1];break}if(6===o[0]&&s.label<i[1]){s.label=i[1],i=o;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(o);break}i[2]&&s.ops.pop(),s.trys.pop();continue}o=t.call(e,s)}catch(e){o=[6,e],n=0}finally{r=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,a])}}},s=this&&this.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(r,"__esModule",{value:!0}),r.BrowserCodeReader=void 0;var a=e("@zxing/library"),u=e("../common/HTMLCanvasElementLuminanceSource"),c=e("../common/navigator-utils"),l={delayBetweenScanAttempts:500,delayBetweenScanSuccess:500,tryPlayVideoTimeout:5e3},d=function(){function e(e,t,r){void 0===t&&(t=new Map),void 0===r&&(r={}),this.reader=e,this.hints=t,this.options=n(n({},l),r)}return Object.defineProperty(e.prototype,"possibleFormats",{set:function(e){this.hints.set(a.DecodeHintType.POSSIBLE_FORMATS,e)},enumerable:!1,configurable:!0}),e.addVideoSource=function(e,t){try{e.srcObject=t}catch(r){e.src=URL.createObjectURL(t)}},e.mediaStreamSetTorch=function(e,t){return i(this,void 0,void 0,(function(){return o(this,(function(r){switch(r.label){case 0:return[4,e.applyConstraints({advanced:[{fillLightMode:t?"flash":"off",torch:!!t}]})];case 1:return r.sent(),[2]}}))}))},e.mediaStreamIsTorchCompatible=function(t){var r,n,i=t.getVideoTracks();try{for(var o=s(i),a=o.next();!a.done;a=o.next()){var u=a.value;if(e.mediaStreamIsTorchCompatibleTrack(u))return!0}}catch(e){r={error:e}}finally{try{a&&!a.done&&(n=o.return)&&n.call(o)}finally{if(r)throw r.error}}return!1},e.mediaStreamIsTorchCompatibleTrack=function(e){try{return"torch"in e.getCapabilities()}catch(e){return console.error(e),console.warn("Your browser may be not fully compatible with WebRTC and/or ImageCapture specs. Torch will not be available."),!1}},e.isVideoPlaying=function(e){return e.currentTime>0&&!e.paused&&e.readyState>2},e.getMediaElement=function(e,t){var r=document.getElementById(e);if(!r)throw new a.ArgumentException("element with id '"+e+"' not found");if(r.nodeName.toLowerCase()!==t.toLowerCase())throw new a.ArgumentException("element with id '"+e+"' must be an "+t+" element");return r},e.createVideoElement=function(t){if(t instanceof HTMLVideoElement)return t;if("string"==typeof t)return e.getMediaElement(t,"video");if(!t&&"undefined"!=typeof document){var r=document.createElement("video");return r.width=200,r.height=200,r}throw new Error("Couldn't get videoElement from videoSource!")},e.prepareImageElement=function(t){if(t instanceof HTMLImageElement)return t;if("string"==typeof t)return e.getMediaElement(t,"img");if(void 0===t){var r=document.createElement("img");return r.width=200,r.height=200,r}throw new Error("Couldn't get imageElement from imageSource!")},e.prepareVideoElement=function(t){var r=e.createVideoElement(t);return r.setAttribute("autoplay","true"),r.setAttribute("muted","true"),r.setAttribute("playsinline","true"),r},e.isImageLoaded=function(e){return!!e.complete&&0!==e.naturalWidth},e.createBinaryBitmapFromCanvas=function(e){var t=new u.HTMLCanvasElementLuminanceSource(e),r=new a.HybridBinarizer(t);return new a.BinaryBitmap(r)},e.drawImageOnCanvas=function(e,t){e.drawImage(t,0,0)},e.getMediaElementDimensions=function(e){if(e instanceof HTMLVideoElement)return{height:e.videoHeight,width:e.videoWidth};if(e instanceof HTMLImageElement)return{height:e.naturalHeight||e.height,width:e.naturalWidth||e.width};throw new Error("Couldn't find the Source's dimensions!")},e.createCaptureCanvas=function(t){if(!t)throw new a.ArgumentException("Cannot create a capture canvas without a media element.");if("undefined"==typeof document)throw new Error('The page "Document" is undefined, make sure you\'re running in a browser.');var r=document.createElement("canvas"),n=e.getMediaElementDimensions(t),i=n.width,o=n.height;return r.style.width=i+"px",r.style.height=o+"px",r.width=i,r.height=o,r},e.tryPlayVideo=function(t){return i(this,void 0,void 0,(function(){var r;return o(this,(function(n){switch(n.label){case 0:if(null==t?void 0:t.ended)return console.error("Trying to play video that has ended."),[2,!1];if(e.isVideoPlaying(t))return console.warn("Trying to play video that is already playing."),[2,!0];n.label=1;case 1:return n.trys.push([1,3,,4]),[4,t.play()];case 2:return n.sent(),[2,!0];case 3:return r=n.sent(),console.warn("It was not possible to play the video.",r),[2,!1];case 4:return[2]}}))}))},e.createCanvasFromMediaElement=function(t){var r=e.createCaptureCanvas(t),n=r.getContext("2d");if(!n)throw new Error("Couldn't find Canvas 2D Context.");return e.drawImageOnCanvas(n,t),r},e.createBinaryBitmapFromMediaElem=function(t){var r=e.createCanvasFromMediaElement(t);return e.createBinaryBitmapFromCanvas(r)},e.destroyImageElement=function(e){e.src="",e.removeAttribute("src"),e=undefined},e.listVideoInputDevices=function(){return i(this,void 0,void 0,(function(){var e,t,r,n,i,a,u,l,d,f,h,p;return o(this,(function(o){switch(o.label){case 0:if(!c.hasNavigator())throw new Error("Can't enumerate devices, navigator is not present.");if(!c.canEnumerateDevices())throw new Error("Can't enumerate devices, method not supported.");return[4,navigator.mediaDevices.enumerateDevices()];case 1:e=o.sent(),t=[];try{for(r=s(e),n=r.next();!n.done;n=r.next())i=n.value,"videoinput"===(a="video"===i.kind?"videoinput":i.kind)&&(u=i.deviceId||i.id,l=i.label||"Video device "+(t.length+1),d=i.groupId,f={deviceId:u,label:l,kind:a,groupId:d},t.push(f))}catch(e){h={error:e}}finally{try{n&&!n.done&&(p=r.return)&&p.call(r)}finally{if(h)throw h.error}}return[2,t]}}))}))},e.findDeviceById=function(t){return i(this,void 0,void 0,(function(){var r;return o(this,(function(n){switch(n.label){case 0:return[4,e.listVideoInputDevices()];case 1:return(r=n.sent())?[2,r.find((function(e){return e.deviceId===t}))]:[2]}}))}))},e.cleanVideoSource=function(e){if(e){try{e.srcObject=null}catch(t){e.src=""}e&&e.removeAttribute("src")}},e.releaseAllStreams=function(){0!==e.streamTracker.length&&e.streamTracker.forEach((function(e){e.getTracks().forEach((function(e){return e.stop()}))})),e.streamTracker=[]},e.playVideoOnLoadAsync=function(t,r){return i(this,void 0,void 0,(function(){return o(this,(function(n){switch(n.label){case 0:return[4,e.tryPlayVideo(t)];case 1:return n.sent()?[2,!0]:[2,new Promise((function(n,i){var o=setTimeout((function(){e.isVideoPlaying(t)||(i(!1),t.removeEventListener("canplay",s))}),r),s=function(){e.tryPlayVideo(t).then((function(e){clearTimeout(o),t.removeEventListener("canplay",s),n(e)}))};t.addEventListener("canplay",s)}))]}}))}))},e.attachStreamToVideo=function(t,r,n){return void 0===n&&(n=5e3),i(this,void 0,void 0,(function(){var i;return o(this,(function(o){switch(o.label){case 0:return i=e.prepareVideoElement(r),e.addVideoSource(i,t),[4,e.playVideoOnLoadAsync(i,n)];case 1:return o.sent(),[2,i]}}))}))},e._waitImageLoad=function(t){return new Promise((function(r,n){var i=setTimeout((function(){e.isImageLoaded(t)||(t.removeEventListener("load",o),n())}),1e4),o=function(){clearTimeout(i),t.removeEventListener("load",o),r()};t.addEventListener("load",o)}))},e.checkCallbackFnOrThrow=function(e){if(!e)throw new a.ArgumentException("`callbackFn` is a required parameter, you cannot capture results without it.")},e.disposeMediaStream=function(e){e.getVideoTracks().forEach((function(e){return e.stop()})),e=undefined},e.prototype.decode=function(t){var r=e.createCanvasFromMediaElement(t);return this.decodeFromCanvas(r)},e.prototype.decodeBitmap=function(e){return this.reader.decode(e,this.hints)},e.prototype.decodeFromCanvas=function(t){var r=e.createBinaryBitmapFromCanvas(t);return this.decodeBitmap(r)},e.prototype.decodeFromImageElement=function(t){return i(this,void 0,void 0,(function(){var r;return o(this,(function(n){switch(n.label){case 0:if(!t)throw new a.ArgumentException("An image element must be provided.");return r=e.prepareImageElement(t),[4,this._decodeOnLoadImage(r)];case 1:return[2,n.sent()]}}))}))},e.prototype.decodeFromImageUrl=function(t){return i(this,void 0,void 0,(function(){var r;return o(this,(function(n){switch(n.label){case 0:if(!t)throw new a.ArgumentException("An URL must be provided.");(r=e.prepareImageElement()).src=t,n.label=1;case 1:return n.trys.push([1,,3,4]),[4,this.decodeFromImageElement(r)];case 2:return[2,n.sent()];case 3:return e.destroyImageElement(r),[7];case 4:return[2]}}))}))},e.prototype.decodeFromConstraints=function(t,r,n){return i(this,void 0,void 0,(function(){var i,s;return o(this,(function(o){switch(o.label){case 0:return e.checkCallbackFnOrThrow(n),[4,this.getUserMedia(t)];case 1:i=o.sent(),o.label=2;case 2:return o.trys.push([2,4,,5]),[4,this.decodeFromStream(i,r,n)];case 3:return[2,o.sent()];case 4:throw s=o.sent(),e.disposeMediaStream(i),s;case 5:return[2]}}))}))},e.prototype.decodeFromStream=function(t,r,a){return i(this,void 0,void 0,(function(){var u,c,l,d,f,h,p,m,g,y=this;return o(this,(function(v){switch(v.label){case 0:return e.checkCallbackFnOrThrow(a),u=this.options.tryPlayVideoTimeout,[4,e.attachStreamToVideo(t,r,u)];case 1:return c=v.sent(),l=function(){e.disposeMediaStream(t),e.cleanVideoSource(c)},d=this.scan(c,a,l),f=t.getVideoTracks(),h=n(n({},d),{stop:function(){d.stop()},streamVideoConstraintsApply:function(e,t){return i(this,void 0,void 0,(function(){var r,n,i,a,u,c;return o(this,(function(o){switch(o.label){case 0:r=t?f.filter(t):f,o.label=1;case 1:o.trys.push([1,6,7,8]),n=s(r),i=n.next(),o.label=2;case 2:return i.done?[3,5]:[4,i.value.applyConstraints(e)];case 3:o.sent(),o.label=4;case 4:return i=n.next(),[3,2];case 5:return[3,8];case 6:return a=o.sent(),u={error:a},[3,8];case 7:try{i&&!i.done&&(c=n.return)&&c.call(n)}finally{if(u)throw u.error}return[7];case 8:return[2]}}))}))},streamVideoConstraintsGet:function(e){return f.find(e).getConstraints()},streamVideoSettingsGet:function(e){return f.find(e).getSettings()},streamVideoCapabilitiesGet:function(e){return f.find(e).getCapabilities()}}),e.mediaStreamIsTorchCompatible(t)&&(p=null==f?void 0:f.find((function(t){return e.mediaStreamIsTorchCompatibleTrack(t)})),m=function(t){return i(y,void 0,void 0,(function(){return o(this,(function(r){switch(r.label){case 0:return[4,e.mediaStreamSetTorch(p,t)];case 1:return r.sent(),[2]}}))}))},h.switchTorch=m,g=function(){d.stop(),m(!1)},h.stop=g),[2,h]}}))}))},e.prototype.decodeFromVideoDevice=function(t,r,n){return i(this,void 0,void 0,(function(){var i;return o(this,(function(o){switch(o.label){case 0:return e.checkCallbackFnOrThrow(n),i={video:t?{deviceId:{exact:t}}:{facingMode:"environment"}},[4,this.decodeFromConstraints(i,r,n)];case 1:return[2,o.sent()]}}))}))},e.prototype.decodeFromVideoElement=function(t,r){return i(this,void 0,void 0,(function(){var n,i;return o(this,(function(o){switch(o.label){case 0:if(e.checkCallbackFnOrThrow(r),!t)throw new a.ArgumentException("A video element must be provided.");return n=e.prepareVideoElement(t),i=this.options.tryPlayVideoTimeout,[4,e.playVideoOnLoadAsync(n,i)];case 1:return o.sent(),[2,this.scan(n,r)]}}))}))},e.prototype.decodeFromVideoUrl=function(t,r){return i(this,void 0,void 0,(function(){var n,i,s;return o(this,(function(o){switch(o.label){case 0:if(e.checkCallbackFnOrThrow(r),!t)throw new a.ArgumentException("An URL must be provided.");return(n=e.prepareVideoElement()).src=t,i=function(){e.cleanVideoSource(n)},s=this.options.tryPlayVideoTimeout,[4,e.playVideoOnLoadAsync(n,s)];case 1:return o.sent(),[2,this.scan(n,r,i)]}}))}))},e.prototype.decodeOnceFromConstraints=function(e,t){return i(this,void 0,void 0,(function(){var r;return o(this,(function(n){switch(n.label){case 0:return[4,this.getUserMedia(e)];case 1:return r=n.sent(),[4,this.decodeOnceFromStream(r,t)];case 2:return[2,n.sent()]}}))}))},e.prototype.decodeOnceFromStream=function(t,r){return i(this,void 0,void 0,(function(){var n,i;return o(this,(function(o){switch(o.label){case 0:return n=Boolean(r),[4,e.attachStreamToVideo(t,r)];case 1:i=o.sent(),o.label=2;case 2:return o.trys.push([2,,4,5]),[4,this.scanOneResult(i)];case 3:return[2,o.sent()];case 4:return n||e.cleanVideoSource(i),[7];case 5:return[2]}}))}))},e.prototype.decodeOnceFromVideoDevice=function(e,t){return i(this,void 0,void 0,(function(){var r;return o(this,(function(n){switch(n.label){case 0:return r={video:e?{deviceId:{exact:e}}:{facingMode:"environment"}},[4,this.decodeOnceFromConstraints(r,t)];case 1:return[2,n.sent()]}}))}))},e.prototype.decodeOnceFromVideoElement=function(t){return i(this,void 0,void 0,(function(){var r,n;return o(this,(function(i){switch(i.label){case 0:if(!t)throw new a.ArgumentException("A video element must be provided.");return r=e.prepareVideoElement(t),n=this.options.tryPlayVideoTimeout,[4,e.playVideoOnLoadAsync(r,n)];case 1:return i.sent(),[4,this.scanOneResult(r)];case 2:return[2,i.sent()]}}))}))},e.prototype.decodeOnceFromVideoUrl=function(t){return i(this,void 0,void 0,(function(){var r,n;return o(this,(function(i){switch(i.label){case 0:if(!t)throw new a.ArgumentException("An URL must be provided.");(r=e.prepareVideoElement()).src=t,n=this.decodeOnceFromVideoElement(r),i.label=1;case 1:return i.trys.push([1,,3,4]),[4,n];case 2:return[2,i.sent()];case 3:return e.cleanVideoSource(r),[7];case 4:return[2]}}))}))},e.prototype.scanOneResult=function(e,t,r,n){var i=this;return void 0===t&&(t=!0),void 0===r&&(r=!0),void 0===n&&(n=!0),new Promise((function(o,s){i.scan(e,(function(e,i,u){if(e)return o(e),void u.stop();if(i){if(i instanceof a.NotFoundException&&t)return;if(i instanceof a.ChecksumException&&r)return;if(i instanceof a.FormatException&&n)return;u.stop(),s(i)}}))}))},e.prototype.scan=function(t,r,n){var i=this;e.checkCallbackFnOrThrow(r);var o=e.createCaptureCanvas(t),s=o.getContext("2d");if(!s)throw new Error("Couldn't create canvas for visual element scan.");var u,c=function(){s=undefined,o=undefined},l=!1,d={stop:function(){l=!0,clearTimeout(u),c(),n&&n()}},f=function(){if(!l)try{e.drawImageOnCanvas(s,t);var h=i.decodeFromCanvas(o);r(h,undefined,d),u=setTimeout(f,i.options.delayBetweenScanSuccess)}catch(e){r(undefined,e,d);var p=e instanceof a.ChecksumException,m=e instanceof a.FormatException,g=e instanceof a.NotFoundException;if(p||m||g)return void(u=setTimeout(f,i.options.delayBetweenScanAttempts));c(),n&&n(e)}};return f(),d},e.prototype._decodeOnLoadImage=function(t){return i(this,void 0,void 0,(function(){return o(this,(function(r){switch(r.label){case 0:return e.isImageLoaded(t)?[3,2]:[4,e._waitImageLoad(t)];case 1:r.sent(),r.label=2;case 2:return[2,this.decode(t)]}}))}))},e.prototype.getUserMedia=function(t){return i(this,void 0,void 0,(function(){var r;return o(this,(function(n){switch(n.label){case 0:return[4,navigator.mediaDevices.getUserMedia(t)];case 1:return r=n.sent(),e.streamTracker.push(r),[2,r]}}))}))},e.streamTracker=[],e}();r.BrowserCodeReader=d}}},{package:"@zxing/browser",file:"node_modules/@zxing/browser/cjs/readers/BrowserCodeReader.js"}],[1660,{"./BrowserCodeReader":1659,"@zxing/library":1668},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){var n,i=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},n(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(r,"__esModule",{value:!0}),r.BrowserDatamatrixCodeReader=void 0;var o=e("@zxing/library"),s=function(e){function t(t,r){return e.call(this,new o.DataMatrixReader,t,r)||this}return i(t,e),t}(e("./BrowserCodeReader").BrowserCodeReader);r.BrowserDatamatrixCodeReader=s}}},{package:"@zxing/browser",file:"node_modules/@zxing/browser/cjs/readers/BrowserDatamatrixCodeReader.js"}],[1661,{"./BrowserCodeReader":1659,"@zxing/library":1668},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){var n,i=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},n(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(r,"__esModule",{value:!0}),r.BrowserMultiFormatOneDReader=void 0;var o=e("@zxing/library"),s=function(e){function t(t,r){return e.call(this,new o.MultiFormatOneDReader(t),t,r)||this}return i(t,e),t}(e("./BrowserCodeReader").BrowserCodeReader);r.BrowserMultiFormatOneDReader=s}}},{package:"@zxing/browser",file:"node_modules/@zxing/browser/cjs/readers/BrowserMultiFormatOneDReader.js"}],[1662,{"./BrowserCodeReader":1659,"@zxing/library":1668},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){var n,i=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},n(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(r,"__esModule",{value:!0}),r.BrowserMultiFormatReader=void 0;var o=e("@zxing/library"),s=function(e){function t(t,r){var n=this,i=new o.MultiFormatReader;return i.setHints(t),(n=e.call(this,i,t,r)||this).reader=i,n}return i(t,e),Object.defineProperty(t.prototype,"possibleFormats",{set:function(e){this.hints.set(o.DecodeHintType.POSSIBLE_FORMATS,e),this.reader.setHints(this.hints)},enumerable:!1,configurable:!0}),t.prototype.decodeBitmap=function(e){return this.reader.decodeWithState(e)},t.prototype.setHints=function(e){this.hints=e,this.reader.setHints(this.hints)},t}(e("./BrowserCodeReader").BrowserCodeReader);r.BrowserMultiFormatReader=s}}},{package:"@zxing/browser",file:"node_modules/@zxing/browser/cjs/readers/BrowserMultiFormatReader.js"}],[1663,{"./BrowserCodeReader":1659,"@zxing/library":1668},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){var n,i=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},n(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(r,"__esModule",{value:!0}),r.BrowserPDF417Reader=void 0;var o=e("@zxing/library"),s=function(e){function t(t,r){return e.call(this,new o.PDF417Reader,t,r)||this}return i(t,e),t}(e("./BrowserCodeReader").BrowserCodeReader);r.BrowserPDF417Reader=s}}},{package:"@zxing/browser",file:"node_modules/@zxing/browser/cjs/readers/BrowserPDF417Reader.js"}],[1664,{"./BrowserCodeReader":1659,"@zxing/library":1668},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){var n,i=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},n(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(r,"__esModule",{value:!0}),r.BrowserQRCodeReader=void 0;var o=e("@zxing/library"),s=function(e){function t(t,r){return e.call(this,new o.QRCodeReader,t,r)||this}return i(t,e),t}(e("./BrowserCodeReader").BrowserCodeReader);r.BrowserQRCodeReader=s}}},{package:"@zxing/browser",file:"node_modules/@zxing/browser/cjs/readers/BrowserQRCodeReader.js"}],[1665,{},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0})}}},{package:"@zxing/browser",file:"node_modules/@zxing/browser/cjs/readers/IBrowserCodeReaderOptions.js"}],[1666,{"@zxing/library":1668},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.BrowserCodeSvgWriter=void 0;var n=e("@zxing/library"),i="http://www.w3.org/2000/svg",o=function(){function e(e){if("string"==typeof e){var t=document.getElementById(e);if(!t)throw new Error("Could not find a Container element with '"+e+"'.");this.containerElement=t}else this.containerElement=e}return e.prototype.write=function(t,r,i,o){if(0===t.length)throw new n.IllegalArgumentException("Found empty contents");if(r<0||i<0)throw new n.IllegalArgumentException("Requested dimensions are too small: "+r+"x"+i);var s=o&&o.get(n.EncodeHintType.MARGIN)!==undefined?Number.parseInt(o.get(n.EncodeHintType.MARGIN).toString(),10):e.QUIET_ZONE_SIZE,a=this.encode(o,t);return this.renderResult(a,r,i,s)},e.prototype.createSVGElement=function(t,r){var n=document.createElementNS(e.SVG_NS,"svg");return n.setAttributeNS(i,"width",r.toString()),n.setAttributeNS(i,"height",t.toString()),n},e.prototype.createSvgPathPlaceholderElement=function(t,r){var n=document.createElementNS(e.SVG_NS,"path");return n.setAttributeNS(i,"d","M0 0h"+t+"v"+r+"H0z"),n.setAttributeNS(i,"fill","none"),n},e.prototype.createSvgRectElement=function(t,r,n,o){var s=document.createElementNS(e.SVG_NS,"rect");return s.setAttributeNS(i,"x",t.toString()),s.setAttributeNS(i,"y",r.toString()),s.setAttributeNS(i,"height",n.toString()),s.setAttributeNS(i,"width",o.toString()),s.setAttributeNS(i,"fill","#000000"),s},e.prototype.encode=function(e,t){var r=n.QRCodeDecoderErrorCorrectionLevel.L;if(e&&e.get(n.EncodeHintType.ERROR_CORRECTION)!==undefined){var i=e.get(n.EncodeHintType.ERROR_CORRECTION).toString();r=n.QRCodeDecoderErrorCorrectionLevel.fromString(i)}return n.QRCodeEncoder.encode(t,r,e)},e.prototype.renderResult=function(e,t,r,i){var o=e.getMatrix();if(null===o)throw new n.IllegalStateException;var s=o.getWidth(),a=o.getHeight(),u=s+2*i,c=a+2*i,l=Math.max(t,u),d=Math.max(r,c),f=Math.min(Math.floor(l/u),Math.floor(d/c)),h=Math.floor((l-s*f)/2),p=Math.floor((d-a*f)/2),m=this.createSVGElement(l,d),g=this.createSvgPathPlaceholderElement(t,r);m.appendChild(g),this.containerElement.appendChild(m);for(var y=0,v=p;y<a;y++,v+=f)for(var b=0,w=h;b<s;b++,w+=f)if(1===o.get(b,y)){var M=this.createSvgRectElement(w,v,f,f);m.appendChild(M)}return m},e.QUIET_ZONE_SIZE=4,e.SVG_NS="http://www.w3.org/2000/svg",e}();r.BrowserCodeSvgWriter=o}}},{package:"@zxing/browser",file:"node_modules/@zxing/browser/cjs/writers/BrowserCodeSvgWriter.js"}],[1667,{"@zxing/library":1668},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.BrowserQRCodeSvgWriter=void 0;var n=e("@zxing/library"),i="http://www.w3.org/2000/svg",o=function(){function e(){}return e.prototype.write=function(t,r,i,o){if(0===t.length)throw new n.IllegalArgumentException("Found empty contents");if(r<0||i<0)throw new n.IllegalArgumentException("Requested dimensions are too small: "+r+"x"+i);var s=n.QRCodeDecoderErrorCorrectionLevel.L,a=e.QUIET_ZONE_SIZE;if(o){if(undefined!==o.get(n.EncodeHintType.ERROR_CORRECTION)){var u=o.get(n.EncodeHintType.ERROR_CORRECTION).toString();s=n.QRCodeDecoderErrorCorrectionLevel.fromString(u)}undefined!==o.get(n.EncodeHintType.MARGIN)&&(a=Number.parseInt(o.get(n.EncodeHintType.MARGIN).toString(),10))}var c=n.QRCodeEncoder.encode(t,s,o);return this.renderResult(c,r,i,a)},e.prototype.writeToDom=function(e,t,r,n,i){if("string"==typeof e){var o=document.querySelector(e);if(!o)throw new Error("Could no find the target HTML element.");e=o}var s=this.write(t,r,n,i);e instanceof HTMLElement&&e.appendChild(s)},e.prototype.renderResult=function(e,t,r,i){var o=e.getMatrix();if(null===o)throw new n.IllegalStateException;for(var s=o.getWidth(),a=o.getHeight(),u=s+2*i,c=a+2*i,l=Math.max(t,u),d=Math.max(r,c),f=Math.min(Math.floor(l/u),Math.floor(d/c)),h=Math.floor((l-s*f)/2),p=Math.floor((d-a*f)/2),m=this.createSVGElement(l,d),g=0,y=p;g<a;g++,y+=f)for(var v=0,b=h;v<s;v++,b+=f)if(1===o.get(v,g)){var w=this.createSvgRectElement(b,y,f,f);m.appendChild(w)}return m},e.prototype.createSVGElement=function(e,t){var r=document.createElementNS(i,"svg"),n=e.toString(),o=t.toString();return r.setAttribute("height",o),r.setAttribute("width",n),r.setAttribute("viewBox","0 0 "+n+" "+o),r},e.prototype.createSvgRectElement=function(e,t,r,n){var o=document.createElementNS(i,"rect");return o.setAttribute("x",e.toString()),o.setAttribute("y",t.toString()),o.setAttribute("height",r.toString()),o.setAttribute("width",n.toString()),o.setAttribute("fill","#000000"),o},e.QUIET_ZONE_SIZE=4,e}();r.BrowserQRCodeSvgWriter=o}}},{package:"@zxing/browser",file:"node_modules/@zxing/browser/cjs/writers/BrowserQRCodeSvgWriter.js"}]],[],{});