@eluvio/elv-client-js 4.0.24 → 4.0.25
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ElvClient-min.js +2 -2
- package/dist/ElvClient-node-min.js +2 -2
- package/dist/ElvFrameClient-min.js +1 -1
- package/dist/ElvWalletClient-min.js +2 -2
- package/dist/ElvWalletClient-node-min.js +2 -2
- package/dist/src/ElvClient.js +5 -1
- package/dist/src/client/ContentAccess.js +22 -8
- package/package.json +1 -1
- package/src/ElvClient.js +1 -0
- package/src/client/ContentAccess.js +19 -5
|
@@ -64,4 +64,4 @@ var n=r(12),i=r(13),o=r(14);function a(){return c.TYPED_ARRAY_SUPPORT?2147483647
|
|
|
64
64
|
* @copyright Chen, Yi-Cyuan 2015-2018
|
|
65
65
|
* @license MIT
|
|
66
66
|
*/!function(){"use strict";var s="input is invalid type",c="object"===("undefined"==typeof window?"undefined":a(window)),A=c?window:{};A.JS_SHA3_NO_WINDOW&&(c=!1);var u=!c&&"object"===("undefined"==typeof self?"undefined":a(self));!A.JS_SHA3_NO_NODE_JS&&"object"===(void 0===t?"undefined":a(t))&&t.versions&&t.versions.node?A=n:u&&(A=self);var f=!A.JS_SHA3_NO_COMMON_JS&&"object"===a(i)&&i.exports,h=r(54),l=!A.JS_SHA3_NO_ARRAY_BUFFER&&"undefined"!=typeof ArrayBuffer,d="0123456789abcdef".split(""),g=[4,1024,262144,67108864],p=[0,8,16,24],y=[1,0,32898,0,32906,2147483648,2147516416,2147483648,32907,0,2147483649,0,2147516545,2147483648,32777,2147483648,138,0,136,0,2147516425,0,2147483658,0,2147516555,0,139,2147483648,32905,2147483648,32771,2147483648,32770,2147483648,128,2147483648,32778,0,2147483658,2147483648,2147516545,2147483648,32896,2147483648,2147483649,0,2147516424,2147483648],I=[224,256,384,512],b=[128,256],v=["hex","buffer","arrayBuffer","array","digest"],E={128:168,256:136};!A.JS_SHA3_NO_NODE_JS&&Array.isArray||(Array.isArray=function(t){return"[object Array]"===Object.prototype.toString.call(t)}),!l||!A.JS_SHA3_NO_ARRAY_BUFFER_IS_VIEW&&ArrayBuffer.isView||(ArrayBuffer.isView=function(t){return"object"===a(t)&&t.buffer&&t.buffer.constructor===ArrayBuffer});for(var m=function(t,e,r){return function(n){return new j(t,e,t).update(n)[r]()}},C=function(t,e,r){return function(n,i){return new j(t,e,i).update(n)[r]()}},w=function(t,e,r){return function(e,n,i,o){return _["cshake"+t].update(e,n,i,o)[r]()}},B=function(t,e,r){return function(e,n,i,o){return _["kmac"+t].update(e,n,i,o)[r]()}},Q=function(t,e,r,n){for(var i=0;i<v.length;++i){var o=v[i];t[o]=e(r,n,o)}return t},k=function(t,e){var r=m(t,e,"hex");return r.create=function(){return new j(t,e,t)},r.update=function(t){return r.create().update(t)},Q(r,m,t,e)},S=[{name:"keccak",padding:[1,256,65536,16777216],bits:I,createMethod:k},{name:"sha3",padding:[6,1536,393216,100663296],bits:I,createMethod:k},{name:"shake",padding:[31,7936,2031616,520093696],bits:b,createMethod:function(t,e){var r=C(t,e,"hex");return r.create=function(r){return new j(t,e,r)},r.update=function(t,e){return r.create(e).update(t)},Q(r,C,t,e)}},{name:"cshake",padding:g,bits:b,createMethod:function(t,e){var r=E[t],n=w(t,0,"hex");return n.create=function(n,i,o){return i||o?new j(t,e,n).bytepad([i,o],r):_["shake"+t].create(n)},n.update=function(t,e,r,i){return n.create(e,r,i).update(t)},Q(n,w,t,e)}},{name:"kmac",padding:g,bits:b,createMethod:function(t,e){var r=E[t],n=B(t,0,"hex");return n.create=function(n,i,o){return new L(t,e,i).bytepad(["KMAC",o],r).bytepad([n],r)},n.update=function(t,e,r,i){return n.create(t,r,i).update(e)},Q(n,B,t,e)}}],_={},D=[],x=0;x<S.length;++x)for(var M=S[x],R=M.bits,O=0;O<R.length;++O){var N=M.name+"_"+R[O];if(D.push(N),_[N]=M.createMethod(R[O],M.padding),"sha3"!==M.name){var P=M.name+R[O];D.push(P),_[P]=_[N]}}function j(t,e,r){this.blocks=[],this.s=[],this.padding=e,this.outputBits=r,this.reset=!0,this.finalized=!1,this.block=0,this.start=0,this.blockCount=1600-(t<<1)>>5,this.byteCount=this.blockCount<<2,this.outputBlocks=r>>5,this.extraBytes=(31&r)>>3;for(var n=0;n<50;++n)this.s[n]=0}function L(t,e,r){j.call(this,t,e,r)}j.prototype.update=function(t){if(this.finalized)throw new Error("finalize already called");var e,r=a(t);if("string"!==r){if("object"!==r)throw new Error(s);if(null===t)throw new Error(s);if(l&&t.constructor===ArrayBuffer)t=new Uint8Array(t);else if(!(Array.isArray(t)||l&&ArrayBuffer.isView(t)))throw new Error(s);e=!0}for(var n,i,o=this.blocks,c=this.byteCount,A=t.length,u=this.blockCount,f=0,h=this.s;f<A;){if(this.reset)for(this.reset=!1,o[0]=this.block,n=1;n<u+1;++n)o[n]=0;if(e)for(n=this.start;f<A&&n<c;++f)o[n>>2]|=t[f]<<p[3&n++];else for(n=this.start;f<A&&n<c;++f)(i=t.charCodeAt(f))<128?o[n>>2]|=i<<p[3&n++]:i<2048?(o[n>>2]|=(192|i>>6)<<p[3&n++],o[n>>2]|=(128|63&i)<<p[3&n++]):i<55296||i>=57344?(o[n>>2]|=(224|i>>12)<<p[3&n++],o[n>>2]|=(128|i>>6&63)<<p[3&n++],o[n>>2]|=(128|63&i)<<p[3&n++]):(i=65536+((1023&i)<<10|1023&t.charCodeAt(++f)),o[n>>2]|=(240|i>>18)<<p[3&n++],o[n>>2]|=(128|i>>12&63)<<p[3&n++],o[n>>2]|=(128|i>>6&63)<<p[3&n++],o[n>>2]|=(128|63&i)<<p[3&n++]);if(this.lastByteIndex=n,n>=c){for(this.start=n-c,this.block=o[u],n=0;n<u;++n)h[n]^=o[n];F(h),this.reset=!0}else this.start=n}return this},j.prototype.encode=function(t,e){var r=255&t,n=1,i=[r];for(r=255&(t>>=8);r>0;)i.unshift(r),r=255&(t>>=8),++n;return e?i.push(n):i.unshift(n),this.update(i),i.length},j.prototype.encodeString=function(t){var e,r=a(t);if("string"!==r){if("object"!==r)throw new Error(s);if(null===t)throw new Error(s);if(l&&t.constructor===ArrayBuffer)t=new Uint8Array(t);else if(!(Array.isArray(t)||l&&ArrayBuffer.isView(t)))throw new Error(s);e=!0}var n=0,i=t.length;if(e)n=i;else for(var o=0;o<t.length;++o){var c=t.charCodeAt(o);c<128?n+=1:c<2048?n+=2:c<55296||c>=57344?n+=3:(c=65536+((1023&c)<<10|1023&t.charCodeAt(++o)),n+=4)}return n+=this.encode(8*n),this.update(t),n},j.prototype.bytepad=function(t,e){for(var r=this.encode(e),n=0;n<t.length;++n)r+=this.encodeString(t[n]);var i=e-r%e,o=[];return o.length=i,this.update(o),this},j.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var t=this.blocks,e=this.lastByteIndex,r=this.blockCount,n=this.s;if(t[e>>2]|=this.padding[3&e],this.lastByteIndex===this.byteCount)for(t[0]=t[r],e=1;e<r+1;++e)t[e]=0;for(t[r-1]|=2147483648,e=0;e<r;++e)n[e]^=t[e];F(n)}},j.prototype.toString=j.prototype.hex=function(){this.finalize();for(var t,e=this.blockCount,r=this.s,n=this.outputBlocks,i=this.extraBytes,o=0,a=0,s="";a<n;){for(o=0;o<e&&a<n;++o,++a)t=r[o],s+=d[t>>4&15]+d[15&t]+d[t>>12&15]+d[t>>8&15]+d[t>>20&15]+d[t>>16&15]+d[t>>28&15]+d[t>>24&15];a%e==0&&(F(r),o=0)}return i&&(t=r[o],s+=d[t>>4&15]+d[15&t],i>1&&(s+=d[t>>12&15]+d[t>>8&15]),i>2&&(s+=d[t>>20&15]+d[t>>16&15])),s},j.prototype.arrayBuffer=function(){this.finalize();var t,e=this.blockCount,r=this.s,n=this.outputBlocks,i=this.extraBytes,o=0,a=0,s=this.outputBits>>3;t=i?new ArrayBuffer(n+1<<2):new ArrayBuffer(s);for(var c=new Uint32Array(t);a<n;){for(o=0;o<e&&a<n;++o,++a)c[a]=r[o];a%e==0&&F(r)}return i&&(c[o]=r[o],t=t.slice(0,s)),t},j.prototype.buffer=j.prototype.arrayBuffer,j.prototype.digest=j.prototype.array=function(){this.finalize();for(var t,e,r=this.blockCount,n=this.s,i=this.outputBlocks,o=this.extraBytes,a=0,s=0,c=[];s<i;){for(a=0;a<r&&s<i;++a,++s)t=s<<2,e=n[a],c[t]=255&e,c[t+1]=e>>8&255,c[t+2]=e>>16&255,c[t+3]=e>>24&255;s%r==0&&F(n)}return o&&(t=s<<2,e=n[a],c[t]=255&e,o>1&&(c[t+1]=e>>8&255),o>2&&(c[t+2]=e>>16&255)),c},L.prototype=new j,L.prototype.finalize=function(){return this.encode(this.outputBits,!0),j.prototype.finalize.call(this)};var F=function(t){var e,r,n,i,o,a,s,c,A,u,f,h,l,d,g,p,I,b,v,E,m,C,w,B,Q,k,S,_,D,x,M,R,O,N,P,j,L,F,T,U,G,H,Y,K,q,J,z,Z,V,W,X,$,tt,et,rt,nt,it,ot,at,st,ct,At,ut;for(n=0;n<48;n+=2)i=t[0]^t[10]^t[20]^t[30]^t[40],o=t[1]^t[11]^t[21]^t[31]^t[41],a=t[2]^t[12]^t[22]^t[32]^t[42],s=t[3]^t[13]^t[23]^t[33]^t[43],c=t[4]^t[14]^t[24]^t[34]^t[44],A=t[5]^t[15]^t[25]^t[35]^t[45],u=t[6]^t[16]^t[26]^t[36]^t[46],f=t[7]^t[17]^t[27]^t[37]^t[47],e=(h=t[8]^t[18]^t[28]^t[38]^t[48])^(a<<1|s>>>31),r=(l=t[9]^t[19]^t[29]^t[39]^t[49])^(s<<1|a>>>31),t[0]^=e,t[1]^=r,t[10]^=e,t[11]^=r,t[20]^=e,t[21]^=r,t[30]^=e,t[31]^=r,t[40]^=e,t[41]^=r,e=i^(c<<1|A>>>31),r=o^(A<<1|c>>>31),t[2]^=e,t[3]^=r,t[12]^=e,t[13]^=r,t[22]^=e,t[23]^=r,t[32]^=e,t[33]^=r,t[42]^=e,t[43]^=r,e=a^(u<<1|f>>>31),r=s^(f<<1|u>>>31),t[4]^=e,t[5]^=r,t[14]^=e,t[15]^=r,t[24]^=e,t[25]^=r,t[34]^=e,t[35]^=r,t[44]^=e,t[45]^=r,e=c^(h<<1|l>>>31),r=A^(l<<1|h>>>31),t[6]^=e,t[7]^=r,t[16]^=e,t[17]^=r,t[26]^=e,t[27]^=r,t[36]^=e,t[37]^=r,t[46]^=e,t[47]^=r,e=u^(i<<1|o>>>31),r=f^(o<<1|i>>>31),t[8]^=e,t[9]^=r,t[18]^=e,t[19]^=r,t[28]^=e,t[29]^=r,t[38]^=e,t[39]^=r,t[48]^=e,t[49]^=r,d=t[0],g=t[1],J=t[11]<<4|t[10]>>>28,z=t[10]<<4|t[11]>>>28,_=t[20]<<3|t[21]>>>29,D=t[21]<<3|t[20]>>>29,st=t[31]<<9|t[30]>>>23,ct=t[30]<<9|t[31]>>>23,H=t[40]<<18|t[41]>>>14,Y=t[41]<<18|t[40]>>>14,N=t[2]<<1|t[3]>>>31,P=t[3]<<1|t[2]>>>31,p=t[13]<<12|t[12]>>>20,I=t[12]<<12|t[13]>>>20,Z=t[22]<<10|t[23]>>>22,V=t[23]<<10|t[22]>>>22,x=t[33]<<13|t[32]>>>19,M=t[32]<<13|t[33]>>>19,At=t[42]<<2|t[43]>>>30,ut=t[43]<<2|t[42]>>>30,et=t[5]<<30|t[4]>>>2,rt=t[4]<<30|t[5]>>>2,j=t[14]<<6|t[15]>>>26,L=t[15]<<6|t[14]>>>26,b=t[25]<<11|t[24]>>>21,v=t[24]<<11|t[25]>>>21,W=t[34]<<15|t[35]>>>17,X=t[35]<<15|t[34]>>>17,R=t[45]<<29|t[44]>>>3,O=t[44]<<29|t[45]>>>3,B=t[6]<<28|t[7]>>>4,Q=t[7]<<28|t[6]>>>4,nt=t[17]<<23|t[16]>>>9,it=t[16]<<23|t[17]>>>9,F=t[26]<<25|t[27]>>>7,T=t[27]<<25|t[26]>>>7,E=t[36]<<21|t[37]>>>11,m=t[37]<<21|t[36]>>>11,$=t[47]<<24|t[46]>>>8,tt=t[46]<<24|t[47]>>>8,K=t[8]<<27|t[9]>>>5,q=t[9]<<27|t[8]>>>5,k=t[18]<<20|t[19]>>>12,S=t[19]<<20|t[18]>>>12,ot=t[29]<<7|t[28]>>>25,at=t[28]<<7|t[29]>>>25,U=t[38]<<8|t[39]>>>24,G=t[39]<<8|t[38]>>>24,C=t[48]<<14|t[49]>>>18,w=t[49]<<14|t[48]>>>18,t[0]=d^~p&b,t[1]=g^~I&v,t[10]=B^~k&_,t[11]=Q^~S&D,t[20]=N^~j&F,t[21]=P^~L&T,t[30]=K^~J&Z,t[31]=q^~z&V,t[40]=et^~nt&ot,t[41]=rt^~it&at,t[2]=p^~b&E,t[3]=I^~v&m,t[12]=k^~_&x,t[13]=S^~D&M,t[22]=j^~F&U,t[23]=L^~T&G,t[32]=J^~Z&W,t[33]=z^~V&X,t[42]=nt^~ot&st,t[43]=it^~at&ct,t[4]=b^~E&C,t[5]=v^~m&w,t[14]=_^~x&R,t[15]=D^~M&O,t[24]=F^~U&H,t[25]=T^~G&Y,t[34]=Z^~W&$,t[35]=V^~X&tt,t[44]=ot^~st&At,t[45]=at^~ct&ut,t[6]=E^~C&d,t[7]=m^~w&g,t[16]=x^~R&B,t[17]=M^~O&Q,t[26]=U^~H&N,t[27]=G^~Y&P,t[36]=W^~$&K,t[37]=X^~tt&q,t[46]=st^~At&et,t[47]=ct^~ut&rt,t[8]=C^~d&p,t[9]=w^~g&I,t[18]=R^~B&k,t[19]=O^~Q&S,t[28]=H^~N&j,t[29]=Y^~P&L,t[38]=$^~K&J,t[39]=tt^~q&z,t[48]=At^~et&nt,t[49]=ut^~rt&it,t[0]^=y[n],t[1]^=y[n+1]};if(f)i.exports=_;else{for(x=0;x<D.length;++x)A[D[x]]=_[D[x]];h&&(void 0===(o=function(){return _}.call(e,r,e,i))||(i.exports=o))}}()}).call(this,r(9),r(8),r(14)(t))},function(t,e,r){"use strict";r.d(e,"a",(function(){return n}));var n="random/5.7.0"},function(t,e,r){var n=r(37),i=r(20),o=r(21),a=r(52),s=r(53);function c(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function A(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?c(Object(r),!0).forEach((function(e){n(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):c(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function u(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(!t)return;if("string"==typeof t)return f(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return f(t,e)}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw o}}}}function f(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}var h=r(174),l=r(38),d=r(198).permissionLevels,g=r(99).LogMessage,p=r(268),y=function(){"use strict";function t(){var e=this,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=r.target,s=r.timeout,c=void 0===s?30:s;a(this,t),this.permissionLevels=d,!n&&"undefined"!=typeof window&&window.parent&&(n=window.parent),this.target=n,this.timeout=c,this.utils=l,this.Crypto=p,this.Crypto.ElvCrypto();var A,f=u(this.AllowedMethods());try{var h=function(){var t=A.value;e[t]=function(){var r=o(i.mark((function r(n){var o;return i.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return(o=n&&n.callback)&&delete n.callback,r.next=4,e.SendMessage({options:{calledMethod:t,args:e.utils.MakeClonable(n)},callback:o});case 4:return r.abrupt("return",r.sent);case 5:case"end":return r.stop()}}),r)})));return function(t){return r.apply(this,arguments)}}()};for(f.s();!(A=f.n()).done;)h()}catch(t){f.e(t)}finally{f.f()}this.userProfileClient={};var g,y=u(this.AllowedUserProfileMethods());try{var I=function(){var r=g.value;e.userProfileClient[r]=function(){var n=o(i.mark((function n(o){var a;return i.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return(a=o&&o.callback)&&delete o.callback,n.next=4,e.SendMessage({options:{module:"userProfileClient",calledMethod:r,args:e.utils.MakeClonable(o),prompted:t.PromptedMethods().includes(r)},callback:a});case 4:return n.abrupt("return",n.sent);case 5:case"end":return n.stop()}}),n)})));return function(t){return n.apply(this,arguments)}}()};for(y.s();!(g=y.n()).done;)I()}catch(t){y.e(t)}finally{y.f()}}var e,r,n;return s(t,[{key:"Log",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];g(this,t,e)}},{key:"PassRequest",value:(n=o(i.mark((function t(e){var r,n,o,a,s;return i.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=e.request,n=e.Respond,t.prev=1,r.callbackId&&(s=function(t){return n({type:"ElvFrameResponse",requestId:r.callbackId,response:t})}),t.next=5,this.SendMessage({options:r,callback:s});case 5:o=t.sent,t.next=11;break;case 8:t.prev=8,t.t0=t.catch(1),a=t.t0;case 11:return t.abrupt("return",{type:"ElvFrameResponse",requestId:r.requestId,response:o,error:a});case 12:case"end":return t.stop()}}),t,this,[[1,8]])}))),function(t){return n.apply(this,arguments)})},{key:"SendMessage",value:(r=o(i.mark((function e(r){var n,o,a,s,c,u,f,l,d,g;return i.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=r.options,o=void 0===n?{}:n,a=r.callback,s=r.noResponse,c=void 0!==s&&s,u=h.next(),a&&(f=h.next()),this.target.postMessage(A(A({},o),{},{type:"ElvFrameRequest",requestId:u,callbackId:f}),"*"),!c){e.next=6;break}return e.abrupt("return");case 6:return l=o.calledMethod||o.operation,d=t.FileMethods().includes(o.calledMethod),g=this.timeout,o.prompted||d?g=0:o.args&&o.args.fcTimeout&&(g=o.args.fcTimeout),e.next=12,this.AwaitMessage(u,g,a,f,l);case 12:return e.abrupt("return",e.sent);case 13:case"end":return e.stop()}}),e,this)}))),function(t){return r.apply(this,arguments)})},{key:"AwaitMessage",value:(e=o(i.mark((function t(e,r,n,a,s){return i.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,new Promise((function(t,c){var A,u,f,h=function(){u&&clearTimeout(u),r>0&&(u=setTimeout((function(){"undefined"!=typeof window&&(window.removeEventListener("message",A),f&&window.removeEventListener("message",f)),c("Request ".concat(e," timed out (").concat(s,")"))}),1e3*r))};a&&(f=function(t){try{h();var e=t.data;if("ElvFrameResponse"!==e.type||e.requestId!==a)return;n(e.response)}catch(t){console.error(t)}},window.addEventListener("message",f)),A=function(){var r=o(i.mark((function r(n){var o;return i.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(r.prev=0,"ElvFrameResponse"===(o=n.data).type&&o.requestId===e){r.next=4;break}return r.abrupt("return");case 4:clearTimeout(u),window.removeEventListener("message",A),f&&window.removeEventListener("message",f),o.error?c(o.error):t(o.response),r.next=16;break;case 10:r.prev=10,r.t0=r.catch(0),clearTimeout(u),window.removeEventListener("message",A),f&&window.removeEventListener("message",f),c(r.t0);case 16:case"end":return r.stop()}}),r,null,[[0,10]])})));return function(t){return r.apply(this,arguments)}}(),h(),window.addEventListener("message",A)}));case 2:return t.abrupt("return",t.sent);case 3:case"end":return t.stop()}}),t)}))),function(t,r,n,i,o){return e.apply(this,arguments)})},{key:"OverriddenMethods",value:function(){return["UploadFiles"]}},{key:"AllowedMethods",value:function(){return["AccessGroupManagers","AccessGroupMembers","AccessGroupOwner","AccessInfo","AccessRequest","AccessType","AddAccessGroupManager","AddAccessGroupMember","AddContentLibraryGroup","AddContentObjectGroupPermission","AddLibraryContentType","AssetMetadata","AvailableDRMs","AvailableOfferings","AwaitPending","BitmovinPlayoutOptions","BlockNumber","CallBitcodeMethod","CallContractMethod","CallContractMethodAndWait","ClearCache","ClearStaticToken","Collection","CollectionTransactions","ConfigUrl","ContentLibraries","ContentLibrary","ContentLibraryGroupPermissions","ContentLibraryOwner","ContentObject","ContentObjectAccessComplete","ContentObjectGraph","ContentObjectGroupPermissions","ContentObjectImageUrl","ContentObjectLibraryId","ContentObjectMetadata","ContentObjectOwner","ContentObjectTenantId","ContentObjectVersions","ContentObjects","ContentPart","ContentParts","ContentSpaceId","ContentType","ContentTypeOwner","ContentTypes","ContractAbi","ContractEvents","ContractMetadata","ContractName","CopyContentObject","CreateABRMezzanine","CreateAccessGroup","CreateAndFinalizeContentObject","CreateContentLibrary","CreateContentObject","CreateContentType","CreateEncryptionConk","CreateFabricToken","CreateFileDirectories","CreateFileUploadJob","CreateLinks","CreateNTPInstance","CreateNonOwnerCap","CreatePart","CreateProductionMaster","CreateSignedToken","CurrentAccountAddress","CustomContractAddress","Decrypt","DecryptECIES","DefaultKMSAddress","DeleteAccessGroup","DeleteContentLibrary","DeleteContentObject","DeleteContentVersion","DeleteFiles","DeleteMetadata","DeleteNTPInstance","DeletePart","DeployContract","Download","DownloadEncrypted","DownloadFile","DownloadPart","EditAndFinalizeContentObject","EditContentObject","Encrypt","EncryptECIES","EncryptionConk","Events","ExtractEventFromLogs","ExtractValueFromEvent","FabricUrl","FileUrl","FinalizeABRMezzanine","FinalizeContentObject","FinalizePart","FinalizeStateChannelAccess","FinalizeUploadJob","FormatContractArguments","GenerateStateChannelToken","GenerateSignedLinkToken","GetBalance","InitializeAuthPolicy","IssueNTPCode","IssueSignedNTPCode","LatestVersionHash","LibraryContentTypes","LinkAccessGroupToOauth","LinkData","LinkTarget","LinkUrl","ListAccessGroups","ListFiles","ListNTPInstances","LRODraftInfo","LROStatus","MergeContractMetadata","MergeMetadata","MetadataAuth","MintNFT","NetworkInfo","NodeId","Nodes","NTPInstance","Permission","PlayoutOptions","PlayoutPathResolution","ProduceMetadataLinks","Proofs","PublicRep","PublishContentVersion","QParts","RedeemCode","RemoveAccessGroupManager","RemoveAccessGroupMember","RemoveContentObjectGroupPermission","RemoveContentLibraryGroup","RemoveLibraryContentType","Rep","ReplaceContractMetadata","ReplaceMetadata","Request","ResetRegion","SendFunds","SetAccessCharge","SetAuth","SetAuthContext","SetAuthPolicy","SetContentLibraryImage","SetContentObjectImage","SetCustomContentContract","SetGroupPermission","SetNodes","SetOauthToken","SetPolicyAuthorization","SetSignerFromOauthToken","SetStaticToken","SetVisibility","SetPermission","StartABRMezzanineJobs","SuspendNTPInstance","UnlinkAccessGroupFromOauth","UpdateContentObjectGraph","UpdateNTPInstance","UploadFileData","UploadFilesFromS3","UploadJobStatus","UploadPart","UploadPartChunk","UploadStatus","UseRegion","VerifyContentObject","Visibility"]}},{key:"AllowedUserProfileMethods",value:function(){return["AccessLevel","CollectedTags","CreateWallet","DeleteUserMetadata","MergeUserMetadata","PublicUserMetadata","ReplaceUserMetadata","TenantId","UserMetadata","UserProfileImage","UserWalletAddress","UserWalletObjectInfo","WalletAddress"]}}],[{key:"PromptedMethods",value:function(){return["CollectedTags","DeleteUserMetadata","MergeUserMetadata","ReplaceUserMetadata","UserMetadata"]}},{key:"MetadataMethods",value:function(){return["DeleteUserMetadata","MergeUserMetadata","ReplaceUserMetadata","UserMetadata"]}},{key:"FileMethods",value:function(){return["CreateFileUploadJob","DownloadEncrypted","DownloadFile","DownloadPart","FinalizeUploadJob","UpdateContentObjectGraph","UploadFileData","UploadFiles","UploadFilesFromS3","UploadJobStatus","UploadPart","UploadPartChunk","UploadStatus"]}}]),t}(),I=r(337).UploadFiles;y.prototype.UploadFiles=I,e.FrameClient=y},,,function(t,e,r){var n=r(29).default;t.exports=function(t,e){if("object"!==n(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var i=r.call(t,e||"default");if("object"!==n(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)},t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e,r){var n=r(29).default;function i(){"use strict";
|
|
67
|
-
/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */t.exports=i=function(){return e},t.exports.__esModule=!0,t.exports.default=t.exports;var e={},r=Object.prototype,o=r.hasOwnProperty,a=Object.defineProperty||function(t,e,r){t[e]=r.value},s="function"==typeof Symbol?Symbol:{},c=s.iterator||"@@iterator",A=s.asyncIterator||"@@asyncIterator",u=s.toStringTag||"@@toStringTag";function f(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{f({},"")}catch(t){f=function(t,e,r){return t[e]=r}}function h(t,e,r,n){var i=e&&e.prototype instanceof g?e:g,o=Object.create(i.prototype),s=new S(n||[]);return a(o,"_invoke",{value:w(t,r,s)}),o}function l(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=h;var d={};function g(){}function p(){}function y(){}var I={};f(I,c,(function(){return this}));var b=Object.getPrototypeOf,v=b&&b(b(_([])));v&&v!==r&&o.call(v,c)&&(I=v);var E=y.prototype=g.prototype=Object.create(I);function m(t){["next","throw","return"].forEach((function(e){f(t,e,(function(t){return this._invoke(e,t)}))}))}function C(t,e){var r;a(this,"_invoke",{value:function(i,a){function s(){return new e((function(r,s){!function r(i,a,s,c){var A=l(t[i],t,a);if("throw"!==A.type){var u=A.arg,f=u.value;return f&&"object"==n(f)&&o.call(f,"__await")?e.resolve(f.__await).then((function(t){r("next",t,s,c)}),(function(t){r("throw",t,s,c)})):e.resolve(f).then((function(t){u.value=t,s(u)}),(function(t){return r("throw",t,s,c)}))}c(A.arg)}(i,a,r,s)}))}return r=r?r.then(s,s):s()}})}function w(t,e,r){var n="suspendedStart";return function(i,o){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===i)throw o;return D()}for(r.method=i,r.arg=o;;){var a=r.delegate;if(a){var s=B(a,r);if(s){if(s===d)continue;return s}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var c=l(t,e,r);if("normal"===c.type){if(n=r.done?"completed":"suspendedYield",c.arg===d)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(n="completed",r.method="throw",r.arg=c.arg)}}}function B(t,e){var r=e.method,n=t.iterator[r];if(void 0===n)return e.delegate=null,"throw"===r&&t.iterator.return&&(e.method="return",e.arg=void 0,B(t,e),"throw"===e.method)||"return"!==r&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+r+"' method")),d;var i=l(n,t.iterator,e.arg);if("throw"===i.type)return e.method="throw",e.arg=i.arg,e.delegate=null,d;var o=i.arg;return o?o.done?(e[t.resultName]=o.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,d):o:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,d)}function Q(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function k(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function S(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(Q,this),this.reset(!0)}function _(t){if(t){var e=t[c];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var r=-1,n=function e(){for(;++r<t.length;)if(o.call(t,r))return e.value=t[r],e.done=!1,e;return e.value=void 0,e.done=!0,e};return n.next=n}}return{next:D}}function D(){return{value:void 0,done:!0}}return p.prototype=y,a(E,"constructor",{value:y,configurable:!0}),a(y,"constructor",{value:p,configurable:!0}),p.displayName=f(y,u,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===p||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,y):(t.__proto__=y,f(t,u,"GeneratorFunction")),t.prototype=Object.create(E),t},e.awrap=function(t){return{__await:t}},m(C.prototype),f(C.prototype,A,(function(){return this})),e.AsyncIterator=C,e.async=function(t,r,n,i,o){void 0===o&&(o=Promise);var a=new C(h(t,r,n,i),o);return e.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},m(E),f(E,u,"Generator"),f(E,c,(function(){return this})),f(E,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},e.values=_,S.prototype={constructor:S,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(k),!t)for(var e in this)"t"===e.charAt(0)&&o.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function r(r,n){return a.type="throw",a.arg=t,e.next=r,n&&(e.method="next",e.arg=void 0),!!n}for(var n=this.tryEntries.length-1;n>=0;--n){var i=this.tryEntries[n],a=i.completion;if("root"===i.tryLoc)return r("end");if(i.tryLoc<=this.prev){var s=o.call(i,"catchLoc"),c=o.call(i,"finallyLoc");if(s&&c){if(this.prev<i.catchLoc)return r(i.catchLoc,!0);if(this.prev<i.finallyLoc)return r(i.finallyLoc)}else if(s){if(this.prev<i.catchLoc)return r(i.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return r(i.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&o.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var i=n;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,d):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),d},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),k(r),d}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var i=n.arg;k(r)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:_(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),d}},e}t.exports=i,t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e,r){var n=r(52),i=r(53),o=0,a=function(){"use strict";function t(){n(this,t)}return i(t,null,[{key:"next",value:function(){return++o}}]),t}();t.exports=a},function(t,e){var r={}.toString;t.exports=Array.isArray||function(t){return"[object Array]"==r.call(t)}},function(t,e,r){var n=r(86);t.exports=function(t){if(Array.isArray(t))return n(t)},t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e){t.exports=function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)},t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e){t.exports=function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")},t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e,r){var n=r(180),i=r(181),o=r(87),a=r(182);t.exports=function(t,e){return n(t)||i(t,e)||o(t,e)||a()},t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e){t.exports=function(t){if(Array.isArray(t))return t},t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e){t.exports=function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,i,o,a,s=[],c=!0,A=!1;try{if(o=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;c=!1}else for(;!(c=(n=o.call(r)).done)&&(s.push(n.value),s.length!==e);c=!0);}catch(t){A=!0,i=t}finally{try{if(!c&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(A)throw i}}return s}},t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e){t.exports=function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")},t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e,r){"use strict";var n=r(4).Buffer;t.exports=function(t){if(t.length>=255)throw new TypeError("Alphabet too long");for(var e=new Uint8Array(256),r=0;r<e.length;r++)e[r]=255;for(var i=0;i<t.length;i++){var o=t.charAt(i),a=o.charCodeAt(0);if(255!==e[a])throw new TypeError(o+" is ambiguous");e[a]=i}var s=t.length,c=t.charAt(0),A=Math.log(s)/Math.log(256),u=Math.log(256)/Math.log(s);function f(t){if("string"!=typeof t)throw new TypeError("Expected String");if(0===t.length)return n.alloc(0);for(var r=0,i=0,o=0;t[r]===c;)i++,r++;for(var a=(t.length-r)*A+1>>>0,u=new Uint8Array(a);t[r];){var f=e[t.charCodeAt(r)];if(255===f)return;for(var h=0,l=a-1;(0!==f||h<o)&&-1!==l;l--,h++)f+=s*u[l]>>>0,u[l]=f%256>>>0,f=f/256>>>0;if(0!==f)throw new Error("Non-zero carry");o=h,r++}for(var d=a-o;d!==a&&0===u[d];)d++;var g=n.allocUnsafe(i+(a-d));g.fill(0,0,i);for(var p=i;d!==a;)g[p++]=u[d++];return g}return{encode:function(e){if((Array.isArray(e)||e instanceof Uint8Array)&&(e=n.from(e)),!n.isBuffer(e))throw new TypeError("Expected Buffer");if(0===e.length)return"";for(var r=0,i=0,o=0,a=e.length;o!==a&&0===e[o];)o++,r++;for(var A=(a-o)*u+1>>>0,f=new Uint8Array(A);o!==a;){for(var h=e[o],l=0,d=A-1;(0!==h||l<i)&&-1!==d;d--,l++)h+=256*f[d]>>>0,f[d]=h%s>>>0,h=h/s>>>0;if(0!==h)throw new Error("Non-zero carry");i=l,o++}for(var g=A-i;g!==A&&0===f[g];)g++;for(var p=c.repeat(r);g<A;++g)p+=t.charAt(f[g]);return p},decodeUnsafe:f,decode:function(t){var e=f(t);if(e)return e;throw new Error("Non-base"+s+" character")}}}},function(t,e,r){var n;function i(t){return(i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}!function(o){"use strict";var a,s=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,c="function"==typeof Symbol&&"symbol"==i(Symbol.iterator),A=Math.ceil,u=Math.floor,f="[BigNumber Error] ",h=f+"Number primitive has more than 15 significant digits: ",l=1e14,d=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13],g=1e9;function p(t){var e=0|t;return t>0||t===e?e:e-1}function y(t){for(var e,r,n=1,i=t.length,o=t[0]+"";n<i;){for(r=14-(e=t[n++]+"").length;r--;e="0"+e);o+=e}for(i=o.length;48===o.charCodeAt(--i););return o.slice(0,i+1||1)}function I(t,e){var r,n,i=t.c,o=e.c,a=t.s,s=e.s,c=t.e,A=e.e;if(!a||!s)return null;if(r=i&&!i[0],n=o&&!o[0],r||n)return r?n?0:-s:a;if(a!=s)return a;if(r=a<0,n=c==A,!i||!o)return n?0:!i^r?1:-1;if(!n)return c>A^r?1:-1;for(s=(c=i.length)<(A=o.length)?c:A,a=0;a<s;a++)if(i[a]!=o[a])return i[a]>o[a]^r?1:-1;return c==A?0:c>A^r?1:-1}function b(t,e,r,n){if(t<e||t>r||t!==u(t))throw Error(f+(n||"Argument")+("number"==typeof t?t<e||t>r?" out of range: ":" not an integer: ":" not a primitive number: ")+String(t))}function v(t){var e=t.c.length-1;return p(t.e/14)==e&&t.c[e]%2!=0}function E(t,e){return(t.length>1?t.charAt(0)+"."+t.slice(1):t)+(e<0?"e":"e+")+e}function m(t,e,r){var n,i;if(e<0){for(i=r+".";++e;i+=r);t=i+t}else if(++e>(n=t.length)){for(i=r,e-=n;--e;i+=r);t+=i}else e<n&&(t=t.slice(0,e)+"."+t.slice(e));return t}(a=function t(e){var r,n,o,a,C,w,B,Q,k,S=U.prototype={constructor:U,toString:null,valueOf:null},_=new U(1),D=20,x=4,M=-7,R=21,O=-1e7,N=1e7,P=!1,j=1,L=0,F={prefix:"",groupSize:3,secondaryGroupSize:0,groupSeparator:",",decimalSeparator:".",fractionGroupSize:0,fractionGroupSeparator:" ",suffix:""},T="0123456789abcdefghijklmnopqrstuvwxyz";function U(t,e){var r,i,a,c,A,f,l,d,g=this;if(!(g instanceof U))return new U(t,e);if(null==e){if(t&&!0===t._isBigNumber)return g.s=t.s,void(!t.c||t.e>N?g.c=g.e=null:t.e<O?g.c=[g.e=0]:(g.e=t.e,g.c=t.c.slice()));if((f="number"==typeof t)&&0*t==0){if(g.s=1/t<0?(t=-t,-1):1,t===~~t){for(c=0,A=t;A>=10;A/=10,c++);return void(c>N?g.c=g.e=null:(g.e=c,g.c=[t]))}d=String(t)}else{if(!s.test(d=String(t)))return o(g,d,f);g.s=45==d.charCodeAt(0)?(d=d.slice(1),-1):1}(c=d.indexOf("."))>-1&&(d=d.replace(".","")),(A=d.search(/e/i))>0?(c<0&&(c=A),c+=+d.slice(A+1),d=d.substring(0,A)):c<0&&(c=d.length)}else{if(b(e,2,T.length,"Base"),10==e)return K(g=new U(t),D+g.e+1,x);if(d=String(t),f="number"==typeof t){if(0*t!=0)return o(g,d,f,e);if(g.s=1/t<0?(d=d.slice(1),-1):1,U.DEBUG&&d.replace(/^0\.0*|\./,"").length>15)throw Error(h+t)}else g.s=45===d.charCodeAt(0)?(d=d.slice(1),-1):1;for(r=T.slice(0,e),c=A=0,l=d.length;A<l;A++)if(r.indexOf(i=d.charAt(A))<0){if("."==i){if(A>c){c=l;continue}}else if(!a&&(d==d.toUpperCase()&&(d=d.toLowerCase())||d==d.toLowerCase()&&(d=d.toUpperCase()))){a=!0,A=-1,c=0;continue}return o(g,String(t),f,e)}f=!1,(c=(d=n(d,e,10,g.s)).indexOf("."))>-1?d=d.replace(".",""):c=d.length}for(A=0;48===d.charCodeAt(A);A++);for(l=d.length;48===d.charCodeAt(--l););if(d=d.slice(A,++l)){if(l-=A,f&&U.DEBUG&&l>15&&(t>9007199254740991||t!==u(t)))throw Error(h+g.s*t);if((c=c-A-1)>N)g.c=g.e=null;else if(c<O)g.c=[g.e=0];else{if(g.e=c,g.c=[],A=(c+1)%14,c<0&&(A+=14),A<l){for(A&&g.c.push(+d.slice(0,A)),l-=14;A<l;)g.c.push(+d.slice(A,A+=14));A=14-(d=d.slice(A)).length}else A-=l;for(;A--;d+="0");g.c.push(+d)}}else g.c=[g.e=0]}function G(t,e,r,n){var i,o,a,s,c;if(null==r?r=x:b(r,0,8),!t.c)return t.toString();if(i=t.c[0],a=t.e,null==e)c=y(t.c),c=1==n||2==n&&(a<=M||a>=R)?E(c,a):m(c,a,"0");else if(o=(t=K(new U(t),e,r)).e,s=(c=y(t.c)).length,1==n||2==n&&(e<=o||o<=M)){for(;s<e;c+="0",s++);c=E(c,o)}else if(e-=a,c=m(c,o,"0"),o+1>s){if(--e>0)for(c+=".";e--;c+="0");}else if((e+=o-s)>0)for(o+1==s&&(c+=".");e--;c+="0");return t.s<0&&i?"-"+c:c}function H(t,e){for(var r,n=1,i=new U(t[0]);n<t.length;n++){if(!(r=new U(t[n])).s){i=r;break}e.call(i,r)&&(i=r)}return i}function Y(t,e,r){for(var n=1,i=e.length;!e[--i];e.pop());for(i=e[0];i>=10;i/=10,n++);return(r=n+14*r-1)>N?t.c=t.e=null:r<O?t.c=[t.e=0]:(t.e=r,t.c=e),t}function K(t,e,r,n){var i,o,a,s,c,f,h,g=t.c,p=d;if(g){t:{for(i=1,s=g[0];s>=10;s/=10,i++);if((o=e-i)<0)o+=14,a=e,h=(c=g[f=0])/p[i-a-1]%10|0;else if((f=A((o+1)/14))>=g.length){if(!n)break t;for(;g.length<=f;g.push(0));c=h=0,i=1,a=(o%=14)-14+1}else{for(c=s=g[f],i=1;s>=10;s/=10,i++);h=(a=(o%=14)-14+i)<0?0:c/p[i-a-1]%10|0}if(n=n||e<0||null!=g[f+1]||(a<0?c:c%p[i-a-1]),n=r<4?(h||n)&&(0==r||r==(t.s<0?3:2)):h>5||5==h&&(4==r||n||6==r&&(o>0?a>0?c/p[i-a]:0:g[f-1])%10&1||r==(t.s<0?8:7)),e<1||!g[0])return g.length=0,n?(e-=t.e+1,g[0]=p[(14-e%14)%14],t.e=-e||0):g[0]=t.e=0,t;if(0==o?(g.length=f,s=1,f--):(g.length=f+1,s=p[14-o],g[f]=a>0?u(c/p[i-a]%p[a])*s:0),n)for(;;){if(0==f){for(o=1,a=g[0];a>=10;a/=10,o++);for(a=g[0]+=s,s=1;a>=10;a/=10,s++);o!=s&&(t.e++,g[0]==l&&(g[0]=1));break}if(g[f]+=s,g[f]!=l)break;g[f--]=0,s=1}for(o=g.length;0===g[--o];g.pop());}t.e>N?t.c=t.e=null:t.e<O&&(t.c=[t.e=0])}return t}function q(t){var e,r=t.e;return null===r?t.toString():(e=y(t.c),e=r<=M||r>=R?E(e,r):m(e,r,"0"),t.s<0?"-"+e:e)}return U.clone=t,U.ROUND_UP=0,U.ROUND_DOWN=1,U.ROUND_CEIL=2,U.ROUND_FLOOR=3,U.ROUND_HALF_UP=4,U.ROUND_HALF_DOWN=5,U.ROUND_HALF_EVEN=6,U.ROUND_HALF_CEIL=7,U.ROUND_HALF_FLOOR=8,U.EUCLID=9,U.config=U.set=function(t){var e,r;if(null!=t){if("object"!=i(t))throw Error(f+"Object expected: "+t);if(t.hasOwnProperty(e="DECIMAL_PLACES")&&(b(r=t[e],0,g,e),D=r),t.hasOwnProperty(e="ROUNDING_MODE")&&(b(r=t[e],0,8,e),x=r),t.hasOwnProperty(e="EXPONENTIAL_AT")&&((r=t[e])&&r.pop?(b(r[0],-g,0,e),b(r[1],0,g,e),M=r[0],R=r[1]):(b(r,-g,g,e),M=-(R=r<0?-r:r))),t.hasOwnProperty(e="RANGE"))if((r=t[e])&&r.pop)b(r[0],-g,-1,e),b(r[1],1,g,e),O=r[0],N=r[1];else{if(b(r,-g,g,e),!r)throw Error(f+e+" cannot be zero: "+r);O=-(N=r<0?-r:r)}if(t.hasOwnProperty(e="CRYPTO")){if((r=t[e])!==!!r)throw Error(f+e+" not true or false: "+r);if(r){if("undefined"==typeof crypto||!crypto||!crypto.getRandomValues&&!crypto.randomBytes)throw P=!r,Error(f+"crypto unavailable");P=r}else P=r}if(t.hasOwnProperty(e="MODULO_MODE")&&(b(r=t[e],0,9,e),j=r),t.hasOwnProperty(e="POW_PRECISION")&&(b(r=t[e],0,g,e),L=r),t.hasOwnProperty(e="FORMAT")){if("object"!=i(r=t[e]))throw Error(f+e+" not an object: "+r);F=r}if(t.hasOwnProperty(e="ALPHABET")){if("string"!=typeof(r=t[e])||/^.$|[+-.\s]|(.).*\1/.test(r))throw Error(f+e+" invalid: "+r);T=r}}return{DECIMAL_PLACES:D,ROUNDING_MODE:x,EXPONENTIAL_AT:[M,R],RANGE:[O,N],CRYPTO:P,MODULO_MODE:j,POW_PRECISION:L,FORMAT:F,ALPHABET:T}},U.isBigNumber=function(t){if(!t||!0!==t._isBigNumber)return!1;if(!U.DEBUG)return!0;var e,r,n=t.c,i=t.e,o=t.s;t:if("[object Array]"=={}.toString.call(n)){if((1===o||-1===o)&&i>=-g&&i<=g&&i===u(i)){if(0===n[0]){if(0===i&&1===n.length)return!0;break t}if((e=(i+1)%14)<1&&(e+=14),String(n[0]).length==e){for(e=0;e<n.length;e++)if((r=n[e])<0||r>=l||r!==u(r))break t;if(0!==r)return!0}}}else if(null===n&&null===i&&(null===o||1===o||-1===o))return!0;throw Error(f+"Invalid BigNumber: "+t)},U.maximum=U.max=function(){return H(arguments,S.lt)},U.minimum=U.min=function(){return H(arguments,S.gt)},U.random=(a=9007199254740992*Math.random()&2097151?function(){return u(9007199254740992*Math.random())}:function(){return 8388608*(1073741824*Math.random()|0)+(8388608*Math.random()|0)},function(t){var e,r,n,i,o,s=0,c=[],h=new U(_);if(null==t?t=D:b(t,0,g),i=A(t/14),P)if(crypto.getRandomValues){for(e=crypto.getRandomValues(new Uint32Array(i*=2));s<i;)(o=131072*e[s]+(e[s+1]>>>11))>=9e15?(r=crypto.getRandomValues(new Uint32Array(2)),e[s]=r[0],e[s+1]=r[1]):(c.push(o%1e14),s+=2);s=i/2}else{if(!crypto.randomBytes)throw P=!1,Error(f+"crypto unavailable");for(e=crypto.randomBytes(i*=7);s<i;)(o=281474976710656*(31&e[s])+1099511627776*e[s+1]+4294967296*e[s+2]+16777216*e[s+3]+(e[s+4]<<16)+(e[s+5]<<8)+e[s+6])>=9e15?crypto.randomBytes(7).copy(e,s):(c.push(o%1e14),s+=7);s=i/7}if(!P)for(;s<i;)(o=a())<9e15&&(c[s++]=o%1e14);for(t%=14,(i=c[--s])&&t&&(o=d[14-t],c[s]=u(i/o)*o);0===c[s];c.pop(),s--);if(s<0)c=[n=0];else{for(n=-1;0===c[0];c.splice(0,1),n-=14);for(s=1,o=c[0];o>=10;o/=10,s++);s<14&&(n-=14-s)}return h.e=n,h.c=c,h}),U.sum=function(){for(var t=1,e=arguments,r=new U(e[0]);t<e.length;)r=r.plus(e[t++]);return r},n=function(){function t(t,e,r,n){for(var i,o,a=[0],s=0,c=t.length;s<c;){for(o=a.length;o--;a[o]*=e);for(a[0]+=n.indexOf(t.charAt(s++)),i=0;i<a.length;i++)a[i]>r-1&&(null==a[i+1]&&(a[i+1]=0),a[i+1]+=a[i]/r|0,a[i]%=r)}return a.reverse()}return function(e,n,i,o,a){var s,c,A,u,f,h,l,d,g=e.indexOf("."),p=D,I=x;for(g>=0&&(u=L,L=0,e=e.replace(".",""),h=(d=new U(n)).pow(e.length-g),L=u,d.c=t(m(y(h.c),h.e,"0"),10,i,"0123456789"),d.e=d.c.length),A=u=(l=t(e,n,i,a?(s=T,"0123456789"):(s="0123456789",T))).length;0==l[--u];l.pop());if(!l[0])return s.charAt(0);if(g<0?--A:(h.c=l,h.e=A,h.s=o,l=(h=r(h,d,p,I,i)).c,f=h.r,A=h.e),g=l[c=A+p+1],u=i/2,f=f||c<0||null!=l[c+1],f=I<4?(null!=g||f)&&(0==I||I==(h.s<0?3:2)):g>u||g==u&&(4==I||f||6==I&&1&l[c-1]||I==(h.s<0?8:7)),c<1||!l[0])e=f?m(s.charAt(1),-p,s.charAt(0)):s.charAt(0);else{if(l.length=c,f)for(--i;++l[--c]>i;)l[c]=0,c||(++A,l=[1].concat(l));for(u=l.length;!l[--u];);for(g=0,e="";g<=u;e+=s.charAt(l[g++]));e=m(e,A,s.charAt(0))}return e}}(),r=function(){function t(t,e,r){var n,i,o,a,s=0,c=t.length,A=e%1e7,u=e/1e7|0;for(t=t.slice();c--;)s=((i=A*(o=t[c]%1e7)+(n=u*o+(a=t[c]/1e7|0)*A)%1e7*1e7+s)/r|0)+(n/1e7|0)+u*a,t[c]=i%r;return s&&(t=[s].concat(t)),t}function e(t,e,r,n){var i,o;if(r!=n)o=r>n?1:-1;else for(i=o=0;i<r;i++)if(t[i]!=e[i]){o=t[i]>e[i]?1:-1;break}return o}function r(t,e,r,n){for(var i=0;r--;)t[r]-=i,i=t[r]<e[r]?1:0,t[r]=i*n+t[r]-e[r];for(;!t[0]&&t.length>1;t.splice(0,1));}return function(n,i,o,a,s){var c,A,f,h,d,g,y,I,b,v,E,m,C,w,B,Q,k,S=n.s==i.s?1:-1,_=n.c,D=i.c;if(!(_&&_[0]&&D&&D[0]))return new U(n.s&&i.s&&(_?!D||_[0]!=D[0]:D)?_&&0==_[0]||!D?0*S:S/0:NaN);for(b=(I=new U(S)).c=[],S=o+(A=n.e-i.e)+1,s||(s=l,A=p(n.e/14)-p(i.e/14),S=S/14|0),f=0;D[f]==(_[f]||0);f++);if(D[f]>(_[f]||0)&&A--,S<0)b.push(1),h=!0;else{for(w=_.length,Q=D.length,f=0,S+=2,(d=u(s/(D[0]+1)))>1&&(D=t(D,d,s),_=t(_,d,s),Q=D.length,w=_.length),C=Q,E=(v=_.slice(0,Q)).length;E<Q;v[E++]=0);k=D.slice(),k=[0].concat(k),B=D[0],D[1]>=s/2&&B++;do{if(d=0,(c=e(D,v,Q,E))<0){if(m=v[0],Q!=E&&(m=m*s+(v[1]||0)),(d=u(m/B))>1)for(d>=s&&(d=s-1),y=(g=t(D,d,s)).length,E=v.length;1==e(g,v,y,E);)d--,r(g,Q<y?k:D,y,s),y=g.length,c=1;else 0==d&&(c=d=1),y=(g=D.slice()).length;if(y<E&&(g=[0].concat(g)),r(v,g,E,s),E=v.length,-1==c)for(;e(D,v,Q,E)<1;)d++,r(v,Q<E?k:D,E,s),E=v.length}else 0===c&&(d++,v=[0]);b[f++]=d,v[0]?v[E++]=_[C]||0:(v=[_[C]],E=1)}while((C++<w||null!=v[0])&&S--);h=null!=v[0],b[0]||b.splice(0,1)}if(s==l){for(f=1,S=b[0];S>=10;S/=10,f++);K(I,o+(I.e=f+14*A-1)+1,a,h)}else I.e=A,I.r=+h;return I}}(),C=/^(-?)0([xbo])(?=\w[\w.]*$)/i,w=/^([^.]+)\.$/,B=/^\.([^.]+)$/,Q=/^-?(Infinity|NaN)$/,k=/^\s*\+(?=[\w.])|^\s+|\s+$/g,o=function(t,e,r,n){var i,o=r?e:e.replace(k,"");if(Q.test(o))t.s=isNaN(o)?null:o<0?-1:1;else{if(!r&&(o=o.replace(C,(function(t,e,r){return i="x"==(r=r.toLowerCase())?16:"b"==r?2:8,n&&n!=i?t:e})),n&&(i=n,o=o.replace(w,"$1").replace(B,"0.$1")),e!=o))return new U(o,i);if(U.DEBUG)throw Error(f+"Not a"+(n?" base "+n:"")+" number: "+e);t.s=null}t.c=t.e=null},S.absoluteValue=S.abs=function(){var t=new U(this);return t.s<0&&(t.s=1),t},S.comparedTo=function(t,e){return I(this,new U(t,e))},S.decimalPlaces=S.dp=function(t,e){var r,n,i,o=this;if(null!=t)return b(t,0,g),null==e?e=x:b(e,0,8),K(new U(o),t+o.e+1,e);if(!(r=o.c))return null;if(n=14*((i=r.length-1)-p(this.e/14)),i=r[i])for(;i%10==0;i/=10,n--);return n<0&&(n=0),n},S.dividedBy=S.div=function(t,e){return r(this,new U(t,e),D,x)},S.dividedToIntegerBy=S.idiv=function(t,e){return r(this,new U(t,e),0,1)},S.exponentiatedBy=S.pow=function(t,e){var r,n,i,o,a,s,c,h,l=this;if((t=new U(t)).c&&!t.isInteger())throw Error(f+"Exponent not an integer: "+q(t));if(null!=e&&(e=new U(e)),a=t.e>14,!l.c||!l.c[0]||1==l.c[0]&&!l.e&&1==l.c.length||!t.c||!t.c[0])return h=new U(Math.pow(+q(l),a?2-v(t):+q(t))),e?h.mod(e):h;if(s=t.s<0,e){if(e.c?!e.c[0]:!e.s)return new U(NaN);(n=!s&&l.isInteger()&&e.isInteger())&&(l=l.mod(e))}else{if(t.e>9&&(l.e>0||l.e<-1||(0==l.e?l.c[0]>1||a&&l.c[1]>=24e7:l.c[0]<8e13||a&&l.c[0]<=9999975e7)))return o=l.s<0&&v(t)?-0:0,l.e>-1&&(o=1/o),new U(s?1/o:o);L&&(o=A(L/14+2))}for(a?(r=new U(.5),s&&(t.s=1),c=v(t)):c=(i=Math.abs(+q(t)))%2,h=new U(_);;){if(c){if(!(h=h.times(l)).c)break;o?h.c.length>o&&(h.c.length=o):n&&(h=h.mod(e))}if(i){if(0===(i=u(i/2)))break;c=i%2}else if(K(t=t.times(r),t.e+1,1),t.e>14)c=v(t);else{if(0===(i=+q(t)))break;c=i%2}l=l.times(l),o?l.c&&l.c.length>o&&(l.c.length=o):n&&(l=l.mod(e))}return n?h:(s&&(h=_.div(h)),e?h.mod(e):o?K(h,L,x,void 0):h)},S.integerValue=function(t){var e=new U(this);return null==t?t=x:b(t,0,8),K(e,e.e+1,t)},S.isEqualTo=S.eq=function(t,e){return 0===I(this,new U(t,e))},S.isFinite=function(){return!!this.c},S.isGreaterThan=S.gt=function(t,e){return I(this,new U(t,e))>0},S.isGreaterThanOrEqualTo=S.gte=function(t,e){return 1===(e=I(this,new U(t,e)))||0===e},S.isInteger=function(){return!!this.c&&p(this.e/14)>this.c.length-2},S.isLessThan=S.lt=function(t,e){return I(this,new U(t,e))<0},S.isLessThanOrEqualTo=S.lte=function(t,e){return-1===(e=I(this,new U(t,e)))||0===e},S.isNaN=function(){return!this.s},S.isNegative=function(){return this.s<0},S.isPositive=function(){return this.s>0},S.isZero=function(){return!!this.c&&0==this.c[0]},S.minus=function(t,e){var r,n,i,o,a=this,s=a.s;if(e=(t=new U(t,e)).s,!s||!e)return new U(NaN);if(s!=e)return t.s=-e,a.plus(t);var c=a.e/14,A=t.e/14,u=a.c,f=t.c;if(!c||!A){if(!u||!f)return u?(t.s=-e,t):new U(f?a:NaN);if(!u[0]||!f[0])return f[0]?(t.s=-e,t):new U(u[0]?a:3==x?-0:0)}if(c=p(c),A=p(A),u=u.slice(),s=c-A){for((o=s<0)?(s=-s,i=u):(A=c,i=f),i.reverse(),e=s;e--;i.push(0));i.reverse()}else for(n=(o=(s=u.length)<(e=f.length))?s:e,s=e=0;e<n;e++)if(u[e]!=f[e]){o=u[e]<f[e];break}if(o&&(i=u,u=f,f=i,t.s=-t.s),(e=(n=f.length)-(r=u.length))>0)for(;e--;u[r++]=0);for(e=l-1;n>s;){if(u[--n]<f[n]){for(r=n;r&&!u[--r];u[r]=e);--u[r],u[n]+=l}u[n]-=f[n]}for(;0==u[0];u.splice(0,1),--A);return u[0]?Y(t,u,A):(t.s=3==x?-1:1,t.c=[t.e=0],t)},S.modulo=S.mod=function(t,e){var n,i,o=this;return t=new U(t,e),!o.c||!t.s||t.c&&!t.c[0]?new U(NaN):!t.c||o.c&&!o.c[0]?new U(o):(9==j?(i=t.s,t.s=1,n=r(o,t,0,3),t.s=i,n.s*=i):n=r(o,t,0,j),(t=o.minus(n.times(t))).c[0]||1!=j||(t.s=o.s),t)},S.multipliedBy=S.times=function(t,e){var r,n,i,o,a,s,c,A,u,f,h,d,g,y,I=this,b=I.c,v=(t=new U(t,e)).c;if(!(b&&v&&b[0]&&v[0]))return!I.s||!t.s||b&&!b[0]&&!v||v&&!v[0]&&!b?t.c=t.e=t.s=null:(t.s*=I.s,b&&v?(t.c=[0],t.e=0):t.c=t.e=null),t;for(n=p(I.e/14)+p(t.e/14),t.s*=I.s,(c=b.length)<(f=v.length)&&(g=b,b=v,v=g,i=c,c=f,f=i),i=c+f,g=[];i--;g.push(0));for(y=l,1e7,i=f;--i>=0;){for(r=0,h=v[i]%1e7,d=v[i]/1e7|0,o=i+(a=c);o>i;)r=((A=h*(A=b[--a]%1e7)+(s=d*A+(u=b[a]/1e7|0)*h)%1e7*1e7+g[o]+r)/y|0)+(s/1e7|0)+d*u,g[o--]=A%y;g[o]=r}return r?++n:g.splice(0,1),Y(t,g,n)},S.negated=function(){var t=new U(this);return t.s=-t.s||null,t},S.plus=function(t,e){var r,n=this,i=n.s;if(e=(t=new U(t,e)).s,!i||!e)return new U(NaN);if(i!=e)return t.s=-e,n.minus(t);var o=n.e/14,a=t.e/14,s=n.c,c=t.c;if(!o||!a){if(!s||!c)return new U(i/0);if(!s[0]||!c[0])return c[0]?t:new U(s[0]?n:0*i)}if(o=p(o),a=p(a),s=s.slice(),i=o-a){for(i>0?(a=o,r=c):(i=-i,r=s),r.reverse();i--;r.push(0));r.reverse()}for((i=s.length)-(e=c.length)<0&&(r=c,c=s,s=r,e=i),i=0;e;)i=(s[--e]=s[e]+c[e]+i)/l|0,s[e]=l===s[e]?0:s[e]%l;return i&&(s=[i].concat(s),++a),Y(t,s,a)},S.precision=S.sd=function(t,e){var r,n,i,o=this;if(null!=t&&t!==!!t)return b(t,1,g),null==e?e=x:b(e,0,8),K(new U(o),t,e);if(!(r=o.c))return null;if(n=14*(i=r.length-1)+1,i=r[i]){for(;i%10==0;i/=10,n--);for(i=r[0];i>=10;i/=10,n++);}return t&&o.e+1>n&&(n=o.e+1),n},S.shiftedBy=function(t){return b(t,-9007199254740991,9007199254740991),this.times("1e"+t)},S.squareRoot=S.sqrt=function(){var t,e,n,i,o,a=this,s=a.c,c=a.s,A=a.e,u=D+4,f=new U("0.5");if(1!==c||!s||!s[0])return new U(!c||c<0&&(!s||s[0])?NaN:s?a:1/0);if(0==(c=Math.sqrt(+q(a)))||c==1/0?(((e=y(s)).length+A)%2==0&&(e+="0"),c=Math.sqrt(+e),A=p((A+1)/2)-(A<0||A%2),n=new U(e=c==1/0?"1e"+A:(e=c.toExponential()).slice(0,e.indexOf("e")+1)+A)):n=new U(c+""),n.c[0])for((c=(A=n.e)+u)<3&&(c=0);;)if(o=n,n=f.times(o.plus(r(a,o,u,1))),y(o.c).slice(0,c)===(e=y(n.c)).slice(0,c)){if(n.e<A&&--c,"9999"!=(e=e.slice(c-3,c+1))&&(i||"4999"!=e)){+e&&(+e.slice(1)||"5"!=e.charAt(0))||(K(n,n.e+D+2,1),t=!n.times(n).eq(a));break}if(!i&&(K(o,o.e+D+2,0),o.times(o).eq(a))){n=o;break}u+=4,c+=4,i=1}return K(n,n.e+D+1,x,t)},S.toExponential=function(t,e){return null!=t&&(b(t,0,g),t++),G(this,t,e,1)},S.toFixed=function(t,e){return null!=t&&(b(t,0,g),t=t+this.e+1),G(this,t,e)},S.toFormat=function(t,e,r){var n,o=this;if(null==r)null!=t&&e&&"object"==i(e)?(r=e,e=null):t&&"object"==i(t)?(r=t,t=e=null):r=F;else if("object"!=i(r))throw Error(f+"Argument not an object: "+r);if(n=o.toFixed(t,e),o.c){var a,s=n.split("."),c=+r.groupSize,A=+r.secondaryGroupSize,u=r.groupSeparator||"",h=s[0],l=s[1],d=o.s<0,g=d?h.slice(1):h,p=g.length;if(A&&(a=c,c=A,A=a,p-=a),c>0&&p>0){for(a=p%c||c,h=g.substr(0,a);a<p;a+=c)h+=u+g.substr(a,c);A>0&&(h+=u+g.slice(a)),d&&(h="-"+h)}n=l?h+(r.decimalSeparator||"")+((A=+r.fractionGroupSize)?l.replace(new RegExp("\\d{"+A+"}\\B","g"),"$&"+(r.fractionGroupSeparator||"")):l):h}return(r.prefix||"")+n+(r.suffix||"")},S.toFraction=function(t){var e,n,i,o,a,s,c,A,u,h,l,g,p=this,I=p.c;if(null!=t&&(!(c=new U(t)).isInteger()&&(c.c||1!==c.s)||c.lt(_)))throw Error(f+"Argument "+(c.isInteger()?"out of range: ":"not an integer: ")+q(c));if(!I)return new U(p);for(e=new U(_),u=n=new U(_),i=A=new U(_),g=y(I),a=e.e=g.length-p.e-1,e.c[0]=d[(s=a%14)<0?14+s:s],t=!t||c.comparedTo(e)>0?a>0?e:u:c,s=N,N=1/0,c=new U(g),A.c[0]=0;h=r(c,e,0,1),1!=(o=n.plus(h.times(i))).comparedTo(t);)n=i,i=o,u=A.plus(h.times(o=u)),A=o,e=c.minus(h.times(o=e)),c=o;return o=r(t.minus(n),i,0,1),A=A.plus(o.times(u)),n=n.plus(o.times(i)),A.s=u.s=p.s,l=r(u,i,a*=2,x).minus(p).abs().comparedTo(r(A,n,a,x).minus(p).abs())<1?[u,i]:[A,n],N=s,l},S.toNumber=function(){return+q(this)},S.toPrecision=function(t,e){return null!=t&&b(t,1,g),G(this,t,e,2)},S.toString=function(t){var e,r=this,i=r.s,o=r.e;return null===o?i?(e="Infinity",i<0&&(e="-"+e)):e="NaN":(null==t?e=o<=M||o>=R?E(y(r.c),o):m(y(r.c),o,"0"):10===t?e=m(y((r=K(new U(r),D+o+1,x)).c),r.e,"0"):(b(t,2,T.length,"Base"),e=n(m(y(r.c),o,"0"),10,t,i,!0)),i<0&&r.c[0]&&(e="-"+e)),e},S.valueOf=S.toJSON=function(){return q(this)},S._isBigNumber=!0,c&&(S[Symbol.toStringTag]="BigNumber",S[Symbol.for("nodejs.util.inspect.custom")]=S.valueOf),null!=e&&U.set(e),U}()).default=a.BigNumber=a,void 0===(n=function(){return a}.call(e,r,e,t))||(t.exports=n)}()},function(t,e,r){t.exports={encode:r(186),decode:r(187),encodingLength:r(188)}},function(t,e){t.exports=function t(e,n,i){n=n||[];var o=i=i||0;for(;e>=r;)n[i++]=255&e|128,e/=128;for(;-128&e;)n[i++]=255&e|128,e>>>=7;return n[i]=0|e,t.bytes=i-o+1,n};var r=Math.pow(2,31)},function(t,e){t.exports=function t(e,r){var n,i=0,o=0,a=r=r||0,s=e.length;do{if(a>=s)throw t.bytes=0,new RangeError("Could not decode varint");n=e[a++],i+=o<28?(127&n)<<o:(127&n)*Math.pow(2,o),o+=7}while(n>=128);return t.bytes=a-r,i}},function(t,e){var r=Math.pow(2,7),n=Math.pow(2,14),i=Math.pow(2,21),o=Math.pow(2,28),a=Math.pow(2,35),s=Math.pow(2,42),c=Math.pow(2,49),A=Math.pow(2,56),u=Math.pow(2,63);t.exports=function(t){return t<r?1:t<n?2:t<i?3:t<o?4:t<a?5:t<s?6:t<c?7:t<A?8:t<u?9:10}},function(t,e,r){"use strict";r.r(e),r.d(e,"Deflate",(function(){return $e})),r.d(e,"Inflate",(function(){return nr})),r.d(e,"constants",(function(){return sr})),r.d(e,"default",(function(){return cr})),r.d(e,"deflate",(function(){return tr})),r.d(e,"deflateRaw",(function(){return er})),r.d(e,"gzip",(function(){return rr})),r.d(e,"inflate",(function(){return ir})),r.d(e,"inflateRaw",(function(){return or})),r.d(e,"ungzip",(function(){return ar}));function n(t){let e=t.length;for(;--e>=0;)t[e]=0}const i=new Uint8Array([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0]),o=new Uint8Array([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13]),a=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]),s=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),c=new Array(576);n(c);const A=new Array(60);n(A);const u=new Array(512);n(u);const f=new Array(256);n(f);const h=new Array(29);n(h);const l=new Array(30);function d(t,e,r,n,i){this.static_tree=t,this.extra_bits=e,this.extra_base=r,this.elems=n,this.max_length=i,this.has_stree=t&&t.length}let g,p,y;function I(t,e){this.dyn_tree=t,this.max_code=0,this.stat_desc=e}n(l);const b=t=>t<256?u[t]:u[256+(t>>>7)],v=(t,e)=>{t.pending_buf[t.pending++]=255&e,t.pending_buf[t.pending++]=e>>>8&255},E=(t,e,r)=>{t.bi_valid>16-r?(t.bi_buf|=e<<t.bi_valid&65535,v(t,t.bi_buf),t.bi_buf=e>>16-t.bi_valid,t.bi_valid+=r-16):(t.bi_buf|=e<<t.bi_valid&65535,t.bi_valid+=r)},m=(t,e,r)=>{E(t,r[2*e],r[2*e+1])},C=(t,e)=>{let r=0;do{r|=1&t,t>>>=1,r<<=1}while(--e>0);return r>>>1},w=(t,e,r)=>{const n=new Array(16);let i,o,a=0;for(i=1;i<=15;i++)a=a+r[i-1]<<1,n[i]=a;for(o=0;o<=e;o++){let e=t[2*o+1];0!==e&&(t[2*o]=C(n[e]++,e))}},B=t=>{let e;for(e=0;e<286;e++)t.dyn_ltree[2*e]=0;for(e=0;e<30;e++)t.dyn_dtree[2*e]=0;for(e=0;e<19;e++)t.bl_tree[2*e]=0;t.dyn_ltree[512]=1,t.opt_len=t.static_len=0,t.sym_next=t.matches=0},Q=t=>{t.bi_valid>8?v(t,t.bi_buf):t.bi_valid>0&&(t.pending_buf[t.pending++]=t.bi_buf),t.bi_buf=0,t.bi_valid=0},k=(t,e,r,n)=>{const i=2*e,o=2*r;return t[i]<t[o]||t[i]===t[o]&&n[e]<=n[r]},S=(t,e,r)=>{const n=t.heap[r];let i=r<<1;for(;i<=t.heap_len&&(i<t.heap_len&&k(e,t.heap[i+1],t.heap[i],t.depth)&&i++,!k(e,n,t.heap[i],t.depth));)t.heap[r]=t.heap[i],r=i,i<<=1;t.heap[r]=n},_=(t,e,r)=>{let n,a,s,c,A=0;if(0!==t.sym_next)do{n=255&t.pending_buf[t.sym_buf+A++],n+=(255&t.pending_buf[t.sym_buf+A++])<<8,a=t.pending_buf[t.sym_buf+A++],0===n?m(t,a,e):(s=f[a],m(t,s+256+1,e),c=i[s],0!==c&&(a-=h[s],E(t,a,c)),n--,s=b(n),m(t,s,r),c=o[s],0!==c&&(n-=l[s],E(t,n,c)))}while(A<t.sym_next);m(t,256,e)},D=(t,e)=>{const r=e.dyn_tree,n=e.stat_desc.static_tree,i=e.stat_desc.has_stree,o=e.stat_desc.elems;let a,s,c,A=-1;for(t.heap_len=0,t.heap_max=573,a=0;a<o;a++)0!==r[2*a]?(t.heap[++t.heap_len]=A=a,t.depth[a]=0):r[2*a+1]=0;for(;t.heap_len<2;)c=t.heap[++t.heap_len]=A<2?++A:0,r[2*c]=1,t.depth[c]=0,t.opt_len--,i&&(t.static_len-=n[2*c+1]);for(e.max_code=A,a=t.heap_len>>1;a>=1;a--)S(t,r,a);c=o;do{a=t.heap[1],t.heap[1]=t.heap[t.heap_len--],S(t,r,1),s=t.heap[1],t.heap[--t.heap_max]=a,t.heap[--t.heap_max]=s,r[2*c]=r[2*a]+r[2*s],t.depth[c]=(t.depth[a]>=t.depth[s]?t.depth[a]:t.depth[s])+1,r[2*a+1]=r[2*s+1]=c,t.heap[1]=c++,S(t,r,1)}while(t.heap_len>=2);t.heap[--t.heap_max]=t.heap[1],((t,e)=>{const r=e.dyn_tree,n=e.max_code,i=e.stat_desc.static_tree,o=e.stat_desc.has_stree,a=e.stat_desc.extra_bits,s=e.stat_desc.extra_base,c=e.stat_desc.max_length;let A,u,f,h,l,d,g=0;for(h=0;h<=15;h++)t.bl_count[h]=0;for(r[2*t.heap[t.heap_max]+1]=0,A=t.heap_max+1;A<573;A++)u=t.heap[A],h=r[2*r[2*u+1]+1]+1,h>c&&(h=c,g++),r[2*u+1]=h,u>n||(t.bl_count[h]++,l=0,u>=s&&(l=a[u-s]),d=r[2*u],t.opt_len+=d*(h+l),o&&(t.static_len+=d*(i[2*u+1]+l)));if(0!==g){do{for(h=c-1;0===t.bl_count[h];)h--;t.bl_count[h]--,t.bl_count[h+1]+=2,t.bl_count[c]--,g-=2}while(g>0);for(h=c;0!==h;h--)for(u=t.bl_count[h];0!==u;)f=t.heap[--A],f>n||(r[2*f+1]!==h&&(t.opt_len+=(h-r[2*f+1])*r[2*f],r[2*f+1]=h),u--)}})(t,e),w(r,A,t.bl_count)},x=(t,e,r)=>{let n,i,o=-1,a=e[1],s=0,c=7,A=4;for(0===a&&(c=138,A=3),e[2*(r+1)+1]=65535,n=0;n<=r;n++)i=a,a=e[2*(n+1)+1],++s<c&&i===a||(s<A?t.bl_tree[2*i]+=s:0!==i?(i!==o&&t.bl_tree[2*i]++,t.bl_tree[32]++):s<=10?t.bl_tree[34]++:t.bl_tree[36]++,s=0,o=i,0===a?(c=138,A=3):i===a?(c=6,A=3):(c=7,A=4))},M=(t,e,r)=>{let n,i,o=-1,a=e[1],s=0,c=7,A=4;for(0===a&&(c=138,A=3),n=0;n<=r;n++)if(i=a,a=e[2*(n+1)+1],!(++s<c&&i===a)){if(s<A)do{m(t,i,t.bl_tree)}while(0!=--s);else 0!==i?(i!==o&&(m(t,i,t.bl_tree),s--),m(t,16,t.bl_tree),E(t,s-3,2)):s<=10?(m(t,17,t.bl_tree),E(t,s-3,3)):(m(t,18,t.bl_tree),E(t,s-11,7));s=0,o=i,0===a?(c=138,A=3):i===a?(c=6,A=3):(c=7,A=4)}};let R=!1;const O=(t,e,r,n)=>{E(t,0+(n?1:0),3),Q(t),v(t,r),v(t,~r),r&&t.pending_buf.set(t.window.subarray(e,e+r),t.pending),t.pending+=r};var N={_tr_init:t=>{R||((()=>{let t,e,r,n,s;const I=new Array(16);for(r=0,n=0;n<28;n++)for(h[n]=r,t=0;t<1<<i[n];t++)f[r++]=n;for(f[r-1]=n,s=0,n=0;n<16;n++)for(l[n]=s,t=0;t<1<<o[n];t++)u[s++]=n;for(s>>=7;n<30;n++)for(l[n]=s<<7,t=0;t<1<<o[n]-7;t++)u[256+s++]=n;for(e=0;e<=15;e++)I[e]=0;for(t=0;t<=143;)c[2*t+1]=8,t++,I[8]++;for(;t<=255;)c[2*t+1]=9,t++,I[9]++;for(;t<=279;)c[2*t+1]=7,t++,I[7]++;for(;t<=287;)c[2*t+1]=8,t++,I[8]++;for(w(c,287,I),t=0;t<30;t++)A[2*t+1]=5,A[2*t]=C(t,5);g=new d(c,i,257,286,15),p=new d(A,o,0,30,15),y=new d(new Array(0),a,0,19,7)})(),R=!0),t.l_desc=new I(t.dyn_ltree,g),t.d_desc=new I(t.dyn_dtree,p),t.bl_desc=new I(t.bl_tree,y),t.bi_buf=0,t.bi_valid=0,B(t)},_tr_stored_block:O,_tr_flush_block:(t,e,r,n)=>{let i,o,a=0;t.level>0?(2===t.strm.data_type&&(t.strm.data_type=(t=>{let e,r=4093624447;for(e=0;e<=31;e++,r>>>=1)if(1&r&&0!==t.dyn_ltree[2*e])return 0;if(0!==t.dyn_ltree[18]||0!==t.dyn_ltree[20]||0!==t.dyn_ltree[26])return 1;for(e=32;e<256;e++)if(0!==t.dyn_ltree[2*e])return 1;return 0})(t)),D(t,t.l_desc),D(t,t.d_desc),a=(t=>{let e;for(x(t,t.dyn_ltree,t.l_desc.max_code),x(t,t.dyn_dtree,t.d_desc.max_code),D(t,t.bl_desc),e=18;e>=3&&0===t.bl_tree[2*s[e]+1];e--);return t.opt_len+=3*(e+1)+5+5+4,e})(t),i=t.opt_len+3+7>>>3,o=t.static_len+3+7>>>3,o<=i&&(i=o)):i=o=r+5,r+4<=i&&-1!==e?O(t,e,r,n):4===t.strategy||o===i?(E(t,2+(n?1:0),3),_(t,c,A)):(E(t,4+(n?1:0),3),((t,e,r,n)=>{let i;for(E(t,e-257,5),E(t,r-1,5),E(t,n-4,4),i=0;i<n;i++)E(t,t.bl_tree[2*s[i]+1],3);M(t,t.dyn_ltree,e-1),M(t,t.dyn_dtree,r-1)})(t,t.l_desc.max_code+1,t.d_desc.max_code+1,a+1),_(t,t.dyn_ltree,t.dyn_dtree)),B(t),n&&Q(t)},_tr_tally:(t,e,r)=>(t.pending_buf[t.sym_buf+t.sym_next++]=e,t.pending_buf[t.sym_buf+t.sym_next++]=e>>8,t.pending_buf[t.sym_buf+t.sym_next++]=r,0===e?t.dyn_ltree[2*r]++:(t.matches++,e--,t.dyn_ltree[2*(f[r]+256+1)]++,t.dyn_dtree[2*b(e)]++),t.sym_next===t.sym_end),_tr_align:t=>{E(t,2,3),m(t,256,c),(t=>{16===t.bi_valid?(v(t,t.bi_buf),t.bi_buf=0,t.bi_valid=0):t.bi_valid>=8&&(t.pending_buf[t.pending++]=255&t.bi_buf,t.bi_buf>>=8,t.bi_valid-=8)})(t)}};var P=(t,e,r,n)=>{let i=65535&t|0,o=t>>>16&65535|0,a=0;for(;0!==r;){a=r>2e3?2e3:r,r-=a;do{i=i+e[n++]|0,o=o+i|0}while(--a);i%=65521,o%=65521}return i|o<<16|0};const j=new Uint32Array((()=>{let t,e=[];for(var r=0;r<256;r++){t=r;for(var n=0;n<8;n++)t=1&t?3988292384^t>>>1:t>>>1;e[r]=t}return e})());var L=(t,e,r,n)=>{const i=j,o=n+r;t^=-1;for(let r=n;r<o;r++)t=t>>>8^i[255&(t^e[r])];return-1^t},F={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"},T={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8};const{_tr_init:U,_tr_stored_block:G,_tr_flush_block:H,_tr_tally:Y,_tr_align:K}=N,{Z_NO_FLUSH:q,Z_PARTIAL_FLUSH:J,Z_FULL_FLUSH:z,Z_FINISH:Z,Z_BLOCK:V,Z_OK:W,Z_STREAM_END:X,Z_STREAM_ERROR:$,Z_DATA_ERROR:tt,Z_BUF_ERROR:et,Z_DEFAULT_COMPRESSION:rt,Z_FILTERED:nt,Z_HUFFMAN_ONLY:it,Z_RLE:ot,Z_FIXED:at,Z_DEFAULT_STRATEGY:st,Z_UNKNOWN:ct,Z_DEFLATED:At}=T,ut=(t,e)=>(t.msg=F[e],e),ft=t=>2*t-(t>4?9:0),ht=t=>{let e=t.length;for(;--e>=0;)t[e]=0},lt=t=>{let e,r,n,i=t.w_size;e=t.hash_size,n=e;do{r=t.head[--n],t.head[n]=r>=i?r-i:0}while(--e);e=i,n=e;do{r=t.prev[--n],t.prev[n]=r>=i?r-i:0}while(--e)};let dt=(t,e,r)=>(e<<t.hash_shift^r)&t.hash_mask;const gt=t=>{const e=t.state;let r=e.pending;r>t.avail_out&&(r=t.avail_out),0!==r&&(t.output.set(e.pending_buf.subarray(e.pending_out,e.pending_out+r),t.next_out),t.next_out+=r,e.pending_out+=r,t.total_out+=r,t.avail_out-=r,e.pending-=r,0===e.pending&&(e.pending_out=0))},pt=(t,e)=>{H(t,t.block_start>=0?t.block_start:-1,t.strstart-t.block_start,e),t.block_start=t.strstart,gt(t.strm)},yt=(t,e)=>{t.pending_buf[t.pending++]=e},It=(t,e)=>{t.pending_buf[t.pending++]=e>>>8&255,t.pending_buf[t.pending++]=255&e},bt=(t,e,r,n)=>{let i=t.avail_in;return i>n&&(i=n),0===i?0:(t.avail_in-=i,e.set(t.input.subarray(t.next_in,t.next_in+i),r),1===t.state.wrap?t.adler=P(t.adler,e,i,r):2===t.state.wrap&&(t.adler=L(t.adler,e,i,r)),t.next_in+=i,t.total_in+=i,i)},vt=(t,e)=>{let r,n,i=t.max_chain_length,o=t.strstart,a=t.prev_length,s=t.nice_match;const c=t.strstart>t.w_size-262?t.strstart-(t.w_size-262):0,A=t.window,u=t.w_mask,f=t.prev,h=t.strstart+258;let l=A[o+a-1],d=A[o+a];t.prev_length>=t.good_match&&(i>>=2),s>t.lookahead&&(s=t.lookahead);do{if(r=e,A[r+a]===d&&A[r+a-1]===l&&A[r]===A[o]&&A[++r]===A[o+1]){o+=2,r++;do{}while(A[++o]===A[++r]&&A[++o]===A[++r]&&A[++o]===A[++r]&&A[++o]===A[++r]&&A[++o]===A[++r]&&A[++o]===A[++r]&&A[++o]===A[++r]&&A[++o]===A[++r]&&o<h);if(n=258-(h-o),o=h-258,n>a){if(t.match_start=e,a=n,n>=s)break;l=A[o+a-1],d=A[o+a]}}}while((e=f[e&u])>c&&0!=--i);return a<=t.lookahead?a:t.lookahead},Et=t=>{const e=t.w_size;let r,n,i;do{if(n=t.window_size-t.lookahead-t.strstart,t.strstart>=e+(e-262)&&(t.window.set(t.window.subarray(e,e+e-n),0),t.match_start-=e,t.strstart-=e,t.block_start-=e,t.insert>t.strstart&&(t.insert=t.strstart),lt(t),n+=e),0===t.strm.avail_in)break;if(r=bt(t.strm,t.window,t.strstart+t.lookahead,n),t.lookahead+=r,t.lookahead+t.insert>=3)for(i=t.strstart-t.insert,t.ins_h=t.window[i],t.ins_h=dt(t,t.ins_h,t.window[i+1]);t.insert&&(t.ins_h=dt(t,t.ins_h,t.window[i+3-1]),t.prev[i&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=i,i++,t.insert--,!(t.lookahead+t.insert<3)););}while(t.lookahead<262&&0!==t.strm.avail_in)},mt=(t,e)=>{let r,n,i,o=t.pending_buf_size-5>t.w_size?t.w_size:t.pending_buf_size-5,a=0,s=t.strm.avail_in;do{if(r=65535,i=t.bi_valid+42>>3,t.strm.avail_out<i)break;if(i=t.strm.avail_out-i,n=t.strstart-t.block_start,r>n+t.strm.avail_in&&(r=n+t.strm.avail_in),r>i&&(r=i),r<o&&(0===r&&e!==Z||e===q||r!==n+t.strm.avail_in))break;a=e===Z&&r===n+t.strm.avail_in?1:0,G(t,0,0,a),t.pending_buf[t.pending-4]=r,t.pending_buf[t.pending-3]=r>>8,t.pending_buf[t.pending-2]=~r,t.pending_buf[t.pending-1]=~r>>8,gt(t.strm),n&&(n>r&&(n=r),t.strm.output.set(t.window.subarray(t.block_start,t.block_start+n),t.strm.next_out),t.strm.next_out+=n,t.strm.avail_out-=n,t.strm.total_out+=n,t.block_start+=n,r-=n),r&&(bt(t.strm,t.strm.output,t.strm.next_out,r),t.strm.next_out+=r,t.strm.avail_out-=r,t.strm.total_out+=r)}while(0===a);return s-=t.strm.avail_in,s&&(s>=t.w_size?(t.matches=2,t.window.set(t.strm.input.subarray(t.strm.next_in-t.w_size,t.strm.next_in),0),t.strstart=t.w_size,t.insert=t.strstart):(t.window_size-t.strstart<=s&&(t.strstart-=t.w_size,t.window.set(t.window.subarray(t.w_size,t.w_size+t.strstart),0),t.matches<2&&t.matches++,t.insert>t.strstart&&(t.insert=t.strstart)),t.window.set(t.strm.input.subarray(t.strm.next_in-s,t.strm.next_in),t.strstart),t.strstart+=s,t.insert+=s>t.w_size-t.insert?t.w_size-t.insert:s),t.block_start=t.strstart),t.high_water<t.strstart&&(t.high_water=t.strstart),a?4:e!==q&&e!==Z&&0===t.strm.avail_in&&t.strstart===t.block_start?2:(i=t.window_size-t.strstart,t.strm.avail_in>i&&t.block_start>=t.w_size&&(t.block_start-=t.w_size,t.strstart-=t.w_size,t.window.set(t.window.subarray(t.w_size,t.w_size+t.strstart),0),t.matches<2&&t.matches++,i+=t.w_size,t.insert>t.strstart&&(t.insert=t.strstart)),i>t.strm.avail_in&&(i=t.strm.avail_in),i&&(bt(t.strm,t.window,t.strstart,i),t.strstart+=i,t.insert+=i>t.w_size-t.insert?t.w_size-t.insert:i),t.high_water<t.strstart&&(t.high_water=t.strstart),i=t.bi_valid+42>>3,i=t.pending_buf_size-i>65535?65535:t.pending_buf_size-i,o=i>t.w_size?t.w_size:i,n=t.strstart-t.block_start,(n>=o||(n||e===Z)&&e!==q&&0===t.strm.avail_in&&n<=i)&&(r=n>i?i:n,a=e===Z&&0===t.strm.avail_in&&r===n?1:0,G(t,t.block_start,r,a),t.block_start+=r,gt(t.strm)),a?3:1)},Ct=(t,e)=>{let r,n;for(;;){if(t.lookahead<262){if(Et(t),t.lookahead<262&&e===q)return 1;if(0===t.lookahead)break}if(r=0,t.lookahead>=3&&(t.ins_h=dt(t,t.ins_h,t.window[t.strstart+3-1]),r=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),0!==r&&t.strstart-r<=t.w_size-262&&(t.match_length=vt(t,r)),t.match_length>=3)if(n=Y(t,t.strstart-t.match_start,t.match_length-3),t.lookahead-=t.match_length,t.match_length<=t.max_lazy_match&&t.lookahead>=3){t.match_length--;do{t.strstart++,t.ins_h=dt(t,t.ins_h,t.window[t.strstart+3-1]),r=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart}while(0!=--t.match_length);t.strstart++}else t.strstart+=t.match_length,t.match_length=0,t.ins_h=t.window[t.strstart],t.ins_h=dt(t,t.ins_h,t.window[t.strstart+1]);else n=Y(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++;if(n&&(pt(t,!1),0===t.strm.avail_out))return 1}return t.insert=t.strstart<2?t.strstart:2,e===Z?(pt(t,!0),0===t.strm.avail_out?3:4):t.sym_next&&(pt(t,!1),0===t.strm.avail_out)?1:2},wt=(t,e)=>{let r,n,i;for(;;){if(t.lookahead<262){if(Et(t),t.lookahead<262&&e===q)return 1;if(0===t.lookahead)break}if(r=0,t.lookahead>=3&&(t.ins_h=dt(t,t.ins_h,t.window[t.strstart+3-1]),r=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),t.prev_length=t.match_length,t.prev_match=t.match_start,t.match_length=2,0!==r&&t.prev_length<t.max_lazy_match&&t.strstart-r<=t.w_size-262&&(t.match_length=vt(t,r),t.match_length<=5&&(t.strategy===nt||3===t.match_length&&t.strstart-t.match_start>4096)&&(t.match_length=2)),t.prev_length>=3&&t.match_length<=t.prev_length){i=t.strstart+t.lookahead-3,n=Y(t,t.strstart-1-t.prev_match,t.prev_length-3),t.lookahead-=t.prev_length-1,t.prev_length-=2;do{++t.strstart<=i&&(t.ins_h=dt(t,t.ins_h,t.window[t.strstart+3-1]),r=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart)}while(0!=--t.prev_length);if(t.match_available=0,t.match_length=2,t.strstart++,n&&(pt(t,!1),0===t.strm.avail_out))return 1}else if(t.match_available){if(n=Y(t,0,t.window[t.strstart-1]),n&&pt(t,!1),t.strstart++,t.lookahead--,0===t.strm.avail_out)return 1}else t.match_available=1,t.strstart++,t.lookahead--}return t.match_available&&(n=Y(t,0,t.window[t.strstart-1]),t.match_available=0),t.insert=t.strstart<2?t.strstart:2,e===Z?(pt(t,!0),0===t.strm.avail_out?3:4):t.sym_next&&(pt(t,!1),0===t.strm.avail_out)?1:2};function Bt(t,e,r,n,i){this.good_length=t,this.max_lazy=e,this.nice_length=r,this.max_chain=n,this.func=i}const Qt=[new Bt(0,0,0,0,mt),new Bt(4,4,8,4,Ct),new Bt(4,5,16,8,Ct),new Bt(4,6,32,32,Ct),new Bt(4,4,16,16,wt),new Bt(8,16,32,32,wt),new Bt(8,16,128,128,wt),new Bt(8,32,128,256,wt),new Bt(32,128,258,1024,wt),new Bt(32,258,258,4096,wt)];function kt(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=At,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new Uint16Array(1146),this.dyn_dtree=new Uint16Array(122),this.bl_tree=new Uint16Array(78),ht(this.dyn_ltree),ht(this.dyn_dtree),ht(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Uint16Array(16),this.heap=new Uint16Array(573),ht(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Uint16Array(573),ht(this.depth),this.sym_buf=0,this.lit_bufsize=0,this.sym_next=0,this.sym_end=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}const St=t=>{if(!t)return 1;const e=t.state;return!e||e.strm!==t||42!==e.status&&57!==e.status&&69!==e.status&&73!==e.status&&91!==e.status&&103!==e.status&&113!==e.status&&666!==e.status?1:0},_t=t=>{if(St(t))return ut(t,$);t.total_in=t.total_out=0,t.data_type=ct;const e=t.state;return e.pending=0,e.pending_out=0,e.wrap<0&&(e.wrap=-e.wrap),e.status=2===e.wrap?57:e.wrap?42:113,t.adler=2===e.wrap?0:1,e.last_flush=-2,U(e),W},Dt=t=>{const e=_t(t);var r;return e===W&&((r=t.state).window_size=2*r.w_size,ht(r.head),r.max_lazy_match=Qt[r.level].max_lazy,r.good_match=Qt[r.level].good_length,r.nice_match=Qt[r.level].nice_length,r.max_chain_length=Qt[r.level].max_chain,r.strstart=0,r.block_start=0,r.lookahead=0,r.insert=0,r.match_length=r.prev_length=2,r.match_available=0,r.ins_h=0),e},xt=(t,e,r,n,i,o)=>{if(!t)return $;let a=1;if(e===rt&&(e=6),n<0?(a=0,n=-n):n>15&&(a=2,n-=16),i<1||i>9||r!==At||n<8||n>15||e<0||e>9||o<0||o>at||8===n&&1!==a)return ut(t,$);8===n&&(n=9);const s=new kt;return t.state=s,s.strm=t,s.status=42,s.wrap=a,s.gzhead=null,s.w_bits=n,s.w_size=1<<s.w_bits,s.w_mask=s.w_size-1,s.hash_bits=i+7,s.hash_size=1<<s.hash_bits,s.hash_mask=s.hash_size-1,s.hash_shift=~~((s.hash_bits+3-1)/3),s.window=new Uint8Array(2*s.w_size),s.head=new Uint16Array(s.hash_size),s.prev=new Uint16Array(s.w_size),s.lit_bufsize=1<<i+6,s.pending_buf_size=4*s.lit_bufsize,s.pending_buf=new Uint8Array(s.pending_buf_size),s.sym_buf=s.lit_bufsize,s.sym_end=3*(s.lit_bufsize-1),s.level=e,s.strategy=o,s.method=r,Dt(t)};var Mt={deflateInit:(t,e)=>xt(t,e,At,15,8,st),deflateInit2:xt,deflateReset:Dt,deflateResetKeep:_t,deflateSetHeader:(t,e)=>St(t)||2!==t.state.wrap?$:(t.state.gzhead=e,W),deflate:(t,e)=>{if(St(t)||e>V||e<0)return t?ut(t,$):$;const r=t.state;if(!t.output||0!==t.avail_in&&!t.input||666===r.status&&e!==Z)return ut(t,0===t.avail_out?et:$);const n=r.last_flush;if(r.last_flush=e,0!==r.pending){if(gt(t),0===t.avail_out)return r.last_flush=-1,W}else if(0===t.avail_in&&ft(e)<=ft(n)&&e!==Z)return ut(t,et);if(666===r.status&&0!==t.avail_in)return ut(t,et);if(42===r.status&&0===r.wrap&&(r.status=113),42===r.status){let e=At+(r.w_bits-8<<4)<<8,n=-1;if(n=r.strategy>=it||r.level<2?0:r.level<6?1:6===r.level?2:3,e|=n<<6,0!==r.strstart&&(e|=32),e+=31-e%31,It(r,e),0!==r.strstart&&(It(r,t.adler>>>16),It(r,65535&t.adler)),t.adler=1,r.status=113,gt(t),0!==r.pending)return r.last_flush=-1,W}if(57===r.status)if(t.adler=0,yt(r,31),yt(r,139),yt(r,8),r.gzhead)yt(r,(r.gzhead.text?1:0)+(r.gzhead.hcrc?2:0)+(r.gzhead.extra?4:0)+(r.gzhead.name?8:0)+(r.gzhead.comment?16:0)),yt(r,255&r.gzhead.time),yt(r,r.gzhead.time>>8&255),yt(r,r.gzhead.time>>16&255),yt(r,r.gzhead.time>>24&255),yt(r,9===r.level?2:r.strategy>=it||r.level<2?4:0),yt(r,255&r.gzhead.os),r.gzhead.extra&&r.gzhead.extra.length&&(yt(r,255&r.gzhead.extra.length),yt(r,r.gzhead.extra.length>>8&255)),r.gzhead.hcrc&&(t.adler=L(t.adler,r.pending_buf,r.pending,0)),r.gzindex=0,r.status=69;else if(yt(r,0),yt(r,0),yt(r,0),yt(r,0),yt(r,0),yt(r,9===r.level?2:r.strategy>=it||r.level<2?4:0),yt(r,3),r.status=113,gt(t),0!==r.pending)return r.last_flush=-1,W;if(69===r.status){if(r.gzhead.extra){let e=r.pending,n=(65535&r.gzhead.extra.length)-r.gzindex;for(;r.pending+n>r.pending_buf_size;){let i=r.pending_buf_size-r.pending;if(r.pending_buf.set(r.gzhead.extra.subarray(r.gzindex,r.gzindex+i),r.pending),r.pending=r.pending_buf_size,r.gzhead.hcrc&&r.pending>e&&(t.adler=L(t.adler,r.pending_buf,r.pending-e,e)),r.gzindex+=i,gt(t),0!==r.pending)return r.last_flush=-1,W;e=0,n-=i}let i=new Uint8Array(r.gzhead.extra);r.pending_buf.set(i.subarray(r.gzindex,r.gzindex+n),r.pending),r.pending+=n,r.gzhead.hcrc&&r.pending>e&&(t.adler=L(t.adler,r.pending_buf,r.pending-e,e)),r.gzindex=0}r.status=73}if(73===r.status){if(r.gzhead.name){let e,n=r.pending;do{if(r.pending===r.pending_buf_size){if(r.gzhead.hcrc&&r.pending>n&&(t.adler=L(t.adler,r.pending_buf,r.pending-n,n)),gt(t),0!==r.pending)return r.last_flush=-1,W;n=0}e=r.gzindex<r.gzhead.name.length?255&r.gzhead.name.charCodeAt(r.gzindex++):0,yt(r,e)}while(0!==e);r.gzhead.hcrc&&r.pending>n&&(t.adler=L(t.adler,r.pending_buf,r.pending-n,n)),r.gzindex=0}r.status=91}if(91===r.status){if(r.gzhead.comment){let e,n=r.pending;do{if(r.pending===r.pending_buf_size){if(r.gzhead.hcrc&&r.pending>n&&(t.adler=L(t.adler,r.pending_buf,r.pending-n,n)),gt(t),0!==r.pending)return r.last_flush=-1,W;n=0}e=r.gzindex<r.gzhead.comment.length?255&r.gzhead.comment.charCodeAt(r.gzindex++):0,yt(r,e)}while(0!==e);r.gzhead.hcrc&&r.pending>n&&(t.adler=L(t.adler,r.pending_buf,r.pending-n,n))}r.status=103}if(103===r.status){if(r.gzhead.hcrc){if(r.pending+2>r.pending_buf_size&&(gt(t),0!==r.pending))return r.last_flush=-1,W;yt(r,255&t.adler),yt(r,t.adler>>8&255),t.adler=0}if(r.status=113,gt(t),0!==r.pending)return r.last_flush=-1,W}if(0!==t.avail_in||0!==r.lookahead||e!==q&&666!==r.status){let n=0===r.level?mt(r,e):r.strategy===it?((t,e)=>{let r;for(;;){if(0===t.lookahead&&(Et(t),0===t.lookahead)){if(e===q)return 1;break}if(t.match_length=0,r=Y(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++,r&&(pt(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,e===Z?(pt(t,!0),0===t.strm.avail_out?3:4):t.sym_next&&(pt(t,!1),0===t.strm.avail_out)?1:2})(r,e):r.strategy===ot?((t,e)=>{let r,n,i,o;const a=t.window;for(;;){if(t.lookahead<=258){if(Et(t),t.lookahead<=258&&e===q)return 1;if(0===t.lookahead)break}if(t.match_length=0,t.lookahead>=3&&t.strstart>0&&(i=t.strstart-1,n=a[i],n===a[++i]&&n===a[++i]&&n===a[++i])){o=t.strstart+258;do{}while(n===a[++i]&&n===a[++i]&&n===a[++i]&&n===a[++i]&&n===a[++i]&&n===a[++i]&&n===a[++i]&&n===a[++i]&&i<o);t.match_length=258-(o-i),t.match_length>t.lookahead&&(t.match_length=t.lookahead)}if(t.match_length>=3?(r=Y(t,1,t.match_length-3),t.lookahead-=t.match_length,t.strstart+=t.match_length,t.match_length=0):(r=Y(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++),r&&(pt(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,e===Z?(pt(t,!0),0===t.strm.avail_out?3:4):t.sym_next&&(pt(t,!1),0===t.strm.avail_out)?1:2})(r,e):Qt[r.level].func(r,e);if(3!==n&&4!==n||(r.status=666),1===n||3===n)return 0===t.avail_out&&(r.last_flush=-1),W;if(2===n&&(e===J?K(r):e!==V&&(G(r,0,0,!1),e===z&&(ht(r.head),0===r.lookahead&&(r.strstart=0,r.block_start=0,r.insert=0))),gt(t),0===t.avail_out))return r.last_flush=-1,W}return e!==Z?W:r.wrap<=0?X:(2===r.wrap?(yt(r,255&t.adler),yt(r,t.adler>>8&255),yt(r,t.adler>>16&255),yt(r,t.adler>>24&255),yt(r,255&t.total_in),yt(r,t.total_in>>8&255),yt(r,t.total_in>>16&255),yt(r,t.total_in>>24&255)):(It(r,t.adler>>>16),It(r,65535&t.adler)),gt(t),r.wrap>0&&(r.wrap=-r.wrap),0!==r.pending?W:X)},deflateEnd:t=>{if(St(t))return $;const e=t.state.status;return t.state=null,113===e?ut(t,tt):W},deflateSetDictionary:(t,e)=>{let r=e.length;if(St(t))return $;const n=t.state,i=n.wrap;if(2===i||1===i&&42!==n.status||n.lookahead)return $;if(1===i&&(t.adler=P(t.adler,e,r,0)),n.wrap=0,r>=n.w_size){0===i&&(ht(n.head),n.strstart=0,n.block_start=0,n.insert=0);let t=new Uint8Array(n.w_size);t.set(e.subarray(r-n.w_size,r),0),e=t,r=n.w_size}const o=t.avail_in,a=t.next_in,s=t.input;for(t.avail_in=r,t.next_in=0,t.input=e,Et(n);n.lookahead>=3;){let t=n.strstart,e=n.lookahead-2;do{n.ins_h=dt(n,n.ins_h,n.window[t+3-1]),n.prev[t&n.w_mask]=n.head[n.ins_h],n.head[n.ins_h]=t,t++}while(--e);n.strstart=t,n.lookahead=2,Et(n)}return n.strstart+=n.lookahead,n.block_start=n.strstart,n.insert=n.lookahead,n.lookahead=0,n.match_length=n.prev_length=2,n.match_available=0,t.next_in=a,t.input=s,t.avail_in=o,n.wrap=i,W},deflateInfo:"pako deflate (from Nodeca project)"};const Rt=(t,e)=>Object.prototype.hasOwnProperty.call(t,e);var Ot=function(t){const e=Array.prototype.slice.call(arguments,1);for(;e.length;){const r=e.shift();if(r){if("object"!=typeof r)throw new TypeError(r+"must be non-object");for(const e in r)Rt(r,e)&&(t[e]=r[e])}}return t},Nt=t=>{let e=0;for(let r=0,n=t.length;r<n;r++)e+=t[r].length;const r=new Uint8Array(e);for(let e=0,n=0,i=t.length;e<i;e++){let i=t[e];r.set(i,n),n+=i.length}return r};let Pt=!0;try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(t){Pt=!1}const jt=new Uint8Array(256);for(let t=0;t<256;t++)jt[t]=t>=252?6:t>=248?5:t>=240?4:t>=224?3:t>=192?2:1;jt[254]=jt[254]=1;var Lt=t=>{if("function"==typeof TextEncoder&&TextEncoder.prototype.encode)return(new TextEncoder).encode(t);let e,r,n,i,o,a=t.length,s=0;for(i=0;i<a;i++)r=t.charCodeAt(i),55296==(64512&r)&&i+1<a&&(n=t.charCodeAt(i+1),56320==(64512&n)&&(r=65536+(r-55296<<10)+(n-56320),i++)),s+=r<128?1:r<2048?2:r<65536?3:4;for(e=new Uint8Array(s),o=0,i=0;o<s;i++)r=t.charCodeAt(i),55296==(64512&r)&&i+1<a&&(n=t.charCodeAt(i+1),56320==(64512&n)&&(r=65536+(r-55296<<10)+(n-56320),i++)),r<128?e[o++]=r:r<2048?(e[o++]=192|r>>>6,e[o++]=128|63&r):r<65536?(e[o++]=224|r>>>12,e[o++]=128|r>>>6&63,e[o++]=128|63&r):(e[o++]=240|r>>>18,e[o++]=128|r>>>12&63,e[o++]=128|r>>>6&63,e[o++]=128|63&r);return e},Ft=(t,e)=>{const r=e||t.length;if("function"==typeof TextDecoder&&TextDecoder.prototype.decode)return(new TextDecoder).decode(t.subarray(0,e));let n,i;const o=new Array(2*r);for(i=0,n=0;n<r;){let e=t[n++];if(e<128){o[i++]=e;continue}let a=jt[e];if(a>4)o[i++]=65533,n+=a-1;else{for(e&=2===a?31:3===a?15:7;a>1&&n<r;)e=e<<6|63&t[n++],a--;a>1?o[i++]=65533:e<65536?o[i++]=e:(e-=65536,o[i++]=55296|e>>10&1023,o[i++]=56320|1023&e)}}return((t,e)=>{if(e<65534&&t.subarray&&Pt)return String.fromCharCode.apply(null,t.length===e?t:t.subarray(0,e));let r="";for(let n=0;n<e;n++)r+=String.fromCharCode(t[n]);return r})(o,i)},Tt=(t,e)=>{(e=e||t.length)>t.length&&(e=t.length);let r=e-1;for(;r>=0&&128==(192&t[r]);)r--;return r<0||0===r?e:r+jt[t[r]]>e?r:e};var Ut=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0};const Gt=Object.prototype.toString,{Z_NO_FLUSH:Ht,Z_SYNC_FLUSH:Yt,Z_FULL_FLUSH:Kt,Z_FINISH:qt,Z_OK:Jt,Z_STREAM_END:zt,Z_DEFAULT_COMPRESSION:Zt,Z_DEFAULT_STRATEGY:Vt,Z_DEFLATED:Wt}=T;function Xt(t){this.options=Ot({level:Zt,method:Wt,chunkSize:16384,windowBits:15,memLevel:8,strategy:Vt},t||{});let e=this.options;e.raw&&e.windowBits>0?e.windowBits=-e.windowBits:e.gzip&&e.windowBits>0&&e.windowBits<16&&(e.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new Ut,this.strm.avail_out=0;let r=Mt.deflateInit2(this.strm,e.level,e.method,e.windowBits,e.memLevel,e.strategy);if(r!==Jt)throw new Error(F[r]);if(e.header&&Mt.deflateSetHeader(this.strm,e.header),e.dictionary){let t;if(t="string"==typeof e.dictionary?Lt(e.dictionary):"[object ArrayBuffer]"===Gt.call(e.dictionary)?new Uint8Array(e.dictionary):e.dictionary,r=Mt.deflateSetDictionary(this.strm,t),r!==Jt)throw new Error(F[r]);this._dict_set=!0}}function $t(t,e){const r=new Xt(e);if(r.push(t,!0),r.err)throw r.msg||F[r.err];return r.result}Xt.prototype.push=function(t,e){const r=this.strm,n=this.options.chunkSize;let i,o;if(this.ended)return!1;for(o=e===~~e?e:!0===e?qt:Ht,"string"==typeof t?r.input=Lt(t):"[object ArrayBuffer]"===Gt.call(t)?r.input=new Uint8Array(t):r.input=t,r.next_in=0,r.avail_in=r.input.length;;)if(0===r.avail_out&&(r.output=new Uint8Array(n),r.next_out=0,r.avail_out=n),(o===Yt||o===Kt)&&r.avail_out<=6)this.onData(r.output.subarray(0,r.next_out)),r.avail_out=0;else{if(i=Mt.deflate(r,o),i===zt)return r.next_out>0&&this.onData(r.output.subarray(0,r.next_out)),i=Mt.deflateEnd(this.strm),this.onEnd(i),this.ended=!0,i===Jt;if(0!==r.avail_out){if(o>0&&r.next_out>0)this.onData(r.output.subarray(0,r.next_out)),r.avail_out=0;else if(0===r.avail_in)break}else this.onData(r.output)}return!0},Xt.prototype.onData=function(t){this.chunks.push(t)},Xt.prototype.onEnd=function(t){t===Jt&&(this.result=Nt(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg};var te={Deflate:Xt,deflate:$t,deflateRaw:function(t,e){return(e=e||{}).raw=!0,$t(t,e)},gzip:function(t,e){return(e=e||{}).gzip=!0,$t(t,e)},constants:T};var ee=function(t,e){let r,n,i,o,a,s,c,A,u,f,h,l,d,g,p,y,I,b,v,E,m,C,w,B;const Q=t.state;r=t.next_in,w=t.input,n=r+(t.avail_in-5),i=t.next_out,B=t.output,o=i-(e-t.avail_out),a=i+(t.avail_out-257),s=Q.dmax,c=Q.wsize,A=Q.whave,u=Q.wnext,f=Q.window,h=Q.hold,l=Q.bits,d=Q.lencode,g=Q.distcode,p=(1<<Q.lenbits)-1,y=(1<<Q.distbits)-1;t:do{l<15&&(h+=w[r++]<<l,l+=8,h+=w[r++]<<l,l+=8),I=d[h&p];e:for(;;){if(b=I>>>24,h>>>=b,l-=b,b=I>>>16&255,0===b)B[i++]=65535&I;else{if(!(16&b)){if(0==(64&b)){I=d[(65535&I)+(h&(1<<b)-1)];continue e}if(32&b){Q.mode=16191;break t}t.msg="invalid literal/length code",Q.mode=16209;break t}v=65535&I,b&=15,b&&(l<b&&(h+=w[r++]<<l,l+=8),v+=h&(1<<b)-1,h>>>=b,l-=b),l<15&&(h+=w[r++]<<l,l+=8,h+=w[r++]<<l,l+=8),I=g[h&y];r:for(;;){if(b=I>>>24,h>>>=b,l-=b,b=I>>>16&255,!(16&b)){if(0==(64&b)){I=g[(65535&I)+(h&(1<<b)-1)];continue r}t.msg="invalid distance code",Q.mode=16209;break t}if(E=65535&I,b&=15,l<b&&(h+=w[r++]<<l,l+=8,l<b&&(h+=w[r++]<<l,l+=8)),E+=h&(1<<b)-1,E>s){t.msg="invalid distance too far back",Q.mode=16209;break t}if(h>>>=b,l-=b,b=i-o,E>b){if(b=E-b,b>A&&Q.sane){t.msg="invalid distance too far back",Q.mode=16209;break t}if(m=0,C=f,0===u){if(m+=c-b,b<v){v-=b;do{B[i++]=f[m++]}while(--b);m=i-E,C=B}}else if(u<b){if(m+=c+u-b,b-=u,b<v){v-=b;do{B[i++]=f[m++]}while(--b);if(m=0,u<v){b=u,v-=b;do{B[i++]=f[m++]}while(--b);m=i-E,C=B}}}else if(m+=u-b,b<v){v-=b;do{B[i++]=f[m++]}while(--b);m=i-E,C=B}for(;v>2;)B[i++]=C[m++],B[i++]=C[m++],B[i++]=C[m++],v-=3;v&&(B[i++]=C[m++],v>1&&(B[i++]=C[m++]))}else{m=i-E;do{B[i++]=B[m++],B[i++]=B[m++],B[i++]=B[m++],v-=3}while(v>2);v&&(B[i++]=B[m++],v>1&&(B[i++]=B[m++]))}break}}break}}while(r<n&&i<a);v=l>>3,r-=v,l-=v<<3,h&=(1<<l)-1,t.next_in=r,t.next_out=i,t.avail_in=r<n?n-r+5:5-(r-n),t.avail_out=i<a?a-i+257:257-(i-a),Q.hold=h,Q.bits=l};const re=new Uint16Array([3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0]),ne=new Uint8Array([16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78]),ie=new Uint16Array([1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0]),oe=new Uint8Array([16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64]);var ae=(t,e,r,n,i,o,a,s)=>{const c=s.bits;let A,u,f,h,l,d,g=0,p=0,y=0,I=0,b=0,v=0,E=0,m=0,C=0,w=0,B=null;const Q=new Uint16Array(16),k=new Uint16Array(16);let S,_,D,x=null;for(g=0;g<=15;g++)Q[g]=0;for(p=0;p<n;p++)Q[e[r+p]]++;for(b=c,I=15;I>=1&&0===Q[I];I--);if(b>I&&(b=I),0===I)return i[o++]=20971520,i[o++]=20971520,s.bits=1,0;for(y=1;y<I&&0===Q[y];y++);for(b<y&&(b=y),m=1,g=1;g<=15;g++)if(m<<=1,m-=Q[g],m<0)return-1;if(m>0&&(0===t||1!==I))return-1;for(k[1]=0,g=1;g<15;g++)k[g+1]=k[g]+Q[g];for(p=0;p<n;p++)0!==e[r+p]&&(a[k[e[r+p]]++]=p);if(0===t?(B=x=a,d=20):1===t?(B=re,x=ne,d=257):(B=ie,x=oe,d=0),w=0,p=0,g=y,l=o,v=b,E=0,f=-1,C=1<<b,h=C-1,1===t&&C>852||2===t&&C>592)return 1;for(;;){S=g-E,a[p]+1<d?(_=0,D=a[p]):a[p]>=d?(_=x[a[p]-d],D=B[a[p]-d]):(_=96,D=0),A=1<<g-E,u=1<<v,y=u;do{u-=A,i[l+(w>>E)+u]=S<<24|_<<16|D|0}while(0!==u);for(A=1<<g-1;w&A;)A>>=1;if(0!==A?(w&=A-1,w+=A):w=0,p++,0==--Q[g]){if(g===I)break;g=e[r+a[p]]}if(g>b&&(w&h)!==f){for(0===E&&(E=b),l+=y,v=g-E,m=1<<v;v+E<I&&(m-=Q[v+E],!(m<=0));)v++,m<<=1;if(C+=1<<v,1===t&&C>852||2===t&&C>592)return 1;f=w&h,i[f]=b<<24|v<<16|l-o|0}}return 0!==w&&(i[l+w]=g-E<<24|64<<16|0),s.bits=b,0};const{Z_FINISH:se,Z_BLOCK:ce,Z_TREES:Ae,Z_OK:ue,Z_STREAM_END:fe,Z_NEED_DICT:he,Z_STREAM_ERROR:le,Z_DATA_ERROR:de,Z_MEM_ERROR:ge,Z_BUF_ERROR:pe,Z_DEFLATED:ye}=T,Ie=16209,be=t=>(t>>>24&255)+(t>>>8&65280)+((65280&t)<<8)+((255&t)<<24);function ve(){this.strm=null,this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new Uint16Array(320),this.work=new Uint16Array(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}const Ee=t=>{if(!t)return 1;const e=t.state;return!e||e.strm!==t||e.mode<16180||e.mode>16211?1:0},me=t=>{if(Ee(t))return le;const e=t.state;return t.total_in=t.total_out=e.total=0,t.msg="",e.wrap&&(t.adler=1&e.wrap),e.mode=16180,e.last=0,e.havedict=0,e.flags=-1,e.dmax=32768,e.head=null,e.hold=0,e.bits=0,e.lencode=e.lendyn=new Int32Array(852),e.distcode=e.distdyn=new Int32Array(592),e.sane=1,e.back=-1,ue},Ce=t=>{if(Ee(t))return le;const e=t.state;return e.wsize=0,e.whave=0,e.wnext=0,me(t)},we=(t,e)=>{let r;if(Ee(t))return le;const n=t.state;return e<0?(r=0,e=-e):(r=5+(e>>4),e<48&&(e&=15)),e&&(e<8||e>15)?le:(null!==n.window&&n.wbits!==e&&(n.window=null),n.wrap=r,n.wbits=e,Ce(t))},Be=(t,e)=>{if(!t)return le;const r=new ve;t.state=r,r.strm=t,r.window=null,r.mode=16180;const n=we(t,e);return n!==ue&&(t.state=null),n};let Qe,ke,Se=!0;const _e=t=>{if(Se){Qe=new Int32Array(512),ke=new Int32Array(32);let e=0;for(;e<144;)t.lens[e++]=8;for(;e<256;)t.lens[e++]=9;for(;e<280;)t.lens[e++]=7;for(;e<288;)t.lens[e++]=8;for(ae(1,t.lens,0,288,Qe,0,t.work,{bits:9}),e=0;e<32;)t.lens[e++]=5;ae(2,t.lens,0,32,ke,0,t.work,{bits:5}),Se=!1}t.lencode=Qe,t.lenbits=9,t.distcode=ke,t.distbits=5},De=(t,e,r,n)=>{let i;const o=t.state;return null===o.window&&(o.wsize=1<<o.wbits,o.wnext=0,o.whave=0,o.window=new Uint8Array(o.wsize)),n>=o.wsize?(o.window.set(e.subarray(r-o.wsize,r),0),o.wnext=0,o.whave=o.wsize):(i=o.wsize-o.wnext,i>n&&(i=n),o.window.set(e.subarray(r-n,r-n+i),o.wnext),(n-=i)?(o.window.set(e.subarray(r-n,r),0),o.wnext=n,o.whave=o.wsize):(o.wnext+=i,o.wnext===o.wsize&&(o.wnext=0),o.whave<o.wsize&&(o.whave+=i))),0};var xe={inflateReset:Ce,inflateReset2:we,inflateResetKeep:me,inflateInit:t=>Be(t,15),inflateInit2:Be,inflate:(t,e)=>{let r,n,i,o,a,s,c,A,u,f,h,l,d,g,p,y,I,b,v,E,m,C,w=0;const B=new Uint8Array(4);let Q,k;const S=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);if(Ee(t)||!t.output||!t.input&&0!==t.avail_in)return le;r=t.state,16191===r.mode&&(r.mode=16192),a=t.next_out,i=t.output,c=t.avail_out,o=t.next_in,n=t.input,s=t.avail_in,A=r.hold,u=r.bits,f=s,h=c,C=ue;t:for(;;)switch(r.mode){case 16180:if(0===r.wrap){r.mode=16192;break}for(;u<16;){if(0===s)break t;s--,A+=n[o++]<<u,u+=8}if(2&r.wrap&&35615===A){0===r.wbits&&(r.wbits=15),r.check=0,B[0]=255&A,B[1]=A>>>8&255,r.check=L(r.check,B,2,0),A=0,u=0,r.mode=16181;break}if(r.head&&(r.head.done=!1),!(1&r.wrap)||(((255&A)<<8)+(A>>8))%31){t.msg="incorrect header check",r.mode=Ie;break}if((15&A)!==ye){t.msg="unknown compression method",r.mode=Ie;break}if(A>>>=4,u-=4,m=8+(15&A),0===r.wbits&&(r.wbits=m),m>15||m>r.wbits){t.msg="invalid window size",r.mode=Ie;break}r.dmax=1<<r.wbits,r.flags=0,t.adler=r.check=1,r.mode=512&A?16189:16191,A=0,u=0;break;case 16181:for(;u<16;){if(0===s)break t;s--,A+=n[o++]<<u,u+=8}if(r.flags=A,(255&r.flags)!==ye){t.msg="unknown compression method",r.mode=Ie;break}if(57344&r.flags){t.msg="unknown header flags set",r.mode=Ie;break}r.head&&(r.head.text=A>>8&1),512&r.flags&&4&r.wrap&&(B[0]=255&A,B[1]=A>>>8&255,r.check=L(r.check,B,2,0)),A=0,u=0,r.mode=16182;case 16182:for(;u<32;){if(0===s)break t;s--,A+=n[o++]<<u,u+=8}r.head&&(r.head.time=A),512&r.flags&&4&r.wrap&&(B[0]=255&A,B[1]=A>>>8&255,B[2]=A>>>16&255,B[3]=A>>>24&255,r.check=L(r.check,B,4,0)),A=0,u=0,r.mode=16183;case 16183:for(;u<16;){if(0===s)break t;s--,A+=n[o++]<<u,u+=8}r.head&&(r.head.xflags=255&A,r.head.os=A>>8),512&r.flags&&4&r.wrap&&(B[0]=255&A,B[1]=A>>>8&255,r.check=L(r.check,B,2,0)),A=0,u=0,r.mode=16184;case 16184:if(1024&r.flags){for(;u<16;){if(0===s)break t;s--,A+=n[o++]<<u,u+=8}r.length=A,r.head&&(r.head.extra_len=A),512&r.flags&&4&r.wrap&&(B[0]=255&A,B[1]=A>>>8&255,r.check=L(r.check,B,2,0)),A=0,u=0}else r.head&&(r.head.extra=null);r.mode=16185;case 16185:if(1024&r.flags&&(l=r.length,l>s&&(l=s),l&&(r.head&&(m=r.head.extra_len-r.length,r.head.extra||(r.head.extra=new Uint8Array(r.head.extra_len)),r.head.extra.set(n.subarray(o,o+l),m)),512&r.flags&&4&r.wrap&&(r.check=L(r.check,n,l,o)),s-=l,o+=l,r.length-=l),r.length))break t;r.length=0,r.mode=16186;case 16186:if(2048&r.flags){if(0===s)break t;l=0;do{m=n[o+l++],r.head&&m&&r.length<65536&&(r.head.name+=String.fromCharCode(m))}while(m&&l<s);if(512&r.flags&&4&r.wrap&&(r.check=L(r.check,n,l,o)),s-=l,o+=l,m)break t}else r.head&&(r.head.name=null);r.length=0,r.mode=16187;case 16187:if(4096&r.flags){if(0===s)break t;l=0;do{m=n[o+l++],r.head&&m&&r.length<65536&&(r.head.comment+=String.fromCharCode(m))}while(m&&l<s);if(512&r.flags&&4&r.wrap&&(r.check=L(r.check,n,l,o)),s-=l,o+=l,m)break t}else r.head&&(r.head.comment=null);r.mode=16188;case 16188:if(512&r.flags){for(;u<16;){if(0===s)break t;s--,A+=n[o++]<<u,u+=8}if(4&r.wrap&&A!==(65535&r.check)){t.msg="header crc mismatch",r.mode=Ie;break}A=0,u=0}r.head&&(r.head.hcrc=r.flags>>9&1,r.head.done=!0),t.adler=r.check=0,r.mode=16191;break;case 16189:for(;u<32;){if(0===s)break t;s--,A+=n[o++]<<u,u+=8}t.adler=r.check=be(A),A=0,u=0,r.mode=16190;case 16190:if(0===r.havedict)return t.next_out=a,t.avail_out=c,t.next_in=o,t.avail_in=s,r.hold=A,r.bits=u,he;t.adler=r.check=1,r.mode=16191;case 16191:if(e===ce||e===Ae)break t;case 16192:if(r.last){A>>>=7&u,u-=7&u,r.mode=16206;break}for(;u<3;){if(0===s)break t;s--,A+=n[o++]<<u,u+=8}switch(r.last=1&A,A>>>=1,u-=1,3&A){case 0:r.mode=16193;break;case 1:if(_e(r),r.mode=16199,e===Ae){A>>>=2,u-=2;break t}break;case 2:r.mode=16196;break;case 3:t.msg="invalid block type",r.mode=Ie}A>>>=2,u-=2;break;case 16193:for(A>>>=7&u,u-=7&u;u<32;){if(0===s)break t;s--,A+=n[o++]<<u,u+=8}if((65535&A)!=(A>>>16^65535)){t.msg="invalid stored block lengths",r.mode=Ie;break}if(r.length=65535&A,A=0,u=0,r.mode=16194,e===Ae)break t;case 16194:r.mode=16195;case 16195:if(l=r.length,l){if(l>s&&(l=s),l>c&&(l=c),0===l)break t;i.set(n.subarray(o,o+l),a),s-=l,o+=l,c-=l,a+=l,r.length-=l;break}r.mode=16191;break;case 16196:for(;u<14;){if(0===s)break t;s--,A+=n[o++]<<u,u+=8}if(r.nlen=257+(31&A),A>>>=5,u-=5,r.ndist=1+(31&A),A>>>=5,u-=5,r.ncode=4+(15&A),A>>>=4,u-=4,r.nlen>286||r.ndist>30){t.msg="too many length or distance symbols",r.mode=Ie;break}r.have=0,r.mode=16197;case 16197:for(;r.have<r.ncode;){for(;u<3;){if(0===s)break t;s--,A+=n[o++]<<u,u+=8}r.lens[S[r.have++]]=7&A,A>>>=3,u-=3}for(;r.have<19;)r.lens[S[r.have++]]=0;if(r.lencode=r.lendyn,r.lenbits=7,Q={bits:r.lenbits},C=ae(0,r.lens,0,19,r.lencode,0,r.work,Q),r.lenbits=Q.bits,C){t.msg="invalid code lengths set",r.mode=Ie;break}r.have=0,r.mode=16198;case 16198:for(;r.have<r.nlen+r.ndist;){for(;w=r.lencode[A&(1<<r.lenbits)-1],p=w>>>24,y=w>>>16&255,I=65535&w,!(p<=u);){if(0===s)break t;s--,A+=n[o++]<<u,u+=8}if(I<16)A>>>=p,u-=p,r.lens[r.have++]=I;else{if(16===I){for(k=p+2;u<k;){if(0===s)break t;s--,A+=n[o++]<<u,u+=8}if(A>>>=p,u-=p,0===r.have){t.msg="invalid bit length repeat",r.mode=Ie;break}m=r.lens[r.have-1],l=3+(3&A),A>>>=2,u-=2}else if(17===I){for(k=p+3;u<k;){if(0===s)break t;s--,A+=n[o++]<<u,u+=8}A>>>=p,u-=p,m=0,l=3+(7&A),A>>>=3,u-=3}else{for(k=p+7;u<k;){if(0===s)break t;s--,A+=n[o++]<<u,u+=8}A>>>=p,u-=p,m=0,l=11+(127&A),A>>>=7,u-=7}if(r.have+l>r.nlen+r.ndist){t.msg="invalid bit length repeat",r.mode=Ie;break}for(;l--;)r.lens[r.have++]=m}}if(r.mode===Ie)break;if(0===r.lens[256]){t.msg="invalid code -- missing end-of-block",r.mode=Ie;break}if(r.lenbits=9,Q={bits:r.lenbits},C=ae(1,r.lens,0,r.nlen,r.lencode,0,r.work,Q),r.lenbits=Q.bits,C){t.msg="invalid literal/lengths set",r.mode=Ie;break}if(r.distbits=6,r.distcode=r.distdyn,Q={bits:r.distbits},C=ae(2,r.lens,r.nlen,r.ndist,r.distcode,0,r.work,Q),r.distbits=Q.bits,C){t.msg="invalid distances set",r.mode=Ie;break}if(r.mode=16199,e===Ae)break t;case 16199:r.mode=16200;case 16200:if(s>=6&&c>=258){t.next_out=a,t.avail_out=c,t.next_in=o,t.avail_in=s,r.hold=A,r.bits=u,ee(t,h),a=t.next_out,i=t.output,c=t.avail_out,o=t.next_in,n=t.input,s=t.avail_in,A=r.hold,u=r.bits,16191===r.mode&&(r.back=-1);break}for(r.back=0;w=r.lencode[A&(1<<r.lenbits)-1],p=w>>>24,y=w>>>16&255,I=65535&w,!(p<=u);){if(0===s)break t;s--,A+=n[o++]<<u,u+=8}if(y&&0==(240&y)){for(b=p,v=y,E=I;w=r.lencode[E+((A&(1<<b+v)-1)>>b)],p=w>>>24,y=w>>>16&255,I=65535&w,!(b+p<=u);){if(0===s)break t;s--,A+=n[o++]<<u,u+=8}A>>>=b,u-=b,r.back+=b}if(A>>>=p,u-=p,r.back+=p,r.length=I,0===y){r.mode=16205;break}if(32&y){r.back=-1,r.mode=16191;break}if(64&y){t.msg="invalid literal/length code",r.mode=Ie;break}r.extra=15&y,r.mode=16201;case 16201:if(r.extra){for(k=r.extra;u<k;){if(0===s)break t;s--,A+=n[o++]<<u,u+=8}r.length+=A&(1<<r.extra)-1,A>>>=r.extra,u-=r.extra,r.back+=r.extra}r.was=r.length,r.mode=16202;case 16202:for(;w=r.distcode[A&(1<<r.distbits)-1],p=w>>>24,y=w>>>16&255,I=65535&w,!(p<=u);){if(0===s)break t;s--,A+=n[o++]<<u,u+=8}if(0==(240&y)){for(b=p,v=y,E=I;w=r.distcode[E+((A&(1<<b+v)-1)>>b)],p=w>>>24,y=w>>>16&255,I=65535&w,!(b+p<=u);){if(0===s)break t;s--,A+=n[o++]<<u,u+=8}A>>>=b,u-=b,r.back+=b}if(A>>>=p,u-=p,r.back+=p,64&y){t.msg="invalid distance code",r.mode=Ie;break}r.offset=I,r.extra=15&y,r.mode=16203;case 16203:if(r.extra){for(k=r.extra;u<k;){if(0===s)break t;s--,A+=n[o++]<<u,u+=8}r.offset+=A&(1<<r.extra)-1,A>>>=r.extra,u-=r.extra,r.back+=r.extra}if(r.offset>r.dmax){t.msg="invalid distance too far back",r.mode=Ie;break}r.mode=16204;case 16204:if(0===c)break t;if(l=h-c,r.offset>l){if(l=r.offset-l,l>r.whave&&r.sane){t.msg="invalid distance too far back",r.mode=Ie;break}l>r.wnext?(l-=r.wnext,d=r.wsize-l):d=r.wnext-l,l>r.length&&(l=r.length),g=r.window}else g=i,d=a-r.offset,l=r.length;l>c&&(l=c),c-=l,r.length-=l;do{i[a++]=g[d++]}while(--l);0===r.length&&(r.mode=16200);break;case 16205:if(0===c)break t;i[a++]=r.length,c--,r.mode=16200;break;case 16206:if(r.wrap){for(;u<32;){if(0===s)break t;s--,A|=n[o++]<<u,u+=8}if(h-=c,t.total_out+=h,r.total+=h,4&r.wrap&&h&&(t.adler=r.check=r.flags?L(r.check,i,h,a-h):P(r.check,i,h,a-h)),h=c,4&r.wrap&&(r.flags?A:be(A))!==r.check){t.msg="incorrect data check",r.mode=Ie;break}A=0,u=0}r.mode=16207;case 16207:if(r.wrap&&r.flags){for(;u<32;){if(0===s)break t;s--,A+=n[o++]<<u,u+=8}if(4&r.wrap&&A!==(4294967295&r.total)){t.msg="incorrect length check",r.mode=Ie;break}A=0,u=0}r.mode=16208;case 16208:C=fe;break t;case Ie:C=de;break t;case 16210:return ge;case 16211:default:return le}return t.next_out=a,t.avail_out=c,t.next_in=o,t.avail_in=s,r.hold=A,r.bits=u,(r.wsize||h!==t.avail_out&&r.mode<Ie&&(r.mode<16206||e!==se))&&De(t,t.output,t.next_out,h-t.avail_out),f-=t.avail_in,h-=t.avail_out,t.total_in+=f,t.total_out+=h,r.total+=h,4&r.wrap&&h&&(t.adler=r.check=r.flags?L(r.check,i,h,t.next_out-h):P(r.check,i,h,t.next_out-h)),t.data_type=r.bits+(r.last?64:0)+(16191===r.mode?128:0)+(16199===r.mode||16194===r.mode?256:0),(0===f&&0===h||e===se)&&C===ue&&(C=pe),C},inflateEnd:t=>{if(Ee(t))return le;let e=t.state;return e.window&&(e.window=null),t.state=null,ue},inflateGetHeader:(t,e)=>{if(Ee(t))return le;const r=t.state;return 0==(2&r.wrap)?le:(r.head=e,e.done=!1,ue)},inflateSetDictionary:(t,e)=>{const r=e.length;let n,i,o;return Ee(t)?le:(n=t.state,0!==n.wrap&&16190!==n.mode?le:16190===n.mode&&(i=1,i=P(i,e,r,0),i!==n.check)?de:(o=De(t,e,r,r),o?(n.mode=16210,ge):(n.havedict=1,ue)))},inflateInfo:"pako inflate (from Nodeca project)"};var Me=function(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1};const Re=Object.prototype.toString,{Z_NO_FLUSH:Oe,Z_FINISH:Ne,Z_OK:Pe,Z_STREAM_END:je,Z_NEED_DICT:Le,Z_STREAM_ERROR:Fe,Z_DATA_ERROR:Te,Z_MEM_ERROR:Ue}=T;function Ge(t){this.options=Ot({chunkSize:65536,windowBits:15,to:""},t||{});const e=this.options;e.raw&&e.windowBits>=0&&e.windowBits<16&&(e.windowBits=-e.windowBits,0===e.windowBits&&(e.windowBits=-15)),!(e.windowBits>=0&&e.windowBits<16)||t&&t.windowBits||(e.windowBits+=32),e.windowBits>15&&e.windowBits<48&&0==(15&e.windowBits)&&(e.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new Ut,this.strm.avail_out=0;let r=xe.inflateInit2(this.strm,e.windowBits);if(r!==Pe)throw new Error(F[r]);if(this.header=new Me,xe.inflateGetHeader(this.strm,this.header),e.dictionary&&("string"==typeof e.dictionary?e.dictionary=Lt(e.dictionary):"[object ArrayBuffer]"===Re.call(e.dictionary)&&(e.dictionary=new Uint8Array(e.dictionary)),e.raw&&(r=xe.inflateSetDictionary(this.strm,e.dictionary),r!==Pe)))throw new Error(F[r])}function He(t,e){const r=new Ge(e);if(r.push(t),r.err)throw r.msg||F[r.err];return r.result}Ge.prototype.push=function(t,e){const r=this.strm,n=this.options.chunkSize,i=this.options.dictionary;let o,a,s;if(this.ended)return!1;for(a=e===~~e?e:!0===e?Ne:Oe,"[object ArrayBuffer]"===Re.call(t)?r.input=new Uint8Array(t):r.input=t,r.next_in=0,r.avail_in=r.input.length;;){for(0===r.avail_out&&(r.output=new Uint8Array(n),r.next_out=0,r.avail_out=n),o=xe.inflate(r,a),o===Le&&i&&(o=xe.inflateSetDictionary(r,i),o===Pe?o=xe.inflate(r,a):o===Te&&(o=Le));r.avail_in>0&&o===je&&r.state.wrap>0&&0!==t[r.next_in];)xe.inflateReset(r),o=xe.inflate(r,a);switch(o){case Fe:case Te:case Le:case Ue:return this.onEnd(o),this.ended=!0,!1}if(s=r.avail_out,r.next_out&&(0===r.avail_out||o===je))if("string"===this.options.to){let t=Tt(r.output,r.next_out),e=r.next_out-t,i=Ft(r.output,t);r.next_out=e,r.avail_out=n-e,e&&r.output.set(r.output.subarray(t,t+e),0),this.onData(i)}else this.onData(r.output.length===r.next_out?r.output:r.output.subarray(0,r.next_out));if(o!==Pe||0!==s){if(o===je)return o=xe.inflateEnd(this.strm),this.onEnd(o),this.ended=!0,!0;if(0===r.avail_in)break}}return!0},Ge.prototype.onData=function(t){this.chunks.push(t)},Ge.prototype.onEnd=function(t){t===Pe&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=Nt(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg};var Ye={Inflate:Ge,inflate:He,inflateRaw:function(t,e){return(e=e||{}).raw=!0,He(t,e)},ungzip:He,constants:T};const{Deflate:Ke,deflate:qe,deflateRaw:Je,gzip:ze}=te,{Inflate:Ze,inflate:Ve,inflateRaw:We,ungzip:Xe}=Ye;var $e=Ke,tr=qe,er=Je,rr=ze,nr=Ze,ir=Ve,or=We,ar=Xe,sr=T,cr={Deflate:Ke,deflate:qe,deflateRaw:Je,gzip:ze,Inflate:Ze,inflate:Ve,inflateRaw:We,ungzip:Xe,constants:T}},function(t,e){},function(t,e,r){"use strict";e.sha1=r(192),e.sha224=r(193),e.sha256=r(94),e.sha384=r(194),e.sha512=r(95)},function(t,e,r){"use strict";var n=r(15),i=r(30),o=r(93),a=n.rotl32,s=n.sum32,c=n.sum32_5,A=o.ft_1,u=i.BlockHash,f=[1518500249,1859775393,2400959708,3395469782];function h(){if(!(this instanceof h))return new h;u.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=new Array(80)}n.inherits(h,u),t.exports=h,h.blockSize=512,h.outSize=160,h.hmacStrength=80,h.padLength=64,h.prototype._update=function(t,e){for(var r=this.W,n=0;n<16;n++)r[n]=t[e+n];for(;n<r.length;n++)r[n]=a(r[n-3]^r[n-8]^r[n-14]^r[n-16],1);var i=this.h[0],o=this.h[1],u=this.h[2],h=this.h[3],l=this.h[4];for(n=0;n<r.length;n++){var d=~~(n/20),g=c(a(i,5),A(d,o,u,h),l,r[n],f[d]);l=h,h=u,u=a(o,30),o=i,i=g}this.h[0]=s(this.h[0],i),this.h[1]=s(this.h[1],o),this.h[2]=s(this.h[2],u),this.h[3]=s(this.h[3],h),this.h[4]=s(this.h[4],l)},h.prototype._digest=function(t){return"hex"===t?n.toHex32(this.h,"big"):n.split32(this.h,"big")}},function(t,e,r){"use strict";var n=r(15),i=r(94);function o(){if(!(this instanceof o))return new o;i.call(this),this.h=[3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428]}n.inherits(o,i),t.exports=o,o.blockSize=512,o.outSize=224,o.hmacStrength=192,o.padLength=64,o.prototype._digest=function(t){return"hex"===t?n.toHex32(this.h.slice(0,7),"big"):n.split32(this.h.slice(0,7),"big")}},function(t,e,r){"use strict";var n=r(15),i=r(95);function o(){if(!(this instanceof o))return new o;i.call(this),this.h=[3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428]}n.inherits(o,i),t.exports=o,o.blockSize=1024,o.outSize=384,o.hmacStrength=192,o.padLength=128,o.prototype._digest=function(t){return"hex"===t?n.toHex32(this.h.slice(0,12),"big"):n.split32(this.h.slice(0,12),"big")}},function(t,e,r){"use strict";var n=r(15),i=r(30),o=n.rotl32,a=n.sum32,s=n.sum32_3,c=n.sum32_4,A=i.BlockHash;function u(){if(!(this instanceof u))return new u;A.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.endian="little"}function f(t,e,r,n){return t<=15?e^r^n:t<=31?e&r|~e&n:t<=47?(e|~r)^n:t<=63?e&n|r&~n:e^(r|~n)}function h(t){return t<=15?0:t<=31?1518500249:t<=47?1859775393:t<=63?2400959708:2840853838}function l(t){return t<=15?1352829926:t<=31?1548603684:t<=47?1836072691:t<=63?2053994217:0}n.inherits(u,A),e.ripemd160=u,u.blockSize=512,u.outSize=160,u.hmacStrength=192,u.padLength=64,u.prototype._update=function(t,e){for(var r=this.h[0],n=this.h[1],i=this.h[2],A=this.h[3],u=this.h[4],I=r,b=n,v=i,E=A,m=u,C=0;C<80;C++){var w=a(o(c(r,f(C,n,i,A),t[d[C]+e],h(C)),p[C]),u);r=u,u=A,A=o(i,10),i=n,n=w,w=a(o(c(I,f(79-C,b,v,E),t[g[C]+e],l(C)),y[C]),m),I=m,m=E,E=o(v,10),v=b,b=w}w=s(this.h[1],i,E),this.h[1]=s(this.h[2],A,m),this.h[2]=s(this.h[3],u,I),this.h[3]=s(this.h[4],r,b),this.h[4]=s(this.h[0],n,v),this.h[0]=w},u.prototype._digest=function(t){return"hex"===t?n.toHex32(this.h,"little"):n.split32(this.h,"little")};var d=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13],g=[5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11],p=[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6],y=[8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11]},function(t,e,r){"use strict";var n=r(15),i=r(11);function o(t,e,r){if(!(this instanceof o))return new o(t,e,r);this.Hash=t,this.blockSize=t.blockSize/8,this.outSize=t.outSize/8,this.inner=null,this.outer=null,this._init(n.toArray(e,r))}t.exports=o,o.prototype._init=function(t){t.length>this.blockSize&&(t=(new this.Hash).update(t).digest()),i(t.length<=this.blockSize);for(var e=t.length;e<this.blockSize;e++)t.push(0);for(e=0;e<t.length;e++)t[e]^=54;for(this.inner=(new this.Hash).update(t),e=0;e<t.length;e++)t[e]^=106;this.outer=(new this.Hash).update(t)},o.prototype.update=function(t,e){return this.inner.update(t,e),this},o.prototype.digest=function(t){return this.outer.update(this.inner.digest()),this.outer.digest(t)}},function(t,e,r){(function(t,e){!function(t,r){"use strict";if(!t.setImmediate){var n,i,o,a,s,c=1,A={},u=!1,f=t.document,h=Object.getPrototypeOf&&Object.getPrototypeOf(t);h=h&&h.setTimeout?h:t,"[object process]"==={}.toString.call(t.process)?n=function(t){e.nextTick((function(){d(t)}))}:!function(){if(t.postMessage&&!t.importScripts){var e=!0,r=t.onmessage;return t.onmessage=function(){e=!1},t.postMessage("","*"),t.onmessage=r,e}}()?t.MessageChannel?((o=new MessageChannel).port1.onmessage=function(t){d(t.data)},n=function(t){o.port2.postMessage(t)}):f&&"onreadystatechange"in f.createElement("script")?(i=f.documentElement,n=function(t){var e=f.createElement("script");e.onreadystatechange=function(){d(t),e.onreadystatechange=null,i.removeChild(e),e=null},i.appendChild(e)}):n=function(t){setTimeout(d,0,t)}:(a="setImmediate$"+Math.random()+"$",s=function(e){e.source===t&&"string"==typeof e.data&&0===e.data.indexOf(a)&&d(+e.data.slice(a.length))},t.addEventListener?t.addEventListener("message",s,!1):t.attachEvent("onmessage",s),n=function(e){t.postMessage(a+e,"*")}),h.setImmediate=function(t){"function"!=typeof t&&(t=new Function(""+t));for(var e=new Array(arguments.length-1),r=0;r<e.length;r++)e[r]=arguments[r+1];var i={callback:t,args:e};return A[c]=i,n(c),c++},h.clearImmediate=l}function l(t){delete A[t]}function d(t){if(u)setTimeout(d,0,t);else{var e=A[t];if(e){u=!0;try{!function(t){var e=t.callback,r=t.args;switch(r.length){case 0:e();break;case 1:e(r[0]);break;case 2:e(r[0],r[1]);break;case 3:e(r[0],r[1],r[2]);break;default:e.apply(void 0,r)}}(e)}finally{l(t),u=!1}}}}}("undefined"==typeof self?void 0===t?this:t:self)}).call(this,r(8),r(9))},function(t,e,r){var n=r(85),i=r(29),o=r(37),a=r(20),s=r(21);function c(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function A(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?c(Object(r),!0).forEach((function(e){o(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):c(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}var u=r(97),f=r(199),h=r(200),l=r(100),d=l.ValidateLibrary,g=l.ValidateObject,p=l.ValidateVersion,y=l.ValidatePartHash,I=l.ValidateWriteToken,b=l.ValidateParameters,v=r(201);e.permissionLevels={owner:{short:"Owner Only",description:"Only the owner has access to the object and ability to change permissions",settings:{visibility:0,statusCode:-1,kmsConk:!1}},editable:{short:"Editable",description:"Members of the editors group have full access to the object and the ability to change permissions",settings:{visibility:0,statusCode:-1,kmsConk:!0}},viewable:{short:"Viewable",description:"In addition to editors, members of the 'accessor' group can have read-only access to the object including playing video and retrieving metadata, images and documents",settings:{visibility:0,statusCode:0,kmsConk:!0}},listable:{short:"Publicly Listable",description:"Anyone can list the public portion of this object but only accounts with specific rights can access",settings:{visibility:1,statusCode:0,kmsConk:!0}},public:{short:"Public",description:"Anyone can access this object",settings:{visibility:10,statusCode:0,kmsConk:!0}}},e.Visibility=function(){var t=s(a.mark((function t(e){var r,n,i,o=this;return a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=e.id,n=e.clearCache,t.prev=1,i=this.utils.HashToAddress(r),n&&delete this.visibilityInfo[i],this.visibilityInfo[i]||(this.visibilityInfo[i]=new Promise(function(){var t=s(a.mark((function t(e,n){return a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,o.authClient.ContractHasMethod({contractAddress:i,methodName:"visibility"});case 3:if(t.sent){t.next=7;break}return e(0),t.abrupt("return");case 7:return t.t0=e,t.next=10,o.CallContractMethod({contractAddress:o.utils.HashToAddress(r),methodName:"visibility"});case 10:t.t1=t.sent,(0,t.t0)(t.t1),t.next=17;break;case 14:t.prev=14,t.t2=t.catch(0),n(t.t2);case 17:case"end":return t.stop()}}),t,null,[[0,14]])})));return function(e,r){return t.apply(this,arguments)}}())),t.prev=5,t.next=8,this.visibilityInfo[i];case 8:return t.abrupt("return",t.sent);case 11:throw t.prev=11,t.t0=t.catch(5),delete this.visibilityInfo[i],t.t0;case 15:t.next=22;break;case 17:if(t.prev=17,t.t1=t.catch(1),"CALL_EXCEPTION"!==t.t1.code){t.next=21;break}return t.abrupt("return",0);case 21:throw t.t1;case 22:case"end":return t.stop()}}),t,this,[[1,17],[5,11]])})));return function(e){return t.apply(this,arguments)}}(),e.Permission=function(){var t=s(a.mark((function t(e){var r,n,i,o,s,c,A,u,f=this;return a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=e.objectId,n=e.clearCache,g(r),t.next=4,this.AccessType({id:r});case 4:if(t.t0=t.sent,t.t1=this.authClient.ACCESS_TYPES.OBJECT,t.t0===t.t1){t.next=8;break}throw Error("Permission only valid for normal content objects: "+r);case 8:return t.next=10,this.Visibility({id:r,clearCache:n});case 10:return i=t.sent,t.next=13,this.CallContractMethod({contractAddress:this.utils.HashToAddress(r),methodName:"addressKMS"});case 13:if(o=t.sent,s=o&&"ikms".concat(this.utils.AddressToHash(o)),c=!1,!s){t.next=27;break}return t.t2=this,t.next=20,this.ContentObjectLibraryId({objectId:r});case 20:return t.t3=t.sent,t.t4=r,t.t5="eluv.caps.".concat(s),t.t6={libraryId:t.t3,objectId:t.t4,metadataSubtree:t.t5},t.next=26,t.t2.ContentObjectMetadata.call(t.t2,t.t6);case 26:c=!!t.sent;case 27:return t.next=29,this.CallContractMethod({contractAddress:this.utils.HashToAddress(r),methodName:"statusCode"});case 29:return A=t.sent,A=parseInt(A._hex,16),(u=Object.keys(this.permissionLevels).filter((function(t){var e=f.permissionLevels[t].settings;return i>=e.visibility&&A>=e.statusCode&&c===e.kmsConk})))||(u=c?["editable"]:["owner"]),t.abrupt("return",u.slice(-1)[0]);case 34:case"end":return t.stop()}}),t,this)})));return function(e){return t.apply(this,arguments)}}(),e.DefaultKMSAddress=s(a.mark((function t(){var e,r,n,i=arguments;return a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e=i.length>0&&void 0!==i[0]?i[0]:{},r=e.tenantId,t.t0=r,!t.t0){t.next=8;break}return t.next=5,this.AccessType({id:r});case 5:t.t1=t.sent,t.t2=this.authClient.ACCESS_TYPES.TENANT,t.t0=t.t1===t.t2;case 8:if(!t.t0){t.next=14;break}return t.next=11,this.CallContractMethod({contractAddress:this.utils.HashToAddress(r),methodName:"addressKMS"});case 11:if(!(n=t.sent)){t.next=14;break}return t.abrupt("return",n);case 14:return t.next=16,this.CallContractMethod({contractAddress:this.contentSpaceAddress,methodName:"addressKMS"});case 16:return t.abrupt("return",t.sent);case 17:case"end":return t.stop()}}),t,this)}))),e.ContentSpaceId=function(){return this.contentSpaceId},e.ContentTypeOwner=function(){var t=s(a.mark((function t(e){var r,n,i,o;return a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=e.name,n=e.typeId,i=e.versionHash,t.next=3,this.ContentType({name:r,typeId:n,versionHash:i});case 3:return o=t.sent,t.t0=this.utils,t.next=7,this.ethClient.CallContractMethod({contractAddress:this.utils.HashToAddress(o.id),methodName:"owner",methodArgs:[]});case 7:return t.t1=t.sent,t.abrupt("return",t.t0.FormatAddress.call(t.t0,t.t1));case 9:case"end":return t.stop()}}),t,this)})));return function(e){return t.apply(this,arguments)}}(),e.ContentType=function(){var t=s(a.mark((function t(e){var r,n,i,o,s,c,A;return a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=e.name,n=e.typeId,i=e.versionHash,o=e.publicOnly,s=void 0!==o&&o,this.Log("Retrieving content type: ".concat(r||n||i)),i&&(n=this.utils.DecodeVersionHash(i).objectId),!r){t.next=13;break}return this.Log("Looking up type by name in content space metadata..."),t.prev=5,t.next=8,this.ContentObjectMetadata({libraryId:this.contentSpaceLibraryId,objectId:this.contentSpaceObjectId,metadataSubtree:u("public","contentTypes",r)});case 8:n=t.sent,t.next=13;break;case 11:t.prev=11,t.t0=t.catch(5);case 13:if(n){t.next=23;break}return this.Log("Looking up type by name in available types..."),t.next=17,this.ContentTypes();case 17:if(c=t.sent,!r){t.next=22;break}return t.abrupt("return",Object.values(c).find((function(t){return(t.name||"").toLowerCase()===r.toLowerCase()})));case 22:return t.abrupt("return",Object.values(c).find((function(t){return t.hash===i})));case 23:if(i){t.next=27;break}return t.next=26,this.LatestVersionHash({objectId:n});case 26:i=t.sent;case 27:if(t.prev=27,this.Log("Looking up type by ID..."),!s){t.next=39;break}return t.next=32,this.ContentObjectMetadata({libraryId:this.contentSpaceLibraryId,objectId:n,versionHash:i,metadataSubtree:"public"});case 32:if(t.t1=t.sent,t.t1){t.next=35;break}t.t1={};case 35:t.t2=t.t1,A={public:t.t2},t.next=45;break;case 39:return t.next=41,this.ContentObjectMetadata({libraryId:this.contentSpaceLibraryId,objectId:n,versionHash:i});case 41:if(t.t3=t.sent,t.t3){t.next=44;break}t.t3={};case 44:A=t.t3;case 45:return t.abrupt("return",{id:n,hash:i,name:A.public&&A.public.name||A.name||n,meta:A});case 48:throw t.prev=48,t.t4=t.catch(27),this.Log("Error looking up content type:"),this.Log(t.t4),new Error("Content Type ".concat(r||n," is invalid"));case 53:case"end":return t.stop()}}),t,this,[[5,11],[27,48]])})));return function(e){return t.apply(this,arguments)}}(),e.ContentTypes=s(a.mark((function t(){var e,r,n,i=this;return a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this.contentTypes=this.contentTypes||{},this.Log("Looking up all available content types"),t.next=4,this.Collection({collectionType:"contentTypes"});case 4:return e=t.sent,this.Log("Personally available types:"),this.Log(e),r={},t.prev=8,t.next=11,this.ContentObjectMetadata({libraryId:this.contentSpaceLibraryId,objectId:this.contentSpaceObjectId,metadataSubtree:"public/contentTypes"});case 11:if(t.t0=t.sent,t.t0){t.next=14;break}t.t0={};case 14:r=t.t0,t.next=19;break;case 17:t.prev=17,t.t1=t.catch(8);case 19:return n=Object.values(r).map((function(t){return i.utils.HashToAddress(t)})),this.Log("Content space types:"),this.Log(n),e=e.concat(n).filter((function(t){return t})).map((function(t){return i.utils.FormatAddress(t)})).filter((function(t,e,r){return r.indexOf(t)===e})),t.next=25,Promise.all(e.map(function(){var t=s(a.mark((function t(e){var r;return a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=i.utils.AddressToObjectId(e),i.contentTypes[r]){t.next=11;break}return t.prev=2,t.next=5,i.ContentType({typeId:r,publicOnly:!0});case 5:i.contentTypes[r]=t.sent,t.next=11;break;case 8:t.prev=8,t.t0=t.catch(2),console.error(t.t0);case 11:case"end":return t.stop()}}),t,null,[[2,8]])})));return function(e){return t.apply(this,arguments)}}()));case 25:return t.abrupt("return",this.contentTypes);case 26:case"end":return t.stop()}}),t,this,[[8,17]])}))),e.ContentLibraries=s(a.mark((function t(){var e,r=this;return a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.Collection({collectionType:"libraries"});case 2:return e=t.sent,t.abrupt("return",e.map((function(t){return r.utils.AddressToLibraryId(t)})));case 4:case"end":return t.stop()}}),t,this)}))),e.ContentLibrary=function(){var t=s(a.mark((function t(e){var r,n,i;return a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=e.libraryId,d(r),n=u("qlibs",r),t.t0=this.utils,t.t1=this.HttpClient,t.next=7,this.authClient.AuthorizationHeader({libraryId:r});case 7:return t.t2=t.sent,t.t3=n,t.t4={headers:t.t2,method:"GET",path:t.t3},t.t5=t.t1.Request.call(t.t1,t.t4),t.next=13,t.t0.ResponseToJson.call(t.t0,t.t5);case 13:return i=t.sent,t.abrupt("return",A(A({},i),{},{meta:i.meta||{}}));case 15:case"end":return t.stop()}}),t,this)})));return function(e){return t.apply(this,arguments)}}(),e.ContentLibraryOwner=function(){var t=s(a.mark((function t(e){var r;return a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=e.libraryId,d(r),t.t0=this.utils,t.next=5,this.ethClient.CallContractMethod({contractAddress:this.utils.HashToAddress(r),methodName:"owner",methodArgs:[]});case 5:return t.t1=t.sent,t.abrupt("return",t.t0.FormatAddress.call(t.t0,t.t1));case 7:case"end":return t.stop()}}),t,this)})));return function(e){return t.apply(this,arguments)}}(),e.LibraryContentTypes=function(){var t=s(a.mark((function t(e){var r,n,i,o=this;return a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=e.libraryId,d(r),this.Log("Retrieving library content types for ".concat(r)),t.next=5,this.ethClient.CallContractMethod({contractAddress:this.utils.HashToAddress(r),methodName:"contentTypesLength",methodArgs:[]});case 5:if(n=t.sent.toNumber(),this.Log("".concat(n," types")),0!==n){t.next=9;break}return t.abrupt("return",{});case 9:return i={},t.next=12,Promise.all(Array.from(new Array(n),function(){var t=s(a.mark((function t(e,n){var s,c;return a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,o.ethClient.CallContractMethod({contractAddress:o.utils.HashToAddress(r),methodName:"contentTypes",methodArgs:[n]});case 2:return s=t.sent,c=o.utils.AddressToObjectId(s),t.next=6,o.ContentType({typeId:c});case 6:i[c]=t.sent;case 7:case"end":return t.stop()}}),t)})));return function(e,r){return t.apply(this,arguments)}}()));case 12:return this.Log(i),t.abrupt("return",i);case 14:case"end":return t.stop()}}),t,this)})));return function(e){return t.apply(this,arguments)}}(),e.ContentObjects=function(){var t=s(a.mark((function t(e){var r,n,i,o,s,c,A;return a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=e.libraryId,n=e.filterOptions,i=void 0===n?{}:n,d(r),this.Log("Retrieving content objects from ".concat(r)),o=u("qlibs",r,"q"),s={filter:[]},i.cacheId&&(s.cache_id=i.cacheId),i.start&&(s.start=i.start),i.limit&&(s.limit=i.limit),i.select&&(s.select=i.select),i.sort&&(s.sort_by=i.sort,i.sortDesc&&(s.sort_descending=!0)),c={eq:":eq:",neq:":ne:",lt:":lt:",lte:":le:",gt:":gt:",gte:":ge:",cnt:":co:",ncnt:":nc:"},A=function(t){var e=t.key,r=t.type,n=t.filter;s.filter.push("".concat(e).concat(c[r]).concat(n))},i.filter&&(Array.isArray(i.filter)?i.filter.forEach((function(t){return A(t)})):A(i.filter)),this.Log("Filter options:"),this.Log(i),t.t0=this.utils,t.t1=this.HttpClient,t.next=19,this.authClient.AuthorizationHeader({libraryId:r});case 19:return t.t2=t.sent,t.t3=o,t.t4=s,t.t5={headers:t.t2,method:"GET",path:t.t3,queryParams:t.t4},t.t6=t.t1.Request.call(t.t1,t.t5),t.next=26,t.t0.ResponseToJson.call(t.t0,t.t6);case 26:return t.abrupt("return",t.sent);case 27:case"end":return t.stop()}}),t,this)})));return function(e){return t.apply(this,arguments)}}(),e.ContentObject=function(){var t=s(a.mark((function t(e){var r,n,i,o,s;return a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=e.libraryId,n=e.objectId,i=e.versionHash,o=e.writeToken,b({libraryId:r,objectId:n,versionHash:i}),this.Log("Retrieving content object: ".concat(r||""," ").concat(o||i||n)),i&&(n=this.utils.DecodeVersionHash(i).objectId),s=u("q",o||i||n),t.t0=this.utils,t.t1=this.HttpClient,t.next=9,this.authClient.AuthorizationHeader({libraryId:r,objectId:n,versionHash:i});case 9:return t.t2=t.sent,t.t3=s,t.t4={headers:t.t2,method:"GET",path:t.t3},t.t5=t.t1.Request.call(t.t1,t.t4),t.next=15,t.t0.ResponseToJson.call(t.t0,t.t5);case 15:return t.abrupt("return",t.sent);case 16:case"end":return t.stop()}}),t,this)})));return function(e){return t.apply(this,arguments)}}(),e.ContentObjectOwner=function(){var t=s(a.mark((function t(e){var r;return a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=e.objectId,g(r),this.Log("Retrieving content object owner: ".concat(r)),t.t0=this.utils,t.next=6,this.ethClient.CallContractMethod({contractAddress:this.utils.HashToAddress(r),methodName:"owner",methodArgs:[]});case 6:return t.t1=t.sent,t.abrupt("return",t.t0.FormatAddress.call(t.t0,t.t1));case 8:case"end":return t.stop()}}),t,this)})));return function(e){return t.apply(this,arguments)}}(),e.ContentObjectTenantId=function(){var t=s(a.mark((function t(e){var r,n;return a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=e.objectId,(n=e.versionHash)?p(n):g(r),n&&(r=this.utils.DecodeVersionHash(n).objectId),this.objectTenantIds[r]){t.next=7;break}return t.next=6,this.authClient.MakeElvMasterCall({methodName:"elv_getTenantById",params:[this.contentSpaceId,r]});case 6:this.objectTenantIds[r]=t.sent;case 7:return t.abrupt("return",this.objectTenantIds[r]);case 8:case"end":return t.stop()}}),t,this)})));return function(e){return t.apply(this,arguments)}}(),e.ContentObjectLibraryId=function(){var t=s(a.mark((function t(e){var r,n,i=this;return a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=e.objectId,(n=e.versionHash)?p(n):g(r),n&&(r=this.utils.DecodeVersionHash(n).objectId),t.next=5,this.authClient.AccessType(r);case 5:t.t0=t.sent,t.next=t.t0===this.authClient.ACCESS_TYPES.LIBRARY?8:t.t0===this.authClient.ACCESS_TYPES.OBJECT?9:t.t0===this.authClient.ACCESS_TYPES.OTHER?20:21;break;case 8:return t.abrupt("return",this.utils.AddressToLibraryId(this.utils.HashToAddress(r)));case 9:return this.objectLibraryIds[r]||(this.Log("Retrieving content object library ID: ".concat(r||n)),this.objectLibraryIds[r]=new Promise(function(){var t=s(a.mark((function t(e,n){return a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.t0=e,t.t1=i.utils,t.next=5,i.CallContractMethod({contractAddress:i.utils.HashToAddress(r),methodName:"libraryAddress"});case 5:t.t2=t.sent,t.t3=t.t1.AddressToLibraryId.call(t.t1,t.t2),(0,t.t0)(t.t3),t.next=13;break;case 10:t.prev=10,t.t4=t.catch(0),n(t.t4);case 13:case"end":return t.stop()}}),t,null,[[0,10]])})));return function(e,r){return t.apply(this,arguments)}}())),t.prev=10,t.next=13,this.objectLibraryIds[r];case 13:return t.abrupt("return",t.sent);case 16:throw t.prev=16,t.t1=t.catch(10),delete this.objectLibraryIds[r],t.t1;case 20:throw Error("Unable to retrieve library ID for ".concat(n||r,": Unknown type. (wrong network or deleted object?)"));case 21:return t.abrupt("return",this.contentSpaceLibraryId);case 22:case"end":return t.stop()}}),t,this,[[10,16]])})));return function(e){return t.apply(this,arguments)}}(),e.ProduceMetadataLinks=function(){var t=s(a.mark((function t(e){var r,n,o,c,f,h,l,d,g,p=this;return a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=e.libraryId,n=e.objectId,o=e.versionHash,c=e.path,f=void 0===c?"/":c,h=e.metadata,l=e.authorizationToken,d=e.noAuth,h&&"object"===i(h)){t.next=3;break}return t.abrupt("return",h);case 3:if(!Array.isArray(h)){t.next=7;break}return t.next=6,this.utils.LimitedMap(5,h,function(){var t=s(a.mark((function t(e,i){return a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,p.ProduceMetadataLinks({libraryId:r,objectId:n,versionHash:o,path:u(f,i.toString()),metadata:e,authorizationToken:l,noAuth:d});case 2:return t.abrupt("return",t.sent);case 3:case"end":return t.stop()}}),t)})));return function(e,r){return t.apply(this,arguments)}}());case 6:return t.abrupt("return",t.sent);case 7:if(!h["/"]||!h["/"].match(/\.\/(rep|files)\/.+/)&&!h["/"].match(/^\/?qfab\/([\w]+)\/?(rep|files)\/.+/)){t.next=16;break}return t.t0=A,t.t1=A({},h),t.t2={},t.next=13,this.LinkUrl({libraryId:r,objectId:n,versionHash:o,linkPath:f,authorizationToken:l,noAuth:d});case 13:return t.t3=t.sent,t.t4={url:t.t3},t.abrupt("return",(0,t.t0)(t.t1,t.t2,t.t4));case 16:return g={},t.next=19,this.utils.LimitedMap(5,Object.keys(h),function(){var t=s(a.mark((function t(e){return a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,p.ProduceMetadataLinks({libraryId:r,objectId:n,versionHash:o,path:u(f,e),metadata:h[e],authorizationToken:l,noAuth:d});case 2:g[e]=t.sent;case 3:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}());case 19:return t.abrupt("return",g);case 20:case"end":return t.stop()}}),t,this)})));return function(e){return t.apply(this,arguments)}}(),e.MetadataAuth=function(){var t=s(a.mark((function t(e){var r,n,i,o,s,c,A,u,f,h,l,d,g;return a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=e.libraryId,n=e.objectId,i=e.versionHash,o=e.path,s=void 0===o?"/":o,c=e.channelAuth,A=void 0!==c&&c,u=e.noAuth,f=void 0!==u&&u,b({libraryId:r,objectId:n,versionHash:i}),i&&(n=this.utils.DecodeVersionHash(i).objectId),f=this.noAuth||f||this.staticToken,h=f,f){t.next=14;break}return t.next=8,this.Visibility({id:n});case 8:return d=t.sent,t.next=11,this.AccessType({id:n});case 11:l=t.sent,h=(s||"").replace(/^\/+/,"").startsWith("public"),f=d>=10||h&&d>=1;case 14:if(!this.oauthToken){t.next=22;break}return t.next=17,this.authClient.KMSAddress({objectId:n,versionHash:i});case 17:if(!(g=t.sent)||this.utils.EqualAddress(g,this.utils.nullAddress)){t.next=22;break}return t.next=21,this.authClient.AuthorizationToken({libraryId:r,objectId:n,versionHash:i,channelAuth:!0,oauthToken:this.oauthToken});case 21:return t.abrupt("return",t.sent);case 22:if(this.inaccessibleLibraries[r]||!h||l!==this.authClient.ACCESS_TYPES.OBJECT||A){t.next=48;break}if(t.prev=23,t.t0=this.authClient,t.t1=r,t.t1){t.next=30;break}return t.next=29,this.ContentObjectLibraryId({objectId:n,versionHash:i});case 29:t.t1=t.sent;case 30:return t.t2=t.t1,t.t3=f,t.t4={libraryId:t.t2,noAuth:t.t3},t.next=35,t.t0.AuthorizationToken.call(t.t0,t.t4);case 35:return t.abrupt("return",t.sent);case 38:if(t.prev=38,t.t5=t.catch(23),!t.t5.message||!t.t5.message.toLowerCase().startsWith("access denied")){t.next=45;break}return this.inaccessibleLibraries[r]=!0,t.next=44,this.authClient.AuthorizationToken({libraryId:r,objectId:n,versionHash:i,noAuth:f,channelAuth:A});case 44:return t.abrupt("return",t.sent);case 45:throw t.t5;case 46:t.next=51;break;case 48:return t.next=50,this.authClient.AuthorizationToken({libraryId:r,objectId:n,versionHash:i,noAuth:f,channelAuth:A});case 50:return t.abrupt("return",t.sent);case 51:case"end":return t.stop()}}),t,this,[[23,38]])})));return function(e){return t.apply(this,arguments)}}(),e.ContentObjectMetadata=function(){var t=s(a.mark((function t(e){var r,n,i,o,s,c,h,l,d,g,p,y,I,E,m,C,w,B,Q,k,S,_,D,x,M,R,O,N,P,j,L,F=arguments;return a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=e.libraryId,n=e.objectId,i=e.versionHash,o=e.writeToken,s=e.metadataSubtree,c=void 0===s?"/":s,h=e.localizationSubtree,l=e.queryParams,d=void 0===l?{}:l,g=e.select,p=void 0===g?[]:g,y=e.remove,I=void 0===y?[]:y,E=e.authorizationToken,m=e.noAuth,C=void 0!==m&&m,w=e.resolveLinks,B=void 0!==w&&w,Q=e.resolveIncludeSource,k=void 0!==Q&&Q,S=e.resolveIgnoreErrors,_=void 0!==S&&S,D=e.linkDepthLimit,x=void 0===D?1:D,M=e.produceLinkUrls,R=void 0!==M&&M,b({libraryId:r,objectId:n,versionHash:i}),this.Log("Retrieving content object metadata: ".concat(r||""," ").concat(n||i," ").concat(o||"","\n Subtree: ").concat(c)),d=A({},d||{}),i&&(n=this.utils.DecodeVersionHash(i).objectId),O=u("q",o||i||n,"meta",c),i){t.next=12;break}if(r){t.next=11;break}return t.next=10,this.ContentObjectLibraryId({objectId:n});case 10:r=t.sent;case 11:O=u("qlibs",r,O);case 12:return t.next=14,this.MetadataAuth({libraryId:r,objectId:n,versionHash:i,path:c,noAuth:C});case 14:return N=t.sent,P=[E,d.authorization,N].flat().filter((function(t){return t})),delete d.authorization,t.prev=17,t.next=20,this.utils.ResponseToJson(this.HttpClient.Request({headers:{Authorization:P.map((function(t){return"Bearer ".concat(t)}))},queryParams:A(A({},d),{},{select:p,remove:I,link_depth:x,resolve:B,resolve_include_source:k,resolve_ignore_errors:_}),method:"GET",path:O}));case 20:j=t.sent,t.next=33;break;case 23:if(t.prev=23,t.t0=t.catch(17),404===t.t0.status){t.next=27;break}throw t.t0;case 27:if(!f.get(t.t0.body,"errors[0].cause.cause.cause.qwtoken")){t.next=32;break}throw t.t0;case 32:j="/"===c?{}:void 0;case 33:if(!R){t.next=37;break}return t.next=36,this.ProduceMetadataLinks({libraryId:r,objectId:n,versionHash:i,path:c,metadata:j,authorizationToken:E,noAuth:C});case 36:j=t.sent;case 37:if(h){t.next=39;break}return t.abrupt("return",j);case 39:return t.prev=39,t.next=42,this.ContentObjectMetadata(A(A({},F[0]),{},{metadataSubtree:h,localizationSubtree:void 0}));case 42:return L=t.sent,t.abrupt("return",v({},j,L,(function(t,e){return null===e||""===e?t:void 0})));case 46:return t.prev=46,t.t1=t.catch(39),this.Log(t.t1,!0),t.abrupt("return",j);case 50:case"end":return t.stop()}}),t,this,[[17,23],[39,46]])})));return function(e){return t.apply(this,arguments)}}(),e.AssetMetadata=function(){var t=s(a.mark((function t(e){var r,i,o,s,c,f,h,l,d,g=this;return a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=e.libraryId,i=e.objectId,o=e.versionHash,s=e.metadata,c=e.localization,f=e.noAuth,h=e.produceLinkUrls,l=void 0!==h&&h,b({libraryId:r,objectId:i,versionHash:o}),i||(i=this.utils.DecodeVersionHash(o).objectId),s){t.next=12;break}return t.next=6,this.ContentObjectMetadata({libraryId:r,objectId:i,versionHash:o,metadataSubtree:"public/asset_metadata",resolveLinks:!0,linkDepthLimit:2,resolveIgnoreErrors:!0,produceLinkUrls:l,noAuth:f});case 6:if(t.t0=t.sent,t.t0){t.next=9;break}t.t0={};case 9:s=t.t0,t.next=16;break;case 12:if(!l){t.next=16;break}return t.next=15,this.ProduceMetadataLinks({libraryId:r,objectId:i,versionHash:o,path:u("public","asset_metadata"),metadata:s,noAuth:f});case 15:s=t.sent;case 16:return s.info||(s.info={}),d=A({},s),c&&c.reverse().forEach((function(t){var e,r=(e=g.utils).SafeTraverse.apply(e,[s].concat(n(t)))||{};d=v({},d,r,(function(t,e){return null===e||""===e?t:void 0}))})),t.abrupt("return",d);case 20:case"end":return t.stop()}}),t,this)})));return function(e){return t.apply(this,arguments)}}(),e.ContentObjectVersions=function(){var t=s(a.mark((function t(e){var r,n,i;return a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=e.libraryId,n=e.objectId,b({libraryId:r,objectId:n}),this.Log("Retrieving content object versions: ".concat(r||""," ").concat(n)),i=u("qid",n),t.t0=this.utils,t.t1=this.HttpClient,t.next=8,this.authClient.AuthorizationHeader({libraryId:r,objectId:n});case 8:return t.t2=t.sent,t.t3=i,t.t4={headers:t.t2,method:"GET",path:t.t3},t.t5=t.t1.Request.call(t.t1,t.t4),t.abrupt("return",t.t0.ResponseToJson.call(t.t0,t.t5));case 13:case"end":return t.stop()}}),t,this)})));return function(e){return t.apply(this,arguments)}}(),e.LatestVersionHash=function(){var t=s(a.mark((function t(e){var r,n,i,o;return a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=e.objectId,(n=e.versionHash)&&(r=this.utils.DecodeVersionHash(n).objectId),g(r),t.prev=3,t.next=6,this.CallContractMethod({contractAddress:this.utils.HashToAddress(r),methodName:"objectHash"});case 6:i=t.sent,t.next=11;break;case 9:t.prev=9,t.t0=t.catch(3);case 11:if(i){t.next=20;break}return t.next=14,this.CallContractMethod({contractAddress:this.utils.HashToAddress(r),methodName:"countVersionHashes"});case 14:if((o=t.sent).toNumber()){t.next=17;break}throw Error("Unable to determine latest version hash for ".concat(n||r," - Item deleted?"));case 17:return t.next=19,this.CallContractMethod({contractAddress:this.utils.HashToAddress(r),methodName:"versionHashes",methodArgs:[o-1]});case 19:i=t.sent;case 20:return t.abrupt("return",i);case 21:case"end":return t.stop()}}),t,this,[[3,9]])})));return function(e){return t.apply(this,arguments)}}(),e.AvailableDRMs=s(a.mark((function t(){var e,r,n,i,o,s,c,A,u;return a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e=["clear","aes-128"],"undefined"!=typeof window){t.next=3;break}return t.abrupt("return",e);case 3:if(window.navigator&&window.navigator.userAgent&&((r=window.navigator.userAgent.match(/(iPad|iPhone|iphone|iPod).*?(OS |os |OS_)(\d+((_|\.)\d)?((_|\.)\d)?)/))&&r[3]&&(n=r[3].split("_"),i=parseInt(n[0]),o=parseInt(n[1]),(i>13||13===i&&o>=1)&&(e[1]="sample-aes",e[2]="fairplay")),/^((?!chrome|android).)*safari/i.test(window.navigator.userAgent)&&(s=window.navigator.userAgent.match(/.+Version\/(\d+)\.(\d+)/))&&s[2]&&(c=parseInt(s[1]),A=parseInt(s[2]),(c>13||13===c&&A>=1)&&(e[1]="sample-aes",e[2]="fairplay"))),"undefined"==typeof window||"function"==typeof window.navigator.requestMediaKeySystemAccess){t.next=6;break}return t.abrupt("return",e);case 6:return t.prev=6,u=[{initDataTypes:["cenc"],audioCapabilities:[{contentType:'audio/mp4;codecs="mp4a.40.2"'}],videoCapabilities:[{contentType:'video/mp4;codecs="avc1.42E01E"'}]}],t.next=10,navigator.requestMediaKeySystemAccess("com.widevine.alpha",u);case 10:e.push("widevine"),t.next=15;break;case 13:t.prev=13,t.t0=t.catch(6);case 15:return t.abrupt("return",e);case 16:case"end":return t.stop()}}),t,null,[[6,13]])}))),e.PlayoutPathResolution=function(){var t=s(a.mark((function t(e){var r,n,i,o,s,c,A,f,h,l,d,g,p,y,I,b,v;return a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=e.libraryId,n=e.objectId,i=e.versionHash,o=e.writeToken,s=e.linkPath,c=e.handler,A=e.offering,f=void 0===A?"":A,h=e.signedLink,l=void 0!==h&&h,d=e.authorizationToken,r){t.next=5;break}return t.next=4,this.ContentObjectLibraryId({objectId:n});case 4:r=t.sent;case 5:if(i){t.next=9;break}return t.next=8,this.LatestVersionHash({objectId:n});case 8:i=t.sent;case 9:if(g=u("qlibs",r,"q",o||i,"rep",c,f,"options.json"),!s){t.next=26;break}return t.next=13,this.ContentObjectMetadata({libraryId:r,objectId:n,versionHash:i,writeToken:o,metadataSubtree:s,resolveLinks:!1,resolveIgnoreErrors:!0,resolveIncludeSource:!0,authorizationToken:d});case 13:if(v=t.sent,b=!!v&&!!v["/"]&&!v["/"].endsWith("options.json"),g=u("qlibs",r,"q",o||i,"meta",s),l){t.next=25;break}return t.next=19,this.LinkTarget({libraryId:r,objectId:n,versionHash:i,writeToken:o,linkPath:s,linkInfo:v,authorizationToken:d});case 19:return I=t.sent,y=this.utils.DecodeVersionHash(I).objectId,t.next=23,this.ContentObjectLibraryId({objectId:y});case 23:p=t.sent,b||f||(g=u("q",I,"rep",c,"options.json"));case 25:b&&(g=u(g,f,"options.json"));case 26:return t.abrupt("return",{path:g,multiOfferingLink:b,linkTarget:{libraryId:p,objectId:y,versionHash:I}});case 27:case"end":return t.stop()}}),t,this)})));return function(e){return t.apply(this,arguments)}}(),e.AvailableOfferings=function(){var t=s(a.mark((function t(e){var r,n,i,o,s,c,A,u,f,h,l,d;return a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=e.objectId,n=e.versionHash,i=e.writeToken,o=e.linkPath,s=e.signedLink,c=e.directLink,A=e.handler,u=void 0===A?"playout":A,f=e.authorizationToken,r||(r=this.utils.DecodeVersionHash(n).objectId),!c){t.next=15;break}return t.t0=this,t.next=6,this.ContentObjectLibraryId({objectId:r});case 6:return t.t1=t.sent,t.t2=r,t.t3=n,t.t4=o,t.t5=f,t.t6={libraryId:t.t1,objectId:t.t2,versionHash:t.t3,metadataSubtree:t.t4,resolveLinks:!0,authorizationToken:t.t5},t.next=14,t.t0.ContentObjectMetadata.call(t.t0,t.t6);case 14:return t.abrupt("return",t.sent);case 15:return t.next=17,this.PlayoutPathResolution({objectId:r,versionHash:n,writeToken:i,linkPath:o,signedLink:s,handler:u,authorizationToken:f});case 17:return h=t.sent,l=h.path,t.prev=19,t.t7=f,t.next=23,this.authClient.AuthorizationToken({objectId:r,channelAuth:!0,oauthToken:this.oauthToken});case 23:return t.t8=t.sent,d=[t.t7,t.t8].flat().filter((function(t){return t})),t.next=27,this.utils.ResponseToJson(this.HttpClient.Request({path:l,method:"GET",headers:{Authorization:"Bearer ".concat(d.join(","))}}));case 27:return t.abrupt("return",t.sent);case 30:if(t.prev=30,t.t9=t.catch(19),!t.t9.status||500!==parseInt(t.t9.status)){t.next=34;break}return t.abrupt("return",{});case 34:throw t.t9;case 35:case"end":return t.stop()}}),t,this,[[19,30]])})));return function(e){return t.apply(this,arguments)}}(),e.PlayoutOptions=function(){var t=s(a.mark((function t(e){var r,n,i,c,f,h,l,d,y,I,b,v,E,m,C,w,B,Q,k,S,_,D,x,M,R,O,N,P,j,L,F,T,U,G,H,Y,K,q,J,z,Z,V,W,X,$,tt,et=this;return a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=e.offeringURI,n=e.objectId,i=e.versionHash,c=e.writeToken,f=e.linkPath,h=e.signedLink,l=void 0!==h&&h,d=e.protocols,y=void 0===d?["dash","hls"]:d,I=e.handler,b=void 0===I?"playout":I,v=e.offering,E=void 0===v?"default":v,m=e.playoutType,C=e.drms,w=void 0===C?[]:C,B=e.context,Q=e.hlsjsProfile,k=void 0===Q||Q,S=e.authorizationToken,_=e.options,D=void 0===_?{}:_,!r){t.next=8;break}if(x=r.match(/(hq__[^/]+)\/rep\/([^/]+)\/([^/]+)\/options.json/),i=x[1],b=x[2],E=x[3],i&&b&&E){t.next=8;break}throw Error("Invalid offering URI: ".concat(r));case 8:if(i?p(i):g(n),y=y.map((function(t){return t.toLowerCase()})),w=w.map((function(t){return t.toLowerCase()})),n){t.next=15;break}n=this.utils.DecodeVersionHash(i).objectId,t.next=19;break;case 15:if(i){t.next=19;break}return t.next=18,this.LatestVersionHash({objectId:n});case 18:i=t.sent;case 19:return t.next=21,this.ContentObjectLibraryId({objectId:n});case 21:if(M=t.sent,t.prev=22,f){t.next=29;break}return R=u("public","asset_metadata","sources",E),t.next=27,this.ContentObjectMetadata({libraryId:M,objectId:n,versionHash:i,metadataSubtree:R,authorizationToken:S});case 27:t.sent&&(f=R);case 29:t.next=33;break;case 31:t.prev=31,t.t0=t.catch(22);case 33:return t.next=35,this.PlayoutPathResolution({libraryId:M,objectId:n,versionHash:i,writeToken:c,linkPath:f,signedLink:l,handler:b,offering:E,authorizationToken:S});case 35:if(O=t.sent,N=O.path,P=O.linkTarget,t.t1=this.authClient,t.t2=P.objectId||n,t.t3=P.versionHash||i,t.t3){t.next=45;break}return t.next=44,this.LatestVersionHash({objectId:n});case 44:t.t3=t.sent;case 45:return t.t4=t.t3,t.t5=y,t.t6=w,t.t7=B,t.t8={objectId:t.t2,versionHash:t.t4,protocols:t.t5,drms:t.t6,context:t.t7},j=t.t1.AudienceData.call(t.t1,t.t8),t.t9=S,t.next=54,this.authClient.AuthorizationToken({libraryId:M,objectId:n,channelAuth:!0,oauthToken:this.oauthToken,audienceData:j});case 54:return t.t10=t.sent,L=[t.t9,t.t10].flat().filter((function(t){return t})),F=A({authorization:L,resolve:!!f},D),t.t11=Object,t.next=60,this.utils.ResponseToJson(this.HttpClient.Request({path:N,method:"GET",queryParams:F}));case 60:if(t.t12=t.sent,T=t.t11.values.call(t.t11,t.t12),l||!P.versionHash){t.next=68;break}return t.t13=S,t.next=66,this.authClient.AuthorizationToken({libraryId:P.libraryId,objectId:P.objectId,channelAuth:!0,oauthToken:this.oauthToken,audienceData:j});case 66:t.t14=t.sent,F.authorization=[t.t13,t.t14].flat().filter((function(t){return t}));case 68:U={},Y=0;case 70:if(!(Y<T.length)){t.next=116;break}if(K=T[Y],q=K.properties.protocol,J=K.properties.drm,G=G||K.sid,H=H||!!K.properties.multiview,G&&(F.sid=G),z=K.uri.split("?")[0],m&&(z=z.replace("playlist","playlist-".concat(m))),Z=K.properties.license_servers,V=K.properties.cert,k&&"hls"===q&&"aes-128"===J&&(F.player_profile="hls-js"),t.t15=A,t.t16=A({},U[q]||{}),t.t17={},t.t18=A,t.t19=A({},(U[q]||{}).playoutMethods||{}),t.t20={},t.t21=o,t.t22={},t.t23=J||"clear",!l){t.next=97;break}return t.next=94,this.LinkUrl({versionHash:i,linkPath:u(f,E,z),queryParams:F,noAuth:!0});case 94:t.t24=t.sent,t.next=100;break;case 97:return t.next=99,this.Rep({libraryId:P.libraryId||M,objectId:P.objectId||n,versionHash:P.versionHash||i,rep:u(b,E,z),noAuth:!0,queryParams:F});case 99:t.t24=t.sent;case 100:for(W in t.t25=t.t24,t.t26=J?o({},J,{licenseServers:Z,cert:V}):void 0,t.t27={playoutUrl:t.t25,drms:t.t26},t.t28=(0,t.t21)(t.t22,t.t23,t.t27),t.t29=(0,t.t18)(t.t19,t.t20,t.t28),t.t30={playoutMethods:t.t29},U[q]=(0,t.t15)(t.t16,t.t17,t.t30),U[q].playoutMethods)U[q].playoutMethods[W].drms&&U[q].playoutMethods[W].drms[J]&&U[q].playoutMethods[W].drms[J].cert&&((X=new URL(U[q].playoutMethods[W].playoutUrl)).pathname=X.pathname.split("/").slice(0,-1).concat(["drm.cert"]).join("/"),U[q].playoutMethods[W].drms[J].cert_url=X.toString());if($=y.includes(q),tt=w.includes(J||"clear")||0===w.length&&!J,$&&tt){t.next=112;break}return t.abrupt("continue",113);case 112:(!U[q].playoutUrl||J&&"clear"!==J)&&(U[q].playoutUrl=U[q].playoutMethods[J||"clear"].playoutUrl,U[q].drms=U[q].playoutMethods[J||"clear"].drms);case 113:Y++,t.next=70;break;case 116:return H&&G&&(U.sessionId=G,U.multiview=!0,U.AvailableViews=s(a.mark((function t(){return a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.t0=et.utils,t.next=3,et.HttpClient.Request({path:u("q",P.versionHash||i,"rep",b,E,"views.json"),method:"GET",queryParams:{sid:G,authorization:L}});case 3:return t.t1=t.sent,t.next=6,t.t0.ResponseToFormat.call(t.t0,"json",t.t1);case 6:return t.abrupt("return",t.sent);case 7:case"end":return t.stop()}}),t)}))),U.SwitchView=function(){var t=s(a.mark((function t(e){return a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,et.HttpClient.Request({path:u("q",P.versionHash||i,"rep",b,E,"select_view"),method:"POST",queryParams:{sid:G,authorization:L},body:{view:e}});case 2:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()),this.Log(U),t.abrupt("return",U);case 119:case"end":return t.stop()}}),t,this,[[22,31]])})));return function(e){return t.apply(this,arguments)}}(),e.BitmovinPlayoutOptions=function(){var t=s(a.mark((function t(e){var r,n,i,o,s,c,A,u,f,h,l,d,y,I,b,v,E,m,C,w,B,Q,k,S;return a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=e.objectId,n=e.versionHash,i=e.writeToken,o=e.linkPath,s=e.signedLink,c=void 0!==s&&s,A=e.protocols,u=void 0===A?["dash","hls"]:A,f=e.drms,h=void 0===f?[]:f,l=e.handler,d=void 0===l?"playout":l,y=e.offering,I=void 0===y?"default":y,b=e.playoutType,v=e.context,E=e.authorizationToken,m=e.options,C=void 0===m?{}:m,n?p(n):g(r),r||(r=this.utils.DecodeVersionHash(n).objectId),t.next=5,this.PlayoutOptions({objectId:r,versionHash:n,writeToken:i,linkPath:o,signedLink:c,protocols:u,drms:h,handler:d,offering:I,playoutType:b,hlsjsProfile:!1,context:v,authorizationToken:E,options:C});case 5:return delete(w=t.sent).playoutMethods,t.next=9,this.PlayoutPathResolution({objectId:r,versionHash:n,writeToken:i,linkPath:o,signedLink:c,handler:d,offering:I,authorizationToken:E});case 9:if(B=t.sent,Q=B.linkTarget,k=[],E&&k.push(E),!c&&Q.versionHash){t.next=21;break}return t.t0=k,t.next=17,this.authClient.AuthorizationToken({objectId:r,channelAuth:!0,oauthToken:this.oauthToken});case 17:t.t1=t.sent,t.t0.push.call(t.t0,t.t1),t.next=26;break;case 21:return t.t2=k,t.next=24,this.authClient.AuthorizationToken({libraryId:Q.libraryId,objectId:Q.objectId,channelAuth:!0,oauthToken:this.oauthToken});case 24:t.t3=t.sent,t.t2.push.call(t.t2,t.t3);case 26:return S={drm:{}},Object.keys(w).forEach((function(t){var e=w[t];S[t]=e.playoutUrl,e.drms&&Object.keys(e.drms).forEach((function(t){if(e.drms[t].licenseServers&&0!==e.drms[t].licenseServers.length){var r=function(t){return t.toLowerCase().startsWith("https")},n=e.drms[t].licenseServers;n.find(r)&&(n=n.filter(r));var i=n.sort((function(){return.5-Math.random()}))[0];S.drm[t]||(S.drm[t]={LA_URL:i,headers:{Authorization:"Bearer ".concat(k.flat().filter((function(t){return t})).join(","))}})}}))})),t.abrupt("return",S);case 29:case"end":return t.stop()}}),t,this)})));return function(e){return t.apply(this,arguments)}}(),e.CallBitcodeMethod=function(){var t=s(a.mark((function t(e){var r,n,i,o,s,c,A,f,h,l,d,g,p,y,I,v;return a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=e.libraryId,n=e.objectId,i=e.versionHash,o=e.writeToken,s=e.method,c=e.queryParams,A=void 0===c?{}:c,f=e.body,h=void 0===f?{}:f,l=e.headers,d=void 0===l?{}:l,g=e.constant,p=void 0===g||g,y=e.format,I=void 0===y?"json":y,b({libraryId:r,objectId:n,versionHash:i}),s){t.next=4;break}throw"Bitcode method not specified";case 4:if(i&&(n=this.utils.DecodeVersionHash(i).objectId),v=u("q",o||i||n,"call",s),r&&(v=u("qlibs",r,v)),d.authorization||d.Authorization){t.next=12;break}return t.next=11,this.authClient.AuthorizationHeader({libraryId:r,objectId:n,update:!p});case 11:d.Authorization=t.sent.Authorization;case 12:return this.Log("Calling bitcode method: ".concat(r||""," ").concat(n||i," ").concat(o||"","\n ").concat(p?"GET":"POST"," ").concat(v,"\n Query Params:\n ").concat(JSON.stringify(A||""),"\n Body:\n ").concat(JSON.stringify(h||""),"\n Headers\n ").concat(JSON.stringify(d||""))),t.t0=this.utils,t.t1=I,t.next=17,this.HttpClient.Request({body:h,headers:d,method:p?"GET":"POST",path:v,queryParams:A,allowFailover:!1});case 17:return t.t2=t.sent,t.abrupt("return",t.t0.ResponseToFormat.call(t.t0,t.t1,t.t2));case 19:case"end":return t.stop()}}),t,this)})));return function(e){return t.apply(this,arguments)}}(),e.Rep=function(){var t=s(a.mark((function t(e){var r,n,i,o,s,c,A,u,f,h,l,d;return a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=e.libraryId,n=e.objectId,i=e.versionHash,o=e.rep,s=e.queryParams,c=void 0===s?{}:s,A=e.channelAuth,u=void 0!==A&&A,f=e.noAuth,h=void 0!==f&&f,l=e.noCache,d=void 0!==l&&l,b({libraryId:r,objectId:n,versionHash:i}),o){t.next=4;break}throw"Rep not specified";case 4:return t.abrupt("return",this.FabricUrl({libraryId:r,objectId:n,versionHash:i,rep:o,queryParams:c,channelAuth:u,noAuth:h,noCache:d}));case 5:case"end":return t.stop()}}),t,this)})));return function(e){return t.apply(this,arguments)}}(),e.PublicRep=function(){var t=s(a.mark((function t(e){var r,n,i,o,s,c;return a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=e.libraryId,n=e.objectId,i=e.versionHash,o=e.rep,s=e.queryParams,c=void 0===s?{}:s,b({libraryId:r,objectId:n,versionHash:i}),o){t.next=4;break}throw"Rep not specified";case 4:return t.abrupt("return",this.FabricUrl({libraryId:r,objectId:n,versionHash:i,publicRep:o,queryParams:c,noAuth:!0}));case 5:case"end":return t.stop()}}),t,this)})));return function(e){return t.apply(this,arguments)}}(),e.FabricUrl=function(){var t=s(a.mark((function t(e){var r,n,i,o,s,c,f,h,l,d,g,p,y,I,v,E,m,C;return a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=e.libraryId,n=e.objectId,i=e.versionHash,o=e.writeToken,s=e.partHash,c=e.rep,f=e.publicRep,h=e.call,l=e.queryParams,d=void 0===l?{}:l,g=e.channelAuth,p=void 0!==g&&g,y=e.noAuth,I=void 0!==y&&y,v=e.noCache,E=void 0!==v&&v,(n||i)&&b({libraryId:r,objectId:n,versionHash:i}),i&&(n=this.utils.DecodeVersionHash(i).objectId),this.Log("Building Fabric URL:\n libraryId: ".concat(r,"\n objectId: ").concat(n,"\n versionHash: ").concat(i,"\n writeToken: ").concat(o,"\n partHash: ").concat(s,"\n rep: ").concat(c,"\n publicRep: ").concat(f,"\n call: ").concat(h,"\n channelAuth: ").concat(p,"\n noAuth: ").concat(I,"\n noCache: ").concat(E,"\n queryParams: ").concat(JSON.stringify(d||{},null,2))),m=[],d.authorization&&m.push(d.authorization),I&&d.authorization){t.next=12;break}return t.t0=m,t.next=10,this.authClient.AuthorizationToken({libraryId:r,objectId:n,versionHash:i,channelAuth:p,noAuth:I,noCache:E});case 10:t.t1=t.sent,t.t0.push.call(t.t0,t.t1);case 12:if(d=A(A({},d),{},{authorization:m.flat()}),!c&&!f||!n||i){t.next=17;break}return t.next=16,this.LatestVersionHash({objectId:n});case 16:i=t.sent;case 17:return C="",r?(C=u(C,"qlibs",r),(n||i)&&(C=u(C,"q",o||i||n))):i&&(C=u("q",i)),s?C=u(C,"data",s):c?C=u(C,"rep",c):f?C=u(C,"public",f):h&&(C=u(C,"call",h)),t.abrupt("return",this.HttpClient.URL({path:C,queryParams:d}));case 21:case"end":return t.stop()}}),t,this)})));return function(e){return t.apply(this,arguments)}}(),e.FileUrl=function(){var t=s(a.mark((function t(e){var r,n,i,o,s,c,f,h,l,d,g,p;return a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=e.libraryId,n=e.objectId,i=e.versionHash,o=e.writeToken,s=e.filePath,c=e.queryParams,f=void 0===c?{}:c,h=e.noCache,l=void 0!==h&&h,b({libraryId:r,objectId:n,versionHash:i}),s){t.next=4;break}throw"File path not specified";case 4:return i&&(n=this.utils.DecodeVersionHash(i).objectId),d=r?u("qlibs",r,"q",o||i||n):u("q",i),t.next=8,this.authClient.AuthorizationToken({libraryId:r,objectId:n,noCache:l});case 8:return g=t.sent,f=A(A({},f),{},{authorization:g}),t.next=12,this.ContentObjectMetadata({libraryId:r,objectId:n,versionHash:i,writeToken:o,metadataSubtree:u("files",s)});case 12:return p=t.sent,p&&p["."].encryption&&"cgck"===p["."].encryption.scheme?(d=u(d,"rep","files_download",s),f["header-x_decryption_mode"]="decrypt"):d=u(d,"files",s),t.abrupt("return",this.HttpClient.URL({path:d,queryParams:f}));case 16:case"end":return t.stop()}}),t,this)})));return function(e){return t.apply(this,arguments)}}(),e.ContentObjectImageUrl=function(){var t=s(a.mark((function t(e){var r,n,i,o,s,c,A;return a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=e.libraryId,n=e.objectId,i=e.versionHash,o=e.height,s=e.imagePath,c=void 0===s?"public/display_image":s,b({libraryId:r,objectId:n,versionHash:i}),i){t.next=6;break}return t.next=5,this.LatestVersionHash({objectId:n});case 5:i=t.sent;case 6:if(this.Log("Retrieving content object image url: ".concat(r," ").concat(n," ").concat(i)),this.objectImageUrls[i]){t.next=26;break}return t.prev=8,t.next=11,this.ContentObjectMetadata({versionHash:i,metadataSubtree:c});case 11:if(t.sent){t.next=15;break}return this.Log("No image url set: ".concat(r," ").concat(n," ").concat(i)),t.abrupt("return");case 15:t.next=21;break;case 17:t.prev=17,t.t0=t.catch(8),this.Log("Unable to query for image metadata: ".concat(r," ").concat(n," ").concat(i),!0),this.Log(t.t0,!0);case 21:return A={},o&&!isNaN(parseInt(o))&&(A.height=parseInt(o)),t.next=25,this.LinkUrl({versionHash:i,linkPath:c,queryParams:A});case 25:this.objectImageUrls[i]=t.sent;case 26:return t.abrupt("return",this.objectImageUrls[i]);case 27:case"end":return t.stop()}}),t,this,[[8,17]])})));return function(e){return t.apply(this,arguments)}}(),e.ContentObjectGraph=function(){var t=s(a.mark((function t(e){var r,n,i,o,c,A,f,h,l,d,g=this;return a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=e.libraryId,n=e.objectId,i=e.versionHash,o=e.autoUpdate,c=void 0!==o&&o,A=e.select,b({libraryId:r,objectId:n,versionHash:i}),this.Log("Retrieving content object graph: ".concat(r||""," ").concat(n||i)),i&&(n=this.utils.DecodeVersionHash(i).objectId),f=u("q",i||n,"links"),t.prev=5,t.t0=this.utils,t.t1=this.HttpClient,t.next=10,this.authClient.AuthorizationHeader({libraryId:r,objectId:n,versionHash:i});case 10:return t.t2=t.sent,t.t3={auto_update:c,select:A},t.t4=f,t.t5={headers:t.t2,queryParams:t.t3,method:"GET",path:t.t4},t.t6=t.t1.Request.call(t.t1,t.t5),t.next=17,t.t0.ResponseToJson.call(t.t0,t.t6);case 17:return t.abrupt("return",t.sent);case 20:if(t.prev=20,t.t7=t.catch(5),t.prev=22,(l=t.t7.body.errors[0].cause.cause.cause.cycle)&&0!==l.length){t.next=26;break}throw t.t7;case 26:return d={},t.next=29,Promise.all(l.map(function(){var t=s(a.mark((function t(e){var r,n;return a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!d[e]){t.next=2;break}return t.abrupt("return");case 2:return r=g.utils.DecodeVersionHash(e).objectId,t.next=5,g.ContentObjectMetadata({versionHash:e,metadataSubtree:"public/asset_metadata/display_title"});case 5:if(t.t2=t.sent,t.t2){t.next=10;break}return t.next=9,g.ContentObjectMetadata({versionHash:e,metadataSubtree:"public/name"});case 9:t.t2=t.sent;case 10:if(t.t1=t.t2,t.t1){t.next=15;break}return t.next=14,g.ContentObjectMetadata({versionHash:e,metadataSubtree:"name"});case 14:t.t1=t.sent;case 15:if(t.t0=t.t1,t.t0){t.next=18;break}t.t0=r;case 18:n=t.t0,d[e]={name:n,objectId:r};case 20:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()));case 29:h=l.map((function(t){return"".concat(d[t].name," (").concat(d[t].objectId,")")})),t.next=35;break;case 32:throw t.prev=32,t.t8=t.catch(22),t.t7;case 35:throw new Error("Cycle found in links: ".concat(h.join(" -> ")));case 36:case"end":return t.stop()}}),t,this,[[5,20],[22,32]])})));return function(e){return t.apply(this,arguments)}}(),e.LinkTarget=function(){var t=s(a.mark((function t(e){var r,n,o,s,c,A,u,f,h;return a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=e.libraryId,n=e.objectId,o=e.versionHash,s=e.writeToken,c=e.linkPath,A=e.authorizationToken,u=e.linkInfo,b({libraryId:r,objectId:n,versionHash:o}),s&&I(s),o&&(n=this.utils.DecodeVersionHash(o).objectId),!s||r){t.next=8;break}return t.next=7,this.ContentObjectLibraryId({objectId:n});case 7:r=t.sent;case 8:if(u){t.next=12;break}return t.next=11,this.ContentObjectMetadata({libraryId:r,objectId:n,versionHash:o,writeToken:s,metadataSubtree:c,resolveLinks:!1,resolveIgnoreErrors:!0,resolveIncludeSource:!0,authorizationToken:A});case 11:u=t.sent;case 12:if(!u||!u["/"]){t.next=27;break}if((f=((u["/"]||"").match(/^\/?qfab\/([\w]+)\/?.+/)||[])[1])||(f=u["."].container),!f){t.next=19;break}return t.abrupt("return",f);case 19:if(!o){t.next=21;break}return t.abrupt("return",o);case 21:if(t.t0=o,t.t0){t.next=26;break}return t.next=25,this.LatestVersionHash({objectId:n});case 25:t.t0=t.sent;case 26:return t.abrupt("return",t.t0);case 27:return t.next=29,this.ContentObjectMetadata({libraryId:r,objectId:n,versionHash:o,writeToken:s,metadataSubtree:c,resolveIncludeSource:!0,authorizationToken:A});case 29:if((u=t.sent)&&u["."]){t.next=49;break}if("object"!==i(u)){t.next=38;break}if(t.t1=o,t.t1){t.next=37;break}return t.next=36,this.LatestVersionHash({objectId:n});case 36:t.t1=t.sent;case 37:return t.abrupt("return",t.t1);case 38:if(h=c.split("/").slice(0,-1).join("/")){t.next=46;break}if(t.t2=o,t.t2){t.next=45;break}return t.next=44,this.LatestVersionHash({objectId:n});case 44:t.t2=t.sent;case 45:return t.abrupt("return",t.t2);case 46:return t.next=48,this.ContentObjectMetadata({libraryId:r,objectId:n,versionHash:o,writeToken:s,metadataSubtree:h,resolveIncludeSource:!0,authorizationToken:A});case 48:u=t.sent;case 49:return t.abrupt("return",u["."].source);case 50:case"end":return t.stop()}}),t,this)})));return function(e){return t.apply(this,arguments)}}(),e.LinkUrl=function(){var t=s(a.mark((function t(e){var r,n,i,o,s,c,f,h,l,d,g,p,y,v,E;return a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=e.libraryId,n=e.objectId,i=e.versionHash,o=e.writeToken,s=e.linkPath,c=e.mimeType,f=e.authorizationToken,h=e.queryParams,l=void 0===h?{}:h,d=e.channelAuth,g=void 0!==d&&d,p=e.noAuth,y=void 0!==p&&p,b({libraryId:r,objectId:n,versionHash:i}),o&&I(o),s){t.next=5;break}throw Error("Link path not specified");case 5:return i&&(n=this.utils.DecodeVersionHash(i).objectId),v=r?u("qlibs",r,"q",o||i||n,"meta",s):u("q",i,"meta",s),E=[f],t.t0=E,t.next=11,this.MetadataAuth({libraryId:r,objectId:n,versionHash:i,path:s,channelAuth:g,noAuth:y});case 11:return t.t1=t.sent,t.t0.push.call(t.t0,t.t1),l.authorization&&E.push(l.authorization),l=A(A({},l),{},{authorization:E.flat().filter((function(t){return t})),resolve:!0}),c&&(l["header-accept"]=c),t.abrupt("return",this.HttpClient.URL({path:v,queryParams:l}));case 17:case"end":return t.stop()}}),t,this)})));return function(e){return t.apply(this,arguments)}}(),e.LinkData=function(){var t=s(a.mark((function t(e){var r,n,i,o,s,c,A,u,f,l,d;return a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=e.libraryId,n=e.objectId,i=e.versionHash,o=e.writeToken,s=e.linkPath,c=e.queryParams,A=void 0===c?{}:c,u=e.format,f=void 0===u?"json":u,l=e.channelAuth,t.next=3,this.LinkUrl({libraryId:r,objectId:n,versionHash:i,writeToken:o,linkPath:s,queryParams:A,channelAuth:l});case 3:return d=t.sent,t.t0=this.utils,t.t1=f,t.next=8,h.Fetch(d);case 8:return t.t2=t.sent,t.abrupt("return",t.t0.ResponseToFormat.call(t.t0,t.t1,t.t2));case 10:case"end":return t.stop()}}),t,this)})));return function(e){return t.apply(this,arguments)}}(),e.CreateEncryptionConk=function(){var t=s(a.mark((function t(e){var r,n,i,o,s,c,A,u,f,h,l;return a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=e.libraryId,n=e.objectId,i=e.versionHash,o=e.writeToken,s=e.createKMSConk,c=void 0===s||s,!this.signer.remoteSigner){t.next=3;break}return t.abrupt("return");case 3:if(b({libraryId:r,objectId:n,versionHash:i}),I(o),n||(n=client.DecodeVersionHash(i).objectId),r){t.next=10;break}return t.next=9,this.ContentObjectLibraryId({objectId:n});case 9:r=t.sent;case 10:return A="eluv.caps.iusr".concat(this.utils.AddressToHash(this.signer.address)),t.next=13,this.ContentObjectMetadata({libraryId:r,objectId:n,writeToken:o,metadataSubtree:A});case 13:if(!(u=t.sent)){t.next=20;break}return t.next=17,this.Crypto.DecryptCap(u,this.signer._signingKey().privateKey);case 17:this.encryptionConks[n]=t.sent,t.next=34;break;case 20:return t.next=22,this.Crypto.GeneratePrimaryConk({spaceId:this.contentSpaceId,objectId:n});case 22:return this.encryptionConks[n]=t.sent,t.t0=this,t.t1=r,t.t2=n,t.t3=o,t.t4=A,t.next=30,this.Crypto.EncryptConk(this.encryptionConks[n],this.signer._signingKey().publicKey);case 30:return t.t5=t.sent,t.t6={libraryId:t.t1,objectId:t.t2,writeToken:t.t3,metadataSubtree:t.t4,metadata:t.t5},t.next=34,t.t0.ReplaceMetadata.call(t.t0,t.t6);case 34:if(!c){t.next=64;break}return t.prev=35,t.next=38,this.authClient.KMSAddress({objectId:n});case 38:return f=t.sent,t.next=41,this.authClient.KMSInfo({objectId:n});case 41:return h=t.sent.publicKey,l="eluv.caps.ikms".concat(this.utils.AddressToHash(f)),t.next=45,this.ContentObjectMetadata({libraryId:r,objectId:n,writeToken:o,metadataSubtree:l});case 45:if(t.sent){t.next=58;break}return t.t7=this,t.t8=r,t.t9=n,t.t10=o,t.t11=l,t.next=54,this.Crypto.EncryptConk(this.encryptionConks[n],h);case 54:return t.t12=t.sent,t.t13={libraryId:t.t8,objectId:t.t9,writeToken:t.t10,metadataSubtree:t.t11,metadata:t.t12},t.next=58,t.t7.ReplaceMetadata.call(t.t7,t.t13);case 58:t.next=64;break;case 60:t.prev=60,t.t14=t.catch(35),console.error("Failed to create encryption cap for KMS:"),console.error(t.t14);case 64:return t.abrupt("return",this.encryptionConks[n]);case 65:case"end":return t.stop()}}),t,this,[[35,60]])})));return function(e){return t.apply(this,arguments)}}(),e.EncryptionConk=function(){var t=s(a.mark((function t(e){var r,n,i,o,s,c,A,u,f,h,l;return a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=e.libraryId,n=e.objectId,i=e.versionHash,o=e.writeToken,s=e.download,c=void 0!==s&&s,b({libraryId:r,objectId:n,versionHash:i}),o&&I(o),n||(n=client.DecodeVersionHash(i).objectId),t.next=6,this.authClient.Owner({id:n});case 6:return A=t.sent,u="eluv.caps.iusr".concat(this.utils.AddressToHash(this.signer.address)),t.next=10,this.ContentObjectMetadata({libraryId:r,objectId:n,versionHash:i,metadataSubtree:u});case 10:if(f=t.sent,this.utils.EqualAddress(A,this.signer.address)||f){t.next=21;break}if(!c){t.next=18;break}return t.next=15,this.authClient.ReEncryptionConk({libraryId:r,objectId:n,versionHash:i});case 15:return t.abrupt("return",t.sent);case 18:return t.next=20,this.authClient.EncryptionConk({libraryId:r,objectId:n,versionHash:i});case 20:return t.abrupt("return",t.sent);case 21:if(this.encryptionConks[n]){t.next=38;break}return h="eluv.caps.iusr".concat(this.utils.AddressToHash(this.signer.address)),t.next=25,this.ContentObjectMetadata({libraryId:r,objectId:n,versionHash:i,writeToken:o,metadataSubtree:h});case 25:if(!(l=t.sent)){t.next=32;break}return t.next=29,this.Crypto.DecryptCap(l,this.signer._signingKey().privateKey);case 29:this.encryptionConks[n]=t.sent,t.next=38;break;case 32:if(!o){t.next=37;break}return t.next=35,this.CreateEncryptionConk({libraryId:r,objectId:n,versionHash:i,writeToken:o,createKMSConk:!1});case 35:t.next=38;break;case 37:throw"No encryption conk present for "+n;case 38:return t.abrupt("return",this.encryptionConks[n]);case 39:case"end":return t.stop()}}),t,this)})));return function(e){return t.apply(this,arguments)}}(),e.Encrypt=function(){var t=s(a.mark((function t(e){var r,n,i,o,s,c;return a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=e.libraryId,n=e.objectId,i=e.writeToken,o=e.chunk,b({libraryId:r,objectId:n}),t.next=4,this.EncryptionConk({libraryId:r,objectId:n,writeToken:i});case 4:return s=t.sent,t.next=7,this.Crypto.Encrypt(s,o);case 7:return c=t.sent,t.abrupt("return",c.buffer.slice(c.byteOffset,c.byteOffset+c.byteLength));case 9:case"end":return t.stop()}}),t,this)})));return function(e){return t.apply(this,arguments)}}(),e.Decrypt=function(){var t=s(a.mark((function t(e){var r,n,i,o,s,c;return a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=e.libraryId,n=e.objectId,i=e.writeToken,o=e.chunk,b({libraryId:r,objectId:n}),t.next=4,this.EncryptionConk({libraryId:r,objectId:n,writeToken:i,download:!0});case 4:return s=t.sent,t.next=7,this.Crypto.Decrypt(s,o);case 7:return c=t.sent,t.abrupt("return",c.buffer.slice(c.byteOffset,c.byteOffset+c.byteLength));case 9:case"end":return t.stop()}}),t,this)})));return function(e){return t.apply(this,arguments)}}(),e.AccessType=function(){var t=s(a.mark((function t(e){var r;return a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=e.id,t.next=3,this.authClient.AccessType(r);case 3:return t.abrupt("return",t.sent);case 4:case"end":return t.stop()}}),t,this)})));return function(e){return t.apply(this,arguments)}}(),e.AccessInfo=function(){var t=s(a.mark((function t(e){var r,n,i;return a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=e.objectId,n=e.args,g(r),n||(n=[0,[],[]]),this.Log("Retrieving access info: ".concat(r)),t.next=6,this.ethClient.CallContractMethod({contractAddress:this.utils.HashToAddress(r),methodName:"getAccessInfo",methodArgs:n});case 6:return i=t.sent,this.Log(i),t.abrupt("return",{visibilityCode:i[0],visible:i[0]>=1,accessible:i[0]>=10,editable:i[0]>=100,hasAccess:0===i[1],accessCode:i[1],accessCharge:this.utils.WeiToEther(i[2]).toString()});case 9:case"end":return t.stop()}}),t,this)})));return function(e){return t.apply(this,arguments)}}(),e.AccessRequest=function(){var t=s(a.mark((function t(e){var r,n,i,o,s,c,A,u,f;return a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=e.libraryId,n=e.objectId,i=e.versionHash,o=e.args,s=void 0===o?[]:o,c=e.update,A=void 0!==c&&c,u=e.noCache,f=void 0!==u&&u,b({libraryId:r,objectId:n,versionHash:i}),i&&(n=this.utils.DecodeVersionHash(i).objectId),t.next=5,this.authClient.MakeAccessRequest({libraryId:r,objectId:n,versionHash:i,args:s,update:A,skipCache:!0,noCache:f});case 5:return t.abrupt("return",t.sent);case 6:case"end":return t.stop()}}),t,this)})));return function(e){return t.apply(this,arguments)}}(),e.SetAuthContext=function(t){var e=t.context;if(e&&Object.values(e).find((function(t){return"string"!=typeof t})))throw Error("Context must be a map of string->string");this.authContext=e},e.GenerateStateChannelToken=function(){var t=s(a.mark((function t(e){var r,n,i,o,s;return a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=e.objectId,n=e.versionHash,i=e.context,o=e.noCache,s=void 0!==o&&o,n?p(n):g(r),!n){t.next=6;break}r=this.utils.DecodeVersionHash(n).objectId,t.next=10;break;case 6:if(this.stateChannelAccess[r]){t.next=10;break}return t.next=9,this.LatestVersionHash({objectId:r});case 9:n=t.sent;case 10:return this.stateChannelAccess[r]=n,t.next=13,this.authClient.AuthorizationToken({objectId:r,channelAuth:!0,oauthToken:this.oauthToken,context:i,noCache:s});case 13:return t.abrupt("return",t.sent);case 14:case"end":return t.stop()}}),t,this)})));return function(e){return t.apply(this,arguments)}}(),e.FinalizeStateChannelAccess=function(){var t=s(a.mark((function t(e){var r,n,i;return a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=e.objectId,n=e.versionHash,i=e.percentComplete,n?p(n):g(r),!n){t.next=6;break}r=this.utils.DecodeVersionHash(n).objectId,t.next=13;break;case 6:if(!this.stateChannelAccess[r]){t.next=10;break}n=this.stateChannelAccess[r],t.next=13;break;case 10:return t.next=12,this.LatestVersionHash({objectId:r});case 12:n=t.sent;case 13:return this.stateChannelAccess[r]=void 0,t.next=16,this.authClient.ChannelContentFinalize({objectId:r,versionHash:n,percent:i});case 16:case"end":return t.stop()}}),t,this)})));return function(e){return t.apply(this,arguments)}}(),e.ContentObjectAccessComplete=function(){var t=s(a.mark((function t(e){var r,n,i;return a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=e.objectId,n=e.score,i=void 0===n?100:n,g(r),!(i<0||i>100)){t.next=4;break}throw Error("Invalid AccessComplete score: "+i);case 4:return t.next=6,this.authClient.AccessComplete({id:r,score:i});case 6:return t.abrupt("return",t.sent);case 7:case"end":return t.stop()}}),t,this)})));return function(e){return t.apply(this,arguments)}}(),e.Collection=function(){var t=s(a.mark((function t(e){var r;return a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=e.collectionType,["accessGroups","contentObjects","contentTypes","contracts","libraries"].includes(r)){t.next=4;break}throw new Error("Invalid collection type: "+r);case 4:if(!this.signer){t.next=10;break}return t.next=7,this.userProfileClient.WalletAddress();case 7:t.t0=t.sent,t.next=11;break;case 10:t.t0=void 0;case 11:if(t.t0){t.next=14;break}throw new Error("Unable to get collection: User wallet doesn't exist");case 14:return this.Log("Retrieving ".concat(r," contract collection for user ").concat(this.signer.address)),t.next=17,this.ethClient.MakeProviderCall({methodName:"send",args:["elv_getWalletCollection",[this.contentSpaceId,"iusr".concat(this.utils.AddressToHash(this.signer.address)),r]]});case 17:if(t.t1=t.sent,t.t1){t.next=20;break}t.t1=[];case 20:return t.abrupt("return",t.t1);case 21:case"end":return t.stop()}}),t,this)})));return function(e){return t.apply(this,arguments)}}(),e.VerifyContentObject=function(){var t=s(a.mark((function t(e){var r,n,i;return a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=e.libraryId,n=e.objectId,i=e.versionHash,b({libraryId:r,objectId:n,versionHash:i}),t.next=4,ContentObjectVerification.VerifyContentObject({client:this,libraryId:r,objectId:n,versionHash:i});case 4:return t.abrupt("return",t.sent);case 5:case"end":return t.stop()}}),t,this)})));return function(e){return t.apply(this,arguments)}}(),e.Proofs=function(){var t=s(a.mark((function t(e){var r,n,i,o,s;return a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=e.libraryId,n=e.objectId,i=e.versionHash,o=e.partHash,b({libraryId:r,objectId:n,versionHash:i}),y(o),i&&(n=this.utils.DecodeVersionHash(i).objectId),s=u("q",i||n,"data",o,"proofs"),t.t0=this.utils,t.t1=this.HttpClient,t.next=9,this.authClient.AuthorizationHeader({libraryId:r,objectId:n,versionHash:i});case 9:return t.t2=t.sent,t.t3=s,t.t4={headers:t.t2,method:"GET",path:t.t3},t.t5=t.t1.Request.call(t.t1,t.t4),t.abrupt("return",t.t0.ResponseToJson.call(t.t0,t.t5));case 14:case"end":return t.stop()}}),t,this)})));return function(e){return t.apply(this,arguments)}}(),e.QParts=function(){var t=s(a.mark((function t(e){var r,n,i,o,s,c;return a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=e.libraryId,n=e.objectId,i=e.partHash,o=e.format,s=void 0===o?"blob":o,b({libraryId:r,objectId:n,versionHash:versionHash}),y(i),c=u("qparts",i),t.t0=this.utils,t.t1=s,t.t2=this.HttpClient,t.next=9,this.authClient.AuthorizationHeader({libraryId:r,objectId:n,partHash:i});case 9:return t.t3=t.sent,t.t4=c,t.t5={headers:t.t3,method:"GET",path:t.t4},t.t6=t.t2.Request.call(t.t2,t.t5),t.abrupt("return",t.t0.ResponseToFormat.call(t.t0,t.t1,t.t6));case 14:case"end":return t.stop()}}),t,this)})));return function(e){return t.apply(this,arguments)}}()},function(t,e,r){(function(t){var r,n,i;function o(t){return(o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}!function(a,s){"use strict";"object"===o(t)&&"object"===o(t.exports)?t.exports=s():(n=[],void 0===(i="function"==typeof(r=s)?r.apply(e,n):r)||(t.exports=i))}(0,(function(){"use strict";var t=Object.prototype.toString;function e(t,e){return null!=t&&Object.prototype.hasOwnProperty.call(t,e)}function r(t){if(!t)return!0;if(i(t)&&0===t.length)return!0;if("string"!=typeof t){for(var r in t)if(e(t,r))return!1;return!0}return!1}function n(e){return t.call(e)}var i=Array.isArray||function(e){return"[object Array]"===t.call(e)};function a(t){var e=parseInt(t);return e.toString()===t?e:t}function s(t){var s,c,A=function t(e){return Object.keys(t).reduce((function(r,n){return"create"===n||"function"==typeof t[n]&&(r[n]=t[n].bind(t,e)),r}),{})};function u(t,e){if(s(t,e))return t[e]}function f(t,e,r,n){if("number"==typeof e&&(e=[e]),!e||0===e.length)return t;if("string"==typeof e)return f(t,e.split(".").map(a),r,n);var i=e[0],o=c(t,i);return 1===e.length?(void 0!==o&&n||(t[i]=r),o):(void 0===o&&("number"==typeof e[1]?t[i]=[]:t[i]={}),f(t[i],e.slice(1),r,n))}return s=(t=t||{}).includeInheritedProps?function(){return!0}:function(t,r){return"number"==typeof r&&Array.isArray(t)||e(t,r)},c=t.includeInheritedProps?function(t,e){"string"!=typeof e&&"number"!=typeof e&&(e=String(e));var r=u(t,e);if("__proto__"===e||"prototype"===e||"constructor"===e&&"function"==typeof r)throw new Error("For security reasons, object's magic properties cannot be set");return r}:function(t,e){return u(t,e)},A.has=function(r,n){if("number"==typeof n?n=[n]:"string"==typeof n&&(n=n.split(".")),!n||0===n.length)return!!r;for(var o=0;o<n.length;o++){var s=a(n[o]);if(!("number"==typeof s&&i(r)&&s<r.length||(t.includeInheritedProps?s in Object(r):e(r,s))))return!1;r=r[s]}return!0},A.ensureExists=function(t,e,r){return f(t,e,r,!0)},A.set=function(t,e,r,n){return f(t,e,r,n)},A.insert=function(t,e,r,n){var o=A.get(t,e);n=~~n,i(o)||A.set(t,e,o=[]),o.splice(n,0,r)},A.empty=function(t,e){var a,c;if(!r(e)&&(null!=t&&(a=A.get(t,e)))){if("string"==typeof a)return A.set(t,e,"");if(function(t){return"boolean"==typeof t||"[object Boolean]"===n(t)}(a))return A.set(t,e,!1);if("number"==typeof a)return A.set(t,e,0);if(i(a))a.length=0;else{if(!function(t){return"object"===o(t)&&"[object Object]"===n(t)}(a))return A.set(t,e,null);for(c in a)s(a,c)&&delete a[c]}}},A.push=function(t,e){var r=A.get(t,e);i(r)||A.set(t,e,r=[]),r.push.apply(r,Array.prototype.slice.call(arguments,2))},A.coalesce=function(t,e,r){for(var n,i=0,o=e.length;i<o;i++)if(void 0!==(n=A.get(t,e[i])))return n;return r},A.get=function(t,e,r){if("number"==typeof e&&(e=[e]),!e||0===e.length)return t;if(null==t)return r;if("string"==typeof e)return A.get(t,e.split("."),r);var n=a(e[0]),i=c(t,n);return void 0===i?r:1===e.length?i:A.get(t[n],e.slice(1),r)},A.del=function(t,e){if("number"==typeof e&&(e=[e]),null==t)return t;if(r(e))return t;if("string"==typeof e)return A.del(t,e.split("."));var n=a(e[0]);return c(t,n),s(t,n)?1!==e.length?A.del(t[n],e.slice(1)):(i(t)?t.splice(n,1):delete t[n],t):t},A}var c=s();return c.create=s,c.withInheritedProps=s({includeInheritedProps:!0}),c}))}).call(this,r(14)(t))},function(t,e,r){var n=r(20),i=r(21),o=r(52),a=r(53),s=r(89),c="undefined"!=typeof fetch?fetch:r(98).default,A=r(99).LogMessage,u=function(){"use strict";function t(e){var r=e.uris,n=e.debug;o(this,t),this.uris=r,this.uriIndex=0,this.debug=n,this.draftURIs={},this.retries=Math.max(3,r.length)}var e;return a(t,[{key:"Log",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];A(this,t,e)}},{key:"BaseURI",value:function(){return new s(this.uris[this.uriIndex])}},{key:"RecordWriteToken",value:function(t,e){if(!e)throw Error("RecordWriteToken() - nodeUrlStr not supplied");if(!t)throw Error("RecordWriteToken() - writeToken not supplied");this.draftURIs[t]=new s(e)}},{key:"RequestHeaders",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return e.Accept||(e.Accept="application/json"),"JSON"===t?e["Content-type"]="application/json":"BINARY"===t&&(e["Content-type"]="application/octet-stream"),e}},{key:"Request",value:(e=i(n.mark((function e(r){var i,o,a,s,c,A,u,f,h,l,d,g,p,y,I,b,v,E,m,C,w,B,Q,k,S,_;return n.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=r.method,o=r.path,a=r.queryParams,s=void 0===a?{}:a,c=r.body,A=r.bodyType,u=void 0===A?"JSON":A,f=r.headers,h=void 0===f?{}:f,l=r.attempts,d=void 0===l?0:l,g=r.allowFailover,p=void 0===g||g,y=r.forceFailover,I=void 0!==y&&y,b=r.allowRetry,v=void 0===b||b,E=this.BaseURI(),m=o.replace(/^\//,"").match(/(qlibs\/ilib[a-zA-Z0-9]+|q|qid)\/(tqw__[a-zA-Z0-9]+)/),(C=m?m[2]:void 0)&&(p=!1,this.draftURIs[C]?E=this.draftURIs[C]:this.draftURIs[C]=E),w=E.path(o).query(s).hash(""),B={method:i,headers:this.RequestHeaders(u,h)},"POST"!==i&&"PUT"!==i&&"DELETE"!==i||(c&&"JSON"===u?B.body=JSON.stringify(c):c&&(B.body=c)),this.Log("".concat(i," - ").concat(w.toString())),e.prev=9,e.next=12,t.Fetch(w.toString(),B);case 12:Q=e.sent,e.next=18;break;case 15:e.prev=15,e.t0=e.catch(9),Q={ok:!1,status:500,statusText:"ElvClient Error: "+e.t0.message,url:w.toString(),stack:e.t0.stack};case 18:if(Q.ok){e.next=47;break}if(!((parseInt(Q.status)>=500||I)&&v&&d<this.retries)){e.next=31;break}if(!p){e.next=25;break}this.uriIndex=(this.uriIndex+1)%this.uris.length,this.Log("HttpClient failing over from ".concat(E.toString(),": ").concat(d+1," attempts"),!0),e.next=28;break;case 25:return this.Log("HttpClient retrying request from ".concat(E.toString(),": ").concat(d+1," attempts"),!0),e.next=28,new Promise((function(t){return setTimeout(t,1e3)}));case 28:return e.next=30,this.Request({method:i,path:o,queryParams:s,body:c,bodyType:u,headers:h,attempts:d+1,forceFailover:I});case 30:return e.abrupt("return",e.sent);case 31:if(k=Q.headers&&Q.headers.get("content-type")||"",S="",!Q.text||!Q.json){e.next=44;break}if(!k.includes("application/json")){e.next=40;break}return e.next=37,Q.json();case 37:e.t1=e.sent,e.next=43;break;case 40:return e.next=42,Q.text();case 42:e.t1=e.sent;case 43:S=e.t1;case 44:throw _={name:"ElvHttpClientError",status:Q.status,statusText:Q.statusText,message:Q.statusText,url:w.toString(),body:S,requestParams:B},this.Log(JSON.stringify(_,null,2),!0),_;case 47:return this.Log("".concat(Q.status," - ").concat(i," ").concat(w.toString())),e.abrupt("return",Q);case 49:case"end":return e.stop()}}),e,this,[[9,15]])}))),function(t){return e.apply(this,arguments)})},{key:"URL",value:function(t){var e=t.path,r=t.queryParams,n=void 0===r?{}:r;return this.BaseURI().path(e).query(n).hash("").toString()}}],[{key:"Fetch",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return c(t,e)}}]),t}();t.exports=u},function(t,e,r){var n=r(202),i=r(259)((function(t,e,r,i){n(t,e,r,i)}));t.exports=i},function(t,e,r){var n=r(203),i=r(104),o=r(234),a=r(236),s=r(17),c=r(114),A=r(113);t.exports=function t(e,r,u,f,h){e!==r&&o(r,(function(o,c){if(h||(h=new n),s(o))a(e,r,c,u,t,f,h);else{var l=f?f(A(e,c),o,c+"",e,r,h):void 0;void 0===l&&(l=o),i(e,c,l)}}),c)}},function(t,e,r){var n=r(39),i=r(209),o=r(210),a=r(211),s=r(212),c=r(213);function A(t){var e=this.__data__=new n(t);this.size=e.size}A.prototype.clear=i,A.prototype.delete=o,A.prototype.get=a,A.prototype.has=s,A.prototype.set=c,t.exports=A},function(t,e){t.exports=function(){this.__data__=[],this.size=0}},function(t,e,r){var n=r(40),i=Array.prototype.splice;t.exports=function(t){var e=this.__data__,r=n(e,t);return!(r<0)&&(r==e.length-1?e.pop():i.call(e,r,1),--this.size,!0)}},function(t,e,r){var n=r(40);t.exports=function(t){var e=this.__data__,r=n(e,t);return r<0?void 0:e[r][1]}},function(t,e,r){var n=r(40);t.exports=function(t){return n(this.__data__,t)>-1}},function(t,e,r){var n=r(40);t.exports=function(t,e){var r=this.__data__,i=n(r,t);return i<0?(++this.size,r.push([t,e])):r[i][1]=e,this}},function(t,e,r){var n=r(39);t.exports=function(){this.__data__=new n,this.size=0}},function(t,e){t.exports=function(t){var e=this.__data__,r=e.delete(t);return this.size=e.size,r}},function(t,e){t.exports=function(t){return this.__data__.get(t)}},function(t,e){t.exports=function(t){return this.__data__.has(t)}},function(t,e,r){var n=r(39),i=r(101),o=r(221);t.exports=function(t,e){var r=this.__data__;if(r instanceof n){var a=r.__data__;if(!i||a.length<199)return a.push([t,e]),this.size=++r.size,this;r=this.__data__=new o(a)}return r.set(t,e),this.size=r.size,this}},function(t,e,r){var n=r(56),i=r(217),o=r(17),a=r(219),s=/^\[object .+?Constructor\]$/,c=Function.prototype,A=Object.prototype,u=c.toString,f=A.hasOwnProperty,h=RegExp("^"+u.call(f).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");t.exports=function(t){return!(!o(t)||i(t))&&(n(t)?h:s).test(a(t))}},function(t,e,r){var n=r(102),i=Object.prototype,o=i.hasOwnProperty,a=i.toString,s=n?n.toStringTag:void 0;t.exports=function(t){var e=o.call(t,s),r=t[s];try{t[s]=void 0;var n=!0}catch(t){}var i=a.call(t);return n&&(e?t[s]=r:delete t[s]),i}},function(t,e){var r=Object.prototype.toString;t.exports=function(t){return r.call(t)}},function(t,e,r){var n,i=r(218),o=(n=/[^.]+$/.exec(i&&i.keys&&i.keys.IE_PROTO||""))?"Symbol(src)_1."+n:"";t.exports=function(t){return!!o&&o in t}},function(t,e,r){var n=r(22)["__core-js_shared__"];t.exports=n},function(t,e){var r=Function.prototype.toString;t.exports=function(t){if(null!=t){try{return r.call(t)}catch(t){}try{return t+""}catch(t){}}return""}},function(t,e){t.exports=function(t,e){return null==t?void 0:t[e]}},function(t,e,r){var n=r(222),i=r(229),o=r(231),a=r(232),s=r(233);function c(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}c.prototype.clear=n,c.prototype.delete=i,c.prototype.get=o,c.prototype.has=a,c.prototype.set=s,t.exports=c},function(t,e,r){var n=r(223),i=r(39),o=r(101);t.exports=function(){this.size=0,this.__data__={hash:new n,map:new(o||i),string:new n}}},function(t,e,r){var n=r(224),i=r(225),o=r(226),a=r(227),s=r(228);function c(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}c.prototype.clear=n,c.prototype.delete=i,c.prototype.get=o,c.prototype.has=a,c.prototype.set=s,t.exports=c},function(t,e,r){var n=r(43);t.exports=function(){this.__data__=n?n(null):{},this.size=0}},function(t,e){t.exports=function(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}},function(t,e,r){var n=r(43),i=Object.prototype.hasOwnProperty;t.exports=function(t){var e=this.__data__;if(n){var r=e[t];return"__lodash_hash_undefined__"===r?void 0:r}return i.call(e,t)?e[t]:void 0}},function(t,e,r){var n=r(43),i=Object.prototype.hasOwnProperty;t.exports=function(t){var e=this.__data__;return n?void 0!==e[t]:i.call(e,t)}},function(t,e,r){var n=r(43);t.exports=function(t,e){var r=this.__data__;return this.size+=this.has(t)?0:1,r[t]=n&&void 0===e?"__lodash_hash_undefined__":e,this}},function(t,e,r){var n=r(44);t.exports=function(t){var e=n(this,t).delete(t);return this.size-=e?1:0,e}},function(t,e){function r(t){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}t.exports=function(t){var e=r(t);return"string"==e||"number"==e||"symbol"==e||"boolean"==e?"__proto__"!==t:null===t}},function(t,e,r){var n=r(44);t.exports=function(t){return n(this,t).get(t)}},function(t,e,r){var n=r(44);t.exports=function(t){return n(this,t).has(t)}},function(t,e,r){var n=r(44);t.exports=function(t,e){var r=n(this,t),i=r.size;return r.set(t,e),this.size+=r.size==i?0:1,this}},function(t,e,r){var n=r(235)();t.exports=n},function(t,e){t.exports=function(t){return function(e,r,n){for(var i=-1,o=Object(e),a=n(e),s=a.length;s--;){var c=a[t?s:++i];if(!1===r(o[c],c,o))break}return e}}},function(t,e,r){var n=r(104),i=r(237),o=r(238),a=r(241),s=r(242),c=r(108),A=r(109),u=r(246),f=r(111),h=r(56),l=r(17),d=r(248),g=r(112),p=r(113),y=r(252);t.exports=function(t,e,r,I,b,v,E){var m=p(t,r),C=p(e,r),w=E.get(C);if(w)n(t,r,w);else{var B=v?v(m,C,r+"",t,e,E):void 0,Q=void 0===B;if(Q){var k=A(C),S=!k&&f(C),_=!k&&!S&&g(C);B=C,k||S||_?A(m)?B=m:u(m)?B=a(m):S?(Q=!1,B=i(C,!0)):_?(Q=!1,B=o(C,!0)):B=[]:d(C)||c(C)?(B=m,c(m)?B=y(m):l(m)&&!h(m)||(B=s(C))):Q=!1}Q&&(E.set(C,B),b(B,C,I,v,E),E.delete(C)),n(t,r,B)}}},function(t,e,r){(function(t){function n(t){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var i=r(22),o="object"==n(e)&&e&&!e.nodeType&&e,a=o&&"object"==n(t)&&t&&!t.nodeType&&t,s=a&&a.exports===o?i.Buffer:void 0,c=s?s.allocUnsafe:void 0;t.exports=function(t,e){if(e)return t.slice();var r=t.length,n=c?c(r):new t.constructor(r);return t.copy(n),n}}).call(this,r(14)(t))},function(t,e,r){var n=r(239);t.exports=function(t,e){var r=e?n(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.length)}},function(t,e,r){var n=r(240);t.exports=function(t){var e=new t.constructor(t.byteLength);return new n(e).set(new n(t)),e}},function(t,e,r){var n=r(22).Uint8Array;t.exports=n},function(t,e){t.exports=function(t,e){var r=-1,n=t.length;for(e||(e=Array(n));++r<n;)e[r]=t[r];return e}},function(t,e,r){var n=r(243),i=r(106),o=r(107);t.exports=function(t){return"function"!=typeof t.constructor||o(t)?{}:n(i(t))}},function(t,e,r){var n=r(17),i=Object.create,o=function(){function t(){}return function(e){if(!n(e))return{};if(i)return i(e);t.prototype=e;var r=new t;return t.prototype=void 0,r}}();t.exports=o},function(t,e){t.exports=function(t,e){return function(r){return t(e(r))}}},function(t,e,r){var n=r(42),i=r(31);t.exports=function(t){return i(t)&&"[object Arguments]"==n(t)}},function(t,e,r){var n=r(58),i=r(31);t.exports=function(t){return i(t)&&n(t)}},function(t,e){t.exports=function(){return!1}},function(t,e,r){var n=r(42),i=r(106),o=r(31),a=Function.prototype,s=Object.prototype,c=a.toString,A=s.hasOwnProperty,u=c.call(Object);t.exports=function(t){if(!o(t)||"[object Object]"!=n(t))return!1;var e=i(t);if(null===e)return!0;var r=A.call(e,"constructor")&&e.constructor;return"function"==typeof r&&r instanceof r&&c.call(r)==u}},function(t,e,r){var n=r(42),i=r(110),o=r(31),a={};a["[object Float32Array]"]=a["[object Float64Array]"]=a["[object Int8Array]"]=a["[object Int16Array]"]=a["[object Int32Array]"]=a["[object Uint8Array]"]=a["[object Uint8ClampedArray]"]=a["[object Uint16Array]"]=a["[object Uint32Array]"]=!0,a["[object Arguments]"]=a["[object Array]"]=a["[object ArrayBuffer]"]=a["[object Boolean]"]=a["[object DataView]"]=a["[object Date]"]=a["[object Error]"]=a["[object Function]"]=a["[object Map]"]=a["[object Number]"]=a["[object Object]"]=a["[object RegExp]"]=a["[object Set]"]=a["[object String]"]=a["[object WeakMap]"]=!1,t.exports=function(t){return o(t)&&i(t.length)&&!!a[n(t)]}},function(t,e){t.exports=function(t){return function(e){return t(e)}}},function(t,e,r){(function(t){function n(t){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var i=r(103),o="object"==n(e)&&e&&!e.nodeType&&e,a=o&&"object"==n(t)&&t&&!t.nodeType&&t,s=a&&a.exports===o&&i.process,c=function(){try{var t=a&&a.require&&a.require("util").types;return t||s&&s.binding&&s.binding("util")}catch(t){}}();t.exports=c}).call(this,r(14)(t))},function(t,e,r){var n=r(253),i=r(114);t.exports=function(t){return n(t,i(t))}},function(t,e,r){var n=r(254),i=r(57);t.exports=function(t,e,r,o){var a=!r;r||(r={});for(var s=-1,c=e.length;++s<c;){var A=e[s],u=o?o(r[A],t[A],A,r,t):void 0;void 0===u&&(u=t[A]),a?i(r,A,u):n(r,A,u)}return r}},function(t,e,r){var n=r(57),i=r(41),o=Object.prototype.hasOwnProperty;t.exports=function(t,e,r){var a=t[e];o.call(t,e)&&i(a,r)&&(void 0!==r||e in t)||n(t,e,r)}},function(t,e,r){var n=r(256),i=r(108),o=r(109),a=r(111),s=r(115),c=r(112),A=Object.prototype.hasOwnProperty;t.exports=function(t,e){var r=o(t),u=!r&&i(t),f=!r&&!u&&a(t),h=!r&&!u&&!f&&c(t),l=r||u||f||h,d=l?n(t.length,String):[],g=d.length;for(var p in t)!e&&!A.call(t,p)||l&&("length"==p||f&&("offset"==p||"parent"==p)||h&&("buffer"==p||"byteLength"==p||"byteOffset"==p)||s(p,g))||d.push(p);return d}},function(t,e){t.exports=function(t,e){for(var r=-1,n=Array(t);++r<t;)n[r]=e(r);return n}},function(t,e,r){var n=r(17),i=r(107),o=r(258),a=Object.prototype.hasOwnProperty;t.exports=function(t){if(!n(t))return o(t);var e=i(t),r=[];for(var s in t)("constructor"!=s||!e&&a.call(t,s))&&r.push(s);return r}},function(t,e){t.exports=function(t){var e=[];if(null!=t)for(var r in Object(t))e.push(r);return e}},function(t,e,r){var n=r(260),i=r(267);t.exports=function(t){return n((function(e,r){var n=-1,o=r.length,a=o>1?r[o-1]:void 0,s=o>2?r[2]:void 0;for(a=t.length>3&&"function"==typeof a?(o--,a):void 0,s&&i(r[0],r[1],s)&&(a=o<3?void 0:a,o=1),e=Object(e);++n<o;){var c=r[n];c&&t(e,c,n,a)}return e}))}},function(t,e,r){var n=r(116),i=r(261),o=r(263);t.exports=function(t,e){return o(i(t,e,n),t+"")}},function(t,e,r){var n=r(262),i=Math.max;t.exports=function(t,e,r){return e=i(void 0===e?t.length-1:e,0),function(){for(var o=arguments,a=-1,s=i(o.length-e,0),c=Array(s);++a<s;)c[a]=o[e+a];a=-1;for(var A=Array(e+1);++a<e;)A[a]=o[a];return A[e]=r(c),n(t,this,A)}}},function(t,e){t.exports=function(t,e,r){switch(r.length){case 0:return t.call(e);case 1:return t.call(e,r[0]);case 2:return t.call(e,r[0],r[1]);case 3:return t.call(e,r[0],r[1],r[2])}return t.apply(e,r)}},function(t,e,r){var n=r(264),i=r(266)(n);t.exports=i},function(t,e,r){var n=r(265),i=r(105),o=r(116),a=i?function(t,e){return i(t,"toString",{configurable:!0,enumerable:!1,value:n(e),writable:!0})}:o;t.exports=a},function(t,e){t.exports=function(t){return function(){return t}}},function(t,e){var r=Date.now;t.exports=function(t){var e=0,n=0;return function(){var i=r(),o=16-(i-n);if(n=i,o>0){if(++e>=800)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}},function(t,e,r){function n(t){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var i=r(41),o=r(58),a=r(115),s=r(17);t.exports=function(t,e,r){if(!s(r))return!1;var c=n(e);return!!("number"==c?o(r)&&a(e,r.length):"string"==c&&e in r)&&i(r[e],t)}},function(t,e,r){(function(e){var n=r(20),i=r(21);void 0===globalThis.Buffer&&(globalThis.Buffer=r(5).Buffer);var o,a=r(88),s=r(117),c=r(38);if("undefined"==typeof crypto){var A=r(279);A.getRandomValues=function(t){return A.randomBytes(t.length)},globalThis.crypto=A}switch(c.Platform()){case c.PLATFORM_REACT_NATIVE:case c.PLATFORM_WEB:o=r(165).default;break;default:o=r(!function(){var t=new Error("Cannot find module '@eluvio/crypto/dist/elv-crypto.bundle.node'");throw t.code="MODULE_NOT_FOUND",t}()).default}var u,f,h,l,d,g={ElvCrypto:(d=i(n.mark((function t(){return n.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(t.prev=0,g.elvCrypto){t.next=5;break}return t.next=4,(new o).init();case 4:g.elvCrypto=t.sent;case 5:return t.abrupt("return",g.elvCrypto);case 8:t.prev=8,t.t0=t.catch(0),console.error("Error initializing ElvCrypto:"),console.error(t.t0);case 12:case"end":return t.stop()}}),t,null,[[0,8]])}))),function(){return d.apply(this,arguments)}),EncryptedSize:function(t){var e=Math.floor(t/1e6)*g.EncryptedBlockSize(1e6);return t%1e6!=0&&(e+=g.EncryptedBlockSize(t%1e6)),e},EncryptedBlockSize:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=129,n=608,i=48,o=12*(i-1),a=12*i,s=Math.floor(t/o)*a;return t%o!=0&&(s+=a),e?s+n:s+r},EncryptConk:function(t,r){return i(n.mark((function i(){var o,a,s,A,u,f;return n.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,g.ElvCrypto();case 2:return o=n.sent,r=new Uint8Array(e.from(r.replace("0x",""),"hex")),t=new Uint8Array(e.from(JSON.stringify(t))),n.next=7,o.encryptECIES(t,r);case 7:return a=n.sent,s=a.data,A=a.ephemeralKey,u=a.tag,f=e.concat([e.from(A),e.from(u),e.from(s)]),n.abrupt("return",c.B64(f));case 13:case"end":return n.stop()}}),i)})))()},DecryptCap:function(t,r){return i(n.mark((function i(){var o,a,s,c,A;return n.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,g.ElvCrypto();case 2:return o=n.sent,r=new Uint8Array(e.from(r.replace("0x",""),"hex")),t=e.from(t,"base64"),a=t.slice(0,65),s=t.slice(65,81),c=t.slice(81),A=o.decryptECIES(new Uint8Array(c),r,new Uint8Array(a),new Uint8Array(s)),n.abrupt("return",JSON.parse(e.from(A).toString()));case 10:case"end":return n.stop()}}),i)})))()},GeneratePrimaryConk:function(t){return i(n.mark((function r(){var i,o,s,c,A,u,f;return n.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return i=t.spaceId,o=t.objectId,r.next=3,g.ElvCrypto();case 3:return s=r.sent,c=s.generatePrimaryKeys(),A=c.secretKey,u=c.publicKey,f=s.generateSymmetricKey().key,r.abrupt("return",{symm_key:"kpsy".concat(a.encode(e.from(f))),secret_key:"kpsk".concat(a.encode(e.from(A))),public_key:"kppk".concat(a.encode(e.from(u))),sid:i,qid:o});case 7:case"end":return r.stop()}}),r)})))()},GenerateTargetConk:function(){return i(n.mark((function t(){var r,i,o,s;return n.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,g.ElvCrypto();case 2:return r=t.sent,i=r.generateTargetKeys(),o=i.secretKey,s=i.publicKey,t.abrupt("return",{secret_key:"kpsk".concat(a.encode(e.from(o))),public_key:"ktpk".concat(a.encode(e.from(s)))});case 5:case"end":return t.stop()}}),t)})))()},CapToConk:function(t){var e=function(t){return new Uint8Array(a.decode(t.slice(4)))};return{symmetricKey:e(t.symm_key),secretKey:e(t.secret_key),publicKey:e(t.public_key)}},EncryptionContext:function(t){return i(n.mark((function e(){var r,i,o,a,s,c,A;return n.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,g.ElvCrypto();case 2:return r=e.sent,i=g.CapToConk(t),o=i.symmetricKey,a=i.secretKey,(s=i.publicKey).length===r.PRIMARY_PK_KEY_SIZE?(A=r.CRYPTO_TYPE_PRIMARY,c=r.newPrimaryContext(s,a,o)):(A=r.CRYPTO_TYPE_TARGET,c=r.newTargetDecryptionContext(a,o)),e.abrupt("return",{context:c,type:A});case 6:case"end":return e.stop()}}),e)})))()},Encrypt:(l=i(n.mark((function t(r,i){var o,a,s,c,A;return n.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,g.OpenEncryptionStream(r);case 2:if(o=t.sent,e.isBuffer(i)||i instanceof ArrayBuffer){t.next=9;break}return t.t0=e,t.next=7,new Response(i).arrayBuffer();case 7:t.t1=t.sent,i=t.t0.from.call(t.t0,t.t1);case 9:for(a=new Uint8Array(i),s=0;s<a.length;s+=1e6)c=Math.min(a.length,s+1e6),o.write(a.slice(s,c));return o.end(),A=[],t.next=15,new Promise((function(t,e){o.on("data",(function(t){A.push(t)})).on("finish",(function(){t()})).on("error",(function(t){e(t)}))}));case 15:return t.abrupt("return",e.concat(A));case 16:case"end":return t.stop()}}),t)}))),function(t,e){return l.apply(this,arguments)}),OpenEncryptionStream:(h=i(n.mark((function t(e){var r,i,o,a,c;return n.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,g.ElvCrypto();case 2:return r=t.sent,t.next=5,g.EncryptionContext(e);case 5:return i=t.sent,o=i.context,a=new s.PassThrough,c=r.createCipher(o),t.abrupt("return",a.pipe(c).on("finish",(function(){o.free()})).on("error",(function(t){throw Error(t)})));case 10:case"end":return t.stop()}}),t)}))),function(t){return h.apply(this,arguments)}),Decrypt:(f=i(n.mark((function t(r,i){var o,a,s,c,A;return n.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,g.OpenDecryptionStream(r);case 2:for(o=t.sent,a=new Uint8Array(i),s=0;s<a.length;s+=1e6)c=Math.min(a.length,s+1e6),o.write(a.slice(s,c));return o.end(),A=[],t.next=9,new Promise((function(t,e){o.on("data",(function(t){A.push(t)})).on("finish",(function(){t()})).on("error",(function(t){e(t)}))}));case 9:return t.abrupt("return",e.concat(A));case 10:case"end":return t.stop()}}),t)}))),function(t,e){return f.apply(this,arguments)}),OpenDecryptionStream:(u=i(n.mark((function t(e){var r,i,o,a,c,A;return n.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,g.ElvCrypto();case 2:return r=t.sent,t.next=5,g.EncryptionContext(e);case 5:return i=t.sent,o=i.context,a=i.type,c=new s.PassThrough,A=r.createDecipher(a,o),t.abrupt("return",c.pipe(A).on("finish",(function(){o.free()})).on("error",(function(t){throw Error(t)})));case 11:case"end":return t.stop()}}),t)}))),function(t){return u.apply(this,arguments)})};t.exports=g}).call(this,r(5).Buffer)},function(t,e){var r={}.toString;t.exports=Array.isArray||function(t){return"[object Array]"==r.call(t)}},function(t,e){},function(t,e,r){"use strict";var n=r(60).Buffer,i=r(272);t.exports=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.head=null,this.tail=null,this.length=0}return t.prototype.push=function(t){var e={data:t,next:null};this.length>0?this.tail.next=e:this.head=e,this.tail=e,++this.length},t.prototype.unshift=function(t){var e={data:t,next:this.head};0===this.length&&(this.tail=e),this.head=e,++this.length},t.prototype.shift=function(){if(0!==this.length){var t=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,t}},t.prototype.clear=function(){this.head=this.tail=null,this.length=0},t.prototype.join=function(t){if(0===this.length)return"";for(var e=this.head,r=""+e.data;e=e.next;)r+=t+e.data;return r},t.prototype.concat=function(t){if(0===this.length)return n.alloc(0);if(1===this.length)return this.head.data;for(var e,r,i,o=n.allocUnsafe(t>>>0),a=this.head,s=0;a;)e=a.data,r=o,i=s,e.copy(r,i),s+=a.data.length,a=a.next;return o},t}(),i&&i.inspect&&i.inspect.custom&&(t.exports.prototype[i.inspect.custom]=function(){var t=i.inspect({length:this.length});return this.constructor.name+" "+t})},function(t,e){},function(t,e,r){var n=r(5),i=n.Buffer;function o(t,e){for(var r in t)e[r]=t[r]}function a(t,e,r){return i(t,e,r)}i.from&&i.alloc&&i.allocUnsafe&&i.allocUnsafeSlow?t.exports=n:(o(n,e),e.Buffer=a),o(i,a),a.from=function(t,e,r){if("number"==typeof t)throw new TypeError("Argument must not be a number");return i(t,e,r)},a.alloc=function(t,e,r){if("number"!=typeof t)throw new TypeError("Argument must be a number");var n=i(t);return void 0!==e?"string"==typeof r?n.fill(e,r):n.fill(e):n.fill(0),n},a.allocUnsafe=function(t){if("number"!=typeof t)throw new TypeError("Argument must be a number");return i(t)},a.allocUnsafeSlow=function(t){if("number"!=typeof t)throw new TypeError("Argument must be a number");return n.SlowBuffer(t)}},function(t,e,r){"use strict";t.exports=o;var n=r(122),i=Object.create(r(33));function o(t){if(!(this instanceof o))return new o(t);n.call(this,t)}i.inherits=r(3),i.inherits(o,n),o.prototype._transform=function(t,e,r){r(null,t)}},function(t,e,r){t.exports=r(61)},function(t,e,r){t.exports=r(18)},function(t,e,r){t.exports=r(59).Transform},function(t,e,r){t.exports=r(59).PassThrough},function(t,e,r){"use strict";e.randomBytes=e.rng=e.pseudoRandomBytes=e.prng=r(19),e.createHash=e.Hash=r(23),e.createHmac=e.Hmac=r(67);var n=r(133),i=Object.keys(n),o=["sha1","sha224","sha256","sha384","sha512","md5","rmd160"].concat(i);e.getHashes=function(){return o};var a=r(68);e.pbkdf2=a.pbkdf2,e.pbkdf2Sync=a.pbkdf2Sync;var s=r(139);e.Cipher=s.Cipher,e.createCipher=s.createCipher,e.Cipheriv=s.Cipheriv,e.createCipheriv=s.createCipheriv,e.Decipher=s.Decipher,e.createDecipher=s.createDecipher,e.Decipheriv=s.Decipheriv,e.createDecipheriv=s.createDecipheriv,e.getCiphers=s.getCiphers,e.listCiphers=s.listCiphers;var c=r(147);e.DiffieHellmanGroup=c.DiffieHellmanGroup,e.createDiffieHellmanGroup=c.createDiffieHellmanGroup,e.getDiffieHellman=c.getDiffieHellman,e.createDiffieHellman=c.createDiffieHellman,e.DiffieHellman=c.DiffieHellman;var A=r(150);e.createSign=A.createSign,e.Sign=A.Sign,e.createVerify=A.createVerify,e.Verify=A.Verify,e.createECDH=r(159);var u=r(160);e.publicEncrypt=u.publicEncrypt,e.privateEncrypt=u.privateEncrypt,e.publicDecrypt=u.publicDecrypt,e.privateDecrypt=u.privateDecrypt;var f=r(164);e.randomFill=f.randomFill,e.randomFillSync=f.randomFillSync,e.createCredentials=function(){throw new Error(["sorry, createCredentials is not implemented yet","we accept pull requests","https://github.com/crypto-browserify/crypto-browserify"].join("\n"))},e.constants={DH_CHECK_P_NOT_SAFE_PRIME:2,DH_CHECK_P_NOT_PRIME:1,DH_UNABLE_TO_CHECK_GENERATOR:4,DH_NOT_SUITABLE_GENERATOR:8,NPN_ENABLED:1,ALPN_ENABLED:1,RSA_PKCS1_PADDING:1,RSA_SSLV23_PADDING:2,RSA_NO_PADDING:3,RSA_PKCS1_OAEP_PADDING:4,RSA_X931_PADDING:5,RSA_PKCS1_PSS_PADDING:6,POINT_CONVERSION_COMPRESSED:2,POINT_CONVERSION_UNCOMPRESSED:4,POINT_CONVERSION_HYBRID:6}},function(t,e){},function(t,e,r){"use strict";function n(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function i(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function o(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}var a=r(5).Buffer,s=r(282).inspect,c=s&&s.custom||"inspect";t.exports=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.head=null,this.tail=null,this.length=0}var e,r,A;return e=t,(r=[{key:"push",value:function(t){var e={data:t,next:null};this.length>0?this.tail.next=e:this.head=e,this.tail=e,++this.length}},{key:"unshift",value:function(t){var e={data:t,next:this.head};0===this.length&&(this.tail=e),this.head=e,++this.length}},{key:"shift",value:function(){if(0!==this.length){var t=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,t}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(t){if(0===this.length)return"";for(var e=this.head,r=""+e.data;e=e.next;)r+=t+e.data;return r}},{key:"concat",value:function(t){if(0===this.length)return a.alloc(0);for(var e,r,n,i=a.allocUnsafe(t>>>0),o=this.head,s=0;o;)e=o.data,r=i,n=s,a.prototype.copy.call(e,r,n),s+=o.data.length,o=o.next;return i}},{key:"consume",value:function(t,e){var r;return t<this.head.data.length?(r=this.head.data.slice(0,t),this.head.data=this.head.data.slice(t)):r=t===this.head.data.length?this.shift():e?this._getString(t):this._getBuffer(t),r}},{key:"first",value:function(){return this.head.data}},{key:"_getString",value:function(t){var e=this.head,r=1,n=e.data;for(t-=n.length;e=e.next;){var i=e.data,o=t>i.length?i.length:t;if(o===i.length?n+=i:n+=i.slice(0,t),0==(t-=o)){o===i.length?(++r,e.next?this.head=e.next:this.head=this.tail=null):(this.head=e,e.data=i.slice(o));break}++r}return this.length-=r,n}},{key:"_getBuffer",value:function(t){var e=a.allocUnsafe(t),r=this.head,n=1;for(r.data.copy(e),t-=r.data.length;r=r.next;){var i=r.data,o=t>i.length?i.length:t;if(i.copy(e,e.length-t,0,o),0==(t-=o)){o===i.length?(++n,r.next?this.head=r.next:this.head=this.tail=null):(this.head=r,r.data=i.slice(o));break}++n}return this.length-=n,e}},{key:c,value:function(t,e){return s(this,function(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?n(Object(r),!0).forEach((function(e){i(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):n(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}({},e,{depth:0,customInspect:!1}))}}])&&o(e.prototype,r),A&&o(e,A),t}()},function(t,e){},function(t,e,r){"use strict";(function(e){var n;function i(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var o=r(64),a=Symbol("lastResolve"),s=Symbol("lastReject"),c=Symbol("error"),A=Symbol("ended"),u=Symbol("lastPromise"),f=Symbol("handlePromise"),h=Symbol("stream");function l(t,e){return{value:t,done:e}}function d(t){var e=t[a];if(null!==e){var r=t[h].read();null!==r&&(t[u]=null,t[a]=null,t[s]=null,e(l(r,!1)))}}function g(t){e.nextTick(d,t)}var p=Object.getPrototypeOf((function(){})),y=Object.setPrototypeOf((i(n={get stream(){return this[h]},next:function(){var t=this,r=this[c];if(null!==r)return Promise.reject(r);if(this[A])return Promise.resolve(l(void 0,!0));if(this[h].destroyed)return new Promise((function(r,n){e.nextTick((function(){t[c]?n(t[c]):r(l(void 0,!0))}))}));var n,i=this[u];if(i)n=new Promise(function(t,e){return function(r,n){t.then((function(){e[A]?r(l(void 0,!0)):e[f](r,n)}),n)}}(i,this));else{var o=this[h].read();if(null!==o)return Promise.resolve(l(o,!1));n=new Promise(this[f])}return this[u]=n,n}},Symbol.asyncIterator,(function(){return this})),i(n,"return",(function(){var t=this;return new Promise((function(e,r){t[h].destroy(null,(function(t){t?r(t):e(l(void 0,!0))}))}))})),n),p);t.exports=function(t){var e,r=Object.create(y,(i(e={},h,{value:t,writable:!0}),i(e,a,{value:null,writable:!0}),i(e,s,{value:null,writable:!0}),i(e,c,{value:null,writable:!0}),i(e,A,{value:t._readableState.endEmitted,writable:!0}),i(e,f,{value:function(t,e){var n=r[h].read();n?(r[u]=null,r[a]=null,r[s]=null,t(l(n,!1))):(r[a]=t,r[s]=e)},writable:!0}),e));return r[u]=null,o(t,(function(t){if(t&&"ERR_STREAM_PREMATURE_CLOSE"!==t.code){var e=r[s];return null!==e&&(r[u]=null,r[a]=null,r[s]=null,e(t)),void(r[c]=t)}var n=r[a];null!==n&&(r[u]=null,r[a]=null,r[s]=null,n(l(void 0,!0))),r[A]=!0})),t.on("readable",g.bind(null,r)),r}}).call(this,r(9))},function(t,e){t.exports=function(){throw new Error("Readable.from is not available in the browser")}},function(t,e,r){"use strict";t.exports=i;var n=r(129);function i(t){if(!(this instanceof i))return new i(t);n.call(this,t)}r(3)(i,n),i.prototype._transform=function(t,e,r){r(null,t)}},function(t,e,r){"use strict";var n;var i=r(24).codes,o=i.ERR_MISSING_ARGS,a=i.ERR_STREAM_DESTROYED;function s(t){if(t)throw t}function c(t,e,i,o){o=function(t){var e=!1;return function(){e||(e=!0,t.apply(void 0,arguments))}}(o);var s=!1;t.on("close",(function(){s=!0})),void 0===n&&(n=r(64)),n(t,{readable:e,writable:i},(function(t){if(t)return o(t);s=!0,o()}));var c=!1;return function(e){if(!s&&!c)return c=!0,function(t){return t.setHeader&&"function"==typeof t.abort}(t)?t.abort():"function"==typeof t.destroy?t.destroy():void o(e||new a("pipe"))}}function A(t){t()}function u(t,e){return t.pipe(e)}function f(t){return t.length?"function"!=typeof t[t.length-1]?s:t.pop():s}t.exports=function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];var n,i=f(e);if(Array.isArray(e[0])&&(e=e[0]),e.length<2)throw new o("streams");var a=e.map((function(t,r){var o=r<e.length-1;return c(t,o,r>0,(function(t){n||(n=t),t&&a.forEach(A),o||(a.forEach(A),i(n))}))}));return e.reduce(u)}},function(t,e,r){var n=r(3),i=r(26),o=r(4).Buffer,a=[1518500249,1859775393,-1894007588,-899497514],s=new Array(80);function c(){this.init(),this._w=s,i.call(this,64,56)}function A(t){return t<<30|t>>>2}function u(t,e,r,n){return 0===t?e&r|~e&n:2===t?e&r|e&n|r&n:e^r^n}n(c,i),c.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},c.prototype._update=function(t){for(var e,r=this._w,n=0|this._a,i=0|this._b,o=0|this._c,s=0|this._d,c=0|this._e,f=0;f<16;++f)r[f]=t.readInt32BE(4*f);for(;f<80;++f)r[f]=r[f-3]^r[f-8]^r[f-14]^r[f-16];for(var h=0;h<80;++h){var l=~~(h/20),d=0|((e=n)<<5|e>>>27)+u(l,i,o,s)+c+r[h]+a[l];c=s,s=o,o=A(i),i=n,n=d}this._a=n+this._a|0,this._b=i+this._b|0,this._c=o+this._c|0,this._d=s+this._d|0,this._e=c+this._e|0},c.prototype._hash=function(){var t=o.allocUnsafe(20);return t.writeInt32BE(0|this._a,0),t.writeInt32BE(0|this._b,4),t.writeInt32BE(0|this._c,8),t.writeInt32BE(0|this._d,12),t.writeInt32BE(0|this._e,16),t},t.exports=c},function(t,e,r){var n=r(3),i=r(26),o=r(4).Buffer,a=[1518500249,1859775393,-1894007588,-899497514],s=new Array(80);function c(){this.init(),this._w=s,i.call(this,64,56)}function A(t){return t<<5|t>>>27}function u(t){return t<<30|t>>>2}function f(t,e,r,n){return 0===t?e&r|~e&n:2===t?e&r|e&n|r&n:e^r^n}n(c,i),c.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},c.prototype._update=function(t){for(var e,r=this._w,n=0|this._a,i=0|this._b,o=0|this._c,s=0|this._d,c=0|this._e,h=0;h<16;++h)r[h]=t.readInt32BE(4*h);for(;h<80;++h)r[h]=(e=r[h-3]^r[h-8]^r[h-14]^r[h-16])<<1|e>>>31;for(var l=0;l<80;++l){var d=~~(l/20),g=A(n)+f(d,i,o,s)+c+r[l]+a[d]|0;c=s,s=o,o=u(i),i=n,n=g}this._a=n+this._a|0,this._b=i+this._b|0,this._c=o+this._c|0,this._d=s+this._d|0,this._e=c+this._e|0},c.prototype._hash=function(){var t=o.allocUnsafe(20);return t.writeInt32BE(0|this._a,0),t.writeInt32BE(0|this._b,4),t.writeInt32BE(0|this._c,8),t.writeInt32BE(0|this._d,12),t.writeInt32BE(0|this._e,16),t},t.exports=c},function(t,e,r){var n=r(3),i=r(130),o=r(26),a=r(4).Buffer,s=new Array(64);function c(){this.init(),this._w=s,o.call(this,64,56)}n(c,i),c.prototype.init=function(){return this._a=3238371032,this._b=914150663,this._c=812702999,this._d=4144912697,this._e=4290775857,this._f=1750603025,this._g=1694076839,this._h=3204075428,this},c.prototype._hash=function(){var t=a.allocUnsafe(28);return t.writeInt32BE(this._a,0),t.writeInt32BE(this._b,4),t.writeInt32BE(this._c,8),t.writeInt32BE(this._d,12),t.writeInt32BE(this._e,16),t.writeInt32BE(this._f,20),t.writeInt32BE(this._g,24),t},t.exports=c},function(t,e,r){var n=r(3),i=r(131),o=r(26),a=r(4).Buffer,s=new Array(160);function c(){this.init(),this._w=s,o.call(this,128,112)}n(c,i),c.prototype.init=function(){return this._ah=3418070365,this._bh=1654270250,this._ch=2438529370,this._dh=355462360,this._eh=1731405415,this._fh=2394180231,this._gh=3675008525,this._hh=1203062813,this._al=3238371032,this._bl=914150663,this._cl=812702999,this._dl=4144912697,this._el=4290775857,this._fl=1750603025,this._gl=1694076839,this._hl=3204075428,this},c.prototype._hash=function(){var t=a.allocUnsafe(48);function e(e,r,n){t.writeInt32BE(e,n),t.writeInt32BE(r,n+4)}return e(this._ah,this._al,0),e(this._bh,this._bl,8),e(this._ch,this._cl,16),e(this._dh,this._dl,24),e(this._eh,this._el,32),e(this._fh,this._fl,40),t},t.exports=c},function(t,e,r){"use strict";var n=r(3),i=r(4).Buffer,o=r(16),a=i.alloc(128);function s(t,e){o.call(this,"digest"),"string"==typeof e&&(e=i.from(e)),this._alg=t,this._key=e,e.length>64?e=t(e):e.length<64&&(e=i.concat([e,a],64));for(var r=this._ipad=i.allocUnsafe(64),n=this._opad=i.allocUnsafe(64),s=0;s<64;s++)r[s]=54^e[s],n[s]=92^e[s];this._hash=[r]}n(s,o),s.prototype._update=function(t){this._hash.push(t)},s.prototype._final=function(){var t=this._alg(i.concat(this._hash));return this._alg(i.concat([this._opad,t]))},t.exports=s},function(t,e,r){(function(e){var n,i,o=r(4).Buffer,a=r(135),s=r(136),c=r(137),A=r(138),u=e.crypto&&e.crypto.subtle,f={sha:"SHA-1","sha-1":"SHA-1",sha1:"SHA-1",sha256:"SHA-256","sha-256":"SHA-256",sha384:"SHA-384","sha-384":"SHA-384","sha-512":"SHA-512",sha512:"SHA-512"},h=[];function l(){return i||(i=e.process&&e.process.nextTick?e.process.nextTick:e.queueMicrotask?e.queueMicrotask:e.setImmediate?e.setImmediate:e.setTimeout)}function d(t,e,r,n,i){return u.importKey("raw",t,{name:"PBKDF2"},!1,["deriveBits"]).then((function(t){return u.deriveBits({name:"PBKDF2",salt:e,iterations:r,hash:{name:i}},t,n<<3)})).then((function(t){return o.from(t)}))}t.exports=function(t,r,i,g,p,y){"function"==typeof p&&(y=p,p=void 0);var I=f[(p=p||"sha1").toLowerCase()];if(I&&"function"==typeof e.Promise){if(a(i,g),t=A(t,s,"Password"),r=A(r,s,"Salt"),"function"!=typeof y)throw new Error("No callback provided to pbkdf2");!function(t,e){t.then((function(t){l()((function(){e(null,t)}))}),(function(t){l()((function(){e(t)}))}))}(function(t){if(e.process&&!e.process.browser)return Promise.resolve(!1);if(!u||!u.importKey||!u.deriveBits)return Promise.resolve(!1);if(void 0!==h[t])return h[t];var r=d(n=n||o.alloc(8),n,10,128,t).then((function(){return!0})).catch((function(){return!1}));return h[t]=r,r}(I).then((function(e){return e?d(t,r,i,g,I):c(t,r,i,g,p)})),y)}else l()((function(){var e;try{e=c(t,r,i,g,p)}catch(t){return y(t)}y(null,e)}))}}).call(this,r(8))},function(t,e,r){var n=r(16),i=r(294),o=r(3),a=r(4).Buffer,s={"des-ede3-cbc":i.CBC.instantiate(i.EDE),"des-ede3":i.EDE,"des-ede-cbc":i.CBC.instantiate(i.EDE),"des-ede":i.EDE,"des-cbc":i.CBC.instantiate(i.DES),"des-ecb":i.DES};function c(t){n.call(this);var e,r=t.mode.toLowerCase(),i=s[r];e=t.decrypt?"decrypt":"encrypt";var o=t.key;a.isBuffer(o)||(o=a.from(o)),"des-ede"!==r&&"des-ede-cbc"!==r||(o=a.concat([o,o.slice(0,8)]));var c=t.iv;a.isBuffer(c)||(c=a.from(c)),this._des=i.create({key:o,iv:c,type:e})}s.des=s["des-cbc"],s.des3=s["des-ede3-cbc"],t.exports=c,o(c,n),c.prototype._update=function(t){return a.from(this._des.update(t))},c.prototype._final=function(){return a.from(this._des.final())}},function(t,e,r){"use strict";e.utils=r(140),e.Cipher=r(69),e.DES=r(141),e.CBC=r(295),e.EDE=r(296)},function(t,e,r){"use strict";var n=r(11),i=r(3),o={};function a(t){n.equal(t.length,8,"Invalid IV length"),this.iv=new Array(8);for(var e=0;e<this.iv.length;e++)this.iv[e]=t[e]}e.instantiate=function(t){function e(e){t.call(this,e),this._cbcInit()}i(e,t);for(var r=Object.keys(o),n=0;n<r.length;n++){var a=r[n];e.prototype[a]=o[a]}return e.create=function(t){return new e(t)},e},o._cbcInit=function(){var t=new a(this.options.iv);this._cbcState=t},o._update=function(t,e,r,n){var i=this._cbcState,o=this.constructor.super_.prototype,a=i.iv;if("encrypt"===this.type){for(var s=0;s<this.blockSize;s++)a[s]^=t[e+s];o._update.call(this,a,0,r,n);for(s=0;s<this.blockSize;s++)a[s]=r[n+s]}else{o._update.call(this,t,e,r,n);for(s=0;s<this.blockSize;s++)r[n+s]^=a[s];for(s=0;s<this.blockSize;s++)a[s]=t[e+s]}}},function(t,e,r){"use strict";var n=r(11),i=r(3),o=r(69),a=r(141);function s(t,e){n.equal(e.length,24,"Invalid key length");var r=e.slice(0,8),i=e.slice(8,16),o=e.slice(16,24);this.ciphers="encrypt"===t?[a.create({type:"encrypt",key:r}),a.create({type:"decrypt",key:i}),a.create({type:"encrypt",key:o})]:[a.create({type:"decrypt",key:o}),a.create({type:"encrypt",key:i}),a.create({type:"decrypt",key:r})]}function c(t){o.call(this,t);var e=new s(this.type,this.options.key);this._edeState=e}i(c,o),t.exports=c,c.create=function(t){return new c(t)},c.prototype._update=function(t,e,r,n){var i=this._edeState;i.ciphers[0]._update(t,e,r,n),i.ciphers[1]._update(r,n,r,n),i.ciphers[2]._update(r,n,r,n)},c.prototype._pad=a.prototype._pad,c.prototype._unpad=a.prototype._unpad},function(t,e,r){var n=r(71),i=r(145),o=r(4).Buffer,a=r(146),s=r(16),c=r(46),A=r(47);function u(t,e,r){s.call(this),this._cache=new h,this._cipher=new c.AES(e),this._prev=o.from(r),this._mode=t,this._autopadding=!0}r(3)(u,s),u.prototype._update=function(t){var e,r;this._cache.add(t);for(var n=[];e=this._cache.get();)r=this._mode.encrypt(this,e),n.push(r);return o.concat(n)};var f=o.alloc(16,16);function h(){this.cache=o.allocUnsafe(0)}function l(t,e,r){var s=n[t.toLowerCase()];if(!s)throw new TypeError("invalid suite type");if("string"==typeof e&&(e=o.from(e)),e.length!==s.key/8)throw new TypeError("invalid key length "+e.length);if("string"==typeof r&&(r=o.from(r)),"GCM"!==s.mode&&r.length!==s.iv)throw new TypeError("invalid iv length "+r.length);return"stream"===s.type?new a(s.module,e,r):"auth"===s.type?new i(s.module,e,r):new u(s.module,e,r)}u.prototype._final=function(){var t=this._cache.flush();if(this._autopadding)return t=this._mode.encrypt(this,t),this._cipher.scrub(),t;if(!t.equals(f))throw this._cipher.scrub(),new Error("data not multiple of block length")},u.prototype.setAutoPadding=function(t){return this._autopadding=!!t,this},h.prototype.add=function(t){this.cache=o.concat([this.cache,t])},h.prototype.get=function(){if(this.cache.length>15){var t=this.cache.slice(0,16);return this.cache=this.cache.slice(16),t}return null},h.prototype.flush=function(){for(var t=16-this.cache.length,e=o.allocUnsafe(t),r=-1;++r<t;)e.writeUInt8(t,r);return o.concat([this.cache,e])},e.createCipheriv=l,e.createCipher=function(t,e){var r=n[t.toLowerCase()];if(!r)throw new TypeError("invalid suite type");var i=A(e,!1,r.key,r.iv);return l(t,i.key,i.iv)}},function(t,e){e.encrypt=function(t,e){return t._cipher.encryptBlock(e)},e.decrypt=function(t,e){return t._cipher.decryptBlock(e)}},function(t,e,r){var n=r(35);e.encrypt=function(t,e){var r=n(e,t._prev);return t._prev=t._cipher.encryptBlock(r),t._prev},e.decrypt=function(t,e){var r=t._prev;t._prev=e;var i=t._cipher.decryptBlock(e);return n(i,r)}},function(t,e,r){var n=r(4).Buffer,i=r(35);function o(t,e,r){var o=e.length,a=i(e,t._cache);return t._cache=t._cache.slice(o),t._prev=n.concat([t._prev,r?e:a]),a}e.encrypt=function(t,e,r){for(var i,a=n.allocUnsafe(0);e.length;){if(0===t._cache.length&&(t._cache=t._cipher.encryptBlock(t._prev),t._prev=n.allocUnsafe(0)),!(t._cache.length<=e.length)){a=n.concat([a,o(t,e,r)]);break}i=t._cache.length,a=n.concat([a,o(t,e.slice(0,i),r)]),e=e.slice(i)}return a}},function(t,e,r){var n=r(4).Buffer;function i(t,e,r){var i=t._cipher.encryptBlock(t._prev)[0]^e;return t._prev=n.concat([t._prev.slice(1),n.from([r?e:i])]),i}e.encrypt=function(t,e,r){for(var o=e.length,a=n.allocUnsafe(o),s=-1;++s<o;)a[s]=i(t,e[s],r);return a}},function(t,e,r){var n=r(4).Buffer;function i(t,e,r){for(var n,i,a=-1,s=0;++a<8;)n=e&1<<7-a?128:0,s+=(128&(i=t._cipher.encryptBlock(t._prev)[0]^n))>>a%8,t._prev=o(t._prev,r?n:i);return s}function o(t,e){var r=t.length,i=-1,o=n.allocUnsafe(t.length);for(t=n.concat([t,n.from([e])]);++i<r;)o[i]=t[i]<<1|t[i+1]>>7;return o}e.encrypt=function(t,e,r){for(var o=e.length,a=n.allocUnsafe(o),s=-1;++s<o;)a[s]=i(t,e[s],r);return a}},function(t,e,r){(function(t){var n=r(35);function i(t){return t._prev=t._cipher.encryptBlock(t._prev),t._prev}e.encrypt=function(e,r){for(;e._cache.length<r.length;)e._cache=t.concat([e._cache,i(e)]);var o=e._cache.slice(0,r.length);return e._cache=e._cache.slice(r.length),n(r,o)}}).call(this,r(5).Buffer)},function(t,e,r){var n=r(4).Buffer,i=n.alloc(16,0);function o(t){var e=n.allocUnsafe(16);return e.writeUInt32BE(t[0]>>>0,0),e.writeUInt32BE(t[1]>>>0,4),e.writeUInt32BE(t[2]>>>0,8),e.writeUInt32BE(t[3]>>>0,12),e}function a(t){this.h=t,this.state=n.alloc(16,0),this.cache=n.allocUnsafe(0)}a.prototype.ghash=function(t){for(var e=-1;++e<t.length;)this.state[e]^=t[e];this._multiply()},a.prototype._multiply=function(){for(var t,e,r,n=[(t=this.h).readUInt32BE(0),t.readUInt32BE(4),t.readUInt32BE(8),t.readUInt32BE(12)],i=[0,0,0,0],a=-1;++a<128;){for(0!=(this.state[~~(a/8)]&1<<7-a%8)&&(i[0]^=n[0],i[1]^=n[1],i[2]^=n[2],i[3]^=n[3]),r=0!=(1&n[3]),e=3;e>0;e--)n[e]=n[e]>>>1|(1&n[e-1])<<31;n[0]=n[0]>>>1,r&&(n[0]=n[0]^225<<24)}this.state=o(i)},a.prototype.update=function(t){var e;for(this.cache=n.concat([this.cache,t]);this.cache.length>=16;)e=this.cache.slice(0,16),this.cache=this.cache.slice(16),this.ghash(e)},a.prototype.final=function(t,e){return this.cache.length&&this.ghash(n.concat([this.cache,i],16)),this.ghash(o([0,t,0,e])),this.state},t.exports=a},function(t,e,r){var n=r(145),i=r(4).Buffer,o=r(71),a=r(146),s=r(16),c=r(46),A=r(47);function u(t,e,r){s.call(this),this._cache=new f,this._last=void 0,this._cipher=new c.AES(e),this._prev=i.from(r),this._mode=t,this._autopadding=!0}function f(){this.cache=i.allocUnsafe(0)}function h(t,e,r){var s=o[t.toLowerCase()];if(!s)throw new TypeError("invalid suite type");if("string"==typeof r&&(r=i.from(r)),"GCM"!==s.mode&&r.length!==s.iv)throw new TypeError("invalid iv length "+r.length);if("string"==typeof e&&(e=i.from(e)),e.length!==s.key/8)throw new TypeError("invalid key length "+e.length);return"stream"===s.type?new a(s.module,e,r,!0):"auth"===s.type?new n(s.module,e,r,!0):new u(s.module,e,r)}r(3)(u,s),u.prototype._update=function(t){var e,r;this._cache.add(t);for(var n=[];e=this._cache.get(this._autopadding);)r=this._mode.decrypt(this,e),n.push(r);return i.concat(n)},u.prototype._final=function(){var t=this._cache.flush();if(this._autopadding)return function(t){var e=t[15];if(e<1||e>16)throw new Error("unable to decrypt data");var r=-1;for(;++r<e;)if(t[r+(16-e)]!==e)throw new Error("unable to decrypt data");if(16===e)return;return t.slice(0,16-e)}(this._mode.decrypt(this,t));if(t)throw new Error("data not multiple of block length")},u.prototype.setAutoPadding=function(t){return this._autopadding=!!t,this},f.prototype.add=function(t){this.cache=i.concat([this.cache,t])},f.prototype.get=function(t){var e;if(t){if(this.cache.length>16)return e=this.cache.slice(0,16),this.cache=this.cache.slice(16),e}else if(this.cache.length>=16)return e=this.cache.slice(0,16),this.cache=this.cache.slice(16),e;return null},f.prototype.flush=function(){if(this.cache.length)return this.cache},e.createDecipher=function(t,e){var r=o[t.toLowerCase()];if(!r)throw new TypeError("invalid suite type");var n=A(e,!1,r.key,r.iv);return h(t,n.key,n.iv)},e.createDecipheriv=h},function(t,e){e["des-ecb"]={key:8,iv:0},e["des-cbc"]=e.des={key:8,iv:8},e["des-ede3-cbc"]=e.des3={key:24,iv:8},e["des-ede3"]={key:24,iv:0},e["des-ede-cbc"]={key:16,iv:8},e["des-ede"]={key:16,iv:0}},function(t,e){},function(t){t.exports=JSON.parse('{"modp1":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a63a3620ffffffffffffffff"},"modp2":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece65381ffffffffffffffff"},"modp5":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca237327ffffffffffffffff"},"modp14":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aacaa68ffffffffffffffff"},"modp15":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a93ad2caffffffffffffffff"},"modp16":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c934063199ffffffffffffffff"},"modp17":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c93402849236c3fab4d27c7026c1d4dcb2602646dec9751e763dba37bdf8ff9406ad9e530ee5db382f413001aeb06a53ed9027d831179727b0865a8918da3edbebcf9b14ed44ce6cbaced4bb1bdb7f1447e6cc254b332051512bd7af426fb8f401378cd2bf5983ca01c64b92ecf032ea15d1721d03f482d7ce6e74fef6d55e702f46980c82b5a84031900b1c9e59e7c97fbec7e8f323a97a7e36cc88be0f1d45b7ff585ac54bd407b22b4154aacc8f6d7ebf48e1d814cc5ed20f8037e0a79715eef29be32806a1d58bb7c5da76f550aa3d8a1fbff0eb19ccb1a313d55cda56c9ec2ef29632387fe8d76e3c0468043e8f663f4860ee12bf2d5b0b7474d6e694f91e6dcc4024ffffffffffffffff"},"modp18":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c93402849236c3fab4d27c7026c1d4dcb2602646dec9751e763dba37bdf8ff9406ad9e530ee5db382f413001aeb06a53ed9027d831179727b0865a8918da3edbebcf9b14ed44ce6cbaced4bb1bdb7f1447e6cc254b332051512bd7af426fb8f401378cd2bf5983ca01c64b92ecf032ea15d1721d03f482d7ce6e74fef6d55e702f46980c82b5a84031900b1c9e59e7c97fbec7e8f323a97a7e36cc88be0f1d45b7ff585ac54bd407b22b4154aacc8f6d7ebf48e1d814cc5ed20f8037e0a79715eef29be32806a1d58bb7c5da76f550aa3d8a1fbff0eb19ccb1a313d55cda56c9ec2ef29632387fe8d76e3c0468043e8f663f4860ee12bf2d5b0b7474d6e694f91e6dbe115974a3926f12fee5e438777cb6a932df8cd8bec4d073b931ba3bc832b68d9dd300741fa7bf8afc47ed2576f6936ba424663aab639c5ae4f5683423b4742bf1c978238f16cbe39d652de3fdb8befc848ad922222e04a4037c0713eb57a81a23f0c73473fc646cea306b4bcbc8862f8385ddfa9d4b7fa2c087e879683303ed5bdd3a062b3cf5b3a278a66d2a13f83f44f82ddf310ee074ab6a364597e899a0255dc164f31cc50846851df9ab48195ded7ea1b1d510bd7ee74d73faf36bc31ecfa268359046f4eb879f924009438b481c6cd7889a002ed5ee382bc9190da6fc026e479558e4475677e9aa9e3050e2765694dfc81f56e880b96e7160c980dd98edd3dfffffffffffffffff"}}')},function(t,e,r){(function(e){var n=r(2),i=new(r(149)),o=new n(24),a=new n(11),s=new n(10),c=new n(3),A=new n(7),u=r(148),f=r(19);function h(t,r){return r=r||"utf8",e.isBuffer(t)||(t=new e(t,r)),this._pub=new n(t),this}function l(t,r){return r=r||"utf8",e.isBuffer(t)||(t=new e(t,r)),this._priv=new n(t),this}t.exports=g;var d={};function g(t,e,r){this.setGenerator(e),this.__prime=new n(t),this._prime=n.mont(this.__prime),this._primeLen=t.length,this._pub=void 0,this._priv=void 0,this._primeCode=void 0,r?(this.setPublicKey=h,this.setPrivateKey=l):this._primeCode=8}function p(t,r){var n=new e(t.toArray());return r?n.toString(r):n}Object.defineProperty(g.prototype,"verifyError",{enumerable:!0,get:function(){return"number"!=typeof this._primeCode&&(this._primeCode=function(t,e){var r=e.toString("hex"),n=[r,t.toString(16)].join("_");if(n in d)return d[n];var f,h=0;if(t.isEven()||!u.simpleSieve||!u.fermatTest(t)||!i.test(t))return h+=1,h+="02"===r||"05"===r?8:4,d[n]=h,h;switch(i.test(t.shrn(1))||(h+=2),r){case"02":t.mod(o).cmp(a)&&(h+=8);break;case"05":(f=t.mod(s)).cmp(c)&&f.cmp(A)&&(h+=8);break;default:h+=4}return d[n]=h,h}(this.__prime,this.__gen)),this._primeCode}}),g.prototype.generateKeys=function(){return this._priv||(this._priv=new n(f(this._primeLen))),this._pub=this._gen.toRed(this._prime).redPow(this._priv).fromRed(),this.getPublicKey()},g.prototype.computeSecret=function(t){var r=(t=(t=new n(t)).toRed(this._prime)).redPow(this._priv).fromRed(),i=new e(r.toArray()),o=this.getPrime();if(i.length<o.length){var a=new e(o.length-i.length);a.fill(0),i=e.concat([a,i])}return i},g.prototype.getPublicKey=function(t){return p(this._pub,t)},g.prototype.getPrivateKey=function(t){return p(this._priv,t)},g.prototype.getPrime=function(t){return p(this.__prime,t)},g.prototype.getGenerator=function(t){return p(this._gen,t)},g.prototype.setGenerator=function(t,r){return r=r||"utf8",e.isBuffer(t)||(t=new e(t,r)),this.__gen=t,this._gen=new n(t),this}}).call(this,r(5).Buffer)},function(t,e,r){var n=r(4).Buffer,i=r(67),o=r(73),a=r(74).ec,s=r(2),c=r(49),A=r(158);function u(t,e,r,o){if((t=n.from(t.toArray())).length<e.byteLength()){var a=n.alloc(e.byteLength()-t.length);t=n.concat([a,t])}var s=r.length,c=function(t,e){t=(t=f(t,e)).mod(e);var r=n.from(t.toArray());if(r.length<e.byteLength()){var i=n.alloc(e.byteLength()-r.length);r=n.concat([i,r])}return r}(r,e),A=n.alloc(s);A.fill(1);var u=n.alloc(s);return u=i(o,u).update(A).update(n.from([0])).update(t).update(c).digest(),A=i(o,u).update(A).digest(),{k:u=i(o,u).update(A).update(n.from([1])).update(t).update(c).digest(),v:A=i(o,u).update(A).digest()}}function f(t,e){var r=new s(t),n=(t.length<<3)-e.bitLength();return n>0&&r.ishrn(n),r}function h(t,e,r){var o,a;do{for(o=n.alloc(0);8*o.length<t.bitLength();)e.v=i(r,e.k).update(e.v).digest(),o=n.concat([o,e.v]);a=f(o,t),e.k=i(r,e.k).update(e.v).update(n.from([0])).digest(),e.v=i(r,e.k).update(e.v).digest()}while(-1!==a.cmp(t));return a}function l(t,e,r,n){return t.toRed(s.mont(r)).redPow(e).fromRed().mod(n)}t.exports=function(t,e,r,i,d){var g=c(e);if(g.curve){if("ecdsa"!==i&&"ecdsa/rsa"!==i)throw new Error("wrong private key type");return function(t,e){var r=A[e.curve.join(".")];if(!r)throw new Error("unknown curve "+e.curve.join("."));var i=new a(r).keyFromPrivate(e.privateKey).sign(t);return n.from(i.toDER())}(t,g)}if("dsa"===g.type){if("dsa"!==i)throw new Error("wrong private key type");return function(t,e,r){var i,o=e.params.priv_key,a=e.params.p,c=e.params.q,A=e.params.g,d=new s(0),g=f(t,c).mod(c),p=!1,y=u(o,c,t,r);for(;!1===p;)i=h(c,y,r),d=l(A,i,a,c),0===(p=i.invm(c).imul(g.add(o.mul(d))).mod(c)).cmpn(0)&&(p=!1,d=new s(0));return function(t,e){t=t.toArray(),e=e.toArray(),128&t[0]&&(t=[0].concat(t));128&e[0]&&(e=[0].concat(e));var r=[48,t.length+e.length+4,2,t.length];return r=r.concat(t,[2,e.length],e),n.from(r)}(d,p)}(t,g,r)}if("rsa"!==i&&"ecdsa/rsa"!==i)throw new Error("wrong private key type");t=n.concat([d,t]);for(var p=g.modulus.byteLength(),y=[0,1];t.length+y.length+1<p;)y.push(255);y.push(0);for(var I=-1;++I<t.length;)y.push(t[I]);return o(y,g)},t.exports.getKey=u,t.exports.makeKey=h},function(t){t.exports=JSON.parse('{"name":"elliptic","version":"6.5.4","description":"EC cryptography","main":"lib/elliptic.js","files":["lib"],"scripts":{"lint":"eslint lib test","lint:fix":"npm run lint -- --fix","unit":"istanbul test _mocha --reporter=spec test/index.js","test":"npm run lint && npm run unit","version":"grunt dist && git add dist/"},"repository":{"type":"git","url":"git@github.com:indutny/elliptic"},"keywords":["EC","Elliptic","curve","Cryptography"],"author":"Fedor Indutny <fedor@indutny.com>","license":"MIT","bugs":{"url":"https://github.com/indutny/elliptic/issues"},"homepage":"https://github.com/indutny/elliptic","devDependencies":{"brfs":"^2.0.2","coveralls":"^3.1.0","eslint":"^7.6.0","grunt":"^1.2.1","grunt-browserify":"^5.3.0","grunt-cli":"^1.3.2","grunt-contrib-connect":"^3.0.0","grunt-contrib-copy":"^1.0.0","grunt-contrib-uglify":"^5.0.0","grunt-mocha-istanbul":"^5.0.2","grunt-saucelabs":"^9.0.1","istanbul":"^0.4.5","mocha":"^8.0.1"},"dependencies":{"bn.js":"^4.11.9","brorand":"^1.1.0","hash.js":"^1.0.0","hmac-drbg":"^1.0.1","inherits":"^2.0.4","minimalistic-assert":"^1.0.1","minimalistic-crypto-utils":"^1.0.1"}}')},function(t,e,r){"use strict";var n=r(12),i=r(2),o=r(3),a=r(48),s=n.assert;function c(t){a.call(this,"short",t),this.a=new i(t.a,16).toRed(this.red),this.b=new i(t.b,16).toRed(this.red),this.tinv=this.two.redInvm(),this.zeroA=0===this.a.fromRed().cmpn(0),this.threeA=0===this.a.fromRed().sub(this.p).cmpn(-3),this.endo=this._getEndomorphism(t),this._endoWnafT1=new Array(4),this._endoWnafT2=new Array(4)}function A(t,e,r,n){a.BasePoint.call(this,t,"affine"),null===e&&null===r?(this.x=null,this.y=null,this.inf=!0):(this.x=new i(e,16),this.y=new i(r,16),n&&(this.x.forceRed(this.curve.red),this.y.forceRed(this.curve.red)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.inf=!1)}function u(t,e,r,n){a.BasePoint.call(this,t,"jacobian"),null===e&&null===r&&null===n?(this.x=this.curve.one,this.y=this.curve.one,this.z=new i(0)):(this.x=new i(e,16),this.y=new i(r,16),this.z=new i(n,16)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.zOne=this.z===this.curve.one}o(c,a),t.exports=c,c.prototype._getEndomorphism=function(t){if(this.zeroA&&this.g&&this.n&&1===this.p.modn(3)){var e,r;if(t.beta)e=new i(t.beta,16).toRed(this.red);else{var n=this._getEndoRoots(this.p);e=(e=n[0].cmp(n[1])<0?n[0]:n[1]).toRed(this.red)}if(t.lambda)r=new i(t.lambda,16);else{var o=this._getEndoRoots(this.n);0===this.g.mul(o[0]).x.cmp(this.g.x.redMul(e))?r=o[0]:(r=o[1],s(0===this.g.mul(r).x.cmp(this.g.x.redMul(e))))}return{beta:e,lambda:r,basis:t.basis?t.basis.map((function(t){return{a:new i(t.a,16),b:new i(t.b,16)}})):this._getEndoBasis(r)}}},c.prototype._getEndoRoots=function(t){var e=t===this.p?this.red:i.mont(t),r=new i(2).toRed(e).redInvm(),n=r.redNeg(),o=new i(3).toRed(e).redNeg().redSqrt().redMul(r);return[n.redAdd(o).fromRed(),n.redSub(o).fromRed()]},c.prototype._getEndoBasis=function(t){for(var e,r,n,o,a,s,c,A,u,f=this.n.ushrn(Math.floor(this.n.bitLength()/2)),h=t,l=this.n.clone(),d=new i(1),g=new i(0),p=new i(0),y=new i(1),I=0;0!==h.cmpn(0);){var b=l.div(h);A=l.sub(b.mul(h)),u=p.sub(b.mul(d));var v=y.sub(b.mul(g));if(!n&&A.cmp(f)<0)e=c.neg(),r=d,n=A.neg(),o=u;else if(n&&2==++I)break;c=A,l=h,h=A,p=d,d=u,y=g,g=v}a=A.neg(),s=u;var E=n.sqr().add(o.sqr());return a.sqr().add(s.sqr()).cmp(E)>=0&&(a=e,s=r),n.negative&&(n=n.neg(),o=o.neg()),a.negative&&(a=a.neg(),s=s.neg()),[{a:n,b:o},{a:a,b:s}]},c.prototype._endoSplit=function(t){var e=this.endo.basis,r=e[0],n=e[1],i=n.b.mul(t).divRound(this.n),o=r.b.neg().mul(t).divRound(this.n),a=i.mul(r.a),s=o.mul(n.a),c=i.mul(r.b),A=o.mul(n.b);return{k1:t.sub(a).sub(s),k2:c.add(A).neg()}},c.prototype.pointFromX=function(t,e){(t=new i(t,16)).red||(t=t.toRed(this.red));var r=t.redSqr().redMul(t).redIAdd(t.redMul(this.a)).redIAdd(this.b),n=r.redSqrt();if(0!==n.redSqr().redSub(r).cmp(this.zero))throw new Error("invalid point");var o=n.fromRed().isOdd();return(e&&!o||!e&&o)&&(n=n.redNeg()),this.point(t,n)},c.prototype.validate=function(t){if(t.inf)return!0;var e=t.x,r=t.y,n=this.a.redMul(e),i=e.redSqr().redMul(e).redIAdd(n).redIAdd(this.b);return 0===r.redSqr().redISub(i).cmpn(0)},c.prototype._endoWnafMulAdd=function(t,e,r){for(var n=this._endoWnafT1,i=this._endoWnafT2,o=0;o<t.length;o++){var a=this._endoSplit(e[o]),s=t[o],c=s._getBeta();a.k1.negative&&(a.k1.ineg(),s=s.neg(!0)),a.k2.negative&&(a.k2.ineg(),c=c.neg(!0)),n[2*o]=s,n[2*o+1]=c,i[2*o]=a.k1,i[2*o+1]=a.k2}for(var A=this._wnafMulAdd(1,n,i,2*o,r),u=0;u<2*o;u++)n[u]=null,i[u]=null;return A},o(A,a.BasePoint),c.prototype.point=function(t,e,r){return new A(this,t,e,r)},c.prototype.pointFromJSON=function(t,e){return A.fromJSON(this,t,e)},A.prototype._getBeta=function(){if(this.curve.endo){var t=this.precomputed;if(t&&t.beta)return t.beta;var e=this.curve.point(this.x.redMul(this.curve.endo.beta),this.y);if(t){var r=this.curve,n=function(t){return r.point(t.x.redMul(r.endo.beta),t.y)};t.beta=e,e.precomputed={beta:null,naf:t.naf&&{wnd:t.naf.wnd,points:t.naf.points.map(n)},doubles:t.doubles&&{step:t.doubles.step,points:t.doubles.points.map(n)}}}return e}},A.prototype.toJSON=function(){return this.precomputed?[this.x,this.y,this.precomputed&&{doubles:this.precomputed.doubles&&{step:this.precomputed.doubles.step,points:this.precomputed.doubles.points.slice(1)},naf:this.precomputed.naf&&{wnd:this.precomputed.naf.wnd,points:this.precomputed.naf.points.slice(1)}}]:[this.x,this.y]},A.fromJSON=function(t,e,r){"string"==typeof e&&(e=JSON.parse(e));var n=t.point(e[0],e[1],r);if(!e[2])return n;function i(e){return t.point(e[0],e[1],r)}var o=e[2];return n.precomputed={beta:null,doubles:o.doubles&&{step:o.doubles.step,points:[n].concat(o.doubles.points.map(i))},naf:o.naf&&{wnd:o.naf.wnd,points:[n].concat(o.naf.points.map(i))}},n},A.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+">"},A.prototype.isInfinity=function(){return this.inf},A.prototype.add=function(t){if(this.inf)return t;if(t.inf)return this;if(this.eq(t))return this.dbl();if(this.neg().eq(t))return this.curve.point(null,null);if(0===this.x.cmp(t.x))return this.curve.point(null,null);var e=this.y.redSub(t.y);0!==e.cmpn(0)&&(e=e.redMul(this.x.redSub(t.x).redInvm()));var r=e.redSqr().redISub(this.x).redISub(t.x),n=e.redMul(this.x.redSub(r)).redISub(this.y);return this.curve.point(r,n)},A.prototype.dbl=function(){if(this.inf)return this;var t=this.y.redAdd(this.y);if(0===t.cmpn(0))return this.curve.point(null,null);var e=this.curve.a,r=this.x.redSqr(),n=t.redInvm(),i=r.redAdd(r).redIAdd(r).redIAdd(e).redMul(n),o=i.redSqr().redISub(this.x.redAdd(this.x)),a=i.redMul(this.x.redSub(o)).redISub(this.y);return this.curve.point(o,a)},A.prototype.getX=function(){return this.x.fromRed()},A.prototype.getY=function(){return this.y.fromRed()},A.prototype.mul=function(t){return t=new i(t,16),this.isInfinity()?this:this._hasDoubles(t)?this.curve._fixedNafMul(this,t):this.curve.endo?this.curve._endoWnafMulAdd([this],[t]):this.curve._wnafMul(this,t)},A.prototype.mulAdd=function(t,e,r){var n=[this,e],i=[t,r];return this.curve.endo?this.curve._endoWnafMulAdd(n,i):this.curve._wnafMulAdd(1,n,i,2)},A.prototype.jmulAdd=function(t,e,r){var n=[this,e],i=[t,r];return this.curve.endo?this.curve._endoWnafMulAdd(n,i,!0):this.curve._wnafMulAdd(1,n,i,2,!0)},A.prototype.eq=function(t){return this===t||this.inf===t.inf&&(this.inf||0===this.x.cmp(t.x)&&0===this.y.cmp(t.y))},A.prototype.neg=function(t){if(this.inf)return this;var e=this.curve.point(this.x,this.y.redNeg());if(t&&this.precomputed){var r=this.precomputed,n=function(t){return t.neg()};e.precomputed={naf:r.naf&&{wnd:r.naf.wnd,points:r.naf.points.map(n)},doubles:r.doubles&&{step:r.doubles.step,points:r.doubles.points.map(n)}}}return e},A.prototype.toJ=function(){return this.inf?this.curve.jpoint(null,null,null):this.curve.jpoint(this.x,this.y,this.curve.one)},o(u,a.BasePoint),c.prototype.jpoint=function(t,e,r){return new u(this,t,e,r)},u.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var t=this.z.redInvm(),e=t.redSqr(),r=this.x.redMul(e),n=this.y.redMul(e).redMul(t);return this.curve.point(r,n)},u.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},u.prototype.add=function(t){if(this.isInfinity())return t;if(t.isInfinity())return this;var e=t.z.redSqr(),r=this.z.redSqr(),n=this.x.redMul(e),i=t.x.redMul(r),o=this.y.redMul(e.redMul(t.z)),a=t.y.redMul(r.redMul(this.z)),s=n.redSub(i),c=o.redSub(a);if(0===s.cmpn(0))return 0!==c.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var A=s.redSqr(),u=A.redMul(s),f=n.redMul(A),h=c.redSqr().redIAdd(u).redISub(f).redISub(f),l=c.redMul(f.redISub(h)).redISub(o.redMul(u)),d=this.z.redMul(t.z).redMul(s);return this.curve.jpoint(h,l,d)},u.prototype.mixedAdd=function(t){if(this.isInfinity())return t.toJ();if(t.isInfinity())return this;var e=this.z.redSqr(),r=this.x,n=t.x.redMul(e),i=this.y,o=t.y.redMul(e).redMul(this.z),a=r.redSub(n),s=i.redSub(o);if(0===a.cmpn(0))return 0!==s.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var c=a.redSqr(),A=c.redMul(a),u=r.redMul(c),f=s.redSqr().redIAdd(A).redISub(u).redISub(u),h=s.redMul(u.redISub(f)).redISub(i.redMul(A)),l=this.z.redMul(a);return this.curve.jpoint(f,h,l)},u.prototype.dblp=function(t){if(0===t)return this;if(this.isInfinity())return this;if(!t)return this.dbl();var e;if(this.curve.zeroA||this.curve.threeA){var r=this;for(e=0;e<t;e++)r=r.dbl();return r}var n=this.curve.a,i=this.curve.tinv,o=this.x,a=this.y,s=this.z,c=s.redSqr().redSqr(),A=a.redAdd(a);for(e=0;e<t;e++){var u=o.redSqr(),f=A.redSqr(),h=f.redSqr(),l=u.redAdd(u).redIAdd(u).redIAdd(n.redMul(c)),d=o.redMul(f),g=l.redSqr().redISub(d.redAdd(d)),p=d.redISub(g),y=l.redMul(p);y=y.redIAdd(y).redISub(h);var I=A.redMul(s);e+1<t&&(c=c.redMul(h)),o=g,s=I,A=y}return this.curve.jpoint(o,A.redMul(i),s)},u.prototype.dbl=function(){return this.isInfinity()?this:this.curve.zeroA?this._zeroDbl():this.curve.threeA?this._threeDbl():this._dbl()},u.prototype._zeroDbl=function(){var t,e,r;if(this.zOne){var n=this.x.redSqr(),i=this.y.redSqr(),o=i.redSqr(),a=this.x.redAdd(i).redSqr().redISub(n).redISub(o);a=a.redIAdd(a);var s=n.redAdd(n).redIAdd(n),c=s.redSqr().redISub(a).redISub(a),A=o.redIAdd(o);A=(A=A.redIAdd(A)).redIAdd(A),t=c,e=s.redMul(a.redISub(c)).redISub(A),r=this.y.redAdd(this.y)}else{var u=this.x.redSqr(),f=this.y.redSqr(),h=f.redSqr(),l=this.x.redAdd(f).redSqr().redISub(u).redISub(h);l=l.redIAdd(l);var d=u.redAdd(u).redIAdd(u),g=d.redSqr(),p=h.redIAdd(h);p=(p=p.redIAdd(p)).redIAdd(p),t=g.redISub(l).redISub(l),e=d.redMul(l.redISub(t)).redISub(p),r=(r=this.y.redMul(this.z)).redIAdd(r)}return this.curve.jpoint(t,e,r)},u.prototype._threeDbl=function(){var t,e,r;if(this.zOne){var n=this.x.redSqr(),i=this.y.redSqr(),o=i.redSqr(),a=this.x.redAdd(i).redSqr().redISub(n).redISub(o);a=a.redIAdd(a);var s=n.redAdd(n).redIAdd(n).redIAdd(this.curve.a),c=s.redSqr().redISub(a).redISub(a);t=c;var A=o.redIAdd(o);A=(A=A.redIAdd(A)).redIAdd(A),e=s.redMul(a.redISub(c)).redISub(A),r=this.y.redAdd(this.y)}else{var u=this.z.redSqr(),f=this.y.redSqr(),h=this.x.redMul(f),l=this.x.redSub(u).redMul(this.x.redAdd(u));l=l.redAdd(l).redIAdd(l);var d=h.redIAdd(h),g=(d=d.redIAdd(d)).redAdd(d);t=l.redSqr().redISub(g),r=this.y.redAdd(this.z).redSqr().redISub(f).redISub(u);var p=f.redSqr();p=(p=(p=p.redIAdd(p)).redIAdd(p)).redIAdd(p),e=l.redMul(d.redISub(t)).redISub(p)}return this.curve.jpoint(t,e,r)},u.prototype._dbl=function(){var t=this.curve.a,e=this.x,r=this.y,n=this.z,i=n.redSqr().redSqr(),o=e.redSqr(),a=r.redSqr(),s=o.redAdd(o).redIAdd(o).redIAdd(t.redMul(i)),c=e.redAdd(e),A=(c=c.redIAdd(c)).redMul(a),u=s.redSqr().redISub(A.redAdd(A)),f=A.redISub(u),h=a.redSqr();h=(h=(h=h.redIAdd(h)).redIAdd(h)).redIAdd(h);var l=s.redMul(f).redISub(h),d=r.redAdd(r).redMul(n);return this.curve.jpoint(u,l,d)},u.prototype.trpl=function(){if(!this.curve.zeroA)return this.dbl().add(this);var t=this.x.redSqr(),e=this.y.redSqr(),r=this.z.redSqr(),n=e.redSqr(),i=t.redAdd(t).redIAdd(t),o=i.redSqr(),a=this.x.redAdd(e).redSqr().redISub(t).redISub(n),s=(a=(a=(a=a.redIAdd(a)).redAdd(a).redIAdd(a)).redISub(o)).redSqr(),c=n.redIAdd(n);c=(c=(c=c.redIAdd(c)).redIAdd(c)).redIAdd(c);var A=i.redIAdd(a).redSqr().redISub(o).redISub(s).redISub(c),u=e.redMul(A);u=(u=u.redIAdd(u)).redIAdd(u);var f=this.x.redMul(s).redISub(u);f=(f=f.redIAdd(f)).redIAdd(f);var h=this.y.redMul(A.redMul(c.redISub(A)).redISub(a.redMul(s)));h=(h=(h=h.redIAdd(h)).redIAdd(h)).redIAdd(h);var l=this.z.redAdd(a).redSqr().redISub(r).redISub(s);return this.curve.jpoint(f,h,l)},u.prototype.mul=function(t,e){return t=new i(t,e),this.curve._wnafMul(this,t)},u.prototype.eq=function(t){if("affine"===t.type)return this.eq(t.toJ());if(this===t)return!0;var e=this.z.redSqr(),r=t.z.redSqr();if(0!==this.x.redMul(r).redISub(t.x.redMul(e)).cmpn(0))return!1;var n=e.redMul(this.z),i=r.redMul(t.z);return 0===this.y.redMul(i).redISub(t.y.redMul(n)).cmpn(0)},u.prototype.eqXToP=function(t){var e=this.z.redSqr(),r=t.toRed(this.curve.red).redMul(e);if(0===this.x.cmp(r))return!0;for(var n=t.clone(),i=this.curve.redN.redMul(e);;){if(n.iadd(this.curve.n),n.cmp(this.curve.p)>=0)return!1;if(r.redIAdd(i),0===this.x.cmp(r))return!0}},u.prototype.inspect=function(){return this.isInfinity()?"<EC JPoint Infinity>":"<EC JPoint x: "+this.x.toString(16,2)+" y: "+this.y.toString(16,2)+" z: "+this.z.toString(16,2)+">"},u.prototype.isInfinity=function(){return 0===this.z.cmpn(0)}},function(t,e,r){"use strict";var n=r(2),i=r(3),o=r(48),a=r(12);function s(t){o.call(this,"mont",t),this.a=new n(t.a,16).toRed(this.red),this.b=new n(t.b,16).toRed(this.red),this.i4=new n(4).toRed(this.red).redInvm(),this.two=new n(2).toRed(this.red),this.a24=this.i4.redMul(this.a.redAdd(this.two))}function c(t,e,r){o.BasePoint.call(this,t,"projective"),null===e&&null===r?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new n(e,16),this.z=new n(r,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)))}i(s,o),t.exports=s,s.prototype.validate=function(t){var e=t.normalize().x,r=e.redSqr(),n=r.redMul(e).redAdd(r.redMul(this.a)).redAdd(e);return 0===n.redSqrt().redSqr().cmp(n)},i(c,o.BasePoint),s.prototype.decodePoint=function(t,e){return this.point(a.toArray(t,e),1)},s.prototype.point=function(t,e){return new c(this,t,e)},s.prototype.pointFromJSON=function(t){return c.fromJSON(this,t)},c.prototype.precompute=function(){},c.prototype._encode=function(){return this.getX().toArray("be",this.curve.p.byteLength())},c.fromJSON=function(t,e){return new c(t,e[0],e[1]||t.one)},c.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" z: "+this.z.fromRed().toString(16,2)+">"},c.prototype.isInfinity=function(){return 0===this.z.cmpn(0)},c.prototype.dbl=function(){var t=this.x.redAdd(this.z).redSqr(),e=this.x.redSub(this.z).redSqr(),r=t.redSub(e),n=t.redMul(e),i=r.redMul(e.redAdd(this.curve.a24.redMul(r)));return this.curve.point(n,i)},c.prototype.add=function(){throw new Error("Not supported on Montgomery curve")},c.prototype.diffAdd=function(t,e){var r=this.x.redAdd(this.z),n=this.x.redSub(this.z),i=t.x.redAdd(t.z),o=t.x.redSub(t.z).redMul(r),a=i.redMul(n),s=e.z.redMul(o.redAdd(a).redSqr()),c=e.x.redMul(o.redISub(a).redSqr());return this.curve.point(s,c)},c.prototype.mul=function(t){for(var e=t.clone(),r=this,n=this.curve.point(null,null),i=[];0!==e.cmpn(0);e.iushrn(1))i.push(e.andln(1));for(var o=i.length-1;o>=0;o--)0===i[o]?(r=r.diffAdd(n,this),n=n.dbl()):(n=r.diffAdd(n,this),r=r.dbl());return n},c.prototype.mulAdd=function(){throw new Error("Not supported on Montgomery curve")},c.prototype.jumlAdd=function(){throw new Error("Not supported on Montgomery curve")},c.prototype.eq=function(t){return 0===this.getX().cmp(t.getX())},c.prototype.normalize=function(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this},c.prototype.getX=function(){return this.normalize(),this.x.fromRed()}},function(t,e,r){"use strict";var n=r(12),i=r(2),o=r(3),a=r(48),s=n.assert;function c(t){this.twisted=1!=(0|t.a),this.mOneA=this.twisted&&-1==(0|t.a),this.extended=this.mOneA,a.call(this,"edwards",t),this.a=new i(t.a,16).umod(this.red.m),this.a=this.a.toRed(this.red),this.c=new i(t.c,16).toRed(this.red),this.c2=this.c.redSqr(),this.d=new i(t.d,16).toRed(this.red),this.dd=this.d.redAdd(this.d),s(!this.twisted||0===this.c.fromRed().cmpn(1)),this.oneC=1==(0|t.c)}function A(t,e,r,n,o){a.BasePoint.call(this,t,"projective"),null===e&&null===r&&null===n?(this.x=this.curve.zero,this.y=this.curve.one,this.z=this.curve.one,this.t=this.curve.zero,this.zOne=!0):(this.x=new i(e,16),this.y=new i(r,16),this.z=n?new i(n,16):this.curve.one,this.t=o&&new i(o,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.t&&!this.t.red&&(this.t=this.t.toRed(this.curve.red)),this.zOne=this.z===this.curve.one,this.curve.extended&&!this.t&&(this.t=this.x.redMul(this.y),this.zOne||(this.t=this.t.redMul(this.z.redInvm()))))}o(c,a),t.exports=c,c.prototype._mulA=function(t){return this.mOneA?t.redNeg():this.a.redMul(t)},c.prototype._mulC=function(t){return this.oneC?t:this.c.redMul(t)},c.prototype.jpoint=function(t,e,r,n){return this.point(t,e,r,n)},c.prototype.pointFromX=function(t,e){(t=new i(t,16)).red||(t=t.toRed(this.red));var r=t.redSqr(),n=this.c2.redSub(this.a.redMul(r)),o=this.one.redSub(this.c2.redMul(this.d).redMul(r)),a=n.redMul(o.redInvm()),s=a.redSqrt();if(0!==s.redSqr().redSub(a).cmp(this.zero))throw new Error("invalid point");var c=s.fromRed().isOdd();return(e&&!c||!e&&c)&&(s=s.redNeg()),this.point(t,s)},c.prototype.pointFromY=function(t,e){(t=new i(t,16)).red||(t=t.toRed(this.red));var r=t.redSqr(),n=r.redSub(this.c2),o=r.redMul(this.d).redMul(this.c2).redSub(this.a),a=n.redMul(o.redInvm());if(0===a.cmp(this.zero)){if(e)throw new Error("invalid point");return this.point(this.zero,t)}var s=a.redSqrt();if(0!==s.redSqr().redSub(a).cmp(this.zero))throw new Error("invalid point");return s.fromRed().isOdd()!==e&&(s=s.redNeg()),this.point(s,t)},c.prototype.validate=function(t){if(t.isInfinity())return!0;t.normalize();var e=t.x.redSqr(),r=t.y.redSqr(),n=e.redMul(this.a).redAdd(r),i=this.c2.redMul(this.one.redAdd(this.d.redMul(e).redMul(r)));return 0===n.cmp(i)},o(A,a.BasePoint),c.prototype.pointFromJSON=function(t){return A.fromJSON(this,t)},c.prototype.point=function(t,e,r,n){return new A(this,t,e,r,n)},A.fromJSON=function(t,e){return new A(t,e[0],e[1],e[2])},A.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+" z: "+this.z.fromRed().toString(16,2)+">"},A.prototype.isInfinity=function(){return 0===this.x.cmpn(0)&&(0===this.y.cmp(this.z)||this.zOne&&0===this.y.cmp(this.curve.c))},A.prototype._extDbl=function(){var t=this.x.redSqr(),e=this.y.redSqr(),r=this.z.redSqr();r=r.redIAdd(r);var n=this.curve._mulA(t),i=this.x.redAdd(this.y).redSqr().redISub(t).redISub(e),o=n.redAdd(e),a=o.redSub(r),s=n.redSub(e),c=i.redMul(a),A=o.redMul(s),u=i.redMul(s),f=a.redMul(o);return this.curve.point(c,A,f,u)},A.prototype._projDbl=function(){var t,e,r,n,i,o,a=this.x.redAdd(this.y).redSqr(),s=this.x.redSqr(),c=this.y.redSqr();if(this.curve.twisted){var A=(n=this.curve._mulA(s)).redAdd(c);this.zOne?(t=a.redSub(s).redSub(c).redMul(A.redSub(this.curve.two)),e=A.redMul(n.redSub(c)),r=A.redSqr().redSub(A).redSub(A)):(i=this.z.redSqr(),o=A.redSub(i).redISub(i),t=a.redSub(s).redISub(c).redMul(o),e=A.redMul(n.redSub(c)),r=A.redMul(o))}else n=s.redAdd(c),i=this.curve._mulC(this.z).redSqr(),o=n.redSub(i).redSub(i),t=this.curve._mulC(a.redISub(n)).redMul(o),e=this.curve._mulC(n).redMul(s.redISub(c)),r=n.redMul(o);return this.curve.point(t,e,r)},A.prototype.dbl=function(){return this.isInfinity()?this:this.curve.extended?this._extDbl():this._projDbl()},A.prototype._extAdd=function(t){var e=this.y.redSub(this.x).redMul(t.y.redSub(t.x)),r=this.y.redAdd(this.x).redMul(t.y.redAdd(t.x)),n=this.t.redMul(this.curve.dd).redMul(t.t),i=this.z.redMul(t.z.redAdd(t.z)),o=r.redSub(e),a=i.redSub(n),s=i.redAdd(n),c=r.redAdd(e),A=o.redMul(a),u=s.redMul(c),f=o.redMul(c),h=a.redMul(s);return this.curve.point(A,u,h,f)},A.prototype._projAdd=function(t){var e,r,n=this.z.redMul(t.z),i=n.redSqr(),o=this.x.redMul(t.x),a=this.y.redMul(t.y),s=this.curve.d.redMul(o).redMul(a),c=i.redSub(s),A=i.redAdd(s),u=this.x.redAdd(this.y).redMul(t.x.redAdd(t.y)).redISub(o).redISub(a),f=n.redMul(c).redMul(u);return this.curve.twisted?(e=n.redMul(A).redMul(a.redSub(this.curve._mulA(o))),r=c.redMul(A)):(e=n.redMul(A).redMul(a.redSub(o)),r=this.curve._mulC(c).redMul(A)),this.curve.point(f,e,r)},A.prototype.add=function(t){return this.isInfinity()?t:t.isInfinity()?this:this.curve.extended?this._extAdd(t):this._projAdd(t)},A.prototype.mul=function(t){return this._hasDoubles(t)?this.curve._fixedNafMul(this,t):this.curve._wnafMul(this,t)},A.prototype.mulAdd=function(t,e,r){return this.curve._wnafMulAdd(1,[this,e],[t,r],2,!1)},A.prototype.jmulAdd=function(t,e,r){return this.curve._wnafMulAdd(1,[this,e],[t,r],2,!0)},A.prototype.normalize=function(){if(this.zOne)return this;var t=this.z.redInvm();return this.x=this.x.redMul(t),this.y=this.y.redMul(t),this.t&&(this.t=this.t.redMul(t)),this.z=this.curve.one,this.zOne=!0,this},A.prototype.neg=function(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())},A.prototype.getX=function(){return this.normalize(),this.x.fromRed()},A.prototype.getY=function(){return this.normalize(),this.y.fromRed()},A.prototype.eq=function(t){return this===t||0===this.getX().cmp(t.getX())&&0===this.getY().cmp(t.getY())},A.prototype.eqXToP=function(t){var e=t.toRed(this.curve.red).redMul(this.z);if(0===this.x.cmp(e))return!0;for(var r=t.clone(),n=this.curve.redN.redMul(this.z);;){if(r.iadd(this.curve.n),r.cmp(this.curve.p)>=0)return!1;if(e.redIAdd(n),0===this.x.cmp(e))return!0}},A.prototype.toP=A.prototype.normalize,A.prototype.mixedAdd=A.prototype.add},function(t,e){t.exports={doubles:{step:4,points:[["e60fce93b59e9ec53011aabc21c23e97b2a31369b87a5ae9c44ee89e2a6dec0a","f7e3507399e595929db99f34f57937101296891e44d23f0be1f32cce69616821"],["8282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508","11f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26caf"],["175e159f728b865a72f99cc6c6fc846de0b93833fd2222ed73fce5b551e5b739","d3506e0d9e3c79eba4ef97a51ff71f5eacb5955add24345c6efa6ffee9fed695"],["363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640","4e273adfc732221953b445397f3363145b9a89008199ecb62003c7f3bee9de9"],["8b4b5f165df3c2be8c6244b5b745638843e4a781a15bcd1b69f79a55dffdf80c","4aad0a6f68d308b4b3fbd7813ab0da04f9e336546162ee56b3eff0c65fd4fd36"],["723cbaa6e5db996d6bf771c00bd548c7b700dbffa6c0e77bcb6115925232fcda","96e867b5595cc498a921137488824d6e2660a0653779494801dc069d9eb39f5f"],["eebfa4d493bebf98ba5feec812c2d3b50947961237a919839a533eca0e7dd7fa","5d9a8ca3970ef0f269ee7edaf178089d9ae4cdc3a711f712ddfd4fdae1de8999"],["100f44da696e71672791d0a09b7bde459f1215a29b3c03bfefd7835b39a48db0","cdd9e13192a00b772ec8f3300c090666b7ff4a18ff5195ac0fbd5cd62bc65a09"],["e1031be262c7ed1b1dc9227a4a04c017a77f8d4464f3b3852c8acde6e534fd2d","9d7061928940405e6bb6a4176597535af292dd419e1ced79a44f18f29456a00d"],["feea6cae46d55b530ac2839f143bd7ec5cf8b266a41d6af52d5e688d9094696d","e57c6b6c97dce1bab06e4e12bf3ecd5c981c8957cc41442d3155debf18090088"],["da67a91d91049cdcb367be4be6ffca3cfeed657d808583de33fa978bc1ec6cb1","9bacaa35481642bc41f463f7ec9780e5dec7adc508f740a17e9ea8e27a68be1d"],["53904faa0b334cdda6e000935ef22151ec08d0f7bb11069f57545ccc1a37b7c0","5bc087d0bc80106d88c9eccac20d3c1c13999981e14434699dcb096b022771c8"],["8e7bcd0bd35983a7719cca7764ca906779b53a043a9b8bcaeff959f43ad86047","10b7770b2a3da4b3940310420ca9514579e88e2e47fd68b3ea10047e8460372a"],["385eed34c1cdff21e6d0818689b81bde71a7f4f18397e6690a841e1599c43862","283bebc3e8ea23f56701de19e9ebf4576b304eec2086dc8cc0458fe5542e5453"],["6f9d9b803ecf191637c73a4413dfa180fddf84a5947fbc9c606ed86c3fac3a7","7c80c68e603059ba69b8e2a30e45c4d47ea4dd2f5c281002d86890603a842160"],["3322d401243c4e2582a2147c104d6ecbf774d163db0f5e5313b7e0e742d0e6bd","56e70797e9664ef5bfb019bc4ddaf9b72805f63ea2873af624f3a2e96c28b2a0"],["85672c7d2de0b7da2bd1770d89665868741b3f9af7643397721d74d28134ab83","7c481b9b5b43b2eb6374049bfa62c2e5e77f17fcc5298f44c8e3094f790313a6"],["948bf809b1988a46b06c9f1919413b10f9226c60f668832ffd959af60c82a0a","53a562856dcb6646dc6b74c5d1c3418c6d4dff08c97cd2bed4cb7f88d8c8e589"],["6260ce7f461801c34f067ce0f02873a8f1b0e44dfc69752accecd819f38fd8e8","bc2da82b6fa5b571a7f09049776a1ef7ecd292238051c198c1a84e95b2b4ae17"],["e5037de0afc1d8d43d8348414bbf4103043ec8f575bfdc432953cc8d2037fa2d","4571534baa94d3b5f9f98d09fb990bddbd5f5b03ec481f10e0e5dc841d755bda"],["e06372b0f4a207adf5ea905e8f1771b4e7e8dbd1c6a6c5b725866a0ae4fce725","7a908974bce18cfe12a27bb2ad5a488cd7484a7787104870b27034f94eee31dd"],["213c7a715cd5d45358d0bbf9dc0ce02204b10bdde2a3f58540ad6908d0559754","4b6dad0b5ae462507013ad06245ba190bb4850f5f36a7eeddff2c27534b458f2"],["4e7c272a7af4b34e8dbb9352a5419a87e2838c70adc62cddf0cc3a3b08fbd53c","17749c766c9d0b18e16fd09f6def681b530b9614bff7dd33e0b3941817dcaae6"],["fea74e3dbe778b1b10f238ad61686aa5c76e3db2be43057632427e2840fb27b6","6e0568db9b0b13297cf674deccb6af93126b596b973f7b77701d3db7f23cb96f"],["76e64113f677cf0e10a2570d599968d31544e179b760432952c02a4417bdde39","c90ddf8dee4e95cf577066d70681f0d35e2a33d2b56d2032b4b1752d1901ac01"],["c738c56b03b2abe1e8281baa743f8f9a8f7cc643df26cbee3ab150242bcbb891","893fb578951ad2537f718f2eacbfbbbb82314eef7880cfe917e735d9699a84c3"],["d895626548b65b81e264c7637c972877d1d72e5f3a925014372e9f6588f6c14b","febfaa38f2bc7eae728ec60818c340eb03428d632bb067e179363ed75d7d991f"],["b8da94032a957518eb0f6433571e8761ceffc73693e84edd49150a564f676e03","2804dfa44805a1e4d7c99cc9762808b092cc584d95ff3b511488e4e74efdf6e7"],["e80fea14441fb33a7d8adab9475d7fab2019effb5156a792f1a11778e3c0df5d","eed1de7f638e00771e89768ca3ca94472d155e80af322ea9fcb4291b6ac9ec78"],["a301697bdfcd704313ba48e51d567543f2a182031efd6915ddc07bbcc4e16070","7370f91cfb67e4f5081809fa25d40f9b1735dbf7c0a11a130c0d1a041e177ea1"],["90ad85b389d6b936463f9d0512678de208cc330b11307fffab7ac63e3fb04ed4","e507a3620a38261affdcbd9427222b839aefabe1582894d991d4d48cb6ef150"],["8f68b9d2f63b5f339239c1ad981f162ee88c5678723ea3351b7b444c9ec4c0da","662a9f2dba063986de1d90c2b6be215dbbea2cfe95510bfdf23cbf79501fff82"],["e4f3fb0176af85d65ff99ff9198c36091f48e86503681e3e6686fd5053231e11","1e63633ad0ef4f1c1661a6d0ea02b7286cc7e74ec951d1c9822c38576feb73bc"],["8c00fa9b18ebf331eb961537a45a4266c7034f2f0d4e1d0716fb6eae20eae29e","efa47267fea521a1a9dc343a3736c974c2fadafa81e36c54e7d2a4c66702414b"],["e7a26ce69dd4829f3e10cec0a9e98ed3143d084f308b92c0997fddfc60cb3e41","2a758e300fa7984b471b006a1aafbb18d0a6b2c0420e83e20e8a9421cf2cfd51"],["b6459e0ee3662ec8d23540c223bcbdc571cbcb967d79424f3cf29eb3de6b80ef","67c876d06f3e06de1dadf16e5661db3c4b3ae6d48e35b2ff30bf0b61a71ba45"],["d68a80c8280bb840793234aa118f06231d6f1fc67e73c5a5deda0f5b496943e8","db8ba9fff4b586d00c4b1f9177b0e28b5b0e7b8f7845295a294c84266b133120"],["324aed7df65c804252dc0270907a30b09612aeb973449cea4095980fc28d3d5d","648a365774b61f2ff130c0c35aec1f4f19213b0c7e332843967224af96ab7c84"],["4df9c14919cde61f6d51dfdbe5fee5dceec4143ba8d1ca888e8bd373fd054c96","35ec51092d8728050974c23a1d85d4b5d506cdc288490192ebac06cad10d5d"],["9c3919a84a474870faed8a9c1cc66021523489054d7f0308cbfc99c8ac1f98cd","ddb84f0f4a4ddd57584f044bf260e641905326f76c64c8e6be7e5e03d4fc599d"],["6057170b1dd12fdf8de05f281d8e06bb91e1493a8b91d4cc5a21382120a959e5","9a1af0b26a6a4807add9a2daf71df262465152bc3ee24c65e899be932385a2a8"],["a576df8e23a08411421439a4518da31880cef0fba7d4df12b1a6973eecb94266","40a6bf20e76640b2c92b97afe58cd82c432e10a7f514d9f3ee8be11ae1b28ec8"],["7778a78c28dec3e30a05fe9629de8c38bb30d1f5cf9a3a208f763889be58ad71","34626d9ab5a5b22ff7098e12f2ff580087b38411ff24ac563b513fc1fd9f43ac"],["928955ee637a84463729fd30e7afd2ed5f96274e5ad7e5cb09eda9c06d903ac","c25621003d3f42a827b78a13093a95eeac3d26efa8a8d83fc5180e935bcd091f"],["85d0fef3ec6db109399064f3a0e3b2855645b4a907ad354527aae75163d82751","1f03648413a38c0be29d496e582cf5663e8751e96877331582c237a24eb1f962"],["ff2b0dce97eece97c1c9b6041798b85dfdfb6d8882da20308f5404824526087e","493d13fef524ba188af4c4dc54d07936c7b7ed6fb90e2ceb2c951e01f0c29907"],["827fbbe4b1e880ea9ed2b2e6301b212b57f1ee148cd6dd28780e5e2cf856e241","c60f9c923c727b0b71bef2c67d1d12687ff7a63186903166d605b68baec293ec"],["eaa649f21f51bdbae7be4ae34ce6e5217a58fdce7f47f9aa7f3b58fa2120e2b3","be3279ed5bbbb03ac69a80f89879aa5a01a6b965f13f7e59d47a5305ba5ad93d"],["e4a42d43c5cf169d9391df6decf42ee541b6d8f0c9a137401e23632dda34d24f","4d9f92e716d1c73526fc99ccfb8ad34ce886eedfa8d8e4f13a7f7131deba9414"],["1ec80fef360cbdd954160fadab352b6b92b53576a88fea4947173b9d4300bf19","aeefe93756b5340d2f3a4958a7abbf5e0146e77f6295a07b671cdc1cc107cefd"],["146a778c04670c2f91b00af4680dfa8bce3490717d58ba889ddb5928366642be","b318e0ec3354028add669827f9d4b2870aaa971d2f7e5ed1d0b297483d83efd0"],["fa50c0f61d22e5f07e3acebb1aa07b128d0012209a28b9776d76a8793180eef9","6b84c6922397eba9b72cd2872281a68a5e683293a57a213b38cd8d7d3f4f2811"],["da1d61d0ca721a11b1a5bf6b7d88e8421a288ab5d5bba5220e53d32b5f067ec2","8157f55a7c99306c79c0766161c91e2966a73899d279b48a655fba0f1ad836f1"],["a8e282ff0c9706907215ff98e8fd416615311de0446f1e062a73b0610d064e13","7f97355b8db81c09abfb7f3c5b2515888b679a3e50dd6bd6cef7c73111f4cc0c"],["174a53b9c9a285872d39e56e6913cab15d59b1fa512508c022f382de8319497c","ccc9dc37abfc9c1657b4155f2c47f9e6646b3a1d8cb9854383da13ac079afa73"],["959396981943785c3d3e57edf5018cdbe039e730e4918b3d884fdff09475b7ba","2e7e552888c331dd8ba0386a4b9cd6849c653f64c8709385e9b8abf87524f2fd"],["d2a63a50ae401e56d645a1153b109a8fcca0a43d561fba2dbb51340c9d82b151","e82d86fb6443fcb7565aee58b2948220a70f750af484ca52d4142174dcf89405"],["64587e2335471eb890ee7896d7cfdc866bacbdbd3839317b3436f9b45617e073","d99fcdd5bf6902e2ae96dd6447c299a185b90a39133aeab358299e5e9faf6589"],["8481bde0e4e4d885b3a546d3e549de042f0aa6cea250e7fd358d6c86dd45e458","38ee7b8cba5404dd84a25bf39cecb2ca900a79c42b262e556d64b1b59779057e"],["13464a57a78102aa62b6979ae817f4637ffcfed3c4b1ce30bcd6303f6caf666b","69be159004614580ef7e433453ccb0ca48f300a81d0942e13f495a907f6ecc27"],["bc4a9df5b713fe2e9aef430bcc1dc97a0cd9ccede2f28588cada3a0d2d83f366","d3a81ca6e785c06383937adf4b798caa6e8a9fbfa547b16d758d666581f33c1"],["8c28a97bf8298bc0d23d8c749452a32e694b65e30a9472a3954ab30fe5324caa","40a30463a3305193378fedf31f7cc0eb7ae784f0451cb9459e71dc73cbef9482"],["8ea9666139527a8c1dd94ce4f071fd23c8b350c5a4bb33748c4ba111faccae0","620efabbc8ee2782e24e7c0cfb95c5d735b783be9cf0f8e955af34a30e62b945"],["dd3625faef5ba06074669716bbd3788d89bdde815959968092f76cc4eb9a9787","7a188fa3520e30d461da2501045731ca941461982883395937f68d00c644a573"],["f710d79d9eb962297e4f6232b40e8f7feb2bc63814614d692c12de752408221e","ea98e67232d3b3295d3b535532115ccac8612c721851617526ae47a9c77bfc82"]]},naf:{wnd:7,points:[["f9308a019258c31049344f85f89d5229b531c845836f99b08601f113bce036f9","388f7b0f632de8140fe337e62a37f3566500a99934c2231b6cb9fd7584b8e672"],["2f8bde4d1a07209355b4a7250a5c5128e88b84bddc619ab7cba8d569b240efe4","d8ac222636e5e3d6d4dba9dda6c9c426f788271bab0d6840dca87d3aa6ac62d6"],["5cbdf0646e5db4eaa398f365f2ea7a0e3d419b7e0330e39ce92bddedcac4f9bc","6aebca40ba255960a3178d6d861a54dba813d0b813fde7b5a5082628087264da"],["acd484e2f0c7f65309ad178a9f559abde09796974c57e714c35f110dfc27ccbe","cc338921b0a7d9fd64380971763b61e9add888a4375f8e0f05cc262ac64f9c37"],["774ae7f858a9411e5ef4246b70c65aac5649980be5c17891bbec17895da008cb","d984a032eb6b5e190243dd56d7b7b365372db1e2dff9d6a8301d74c9c953c61b"],["f28773c2d975288bc7d1d205c3748651b075fbc6610e58cddeeddf8f19405aa8","ab0902e8d880a89758212eb65cdaf473a1a06da521fa91f29b5cb52db03ed81"],["d7924d4f7d43ea965a465ae3095ff41131e5946f3c85f79e44adbcf8e27e080e","581e2872a86c72a683842ec228cc6defea40af2bd896d3a5c504dc9ff6a26b58"],["defdea4cdb677750a420fee807eacf21eb9898ae79b9768766e4faa04a2d4a34","4211ab0694635168e997b0ead2a93daeced1f4a04a95c0f6cfb199f69e56eb77"],["2b4ea0a797a443d293ef5cff444f4979f06acfebd7e86d277475656138385b6c","85e89bc037945d93b343083b5a1c86131a01f60c50269763b570c854e5c09b7a"],["352bbf4a4cdd12564f93fa332ce333301d9ad40271f8107181340aef25be59d5","321eb4075348f534d59c18259dda3e1f4a1b3b2e71b1039c67bd3d8bcf81998c"],["2fa2104d6b38d11b0230010559879124e42ab8dfeff5ff29dc9cdadd4ecacc3f","2de1068295dd865b64569335bd5dd80181d70ecfc882648423ba76b532b7d67"],["9248279b09b4d68dab21a9b066edda83263c3d84e09572e269ca0cd7f5453714","73016f7bf234aade5d1aa71bdea2b1ff3fc0de2a887912ffe54a32ce97cb3402"],["daed4f2be3a8bf278e70132fb0beb7522f570e144bf615c07e996d443dee8729","a69dce4a7d6c98e8d4a1aca87ef8d7003f83c230f3afa726ab40e52290be1c55"],["c44d12c7065d812e8acf28d7cbb19f9011ecd9e9fdf281b0e6a3b5e87d22e7db","2119a460ce326cdc76c45926c982fdac0e106e861edf61c5a039063f0e0e6482"],["6a245bf6dc698504c89a20cfded60853152b695336c28063b61c65cbd269e6b4","e022cf42c2bd4a708b3f5126f16a24ad8b33ba48d0423b6efd5e6348100d8a82"],["1697ffa6fd9de627c077e3d2fe541084ce13300b0bec1146f95ae57f0d0bd6a5","b9c398f186806f5d27561506e4557433a2cf15009e498ae7adee9d63d01b2396"],["605bdb019981718b986d0f07e834cb0d9deb8360ffb7f61df982345ef27a7479","2972d2de4f8d20681a78d93ec96fe23c26bfae84fb14db43b01e1e9056b8c49"],["62d14dab4150bf497402fdc45a215e10dcb01c354959b10cfe31c7e9d87ff33d","80fc06bd8cc5b01098088a1950eed0db01aa132967ab472235f5642483b25eaf"],["80c60ad0040f27dade5b4b06c408e56b2c50e9f56b9b8b425e555c2f86308b6f","1c38303f1cc5c30f26e66bad7fe72f70a65eed4cbe7024eb1aa01f56430bd57a"],["7a9375ad6167ad54aa74c6348cc54d344cc5dc9487d847049d5eabb0fa03c8fb","d0e3fa9eca8726909559e0d79269046bdc59ea10c70ce2b02d499ec224dc7f7"],["d528ecd9b696b54c907a9ed045447a79bb408ec39b68df504bb51f459bc3ffc9","eecf41253136e5f99966f21881fd656ebc4345405c520dbc063465b521409933"],["49370a4b5f43412ea25f514e8ecdad05266115e4a7ecb1387231808f8b45963","758f3f41afd6ed428b3081b0512fd62a54c3f3afbb5b6764b653052a12949c9a"],["77f230936ee88cbbd73df930d64702ef881d811e0e1498e2f1c13eb1fc345d74","958ef42a7886b6400a08266e9ba1b37896c95330d97077cbbe8eb3c7671c60d6"],["f2dac991cc4ce4b9ea44887e5c7c0bce58c80074ab9d4dbaeb28531b7739f530","e0dedc9b3b2f8dad4da1f32dec2531df9eb5fbeb0598e4fd1a117dba703a3c37"],["463b3d9f662621fb1b4be8fbbe2520125a216cdfc9dae3debcba4850c690d45b","5ed430d78c296c3543114306dd8622d7c622e27c970a1de31cb377b01af7307e"],["f16f804244e46e2a09232d4aff3b59976b98fac14328a2d1a32496b49998f247","cedabd9b82203f7e13d206fcdf4e33d92a6c53c26e5cce26d6579962c4e31df6"],["caf754272dc84563b0352b7a14311af55d245315ace27c65369e15f7151d41d1","cb474660ef35f5f2a41b643fa5e460575f4fa9b7962232a5c32f908318a04476"],["2600ca4b282cb986f85d0f1709979d8b44a09c07cb86d7c124497bc86f082120","4119b88753c15bd6a693b03fcddbb45d5ac6be74ab5f0ef44b0be9475a7e4b40"],["7635ca72d7e8432c338ec53cd12220bc01c48685e24f7dc8c602a7746998e435","91b649609489d613d1d5e590f78e6d74ecfc061d57048bad9e76f302c5b9c61"],["754e3239f325570cdbbf4a87deee8a66b7f2b33479d468fbc1a50743bf56cc18","673fb86e5bda30fb3cd0ed304ea49a023ee33d0197a695d0c5d98093c536683"],["e3e6bd1071a1e96aff57859c82d570f0330800661d1c952f9fe2694691d9b9e8","59c9e0bba394e76f40c0aa58379a3cb6a5a2283993e90c4167002af4920e37f5"],["186b483d056a033826ae73d88f732985c4ccb1f32ba35f4b4cc47fdcf04aa6eb","3b952d32c67cf77e2e17446e204180ab21fb8090895138b4a4a797f86e80888b"],["df9d70a6b9876ce544c98561f4be4f725442e6d2b737d9c91a8321724ce0963f","55eb2dafd84d6ccd5f862b785dc39d4ab157222720ef9da217b8c45cf2ba2417"],["5edd5cc23c51e87a497ca815d5dce0f8ab52554f849ed8995de64c5f34ce7143","efae9c8dbc14130661e8cec030c89ad0c13c66c0d17a2905cdc706ab7399a868"],["290798c2b6476830da12fe02287e9e777aa3fba1c355b17a722d362f84614fba","e38da76dcd440621988d00bcf79af25d5b29c094db2a23146d003afd41943e7a"],["af3c423a95d9f5b3054754efa150ac39cd29552fe360257362dfdecef4053b45","f98a3fd831eb2b749a93b0e6f35cfb40c8cd5aa667a15581bc2feded498fd9c6"],["766dbb24d134e745cccaa28c99bf274906bb66b26dcf98df8d2fed50d884249a","744b1152eacbe5e38dcc887980da38b897584a65fa06cedd2c924f97cbac5996"],["59dbf46f8c94759ba21277c33784f41645f7b44f6c596a58ce92e666191abe3e","c534ad44175fbc300f4ea6ce648309a042ce739a7919798cd85e216c4a307f6e"],["f13ada95103c4537305e691e74e9a4a8dd647e711a95e73cb62dc6018cfd87b8","e13817b44ee14de663bf4bc808341f326949e21a6a75c2570778419bdaf5733d"],["7754b4fa0e8aced06d4167a2c59cca4cda1869c06ebadfb6488550015a88522c","30e93e864e669d82224b967c3020b8fa8d1e4e350b6cbcc537a48b57841163a2"],["948dcadf5990e048aa3874d46abef9d701858f95de8041d2a6828c99e2262519","e491a42537f6e597d5d28a3224b1bc25df9154efbd2ef1d2cbba2cae5347d57e"],["7962414450c76c1689c7b48f8202ec37fb224cf5ac0bfa1570328a8a3d7c77ab","100b610ec4ffb4760d5c1fc133ef6f6b12507a051f04ac5760afa5b29db83437"],["3514087834964b54b15b160644d915485a16977225b8847bb0dd085137ec47ca","ef0afbb2056205448e1652c48e8127fc6039e77c15c2378b7e7d15a0de293311"],["d3cc30ad6b483e4bc79ce2c9dd8bc54993e947eb8df787b442943d3f7b527eaf","8b378a22d827278d89c5e9be8f9508ae3c2ad46290358630afb34db04eede0a4"],["1624d84780732860ce1c78fcbfefe08b2b29823db913f6493975ba0ff4847610","68651cf9b6da903e0914448c6cd9d4ca896878f5282be4c8cc06e2a404078575"],["733ce80da955a8a26902c95633e62a985192474b5af207da6df7b4fd5fc61cd4","f5435a2bd2badf7d485a4d8b8db9fcce3e1ef8e0201e4578c54673bc1dc5ea1d"],["15d9441254945064cf1a1c33bbd3b49f8966c5092171e699ef258dfab81c045c","d56eb30b69463e7234f5137b73b84177434800bacebfc685fc37bbe9efe4070d"],["a1d0fcf2ec9de675b612136e5ce70d271c21417c9d2b8aaaac138599d0717940","edd77f50bcb5a3cab2e90737309667f2641462a54070f3d519212d39c197a629"],["e22fbe15c0af8ccc5780c0735f84dbe9a790badee8245c06c7ca37331cb36980","a855babad5cd60c88b430a69f53a1a7a38289154964799be43d06d77d31da06"],["311091dd9860e8e20ee13473c1155f5f69635e394704eaa74009452246cfa9b3","66db656f87d1f04fffd1f04788c06830871ec5a64feee685bd80f0b1286d8374"],["34c1fd04d301be89b31c0442d3e6ac24883928b45a9340781867d4232ec2dbdf","9414685e97b1b5954bd46f730174136d57f1ceeb487443dc5321857ba73abee"],["f219ea5d6b54701c1c14de5b557eb42a8d13f3abbcd08affcc2a5e6b049b8d63","4cb95957e83d40b0f73af4544cccf6b1f4b08d3c07b27fb8d8c2962a400766d1"],["d7b8740f74a8fbaab1f683db8f45de26543a5490bca627087236912469a0b448","fa77968128d9c92ee1010f337ad4717eff15db5ed3c049b3411e0315eaa4593b"],["32d31c222f8f6f0ef86f7c98d3a3335ead5bcd32abdd94289fe4d3091aa824bf","5f3032f5892156e39ccd3d7915b9e1da2e6dac9e6f26e961118d14b8462e1661"],["7461f371914ab32671045a155d9831ea8793d77cd59592c4340f86cbc18347b5","8ec0ba238b96bec0cbdddcae0aa442542eee1ff50c986ea6b39847b3cc092ff6"],["ee079adb1df1860074356a25aa38206a6d716b2c3e67453d287698bad7b2b2d6","8dc2412aafe3be5c4c5f37e0ecc5f9f6a446989af04c4e25ebaac479ec1c8c1e"],["16ec93e447ec83f0467b18302ee620f7e65de331874c9dc72bfd8616ba9da6b5","5e4631150e62fb40d0e8c2a7ca5804a39d58186a50e497139626778e25b0674d"],["eaa5f980c245f6f038978290afa70b6bd8855897f98b6aa485b96065d537bd99","f65f5d3e292c2e0819a528391c994624d784869d7e6ea67fb18041024edc07dc"],["78c9407544ac132692ee1910a02439958ae04877151342ea96c4b6b35a49f51","f3e0319169eb9b85d5404795539a5e68fa1fbd583c064d2462b675f194a3ddb4"],["494f4be219a1a77016dcd838431aea0001cdc8ae7a6fc688726578d9702857a5","42242a969283a5f339ba7f075e36ba2af925ce30d767ed6e55f4b031880d562c"],["a598a8030da6d86c6bc7f2f5144ea549d28211ea58faa70ebf4c1e665c1fe9b5","204b5d6f84822c307e4b4a7140737aec23fc63b65b35f86a10026dbd2d864e6b"],["c41916365abb2b5d09192f5f2dbeafec208f020f12570a184dbadc3e58595997","4f14351d0087efa49d245b328984989d5caf9450f34bfc0ed16e96b58fa9913"],["841d6063a586fa475a724604da03bc5b92a2e0d2e0a36acfe4c73a5514742881","73867f59c0659e81904f9a1c7543698e62562d6744c169ce7a36de01a8d6154"],["5e95bb399a6971d376026947f89bde2f282b33810928be4ded112ac4d70e20d5","39f23f366809085beebfc71181313775a99c9aed7d8ba38b161384c746012865"],["36e4641a53948fd476c39f8a99fd974e5ec07564b5315d8bf99471bca0ef2f66","d2424b1b1abe4eb8164227b085c9aa9456ea13493fd563e06fd51cf5694c78fc"],["336581ea7bfbbb290c191a2f507a41cf5643842170e914faeab27c2c579f726","ead12168595fe1be99252129b6e56b3391f7ab1410cd1e0ef3dcdcabd2fda224"],["8ab89816dadfd6b6a1f2634fcf00ec8403781025ed6890c4849742706bd43ede","6fdcef09f2f6d0a044e654aef624136f503d459c3e89845858a47a9129cdd24e"],["1e33f1a746c9c5778133344d9299fcaa20b0938e8acff2544bb40284b8c5fb94","60660257dd11b3aa9c8ed618d24edff2306d320f1d03010e33a7d2057f3b3b6"],["85b7c1dcb3cec1b7ee7f30ded79dd20a0ed1f4cc18cbcfcfa410361fd8f08f31","3d98a9cdd026dd43f39048f25a8847f4fcafad1895d7a633c6fed3c35e999511"],["29df9fbd8d9e46509275f4b125d6d45d7fbe9a3b878a7af872a2800661ac5f51","b4c4fe99c775a606e2d8862179139ffda61dc861c019e55cd2876eb2a27d84b"],["a0b1cae06b0a847a3fea6e671aaf8adfdfe58ca2f768105c8082b2e449fce252","ae434102edde0958ec4b19d917a6a28e6b72da1834aff0e650f049503a296cf2"],["4e8ceafb9b3e9a136dc7ff67e840295b499dfb3b2133e4ba113f2e4c0e121e5","cf2174118c8b6d7a4b48f6d534ce5c79422c086a63460502b827ce62a326683c"],["d24a44e047e19b6f5afb81c7ca2f69080a5076689a010919f42725c2b789a33b","6fb8d5591b466f8fc63db50f1c0f1c69013f996887b8244d2cdec417afea8fa3"],["ea01606a7a6c9cdd249fdfcfacb99584001edd28abbab77b5104e98e8e3b35d4","322af4908c7312b0cfbfe369f7a7b3cdb7d4494bc2823700cfd652188a3ea98d"],["af8addbf2b661c8a6c6328655eb96651252007d8c5ea31be4ad196de8ce2131f","6749e67c029b85f52a034eafd096836b2520818680e26ac8f3dfbcdb71749700"],["e3ae1974566ca06cc516d47e0fb165a674a3dabcfca15e722f0e3450f45889","2aeabe7e4531510116217f07bf4d07300de97e4874f81f533420a72eeb0bd6a4"],["591ee355313d99721cf6993ffed1e3e301993ff3ed258802075ea8ced397e246","b0ea558a113c30bea60fc4775460c7901ff0b053d25ca2bdeee98f1a4be5d196"],["11396d55fda54c49f19aa97318d8da61fa8584e47b084945077cf03255b52984","998c74a8cd45ac01289d5833a7beb4744ff536b01b257be4c5767bea93ea57a4"],["3c5d2a1ba39c5a1790000738c9e0c40b8dcdfd5468754b6405540157e017aa7a","b2284279995a34e2f9d4de7396fc18b80f9b8b9fdd270f6661f79ca4c81bd257"],["cc8704b8a60a0defa3a99a7299f2e9c3fbc395afb04ac078425ef8a1793cc030","bdd46039feed17881d1e0862db347f8cf395b74fc4bcdc4e940b74e3ac1f1b13"],["c533e4f7ea8555aacd9777ac5cad29b97dd4defccc53ee7ea204119b2889b197","6f0a256bc5efdf429a2fb6242f1a43a2d9b925bb4a4b3a26bb8e0f45eb596096"],["c14f8f2ccb27d6f109f6d08d03cc96a69ba8c34eec07bbcf566d48e33da6593","c359d6923bb398f7fd4473e16fe1c28475b740dd098075e6c0e8649113dc3a38"],["a6cbc3046bc6a450bac24789fa17115a4c9739ed75f8f21ce441f72e0b90e6ef","21ae7f4680e889bb130619e2c0f95a360ceb573c70603139862afd617fa9b9f"],["347d6d9a02c48927ebfb86c1359b1caf130a3c0267d11ce6344b39f99d43cc38","60ea7f61a353524d1c987f6ecec92f086d565ab687870cb12689ff1e31c74448"],["da6545d2181db8d983f7dcb375ef5866d47c67b1bf31c8cf855ef7437b72656a","49b96715ab6878a79e78f07ce5680c5d6673051b4935bd897fea824b77dc208a"],["c40747cc9d012cb1a13b8148309c6de7ec25d6945d657146b9d5994b8feb1111","5ca560753be2a12fc6de6caf2cb489565db936156b9514e1bb5e83037e0fa2d4"],["4e42c8ec82c99798ccf3a610be870e78338c7f713348bd34c8203ef4037f3502","7571d74ee5e0fb92a7a8b33a07783341a5492144cc54bcc40a94473693606437"],["3775ab7089bc6af823aba2e1af70b236d251cadb0c86743287522a1b3b0dedea","be52d107bcfa09d8bcb9736a828cfa7fac8db17bf7a76a2c42ad961409018cf7"],["cee31cbf7e34ec379d94fb814d3d775ad954595d1314ba8846959e3e82f74e26","8fd64a14c06b589c26b947ae2bcf6bfa0149ef0be14ed4d80f448a01c43b1c6d"],["b4f9eaea09b6917619f6ea6a4eb5464efddb58fd45b1ebefcdc1a01d08b47986","39e5c9925b5a54b07433a4f18c61726f8bb131c012ca542eb24a8ac07200682a"],["d4263dfc3d2df923a0179a48966d30ce84e2515afc3dccc1b77907792ebcc60e","62dfaf07a0f78feb30e30d6295853ce189e127760ad6cf7fae164e122a208d54"],["48457524820fa65a4f8d35eb6930857c0032acc0a4a2de422233eeda897612c4","25a748ab367979d98733c38a1fa1c2e7dc6cc07db2d60a9ae7a76aaa49bd0f77"],["dfeeef1881101f2cb11644f3a2afdfc2045e19919152923f367a1767c11cceda","ecfb7056cf1de042f9420bab396793c0c390bde74b4bbdff16a83ae09a9a7517"],["6d7ef6b17543f8373c573f44e1f389835d89bcbc6062ced36c82df83b8fae859","cd450ec335438986dfefa10c57fea9bcc521a0959b2d80bbf74b190dca712d10"],["e75605d59102a5a2684500d3b991f2e3f3c88b93225547035af25af66e04541f","f5c54754a8f71ee540b9b48728473e314f729ac5308b06938360990e2bfad125"],["eb98660f4c4dfaa06a2be453d5020bc99a0c2e60abe388457dd43fefb1ed620c","6cb9a8876d9cb8520609af3add26cd20a0a7cd8a9411131ce85f44100099223e"],["13e87b027d8514d35939f2e6892b19922154596941888336dc3563e3b8dba942","fef5a3c68059a6dec5d624114bf1e91aac2b9da568d6abeb2570d55646b8adf1"],["ee163026e9fd6fe017c38f06a5be6fc125424b371ce2708e7bf4491691e5764a","1acb250f255dd61c43d94ccc670d0f58f49ae3fa15b96623e5430da0ad6c62b2"],["b268f5ef9ad51e4d78de3a750c2dc89b1e626d43505867999932e5db33af3d80","5f310d4b3c99b9ebb19f77d41c1dee018cf0d34fd4191614003e945a1216e423"],["ff07f3118a9df035e9fad85eb6c7bfe42b02f01ca99ceea3bf7ffdba93c4750d","438136d603e858a3a5c440c38eccbaddc1d2942114e2eddd4740d098ced1f0d8"],["8d8b9855c7c052a34146fd20ffb658bea4b9f69e0d825ebec16e8c3ce2b526a1","cdb559eedc2d79f926baf44fb84ea4d44bcf50fee51d7ceb30e2e7f463036758"],["52db0b5384dfbf05bfa9d472d7ae26dfe4b851ceca91b1eba54263180da32b63","c3b997d050ee5d423ebaf66a6db9f57b3180c902875679de924b69d84a7b375"],["e62f9490d3d51da6395efd24e80919cc7d0f29c3f3fa48c6fff543becbd43352","6d89ad7ba4876b0b22c2ca280c682862f342c8591f1daf5170e07bfd9ccafa7d"],["7f30ea2476b399b4957509c88f77d0191afa2ff5cb7b14fd6d8e7d65aaab1193","ca5ef7d4b231c94c3b15389a5f6311e9daff7bb67b103e9880ef4bff637acaec"],["5098ff1e1d9f14fb46a210fada6c903fef0fb7b4a1dd1d9ac60a0361800b7a00","9731141d81fc8f8084d37c6e7542006b3ee1b40d60dfe5362a5b132fd17ddc0"],["32b78c7de9ee512a72895be6b9cbefa6e2f3c4ccce445c96b9f2c81e2778ad58","ee1849f513df71e32efc3896ee28260c73bb80547ae2275ba497237794c8753c"],["e2cb74fddc8e9fbcd076eef2a7c72b0ce37d50f08269dfc074b581550547a4f7","d3aa2ed71c9dd2247a62df062736eb0baddea9e36122d2be8641abcb005cc4a4"],["8438447566d4d7bedadc299496ab357426009a35f235cb141be0d99cd10ae3a8","c4e1020916980a4da5d01ac5e6ad330734ef0d7906631c4f2390426b2edd791f"],["4162d488b89402039b584c6fc6c308870587d9c46f660b878ab65c82c711d67e","67163e903236289f776f22c25fb8a3afc1732f2b84b4e95dbda47ae5a0852649"],["3fad3fa84caf0f34f0f89bfd2dcf54fc175d767aec3e50684f3ba4a4bf5f683d","cd1bc7cb6cc407bb2f0ca647c718a730cf71872e7d0d2a53fa20efcdfe61826"],["674f2600a3007a00568c1a7ce05d0816c1fb84bf1370798f1c69532faeb1a86b","299d21f9413f33b3edf43b257004580b70db57da0b182259e09eecc69e0d38a5"],["d32f4da54ade74abb81b815ad1fb3b263d82d6c692714bcff87d29bd5ee9f08f","f9429e738b8e53b968e99016c059707782e14f4535359d582fc416910b3eea87"],["30e4e670435385556e593657135845d36fbb6931f72b08cb1ed954f1e3ce3ff6","462f9bce619898638499350113bbc9b10a878d35da70740dc695a559eb88db7b"],["be2062003c51cc3004682904330e4dee7f3dcd10b01e580bf1971b04d4cad297","62188bc49d61e5428573d48a74e1c655b1c61090905682a0d5558ed72dccb9bc"],["93144423ace3451ed29e0fb9ac2af211cb6e84a601df5993c419859fff5df04a","7c10dfb164c3425f5c71a3f9d7992038f1065224f72bb9d1d902a6d13037b47c"],["b015f8044f5fcbdcf21ca26d6c34fb8197829205c7b7d2a7cb66418c157b112c","ab8c1e086d04e813744a655b2df8d5f83b3cdc6faa3088c1d3aea1454e3a1d5f"],["d5e9e1da649d97d89e4868117a465a3a4f8a18de57a140d36b3f2af341a21b52","4cb04437f391ed73111a13cc1d4dd0db1693465c2240480d8955e8592f27447a"],["d3ae41047dd7ca065dbf8ed77b992439983005cd72e16d6f996a5316d36966bb","bd1aeb21ad22ebb22a10f0303417c6d964f8cdd7df0aca614b10dc14d125ac46"],["463e2763d885f958fc66cdd22800f0a487197d0a82e377b49f80af87c897b065","bfefacdb0e5d0fd7df3a311a94de062b26b80c61fbc97508b79992671ef7ca7f"],["7985fdfd127c0567c6f53ec1bb63ec3158e597c40bfe747c83cddfc910641917","603c12daf3d9862ef2b25fe1de289aed24ed291e0ec6708703a5bd567f32ed03"],["74a1ad6b5f76e39db2dd249410eac7f99e74c59cb83d2d0ed5ff1543da7703e9","cc6157ef18c9c63cd6193d83631bbea0093e0968942e8c33d5737fd790e0db08"],["30682a50703375f602d416664ba19b7fc9bab42c72747463a71d0896b22f6da3","553e04f6b018b4fa6c8f39e7f311d3176290d0e0f19ca73f17714d9977a22ff8"],["9e2158f0d7c0d5f26c3791efefa79597654e7a2b2464f52b1ee6c1347769ef57","712fcdd1b9053f09003a3481fa7762e9ffd7c8ef35a38509e2fbf2629008373"],["176e26989a43c9cfeba4029c202538c28172e566e3c4fce7322857f3be327d66","ed8cc9d04b29eb877d270b4878dc43c19aefd31f4eee09ee7b47834c1fa4b1c3"],["75d46efea3771e6e68abb89a13ad747ecf1892393dfc4f1b7004788c50374da8","9852390a99507679fd0b86fd2b39a868d7efc22151346e1a3ca4726586a6bed8"],["809a20c67d64900ffb698c4c825f6d5f2310fb0451c869345b7319f645605721","9e994980d9917e22b76b061927fa04143d096ccc54963e6a5ebfa5f3f8e286c1"],["1b38903a43f7f114ed4500b4eac7083fdefece1cf29c63528d563446f972c180","4036edc931a60ae889353f77fd53de4a2708b26b6f5da72ad3394119daf408f9"]]}}},function(t,e,r){"use strict";function n(t){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var i=r(2),o=r(317),a=r(12),s=r(75),c=r(72),A=a.assert,u=r(318),f=r(319);function h(t){if(!(this instanceof h))return new h(t);"string"==typeof t&&(A(Object.prototype.hasOwnProperty.call(s,t),"Unknown curve "+t),t=s[t]),t instanceof s.PresetCurve&&(t={curve:t}),this.curve=t.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=t.curve.g,this.g.precompute(t.curve.n.bitLength()+1),this.hash=t.hash||t.curve.hash}t.exports=h,h.prototype.keyPair=function(t){return new u(this,t)},h.prototype.keyFromPrivate=function(t,e){return u.fromPrivate(this,t,e)},h.prototype.keyFromPublic=function(t,e){return u.fromPublic(this,t,e)},h.prototype.genKeyPair=function(t){t||(t={});for(var e=new o({hash:this.hash,pers:t.pers,persEnc:t.persEnc||"utf8",entropy:t.entropy||c(this.hash.hmacStrength),entropyEnc:t.entropy&&t.entropyEnc||"utf8",nonce:this.n.toArray()}),r=this.n.byteLength(),n=this.n.sub(new i(2));;){var a=new i(e.generate(r));if(!(a.cmp(n)>0))return a.iaddn(1),this.keyFromPrivate(a)}},h.prototype._truncateToN=function(t,e){var r=8*t.byteLength()-this.n.bitLength();return r>0&&(t=t.ushrn(r)),!e&&t.cmp(this.n)>=0?t.sub(this.n):t},h.prototype.sign=function(t,e,r,a){"object"===n(r)&&(a=r,r=null),a||(a={}),e=this.keyFromPrivate(e,r),t=this._truncateToN(new i(t,16));for(var s=this.n.byteLength(),c=e.getPrivate().toArray("be",s),A=t.toArray("be",s),u=new o({hash:this.hash,entropy:c,nonce:A,pers:a.pers,persEnc:a.persEnc||"utf8"}),h=this.n.sub(new i(1)),l=0;;l++){var d=a.k?a.k(l):new i(u.generate(this.n.byteLength()));if(!((d=this._truncateToN(d,!0)).cmpn(1)<=0||d.cmp(h)>=0)){var g=this.g.mul(d);if(!g.isInfinity()){var p=g.getX(),y=p.umod(this.n);if(0!==y.cmpn(0)){var I=d.invm(this.n).mul(y.mul(e.getPrivate()).iadd(t));if(0!==(I=I.umod(this.n)).cmpn(0)){var b=(g.getY().isOdd()?1:0)|(0!==p.cmp(y)?2:0);return a.canonical&&I.cmp(this.nh)>0&&(I=this.n.sub(I),b^=1),new f({r:y,s:I,recoveryParam:b})}}}}}},h.prototype.verify=function(t,e,r,n){t=this._truncateToN(new i(t,16)),r=this.keyFromPublic(r,n);var o=(e=new f(e,"hex")).r,a=e.s;if(o.cmpn(1)<0||o.cmp(this.n)>=0)return!1;if(a.cmpn(1)<0||a.cmp(this.n)>=0)return!1;var s,c=a.invm(this.n),A=c.mul(t).umod(this.n),u=c.mul(o).umod(this.n);return this.curve._maxwellTrick?!(s=this.g.jmulAdd(A,r.getPublic(),u)).isInfinity()&&s.eqXToP(o):!(s=this.g.mulAdd(A,r.getPublic(),u)).isInfinity()&&0===s.getX().umod(this.n).cmp(o)},h.prototype.recoverPubKey=function(t,e,r,n){A((3&r)===r,"The recovery param is more than two bits"),e=new f(e,n);var o=this.n,a=new i(t),s=e.r,c=e.s,u=1&r,h=r>>1;if(s.cmp(this.curve.p.umod(this.curve.n))>=0&&h)throw new Error("Unable to find sencond key candinate");s=h?this.curve.pointFromX(s.add(this.curve.n),u):this.curve.pointFromX(s,u);var l=e.r.invm(o),d=o.sub(a).mul(l).umod(o),g=c.mul(l).umod(o);return this.g.mulAdd(d,s,g)},h.prototype.getKeyRecoveryParam=function(t,e,r,n){if(null!==(e=new f(e,n)).recoveryParam)return e.recoveryParam;for(var i=0;i<4;i++){var o;try{o=this.recoverPubKey(t,e,i)}catch(t){continue}if(o.eq(r))return i}throw new Error("Unable to find valid recovery factor")}},function(t,e,r){"use strict";var n=r(6),i=r(151),o=r(11);function a(t){if(!(this instanceof a))return new a(t);this.hash=t.hash,this.predResist=!!t.predResist,this.outLen=this.hash.outSize,this.minEntropy=t.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var e=i.toArray(t.entropy,t.entropyEnc||"hex"),r=i.toArray(t.nonce,t.nonceEnc||"hex"),n=i.toArray(t.pers,t.persEnc||"hex");o(e.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(e,r,n)}t.exports=a,a.prototype._init=function(t,e,r){var n=t.concat(e).concat(r);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var i=0;i<this.V.length;i++)this.K[i]=0,this.V[i]=1;this._update(n),this._reseed=1,this.reseedInterval=281474976710656},a.prototype._hmac=function(){return new n.hmac(this.hash,this.K)},a.prototype._update=function(t){var e=this._hmac().update(this.V).update([0]);t&&(e=e.update(t)),this.K=e.digest(),this.V=this._hmac().update(this.V).digest(),t&&(this.K=this._hmac().update(this.V).update([1]).update(t).digest(),this.V=this._hmac().update(this.V).digest())},a.prototype.reseed=function(t,e,r,n){"string"!=typeof e&&(n=r,r=e,e=null),t=i.toArray(t,e),r=i.toArray(r,n),o(t.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(t.concat(r||[])),this._reseed=1},a.prototype.generate=function(t,e,r,n){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");"string"!=typeof e&&(n=r,r=e,e=null),r&&(r=i.toArray(r,n||"hex"),this._update(r));for(var o=[];o.length<t;)this.V=this._hmac().update(this.V).digest(),o=o.concat(this.V);var a=o.slice(0,t);return this._update(r),this._reseed++,i.encode(a,e)}},function(t,e,r){"use strict";var n=r(2),i=r(12).assert;function o(t,e){this.ec=t,this.priv=null,this.pub=null,e.priv&&this._importPrivate(e.priv,e.privEnc),e.pub&&this._importPublic(e.pub,e.pubEnc)}t.exports=o,o.fromPublic=function(t,e,r){return e instanceof o?e:new o(t,{pub:e,pubEnc:r})},o.fromPrivate=function(t,e,r){return e instanceof o?e:new o(t,{priv:e,privEnc:r})},o.prototype.validate=function(){var t=this.getPublic();return t.isInfinity()?{result:!1,reason:"Invalid public key"}:t.validate()?t.mul(this.ec.curve.n).isInfinity()?{result:!0,reason:null}:{result:!1,reason:"Public key * N != O"}:{result:!1,reason:"Public key is not a point"}},o.prototype.getPublic=function(t,e){return"string"==typeof t&&(e=t,t=null),this.pub||(this.pub=this.ec.g.mul(this.priv)),e?this.pub.encode(e,t):this.pub},o.prototype.getPrivate=function(t){return"hex"===t?this.priv.toString(16,2):this.priv},o.prototype._importPrivate=function(t,e){this.priv=new n(t,e||16),this.priv=this.priv.umod(this.ec.curve.n)},o.prototype._importPublic=function(t,e){if(t.x||t.y)return"mont"===this.ec.curve.type?i(t.x,"Need x coordinate"):"short"!==this.ec.curve.type&&"edwards"!==this.ec.curve.type||i(t.x&&t.y,"Need both x and y coordinate"),void(this.pub=this.ec.curve.point(t.x,t.y));this.pub=this.ec.curve.decodePoint(t,e)},o.prototype.derive=function(t){return t.validate()||i(t.validate(),"public point not validated"),t.mul(this.priv).getX()},o.prototype.sign=function(t,e,r){return this.ec.sign(t,this,e,r)},o.prototype.verify=function(t,e){return this.ec.verify(t,e,this)},o.prototype.inspect=function(){return"<Key priv: "+(this.priv&&this.priv.toString(16,2))+" pub: "+(this.pub&&this.pub.inspect())+" >"}},function(t,e,r){"use strict";var n=r(2),i=r(12),o=i.assert;function a(t,e){if(t instanceof a)return t;this._importDER(t,e)||(o(t.r&&t.s,"Signature without r or s"),this.r=new n(t.r,16),this.s=new n(t.s,16),void 0===t.recoveryParam?this.recoveryParam=null:this.recoveryParam=t.recoveryParam)}function s(){this.place=0}function c(t,e){var r=t[e.place++];if(!(128&r))return r;var n=15&r;if(0===n||n>4)return!1;for(var i=0,o=0,a=e.place;o<n;o++,a++)i<<=8,i|=t[a],i>>>=0;return!(i<=127)&&(e.place=a,i)}function A(t){for(var e=0,r=t.length-1;!t[e]&&!(128&t[e+1])&&e<r;)e++;return 0===e?t:t.slice(e)}function u(t,e){if(e<128)t.push(e);else{var r=1+(Math.log(e)/Math.LN2>>>3);for(t.push(128|r);--r;)t.push(e>>>(r<<3)&255);t.push(e)}}t.exports=a,a.prototype._importDER=function(t,e){t=i.toArray(t,e);var r=new s;if(48!==t[r.place++])return!1;var o=c(t,r);if(!1===o)return!1;if(o+r.place!==t.length)return!1;if(2!==t[r.place++])return!1;var a=c(t,r);if(!1===a)return!1;var A=t.slice(r.place,a+r.place);if(r.place+=a,2!==t[r.place++])return!1;var u=c(t,r);if(!1===u)return!1;if(t.length!==u+r.place)return!1;var f=t.slice(r.place,u+r.place);if(0===A[0]){if(!(128&A[1]))return!1;A=A.slice(1)}if(0===f[0]){if(!(128&f[1]))return!1;f=f.slice(1)}return this.r=new n(A),this.s=new n(f),this.recoveryParam=null,!0},a.prototype.toDER=function(t){var e=this.r.toArray(),r=this.s.toArray();for(128&e[0]&&(e=[0].concat(e)),128&r[0]&&(r=[0].concat(r)),e=A(e),r=A(r);!(r[0]||128&r[1]);)r=r.slice(1);var n=[2];u(n,e.length),(n=n.concat(e)).push(2),u(n,r.length);var o=n.concat(r),a=[48];return u(a,o.length),a=a.concat(o),i.encode(a,t)}},function(t,e,r){"use strict";var n=r(6),i=r(75),o=r(12),a=o.assert,s=o.parseBytes,c=r(321),A=r(322);function u(t){if(a("ed25519"===t,"only tested with ed25519 so far"),!(this instanceof u))return new u(t);t=i[t].curve,this.curve=t,this.g=t.g,this.g.precompute(t.n.bitLength()+1),this.pointClass=t.point().constructor,this.encodingLength=Math.ceil(t.n.bitLength()/8),this.hash=n.sha512}t.exports=u,u.prototype.sign=function(t,e){t=s(t);var r=this.keyFromSecret(e),n=this.hashInt(r.messagePrefix(),t),i=this.g.mul(n),o=this.encodePoint(i),a=this.hashInt(o,r.pubBytes(),t).mul(r.priv()),c=n.add(a).umod(this.curve.n);return this.makeSignature({R:i,S:c,Rencoded:o})},u.prototype.verify=function(t,e,r){t=s(t),e=this.makeSignature(e);var n=this.keyFromPublic(r),i=this.hashInt(e.Rencoded(),n.pubBytes(),t),o=this.g.mul(e.S());return e.R().add(n.pub().mul(i)).eq(o)},u.prototype.hashInt=function(){for(var t=this.hash(),e=0;e<arguments.length;e++)t.update(arguments[e]);return o.intFromLE(t.digest()).umod(this.curve.n)},u.prototype.keyFromPublic=function(t){return c.fromPublic(this,t)},u.prototype.keyFromSecret=function(t){return c.fromSecret(this,t)},u.prototype.makeSignature=function(t){return t instanceof A?t:new A(this,t)},u.prototype.encodePoint=function(t){var e=t.getY().toArray("le",this.encodingLength);return e[this.encodingLength-1]|=t.getX().isOdd()?128:0,e},u.prototype.decodePoint=function(t){var e=(t=o.parseBytes(t)).length-1,r=t.slice(0,e).concat(-129&t[e]),n=0!=(128&t[e]),i=o.intFromLE(r);return this.curve.pointFromY(i,n)},u.prototype.encodeInt=function(t){return t.toArray("le",this.encodingLength)},u.prototype.decodeInt=function(t){return o.intFromLE(t)},u.prototype.isPoint=function(t){return t instanceof this.pointClass}},function(t,e,r){"use strict";var n=r(12),i=n.assert,o=n.parseBytes,a=n.cachedProperty;function s(t,e){this.eddsa=t,this._secret=o(e.secret),t.isPoint(e.pub)?this._pub=e.pub:this._pubBytes=o(e.pub)}s.fromPublic=function(t,e){return e instanceof s?e:new s(t,{pub:e})},s.fromSecret=function(t,e){return e instanceof s?e:new s(t,{secret:e})},s.prototype.secret=function(){return this._secret},a(s,"pubBytes",(function(){return this.eddsa.encodePoint(this.pub())})),a(s,"pub",(function(){return this._pubBytes?this.eddsa.decodePoint(this._pubBytes):this.eddsa.g.mul(this.priv())})),a(s,"privBytes",(function(){var t=this.eddsa,e=this.hash(),r=t.encodingLength-1,n=e.slice(0,t.encodingLength);return n[0]&=248,n[r]&=127,n[r]|=64,n})),a(s,"priv",(function(){return this.eddsa.decodeInt(this.privBytes())})),a(s,"hash",(function(){return this.eddsa.hash().update(this.secret()).digest()})),a(s,"messagePrefix",(function(){return this.hash().slice(this.eddsa.encodingLength)})),s.prototype.sign=function(t){return i(this._secret,"KeyPair can only verify"),this.eddsa.sign(t,this)},s.prototype.verify=function(t,e){return this.eddsa.verify(t,e,this)},s.prototype.getSecret=function(t){return i(this._secret,"KeyPair is public only"),n.encode(this.secret(),t)},s.prototype.getPublic=function(t){return n.encode(this.pubBytes(),t)},t.exports=s},function(t,e,r){"use strict";function n(t){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var i=r(2),o=r(12),a=o.assert,s=o.cachedProperty,c=o.parseBytes;function A(t,e){this.eddsa=t,"object"!==n(e)&&(e=c(e)),Array.isArray(e)&&(e={R:e.slice(0,t.encodingLength),S:e.slice(t.encodingLength)}),a(e.R&&e.S,"Signature without R or S"),t.isPoint(e.R)&&(this._R=e.R),e.S instanceof i&&(this._S=e.S),this._Rencoded=Array.isArray(e.R)?e.R:e.Rencoded,this._Sencoded=Array.isArray(e.S)?e.S:e.Sencoded}s(A,"S",(function(){return this.eddsa.decodeInt(this.Sencoded())})),s(A,"R",(function(){return this.eddsa.decodePoint(this.Rencoded())})),s(A,"Rencoded",(function(){return this.eddsa.encodePoint(this.R())})),s(A,"Sencoded",(function(){return this.eddsa.encodeInt(this.S())})),A.prototype.toBytes=function(){return this.Rencoded().concat(this.Sencoded())},A.prototype.toHex=function(){return o.encode(this.toBytes(),"hex").toUpperCase()},t.exports=A},function(t,e,r){"use strict";var n=r(153);e.certificate=r(329);var i=n.define("RSAPrivateKey",(function(){this.seq().obj(this.key("version").int(),this.key("modulus").int(),this.key("publicExponent").int(),this.key("privateExponent").int(),this.key("prime1").int(),this.key("prime2").int(),this.key("exponent1").int(),this.key("exponent2").int(),this.key("coefficient").int())}));e.RSAPrivateKey=i;var o=n.define("RSAPublicKey",(function(){this.seq().obj(this.key("modulus").int(),this.key("publicExponent").int())}));e.RSAPublicKey=o;var a=n.define("SubjectPublicKeyInfo",(function(){this.seq().obj(this.key("algorithm").use(s),this.key("subjectPublicKey").bitstr())}));e.PublicKey=a;var s=n.define("AlgorithmIdentifier",(function(){this.seq().obj(this.key("algorithm").objid(),this.key("none").null_().optional(),this.key("curve").objid().optional(),this.key("params").seq().obj(this.key("p").int(),this.key("q").int(),this.key("g").int()).optional())})),c=n.define("PrivateKeyInfo",(function(){this.seq().obj(this.key("version").int(),this.key("algorithm").use(s),this.key("subjectPrivateKey").octstr())}));e.PrivateKey=c;var A=n.define("EncryptedPrivateKeyInfo",(function(){this.seq().obj(this.key("algorithm").seq().obj(this.key("id").objid(),this.key("decrypt").seq().obj(this.key("kde").seq().obj(this.key("id").objid(),this.key("kdeparams").seq().obj(this.key("salt").octstr(),this.key("iters").int())),this.key("cipher").seq().obj(this.key("algo").objid(),this.key("iv").octstr()))),this.key("subjectPrivateKey").octstr())}));e.EncryptedPrivateKey=A;var u=n.define("DSAPrivateKey",(function(){this.seq().obj(this.key("version").int(),this.key("p").int(),this.key("q").int(),this.key("g").int(),this.key("pub_key").int(),this.key("priv_key").int())}));e.DSAPrivateKey=u,e.DSAparam=n.define("DSAparam",(function(){this.int()}));var f=n.define("ECPrivateKey",(function(){this.seq().obj(this.key("version").int(),this.key("privateKey").octstr(),this.key("parameters").optional().explicit(0).use(h),this.key("publicKey").optional().explicit(1).bitstr())}));e.ECPrivateKey=f;var h=n.define("ECParameters",(function(){this.choice({namedCurve:this.objid()})}));e.signature=n.define("signature",(function(){this.seq().obj(this.key("r").int(),this.key("s").int())}))},function(t,e,r){"use strict";var n=r(154),i=r(156),o=r(3);function a(t,e){this.name=t,this.body=e,this.decoders={},this.encoders={}}e.define=function(t,e){return new a(t,e)},a.prototype._createNamed=function(t){var e=this.name;function r(t){this._initNamed(t,e)}return o(r,t),r.prototype._initNamed=function(e,r){t.call(this,e,r)},new r(this)},a.prototype._getDecoder=function(t){return t=t||"der",this.decoders.hasOwnProperty(t)||(this.decoders[t]=this._createNamed(i[t])),this.decoders[t]},a.prototype.decode=function(t,e,r){return this._getDecoder(e).decode(t,r)},a.prototype._getEncoder=function(t){return t=t||"der",this.encoders.hasOwnProperty(t)||(this.encoders[t]=this._createNamed(n[t])),this.encoders[t]},a.prototype.encode=function(t,e,r){return this._getEncoder(e).encode(t,r)}},function(t,e,r){"use strict";var n=r(3),i=r(155);function o(t){i.call(this,t),this.enc="pem"}n(o,i),t.exports=o,o.prototype.encode=function(t,e){for(var r=i.prototype.encode.call(this,t).toString("base64"),n=["-----BEGIN "+e.label+"-----"],o=0;o<r.length;o+=64)n.push(r.slice(o,o+64));return n.push("-----END "+e.label+"-----"),n.join("\n")}},function(t,e,r){"use strict";var n=r(3),i=r(76).Buffer,o=r(157);function a(t){o.call(this,t),this.enc="pem"}n(a,o),t.exports=a,a.prototype.decode=function(t,e){for(var r=t.toString().split(/[\r\n]+/g),n=e.label.toUpperCase(),a=/^-----(BEGIN|END) ([^-]+)-----$/,s=-1,c=-1,A=0;A<r.length;A++){var u=r[A].match(a);if(null!==u&&u[2]===n){if(-1!==s){if("END"!==u[1])break;c=A;break}if("BEGIN"!==u[1])break;s=A}}if(-1===s||-1===c)throw new Error("PEM section not found for: "+n);var f=r.slice(s+1,c).join("");f.replace(/[^a-z0-9+/=]+/gi,"");var h=i.from(f,"base64");return o.prototype.decode.call(this,h,e)}},function(t,e,r){"use strict";var n=e;n.Reporter=r(78).Reporter,n.DecoderBuffer=r(36).DecoderBuffer,n.EncoderBuffer=r(36).EncoderBuffer,n.Node=r(77)},function(t,e,r){"use strict";var n=e;n._reverse=function(t){var e={};return Object.keys(t).forEach((function(r){(0|r)==r&&(r|=0);var n=t[r];e[n]=r})),e},n.der=r(79)},function(t,e,r){"use strict";var n=r(153),i=n.define("Time",(function(){this.choice({utcTime:this.utctime(),generalTime:this.gentime()})})),o=n.define("AttributeTypeValue",(function(){this.seq().obj(this.key("type").objid(),this.key("value").any())})),a=n.define("AlgorithmIdentifier",(function(){this.seq().obj(this.key("algorithm").objid(),this.key("parameters").optional(),this.key("curve").objid().optional())})),s=n.define("SubjectPublicKeyInfo",(function(){this.seq().obj(this.key("algorithm").use(a),this.key("subjectPublicKey").bitstr())})),c=n.define("RelativeDistinguishedName",(function(){this.setof(o)})),A=n.define("RDNSequence",(function(){this.seqof(c)})),u=n.define("Name",(function(){this.choice({rdnSequence:this.use(A)})})),f=n.define("Validity",(function(){this.seq().obj(this.key("notBefore").use(i),this.key("notAfter").use(i))})),h=n.define("Extension",(function(){this.seq().obj(this.key("extnID").objid(),this.key("critical").bool().def(!1),this.key("extnValue").octstr())})),l=n.define("TBSCertificate",(function(){this.seq().obj(this.key("version").explicit(0).int().optional(),this.key("serialNumber").int(),this.key("signature").use(a),this.key("issuer").use(u),this.key("validity").use(f),this.key("subject").use(u),this.key("subjectPublicKeyInfo").use(s),this.key("issuerUniqueID").implicit(1).bitstr().optional(),this.key("subjectUniqueID").implicit(2).bitstr().optional(),this.key("extensions").explicit(3).seqof(h).optional())})),d=n.define("X509Certificate",(function(){this.seq().obj(this.key("tbsCertificate").use(l),this.key("signatureAlgorithm").use(a),this.key("signatureValue").bitstr())}));t.exports=d},function(t){t.exports=JSON.parse('{"2.16.840.1.101.3.4.1.1":"aes-128-ecb","2.16.840.1.101.3.4.1.2":"aes-128-cbc","2.16.840.1.101.3.4.1.3":"aes-128-ofb","2.16.840.1.101.3.4.1.4":"aes-128-cfb","2.16.840.1.101.3.4.1.21":"aes-192-ecb","2.16.840.1.101.3.4.1.22":"aes-192-cbc","2.16.840.1.101.3.4.1.23":"aes-192-ofb","2.16.840.1.101.3.4.1.24":"aes-192-cfb","2.16.840.1.101.3.4.1.41":"aes-256-ecb","2.16.840.1.101.3.4.1.42":"aes-256-cbc","2.16.840.1.101.3.4.1.43":"aes-256-ofb","2.16.840.1.101.3.4.1.44":"aes-256-cfb"}')},function(t,e,r){var n=/Proc-Type: 4,ENCRYPTED[\n\r]+DEK-Info: AES-((?:128)|(?:192)|(?:256))-CBC,([0-9A-H]+)[\n\r]+([0-9A-z\n\r+/=]+)[\n\r]+/m,i=/^-----BEGIN ((?:.*? KEY)|CERTIFICATE)-----/m,o=/^-----BEGIN ((?:.*? KEY)|CERTIFICATE)-----([0-9A-z\n\r+/=]+)-----END \1-----$/m,a=r(47),s=r(70),c=r(4).Buffer;t.exports=function(t,e){var r,A=t.toString(),u=A.match(n);if(u){var f="aes"+u[1],h=c.from(u[2],"hex"),l=c.from(u[3].replace(/[\r\n]/g,""),"base64"),d=a(e,h.slice(0,8),parseInt(u[1],10)).key,g=[],p=s.createDecipheriv(f,d,h);g.push(p.update(l)),g.push(p.final()),r=c.concat(g)}else{var y=A.match(o);r=c.from(y[2].replace(/[\r\n]/g,""),"base64")}return{tag:A.match(i)[1],data:r}}},function(t,e,r){var n=r(4).Buffer,i=r(2),o=r(74).ec,a=r(49),s=r(158);function c(t,e){if(t.cmpn(0)<=0)throw new Error("invalid sig");if(t.cmp(e)>=e)throw new Error("invalid sig")}t.exports=function(t,e,r,A,u){var f=a(r);if("ec"===f.type){if("ecdsa"!==A&&"ecdsa/rsa"!==A)throw new Error("wrong public key type");return function(t,e,r){var n=s[r.data.algorithm.curve.join(".")];if(!n)throw new Error("unknown curve "+r.data.algorithm.curve.join("."));var i=new o(n),a=r.data.subjectPrivateKey.data;return i.verify(e,t,a)}(t,e,f)}if("dsa"===f.type){if("dsa"!==A)throw new Error("wrong public key type");return function(t,e,r){var n=r.data.p,o=r.data.q,s=r.data.g,A=r.data.pub_key,u=a.signature.decode(t,"der"),f=u.s,h=u.r;c(f,o),c(h,o);var l=i.mont(n),d=f.invm(o);return 0===s.toRed(l).redPow(new i(e).mul(d).mod(o)).fromRed().mul(A.toRed(l).redPow(h.mul(d).mod(o)).fromRed()).mod(n).mod(o).cmp(h)}(t,e,f)}if("rsa"!==A&&"ecdsa/rsa"!==A)throw new Error("wrong public key type");e=n.concat([u,e]);for(var h=f.modulus.byteLength(),l=[1],d=0;e.length+l.length+2<h;)l.push(255),d++;l.push(0);for(var g=-1;++g<e.length;)l.push(e[g]);l=n.from(l);var p=i.mont(f.modulus);t=(t=new i(t).toRed(p)).redPow(new i(f.publicExponent)),t=n.from(t.fromRed().toArray());var y=d<8?1:0;for(h=Math.min(t.length,l.length),t.length!==l.length&&(y=1),g=-1;++g<h;)y|=t[g]^l[g];return 0===y}},function(t,e,r){var n=r(49),i=r(19),o=r(23),a=r(161),s=r(162),c=r(2),A=r(163),u=r(73),f=r(4).Buffer;t.exports=function(t,e,r){var h;h=t.padding?t.padding:r?1:4;var l,d=n(t);if(4===h)l=function(t,e){var r=t.modulus.byteLength(),n=e.length,A=o("sha1").update(f.alloc(0)).digest(),u=A.length,h=2*u;if(n>r-h-2)throw new Error("message too long");var l=f.alloc(r-n-h-2),d=r-u-1,g=i(u),p=s(f.concat([A,l,f.alloc(1,1),e],d),a(g,d)),y=s(g,a(p,u));return new c(f.concat([f.alloc(1),y,p],r))}(d,e);else if(1===h)l=function(t,e,r){var n,o=e.length,a=t.modulus.byteLength();if(o>a-11)throw new Error("message too long");n=r?f.alloc(a-o-3,255):function(t){var e,r=f.allocUnsafe(t),n=0,o=i(2*t),a=0;for(;n<t;)a===o.length&&(o=i(2*t),a=0),(e=o[a++])&&(r[n++]=e);return r}(a-o-3);return new c(f.concat([f.from([0,r?1:2]),n,f.alloc(1),e],a))}(d,e,r);else{if(3!==h)throw new Error("unknown padding");if((l=new c(e)).cmp(d.modulus)>=0)throw new Error("data too long for modulus")}return r?u(l,d):A(l,d)}},function(t,e,r){var n=r(49),i=r(161),o=r(162),a=r(2),s=r(73),c=r(23),A=r(163),u=r(4).Buffer;t.exports=function(t,e,r){var f;f=t.padding?t.padding:r?1:4;var h,l=n(t),d=l.modulus.byteLength();if(e.length>d||new a(e).cmp(l.modulus)>=0)throw new Error("decryption error");h=r?A(new a(e),l):s(e,l);var g=u.alloc(d-h.length);if(h=u.concat([g,h],d),4===f)return function(t,e){var r=t.modulus.byteLength(),n=c("sha1").update(u.alloc(0)).digest(),a=n.length;if(0!==e[0])throw new Error("decryption error");var s=e.slice(1,a+1),A=e.slice(a+1),f=o(s,i(A,a)),h=o(A,i(f,r-a-1));if(function(t,e){t=u.from(t),e=u.from(e);var r=0,n=t.length;t.length!==e.length&&(r++,n=Math.min(t.length,e.length));var i=-1;for(;++i<n;)r+=t[i]^e[i];return r}(n,h.slice(0,a)))throw new Error("decryption error");var l=a;for(;0===h[l];)l++;if(1!==h[l++])throw new Error("decryption error");return h.slice(l)}(l,h);if(1===f)return function(t,e,r){var n=e.slice(0,2),i=2,o=0;for(;0!==e[i++];)if(i>=e.length){o++;break}var a=e.slice(2,i-1);("0002"!==n.toString("hex")&&!r||"0001"!==n.toString("hex")&&r)&&o++;a.length<8&&o++;if(o)throw new Error("decryption error");return e.slice(i)}(0,h,r);if(3===f)return h;throw new Error("unknown padding")}},function(t,e,r){(function(e){var n=r(63).Transform,i=r(3);function o(t){n.call(this,t),this._destroyed=!1}function a(t,e,r){r(null,t)}function s(t){return function(e,r,n){return"function"==typeof e&&(n=r,r=e,e={}),"function"!=typeof r&&(r=a),"function"!=typeof n&&(n=null),t(e,r,n)}}i(o,n),o.prototype.destroy=function(t){if(!this._destroyed){this._destroyed=!0;var r=this;e.nextTick((function(){t&&r.emit("error",t),r.emit("close")}))}},t.exports=s((function(t,e,r){var n=new o(t);return n._transform=e,r&&(n._flush=r),n})),t.exports.ctor=s((function(t,e,r){function n(e){if(!(this instanceof n))return new n(e);this.options=Object.assign({},t,e),o.call(this,this.options)}return i(n,o),n.prototype._transform=e,r&&(n.prototype._flush=r),n})),t.exports.obj=s((function(t,e,r){var n=new o(Object.assign({objectMode:!0,highWaterMark:16},t));return n._transform=e,r&&(n._flush=r),n}))}).call(this,r(9))},function(t,e){var r={}.toString;t.exports=Array.isArray||function(t){return"[object Array]"==r.call(t)}},function(t,e,r){(function(t){var n=r(37),i=r(20),o=r(21);function a(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function s(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?a(Object(r),!0).forEach((function(e){n(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):a(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}var c,A=r(38);A.Platform()===A.PLATFORM_NODE&&(globalThis.Response=r(98).Response,c=r(338));var u=r(97),f=r(100),h=f.ValidatePresence,l=f.ValidateWriteToken,d=f.ValidatePartHash,g=f.ValidateParameters;e.ListFiles=function(){var t=o(i.mark((function t(e){var r,n,o,a;return i.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=e.libraryId,n=e.objectId,o=e.versionHash,g({libraryId:r,objectId:n,versionHash:o}),o&&(n=this.utils.DecodeVersionHash(o).objectId),a=u("q",o||n,"meta","files"),t.t0=this.utils,t.t1=this.HttpClient,t.next=8,this.authClient.AuthorizationHeader({libraryId:r,objectId:n,versionHash:o});case 8:return t.t2=t.sent,t.t3=a,t.t4={headers:t.t2,method:"GET",path:t.t3},t.t5=t.t1.Request.call(t.t1,t.t4),t.abrupt("return",t.t0.ResponseToJson.call(t.t0,t.t5));case 13:case"end":return t.stop()}}),t,this)})));return function(e){return t.apply(this,arguments)}}(),e.UploadFilesFromS3=function(){var e=o(i.mark((function e(r){var n,o,a,c,A,u,f,h,d,p,y,I,b,v,E,m,C,w,B,Q,k,S,_,D,x,M,R,O,N;return i.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n=r.libraryId,o=r.objectId,a=r.writeToken,c=r.region,A=r.bucket,u=r.fileInfo,f=r.accessKey,h=r.secret,d=r.signedUrl,p=r.encryption,y=void 0===p?"none":p,I=r.copy,b=void 0!==I&&I,v=r.callback,g({libraryId:n,objectId:o}),l(a),E=/^s3:\/\/([^/]+)\//i,m=0;case 5:if(!(m<u.length)){e.next=18;break}if(C=u[m].source,!(w=E.exec(C))){e.next=15;break}if(w[1]===A){e.next=14;break}throw Error('Full S3 file path "'+C+"\" specified, but does not match provided bucket name '"+A+"'");case 14:u[m].source=C.replace(E,"");case 15:m++,e.next=5;break;case 18:if(this.Log("Uploading files from S3: ".concat(n," ").concat(o," ").concat(a)),"cgck"!==y){e.next=25;break}return e.next=22,this.EncryptionConk({libraryId:n,objectId:o,writeToken:a});case 22:Q=s(s({},Q=e.sent),{},{secret_key:""}),B="kp__".concat(this.utils.B58(t.from(JSON.stringify(Q))));case 25:return k={access_key_id:f,secret_access_key:h},d&&(k={signed_url:d}),S={encryption_key:B,access:{protocol:"s3",platform:"aws",path:A,storage_endpoint:{region:c},cloud_credentials:k}},_=u.map((function(t){return b?{op:"ingest-copy",path:t.path,encryption:{scheme:"cgck"===y?"cgck":"none"},ingest:{type:"key",path:t.source}}:{op:"add-reference",path:t.path,reference:{type:"key",path:t.source}}})),e.next=31,this.CreateFileUploadJob({libraryId:n,objectId:o,writeToken:a,ops:_,defaults:S});case 31:D=e.sent,x=D.id;case 33:return e.next=36,new Promise((function(t){return setTimeout(t,1e3)}));case 36:return e.next=38,this.UploadStatus({libraryId:n,objectId:o,writeToken:a,uploadId:x});case 38:if(!((M=e.sent).errors&&M.errors.length>1)){e.next=43;break}throw M.errors.join("\n");case 43:if(!M.error){e.next=48;break}throw this.Log("S3 file upload failed:\n".concat(JSON.stringify(M,null,2))),M.error;case 48:if("failed"!==M.status.toLowerCase()){e.next=50;break}throw"File upload failed";case 50:if(R=!1,b?(R=M.ingest_copy.done,v&&(O=M.ingest_copy.progress,v({done:R,uploaded:O.bytes.completed,total:O.bytes.total,uploadedFiles:O.files.completed,totalFiles:O.files.total,fileStatus:O.files.details}))):(R=M.add_reference.done,v&&(N=M.add_reference.progress,v({done:R,uploadedFiles:N.completed,totalFiles:N.total}))),!R){e.next=54;break}return e.abrupt("break",56);case 54:e.next=33;break;case 56:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}(),e.UploadFiles=function(){var e=o(i.mark((function e(r){var n,a,A,u,f,d,p,y,I,b,v,E,m,C,w,B,Q,k,S,_,D,x,M,R,O,N,P,j,L,F=this;return i.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=r.libraryId,a=r.objectId,A=r.writeToken,u=r.fileInfo,f=r.encryption,d=void 0===f?"none":f,p=r.callback,g({libraryId:n,objectId:a}),l(A),h("fileInfo",u),this.Log("Uploading files: ".concat(n," ").concat(a," ").concat(A)),"cgck"!==d){e.next=9;break}return e.next=8,this.EncryptionConk({libraryId:n,objectId:a,writeToken:A});case 8:y=e.sent;case 9:for(I={},b={},v=u,u=[],E=0;E<v.length;E++)(m=s(s({},v[E]),{},{data:void 0})).path=m.path.replace(/^\/+/,""),"cgck"===d&&(m.encryption={scheme:"cgck"}),b[m.path]=v[E].data,m.type="file",I[m.path]={uploaded:0,total:m.size},u.push(m);return this.Log(u),p&&p(I),e.next=18,this.CreateFileUploadJob({libraryId:n,objectId:a,writeToken:A,ops:u,encryption:d});case 18:C=e.sent,w=C.id,B=C.jobs,this.Log("Upload ID: ".concat(w)),this.Log(B),524288e3,Q=[],k=0,S=0,_=function(){var e=o(i.mark((function e(){var r,o,s,u,f,h;return i.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:r=0;case 1:if(!(r<B.length)){e.next=31;break}case 2:if(!(k-S>524288e3)){e.next=7;break}return e.next=5,new Promise((function(t){return setTimeout(t,500)}));case 5:e.next=2;break;case 7:return o=B[r],e.next=10,F.UploadJobStatus({libraryId:n,objectId:a,writeToken:A,uploadId:w,jobId:o});case 10:s=e.sent,u=0;case 12:if(!(u<s.files.length)){e.next=25;break}if(f=s.files[u],h=void 0,"number"==typeof b[f.path]?(h=t.alloc(f.len),c.readSync(b[f.path],h,0,f.len,f.off)):h=b[f.path].slice(f.off,f.off+f.len),"cgck"!==d){e.next=20;break}return e.next=19,F.Crypto.Encrypt(y,h);case 19:h=e.sent;case 20:s.files[u].data=h,k+=f.len;case 22:u++,e.next=12;break;case 25:return Q[r]=s,e.next=28,new Promise((function(t){return setTimeout(t,50)}));case 28:r++,e.next=1;break;case 31:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),D=function(){var t=o(i.mark((function t(e,r){var o,c,u,f;return i.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(Q[r]){t.next=5;break}return t.next=3,new Promise((function(t){return setTimeout(t,500)}));case 3:t.next=0;break;case 5:o=Q[r],c=o.files,u=i.mark((function t(){var o,u,h;return i.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:o=c[f],u=0,h=!1;case 3:return t.prev=3,t.next=6,F.UploadFileData({libraryId:n,objectId:a,writeToken:A,uploadId:w,jobId:e,filePath:o.path,fileData:o.data,encryption:d});case 6:h=!0,t.next=17;break;case 9:if(t.prev=9,t.t0=t.catch(3),F.Log(t.t0,!0),!((u+=1)>=10)){t.next=15;break}throw t.t0;case 15:return t.next=17,new Promise((function(t){return setTimeout(t,10*u*1e3)}));case 17:if(!h&&u<10){t.next=3;break}case 18:delete Q[r].files[f].data,S+=o.len,p&&(I[o.path]=s(s({},I[o.path]),{},{uploaded:I[o.path].uploaded+o.len}),p(I));case 21:case"end":return t.stop()}}),t,null,[[3,9]])})),f=0;case 9:if(!(f<c.length)){t.next=14;break}return t.delegateYield(u(),"t0",11);case 11:f++,t.next=9;break;case 14:case"end":return t.stop()}}),t)})));return function(e,r){return t.apply(this,arguments)}}(),_().catch((function(t){throw t})),x=Math.min(3,B.length),M=[],R=0;case 33:if(!(R<x)){e.next=43;break}return O=(new Date).getTime(),e.next=37,D(B[R],R);case 37:N=((new Date).getTime()-O)/1e3,P=Q[R].files.map((function(t){return t.len})).reduce((function(t,e){return t+e}),0),M.push(P/N/1048576);case 40:R++,e.next=33;break;case 43:return j=M.reduce((function(t,e){return t+e}),0)/x,L=Math.min(5,Math.ceil(j/2)),e.next=47,this.utils.LimitedMap(L,B,function(){var t=o(i.mark((function t(e,r){return i.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!(r<x)){t.next=2;break}return t.abrupt("return");case 2:return t.next=4,D(e,r);case 4:case"end":return t.stop()}}),t)})));return function(e,r){return t.apply(this,arguments)}}());case 47:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}(),e.CreateFileUploadJob=function(){var t=o(i.mark((function t(e){var r,n,o,a,s,c,A,f,h,d;return i.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=e.libraryId,n=e.objectId,o=e.writeToken,a=e.ops,s=e.defaults,c=void 0===s?{}:s,A=e.encryption,f=void 0===A?"none":A,g({libraryId:r,objectId:n}),l(o),this.Log("Creating file upload job: ".concat(r," ").concat(n," ").concat(o)),this.Log(a),"cgck"===f&&(c.encryption={scheme:"cgck"}),h={seq:0,seq_complete:!0,defaults:c,ops:a},d=u("q",o,"file_jobs"),t.t0=this.utils,t.t1=this.HttpClient,t.next=12,this.authClient.AuthorizationHeader({libraryId:r,objectId:n,update:!0,encryption:f});case 12:return t.t2=t.sent,t.t3=d,t.t4=h,t.t5={headers:t.t2,method:"POST",path:t.t3,body:t.t4,allowFailover:!1},t.t6=t.t1.Request.call(t.t1,t.t5),t.abrupt("return",t.t0.ResponseToJson.call(t.t0,t.t6));case 18:case"end":return t.stop()}}),t,this)})));return function(e){return t.apply(this,arguments)}}(),e.UploadStatus=function(){var t=o(i.mark((function t(e){var r,n,o,a,s;return i.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=e.libraryId,n=e.objectId,o=e.writeToken,a=e.uploadId,g({libraryId:r,objectId:n}),l(o),s=u("q",o,"file_jobs",a),t.t0=this.utils,t.t1=this.HttpClient,t.next=8,this.authClient.AuthorizationHeader({libraryId:r,objectId:n,update:!0});case 8:return t.t2=t.sent,t.t3=s,t.t4={headers:t.t2,method:"GET",path:t.t3,allowFailover:!1},t.t5=t.t1.Request.call(t.t1,t.t4),t.abrupt("return",t.t0.ResponseToJson.call(t.t0,t.t5));case 13:case"end":return t.stop()}}),t,this)})));return function(e){return t.apply(this,arguments)}}(),e.UploadJobStatus=function(){var t=o(i.mark((function t(e){var r,n,o,a,s,c;return i.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=e.libraryId,n=e.objectId,o=e.writeToken,a=e.uploadId,s=e.jobId,g({libraryId:r,objectId:n}),l(o),c=u("q",o,"file_jobs",a,"uploads",s),t.t0=this.utils,t.t1=this.HttpClient,t.next=8,this.authClient.AuthorizationHeader({libraryId:r,objectId:n,update:!0});case 8:return t.t2=t.sent,t.t3=c,t.t4={headers:t.t2,method:"GET",path:t.t3,allowFailover:!1},t.t5=t.t1.Request.call(t.t1,t.t4),t.next=14,t.t0.ResponseToJson.call(t.t0,t.t5);case 14:return t.abrupt("return",t.sent);case 15:case"end":return t.stop()}}),t,this)})));return function(e){return t.apply(this,arguments)}}(),e.UploadFileData=function(){var t=o(i.mark((function t(e){var r,n,o,a,c,A,f,h,d,p,y;return i.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=e.libraryId,n=e.objectId,o=e.writeToken,a=e.encryption,c=e.uploadId,A=e.jobId,f=e.filePath,h=e.fileData,g({libraryId:r,objectId:n}),l(o),t.next=5,this.UploadJobStatus({libraryId:r,objectId:n,writeToken:o,uploadId:c,jobId:A});case 5:if(d=t.sent,p=d.files.find((function(t){return t.path==f})),a&&"none"!==a&&(p=p.encrypted),0!==p.rem){t.next=12;break}return t.abrupt("return");case 12:p.skip&&(h=h.slice(p.skip));case 13:return y=u("q",o,"file_jobs",c,A),t.t0=this.utils,t.t1=this.HttpClient,t.t2=y,t.t3=h,t.t4=s,t.t5={"Content-type":"application/octet-stream"},t.next=22,this.authClient.AuthorizationHeader({libraryId:r,objectId:n,update:!0});case 22:return t.t6=t.sent,t.t7=(0,t.t4)(t.t5,t.t6),t.t8={method:"POST",path:t.t2,body:t.t3,bodyType:"BINARY",headers:t.t7,allowFailover:!1,allowRetry:!1},t.t9=t.t1.Request.call(t.t1,t.t8),t.next=28,t.t0.ResponseToJson.call(t.t0,t.t9);case 28:return t.abrupt("return",t.sent);case 29:case"end":return t.stop()}}),t,this)})));return function(e){return t.apply(this,arguments)}}(),e.FinalizeUploadJob=function(){var t=o(i.mark((function t(e){var r,n,o,a;return i.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=e.libraryId,n=e.objectId,o=e.writeToken,g({libraryId:r,objectId:n}),l(o),this.Log("Finalizing upload job: ".concat(r," ").concat(n," ").concat(o)),a=u("q",o,"files"),t.t0=this.HttpClient,t.t1=a,t.next=9,this.authClient.AuthorizationHeader({libraryId:r,objectId:n,update:!0});case 9:return t.t2=t.sent,t.t3={method:"POST",path:t.t1,bodyType:"BINARY",headers:t.t2,allowFailover:!1},t.next=13,t.t0.Request.call(t.t0,t.t3);case 13:case"end":return t.stop()}}),t,this)})));return function(e){return t.apply(this,arguments)}}(),e.CreateFileDirectories=function(){var t=o(i.mark((function t(e){var r,n,o,a,s;return i.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=e.libraryId,n=e.objectId,o=e.writeToken,a=e.filePaths,g({libraryId:r,objectId:n}),l(o),this.Log("Creating Directories: ".concat(r," ").concat(n," ").concat(o)),this.Log(a),s=a.map((function(t){return{op:"add",type:"directory",path:t}})),t.next=8,this.CreateFileUploadJob({libraryId:r,objectId:n,writeToken:o,ops:s});case 8:case"end":return t.stop()}}),t,this)})));return function(e){return t.apply(this,arguments)}}(),e.DeleteFiles=function(){var t=o(i.mark((function t(e){var r,n,o,a,s;return i.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=e.libraryId,n=e.objectId,o=e.writeToken,a=e.filePaths,g({libraryId:r,objectId:n}),l(o),this.Log("Deleting Files: ".concat(r," ").concat(n," ").concat(o)),this.Log(a),s=a.map((function(t){return{op:"del",path:t}})),t.next=8,this.CreateFileUploadJob({libraryId:r,objectId:n,writeToken:o,ops:s});case 8:case"end":return t.stop()}}),t,this)})));return function(e){return t.apply(this,arguments)}}(),e.DownloadFile=function(){var t=o(i.mark((function t(e){var r,n,o,a,c,A,f,l,d,p,y,I,b,v,E,m,C,w,B,Q,k,S=arguments;return i.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=e.libraryId,n=e.objectId,o=e.versionHash,a=e.writeToken,c=e.filePath,A=e.format,f=void 0===A?"arrayBuffer":A,l=e.chunked,d=void 0!==l&&l,p=e.chunkSize,y=e.clientSideDecryption,I=void 0!==y&&y,b=e.callback,g({libraryId:r,objectId:n,versionHash:o}),h("filePath",c),o&&(n=this.utils.DecodeVersionHash(o).objectId),t.next=6,this.ContentObjectMetadata({libraryId:r,objectId:n,versionHash:o,writeToken:a,metadataSubtree:u("files",c)});case 6:return v=t.sent,E=v&&v["."].encryption&&"cgck"===v["."].encryption.scheme,m=E?"cgck":void 0,C=E&&!I?u("q",a||o||n,"rep","files_download",c):u("q",a||o||n,"files",c),t.next=12,this.authClient.AuthorizationHeader({libraryId:r,objectId:n,versionHash:o,encryption:m,makeAccessRequest:"cgck"===m});case 12:return(w=t.sent).Accept="*/*",B="eluv.caps.iusr".concat(this.utils.AddressToHash(this.signer.address)),t.next=17,this.ContentObjectMetadata({libraryId:r,objectId:n,versionHash:o,metadataSubtree:B});case 17:if(Q=t.sent,t.t1=E,!t.t1){t.next=26;break}return t.t2=this.utils,t.t3=this.signer.address,t.next=24,this.ContentObjectOwner({objectId:n});case 24:t.t4=t.sent,t.t1=!t.t2.EqualAddress.call(t.t2,t.t3,t.t4);case 26:if(t.t0=t.t1,!t.t0){t.next=29;break}t.t0=!Q;case 29:if(!t.t0){t.next=31;break}w["X-Content-Fabric-Decryption-Mode"]="reencrypt";case 31:if(E&&!I&&(w["X-Content-Fabric-Decryption-Mode"]="decrypt",p=Number.MAX_SAFE_INTEGER),k=v["."].size,!E||!I){t.next=51;break}return t.t5=this,t.next=37,this.EncryptionConk({libraryId:r,objectId:n,versionHash:o,download:!0});case 37:return t.t6=t.sent,t.t7=C,t.t8=k,t.t9=w,t.t10=b,t.t11=f,t.t12=I,t.t13=d,t.t14={conk:t.t6,downloadPath:t.t7,bytesTotal:t.t8,headers:t.t9,callback:t.t10,format:t.t11,clientSideDecryption:t.t12,chunked:t.t13},t.next=48,t.t5.DownloadEncrypted.call(t.t5,t.t14);case 48:return t.abrupt("return",t.sent);case 51:return p||(p=1e7),t.prev=52,t.next=55,this.Download({downloadPath:C,bytesTotal:k,headers:w,callback:b,format:f,chunked:d,chunkSize:p});case 55:return t.abrupt("return",t.sent);case 58:if(t.prev=58,t.t15=t.catch(52),!E||I){t.next=62;break}return t.abrupt("return",this.DownloadFile(s(s({},S[0]),{},{clientSideDecryption:!0})));case 62:throw t.t15;case 63:case"end":return t.stop()}}),t,this,[[52,58]])})));return function(e){return t.apply(this,arguments)}}(),e.ContentParts=function(){var t=o(i.mark((function t(e){var r,n,o,a,s;return i.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=e.libraryId,n=e.objectId,o=e.versionHash,g({libraryId:r,objectId:n,versionHash:o}),this.Log("Retrieving parts: ".concat(r," ").concat(n||o)),o&&(n=this.utils.DecodeVersionHash(o).objectId),a=u("q",o||n,"parts"),t.t0=this.utils,t.t1=this.HttpClient,t.next=9,this.authClient.AuthorizationHeader({libraryId:r,objectId:n,versionHash:o});case 9:return t.t2=t.sent,t.t3=a,t.t4={headers:t.t2,method:"GET",path:t.t3},t.t5=t.t1.Request.call(t.t1,t.t4),t.next=15,t.t0.ResponseToJson.call(t.t0,t.t5);case 15:return s=t.sent,t.abrupt("return",s.parts);case 17:case"end":return t.stop()}}),t,this)})));return function(e){return t.apply(this,arguments)}}(),e.ContentPart=function(){var t=o(i.mark((function t(e){var r,n,o,a,s;return i.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=e.libraryId,n=e.objectId,o=e.versionHash,a=e.partHash,g({libraryId:r,objectId:n,versionHash:o}),d(a),this.Log("Retrieving part: ".concat(r," ").concat(n||o," ").concat(a)),o&&(n=this.utils.DecodeVersionHash(o).objectId),s=u("q",o||n,"parts",a),t.t0=this.utils,t.t1=this.HttpClient,t.next=10,this.authClient.AuthorizationHeader({libraryId:r,objectId:n,versionHash:o});case 10:return t.t2=t.sent,t.t3=s,t.t4={headers:t.t2,method:"GET",path:t.t3},t.t5=t.t1.Request.call(t.t1,t.t4),t.next=16,t.t0.ResponseToJson.call(t.t0,t.t5);case 16:return t.abrupt("return",t.sent);case 17:case"end":return t.stop()}}),t,this)})));return function(e){return t.apply(this,arguments)}}(),e.DownloadPart=function(){var t=o(i.mark((function t(e){var r,n,o,a,s,c,A,f,h,l,p,y,I,b,v,E,m;return i.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=e.libraryId,n=e.objectId,o=e.versionHash,a=e.writeToken,s=e.partHash,c=e.format,A=void 0===c?"arrayBuffer":c,f=e.chunked,h=void 0!==f&&f,l=e.chunkSize,p=void 0===l?1e7:l,y=e.callback,g({libraryId:r,objectId:n,versionHash:o}),d(s),o&&(n=this.utils.DecodeVersionHash(o).objectId),I=s.startsWith("hqpe"),b=I?"cgck":void 0,v=u("q",a||o||n,"data",s),t.next=9,this.authClient.AuthorizationHeader({libraryId:r,objectId:n,versionHash:o,encryption:b,makeAccessRequest:!0});case 9:return E=t.sent,t.next=12,this.ContentPart({libraryId:r,objectId:n,versionHash:o,partHash:s});case 12:if(m=t.sent.part.size,!I){t.next=37;break}return t.t0=this.utils,t.t1=this.signer.address,t.next=18,this.ContentObjectOwner({objectId:n});case 18:if(t.t2=t.sent,t.t0.EqualAddress.call(t.t0,t.t1,t.t2)){t.next=21;break}E["X-Content-Fabric-Decryption-Mode"]="reencrypt";case 21:return t.t3=this,t.next=24,this.EncryptionConk({libraryId:r,objectId:n,download:!0});case 24:return t.t4=t.sent,t.t5=v,t.t6=m,t.t7=E,t.t8=y,t.t9=A,t.t10=h,t.t11={conk:t.t4,downloadPath:t.t5,bytesTotal:t.t6,headers:t.t7,callback:t.t8,format:t.t9,chunked:t.t10},t.next=34,t.t3.DownloadEncrypted.call(t.t3,t.t11);case 34:return t.abrupt("return",t.sent);case 37:return t.next=39,this.Download({downloadPath:v,bytesTotal:m,headers:E,callback:y,format:A,chunked:h,chunkSize:p});case 39:return t.abrupt("return",t.sent);case 40:case"end":return t.stop()}}),t,this)})));return function(e){return t.apply(this,arguments)}}(),e.Download=function(){var e=o(i.mark((function e(r){var n,o,a,s,c,A,u,f,h,l,d,g,p,y,I;return i.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=r.downloadPath,o=r.headers,a=r.bytesTotal,s=r.chunked,c=void 0!==s&&s,A=r.chunkSize,u=void 0===A?2e6:A,f=r.callback,h=r.format,l=void 0===h?"arrayBuffer":h,!c||f){e.next=3;break}throw Error("No callback specified for chunked download");case 3:c||(d=[]),g=0,p=Math.ceil(a/u),y=0;case 7:if(!(y<p)){e.next=35;break}return o.Range="bytes=".concat(g,"-").concat(g+u-1),e.next=11,this.HttpClient.Request({path:n,headers:o,method:"GET"});case 11:if(I=e.sent,g=Math.min(g+u,a),!c){e.next=24;break}return e.t0=f,e.t1=g,e.t2=a,e.next=19,this.utils.ResponseToFormat(l,I);case 19:e.t3=e.sent,e.t4={bytesFinished:e.t1,bytesTotal:e.t2,chunk:e.t3},(0,e.t0)(e.t4),e.next=32;break;case 24:return e.t5=d,e.t6=t,e.next=28,I.arrayBuffer();case 28:e.t7=e.sent,e.t8=e.t6.from.call(e.t6,e.t7),e.t5.push.call(e.t5,e.t8),f&&f({bytesFinished:g,bytesTotal:a});case 32:y++,e.next=7;break;case 35:if(c){e.next=39;break}return e.next=38,this.utils.ResponseToFormat(l,new Response(t.concat(d)));case 38:return e.abrupt("return",e.sent);case 39:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}(),e.DownloadEncrypted=function(){var e=o(i.mark((function e(r){var n,a,s,c,A,u,f,h,l,d,g,p,y,I,b,v,E,m=this;return i.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=r.conk,a=r.downloadPath,s=r.bytesTotal,c=r.headers,A=r.callback,u=r.format,f=void 0===u?"arrayBuffer":u,h=r.chunked,!(l=void 0!==h&&h)||A){e.next=3;break}throw Error("No callback specified for chunked download");case 3:return d=n.public_key.startsWith("ktpk"),g=this.Crypto.EncryptedBlockSize(1e6,d),p=0,f=f.toLowerCase(),y=[],e.next=10,this.Crypto.OpenDecryptionStream(n);case 10:(I=e.sent).on("data",function(){var t=o(i.mark((function t(e){var r;return i.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!l){t.next=13;break}if("buffer"===f){t.next=10;break}if(r=e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength),"arraybuffer"!==f){t.next=7;break}e=r,t.next=10;break;case 7:return t.next=9,m.utils.ResponseToFormat(f,new Response(r));case 9:e=t.sent;case 10:A({bytesFinished:p,bytesTotal:s,chunk:e}),t.next=15;break;case 13:A&&A({bytesFinished:p,bytesTotal:s}),y.push(e);case 15:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()),b=Math.ceil(s/g),v=0;case 14:if(!(v<b)){e.next=30;break}return c.Range="bytes=".concat(p,"-").concat(p+g-1),e.next=18,this.HttpClient.Request({headers:c,method:"GET",path:a});case 18:return E=e.sent,p=Math.min(p+g,s),e.t0=I,e.t1=Uint8Array,e.next=24,E.arrayBuffer();case 24:e.t2=e.sent,e.t3=new e.t1(e.t2),e.t0.write.call(e.t0,e.t3);case 27:v++,e.next=14;break;case 30:return I.end(),e.next=33,new Promise((function(t){return I.on("finish",(function(){t()}))}));case 33:if(l){e.next=37;break}return e.next=36,this.utils.ResponseToFormat(f,new Response(t.concat(y)));case 36:return e.abrupt("return",e.sent);case 37:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}(),e.CreatePart=function(){var t=o(i.mark((function t(e){var r,n,o,a,s,c;return i.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=e.libraryId,n=e.objectId,o=e.writeToken,a=e.encryption,g({libraryId:r,objectId:n}),l(o),s=u("q",o,"parts"),t.t0=this.utils,t.t1=this.HttpClient,t.next=8,this.authClient.AuthorizationHeader({libraryId:r,objectId:n,update:!0,encryption:a});case 8:return t.t2=t.sent,t.t3=s,t.t4={headers:t.t2,method:"POST",path:t.t3,bodyType:"BINARY",body:"",allowFailover:!1},t.t5=t.t1.Request.call(t.t1,t.t4),t.next=14,t.t0.ResponseToJson.call(t.t0,t.t5);case 14:return c=t.sent,t.abrupt("return",c.part.write_token);case 16:case"end":return t.stop()}}),t,this)})));return function(e){return t.apply(this,arguments)}}(),e.UploadPartChunk=function(){var t=o(i.mark((function t(e){var r,n,o,a,s,c,A,f;return i.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=e.libraryId,n=e.objectId,o=e.writeToken,a=e.partWriteToken,s=e.chunk,c=e.encryption,g({libraryId:r,objectId:n}),l(o),!c||"none"===c){t.next=10;break}return t.next=6,this.EncryptionConk({libraryId:r,objectId:n,writeToken:o});case 6:return A=t.sent,t.next=9,this.Crypto.Encrypt(A,s);case 9:s=t.sent;case 10:return f=u("q",o,"parts"),t.t0=this.utils,t.t1=this.HttpClient,t.next=15,this.authClient.AuthorizationHeader({libraryId:r,objectId:n,update:!0,encryption:c});case 15:return t.t2=t.sent,t.t3=u(f,a),t.t4=s,t.t5={headers:t.t2,method:"POST",path:t.t3,body:t.t4,bodyType:"BINARY",allowFailover:!1},t.t6=t.t1.Request.call(t.t1,t.t5),t.next=22,t.t0.ResponseToJson.call(t.t0,t.t6);case 22:case"end":return t.stop()}}),t,this)})));return function(e){return t.apply(this,arguments)}}(),e.FinalizePart=function(){var t=o(i.mark((function t(e){var r,n,o,a,s,c;return i.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=e.libraryId,n=e.objectId,o=e.writeToken,a=e.partWriteToken,s=e.encryption,g({libraryId:r,objectId:n}),l(o),c=u("q",o,"parts"),t.t0=this.utils,t.t1=this.HttpClient,t.next=8,this.authClient.AuthorizationHeader({libraryId:r,objectId:n,update:!0,encryption:s});case 8:return t.t2=t.sent,t.t3=u(c,a),t.t4={headers:t.t2,method:"POST",path:t.t3,bodyType:"BINARY",body:"",allowFailover:!1},t.next=13,t.t1.Request.call(t.t1,t.t4);case 13:return t.t5=t.sent,t.next=16,t.t0.ResponseToJson.call(t.t0,t.t5);case 16:return t.abrupt("return",t.sent);case 17:case"end":return t.stop()}}),t,this)})));return function(e){return t.apply(this,arguments)}}(),e.UploadPart=function(){var t=o(i.mark((function t(e){var r,n,o,a,s,c,A,u,f,h,d,p,y;return i.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=e.libraryId,n=e.objectId,o=e.writeToken,a=e.data,s=e.encryption,c=void 0===s?"none":s,A=e.chunkSize,u=void 0===A?1e7:A,f=e.callback,g({libraryId:r,objectId:n}),l(o),t.next=5,this.CreatePart({libraryId:r,objectId:n,writeToken:o,encryption:c});case 5:h=t.sent,d=a.length||a.byteLength||a.size,f&&f({bytesFinished:0,bytesTotal:d}),p=0;case 9:if(!(p<d)){t.next=17;break}return y=a.slice(p,p+u),t.next=13,this.UploadPartChunk({libraryId:r,objectId:n,writeToken:o,partWriteToken:h,chunk:y,encryption:c});case 13:f&&f({bytesFinished:Math.min(p+u,d),bytesTotal:d});case 14:p+=u,t.next=9;break;case 17:return t.next=19,this.FinalizePart({libraryId:r,objectId:n,writeToken:o,partWriteToken:h,encryption:c});case 19:return t.abrupt("return",t.sent);case 20:case"end":return t.stop()}}),t,this)})));return function(e){return t.apply(this,arguments)}}(),e.DeletePart=function(){var t=o(i.mark((function t(e){var r,n,o,a,s;return i.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=e.libraryId,n=e.objectId,o=e.writeToken,a=e.partHash,g({libraryId:r,objectId:n}),l(o),d(a),s=u("q",o,"parts",a),t.t0=this.HttpClient,t.next=8,this.authClient.AuthorizationHeader({libraryId:r,objectId:n,update:!0});case 8:return t.t1=t.sent,t.t2=s,t.t3={headers:t.t1,method:"DELETE",path:t.t2,allowFailover:!1},t.next=13,t.t0.Request.call(t.t0,t.t3);case 13:case"end":return t.stop()}}),t,this)})));return function(e){return t.apply(this,arguments)}}()}).call(this,r(5).Buffer)},function(t,e){},function(t,e,r){"use strict";r.r(e),r.d(e,"ethers",(function(){return c})),r.d(e,"Signer",(function(){return Gn})),r.d(e,"Wallet",(function(){return bs})),r.d(e,"VoidSigner",(function(){return Hn})),r.d(e,"getDefaultProvider",(function(){return qh})),r.d(e,"providers",(function(){return o})),r.d(e,"BaseContract",(function(){return Ki})),r.d(e,"Contract",(function(){return qi})),r.d(e,"ContractFactory",(function(){return Ji})),r.d(e,"BigNumber",(function(){return b})),r.d(e,"FixedNumber",(function(){return co})),r.d(e,"constants",(function(){return i})),r.d(e,"errors",(function(){return h.a})),r.d(e,"logger",(function(){return El})),r.d(e,"utils",(function(){return s})),r.d(e,"wordlists",(function(){return ia})),r.d(e,"version",(function(){return vl})),r.d(e,"Wordlist",(function(){return zo}));var n={};r.r(n),r.d(n,"encode",(function(){return tt})),r.d(n,"decode",(function(){return nt}));var i={};r.r(i),r.d(i,"AddressZero",(function(){return ms})),r.d(i,"NegativeOne",(function(){return Oe})),r.d(i,"Zero",(function(){return Ne})),r.d(i,"One",(function(){return Pe})),r.d(i,"Two",(function(){return je})),r.d(i,"WeiPerEther",(function(){return Le})),r.d(i,"MaxUint256",(function(){return Fe})),r.d(i,"MinInt256",(function(){return Te})),r.d(i,"MaxInt256",(function(){return Ue})),r.d(i,"HashZero",(function(){return Cs})),r.d(i,"EtherSymbol",(function(){return ws}));var o={};r.r(o),r.d(o,"Provider",(function(){return kn})),r.d(o,"BaseProvider",(function(){return dA})),r.d(o,"Resolver",(function(){return fA})),r.d(o,"UrlJsonRpcProvider",(function(){return bu})),r.d(o,"FallbackProvider",(function(){return qf})),r.d(o,"AlchemyProvider",(function(){return Ru})),r.d(o,"AlchemyWebSocketProvider",(function(){return Mu})),r.d(o,"AnkrProvider",(function(){return Yu})),r.d(o,"CloudflareProvider",(function(){return nf})),r.d(o,"EtherscanProvider",(function(){return mf})),r.d(o,"InfuraProvider",(function(){return sh})),r.d(o,"InfuraWebSocketProvider",(function(){return ah})),r.d(o,"JsonRpcProvider",(function(){return TA})),r.d(o,"JsonRpcBatchProvider",(function(){return gh})),r.d(o,"NodesmithProvider",(function(){return wh})),r.d(o,"PocketProvider",(function(){return Rh})),r.d(o,"StaticJsonRpcProvider",(function(){return Iu})),r.d(o,"Web3Provider",(function(){return Yh})),r.d(o,"WebSocketProvider",(function(){return ru})),r.d(o,"IpcProvider",(function(){return Jf})),r.d(o,"JsonRpcSigner",(function(){return jA})),r.d(o,"getDefaultProvider",(function(){return qh})),r.d(o,"getNetwork",(function(){return Ms})),r.d(o,"isCommunityResource",(function(){return Mc})),r.d(o,"isCommunityResourcable",(function(){return xc})),r.d(o,"showThrottleMessage",(function(){return Oc})),r.d(o,"Formatter",(function(){return Dc}));var a={};r.r(a),r.d(a,"decode",(function(){return Rs})),r.d(a,"encode",(function(){return Os}));var s={};r.r(s),r.d(s,"AbiCoder",(function(){return zr})),r.d(s,"defaultAbiCoder",(function(){return Zr})),r.d(s,"Fragment",(function(){return Dr})),r.d(s,"ConstructorFragment",(function(){return Nr})),r.d(s,"ErrorFragment",(function(){return Lr})),r.d(s,"EventFragment",(function(){return xr})),r.d(s,"FunctionFragment",(function(){return Pr})),r.d(s,"ParamType",(function(){return Sr})),r.d(s,"FormatTypes",(function(){return Qr})),r.d(s,"checkResultErrors",(function(){return Y})),r.d(s,"Logger",(function(){return h.b})),r.d(s,"RLP",(function(){return n})),r.d(s,"_fetchData",(function(){return mc})),r.d(s,"fetchJson",(function(){return Cc})),r.d(s,"poll",(function(){return wc})),r.d(s,"checkProperties",(function(){return R})),r.d(s,"deepCopy",(function(){return j})),r.d(s,"defineReadOnly",(function(){return D})),r.d(s,"getStatic",(function(){return x})),r.d(s,"resolveProperties",(function(){return M})),r.d(s,"shallowCopy",(function(){return O})),r.d(s,"arrayify",(function(){return A.a})),r.d(s,"concat",(function(){return A.b})),r.d(s,"stripZeros",(function(){return A.o})),r.d(s,"zeroPad",(function(){return A.p})),r.d(s,"isBytes",(function(){return A.j})),r.d(s,"isBytesLike",(function(){return A.k})),r.d(s,"defaultPath",(function(){return ga})),r.d(s,"HDNode",(function(){return pa})),r.d(s,"SigningKey",(function(){return Vn})),r.d(s,"Interface",(function(){return ln})),r.d(s,"LogDescription",(function(){return sn})),r.d(s,"TransactionDescription",(function(){return cn})),r.d(s,"base58",(function(){return Po})),r.d(s,"base64",(function(){return a})),r.d(s,"hexlify",(function(){return A.i})),r.d(s,"isHexString",(function(){return A.l})),r.d(s,"hexConcat",(function(){return A.c})),r.d(s,"hexStripZeros",(function(){return A.f})),r.d(s,"hexValue",(function(){return A.g})),r.d(s,"hexZeroPad",(function(){return A.h})),r.d(s,"hexDataLength",(function(){return A.d})),r.d(s,"hexDataSlice",(function(){return A.e})),r.d(s,"nameprep",(function(){return ul})),r.d(s,"_toEscapedUtf8String",(function(){return Bt})),r.d(s,"toUtf8Bytes",(function(){return Ct})),r.d(s,"toUtf8CodePoints",(function(){return St})),r.d(s,"toUtf8String",(function(){return kt})),r.d(s,"Utf8ErrorFuncs",(function(){return Et})),r.d(s,"formatBytes32String",(function(){return fl})),r.d(s,"parseBytes32String",(function(){return hl})),r.d(s,"dnsEncode",(function(){return fc})),r.d(s,"hashMessage",(function(){return fo})),r.d(s,"namehash",(function(){return uc})),r.d(s,"isValidName",(function(){return Ac})),r.d(s,"id",(function(){return _t})),r.d(s,"_TypedDataEncoder",(function(){return xo})),r.d(s,"getAddress",(function(){return ht})),r.d(s,"getIcapAddress",(function(){return dt})),r.d(s,"getContractAddress",(function(){return gt})),r.d(s,"getCreate2Address",(function(){return pt})),r.d(s,"isAddress",(function(){return lt})),r.d(s,"formatEther",(function(){return Il})),r.d(s,"parseEther",(function(){return bl})),r.d(s,"formatUnits",(function(){return pl})),r.d(s,"parseUnits",(function(){return yl})),r.d(s,"commify",(function(){return gl})),r.d(s,"computeHmac",(function(){return Ho})),r.d(s,"keccak256",(function(){return V})),r.d(s,"ripemd160",(function(){return To})),r.d(s,"sha256",(function(){return Uo})),r.d(s,"sha512",(function(){return Go})),r.d(s,"randomBytes",(function(){return ma.a})),r.d(s,"shuffled",(function(){return Cf})),r.d(s,"solidityPack",(function(){return Wh})),r.d(s,"solidityKeccak256",(function(){return Xh})),r.d(s,"soliditySha256",(function(){return $h})),r.d(s,"splitSignature",(function(){return A.n})),r.d(s,"joinSignature",(function(){return A.m})),r.d(s,"accessListify",(function(){return Ai})),r.d(s,"parseTransaction",(function(){return gi})),r.d(s,"serializeTransaction",(function(){return li})),r.d(s,"TransactionTypes",(function(){return $n})),r.d(s,"getJsonWalletAddress",(function(){return as})),r.d(s,"computeAddress",(function(){return oi})),r.d(s,"recoverAddress",(function(){return ai})),r.d(s,"computePublicKey",(function(){return Xn})),r.d(s,"recoverPublicKey",(function(){return Wn})),r.d(s,"verifyMessage",(function(){return vs})),r.d(s,"verifyTypedData",(function(){return Es})),r.d(s,"getAccountPath",(function(){return Ea})),r.d(s,"mnemonicToEntropy",(function(){return Ia})),r.d(s,"entropyToMnemonic",(function(){return ba})),r.d(s,"isValidMnemonic",(function(){return va})),r.d(s,"mnemonicToSeed",(function(){return ya})),r.d(s,"SupportedAlgorithm",(function(){return Oo})),r.d(s,"UnicodeNormalizationForm",(function(){return yt})),r.d(s,"Utf8ErrorReason",(function(){return It})),r.d(s,"Indexed",(function(){return un}));var c={};r.r(c),r.d(c,"Signer",(function(){return Gn})),r.d(c,"Wallet",(function(){return bs})),r.d(c,"VoidSigner",(function(){return Hn})),r.d(c,"getDefaultProvider",(function(){return qh})),r.d(c,"providers",(function(){return o})),r.d(c,"BaseContract",(function(){return Ki})),r.d(c,"Contract",(function(){return qi})),r.d(c,"ContractFactory",(function(){return Ji})),r.d(c,"BigNumber",(function(){return b})),r.d(c,"FixedNumber",(function(){return co})),r.d(c,"constants",(function(){return i})),r.d(c,"errors",(function(){return h.a})),r.d(c,"logger",(function(){return El})),r.d(c,"utils",(function(){return s})),r.d(c,"wordlists",(function(){return ia})),r.d(c,"version",(function(){return vl})),r.d(c,"Wordlist",(function(){return zo}));var A=r(0),u=r(2),f=r.n(u),h=r(1);function l(t){return(l="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function d(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,(i=n.key,o=void 0,o=function(t,e){if("object"!==l(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==l(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(i,"string"),"symbol"===l(o)?o:String(o)),n)}var i,o}var g=f.a.BN,p=new h.b("bignumber/5.7.0"),y={};var I=!1,b=function(){function t(e,r){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),e!==y&&p.throwError("cannot call constructor directly; use BigNumber.from",h.b.errors.UNSUPPORTED_OPERATION,{operation:"new (BigNumber)"}),this._hex=r,this._isBigNumber=!0,Object.freeze(this)}var e,r,n;return e=t,n=[{key:"from",value:function(e){if(e instanceof t)return e;if("string"==typeof e)return e.match(/^-?0x[0-9a-f]+$/i)?new t(y,v(e)):e.match(/^-?[0-9]+$/)?new t(y,v(new g(e))):p.throwArgumentError("invalid BigNumber string","value",e);if("number"==typeof e)return e%1&&C("underflow","BigNumber.from",e),(e>=9007199254740991||e<=-9007199254740991)&&C("overflow","BigNumber.from",e),t.from(String(e));var r=e;if("bigint"==typeof r)return t.from(r.toString());if(Object(A.j)(r))return t.from(Object(A.i)(r));if(r)if(r.toHexString){var n=r.toHexString();if("string"==typeof n)return t.from(n)}else{var i=r._hex;if(null==i&&"BigNumber"===r.type&&(i=r.hex),"string"==typeof i&&(Object(A.l)(i)||"-"===i[0]&&Object(A.l)(i.substring(1))))return t.from(i)}return p.throwArgumentError("invalid BigNumber value","value",e)}},{key:"isBigNumber",value:function(t){return!(!t||!t._isBigNumber)}}],(r=[{key:"fromTwos",value:function(t){return E(m(this).fromTwos(t))}},{key:"toTwos",value:function(t){return E(m(this).toTwos(t))}},{key:"abs",value:function(){return"-"===this._hex[0]?t.from(this._hex.substring(1)):this}},{key:"add",value:function(t){return E(m(this).add(m(t)))}},{key:"sub",value:function(t){return E(m(this).sub(m(t)))}},{key:"div",value:function(e){return t.from(e).isZero()&&C("division-by-zero","div"),E(m(this).div(m(e)))}},{key:"mul",value:function(t){return E(m(this).mul(m(t)))}},{key:"mod",value:function(t){var e=m(t);return e.isNeg()&&C("division-by-zero","mod"),E(m(this).umod(e))}},{key:"pow",value:function(t){var e=m(t);return e.isNeg()&&C("negative-power","pow"),E(m(this).pow(e))}},{key:"and",value:function(t){var e=m(t);return(this.isNegative()||e.isNeg())&&C("unbound-bitwise-result","and"),E(m(this).and(e))}},{key:"or",value:function(t){var e=m(t);return(this.isNegative()||e.isNeg())&&C("unbound-bitwise-result","or"),E(m(this).or(e))}},{key:"xor",value:function(t){var e=m(t);return(this.isNegative()||e.isNeg())&&C("unbound-bitwise-result","xor"),E(m(this).xor(e))}},{key:"mask",value:function(t){return(this.isNegative()||t<0)&&C("negative-width","mask"),E(m(this).maskn(t))}},{key:"shl",value:function(t){return(this.isNegative()||t<0)&&C("negative-width","shl"),E(m(this).shln(t))}},{key:"shr",value:function(t){return(this.isNegative()||t<0)&&C("negative-width","shr"),E(m(this).shrn(t))}},{key:"eq",value:function(t){return m(this).eq(m(t))}},{key:"lt",value:function(t){return m(this).lt(m(t))}},{key:"lte",value:function(t){return m(this).lte(m(t))}},{key:"gt",value:function(t){return m(this).gt(m(t))}},{key:"gte",value:function(t){return m(this).gte(m(t))}},{key:"isNegative",value:function(){return"-"===this._hex[0]}},{key:"isZero",value:function(){return m(this).isZero()}},{key:"toNumber",value:function(){try{return m(this).toNumber()}catch(t){C("overflow","toNumber",this.toString())}return null}},{key:"toBigInt",value:function(){try{return BigInt(this.toString())}catch(t){}return p.throwError("this platform does not support BigInt",h.b.errors.UNSUPPORTED_OPERATION,{value:this.toString()})}},{key:"toString",value:function(){return arguments.length>0&&(10===arguments[0]?I||(I=!0,p.warn("BigNumber.toString does not accept any parameters; base-10 is assumed")):16===arguments[0]?p.throwError("BigNumber.toString does not accept any parameters; use bigNumber.toHexString()",h.b.errors.UNEXPECTED_ARGUMENT,{}):p.throwError("BigNumber.toString does not accept parameters",h.b.errors.UNEXPECTED_ARGUMENT,{})),m(this).toString(10)}},{key:"toHexString",value:function(){return this._hex}},{key:"toJSON",value:function(t){return{type:"BigNumber",hex:this.toHexString()}}}])&&d(e.prototype,r),n&&d(e,n),Object.defineProperty(e,"prototype",{writable:!1}),t}();function v(t){if("string"!=typeof t)return v(t.toString(16));if("-"===t[0])return"-"===(t=t.substring(1))[0]&&p.throwArgumentError("invalid hex","value",t),"0x00"===(t=v(t))?t:"-"+t;if("0x"!==t.substring(0,2)&&(t="0x"+t),"0x"===t)return"0x00";for(t.length%2&&(t="0x0"+t.substring(2));t.length>4&&"0x00"===t.substring(0,4);)t="0x"+t.substring(4);return t}function E(t){return b.from(v(t))}function m(t){var e=b.from(t).toHexString();return"-"===e[0]?new g("-"+e.substring(3),16):new g(e.substring(2),16)}function C(t,e,r){var n={fault:t,operation:e};return null!=r&&(n.value=r),p.throwError(t,h.b.errors.NUMERIC_FAULT,n)}function w(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,(i=n.key,o=void 0,o=function(t,e){if("object"!==k(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==k(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(i,"string"),"symbol"===k(o)?o:String(o)),n)}var i,o}function B(t,e,r){return e&&w(t.prototype,e),r&&w(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function Q(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */Q=function(){return t};var t={},e=Object.prototype,r=e.hasOwnProperty,n=Object.defineProperty||function(t,e,r){t[e]=r.value},i="function"==typeof Symbol?Symbol:{},o=i.iterator||"@@iterator",a=i.asyncIterator||"@@asyncIterator",s=i.toStringTag||"@@toStringTag";function c(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{c({},"")}catch(t){c=function(t,e,r){return t[e]=r}}function A(t,e,r,i){var o=e&&e.prototype instanceof h?e:h,a=Object.create(o.prototype),s=new B(i||[]);return n(a,"_invoke",{value:E(t,r,s)}),a}function u(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=A;var f={};function h(){}function l(){}function d(){}var g={};c(g,o,(function(){return this}));var p=Object.getPrototypeOf,y=p&&p(p(S([])));y&&y!==e&&r.call(y,o)&&(g=y);var I=d.prototype=h.prototype=Object.create(g);function b(t){["next","throw","return"].forEach((function(e){c(t,e,(function(t){return this._invoke(e,t)}))}))}function v(t,e){var i;n(this,"_invoke",{value:function(n,o){function a(){return new e((function(i,a){!function n(i,o,a,s){var c=u(t[i],t,o);if("throw"!==c.type){var A=c.arg,f=A.value;return f&&"object"==k(f)&&r.call(f,"__await")?e.resolve(f.__await).then((function(t){n("next",t,a,s)}),(function(t){n("throw",t,a,s)})):e.resolve(f).then((function(t){A.value=t,a(A)}),(function(t){return n("throw",t,a,s)}))}s(c.arg)}(n,o,i,a)}))}return i=i?i.then(a,a):a()}})}function E(t,e,r){var n="suspendedStart";return function(i,o){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===i)throw o;return _()}for(r.method=i,r.arg=o;;){var a=r.delegate;if(a){var s=m(a,r);if(s){if(s===f)continue;return s}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var c=u(t,e,r);if("normal"===c.type){if(n=r.done?"completed":"suspendedYield",c.arg===f)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(n="completed",r.method="throw",r.arg=c.arg)}}}function m(t,e){var r=e.method,n=t.iterator[r];if(void 0===n)return e.delegate=null,"throw"===r&&t.iterator.return&&(e.method="return",e.arg=void 0,m(t,e),"throw"===e.method)||"return"!==r&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+r+"' method")),f;var i=u(n,t.iterator,e.arg);if("throw"===i.type)return e.method="throw",e.arg=i.arg,e.delegate=null,f;var o=i.arg;return o?o.done?(e[t.resultName]=o.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,f):o:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,f)}function C(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function w(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function B(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(C,this),this.reset(!0)}function S(t){if(t){var e=t[o];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,i=function e(){for(;++n<t.length;)if(r.call(t,n))return e.value=t[n],e.done=!1,e;return e.value=void 0,e.done=!0,e};return i.next=i}}return{next:_}}function _(){return{value:void 0,done:!0}}return l.prototype=d,n(I,"constructor",{value:d,configurable:!0}),n(d,"constructor",{value:l,configurable:!0}),l.displayName=c(d,s,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===l||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,d):(t.__proto__=d,c(t,s,"GeneratorFunction")),t.prototype=Object.create(I),t},t.awrap=function(t){return{__await:t}},b(v.prototype),c(v.prototype,a,(function(){return this})),t.AsyncIterator=v,t.async=function(e,r,n,i,o){void 0===o&&(o=Promise);var a=new v(A(e,r,n,i),o);return t.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},b(I),c(I,s,"Generator"),c(I,o,(function(){return this})),c(I,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},t.values=S,B.prototype={constructor:B,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(w),!t)for(var e in this)"t"===e.charAt(0)&&r.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function n(r,n){return a.type="throw",a.arg=t,e.next=r,n&&(e.method="next",e.arg=void 0),!!n}for(var i=this.tryEntries.length-1;i>=0;--i){var o=this.tryEntries[i],a=o.completion;if("root"===o.tryLoc)return n("end");if(o.tryLoc<=this.prev){var s=r.call(o,"catchLoc"),c=r.call(o,"finallyLoc");if(s&&c){if(this.prev<o.catchLoc)return n(o.catchLoc,!0);if(this.prev<o.finallyLoc)return n(o.finallyLoc)}else if(s){if(this.prev<o.catchLoc)return n(o.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return n(o.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&r.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var o=i;break}}o&&("break"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc&&(o=null);var a=o?o.completion:{};return a.type=t,a.arg=e,o?(this.method="next",this.next=o.finallyLoc,f):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),f},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),w(r),f}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var i=n.arg;w(r)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:S(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),f}},t}function k(t){return(k="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var S=function(t,e,r,n){return new(r||(r=Promise))((function(i,o){function a(t){try{c(n.next(t))}catch(t){o(t)}}function s(t){try{c(n.throw(t))}catch(t){o(t)}}function c(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(a,s)}c((n=n.apply(t,e||[])).next())}))},_=new h.b("properties/5.7.0");function D(t,e,r){Object.defineProperty(t,e,{enumerable:!0,value:r,writable:!1})}function x(t,e){for(var r=0;r<32;r++){if(t[e])return t[e];if(!t.prototype||"object"!==k(t.prototype))break;t=Object.getPrototypeOf(t.prototype).constructor}return null}function M(t){return S(this,void 0,void 0,Q().mark((function e(){var r,n;return Q().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=Object.keys(t).map((function(e){var r=t[e];return Promise.resolve(r).then((function(t){return{key:e,value:t}}))})),e.next=3,Promise.all(r);case 3:return n=e.sent,e.abrupt("return",n.reduce((function(t,e){return t[e.key]=e.value,t}),{}));case 5:case"end":return e.stop()}}),e)})))}function R(t,e){t&&"object"===k(t)||_.throwArgumentError("invalid object","object",t),Object.keys(t).forEach((function(r){e[r]||_.throwArgumentError("invalid object key - "+r,"transaction:"+r,t)}))}function O(t){var e={};for(var r in t)e[r]=t[r];return e}var N={bigint:!0,boolean:!0,function:!0,number:!0,string:!0};function P(t){if(function t(e){if(null==e||N[k(e)])return!0;if(Array.isArray(e)||"object"===k(e)){if(!Object.isFrozen(e))return!1;for(var r=Object.keys(e),n=0;n<r.length;n++){var i=null;try{i=e[r[n]]}catch(t){continue}if(!t(i))return!1}return!0}return _.throwArgumentError("Cannot deepCopy ".concat(k(e)),"object",e)}(t))return t;if(Array.isArray(t))return Object.freeze(t.map((function(t){return j(t)})));if("object"===k(t)){var e={};for(var r in t){var n=t[r];void 0!==n&&D(e,r,j(n))}return e}return _.throwArgumentError("Cannot deepCopy ".concat(k(t)),"object",t)}function j(t){return P(t)}var L=B((function t(e){for(var r in function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),e)this[r]=j(e[r])}));function F(t){return(F="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function T(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function U(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,(i=n.key,o=void 0,o=function(t,e){if("object"!==F(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==F(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(i,"string"),"symbol"===F(o)?o:String(o)),n)}var i,o}function G(t,e,r){return e&&U(t.prototype,e),r&&U(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}var H=new h.b("abi/5.7.0");function Y(t){var e=[];return function t(r,n){if(Array.isArray(n))for(var i in n){var o=r.slice();o.push(i);try{t(o,n[i])}catch(t){e.push({path:o,error:t})}}}([],t),e}var K=function(){function t(e,r,n,i){T(this,t),this.name=e,this.type=r,this.localName=n,this.dynamic=i}return G(t,[{key:"_throwError",value:function(t,e){H.throwArgumentError(t,this.localName,e)}}]),t}(),q=function(){function t(e){T(this,t),D(this,"wordSize",e||32),this._data=[],this._dataLength=0,this._padding=new Uint8Array(e)}return G(t,[{key:"data",get:function(){return Object(A.c)(this._data)}},{key:"length",get:function(){return this._dataLength}},{key:"_writeData",value:function(t){return this._data.push(t),this._dataLength+=t.length,t.length}},{key:"appendWriter",value:function(t){return this._writeData(Object(A.b)(t._data))}},{key:"writeBytes",value:function(t){var e=Object(A.a)(t),r=e.length%this.wordSize;return r&&(e=Object(A.b)([e,this._padding.slice(r)])),this._writeData(e)}},{key:"_getValue",value:function(t){var e=Object(A.a)(b.from(t));return e.length>this.wordSize&&H.throwError("value out-of-bounds",h.b.errors.BUFFER_OVERRUN,{length:this.wordSize,offset:e.length}),e.length%this.wordSize&&(e=Object(A.b)([this._padding.slice(e.length%this.wordSize),e])),e}},{key:"writeValue",value:function(t){return this._writeData(this._getValue(t))}},{key:"writeUpdatableValue",value:function(){var t=this,e=this._data.length;return this._data.push(this._padding),this._dataLength+=this.wordSize,function(r){t._data[e]=t._getValue(r)}}}]),t}(),J=function(){function t(e,r,n,i){T(this,t),D(this,"_data",Object(A.a)(e)),D(this,"wordSize",r||32),D(this,"_coerceFunc",n),D(this,"allowLoose",i),this._offset=0}return G(t,[{key:"data",get:function(){return Object(A.i)(this._data)}},{key:"consumed",get:function(){return this._offset}},{key:"coerce",value:function(e,r){return this._coerceFunc?this._coerceFunc(e,r):t.coerce(e,r)}},{key:"_peekBytes",value:function(t,e,r){var n=Math.ceil(e/this.wordSize)*this.wordSize;return this._offset+n>this._data.length&&(this.allowLoose&&r&&this._offset+e<=this._data.length?n=e:H.throwError("data out-of-bounds",h.b.errors.BUFFER_OVERRUN,{length:this._data.length,offset:this._offset+n})),this._data.slice(this._offset,this._offset+n)}},{key:"subReader",value:function(e){return new t(this._data.slice(this._offset+e),this.wordSize,this._coerceFunc,this.allowLoose)}},{key:"readBytes",value:function(t,e){var r=this._peekBytes(0,t,!!e);return this._offset+=r.length,r.slice(0,t)}},{key:"readValue",value:function(){return b.from(this.readBytes(this.wordSize))}}],[{key:"coerce",value:function(t,e){var r=t.match("^u?int([0-9]+)$");return r&&parseInt(r[1])<=48&&(e=e.toNumber()),e}}]),t}(),z=r(167),Z=r.n(z);function V(t){return"0x"+Z.a.keccak_256(Object(A.a)(t))}var W=new h.b("rlp/5.7.0");function X(t){for(var e=[];t;)e.unshift(255&t),t>>=8;return e}function $(t,e,r){for(var n=0,i=0;i<r;i++)n=256*n+t[e+i];return n}function tt(t){return Object(A.i)(function t(e){if(Array.isArray(e)){var r=[];if(e.forEach((function(e){r=r.concat(t(e))})),r.length<=55)return r.unshift(192+r.length),r;var n=X(r.length);return n.unshift(247+n.length),n.concat(r)}Object(A.k)(e)||W.throwArgumentError("RLP object must be BytesLike","object",e);var i=Array.prototype.slice.call(Object(A.a)(e));if(1===i.length&&i[0]<=127)return i;if(i.length<=55)return i.unshift(128+i.length),i;var o=X(i.length);return o.unshift(183+o.length),o.concat(i)}(t))}function et(t,e,r,n){for(var i=[];r<e+1+n;){var o=rt(t,r);i.push(o.result),(r+=o.consumed)>e+1+n&&W.throwError("child data too short",h.b.errors.BUFFER_OVERRUN,{})}return{consumed:1+n,result:i}}function rt(t,e){if(0===t.length&&W.throwError("data too short",h.b.errors.BUFFER_OVERRUN,{}),t[e]>=248){var r=t[e]-247;e+1+r>t.length&&W.throwError("data short segment too short",h.b.errors.BUFFER_OVERRUN,{});var n=$(t,e+1,r);return e+1+r+n>t.length&&W.throwError("data long segment too short",h.b.errors.BUFFER_OVERRUN,{}),et(t,e,e+1+r,r+n)}if(t[e]>=192){var i=t[e]-192;return e+1+i>t.length&&W.throwError("data array too short",h.b.errors.BUFFER_OVERRUN,{}),et(t,e,e+1,i)}if(t[e]>=184){var o=t[e]-183;e+1+o>t.length&&W.throwError("data array too short",h.b.errors.BUFFER_OVERRUN,{});var a=$(t,e+1,o);return e+1+o+a>t.length&&W.throwError("data array too short",h.b.errors.BUFFER_OVERRUN,{}),{consumed:1+o+a,result:Object(A.i)(t.slice(e+1+o,e+1+o+a))}}if(t[e]>=128){var s=t[e]-128;return e+1+s>t.length&&W.throwError("data too short",h.b.errors.BUFFER_OVERRUN,{}),{consumed:1+s,result:Object(A.i)(t.slice(e+1,e+1+s))}}return{consumed:1,result:Object(A.i)(t[e])}}function nt(t){var e=Object(A.a)(t),r=rt(e,0);return r.consumed!==e.length&&W.throwArgumentError("invalid rlp data","data",t),r.result}var it=new h.b("address/5.7.0");function ot(t){Object(A.l)(t,20)||it.throwArgumentError("invalid address","address",t);for(var e=(t=t.toLowerCase()).substring(2).split(""),r=new Uint8Array(40),n=0;n<40;n++)r[n]=e[n].charCodeAt(0);for(var i=Object(A.a)(V(r)),o=0;o<40;o+=2)i[o>>1]>>4>=8&&(e[o]=e[o].toUpperCase()),(15&i[o>>1])>=8&&(e[o+1]=e[o+1].toUpperCase());return"0x"+e.join("")}for(var at={},st=0;st<10;st++)at[String(st)]=String(st);for(var ct=0;ct<26;ct++)at[String.fromCharCode(65+ct)]=String(10+ct);var At,ut=Math.floor((At=9007199254740991,Math.log10?Math.log10(At):Math.log(At)/Math.LN10));function ft(t){for(var e=(t=(t=t.toUpperCase()).substring(4)+t.substring(0,2)+"00").split("").map((function(t){return at[t]})).join("");e.length>=ut;){var r=e.substring(0,ut);e=parseInt(r,10)%97+e.substring(r.length)}for(var n=String(98-parseInt(e,10)%97);n.length<2;)n="0"+n;return n}function ht(t){var e,r=null;if("string"!=typeof t&&it.throwArgumentError("invalid address","address",t),t.match(/^(0x)?[0-9a-fA-F]{40}$/))"0x"!==t.substring(0,2)&&(t="0x"+t),r=ot(t),t.match(/([A-F].*[a-f])|([a-f].*[A-F])/)&&r!==t&&it.throwArgumentError("bad address checksum","address",t);else if(t.match(/^XE[0-9]{2}[0-9A-Za-z]{30,31}$/)){for(t.substring(2,4)!==ft(t)&&it.throwArgumentError("bad icap checksum","address",t),e=t.substring(4),r=new g(e,36).toString(16);r.length<40;)r="0"+r;r=ot("0x"+r)}else it.throwArgumentError("invalid address","address",t);return r}function lt(t){try{return ht(t),!0}catch(t){}return!1}function dt(t){for(var e,r=(e=ht(t).substring(2),new g(e,16).toString(36)).toUpperCase();r.length<30;)r="0"+r;return"XE"+ft("XE00"+r)+r}function gt(t){var e=null;try{e=ht(t.from)}catch(e){it.throwArgumentError("missing from address","transaction",t)}var r=Object(A.o)(Object(A.a)(b.from(t.nonce).toHexString()));return ht(Object(A.e)(V(tt([e,r])),12))}function pt(t,e,r){return 32!==Object(A.d)(e)&&it.throwArgumentError("salt must be 32 bytes","salt",e),32!==Object(A.d)(r)&&it.throwArgumentError("initCodeHash must be 32 bytes","initCodeHash",r),ht(Object(A.e)(V(Object(A.b)(["0xff",ht(t),e,r])),12))}var yt,It,bt=new h.b("strings/5.7.0");function vt(t,e,r,n,i){if(t===It.BAD_PREFIX||t===It.UNEXPECTED_CONTINUE){for(var o=0,a=e+1;a<r.length&&r[a]>>6==2;a++)o++;return o}return t===It.OVERRUN?r.length-e-1:0}!function(t){t.current="",t.NFC="NFC",t.NFD="NFD",t.NFKC="NFKC",t.NFKD="NFKD"}(yt||(yt={})),function(t){t.UNEXPECTED_CONTINUE="unexpected continuation byte",t.BAD_PREFIX="bad codepoint prefix",t.OVERRUN="string overrun",t.MISSING_CONTINUE="missing continuation byte",t.OUT_OF_RANGE="out of UTF-8 range",t.UTF16_SURROGATE="UTF-16 surrogate",t.OVERLONG="overlong representation"}(It||(It={}));var Et=Object.freeze({error:function(t,e,r,n,i){return bt.throwArgumentError("invalid codepoint at offset ".concat(e,"; ").concat(t),"bytes",r)},ignore:vt,replace:function(t,e,r,n,i){return t===It.OVERLONG?(n.push(i),0):(n.push(65533),vt(t,e,r))}});function mt(t,e){null==e&&(e=Et.error),t=Object(A.a)(t);for(var r=[],n=0;n<t.length;){var i=t[n++];if(i>>7!=0){var o=null,a=null;if(192==(224&i))o=1,a=127;else if(224==(240&i))o=2,a=2047;else{if(240!=(248&i)){n+=e(128==(192&i)?It.UNEXPECTED_CONTINUE:It.BAD_PREFIX,n-1,t,r);continue}o=3,a=65535}if(n-1+o>=t.length)n+=e(It.OVERRUN,n-1,t,r);else{for(var s=i&(1<<8-o-1)-1,c=0;c<o;c++){var u=t[n];if(128!=(192&u)){n+=e(It.MISSING_CONTINUE,n,t,r),s=null;break}s=s<<6|63&u,n++}null!==s&&(s>1114111?n+=e(It.OUT_OF_RANGE,n-1-o,t,r,s):s>=55296&&s<=57343?n+=e(It.UTF16_SURROGATE,n-1-o,t,r,s):s<=a?n+=e(It.OVERLONG,n-1-o,t,r,s):r.push(s))}}else r.push(i)}return r}function Ct(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:yt.current;e!=yt.current&&(bt.checkNormalize(),t=t.normalize(e));for(var r=[],n=0;n<t.length;n++){var i=t.charCodeAt(n);if(i<128)r.push(i);else if(i<2048)r.push(i>>6|192),r.push(63&i|128);else if(55296==(64512&i)){n++;var o=t.charCodeAt(n);if(n>=t.length||56320!=(64512&o))throw new Error("invalid utf-8 string");var a=65536+((1023&i)<<10)+(1023&o);r.push(a>>18|240),r.push(a>>12&63|128),r.push(a>>6&63|128),r.push(63&a|128)}else r.push(i>>12|224),r.push(i>>6&63|128),r.push(63&i|128)}return Object(A.a)(r)}function wt(t){var e="0000"+t.toString(16);return"\\u"+e.substring(e.length-4)}function Bt(t,e){return'"'+mt(t,e).map((function(t){if(t<256){switch(t){case 8:return"\\b";case 9:return"\\t";case 10:return"\\n";case 13:return"\\r";case 34:return'\\"';case 92:return"\\\\"}if(t>=32&&t<127)return String.fromCharCode(t)}return t<=65535?wt(t):wt(55296+((t-=65536)>>10&1023))+wt(56320+(1023&t))})).join("")+'"'}function Qt(t){return t.map((function(t){return t<=65535?String.fromCharCode(t):(t-=65536,String.fromCharCode(55296+(t>>10&1023),56320+(1023&t)))})).join("")}function kt(t,e){return Qt(mt(t,e))}function St(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:yt.current;return mt(Ct(t,e))}function _t(t){return V(Ct(t))}function Dt(t){return(Dt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function xt(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,(i=n.key,o=void 0,o=function(t,e){if("object"!==Dt(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==Dt(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(i,"string"),"symbol"===Dt(o)?o:String(o)),n)}var i,o}function Mt(t,e){return(Mt=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}function Rt(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=Nt(t);if(e){var i=Nt(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return Ot(this,r)}}function Ot(t,e){if(e&&("object"===Dt(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function Nt(t){return(Nt=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var Pt=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Mt(t,e)}(o,t);var e,r,n,i=Rt(o);function o(t){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,o),i.call(this,"address","address",t,!1)}return e=o,(r=[{key:"defaultValue",value:function(){return"0x0000000000000000000000000000000000000000"}},{key:"encode",value:function(t,e){try{e=ht(e)}catch(t){this._throwError(t.message,e)}return t.writeValue(e)}},{key:"decode",value:function(t){return ht(Object(A.h)(t.readValue().toHexString(),20))}}])&&xt(e.prototype,r),n&&xt(e,n),Object.defineProperty(e,"prototype",{writable:!1}),o}(K);function jt(t){return(jt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Lt(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,(i=n.key,o=void 0,o=function(t,e){if("object"!==jt(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==jt(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(i,"string"),"symbol"===jt(o)?o:String(o)),n)}var i,o}function Ft(t,e){return(Ft=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}function Tt(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=Gt(t);if(e){var i=Gt(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return Ut(this,r)}}function Ut(t,e){if(e&&("object"===jt(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function Gt(t){return(Gt=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var Ht=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Ft(t,e)}(o,t);var e,r,n,i=Tt(o);function o(t){var e;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,o),(e=i.call(this,t.name,t.type,void 0,t.dynamic)).coder=t,e}return e=o,(r=[{key:"defaultValue",value:function(){return this.coder.defaultValue()}},{key:"encode",value:function(t,e){return this.coder.encode(t,e)}},{key:"decode",value:function(t){return this.coder.decode(t)}}])&&Lt(e.prototype,r),n&&Lt(e,n),Object.defineProperty(e,"prototype",{writable:!1}),o}(K);function Yt(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,(i=n.key,o=void 0,o=function(t,e){if("object"!==Zt(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==Zt(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(i,"string"),"symbol"===Zt(o)?o:String(o)),n)}var i,o}function Kt(t,e){return(Kt=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}function qt(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=zt(t);if(e){var i=zt(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return Jt(this,r)}}function Jt(t,e){if(e&&("object"===Zt(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function zt(t){return(zt=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function Zt(t){return(Zt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var Vt=new h.b("abi/5.7.0");function Wt(t,e,r){var n=null;if(Array.isArray(r))n=r;else if(r&&"object"===Zt(r)){var i={};n=e.map((function(t){var e=t.localName;return e||Vt.throwError("cannot encode object for signature with missing names",h.b.errors.INVALID_ARGUMENT,{argument:"values",coder:t,value:r}),i[e]&&Vt.throwError("cannot encode object for signature with duplicate names",h.b.errors.INVALID_ARGUMENT,{argument:"values",coder:t,value:r}),i[e]=!0,r[e]}))}else Vt.throwArgumentError("invalid tuple value","tuple",r);e.length!==n.length&&Vt.throwArgumentError("types/value length mismatch","tuple",r);var o=new q(t.wordSize),a=new q(t.wordSize),s=[];e.forEach((function(t,e){var r=n[e];if(t.dynamic){var i=a.length;t.encode(a,r);var c=o.writeUpdatableValue();s.push((function(t){c(t+i)}))}else t.encode(o,r)})),s.forEach((function(t){t(o.length)}));var c=t.appendWriter(o);return c+=t.appendWriter(a)}function Xt(t,e){var r=[],n=t.subReader(0);e.forEach((function(e){var i=null;if(e.dynamic){var o=t.readValue(),a=n.subReader(o.toNumber());try{i=e.decode(a)}catch(t){if(t.code===h.b.errors.BUFFER_OVERRUN)throw t;(i=t).baseType=e.name,i.name=e.localName,i.type=e.type}}else try{i=e.decode(t)}catch(t){if(t.code===h.b.errors.BUFFER_OVERRUN)throw t;(i=t).baseType=e.name,i.name=e.localName,i.type=e.type}null!=i&&r.push(i)}));var i=e.reduce((function(t,e){var r=e.localName;return r&&(t[r]||(t[r]=0),t[r]++),t}),{});e.forEach((function(t,e){var n=t.localName;if(n&&1===i[n]&&("length"===n&&(n="_length"),null==r[n])){var o=r[e];o instanceof Error?Object.defineProperty(r,n,{enumerable:!0,get:function(){throw o}}):r[n]=o}}));for(var o=function(){var t=r[a];t instanceof Error&&Object.defineProperty(r,a,{enumerable:!0,get:function(){throw t}})},a=0;a<r.length;a++)o();return Object.freeze(r)}var $t=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Kt(t,e)}(o,t);var e,r,n,i=qt(o);function o(t,e,r){var n;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,o);var a=t.type+"["+(e>=0?e:"")+"]",s=-1===e||t.dynamic;return(n=i.call(this,"array",a,r,s)).coder=t,n.length=e,n}return e=o,(r=[{key:"defaultValue",value:function(){for(var t=this.coder.defaultValue(),e=[],r=0;r<this.length;r++)e.push(t);return e}},{key:"encode",value:function(t,e){Array.isArray(e)||this._throwError("expected array value",e);var r=this.length;-1===r&&(r=e.length,t.writeValue(e.length)),Vt.checkArgumentCount(e.length,r,"coder array"+(this.localName?" "+this.localName:""));for(var n=[],i=0;i<e.length;i++)n.push(this.coder);return Wt(t,n,e)}},{key:"decode",value:function(t){var e=this.length;-1===e&&32*(e=t.readValue().toNumber())>t._data.length&&Vt.throwError("insufficient data length",h.b.errors.BUFFER_OVERRUN,{length:t._data.length,count:e});for(var r=[],n=0;n<e;n++)r.push(new Ht(this.coder));return t.coerce(this.name,Xt(t,r))}}])&&Yt(e.prototype,r),n&&Yt(e,n),Object.defineProperty(e,"prototype",{writable:!1}),o}(K);function te(t){return(te="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function ee(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,(i=n.key,o=void 0,o=function(t,e){if("object"!==te(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==te(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(i,"string"),"symbol"===te(o)?o:String(o)),n)}var i,o}function re(t,e){return(re=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}function ne(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=oe(t);if(e){var i=oe(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return ie(this,r)}}function ie(t,e){if(e&&("object"===te(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function oe(t){return(oe=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var ae=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&re(t,e)}(o,t);var e,r,n,i=ne(o);function o(t){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,o),i.call(this,"bool","bool",t,!1)}return e=o,(r=[{key:"defaultValue",value:function(){return!1}},{key:"encode",value:function(t,e){return t.writeValue(e?1:0)}},{key:"decode",value:function(t){return t.coerce(this.type,!t.readValue().isZero())}}])&&ee(e.prototype,r),n&&ee(e,n),Object.defineProperty(e,"prototype",{writable:!1}),o}(K);function se(t){return(se="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function ce(){return(ce="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,r){var n=Ae(t,e);if(n){var i=Object.getOwnPropertyDescriptor(n,e);return i.get?i.get.call(arguments.length<3?t:r):i.value}}).apply(this,arguments)}function Ae(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=ye(t)););return t}function ue(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function fe(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,(i=n.key,o=void 0,o=function(t,e){if("object"!==se(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==se(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(i,"string"),"symbol"===se(o)?o:String(o)),n)}var i,o}function he(t,e,r){return e&&fe(t.prototype,e),r&&fe(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function le(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&de(t,e)}function de(t,e){return(de=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}function ge(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=ye(t);if(e){var i=ye(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return pe(this,r)}}function pe(t,e){if(e&&("object"===se(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function ye(t){return(ye=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var Ie=function(t){le(r,t);var e=ge(r);function r(t,n){return ue(this,r),e.call(this,t,t,n,!0)}return he(r,[{key:"defaultValue",value:function(){return"0x"}},{key:"encode",value:function(t,e){e=Object(A.a)(e);var r=t.writeValue(e.length);return r+=t.writeBytes(e)}},{key:"decode",value:function(t){return t.readBytes(t.readValue().toNumber(),!0)}}]),r}(K),be=function(t){le(r,t);var e=ge(r);function r(t){return ue(this,r),e.call(this,"bytes",t)}return he(r,[{key:"decode",value:function(t){return t.coerce(this.name,Object(A.i)(ce(ye(r.prototype),"decode",this).call(this,t)))}}]),r}(Ie);function ve(t){return(ve="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Ee(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,(i=n.key,o=void 0,o=function(t,e){if("object"!==ve(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==ve(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(i,"string"),"symbol"===ve(o)?o:String(o)),n)}var i,o}function me(t,e){return(me=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}function Ce(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=Be(t);if(e){var i=Be(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return we(this,r)}}function we(t,e){if(e&&("object"===ve(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function Be(t){return(Be=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var Qe=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&me(t,e)}(o,t);var e,r,n,i=Ce(o);function o(t,e){var r;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,o);var n="bytes"+String(t);return(r=i.call(this,n,n,e,!1)).size=t,r}return e=o,(r=[{key:"defaultValue",value:function(){return"0x0000000000000000000000000000000000000000000000000000000000000000".substring(0,2+2*this.size)}},{key:"encode",value:function(t,e){var r=Object(A.a)(e);return r.length!==this.size&&this._throwError("incorrect data length",e),t.writeBytes(r)}},{key:"decode",value:function(t){return t.coerce(this.name,Object(A.i)(t.readBytes(this.size)))}}])&&Ee(e.prototype,r),n&&Ee(e,n),Object.defineProperty(e,"prototype",{writable:!1}),o}(K);function ke(t){return(ke="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Se(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,(i=n.key,o=void 0,o=function(t,e){if("object"!==ke(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==ke(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(i,"string"),"symbol"===ke(o)?o:String(o)),n)}var i,o}function _e(t,e){return(_e=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}function De(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=Me(t);if(e){var i=Me(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return xe(this,r)}}function xe(t,e){if(e&&("object"===ke(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function Me(t){return(Me=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var Re=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&_e(t,e)}(o,t);var e,r,n,i=De(o);function o(t){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,o),i.call(this,"null","",t,!1)}return e=o,(r=[{key:"defaultValue",value:function(){return null}},{key:"encode",value:function(t,e){return null!=e&&this._throwError("not null",e),t.writeBytes([])}},{key:"decode",value:function(t){return t.readBytes(0),t.coerce(this.name,null)}}])&&Se(e.prototype,r),n&&Se(e,n),Object.defineProperty(e,"prototype",{writable:!1}),o}(K),Oe=b.from(-1),Ne=b.from(0),Pe=b.from(1),je=b.from(2),Le=b.from("1000000000000000000"),Fe=b.from("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"),Te=b.from("-0x8000000000000000000000000000000000000000000000000000000000000000"),Ue=b.from("0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");function Ge(t){return(Ge="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function He(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,(i=n.key,o=void 0,o=function(t,e){if("object"!==Ge(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==Ge(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(i,"string"),"symbol"===Ge(o)?o:String(o)),n)}var i,o}function Ye(t,e){return(Ye=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}function Ke(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=Je(t);if(e){var i=Je(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return qe(this,r)}}function qe(t,e){if(e&&("object"===Ge(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function Je(t){return(Je=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var ze=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Ye(t,e)}(o,t);var e,r,n,i=Ke(o);function o(t,e,r){var n;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,o);var a=(e?"int":"uint")+8*t;return(n=i.call(this,a,a,r,!1)).size=t,n.signed=e,n}return e=o,(r=[{key:"defaultValue",value:function(){return 0}},{key:"encode",value:function(t,e){var r=b.from(e),n=Fe.mask(8*t.wordSize);if(this.signed){var i=n.mask(8*this.size-1);(r.gt(i)||r.lt(i.add(Pe).mul(Oe)))&&this._throwError("value out-of-bounds",e)}else(r.lt(Ne)||r.gt(n.mask(8*this.size)))&&this._throwError("value out-of-bounds",e);return r=r.toTwos(8*this.size).mask(8*this.size),this.signed&&(r=r.fromTwos(8*this.size).toTwos(8*t.wordSize)),t.writeValue(r)}},{key:"decode",value:function(t){var e=t.readValue().mask(8*this.size);return this.signed&&(e=e.fromTwos(8*this.size)),t.coerce(this.name,e)}}])&&He(e.prototype,r),n&&He(e,n),Object.defineProperty(e,"prototype",{writable:!1}),o}(K);function Ze(t){return(Ze="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Ve(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,(i=n.key,o=void 0,o=function(t,e){if("object"!==Ze(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==Ze(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(i,"string"),"symbol"===Ze(o)?o:String(o)),n)}var i,o}function We(){return(We="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,r){var n=Xe(t,e);if(n){var i=Object.getOwnPropertyDescriptor(n,e);return i.get?i.get.call(arguments.length<3?t:r):i.value}}).apply(this,arguments)}function Xe(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=rr(t)););return t}function $e(t,e){return($e=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}function tr(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=rr(t);if(e){var i=rr(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return er(this,r)}}function er(t,e){if(e&&("object"===Ze(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function rr(t){return(rr=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var nr=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&$e(t,e)}(o,t);var e,r,n,i=tr(o);function o(t){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,o),i.call(this,"string",t)}return e=o,(r=[{key:"defaultValue",value:function(){return""}},{key:"encode",value:function(t,e){return We(rr(o.prototype),"encode",this).call(this,t,Ct(e))}},{key:"decode",value:function(t){return kt(We(rr(o.prototype),"decode",this).call(this,t))}}])&&Ve(e.prototype,r),n&&Ve(e,n),Object.defineProperty(e,"prototype",{writable:!1}),o}(Ie);function ir(t){return(ir="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function or(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,(i=n.key,o=void 0,o=function(t,e){if("object"!==ir(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==ir(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(i,"string"),"symbol"===ir(o)?o:String(o)),n)}var i,o}function ar(t,e){return(ar=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}function sr(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=Ar(t);if(e){var i=Ar(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return cr(this,r)}}function cr(t,e){if(e&&("object"===ir(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function Ar(t){return(Ar=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var ur=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&ar(t,e)}(o,t);var e,r,n,i=sr(o);function o(t,e){var r;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,o);var n=!1,a=[];t.forEach((function(t){t.dynamic&&(n=!0),a.push(t.type)}));var s="tuple("+a.join(",")+")";return(r=i.call(this,"tuple",s,e,n)).coders=t,r}return e=o,(r=[{key:"defaultValue",value:function(){var t=[];this.coders.forEach((function(e){t.push(e.defaultValue())}));var e=this.coders.reduce((function(t,e){var r=e.localName;return r&&(t[r]||(t[r]=0),t[r]++),t}),{});return this.coders.forEach((function(r,n){var i=r.localName;i&&1===e[i]&&("length"===i&&(i="_length"),null==t[i]&&(t[i]=t[n]))})),Object.freeze(t)}},{key:"encode",value:function(t,e){return Wt(t,this.coders,e)}},{key:"decode",value:function(t){return t.coerce(this.name,Xt(t,this.coders))}}])&&or(e.prototype,r),n&&or(e,n),Object.defineProperty(e,"prototype",{writable:!1}),o}(K);function fr(t){return(fr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function hr(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&lr(t,e)}function lr(t,e){return(lr=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}function dr(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=pr(t);if(e){var i=pr(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return gr(this,r)}}function gr(t,e){if(e&&("object"===fr(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function pr(t){return(pr=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function yr(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Ir(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,(i=n.key,o=void 0,o=function(t,e){if("object"!==fr(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==fr(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(i,"string"),"symbol"===fr(o)?o:String(o)),n)}var i,o}function br(t,e,r){return e&&Ir(t.prototype,e),r&&Ir(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}var vr=new h.b("abi/5.7.0"),Er={},mr={calldata:!0,memory:!0,storage:!0},Cr={calldata:!0,memory:!0};function wr(t,e){if("bytes"===t||"string"===t){if(mr[e])return!0}else if("address"===t){if("payable"===e)return!0}else if((t.indexOf("[")>=0||"tuple"===t)&&Cr[e])return!0;return(mr[e]||"payable"===e)&&vr.throwArgumentError("invalid modifier","name",e),!1}function Br(t,e){for(var r in e)D(t,r,e[r])}var Qr=Object.freeze({sighash:"sighash",minimal:"minimal",full:"full",json:"json"}),kr=new RegExp(/^(.*)\[([0-9]*)\]$/),Sr=function(){function t(e,r){yr(this,t),e!==Er&&vr.throwError("use fromString",h.b.errors.UNSUPPORTED_OPERATION,{operation:"new ParamType()"}),Br(this,r);var n=this.type.match(kr);Br(this,n?{arrayLength:parseInt(n[2]||"-1"),arrayChildren:t.fromObject({type:n[1],components:this.components}),baseType:"array"}:{arrayLength:null,arrayChildren:null,baseType:null!=this.components?"tuple":this.type}),this._isParamType=!0,Object.freeze(this)}return br(t,[{key:"format",value:function(t){if(t||(t=Qr.sighash),Qr[t]||vr.throwArgumentError("invalid format type","format",t),t===Qr.json){var e={type:"tuple"===this.baseType?"tuple":this.type,name:this.name||void 0};return"boolean"==typeof this.indexed&&(e.indexed=this.indexed),this.components&&(e.components=this.components.map((function(e){return JSON.parse(e.format(t))}))),JSON.stringify(e)}var r="";return"array"===this.baseType?(r+=this.arrayChildren.format(t),r+="["+(this.arrayLength<0?"":String(this.arrayLength))+"]"):"tuple"===this.baseType?(t!==Qr.sighash&&(r+=this.type),r+="("+this.components.map((function(e){return e.format(t)})).join(t===Qr.full?", ":",")+")"):r+=this.type,t!==Qr.sighash&&(!0===this.indexed&&(r+=" indexed"),t===Qr.full&&this.name&&(r+=" "+this.name)),r}}],[{key:"from",value:function(e,r){return"string"==typeof e?t.fromString(e,r):t.fromObject(e)}},{key:"fromObject",value:function(e){return t.isParamType(e)?e:new t(Er,{name:e.name||null,type:Fr(e.type),indexed:null==e.indexed?null:!!e.indexed,components:e.components?e.components.map(t.fromObject):null})}},{key:"fromString",value:function(e,r){return function(e){return t.fromObject({name:e.name,type:e.type,indexed:e.indexed,components:e.components})}(function(t,e){var r=t;function n(e){vr.throwArgumentError("unexpected character at position ".concat(e),"param",t)}function i(t){var r={type:"",name:"",parent:t,state:{allowType:!0}};return e&&(r.indexed=!1),r}t=t.replace(/\s/g," ");for(var o={type:"",name:"",state:{allowType:!0}},a=o,s=0;s<t.length;s++){var c=t[s];switch(c){case"(":a.state.allowType&&""===a.type?a.type="tuple":a.state.allowParams||n(s),a.state.allowType=!1,a.type=Fr(a.type),a.components=[i(a)],a=a.components[0];break;case")":delete a.state,"indexed"===a.name&&(e||n(s),a.indexed=!0,a.name=""),wr(a.type,a.name)&&(a.name=""),a.type=Fr(a.type);var A=a;(a=a.parent)||n(s),delete A.parent,a.state.allowParams=!1,a.state.allowName=!0,a.state.allowArray=!0;break;case",":delete a.state,"indexed"===a.name&&(e||n(s),a.indexed=!0,a.name=""),wr(a.type,a.name)&&(a.name=""),a.type=Fr(a.type);var u=i(a.parent);a.parent.components.push(u),delete a.parent,a=u;break;case" ":a.state.allowType&&""!==a.type&&(a.type=Fr(a.type),delete a.state.allowType,a.state.allowName=!0,a.state.allowParams=!0),a.state.allowName&&""!==a.name&&("indexed"===a.name?(e||n(s),a.indexed&&n(s),a.indexed=!0,a.name=""):wr(a.type,a.name)?a.name="":a.state.allowName=!1);break;case"[":a.state.allowArray||n(s),a.type+=c,a.state.allowArray=!1,a.state.allowName=!1,a.state.readArray=!0;break;case"]":a.state.readArray||n(s),a.type+=c,a.state.readArray=!1,a.state.allowArray=!0,a.state.allowName=!0;break;default:a.state.allowType?(a.type+=c,a.state.allowParams=!0,a.state.allowArray=!0):a.state.allowName?(a.name+=c,delete a.state.allowArray):a.state.readArray?a.type+=c:n(s)}}return a.parent&&vr.throwArgumentError("unexpected eof","param",t),delete o.state,"indexed"===a.name?(e||n(r.length-7),a.indexed&&n(r.length-7),a.indexed=!0,a.name=""):wr(a.type,a.name)&&(a.name=""),o.type=Fr(o.type),o}(e,!!r))}},{key:"isParamType",value:function(t){return!(null==t||!t._isParamType)}}]),t}();function _r(t,e){return function(t){t=t.trim();for(var e=[],r="",n=0,i=0;i<t.length;i++){var o=t[i];","===o&&0===n?(e.push(r),r=""):(r+=o,"("===o?n++:")"===o&&-1===--n&&vr.throwArgumentError("unbalanced parenthesis","value",t))}r&&e.push(r);return e}(t).map((function(t){return Sr.fromString(t,e)}))}var Dr=function(){function t(e,r){yr(this,t),e!==Er&&vr.throwError("use a static from method",h.b.errors.UNSUPPORTED_OPERATION,{operation:"new Fragment()"}),Br(this,r),this._isFragment=!0,Object.freeze(this)}return br(t,null,[{key:"from",value:function(e){return t.isFragment(e)?e:"string"==typeof e?t.fromString(e):t.fromObject(e)}},{key:"fromObject",value:function(e){if(t.isFragment(e))return e;switch(e.type){case"function":return Pr.fromObject(e);case"event":return xr.fromObject(e);case"constructor":return Nr.fromObject(e);case"error":return Lr.fromObject(e);case"fallback":case"receive":return null}return vr.throwArgumentError("invalid fragment object","value",e)}},{key:"fromString",value:function(t){return"event"===(t=(t=(t=t.replace(/\s/g," ")).replace(/\(/g," (").replace(/\)/g,") ").replace(/\s+/g," ")).trim()).split(" ")[0]?xr.fromString(t.substring(5).trim()):"function"===t.split(" ")[0]?Pr.fromString(t.substring(8).trim()):"constructor"===t.split("(")[0].trim()?Nr.fromString(t.trim()):"error"===t.split(" ")[0]?Lr.fromString(t.substring(5).trim()):vr.throwArgumentError("unsupported fragment","value",t)}},{key:"isFragment",value:function(t){return!(!t||!t._isFragment)}}]),t}(),xr=function(t){hr(r,t);var e=dr(r);function r(){return yr(this,r),e.apply(this,arguments)}return br(r,[{key:"format",value:function(t){if(t||(t=Qr.sighash),Qr[t]||vr.throwArgumentError("invalid format type","format",t),t===Qr.json)return JSON.stringify({type:"event",anonymous:this.anonymous,name:this.name,inputs:this.inputs.map((function(e){return JSON.parse(e.format(t))}))});var e="";return t!==Qr.sighash&&(e+="event "),e+=this.name+"("+this.inputs.map((function(e){return e.format(t)})).join(t===Qr.full?", ":",")+") ",t!==Qr.sighash&&this.anonymous&&(e+="anonymous "),e.trim()}}],[{key:"from",value:function(t){return"string"==typeof t?r.fromString(t):r.fromObject(t)}},{key:"fromObject",value:function(t){if(r.isEventFragment(t))return t;"event"!==t.type&&vr.throwArgumentError("invalid event object","value",t);var e={name:Ur(t.name),anonymous:t.anonymous,inputs:t.inputs?t.inputs.map(Sr.fromObject):[],type:"event"};return new r(Er,e)}},{key:"fromString",value:function(t){var e=t.match(Gr);e||vr.throwArgumentError("invalid event string","value",t);var n=!1;return e[3].split(" ").forEach((function(t){switch(t.trim()){case"anonymous":n=!0;break;case"":break;default:vr.warn("unknown modifier: "+t)}})),r.fromObject({name:e[1].trim(),anonymous:n,inputs:_r(e[2],!0),type:"event"})}},{key:"isEventFragment",value:function(t){return t&&t._isFragment&&"event"===t.type}}]),r}(Dr);function Mr(t,e){e.gas=null;var r=t.split("@");return 1!==r.length?(r.length>2&&vr.throwArgumentError("invalid human-readable ABI signature","value",t),r[1].match(/^[0-9]+$/)||vr.throwArgumentError("invalid human-readable ABI signature gas","value",t),e.gas=b.from(r[1]),r[0]):t}function Rr(t,e){e.constant=!1,e.payable=!1,e.stateMutability="nonpayable",t.split(" ").forEach((function(t){switch(t.trim()){case"constant":e.constant=!0;break;case"payable":e.payable=!0,e.stateMutability="payable";break;case"nonpayable":e.payable=!1,e.stateMutability="nonpayable";break;case"pure":e.constant=!0,e.stateMutability="pure";break;case"view":e.constant=!0,e.stateMutability="view";break;case"external":case"public":case"":break;default:console.log("unknown modifier: "+t)}}))}function Or(t){var e={constant:!1,payable:!0,stateMutability:"payable"};return null!=t.stateMutability?(e.stateMutability=t.stateMutability,e.constant="view"===e.stateMutability||"pure"===e.stateMutability,null!=t.constant&&!!t.constant!==e.constant&&vr.throwArgumentError("cannot have constant function with mutability "+e.stateMutability,"value",t),e.payable="payable"===e.stateMutability,null!=t.payable&&!!t.payable!==e.payable&&vr.throwArgumentError("cannot have payable function with mutability "+e.stateMutability,"value",t)):null!=t.payable?(e.payable=!!t.payable,null!=t.constant||e.payable||"constructor"===t.type||vr.throwArgumentError("unable to determine stateMutability","value",t),e.constant=!!t.constant,e.constant?e.stateMutability="view":e.stateMutability=e.payable?"payable":"nonpayable",e.payable&&e.constant&&vr.throwArgumentError("cannot have constant payable function","value",t)):null!=t.constant?(e.constant=!!t.constant,e.payable=!e.constant,e.stateMutability=e.constant?"view":"payable"):"constructor"!==t.type&&vr.throwArgumentError("unable to determine stateMutability","value",t),e}var Nr=function(t){hr(r,t);var e=dr(r);function r(){return yr(this,r),e.apply(this,arguments)}return br(r,[{key:"format",value:function(t){if(t||(t=Qr.sighash),Qr[t]||vr.throwArgumentError("invalid format type","format",t),t===Qr.json)return JSON.stringify({type:"constructor",stateMutability:"nonpayable"!==this.stateMutability?this.stateMutability:void 0,payable:this.payable,gas:this.gas?this.gas.toNumber():void 0,inputs:this.inputs.map((function(e){return JSON.parse(e.format(t))}))});t===Qr.sighash&&vr.throwError("cannot format a constructor for sighash",h.b.errors.UNSUPPORTED_OPERATION,{operation:"format(sighash)"});var e="constructor("+this.inputs.map((function(e){return e.format(t)})).join(t===Qr.full?", ":",")+") ";return this.stateMutability&&"nonpayable"!==this.stateMutability&&(e+=this.stateMutability+" "),e.trim()}}],[{key:"from",value:function(t){return"string"==typeof t?r.fromString(t):r.fromObject(t)}},{key:"fromObject",value:function(t){if(r.isConstructorFragment(t))return t;"constructor"!==t.type&&vr.throwArgumentError("invalid constructor object","value",t);var e=Or(t);e.constant&&vr.throwArgumentError("constructor cannot be constant","value",t);var n={name:null,type:t.type,inputs:t.inputs?t.inputs.map(Sr.fromObject):[],payable:e.payable,stateMutability:e.stateMutability,gas:t.gas?b.from(t.gas):null};return new r(Er,n)}},{key:"fromString",value:function(t){var e={type:"constructor"},n=(t=Mr(t,e)).match(Gr);return n&&"constructor"===n[1].trim()||vr.throwArgumentError("invalid constructor string","value",t),e.inputs=_r(n[2].trim(),!1),Rr(n[3].trim(),e),r.fromObject(e)}},{key:"isConstructorFragment",value:function(t){return t&&t._isFragment&&"constructor"===t.type}}]),r}(Dr),Pr=function(t){hr(r,t);var e=dr(r);function r(){return yr(this,r),e.apply(this,arguments)}return br(r,[{key:"format",value:function(t){if(t||(t=Qr.sighash),Qr[t]||vr.throwArgumentError("invalid format type","format",t),t===Qr.json)return JSON.stringify({type:"function",name:this.name,constant:this.constant,stateMutability:"nonpayable"!==this.stateMutability?this.stateMutability:void 0,payable:this.payable,gas:this.gas?this.gas.toNumber():void 0,inputs:this.inputs.map((function(e){return JSON.parse(e.format(t))})),outputs:this.outputs.map((function(e){return JSON.parse(e.format(t))}))});var e="";return t!==Qr.sighash&&(e+="function "),e+=this.name+"("+this.inputs.map((function(e){return e.format(t)})).join(t===Qr.full?", ":",")+") ",t!==Qr.sighash&&(this.stateMutability?"nonpayable"!==this.stateMutability&&(e+=this.stateMutability+" "):this.constant&&(e+="view "),this.outputs&&this.outputs.length&&(e+="returns ("+this.outputs.map((function(e){return e.format(t)})).join(", ")+") "),null!=this.gas&&(e+="@"+this.gas.toString()+" ")),e.trim()}}],[{key:"from",value:function(t){return"string"==typeof t?r.fromString(t):r.fromObject(t)}},{key:"fromObject",value:function(t){if(r.isFunctionFragment(t))return t;"function"!==t.type&&vr.throwArgumentError("invalid function object","value",t);var e=Or(t),n={type:t.type,name:Ur(t.name),constant:e.constant,inputs:t.inputs?t.inputs.map(Sr.fromObject):[],outputs:t.outputs?t.outputs.map(Sr.fromObject):[],payable:e.payable,stateMutability:e.stateMutability,gas:t.gas?b.from(t.gas):null};return new r(Er,n)}},{key:"fromString",value:function(t){var e={type:"function"},n=(t=Mr(t,e)).split(" returns ");n.length>2&&vr.throwArgumentError("invalid function string","value",t);var i=n[0].match(Gr);if(i||vr.throwArgumentError("invalid function signature","value",t),e.name=i[1].trim(),e.name&&Ur(e.name),e.inputs=_r(i[2],!1),Rr(i[3].trim(),e),n.length>1){var o=n[1].match(Gr);""==o[1].trim()&&""==o[3].trim()||vr.throwArgumentError("unexpected tokens","value",t),e.outputs=_r(o[2],!1)}else e.outputs=[];return r.fromObject(e)}},{key:"isFunctionFragment",value:function(t){return t&&t._isFragment&&"function"===t.type}}]),r}(Nr);function jr(t){var e=t.format();return"Error(string)"!==e&&"Panic(uint256)"!==e||vr.throwArgumentError("cannot specify user defined ".concat(e," error"),"fragment",t),t}var Lr=function(t){hr(r,t);var e=dr(r);function r(){return yr(this,r),e.apply(this,arguments)}return br(r,[{key:"format",value:function(t){if(t||(t=Qr.sighash),Qr[t]||vr.throwArgumentError("invalid format type","format",t),t===Qr.json)return JSON.stringify({type:"error",name:this.name,inputs:this.inputs.map((function(e){return JSON.parse(e.format(t))}))});var e="";return t!==Qr.sighash&&(e+="error "),(e+=this.name+"("+this.inputs.map((function(e){return e.format(t)})).join(t===Qr.full?", ":",")+") ").trim()}}],[{key:"from",value:function(t){return"string"==typeof t?r.fromString(t):r.fromObject(t)}},{key:"fromObject",value:function(t){if(r.isErrorFragment(t))return t;"error"!==t.type&&vr.throwArgumentError("invalid error object","value",t);var e={type:t.type,name:Ur(t.name),inputs:t.inputs?t.inputs.map(Sr.fromObject):[]};return jr(new r(Er,e))}},{key:"fromString",value:function(t){var e={type:"error"},n=t.match(Gr);return n||vr.throwArgumentError("invalid error signature","value",t),e.name=n[1].trim(),e.name&&Ur(e.name),e.inputs=_r(n[2],!1),jr(r.fromObject(e))}},{key:"isErrorFragment",value:function(t){return t&&t._isFragment&&"error"===t.type}}]),r}(Dr);function Fr(t){return t.match(/^uint($|[^1-9])/)?t="uint256"+t.substring(4):t.match(/^int($|[^1-9])/)&&(t="int256"+t.substring(3)),t}var Tr=new RegExp("^[a-zA-Z$_][a-zA-Z0-9$_]*$");function Ur(t){return t&&t.match(Tr)||vr.throwArgumentError('invalid identifier "'.concat(t,'"'),"value",t),t}var Gr=new RegExp("^([^)(]*)\\((.*)\\)([^)(]*)$");function Hr(t){return(Hr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Yr(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,(i=n.key,o=void 0,o=function(t,e){if("object"!==Hr(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==Hr(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(i,"string"),"symbol"===Hr(o)?o:String(o)),n)}var i,o}var Kr=new h.b("abi/5.7.0"),qr=new RegExp(/^bytes([0-9]*)$/),Jr=new RegExp(/^(u?int)([0-9]*)$/),zr=function(){function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),D(this,"coerceFunc",e||null)}var e,r,n;return e=t,(r=[{key:"_getCoder",value:function(t){var e=this;switch(t.baseType){case"address":return new Pt(t.name);case"bool":return new ae(t.name);case"string":return new nr(t.name);case"bytes":return new be(t.name);case"array":return new $t(this._getCoder(t.arrayChildren),t.arrayLength,t.name);case"tuple":return new ur((t.components||[]).map((function(t){return e._getCoder(t)})),t.name);case"":return new Re(t.name)}var r=t.type.match(Jr);if(r){var n=parseInt(r[2]||"256");return(0===n||n>256||n%8!=0)&&Kr.throwArgumentError("invalid "+r[1]+" bit length","param",t),new ze(n/8,"int"===r[1],t.name)}if(r=t.type.match(qr)){var i=parseInt(r[1]);return(0===i||i>32)&&Kr.throwArgumentError("invalid bytes length","param",t),new Qe(i,t.name)}return Kr.throwArgumentError("invalid type","type",t.type)}},{key:"_getWordSize",value:function(){return 32}},{key:"_getReader",value:function(t,e){return new J(t,this._getWordSize(),this.coerceFunc,e)}},{key:"_getWriter",value:function(){return new q(this._getWordSize())}},{key:"getDefaultValue",value:function(t){var e=this,r=t.map((function(t){return e._getCoder(Sr.from(t))}));return new ur(r,"_").defaultValue()}},{key:"encode",value:function(t,e){var r=this;t.length!==e.length&&Kr.throwError("types/values length mismatch",h.b.errors.INVALID_ARGUMENT,{count:{types:t.length,values:e.length},value:{types:t,values:e}});var n=t.map((function(t){return r._getCoder(Sr.from(t))})),i=new ur(n,"_"),o=this._getWriter();return i.encode(o,e),o.data}},{key:"decode",value:function(t,e,r){var n=this,i=t.map((function(t){return n._getCoder(Sr.from(t))}));return new ur(i,"_").decode(this._getReader(Object(A.a)(e),r))}}])&&Yr(e.prototype,r),n&&Yr(e,n),Object.defineProperty(e,"prototype",{writable:!1}),t}(),Zr=new zr;function Vr(t){return(Vr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Wr(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,(i=n.key,o=void 0,o=function(t,e){if("object"!==Vr(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==Vr(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(i,"string"),"symbol"===Vr(o)?o:String(o)),n)}var i,o}function Xr(t,e,r){return e&&Wr(t.prototype,e),r&&Wr(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function $r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function tn(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&en(t,e)}function en(t,e){return(en=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}function rn(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=on(t);if(e){var i=on(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return nn(this,r)}}function nn(t,e){if(e&&("object"===Vr(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function on(t){return(on=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var an=new h.b("abi/5.7.0"),sn=function(t){tn(r,t);var e=rn(r);function r(){return $r(this,r),e.apply(this,arguments)}return Xr(r)}(L),cn=function(t){tn(r,t);var e=rn(r);function r(){return $r(this,r),e.apply(this,arguments)}return Xr(r)}(L),An=function(t){tn(r,t);var e=rn(r);function r(){return $r(this,r),e.apply(this,arguments)}return Xr(r)}(L),un=function(t){tn(r,t);var e=rn(r);function r(){return $r(this,r),e.apply(this,arguments)}return Xr(r,null,[{key:"isIndexed",value:function(t){return!(!t||!t._isIndexed)}}]),r}(L),fn={"0x08c379a0":{signature:"Error(string)",name:"Error",inputs:["string"],reason:!0},"0x4e487b71":{signature:"Panic(uint256)",name:"Panic",inputs:["uint256"]}};function hn(t,e){var r=new Error("deferred error during ABI decoding triggered accessing ".concat(t));return r.error=e,r}var ln=function(){function t(e){var r=this;$r(this,t);D(this,"fragments",("string"==typeof e?JSON.parse(e):e).map((function(t){return Dr.from(t)})).filter((function(t){return null!=t}))),D(this,"_abiCoder",x(this instanceof t?this.constructor:void 0,"getAbiCoder")()),D(this,"functions",{}),D(this,"errors",{}),D(this,"events",{}),D(this,"structs",{}),this.fragments.forEach((function(t){var e=null;switch(t.type){case"constructor":return r.deploy?void an.warn("duplicate definition - constructor"):void D(r,"deploy",t);case"function":e=r.functions;break;case"event":e=r.events;break;case"error":e=r.errors;break;default:return}var n=t.format();e[n]?an.warn("duplicate definition - "+n):e[n]=t})),this.deploy||D(this,"deploy",Nr.from({payable:!1,type:"constructor"})),D(this,"_isInterface",!0)}return Xr(t,[{key:"format",value:function(t){t||(t=Qr.full),t===Qr.sighash&&an.throwArgumentError("interface does not support formatting sighash","format",t);var e=this.fragments.map((function(e){return e.format(t)}));return t===Qr.json?JSON.stringify(e.map((function(t){return JSON.parse(t)}))):e}},{key:"getFunction",value:function(t){if(Object(A.l)(t)){for(var e in this.functions)if(t===this.getSighash(e))return this.functions[e];an.throwArgumentError("no matching function","sighash",t)}if(-1===t.indexOf("(")){var r=t.trim(),n=Object.keys(this.functions).filter((function(t){return t.split("(")[0]===r}));return 0===n.length?an.throwArgumentError("no matching function","name",r):n.length>1&&an.throwArgumentError("multiple matching functions","name",r),this.functions[n[0]]}var i=this.functions[Pr.fromString(t).format()];return i||an.throwArgumentError("no matching function","signature",t),i}},{key:"getEvent",value:function(t){if(Object(A.l)(t)){var e=t.toLowerCase();for(var r in this.events)if(e===this.getEventTopic(r))return this.events[r];an.throwArgumentError("no matching event","topichash",e)}if(-1===t.indexOf("(")){var n=t.trim(),i=Object.keys(this.events).filter((function(t){return t.split("(")[0]===n}));return 0===i.length?an.throwArgumentError("no matching event","name",n):i.length>1&&an.throwArgumentError("multiple matching events","name",n),this.events[i[0]]}var o=this.events[xr.fromString(t).format()];return o||an.throwArgumentError("no matching event","signature",t),o}},{key:"getError",value:function(t){if(Object(A.l)(t)){var e=x(this.constructor,"getSighash");for(var r in this.errors){if(t===e(this.errors[r]))return this.errors[r]}an.throwArgumentError("no matching error","sighash",t)}if(-1===t.indexOf("(")){var n=t.trim(),i=Object.keys(this.errors).filter((function(t){return t.split("(")[0]===n}));return 0===i.length?an.throwArgumentError("no matching error","name",n):i.length>1&&an.throwArgumentError("multiple matching errors","name",n),this.errors[i[0]]}var o=this.errors[Pr.fromString(t).format()];return o||an.throwArgumentError("no matching error","signature",t),o}},{key:"getSighash",value:function(t){if("string"==typeof t)try{t=this.getFunction(t)}catch(e){try{t=this.getError(t)}catch(t){throw e}}return x(this.constructor,"getSighash")(t)}},{key:"getEventTopic",value:function(t){return"string"==typeof t&&(t=this.getEvent(t)),x(this.constructor,"getEventTopic")(t)}},{key:"_decodeParams",value:function(t,e){return this._abiCoder.decode(t,e)}},{key:"_encodeParams",value:function(t,e){return this._abiCoder.encode(t,e)}},{key:"encodeDeploy",value:function(t){return this._encodeParams(this.deploy.inputs,t||[])}},{key:"decodeErrorResult",value:function(t,e){"string"==typeof t&&(t=this.getError(t));var r=Object(A.a)(e);return Object(A.i)(r.slice(0,4))!==this.getSighash(t)&&an.throwArgumentError("data signature does not match error ".concat(t.name,"."),"data",Object(A.i)(r)),this._decodeParams(t.inputs,r.slice(4))}},{key:"encodeErrorResult",value:function(t,e){return"string"==typeof t&&(t=this.getError(t)),Object(A.i)(Object(A.b)([this.getSighash(t),this._encodeParams(t.inputs,e||[])]))}},{key:"decodeFunctionData",value:function(t,e){"string"==typeof t&&(t=this.getFunction(t));var r=Object(A.a)(e);return Object(A.i)(r.slice(0,4))!==this.getSighash(t)&&an.throwArgumentError("data signature does not match function ".concat(t.name,"."),"data",Object(A.i)(r)),this._decodeParams(t.inputs,r.slice(4))}},{key:"encodeFunctionData",value:function(t,e){return"string"==typeof t&&(t=this.getFunction(t)),Object(A.i)(Object(A.b)([this.getSighash(t),this._encodeParams(t.inputs,e||[])]))}},{key:"decodeFunctionResult",value:function(t,e){"string"==typeof t&&(t=this.getFunction(t));var r=Object(A.a)(e),n=null,i="",o=null,a=null,s=null;switch(r.length%this._abiCoder._getWordSize()){case 0:try{return this._abiCoder.decode(t.outputs,r)}catch(f){}break;case 4:var c=Object(A.i)(r.slice(0,4)),u=fn[c];if(u)o=this._abiCoder.decode(u.inputs,r.slice(4)),a=u.name,s=u.signature,u.reason&&(n=o[0]),"Error"===a?i="; VM Exception while processing transaction: reverted with reason string ".concat(JSON.stringify(o[0])):"Panic"===a&&(i="; VM Exception while processing transaction: reverted with panic code ".concat(o[0]));else try{var f=this.getError(c);o=this._abiCoder.decode(f.inputs,r.slice(4)),a=f.name,s=f.format()}catch(f){}}return an.throwError("call revert exception"+i,h.b.errors.CALL_EXCEPTION,{method:t.format(),data:Object(A.i)(e),errorArgs:o,errorName:a,errorSignature:s,reason:n})}},{key:"encodeFunctionResult",value:function(t,e){return"string"==typeof t&&(t=this.getFunction(t)),Object(A.i)(this._abiCoder.encode(t.outputs,e||[]))}},{key:"encodeFilterTopics",value:function(t,e){var r=this;"string"==typeof t&&(t=this.getEvent(t)),e.length>t.inputs.length&&an.throwError("too many arguments for "+t.format(),h.b.errors.UNEXPECTED_ARGUMENT,{argument:"values",value:e});var n=[];t.anonymous||n.push(this.getEventTopic(t));var i=function(t,e){return"string"===t.type?_t(e):"bytes"===t.type?V(Object(A.i)(e)):("bool"===t.type&&"boolean"==typeof e&&(e=e?"0x01":"0x00"),t.type.match(/^u?int/)&&(e=b.from(e).toHexString()),"address"===t.type&&r._abiCoder.encode(["address"],[e]),Object(A.h)(Object(A.i)(e),32))};for(e.forEach((function(e,r){var o=t.inputs[r];o.indexed?null==e?n.push(null):"array"===o.baseType||"tuple"===o.baseType?an.throwArgumentError("filtering with tuples or arrays not supported","contract."+o.name,e):Array.isArray(e)?n.push(e.map((function(t){return i(o,t)}))):n.push(i(o,e)):null!=e&&an.throwArgumentError("cannot filter non-indexed parameters; must be null","contract."+o.name,e)}));n.length&&null===n[n.length-1];)n.pop();return n}},{key:"encodeEventLog",value:function(t,e){var r=this;"string"==typeof t&&(t=this.getEvent(t));var n=[],i=[],o=[];return t.anonymous||n.push(this.getEventTopic(t)),e.length!==t.inputs.length&&an.throwArgumentError("event arguments/values mismatch","values",e),t.inputs.forEach((function(t,a){var s=e[a];if(t.indexed)if("string"===t.type)n.push(_t(s));else if("bytes"===t.type)n.push(V(s));else{if("tuple"===t.baseType||"array"===t.baseType)throw new Error("not implemented");n.push(r._abiCoder.encode([t.type],[s]))}else i.push(t),o.push(s)})),{data:this._abiCoder.encode(i,o),topics:n}}},{key:"decodeEventLog",value:function(t,e,r){if("string"==typeof t&&(t=this.getEvent(t)),null!=r&&!t.anonymous){var n=this.getEventTopic(t);Object(A.l)(r[0],32)&&r[0].toLowerCase()===n||an.throwError("fragment/topic mismatch",h.b.errors.INVALID_ARGUMENT,{argument:"topics[0]",expected:n,value:r[0]}),r=r.slice(1)}var i=[],o=[],a=[];t.inputs.forEach((function(t,e){t.indexed?"string"===t.type||"bytes"===t.type||"tuple"===t.baseType||"array"===t.baseType?(i.push(Sr.fromObject({type:"bytes32",name:t.name})),a.push(!0)):(i.push(t),a.push(!1)):(o.push(t),a.push(!1))}));var s=null!=r?this._abiCoder.decode(i,Object(A.b)(r)):null,c=this._abiCoder.decode(o,e,!0),u=[],f=0,l=0;t.inputs.forEach((function(t,e){if(t.indexed)if(null==s)u[e]=new un({_isIndexed:!0,hash:null});else if(a[e])u[e]=new un({_isIndexed:!0,hash:s[l++]});else try{u[e]=s[l++]}catch(t){u[e]=t}else try{u[e]=c[f++]}catch(t){u[e]=t}if(t.name&&null==u[t.name]){var r=u[e];r instanceof Error?Object.defineProperty(u,t.name,{enumerable:!0,get:function(){throw hn("property ".concat(JSON.stringify(t.name)),r)}}):u[t.name]=r}}));for(var d=function(t){var e=u[t];e instanceof Error&&Object.defineProperty(u,t,{enumerable:!0,get:function(){throw hn("index ".concat(t),e)}})},g=0;g<u.length;g++)d(g);return Object.freeze(u)}},{key:"parseTransaction",value:function(t){var e=this.getFunction(t.data.substring(0,10).toLowerCase());return e?new cn({args:this._abiCoder.decode(e.inputs,"0x"+t.data.substring(10)),functionFragment:e,name:e.name,signature:e.format(),sighash:this.getSighash(e),value:b.from(t.value||"0")}):null}},{key:"parseLog",value:function(t){var e=this.getEvent(t.topics[0]);return!e||e.anonymous?null:new sn({eventFragment:e,name:e.name,signature:e.format(),topic:this.getEventTopic(e),args:this.decodeEventLog(e,t.data,t.topics)})}},{key:"parseError",value:function(t){var e=Object(A.i)(t),r=this.getError(e.substring(0,10).toLowerCase());return r?new An({args:this._abiCoder.decode(r.inputs,"0x"+e.substring(10)),errorFragment:r,name:r.name,signature:r.format(),sighash:this.getSighash(r)}):null}}],[{key:"getAbiCoder",value:function(){return Zr}},{key:"getAddress",value:function(t){return ht(t)}},{key:"getSighash",value:function(t){return Object(A.e)(_t(t.format()),0,4)}},{key:"getEventTopic",value:function(t){return _t(t.format())}},{key:"isInterface",value:function(t){return!(!t||!t._isInterface)}}]),t}();function dn(t){return(dn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function gn(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */gn=function(){return t};var t={},e=Object.prototype,r=e.hasOwnProperty,n=Object.defineProperty||function(t,e,r){t[e]=r.value},i="function"==typeof Symbol?Symbol:{},o=i.iterator||"@@iterator",a=i.asyncIterator||"@@asyncIterator",s=i.toStringTag||"@@toStringTag";function c(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{c({},"")}catch(t){c=function(t,e,r){return t[e]=r}}function A(t,e,r,i){var o=e&&e.prototype instanceof h?e:h,a=Object.create(o.prototype),s=new B(i||[]);return n(a,"_invoke",{value:E(t,r,s)}),a}function u(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=A;var f={};function h(){}function l(){}function d(){}var g={};c(g,o,(function(){return this}));var p=Object.getPrototypeOf,y=p&&p(p(Q([])));y&&y!==e&&r.call(y,o)&&(g=y);var I=d.prototype=h.prototype=Object.create(g);function b(t){["next","throw","return"].forEach((function(e){c(t,e,(function(t){return this._invoke(e,t)}))}))}function v(t,e){var i;n(this,"_invoke",{value:function(n,o){function a(){return new e((function(i,a){!function n(i,o,a,s){var c=u(t[i],t,o);if("throw"!==c.type){var A=c.arg,f=A.value;return f&&"object"==dn(f)&&r.call(f,"__await")?e.resolve(f.__await).then((function(t){n("next",t,a,s)}),(function(t){n("throw",t,a,s)})):e.resolve(f).then((function(t){A.value=t,a(A)}),(function(t){return n("throw",t,a,s)}))}s(c.arg)}(n,o,i,a)}))}return i=i?i.then(a,a):a()}})}function E(t,e,r){var n="suspendedStart";return function(i,o){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===i)throw o;return k()}for(r.method=i,r.arg=o;;){var a=r.delegate;if(a){var s=m(a,r);if(s){if(s===f)continue;return s}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var c=u(t,e,r);if("normal"===c.type){if(n=r.done?"completed":"suspendedYield",c.arg===f)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(n="completed",r.method="throw",r.arg=c.arg)}}}function m(t,e){var r=e.method,n=t.iterator[r];if(void 0===n)return e.delegate=null,"throw"===r&&t.iterator.return&&(e.method="return",e.arg=void 0,m(t,e),"throw"===e.method)||"return"!==r&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+r+"' method")),f;var i=u(n,t.iterator,e.arg);if("throw"===i.type)return e.method="throw",e.arg=i.arg,e.delegate=null,f;var o=i.arg;return o?o.done?(e[t.resultName]=o.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,f):o:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,f)}function C(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function w(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function B(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(C,this),this.reset(!0)}function Q(t){if(t){var e=t[o];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,i=function e(){for(;++n<t.length;)if(r.call(t,n))return e.value=t[n],e.done=!1,e;return e.value=void 0,e.done=!0,e};return i.next=i}}return{next:k}}function k(){return{value:void 0,done:!0}}return l.prototype=d,n(I,"constructor",{value:d,configurable:!0}),n(d,"constructor",{value:l,configurable:!0}),l.displayName=c(d,s,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===l||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,d):(t.__proto__=d,c(t,s,"GeneratorFunction")),t.prototype=Object.create(I),t},t.awrap=function(t){return{__await:t}},b(v.prototype),c(v.prototype,a,(function(){return this})),t.AsyncIterator=v,t.async=function(e,r,n,i,o){void 0===o&&(o=Promise);var a=new v(A(e,r,n,i),o);return t.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},b(I),c(I,s,"Generator"),c(I,o,(function(){return this})),c(I,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},t.values=Q,B.prototype={constructor:B,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(w),!t)for(var e in this)"t"===e.charAt(0)&&r.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function n(r,n){return a.type="throw",a.arg=t,e.next=r,n&&(e.method="next",e.arg=void 0),!!n}for(var i=this.tryEntries.length-1;i>=0;--i){var o=this.tryEntries[i],a=o.completion;if("root"===o.tryLoc)return n("end");if(o.tryLoc<=this.prev){var s=r.call(o,"catchLoc"),c=r.call(o,"finallyLoc");if(s&&c){if(this.prev<o.catchLoc)return n(o.catchLoc,!0);if(this.prev<o.finallyLoc)return n(o.finallyLoc)}else if(s){if(this.prev<o.catchLoc)return n(o.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return n(o.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&r.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var o=i;break}}o&&("break"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc&&(o=null);var a=o?o.completion:{};return a.type=t,a.arg=e,o?(this.method="next",this.next=o.finallyLoc,f):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),f},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),w(r),f}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var i=n.arg;w(r)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:Q(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),f}},t}function pn(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function yn(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,(i=n.key,o=void 0,o=function(t,e){if("object"!==dn(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==dn(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(i,"string"),"symbol"===dn(o)?o:String(o)),n)}var i,o}function In(t,e,r){return e&&yn(t.prototype,e),r&&yn(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function bn(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&vn(t,e)}function vn(t,e){return(vn=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}function En(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=Cn(t);if(e){var i=Cn(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return mn(this,r)}}function mn(t,e){if(e&&("object"===dn(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function Cn(t){return(Cn=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var wn=function(t,e,r,n){return new(r||(r=Promise))((function(i,o){function a(t){try{c(n.next(t))}catch(t){o(t)}}function s(t){try{c(n.throw(t))}catch(t){o(t)}}function c(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(a,s)}c((n=n.apply(t,e||[])).next())}))},Bn=new h.b("abstract-provider/5.7.0"),Qn=function(t){bn(r,t);var e=En(r);function r(){return pn(this,r),e.apply(this,arguments)}return In(r,null,[{key:"isForkEvent",value:function(t){return!(!t||!t._isForkEvent)}}]),r}(L),kn=function(){function t(){pn(this,t),Bn.checkAbstract(this instanceof t?this.constructor:void 0,t),D(this,"_isProvider",!0)}return In(t,[{key:"getFeeData",value:function(){return wn(this,void 0,void 0,gn().mark((function t(){var e,r,n,i,o,a;return gn().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,M({block:this.getBlock("latest"),gasPrice:this.getGasPrice().catch((function(t){return null}))});case 2:return e=t.sent,r=e.block,n=e.gasPrice,i=null,o=null,a=null,r&&r.baseFeePerGas&&(i=r.baseFeePerGas,a=b.from("1500000000"),o=r.baseFeePerGas.mul(2).add(a)),t.abrupt("return",{lastBaseFeePerGas:i,maxFeePerGas:o,maxPriorityFeePerGas:a,gasPrice:n});case 8:case"end":return t.stop()}}),t,this)})))}},{key:"addListener",value:function(t,e){return this.on(t,e)}},{key:"removeListener",value:function(t,e){return this.off(t,e)}}],[{key:"isProvider",value:function(t){return!(!t||!t._isProvider)}}]),t}();function Sn(t){return(Sn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function _n(t,e){return(_n=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}function Dn(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=Rn(t);if(e){var i=Rn(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return xn(this,r)}}function xn(t,e){if(e&&("object"===Sn(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return Mn(t)}function Mn(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Rn(t){return(Rn=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function On(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */On=function(){return t};var t={},e=Object.prototype,r=e.hasOwnProperty,n=Object.defineProperty||function(t,e,r){t[e]=r.value},i="function"==typeof Symbol?Symbol:{},o=i.iterator||"@@iterator",a=i.asyncIterator||"@@asyncIterator",s=i.toStringTag||"@@toStringTag";function c(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{c({},"")}catch(t){c=function(t,e,r){return t[e]=r}}function A(t,e,r,i){var o=e&&e.prototype instanceof h?e:h,a=Object.create(o.prototype),s=new B(i||[]);return n(a,"_invoke",{value:E(t,r,s)}),a}function u(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=A;var f={};function h(){}function l(){}function d(){}var g={};c(g,o,(function(){return this}));var p=Object.getPrototypeOf,y=p&&p(p(Q([])));y&&y!==e&&r.call(y,o)&&(g=y);var I=d.prototype=h.prototype=Object.create(g);function b(t){["next","throw","return"].forEach((function(e){c(t,e,(function(t){return this._invoke(e,t)}))}))}function v(t,e){var i;n(this,"_invoke",{value:function(n,o){function a(){return new e((function(i,a){!function n(i,o,a,s){var c=u(t[i],t,o);if("throw"!==c.type){var A=c.arg,f=A.value;return f&&"object"==Sn(f)&&r.call(f,"__await")?e.resolve(f.__await).then((function(t){n("next",t,a,s)}),(function(t){n("throw",t,a,s)})):e.resolve(f).then((function(t){A.value=t,a(A)}),(function(t){return n("throw",t,a,s)}))}s(c.arg)}(n,o,i,a)}))}return i=i?i.then(a,a):a()}})}function E(t,e,r){var n="suspendedStart";return function(i,o){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===i)throw o;return k()}for(r.method=i,r.arg=o;;){var a=r.delegate;if(a){var s=m(a,r);if(s){if(s===f)continue;return s}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var c=u(t,e,r);if("normal"===c.type){if(n=r.done?"completed":"suspendedYield",c.arg===f)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(n="completed",r.method="throw",r.arg=c.arg)}}}function m(t,e){var r=e.method,n=t.iterator[r];if(void 0===n)return e.delegate=null,"throw"===r&&t.iterator.return&&(e.method="return",e.arg=void 0,m(t,e),"throw"===e.method)||"return"!==r&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+r+"' method")),f;var i=u(n,t.iterator,e.arg);if("throw"===i.type)return e.method="throw",e.arg=i.arg,e.delegate=null,f;var o=i.arg;return o?o.done?(e[t.resultName]=o.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,f):o:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,f)}function C(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function w(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function B(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(C,this),this.reset(!0)}function Q(t){if(t){var e=t[o];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,i=function e(){for(;++n<t.length;)if(r.call(t,n))return e.value=t[n],e.done=!1,e;return e.value=void 0,e.done=!0,e};return i.next=i}}return{next:k}}function k(){return{value:void 0,done:!0}}return l.prototype=d,n(I,"constructor",{value:d,configurable:!0}),n(d,"constructor",{value:l,configurable:!0}),l.displayName=c(d,s,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===l||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,d):(t.__proto__=d,c(t,s,"GeneratorFunction")),t.prototype=Object.create(I),t},t.awrap=function(t){return{__await:t}},b(v.prototype),c(v.prototype,a,(function(){return this})),t.AsyncIterator=v,t.async=function(e,r,n,i,o){void 0===o&&(o=Promise);var a=new v(A(e,r,n,i),o);return t.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},b(I),c(I,s,"Generator"),c(I,o,(function(){return this})),c(I,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},t.values=Q,B.prototype={constructor:B,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(w),!t)for(var e in this)"t"===e.charAt(0)&&r.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function n(r,n){return a.type="throw",a.arg=t,e.next=r,n&&(e.method="next",e.arg=void 0),!!n}for(var i=this.tryEntries.length-1;i>=0;--i){var o=this.tryEntries[i],a=o.completion;if("root"===o.tryLoc)return n("end");if(o.tryLoc<=this.prev){var s=r.call(o,"catchLoc"),c=r.call(o,"finallyLoc");if(s&&c){if(this.prev<o.catchLoc)return n(o.catchLoc,!0);if(this.prev<o.finallyLoc)return n(o.finallyLoc)}else if(s){if(this.prev<o.catchLoc)return n(o.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return n(o.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&r.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var o=i;break}}o&&("break"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc&&(o=null);var a=o?o.completion:{};return a.type=t,a.arg=e,o?(this.method="next",this.next=o.finallyLoc,f):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),f},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),w(r),f}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var i=n.arg;w(r)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:Q(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),f}},t}function Nn(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Pn(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,(i=n.key,o=void 0,o=function(t,e){if("object"!==Sn(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==Sn(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(i,"string"),"symbol"===Sn(o)?o:String(o)),n)}var i,o}function jn(t,e,r){return e&&Pn(t.prototype,e),r&&Pn(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}var Ln=function(t,e,r,n){return new(r||(r=Promise))((function(i,o){function a(t){try{c(n.next(t))}catch(t){o(t)}}function s(t){try{c(n.throw(t))}catch(t){o(t)}}function c(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(a,s)}c((n=n.apply(t,e||[])).next())}))},Fn=new h.b("abstract-signer/5.7.0"),Tn=["accessList","ccipReadEnabled","chainId","customData","data","from","gasLimit","gasPrice","maxFeePerGas","maxPriorityFeePerGas","nonce","to","type","value"],Un=[h.b.errors.INSUFFICIENT_FUNDS,h.b.errors.NONCE_EXPIRED,h.b.errors.REPLACEMENT_UNDERPRICED],Gn=function(){function t(){Nn(this,t),Fn.checkAbstract(this instanceof t?this.constructor:void 0,t),D(this,"_isSigner",!0)}return jn(t,[{key:"getBalance",value:function(t){return Ln(this,void 0,void 0,On().mark((function e(){return On().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this._checkProvider("getBalance"),e.next=3,this.provider.getBalance(this.getAddress(),t);case 3:return e.abrupt("return",e.sent);case 4:case"end":return e.stop()}}),e,this)})))}},{key:"getTransactionCount",value:function(t){return Ln(this,void 0,void 0,On().mark((function e(){return On().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this._checkProvider("getTransactionCount"),e.next=3,this.provider.getTransactionCount(this.getAddress(),t);case 3:return e.abrupt("return",e.sent);case 4:case"end":return e.stop()}}),e,this)})))}},{key:"estimateGas",value:function(t){return Ln(this,void 0,void 0,On().mark((function e(){var r;return On().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this._checkProvider("estimateGas"),e.next=3,M(this.checkTransaction(t));case 3:return r=e.sent,e.next=6,this.provider.estimateGas(r);case 6:return e.abrupt("return",e.sent);case 7:case"end":return e.stop()}}),e,this)})))}},{key:"call",value:function(t,e){return Ln(this,void 0,void 0,On().mark((function r(){var n;return On().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return this._checkProvider("call"),r.next=3,M(this.checkTransaction(t));case 3:return n=r.sent,r.next=6,this.provider.call(n,e);case 6:return r.abrupt("return",r.sent);case 7:case"end":return r.stop()}}),r,this)})))}},{key:"sendTransaction",value:function(t){return Ln(this,void 0,void 0,On().mark((function e(){var r,n;return On().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this._checkProvider("sendTransaction"),e.next=3,this.populateTransaction(t);case 3:return r=e.sent,e.next=6,this.signTransaction(r);case 6:return n=e.sent,e.next=9,this.provider.sendTransaction(n);case 9:return e.abrupt("return",e.sent);case 10:case"end":return e.stop()}}),e,this)})))}},{key:"getChainId",value:function(){return Ln(this,void 0,void 0,On().mark((function t(){var e;return On().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this._checkProvider("getChainId"),t.next=3,this.provider.getNetwork();case 3:return e=t.sent,t.abrupt("return",e.chainId);case 5:case"end":return t.stop()}}),t,this)})))}},{key:"getGasPrice",value:function(){return Ln(this,void 0,void 0,On().mark((function t(){return On().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this._checkProvider("getGasPrice"),t.next=3,this.provider.getGasPrice();case 3:return t.abrupt("return",t.sent);case 4:case"end":return t.stop()}}),t,this)})))}},{key:"getFeeData",value:function(){return Ln(this,void 0,void 0,On().mark((function t(){return On().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this._checkProvider("getFeeData"),t.next=3,this.provider.getFeeData();case 3:return t.abrupt("return",t.sent);case 4:case"end":return t.stop()}}),t,this)})))}},{key:"resolveName",value:function(t){return Ln(this,void 0,void 0,On().mark((function e(){return On().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this._checkProvider("resolveName"),e.next=3,this.provider.resolveName(t);case 3:return e.abrupt("return",e.sent);case 4:case"end":return e.stop()}}),e,this)})))}},{key:"checkTransaction",value:function(t){for(var e in t)-1===Tn.indexOf(e)&&Fn.throwArgumentError("invalid transaction key: "+e,"transaction",t);var r=O(t);return null==r.from?r.from=this.getAddress():r.from=Promise.all([Promise.resolve(r.from),this.getAddress()]).then((function(e){return e[0].toLowerCase()!==e[1].toLowerCase()&&Fn.throwArgumentError("from address mismatch","transaction",t),e[0]})),r}},{key:"populateTransaction",value:function(t){return Ln(this,void 0,void 0,On().mark((function e(){var r,n,i,o,a=this;return On().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,M(this.checkTransaction(t));case 2:if(null!=(r=e.sent).to&&(r.to=Promise.resolve(r.to).then((function(t){return Ln(a,void 0,void 0,On().mark((function e(){var r;return On().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!=t){e.next=2;break}return e.abrupt("return",null);case 2:return e.next=4,this.resolveName(t);case 4:return null==(r=e.sent)&&Fn.throwArgumentError("provided ENS name resolves to null","tx.to",t),e.abrupt("return",r);case 7:case"end":return e.stop()}}),e,this)})))})),r.to.catch((function(t){}))),n=null!=r.maxFeePerGas||null!=r.maxPriorityFeePerGas,null==r.gasPrice||2!==r.type&&!n?0!==r.type&&1!==r.type||!n||Fn.throwArgumentError("pre-eip-1559 transaction do not support maxFeePerGas/maxPriorityFeePerGas","transaction",t):Fn.throwArgumentError("eip-1559 transaction do not support gasPrice","transaction",t),2!==r.type&&null!=r.type||null==r.maxFeePerGas||null==r.maxPriorityFeePerGas){e.next=10;break}r.type=2,e.next=18;break;case 10:if(0!==r.type&&1!==r.type){e.next=14;break}null==r.gasPrice&&(r.gasPrice=this.getGasPrice()),e.next=18;break;case 14:return e.next=16,this.getFeeData();case 16:i=e.sent,null==r.type?null!=i.maxFeePerGas&&null!=i.maxPriorityFeePerGas?(r.type=2,null!=r.gasPrice?(o=r.gasPrice,delete r.gasPrice,r.maxFeePerGas=o,r.maxPriorityFeePerGas=o):(null==r.maxFeePerGas&&(r.maxFeePerGas=i.maxFeePerGas),null==r.maxPriorityFeePerGas&&(r.maxPriorityFeePerGas=i.maxPriorityFeePerGas))):null!=i.gasPrice?(n&&Fn.throwError("network does not support EIP-1559",h.b.errors.UNSUPPORTED_OPERATION,{operation:"populateTransaction"}),null==r.gasPrice&&(r.gasPrice=i.gasPrice),r.type=0):Fn.throwError("failed to get consistent fee data",h.b.errors.UNSUPPORTED_OPERATION,{operation:"signer.getFeeData"}):2===r.type&&(null==r.maxFeePerGas&&(r.maxFeePerGas=i.maxFeePerGas),null==r.maxPriorityFeePerGas&&(r.maxPriorityFeePerGas=i.maxPriorityFeePerGas));case 18:return null==r.nonce&&(r.nonce=this.getTransactionCount("pending")),null==r.gasLimit&&(r.gasLimit=this.estimateGas(r).catch((function(t){if(Un.indexOf(t.code)>=0)throw t;return Fn.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",h.b.errors.UNPREDICTABLE_GAS_LIMIT,{error:t,tx:r})}))),null==r.chainId?r.chainId=this.getChainId():r.chainId=Promise.all([Promise.resolve(r.chainId),this.getChainId()]).then((function(e){return 0!==e[1]&&e[0]!==e[1]&&Fn.throwArgumentError("chainId address mismatch","transaction",t),e[0]})),e.next=23,M(r);case 23:return e.abrupt("return",e.sent);case 24:case"end":return e.stop()}}),e,this)})))}},{key:"_checkProvider",value:function(t){this.provider||Fn.throwError("missing provider",h.b.errors.UNSUPPORTED_OPERATION,{operation:t||"_checkProvider"})}}],[{key:"isSigner",value:function(t){return!(!t||!t._isSigner)}}]),t}(),Hn=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&_n(t,e)}(r,t);var e=Dn(r);function r(t,n){var i;return Nn(this,r),D(Mn(i=e.call(this)),"address",t),D(Mn(i),"provider",n||null),i}return jn(r,[{key:"getAddress",value:function(){return Promise.resolve(this.address)}},{key:"_fail",value:function(t,e){return Promise.resolve().then((function(){Fn.throwError(t,h.b.errors.UNSUPPORTED_OPERATION,{operation:e})}))}},{key:"signMessage",value:function(t){return this._fail("VoidSigner cannot sign messages","signMessage")}},{key:"signTransaction",value:function(t){return this._fail("VoidSigner cannot sign transactions","signTransaction")}},{key:"_signTypedData",value:function(t,e,r){return this._fail("VoidSigner cannot sign typed data","signTypedData")}},{key:"connect",value:function(t){return new r(this.address,t)}}]),r}(Gn),Yn=r(166);function Kn(t){return(Kn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function qn(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,(i=n.key,o=void 0,o=function(t,e){if("object"!==Kn(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==Kn(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(i,"string"),"symbol"===Kn(o)?o:String(o)),n)}var i,o}var Jn=new h.b("signing-key/5.7.0"),zn=null;function Zn(){return zn||(zn=new Yn.a("secp256k1")),zn}var Vn=function(){function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),D(this,"curve","secp256k1"),D(this,"privateKey",Object(A.i)(e)),32!==Object(A.d)(this.privateKey)&&Jn.throwArgumentError("invalid private key","privateKey","[[ REDACTED ]]");var r=Zn().keyFromPrivate(Object(A.a)(this.privateKey));D(this,"publicKey","0x"+r.getPublic(!1,"hex")),D(this,"compressedPublicKey","0x"+r.getPublic(!0,"hex")),D(this,"_isSigningKey",!0)}var e,r,n;return e=t,n=[{key:"isSigningKey",value:function(t){return!(!t||!t._isSigningKey)}}],(r=[{key:"_addPoint",value:function(t){var e=Zn().keyFromPublic(Object(A.a)(this.publicKey)),r=Zn().keyFromPublic(Object(A.a)(t));return"0x"+e.pub.add(r.pub).encodeCompressed("hex")}},{key:"signDigest",value:function(t){var e=Zn().keyFromPrivate(Object(A.a)(this.privateKey)),r=Object(A.a)(t);32!==r.length&&Jn.throwArgumentError("bad digest length","digest",t);var n=e.sign(r,{canonical:!0});return Object(A.n)({recoveryParam:n.recoveryParam,r:Object(A.h)("0x"+n.r.toString(16),32),s:Object(A.h)("0x"+n.s.toString(16),32)})}},{key:"computeSharedSecret",value:function(t){var e=Zn().keyFromPrivate(Object(A.a)(this.privateKey)),r=Zn().keyFromPublic(Object(A.a)(Xn(t)));return Object(A.h)("0x"+e.derive(r.getPublic()).toString(16),32)}}])&&qn(e.prototype,r),n&&qn(e,n),Object.defineProperty(e,"prototype",{writable:!1}),t}();function Wn(t,e){var r=Object(A.n)(e),n={r:Object(A.a)(r.r),s:Object(A.a)(r.s)};return"0x"+Zn().recoverPubKey(Object(A.a)(t),n,r.recoveryParam).encode("hex",!1)}function Xn(t,e){var r=Object(A.a)(t);if(32===r.length){var n=new Vn(r);return e?"0x"+Zn().keyFromPrivate(r).getPublic(!0,"hex"):n.publicKey}return 33===r.length?e?Object(A.i)(r):"0x"+Zn().keyFromPublic(r).getPublic(!1,"hex"):65===r.length?e?"0x"+Zn().keyFromPublic(r).getPublic(!0,"hex"):Object(A.i)(r):Jn.throwArgumentError("invalid public or private key","key","[REDACTED]")}var $n,ti=new h.b("transactions/5.7.0");function ei(t){return"0x"===t?null:ht(t)}function ri(t){return"0x"===t?Ne:b.from(t)}!function(t){t[t.legacy=0]="legacy",t[t.eip2930=1]="eip2930",t[t.eip1559=2]="eip1559"}($n||($n={}));var ni=[{name:"nonce",maxLength:32,numeric:!0},{name:"gasPrice",maxLength:32,numeric:!0},{name:"gasLimit",maxLength:32,numeric:!0},{name:"to",length:20},{name:"value",maxLength:32,numeric:!0},{name:"data"}],ii={chainId:!0,data:!0,gasLimit:!0,gasPrice:!0,nonce:!0,to:!0,type:!0,value:!0};function oi(t){var e=Xn(t);return ht(Object(A.e)(V(Object(A.e)(e,1)),12))}function ai(t,e){return oi(Wn(Object(A.a)(t),e))}function si(t,e){var r=Object(A.o)(b.from(t).toHexString());return r.length>32&&ti.throwArgumentError("invalid length for "+e,"transaction:"+e,t),r}function ci(t,e){return{address:ht(t),storageKeys:(e||[]).map((function(e,r){return 32!==Object(A.d)(e)&&ti.throwArgumentError("invalid access list storageKey","accessList[".concat(t,":").concat(r,"]"),e),e.toLowerCase()}))}}function Ai(t){if(Array.isArray(t))return t.map((function(t,e){return Array.isArray(t)?(t.length>2&&ti.throwArgumentError("access list expected to be [ address, storageKeys[] ]","value[".concat(e,"]"),t),ci(t[0],t[1])):ci(t.address,t.storageKeys)}));var e=Object.keys(t).map((function(e){var r=t[e].reduce((function(t,e){return t[e]=!0,t}),{});return ci(e,Object.keys(r).sort())}));return e.sort((function(t,e){return t.address.localeCompare(e.address)})),e}function ui(t){return Ai(t).map((function(t){return[t.address,t.storageKeys]}))}function fi(t,e){if(null!=t.gasPrice){var r=b.from(t.gasPrice),n=b.from(t.maxFeePerGas||0);r.eq(n)||ti.throwArgumentError("mismatch EIP-1559 gasPrice != maxFeePerGas","tx",{gasPrice:r,maxFeePerGas:n})}var i=[si(t.chainId||0,"chainId"),si(t.nonce||0,"nonce"),si(t.maxPriorityFeePerGas||0,"maxPriorityFeePerGas"),si(t.maxFeePerGas||0,"maxFeePerGas"),si(t.gasLimit||0,"gasLimit"),null!=t.to?ht(t.to):"0x",si(t.value||0,"value"),t.data||"0x",ui(t.accessList||[])];if(e){var o=Object(A.n)(e);i.push(si(o.recoveryParam,"recoveryParam")),i.push(Object(A.o)(o.r)),i.push(Object(A.o)(o.s))}return Object(A.c)(["0x02",tt(i)])}function hi(t,e){var r=[si(t.chainId||0,"chainId"),si(t.nonce||0,"nonce"),si(t.gasPrice||0,"gasPrice"),si(t.gasLimit||0,"gasLimit"),null!=t.to?ht(t.to):"0x",si(t.value||0,"value"),t.data||"0x",ui(t.accessList||[])];if(e){var n=Object(A.n)(e);r.push(si(n.recoveryParam,"recoveryParam")),r.push(Object(A.o)(n.r)),r.push(Object(A.o)(n.s))}return Object(A.c)(["0x01",tt(r)])}function li(t,e){if(null==t.type||0===t.type)return null!=t.accessList&&ti.throwArgumentError("untyped transactions do not support accessList; include type: 1","transaction",t),function(t,e){R(t,ii);var r=[];ni.forEach((function(e){var n=t[e.name]||[],i={};e.numeric&&(i.hexPad="left"),n=Object(A.a)(Object(A.i)(n,i)),e.length&&n.length!==e.length&&n.length>0&&ti.throwArgumentError("invalid length for "+e.name,"transaction:"+e.name,n),e.maxLength&&(n=Object(A.o)(n)).length>e.maxLength&&ti.throwArgumentError("invalid length for "+e.name,"transaction:"+e.name,n),r.push(Object(A.i)(n))}));var n=0;if(null!=t.chainId?"number"!=typeof(n=t.chainId)&&ti.throwArgumentError("invalid transaction.chainId","transaction",t):e&&!Object(A.k)(e)&&e.v>28&&(n=Math.floor((e.v-35)/2)),0!==n&&(r.push(Object(A.i)(n)),r.push("0x"),r.push("0x")),!e)return tt(r);var i=Object(A.n)(e),o=27+i.recoveryParam;return 0!==n?(r.pop(),r.pop(),r.pop(),o+=2*n+8,i.v>28&&i.v!==o&&ti.throwArgumentError("transaction.chainId/signature.v mismatch","signature",e)):i.v!==o&&ti.throwArgumentError("transaction.chainId/signature.v mismatch","signature",e),r.push(Object(A.i)(o)),r.push(Object(A.o)(Object(A.a)(i.r))),r.push(Object(A.o)(Object(A.a)(i.s))),tt(r)}(t,e);switch(t.type){case 1:return hi(t,e);case 2:return fi(t,e)}return ti.throwError("unsupported transaction type: ".concat(t.type),h.b.errors.UNSUPPORTED_OPERATION,{operation:"serializeTransaction",transactionType:t.type})}function di(t,e,r){try{var n=ri(e[0]).toNumber();if(0!==n&&1!==n)throw new Error("bad recid");t.v=n}catch(t){ti.throwArgumentError("invalid v for transaction type: 1","v",e[0])}t.r=Object(A.h)(e[1],32),t.s=Object(A.h)(e[2],32);try{var i=V(r(t));t.from=ai(i,{r:t.r,s:t.s,recoveryParam:t.v})}catch(t){}}function gi(t){var e=Object(A.a)(t);if(e[0]>127)return function(t){var e=nt(t);9!==e.length&&6!==e.length&&ti.throwArgumentError("invalid raw transaction","rawTransaction",t);var r={nonce:ri(e[0]).toNumber(),gasPrice:ri(e[1]),gasLimit:ri(e[2]),to:ei(e[3]),value:ri(e[4]),data:e[5],chainId:0};if(6===e.length)return r;try{r.v=b.from(e[6]).toNumber()}catch(t){return r}if(r.r=Object(A.h)(e[7],32),r.s=Object(A.h)(e[8],32),b.from(r.r).isZero()&&b.from(r.s).isZero())r.chainId=r.v,r.v=0;else{r.chainId=Math.floor((r.v-35)/2),r.chainId<0&&(r.chainId=0);var n=r.v-27,i=e.slice(0,6);0!==r.chainId&&(i.push(Object(A.i)(r.chainId)),i.push("0x"),i.push("0x"),n-=2*r.chainId+8);var o=V(tt(i));try{r.from=ai(o,{r:Object(A.i)(r.r),s:Object(A.i)(r.s),recoveryParam:n})}catch(t){}r.hash=V(t)}return r.type=null,r}(e);switch(e[0]){case 1:return function(t){var e=nt(t.slice(1));8!==e.length&&11!==e.length&&ti.throwArgumentError("invalid component count for transaction type: 1","payload",Object(A.i)(t));var r={type:1,chainId:ri(e[0]).toNumber(),nonce:ri(e[1]).toNumber(),gasPrice:ri(e[2]),gasLimit:ri(e[3]),to:ei(e[4]),value:ri(e[5]),data:e[6],accessList:Ai(e[7])};return 8===e.length||(r.hash=V(t),di(r,e.slice(8),hi)),r}(e);case 2:return function(t){var e=nt(t.slice(1));9!==e.length&&12!==e.length&&ti.throwArgumentError("invalid component count for transaction type: 2","payload",Object(A.i)(t));var r=ri(e[2]),n=ri(e[3]),i={type:2,chainId:ri(e[0]).toNumber(),nonce:ri(e[1]).toNumber(),maxPriorityFeePerGas:r,maxFeePerGas:n,gasPrice:null,gasLimit:ri(e[4]),to:ei(e[5]),value:ri(e[6]),data:e[7],accessList:Ai(e[8])};return 9===e.length||(i.hash=V(t),di(i,e.slice(9),fi)),i}(e)}return ti.throwError("unsupported transaction type: ".concat(e[0]),h.b.errors.UNSUPPORTED_OPERATION,{operation:"parseTransaction",transactionType:e[0]})}function pi(t){return function(t){if(Array.isArray(t))return yi(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(!t)return;if("string"==typeof t)return yi(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return yi(t,e)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function yi(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function Ii(){return(Ii="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,r){var n=bi(t,e);if(n){var i=Object.getOwnPropertyDescriptor(n,e);return i.get?i.get.call(arguments.length<3?t:r):i.value}}).apply(this,arguments)}function bi(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=Bi(t)););return t}function vi(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Ei(t,e)}function Ei(t,e){return(Ei=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}function mi(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=Bi(t);if(e){var i=Bi(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return Ci(this,r)}}function Ci(t,e){if(e&&("object"===_i(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return wi(t)}function wi(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Bi(t){return(Bi=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function Qi(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function ki(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,(i=n.key,o=void 0,o=function(t,e){if("object"!==_i(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==_i(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(i,"string"),"symbol"===_i(o)?o:String(o)),n)}var i,o}function Si(t,e,r){return e&&ki(t.prototype,e),r&&ki(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function _i(t){return(_i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Di(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */Di=function(){return t};var t={},e=Object.prototype,r=e.hasOwnProperty,n=Object.defineProperty||function(t,e,r){t[e]=r.value},i="function"==typeof Symbol?Symbol:{},o=i.iterator||"@@iterator",a=i.asyncIterator||"@@asyncIterator",s=i.toStringTag||"@@toStringTag";function c(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{c({},"")}catch(t){c=function(t,e,r){return t[e]=r}}function A(t,e,r,i){var o=e&&e.prototype instanceof h?e:h,a=Object.create(o.prototype),s=new B(i||[]);return n(a,"_invoke",{value:E(t,r,s)}),a}function u(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=A;var f={};function h(){}function l(){}function d(){}var g={};c(g,o,(function(){return this}));var p=Object.getPrototypeOf,y=p&&p(p(Q([])));y&&y!==e&&r.call(y,o)&&(g=y);var I=d.prototype=h.prototype=Object.create(g);function b(t){["next","throw","return"].forEach((function(e){c(t,e,(function(t){return this._invoke(e,t)}))}))}function v(t,e){var i;n(this,"_invoke",{value:function(n,o){function a(){return new e((function(i,a){!function n(i,o,a,s){var c=u(t[i],t,o);if("throw"!==c.type){var A=c.arg,f=A.value;return f&&"object"==_i(f)&&r.call(f,"__await")?e.resolve(f.__await).then((function(t){n("next",t,a,s)}),(function(t){n("throw",t,a,s)})):e.resolve(f).then((function(t){A.value=t,a(A)}),(function(t){return n("throw",t,a,s)}))}s(c.arg)}(n,o,i,a)}))}return i=i?i.then(a,a):a()}})}function E(t,e,r){var n="suspendedStart";return function(i,o){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===i)throw o;return k()}for(r.method=i,r.arg=o;;){var a=r.delegate;if(a){var s=m(a,r);if(s){if(s===f)continue;return s}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var c=u(t,e,r);if("normal"===c.type){if(n=r.done?"completed":"suspendedYield",c.arg===f)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(n="completed",r.method="throw",r.arg=c.arg)}}}function m(t,e){var r=e.method,n=t.iterator[r];if(void 0===n)return e.delegate=null,"throw"===r&&t.iterator.return&&(e.method="return",e.arg=void 0,m(t,e),"throw"===e.method)||"return"!==r&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+r+"' method")),f;var i=u(n,t.iterator,e.arg);if("throw"===i.type)return e.method="throw",e.arg=i.arg,e.delegate=null,f;var o=i.arg;return o?o.done?(e[t.resultName]=o.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,f):o:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,f)}function C(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function w(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function B(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(C,this),this.reset(!0)}function Q(t){if(t){var e=t[o];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,i=function e(){for(;++n<t.length;)if(r.call(t,n))return e.value=t[n],e.done=!1,e;return e.value=void 0,e.done=!0,e};return i.next=i}}return{next:k}}function k(){return{value:void 0,done:!0}}return l.prototype=d,n(I,"constructor",{value:d,configurable:!0}),n(d,"constructor",{value:l,configurable:!0}),l.displayName=c(d,s,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===l||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,d):(t.__proto__=d,c(t,s,"GeneratorFunction")),t.prototype=Object.create(I),t},t.awrap=function(t){return{__await:t}},b(v.prototype),c(v.prototype,a,(function(){return this})),t.AsyncIterator=v,t.async=function(e,r,n,i,o){void 0===o&&(o=Promise);var a=new v(A(e,r,n,i),o);return t.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},b(I),c(I,s,"Generator"),c(I,o,(function(){return this})),c(I,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},t.values=Q,B.prototype={constructor:B,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(w),!t)for(var e in this)"t"===e.charAt(0)&&r.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function n(r,n){return a.type="throw",a.arg=t,e.next=r,n&&(e.method="next",e.arg=void 0),!!n}for(var i=this.tryEntries.length-1;i>=0;--i){var o=this.tryEntries[i],a=o.completion;if("root"===o.tryLoc)return n("end");if(o.tryLoc<=this.prev){var s=r.call(o,"catchLoc"),c=r.call(o,"finallyLoc");if(s&&c){if(this.prev<o.catchLoc)return n(o.catchLoc,!0);if(this.prev<o.finallyLoc)return n(o.finallyLoc)}else if(s){if(this.prev<o.catchLoc)return n(o.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return n(o.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&r.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var o=i;break}}o&&("break"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc&&(o=null);var a=o?o.completion:{};return a.type=t,a.arg=e,o?(this.method="next",this.next=o.finallyLoc,f):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),f},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),w(r),f}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var i=n.arg;w(r)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:Q(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),f}},t}var xi=function(t,e,r,n){return new(r||(r=Promise))((function(i,o){function a(t){try{c(n.next(t))}catch(t){o(t)}}function s(t){try{c(n.throw(t))}catch(t){o(t)}}function c(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(a,s)}c((n=n.apply(t,e||[])).next())}))},Mi=new h.b("contracts/5.7.0"),Ri={chainId:!0,data:!0,from:!0,gasLimit:!0,gasPrice:!0,nonce:!0,to:!0,value:!0,type:!0,accessList:!0,maxFeePerGas:!0,maxPriorityFeePerGas:!0,customData:!0,ccipReadEnabled:!0};function Oi(t,e){return xi(this,void 0,void 0,Di().mark((function r(){var n,i;return Di().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,e;case 2:return"string"!=typeof(n=r.sent)&&Mi.throwArgumentError("invalid address or ENS name","name",n),r.prev=4,r.abrupt("return",ht(n));case 8:r.prev=8,r.t0=r.catch(4);case 10:return t||Mi.throwError("a provider or signer is needed to resolve ENS names",h.b.errors.UNSUPPORTED_OPERATION,{operation:"resolveName"}),r.next=13,t.resolveName(n);case 13:return null==(i=r.sent)&&Mi.throwArgumentError("resolver or addr is not configured for ENS name","name",n),r.abrupt("return",i);case 16:case"end":return r.stop()}}),r,null,[[4,8]])})))}function Ni(t,e,r){return xi(this,void 0,void 0,Di().mark((function n(){return Di().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(!Array.isArray(r)){n.next=4;break}return n.next=3,Promise.all(r.map((function(r,n){return Ni(t,Array.isArray(e)?e[n]:e[r.name],r)})));case 3:return n.abrupt("return",n.sent);case 4:if("address"!==r.type){n.next=8;break}return n.next=7,Oi(t,e);case 7:return n.abrupt("return",n.sent);case 8:if("tuple"!==r.type){n.next=12;break}return n.next=11,Ni(t,e,r.components);case 11:return n.abrupt("return",n.sent);case 12:if("array"!==r.baseType){n.next=18;break}if(Array.isArray(e)){n.next=15;break}return n.abrupt("return",Promise.reject(Mi.makeError("invalid value for array",h.b.errors.INVALID_ARGUMENT,{argument:"value",value:e})));case 15:return n.next=17,Promise.all(e.map((function(e){return Ni(t,e,r.arrayChildren)})));case 17:return n.abrupt("return",n.sent);case 18:return n.abrupt("return",e);case 19:case"end":return n.stop()}}),n)})))}function Pi(t,e,r){return xi(this,void 0,void 0,Di().mark((function n(){var i,o,a,s,c,u,f,l,d,g,p=this;return Di().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return i={},r.length===e.inputs.length+1&&"object"===_i(r[r.length-1])&&(i=O(r.pop())),Mi.checkArgumentCount(r.length,e.inputs.length,"passed to contract"),t.signer?i.from?i.from=M({override:Oi(t.signer,i.from),signer:t.signer.getAddress()}).then((function(t){return xi(p,void 0,void 0,Di().mark((function e(){return Di().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return ht(t.signer)!==t.override&&Mi.throwError("Contract with a Signer cannot override from",h.b.errors.UNSUPPORTED_OPERATION,{operation:"overrides.from"}),e.abrupt("return",t.override);case 2:case"end":return e.stop()}}),e)})))})):i.from=t.signer.getAddress():i.from&&(i.from=Oi(t.provider,i.from)),n.next=6,M({args:Ni(t.signer||t.provider,r,e.inputs),address:t.resolvedAddress,overrides:M(i)||{}});case 6:if(o=n.sent,a=t.interface.encodeFunctionData(e,o.args),s={data:a,to:o.address},null!=(c=o.overrides).nonce&&(s.nonce=b.from(c.nonce).toNumber()),null!=c.gasLimit&&(s.gasLimit=b.from(c.gasLimit)),null!=c.gasPrice&&(s.gasPrice=b.from(c.gasPrice)),null!=c.maxFeePerGas&&(s.maxFeePerGas=b.from(c.maxFeePerGas)),null!=c.maxPriorityFeePerGas&&(s.maxPriorityFeePerGas=b.from(c.maxPriorityFeePerGas)),null!=c.from&&(s.from=c.from),null!=c.type&&(s.type=c.type),null!=c.accessList&&(s.accessList=Ai(c.accessList)),null==s.gasLimit&&null!=e.gas){for(u=21e3,f=Object(A.a)(a),l=0;l<f.length;l++)u+=4,f[l]&&(u+=64);s.gasLimit=b.from(e.gas).add(u)}return c.value&&((d=b.from(c.value)).isZero()||e.payable||Mi.throwError("non-payable method cannot override value",h.b.errors.UNSUPPORTED_OPERATION,{operation:"overrides.value",value:i.value}),s.value=d),c.customData&&(s.customData=O(c.customData)),c.ccipReadEnabled&&(s.ccipReadEnabled=!!c.ccipReadEnabled),delete i.nonce,delete i.gasLimit,delete i.gasPrice,delete i.from,delete i.value,delete i.type,delete i.accessList,delete i.maxFeePerGas,delete i.maxPriorityFeePerGas,delete i.customData,delete i.ccipReadEnabled,(g=Object.keys(i).filter((function(t){return null!=i[t]}))).length&&Mi.throwError("cannot override ".concat(g.map((function(t){return JSON.stringify(t)})).join(",")),h.b.errors.UNSUPPORTED_OPERATION,{operation:"overrides",overrides:g}),n.abrupt("return",s);case 36:case"end":return n.stop()}}),n)})))}function ji(t,e){var r=e.wait.bind(e);e.wait=function(e){return r(e).then((function(e){return e.events=e.logs.map((function(r){var n=j(r),i=null;try{i=t.interface.parseLog(r)}catch(t){}return i&&(n.args=i.args,n.decode=function(e,r){return t.interface.decodeEventLog(i.eventFragment,e,r)},n.event=i.name,n.eventSignature=i.signature),n.removeListener=function(){return t.provider},n.getBlock=function(){return t.provider.getBlock(e.blockHash)},n.getTransaction=function(){return t.provider.getTransaction(e.transactionHash)},n.getTransactionReceipt=function(){return Promise.resolve(e)},n})),e}))}}function Li(t,e,r){var n=t.signer||t.provider;return function(){for(var i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];return xi(this,void 0,void 0,Di().mark((function i(){var a,s,c,A,u;return Di().wrap((function(i){for(;;)switch(i.prev=i.next){case 0:if(a=void 0,o.length!==e.inputs.length+1||"object"!==_i(o[o.length-1])){i.next=9;break}if(null==(s=O(o.pop())).blockTag){i.next=7;break}return i.next=6,s.blockTag;case 6:a=i.sent;case 7:delete s.blockTag,o.push(s);case 9:if(null==t.deployTransaction){i.next=12;break}return i.next=12,t._deployed(a);case 12:return i.next=14,Pi(t,e,o);case 14:return c=i.sent,i.next=17,n.call(c,a);case 17:return A=i.sent,i.prev=18,u=t.interface.decodeFunctionResult(e,A),r&&1===e.outputs.length&&(u=u[0]),i.abrupt("return",u);case 24:throw i.prev=24,i.t0=i.catch(18),i.t0.code===h.b.errors.CALL_EXCEPTION&&(i.t0.address=t.address,i.t0.args=o,i.t0.transaction=c),i.t0;case 28:case"end":return i.stop()}}),i,null,[[18,24]])})))}}function Fi(t,e,r){return e.constant?Li(t,e,r):function(t,e){return function(){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return xi(this,void 0,void 0,Di().mark((function r(){var i,o;return Di().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(t.signer||Mi.throwError("sending a transaction requires a signer",h.b.errors.UNSUPPORTED_OPERATION,{operation:"sendTransaction"}),null==t.deployTransaction){r.next=4;break}return r.next=4,t._deployed();case 4:return r.next=6,Pi(t,e,n);case 6:return i=r.sent,r.next=9,t.signer.sendTransaction(i);case 9:return o=r.sent,ji(t,o),r.abrupt("return",o);case 12:case"end":return r.stop()}}),r)})))}}(t,e)}function Ti(t){return!t.address||null!=t.topics&&0!==t.topics.length?(t.address||"*")+"@"+(t.topics?t.topics.map((function(t){return Array.isArray(t)?t.join("|"):t})).join(":"):""):"*"}var Ui=function(){function t(e,r){Qi(this,t),D(this,"tag",e),D(this,"filter",r),this._listeners=[]}return Si(t,[{key:"addListener",value:function(t,e){this._listeners.push({listener:t,once:e})}},{key:"removeListener",value:function(t){var e=!1;this._listeners=this._listeners.filter((function(r){return!(!e&&r.listener===t)||(e=!0,!1)}))}},{key:"removeAllListeners",value:function(){this._listeners=[]}},{key:"listeners",value:function(){return this._listeners.map((function(t){return t.listener}))}},{key:"listenerCount",value:function(){return this._listeners.length}},{key:"run",value:function(t){var e=this,r=this.listenerCount();return this._listeners=this._listeners.filter((function(r){var n=t.slice();return setTimeout((function(){r.listener.apply(e,n)}),0),!r.once})),r}},{key:"prepareEvent",value:function(t){}},{key:"getEmit",value:function(t){return[t]}}]),t}(),Gi=function(t){vi(r,t);var e=mi(r);function r(){return Qi(this,r),e.call(this,"error",null)}return Si(r)}(Ui),Hi=function(t){vi(r,t);var e=mi(r);function r(t,n,i,o){var a;Qi(this,r);var s={address:t},c=n.getEventTopic(i);return o?(c!==o[0]&&Mi.throwArgumentError("topic mismatch","topics",o),s.topics=o.slice()):s.topics=[c],D(wi(a=e.call(this,Ti(s),s)),"address",t),D(wi(a),"interface",n),D(wi(a),"fragment",i),a}return Si(r,[{key:"prepareEvent",value:function(t){var e=this;Ii(Bi(r.prototype),"prepareEvent",this).call(this,t),t.event=this.fragment.name,t.eventSignature=this.fragment.format(),t.decode=function(t,r){return e.interface.decodeEventLog(e.fragment,t,r)};try{t.args=this.interface.decodeEventLog(this.fragment,t.data,t.topics)}catch(e){t.args=null,t.decodeError=e}}},{key:"getEmit",value:function(t){var e=Y(t.args);if(e.length)throw e[0].error;var r=(t.args||[]).slice();return r.push(t),r}}]),r}(Ui),Yi=function(t){vi(r,t);var e=mi(r);function r(t,n){var i;return Qi(this,r),D(wi(i=e.call(this,"*",{address:t})),"address",t),D(wi(i),"interface",n),i}return Si(r,[{key:"prepareEvent",value:function(t){var e=this;Ii(Bi(r.prototype),"prepareEvent",this).call(this,t);try{var n=this.interface.parseLog(t);t.event=n.name,t.eventSignature=n.signature,t.decode=function(t,r){return e.interface.decodeEventLog(n.eventFragment,t,r)},t.args=n.args}catch(t){}}}]),r}(Ui),Ki=function(){function t(e,r,n){var i=this;Qi(this,t),D(this,"interface",x(this instanceof t?this.constructor:void 0,"getInterface")(r)),null==n?(D(this,"provider",null),D(this,"signer",null)):Gn.isSigner(n)?(D(this,"provider",n.provider||null),D(this,"signer",n)):kn.isProvider(n)?(D(this,"provider",n),D(this,"signer",null)):Mi.throwArgumentError("invalid signer or provider","signerOrProvider",n),D(this,"callStatic",{}),D(this,"estimateGas",{}),D(this,"functions",{}),D(this,"populateTransaction",{}),D(this,"filters",{});var o={};if(Object.keys(this.interface.events).forEach((function(t){var e=i.interface.events[t];D(i.filters,t,(function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return{address:i.address,topics:i.interface.encodeFilterTopics(e,r)}})),o[e.name]||(o[e.name]=[]),o[e.name].push(t)})),Object.keys(o).forEach((function(t){var e=o[t];1===e.length?D(i.filters,t,i.filters[e[0]]):Mi.warn("Duplicate definition of ".concat(t," (").concat(e.join(", "),")"))})),D(this,"_runningEvents",{}),D(this,"_wrappedEmits",{}),null==e&&Mi.throwArgumentError("invalid contract address or ENS name","addressOrName",e),D(this,"address",e),this.provider)D(this,"resolvedAddress",Oi(this.provider,e));else try{D(this,"resolvedAddress",Promise.resolve(ht(e)))}catch(t){Mi.throwError("provider is required to use ENS name as contract address",h.b.errors.UNSUPPORTED_OPERATION,{operation:"new Contract"})}this.resolvedAddress.catch((function(t){}));var a={},s={};Object.keys(this.interface.functions).forEach((function(t){var e=i.interface.functions[t];if(s[t])Mi.warn("Duplicate ABI entry for ".concat(JSON.stringify(t)));else{s[t]=!0;var r=e.name;a["%".concat(r)]||(a["%".concat(r)]=[]),a["%".concat(r)].push(t),null==i[t]&&D(i,t,Fi(i,e,!0)),null==i.functions[t]&&D(i.functions,t,Fi(i,e,!1)),null==i.callStatic[t]&&D(i.callStatic,t,Li(i,e,!0)),null==i.populateTransaction[t]&&D(i.populateTransaction,t,function(t,e){return function(){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return Pi(t,e,n)}}(i,e)),null==i.estimateGas[t]&&D(i.estimateGas,t,function(t,e){var r=t.signer||t.provider;return function(){for(var n=arguments.length,i=new Array(n),o=0;o<n;o++)i[o]=arguments[o];return xi(this,void 0,void 0,Di().mark((function n(){var o;return Di().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return r||Mi.throwError("estimate require a provider or signer",h.b.errors.UNSUPPORTED_OPERATION,{operation:"estimateGas"}),n.next=3,Pi(t,e,i);case 3:return o=n.sent,n.next=6,r.estimateGas(o);case 6:return n.abrupt("return",n.sent);case 7:case"end":return n.stop()}}),n)})))}}(i,e))}})),Object.keys(a).forEach((function(t){var e=a[t];if(!(e.length>1)){t=t.substring(1);var r=e[0];try{null==i[t]&&D(i,t,i[r])}catch(t){}null==i.functions[t]&&D(i.functions,t,i.functions[r]),null==i.callStatic[t]&&D(i.callStatic,t,i.callStatic[r]),null==i.populateTransaction[t]&&D(i.populateTransaction,t,i.populateTransaction[r]),null==i.estimateGas[t]&&D(i.estimateGas,t,i.estimateGas[r])}}))}return Si(t,[{key:"deployed",value:function(){return this._deployed()}},{key:"_deployed",value:function(t){var e=this;return this._deployedPromise||(this.deployTransaction?this._deployedPromise=this.deployTransaction.wait().then((function(){return e})):this._deployedPromise=this.provider.getCode(this.address,t).then((function(t){return"0x"===t&&Mi.throwError("contract not deployed",h.b.errors.UNSUPPORTED_OPERATION,{contractAddress:e.address,operation:"getDeployed"}),e}))),this._deployedPromise}},{key:"fallback",value:function(t){var e=this;this.signer||Mi.throwError("sending a transactions require a signer",h.b.errors.UNSUPPORTED_OPERATION,{operation:"sendTransaction(fallback)"});var r=O(t||{});return["from","to"].forEach((function(t){null!=r[t]&&Mi.throwError("cannot override "+t,h.b.errors.UNSUPPORTED_OPERATION,{operation:t})})),r.to=this.resolvedAddress,this.deployed().then((function(){return e.signer.sendTransaction(r)}))}},{key:"connect",value:function(t){"string"==typeof t&&(t=new Hn(t,this.provider));var e=new this.constructor(this.address,this.interface,t);return this.deployTransaction&&D(e,"deployTransaction",this.deployTransaction),e}},{key:"attach",value:function(t){return new this.constructor(t,this.interface,this.signer||this.provider)}},{key:"_normalizeRunningEvent",value:function(t){return this._runningEvents[t.tag]?this._runningEvents[t.tag]:t}},{key:"_getRunningEvent",value:function(t){if("string"==typeof t){if("error"===t)return this._normalizeRunningEvent(new Gi);if("event"===t)return this._normalizeRunningEvent(new Ui("event",null));if("*"===t)return this._normalizeRunningEvent(new Yi(this.address,this.interface));var e=this.interface.getEvent(t);return this._normalizeRunningEvent(new Hi(this.address,this.interface,e))}if(t.topics&&t.topics.length>0){try{var r=t.topics[0];if("string"!=typeof r)throw new Error("invalid topic");var n=this.interface.getEvent(r);return this._normalizeRunningEvent(new Hi(this.address,this.interface,n,t.topics))}catch(t){}var i={address:this.address,topics:t.topics};return this._normalizeRunningEvent(new Ui(Ti(i),i))}return this._normalizeRunningEvent(new Yi(this.address,this.interface))}},{key:"_checkRunningEvents",value:function(t){if(0===t.listenerCount()){delete this._runningEvents[t.tag];var e=this._wrappedEmits[t.tag];e&&t.filter&&(this.provider.off(t.filter,e),delete this._wrappedEmits[t.tag])}}},{key:"_wrapEvent",value:function(t,e,r){var n=this,i=j(e);return i.removeListener=function(){r&&(t.removeListener(r),n._checkRunningEvents(t))},i.getBlock=function(){return n.provider.getBlock(e.blockHash)},i.getTransaction=function(){return n.provider.getTransaction(e.transactionHash)},i.getTransactionReceipt=function(){return n.provider.getTransactionReceipt(e.transactionHash)},t.prepareEvent(i),i}},{key:"_addEventListener",value:function(t,e,r){var n=this;if(this.provider||Mi.throwError("events require a provider or a signer with a provider",h.b.errors.UNSUPPORTED_OPERATION,{operation:"once"}),t.addListener(e,r),this._runningEvents[t.tag]=t,!this._wrappedEmits[t.tag]){var i=function(r){var i=n._wrapEvent(t,r,e);if(null==i.decodeError)try{var o=t.getEmit(i);n.emit.apply(n,[t.filter].concat(pi(o)))}catch(t){i.decodeError=t.error}null!=t.filter&&n.emit("event",i),null!=i.decodeError&&n.emit("error",i.decodeError,i)};this._wrappedEmits[t.tag]=i,null!=t.filter&&this.provider.on(t.filter,i)}}},{key:"queryFilter",value:function(t,e,r){var n=this,i=this._getRunningEvent(t),o=O(i.filter);return"string"==typeof e&&Object(A.l)(e,32)?(null!=r&&Mi.throwArgumentError("cannot specify toBlock with blockhash","toBlock",r),o.blockHash=e):(o.fromBlock=null!=e?e:0,o.toBlock=null!=r?r:"latest"),this.provider.getLogs(o).then((function(t){return t.map((function(t){return n._wrapEvent(i,t,null)}))}))}},{key:"on",value:function(t,e){return this._addEventListener(this._getRunningEvent(t),e,!1),this}},{key:"once",value:function(t,e){return this._addEventListener(this._getRunningEvent(t),e,!0),this}},{key:"emit",value:function(t){if(!this.provider)return!1;for(var e=this._getRunningEvent(t),r=arguments.length,n=new Array(r>1?r-1:0),i=1;i<r;i++)n[i-1]=arguments[i];var o=e.run(n)>0;return this._checkRunningEvents(e),o}},{key:"listenerCount",value:function(t){var e=this;return this.provider?null==t?Object.keys(this._runningEvents).reduce((function(t,r){return t+e._runningEvents[r].listenerCount()}),0):this._getRunningEvent(t).listenerCount():0}},{key:"listeners",value:function(t){if(!this.provider)return[];if(null==t){var e=[];for(var r in this._runningEvents)this._runningEvents[r].listeners().forEach((function(t){e.push(t)}));return e}return this._getRunningEvent(t).listeners()}},{key:"removeAllListeners",value:function(t){if(!this.provider)return this;if(null==t){for(var e in this._runningEvents){var r=this._runningEvents[e];r.removeAllListeners(),this._checkRunningEvents(r)}return this}var n=this._getRunningEvent(t);return n.removeAllListeners(),this._checkRunningEvents(n),this}},{key:"off",value:function(t,e){if(!this.provider)return this;var r=this._getRunningEvent(t);return r.removeListener(e),this._checkRunningEvents(r),this}},{key:"removeListener",value:function(t,e){return this.off(t,e)}}],[{key:"getContractAddress",value:function(t){return gt(t)}},{key:"getInterface",value:function(t){return ln.isInterface(t)?t:new ln(t)}},{key:"isIndexed",value:function(t){return un.isIndexed(t)}}]),t}(),qi=function(t){vi(r,t);var e=mi(r);function r(){return Qi(this,r),e.apply(this,arguments)}return Si(r)}(Ki),Ji=function(){function t(e,r,n){Qi(this,t);var i=null;"0x"!==(i="string"==typeof r?r:Object(A.j)(r)?Object(A.i)(r):r&&"string"==typeof r.object?r.object:"!").substring(0,2)&&(i="0x"+i),(!Object(A.l)(i)||i.length%2)&&Mi.throwArgumentError("invalid bytecode","bytecode",r),n&&!Gn.isSigner(n)&&Mi.throwArgumentError("invalid signer","signer",n),D(this,"bytecode",i),D(this,"interface",x(this instanceof t?this.constructor:void 0,"getInterface")(e)),D(this,"signer",n||null)}return Si(t,[{key:"getDeployTransaction",value:function(){for(var t={},e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];if(r.length===this.interface.deploy.inputs.length+1&&"object"===_i(r[r.length-1]))for(var i in t=O(r.pop()))if(!Ri[i])throw new Error("unknown transaction override "+i);if(["data","from","to"].forEach((function(e){null!=t[e]&&Mi.throwError("cannot override "+e,h.b.errors.UNSUPPORTED_OPERATION,{operation:e})})),t.value){var o=b.from(t.value);o.isZero()||this.interface.deploy.payable||Mi.throwError("non-payable constructor cannot override value",h.b.errors.UNSUPPORTED_OPERATION,{operation:"overrides.value",value:t.value})}return Mi.checkArgumentCount(r.length,this.interface.deploy.inputs.length," in Contract constructor"),t.data=Object(A.i)(Object(A.b)([this.bytecode,this.interface.encodeDeploy(r)])),t}},{key:"deploy",value:function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];return xi(this,void 0,void 0,Di().mark((function t(){var r,n,i,o,a,s;return Di().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r={},e.length===this.interface.deploy.inputs.length+1&&(r=e.pop()),Mi.checkArgumentCount(e.length,this.interface.deploy.inputs.length," in Contract constructor"),t.next=5,Ni(this.signer,e,this.interface.deploy.inputs);case 5:return(n=t.sent).push(r),i=this.getDeployTransaction.apply(this,pi(n)),t.next=10,this.signer.sendTransaction(i);case 10:return o=t.sent,a=x(this.constructor,"getContractAddress")(o),ji(s=x(this.constructor,"getContract")(a,this.interface,this.signer),o),D(s,"deployTransaction",o),t.abrupt("return",s);case 16:case"end":return t.stop()}}),t,this)})))}},{key:"attach",value:function(t){return this.constructor.getContract(t,this.interface,this.signer)}},{key:"connect",value:function(t){return new this.constructor(this.interface,this.bytecode,t)}}],[{key:"fromSolidity",value:function(t,e){null==t&&Mi.throwError("missing compiler output",h.b.errors.MISSING_ARGUMENT,{argument:"compilerOutput"}),"string"==typeof t&&(t=JSON.parse(t));var r=t.abi,n=null;return t.bytecode?n=t.bytecode:t.evm&&t.evm.bytecode&&(n=t.evm.bytecode),new this(r,n,e)}},{key:"getInterface",value:function(t){return qi.getInterface(t)}},{key:"getContractAddress",value:function(t){return gt(t)}},{key:"getContract",value:function(t,e,r){return new qi(t,e,r)}}]),t}();function zi(t){return(zi="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Zi(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Vi(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,(i=n.key,o=void 0,o=function(t,e){if("object"!==zi(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==zi(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(i,"string"),"symbol"===zi(o)?o:String(o)),n)}var i,o}function Wi(t,e,r){return e&&Vi(t.prototype,e),r&&Vi(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}var Xi=new h.b("bignumber/5.7.0"),$i={},to=b.from(0),eo=b.from(-1);function ro(t,e,r,n){var i={fault:e,operation:r};return void 0!==n&&(i.value=n),Xi.throwError(t,h.b.errors.NUMERIC_FAULT,i)}for(var no="0";no.length<256;)no+=no;function io(t){if("number"!=typeof t)try{t=b.from(t).toNumber()}catch(t){}return"number"==typeof t&&t>=0&&t<=256&&!(t%1)?"1"+no.substring(0,t):Xi.throwArgumentError("invalid decimal size","decimals",t)}function oo(t,e){null==e&&(e=0);var r=io(e),n=(t=b.from(t)).lt(to);n&&(t=t.mul(eo));for(var i=t.mod(r).toString();i.length<r.length-1;)i="0"+i;i=i.match(/^([0-9]*[1-9]|0)(0*)/)[1];var o=t.div(r).toString();return t=1===r.length?o:o+"."+i,n&&(t="-"+t),t}function ao(t,e){null==e&&(e=0);var r=io(e);"string"==typeof t&&t.match(/^-?[0-9.]+$/)||Xi.throwArgumentError("invalid decimal value","value",t);var n="-"===t.substring(0,1);n&&(t=t.substring(1)),"."===t&&Xi.throwArgumentError("missing value","value",t);var i=t.split(".");i.length>2&&Xi.throwArgumentError("too many decimal points","value",t);var o=i[0],a=i[1];for(o||(o="0"),a||(a="0");"0"===a[a.length-1];)a=a.substring(0,a.length-1);for(a.length>r.length-1&&ro("fractional component exceeds decimals","underflow","parseFixed"),""===a&&(a="0");a.length<r.length-1;)a+="0";var s=b.from(o),c=b.from(a),A=s.mul(r).add(c);return n&&(A=A.mul(eo)),A}var so=function(){function t(e,r,n,i){Zi(this,t),e!==$i&&Xi.throwError("cannot use FixedFormat constructor; use FixedFormat.from",h.b.errors.UNSUPPORTED_OPERATION,{operation:"new FixedFormat"}),this.signed=r,this.width=n,this.decimals=i,this.name=(r?"":"u")+"fixed"+String(n)+"x"+String(i),this._multiplier=io(i),Object.freeze(this)}return Wi(t,null,[{key:"from",value:function(e){if(e instanceof t)return e;"number"==typeof e&&(e="fixed128x".concat(e));var r=!0,n=128,i=18;if("string"==typeof e)if("fixed"===e);else if("ufixed"===e)r=!1;else{var o=e.match(/^(u?)fixed([0-9]+)x([0-9]+)$/);o||Xi.throwArgumentError("invalid fixed format","format",e),r="u"!==o[1],n=parseInt(o[2]),i=parseInt(o[3])}else if(e){var a=function(t,r,n){return null==e[t]?n:(zi(e[t])!==r&&Xi.throwArgumentError("invalid fixed format ("+t+" not "+r+")","format."+t,e[t]),e[t])};r=a("signed","boolean",r),n=a("width","number",n),i=a("decimals","number",i)}return n%8&&Xi.throwArgumentError("invalid fixed format width (not byte aligned)","format.width",n),i>80&&Xi.throwArgumentError("invalid fixed format (decimals too large)","format.decimals",i),new t($i,r,n,i)}}]),t}(),co=function(){function t(e,r,n,i){Zi(this,t),e!==$i&&Xi.throwError("cannot use FixedNumber constructor; use FixedNumber.from",h.b.errors.UNSUPPORTED_OPERATION,{operation:"new FixedFormat"}),this.format=i,this._hex=r,this._value=n,this._isFixedNumber=!0,Object.freeze(this)}return Wi(t,[{key:"_checkFormat",value:function(t){this.format.name!==t.format.name&&Xi.throwArgumentError("incompatible format; use fixedNumber.toFormat","other",t)}},{key:"addUnsafe",value:function(e){this._checkFormat(e);var r=ao(this._value,this.format.decimals),n=ao(e._value,e.format.decimals);return t.fromValue(r.add(n),this.format.decimals,this.format)}},{key:"subUnsafe",value:function(e){this._checkFormat(e);var r=ao(this._value,this.format.decimals),n=ao(e._value,e.format.decimals);return t.fromValue(r.sub(n),this.format.decimals,this.format)}},{key:"mulUnsafe",value:function(e){this._checkFormat(e);var r=ao(this._value,this.format.decimals),n=ao(e._value,e.format.decimals);return t.fromValue(r.mul(n).div(this.format._multiplier),this.format.decimals,this.format)}},{key:"divUnsafe",value:function(e){this._checkFormat(e);var r=ao(this._value,this.format.decimals),n=ao(e._value,e.format.decimals);return t.fromValue(r.mul(this.format._multiplier).div(n),this.format.decimals,this.format)}},{key:"floor",value:function(){var e=this.toString().split(".");1===e.length&&e.push("0");var r=t.from(e[0],this.format),n=!e[1].match(/^(0*)$/);return this.isNegative()&&n&&(r=r.subUnsafe(Ao.toFormat(r.format))),r}},{key:"ceiling",value:function(){var e=this.toString().split(".");1===e.length&&e.push("0");var r=t.from(e[0],this.format),n=!e[1].match(/^(0*)$/);return!this.isNegative()&&n&&(r=r.addUnsafe(Ao.toFormat(r.format))),r}},{key:"round",value:function(e){null==e&&(e=0);var r=this.toString().split(".");if(1===r.length&&r.push("0"),(e<0||e>80||e%1)&&Xi.throwArgumentError("invalid decimal count","decimals",e),r[1].length<=e)return this;var n=t.from("1"+no.substring(0,e),this.format),i=uo.toFormat(this.format);return this.mulUnsafe(n).addUnsafe(i).floor().divUnsafe(n)}},{key:"isZero",value:function(){return"0.0"===this._value||"0"===this._value}},{key:"isNegative",value:function(){return"-"===this._value[0]}},{key:"toString",value:function(){return this._value}},{key:"toHexString",value:function(t){if(null==t)return this._hex;t%8&&Xi.throwArgumentError("invalid byte width","width",t);var e=b.from(this._hex).fromTwos(this.format.width).toTwos(t).toHexString();return Object(A.h)(e,t/8)}},{key:"toUnsafeFloat",value:function(){return parseFloat(this.toString())}},{key:"toFormat",value:function(e){return t.fromString(this._value,e)}}],[{key:"fromValue",value:function(e,r,n){return null!=n||null==r||function(t){return null!=t&&(b.isBigNumber(t)||"number"==typeof t&&t%1==0||"string"==typeof t&&!!t.match(/^-?[0-9]+$/)||Object(A.l)(t)||"bigint"==typeof t||Object(A.j)(t))}(r)||(n=r,r=null),null==r&&(r=0),null==n&&(n="fixed"),t.fromString(oo(e,r),so.from(n))}},{key:"fromString",value:function(e,r){null==r&&(r="fixed");var n=so.from(r),i=ao(e,n.decimals);!n.signed&&i.lt(to)&&ro("unsigned value cannot be negative","overflow","value",e);var o=null;n.signed?o=i.toTwos(n.width).toHexString():(o=i.toHexString(),o=Object(A.h)(o,n.width/8));var a=oo(i,n.decimals);return new t($i,o,a,n)}},{key:"fromBytes",value:function(e,r){null==r&&(r="fixed");var n=so.from(r);if(Object(A.a)(e).length>n.width/8)throw new Error("overflow");var i=b.from(e);n.signed&&(i=i.fromTwos(n.width));var o=i.toTwos((n.signed?0:1)+n.width).toHexString(),a=oo(i,n.decimals);return new t($i,o,a,n)}},{key:"from",value:function(e,r){if("string"==typeof e)return t.fromString(e,r);if(Object(A.j)(e))return t.fromBytes(e,r);try{return t.fromValue(e,0,r)}catch(t){if(t.code!==h.b.errors.INVALID_ARGUMENT)throw t}return Xi.throwArgumentError("invalid FixedNumber value","value",e)}},{key:"isFixedNumber",value:function(t){return!(!t||!t._isFixedNumber)}}]),t}(),Ao=co.from(1),uo=co.from("0.5");function fo(t){return"string"==typeof t&&(t=Ct(t)),V(Object(A.b)([Ct("Ethereum Signed Message:\n"),Ct(String(t.length)),t]))}function ho(t){return(ho="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function lo(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */lo=function(){return t};var t={},e=Object.prototype,r=e.hasOwnProperty,n=Object.defineProperty||function(t,e,r){t[e]=r.value},i="function"==typeof Symbol?Symbol:{},o=i.iterator||"@@iterator",a=i.asyncIterator||"@@asyncIterator",s=i.toStringTag||"@@toStringTag";function c(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{c({},"")}catch(t){c=function(t,e,r){return t[e]=r}}function A(t,e,r,i){var o=e&&e.prototype instanceof h?e:h,a=Object.create(o.prototype),s=new B(i||[]);return n(a,"_invoke",{value:E(t,r,s)}),a}function u(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=A;var f={};function h(){}function l(){}function d(){}var g={};c(g,o,(function(){return this}));var p=Object.getPrototypeOf,y=p&&p(p(Q([])));y&&y!==e&&r.call(y,o)&&(g=y);var I=d.prototype=h.prototype=Object.create(g);function b(t){["next","throw","return"].forEach((function(e){c(t,e,(function(t){return this._invoke(e,t)}))}))}function v(t,e){var i;n(this,"_invoke",{value:function(n,o){function a(){return new e((function(i,a){!function n(i,o,a,s){var c=u(t[i],t,o);if("throw"!==c.type){var A=c.arg,f=A.value;return f&&"object"==ho(f)&&r.call(f,"__await")?e.resolve(f.__await).then((function(t){n("next",t,a,s)}),(function(t){n("throw",t,a,s)})):e.resolve(f).then((function(t){A.value=t,a(A)}),(function(t){return n("throw",t,a,s)}))}s(c.arg)}(n,o,i,a)}))}return i=i?i.then(a,a):a()}})}function E(t,e,r){var n="suspendedStart";return function(i,o){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===i)throw o;return k()}for(r.method=i,r.arg=o;;){var a=r.delegate;if(a){var s=m(a,r);if(s){if(s===f)continue;return s}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var c=u(t,e,r);if("normal"===c.type){if(n=r.done?"completed":"suspendedYield",c.arg===f)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(n="completed",r.method="throw",r.arg=c.arg)}}}function m(t,e){var r=e.method,n=t.iterator[r];if(void 0===n)return e.delegate=null,"throw"===r&&t.iterator.return&&(e.method="return",e.arg=void 0,m(t,e),"throw"===e.method)||"return"!==r&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+r+"' method")),f;var i=u(n,t.iterator,e.arg);if("throw"===i.type)return e.method="throw",e.arg=i.arg,e.delegate=null,f;var o=i.arg;return o?o.done?(e[t.resultName]=o.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,f):o:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,f)}function C(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function w(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function B(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(C,this),this.reset(!0)}function Q(t){if(t){var e=t[o];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,i=function e(){for(;++n<t.length;)if(r.call(t,n))return e.value=t[n],e.done=!1,e;return e.value=void 0,e.done=!0,e};return i.next=i}}return{next:k}}function k(){return{value:void 0,done:!0}}return l.prototype=d,n(I,"constructor",{value:d,configurable:!0}),n(d,"constructor",{value:l,configurable:!0}),l.displayName=c(d,s,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===l||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,d):(t.__proto__=d,c(t,s,"GeneratorFunction")),t.prototype=Object.create(I),t},t.awrap=function(t){return{__await:t}},b(v.prototype),c(v.prototype,a,(function(){return this})),t.AsyncIterator=v,t.async=function(e,r,n,i,o){void 0===o&&(o=Promise);var a=new v(A(e,r,n,i),o);return t.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},b(I),c(I,s,"Generator"),c(I,o,(function(){return this})),c(I,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},t.values=Q,B.prototype={constructor:B,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(w),!t)for(var e in this)"t"===e.charAt(0)&&r.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function n(r,n){return a.type="throw",a.arg=t,e.next=r,n&&(e.method="next",e.arg=void 0),!!n}for(var i=this.tryEntries.length-1;i>=0;--i){var o=this.tryEntries[i],a=o.completion;if("root"===o.tryLoc)return n("end");if(o.tryLoc<=this.prev){var s=r.call(o,"catchLoc"),c=r.call(o,"finallyLoc");if(s&&c){if(this.prev<o.catchLoc)return n(o.catchLoc,!0);if(this.prev<o.finallyLoc)return n(o.finallyLoc)}else if(s){if(this.prev<o.catchLoc)return n(o.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return n(o.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&r.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var o=i;break}}o&&("break"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc&&(o=null);var a=o?o.completion:{};return a.type=t,a.arg=e,o?(this.method="next",this.next=o.finallyLoc,f):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),f},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),w(r),f}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var i=n.arg;w(r)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:Q(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),f}},t}function go(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,(i=n.key,o=void 0,o=function(t,e){if("object"!==ho(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==ho(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(i,"string"),"symbol"===ho(o)?o:String(o)),n)}var i,o}var po=function(t,e,r,n){return new(r||(r=Promise))((function(i,o){function a(t){try{c(n.next(t))}catch(t){o(t)}}function s(t){try{c(n.throw(t))}catch(t){o(t)}}function c(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(a,s)}c((n=n.apply(t,e||[])).next())}))},yo=new h.b("hash/5.7.0"),Io=new Uint8Array(32);Io.fill(0);var bo=b.from(-1),vo=b.from(0),Eo=b.from(1),mo=b.from("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");var Co=Object(A.h)(Eo.toHexString(),32),wo=Object(A.h)(vo.toHexString(),32),Bo={name:"string",version:"string",chainId:"uint256",verifyingContract:"address",salt:"bytes32"},Qo=["name","version","chainId","verifyingContract","salt"];function ko(t){return function(e){return"string"!=typeof e&&yo.throwArgumentError("invalid domain value for ".concat(JSON.stringify(t)),"domain.".concat(t),e),e}}var So={name:ko("name"),version:ko("version"),chainId:function(t){try{return b.from(t).toString()}catch(t){}return yo.throwArgumentError('invalid domain value for "chainId"',"domain.chainId",t)},verifyingContract:function(t){try{return ht(t).toLowerCase()}catch(t){}return yo.throwArgumentError('invalid domain value "verifyingContract"',"domain.verifyingContract",t)},salt:function(t){try{var e=Object(A.a)(t);if(32!==e.length)throw new Error("bad length");return Object(A.i)(e)}catch(t){}return yo.throwArgumentError('invalid domain value "salt"',"domain.salt",t)}};function _o(t){var e=t.match(/^(u?)int(\d*)$/);if(e){var r=""===e[1],n=parseInt(e[2]||"256");(n%8!=0||n>256||e[2]&&e[2]!==String(n))&&yo.throwArgumentError("invalid numeric width","type",t);var i=mo.mask(r?n-1:n),o=r?i.add(Eo).mul(bo):vo;return function(e){var r=b.from(e);return(r.lt(o)||r.gt(i))&&yo.throwArgumentError("value out-of-bounds for ".concat(t),"value",e),Object(A.h)(r.toTwos(256).toHexString(),32)}}var a=t.match(/^bytes(\d+)$/);if(a){var s=parseInt(a[1]);return(0===s||s>32||a[1]!==String(s))&&yo.throwArgumentError("invalid bytes width","type",t),function(e){return Object(A.a)(e).length!==s&&yo.throwArgumentError("invalid length for ".concat(t),"value",e),function(t){var e=Object(A.a)(t),r=e.length%32;return r?Object(A.c)([e,Io.slice(r)]):Object(A.i)(e)}(e)}}switch(t){case"address":return function(t){return Object(A.h)(ht(t),32)};case"bool":return function(t){return t?Co:wo};case"bytes":return function(t){return V(t)};case"string":return function(t){return _t(t)}}return null}function Do(t,e){return"".concat(t,"(").concat(e.map((function(t){var e=t.name;return t.type+" "+e})).join(","),")")}var xo=function(){function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),D(this,"types",Object.freeze(j(e))),D(this,"_encoderCache",{}),D(this,"_types",{});var r={},n={},i={};Object.keys(e).forEach((function(t){r[t]={},n[t]=[],i[t]={}}));var o=function(t){var i={};e[t].forEach((function(o){i[o.name]&&yo.throwArgumentError("duplicate variable name ".concat(JSON.stringify(o.name)," in ").concat(JSON.stringify(t)),"types",e),i[o.name]=!0;var a=o.type.match(/^([^\x5b]*)(\x5b|$)/)[1];a===t&&yo.throwArgumentError("circular type reference to ".concat(JSON.stringify(a)),"types",e),_o(a)||(n[a]||yo.throwArgumentError("unknown type ".concat(JSON.stringify(a)),"types",e),n[a].push(t),r[t][a]=!0)}))};for(var a in e)o(a);var s=Object.keys(n).filter((function(t){return 0===n[t].length}));for(var c in 0===s.length?yo.throwArgumentError("missing primary type","types",e):s.length>1&&yo.throwArgumentError("ambiguous primary types or unused types: ".concat(s.map((function(t){return JSON.stringify(t)})).join(", ")),"types",e),D(this,"primaryType",s[0]),function t(o,a){a[o]&&yo.throwArgumentError("circular type reference to ".concat(JSON.stringify(o)),"types",e),a[o]=!0,Object.keys(r[o]).forEach((function(e){n[e]&&(t(e,a),Object.keys(a).forEach((function(t){i[t][e]=!0})))})),delete a[o]}(this.primaryType,{}),i){var A=Object.keys(i[c]);A.sort(),this._types[c]=Do(c,e[c])+A.map((function(t){return Do(t,e[t])})).join("")}}var e,r,n;return e=t,n=[{key:"from",value:function(e){return new t(e)}},{key:"getPrimaryType",value:function(e){return t.from(e).primaryType}},{key:"hashStruct",value:function(e,r,n){return t.from(r).hashStruct(e,n)}},{key:"hashDomain",value:function(e){var r=[];for(var n in e){var i=Bo[n];i||yo.throwArgumentError("invalid typed-data domain key: ".concat(JSON.stringify(n)),"domain",e),r.push({name:n,type:i})}return r.sort((function(t,e){return Qo.indexOf(t.name)-Qo.indexOf(e.name)})),t.hashStruct("EIP712Domain",{EIP712Domain:r},e)}},{key:"encode",value:function(e,r,n){return Object(A.c)(["0x1901",t.hashDomain(e),t.from(r).hash(n)])}},{key:"hash",value:function(e,r,n){return V(t.encode(e,r,n))}},{key:"resolveNames",value:function(e,r,n,i){return po(this,void 0,void 0,lo().mark((function o(){var a,s,c;return lo().wrap((function(o){for(;;)switch(o.prev=o.next){case 0:e=O(e),a={},e.verifyingContract&&!Object(A.l)(e.verifyingContract,20)&&(a[e.verifyingContract]="0x"),(s=t.from(r)).visit(n,(function(t,e){return"address"!==t||Object(A.l)(e,20)||(a[e]="0x"),e})),o.t0=lo().keys(a);case 6:if((o.t1=o.t0()).done){o.next=13;break}return c=o.t1.value,o.next=10,i(c);case 10:a[c]=o.sent,o.next=6;break;case 13:return e.verifyingContract&&a[e.verifyingContract]&&(e.verifyingContract=a[e.verifyingContract]),n=s.visit(n,(function(t,e){return"address"===t&&a[e]?a[e]:e})),o.abrupt("return",{domain:e,value:n});case 16:case"end":return o.stop()}}),o)})))}},{key:"getPayload",value:function(e,r,n){t.hashDomain(e);var i={},o=[];Qo.forEach((function(t){var r=e[t];null!=r&&(i[t]=So[t](r),o.push({name:t,type:Bo[t]}))}));var a=t.from(r),s=O(r);return s.EIP712Domain?yo.throwArgumentError("types must not contain EIP712Domain type","types.EIP712Domain",r):s.EIP712Domain=o,a.encode(n),{types:s,domain:i,primaryType:a.primaryType,message:a.visit(n,(function(t,e){if(t.match(/^bytes(\d*)/))return Object(A.i)(Object(A.a)(e));if(t.match(/^u?int/))return b.from(e).toString();switch(t){case"address":return e.toLowerCase();case"bool":return!!e;case"string":return"string"!=typeof e&&yo.throwArgumentError("invalid string","value",e),e}return yo.throwArgumentError("unsupported type","type",t)}))}}}],(r=[{key:"getEncoder",value:function(t){var e=this._encoderCache[t];return e||(e=this._encoderCache[t]=this._getEncoder(t)),e}},{key:"_getEncoder",value:function(t){var e=this,r=_o(t);if(r)return r;var n=t.match(/^(.*)(\x5b(\d*)\x5d)$/);if(n){var i=n[1],o=this.getEncoder(i),a=parseInt(n[3]);return function(t){a>=0&&t.length!==a&&yo.throwArgumentError("array length mismatch; expected length ${ arrayLength }","value",t);var r=t.map(o);return e._types[i]&&(r=r.map(V)),V(Object(A.c)(r))}}var s=this.types[t];if(s){var c=_t(this._types[t]);return function(t){var r=s.map((function(r){var n=r.name,i=r.type,o=e.getEncoder(i)(t[n]);return e._types[i]?V(o):o}));return r.unshift(c),Object(A.c)(r)}}return yo.throwArgumentError("unknown type: ".concat(t),"type",t)}},{key:"encodeType",value:function(t){var e=this._types[t];return e||yo.throwArgumentError("unknown type: ".concat(JSON.stringify(t)),"name",t),e}},{key:"encodeData",value:function(t,e){return this.getEncoder(t)(e)}},{key:"hashStruct",value:function(t,e){return V(this.encodeData(t,e))}},{key:"encode",value:function(t){return this.encodeData(this.primaryType,t)}},{key:"hash",value:function(t){return this.hashStruct(this.primaryType,t)}},{key:"_visit",value:function(t,e,r){var n=this;if(_o(t))return r(t,e);var i=t.match(/^(.*)(\x5b(\d*)\x5d)$/);if(i){var o=i[1],a=parseInt(i[3]);return a>=0&&e.length!==a&&yo.throwArgumentError("array length mismatch; expected length ${ arrayLength }","value",e),e.map((function(t){return n._visit(o,t,r)}))}var s=this.types[t];return s?s.reduce((function(t,i){var o=i.name,a=i.type;return t[o]=n._visit(a,e[o],r),t}),{}):yo.throwArgumentError("unknown type: ".concat(t),"type",t)}},{key:"visit",value:function(t,e){return this._visit(this.primaryType,t,e)}}])&&go(e.prototype,r),n&&go(e,n),Object.defineProperty(e,"prototype",{writable:!1}),t}();function Mo(t){return(Mo="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Ro(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,(i=n.key,o=void 0,o=function(t,e){if("object"!==Mo(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==Mo(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(i,"string"),"symbol"===Mo(o)?o:String(o)),n)}var i,o}var Oo,No=function(){function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),D(this,"alphabet",e),D(this,"base",e.length),D(this,"_alphabetMap",{}),D(this,"_leader",e.charAt(0));for(var r=0;r<e.length;r++)this._alphabetMap[e.charAt(r)]=r}var e,r,n;return e=t,(r=[{key:"encode",value:function(t){var e=Object(A.a)(t);if(0===e.length)return"";for(var r=[0],n=0;n<e.length;++n){for(var i=e[n],o=0;o<r.length;++o)i+=r[o]<<8,r[o]=i%this.base,i=i/this.base|0;for(;i>0;)r.push(i%this.base),i=i/this.base|0}for(var a="",s=0;0===e[s]&&s<e.length-1;++s)a+=this._leader;for(var c=r.length-1;c>=0;--c)a+=this.alphabet[r[c]];return a}},{key:"decode",value:function(t){if("string"!=typeof t)throw new TypeError("Expected String");var e=[];if(0===t.length)return new Uint8Array(e);e.push(0);for(var r=0;r<t.length;r++){var n=this._alphabetMap[t[r]];if(void 0===n)throw new Error("Non-base"+this.base+" character");for(var i=n,o=0;o<e.length;++o)i+=e[o]*this.base,e[o]=255&i,i>>=8;for(;i>0;)e.push(255&i),i>>=8}for(var a=0;t[a]===this._leader&&a<t.length-1;++a)e.push(0);return Object(A.a)(new Uint8Array(e.reverse()))}}])&&Ro(e.prototype,r),n&&Ro(e,n),Object.defineProperty(e,"prototype",{writable:!1}),t}(),Po=(new No("abcdefghijklmnopqrstuvwxyz234567"),new No("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz")),jo=r(6),Lo=r.n(jo);!function(t){t.sha256="sha256",t.sha512="sha512"}(Oo||(Oo={}));var Fo=new h.b("sha2/5.7.0");function To(t){return"0x"+Lo.a.ripemd160().update(Object(A.a)(t)).digest("hex")}function Uo(t){return"0x"+Lo.a.sha256().update(Object(A.a)(t)).digest("hex")}function Go(t){return"0x"+Lo.a.sha512().update(Object(A.a)(t)).digest("hex")}function Ho(t,e,r){return Oo[t]||Fo.throwError("unsupported algorithm "+t,h.b.errors.UNSUPPORTED_OPERATION,{operation:"hmac",algorithm:t}),"0x"+Lo.a.hmac(Lo.a[t],Object(A.a)(e)).update(Object(A.a)(r)).digest("hex")}function Yo(t,e,r,n,i){var o;t=Object(A.a)(t),e=Object(A.a)(e);var a,s,c=1,u=new Uint8Array(n),f=new Uint8Array(e.length+4);f.set(e);for(var h=1;h<=c;h++){f[e.length]=h>>24&255,f[e.length+1]=h>>16&255,f[e.length+2]=h>>8&255,f[e.length+3]=255&h;var l=Object(A.a)(Ho(i,t,f));o||(o=l.length,s=new Uint8Array(o),a=n-((c=Math.ceil(n/o))-1)*o),s.set(l);for(var d=1;d<r;d++){l=Object(A.a)(Ho(i,t,l));for(var g=0;g<o;g++)s[g]^=l[g]}var p=(h-1)*o,y=h===c?a:o;u.set(Object(A.a)(s).slice(0,y),p)}return Object(A.i)(u)}function Ko(t){return(Ko="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function qo(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,(i=n.key,o=void 0,o=function(t,e){if("object"!==Ko(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==Ko(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(i,"string"),"symbol"===Ko(o)?o:String(o)),n)}var i,o}var Jo=new h.b("wordlists/5.7.0"),zo=function(){function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),Jo.checkAbstract(this instanceof t?this.constructor:void 0,t),D(this,"locale",e)}var e,r,n;return e=t,n=[{key:"check",value:function(t){for(var e=[],r=0;r<2048;r++){var n=t.getWord(r);if(r!==t.getWordIndex(n))return"0x";e.push(n)}return _t(e.join("\n")+"\n")}},{key:"register",value:function(t,e){e||(e=t.locale)}}],(r=[{key:"split",value:function(t){return t.toLowerCase().split(/ +/g)}},{key:"join",value:function(t){return t.join(" ")}}])&&qo(e.prototype,r),n&&qo(e,n),Object.defineProperty(e,"prototype",{writable:!1}),t}();function Zo(t){return(Zo="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Vo(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,(i=n.key,o=void 0,o=function(t,e){if("object"!==Zo(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==Zo(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(i,"string"),"symbol"===Zo(o)?o:String(o)),n)}var i,o}function Wo(t,e){return(Wo=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}function Xo(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=ta(t);if(e){var i=ta(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return $o(this,r)}}function $o(t,e){if(e&&("object"===Zo(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function ta(t){return(ta=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var ea=null;function ra(t){if(null==ea&&(ea="AbandonAbilityAbleAboutAboveAbsentAbsorbAbstractAbsurdAbuseAccessAccidentAccountAccuseAchieveAcidAcousticAcquireAcrossActActionActorActressActualAdaptAddAddictAddressAdjustAdmitAdultAdvanceAdviceAerobicAffairAffordAfraidAgainAgeAgentAgreeAheadAimAirAirportAisleAlarmAlbumAlcoholAlertAlienAllAlleyAllowAlmostAloneAlphaAlreadyAlsoAlterAlwaysAmateurAmazingAmongAmountAmusedAnalystAnchorAncientAngerAngleAngryAnimalAnkleAnnounceAnnualAnotherAnswerAntennaAntiqueAnxietyAnyApartApologyAppearAppleApproveAprilArchArcticAreaArenaArgueArmArmedArmorArmyAroundArrangeArrestArriveArrowArtArtefactArtistArtworkAskAspectAssaultAssetAssistAssumeAsthmaAthleteAtomAttackAttendAttitudeAttractAuctionAuditAugustAuntAuthorAutoAutumnAverageAvocadoAvoidAwakeAwareAwayAwesomeAwfulAwkwardAxisBabyBachelorBaconBadgeBagBalanceBalconyBallBambooBananaBannerBarBarelyBargainBarrelBaseBasicBasketBattleBeachBeanBeautyBecauseBecomeBeefBeforeBeginBehaveBehindBelieveBelowBeltBenchBenefitBestBetrayBetterBetweenBeyondBicycleBidBikeBindBiologyBirdBirthBitterBlackBladeBlameBlanketBlastBleakBlessBlindBloodBlossomBlouseBlueBlurBlushBoardBoatBodyBoilBombBoneBonusBookBoostBorderBoringBorrowBossBottomBounceBoxBoyBracketBrainBrandBrassBraveBreadBreezeBrickBridgeBriefBrightBringBriskBroccoliBrokenBronzeBroomBrotherBrownBrushBubbleBuddyBudgetBuffaloBuildBulbBulkBulletBundleBunkerBurdenBurgerBurstBusBusinessBusyButterBuyerBuzzCabbageCabinCableCactusCageCakeCallCalmCameraCampCanCanalCancelCandyCannonCanoeCanvasCanyonCapableCapitalCaptainCarCarbonCardCargoCarpetCarryCartCaseCashCasinoCastleCasualCatCatalogCatchCategoryCattleCaughtCauseCautionCaveCeilingCeleryCementCensusCenturyCerealCertainChairChalkChampionChangeChaosChapterChargeChaseChatCheapCheckCheeseChefCherryChestChickenChiefChildChimneyChoiceChooseChronicChuckleChunkChurnCigarCinnamonCircleCitizenCityCivilClaimClapClarifyClawClayCleanClerkCleverClickClientCliffClimbClinicClipClockClogCloseClothCloudClownClubClumpClusterClutchCoachCoastCoconutCodeCoffeeCoilCoinCollectColorColumnCombineComeComfortComicCommonCompanyConcertConductConfirmCongressConnectConsiderControlConvinceCookCoolCopperCopyCoralCoreCornCorrectCostCottonCouchCountryCoupleCourseCousinCoverCoyoteCrackCradleCraftCramCraneCrashCraterCrawlCrazyCreamCreditCreekCrewCricketCrimeCrispCriticCropCrossCrouchCrowdCrucialCruelCruiseCrumbleCrunchCrushCryCrystalCubeCultureCupCupboardCuriousCurrentCurtainCurveCushionCustomCuteCycleDadDamageDampDanceDangerDaringDashDaughterDawnDayDealDebateDebrisDecadeDecemberDecideDeclineDecorateDecreaseDeerDefenseDefineDefyDegreeDelayDeliverDemandDemiseDenialDentistDenyDepartDependDepositDepthDeputyDeriveDescribeDesertDesignDeskDespairDestroyDetailDetectDevelopDeviceDevoteDiagramDialDiamondDiaryDiceDieselDietDifferDigitalDignityDilemmaDinnerDinosaurDirectDirtDisagreeDiscoverDiseaseDishDismissDisorderDisplayDistanceDivertDivideDivorceDizzyDoctorDocumentDogDollDolphinDomainDonateDonkeyDonorDoorDoseDoubleDoveDraftDragonDramaDrasticDrawDreamDressDriftDrillDrinkDripDriveDropDrumDryDuckDumbDuneDuringDustDutchDutyDwarfDynamicEagerEagleEarlyEarnEarthEasilyEastEasyEchoEcologyEconomyEdgeEditEducateEffortEggEightEitherElbowElderElectricElegantElementElephantElevatorEliteElseEmbarkEmbodyEmbraceEmergeEmotionEmployEmpowerEmptyEnableEnactEndEndlessEndorseEnemyEnergyEnforceEngageEngineEnhanceEnjoyEnlistEnoughEnrichEnrollEnsureEnterEntireEntryEnvelopeEpisodeEqualEquipEraEraseErodeErosionErrorEruptEscapeEssayEssenceEstateEternalEthicsEvidenceEvilEvokeEvolveExactExampleExcessExchangeExciteExcludeExcuseExecuteExerciseExhaustExhibitExileExistExitExoticExpandExpectExpireExplainExposeExpressExtendExtraEyeEyebrowFabricFaceFacultyFadeFaintFaithFallFalseFameFamilyFamousFanFancyFantasyFarmFashionFatFatalFatherFatigueFaultFavoriteFeatureFebruaryFederalFeeFeedFeelFemaleFenceFestivalFetchFeverFewFiberFictionFieldFigureFileFilmFilterFinalFindFineFingerFinishFireFirmFirstFiscalFishFitFitnessFixFlagFlameFlashFlatFlavorFleeFlightFlipFloatFlockFloorFlowerFluidFlushFlyFoamFocusFogFoilFoldFollowFoodFootForceForestForgetForkFortuneForumForwardFossilFosterFoundFoxFragileFrameFrequentFreshFriendFringeFrogFrontFrostFrownFrozenFruitFuelFunFunnyFurnaceFuryFutureGadgetGainGalaxyGalleryGameGapGarageGarbageGardenGarlicGarmentGasGaspGateGatherGaugeGazeGeneralGeniusGenreGentleGenuineGestureGhostGiantGiftGiggleGingerGiraffeGirlGiveGladGlanceGlareGlassGlideGlimpseGlobeGloomGloryGloveGlowGlueGoatGoddessGoldGoodGooseGorillaGospelGossipGovernGownGrabGraceGrainGrantGrapeGrassGravityGreatGreenGridGriefGritGroceryGroupGrowGruntGuardGuessGuideGuiltGuitarGunGymHabitHairHalfHammerHamsterHandHappyHarborHardHarshHarvestHatHaveHawkHazardHeadHealthHeartHeavyHedgehogHeightHelloHelmetHelpHenHeroHiddenHighHillHintHipHireHistoryHobbyHockeyHoldHoleHolidayHollowHomeHoneyHoodHopeHornHorrorHorseHospitalHostHotelHourHoverHubHugeHumanHumbleHumorHundredHungryHuntHurdleHurryHurtHusbandHybridIceIconIdeaIdentifyIdleIgnoreIllIllegalIllnessImageImitateImmenseImmuneImpactImposeImproveImpulseInchIncludeIncomeIncreaseIndexIndicateIndoorIndustryInfantInflictInformInhaleInheritInitialInjectInjuryInmateInnerInnocentInputInquiryInsaneInsectInsideInspireInstallIntactInterestIntoInvestInviteInvolveIronIslandIsolateIssueItemIvoryJacketJaguarJarJazzJealousJeansJellyJewelJobJoinJokeJourneyJoyJudgeJuiceJumpJungleJuniorJunkJustKangarooKeenKeepKetchupKeyKickKidKidneyKindKingdomKissKitKitchenKiteKittenKiwiKneeKnifeKnockKnowLabLabelLaborLadderLadyLakeLampLanguageLaptopLargeLaterLatinLaughLaundryLavaLawLawnLawsuitLayerLazyLeaderLeafLearnLeaveLectureLeftLegLegalLegendLeisureLemonLendLengthLensLeopardLessonLetterLevelLiarLibertyLibraryLicenseLifeLiftLightLikeLimbLimitLinkLionLiquidListLittleLiveLizardLoadLoanLobsterLocalLockLogicLonelyLongLoopLotteryLoudLoungeLoveLoyalLuckyLuggageLumberLunarLunchLuxuryLyricsMachineMadMagicMagnetMaidMailMainMajorMakeMammalManManageMandateMangoMansionManualMapleMarbleMarchMarginMarineMarketMarriageMaskMassMasterMatchMaterialMathMatrixMatterMaximumMazeMeadowMeanMeasureMeatMechanicMedalMediaMelodyMeltMemberMemoryMentionMenuMercyMergeMeritMerryMeshMessageMetalMethodMiddleMidnightMilkMillionMimicMindMinimumMinorMinuteMiracleMirrorMiseryMissMistakeMixMixedMixtureMobileModelModifyMomMomentMonitorMonkeyMonsterMonthMoonMoralMoreMorningMosquitoMotherMotionMotorMountainMouseMoveMovieMuchMuffinMuleMultiplyMuscleMuseumMushroomMusicMustMutualMyselfMysteryMythNaiveNameNapkinNarrowNastyNationNatureNearNeckNeedNegativeNeglectNeitherNephewNerveNestNetNetworkNeutralNeverNewsNextNiceNightNobleNoiseNomineeNoodleNormalNorthNoseNotableNoteNothingNoticeNovelNowNuclearNumberNurseNutOakObeyObjectObligeObscureObserveObtainObviousOccurOceanOctoberOdorOffOfferOfficeOftenOilOkayOldOliveOlympicOmitOnceOneOnionOnlineOnlyOpenOperaOpinionOpposeOptionOrangeOrbitOrchardOrderOrdinaryOrganOrientOriginalOrphanOstrichOtherOutdoorOuterOutputOutsideOvalOvenOverOwnOwnerOxygenOysterOzonePactPaddlePagePairPalacePalmPandaPanelPanicPantherPaperParadeParentParkParrotPartyPassPatchPathPatientPatrolPatternPausePavePaymentPeacePeanutPearPeasantPelicanPenPenaltyPencilPeoplePepperPerfectPermitPersonPetPhonePhotoPhrasePhysicalPianoPicnicPicturePiecePigPigeonPillPilotPinkPioneerPipePistolPitchPizzaPlacePlanetPlasticPlatePlayPleasePledgePluckPlugPlungePoemPoetPointPolarPolePolicePondPonyPoolPopularPortionPositionPossiblePostPotatoPotteryPovertyPowderPowerPracticePraisePredictPreferPreparePresentPrettyPreventPricePridePrimaryPrintPriorityPrisonPrivatePrizeProblemProcessProduceProfitProgramProjectPromoteProofPropertyProsperProtectProudProvidePublicPuddingPullPulpPulsePumpkinPunchPupilPuppyPurchasePurityPurposePursePushPutPuzzlePyramidQualityQuantumQuarterQuestionQuickQuitQuizQuoteRabbitRaccoonRaceRackRadarRadioRailRainRaiseRallyRampRanchRandomRangeRapidRareRateRatherRavenRawRazorReadyRealReasonRebelRebuildRecallReceiveRecipeRecordRecycleReduceReflectReformRefuseRegionRegretRegularRejectRelaxReleaseReliefRelyRemainRememberRemindRemoveRenderRenewRentReopenRepairRepeatReplaceReportRequireRescueResembleResistResourceResponseResultRetireRetreatReturnReunionRevealReviewRewardRhythmRibRibbonRiceRichRideRidgeRifleRightRigidRingRiotRippleRiskRitualRivalRiverRoadRoastRobotRobustRocketRomanceRoofRookieRoomRoseRotateRoughRoundRouteRoyalRubberRudeRugRuleRunRunwayRuralSadSaddleSadnessSafeSailSaladSalmonSalonSaltSaluteSameSampleSandSatisfySatoshiSauceSausageSaveSayScaleScanScareScatterSceneSchemeSchoolScienceScissorsScorpionScoutScrapScreenScriptScrubSeaSearchSeasonSeatSecondSecretSectionSecuritySeedSeekSegmentSelectSellSeminarSeniorSenseSentenceSeriesServiceSessionSettleSetupSevenShadowShaftShallowShareShedShellSheriffShieldShiftShineShipShiverShockShoeShootShopShortShoulderShoveShrimpShrugShuffleShySiblingSickSideSiegeSightSignSilentSilkSillySilverSimilarSimpleSinceSingSirenSisterSituateSixSizeSkateSketchSkiSkillSkinSkirtSkullSlabSlamSleepSlenderSliceSlideSlightSlimSloganSlotSlowSlushSmallSmartSmileSmokeSmoothSnackSnakeSnapSniffSnowSoapSoccerSocialSockSodaSoftSolarSoldierSolidSolutionSolveSomeoneSongSoonSorrySortSoulSoundSoupSourceSouthSpaceSpareSpatialSpawnSpeakSpecialSpeedSpellSpendSphereSpiceSpiderSpikeSpinSpiritSplitSpoilSponsorSpoonSportSpotSpraySpreadSpringSpySquareSqueezeSquirrelStableStadiumStaffStageStairsStampStandStartStateStaySteakSteelStemStepStereoStickStillStingStockStomachStoneStoolStoryStoveStrategyStreetStrikeStrongStruggleStudentStuffStumbleStyleSubjectSubmitSubwaySuccessSuchSuddenSufferSugarSuggestSuitSummerSunSunnySunsetSuperSupplySupremeSureSurfaceSurgeSurpriseSurroundSurveySuspectSustainSwallowSwampSwapSwarmSwearSweetSwiftSwimSwingSwitchSwordSymbolSymptomSyrupSystemTableTackleTagTailTalentTalkTankTapeTargetTaskTasteTattooTaxiTeachTeamTellTenTenantTennisTentTermTestTextThankThatThemeThenTheoryThereTheyThingThisThoughtThreeThriveThrowThumbThunderTicketTideTigerTiltTimberTimeTinyTipTiredTissueTitleToastTobaccoTodayToddlerToeTogetherToiletTokenTomatoTomorrowToneTongueTonightToolToothTopTopicToppleTorchTornadoTortoiseTossTotalTouristTowardTowerTownToyTrackTradeTrafficTragicTrainTransferTrapTrashTravelTrayTreatTreeTrendTrialTribeTrickTriggerTrimTripTrophyTroubleTruckTrueTrulyTrumpetTrustTruthTryTubeTuitionTumbleTunaTunnelTurkeyTurnTurtleTwelveTwentyTwiceTwinTwistTwoTypeTypicalUglyUmbrellaUnableUnawareUncleUncoverUnderUndoUnfairUnfoldUnhappyUniformUniqueUnitUniverseUnknownUnlockUntilUnusualUnveilUpdateUpgradeUpholdUponUpperUpsetUrbanUrgeUsageUseUsedUsefulUselessUsualUtilityVacantVacuumVagueValidValleyValveVanVanishVaporVariousVastVaultVehicleVelvetVendorVentureVenueVerbVerifyVersionVeryVesselVeteranViableVibrantViciousVictoryVideoViewVillageVintageViolinVirtualVirusVisaVisitVisualVitalVividVocalVoiceVoidVolcanoVolumeVoteVoyageWageWagonWaitWalkWallWalnutWantWarfareWarmWarriorWashWaspWasteWaterWaveWayWealthWeaponWearWeaselWeatherWebWeddingWeekendWeirdWelcomeWestWetWhaleWhatWheatWheelWhenWhereWhipWhisperWideWidthWifeWildWillWinWindowWineWingWinkWinnerWinterWireWisdomWiseWishWitnessWolfWomanWonderWoodWoolWordWorkWorldWorryWorthWrapWreckWrestleWristWriteWrongYardYearYellowYouYoungYouthZebraZeroZoneZoo".replace(/([A-Z])/g," $1").toLowerCase().substring(1).split(" "),"0x3c8acc1e7b08d8e76f9fda015ef48dc8c710a73cb7e0f77b2c18a9b5a7adde60"!==zo.check(t)))throw ea=null,new Error("BIP39 Wordlist for en (English) FAILED")}var na=new(function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Wo(t,e)}(o,t);var e,r,n,i=Xo(o);function o(){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,o),i.call(this,"en")}return e=o,(r=[{key:"getWord",value:function(t){return ra(this),ea[t]}},{key:"getWordIndex",value:function(t){return ra(this),ea.indexOf(t)}}])&&Vo(e.prototype,r),n&&Vo(e,n),Object.defineProperty(e,"prototype",{writable:!1}),o}(zo));zo.register(na);var ia={en:na};function oa(t){return(oa="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function aa(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,(i=n.key,o=void 0,o=function(t,e){if("object"!==oa(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==oa(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(i,"string"),"symbol"===oa(o)?o:String(o)),n)}var i,o}var sa=new h.b("hdnode/5.7.0"),ca=b.from("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),Aa=Ct("Bitcoin seed");function ua(t){return(1<<t)-1<<8-t}function fa(t){return Object(A.h)(Object(A.i)(t),32)}function ha(t){return Po.encode(Object(A.b)([t,Object(A.e)(Uo(Uo(t)),0,4)]))}function la(t){if(null==t)return ia.en;if("string"==typeof t){var e=ia[t];return null==e&&sa.throwArgumentError("unknown locale","wordlist",t),e}return t}var da={},ga="m/44'/60'/0'/0/0",pa=function(){function t(e,r,n,i,o,a,s,c){if(function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),e!==da)throw new Error("HDNode constructor cannot be called directly");if(r){var u=new Vn(r);D(this,"privateKey",u.privateKey),D(this,"publicKey",u.compressedPublicKey)}else D(this,"privateKey",null),D(this,"publicKey",Object(A.i)(n));D(this,"parentFingerprint",i),D(this,"fingerprint",Object(A.e)(To(Uo(this.publicKey)),0,4)),D(this,"address",oi(this.publicKey)),D(this,"chainCode",o),D(this,"index",a),D(this,"depth",s),null==c?(D(this,"mnemonic",null),D(this,"path",null)):"string"==typeof c?(D(this,"mnemonic",null),D(this,"path",c)):(D(this,"mnemonic",c),D(this,"path",c.path))}var e,r,n;return e=t,n=[{key:"_fromSeed",value:function(e,r){var n=Object(A.a)(e);if(n.length<16||n.length>64)throw new Error("invalid seed");var i=Object(A.a)(Ho(Oo.sha512,Aa,n));return new t(da,fa(i.slice(0,32)),null,"0x00000000",fa(i.slice(32)),0,0,r)}},{key:"fromMnemonic",value:function(e,r,n){return e=ba(Ia(e,n=la(n)),n),t._fromSeed(ya(e,r),{phrase:e,path:"m",locale:n.locale})}},{key:"fromSeed",value:function(e){return t._fromSeed(e,null)}},{key:"fromExtendedKey",value:function(e){var r=Po.decode(e);82===r.length&&ha(r.slice(0,78))===e||sa.throwArgumentError("invalid extended key","extendedKey","[REDACTED]");var n=r[4],i=Object(A.i)(r.slice(5,9)),o=parseInt(Object(A.i)(r.slice(9,13)).substring(2),16),a=Object(A.i)(r.slice(13,45)),s=r.slice(45,78);switch(Object(A.i)(r.slice(0,4))){case"0x0488b21e":case"0x043587cf":return new t(da,null,Object(A.i)(s),i,a,o,n,null);case"0x0488ade4":case"0x04358394 ":if(0!==s[0])break;return new t(da,Object(A.i)(s.slice(1)),null,i,a,o,n,null)}return sa.throwArgumentError("invalid extended key","extendedKey","[REDACTED]")}}],(r=[{key:"extendedKey",get:function(){if(this.depth>=256)throw new Error("Depth too large!");return ha(Object(A.b)([null!=this.privateKey?"0x0488ADE4":"0x0488B21E",Object(A.i)(this.depth),this.parentFingerprint,Object(A.h)(Object(A.i)(this.index),4),this.chainCode,null!=this.privateKey?Object(A.b)(["0x00",this.privateKey]):this.publicKey]))}},{key:"neuter",value:function(){return new t(da,null,this.publicKey,this.parentFingerprint,this.chainCode,this.index,this.depth,this.path)}},{key:"_derive",value:function(e){if(e>4294967295)throw new Error("invalid index - "+String(e));var r=this.path;r&&(r+="/"+(2147483647&e));var n=new Uint8Array(37);if(2147483648&e){if(!this.privateKey)throw new Error("cannot derive child of neutered node");n.set(Object(A.a)(this.privateKey),1),r&&(r+="'")}else n.set(Object(A.a)(this.publicKey));for(var i=24;i>=0;i-=8)n[33+(i>>3)]=e>>24-i&255;var o=Object(A.a)(Ho(Oo.sha512,this.chainCode,n)),a=o.slice(0,32),s=o.slice(32),c=null,u=null;this.privateKey?c=fa(b.from(a).add(this.privateKey).mod(ca)):u=new Vn(Object(A.i)(a))._addPoint(this.publicKey);var f=r,h=this.mnemonic;return h&&(f=Object.freeze({phrase:h.phrase,path:r,locale:h.locale||"en"})),new t(da,c,u,this.fingerprint,fa(s),e,this.depth+1,f)}},{key:"derivePath",value:function(t){var e=t.split("/");if(0===e.length||"m"===e[0]&&0!==this.depth)throw new Error("invalid path - "+t);"m"===e[0]&&e.shift();for(var r=this,n=0;n<e.length;n++){var i=e[n];if(i.match(/^[0-9]+'$/)){var o=parseInt(i.substring(0,i.length-1));if(o>=2147483648)throw new Error("invalid path index - "+i);r=r._derive(2147483648+o)}else{if(!i.match(/^[0-9]+$/))throw new Error("invalid path component - "+i);var a=parseInt(i);if(a>=2147483648)throw new Error("invalid path index - "+i);r=r._derive(a)}}return r}}])&&aa(e.prototype,r),n&&aa(e,n),Object.defineProperty(e,"prototype",{writable:!1}),t}();function ya(t,e){e||(e="");var r=Ct("mnemonic"+e,yt.NFKD);return Yo(Ct(t,yt.NFKD),r,2048,64,"sha512")}function Ia(t,e){e=la(e),sa.checkNormalize();var r=e.split(t);if(r.length%3!=0)throw new Error("invalid mnemonic");for(var n=Object(A.a)(new Uint8Array(Math.ceil(11*r.length/8))),i=0,o=0;o<r.length;o++){var a=e.getWordIndex(r[o].normalize("NFKD"));if(-1===a)throw new Error("invalid mnemonic");for(var s=0;s<11;s++)a&1<<10-s&&(n[i>>3]|=1<<7-i%8),i++}var c=32*r.length/3,u=ua(r.length/3);if((Object(A.a)(Uo(n.slice(0,c/8)))[0]&u)!==(n[n.length-1]&u))throw new Error("invalid checksum");return Object(A.i)(n.slice(0,c/8))}function ba(t,e){if(e=la(e),(t=Object(A.a)(t)).length%4!=0||t.length<16||t.length>32)throw new Error("invalid entropy");for(var r=[0],n=11,i=0;i<t.length;i++)n>8?(r[r.length-1]<<=8,r[r.length-1]|=t[i],n-=8):(r[r.length-1]<<=n,r[r.length-1]|=t[i]>>8-n,r.push(t[i]&(1<<8-n)-1),n+=3);var o=t.length/4,a=Object(A.a)(Uo(t))[0]&ua(o);return r[r.length-1]<<=o,r[r.length-1]|=a>>8-o,e.join(r.map((function(t){return e.getWord(t)})))}function va(t,e){try{return Ia(t,e),!0}catch(t){}return!1}function Ea(t){return("number"!=typeof t||t<0||t>=2147483648||t%1)&&sa.throwArgumentError("invalid account index","index",t),"m/44'/60'/".concat(t,"'/0/0")}var ma=r(340),Ca=r(13),wa=r.n(Ca),Ba=r(50),Qa=r.n(Ba);function ka(t){return"string"==typeof t&&"0x"!==t.substring(0,2)&&(t="0x"+t),Object(A.a)(t)}function Sa(t,e){for(t=String(t);t.length<e;)t="0"+t;return t}function _a(t){return"string"==typeof t?Ct(t,yt.NFKC):Object(A.a)(t)}function Da(t,e){for(var r=t,n=e.toLowerCase().split("/"),i=0;i<n.length;i++){var o=null;for(var a in r)if(a.toLowerCase()===n[i]){o=r[a];break}if(null===o)return null;r=o}return r}function xa(t){var e=Object(A.a)(t);e[6]=15&e[6]|64,e[8]=63&e[8]|128;var r=Object(A.i)(e);return[r.substring(2,10),r.substring(10,14),r.substring(14,18),r.substring(18,22),r.substring(22,34)].join("-")}function Ma(t){return(Ma="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Ra(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */Ra=function(){return t};var t={},e=Object.prototype,r=e.hasOwnProperty,n=Object.defineProperty||function(t,e,r){t[e]=r.value},i="function"==typeof Symbol?Symbol:{},o=i.iterator||"@@iterator",a=i.asyncIterator||"@@asyncIterator",s=i.toStringTag||"@@toStringTag";function c(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{c({},"")}catch(t){c=function(t,e,r){return t[e]=r}}function A(t,e,r,i){var o=e&&e.prototype instanceof h?e:h,a=Object.create(o.prototype),s=new B(i||[]);return n(a,"_invoke",{value:E(t,r,s)}),a}function u(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=A;var f={};function h(){}function l(){}function d(){}var g={};c(g,o,(function(){return this}));var p=Object.getPrototypeOf,y=p&&p(p(Q([])));y&&y!==e&&r.call(y,o)&&(g=y);var I=d.prototype=h.prototype=Object.create(g);function b(t){["next","throw","return"].forEach((function(e){c(t,e,(function(t){return this._invoke(e,t)}))}))}function v(t,e){var i;n(this,"_invoke",{value:function(n,o){function a(){return new e((function(i,a){!function n(i,o,a,s){var c=u(t[i],t,o);if("throw"!==c.type){var A=c.arg,f=A.value;return f&&"object"==Ma(f)&&r.call(f,"__await")?e.resolve(f.__await).then((function(t){n("next",t,a,s)}),(function(t){n("throw",t,a,s)})):e.resolve(f).then((function(t){A.value=t,a(A)}),(function(t){return n("throw",t,a,s)}))}s(c.arg)}(n,o,i,a)}))}return i=i?i.then(a,a):a()}})}function E(t,e,r){var n="suspendedStart";return function(i,o){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===i)throw o;return k()}for(r.method=i,r.arg=o;;){var a=r.delegate;if(a){var s=m(a,r);if(s){if(s===f)continue;return s}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var c=u(t,e,r);if("normal"===c.type){if(n=r.done?"completed":"suspendedYield",c.arg===f)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(n="completed",r.method="throw",r.arg=c.arg)}}}function m(t,e){var r=e.method,n=t.iterator[r];if(void 0===n)return e.delegate=null,"throw"===r&&t.iterator.return&&(e.method="return",e.arg=void 0,m(t,e),"throw"===e.method)||"return"!==r&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+r+"' method")),f;var i=u(n,t.iterator,e.arg);if("throw"===i.type)return e.method="throw",e.arg=i.arg,e.delegate=null,f;var o=i.arg;return o?o.done?(e[t.resultName]=o.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,f):o:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,f)}function C(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function w(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function B(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(C,this),this.reset(!0)}function Q(t){if(t){var e=t[o];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,i=function e(){for(;++n<t.length;)if(r.call(t,n))return e.value=t[n],e.done=!1,e;return e.value=void 0,e.done=!0,e};return i.next=i}}return{next:k}}function k(){return{value:void 0,done:!0}}return l.prototype=d,n(I,"constructor",{value:d,configurable:!0}),n(d,"constructor",{value:l,configurable:!0}),l.displayName=c(d,s,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===l||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,d):(t.__proto__=d,c(t,s,"GeneratorFunction")),t.prototype=Object.create(I),t},t.awrap=function(t){return{__await:t}},b(v.prototype),c(v.prototype,a,(function(){return this})),t.AsyncIterator=v,t.async=function(e,r,n,i,o){void 0===o&&(o=Promise);var a=new v(A(e,r,n,i),o);return t.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},b(I),c(I,s,"Generator"),c(I,o,(function(){return this})),c(I,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},t.values=Q,B.prototype={constructor:B,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(w),!t)for(var e in this)"t"===e.charAt(0)&&r.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function n(r,n){return a.type="throw",a.arg=t,e.next=r,n&&(e.method="next",e.arg=void 0),!!n}for(var i=this.tryEntries.length-1;i>=0;--i){var o=this.tryEntries[i],a=o.completion;if("root"===o.tryLoc)return n("end");if(o.tryLoc<=this.prev){var s=r.call(o,"catchLoc"),c=r.call(o,"finallyLoc");if(s&&c){if(this.prev<o.catchLoc)return n(o.catchLoc,!0);if(this.prev<o.finallyLoc)return n(o.finallyLoc)}else if(s){if(this.prev<o.catchLoc)return n(o.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return n(o.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&r.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var o=i;break}}o&&("break"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc&&(o=null);var a=o?o.completion:{};return a.type=t,a.arg=e,o?(this.method="next",this.next=o.finallyLoc,f):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),f},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),w(r),f}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var i=n.arg;w(r)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:Q(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),f}},t}function Oa(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Na(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,(i=n.key,o=void 0,o=function(t,e){if("object"!==Ma(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==Ma(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(i,"string"),"symbol"===Ma(o)?o:String(o)),n)}var i,o}function Pa(t,e){return(Pa=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}function ja(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=Fa(t);if(e){var i=Fa(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return La(this,r)}}function La(t,e){if(e&&("object"===Ma(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function Fa(t){return(Fa=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var Ta=function(t,e,r,n){return new(r||(r=Promise))((function(i,o){function a(t){try{c(n.next(t))}catch(t){o(t)}}function s(t){try{c(n.throw(t))}catch(t){o(t)}}function c(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(a,s)}c((n=n.apply(t,e||[])).next())}))},Ua=new h.b("json-wallets/5.7.0");function Ga(t){return null!=t&&t.mnemonic&&t.mnemonic.phrase}var Ha=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Pa(t,e)}(o,t);var e,r,n,i=ja(o);function o(){return Oa(this,o),i.apply(this,arguments)}return e=o,(r=[{key:"isKeystoreAccount",value:function(t){return!(!t||!t._isKeystoreAccount)}}])&&Na(e.prototype,r),n&&Na(e,n),Object.defineProperty(e,"prototype",{writable:!1}),o}(L);function Ya(t,e){var r=ka(Da(t,"crypto/ciphertext"));if(Object(A.i)(V(Object(A.b)([e.slice(16,32),r]))).substring(2)!==Da(t,"crypto/mac").toLowerCase())throw new Error("invalid password");var n=function(t,e,r){if("aes-128-ctr"===Da(t,"crypto/cipher")){var n=ka(Da(t,"crypto/cipherparams/iv")),i=new wa.a.Counter(n),o=new wa.a.ModeOfOperation.ctr(e,i);return Object(A.a)(o.decrypt(r))}return null}(t,e.slice(0,16),r);n||Ua.throwError("unsupported cipher",h.b.errors.UNSUPPORTED_OPERATION,{operation:"decrypt"});var i=e.slice(32,64),o=oi(n);if(t.address){var a=t.address.toLowerCase();if("0x"!==a.substring(0,2)&&(a="0x"+a),ht(a)!==o)throw new Error("address mismatch")}var s={_isKeystoreAccount:!0,address:o,privateKey:Object(A.i)(n)};if("0.1"===Da(t,"x-ethers/version")){var c=ka(Da(t,"x-ethers/mnemonicCiphertext")),u=ka(Da(t,"x-ethers/mnemonicCounter")),f=new wa.a.Counter(u),l=new wa.a.ModeOfOperation.ctr(i,f),d=Da(t,"x-ethers/path")||ga,g=Da(t,"x-ethers/locale")||"en",p=Object(A.a)(l.decrypt(c));try{var y=ba(p,g),I=pa.fromMnemonic(y,null,g).derivePath(d);if(I.privateKey!=s.privateKey)throw new Error("mnemonic mismatch");s.mnemonic=I.mnemonic}catch(t){if(t.code!==h.b.errors.INVALID_ARGUMENT||"wordlist"!==t.argument)throw t}}return new Ha(s)}function Ka(t,e,r,n,i){return Object(A.a)(Yo(t,e,r,n,i))}function qa(t,e,r,n,i){return Promise.resolve(Ka(t,e,r,n,i))}function Ja(t,e,r,n,i){var o=_a(e),a=Da(t,"crypto/kdf");if(a&&"string"==typeof a){var s=function(t,e){return Ua.throwArgumentError("invalid key-derivation function parameters",t,e)};if("scrypt"===a.toLowerCase()){var c=ka(Da(t,"crypto/kdfparams/salt")),A=parseInt(Da(t,"crypto/kdfparams/n")),u=parseInt(Da(t,"crypto/kdfparams/r")),f=parseInt(Da(t,"crypto/kdfparams/p"));A&&u&&f||s("kdf",a),0!=(A&A-1)&&s("N",A);var h=parseInt(Da(t,"crypto/kdfparams/dklen"));return 32!==h&&s("dklen",h),n(o,c,A,u,f,64,i)}if("pbkdf2"===a.toLowerCase()){var l=ka(Da(t,"crypto/kdfparams/salt")),d=null,g=Da(t,"crypto/kdfparams/prf");"hmac-sha256"===g?d="sha256":"hmac-sha512"===g?d="sha512":s("prf",g);var p=parseInt(Da(t,"crypto/kdfparams/c")),y=parseInt(Da(t,"crypto/kdfparams/dklen"));return 32!==y&&s("dklen",y),r(o,l,p,y,d)}}return Ua.throwArgumentError("unsupported key-derivation function","kdf",a)}function za(t){return(za="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Za(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Va(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,(i=n.key,o=void 0,o=function(t,e){if("object"!==za(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==za(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(i,"string"),"symbol"===za(o)?o:String(o)),n)}var i,o}function Wa(t,e){return(Wa=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}function Xa(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=ts(t);if(e){var i=ts(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return $a(this,r)}}function $a(t,e){if(e&&("object"===za(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function ts(t){return(ts=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var es=new h.b("json-wallets/5.7.0"),rs=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Wa(t,e)}(o,t);var e,r,n,i=Xa(o);function o(){return Za(this,o),i.apply(this,arguments)}return e=o,(r=[{key:"isCrowdsaleAccount",value:function(t){return!(!t||!t._isCrowdsaleAccount)}}])&&Va(e.prototype,r),n&&Va(e,n),Object.defineProperty(e,"prototype",{writable:!1}),o}(L);function ns(t,e){var r=JSON.parse(t);e=_a(e);var n=ht(Da(r,"ethaddr")),i=ka(Da(r,"encseed"));i&&i.length%16==0||es.throwArgumentError("invalid encseed","json",t);for(var o=Object(A.a)(Yo(e,e,2e3,32,"sha256")).slice(0,16),a=i.slice(0,16),s=i.slice(16),c=new wa.a.ModeOfOperation.cbc(o,a),u=wa.a.padding.pkcs7.strip(Object(A.a)(c.decrypt(s))),f="",h=0;h<u.length;h++)f+=String.fromCharCode(u[h]);var l=V(Ct(f));return new rs({_isCrowdsaleAccount:!0,address:n,privateKey:l})}function is(t){var e=null;try{e=JSON.parse(t)}catch(t){return!1}return e.encseed&&e.ethaddr}function os(t){var e=null;try{e=JSON.parse(t)}catch(t){return!1}return!(!e.version||parseInt(e.version)!==e.version||3!==parseInt(e.version))}function as(t){if(is(t))try{return ht(JSON.parse(t).ethaddr)}catch(t){return null}if(os(t))try{return ht(JSON.parse(t).address)}catch(t){return null}return null}function ss(t,e,r){if(is(t)){r&&r(0);var n=ns(t,e);return r&&r(1),Promise.resolve(n)}return os(t)?function(t,e,r){return Ta(this,void 0,void 0,Ra().mark((function n(){var i,o;return Ra().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return i=JSON.parse(t),n.next=3,Ja(i,e,qa,Qa.a.scrypt,r);case 3:return o=n.sent,n.abrupt("return",Ya(i,o));case 5:case"end":return n.stop()}}),n)})))}(t,e,r):Promise.reject(new Error("invalid JSON wallet"))}function cs(t,e){if(is(t))return ns(t,e);if(os(t))return function(t,e){var r=JSON.parse(t);return Ya(r,Ja(r,e,Ka,Qa.a.syncScrypt))}(t,e);throw new Error("invalid JSON wallet")}function As(t){return(As="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function us(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */us=function(){return t};var t={},e=Object.prototype,r=e.hasOwnProperty,n=Object.defineProperty||function(t,e,r){t[e]=r.value},i="function"==typeof Symbol?Symbol:{},o=i.iterator||"@@iterator",a=i.asyncIterator||"@@asyncIterator",s=i.toStringTag||"@@toStringTag";function c(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{c({},"")}catch(t){c=function(t,e,r){return t[e]=r}}function A(t,e,r,i){var o=e&&e.prototype instanceof h?e:h,a=Object.create(o.prototype),s=new B(i||[]);return n(a,"_invoke",{value:E(t,r,s)}),a}function u(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=A;var f={};function h(){}function l(){}function d(){}var g={};c(g,o,(function(){return this}));var p=Object.getPrototypeOf,y=p&&p(p(Q([])));y&&y!==e&&r.call(y,o)&&(g=y);var I=d.prototype=h.prototype=Object.create(g);function b(t){["next","throw","return"].forEach((function(e){c(t,e,(function(t){return this._invoke(e,t)}))}))}function v(t,e){var i;n(this,"_invoke",{value:function(n,o){function a(){return new e((function(i,a){!function n(i,o,a,s){var c=u(t[i],t,o);if("throw"!==c.type){var A=c.arg,f=A.value;return f&&"object"==As(f)&&r.call(f,"__await")?e.resolve(f.__await).then((function(t){n("next",t,a,s)}),(function(t){n("throw",t,a,s)})):e.resolve(f).then((function(t){A.value=t,a(A)}),(function(t){return n("throw",t,a,s)}))}s(c.arg)}(n,o,i,a)}))}return i=i?i.then(a,a):a()}})}function E(t,e,r){var n="suspendedStart";return function(i,o){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===i)throw o;return k()}for(r.method=i,r.arg=o;;){var a=r.delegate;if(a){var s=m(a,r);if(s){if(s===f)continue;return s}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var c=u(t,e,r);if("normal"===c.type){if(n=r.done?"completed":"suspendedYield",c.arg===f)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(n="completed",r.method="throw",r.arg=c.arg)}}}function m(t,e){var r=e.method,n=t.iterator[r];if(void 0===n)return e.delegate=null,"throw"===r&&t.iterator.return&&(e.method="return",e.arg=void 0,m(t,e),"throw"===e.method)||"return"!==r&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+r+"' method")),f;var i=u(n,t.iterator,e.arg);if("throw"===i.type)return e.method="throw",e.arg=i.arg,e.delegate=null,f;var o=i.arg;return o?o.done?(e[t.resultName]=o.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,f):o:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,f)}function C(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function w(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function B(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(C,this),this.reset(!0)}function Q(t){if(t){var e=t[o];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,i=function e(){for(;++n<t.length;)if(r.call(t,n))return e.value=t[n],e.done=!1,e;return e.value=void 0,e.done=!0,e};return i.next=i}}return{next:k}}function k(){return{value:void 0,done:!0}}return l.prototype=d,n(I,"constructor",{value:d,configurable:!0}),n(d,"constructor",{value:l,configurable:!0}),l.displayName=c(d,s,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===l||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,d):(t.__proto__=d,c(t,s,"GeneratorFunction")),t.prototype=Object.create(I),t},t.awrap=function(t){return{__await:t}},b(v.prototype),c(v.prototype,a,(function(){return this})),t.AsyncIterator=v,t.async=function(e,r,n,i,o){void 0===o&&(o=Promise);var a=new v(A(e,r,n,i),o);return t.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},b(I),c(I,s,"Generator"),c(I,o,(function(){return this})),c(I,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},t.values=Q,B.prototype={constructor:B,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(w),!t)for(var e in this)"t"===e.charAt(0)&&r.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function n(r,n){return a.type="throw",a.arg=t,e.next=r,n&&(e.method="next",e.arg=void 0),!!n}for(var i=this.tryEntries.length-1;i>=0;--i){var o=this.tryEntries[i],a=o.completion;if("root"===o.tryLoc)return n("end");if(o.tryLoc<=this.prev){var s=r.call(o,"catchLoc"),c=r.call(o,"finallyLoc");if(s&&c){if(this.prev<o.catchLoc)return n(o.catchLoc,!0);if(this.prev<o.finallyLoc)return n(o.finallyLoc)}else if(s){if(this.prev<o.catchLoc)return n(o.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return n(o.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&r.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var o=i;break}}o&&("break"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc&&(o=null);var a=o?o.completion:{};return a.type=t,a.arg=e,o?(this.method="next",this.next=o.finallyLoc,f):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),f},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),w(r),f}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var i=n.arg;w(r)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:Q(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),f}},t}function fs(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,(i=n.key,o=void 0,o=function(t,e){if("object"!==As(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==As(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(i,"string"),"symbol"===As(o)?o:String(o)),n)}var i,o}function hs(t,e){return(hs=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}function ls(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=ps(t);if(e){var i=ps(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return ds(this,r)}}function ds(t,e){if(e&&("object"===As(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return gs(t)}function gs(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function ps(t){return(ps=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var ys=function(t,e,r,n){return new(r||(r=Promise))((function(i,o){function a(t){try{c(n.next(t))}catch(t){o(t)}}function s(t){try{c(n.throw(t))}catch(t){o(t)}}function c(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(a,s)}c((n=n.apply(t,e||[])).next())}))},Is=new h.b("wallet/5.7.0");var bs=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&hs(t,e)}(o,t);var e,r,n,i=ls(o);function o(t,e){var r,n;if(function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,o),r=i.call(this),null!=(n=t)&&Object(A.l)(n.privateKey,32)&&null!=n.address){var a=new Vn(t.privateKey);if(D(gs(r),"_signingKey",(function(){return a})),D(gs(r),"address",oi(r.publicKey)),r.address!==ht(t.address)&&Is.throwArgumentError("privateKey/address mismatch","privateKey","[REDACTED]"),function(t){var e=t.mnemonic;return e&&e.phrase}(t)){var s=t.mnemonic;D(gs(r),"_mnemonic",(function(){return{phrase:s.phrase,path:s.path||ga,locale:s.locale||"en"}}));var c=r.mnemonic;oi(pa.fromMnemonic(c.phrase,null,c.locale).derivePath(c.path).privateKey)!==r.address&&Is.throwArgumentError("mnemonic/address mismatch","privateKey","[REDACTED]")}else D(gs(r),"_mnemonic",(function(){return null}))}else{if(Vn.isSigningKey(t))"secp256k1"!==t.curve&&Is.throwArgumentError("unsupported curve; must be secp256k1","privateKey","[REDACTED]"),D(gs(r),"_signingKey",(function(){return t}));else{"string"==typeof t&&t.match(/^[0-9a-f]*$/i)&&64===t.length&&(t="0x"+t);var u=new Vn(t);D(gs(r),"_signingKey",(function(){return u}))}D(gs(r),"_mnemonic",(function(){return null})),D(gs(r),"address",oi(r.publicKey))}return e&&!kn.isProvider(e)&&Is.throwArgumentError("invalid provider","provider",e),D(gs(r),"provider",e||null),r}return e=o,n=[{key:"createRandom",value:function(t){var e=Object(ma.a)(16);t||(t={}),t.extraEntropy&&(e=Object(A.a)(Object(A.e)(V(Object(A.b)([e,t.extraEntropy])),0,16)));var r=ba(e,t.locale);return o.fromMnemonic(r,t.path,t.locale)}},{key:"fromEncryptedJson",value:function(t,e,r){return ss(t,e,r).then((function(t){return new o(t)}))}},{key:"fromEncryptedJsonSync",value:function(t,e){return new o(cs(t,e))}},{key:"fromMnemonic",value:function(t,e,r){return e||(e=ga),new o(pa.fromMnemonic(t,null,r).derivePath(e))}}],(r=[{key:"mnemonic",get:function(){return this._mnemonic()}},{key:"privateKey",get:function(){return this._signingKey().privateKey}},{key:"publicKey",get:function(){return this._signingKey().publicKey}},{key:"getAddress",value:function(){return Promise.resolve(this.address)}},{key:"connect",value:function(t){return new o(this,t)}},{key:"signTransaction",value:function(t){var e=this;return M(t).then((function(r){null!=r.from&&(ht(r.from)!==e.address&&Is.throwArgumentError("transaction from address mismatch","transaction.from",t.from),delete r.from);var n=e._signingKey().signDigest(V(li(r)));return li(r,n)}))}},{key:"signMessage",value:function(t){return ys(this,void 0,void 0,us().mark((function e(){return us().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",Object(A.m)(this._signingKey().signDigest(fo(t))));case 1:case"end":return e.stop()}}),e,this)})))}},{key:"_signTypedData",value:function(t,e,r){return ys(this,void 0,void 0,us().mark((function n(){var i,o=this;return us().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,xo.resolveNames(t,e,r,(function(t){return null==o.provider&&Is.throwError("cannot resolve ENS names without a provider",h.b.errors.UNSUPPORTED_OPERATION,{operation:"resolveName",value:t}),o.provider.resolveName(t)}));case 2:return i=n.sent,n.abrupt("return",Object(A.m)(this._signingKey().signDigest(xo.hash(i.domain,e,i.value))));case 4:case"end":return n.stop()}}),n,this)})))}},{key:"encrypt",value:function(t,e,r){if("function"!=typeof e||r||(r=e,e={}),r&&"function"!=typeof r)throw new Error("invalid callback");return e||(e={}),function(t,e,r,n){try{if(ht(t.address)!==oi(t.privateKey))throw new Error("address/privateKey mismatch");if(Ga(t)){var i=t.mnemonic;if(pa.fromMnemonic(i.phrase,null,i.locale).derivePath(i.path||ga).privateKey!=t.privateKey)throw new Error("mnemonic mismatch")}}catch(t){return Promise.reject(t)}"function"!=typeof r||n||(n=r,r={}),r||(r={});var o=Object(A.a)(t.privateKey),a=_a(e),s=null,c=null,u=null;if(Ga(t)){var f=t.mnemonic;s=Object(A.a)(Ia(f.phrase,f.locale||"en")),c=f.path||ga,u=f.locale||"en"}var h=r.client;h||(h="ethers.js");var l=null;l=r.salt?Object(A.a)(r.salt):Object(ma.a)(32);var d=null;if(r.iv){if(16!==(d=Object(A.a)(r.iv)).length)throw new Error("invalid iv")}else d=Object(ma.a)(16);var g=null;if(r.uuid){if(16!==(g=Object(A.a)(r.uuid)).length)throw new Error("invalid uuid")}else g=Object(ma.a)(16);var p=1<<17,y=8,I=1;return r.scrypt&&(r.scrypt.N&&(p=r.scrypt.N),r.scrypt.r&&(y=r.scrypt.r),r.scrypt.p&&(I=r.scrypt.p)),Qa.a.scrypt(a,l,p,y,I,64,n).then((function(e){var r=(e=Object(A.a)(e)).slice(0,16),n=e.slice(16,32),i=e.slice(32,64),a=new wa.a.Counter(d),f=new wa.a.ModeOfOperation.ctr(r,a),b=Object(A.a)(f.encrypt(o)),v=V(Object(A.b)([n,b])),E={address:t.address.substring(2).toLowerCase(),id:xa(g),version:3,crypto:{cipher:"aes-128-ctr",cipherparams:{iv:Object(A.i)(d).substring(2)},ciphertext:Object(A.i)(b).substring(2),kdf:"scrypt",kdfparams:{salt:Object(A.i)(l).substring(2),n:p,dklen:32,p:I,r:y},mac:v.substring(2)}};if(s){var m=Object(ma.a)(16),C=new wa.a.Counter(m),w=new wa.a.ModeOfOperation.ctr(i,C),B=Object(A.a)(w.encrypt(s)),Q=new Date,k=Q.getUTCFullYear()+"-"+Sa(Q.getUTCMonth()+1,2)+"-"+Sa(Q.getUTCDate(),2)+"T"+Sa(Q.getUTCHours(),2)+"-"+Sa(Q.getUTCMinutes(),2)+"-"+Sa(Q.getUTCSeconds(),2)+".0Z";E["x-ethers"]={client:h,gethFilename:"UTC--"+k+"--"+E.address,mnemonicCounter:Object(A.i)(m).substring(2),mnemonicCiphertext:Object(A.i)(B).substring(2),path:c,locale:u,version:"0.1"}}return JSON.stringify(E)}))}(this,t,e,r)}}])&&fs(e.prototype,r),n&&fs(e,n),Object.defineProperty(e,"prototype",{writable:!1}),o}(Gn);function vs(t,e){return ai(fo(t),e)}function Es(t,e,r,n){return ai(xo.hash(t,e,r),n)}var ms="0x0000000000000000000000000000000000000000",Cs="0x0000000000000000000000000000000000000000000000000000000000000000",ws="Ξ",Bs=new h.b("networks/5.7.1");function Qs(t){var e=function(e,r){null==r&&(r={});var n=[];if(e.InfuraProvider&&"-"!==r.infura)try{n.push(new e.InfuraProvider(t,r.infura))}catch(t){}if(e.EtherscanProvider&&"-"!==r.etherscan)try{n.push(new e.EtherscanProvider(t,r.etherscan))}catch(t){}if(e.AlchemyProvider&&"-"!==r.alchemy)try{n.push(new e.AlchemyProvider(t,r.alchemy))}catch(t){}if(e.PocketProvider&&"-"!==r.pocket){try{var i=new e.PocketProvider(t,r.pocket);i.network&&-1===["goerli","ropsten","rinkeby","sepolia"].indexOf(i.network.name)&&n.push(i)}catch(t){}}if(e.CloudflareProvider&&"-"!==r.cloudflare)try{n.push(new e.CloudflareProvider(t))}catch(t){}if(e.AnkrProvider&&"-"!==r.ankr)try{var o=new e.AnkrProvider(t,r.ankr);o.network&&-1===["ropsten"].indexOf(o.network.name)&&n.push(o)}catch(t){}if(0===n.length)return null;if(e.FallbackProvider){var a=1;return null!=r.quorum?a=r.quorum:"homestead"===t&&(a=2),new e.FallbackProvider(n,a)}return n[0]};return e.renetwork=function(t){return Qs(t)},e}function ks(t,e){var r=function(r,n){return r.JsonRpcProvider?new r.JsonRpcProvider(t,e):null};return r.renetwork=function(e){return ks(t,e)},r}var Ss={chainId:1,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"homestead",_defaultProvider:Qs("homestead")},_s={chainId:3,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"ropsten",_defaultProvider:Qs("ropsten")},Ds={chainId:63,name:"classicMordor",_defaultProvider:ks("https://www.ethercluster.com/mordor","classicMordor")},xs={unspecified:{chainId:0,name:"unspecified"},homestead:Ss,mainnet:Ss,morden:{chainId:2,name:"morden"},ropsten:_s,testnet:_s,rinkeby:{chainId:4,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"rinkeby",_defaultProvider:Qs("rinkeby")},kovan:{chainId:42,name:"kovan",_defaultProvider:Qs("kovan")},goerli:{chainId:5,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"goerli",_defaultProvider:Qs("goerli")},kintsugi:{chainId:1337702,name:"kintsugi"},sepolia:{chainId:11155111,name:"sepolia",_defaultProvider:Qs("sepolia")},classic:{chainId:61,name:"classic",_defaultProvider:ks("https://www.ethercluster.com/etc","classic")},classicMorden:{chainId:62,name:"classicMorden"},classicMordor:Ds,classicTestnet:Ds,classicKotti:{chainId:6,name:"classicKotti",_defaultProvider:ks("https://www.ethercluster.com/kotti","classicKotti")},xdai:{chainId:100,name:"xdai"},matic:{chainId:137,name:"matic",_defaultProvider:Qs("matic")},maticmum:{chainId:80001,name:"maticmum"},optimism:{chainId:10,name:"optimism",_defaultProvider:Qs("optimism")},"optimism-kovan":{chainId:69,name:"optimism-kovan"},"optimism-goerli":{chainId:420,name:"optimism-goerli"},arbitrum:{chainId:42161,name:"arbitrum"},"arbitrum-rinkeby":{chainId:421611,name:"arbitrum-rinkeby"},"arbitrum-goerli":{chainId:421613,name:"arbitrum-goerli"},bnb:{chainId:56,name:"bnb"},bnbt:{chainId:97,name:"bnbt"}};function Ms(t){if(null==t)return null;if("number"==typeof t){for(var e in xs){var r=xs[e];if(r.chainId===t)return{name:r.name,chainId:r.chainId,ensAddress:r.ensAddress||null,_defaultProvider:r._defaultProvider||null}}return{chainId:t,name:"unknown"}}if("string"==typeof t){var n=xs[t];return null==n?null:{name:n.name,chainId:n.chainId,ensAddress:n.ensAddress,_defaultProvider:n._defaultProvider||null}}var i=xs[t.name];if(!i)return"number"!=typeof t.chainId&&Bs.throwArgumentError("invalid network chainId","network",t),t;0!==t.chainId&&t.chainId!==i.chainId&&Bs.throwArgumentError("network chainId mismatch","network",t);var o,a=t._defaultProvider||null;return null==a&&i._defaultProvider&&(a=(o=i._defaultProvider)&&"function"==typeof o.renetwork?i._defaultProvider.renetwork(t):i._defaultProvider),{name:t.name,chainId:i.chainId,ensAddress:t.ensAddress||i.ensAddress||null,_defaultProvider:a}}function Rs(t){t=atob(t);for(var e=[],r=0;r<t.length;r++)e.push(t.charCodeAt(r));return Object(A.a)(e)}function Os(t){t=Object(A.a)(t);for(var e="",r=0;r<t.length;r++)e+=String.fromCharCode(t[r]);return btoa(e)}function Ns(t,e){null==e&&(e=1);var r=[],n=r.forEach;return function t(e,i){n.call(e,(function(e){i>0&&Array.isArray(e)?t(e,i-1):r.push(e)}))}(t,e),r}function Ps(t){return function(t){var e=0;return function(){return t[e++]}}(function(t){var e=0;function r(){return t[e++]<<8|t[e++]}for(var n=r(),i=1,o=[0,1],a=1;a<n;a++)o.push(i+=r());var s=r(),c=e;e+=s;var A=0,u=0;function f(){return 0==A&&(u=u<<8|t[e++],A=8),u>>--A&1}for(var h=Math.pow(2,31),l=h>>>1,d=l>>1,g=h-1,p=0,y=0;y<31;y++)p=p<<1|f();for(var I=[],b=0,v=h;;){for(var E=Math.floor(((p-b+1)*i-1)/v),m=0,C=n;C-m>1;){var w=m+C>>>1;E<o[w]?C=w:m=w}if(0==m)break;I.push(m);for(var B=b+Math.floor(v*o[m]/i),Q=b+Math.floor(v*o[m+1]/i)-1;0==((B^Q)&l);)p=p<<1&g|f(),B=B<<1&g,Q=Q<<1&g|1;for(;B&~Q&d;)p=p&l|p<<1&g>>>1|f(),B=B<<1^l,Q=(Q^l)<<1|l|1;b=B,v=1+Q-B}var k=n-4;return I.map((function(e){switch(e-k){case 3:return k+65792+(t[c++]<<16|t[c++]<<8|t[c++]);case 2:return k+256+(t[c++]<<8|t[c++]);case 1:return k+t[c++];default:return e-1}}))}(t))}function js(t){return 1&t?~t>>1:t>>1}function Ls(t,e){for(var r=Array(t),n=0,i=-1;n<t;n++)r[n]=i+=1+e();return r}function Fs(t,e){for(var r=Array(t),n=0,i=0;n<t;n++)r[n]=i+=js(e());return r}function Ts(t,e){for(var r=Ls(t(),t),n=t(),i=Ls(n,t),o=function(t,e){for(var r=Array(t),n=0;n<t;n++)r[n]=1+e();return r}(n,t),a=0;a<n;a++)for(var s=0;s<o[a];s++)r.push(i[a]+s);return e?r.map((function(t){return e[t]})):r}function Us(t,e,r){for(var n=Array(t).fill(void 0).map((function(){return[]})),i=0;i<e;i++)Fs(t,r).forEach((function(t,e){return n[e].push(t)}));return n}function Gs(t,e){var r=1+e(),n=e(),i=function(t){for(var e=[];;){var r=t();if(0==r)break;e.push(r)}return e}(e);return Ns(Us(i.length,1+t,e).map((function(t,e){var o=t[0],a=t.slice(1);return Array(i[e]).fill(void 0).map((function(t,e){var i=e*n;return[o+e*r,a.map((function(t){return t+i}))]}))})))}function Hs(t,e){return Us(1+e(),1+t,e).map((function(t){return[t[0],t.slice(1)]}))}function Ys(t){return function(t){if(Array.isArray(t))return qs(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||Ks(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Ks(t,e){if(t){if("string"==typeof t)return qs(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?qs(t,e):void 0}}function qs(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}var Js,zs,Zs=Ps(Rs("AEQF2AO2DEsA2wIrAGsBRABxAN8AZwCcAEwAqgA0AGwAUgByADcATAAVAFYAIQAyACEAKAAYAFgAGwAjABQAMAAmADIAFAAfABQAKwATACoADgAbAA8AHQAYABoAGQAxADgALAAoADwAEwA9ABMAGgARAA4ADwAWABMAFgAIAA8AHgQXBYMA5BHJAS8JtAYoAe4AExozi0UAH21tAaMnBT8CrnIyhrMDhRgDygIBUAEHcoFHUPe8AXBjAewCjgDQR8IICIcEcQLwATXCDgzvHwBmBoHNAqsBdBcUAykgDhAMShskMgo8AY8jqAQfAUAfHw8BDw87MioGlCIPBwZCa4ELatMAAMspJVgsDl8AIhckSg8XAHdvTwBcIQEiDT4OPhUqbyECAEoAS34Aej8Ybx83JgT/Xw8gHxZ/7w8RICxPHA9vBw+Pfw8PHwAPFv+fAsAvCc8vEr8ivwD/EQ8Bol8OEBa/A78hrwAPCU8vESNvvwWfHwNfAVoDHr+ZAAED34YaAdJPAK7PLwSEgDLHAGo1Pz8Pvx9fUwMrpb8O/58VTzAPIBoXIyQJNF8hpwIVAT8YGAUADDNBaX3RAMomJCg9EhUeA29MABsZBTMNJipjOhc19gcIDR8bBwQHEggCWi6DIgLuAQYA+BAFCha3A5XiAEsqM7UFFgFLhAMjFTMYE1Klnw74nRVBG/ASCm0BYRN/BrsU3VoWy+S0vV8LQx+vN8gF2AC2AK5EAWwApgYDKmAAroQ0NDQ0AT+OCg7wAAIHRAbpNgVcBV0APTA5BfbPFgMLzcYL/QqqA82eBALKCjQCjqYCht0/k2+OAsXQAoP3ASTKDgDw6ACKAUYCMpIKJpRaAE4A5womABzZvs0REEKiACIQAd5QdAECAj4Ywg/wGqY2AVgAYADYvAoCGAEubA0gvAY2ALAAbpbvqpyEAGAEpgQAJgAG7gAgAEACmghUFwCqAMpAINQIwC4DthRAAPcycKgApoIdABwBfCisABoATwBqASIAvhnSBP8aH/ECeAKXAq40NjgDBTwFYQU6AXs3oABgAD4XNgmcCY1eCl5tIFZeUqGgyoNHABgAEQAaABNwWQAmABMATPMa3T34ADldyprmM1M2XociUQgLzvwAXT3xABgAEQAaABNwIGFAnADD8AAgAD4BBJWzaCcIAIEBFMAWwKoAAdq9BWAF5wLQpALEtQAKUSGkahR4GnJM+gsAwCgeFAiUAECQ0BQuL8AAIAAAADKeIheclvFqQAAETr4iAMxIARMgAMIoHhQIAn0E0pDQFC4HhznoAAAAIAI2C0/4lvFqQAAETgBJJwYCAy4ABgYAFAA8MBKYEH4eRhTkAjYeFcgACAYAeABsOqyQ5gRwDayqugEgaIIAtgoACgDmEABmBAWGme5OBJJA2m4cDeoAmITWAXwrMgOgAGwBCh6CBXYF1Tzg1wKAAFdiuABRAFwAXQBsAG8AdgBrAHYAbwCEAHEwfxQBVE5TEQADVFhTBwBDANILAqcCzgLTApQCrQL6vAAMAL8APLhNBKkE6glGKTAU4Dr4N2EYEwBCkABKk8rHAbYBmwIoAiU4Ajf/Aq4CowCAANIChzgaNBsCsTgeODcFXrgClQKdAqQBiQGYAqsCsjTsNHsfNPA0ixsAWTWiOAMFPDQSNCk2BDZHNow2TTZUNhk28Jk9VzI3QkEoAoICoQKwAqcAQAAxBV4FXbS9BW47YkIXP1ciUqs05DS/FwABUwJW11e6nHuYZmSh/RAYA8oMKvZ8KASoUAJYWAJ6ILAsAZSoqjpgA0ocBIhmDgDWAAawRDQoAAcuAj5iAHABZiR2AIgiHgCaAU68ACxuHAG0ygM8MiZIAlgBdF4GagJqAPZOHAMuBgoATkYAsABiAHgAMLoGDPj0HpKEBAAOJgAuALggTAHWAeAMEDbd20Uege0ADwAWADkAQgA9OHd+2MUQZBBhBgNNDkxxPxUQArEPqwvqERoM1irQ090ANK4H8ANYB/ADWANYB/AH8ANYB/ADWANYA1gDWBwP8B/YxRBkD00EcgWTBZAE2wiIJk4RhgctCNdUEnQjHEwDSgEBIypJITuYMxAlR0wRTQgIATZHbKx9PQNMMbBU+pCnA9AyVDlxBgMedhKlAC8PeCE1uk6DekxxpQpQT7NX9wBFBgASqwAS5gBJDSgAUCwGPQBI4zTYABNGAE2bAE3KAExdGABKaAbgAFBXAFCOAFBJABI2SWdObALDOq0//QomCZhvwHdTBkIQHCemEPgMNAG2ATwN7kvZBPIGPATKH34ZGg/OlZ0Ipi3eDO4m5C6igFsj9iqEBe5L9TzeC05RaQ9aC2YJ5DpkgU8DIgEOIowK3g06CG4Q9ArKbA3mEUYHOgPWSZsApgcCCxIdNhW2JhFirQsKOXgG/Br3C5AmsBMqev0F1BoiBk4BKhsAANAu6IWxWjJcHU9gBgQLJiPIFKlQIQ0mQLh4SRocBxYlqgKSQ3FKiFE3HpQh9zw+DWcuFFF9B/Y8BhlQC4I8n0asRQ8R0z6OPUkiSkwtBDaALDAnjAnQD4YMunxzAVoJIgmyDHITMhEYN8YIOgcaLpclJxYIIkaWYJsE+KAD9BPSAwwFQAlCBxQDthwuEy8VKgUOgSXYAvQ21i60ApBWgQEYBcwPJh/gEFFH4Q7qCJwCZgOEJewALhUiABginAhEZABgj9lTBi7MCMhqbSN1A2gU6GIRdAeSDlgHqBw0FcAc4nDJXgyGCSiksAlcAXYJmgFgBOQICjVcjKEgQmdUi1kYnCBiQUBd/QIyDGYVoES+h3kCjA9sEhwBNgF0BzoNAgJ4Ee4RbBCWCOyGBTW2M/k6JgRQIYQgEgooA1BszwsoJvoM+WoBpBJjAw00PnfvZ6xgtyUX/gcaMsZBYSHyC5NPzgydGsIYQ1QvGeUHwAP0GvQn60FYBgADpAQUOk4z7wS+C2oIjAlAAEoOpBgH2BhrCnKM0QEyjAG4mgNYkoQCcJAGOAcMAGgMiAV65gAeAqgIpAAGANADWAA6Aq4HngAaAIZCAT4DKDABIuYCkAOUCDLMAZYwAfQqBBzEDBYA+DhuSwLDsgKAa2ajBd5ZAo8CSjYBTiYEBk9IUgOwcuIA3ABMBhTgSAEWrEvMG+REAeBwLADIAPwABjYHBkIBzgH0bgC4AWALMgmjtLYBTuoqAIQAFmwB2AKKAN4ANgCA8gFUAE4FWvoF1AJQSgESMhksWGIBvAMgATQBDgB6BsyOpsoIIARuB9QCEBwV4gLvLwe2AgMi4BPOQsYCvd9WADIXUu5eZwqoCqdeaAC0YTQHMnM9UQAPH6k+yAdy/BZIiQImSwBQ5gBQQzSaNTFWSTYBpwGqKQK38AFtqwBI/wK37gK3rQK3sAK6280C0gK33AK3zxAAUEIAUD9SklKDArekArw5AEQAzAHCO147WTteO1k7XjtZO147WTteO1kDmChYI03AVU0oJqkKbV9GYewMpw3VRMk6ShPcYFJgMxPJLbgUwhXPJVcZPhq9JwYl5VUKDwUt1GYxCC00dhe9AEApaYNCY4ceMQpMHOhTklT5LRwAskujM7ANrRsWREEFSHXuYisWDwojAmSCAmJDXE6wXDchAqH4AmiZAmYKAp+FOBwMAmY8AmYnBG8EgAN/FAN+kzkHOXgYOYM6JCQCbB4CMjc4CwJtyAJtr/CLADRoRiwBaADfAOIASwYHmQyOAP8MwwAOtgJ3MAJ2o0ACeUxEAni7Hl3cRa9G9AJ8QAJ6yQJ9CgJ88UgBSH5kJQAsFklZSlwWGErNAtECAtDNSygDiFADh+dExpEzAvKiXQQDA69Lz0wuJgTQTU1NsAKLQAKK2cIcCB5EaAa4Ao44Ao5dQZiCAo7aAo5deVG1UzYLUtVUhgKT/AKTDQDqAB1VH1WwVdEHLBwplocy4nhnRTw6ApegAu+zWCKpAFomApaQApZ9nQCqWa1aCoJOADwClrYClk9cRVzSApnMApllXMtdCBoCnJw5wzqeApwXAp+cAp65iwAeEDIrEAKd8gKekwC2PmE1YfACntQCoG8BqgKeoCACnk+mY8lkKCYsAiewAiZ/AqD8AqBN2AKmMAKlzwKoAAB+AqfzaH1osgAESmodatICrOQCrK8CrWgCrQMCVx4CVd0CseLYAx9PbJgCsr4OArLpGGzhbWRtSWADJc4Ctl08QG6RAylGArhfArlIFgK5K3hwN3DiAr0aAy2zAzISAr6JcgMDM3ICvhtzI3NQAsPMAsMFc4N0TDZGdOEDPKgDPJsDPcACxX0CxkgCxhGKAshqUgLIRQLJUALJLwJkngLd03h6YniveSZL0QMYpGcDAmH1GfSVJXsMXpNevBICz2wCz20wTFTT9BSgAMeuAs90ASrrA04TfkwGAtwoAtuLAtJQA1JdA1NgAQIDVY2AikABzBfuYUZ2AILPg44C2sgC2d+EEYRKpz0DhqYAMANkD4ZyWvoAVgLfZgLeuXR4AuIw7RUB8zEoAfScAfLTiALr9ALpcXoAAur6AurlAPpIAboC7ooC652Wq5cEAu5AA4XhmHpw4XGiAvMEAGoDjheZlAL3FAORbwOSiAL3mQL52gL4Z5odmqy8OJsfA52EAv77ARwAOp8dn7QDBY4DpmsDptoA0sYDBmuhiaIGCgMMSgFgASACtgNGAJwEgLpoBgC8BGzAEowcggCEDC6kdjoAJAM0C5IKRoABZCgiAIzw3AYBLACkfng9ogigkgNmWAN6AEQCvrkEVqTGAwCsBRbAA+4iQkMCHR072jI2PTbUNsk2RjY5NvA23TZKNiU3EDcZN5I+RTxDRTBCJkK5VBYKFhZfwQCWygU3AJBRHpu+OytgNxa61A40GMsYjsn7BVwFXQVcBV0FaAVdBVwFXQVcBV0FXAVdBVwFXUsaCNyKAK4AAQUHBwKU7oICoW1e7jAEzgPxA+YDwgCkBFDAwADABKzAAOxFLhitA1UFTDeyPkM+bj51QkRCuwTQWWQ8X+0AWBYzsACNA8xwzAGm7EZ/QisoCTAbLDs6fnLfb8H2GccsbgFw13M1HAVkBW/Jxsm9CNRO8E8FDD0FBQw9FkcClOYCoMFegpDfADgcMiA2AJQACB8AsigKAIzIEAJKeBIApY5yPZQIAKQiHb4fvj5BKSRPQrZCOz0oXyxgOywfKAnGbgMClQaCAkILXgdeCD9IIGUgQj5fPoY+dT52Ao5CM0dAX9BTVG9SDzFwWTQAbxBzJF/lOEIQQglCCkKJIAls5AcClQICoKPMODEFxhi6KSAbiyfIRrMjtCgdWCAkPlFBIitCsEJRzAbMAV/OEyQzDg0OAQQEJ36i328/Mk9AybDJsQlq3tDRApUKAkFzXf1d/j9uALYP6hCoFgCTGD8kPsFKQiobrm0+zj0KSD8kPnVCRBwMDyJRTHFgMTJa5rwXQiQ2YfI/JD7BMEJEHGINTw4TOFlIRzwJO0icMQpyPyQ+wzJCRBv6DVgnKB01NgUKj2bwYzMqCoBkznBgEF+zYDIocwRIX+NgHj4HICNfh2C4CwdwFWpTG/lgUhYGAwRfv2Ts8mAaXzVgml/XYIJfuWC4HI1gUF9pYJZgMR6ilQHMAOwLAlDRefC0in4AXAEJA6PjCwc0IamOANMMCAECRQDFNRTZBgd+CwQlRA+r6+gLBDEFBnwUBXgKATIArwAGRAAHA3cDdAN2A3kDdwN9A3oDdQN7A30DfAN4A3oDfQAYEAAlAtYASwMAUAFsAHcKAHcAmgB3AHUAdQB2AHVu8UgAygDAAHcAdQB1AHYAdQALCgB3AAsAmgB3AAsCOwB3AAtu8UgAygDAAHgKAJoAdwB3AHUAdQB2AHUAeAB1AHUAdgB1bvFIAMoAwAALCgCaAHcACwB3AAsCOwB3AAtu8UgAygDAAH4ACwGgALcBpwC6AahdAu0COwLtbvFIAMoAwAALCgCaAu0ACwLtAAsCOwLtAAtu8UgAygDAA24ACwNvAAu0VsQAAzsAABCkjUIpAAsAUIusOggWcgMeBxVsGwL67U/2HlzmWOEeOgALASvuAAseAfpKUpnpGgYJDCIZM6YyARUE9ThqAD5iXQgnAJYJPnOzw0ZAEZxEKsIAkA4DhAHnTAIDxxUDK0lxCQlPYgIvIQVYJQBVqE1GakUAKGYiDToSBA1EtAYAXQJYAIF8GgMHRyAAIAjOe9YncekRAA0KACUrjwE7Ayc6AAYWAqaiKG4McEcqANoN3+Mg9TwCBhIkuCny+JwUQ29L008JluRxu3K+oAdqiHOqFH0AG5SUIfUJ5SxCGfxdipRzqTmT4V5Zb+r1Uo4Vm+NqSSEl2mNvR2JhIa8SpYO6ntdwFXHCWTCK8f2+Hxo7uiG3drDycAuKIMP5bhi06ACnqArH1rz4Rqg//lm6SgJGEVbF9xJHISaR6HxqxSnkw6shDnelHKNEfGUXSJRJ1GcsmtJw25xrZMDK9gXSm1/YMkdX4/6NKYOdtk/NQ3/NnDASjTc3fPjIjW/5sVfVObX2oTDWkr1dF9f3kxBsD3/3aQO8hPfRz+e0uEiJqt1161griu7gz8hDDwtpy+F+BWtefnKHZPAxcZoWbnznhJpy0e842j36bcNzGnIEusgGX0a8ZxsnjcSsPDZ09yZ36fCQbriHeQ72JRMILNl6ePPf2HWoVwgWAm1fb3V2sAY0+B6rAXqSwPBgseVmoqsBTSrm91+XasMYYySI8eeRxH3ZvHkMz3BQ5aJ3iUVbYPNM3/7emRtjlsMgv/9VyTsyt/mK+8fgWeT6SoFaclXqn42dAIsvAarF5vNNWHzKSkKQ/8Hfk5ZWK7r9yliOsooyBjRhfkHP4Q2DkWXQi6FG/9r/IwbmkV5T7JSopHKn1pJwm9tb5Ot0oyN1Z2mPpKXHTxx2nlK08fKk1hEYA8WgVVWL5lgx0iTv+KdojJeU23ZDjmiubXOxVXJKKi2Wjuh2HLZOFLiSC7Tls5SMh4f+Pj6xUSrNjFqLGehRNB8lC0QSLNmkJJx/wSG3MnjE9T1CkPwJI0wH2lfzwETIiVqUxg0dfu5q39Gt+hwdcxkhhNvQ4TyrBceof3Mhs/IxFci1HmHr4FMZgXEEczPiGCx0HRwzAqDq2j9AVm1kwN0mRVLWLylgtoPNapF5cY4Y1wJh/e0BBwZj44YgZrDNqvD/9Hv7GFYdUQeDJuQ3EWI4HaKqavU1XjC/n41kT4L79kqGq0kLhdTZvgP3TA3fS0ozVz+5piZsoOtIvBUFoMKbNcmBL6YxxaUAusHB38XrS8dQMnQwJfUUkpRoGr5AUeWicvBTzyK9g77+yCkf5PAysL7r/JjcZgrbvRpMW9iyaxZvKO6ceZN2EwIxKwVFPuvFuiEPGCoagbMo+SpydLrXqBzNCDGFCrO/rkcwa2xhokQZ5CdZ0AsU3JfSqJ6n5I14YA+P/uAgfhPU84Tlw7cEFfp7AEE8ey4sP12PTt4Cods1GRgDOB5xvyiR5m+Bx8O5nBCNctU8BevfV5A08x6RHd5jcwPTMDSZJOedIZ1cGQ704lxbAzqZOP05ZxaOghzSdvFBHYqomATARyAADK4elP8Ly3IrUZKfWh23Xy20uBUmLS4Pfagu9+oyVa2iPgqRP3F2CTUsvJ7+RYnN8fFZbU/HVvxvcFFDKkiTqV5UBZ3Gz54JAKByi9hkKMZJvuGgcSYXFmw08UyoQyVdfTD1/dMkCHXcTGAKeROgArsvmRrQTLUOXioOHGK2QkjHuoYFgXciZoTJd6Fs5q1QX1G+p/e26hYsEf7QZD1nnIyl/SFkNtYYmmBhpBrxl9WbY0YpHWRuw2Ll/tj9mD8P4snVzJl4F9J+1arVeTb9E5r2ILH04qStjxQNwn3m4YNqxmaNbLAqW2TN6LidwuJRqS+NXbtqxoeDXpxeGWmxzSkWxjkyCkX4NQRme6q5SAcC+M7+9ETfA/EwrzQajKakCwYyeunP6ZFlxU2oMEn1Pz31zeStW74G406ZJFCl1wAXIoUKkWotYEpOuXB1uVNxJ63dpJEqfxBeptwIHNrPz8BllZoIcBoXwgfJ+8VAUnVPvRvexnw0Ma/WiGYuJO5y8QTvEYBigFmhUxY5RqzE8OcywN/8m4UYrlaniJO75XQ6KSo9+tWHlu+hMi0UVdiKQp7NelnoZUzNaIyBPVeOwK6GNp+FfHuPOoyhaWuNvTYFkvxscMQWDh+zeFCFkgwbXftiV23ywJ4+uwRqmg9k3KzwIQpzppt8DBBOMbrqwQM5Gb05sEwdKzMiAqOloaA/lr0KA+1pr0/+HiWoiIjHA/wir2nIuS3PeU/ji3O6ZwoxcR1SZ9FhtLC5S0FIzFhbBWcGVP/KpxOPSiUoAdWUpqKH++6Scz507iCcxYI6rdMBICPJZea7OcmeFw5mObJSiqpjg2UoWNIs+cFhyDSt6geV5qgi3FunmwwDoGSMgerFOZGX1m0dMCYo5XOruxO063dwENK9DbnVM9wYFREzh4vyU1WYYJ/LRRp6oxgjqP/X5a8/4Af6p6NWkQferzBmXme0zY/4nwMJm/wd1tIqSwGz+E3xPEAOoZlJit3XddD7/BT1pllzOx+8bmQtANQ/S6fZexc6qi3W+Q2xcmXTUhuS5mpHQRvcxZUN0S5+PL9lXWUAaRZhEH8hTdAcuNMMCuVNKTEGtSUKNi3O6KhSaTzck8csZ2vWRZ+d7mW8c4IKwXIYd25S/zIftPkwPzufjEvOHWVD1m+FjpDVUTV0DGDuHj6QnaEwLu/dEgdLQOg9E1Sro9XHJ8ykLAwtPu+pxqKDuFexqON1sKQm7rwbE1E68UCfA/erovrTCG+DBSNg0l4goDQvZN6uNlbyLpcZAwj2UclycvLpIZMgv4yRlpb3YuMftozorbcGVHt/VeDV3+Fdf1TP0iuaCsPi2G4XeGhsyF1ubVDxkoJhmniQ0/jSg/eYML9KLfnCFgISWkp91eauR3IQvED0nAPXK+6hPCYs+n3+hCZbiskmVMG2da+0EsZPonUeIY8EbfusQXjsK/eFDaosbPjEfQS0RKG7yj5GG69M7MeO1HmiUYocgygJHL6M1qzUDDwUSmr99V7Sdr2F3JjQAJY+F0yH33Iv3+C9M38eML7gTgmNu/r2bUMiPvpYbZ6v1/IaESirBHNa7mPKn4dEmYg7v/+HQgPN1G79jBQ1+soydfDC2r+h2Bl/KIc5KjMK7OH6nb1jLsNf0EHVe2KBiE51ox636uyG6Lho0t3J34L5QY/ilE3mikaF4HKXG1mG1rCevT1Vv6GavltxoQe/bMrpZvRggnBxSEPEeEzkEdOxTnPXHVjUYdw8JYvjB/o7Eegc3Ma+NUxLLnsK0kJlinPmUHzHGtrk5+CAbVzFOBqpyy3QVUnzTDfC/0XD94/okH+OB+i7g9lolhWIjSnfIb+Eq43ZXOWmwvjyV/qqD+t0e+7mTEM74qP/Ozt8nmC7mRpyu63OB4KnUzFc074SqoyPUAgM+/TJGFo6T44EHnQU4X4z6qannVqgw/U7zCpwcmXV1AubIrvOmkKHazJAR55ePjp5tLBsN8vAqs3NAHdcEHOR2xQ0lsNAFzSUuxFQCFYvXLZJdOj9p4fNq6p0HBGUik2YzaI4xySy91KzhQ0+q1hjxvImRwPRf76tChlRkhRCi74NXZ9qUNeIwP+s5p+3m5nwPdNOHgSLD79n7O9m1n1uDHiMntq4nkYwV5OZ1ENbXxFd4PgrlvavZsyUO4MqYlqqn1O8W/I1dEZq5dXhrbETLaZIbC2Kj/Aa/QM+fqUOHdf0tXAQ1huZ3cmWECWSXy/43j35+Mvq9xws7JKseriZ1pEWKc8qlzNrGPUGcVgOa9cPJYIJsGnJTAUsEcDOEVULO5x0rXBijc1lgXEzQQKhROf8zIV82w8eswc78YX11KYLWQRcgHNJElBxfXr72lS2RBSl07qTKorO2uUDZr3sFhYsvnhLZn0A94KRzJ/7DEGIAhW5ZWFpL8gEwu1aLA9MuWZzNwl8Oze9Y+bX+v9gywRVnoB5I/8kXTXU3141yRLYrIOOz6SOnyHNy4SieqzkBXharjfjqq1q6tklaEbA8Qfm2DaIPs7OTq/nvJBjKfO2H9bH2cCMh1+5gspfycu8f/cuuRmtDjyqZ7uCIMyjdV3a+p3fqmXsRx4C8lujezIFHnQiVTXLXuI1XrwN3+siYYj2HHTvESUx8DlOTXpak9qFRK+L3mgJ1WsD7F4cu1aJoFoYQnu+wGDMOjJM3kiBQWHCcvhJ/HRdxodOQp45YZaOTA22Nb4XKCVxqkbwMYFhzYQYIAnCW8FW14uf98jhUG2zrKhQQ0q0CEq0t5nXyvUyvR8DvD69LU+g3i+HFWQMQ8PqZuHD+sNKAV0+M6EJC0szq7rEr7B5bQ8BcNHzvDMc9eqB5ZCQdTf80Obn4uzjwpYU7SISdtV0QGa9D3Wrh2BDQtpBKxaNFV+/Cy2P/Sv+8s7Ud0Fd74X4+o/TNztWgETUapy+majNQ68Lq3ee0ZO48VEbTZYiH1Co4OlfWef82RWeyUXo7woM03PyapGfikTnQinoNq5z5veLpeMV3HCAMTaZmA1oGLAn7XS3XYsz+XK7VMQsc4XKrmDXOLU/pSXVNUq8dIqTba///3x6LiLS6xs1xuCAYSfcQ3+rQgmu7uvf3THKt5Ooo97TqcbRqxx7EASizaQCBQllG/rYxVapMLgtLbZS64w1MDBMXX+PQpBKNwqUKOf2DDRDUXQf9EhOS0Qj4nTmlA8dzSLz/G1d+Ud8MTy/6ghhdiLpeerGY/UlDOfiuqFsMUU5/UYlP+BAmgRLuNpvrUaLlVkrqDievNVEAwF+4CoM1MZTmjxjJMsKJq+u8Zd7tNCUFy6LiyYXRJQ4VyvEQFFaCGKsxIwQkk7EzZ6LTJq2hUuPhvAW+gQnSG6J+MszC+7QCRHcnqDdyNRJ6T9xyS87A6MDutbzKGvGktpbXqtzWtXb9HsfK2cBMomjN9a4y+TaJLnXxAeX/HWzmf4cR4vALt/P4w4qgKY04ml4ZdLOinFYS6cup3G/1ie4+t1eOnpBNlqGqs75ilzkT4+DsZQxNvaSKJ//6zIbbk/M7LOhFmRc/1R+kBtz7JFGdZm/COotIdvQoXpTqP/1uqEUmCb/QWoGLMwO5ANcHzxdY48IGP5+J+zKOTBFZ4Pid+GTM+Wq12MV/H86xEJptBa6T+p3kgpwLedManBHC2GgNrFpoN2xnrMz9WFWX/8/ygSBkavq2Uv7FdCsLEYLu9LLIvAU0bNRDtzYl+/vXmjpIvuJFYjmI0im6QEYqnIeMsNjXG4vIutIGHijeAG/9EDBozKV5cldkHbLxHh25vT+ZEzbhXlqvpzKJwcEgfNwLAKFeo0/pvEE10XDB+EXRTXtSzJozQKFFAJhMxYkVaCW+E9AL7tMeU8acxidHqzb6lX4691UsDpy/LLRmT+epgW56+5Cw8tB4kMUv6s9lh3eRKbyGs+H/4mQMaYzPTf2OOdokEn+zzgvoD3FqNKk8QqGAXVsqcGdXrT62fSPkR2vROFi68A6se86UxRUk4cajfPyCC4G5wDhD+zNq4jodQ4u4n/m37Lr36n4LIAAsVr02dFi9AiwA81MYs2rm4eDlDNmdMRvEKRHfBwW5DdMNp0jPFZMeARqF/wL4XBfd+EMLBfMzpH5GH6NaW+1vrvMdg+VxDzatk3MXgO3ro3P/DpcC6+Mo4MySJhKJhSR01SGGGp5hPWmrrUgrv3lDnP+HhcI3nt3YqBoVAVTBAQT5iuhTg8nvPtd8ZeYj6w1x6RqGUBrSku7+N1+BaasZvjTk64RoIDlL8brpEcJx3OmY7jLoZsswdtmhfC/G21llXhITOwmvRDDeTTPbyASOa16cF5/A1fZAidJpqju3wYAy9avPR1ya6eNp9K8XYrrtuxlqi+bDKwlfrYdR0RRiKRVTLOH85+ZY7XSmzRpfZBJjaTa81VDcJHpZnZnSQLASGYW9l51ZV/h7eVzTi3Hv6hUsgc/51AqJRTkpbFVLXXszoBL8nBX0u/0jBLT8nH+fJePbrwURT58OY+UieRjd1vs04w0VG5VN2U6MoGZkQzKN/ptz0Q366dxoTGmj7i1NQGHi9GgnquXFYdrCfZBmeb7s0T6yrdlZH5cZuwHFyIJ/kAtGsTg0xH5taAAq44BAk1CPk9KVVbqQzrCUiFdF/6gtlPQ8bHHc1G1W92MXGZ5HEHftyLYs8mbD/9xYRUWkHmlM0zC2ilJlnNgV4bfALpQghxOUoZL7VTqtCHIaQSXm+YUMnpkXybnV+A6xlm2CVy8fn0Xlm2XRa0+zzOa21JWWmixfiPMSCZ7qA4rS93VN3pkpF1s5TonQjisHf7iU9ZGvUPOAKZcR1pbeVf/Ul7OhepGCaId9wOtqo7pJ7yLcBZ0pFkOF28y4zEI/kcUNmutBHaQpBdNM8vjCS6HZRokkeo88TBAjGyG7SR+6vUgTcyK9Imalj0kuxz0wmK+byQU11AiJFk/ya5dNduRClcnU64yGu/ieWSeOos1t3ep+RPIWQ2pyTYVbZltTbsb7NiwSi3AV+8KLWk7LxCnfZUetEM8ThnsSoGH38/nyAwFguJp8FjvlHtcWZuU4hPva0rHfr0UhOOJ/F6vS62FW7KzkmRll2HEc7oUq4fyi5T70Vl7YVIfsPHUCdHesf9Lk7WNVWO75JDkYbMI8TOW8JKVtLY9d6UJRITO8oKo0xS+o99Yy04iniGHAaGj88kEWgwv0OrHdY/nr76DOGNS59hXCGXzTKUvDl9iKpLSWYN1lxIeyywdNpTkhay74w2jFT6NS8qkjo5CxA1yfSYwp6AJIZNKIeEK5PJAW7ORgWgwp0VgzYpqovMrWxbu+DGZ6Lhie1RAqpzm8VUzKJOH3mCzWuTOLsN3VT/dv2eeYe9UjbR8YTBsLz7q60VN1sU51k+um1f8JxD5pPhbhSC8rRaB454tmh6YUWrJI3+GWY0qeWioj/tbkYITOkJaeuGt4JrJvHA+l0Gu7kY7XOaa05alMnRWVCXqFgLIwSY4uF59Ue5SU4QKuc/HamDxbr0x6csCetXGoP7Qn1Bk/J9DsynO/UD6iZ1Hyrz+jit0hDCwi/E9OjgKTbB3ZQKQ/0ZOvevfNHG0NK4Aj3Cp7NpRk07RT1i/S0EL93Ag8GRgKI9CfpajKyK6+Jj/PI1KO5/85VAwz2AwzP8FTBb075IxCXv6T9RVvWT2tUaqxDS92zrGUbWzUYk9mSs82pECH+fkqsDt93VW++4YsR/dHCYcQSYTO/KaBMDj9LSD/J/+z20Kq8XvZUAIHtm9hRPP3ItbuAu2Hm5lkPs92pd7kCxgRs0xOVBnZ13ccdA0aunrwv9SdqElJRC3g+oCu+nXyCgmXUs9yMjTMAIHfxZV+aPKcZeUBWt057Xo85Ks1Ir5gzEHCWqZEhrLZMuF11ziGtFQUds/EESajhagzcKsxamcSZxGth4UII+adPhQkUnx2WyN+4YWR+r3f8MnkyGFuR4zjzxJS8WsQYR5PTyRaD9ixa6Mh741nBHbzfjXHskGDq179xaRNrCIB1z1xRfWfjqw2pHc1zk9xlPpL8sQWAIuETZZhbnmL54rceXVNRvUiKrrqIkeogsl0XXb17ylNb0f4GA9Wd44vffEG8FSZGHEL2fbaTGRcSiCeA8PmA/f6Hz8HCS76fXUHwgwkzSwlI71ekZ7Fapmlk/KC+Hs8hUcw3N2LN5LhkVYyizYFl/uPeVP5lsoJHhhfWvvSWruCUW1ZcJOeuTbrDgywJ/qG07gZJplnTvLcYdNaH0KMYOYMGX+rB4NGPFmQsNaIwlWrfCezxre8zXBrsMT+edVLbLqN1BqB76JH4BvZTqUIMfGwPGEn+EnmTV86fPBaYbFL3DFEhjB45CewkXEAtJxk4/Ms2pPXnaRqdky0HOYdcUcE2zcXq4vaIvW2/v0nHFJH2XXe22ueDmq/18XGtELSq85j9X8q0tcNSSKJIX8FTuJF/Pf8j5PhqG2u+osvsLxYrvvfeVJL+4tkcXcr9JV7v0ERmj/X6fM3NC4j6dS1+9Umr2oPavqiAydTZPLMNRGY23LO9zAVDly7jD+70G5TPPLdhRIl4WxcYjLnM+SNcJ26FOrkrISUtPObIz5Zb3AG612krnpy15RMW+1cQjlnWFI6538qky9axd2oJmHIHP08KyP0ubGO+TQNOYuv2uh17yCIvR8VcStw7o1g0NM60sk+8Tq7YfIBJrtp53GkvzXH7OA0p8/n/u1satf/VJhtR1l8Wa6Gmaug7haSpaCaYQax6ta0mkutlb+eAOSG1aobM81D9A4iS1RRlzBBoVX6tU1S6WE2N9ORY6DfeLRC4l9Rvr5h95XDWB2mR1d4WFudpsgVYwiTwT31ljskD8ZyDOlm5DkGh9N/UB/0AI5Xvb8ZBmai2hQ4BWMqFwYnzxwB26YHSOv9WgY3JXnvoN+2R4rqGVh/LLDMtpFP+SpMGJNWvbIl5SOodbCczW2RKleksPoUeGEzrjtKHVdtZA+kfqO+rVx/iclCqwoopepvJpSTDjT+b9GWylGRF8EDbGlw6eUzmJM95Ovoz+kwLX3c2fTjFeYEsE7vUZm3mqdGJuKh2w9/QGSaqRHs99aScGOdDqkFcACoqdbBoQqqjamhH6Q9ng39JCg3lrGJwd50Qk9ovnqBTr8MME7Ps2wiVfygUmPoUBJJfJWX5Nda0nuncbFkA==")),Vs=new Set(Ts(Zs)),Ws=new Set(Ts(Zs)),Xs=function(t){for(var e=[];;){var r=t();if(0==r)break;e.push(Gs(r,t))}for(;;){var n=t()-1;if(n<0)break;e.push(Hs(n,t))}return function(t){for(var e={},r=0;r<t.length;r++){var n=t[r];e[n[0]]=n[1]}return e}(Ns(e))}(Zs),$s=(zs=Ts(Js=Zs).sort((function(t,e){return t-e})),function t(){for(var e=[];;){var r=Ts(Js,zs);if(0==r.length)break;e.push({set:new Set(r),node:t()})}e.sort((function(t,e){return e.set.size-t.set.size}));var n=Js();return{branches:e,valid:n%3,fe0f:!!(1&(n=n/3|0)),save:1==(n>>=1),check:2==n}}());function tc(t){return St(t)}function ec(t){return t.filter((function(t){return 65039!=t}))}function rc(t){var e,r=function(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=Ks(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw o}}}}(t.split("."));try{for(r.s();!(e=r.n()).done;){var n=e.value,i=tc(n);try{for(var o=i.lastIndexOf(95)-1;o>=0;o--)if(95!==i[o])throw new Error("underscore only allowed at start");if(i.length>=4&&i.every((function(t){return t<128}))&&45===i[2]&&45===i[3])throw new Error("invalid label extension")}catch(t){throw new Error('Invalid label "'.concat(n,'": ').concat(t.message))}}}catch(t){r.e(t)}finally{r.f()}return t}function nc(t){return rc(function(t,e){var r=tc(t).reverse(),n=[];for(;r.length;){var i=ic(r);if(i)n.push.apply(n,Ys(e(i)));else{var o=r.pop();if(Vs.has(o))n.push(o);else if(!Ws.has(o)){var a=Xs[o];if(!a)throw new Error("Disallowed codepoint: 0x".concat(o.toString(16).toUpperCase()));n.push.apply(n,Ys(a))}}}return rc((s=String.fromCodePoint.apply(String,n),s.normalize("NFC")));var s}(t,ec))}function ic(t,e){var r,n,i,o=$s,a=[],s=t.length;e&&(e.length=0);for(var c=function(){var c=t[--s];if(!(o=null===(r=o.branches.find((function(t){return t.set.has(c)})))||void 0===r?void 0:r.node))return"break";if(o.save)i=c;else if(o.check&&c===i)return"break";a.push(c),o.fe0f&&(a.push(65039),s>0&&65039==t[s-1]&&s--),o.valid&&(n=a.slice(),2==o.valid&&n.splice(1,1),e&&e.push.apply(e,Ys(t.slice(s).reverse())),t.length=s)};s;){if("break"===c())break}return n}var oc=new h.b("hash/5.7.0"),ac=new Uint8Array(32);function sc(t){if(0===t.length)throw new Error("invalid ENS name; empty component");return t}function cc(t){var e=Ct(nc(t)),r=[];if(0===t.length)return r;for(var n=0,i=0;i<e.length;i++){46===e[i]&&(r.push(sc(e.slice(n,i))),n=i+1)}if(n>=e.length)throw new Error("invalid ENS name; empty component");return r.push(sc(e.slice(n))),r}function Ac(t){try{return 0!==cc(t).length}catch(t){}return!1}function uc(t){"string"!=typeof t&&oc.throwArgumentError("invalid ENS name; not a string","name",t);for(var e=ac,r=cc(t);r.length;)e=V(Object(A.b)([e,V(r.pop())]));return Object(A.i)(e)}function fc(t){return Object(A.i)(Object(A.b)(cc(t).map((function(t){if(t.length>63)throw new Error("invalid DNS encoded entry; length exceeds 63 bytes");var e=new Uint8Array(t.length+1);return e.set(t,1),e[0]=e.length-1,e}))))+"00"}ac.fill(0);function hc(t){return(hc="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function lc(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */lc=function(){return t};var t={},e=Object.prototype,r=e.hasOwnProperty,n=Object.defineProperty||function(t,e,r){t[e]=r.value},i="function"==typeof Symbol?Symbol:{},o=i.iterator||"@@iterator",a=i.asyncIterator||"@@asyncIterator",s=i.toStringTag||"@@toStringTag";function c(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{c({},"")}catch(t){c=function(t,e,r){return t[e]=r}}function A(t,e,r,i){var o=e&&e.prototype instanceof h?e:h,a=Object.create(o.prototype),s=new B(i||[]);return n(a,"_invoke",{value:E(t,r,s)}),a}function u(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=A;var f={};function h(){}function l(){}function d(){}var g={};c(g,o,(function(){return this}));var p=Object.getPrototypeOf,y=p&&p(p(Q([])));y&&y!==e&&r.call(y,o)&&(g=y);var I=d.prototype=h.prototype=Object.create(g);function b(t){["next","throw","return"].forEach((function(e){c(t,e,(function(t){return this._invoke(e,t)}))}))}function v(t,e){var i;n(this,"_invoke",{value:function(n,o){function a(){return new e((function(i,a){!function n(i,o,a,s){var c=u(t[i],t,o);if("throw"!==c.type){var A=c.arg,f=A.value;return f&&"object"==hc(f)&&r.call(f,"__await")?e.resolve(f.__await).then((function(t){n("next",t,a,s)}),(function(t){n("throw",t,a,s)})):e.resolve(f).then((function(t){A.value=t,a(A)}),(function(t){return n("throw",t,a,s)}))}s(c.arg)}(n,o,i,a)}))}return i=i?i.then(a,a):a()}})}function E(t,e,r){var n="suspendedStart";return function(i,o){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===i)throw o;return k()}for(r.method=i,r.arg=o;;){var a=r.delegate;if(a){var s=m(a,r);if(s){if(s===f)continue;return s}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var c=u(t,e,r);if("normal"===c.type){if(n=r.done?"completed":"suspendedYield",c.arg===f)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(n="completed",r.method="throw",r.arg=c.arg)}}}function m(t,e){var r=e.method,n=t.iterator[r];if(void 0===n)return e.delegate=null,"throw"===r&&t.iterator.return&&(e.method="return",e.arg=void 0,m(t,e),"throw"===e.method)||"return"!==r&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+r+"' method")),f;var i=u(n,t.iterator,e.arg);if("throw"===i.type)return e.method="throw",e.arg=i.arg,e.delegate=null,f;var o=i.arg;return o?o.done?(e[t.resultName]=o.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,f):o:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,f)}function C(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function w(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function B(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(C,this),this.reset(!0)}function Q(t){if(t){var e=t[o];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,i=function e(){for(;++n<t.length;)if(r.call(t,n))return e.value=t[n],e.done=!1,e;return e.value=void 0,e.done=!0,e};return i.next=i}}return{next:k}}function k(){return{value:void 0,done:!0}}return l.prototype=d,n(I,"constructor",{value:d,configurable:!0}),n(d,"constructor",{value:l,configurable:!0}),l.displayName=c(d,s,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===l||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,d):(t.__proto__=d,c(t,s,"GeneratorFunction")),t.prototype=Object.create(I),t},t.awrap=function(t){return{__await:t}},b(v.prototype),c(v.prototype,a,(function(){return this})),t.AsyncIterator=v,t.async=function(e,r,n,i,o){void 0===o&&(o=Promise);var a=new v(A(e,r,n,i),o);return t.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},b(I),c(I,s,"Generator"),c(I,o,(function(){return this})),c(I,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},t.values=Q,B.prototype={constructor:B,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(w),!t)for(var e in this)"t"===e.charAt(0)&&r.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function n(r,n){return a.type="throw",a.arg=t,e.next=r,n&&(e.method="next",e.arg=void 0),!!n}for(var i=this.tryEntries.length-1;i>=0;--i){var o=this.tryEntries[i],a=o.completion;if("root"===o.tryLoc)return n("end");if(o.tryLoc<=this.prev){var s=r.call(o,"catchLoc"),c=r.call(o,"finallyLoc");if(s&&c){if(this.prev<o.catchLoc)return n(o.catchLoc,!0);if(this.prev<o.finallyLoc)return n(o.finallyLoc)}else if(s){if(this.prev<o.catchLoc)return n(o.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return n(o.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&r.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var o=i;break}}o&&("break"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc&&(o=null);var a=o?o.completion:{};return a.type=t,a.arg=e,o?(this.method="next",this.next=o.finallyLoc,f):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),f},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),w(r),f}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var i=n.arg;w(r)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:Q(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),f}},t}var dc=function(t,e,r,n){return new(r||(r=Promise))((function(i,o){function a(t){try{c(n.next(t))}catch(t){o(t)}}function s(t){try{c(n.throw(t))}catch(t){o(t)}}function c(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(a,s)}c((n=n.apply(t,e||[])).next())}))};function gc(t,e){return dc(this,void 0,void 0,lc().mark((function r(){var n,i,o,a,s;return lc().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return null==e&&(e={}),n={method:e.method||"GET",headers:e.headers||{},body:e.body||void 0},!0!==e.skipFetchSetup&&(n.mode="cors",n.cache="no-cache",n.credentials="same-origin",n.redirect="follow",n.referrer="client"),null!=e.fetchOptions&&((i=e.fetchOptions).mode&&(n.mode=i.mode),i.cache&&(n.cache=i.cache),i.credentials&&(n.credentials=i.credentials),i.redirect&&(n.redirect=i.redirect),i.referrer&&(n.referrer=i.referrer)),r.next=7,fetch(t,n);case 7:return o=r.sent,r.next=10,o.arrayBuffer();case 10:return a=r.sent,s={},o.headers.forEach?o.headers.forEach((function(t,e){s[e.toLowerCase()]=t})):o.headers.keys().forEach((function(t){s[t.toLowerCase()]=o.headers.get(t)})),r.abrupt("return",{headers:s,statusCode:o.status,statusMessage:o.statusText,body:Object(A.a)(new Uint8Array(a))});case 14:case"end":return r.stop()}}),r)})))}function pc(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */pc=function(){return t};var t={},e=Object.prototype,r=e.hasOwnProperty,n=Object.defineProperty||function(t,e,r){t[e]=r.value},i="function"==typeof Symbol?Symbol:{},o=i.iterator||"@@iterator",a=i.asyncIterator||"@@asyncIterator",s=i.toStringTag||"@@toStringTag";function c(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{c({},"")}catch(t){c=function(t,e,r){return t[e]=r}}function A(t,e,r,i){var o=e&&e.prototype instanceof h?e:h,a=Object.create(o.prototype),s=new B(i||[]);return n(a,"_invoke",{value:E(t,r,s)}),a}function u(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=A;var f={};function h(){}function l(){}function d(){}var g={};c(g,o,(function(){return this}));var p=Object.getPrototypeOf,y=p&&p(p(Q([])));y&&y!==e&&r.call(y,o)&&(g=y);var I=d.prototype=h.prototype=Object.create(g);function b(t){["next","throw","return"].forEach((function(e){c(t,e,(function(t){return this._invoke(e,t)}))}))}function v(t,e){var i;n(this,"_invoke",{value:function(n,o){function a(){return new e((function(i,a){!function n(i,o,a,s){var c=u(t[i],t,o);if("throw"!==c.type){var A=c.arg,f=A.value;return f&&"object"==yc(f)&&r.call(f,"__await")?e.resolve(f.__await).then((function(t){n("next",t,a,s)}),(function(t){n("throw",t,a,s)})):e.resolve(f).then((function(t){A.value=t,a(A)}),(function(t){return n("throw",t,a,s)}))}s(c.arg)}(n,o,i,a)}))}return i=i?i.then(a,a):a()}})}function E(t,e,r){var n="suspendedStart";return function(i,o){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===i)throw o;return k()}for(r.method=i,r.arg=o;;){var a=r.delegate;if(a){var s=m(a,r);if(s){if(s===f)continue;return s}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var c=u(t,e,r);if("normal"===c.type){if(n=r.done?"completed":"suspendedYield",c.arg===f)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(n="completed",r.method="throw",r.arg=c.arg)}}}function m(t,e){var r=e.method,n=t.iterator[r];if(void 0===n)return e.delegate=null,"throw"===r&&t.iterator.return&&(e.method="return",e.arg=void 0,m(t,e),"throw"===e.method)||"return"!==r&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+r+"' method")),f;var i=u(n,t.iterator,e.arg);if("throw"===i.type)return e.method="throw",e.arg=i.arg,e.delegate=null,f;var o=i.arg;return o?o.done?(e[t.resultName]=o.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,f):o:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,f)}function C(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function w(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function B(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(C,this),this.reset(!0)}function Q(t){if(t){var e=t[o];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,i=function e(){for(;++n<t.length;)if(r.call(t,n))return e.value=t[n],e.done=!1,e;return e.value=void 0,e.done=!0,e};return i.next=i}}return{next:k}}function k(){return{value:void 0,done:!0}}return l.prototype=d,n(I,"constructor",{value:d,configurable:!0}),n(d,"constructor",{value:l,configurable:!0}),l.displayName=c(d,s,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===l||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,d):(t.__proto__=d,c(t,s,"GeneratorFunction")),t.prototype=Object.create(I),t},t.awrap=function(t){return{__await:t}},b(v.prototype),c(v.prototype,a,(function(){return this})),t.AsyncIterator=v,t.async=function(e,r,n,i,o){void 0===o&&(o=Promise);var a=new v(A(e,r,n,i),o);return t.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},b(I),c(I,s,"Generator"),c(I,o,(function(){return this})),c(I,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},t.values=Q,B.prototype={constructor:B,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(w),!t)for(var e in this)"t"===e.charAt(0)&&r.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function n(r,n){return a.type="throw",a.arg=t,e.next=r,n&&(e.method="next",e.arg=void 0),!!n}for(var i=this.tryEntries.length-1;i>=0;--i){var o=this.tryEntries[i],a=o.completion;if("root"===o.tryLoc)return n("end");if(o.tryLoc<=this.prev){var s=r.call(o,"catchLoc"),c=r.call(o,"finallyLoc");if(s&&c){if(this.prev<o.catchLoc)return n(o.catchLoc,!0);if(this.prev<o.finallyLoc)return n(o.finallyLoc)}else if(s){if(this.prev<o.catchLoc)return n(o.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return n(o.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&r.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var o=i;break}}o&&("break"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc&&(o=null);var a=o?o.completion:{};return a.type=t,a.arg=e,o?(this.method="next",this.next=o.finallyLoc,f):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),f},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),w(r),f}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var i=n.arg;w(r)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:Q(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),f}},t}function yc(t){return(yc="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var Ic=function(t,e,r,n){return new(r||(r=Promise))((function(i,o){function a(t){try{c(n.next(t))}catch(t){o(t)}}function s(t){try{c(n.throw(t))}catch(t){o(t)}}function c(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(a,s)}c((n=n.apply(t,e||[])).next())}))},bc=new h.b("web/5.7.1");function vc(t){return new Promise((function(e){setTimeout(e,t)}))}function Ec(t,e){if(null==t)return null;if("string"==typeof t)return t;if(Object(A.k)(t)){if(e&&("text"===e.split("/")[0]||"application/json"===e.split(";")[0].trim()))try{return kt(t)}catch(t){}return Object(A.i)(t)}return t}function mc(t,e,r){var n="object"===yc(t)&&null!=t.throttleLimit?t.throttleLimit:12;bc.assertArgument(n>0&&n%1==0,"invalid connection throttle limit","connection.throttleLimit",n);var i="object"===yc(t)?t.throttleCallback:null,o="object"===yc(t)&&"number"==typeof t.throttleSlotInterval?t.throttleSlotInterval:100;bc.assertArgument(o>0&&o%1==0,"invalid connection throttle slot interval","connection.throttleSlotInterval",o);var a="object"===yc(t)&&!!t.errorPassThrough,s={},c=null,A={method:"GET"},u=!1,f=12e4;if("string"==typeof t)c=t;else if("object"===yc(t)){if(null!=t&&null!=t.url||bc.throwArgumentError("missing URL","connection.url",t),c=t.url,"number"==typeof t.timeout&&t.timeout>0&&(f=t.timeout),t.headers)for(var l in t.headers)s[l.toLowerCase()]={key:l,value:String(t.headers[l])},["if-none-match","if-modified-since"].indexOf(l.toLowerCase())>=0&&(u=!0);if(A.allowGzip=!!t.allowGzip,null!=t.user&&null!=t.password){"https:"!==c.substring(0,6)&&!0!==t.allowInsecureAuthentication&&bc.throwError("basic authentication requires a secure https url",h.b.errors.INVALID_ARGUMENT,{argument:"url",url:c,user:t.user,password:"[REDACTED]"});var d=t.user+":"+t.password;s.authorization={key:"Authorization",value:"Basic "+Os(Ct(d))}}null!=t.skipFetchSetup&&(A.skipFetchSetup=!!t.skipFetchSetup),null!=t.fetchOptions&&(A.fetchOptions=O(t.fetchOptions))}var g,p=new RegExp("^data:([^;:]*)?(;base64)?,(.*)$","i"),y=c?c.match(p):null;if(y)try{var I={statusCode:200,statusMessage:"OK",headers:{"content-type":y[1]||"text/plain"},body:y[2]?Rs(y[3]):(g=y[3],Ct(g.replace(/%([0-9a-f][0-9a-f])/gi,(function(t,e){return String.fromCharCode(parseInt(e,16))}))))},b=I.body;return r&&(b=r(I.body,I)),Promise.resolve(b)}catch(t){bc.throwError("processing response error",h.b.errors.SERVER_ERROR,{body:Ec(y[1],y[2]),error:t,requestBody:null,requestMethod:"GET",url:c})}e&&(A.method="POST",A.body=e,null==s["content-type"]&&(s["content-type"]={key:"Content-Type",value:"application/octet-stream"}),null==s["content-length"]&&(s["content-length"]={key:"Content-Length",value:String(e.length)}));var v={};Object.keys(s).forEach((function(t){var e=s[t];v[e.key]=e.value})),A.headers=v;var E,m=(E=null,{promise:new Promise((function(t,e){f&&(E=setTimeout((function(){null!=E&&(E=null,e(bc.makeError("timeout",h.b.errors.TIMEOUT,{requestBody:Ec(A.body,v["content-type"]),requestMethod:A.method,timeout:f,url:c})))}),f))})),cancel:function(){null!=E&&(clearTimeout(E),E=null)}}),C=function(){return Ic(this,void 0,void 0,pc().mark((function t(){var e,s,f,l,d,g,p,y,I,b;return pc().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:e=0;case 1:if(!(e<n)){t.next=65;break}return s=null,t.prev=3,t.next=6,gc(c,A);case 6:if(s=t.sent,!(e<n)){t.next=28;break}if(301!==s.statusCode&&302!==s.statusCode){t.next=15;break}if(f=s.headers.location||"","GET"!==A.method||!f.match(/^https:/)){t.next=13;break}return c=s.headers.location,t.abrupt("continue",62);case 13:t.next=28;break;case 15:if(429!==s.statusCode){t.next=28;break}if(l=!0,!i){t.next=21;break}return t.next=20,i(e,c);case 20:l=t.sent;case 21:if(!l){t.next=28;break}return d=0,g=s.headers["retry-after"],d="string"==typeof g&&g.match(/^[1-9][0-9]*$/)?1e3*parseInt(g):o*parseInt(String(Math.random()*Math.pow(2,e))),t.next=27,vc(d);case 27:return t.abrupt("continue",62);case 28:t.next=34;break;case 30:t.prev=30,t.t0=t.catch(3),null==(s=t.t0.response)&&(m.cancel(),bc.throwError("missing response",h.b.errors.SERVER_ERROR,{requestBody:Ec(A.body,v["content-type"]),requestMethod:A.method,serverError:t.t0,url:c}));case 34:if(p=s.body,u&&304===s.statusCode?p=null:!a&&(s.statusCode<200||s.statusCode>=300)&&(m.cancel(),bc.throwError("bad response",h.b.errors.SERVER_ERROR,{status:s.statusCode,headers:s.headers,body:Ec(p,s.headers?s.headers["content-type"]:null),requestBody:Ec(A.body,v["content-type"]),requestMethod:A.method,url:c})),!r){t.next=60;break}return t.prev=37,t.next=40,r(p,s);case 40:return y=t.sent,m.cancel(),t.abrupt("return",y);case 45:if(t.prev=45,t.t1=t.catch(37),!(t.t1.throttleRetry&&e<n)){t.next=58;break}if(I=!0,!i){t.next=53;break}return t.next=52,i(e,c);case 52:I=t.sent;case 53:if(!I){t.next=58;break}return b=o*parseInt(String(Math.random()*Math.pow(2,e))),t.next=57,vc(b);case 57:return t.abrupt("continue",62);case 58:m.cancel(),bc.throwError("processing response error",h.b.errors.SERVER_ERROR,{body:Ec(p,s.headers?s.headers["content-type"]:null),error:t.t1,requestBody:Ec(A.body,v["content-type"]),requestMethod:A.method,url:c});case 60:return m.cancel(),t.abrupt("return",p);case 62:e++,t.next=1;break;case 65:return t.abrupt("return",bc.throwError("failed response",h.b.errors.SERVER_ERROR,{requestBody:Ec(A.body,v["content-type"]),requestMethod:A.method,url:c}));case 66:case"end":return t.stop()}}),t,null,[[3,30],[37,45]])})))}();return Promise.race([m.promise,C])}function Cc(t,e,r){var n=null;if(null!=e){n=Ct(e);var i="string"==typeof t?{url:t}:O(t);if(i.headers)0!==Object.keys(i.headers).filter((function(t){return"content-type"===t.toLowerCase()})).length||(i.headers=O(i.headers),i.headers["content-type"]="application/json");else i.headers={"content-type":"application/json"};t=i}return mc(t,n,(function(t,e){var n=null;if(null!=t)try{n=JSON.parse(kt(t))}catch(e){bc.throwError("invalid JSON",h.b.errors.SERVER_ERROR,{body:t,error:e})}return r&&(n=r(n,e)),n}))}function wc(t,e){return e||(e={}),null==(e=O(e)).floor&&(e.floor=0),null==e.ceiling&&(e.ceiling=1e4),null==e.interval&&(e.interval=250),new Promise((function(r,n){var i=null,o=!1,a=function(){return!o&&(o=!0,i&&clearTimeout(i),!0)};e.timeout&&(i=setTimeout((function(){a()&&n(new Error("timeout"))}),e.timeout));var s=e.retryLimit,c=0;!function i(){return t().then((function(t){if(void 0!==t)a()&&r(t);else if(e.oncePoll)e.oncePoll.once("poll",i);else if(e.onceBlock)e.onceBlock.once("block",i);else if(!o){if(++c>s)return void(a()&&n(new Error("retry limit reached")));var A=e.interval*parseInt(String(Math.random()*Math.pow(2,c)));A<e.floor&&(A=e.floor),A>e.ceiling&&(A=e.ceiling),setTimeout(i,A)}return null}),(function(t){a()&&n(t)}))}()}))}var Bc=r(80),Qc=r.n(Bc);function kc(t){return(kc="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Sc(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,(i=n.key,o=void 0,o=function(t,e){if("object"!==kc(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==kc(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(i,"string"),"symbol"===kc(o)?o:String(o)),n)}var i,o}var _c=new h.b("providers/5.7.2"),Dc=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.formats=this.getDefaultFormats()}var e,r,n;return e=t,n=[{key:"check",value:function(t,e){var r={};for(var n in t)try{var i=t[n](e[n]);void 0!==i&&(r[n]=i)}catch(t){throw t.checkKey=n,t.checkValue=e[n],t}return r}},{key:"allowNull",value:function(t,e){return function(r){return null==r?e:t(r)}}},{key:"allowFalsish",value:function(t,e){return function(r){return r?t(r):e}}},{key:"arrayOf",value:function(t){return function(e){if(!Array.isArray(e))throw new Error("not an array");var r=[];return e.forEach((function(e){r.push(t(e))})),r}}}],(r=[{key:"getDefaultFormats",value:function(){var e=this,r={},n=this.address.bind(this),i=this.bigNumber.bind(this),o=this.blockTag.bind(this),a=this.data.bind(this),s=this.hash.bind(this),c=this.hex.bind(this),A=this.number.bind(this),u=this.type.bind(this);return r.transaction={hash:s,type:u,accessList:t.allowNull(this.accessList.bind(this),null),blockHash:t.allowNull(s,null),blockNumber:t.allowNull(A,null),transactionIndex:t.allowNull(A,null),confirmations:t.allowNull(A,null),from:n,gasPrice:t.allowNull(i),maxPriorityFeePerGas:t.allowNull(i),maxFeePerGas:t.allowNull(i),gasLimit:i,to:t.allowNull(n,null),value:i,nonce:A,data:a,r:t.allowNull(this.uint256),s:t.allowNull(this.uint256),v:t.allowNull(A),creates:t.allowNull(n,null),raw:t.allowNull(a)},r.transactionRequest={from:t.allowNull(n),nonce:t.allowNull(A),gasLimit:t.allowNull(i),gasPrice:t.allowNull(i),maxPriorityFeePerGas:t.allowNull(i),maxFeePerGas:t.allowNull(i),to:t.allowNull(n),value:t.allowNull(i),data:t.allowNull((function(t){return e.data(t,!0)})),type:t.allowNull(A),accessList:t.allowNull(this.accessList.bind(this),null)},r.receiptLog={transactionIndex:A,blockNumber:A,transactionHash:s,address:n,topics:t.arrayOf(s),data:a,logIndex:A,blockHash:s},r.receipt={to:t.allowNull(this.address,null),from:t.allowNull(this.address,null),contractAddress:t.allowNull(n,null),transactionIndex:A,root:t.allowNull(c),gasUsed:i,logsBloom:t.allowNull(a),blockHash:s,transactionHash:s,logs:t.arrayOf(this.receiptLog.bind(this)),blockNumber:A,confirmations:t.allowNull(A,null),cumulativeGasUsed:i,effectiveGasPrice:t.allowNull(i),status:t.allowNull(A),type:u},r.block={hash:t.allowNull(s),parentHash:s,number:A,timestamp:A,nonce:t.allowNull(c),difficulty:this.difficulty.bind(this),gasLimit:i,gasUsed:i,miner:t.allowNull(n),extraData:a,transactions:t.allowNull(t.arrayOf(s)),baseFeePerGas:t.allowNull(i)},r.blockWithTransactions=O(r.block),r.blockWithTransactions.transactions=t.allowNull(t.arrayOf(this.transactionResponse.bind(this))),r.filter={fromBlock:t.allowNull(o,void 0),toBlock:t.allowNull(o,void 0),blockHash:t.allowNull(s,void 0),address:t.allowNull(n,void 0),topics:t.allowNull(this.topics.bind(this),void 0)},r.filterLog={blockNumber:t.allowNull(A),blockHash:t.allowNull(s),transactionIndex:A,removed:t.allowNull(this.boolean.bind(this)),address:n,data:t.allowFalsish(a,"0x"),topics:t.arrayOf(s),transactionHash:s,logIndex:A},r}},{key:"accessList",value:function(t){return Ai(t||[])}},{key:"number",value:function(t){return"0x"===t?0:b.from(t).toNumber()}},{key:"type",value:function(t){return"0x"===t||null==t?0:b.from(t).toNumber()}},{key:"bigNumber",value:function(t){return b.from(t)}},{key:"boolean",value:function(t){if("boolean"==typeof t)return t;if("string"==typeof t){if("true"===(t=t.toLowerCase()))return!0;if("false"===t)return!1}throw new Error("invalid boolean - "+t)}},{key:"hex",value:function(t,e){return"string"==typeof t&&(e||"0x"===t.substring(0,2)||(t="0x"+t),Object(A.l)(t))?t.toLowerCase():_c.throwArgumentError("invalid hash","value",t)}},{key:"data",value:function(t,e){var r=this.hex(t,e);if(r.length%2!=0)throw new Error("invalid data; odd-length - "+t);return r}},{key:"address",value:function(t){return ht(t)}},{key:"callAddress",value:function(t){if(!Object(A.l)(t,32))return null;var e=ht(Object(A.e)(t,12));return e===ms?null:e}},{key:"contractAddress",value:function(t){return gt(t)}},{key:"blockTag",value:function(t){if(null==t)return"latest";if("earliest"===t)return"0x0";switch(t){case"earliest":return"0x0";case"latest":case"pending":case"safe":case"finalized":return t}if("number"==typeof t||Object(A.l)(t))return Object(A.g)(t);throw new Error("invalid blockTag")}},{key:"hash",value:function(t,e){var r=this.hex(t,e);return 32!==Object(A.d)(r)?_c.throwArgumentError("invalid hash","value",t):r}},{key:"difficulty",value:function(t){if(null==t)return null;var e=b.from(t);try{return e.toNumber()}catch(t){}return null}},{key:"uint256",value:function(t){if(!Object(A.l)(t))throw new Error("invalid uint256");return Object(A.h)(t,32)}},{key:"_block",value:function(e,r){null!=e.author&&null==e.miner&&(e.miner=e.author);var n=null!=e._difficulty?e._difficulty:e.difficulty,i=t.check(r,e);return i._difficulty=null==n?null:b.from(n),i}},{key:"block",value:function(t){return this._block(t,this.formats.block)}},{key:"blockWithTransactions",value:function(t){return this._block(t,this.formats.blockWithTransactions)}},{key:"transactionRequest",value:function(e){return t.check(this.formats.transactionRequest,e)}},{key:"transactionResponse",value:function(e){null!=e.gas&&null==e.gasLimit&&(e.gasLimit=e.gas),e.to&&b.from(e.to).isZero()&&(e.to="0x0000000000000000000000000000000000000000"),null!=e.input&&null==e.data&&(e.data=e.input),null==e.to&&null==e.creates&&(e.creates=this.contractAddress(e)),1!==e.type&&2!==e.type||null!=e.accessList||(e.accessList=[]);var r=t.check(this.formats.transaction,e);if(null!=e.chainId){var n=e.chainId;Object(A.l)(n)&&(n=b.from(n).toNumber()),r.chainId=n}else{var i=e.networkId;null==i&&null==r.v&&(i=e.chainId),Object(A.l)(i)&&(i=b.from(i).toNumber()),"number"!=typeof i&&null!=r.v&&((i=(r.v-35)/2)<0&&(i=0),i=parseInt(i)),"number"!=typeof i&&(i=0),r.chainId=i}return r.blockHash&&"x"===r.blockHash.replace(/0/g,"")&&(r.blockHash=null),r}},{key:"transaction",value:function(t){return gi(t)}},{key:"receiptLog",value:function(e){return t.check(this.formats.receiptLog,e)}},{key:"receipt",value:function(e){var r=t.check(this.formats.receipt,e);if(null!=r.root)if(r.root.length<=4){var n=b.from(r.root).toNumber();0===n||1===n?(null!=r.status&&r.status!==n&&_c.throwArgumentError("alt-root-status/status mismatch","value",{root:r.root,status:r.status}),r.status=n,delete r.root):_c.throwArgumentError("invalid alt-root-status","value.root",r.root)}else 66!==r.root.length&&_c.throwArgumentError("invalid root hash","value.root",r.root);return null!=r.status&&(r.byzantium=!0),r}},{key:"topics",value:function(t){var e=this;return Array.isArray(t)?t.map((function(t){return e.topics(t)})):null!=t?this.hash(t,!0):null}},{key:"filter",value:function(e){return t.check(this.formats.filter,e)}},{key:"filterLog",value:function(e){return t.check(this.formats.filterLog,e)}}])&&Sc(e.prototype,r),n&&Sc(e,n),Object.defineProperty(e,"prototype",{writable:!1}),t}();function xc(t){return t&&"function"==typeof t.isCommunityResource}function Mc(t){return xc(t)&&t.isCommunityResource()}var Rc=!1;function Oc(){Rc||(Rc=!0,console.log("========= NOTICE ========="),console.log("Request-Rate Exceeded (this message will not be repeated)"),console.log(""),console.log("The default API keys for each service are provided as a highly-throttled,"),console.log("community resource for low-traffic projects and early prototyping."),console.log(""),console.log("While your application will continue to function, we highly recommended"),console.log("signing up for your own API keys to improve performance, increase your"),console.log("request rate/limit and enable other perks, such as metrics and advanced APIs."),console.log(""),console.log("For more details: https://docs.ethers.io/api-keys/"),console.log("=========================="))}function Nc(t,e){return(Nc=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}function Pc(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=Fc(t);if(e){var i=Fc(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return jc(this,r)}}function jc(t,e){if(e&&("object"===Yc(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return Lc(t)}function Lc(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Fc(t){return(Fc=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function Tc(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */Tc=function(){return t};var t={},e=Object.prototype,r=e.hasOwnProperty,n=Object.defineProperty||function(t,e,r){t[e]=r.value},i="function"==typeof Symbol?Symbol:{},o=i.iterator||"@@iterator",a=i.asyncIterator||"@@asyncIterator",s=i.toStringTag||"@@toStringTag";function c(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{c({},"")}catch(t){c=function(t,e,r){return t[e]=r}}function A(t,e,r,i){var o=e&&e.prototype instanceof h?e:h,a=Object.create(o.prototype),s=new B(i||[]);return n(a,"_invoke",{value:E(t,r,s)}),a}function u(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=A;var f={};function h(){}function l(){}function d(){}var g={};c(g,o,(function(){return this}));var p=Object.getPrototypeOf,y=p&&p(p(Q([])));y&&y!==e&&r.call(y,o)&&(g=y);var I=d.prototype=h.prototype=Object.create(g);function b(t){["next","throw","return"].forEach((function(e){c(t,e,(function(t){return this._invoke(e,t)}))}))}function v(t,e){var i;n(this,"_invoke",{value:function(n,o){function a(){return new e((function(i,a){!function n(i,o,a,s){var c=u(t[i],t,o);if("throw"!==c.type){var A=c.arg,f=A.value;return f&&"object"==Yc(f)&&r.call(f,"__await")?e.resolve(f.__await).then((function(t){n("next",t,a,s)}),(function(t){n("throw",t,a,s)})):e.resolve(f).then((function(t){A.value=t,a(A)}),(function(t){return n("throw",t,a,s)}))}s(c.arg)}(n,o,i,a)}))}return i=i?i.then(a,a):a()}})}function E(t,e,r){var n="suspendedStart";return function(i,o){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===i)throw o;return k()}for(r.method=i,r.arg=o;;){var a=r.delegate;if(a){var s=m(a,r);if(s){if(s===f)continue;return s}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var c=u(t,e,r);if("normal"===c.type){if(n=r.done?"completed":"suspendedYield",c.arg===f)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(n="completed",r.method="throw",r.arg=c.arg)}}}function m(t,e){var r=e.method,n=t.iterator[r];if(void 0===n)return e.delegate=null,"throw"===r&&t.iterator.return&&(e.method="return",e.arg=void 0,m(t,e),"throw"===e.method)||"return"!==r&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+r+"' method")),f;var i=u(n,t.iterator,e.arg);if("throw"===i.type)return e.method="throw",e.arg=i.arg,e.delegate=null,f;var o=i.arg;return o?o.done?(e[t.resultName]=o.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,f):o:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,f)}function C(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function w(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function B(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(C,this),this.reset(!0)}function Q(t){if(t){var e=t[o];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,i=function e(){for(;++n<t.length;)if(r.call(t,n))return e.value=t[n],e.done=!1,e;return e.value=void 0,e.done=!0,e};return i.next=i}}return{next:k}}function k(){return{value:void 0,done:!0}}return l.prototype=d,n(I,"constructor",{value:d,configurable:!0}),n(d,"constructor",{value:l,configurable:!0}),l.displayName=c(d,s,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===l||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,d):(t.__proto__=d,c(t,s,"GeneratorFunction")),t.prototype=Object.create(I),t},t.awrap=function(t){return{__await:t}},b(v.prototype),c(v.prototype,a,(function(){return this})),t.AsyncIterator=v,t.async=function(e,r,n,i,o){void 0===o&&(o=Promise);var a=new v(A(e,r,n,i),o);return t.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},b(I),c(I,s,"Generator"),c(I,o,(function(){return this})),c(I,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},t.values=Q,B.prototype={constructor:B,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(w),!t)for(var e in this)"t"===e.charAt(0)&&r.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function n(r,n){return a.type="throw",a.arg=t,e.next=r,n&&(e.method="next",e.arg=void 0),!!n}for(var i=this.tryEntries.length-1;i>=0;--i){var o=this.tryEntries[i],a=o.completion;if("root"===o.tryLoc)return n("end");if(o.tryLoc<=this.prev){var s=r.call(o,"catchLoc"),c=r.call(o,"finallyLoc");if(s&&c){if(this.prev<o.catchLoc)return n(o.catchLoc,!0);if(this.prev<o.finallyLoc)return n(o.finallyLoc)}else if(s){if(this.prev<o.catchLoc)return n(o.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return n(o.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&r.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var o=i;break}}o&&("break"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc&&(o=null);var a=o?o.completion:{};return a.type=t,a.arg=e,o?(this.method="next",this.next=o.finallyLoc,f):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),f},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),w(r),f}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var i=n.arg;w(r)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:Q(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),f}},t}function Uc(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Gc(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,(i=n.key,o=void 0,o=function(t,e){if("object"!==Yc(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==Yc(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(i,"string"),"symbol"===Yc(o)?o:String(o)),n)}var i,o}function Hc(t,e,r){return e&&Gc(t.prototype,e),r&&Gc(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function Yc(t){return(Yc="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var Kc=function(t,e,r,n){return new(r||(r=Promise))((function(i,o){function a(t){try{c(n.next(t))}catch(t){o(t)}}function s(t){try{c(n.throw(t))}catch(t){o(t)}}function c(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(a,s)}c((n=n.apply(t,e||[])).next())}))},qc=new h.b("providers/5.7.2");function Jc(t){return null==t?"null":(32!==Object(A.d)(t)&&qc.throwArgumentError("invalid topic","topic",t),t.toLowerCase())}function zc(t){for(t=t.slice();t.length>0&&null==t[t.length-1];)t.pop();return t.map((function(t){if(Array.isArray(t)){var e={};t.forEach((function(t){e[Jc(t)]=!0}));var r=Object.keys(e);return r.sort(),r.join("|")}return Jc(t)})).join("&")}function Zc(t){if("string"==typeof t){if(t=t.toLowerCase(),32===Object(A.d)(t))return"tx:"+t;if(-1===t.indexOf(":"))return t}else{if(Array.isArray(t))return"filter:*:"+zc(t);if(Qn.isForkEvent(t))throw qc.warn("not implemented"),new Error("not implemented");if(t&&"object"===Yc(t))return"filter:"+(t.address||"*")+":"+zc(t.topics||[])}throw new Error("invalid event - "+t)}function Vc(){return(new Date).getTime()}function Wc(t){return new Promise((function(e){setTimeout(e,t)}))}var Xc=["block","network","pending","poll"],$c=function(){function t(e,r,n){Uc(this,t),D(this,"tag",e),D(this,"listener",r),D(this,"once",n),this._lastBlockNumber=-2,this._inflight=!1}return Hc(t,[{key:"event",get:function(){switch(this.type){case"tx":return this.hash;case"filter":return this.filter}return this.tag}},{key:"type",get:function(){return this.tag.split(":")[0]}},{key:"hash",get:function(){var t=this.tag.split(":");return"tx"!==t[0]?null:t[1]}},{key:"filter",get:function(){var t=this.tag.split(":");if("filter"!==t[0])return null;var e,r=t[1],n=""===(e=t[2])?[]:e.split(/&/g).map((function(t){if(""===t)return[];var e=t.split("|").map((function(t){return"null"===t?null:t}));return 1===e.length?e[0]:e})),i={};return n.length>0&&(i.topics=n),r&&"*"!==r&&(i.address=r),i}},{key:"pollable",value:function(){return this.tag.indexOf(":")>=0||Xc.indexOf(this.tag)>=0}}]),t}(),tA={0:{symbol:"btc",p2pkh:0,p2sh:5,prefix:"bc"},2:{symbol:"ltc",p2pkh:48,p2sh:50,prefix:"ltc"},3:{symbol:"doge",p2pkh:30,p2sh:22},60:{symbol:"eth",ilk:"eth"},61:{symbol:"etc",ilk:"eth"},700:{symbol:"xdai",ilk:"eth"}};function eA(t){return Object(A.h)(b.from(t).toHexString(),32)}function rA(t){return Po.encode(Object(A.b)([t,Object(A.e)(Uo(Uo(t)),0,4)]))}var nA=new RegExp("^(ipfs)://(.*)$","i"),iA=[new RegExp("^(https)://(.*)$","i"),new RegExp("^(data):(.*)$","i"),nA,new RegExp("^eip155:[0-9]+/(erc[0-9]+):(.*)$","i")];function oA(t,e){try{return kt(aA(t,e))}catch(t){}return null}function aA(t,e){if("0x"===t)return null;var r=b.from(Object(A.e)(t,e,e+32)).toNumber(),n=b.from(Object(A.e)(t,r,r+32)).toNumber();return Object(A.e)(t,r+32,r+32+n)}function sA(t){return t.match(/^ipfs:\/\/ipfs\//i)?t=t.substring(12):t.match(/^ipfs:\/\//i)?t=t.substring(7):qc.throwArgumentError("unsupported IPFS format","link",t),"https://gateway.ipfs.io/ipfs/".concat(t)}function cA(t){var e=Object(A.a)(t);if(e.length>32)throw new Error("internal; should not happen");var r=new Uint8Array(32);return r.set(e,32-e.length),r}function AA(t){if(t.length%32==0)return t;var e=new Uint8Array(32*Math.ceil(t.length/32));return e.set(t),e}function uA(t){for(var e=[],r=0,n=0;n<t.length;n++)e.push(null),r+=32;for(var i=0;i<t.length;i++){var o=Object(A.a)(t[i]);e[i]=cA(r),e.push(cA(o.length)),e.push(AA(o)),r+=32+32*Math.ceil(o.length/32)}return Object(A.c)(e)}var fA=function(){function t(e,r,n,i){Uc(this,t),D(this,"provider",e),D(this,"name",n),D(this,"address",e.formatter.address(r)),D(this,"_resolvedAddress",i)}return Hc(t,[{key:"supportsWildcard",value:function(){var t=this;return this._supportsEip2544||(this._supportsEip2544=this.provider.call({to:this.address,data:"0x01ffc9a79061b92300000000000000000000000000000000000000000000000000000000"}).then((function(t){return b.from(t).eq(1)})).catch((function(e){if(e.code===h.b.errors.CALL_EXCEPTION)return!1;throw t._supportsEip2544=null,e}))),this._supportsEip2544}},{key:"_fetch",value:function(t,e){return Kc(this,void 0,void 0,Tc().mark((function r(){var n,i,o;return Tc().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return n={to:this.address,ccipReadEnabled:!0,data:Object(A.c)([t,uc(this.name),e||"0x"])},i=!1,r.next=4,this.supportsWildcard();case 4:if(!r.sent){r.next=7;break}i=!0,n.data=Object(A.c)(["0x9061b923",uA([fc(this.name),n.data])]);case 7:return r.prev=7,r.next=10,this.provider.call(n);case 10:return o=r.sent,Object(A.a)(o).length%32==4&&qc.throwError("resolver threw error",h.b.errors.CALL_EXCEPTION,{transaction:n,data:o}),i&&(o=aA(o,0)),r.abrupt("return",o);case 16:if(r.prev=16,r.t0=r.catch(7),r.t0.code!==h.b.errors.CALL_EXCEPTION){r.next=20;break}return r.abrupt("return",null);case 20:throw r.t0;case 21:case"end":return r.stop()}}),r,this,[[7,16]])})))}},{key:"_fetchBytes",value:function(t,e){return Kc(this,void 0,void 0,Tc().mark((function r(){var n;return Tc().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,this._fetch(t,e);case 2:if(null==(n=r.sent)){r.next=5;break}return r.abrupt("return",aA(n,0));case 5:return r.abrupt("return",null);case 6:case"end":return r.stop()}}),r,this)})))}},{key:"_getAddress",value:function(t,e){var r=tA[String(t)];if(null==r&&qc.throwError("unsupported coin type: ".concat(t),h.b.errors.UNSUPPORTED_OPERATION,{operation:"getAddress(".concat(t,")")}),"eth"===r.ilk)return this.provider.formatter.address(e);var n=Object(A.a)(e);if(null!=r.p2pkh){var i=e.match(/^0x76a9([0-9a-f][0-9a-f])([0-9a-f]*)88ac$/);if(i){var o=parseInt(i[1],16);if(i[2].length===2*o&&o>=1&&o<=75)return rA(Object(A.b)([[r.p2pkh],"0x"+i[2]]))}}if(null!=r.p2sh){var a=e.match(/^0xa9([0-9a-f][0-9a-f])([0-9a-f]*)87$/);if(a){var s=parseInt(a[1],16);if(a[2].length===2*s&&s>=1&&s<=75)return rA(Object(A.b)([[r.p2sh],"0x"+a[2]]))}}if(null!=r.prefix){var c=n[1],u=n[0];if(0===u?20!==c&&32!==c&&(u=-1):u=-1,u>=0&&n.length===2+c&&c>=1&&c<=75){var f=Qc.a.toWords(n.slice(2));return f.unshift(u),Qc.a.encode(r.prefix,f)}}return null}},{key:"getAddress",value:function(t){return Kc(this,void 0,void 0,Tc().mark((function e(){var r,n,i;return Tc().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null==t&&(t=60),60!==t){e.next=16;break}return e.prev=2,e.next=5,this._fetch("0x3b3b57de");case 5:if("0x"!==(r=e.sent)&&r!==Cs){e.next=8;break}return e.abrupt("return",null);case 8:return e.abrupt("return",this.provider.formatter.callAddress(r));case 11:if(e.prev=11,e.t0=e.catch(2),e.t0.code!==h.b.errors.CALL_EXCEPTION){e.next=15;break}return e.abrupt("return",null);case 15:throw e.t0;case 16:return e.next=18,this._fetchBytes("0xf1cb7e06",eA(t));case 18:if(null!=(n=e.sent)&&"0x"!==n){e.next=21;break}return e.abrupt("return",null);case 21:return null==(i=this._getAddress(t,n))&&qc.throwError("invalid or unsupported coin data",h.b.errors.UNSUPPORTED_OPERATION,{operation:"getAddress(".concat(t,")"),coinType:t,data:n}),e.abrupt("return",i);case 24:case"end":return e.stop()}}),e,this,[[2,11]])})))}},{key:"getAvatar",value:function(){return Kc(this,void 0,void 0,Tc().mark((function t(){var e,r,n,i,o,a,s,c,u,f,h,l,d,g,p,y;return Tc().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e=[{type:"name",content:this.name}],t.prev=1,t.next=4,this.getText("avatar");case 4:if(null!=(r=t.sent)){t.next=7;break}return t.abrupt("return",null);case 7:n=0;case 8:if(!(n<iA.length)){t.next=91;break}if(null!=(i=r.match(iA[n]))){t.next=12;break}return t.abrupt("continue",88);case 12:o=i[1].toLowerCase(),t.t0=o,t.next="https"===t.t0?16:"data"===t.t0?18:"ipfs"===t.t0?20:"erc721"===t.t0||"erc1155"===t.t0?22:88;break;case 16:return e.push({type:"url",content:r}),t.abrupt("return",{linkage:e,url:r});case 18:return e.push({type:"data",content:r}),t.abrupt("return",{linkage:e,url:r});case 20:return e.push({type:"ipfs",content:r}),t.abrupt("return",{linkage:e,url:sA(r)});case 22:if(a="erc721"===o?"0xc87b56dd":"0x0e89341c",e.push({type:o,content:r}),t.t1=this._resolvedAddress,t.t1){t.next=29;break}return t.next=28,this.getAddress();case 28:t.t1=t.sent;case 29:if(s=t.t1,2===(c=(i[2]||"").split("/")).length){t.next=33;break}return t.abrupt("return",null);case 33:return t.next=35,this.provider.formatter.address(c[0]);case 35:if(u=t.sent,f=Object(A.h)(b.from(c[1]).toHexString(),32),"erc721"!==o){t.next=48;break}return t.t2=this.provider.formatter,t.next=41,this.provider.call({to:u,data:Object(A.c)(["0x6352211e",f])});case 41:if(t.t3=t.sent,h=t.t2.callAddress.call(t.t2,t.t3),s===h){t.next=45;break}return t.abrupt("return",null);case 45:e.push({type:"owner",content:h}),t.next=57;break;case 48:if("erc1155"!==o){t.next=57;break}return t.t4=b,t.next=52,this.provider.call({to:u,data:Object(A.c)(["0x00fdd58e",Object(A.h)(s,32),f])});case 52:if(t.t5=t.sent,!(l=t.t4.from.call(t.t4,t.t5)).isZero()){t.next=56;break}return t.abrupt("return",null);case 56:e.push({type:"balance",content:l.toString()});case 57:return d={to:this.provider.formatter.address(c[0]),data:Object(A.c)([a,f])},t.t6=oA,t.next=61,this.provider.call(d);case 61:if(t.t7=t.sent,null!=(g=(0,t.t6)(t.t7,0))){t.next=65;break}return t.abrupt("return",null);case 65:return e.push({type:"metadata-url-base",content:g}),"erc1155"===o&&(g=g.replace("{id}",f.substring(2)),e.push({type:"metadata-url-expanded",content:g})),g.match(/^ipfs:/i)&&(g=sA(g)),e.push({type:"metadata-url",content:g}),t.next=71,Cc(g);case 71:if(p=t.sent){t.next=74;break}return t.abrupt("return",null);case 74:if(e.push({type:"metadata",content:JSON.stringify(p)}),"string"==typeof(y=p.image)){t.next=78;break}return t.abrupt("return",null);case 78:if(!y.match(/^(https:\/\/|data:)/i)){t.next=81;break}t.next=86;break;case 81:if(null!=y.match(nA)){t.next=84;break}return t.abrupt("return",null);case 84:e.push({type:"url-ipfs",content:y}),y=sA(y);case 86:return e.push({type:"url",content:y}),t.abrupt("return",{linkage:e,url:y});case 88:n++,t.next=8;break;case 91:t.next=95;break;case 93:t.prev=93,t.t8=t.catch(1);case 95:return t.abrupt("return",null);case 96:case"end":return t.stop()}}),t,this,[[1,93]])})))}},{key:"getContentHash",value:function(){return Kc(this,void 0,void 0,Tc().mark((function t(){var e,r,n,i,o,a,s,c,A;return Tc().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this._fetchBytes("0xbc1c58d1");case 2:if(null!=(e=t.sent)&&"0x"!==e){t.next=5;break}return t.abrupt("return",null);case 5:if(!(r=e.match(/^0xe3010170(([0-9a-f][0-9a-f])([0-9a-f][0-9a-f])([0-9a-f]*))$/))){t.next=10;break}if(n=parseInt(r[3],16),r[4].length!==2*n){t.next=10;break}return t.abrupt("return","ipfs://"+Po.encode("0x"+r[1]));case 10:if(!(i=e.match(/^0xe5010172(([0-9a-f][0-9a-f])([0-9a-f][0-9a-f])([0-9a-f]*))$/))){t.next=15;break}if(o=parseInt(i[3],16),i[4].length!==2*o){t.next=15;break}return t.abrupt("return","ipns://"+Po.encode("0x"+i[1]));case 15:if(!(a=e.match(/^0xe40101fa011b20([0-9a-f]*)$/))){t.next=19;break}if(64!==a[1].length){t.next=19;break}return t.abrupt("return","bzz://"+a[1]);case 19:if(!(s=e.match(/^0x90b2c605([0-9a-f]*)$/))){t.next=25;break}if(68!==s[1].length){t.next=25;break}return c={"=":"","+":"-","/":"_"},A=Os("0x"+s[1]).replace(/[=+\/]/g,(function(t){return c[t]})),t.abrupt("return","sia://"+A);case 25:return t.abrupt("return",qc.throwError("invalid or unsupported content hash data",h.b.errors.UNSUPPORTED_OPERATION,{operation:"getContentHash()",data:e}));case 26:case"end":return t.stop()}}),t,this)})))}},{key:"getText",value:function(t){return Kc(this,void 0,void 0,Tc().mark((function e(){var r,n;return Tc().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=Ct(t),(r=Object(A.b)([eA(64),eA(r.length),r])).length%32!=0&&(r=Object(A.b)([r,Object(A.h)("0x",32-t.length%32)])),e.next=5,this._fetchBytes("0x59d1d43c",Object(A.i)(r));case 5:if(null!=(n=e.sent)&&"0x"!==n){e.next=8;break}return e.abrupt("return",null);case 8:return e.abrupt("return",kt(n));case 9:case"end":return e.stop()}}),e,this)})))}}]),t}(),hA=null,lA=1,dA=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Nc(t,e)}(r,t);var e=Pc(r);function r(t){var n;if(Uc(this,r),(n=e.call(this))._events=[],n._emitted={block:-2},n.disableCcipRead=!1,n.formatter=(this instanceof r?this.constructor:void 0).getFormatter(),D(Lc(n),"anyNetwork","any"===t),n.anyNetwork&&(t=n.detectNetwork()),t instanceof Promise)n._networkPromise=t,t.catch((function(t){})),n._ready().catch((function(t){}));else{var i=x(this instanceof r?this.constructor:void 0,"getNetwork")(t);i?(D(Lc(n),"_network",i),n.emit("network",i,null)):qc.throwArgumentError("invalid network","network",t)}return n._maxInternalBlockNumber=-1024,n._lastBlockNumber=-2,n._maxFilterBlockRange=10,n._pollingInterval=4e3,n._fastQueryDate=0,n}return Hc(r,[{key:"_ready",value:function(){return Kc(this,void 0,void 0,Tc().mark((function t(){var e;return Tc().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(null!=this._network){t.next=17;break}if(e=null,!this._networkPromise){t.next=11;break}return t.prev=3,t.next=6,this._networkPromise;case 6:e=t.sent,t.next=11;break;case 9:t.prev=9,t.t0=t.catch(3);case 11:if(null!=e){t.next=15;break}return t.next=14,this.detectNetwork();case 14:e=t.sent;case 15:e||qc.throwError("no network detected",h.b.errors.UNKNOWN_ERROR,{}),null==this._network&&(this.anyNetwork?this._network=e:D(this,"_network",e),this.emit("network",e,null));case 17:return t.abrupt("return",this._network);case 18:case"end":return t.stop()}}),t,this,[[3,9]])})))}},{key:"ready",get:function(){var t=this;return wc((function(){return t._ready().then((function(t){return t}),(function(t){if(t.code!==h.b.errors.NETWORK_ERROR||"noNetwork"!==t.event)throw t}))}))}},{key:"ccipReadFetch",value:function(t,e,r){return Kc(this,void 0,void 0,Tc().mark((function n(){var i,o,a,s,c,A,u,f,l;return Tc().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(!this.disableCcipRead&&0!==r.length){n.next=2;break}return n.abrupt("return",null);case 2:i=t.to.toLowerCase(),o=e.toLowerCase(),a=[],s=0;case 6:if(!(s<r.length)){n.next=22;break}return c=r[s],A=c.replace("{sender}",i).replace("{data}",o),u=c.indexOf("{data}")>=0?null:JSON.stringify({data:o,sender:i}),n.next=12,Cc({url:A,errorPassThrough:!0},u,(function(t,e){return t.status=e.statusCode,t}));case 12:if(!(f=n.sent).data){n.next=15;break}return n.abrupt("return",f.data);case 15:if(l=f.message||"unknown error",!(f.status>=400&&f.status<500)){n.next=18;break}return n.abrupt("return",qc.throwError("response not found during CCIP fetch: ".concat(l),h.b.errors.SERVER_ERROR,{url:c,errorMessage:l}));case 18:a.push(l);case 19:s++,n.next=6;break;case 22:return n.abrupt("return",qc.throwError("error encountered during CCIP fetch: ".concat(a.map((function(t){return JSON.stringify(t)})).join(", ")),h.b.errors.SERVER_ERROR,{urls:r,errorMessages:a}));case 23:case"end":return n.stop()}}),n,this)})))}},{key:"_getInternalBlockNumber",value:function(t){return Kc(this,void 0,void 0,Tc().mark((function e(){var r,n,i,o,a=this;return Tc().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._ready();case 2:if(!(t>0)){e.next=20;break}case 3:if(!this._internalBlockNumber){e.next=20;break}return r=this._internalBlockNumber,e.prev=5,e.next=8,r;case 8:if(n=e.sent,!(Vc()-n.respTime<=t)){e.next=11;break}return e.abrupt("return",n.blockNumber);case 11:return e.abrupt("break",20);case 14:if(e.prev=14,e.t0=e.catch(5),this._internalBlockNumber!==r){e.next=18;break}return e.abrupt("break",20);case 18:e.next=3;break;case 20:return i=Vc(),o=M({blockNumber:this.perform("getBlockNumber",{}),networkError:this.getNetwork().then((function(t){return null}),(function(t){return t}))}).then((function(t){var e=t.blockNumber,r=t.networkError;if(r)throw a._internalBlockNumber===o&&(a._internalBlockNumber=null),r;var n=Vc();return(e=b.from(e).toNumber())<a._maxInternalBlockNumber&&(e=a._maxInternalBlockNumber),a._maxInternalBlockNumber=e,a._setFastBlockNumber(e),{blockNumber:e,reqTime:i,respTime:n}})),this._internalBlockNumber=o,o.catch((function(t){a._internalBlockNumber===o&&(a._internalBlockNumber=null)})),e.next=26,o;case 26:return e.abrupt("return",e.sent.blockNumber);case 27:case"end":return e.stop()}}),e,this,[[5,14]])})))}},{key:"poll",value:function(){return Kc(this,void 0,void 0,Tc().mark((function t(){var e,r,n,i,o=this;return Tc().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e=lA++,r=[],n=null,t.prev=3,t.next=6,this._getInternalBlockNumber(100+this.pollingInterval/2);case 6:n=t.sent,t.next=13;break;case 9:return t.prev=9,t.t0=t.catch(3),this.emit("error",t.t0),t.abrupt("return");case 13:if(this._setFastBlockNumber(n),this.emit("poll",e,n),n!==this._lastBlockNumber){t.next=18;break}return this.emit("didPoll",e),t.abrupt("return");case 18:if(-2===this._emitted.block&&(this._emitted.block=n-1),Math.abs(this._emitted.block-n)>1e3)qc.warn("network block skew detected; skipping block events (emitted=".concat(this._emitted.block," blockNumber").concat(n,")")),this.emit("error",qc.makeError("network block skew detected",h.b.errors.NETWORK_ERROR,{blockNumber:n,event:"blockSkew",previousBlockNumber:this._emitted.block})),this.emit("block",n);else for(i=this._emitted.block+1;i<=n;i++)this.emit("block",i);return this._emitted.block!==n&&(this._emitted.block=n,Object.keys(this._emitted).forEach((function(t){if("block"!==t){var e=o._emitted[t];"pending"!==e&&n-e>12&&delete o._emitted[t]}}))),-2===this._lastBlockNumber&&(this._lastBlockNumber=n-1),this._events.forEach((function(t){switch(t.type){case"tx":var e=t.hash,i=o.getTransactionReceipt(e).then((function(t){return t&&null!=t.blockNumber?(o._emitted["t:"+e]=t.blockNumber,o.emit(e,t),null):null})).catch((function(t){o.emit("error",t)}));r.push(i);break;case"filter":if(!t._inflight){t._inflight=!0,-2===t._lastBlockNumber&&(t._lastBlockNumber=n-1);var a=t.filter;a.fromBlock=t._lastBlockNumber+1,a.toBlock=n;var s=a.toBlock-o._maxFilterBlockRange;s>a.fromBlock&&(a.fromBlock=s),a.fromBlock<0&&(a.fromBlock=0);var c=o.getLogs(a).then((function(e){t._inflight=!1,0!==e.length&&e.forEach((function(e){e.blockNumber>t._lastBlockNumber&&(t._lastBlockNumber=e.blockNumber),o._emitted["b:"+e.blockHash]=e.blockNumber,o._emitted["t:"+e.transactionHash]=e.blockNumber,o.emit(a,e)}))})).catch((function(e){o.emit("error",e),t._inflight=!1}));r.push(c)}}})),this._lastBlockNumber=n,Promise.all(r).then((function(){o.emit("didPoll",e)})).catch((function(t){o.emit("error",t)})),t.abrupt("return");case 26:case"end":return t.stop()}}),t,this,[[3,9]])})))}},{key:"resetEventsBlock",value:function(t){this._lastBlockNumber=t-1,this.polling&&this.poll()}},{key:"network",get:function(){return this._network}},{key:"detectNetwork",value:function(){return Kc(this,void 0,void 0,Tc().mark((function t(){return Tc().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",qc.throwError("provider does not support network detection",h.b.errors.UNSUPPORTED_OPERATION,{operation:"provider.detectNetwork"}));case 1:case"end":return t.stop()}}),t)})))}},{key:"getNetwork",value:function(){return Kc(this,void 0,void 0,Tc().mark((function t(){var e,r,n;return Tc().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this._ready();case 2:return e=t.sent,t.next=5,this.detectNetwork();case 5:if(r=t.sent,e.chainId===r.chainId){t.next=23;break}if(!this.anyNetwork){t.next=20;break}return this._network=r,this._lastBlockNumber=-2,this._fastBlockNumber=null,this._fastBlockNumberPromise=null,this._fastQueryDate=0,this._emitted.block=-2,this._maxInternalBlockNumber=-1024,this._internalBlockNumber=null,this.emit("network",r,e),t.next=19,Wc(0);case 19:return t.abrupt("return",this._network);case 20:throw n=qc.makeError("underlying network changed",h.b.errors.NETWORK_ERROR,{event:"changed",network:e,detectedNetwork:r}),this.emit("error",n),n;case 23:return t.abrupt("return",e);case 24:case"end":return t.stop()}}),t,this)})))}},{key:"blockNumber",get:function(){var t=this;return this._getInternalBlockNumber(100+this.pollingInterval/2).then((function(e){t._setFastBlockNumber(e)}),(function(t){})),null!=this._fastBlockNumber?this._fastBlockNumber:-1}},{key:"polling",get:function(){return null!=this._poller},set:function(t){var e=this;t&&!this._poller?(this._poller=setInterval((function(){e.poll()}),this.pollingInterval),this._bootstrapPoll||(this._bootstrapPoll=setTimeout((function(){e.poll(),e._bootstrapPoll=setTimeout((function(){e._poller||e.poll(),e._bootstrapPoll=null}),e.pollingInterval)}),0))):!t&&this._poller&&(clearInterval(this._poller),this._poller=null)}},{key:"pollingInterval",get:function(){return this._pollingInterval},set:function(t){var e=this;if("number"!=typeof t||t<=0||parseInt(String(t))!=t)throw new Error("invalid polling interval");this._pollingInterval=t,this._poller&&(clearInterval(this._poller),this._poller=setInterval((function(){e.poll()}),this._pollingInterval))}},{key:"_getFastBlockNumber",value:function(){var t=this,e=Vc();return e-this._fastQueryDate>2*this._pollingInterval&&(this._fastQueryDate=e,this._fastBlockNumberPromise=this.getBlockNumber().then((function(e){return(null==t._fastBlockNumber||e>t._fastBlockNumber)&&(t._fastBlockNumber=e),t._fastBlockNumber}))),this._fastBlockNumberPromise}},{key:"_setFastBlockNumber",value:function(t){null!=this._fastBlockNumber&&t<this._fastBlockNumber||(this._fastQueryDate=Vc(),(null==this._fastBlockNumber||t>this._fastBlockNumber)&&(this._fastBlockNumber=t,this._fastBlockNumberPromise=Promise.resolve(t)))}},{key:"waitForTransaction",value:function(t,e,r){return Kc(this,void 0,void 0,Tc().mark((function n(){return Tc().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.abrupt("return",this._waitForTransaction(t,null==e?1:e,r||0,null));case 1:case"end":return n.stop()}}),n,this)})))}},{key:"_waitForTransaction",value:function(t,e,r,n){return Kc(this,void 0,void 0,Tc().mark((function i(){var o,a=this;return Tc().wrap((function(i){for(;;)switch(i.prev=i.next){case 0:return i.next=2,this.getTransactionReceipt(t);case 2:if(!(((o=i.sent)?o.confirmations:0)>=e)){i.next=5;break}return i.abrupt("return",o);case 5:return i.abrupt("return",new Promise((function(i,o){var s=[],c=!1,A=function(){return!!c||(c=!0,s.forEach((function(t){t()})),!1)},u=function(t){t.confirmations<e||A()||i(t)};if(a.on(t,u),s.push((function(){a.removeListener(t,u)})),n){var f=n.startBlock,l=null,d=function r(i){return Kc(a,void 0,void 0,Tc().mark((function a(){var s=this;return Tc().wrap((function(a){for(;;)switch(a.prev=a.next){case 0:if(!c){a.next=2;break}return a.abrupt("return");case 2:return a.next=4,Wc(1e3);case 4:this.getTransactionCount(n.from).then((function(a){return Kc(s,void 0,void 0,Tc().mark((function s(){var u,d,g,p,y,I;return Tc().wrap((function(s){for(;;)switch(s.prev=s.next){case 0:if(!c){s.next=2;break}return s.abrupt("return");case 2:if(!(a<=n.nonce)){s.next=6;break}f=i,s.next=41;break;case 6:return s.next=8,this.getTransaction(t);case 8:if(!(u=s.sent)||null==u.blockNumber){s.next=11;break}return s.abrupt("return");case 11:null==l&&(l=f-3)<n.startBlock&&(l=n.startBlock);case 12:if(!(l<=i)){s.next=41;break}if(!c){s.next=15;break}return s.abrupt("return");case 15:return s.next=17,this.getBlockWithTransactions(l);case 17:d=s.sent,g=0;case 19:if(!(g<d.transactions.length)){s.next=38;break}if((p=d.transactions[g]).hash!==t){s.next=23;break}return s.abrupt("return");case 23:if(p.from!==n.from||p.nonce!==n.nonce){s.next=35;break}if(!c){s.next=26;break}return s.abrupt("return");case 26:return s.next=28,this.waitForTransaction(p.hash,e);case 28:if(y=s.sent,!A()){s.next=31;break}return s.abrupt("return");case 31:return I="replaced",p.data===n.data&&p.to===n.to&&p.value.eq(n.value)?I="repriced":"0x"===p.data&&p.from===p.to&&p.value.isZero()&&(I="cancelled"),o(qc.makeError("transaction was replaced",h.b.errors.TRANSACTION_REPLACED,{cancelled:"replaced"===I||"cancelled"===I,reason:I,replacement:this._wrapTransaction(p),hash:t,receipt:y})),s.abrupt("return");case 35:g++,s.next=19;break;case 38:l++,s.next=12;break;case 41:if(!c){s.next=43;break}return s.abrupt("return");case 43:this.once("block",r);case 44:case"end":return s.stop()}}),s,this)})))}),(function(t){c||s.once("block",r)}));case 5:case"end":return a.stop()}}),a,this)})))};if(c)return;a.once("block",d),s.push((function(){a.removeListener("block",d)}))}if("number"==typeof r&&r>0){var g=setTimeout((function(){A()||o(qc.makeError("timeout exceeded",h.b.errors.TIMEOUT,{timeout:r}))}),r);g.unref&&g.unref(),s.push((function(){clearTimeout(g)}))}})));case 6:case"end":return i.stop()}}),i,this)})))}},{key:"getBlockNumber",value:function(){return Kc(this,void 0,void 0,Tc().mark((function t(){return Tc().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",this._getInternalBlockNumber(0));case 1:case"end":return t.stop()}}),t,this)})))}},{key:"getGasPrice",value:function(){return Kc(this,void 0,void 0,Tc().mark((function t(){var e;return Tc().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.getNetwork();case 2:return t.next=4,this.perform("getGasPrice",{});case 4:return e=t.sent,t.prev=5,t.abrupt("return",b.from(e));case 9:return t.prev=9,t.t0=t.catch(5),t.abrupt("return",qc.throwError("bad result from backend",h.b.errors.SERVER_ERROR,{method:"getGasPrice",result:e,error:t.t0}));case 12:case"end":return t.stop()}}),t,this,[[5,9]])})))}},{key:"getBalance",value:function(t,e){return Kc(this,void 0,void 0,Tc().mark((function r(){var n,i;return Tc().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,this.getNetwork();case 2:return r.next=4,M({address:this._getAddress(t),blockTag:this._getBlockTag(e)});case 4:return n=r.sent,r.next=7,this.perform("getBalance",n);case 7:return i=r.sent,r.prev=8,r.abrupt("return",b.from(i));case 12:return r.prev=12,r.t0=r.catch(8),r.abrupt("return",qc.throwError("bad result from backend",h.b.errors.SERVER_ERROR,{method:"getBalance",params:n,result:i,error:r.t0}));case 15:case"end":return r.stop()}}),r,this,[[8,12]])})))}},{key:"getTransactionCount",value:function(t,e){return Kc(this,void 0,void 0,Tc().mark((function r(){var n,i;return Tc().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,this.getNetwork();case 2:return r.next=4,M({address:this._getAddress(t),blockTag:this._getBlockTag(e)});case 4:return n=r.sent,r.next=7,this.perform("getTransactionCount",n);case 7:return i=r.sent,r.prev=8,r.abrupt("return",b.from(i).toNumber());case 12:return r.prev=12,r.t0=r.catch(8),r.abrupt("return",qc.throwError("bad result from backend",h.b.errors.SERVER_ERROR,{method:"getTransactionCount",params:n,result:i,error:r.t0}));case 15:case"end":return r.stop()}}),r,this,[[8,12]])})))}},{key:"getCode",value:function(t,e){return Kc(this,void 0,void 0,Tc().mark((function r(){var n,i;return Tc().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,this.getNetwork();case 2:return r.next=4,M({address:this._getAddress(t),blockTag:this._getBlockTag(e)});case 4:return n=r.sent,r.next=7,this.perform("getCode",n);case 7:return i=r.sent,r.prev=8,r.abrupt("return",Object(A.i)(i));case 12:return r.prev=12,r.t0=r.catch(8),r.abrupt("return",qc.throwError("bad result from backend",h.b.errors.SERVER_ERROR,{method:"getCode",params:n,result:i,error:r.t0}));case 15:case"end":return r.stop()}}),r,this,[[8,12]])})))}},{key:"getStorageAt",value:function(t,e,r){return Kc(this,void 0,void 0,Tc().mark((function n(){var i,o;return Tc().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,this.getNetwork();case 2:return n.next=4,M({address:this._getAddress(t),blockTag:this._getBlockTag(r),position:Promise.resolve(e).then((function(t){return Object(A.g)(t)}))});case 4:return i=n.sent,n.next=7,this.perform("getStorageAt",i);case 7:return o=n.sent,n.prev=8,n.abrupt("return",Object(A.i)(o));case 12:return n.prev=12,n.t0=n.catch(8),n.abrupt("return",qc.throwError("bad result from backend",h.b.errors.SERVER_ERROR,{method:"getStorageAt",params:i,result:o,error:n.t0}));case 15:case"end":return n.stop()}}),n,this,[[8,12]])})))}},{key:"_wrapTransaction",value:function(t,e,r){var n=this;if(null!=e&&32!==Object(A.d)(e))throw new Error("invalid response - sendTransaction");var i=t;return null!=e&&t.hash!==e&&qc.throwError("Transaction hash mismatch from Provider.sendTransaction.",h.b.errors.UNKNOWN_ERROR,{expectedHash:t.hash,returnedHash:e}),i.wait=function(e,i){return Kc(n,void 0,void 0,Tc().mark((function n(){var o,a;return Tc().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return null==e&&(e=1),null==i&&(i=0),o=void 0,0!==e&&null!=r&&(o={data:t.data,from:t.from,nonce:t.nonce,to:t.to,value:t.value,startBlock:r}),n.next=6,this._waitForTransaction(t.hash,e,i,o);case 6:if(null!=(a=n.sent)||0!==e){n.next=9;break}return n.abrupt("return",null);case 9:return this._emitted["t:"+t.hash]=a.blockNumber,0===a.status&&qc.throwError("transaction failed",h.b.errors.CALL_EXCEPTION,{transactionHash:t.hash,transaction:t,receipt:a}),n.abrupt("return",a);case 12:case"end":return n.stop()}}),n,this)})))},i}},{key:"sendTransaction",value:function(t){return Kc(this,void 0,void 0,Tc().mark((function e(){var r,n,i,o;return Tc().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.getNetwork();case 2:return e.next=4,Promise.resolve(t).then((function(t){return Object(A.i)(t)}));case 4:return r=e.sent,null==(n=this.formatter.transaction(t)).confirmations&&(n.confirmations=0),e.next=9,this._getInternalBlockNumber(100+2*this.pollingInterval);case 9:return i=e.sent,e.prev=10,e.next=13,this.perform("sendTransaction",{signedTransaction:r});case 13:return o=e.sent,e.abrupt("return",this._wrapTransaction(n,o,i));case 17:throw e.prev=17,e.t0=e.catch(10),e.t0.transaction=n,e.t0.transactionHash=n.hash,e.t0;case 22:case"end":return e.stop()}}),e,this,[[10,17]])})))}},{key:"_getTransactionRequest",value:function(t){return Kc(this,void 0,void 0,Tc().mark((function e(){var r,n,i=this;return Tc().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t;case 2:return r=e.sent,n={},["from","to"].forEach((function(t){null!=r[t]&&(n[t]=Promise.resolve(r[t]).then((function(t){return t?i._getAddress(t):null})))})),["gasLimit","gasPrice","maxFeePerGas","maxPriorityFeePerGas","value"].forEach((function(t){null!=r[t]&&(n[t]=Promise.resolve(r[t]).then((function(t){return t?b.from(t):null})))})),["type"].forEach((function(t){null!=r[t]&&(n[t]=Promise.resolve(r[t]).then((function(t){return null!=t?t:null})))})),r.accessList&&(n.accessList=this.formatter.accessList(r.accessList)),["data"].forEach((function(t){null!=r[t]&&(n[t]=Promise.resolve(r[t]).then((function(t){return t?Object(A.i)(t):null})))})),e.t0=this.formatter,e.next=12,M(n);case 12:return e.t1=e.sent,e.abrupt("return",e.t0.transactionRequest.call(e.t0,e.t1));case 14:case"end":return e.stop()}}),e,this)})))}},{key:"_getFilter",value:function(t){return Kc(this,void 0,void 0,Tc().mark((function e(){var r,n=this;return Tc().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t;case 2:return t=e.sent,r={},null!=t.address&&(r.address=this._getAddress(t.address)),["blockHash","topics"].forEach((function(e){null!=t[e]&&(r[e]=t[e])})),["fromBlock","toBlock"].forEach((function(e){null!=t[e]&&(r[e]=n._getBlockTag(t[e]))})),e.t0=this.formatter,e.next=10,M(r);case 10:return e.t1=e.sent,e.abrupt("return",e.t0.filter.call(e.t0,e.t1));case 12:case"end":return e.stop()}}),e,this)})))}},{key:"_call",value:function(t,e,r){return Kc(this,void 0,void 0,Tc().mark((function n(){var i,o,a,s,c,u,f,l,d,g,p,y,I,v,E;return Tc().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return r>=10&&qc.throwError("CCIP read exceeded maximum redirections",h.b.errors.SERVER_ERROR,{redirects:r,transaction:t}),i=t.to,n.next=4,this.perform("call",{transaction:t,blockTag:e});case 4:if(o=n.sent,!(r>=0&&"latest"===e&&null!=i&&"0x556f1830"===o.substring(0,10)&&Object(A.d)(o)%32==4)){n.next=31;break}for(n.prev=6,a=Object(A.e)(o,4),s=Object(A.e)(a,0,32),b.from(s).eq(i)||qc.throwError("CCIP Read sender did not match",h.b.errors.CALL_EXCEPTION,{name:"OffchainLookup",signature:"OffchainLookup(address,string[],bytes,bytes4,bytes)",transaction:t,data:o}),c=[],u=b.from(Object(A.e)(a,32,64)).toNumber(),f=b.from(Object(A.e)(a,u,u+32)).toNumber(),l=Object(A.e)(a,u+32),d=0;d<f;d++)null==(g=oA(l,32*d))&&qc.throwError("CCIP Read contained corrupt URL string",h.b.errors.CALL_EXCEPTION,{name:"OffchainLookup",signature:"OffchainLookup(address,string[],bytes,bytes4,bytes)",transaction:t,data:o}),c.push(g);return p=aA(a,64),b.from(Object(A.e)(a,100,128)).isZero()||qc.throwError("CCIP Read callback selector included junk",h.b.errors.CALL_EXCEPTION,{name:"OffchainLookup",signature:"OffchainLookup(address,string[],bytes,bytes4,bytes)",transaction:t,data:o}),y=Object(A.e)(a,96,100),I=aA(a,128),n.next=21,this.ccipReadFetch(t,p,c);case 21:return null==(v=n.sent)&&qc.throwError("CCIP Read disabled or provided no URLs",h.b.errors.CALL_EXCEPTION,{name:"OffchainLookup",signature:"OffchainLookup(address,string[],bytes,bytes4,bytes)",transaction:t,data:o}),E={to:i,data:Object(A.c)([y,uA([v,I])])},n.abrupt("return",this._call(E,e,r+1));case 27:if(n.prev=27,n.t0=n.catch(6),n.t0.code!==h.b.errors.SERVER_ERROR){n.next=31;break}throw n.t0;case 31:return n.prev=31,n.abrupt("return",Object(A.i)(o));case 35:return n.prev=35,n.t1=n.catch(31),n.abrupt("return",qc.throwError("bad result from backend",h.b.errors.SERVER_ERROR,{method:"call",params:{transaction:t,blockTag:e},result:o,error:n.t1}));case 38:case"end":return n.stop()}}),n,this,[[6,27],[31,35]])})))}},{key:"call",value:function(t,e){return Kc(this,void 0,void 0,Tc().mark((function r(){var n;return Tc().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,this.getNetwork();case 2:return r.next=4,M({transaction:this._getTransactionRequest(t),blockTag:this._getBlockTag(e),ccipReadEnabled:Promise.resolve(t.ccipReadEnabled)});case 4:return n=r.sent,r.abrupt("return",this._call(n.transaction,n.blockTag,n.ccipReadEnabled?0:-1));case 6:case"end":return r.stop()}}),r,this)})))}},{key:"estimateGas",value:function(t){return Kc(this,void 0,void 0,Tc().mark((function e(){var r,n;return Tc().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.getNetwork();case 2:return e.next=4,M({transaction:this._getTransactionRequest(t)});case 4:return r=e.sent,e.next=7,this.perform("estimateGas",r);case 7:return n=e.sent,e.prev=8,e.abrupt("return",b.from(n));case 12:return e.prev=12,e.t0=e.catch(8),e.abrupt("return",qc.throwError("bad result from backend",h.b.errors.SERVER_ERROR,{method:"estimateGas",params:r,result:n,error:e.t0}));case 15:case"end":return e.stop()}}),e,this,[[8,12]])})))}},{key:"_getAddress",value:function(t){return Kc(this,void 0,void 0,Tc().mark((function e(){var r;return Tc().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t;case 2:return"string"!=typeof(t=e.sent)&&qc.throwArgumentError("invalid address or ENS name","name",t),e.next=6,this.resolveName(t);case 6:return null==(r=e.sent)&&qc.throwError("ENS name not configured",h.b.errors.UNSUPPORTED_OPERATION,{operation:"resolveName(".concat(JSON.stringify(t),")")}),e.abrupt("return",r);case 9:case"end":return e.stop()}}),e,this)})))}},{key:"_getBlock",value:function(t,e){return Kc(this,void 0,void 0,Tc().mark((function r(){var n,i,o=this;return Tc().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,this.getNetwork();case 2:return r.next=4,t;case 4:if(t=r.sent,n=-128,i={includeTransactions:!!e},!Object(A.l)(t,32)){r.next=11;break}i.blockHash=t,r.next=21;break;case 11:return r.prev=11,r.next=14,this._getBlockTag(t);case 14:i.blockTag=r.sent,Object(A.l)(i.blockTag)&&(n=parseInt(i.blockTag.substring(2),16)),r.next=21;break;case 18:r.prev=18,r.t0=r.catch(11),qc.throwArgumentError("invalid block hash or block tag","blockHashOrBlockTag",t);case 21:return r.abrupt("return",wc((function(){return Kc(o,void 0,void 0,Tc().mark((function t(){var r,o,a,s,c,A,u=this;return Tc().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.perform("getBlock",i);case 2:if(null!=(r=t.sent)){t.next=11;break}if(null==i.blockHash){t.next=7;break}if(null!=this._emitted["b:"+i.blockHash]){t.next=7;break}return t.abrupt("return",null);case 7:if(null==i.blockTag){t.next=10;break}if(!(n>this._emitted.block)){t.next=10;break}return t.abrupt("return",null);case 10:return t.abrupt("return",void 0);case 11:if(!e){t.next=34;break}o=null,a=0;case 14:if(!(a<r.transactions.length)){t.next=31;break}if(null!=(s=r.transactions[a]).blockNumber){t.next=20;break}s.confirmations=0,t.next=28;break;case 20:if(null!=s.confirmations){t.next=28;break}if(null!=o){t.next=25;break}return t.next=24,this._getInternalBlockNumber(100+2*this.pollingInterval);case 24:o=t.sent;case 25:(c=o-s.blockNumber+1)<=0&&(c=1),s.confirmations=c;case 28:a++,t.next=14;break;case 31:return(A=this.formatter.blockWithTransactions(r)).transactions=A.transactions.map((function(t){return u._wrapTransaction(t)})),t.abrupt("return",A);case 34:return t.abrupt("return",this.formatter.block(r));case 35:case"end":return t.stop()}}),t,this)})))}),{oncePoll:this}));case 22:case"end":return r.stop()}}),r,this,[[11,18]])})))}},{key:"getBlock",value:function(t){return this._getBlock(t,!1)}},{key:"getBlockWithTransactions",value:function(t){return this._getBlock(t,!0)}},{key:"getTransaction",value:function(t){return Kc(this,void 0,void 0,Tc().mark((function e(){var r,n=this;return Tc().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.getNetwork();case 2:return e.next=4,t;case 4:return t=e.sent,r={transactionHash:this.formatter.hash(t,!0)},e.abrupt("return",wc((function(){return Kc(n,void 0,void 0,Tc().mark((function e(){var n,i,o,a;return Tc().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.perform("getTransaction",r);case 2:if(null!=(n=e.sent)){e.next=7;break}if(null!=this._emitted["t:"+t]){e.next=6;break}return e.abrupt("return",null);case 6:return e.abrupt("return",void 0);case 7:if(null!=(i=this.formatter.transactionResponse(n)).blockNumber){e.next=12;break}i.confirmations=0,e.next=19;break;case 12:if(null!=i.confirmations){e.next=19;break}return e.next=15,this._getInternalBlockNumber(100+2*this.pollingInterval);case 15:o=e.sent,(a=o-i.blockNumber+1)<=0&&(a=1),i.confirmations=a;case 19:return e.abrupt("return",this._wrapTransaction(i));case 20:case"end":return e.stop()}}),e,this)})))}),{oncePoll:this}));case 7:case"end":return e.stop()}}),e,this)})))}},{key:"getTransactionReceipt",value:function(t){return Kc(this,void 0,void 0,Tc().mark((function e(){var r,n=this;return Tc().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.getNetwork();case 2:return e.next=4,t;case 4:return t=e.sent,r={transactionHash:this.formatter.hash(t,!0)},e.abrupt("return",wc((function(){return Kc(n,void 0,void 0,Tc().mark((function e(){var n,i,o,a;return Tc().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.perform("getTransactionReceipt",r);case 2:if(null!=(n=e.sent)){e.next=7;break}if(null!=this._emitted["t:"+t]){e.next=6;break}return e.abrupt("return",null);case 6:return e.abrupt("return",void 0);case 7:if(null!=n.blockHash){e.next=9;break}return e.abrupt("return",void 0);case 9:if(null!=(i=this.formatter.receipt(n)).blockNumber){e.next=14;break}i.confirmations=0,e.next=21;break;case 14:if(null!=i.confirmations){e.next=21;break}return e.next=17,this._getInternalBlockNumber(100+2*this.pollingInterval);case 17:o=e.sent,(a=o-i.blockNumber+1)<=0&&(a=1),i.confirmations=a;case 21:return e.abrupt("return",i);case 22:case"end":return e.stop()}}),e,this)})))}),{oncePoll:this}));case 7:case"end":return e.stop()}}),e,this)})))}},{key:"getLogs",value:function(t){return Kc(this,void 0,void 0,Tc().mark((function e(){var r,n;return Tc().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.getNetwork();case 2:return e.next=4,M({filter:this._getFilter(t)});case 4:return r=e.sent,e.next=7,this.perform("getLogs",r);case 7:return(n=e.sent).forEach((function(t){null==t.removed&&(t.removed=!1)})),e.abrupt("return",Dc.arrayOf(this.formatter.filterLog.bind(this.formatter))(n));case 10:case"end":return e.stop()}}),e,this)})))}},{key:"getEtherPrice",value:function(){return Kc(this,void 0,void 0,Tc().mark((function t(){return Tc().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.getNetwork();case 2:return t.abrupt("return",this.perform("getEtherPrice",{}));case 3:case"end":return t.stop()}}),t,this)})))}},{key:"_getBlockTag",value:function(t){return Kc(this,void 0,void 0,Tc().mark((function e(){var r;return Tc().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t;case 2:if(!("number"==typeof(t=e.sent)&&t<0)){e.next=11;break}return t%1&&qc.throwArgumentError("invalid BlockTag","blockTag",t),e.next=7,this._getInternalBlockNumber(100+2*this.pollingInterval);case 7:return r=e.sent,(r+=t)<0&&(r=0),e.abrupt("return",this.formatter.blockTag(r));case 11:return e.abrupt("return",this.formatter.blockTag(t));case 12:case"end":return e.stop()}}),e,this)})))}},{key:"getResolver",value:function(t){return Kc(this,void 0,void 0,Tc().mark((function e(){var r,n,i;return Tc().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:r=t;case 1:if(""!==r&&"."!==r){e.next=4;break}return e.abrupt("return",null);case 4:if("eth"===t||"eth"!==r){e.next=6;break}return e.abrupt("return",null);case 6:return e.next=8,this._getResolver(r,"getResolver");case 8:if(null==(n=e.sent)){e.next=19;break}if(i=new fA(this,n,t),e.t0=r!==t,!e.t0){e.next=16;break}return e.next=15,i.supportsWildcard();case 15:e.t0=!e.sent;case 16:if(!e.t0){e.next=18;break}return e.abrupt("return",null);case 18:return e.abrupt("return",i);case 19:r=r.split(".").slice(1).join("."),e.next=1;break;case 22:case"end":return e.stop()}}),e,this)})))}},{key:"_getResolver",value:function(t,e){return Kc(this,void 0,void 0,Tc().mark((function r(){var n,i;return Tc().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return null==e&&(e="ENS"),r.next=3,this.getNetwork();case 3:return(n=r.sent).ensAddress||qc.throwError("network does not support ENS",h.b.errors.UNSUPPORTED_OPERATION,{operation:e,network:n.name}),r.prev=5,r.next=8,this.call({to:n.ensAddress,data:"0x0178b8bf"+uc(t).substring(2)});case 8:return i=r.sent,r.abrupt("return",this.formatter.callAddress(i));case 12:r.prev=12,r.t0=r.catch(5);case 14:return r.abrupt("return",null);case 15:case"end":return r.stop()}}),r,this,[[5,12]])})))}},{key:"resolveName",value:function(t){return Kc(this,void 0,void 0,Tc().mark((function e(){var r;return Tc().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t;case 2:return t=e.sent,e.prev=3,e.abrupt("return",Promise.resolve(this.formatter.address(t)));case 7:if(e.prev=7,e.t0=e.catch(3),!Object(A.l)(t)){e.next=11;break}throw e.t0;case 11:return"string"!=typeof t&&qc.throwArgumentError("invalid ENS name","name",t),e.next=14,this.getResolver(t);case 14:if(r=e.sent){e.next=17;break}return e.abrupt("return",null);case 17:return e.next=19,r.getAddress();case 19:return e.abrupt("return",e.sent);case 20:case"end":return e.stop()}}),e,this,[[3,7]])})))}},{key:"lookupAddress",value:function(t){return Kc(this,void 0,void 0,Tc().mark((function e(){var r,n,i;return Tc().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t;case 2:return t=e.sent,t=this.formatter.address(t),r=t.substring(2).toLowerCase()+".addr.reverse",e.next=7,this._getResolver(r,"lookupAddress");case 7:if(null!=(n=e.sent)){e.next=10;break}return e.abrupt("return",null);case 10:return e.t0=oA,e.next=13,this.call({to:n,data:"0x691f3431"+uc(r).substring(2)});case 13:return e.t1=e.sent,i=(0,e.t0)(e.t1,0),e.next=17,this.resolveName(i);case 17:if(e.sent==t){e.next=20;break}return e.abrupt("return",null);case 20:return e.abrupt("return",i);case 21:case"end":return e.stop()}}),e,this)})))}},{key:"getAvatar",value:function(t){return Kc(this,void 0,void 0,Tc().mark((function e(){var r,n,i,o,a,s,c;return Tc().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=null,!Object(A.l)(t)){e.next=40;break}return n=this.formatter.address(t),i=n.substring(2).toLowerCase()+".addr.reverse",e.next=6,this._getResolver(i,"getAvatar");case 6:if(o=e.sent){e.next=9;break}return e.abrupt("return",null);case 9:return r=new fA(this,o,i),e.prev=10,e.next=13,r.getAvatar();case 13:if(!(a=e.sent)){e.next=16;break}return e.abrupt("return",a.url);case 16:e.next=22;break;case 18:if(e.prev=18,e.t0=e.catch(10),e.t0.code===h.b.errors.CALL_EXCEPTION){e.next=22;break}throw e.t0;case 22:return e.prev=22,e.t1=oA,e.next=26,this.call({to:o,data:"0x691f3431"+uc(i).substring(2)});case 26:return e.t2=e.sent,s=(0,e.t1)(e.t2,0),e.next=30,this.getResolver(s);case 30:r=e.sent,e.next=38;break;case 33:if(e.prev=33,e.t3=e.catch(22),e.t3.code===h.b.errors.CALL_EXCEPTION){e.next=37;break}throw e.t3;case 37:return e.abrupt("return",null);case 38:e.next=45;break;case 40:return e.next=42,this.getResolver(t);case 42:if(r=e.sent){e.next=45;break}return e.abrupt("return",null);case 45:return e.next=47,r.getAvatar();case 47:if(null!=(c=e.sent)){e.next=50;break}return e.abrupt("return",null);case 50:return e.abrupt("return",c.url);case 51:case"end":return e.stop()}}),e,this,[[10,18],[22,33]])})))}},{key:"perform",value:function(t,e){return qc.throwError(t+" not implemented",h.b.errors.NOT_IMPLEMENTED,{operation:t})}},{key:"_startEvent",value:function(t){this.polling=this._events.filter((function(t){return t.pollable()})).length>0}},{key:"_stopEvent",value:function(t){this.polling=this._events.filter((function(t){return t.pollable()})).length>0}},{key:"_addEventListener",value:function(t,e,r){var n=new $c(Zc(t),e,r);return this._events.push(n),this._startEvent(n),this}},{key:"on",value:function(t,e){return this._addEventListener(t,e,!1)}},{key:"once",value:function(t,e){return this._addEventListener(t,e,!0)}},{key:"emit",value:function(t){for(var e=this,r=arguments.length,n=new Array(r>1?r-1:0),i=1;i<r;i++)n[i-1]=arguments[i];var o=!1,a=[],s=Zc(t);return this._events=this._events.filter((function(t){return t.tag!==s||(setTimeout((function(){t.listener.apply(e,n)}),0),o=!0,!t.once||(a.push(t),!1))})),a.forEach((function(t){e._stopEvent(t)})),o}},{key:"listenerCount",value:function(t){if(!t)return this._events.length;var e=Zc(t);return this._events.filter((function(t){return t.tag===e})).length}},{key:"listeners",value:function(t){if(null==t)return this._events.map((function(t){return t.listener}));var e=Zc(t);return this._events.filter((function(t){return t.tag===e})).map((function(t){return t.listener}))}},{key:"off",value:function(t,e){var r=this;if(null==e)return this.removeAllListeners(t);var n=[],i=!1,o=Zc(t);return this._events=this._events.filter((function(t){return t.tag!==o||t.listener!=e||(!!i||(i=!0,n.push(t),!1))})),n.forEach((function(t){r._stopEvent(t)})),this}},{key:"removeAllListeners",value:function(t){var e=this,r=[];if(null==t)r=this._events,this._events=[];else{var n=Zc(t);this._events=this._events.filter((function(t){return t.tag!==n||(r.push(t),!1)}))}return r.forEach((function(t){e._stopEvent(t)})),this}}],[{key:"getFormatter",value:function(){return null==hA&&(hA=new Dc),hA}},{key:"getNetwork",value:function(t){return Ms(null==t?"homestead":t)}}]),r}(kn);function gA(){return(gA="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,r){var n=pA(t,e);if(n){var i=Object.getOwnPropertyDescriptor(n,e);return i.get?i.get.call(arguments.length<3?t:r):i.value}}).apply(this,arguments)}function pA(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=QA(t)););return t}function yA(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */yA=function(){return t};var t={},e=Object.prototype,r=e.hasOwnProperty,n=Object.defineProperty||function(t,e,r){t[e]=r.value},i="function"==typeof Symbol?Symbol:{},o=i.iterator||"@@iterator",a=i.asyncIterator||"@@asyncIterator",s=i.toStringTag||"@@toStringTag";function c(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{c({},"")}catch(t){c=function(t,e,r){return t[e]=r}}function A(t,e,r,i){var o=e&&e.prototype instanceof h?e:h,a=Object.create(o.prototype),s=new B(i||[]);return n(a,"_invoke",{value:E(t,r,s)}),a}function u(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=A;var f={};function h(){}function l(){}function d(){}var g={};c(g,o,(function(){return this}));var p=Object.getPrototypeOf,y=p&&p(p(Q([])));y&&y!==e&&r.call(y,o)&&(g=y);var I=d.prototype=h.prototype=Object.create(g);function b(t){["next","throw","return"].forEach((function(e){c(t,e,(function(t){return this._invoke(e,t)}))}))}function v(t,e){var i;n(this,"_invoke",{value:function(n,o){function a(){return new e((function(i,a){!function n(i,o,a,s){var c=u(t[i],t,o);if("throw"!==c.type){var A=c.arg,f=A.value;return f&&"object"==kA(f)&&r.call(f,"__await")?e.resolve(f.__await).then((function(t){n("next",t,a,s)}),(function(t){n("throw",t,a,s)})):e.resolve(f).then((function(t){A.value=t,a(A)}),(function(t){return n("throw",t,a,s)}))}s(c.arg)}(n,o,i,a)}))}return i=i?i.then(a,a):a()}})}function E(t,e,r){var n="suspendedStart";return function(i,o){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===i)throw o;return k()}for(r.method=i,r.arg=o;;){var a=r.delegate;if(a){var s=m(a,r);if(s){if(s===f)continue;return s}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var c=u(t,e,r);if("normal"===c.type){if(n=r.done?"completed":"suspendedYield",c.arg===f)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(n="completed",r.method="throw",r.arg=c.arg)}}}function m(t,e){var r=e.method,n=t.iterator[r];if(void 0===n)return e.delegate=null,"throw"===r&&t.iterator.return&&(e.method="return",e.arg=void 0,m(t,e),"throw"===e.method)||"return"!==r&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+r+"' method")),f;var i=u(n,t.iterator,e.arg);if("throw"===i.type)return e.method="throw",e.arg=i.arg,e.delegate=null,f;var o=i.arg;return o?o.done?(e[t.resultName]=o.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,f):o:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,f)}function C(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function w(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function B(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(C,this),this.reset(!0)}function Q(t){if(t){var e=t[o];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,i=function e(){for(;++n<t.length;)if(r.call(t,n))return e.value=t[n],e.done=!1,e;return e.value=void 0,e.done=!0,e};return i.next=i}}return{next:k}}function k(){return{value:void 0,done:!0}}return l.prototype=d,n(I,"constructor",{value:d,configurable:!0}),n(d,"constructor",{value:l,configurable:!0}),l.displayName=c(d,s,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===l||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,d):(t.__proto__=d,c(t,s,"GeneratorFunction")),t.prototype=Object.create(I),t},t.awrap=function(t){return{__await:t}},b(v.prototype),c(v.prototype,a,(function(){return this})),t.AsyncIterator=v,t.async=function(e,r,n,i,o){void 0===o&&(o=Promise);var a=new v(A(e,r,n,i),o);return t.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},b(I),c(I,s,"Generator"),c(I,o,(function(){return this})),c(I,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},t.values=Q,B.prototype={constructor:B,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(w),!t)for(var e in this)"t"===e.charAt(0)&&r.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function n(r,n){return a.type="throw",a.arg=t,e.next=r,n&&(e.method="next",e.arg=void 0),!!n}for(var i=this.tryEntries.length-1;i>=0;--i){var o=this.tryEntries[i],a=o.completion;if("root"===o.tryLoc)return n("end");if(o.tryLoc<=this.prev){var s=r.call(o,"catchLoc"),c=r.call(o,"finallyLoc");if(s&&c){if(this.prev<o.catchLoc)return n(o.catchLoc,!0);if(this.prev<o.finallyLoc)return n(o.finallyLoc)}else if(s){if(this.prev<o.catchLoc)return n(o.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return n(o.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&r.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var o=i;break}}o&&("break"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc&&(o=null);var a=o?o.completion:{};return a.type=t,a.arg=e,o?(this.method="next",this.next=o.finallyLoc,f):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),f},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),w(r),f}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var i=n.arg;w(r)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:Q(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),f}},t}function IA(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function bA(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,(i=n.key,o=void 0,o=function(t,e){if("object"!==kA(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==kA(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(i,"string"),"symbol"===kA(o)?o:String(o)),n)}var i,o}function vA(t,e,r){return e&&bA(t.prototype,e),r&&bA(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function EA(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&mA(t,e)}function mA(t,e){return(mA=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}function CA(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=QA(t);if(e){var i=QA(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return wA(this,r)}}function wA(t,e){if(e&&("object"===kA(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return BA(t)}function BA(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function QA(t){return(QA=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function kA(t){return(kA="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var SA=function(t,e,r,n){return new(r||(r=Promise))((function(i,o){function a(t){try{c(n.next(t))}catch(t){o(t)}}function s(t){try{c(n.throw(t))}catch(t){o(t)}}function c(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(a,s)}c((n=n.apply(t,e||[])).next())}))},_A=new h.b("providers/5.7.2"),DA=["call","estimateGas"];function xA(t,e){if(null==t)return null;if("string"==typeof t.message&&t.message.match("reverted")){var r=Object(A.l)(t.data)?t.data:null;if(!e||r)return{message:t.message,data:r}}if("object"===kA(t)){for(var n in t){var i=xA(t[n],e);if(i)return i}return null}if("string"==typeof t)try{return xA(JSON.parse(t),e)}catch(t){}return null}function MA(t,e,r){var n=r.transaction||r.signedTransaction;if("call"===t){var i=xA(e,!0);if(i)return i.data;_A.throwError("missing revert data in call exception; Transaction reverted without a reason string",h.b.errors.CALL_EXCEPTION,{data:"0x",transaction:n,error:e})}if("estimateGas"===t){var o=xA(e.body,!1);null==o&&(o=xA(e,!1)),o&&_A.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",h.b.errors.UNPREDICTABLE_GAS_LIMIT,{reason:o.message,method:t,transaction:n,error:e})}var a=e.message;throw e.code===h.b.errors.SERVER_ERROR&&e.error&&"string"==typeof e.error.message?a=e.error.message:"string"==typeof e.body?a=e.body:"string"==typeof e.responseText&&(a=e.responseText),(a=(a||"").toLowerCase()).match(/insufficient funds|base fee exceeds gas limit|InsufficientFunds/i)&&_A.throwError("insufficient funds for intrinsic transaction cost",h.b.errors.INSUFFICIENT_FUNDS,{error:e,method:t,transaction:n}),a.match(/nonce (is )?too low/i)&&_A.throwError("nonce has already been used",h.b.errors.NONCE_EXPIRED,{error:e,method:t,transaction:n}),a.match(/replacement transaction underpriced|transaction gas price.*too low/i)&&_A.throwError("replacement fee too low",h.b.errors.REPLACEMENT_UNDERPRICED,{error:e,method:t,transaction:n}),a.match(/only replay-protected/i)&&_A.throwError("legacy pre-eip-155 transactions not supported",h.b.errors.UNSUPPORTED_OPERATION,{error:e,method:t,transaction:n}),DA.indexOf(t)>=0&&a.match(/gas required exceeds allowance|always failing transaction|execution reverted|revert/)&&_A.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",h.b.errors.UNPREDICTABLE_GAS_LIMIT,{error:e,method:t,transaction:n}),e}function RA(t){return new Promise((function(e){setTimeout(e,t)}))}function OA(t){if(t.error){var e=new Error(t.error.message);throw e.code=t.error.code,e.data=t.error.data,e}return t.result}function NA(t){return t?t.toLowerCase():t}var PA={},jA=function(t){EA(r,t);var e=CA(r);function r(t,n,i){var o;if(IA(this,r),o=e.call(this),t!==PA)throw new Error("do not call the JsonRpcSigner constructor directly; use provider.getSigner");return D(BA(o),"provider",n),null==i&&(i=0),"string"==typeof i?(D(BA(o),"_address",o.provider.formatter.address(i)),D(BA(o),"_index",null)):"number"==typeof i?(D(BA(o),"_index",i),D(BA(o),"_address",null)):_A.throwArgumentError("invalid address or index","addressOrIndex",i),o}return vA(r,[{key:"connect",value:function(t){return _A.throwError("cannot alter JSON-RPC Signer connection",h.b.errors.UNSUPPORTED_OPERATION,{operation:"connect"})}},{key:"connectUnchecked",value:function(){return new LA(PA,this.provider,this._address||this._index)}},{key:"getAddress",value:function(){var t=this;return this._address?Promise.resolve(this._address):this.provider.send("eth_accounts",[]).then((function(e){return e.length<=t._index&&_A.throwError("unknown account #"+t._index,h.b.errors.UNSUPPORTED_OPERATION,{operation:"getAddress"}),t.provider.formatter.address(e[t._index])}))}},{key:"sendUncheckedTransaction",value:function(t){var e=this;t=O(t);var r=this.getAddress().then((function(t){return t&&(t=t.toLowerCase()),t}));if(null==t.gasLimit){var n=O(t);n.from=r,t.gasLimit=this.provider.estimateGas(n)}return null!=t.to&&(t.to=Promise.resolve(t.to).then((function(t){return SA(e,void 0,void 0,yA().mark((function e(){var r;return yA().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!=t){e.next=2;break}return e.abrupt("return",null);case 2:return e.next=4,this.provider.resolveName(t);case 4:return null==(r=e.sent)&&_A.throwArgumentError("provided ENS name resolves to null","tx.to",t),e.abrupt("return",r);case 7:case"end":return e.stop()}}),e,this)})))}))),M({tx:M(t),sender:r}).then((function(r){var n=r.tx,i=r.sender;null!=n.from?n.from.toLowerCase()!==i&&_A.throwArgumentError("from address mismatch","transaction",t):n.from=i;var o=e.provider.constructor.hexlifyTransaction(n,{from:!0});return e.provider.send("eth_sendTransaction",[o]).then((function(t){return t}),(function(t){return"string"==typeof t.message&&t.message.match(/user denied/i)&&_A.throwError("user rejected transaction",h.b.errors.ACTION_REJECTED,{action:"sendTransaction",transaction:n}),MA("sendTransaction",t,o)}))}))}},{key:"signTransaction",value:function(t){return _A.throwError("signing transactions is unsupported",h.b.errors.UNSUPPORTED_OPERATION,{operation:"signTransaction"})}},{key:"sendTransaction",value:function(t){return SA(this,void 0,void 0,yA().mark((function e(){var r,n,i=this;return yA().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.provider._getInternalBlockNumber(100+2*this.provider.pollingInterval);case 2:return r=e.sent,e.next=5,this.sendUncheckedTransaction(t);case 5:return n=e.sent,e.prev=6,e.next=9,wc((function(){return SA(i,void 0,void 0,yA().mark((function t(){var e;return yA().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.provider.getTransaction(n);case 2:if(null!==(e=t.sent)){t.next=5;break}return t.abrupt("return",void 0);case 5:return t.abrupt("return",this.provider._wrapTransaction(e,n,r));case 6:case"end":return t.stop()}}),t,this)})))}),{oncePoll:this.provider});case 9:return e.abrupt("return",e.sent);case 12:throw e.prev=12,e.t0=e.catch(6),e.t0.transactionHash=n,e.t0;case 16:case"end":return e.stop()}}),e,this,[[6,12]])})))}},{key:"signMessage",value:function(t){return SA(this,void 0,void 0,yA().mark((function e(){var r,n;return yA().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r="string"==typeof t?Ct(t):t,e.next=3,this.getAddress();case 3:return n=e.sent,e.prev=4,e.next=7,this.provider.send("personal_sign",[Object(A.i)(r),n.toLowerCase()]);case 7:return e.abrupt("return",e.sent);case 10:throw e.prev=10,e.t0=e.catch(4),"string"==typeof e.t0.message&&e.t0.message.match(/user denied/i)&&_A.throwError("user rejected signing",h.b.errors.ACTION_REJECTED,{action:"signMessage",from:n,messageData:t}),e.t0;case 14:case"end":return e.stop()}}),e,this,[[4,10]])})))}},{key:"_legacySignMessage",value:function(t){return SA(this,void 0,void 0,yA().mark((function e(){var r,n;return yA().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r="string"==typeof t?Ct(t):t,e.next=3,this.getAddress();case 3:return n=e.sent,e.prev=4,e.next=7,this.provider.send("eth_sign",[n.toLowerCase(),Object(A.i)(r)]);case 7:return e.abrupt("return",e.sent);case 10:throw e.prev=10,e.t0=e.catch(4),"string"==typeof e.t0.message&&e.t0.message.match(/user denied/i)&&_A.throwError("user rejected signing",h.b.errors.ACTION_REJECTED,{action:"_legacySignMessage",from:n,messageData:t}),e.t0;case 14:case"end":return e.stop()}}),e,this,[[4,10]])})))}},{key:"_signTypedData",value:function(t,e,r){return SA(this,void 0,void 0,yA().mark((function n(){var i,o,a=this;return yA().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,xo.resolveNames(t,e,r,(function(t){return a.provider.resolveName(t)}));case 2:return i=n.sent,n.next=5,this.getAddress();case 5:return o=n.sent,n.prev=6,n.next=9,this.provider.send("eth_signTypedData_v4",[o.toLowerCase(),JSON.stringify(xo.getPayload(i.domain,e,i.value))]);case 9:return n.abrupt("return",n.sent);case 12:throw n.prev=12,n.t0=n.catch(6),"string"==typeof n.t0.message&&n.t0.message.match(/user denied/i)&&_A.throwError("user rejected signing",h.b.errors.ACTION_REJECTED,{action:"_signTypedData",from:o,messageData:{domain:i.domain,types:e,value:i.value}}),n.t0;case 16:case"end":return n.stop()}}),n,this,[[6,12]])})))}},{key:"unlock",value:function(t){return SA(this,void 0,void 0,yA().mark((function e(){var r,n;return yA().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=this.provider,e.next=3,this.getAddress();case 3:return n=e.sent,e.abrupt("return",r.send("personal_unlockAccount",[n.toLowerCase(),t,null]));case 5:case"end":return e.stop()}}),e,this)})))}}]),r}(Gn),LA=function(t){EA(r,t);var e=CA(r);function r(){return IA(this,r),e.apply(this,arguments)}return vA(r,[{key:"sendTransaction",value:function(t){var e=this;return this.sendUncheckedTransaction(t).then((function(t){return{hash:t,nonce:null,gasLimit:null,gasPrice:null,data:null,value:null,chainId:null,confirmations:0,from:null,wait:function(r){return e.provider.waitForTransaction(t,r)}}}))}}]),r}(jA),FA={chainId:!0,data:!0,gasLimit:!0,gasPrice:!0,nonce:!0,to:!0,value:!0,type:!0,accessList:!0,maxFeePerGas:!0,maxPriorityFeePerGas:!0},TA=function(t){EA(r,t);var e=CA(r);function r(t,n){var i;IA(this,r);var o=n;return null==o&&(o=new Promise((function(t,e){setTimeout((function(){i.detectNetwork().then((function(e){t(e)}),(function(t){e(t)}))}),0)}))),i=e.call(this,o),t||(t=x(i.constructor,"defaultUrl")()),D(BA(i),"connection","string"==typeof t?Object.freeze({url:t}):Object.freeze(O(t))),i._nextId=42,i}return vA(r,[{key:"_cache",get:function(){return null==this._eventLoopCache&&(this._eventLoopCache={}),this._eventLoopCache}},{key:"detectNetwork",value:function(){var t=this;return this._cache.detectNetwork||(this._cache.detectNetwork=this._uncachedDetectNetwork(),setTimeout((function(){t._cache.detectNetwork=null}),0)),this._cache.detectNetwork}},{key:"_uncachedDetectNetwork",value:function(){return SA(this,void 0,void 0,yA().mark((function t(){var e,r;return yA().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,RA(0);case 2:return e=null,t.prev=3,t.next=6,this.send("eth_chainId",[]);case 6:e=t.sent,t.next=19;break;case 9:return t.prev=9,t.t0=t.catch(3),t.prev=11,t.next=14,this.send("net_version",[]);case 14:e=t.sent,t.next=19;break;case 17:t.prev=17,t.t1=t.catch(11);case 19:if(null==e){t.next=28;break}return r=x(this.constructor,"getNetwork"),t.prev=21,t.abrupt("return",r(b.from(e).toNumber()));case 25:return t.prev=25,t.t2=t.catch(21),t.abrupt("return",_A.throwError("could not detect network",h.b.errors.NETWORK_ERROR,{chainId:e,event:"invalidNetwork",serverError:t.t2}));case 28:return t.abrupt("return",_A.throwError("could not detect network",h.b.errors.NETWORK_ERROR,{event:"noNetwork"}));case 29:case"end":return t.stop()}}),t,this,[[3,9],[11,17],[21,25]])})))}},{key:"getSigner",value:function(t){return new jA(PA,this,t)}},{key:"getUncheckedSigner",value:function(t){return this.getSigner(t).connectUnchecked()}},{key:"listAccounts",value:function(){var t=this;return this.send("eth_accounts",[]).then((function(e){return e.map((function(e){return t.formatter.address(e)}))}))}},{key:"send",value:function(t,e){var r=this,n={method:t,params:e,id:this._nextId++,jsonrpc:"2.0"};this.emit("debug",{action:"request",request:j(n),provider:this});var i=["eth_chainId","eth_blockNumber"].indexOf(t)>=0;if(i&&this._cache[t])return this._cache[t];var o=Cc(this.connection,JSON.stringify(n),OA).then((function(t){return r.emit("debug",{action:"response",request:n,response:t,provider:r}),t}),(function(t){throw r.emit("debug",{action:"response",error:t,request:n,provider:r}),t}));return i&&(this._cache[t]=o,setTimeout((function(){r._cache[t]=null}),0)),o}},{key:"prepareRequest",value:function(t,e){switch(t){case"getBlockNumber":return["eth_blockNumber",[]];case"getGasPrice":return["eth_gasPrice",[]];case"getBalance":return["eth_getBalance",[NA(e.address),e.blockTag]];case"getTransactionCount":return["eth_getTransactionCount",[NA(e.address),e.blockTag]];case"getCode":return["eth_getCode",[NA(e.address),e.blockTag]];case"getStorageAt":return["eth_getStorageAt",[NA(e.address),Object(A.h)(e.position,32),e.blockTag]];case"sendTransaction":return["eth_sendRawTransaction",[e.signedTransaction]];case"getBlock":return e.blockTag?["eth_getBlockByNumber",[e.blockTag,!!e.includeTransactions]]:e.blockHash?["eth_getBlockByHash",[e.blockHash,!!e.includeTransactions]]:null;case"getTransaction":return["eth_getTransactionByHash",[e.transactionHash]];case"getTransactionReceipt":return["eth_getTransactionReceipt",[e.transactionHash]];case"call":return["eth_call",[x(this.constructor,"hexlifyTransaction")(e.transaction,{from:!0}),e.blockTag]];case"estimateGas":return["eth_estimateGas",[x(this.constructor,"hexlifyTransaction")(e.transaction,{from:!0})]];case"getLogs":return e.filter&&null!=e.filter.address&&(e.filter.address=NA(e.filter.address)),["eth_getLogs",[e.filter]]}return null}},{key:"perform",value:function(t,e){return SA(this,void 0,void 0,yA().mark((function r(){var n,i,o;return yA().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if("call"!==t&&"estimateGas"!==t){r.next=8;break}if(!(n=e.transaction)||null==n.type||!b.from(n.type).isZero()){r.next=8;break}if(null!=n.maxFeePerGas||null!=n.maxPriorityFeePerGas){r.next=8;break}return r.next=6,this.getFeeData();case 6:null==(i=r.sent).maxFeePerGas&&null==i.maxPriorityFeePerGas&&((e=O(e)).transaction=O(n),delete e.transaction.type);case 8:return null==(o=this.prepareRequest(t,e))&&_A.throwError(t+" not implemented",h.b.errors.NOT_IMPLEMENTED,{operation:t}),r.prev=10,r.next=13,this.send(o[0],o[1]);case 13:return r.abrupt("return",r.sent);case 16:return r.prev=16,r.t0=r.catch(10),r.abrupt("return",MA(t,r.t0,e));case 19:case"end":return r.stop()}}),r,this,[[10,16]])})))}},{key:"_startEvent",value:function(t){"pending"===t.tag&&this._startPending(),gA(QA(r.prototype),"_startEvent",this).call(this,t)}},{key:"_startPending",value:function(){if(null==this._pendingFilter){var t=this,e=this.send("eth_newPendingTransactionFilter",[]);this._pendingFilter=e,e.then((function(r){return function n(){t.send("eth_getFilterChanges",[r]).then((function(r){if(t._pendingFilter!=e)return null;var n=Promise.resolve();return r.forEach((function(e){t._emitted["t:"+e.toLowerCase()]="pending",n=n.then((function(){return t.getTransaction(e).then((function(e){return t.emit("pending",e),null}))}))})),n.then((function(){return RA(1e3)}))})).then((function(){if(t._pendingFilter==e)return setTimeout((function(){n()}),0),null;t.send("eth_uninstallFilter",[r])})).catch((function(t){}))}(),r})).catch((function(t){}))}}},{key:"_stopEvent",value:function(t){"pending"===t.tag&&0===this.listenerCount("pending")&&(this._pendingFilter=null),gA(QA(r.prototype),"_stopEvent",this).call(this,t)}}],[{key:"defaultUrl",value:function(){return"http://localhost:8545"}},{key:"hexlifyTransaction",value:function(t,e){var r=O(FA);if(e)for(var n in e)e[n]&&(r[n]=!0);R(t,r);var i={};return["chainId","gasLimit","gasPrice","type","maxFeePerGas","maxPriorityFeePerGas","nonce","value"].forEach((function(e){if(null!=t[e]){var r=Object(A.g)(b.from(t[e]));"gasLimit"===e&&(e="gas"),i[e]=r}})),["from","to","data"].forEach((function(e){null!=t[e]&&(i[e]=Object(A.i)(t[e]))})),t.accessList&&(i.accessList=Ai(t.accessList)),i}}]),r}(dA),UA=null;try{if(null==(UA=WebSocket))throw new Error("inject please")}catch(t){var GA=new h.b("providers/5.7.2");UA=function(){GA.throwError("WebSockets not supported in this environment",h.b.errors.UNSUPPORTED_OPERATION,{operation:"new WebSocket()"})}}function HA(t){return(HA="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function YA(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */YA=function(){return t};var t={},e=Object.prototype,r=e.hasOwnProperty,n=Object.defineProperty||function(t,e,r){t[e]=r.value},i="function"==typeof Symbol?Symbol:{},o=i.iterator||"@@iterator",a=i.asyncIterator||"@@asyncIterator",s=i.toStringTag||"@@toStringTag";function c(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{c({},"")}catch(t){c=function(t,e,r){return t[e]=r}}function A(t,e,r,i){var o=e&&e.prototype instanceof h?e:h,a=Object.create(o.prototype),s=new B(i||[]);return n(a,"_invoke",{value:E(t,r,s)}),a}function u(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=A;var f={};function h(){}function l(){}function d(){}var g={};c(g,o,(function(){return this}));var p=Object.getPrototypeOf,y=p&&p(p(Q([])));y&&y!==e&&r.call(y,o)&&(g=y);var I=d.prototype=h.prototype=Object.create(g);function b(t){["next","throw","return"].forEach((function(e){c(t,e,(function(t){return this._invoke(e,t)}))}))}function v(t,e){var i;n(this,"_invoke",{value:function(n,o){function a(){return new e((function(i,a){!function n(i,o,a,s){var c=u(t[i],t,o);if("throw"!==c.type){var A=c.arg,f=A.value;return f&&"object"==HA(f)&&r.call(f,"__await")?e.resolve(f.__await).then((function(t){n("next",t,a,s)}),(function(t){n("throw",t,a,s)})):e.resolve(f).then((function(t){A.value=t,a(A)}),(function(t){return n("throw",t,a,s)}))}s(c.arg)}(n,o,i,a)}))}return i=i?i.then(a,a):a()}})}function E(t,e,r){var n="suspendedStart";return function(i,o){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===i)throw o;return k()}for(r.method=i,r.arg=o;;){var a=r.delegate;if(a){var s=m(a,r);if(s){if(s===f)continue;return s}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var c=u(t,e,r);if("normal"===c.type){if(n=r.done?"completed":"suspendedYield",c.arg===f)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(n="completed",r.method="throw",r.arg=c.arg)}}}function m(t,e){var r=e.method,n=t.iterator[r];if(void 0===n)return e.delegate=null,"throw"===r&&t.iterator.return&&(e.method="return",e.arg=void 0,m(t,e),"throw"===e.method)||"return"!==r&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+r+"' method")),f;var i=u(n,t.iterator,e.arg);if("throw"===i.type)return e.method="throw",e.arg=i.arg,e.delegate=null,f;var o=i.arg;return o?o.done?(e[t.resultName]=o.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,f):o:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,f)}function C(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function w(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function B(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(C,this),this.reset(!0)}function Q(t){if(t){var e=t[o];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,i=function e(){for(;++n<t.length;)if(r.call(t,n))return e.value=t[n],e.done=!1,e;return e.value=void 0,e.done=!0,e};return i.next=i}}return{next:k}}function k(){return{value:void 0,done:!0}}return l.prototype=d,n(I,"constructor",{value:d,configurable:!0}),n(d,"constructor",{value:l,configurable:!0}),l.displayName=c(d,s,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===l||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,d):(t.__proto__=d,c(t,s,"GeneratorFunction")),t.prototype=Object.create(I),t},t.awrap=function(t){return{__await:t}},b(v.prototype),c(v.prototype,a,(function(){return this})),t.AsyncIterator=v,t.async=function(e,r,n,i,o){void 0===o&&(o=Promise);var a=new v(A(e,r,n,i),o);return t.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},b(I),c(I,s,"Generator"),c(I,o,(function(){return this})),c(I,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},t.values=Q,B.prototype={constructor:B,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(w),!t)for(var e in this)"t"===e.charAt(0)&&r.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function n(r,n){return a.type="throw",a.arg=t,e.next=r,n&&(e.method="next",e.arg=void 0),!!n}for(var i=this.tryEntries.length-1;i>=0;--i){var o=this.tryEntries[i],a=o.completion;if("root"===o.tryLoc)return n("end");if(o.tryLoc<=this.prev){var s=r.call(o,"catchLoc"),c=r.call(o,"finallyLoc");if(s&&c){if(this.prev<o.catchLoc)return n(o.catchLoc,!0);if(this.prev<o.finallyLoc)return n(o.finallyLoc)}else if(s){if(this.prev<o.catchLoc)return n(o.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return n(o.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&r.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var o=i;break}}o&&("break"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc&&(o=null);var a=o?o.completion:{};return a.type=t,a.arg=e,o?(this.method="next",this.next=o.finallyLoc,f):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),f},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),w(r),f}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var i=n.arg;w(r)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:Q(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),f}},t}function KA(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,(i=n.key,o=void 0,o=function(t,e){if("object"!==HA(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==HA(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(i,"string"),"symbol"===HA(o)?o:String(o)),n)}var i,o}function qA(t,e){return(qA=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}function JA(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=XA(t);if(e){var i=XA(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return zA(this,r)}}function zA(t,e){if(e&&("object"===HA(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return ZA(t)}function ZA(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function VA(){return(VA="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,r){var n=WA(t,e);if(n){var i=Object.getOwnPropertyDescriptor(n,e);return i.get?i.get.call(arguments.length<3?t:r):i.value}}).apply(this,arguments)}function WA(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=XA(t)););return t}function XA(t){return(XA=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var $A=function(t,e,r,n){return new(r||(r=Promise))((function(i,o){function a(t){try{c(n.next(t))}catch(t){o(t)}}function s(t){try{c(n.throw(t))}catch(t){o(t)}}function c(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(a,s)}c((n=n.apply(t,e||[])).next())}))},tu=new h.b("providers/5.7.2"),eu=1,ru=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&qA(t,e)}(o,t);var e,r,n,i=JA(o);function o(t,e){var r,n;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,o),"any"===e&&tu.throwError("WebSocketProvider does not support 'any' network yet",h.b.errors.UNSUPPORTED_OPERATION,{operation:"network:any"}),(n="string"==typeof t?i.call(this,t,e):i.call(this,"_websocket",e))._pollingInterval=-1,n._wsReady=!1,D(ZA(n),"_websocket","string"==typeof t?new UA(n.connection.url):t),D(ZA(n),"_requests",{}),D(ZA(n),"_subs",{}),D(ZA(n),"_subIds",{}),D(ZA(n),"_detectNetwork",VA((r=ZA(n),XA(o.prototype)),"detectNetwork",r).call(r)),n.websocket.onopen=function(){n._wsReady=!0,Object.keys(n._requests).forEach((function(t){n.websocket.send(n._requests[t].payload)}))},n.websocket.onmessage=function(t){var e=t.data,r=JSON.parse(e);if(null!=r.id){var i=String(r.id),o=n._requests[i];if(delete n._requests[i],void 0!==r.result)o.callback(null,r.result),n.emit("debug",{action:"response",request:JSON.parse(o.payload),response:r.result,provider:ZA(n)});else{var a=null;r.error?(D(a=new Error(r.error.message||"unknown error"),"code",r.error.code||null),D(a,"response",e)):a=new Error("unknown error"),o.callback(a,void 0),n.emit("debug",{action:"response",error:a,request:JSON.parse(o.payload),provider:ZA(n)})}}else if("eth_subscription"===r.method){var s=n._subs[r.params.subscription];s&&s.processFunc(r.params.result)}else console.warn("this should not happen")};var a=setInterval((function(){n.emit("poll")}),1e3);return a.unref&&a.unref(),zA(n)}return e=o,n=[{key:"defaultUrl",value:function(){return"ws://localhost:8546"}}],(r=[{key:"websocket",get:function(){return this._websocket}},{key:"detectNetwork",value:function(){return this._detectNetwork}},{key:"pollingInterval",get:function(){return 0},set:function(t){tu.throwError("cannot set polling interval on WebSocketProvider",h.b.errors.UNSUPPORTED_OPERATION,{operation:"setPollingInterval"})}},{key:"resetEventsBlock",value:function(t){tu.throwError("cannot reset events block on WebSocketProvider",h.b.errors.UNSUPPORTED_OPERATION,{operation:"resetEventBlock"})}},{key:"poll",value:function(){return $A(this,void 0,void 0,YA().mark((function t(){return YA().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",null);case 1:case"end":return t.stop()}}),t)})))}},{key:"polling",set:function(t){t&&tu.throwError("cannot set polling on WebSocketProvider",h.b.errors.UNSUPPORTED_OPERATION,{operation:"setPolling"})}},{key:"send",value:function(t,e){var r=this,n=eu++;return new Promise((function(i,o){var a=JSON.stringify({method:t,params:e,id:n,jsonrpc:"2.0"});r.emit("debug",{action:"request",request:JSON.parse(a),provider:r}),r._requests[String(n)]={callback:function(t,e){return t?o(t):i(e)},payload:a},r._wsReady&&r.websocket.send(a)}))}},{key:"_subscribe",value:function(t,e,r){return $A(this,void 0,void 0,YA().mark((function n(){var i,o,a=this;return YA().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return null==(i=this._subIds[t])&&(i=Promise.all(e).then((function(t){return a.send("eth_subscribe",t)})),this._subIds[t]=i),n.next=4,i;case 4:o=n.sent,this._subs[o]={tag:t,processFunc:r};case 6:case"end":return n.stop()}}),n,this)})))}},{key:"_startEvent",value:function(t){var e=this;switch(t.type){case"block":this._subscribe("block",["newHeads"],(function(t){var r=b.from(t.number).toNumber();e._emitted.block=r,e.emit("block",r)}));break;case"pending":this._subscribe("pending",["newPendingTransactions"],(function(t){e.emit("pending",t)}));break;case"filter":this._subscribe(t.tag,["logs",this._getFilter(t.filter)],(function(r){null==r.removed&&(r.removed=!1),e.emit(t.filter,e.formatter.filterLog(r))}));break;case"tx":var r=function(t){var r=t.hash;e.getTransactionReceipt(r).then((function(t){t&&e.emit(r,t)}))};r(t),this._subscribe("tx",["newHeads"],(function(t){e._events.filter((function(t){return"tx"===t.type})).forEach(r)}));break;case"debug":case"poll":case"willPoll":case"didPoll":case"error":break;default:console.log("unhandled:",t)}}},{key:"_stopEvent",value:function(t){var e=this,r=t.tag;if("tx"===t.type){if(this._events.filter((function(t){return"tx"===t.type})).length)return;r="tx"}else if(this.listenerCount(t.event))return;var n=this._subIds[r];n&&(delete this._subIds[r],n.then((function(t){e._subs[t]&&(delete e._subs[t],e.send("eth_unsubscribe",[t]))})))}},{key:"destroy",value:function(){return $A(this,void 0,void 0,YA().mark((function t(){var e=this;return YA().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(this.websocket.readyState!==UA.CONNECTING){t.next=3;break}return t.next=3,new Promise((function(t){e.websocket.onopen=function(){t(!0)},e.websocket.onerror=function(){t(!1)}}));case 3:this.websocket.close(1e3);case 4:case"end":return t.stop()}}),t,this)})))}}])&&KA(e.prototype,r),n&&KA(e,n),Object.defineProperty(e,"prototype",{writable:!1}),o}(TA);function nu(t){return(nu="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function iu(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */iu=function(){return t};var t={},e=Object.prototype,r=e.hasOwnProperty,n=Object.defineProperty||function(t,e,r){t[e]=r.value},i="function"==typeof Symbol?Symbol:{},o=i.iterator||"@@iterator",a=i.asyncIterator||"@@asyncIterator",s=i.toStringTag||"@@toStringTag";function c(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{c({},"")}catch(t){c=function(t,e,r){return t[e]=r}}function A(t,e,r,i){var o=e&&e.prototype instanceof h?e:h,a=Object.create(o.prototype),s=new B(i||[]);return n(a,"_invoke",{value:E(t,r,s)}),a}function u(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=A;var f={};function h(){}function l(){}function d(){}var g={};c(g,o,(function(){return this}));var p=Object.getPrototypeOf,y=p&&p(p(Q([])));y&&y!==e&&r.call(y,o)&&(g=y);var I=d.prototype=h.prototype=Object.create(g);function b(t){["next","throw","return"].forEach((function(e){c(t,e,(function(t){return this._invoke(e,t)}))}))}function v(t,e){var i;n(this,"_invoke",{value:function(n,o){function a(){return new e((function(i,a){!function n(i,o,a,s){var c=u(t[i],t,o);if("throw"!==c.type){var A=c.arg,f=A.value;return f&&"object"==nu(f)&&r.call(f,"__await")?e.resolve(f.__await).then((function(t){n("next",t,a,s)}),(function(t){n("throw",t,a,s)})):e.resolve(f).then((function(t){A.value=t,a(A)}),(function(t){return n("throw",t,a,s)}))}s(c.arg)}(n,o,i,a)}))}return i=i?i.then(a,a):a()}})}function E(t,e,r){var n="suspendedStart";return function(i,o){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===i)throw o;return k()}for(r.method=i,r.arg=o;;){var a=r.delegate;if(a){var s=m(a,r);if(s){if(s===f)continue;return s}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var c=u(t,e,r);if("normal"===c.type){if(n=r.done?"completed":"suspendedYield",c.arg===f)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(n="completed",r.method="throw",r.arg=c.arg)}}}function m(t,e){var r=e.method,n=t.iterator[r];if(void 0===n)return e.delegate=null,"throw"===r&&t.iterator.return&&(e.method="return",e.arg=void 0,m(t,e),"throw"===e.method)||"return"!==r&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+r+"' method")),f;var i=u(n,t.iterator,e.arg);if("throw"===i.type)return e.method="throw",e.arg=i.arg,e.delegate=null,f;var o=i.arg;return o?o.done?(e[t.resultName]=o.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,f):o:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,f)}function C(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function w(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function B(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(C,this),this.reset(!0)}function Q(t){if(t){var e=t[o];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,i=function e(){for(;++n<t.length;)if(r.call(t,n))return e.value=t[n],e.done=!1,e;return e.value=void 0,e.done=!0,e};return i.next=i}}return{next:k}}function k(){return{value:void 0,done:!0}}return l.prototype=d,n(I,"constructor",{value:d,configurable:!0}),n(d,"constructor",{value:l,configurable:!0}),l.displayName=c(d,s,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===l||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,d):(t.__proto__=d,c(t,s,"GeneratorFunction")),t.prototype=Object.create(I),t},t.awrap=function(t){return{__await:t}},b(v.prototype),c(v.prototype,a,(function(){return this})),t.AsyncIterator=v,t.async=function(e,r,n,i,o){void 0===o&&(o=Promise);var a=new v(A(e,r,n,i),o);return t.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},b(I),c(I,s,"Generator"),c(I,o,(function(){return this})),c(I,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},t.values=Q,B.prototype={constructor:B,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(w),!t)for(var e in this)"t"===e.charAt(0)&&r.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function n(r,n){return a.type="throw",a.arg=t,e.next=r,n&&(e.method="next",e.arg=void 0),!!n}for(var i=this.tryEntries.length-1;i>=0;--i){var o=this.tryEntries[i],a=o.completion;if("root"===o.tryLoc)return n("end");if(o.tryLoc<=this.prev){var s=r.call(o,"catchLoc"),c=r.call(o,"finallyLoc");if(s&&c){if(this.prev<o.catchLoc)return n(o.catchLoc,!0);if(this.prev<o.finallyLoc)return n(o.finallyLoc)}else if(s){if(this.prev<o.catchLoc)return n(o.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return n(o.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&r.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var o=i;break}}o&&("break"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc&&(o=null);var a=o?o.completion:{};return a.type=t,a.arg=e,o?(this.method="next",this.next=o.finallyLoc,f):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),f},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),w(r),f}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var i=n.arg;w(r)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:Q(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),f}},t}function ou(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function au(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,(i=n.key,o=void 0,o=function(t,e){if("object"!==nu(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==nu(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(i,"string"),"symbol"===nu(o)?o:String(o)),n)}var i,o}function su(t,e,r){return e&&au(t.prototype,e),r&&au(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function cu(){return(cu="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,r){var n=Au(t,e);if(n){var i=Object.getOwnPropertyDescriptor(n,e);return i.get?i.get.call(arguments.length<3?t:r):i.value}}).apply(this,arguments)}function Au(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=gu(t)););return t}function uu(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&fu(t,e)}function fu(t,e){return(fu=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}function hu(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=gu(t);if(e){var i=gu(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return lu(this,r)}}function lu(t,e){if(e&&("object"===nu(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return du(t)}function du(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function gu(t){return(gu=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var pu=function(t,e,r,n){return new(r||(r=Promise))((function(i,o){function a(t){try{c(n.next(t))}catch(t){o(t)}}function s(t){try{c(n.throw(t))}catch(t){o(t)}}function c(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(a,s)}c((n=n.apply(t,e||[])).next())}))},yu=new h.b("providers/5.7.2"),Iu=function(t){uu(r,t);var e=hu(r);function r(){return ou(this,r),e.apply(this,arguments)}return su(r,[{key:"detectNetwork",value:function(){var t=this,e=Object.create(null,{detectNetwork:{get:function(){return cu(gu(r.prototype),"detectNetwork",t)}}});return pu(this,void 0,void 0,iu().mark((function t(){var r;return iu().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(null!=(r=this.network)){t.next=7;break}return t.next=4,e.detectNetwork.call(this);case 4:(r=t.sent)||yu.throwError("no network detected",h.b.errors.UNKNOWN_ERROR,{}),null==this._network&&(D(this,"_network",r),this.emit("network",r,null));case 7:return t.abrupt("return",r);case 8:case"end":return t.stop()}}),t,this)})))}}]),r}(TA),bu=function(t){uu(r,t);var e=hu(r);function r(t,n){var i;ou(this,r),yu.checkAbstract(this instanceof r?this.constructor:void 0,r),t=x(this instanceof r?this.constructor:void 0,"getNetwork")(t),n=x(this instanceof r?this.constructor:void 0,"getApiKey")(n);var o=x(this instanceof r?this.constructor:void 0,"getUrl")(t,n);return i=e.call(this,o,t),"string"==typeof n?D(du(i),"apiKey",n):null!=n&&Object.keys(n).forEach((function(t){D(du(i),t,n[t])})),i}return su(r,[{key:"_startPending",value:function(){yu.warn("WARNING: API provider does not support pending filters")}},{key:"isCommunityResource",value:function(){return!1}},{key:"getSigner",value:function(t){return yu.throwError("API provider does not support signing",h.b.errors.UNSUPPORTED_OPERATION,{operation:"getSigner"})}},{key:"listAccounts",value:function(){return Promise.resolve([])}}],[{key:"getApiKey",value:function(t){return t}},{key:"getUrl",value:function(t,e){return yu.throwError("not implemented; sub-classes must override getUrl",h.b.errors.NOT_IMPLEMENTED,{operation:"getUrl"})}}]),r}(Iu);function vu(t){return(vu="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Eu(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function mu(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,(i=n.key,o=void 0,o=function(t,e){if("object"!==vu(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==vu(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(i,"string"),"symbol"===vu(o)?o:String(o)),n)}var i,o}function Cu(t,e,r){return e&&mu(t.prototype,e),r&&mu(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function wu(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Bu(t,e)}function Bu(t,e){return(Bu=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}function Qu(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=_u(t);if(e){var i=_u(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return ku(this,r)}}function ku(t,e){if(e&&("object"===vu(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return Su(t)}function Su(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function _u(t){return(_u=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var Du=new h.b("providers/5.7.2"),xu="_gg7wSSi0KMBsdKnGVfHDueq6xMB9EkC",Mu=function(t){wu(r,t);var e=Qu(r);function r(t,n){var i;Eu(this,r);var o=new Ru(t,n),a=o.connection.url.replace(/^http/i,"ws").replace(".alchemyapi.",".ws.alchemyapi.");return D(Su(i=e.call(this,a,o.network)),"apiKey",o.apiKey),i}return Cu(r,[{key:"isCommunityResource",value:function(){return this.apiKey===xu}}]),r}(ru),Ru=function(t){wu(r,t);var e=Qu(r);function r(){return Eu(this,r),e.apply(this,arguments)}return Cu(r,[{key:"isCommunityResource",value:function(){return this.apiKey===xu}}],[{key:"getWebSocketProvider",value:function(t,e){return new Mu(t,e)}},{key:"getApiKey",value:function(t){return null==t?xu:(t&&"string"!=typeof t&&Du.throwArgumentError("invalid apiKey","apiKey",t),t)}},{key:"getUrl",value:function(t,e){var r=null;switch(t.name){case"homestead":r="eth-mainnet.alchemyapi.io/v2/";break;case"goerli":r="eth-goerli.g.alchemy.com/v2/";break;case"matic":r="polygon-mainnet.g.alchemy.com/v2/";break;case"maticmum":r="polygon-mumbai.g.alchemy.com/v2/";break;case"arbitrum":r="arb-mainnet.g.alchemy.com/v2/";break;case"arbitrum-goerli":r="arb-goerli.g.alchemy.com/v2/";break;case"optimism":r="opt-mainnet.g.alchemy.com/v2/";break;case"optimism-goerli":r="opt-goerli.g.alchemy.com/v2/";break;default:Du.throwArgumentError("unsupported network","network",arguments[0])}return{allowGzip:!0,url:"https://"+r+e,throttleCallback:function(t,r){return e===xu&&Oc(),Promise.resolve(!0)}}}}]),r}(bu);function Ou(t){return(Ou="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Nu(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Pu(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,(i=n.key,o=void 0,o=function(t,e){if("object"!==Ou(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==Ou(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(i,"string"),"symbol"===Ou(o)?o:String(o)),n)}var i,o}function ju(t,e){return(ju=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}function Lu(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=Tu(t);if(e){var i=Tu(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return Fu(this,r)}}function Fu(t,e){if(e&&("object"===Ou(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function Tu(t){return(Tu=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var Uu=new h.b("providers/5.7.2"),Gu="9f7d929b018cdffb338517efa06f58359e86ff1ffd350bc889738523659e7972";function Hu(t){switch(t){case"homestead":return"rpc.ankr.com/eth/";case"ropsten":return"rpc.ankr.com/eth_ropsten/";case"rinkeby":return"rpc.ankr.com/eth_rinkeby/";case"goerli":return"rpc.ankr.com/eth_goerli/";case"matic":return"rpc.ankr.com/polygon/";case"arbitrum":return"rpc.ankr.com/arbitrum/"}return Uu.throwArgumentError("unsupported network","name",t)}var Yu=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&ju(t,e)}(o,t);var e,r,n,i=Lu(o);function o(){return Nu(this,o),i.apply(this,arguments)}return e=o,n=[{key:"getApiKey",value:function(t){return null==t?Gu:t}},{key:"getUrl",value:function(t,e){null==e&&(e=Gu);var r={allowGzip:!0,url:"https://"+Hu(t.name)+e,throttleCallback:function(t,r){return e.apiKey===Gu&&Oc(),Promise.resolve(!0)}};return null!=e.projectSecret&&(r.user="",r.password=e.projectSecret),r}}],(r=[{key:"isCommunityResource",value:function(){return this.apiKey===Gu}}])&&Pu(e.prototype,r),n&&Pu(e,n),Object.defineProperty(e,"prototype",{writable:!1}),o}(bu);function Ku(t){return(Ku="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function qu(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */qu=function(){return t};var t={},e=Object.prototype,r=e.hasOwnProperty,n=Object.defineProperty||function(t,e,r){t[e]=r.value},i="function"==typeof Symbol?Symbol:{},o=i.iterator||"@@iterator",a=i.asyncIterator||"@@asyncIterator",s=i.toStringTag||"@@toStringTag";function c(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{c({},"")}catch(t){c=function(t,e,r){return t[e]=r}}function A(t,e,r,i){var o=e&&e.prototype instanceof h?e:h,a=Object.create(o.prototype),s=new B(i||[]);return n(a,"_invoke",{value:E(t,r,s)}),a}function u(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=A;var f={};function h(){}function l(){}function d(){}var g={};c(g,o,(function(){return this}));var p=Object.getPrototypeOf,y=p&&p(p(Q([])));y&&y!==e&&r.call(y,o)&&(g=y);var I=d.prototype=h.prototype=Object.create(g);function b(t){["next","throw","return"].forEach((function(e){c(t,e,(function(t){return this._invoke(e,t)}))}))}function v(t,e){var i;n(this,"_invoke",{value:function(n,o){function a(){return new e((function(i,a){!function n(i,o,a,s){var c=u(t[i],t,o);if("throw"!==c.type){var A=c.arg,f=A.value;return f&&"object"==Ku(f)&&r.call(f,"__await")?e.resolve(f.__await).then((function(t){n("next",t,a,s)}),(function(t){n("throw",t,a,s)})):e.resolve(f).then((function(t){A.value=t,a(A)}),(function(t){return n("throw",t,a,s)}))}s(c.arg)}(n,o,i,a)}))}return i=i?i.then(a,a):a()}})}function E(t,e,r){var n="suspendedStart";return function(i,o){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===i)throw o;return k()}for(r.method=i,r.arg=o;;){var a=r.delegate;if(a){var s=m(a,r);if(s){if(s===f)continue;return s}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var c=u(t,e,r);if("normal"===c.type){if(n=r.done?"completed":"suspendedYield",c.arg===f)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(n="completed",r.method="throw",r.arg=c.arg)}}}function m(t,e){var r=e.method,n=t.iterator[r];if(void 0===n)return e.delegate=null,"throw"===r&&t.iterator.return&&(e.method="return",e.arg=void 0,m(t,e),"throw"===e.method)||"return"!==r&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+r+"' method")),f;var i=u(n,t.iterator,e.arg);if("throw"===i.type)return e.method="throw",e.arg=i.arg,e.delegate=null,f;var o=i.arg;return o?o.done?(e[t.resultName]=o.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,f):o:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,f)}function C(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function w(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function B(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(C,this),this.reset(!0)}function Q(t){if(t){var e=t[o];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,i=function e(){for(;++n<t.length;)if(r.call(t,n))return e.value=t[n],e.done=!1,e;return e.value=void 0,e.done=!0,e};return i.next=i}}return{next:k}}function k(){return{value:void 0,done:!0}}return l.prototype=d,n(I,"constructor",{value:d,configurable:!0}),n(d,"constructor",{value:l,configurable:!0}),l.displayName=c(d,s,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===l||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,d):(t.__proto__=d,c(t,s,"GeneratorFunction")),t.prototype=Object.create(I),t},t.awrap=function(t){return{__await:t}},b(v.prototype),c(v.prototype,a,(function(){return this})),t.AsyncIterator=v,t.async=function(e,r,n,i,o){void 0===o&&(o=Promise);var a=new v(A(e,r,n,i),o);return t.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},b(I),c(I,s,"Generator"),c(I,o,(function(){return this})),c(I,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},t.values=Q,B.prototype={constructor:B,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(w),!t)for(var e in this)"t"===e.charAt(0)&&r.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function n(r,n){return a.type="throw",a.arg=t,e.next=r,n&&(e.method="next",e.arg=void 0),!!n}for(var i=this.tryEntries.length-1;i>=0;--i){var o=this.tryEntries[i],a=o.completion;if("root"===o.tryLoc)return n("end");if(o.tryLoc<=this.prev){var s=r.call(o,"catchLoc"),c=r.call(o,"finallyLoc");if(s&&c){if(this.prev<o.catchLoc)return n(o.catchLoc,!0);if(this.prev<o.finallyLoc)return n(o.finallyLoc)}else if(s){if(this.prev<o.catchLoc)return n(o.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return n(o.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&r.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var o=i;break}}o&&("break"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc&&(o=null);var a=o?o.completion:{};return a.type=t,a.arg=e,o?(this.method="next",this.next=o.finallyLoc,f):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),f},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),w(r),f}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var i=n.arg;w(r)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:Q(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),f}},t}function Ju(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function zu(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,(i=n.key,o=void 0,o=function(t,e){if("object"!==Ku(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==Ku(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(i,"string"),"symbol"===Ku(o)?o:String(o)),n)}var i,o}function Zu(){return(Zu="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,r){var n=Vu(t,e);if(n){var i=Object.getOwnPropertyDescriptor(n,e);return i.get?i.get.call(arguments.length<3?t:r):i.value}}).apply(this,arguments)}function Vu(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=tf(t)););return t}function Wu(t,e){return(Wu=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}function Xu(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=tf(t);if(e){var i=tf(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return $u(this,r)}}function $u(t,e){if(e&&("object"===Ku(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function tf(t){return(tf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var ef=function(t,e,r,n){return new(r||(r=Promise))((function(i,o){function a(t){try{c(n.next(t))}catch(t){o(t)}}function s(t){try{c(n.throw(t))}catch(t){o(t)}}function c(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(a,s)}c((n=n.apply(t,e||[])).next())}))},rf=new h.b("providers/5.7.2"),nf=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Wu(t,e)}(o,t);var e,r,n,i=Xu(o);function o(){return Ju(this,o),i.apply(this,arguments)}return e=o,n=[{key:"getApiKey",value:function(t){return null!=t&&rf.throwArgumentError("apiKey not supported for cloudflare","apiKey",t),null}},{key:"getUrl",value:function(t,e){var r=null;switch(t.name){case"homestead":r="https://cloudflare-eth.com/";break;default:rf.throwArgumentError("unsupported network","network",arguments[0])}return r}}],(r=[{key:"perform",value:function(t,e){var r=this,n=Object.create(null,{perform:{get:function(){return Zu(tf(o.prototype),"perform",r)}}});return ef(this,void 0,void 0,qu().mark((function r(){var i;return qu().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if("getBlockNumber"!==t){r.next=5;break}return r.next=3,n.perform.call(this,"getBlock",{blockTag:"latest"});case 3:return i=r.sent,r.abrupt("return",i.number);case 5:return r.abrupt("return",n.perform.call(this,t,e));case 6:case"end":return r.stop()}}),r,this)})))}}])&&zu(e.prototype,r),n&&zu(e,n),Object.defineProperty(e,"prototype",{writable:!1}),o}(bu);function of(t){return(of="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function af(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */af=function(){return t};var t={},e=Object.prototype,r=e.hasOwnProperty,n=Object.defineProperty||function(t,e,r){t[e]=r.value},i="function"==typeof Symbol?Symbol:{},o=i.iterator||"@@iterator",a=i.asyncIterator||"@@asyncIterator",s=i.toStringTag||"@@toStringTag";function c(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{c({},"")}catch(t){c=function(t,e,r){return t[e]=r}}function A(t,e,r,i){var o=e&&e.prototype instanceof h?e:h,a=Object.create(o.prototype),s=new B(i||[]);return n(a,"_invoke",{value:E(t,r,s)}),a}function u(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=A;var f={};function h(){}function l(){}function d(){}var g={};c(g,o,(function(){return this}));var p=Object.getPrototypeOf,y=p&&p(p(Q([])));y&&y!==e&&r.call(y,o)&&(g=y);var I=d.prototype=h.prototype=Object.create(g);function b(t){["next","throw","return"].forEach((function(e){c(t,e,(function(t){return this._invoke(e,t)}))}))}function v(t,e){var i;n(this,"_invoke",{value:function(n,o){function a(){return new e((function(i,a){!function n(i,o,a,s){var c=u(t[i],t,o);if("throw"!==c.type){var A=c.arg,f=A.value;return f&&"object"==of(f)&&r.call(f,"__await")?e.resolve(f.__await).then((function(t){n("next",t,a,s)}),(function(t){n("throw",t,a,s)})):e.resolve(f).then((function(t){A.value=t,a(A)}),(function(t){return n("throw",t,a,s)}))}s(c.arg)}(n,o,i,a)}))}return i=i?i.then(a,a):a()}})}function E(t,e,r){var n="suspendedStart";return function(i,o){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===i)throw o;return k()}for(r.method=i,r.arg=o;;){var a=r.delegate;if(a){var s=m(a,r);if(s){if(s===f)continue;return s}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var c=u(t,e,r);if("normal"===c.type){if(n=r.done?"completed":"suspendedYield",c.arg===f)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(n="completed",r.method="throw",r.arg=c.arg)}}}function m(t,e){var r=e.method,n=t.iterator[r];if(void 0===n)return e.delegate=null,"throw"===r&&t.iterator.return&&(e.method="return",e.arg=void 0,m(t,e),"throw"===e.method)||"return"!==r&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+r+"' method")),f;var i=u(n,t.iterator,e.arg);if("throw"===i.type)return e.method="throw",e.arg=i.arg,e.delegate=null,f;var o=i.arg;return o?o.done?(e[t.resultName]=o.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,f):o:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,f)}function C(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function w(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function B(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(C,this),this.reset(!0)}function Q(t){if(t){var e=t[o];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,i=function e(){for(;++n<t.length;)if(r.call(t,n))return e.value=t[n],e.done=!1,e;return e.value=void 0,e.done=!0,e};return i.next=i}}return{next:k}}function k(){return{value:void 0,done:!0}}return l.prototype=d,n(I,"constructor",{value:d,configurable:!0}),n(d,"constructor",{value:l,configurable:!0}),l.displayName=c(d,s,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===l||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,d):(t.__proto__=d,c(t,s,"GeneratorFunction")),t.prototype=Object.create(I),t},t.awrap=function(t){return{__await:t}},b(v.prototype),c(v.prototype,a,(function(){return this})),t.AsyncIterator=v,t.async=function(e,r,n,i,o){void 0===o&&(o=Promise);var a=new v(A(e,r,n,i),o);return t.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},b(I),c(I,s,"Generator"),c(I,o,(function(){return this})),c(I,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},t.values=Q,B.prototype={constructor:B,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(w),!t)for(var e in this)"t"===e.charAt(0)&&r.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function n(r,n){return a.type="throw",a.arg=t,e.next=r,n&&(e.method="next",e.arg=void 0),!!n}for(var i=this.tryEntries.length-1;i>=0;--i){var o=this.tryEntries[i],a=o.completion;if("root"===o.tryLoc)return n("end");if(o.tryLoc<=this.prev){var s=r.call(o,"catchLoc"),c=r.call(o,"finallyLoc");if(s&&c){if(this.prev<o.catchLoc)return n(o.catchLoc,!0);if(this.prev<o.finallyLoc)return n(o.finallyLoc)}else if(s){if(this.prev<o.catchLoc)return n(o.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return n(o.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&r.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var o=i;break}}o&&("break"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc&&(o=null);var a=o?o.completion:{};return a.type=t,a.arg=e,o?(this.method="next",this.next=o.finallyLoc,f):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),f},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),w(r),f}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var i=n.arg;w(r)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:Q(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),f}},t}function sf(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,(i=n.key,o=void 0,o=function(t,e){if("object"!==of(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==of(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(i,"string"),"symbol"===of(o)?o:String(o)),n)}var i,o}function cf(){return(cf="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,r){var n=Af(t,e);if(n){var i=Object.getOwnPropertyDescriptor(n,e);return i.get?i.get.call(arguments.length<3?t:r):i.value}}).apply(this,arguments)}function Af(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=df(t)););return t}function uf(t,e){return(uf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}function ff(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=df(t);if(e){var i=df(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return hf(this,r)}}function hf(t,e){if(e&&("object"===of(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return lf(t)}function lf(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function df(t){return(df=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var gf=function(t,e,r,n){return new(r||(r=Promise))((function(i,o){function a(t){try{c(n.next(t))}catch(t){o(t)}}function s(t){try{c(n.throw(t))}catch(t){o(t)}}function c(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(a,s)}c((n=n.apply(t,e||[])).next())}))},pf=new h.b("providers/5.7.2");function yf(t){var e={};for(var r in t)if(null!=t[r]){var n=t[r];"type"===r&&0===n||(n={type:!0,gasLimit:!0,gasPrice:!0,maxFeePerGs:!0,maxPriorityFeePerGas:!0,nonce:!0,value:!0}[r]?Object(A.g)(Object(A.i)(n)):"accessList"===r?"["+Ai(n).map((function(t){return'{address:"'.concat(t.address,'",storageKeys:["').concat(t.storageKeys.join('","'),'"]}')})).join(",")+"]":Object(A.i)(n),e[r]=n)}return e}function If(t){if(0==t.status&&("No records found"===t.message||"No transactions found"===t.message))return t.result;if(1!=t.status||"string"!=typeof t.message||!t.message.match(/^OK/)){var e=new Error("invalid response");throw e.result=JSON.stringify(t),(t.result||"").toLowerCase().indexOf("rate limit")>=0&&(e.throttleRetry=!0),e}return t.result}function bf(t){if(t&&0==t.status&&"NOTOK"==t.message&&(t.result||"").toLowerCase().indexOf("rate limit")>=0){var e=new Error("throttled response");throw e.result=JSON.stringify(t),e.throttleRetry=!0,e}if("2.0"!=t.jsonrpc){var r=new Error("invalid response");throw r.result=JSON.stringify(t),r}if(t.error){var n=new Error(t.error.message||"unknown error");throw t.error.code&&(n.code=t.error.code),t.error.data&&(n.data=t.error.data),n}return t.result}function vf(t){if("pending"===t)throw new Error("pending not supported");return"latest"===t?t:parseInt(t.substring(2),16)}function Ef(t,e,r){if("call"===t&&e.code===h.b.errors.SERVER_ERROR){var n=e.error;if(n&&(n.message.match(/reverted/i)||n.message.match(/VM execution error/i))){var i=n.data;if(i&&(i="0x"+i.replace(/^.*0x/i,"")),Object(A.l)(i))return i;pf.throwError("missing revert data in call exception",h.b.errors.CALL_EXCEPTION,{error:e,data:"0x"})}}var o=e.message;throw e.code===h.b.errors.SERVER_ERROR&&(e.error&&"string"==typeof e.error.message?o=e.error.message:"string"==typeof e.body?o=e.body:"string"==typeof e.responseText&&(o=e.responseText)),(o=(o||"").toLowerCase()).match(/insufficient funds/)&&pf.throwError("insufficient funds for intrinsic transaction cost",h.b.errors.INSUFFICIENT_FUNDS,{error:e,method:t,transaction:r}),o.match(/same hash was already imported|transaction nonce is too low|nonce too low/)&&pf.throwError("nonce has already been used",h.b.errors.NONCE_EXPIRED,{error:e,method:t,transaction:r}),o.match(/another transaction with same nonce/)&&pf.throwError("replacement fee too low",h.b.errors.REPLACEMENT_UNDERPRICED,{error:e,method:t,transaction:r}),o.match(/execution failed due to an exception|execution reverted/)&&pf.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",h.b.errors.UNPREDICTABLE_GAS_LIMIT,{error:e,method:t,transaction:r}),e}var mf=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&uf(t,e)}(o,t);var e,r,n,i=ff(o);function o(t,e){var r;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,o),D(lf(r=i.call(this,t)),"baseUrl",r.getBaseUrl()),D(lf(r),"apiKey",e||null),r}return e=o,(r=[{key:"getBaseUrl",value:function(){switch(this.network?this.network.name:"invalid"){case"homestead":return"https://api.etherscan.io";case"goerli":return"https://api-goerli.etherscan.io";case"sepolia":return"https://api-sepolia.etherscan.io";case"matic":return"https://api.polygonscan.com";case"maticmum":return"https://api-testnet.polygonscan.com";case"arbitrum":return"https://api.arbiscan.io";case"arbitrum-goerli":return"https://api-goerli.arbiscan.io";case"optimism":return"https://api-optimistic.etherscan.io";case"optimism-goerli":return"https://api-goerli-optimistic.etherscan.io"}return pf.throwArgumentError("unsupported network","network",this.network.name)}},{key:"getUrl",value:function(t,e){var r=Object.keys(e).reduce((function(t,r){var n=e[r];return null!=n&&(t+="&".concat(r,"=").concat(n)),t}),""),n=this.apiKey?"&apikey=".concat(this.apiKey):"";return"".concat(this.baseUrl,"/api?module=").concat(t).concat(r).concat(n)}},{key:"getPostUrl",value:function(){return"".concat(this.baseUrl,"/api")}},{key:"getPostData",value:function(t,e){return e.module=t,e.apikey=this.apiKey,e}},{key:"fetch",value:function(t,e,r){return gf(this,void 0,void 0,af().mark((function n(){var i,o,a,s,c,A,u=this;return af().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return i=r?this.getPostUrl():this.getUrl(t,e),o=r?this.getPostData(t,e):null,a="proxy"===t?bf:If,this.emit("debug",{action:"request",request:i,provider:this}),s={url:i,throttleSlotInterval:1e3,throttleCallback:function(t,e){return u.isCommunityResource()&&Oc(),Promise.resolve(!0)}},c=null,o&&(s.headers={"content-type":"application/x-www-form-urlencoded; charset=UTF-8"},c=Object.keys(o).map((function(t){return"".concat(t,"=").concat(o[t])})).join("&")),n.next=9,Cc(s,c,a||bf);case 9:return A=n.sent,this.emit("debug",{action:"response",request:i,response:j(A),provider:this}),n.abrupt("return",A);case 12:case"end":return n.stop()}}),n,this)})))}},{key:"detectNetwork",value:function(){return gf(this,void 0,void 0,af().mark((function t(){return af().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",this.network);case 1:case"end":return t.stop()}}),t,this)})))}},{key:"perform",value:function(t,e){var r=this,n=Object.create(null,{perform:{get:function(){return cf(df(o.prototype),"perform",r)}}});return gf(this,void 0,void 0,af().mark((function r(){var i,o,a,s,c,A,u,f,l;return af().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:r.t0=t,r.next="getBlockNumber"===r.t0?3:"getGasPrice"===r.t0?4:"getBalance"===r.t0?5:"getTransactionCount"===r.t0?6:"getCode"===r.t0?7:"getStorageAt"===r.t0?8:"sendTransaction"===r.t0?9:"getBlock"===r.t0?10:"getTransaction"===r.t0?13:"getTransactionReceipt"===r.t0?14:"call"===r.t0?15:"estimateGas"===r.t0?29:"getLogs"===r.t0?41:"getEtherPrice"===r.t0?65:72;break;case 3:return r.abrupt("return",this.fetch("proxy",{action:"eth_blockNumber"}));case 4:return r.abrupt("return",this.fetch("proxy",{action:"eth_gasPrice"}));case 5:return r.abrupt("return",this.fetch("account",{action:"balance",address:e.address,tag:e.blockTag}));case 6:return r.abrupt("return",this.fetch("proxy",{action:"eth_getTransactionCount",address:e.address,tag:e.blockTag}));case 7:return r.abrupt("return",this.fetch("proxy",{action:"eth_getCode",address:e.address,tag:e.blockTag}));case 8:return r.abrupt("return",this.fetch("proxy",{action:"eth_getStorageAt",address:e.address,position:e.position,tag:e.blockTag}));case 9:return r.abrupt("return",this.fetch("proxy",{action:"eth_sendRawTransaction",hex:e.signedTransaction},!0).catch((function(t){return Ef("sendTransaction",t,e.signedTransaction)})));case 10:if(!e.blockTag){r.next=12;break}return r.abrupt("return",this.fetch("proxy",{action:"eth_getBlockByNumber",tag:e.blockTag,boolean:e.includeTransactions?"true":"false"}));case 12:throw new Error("getBlock by blockHash not implemented");case 13:return r.abrupt("return",this.fetch("proxy",{action:"eth_getTransactionByHash",txhash:e.transactionHash}));case 14:return r.abrupt("return",this.fetch("proxy",{action:"eth_getTransactionReceipt",txhash:e.transactionHash}));case 15:if("latest"===e.blockTag){r.next=17;break}throw new Error("EtherscanProvider does not support blockTag for call");case 17:return(i=yf(e.transaction)).module="proxy",i.action="eth_call",r.prev=20,r.next=23,this.fetch("proxy",i,!0);case 23:return r.abrupt("return",r.sent);case 26:return r.prev=26,r.t1=r.catch(20),r.abrupt("return",Ef("call",r.t1,e.transaction));case 29:return(o=yf(e.transaction)).module="proxy",o.action="eth_estimateGas",r.prev=32,r.next=35,this.fetch("proxy",o,!0);case 35:return r.abrupt("return",r.sent);case 38:return r.prev=38,r.t2=r.catch(32),r.abrupt("return",Ef("estimateGas",r.t2,e.transaction));case 41:return a={action:"getLogs"},e.filter.fromBlock&&(a.fromBlock=vf(e.filter.fromBlock)),e.filter.toBlock&&(a.toBlock=vf(e.filter.toBlock)),e.filter.address&&(a.address=e.filter.address),e.filter.topics&&e.filter.topics.length>0&&(e.filter.topics.length>1&&pf.throwError("unsupported topic count",h.b.errors.UNSUPPORTED_OPERATION,{topics:e.filter.topics}),1===e.filter.topics.length&&("string"==typeof(s=e.filter.topics[0])&&66===s.length||pf.throwError("unsupported topic format",h.b.errors.UNSUPPORTED_OPERATION,{topic0:s}),a.topic0=s)),r.next=48,this.fetch("logs",a);case 48:c=r.sent,A={},u=0;case 51:if(!(u<c.length)){r.next=64;break}if(null==(f=c[u]).blockHash){r.next=55;break}return r.abrupt("continue",61);case 55:if(null!=A[f.blockNumber]){r.next=60;break}return r.next=58,this.getBlock(f.blockNumber);case 58:(l=r.sent)&&(A[f.blockNumber]=l.hash);case 60:f.blockHash=A[f.blockNumber];case 61:u++,r.next=51;break;case 64:return r.abrupt("return",c);case 65:if("homestead"===this.network.name){r.next=67;break}return r.abrupt("return",0);case 67:return r.t3=parseFloat,r.next=70,this.fetch("stats",{action:"ethprice"});case 70:return r.t4=r.sent.ethusd,r.abrupt("return",(0,r.t3)(r.t4));case 72:return r.abrupt("break",73);case 73:return r.abrupt("return",n.perform.call(this,t,e));case 74:case"end":return r.stop()}}),r,this,[[20,26],[32,38]])})))}},{key:"getHistory",value:function(t,e,r){return gf(this,void 0,void 0,af().mark((function n(){var i,o,a=this;return af().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,this.resolveName(t);case 2:return n.t0=n.sent,n.t1=null==e?0:e,n.t2=null==r?99999999:r,i={action:"txlist",address:n.t0,startblock:n.t1,endblock:n.t2,sort:"asc"},n.next=8,this.fetch("account",i);case 8:return o=n.sent,n.abrupt("return",o.map((function(t){["contractAddress","to"].forEach((function(e){""==t[e]&&delete t[e]})),null==t.creates&&null!=t.contractAddress&&(t.creates=t.contractAddress);var e=a.formatter.transactionResponse(t);return t.timeStamp&&(e.timestamp=parseInt(t.timeStamp)),e})));case 10:case"end":return n.stop()}}),n,this)})))}},{key:"isCommunityResource",value:function(){return null==this.apiKey}}])&&sf(e.prototype,r),n&&sf(e,n),Object.defineProperty(e,"prototype",{writable:!1}),o}(dA);function Cf(t){for(var e=(t=t.slice()).length-1;e>0;e--){var r=Math.floor(Math.random()*(e+1)),n=t[e];t[e]=t[r],t[r]=n}return t}function wf(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,(i=n.key,o=void 0,o=function(t,e){if("object"!==xf(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==xf(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(i,"string"),"symbol"===xf(o)?o:String(o)),n)}var i,o}function Bf(t,e){return(Bf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}function Qf(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=_f(t);if(e){var i=_f(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return kf(this,r)}}function kf(t,e){if(e&&("object"===xf(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return Sf(t)}function Sf(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function _f(t){return(_f=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function Df(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */Df=function(){return t};var t={},e=Object.prototype,r=e.hasOwnProperty,n=Object.defineProperty||function(t,e,r){t[e]=r.value},i="function"==typeof Symbol?Symbol:{},o=i.iterator||"@@iterator",a=i.asyncIterator||"@@asyncIterator",s=i.toStringTag||"@@toStringTag";function c(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{c({},"")}catch(t){c=function(t,e,r){return t[e]=r}}function A(t,e,r,i){var o=e&&e.prototype instanceof h?e:h,a=Object.create(o.prototype),s=new B(i||[]);return n(a,"_invoke",{value:E(t,r,s)}),a}function u(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=A;var f={};function h(){}function l(){}function d(){}var g={};c(g,o,(function(){return this}));var p=Object.getPrototypeOf,y=p&&p(p(Q([])));y&&y!==e&&r.call(y,o)&&(g=y);var I=d.prototype=h.prototype=Object.create(g);function b(t){["next","throw","return"].forEach((function(e){c(t,e,(function(t){return this._invoke(e,t)}))}))}function v(t,e){var i;n(this,"_invoke",{value:function(n,o){function a(){return new e((function(i,a){!function n(i,o,a,s){var c=u(t[i],t,o);if("throw"!==c.type){var A=c.arg,f=A.value;return f&&"object"==xf(f)&&r.call(f,"__await")?e.resolve(f.__await).then((function(t){n("next",t,a,s)}),(function(t){n("throw",t,a,s)})):e.resolve(f).then((function(t){A.value=t,a(A)}),(function(t){return n("throw",t,a,s)}))}s(c.arg)}(n,o,i,a)}))}return i=i?i.then(a,a):a()}})}function E(t,e,r){var n="suspendedStart";return function(i,o){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===i)throw o;return k()}for(r.method=i,r.arg=o;;){var a=r.delegate;if(a){var s=m(a,r);if(s){if(s===f)continue;return s}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var c=u(t,e,r);if("normal"===c.type){if(n=r.done?"completed":"suspendedYield",c.arg===f)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(n="completed",r.method="throw",r.arg=c.arg)}}}function m(t,e){var r=e.method,n=t.iterator[r];if(void 0===n)return e.delegate=null,"throw"===r&&t.iterator.return&&(e.method="return",e.arg=void 0,m(t,e),"throw"===e.method)||"return"!==r&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+r+"' method")),f;var i=u(n,t.iterator,e.arg);if("throw"===i.type)return e.method="throw",e.arg=i.arg,e.delegate=null,f;var o=i.arg;return o?o.done?(e[t.resultName]=o.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,f):o:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,f)}function C(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function w(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function B(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(C,this),this.reset(!0)}function Q(t){if(t){var e=t[o];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,i=function e(){for(;++n<t.length;)if(r.call(t,n))return e.value=t[n],e.done=!1,e;return e.value=void 0,e.done=!0,e};return i.next=i}}return{next:k}}function k(){return{value:void 0,done:!0}}return l.prototype=d,n(I,"constructor",{value:d,configurable:!0}),n(d,"constructor",{value:l,configurable:!0}),l.displayName=c(d,s,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===l||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,d):(t.__proto__=d,c(t,s,"GeneratorFunction")),t.prototype=Object.create(I),t},t.awrap=function(t){return{__await:t}},b(v.prototype),c(v.prototype,a,(function(){return this})),t.AsyncIterator=v,t.async=function(e,r,n,i,o){void 0===o&&(o=Promise);var a=new v(A(e,r,n,i),o);return t.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},b(I),c(I,s,"Generator"),c(I,o,(function(){return this})),c(I,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},t.values=Q,B.prototype={constructor:B,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(w),!t)for(var e in this)"t"===e.charAt(0)&&r.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function n(r,n){return a.type="throw",a.arg=t,e.next=r,n&&(e.method="next",e.arg=void 0),!!n}for(var i=this.tryEntries.length-1;i>=0;--i){var o=this.tryEntries[i],a=o.completion;if("root"===o.tryLoc)return n("end");if(o.tryLoc<=this.prev){var s=r.call(o,"catchLoc"),c=r.call(o,"finallyLoc");if(s&&c){if(this.prev<o.catchLoc)return n(o.catchLoc,!0);if(this.prev<o.finallyLoc)return n(o.finallyLoc)}else if(s){if(this.prev<o.catchLoc)return n(o.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return n(o.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&r.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var o=i;break}}o&&("break"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc&&(o=null);var a=o?o.completion:{};return a.type=t,a.arg=e,o?(this.method="next",this.next=o.finallyLoc,f):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),f},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),w(r),f}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var i=n.arg;w(r)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:Q(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),f}},t}function xf(t){return(xf="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var Mf=function(t,e,r,n){return new(r||(r=Promise))((function(i,o){function a(t){try{c(n.next(t))}catch(t){o(t)}}function s(t){try{c(n.throw(t))}catch(t){o(t)}}function c(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(a,s)}c((n=n.apply(t,e||[])).next())}))},Rf=new h.b("providers/5.7.2");function Of(){return(new Date).getTime()}function Nf(t){for(var e=null,r=0;r<t.length;r++){var n=t[r];if(null==n)return null;e?e.name===n.name&&e.chainId===n.chainId&&(e.ensAddress===n.ensAddress||null==e.ensAddress&&null==n.ensAddress)||Rf.throwArgumentError("provider mismatch","networks",t):e=n}return e}function Pf(t,e){t=t.slice().sort();var r=Math.floor(t.length/2);if(t.length%2)return t[r];var n=t[r-1],i=t[r];return null!=e&&Math.abs(n-i)>e?null:(n+i)/2}function jf(t){if(null===t)return"null";if("number"==typeof t||"boolean"==typeof t)return JSON.stringify(t);if("string"==typeof t)return t;if(b.isBigNumber(t))return t.toString();if(Array.isArray(t))return JSON.stringify(t.map((function(t){return jf(t)})));if("object"===xf(t)){var e=Object.keys(t);return e.sort(),"{"+e.map((function(e){var r=t[e];return r="function"==typeof r?"[function]":jf(r),JSON.stringify(e)+":"+r})).join(",")+"}"}throw new Error("unknown value type: "+xf(t))}var Lf=1;function Ff(t){var e=null,r=null,n=new Promise((function(n){e=function(){r&&(clearTimeout(r),r=null),n()},r=setTimeout(e,t)}));return{cancel:e,getPromise:function(){return n},wait:function(t){return n=n.then(t)}}}var Tf=[h.b.errors.CALL_EXCEPTION,h.b.errors.INSUFFICIENT_FUNDS,h.b.errors.NONCE_EXPIRED,h.b.errors.REPLACEMENT_UNDERPRICED,h.b.errors.UNPREDICTABLE_GAS_LIMIT],Uf=["address","args","errorArgs","errorSignature","method","transaction"];function Gf(t,e){var r={weight:t.weight};return Object.defineProperty(r,"provider",{get:function(){return t.provider}}),t.start&&(r.start=t.start),e&&(r.duration=e-t.start),t.done&&(t.error?r.error=t.error:r.result=t.result||null),r}function Hf(t,e,r){var n=jf;switch(e){case"getBlockNumber":return function(e){var r=e.map((function(t){return t.result})),n=Pf(e.map((function(t){return t.result})),2);if(null!=n)return n=Math.ceil(n),r.indexOf(n+1)>=0&&n++,n>=t._highestBlockNumber&&(t._highestBlockNumber=n),t._highestBlockNumber};case"getGasPrice":return function(t){var e=t.map((function(t){return t.result}));return e.sort(),e[Math.floor(e.length/2)]};case"getEtherPrice":return function(t){return Pf(t.map((function(t){return t.result})))};case"getBalance":case"getTransactionCount":case"getCode":case"getStorageAt":case"call":case"estimateGas":case"getLogs":break;case"getTransaction":case"getTransactionReceipt":n=function(t){return null==t?null:((t=O(t)).confirmations=-1,jf(t))};break;case"getBlock":n=r.includeTransactions?function(t){return null==t?null:((t=O(t)).transactions=t.transactions.map((function(t){return(t=O(t)).confirmations=-1,t})),jf(t))}:function(t){return null==t?null:jf(t)};break;default:throw new Error("unknown method: "+e)}return function(t,e){return function(r){var n={};r.forEach((function(e){var r=t(e.result);n[r]||(n[r]={count:0,result:e.result}),n[r].count++}));for(var i=Object.keys(n),o=0;o<i.length;o++){var a=n[i[o]];if(a.count>=e)return a.result}}}(n,t.quorum)}function Yf(t,e){return Mf(this,void 0,void 0,Df().mark((function r(){var n;return Df().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(!(null!=(n=t.provider).blockNumber&&n.blockNumber>=e||-1===e)){r.next=3;break}return r.abrupt("return",n);case 3:return r.abrupt("return",wc((function(){return new Promise((function(r,i){setTimeout((function(){return n.blockNumber>=e?r(n):t.cancelled?r(null):r(void 0)}),0)}))}),{oncePoll:n}));case 4:case"end":return r.stop()}}),r)})))}function Kf(t,e,r,n){return Mf(this,void 0,void 0,Df().mark((function i(){var o,a;return Df().wrap((function(i){for(;;)switch(i.prev=i.next){case 0:o=t.provider,i.t0=r,i.next="getBlockNumber"===i.t0||"getGasPrice"===i.t0?4:"getEtherPrice"===i.t0?5:"getBalance"===i.t0||"getTransactionCount"===i.t0||"getCode"===i.t0?8:"getStorageAt"===i.t0?13:"getBlock"===i.t0?18:"call"===i.t0||"estimateGas"===i.t0?23:"getTransaction"===i.t0||"getTransactionReceipt"===i.t0?30:"getLogs"===i.t0?31:37;break;case 4:return i.abrupt("return",o[r]());case 5:if(!o.getEtherPrice){i.next=7;break}return i.abrupt("return",o.getEtherPrice());case 7:return i.abrupt("break",37);case 8:if(!n.blockTag||!Object(A.l)(n.blockTag)){i.next=12;break}return i.next=11,Yf(t,e);case 11:o=i.sent;case 12:return i.abrupt("return",o[r](n.address,n.blockTag||"latest"));case 13:if(!n.blockTag||!Object(A.l)(n.blockTag)){i.next=17;break}return i.next=16,Yf(t,e);case 16:o=i.sent;case 17:return i.abrupt("return",o.getStorageAt(n.address,n.position,n.blockTag||"latest"));case 18:if(!n.blockTag||!Object(A.l)(n.blockTag)){i.next=22;break}return i.next=21,Yf(t,e);case 21:o=i.sent;case 22:return i.abrupt("return",o[n.includeTransactions?"getBlockWithTransactions":"getBlock"](n.blockTag||n.blockHash));case 23:if(!n.blockTag||!Object(A.l)(n.blockTag)){i.next=27;break}return i.next=26,Yf(t,e);case 26:o=i.sent;case 27:if("call"!==r||!n.blockTag){i.next=29;break}return i.abrupt("return",o[r](n.transaction,n.blockTag));case 29:return i.abrupt("return",o[r](n.transaction));case 30:return i.abrupt("return",o[r](n.transactionHash));case 31:if(!((a=n.filter).fromBlock&&Object(A.l)(a.fromBlock)||a.toBlock&&Object(A.l)(a.toBlock))){i.next=36;break}return i.next=35,Yf(t,e);case 35:o=i.sent;case 36:return i.abrupt("return",o.getLogs(a));case 37:return i.abrupt("return",Rf.throwError("unknown method error",h.b.errors.UNKNOWN_ERROR,{method:r,params:n}));case 38:case"end":return i.stop()}}),i)})))}var qf=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Bf(t,e)}(o,t);var e,r,n,i=Qf(o);function o(t,e){var r;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,o),0===t.length&&Rf.throwArgumentError("missing providers","providers",t);var n=t.map((function(t,e){if(kn.isProvider(t)){var r=Mc(t)?2e3:750;return Object.freeze({provider:t,weight:1,stallTimeout:r,priority:1})}var n=O(t);null==n.priority&&(n.priority=1),null==n.stallTimeout&&(n.stallTimeout=Mc(t)?2e3:750),null==n.weight&&(n.weight=1);var i=n.weight;return(i%1||i>512||i<1)&&Rf.throwArgumentError("invalid weight; must be integer in [1, 512]","providers[".concat(e,"].weight"),i),Object.freeze(n)})),a=n.reduce((function(t,e){return t+e.weight}),0);null==e?e=a/2:e>a&&Rf.throwArgumentError("quorum will always fail; larger than total weight","quorum",e);var s=Nf(n.map((function(t){return t.provider.network})));return null==s&&(s=new Promise((function(t,e){setTimeout((function(){r.detectNetwork().then(t,e)}),0)}))),D(Sf(r=i.call(this,s)),"providerConfigs",Object.freeze(n)),D(Sf(r),"quorum",e),r._highestBlockNumber=-1,r}return e=o,(r=[{key:"detectNetwork",value:function(){return Mf(this,void 0,void 0,Df().mark((function t(){var e;return Df().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,Promise.all(this.providerConfigs.map((function(t){return t.provider.getNetwork()})));case 2:return e=t.sent,t.abrupt("return",Nf(e));case 4:case"end":return t.stop()}}),t,this)})))}},{key:"perform",value:function(t,e){return Mf(this,void 0,void 0,Df().mark((function r(){var n,i,o,a,s,c,A,u,f,l,d=this;return Df().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if("sendTransaction"!==t){r.next=13;break}return r.next=3,Promise.all(this.providerConfigs.map((function(t){return t.provider.sendTransaction(e.signedTransaction).then((function(t){return t.hash}),(function(t){return t}))})));case 3:n=r.sent,i=0;case 5:if(!(i<n.length)){r.next=12;break}if("string"!=typeof(o=n[i])){r.next=9;break}return r.abrupt("return",o);case 9:i++,r.next=5;break;case 12:throw n[0];case 13:if(-1!==this._highestBlockNumber||"getBlockNumber"===t){r.next=16;break}return r.next=16,this.getBlockNumber();case 16:a=Hf(this,t,e),(s=Cf(this.providerConfigs.map(O))).sort((function(t,e){return t.priority-e.priority})),c=this._highestBlockNumber,A=0,u=!0,f=Df().mark((function r(){var n,i,o,f,h,l,g;return Df().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:n=Of(),i=s.filter((function(t){return t.runner&&n-t.start<t.stallTimeout})).reduce((function(t,e){return t+e.weight}),0),o=Df().mark((function r(){var n,o;return Df().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:n=s[A++],o=Lf++,n.start=Of(),n.staller=Ff(n.stallTimeout),n.staller.wait((function(){n.staller=null})),n.runner=Kf(n,c,t,e).then((function(r){n.done=!0,n.result=r,d.listenerCount("debug")&&d.emit("debug",{action:"request",rid:o,backend:Gf(n,Of()),request:{method:t,params:j(e)},provider:d})}),(function(r){n.done=!0,n.error=r,d.listenerCount("debug")&&d.emit("debug",{action:"request",rid:o,backend:Gf(n,Of()),request:{method:t,params:j(e)},provider:d})})),d.listenerCount("debug")&&d.emit("debug",{action:"request",rid:o,backend:Gf(n,null),request:{method:t,params:j(e)},provider:d}),i+=n.weight;case 8:case"end":return r.stop()}}),r)}));case 3:if(!(i<d.quorum&&A<s.length)){r.next=7;break}return r.delegateYield(o(),"t0",5);case 5:r.next=3;break;case 7:if(f=[],s.forEach((function(t){!t.done&&t.runner&&(f.push(t.runner),t.staller&&f.push(t.staller.getPromise()))})),!f.length){r.next=12;break}return r.next=12,Promise.race(f);case 12:if(!((h=s.filter((function(t){return t.done&&null==t.error}))).length>=d.quorum)){r.next=22;break}if(void 0===(l=a(h))){r.next=18;break}return s.forEach((function(t){t.staller&&t.staller.cancel(),t.cancelled=!0})),r.abrupt("return",{v:l});case 18:if(u){r.next=21;break}return r.next=21,Ff(100).getPromise();case 21:u=!1;case 22:if(g=s.reduce((function(t,e){if(!e.done||null==e.error)return t;var r=e.error.code;return Tf.indexOf(r)>=0&&(t[r]||(t[r]={error:e.error,weight:0}),t[r].weight+=e.weight),t}),{}),Object.keys(g).forEach((function(t){var e=g[t];if(!(e.weight<d.quorum)){s.forEach((function(t){t.staller&&t.staller.cancel(),t.cancelled=!0}));var r=e.error,n={};Uf.forEach((function(t){null!=r[t]&&(n[t]=r[t])})),Rf.throwError(r.reason||r.message,t,n)}})),0!==s.filter((function(t){return!t.done})).length){r.next=26;break}return r.abrupt("return","break");case 26:case"end":return r.stop()}}),r)}));case 23:return r.delegateYield(f(),"t0",25);case 25:if("break"!==(l=r.t0)){r.next=28;break}return r.abrupt("break",32);case 28:if("object"!==xf(l)){r.next=30;break}return r.abrupt("return",l.v);case 30:r.next=23;break;case 32:return s.forEach((function(t){t.staller&&t.staller.cancel(),t.cancelled=!0})),r.abrupt("return",Rf.throwError("failed to meet quorum",h.b.errors.SERVER_ERROR,{method:t,params:e,results:s.map((function(t){return Gf(t)})),provider:this}));case 34:case"end":return r.stop()}}),r,this)})))}}])&&wf(e.prototype,r),n&&wf(e,n),Object.defineProperty(e,"prototype",{writable:!1}),o}(dA),Jf=null;function zf(t){return(zf="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Zf(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Vf(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,(i=n.key,o=void 0,o=function(t,e){if("object"!==zf(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==zf(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(i,"string"),"symbol"===zf(o)?o:String(o)),n)}var i,o}function Wf(t,e,r){return e&&Vf(t.prototype,e),r&&Vf(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function Xf(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&$f(t,e)}function $f(t,e){return($f=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}function th(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=nh(t);if(e){var i=nh(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return eh(this,r)}}function eh(t,e){if(e&&("object"===zf(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return rh(t)}function rh(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function nh(t){return(nh=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var ih=new h.b("providers/5.7.2"),oh="84842078b09946638c03157f83405213",ah=function(t){Xf(r,t);var e=th(r);function r(t,n){var i;Zf(this,r);var o=new sh(t,n),a=o.connection;a.password&&ih.throwError("INFURA WebSocket project secrets unsupported",h.b.errors.UNSUPPORTED_OPERATION,{operation:"InfuraProvider.getWebSocketProvider()"});var s=a.url.replace(/^http/i,"ws").replace("/v3/","/ws/v3/");return D(rh(i=e.call(this,s,t)),"apiKey",o.projectId),D(rh(i),"projectId",o.projectId),D(rh(i),"projectSecret",o.projectSecret),i}return Wf(r,[{key:"isCommunityResource",value:function(){return this.projectId===oh}}]),r}(ru),sh=function(t){Xf(r,t);var e=th(r);function r(){return Zf(this,r),e.apply(this,arguments)}return Wf(r,[{key:"isCommunityResource",value:function(){return this.projectId===oh}}],[{key:"getWebSocketProvider",value:function(t,e){return new ah(t,e)}},{key:"getApiKey",value:function(t){var e={apiKey:oh,projectId:oh,projectSecret:null};return null==t||("string"==typeof t?e.projectId=t:null!=t.projectSecret?(ih.assertArgument("string"==typeof t.projectId,"projectSecret requires a projectId","projectId",t.projectId),ih.assertArgument("string"==typeof t.projectSecret,"invalid projectSecret","projectSecret","[REDACTED]"),e.projectId=t.projectId,e.projectSecret=t.projectSecret):t.projectId&&(e.projectId=t.projectId),e.apiKey=e.projectId),e}},{key:"getUrl",value:function(t,e){var r=null;switch(t?t.name:"unknown"){case"homestead":r="mainnet.infura.io";break;case"goerli":r="goerli.infura.io";break;case"sepolia":r="sepolia.infura.io";break;case"matic":r="polygon-mainnet.infura.io";break;case"maticmum":r="polygon-mumbai.infura.io";break;case"optimism":r="optimism-mainnet.infura.io";break;case"optimism-goerli":r="optimism-goerli.infura.io";break;case"arbitrum":r="arbitrum-mainnet.infura.io";break;case"arbitrum-goerli":r="arbitrum-goerli.infura.io";break;default:ih.throwError("unsupported network",h.b.errors.INVALID_ARGUMENT,{argument:"network",value:t})}var n={allowGzip:!0,url:"https://"+r+"/v3/"+e.projectId,throttleCallback:function(t,r){return e.projectId===oh&&Oc(),Promise.resolve(!0)}};return null!=e.projectSecret&&(n.user="",n.password=e.projectSecret),n}}]),r}(bu);function ch(t){return(ch="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Ah(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function uh(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,(i=n.key,o=void 0,o=function(t,e){if("object"!==ch(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==ch(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(i,"string"),"symbol"===ch(o)?o:String(o)),n)}var i,o}function fh(t,e){return(fh=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}function hh(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=dh(t);if(e){var i=dh(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return lh(this,r)}}function lh(t,e){if(e&&("object"===ch(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function dh(t){return(dh=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var gh=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&fh(t,e)}(o,t);var e,r,n,i=hh(o);function o(){return Ah(this,o),i.apply(this,arguments)}return e=o,(r=[{key:"send",value:function(t,e){var r=this,n={method:t,params:e,id:this._nextId++,jsonrpc:"2.0"};null==this._pendingBatch&&(this._pendingBatch=[]);var i={request:n,resolve:null,reject:null},o=new Promise((function(t,e){i.resolve=t,i.reject=e}));return this._pendingBatch.push(i),this._pendingBatchAggregator||(this._pendingBatchAggregator=setTimeout((function(){var t=r._pendingBatch;r._pendingBatch=null,r._pendingBatchAggregator=null;var e=t.map((function(t){return t.request}));return r.emit("debug",{action:"requestBatch",request:j(e),provider:r}),Cc(r.connection,JSON.stringify(e)).then((function(n){r.emit("debug",{action:"response",request:e,response:n,provider:r}),t.forEach((function(t,e){var r=n[e];if(r.error){var i=new Error(r.error.message);i.code=r.error.code,i.data=r.error.data,t.reject(i)}else t.resolve(r.result)}))}),(function(n){r.emit("debug",{action:"response",error:n,request:e,provider:r}),t.forEach((function(t){t.reject(n)}))}))}),10)),o}}])&&uh(e.prototype,r),n&&uh(e,n),Object.defineProperty(e,"prototype",{writable:!1}),o}(TA);function ph(t){return(ph="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function yh(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Ih(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,(i=n.key,o=void 0,o=function(t,e){if("object"!==ph(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==ph(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(i,"string"),"symbol"===ph(o)?o:String(o)),n)}var i,o}function bh(t,e){return(bh=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}function vh(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=mh(t);if(e){var i=mh(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return Eh(this,r)}}function Eh(t,e){if(e&&("object"===ph(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function mh(t){return(mh=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var Ch=new h.b("providers/5.7.2"),wh=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&bh(t,e)}(o,t);var e,r,n,i=vh(o);function o(){return yh(this,o),i.apply(this,arguments)}return e=o,n=[{key:"getApiKey",value:function(t){return t&&"string"!=typeof t&&Ch.throwArgumentError("invalid apiKey","apiKey",t),t||"ETHERS_JS_SHARED"}},{key:"getUrl",value:function(t,e){Ch.warn("NodeSmith will be discontinued on 2019-12-20; please migrate to another platform.");var r=null;switch(t.name){case"homestead":r="https://ethereum.api.nodesmith.io/v1/mainnet/jsonrpc";break;case"ropsten":r="https://ethereum.api.nodesmith.io/v1/ropsten/jsonrpc";break;case"rinkeby":r="https://ethereum.api.nodesmith.io/v1/rinkeby/jsonrpc";break;case"goerli":r="https://ethereum.api.nodesmith.io/v1/goerli/jsonrpc";break;case"kovan":r="https://ethereum.api.nodesmith.io/v1/kovan/jsonrpc";break;default:Ch.throwArgumentError("unsupported network","network",arguments[0])}return r+"?apiKey="+e}}],(r=null)&&Ih(e.prototype,r),n&&Ih(e,n),Object.defineProperty(e,"prototype",{writable:!1}),o}(bu);function Bh(t){return(Bh="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Qh(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function kh(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,(i=n.key,o=void 0,o=function(t,e){if("object"!==Bh(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==Bh(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(i,"string"),"symbol"===Bh(o)?o:String(o)),n)}var i,o}function Sh(t,e){return(Sh=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}function _h(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=xh(t);if(e){var i=xh(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return Dh(this,r)}}function Dh(t,e){if(e&&("object"===Bh(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function xh(t){return(xh=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var Mh=new h.b("providers/5.7.2"),Rh=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Sh(t,e)}(o,t);var e,r,n,i=_h(o);function o(){return Qh(this,o),i.apply(this,arguments)}return e=o,n=[{key:"getApiKey",value:function(t){var e={applicationId:null,loadBalancer:!0,applicationSecretKey:null};return null==t?e.applicationId="62e1ad51b37b8e00394bda3b":"string"==typeof t?e.applicationId=t:null!=t.applicationSecretKey?(e.applicationId=t.applicationId,e.applicationSecretKey=t.applicationSecretKey):t.applicationId?e.applicationId=t.applicationId:Mh.throwArgumentError("unsupported PocketProvider apiKey","apiKey",t),e}},{key:"getUrl",value:function(t,e){var r=null;switch(t?t.name:"unknown"){case"goerli":r="eth-goerli.gateway.pokt.network";break;case"homestead":r="eth-mainnet.gateway.pokt.network";break;case"kovan":r="poa-kovan.gateway.pokt.network";break;case"matic":r="poly-mainnet.gateway.pokt.network";break;case"maticmum":r="polygon-mumbai-rpc.gateway.pokt.network";break;case"rinkeby":r="eth-rinkeby.gateway.pokt.network";break;case"ropsten":r="eth-ropsten.gateway.pokt.network";break;default:Mh.throwError("unsupported network",h.b.errors.INVALID_ARGUMENT,{argument:"network",value:t})}var n={headers:{},url:"https://".concat(r,"/v1/lb/").concat(e.applicationId)};return null!=e.applicationSecretKey&&(n.user="",n.password=e.applicationSecretKey),n}}],(r=[{key:"isCommunityResource",value:function(){return"62e1ad51b37b8e00394bda3b"===this.applicationId}}])&&kh(e.prototype,r),n&&kh(e,n),Object.defineProperty(e,"prototype",{writable:!1}),o}(bu);function Oh(t){return(Oh="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Nh(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,(i=n.key,o=void 0,o=function(t,e){if("object"!==Oh(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==Oh(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(i,"string"),"symbol"===Oh(o)?o:String(o)),n)}var i,o}function Ph(t,e){return(Ph=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}function jh(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=Th(t);if(e){var i=Th(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return Lh(this,r)}}function Lh(t,e){if(e&&("object"===Oh(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return Fh(t)}function Fh(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Th(t){return(Th=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var Uh=new h.b("providers/5.7.2"),Gh=1;function Hh(t,e){var r="Web3LegacyFetcher";return function(t,n){var i=this,o={method:t,params:n,id:Gh++,jsonrpc:"2.0"};return new Promise((function(t,n){i.emit("debug",{action:"request",fetcher:r,request:j(o),provider:i}),e(o,(function(e,a){if(e)return i.emit("debug",{action:"response",fetcher:r,error:e,request:o,provider:i}),n(e);if(i.emit("debug",{action:"response",fetcher:r,request:o,response:a,provider:i}),a.error){var s=new Error(a.error.message);return s.code=a.error.code,s.data=a.error.data,n(s)}t(a.result)}))}))}}var Yh=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Ph(t,e)}(o,t);var e,r,n,i=jh(o);function o(t,e){var r;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,o),null==t&&Uh.throwArgumentError("missing provider","provider",t);var n=null,a=null,s=null;return"function"==typeof t?(n="unknown:",a=t):(!(n=t.host||t.path||"")&&t.isMetaMask&&(n="metamask"),s=t,t.request?(""===n&&(n="eip-1193:"),a=function(t){return function(e,r){var n=this;null==r&&(r=[]);var i={method:e,params:r};return this.emit("debug",{action:"request",fetcher:"Eip1193Fetcher",request:j(i),provider:this}),t.request(i).then((function(t){return n.emit("debug",{action:"response",fetcher:"Eip1193Fetcher",request:i,response:t,provider:n}),t}),(function(t){throw n.emit("debug",{action:"response",fetcher:"Eip1193Fetcher",request:i,error:t,provider:n}),t}))}}(t)):t.sendAsync?a=Hh(0,t.sendAsync.bind(t)):t.send?a=Hh(0,t.send.bind(t)):Uh.throwArgumentError("unsupported provider","provider",t),n||(n="unknown:")),D(Fh(r=i.call(this,n,e)),"jsonRpcFetchFunc",a),D(Fh(r),"provider",s),r}return e=o,(r=[{key:"send",value:function(t,e){return this.jsonRpcFetchFunc(t,e)}}])&&Nh(e.prototype,r),n&&Nh(e,n),Object.defineProperty(e,"prototype",{writable:!1}),o}(TA),Kh=new h.b("providers/5.7.2");function qh(t,e){if(null==t&&(t="homestead"),"string"==typeof t){var r=t.match(/^(ws|http)s?:/i);if(r)switch(r[1].toLowerCase()){case"http":case"https":return new TA(t);case"ws":case"wss":return new ru(t);default:Kh.throwArgumentError("unsupported URL scheme","network",t)}}var n=Ms(t);return n&&n._defaultProvider||Kh.throwError("unsupported getDefaultProvider network",h.b.errors.NETWORK_ERROR,{operation:"getDefaultProvider",network:t}),n._defaultProvider({FallbackProvider:qf,AlchemyProvider:Ru,AnkrProvider:Yu,CloudflareProvider:nf,EtherscanProvider:mf,InfuraProvider:sh,JsonRpcProvider:TA,NodesmithProvider:wh,PocketProvider:Rh,Web3Provider:Yh,IpcProvider:Jf},e)}var Jh=new RegExp("^bytes([0-9]+)$"),zh=new RegExp("^(u?int)([0-9]*)$"),Zh=new RegExp("^(.*)\\[([0-9]*)\\]$"),Vh=new h.b("solidity/5.7.0");function Wh(t,e){t.length!=e.length&&Vh.throwArgumentError("wrong number of values; expected ${ types.length }","values",e);var r=[];return t.forEach((function(t,n){r.push(function t(e,r,n){switch(e){case"address":return n?Object(A.p)(r,32):Object(A.a)(r);case"string":return Ct(r);case"bytes":return Object(A.a)(r);case"bool":return r=r?"0x01":"0x00",n?Object(A.p)(r,32):Object(A.a)(r)}var i=e.match(zh);if(i){var o=parseInt(i[2]||"256");return(i[2]&&String(o)!==i[2]||o%8!=0||0===o||o>256)&&Vh.throwArgumentError("invalid number type","type",e),n&&(o=256),r=b.from(r).toTwos(o),Object(A.p)(r,o/8)}if(i=e.match(Jh)){var a=parseInt(i[1]);return(String(a)!==i[1]||0===a||a>32)&&Vh.throwArgumentError("invalid bytes type","type",e),Object(A.a)(r).byteLength!==a&&Vh.throwArgumentError("invalid value for ".concat(e),"value",r),n?Object(A.a)((r+"0000000000000000000000000000000000000000000000000000000000000000").substring(0,66)):r}if((i=e.match(Zh))&&Array.isArray(r)){var s=i[1];parseInt(i[2]||String(r.length))!=r.length&&Vh.throwArgumentError("invalid array length for ".concat(e),"value",r);var c=[];return r.forEach((function(e){c.push(t(s,e,!0))})),Object(A.b)(c)}return Vh.throwArgumentError("invalid type","type",e)}(t,e[n]))})),Object(A.i)(Object(A.b)(r))}function Xh(t,e){return V(Wh(t,e))}function $h(t,e){return Uo(Wh(t,e))}function tl(t,e){e||(e=function(t){return[parseInt(t,16)]});var r=0,n={};return t.split(",").forEach((function(t){var i=t.split(":");r+=parseInt(i[0],16),n[r]=e(i[1])})),n}function el(t){var e=0;return t.split(",").map((function(t){var r=t.split("-");return 1===r.length?r[1]="0":""===r[1]&&(r[1]="1"),{l:e+parseInt(r[0],16),h:e=parseInt(r[1],16)}}))}function rl(t,e){for(var r=0,n=0;n<e.length;n++){var i=e[n];if(t>=(r+=i.l)&&t<=r+i.h&&(t-r)%(i.d||1)==0){if(i.e&&-1!==i.e.indexOf(t-r))continue;return i}}return null}var nl=el("221,13-1b,5f-,40-10,51-f,11-3,3-3,2-2,2-4,8,2,15,2d,28-8,88,48,27-,3-5,11-20,27-,8,28,3-5,12,18,b-a,1c-4,6-16,2-d,2-2,2,1b-4,17-9,8f-,10,f,1f-2,1c-34,33-14e,4,36-,13-,6-2,1a-f,4,9-,3-,17,8,2-2,5-,2,8-,3-,4-8,2-3,3,6-,16-6,2-,7-3,3-,17,8,3,3,3-,2,6-3,3-,4-a,5,2-6,10-b,4,8,2,4,17,8,3,6-,b,4,4-,2-e,2-4,b-10,4,9-,3-,17,8,3-,5-,9-2,3-,4-7,3-3,3,4-3,c-10,3,7-2,4,5-2,3,2,3-2,3-2,4-2,9,4-3,6-2,4,5-8,2-e,d-d,4,9,4,18,b,6-3,8,4,5-6,3-8,3-3,b-11,3,9,4,18,b,6-3,8,4,5-6,3-6,2,3-3,b-11,3,9,4,18,11-3,7-,4,5-8,2-7,3-3,b-11,3,13-2,19,a,2-,8-2,2-3,7,2,9-11,4-b,3b-3,1e-24,3,2-,3,2-,2-5,5,8,4,2,2-,3,e,4-,6,2,7-,b-,3-21,49,23-5,1c-3,9,25,10-,2-2f,23,6,3,8-2,5-5,1b-45,27-9,2a-,2-3,5b-4,45-4,53-5,8,40,2,5-,8,2,5-,28,2,5-,20,2,5-,8,2,5-,8,8,18,20,2,5-,8,28,14-5,1d-22,56-b,277-8,1e-2,52-e,e,8-a,18-8,15-b,e,4,3-b,5e-2,b-15,10,b-5,59-7,2b-555,9d-3,5b-5,17-,7-,27-,7-,9,2,2,2,20-,36,10,f-,7,14-,4,a,54-3,2-6,6-5,9-,1c-10,13-1d,1c-14,3c-,10-6,32-b,240-30,28-18,c-14,a0,115-,3,66-,b-76,5,5-,1d,24,2,5-2,2,8-,35-2,19,f-10,1d-3,311-37f,1b,5a-b,d7-19,d-3,41,57-,68-4,29-3,5f,29-37,2e-2,25-c,2c-2,4e-3,30,78-3,64-,20,19b7-49,51a7-59,48e-2,38-738,2ba5-5b,222f-,3c-94,8-b,6-4,1b,6,2,3,3,6d-20,16e-f,41-,37-7,2e-2,11-f,5-b,18-,b,14,5-3,6,88-,2,bf-2,7-,7-,7-,4-2,8,8-9,8-2ff,20,5-b,1c-b4,27-,27-cbb1,f7-9,28-2,b5-221,56,48,3-,2-,3-,5,d,2,5,3,42,5-,9,8,1d,5,6,2-2,8,153-3,123-3,33-27fd,a6da-5128,21f-5df,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3,2-1d,61-ff7d"),il="ad,34f,1806,180b,180c,180d,200b,200c,200d,2060,feff".split(",").map((function(t){return parseInt(t,16)})),ol=[{h:25,s:32,l:65},{h:30,s:32,e:[23],l:127},{h:54,s:1,e:[48],l:64,d:2},{h:14,s:1,l:57,d:2},{h:44,s:1,l:17,d:2},{h:10,s:1,e:[2,6,8],l:61,d:2},{h:16,s:1,l:68,d:2},{h:84,s:1,e:[18,24,66],l:19,d:2},{h:26,s:32,e:[17],l:435},{h:22,s:1,l:71,d:2},{h:15,s:80,l:40},{h:31,s:32,l:16},{h:32,s:1,l:80,d:2},{h:52,s:1,l:42,d:2},{h:12,s:1,l:55,d:2},{h:40,s:1,e:[38],l:15,d:2},{h:14,s:1,l:48,d:2},{h:37,s:48,l:49},{h:148,s:1,l:6351,d:2},{h:88,s:1,l:160,d:2},{h:15,s:16,l:704},{h:25,s:26,l:854},{h:25,s:32,l:55915},{h:37,s:40,l:1247},{h:25,s:-119711,l:53248},{h:25,s:-119763,l:52},{h:25,s:-119815,l:52},{h:25,s:-119867,e:[1,4,5,7,8,11,12,17],l:52},{h:25,s:-119919,l:52},{h:24,s:-119971,e:[2,7,8,17],l:52},{h:24,s:-120023,e:[2,7,13,15,16,17],l:52},{h:25,s:-120075,l:52},{h:25,s:-120127,l:52},{h:25,s:-120179,l:52},{h:25,s:-120231,l:52},{h:25,s:-120283,l:52},{h:25,s:-120335,l:52},{h:24,s:-119543,e:[17],l:56},{h:24,s:-119601,e:[17],l:58},{h:24,s:-119659,e:[17],l:58},{h:24,s:-119717,e:[17],l:58},{h:24,s:-119775,e:[17],l:58}],al=tl("b5:3bc,c3:ff,7:73,2:253,5:254,3:256,1:257,5:259,1:25b,3:260,1:263,2:269,1:268,5:26f,1:272,2:275,7:280,3:283,5:288,3:28a,1:28b,5:292,3f:195,1:1bf,29:19e,125:3b9,8b:3b2,1:3b8,1:3c5,3:3c6,1:3c0,1a:3ba,1:3c1,1:3c3,2:3b8,1:3b5,1bc9:3b9,1c:1f76,1:1f77,f:1f7a,1:1f7b,d:1f78,1:1f79,1:1f7c,1:1f7d,107:63,5:25b,4:68,1:68,1:68,3:69,1:69,1:6c,3:6e,4:70,1:71,1:72,1:72,1:72,7:7a,2:3c9,2:7a,2:6b,1:e5,1:62,1:63,3:65,1:66,2:6d,b:3b3,1:3c0,6:64,1b574:3b8,1a:3c3,20:3b8,1a:3c3,20:3b8,1a:3c3,20:3b8,1a:3c3,20:3b8,1a:3c3"),sl=tl("179:1,2:1,2:1,5:1,2:1,a:4f,a:1,8:1,2:1,2:1,3:1,5:1,3:1,4:1,2:1,3:1,4:1,8:2,1:1,2:2,1:1,2:2,27:2,195:26,2:25,1:25,1:25,2:40,2:3f,1:3f,33:1,11:-6,1:-9,1ac7:-3a,6d:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,b:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,c:-8,2:-8,2:-8,2:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,49:-8,1:-8,1:-4a,1:-4a,d:-56,1:-56,1:-56,1:-56,d:-8,1:-8,f:-8,1:-8,3:-7"),cl=tl("df:00730073,51:00690307,19:02BC006E,a7:006A030C,18a:002003B9,16:03B903080301,20:03C503080301,1d7:05650582,190f:00680331,1:00740308,1:0077030A,1:0079030A,1:006102BE,b6:03C50313,2:03C503130300,2:03C503130301,2:03C503130342,2a:1F0003B9,1:1F0103B9,1:1F0203B9,1:1F0303B9,1:1F0403B9,1:1F0503B9,1:1F0603B9,1:1F0703B9,1:1F0003B9,1:1F0103B9,1:1F0203B9,1:1F0303B9,1:1F0403B9,1:1F0503B9,1:1F0603B9,1:1F0703B9,1:1F2003B9,1:1F2103B9,1:1F2203B9,1:1F2303B9,1:1F2403B9,1:1F2503B9,1:1F2603B9,1:1F2703B9,1:1F2003B9,1:1F2103B9,1:1F2203B9,1:1F2303B9,1:1F2403B9,1:1F2503B9,1:1F2603B9,1:1F2703B9,1:1F6003B9,1:1F6103B9,1:1F6203B9,1:1F6303B9,1:1F6403B9,1:1F6503B9,1:1F6603B9,1:1F6703B9,1:1F6003B9,1:1F6103B9,1:1F6203B9,1:1F6303B9,1:1F6403B9,1:1F6503B9,1:1F6603B9,1:1F6703B9,3:1F7003B9,1:03B103B9,1:03AC03B9,2:03B10342,1:03B1034203B9,5:03B103B9,6:1F7403B9,1:03B703B9,1:03AE03B9,2:03B70342,1:03B7034203B9,5:03B703B9,6:03B903080300,1:03B903080301,3:03B90342,1:03B903080342,b:03C503080300,1:03C503080301,1:03C10313,2:03C50342,1:03C503080342,b:1F7C03B9,1:03C903B9,1:03CE03B9,2:03C90342,1:03C9034203B9,5:03C903B9,ac:00720073,5b:00B00063,6:00B00066,d:006E006F,a:0073006D,1:00740065006C,1:0074006D,124f:006800700061,2:00610075,2:006F0076,b:00700061,1:006E0061,1:03BC0061,1:006D0061,1:006B0061,1:006B0062,1:006D0062,1:00670062,3:00700066,1:006E0066,1:03BC0066,4:0068007A,1:006B0068007A,1:006D0068007A,1:00670068007A,1:00740068007A,15:00700061,1:006B00700061,1:006D00700061,1:006700700061,8:00700076,1:006E0076,1:03BC0076,1:006D0076,1:006B0076,1:006D0076,1:00700077,1:006E0077,1:03BC0077,1:006D0077,1:006B0077,1:006D0077,1:006B03C9,1:006D03C9,2:00620071,3:00632215006B0067,1:0063006F002E,1:00640062,1:00670079,2:00680070,2:006B006B,1:006B006D,9:00700068,2:00700070006D,1:00700072,2:00730076,1:00770062,c723:00660066,1:00660069,1:0066006C,1:006600660069,1:00660066006C,1:00730074,1:00730074,d:05740576,1:05740565,1:0574056B,1:057E0576,1:0574056D",(function(t){if(t.length%4!=0)throw new Error("bad data");for(var e=[],r=0;r<t.length;r+=4)e.push(parseInt(t.substring(r,r+4),16));return e})),Al=el("80-20,2a0-,39c,32,f71,18e,7f2-f,19-7,30-4,7-5,f81-b,5,a800-20ff,4d1-1f,110,fa-6,d174-7,2e84-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,2,1f-5f,ff7f-20001");function ul(t){if(t.match(/^[a-z0-9-]*$/i)&&t.length<=59)return t.toLowerCase();var e,r=St(t);e=r.map((function(t){if(il.indexOf(t)>=0)return[];if(t>=65024&&t<=65039)return[];var e=function(t){var e=rl(t,ol);if(e)return[t+e.s];var r=al[t];if(r)return r;var n=sl[t];if(n)return[t+n[0]];var i=cl[t];return i||null}(t);return e||[t]})),(r=St(Qt(r=e.reduce((function(t,e){return e.forEach((function(e){t.push(e)})),t}),[])),yt.NFKC)).forEach((function(t){if(rl(t,Al))throw new Error("STRINGPREP_CONTAINS_PROHIBITED")})),r.forEach((function(t){if(rl(t,nl))throw new Error("STRINGPREP_CONTAINS_UNASSIGNED")}));var n=Qt(r);if("-"===n.substring(0,1)||"--"===n.substring(2,4)||"-"===n.substring(n.length-1))throw new Error("invalid hyphen");return n}function fl(t){var e=Ct(t);if(e.length>31)throw new Error("bytes32 string must be less than 32 bytes");return Object(A.i)(Object(A.b)([e,Cs]).slice(0,32))}function hl(t){var e=Object(A.a)(t);if(32!==e.length)throw new Error("invalid bytes32 - not 32 bytes long");if(0!==e[31])throw new Error("invalid bytes32 string - no null terminator");for(var r=31;0===e[r-1];)r--;return kt(e.slice(0,r))}var ll=new h.b("units/5.7.0"),dl=["wei","kwei","mwei","gwei","szabo","finney","ether"];function gl(t){var e=String(t).split(".");(e.length>2||!e[0].match(/^-?[0-9]*$/)||e[1]&&!e[1].match(/^[0-9]*$/)||"."===t||"-."===t)&&ll.throwArgumentError("invalid value","value",t);var r=e[0],n="";for("-"===r.substring(0,1)&&(n="-",r=r.substring(1));"0"===r.substring(0,1);)r=r.substring(1);""===r&&(r="0");var i="";for(2===e.length&&(i="."+(e[1]||"0"));i.length>2&&"0"===i[i.length-1];)i=i.substring(0,i.length-1);for(var o=[];r.length;){if(r.length<=3){o.unshift(r);break}var a=r.length-3;o.unshift(r.substring(a)),r=r.substring(0,a)}return n+o.join(",")+i}function pl(t,e){if("string"==typeof e){var r=dl.indexOf(e);-1!==r&&(e=3*r)}return oo(t,null!=e?e:18)}function yl(t,e){if("string"!=typeof t&&ll.throwArgumentError("value must be a string","value",t),"string"==typeof e){var r=dl.indexOf(e);-1!==r&&(e=3*r)}return ao(t,null!=e?e:18)}function Il(t){return pl(t,18)}function bl(t){return yl(t,18)}var vl="ethers/5.7.2",El=new h.b(vl);try{var ml=window;null==ml._ethers&&(ml._ethers=c)}catch(t){}},function(t,e,r){"use strict";(function(t){r.d(e,"a",(function(){return A}));var n=r(0),i=r(1),o=r(168),a=new i.b(o.a);var s=function(){if("undefined"!=typeof self)return self;if("undefined"!=typeof window)return window;if(void 0!==t)return t;throw new Error("unable to locate global object")}(),c=s.crypto||s.msCrypto;function A(t){(t<=0||t>1024||t%1||t!=t)&&a.throwArgumentError("invalid length","length",t);var e=new Uint8Array(t);return c.getRandomValues(e),Object(n.a)(e)}c&&c.getRandomValues||(a.warn("WARNING: Missing strong random number source"),c={getRandomValues:function(t){return a.throwError("no secure random source avaialble",i.b.errors.UNSUPPORTED_OPERATION,{operation:"crypto.getRandomValues"})}})}).call(this,r(8))}])}));
|
|
67
|
+
/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */t.exports=i=function(){return e},t.exports.__esModule=!0,t.exports.default=t.exports;var e={},r=Object.prototype,o=r.hasOwnProperty,a=Object.defineProperty||function(t,e,r){t[e]=r.value},s="function"==typeof Symbol?Symbol:{},c=s.iterator||"@@iterator",A=s.asyncIterator||"@@asyncIterator",u=s.toStringTag||"@@toStringTag";function f(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{f({},"")}catch(t){f=function(t,e,r){return t[e]=r}}function h(t,e,r,n){var i=e&&e.prototype instanceof g?e:g,o=Object.create(i.prototype),s=new S(n||[]);return a(o,"_invoke",{value:w(t,r,s)}),o}function l(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=h;var d={};function g(){}function p(){}function y(){}var I={};f(I,c,(function(){return this}));var b=Object.getPrototypeOf,v=b&&b(b(_([])));v&&v!==r&&o.call(v,c)&&(I=v);var E=y.prototype=g.prototype=Object.create(I);function m(t){["next","throw","return"].forEach((function(e){f(t,e,(function(t){return this._invoke(e,t)}))}))}function C(t,e){var r;a(this,"_invoke",{value:function(i,a){function s(){return new e((function(r,s){!function r(i,a,s,c){var A=l(t[i],t,a);if("throw"!==A.type){var u=A.arg,f=u.value;return f&&"object"==n(f)&&o.call(f,"__await")?e.resolve(f.__await).then((function(t){r("next",t,s,c)}),(function(t){r("throw",t,s,c)})):e.resolve(f).then((function(t){u.value=t,s(u)}),(function(t){return r("throw",t,s,c)}))}c(A.arg)}(i,a,r,s)}))}return r=r?r.then(s,s):s()}})}function w(t,e,r){var n="suspendedStart";return function(i,o){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===i)throw o;return D()}for(r.method=i,r.arg=o;;){var a=r.delegate;if(a){var s=B(a,r);if(s){if(s===d)continue;return s}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var c=l(t,e,r);if("normal"===c.type){if(n=r.done?"completed":"suspendedYield",c.arg===d)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(n="completed",r.method="throw",r.arg=c.arg)}}}function B(t,e){var r=e.method,n=t.iterator[r];if(void 0===n)return e.delegate=null,"throw"===r&&t.iterator.return&&(e.method="return",e.arg=void 0,B(t,e),"throw"===e.method)||"return"!==r&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+r+"' method")),d;var i=l(n,t.iterator,e.arg);if("throw"===i.type)return e.method="throw",e.arg=i.arg,e.delegate=null,d;var o=i.arg;return o?o.done?(e[t.resultName]=o.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,d):o:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,d)}function Q(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function k(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function S(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(Q,this),this.reset(!0)}function _(t){if(t){var e=t[c];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var r=-1,n=function e(){for(;++r<t.length;)if(o.call(t,r))return e.value=t[r],e.done=!1,e;return e.value=void 0,e.done=!0,e};return n.next=n}}return{next:D}}function D(){return{value:void 0,done:!0}}return p.prototype=y,a(E,"constructor",{value:y,configurable:!0}),a(y,"constructor",{value:p,configurable:!0}),p.displayName=f(y,u,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===p||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,y):(t.__proto__=y,f(t,u,"GeneratorFunction")),t.prototype=Object.create(E),t},e.awrap=function(t){return{__await:t}},m(C.prototype),f(C.prototype,A,(function(){return this})),e.AsyncIterator=C,e.async=function(t,r,n,i,o){void 0===o&&(o=Promise);var a=new C(h(t,r,n,i),o);return e.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},m(E),f(E,u,"Generator"),f(E,c,(function(){return this})),f(E,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},e.values=_,S.prototype={constructor:S,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(k),!t)for(var e in this)"t"===e.charAt(0)&&o.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function r(r,n){return a.type="throw",a.arg=t,e.next=r,n&&(e.method="next",e.arg=void 0),!!n}for(var n=this.tryEntries.length-1;n>=0;--n){var i=this.tryEntries[n],a=i.completion;if("root"===i.tryLoc)return r("end");if(i.tryLoc<=this.prev){var s=o.call(i,"catchLoc"),c=o.call(i,"finallyLoc");if(s&&c){if(this.prev<i.catchLoc)return r(i.catchLoc,!0);if(this.prev<i.finallyLoc)return r(i.finallyLoc)}else if(s){if(this.prev<i.catchLoc)return r(i.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return r(i.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&o.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var i=n;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,d):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),d},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),k(r),d}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var i=n.arg;k(r)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:_(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),d}},e}t.exports=i,t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e,r){var n=r(52),i=r(53),o=0,a=function(){"use strict";function t(){n(this,t)}return i(t,null,[{key:"next",value:function(){return++o}}]),t}();t.exports=a},function(t,e){var r={}.toString;t.exports=Array.isArray||function(t){return"[object Array]"==r.call(t)}},function(t,e,r){var n=r(86);t.exports=function(t){if(Array.isArray(t))return n(t)},t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e){t.exports=function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)},t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e){t.exports=function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")},t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e,r){var n=r(180),i=r(181),o=r(87),a=r(182);t.exports=function(t,e){return n(t)||i(t,e)||o(t,e)||a()},t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e){t.exports=function(t){if(Array.isArray(t))return t},t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e){t.exports=function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,i,o,a,s=[],c=!0,A=!1;try{if(o=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;c=!1}else for(;!(c=(n=o.call(r)).done)&&(s.push(n.value),s.length!==e);c=!0);}catch(t){A=!0,i=t}finally{try{if(!c&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(A)throw i}}return s}},t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e){t.exports=function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")},t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e,r){"use strict";var n=r(4).Buffer;t.exports=function(t){if(t.length>=255)throw new TypeError("Alphabet too long");for(var e=new Uint8Array(256),r=0;r<e.length;r++)e[r]=255;for(var i=0;i<t.length;i++){var o=t.charAt(i),a=o.charCodeAt(0);if(255!==e[a])throw new TypeError(o+" is ambiguous");e[a]=i}var s=t.length,c=t.charAt(0),A=Math.log(s)/Math.log(256),u=Math.log(256)/Math.log(s);function f(t){if("string"!=typeof t)throw new TypeError("Expected String");if(0===t.length)return n.alloc(0);for(var r=0,i=0,o=0;t[r]===c;)i++,r++;for(var a=(t.length-r)*A+1>>>0,u=new Uint8Array(a);t[r];){var f=e[t.charCodeAt(r)];if(255===f)return;for(var h=0,l=a-1;(0!==f||h<o)&&-1!==l;l--,h++)f+=s*u[l]>>>0,u[l]=f%256>>>0,f=f/256>>>0;if(0!==f)throw new Error("Non-zero carry");o=h,r++}for(var d=a-o;d!==a&&0===u[d];)d++;var g=n.allocUnsafe(i+(a-d));g.fill(0,0,i);for(var p=i;d!==a;)g[p++]=u[d++];return g}return{encode:function(e){if((Array.isArray(e)||e instanceof Uint8Array)&&(e=n.from(e)),!n.isBuffer(e))throw new TypeError("Expected Buffer");if(0===e.length)return"";for(var r=0,i=0,o=0,a=e.length;o!==a&&0===e[o];)o++,r++;for(var A=(a-o)*u+1>>>0,f=new Uint8Array(A);o!==a;){for(var h=e[o],l=0,d=A-1;(0!==h||l<i)&&-1!==d;d--,l++)h+=256*f[d]>>>0,f[d]=h%s>>>0,h=h/s>>>0;if(0!==h)throw new Error("Non-zero carry");i=l,o++}for(var g=A-i;g!==A&&0===f[g];)g++;for(var p=c.repeat(r);g<A;++g)p+=t.charAt(f[g]);return p},decodeUnsafe:f,decode:function(t){var e=f(t);if(e)return e;throw new Error("Non-base"+s+" character")}}}},function(t,e,r){var n;function i(t){return(i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}!function(o){"use strict";var a,s=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,c="function"==typeof Symbol&&"symbol"==i(Symbol.iterator),A=Math.ceil,u=Math.floor,f="[BigNumber Error] ",h=f+"Number primitive has more than 15 significant digits: ",l=1e14,d=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13],g=1e9;function p(t){var e=0|t;return t>0||t===e?e:e-1}function y(t){for(var e,r,n=1,i=t.length,o=t[0]+"";n<i;){for(r=14-(e=t[n++]+"").length;r--;e="0"+e);o+=e}for(i=o.length;48===o.charCodeAt(--i););return o.slice(0,i+1||1)}function I(t,e){var r,n,i=t.c,o=e.c,a=t.s,s=e.s,c=t.e,A=e.e;if(!a||!s)return null;if(r=i&&!i[0],n=o&&!o[0],r||n)return r?n?0:-s:a;if(a!=s)return a;if(r=a<0,n=c==A,!i||!o)return n?0:!i^r?1:-1;if(!n)return c>A^r?1:-1;for(s=(c=i.length)<(A=o.length)?c:A,a=0;a<s;a++)if(i[a]!=o[a])return i[a]>o[a]^r?1:-1;return c==A?0:c>A^r?1:-1}function b(t,e,r,n){if(t<e||t>r||t!==u(t))throw Error(f+(n||"Argument")+("number"==typeof t?t<e||t>r?" out of range: ":" not an integer: ":" not a primitive number: ")+String(t))}function v(t){var e=t.c.length-1;return p(t.e/14)==e&&t.c[e]%2!=0}function E(t,e){return(t.length>1?t.charAt(0)+"."+t.slice(1):t)+(e<0?"e":"e+")+e}function m(t,e,r){var n,i;if(e<0){for(i=r+".";++e;i+=r);t=i+t}else if(++e>(n=t.length)){for(i=r,e-=n;--e;i+=r);t+=i}else e<n&&(t=t.slice(0,e)+"."+t.slice(e));return t}(a=function t(e){var r,n,o,a,C,w,B,Q,k,S=U.prototype={constructor:U,toString:null,valueOf:null},_=new U(1),D=20,x=4,M=-7,R=21,O=-1e7,N=1e7,P=!1,j=1,L=0,F={prefix:"",groupSize:3,secondaryGroupSize:0,groupSeparator:",",decimalSeparator:".",fractionGroupSize:0,fractionGroupSeparator:" ",suffix:""},T="0123456789abcdefghijklmnopqrstuvwxyz";function U(t,e){var r,i,a,c,A,f,l,d,g=this;if(!(g instanceof U))return new U(t,e);if(null==e){if(t&&!0===t._isBigNumber)return g.s=t.s,void(!t.c||t.e>N?g.c=g.e=null:t.e<O?g.c=[g.e=0]:(g.e=t.e,g.c=t.c.slice()));if((f="number"==typeof t)&&0*t==0){if(g.s=1/t<0?(t=-t,-1):1,t===~~t){for(c=0,A=t;A>=10;A/=10,c++);return void(c>N?g.c=g.e=null:(g.e=c,g.c=[t]))}d=String(t)}else{if(!s.test(d=String(t)))return o(g,d,f);g.s=45==d.charCodeAt(0)?(d=d.slice(1),-1):1}(c=d.indexOf("."))>-1&&(d=d.replace(".","")),(A=d.search(/e/i))>0?(c<0&&(c=A),c+=+d.slice(A+1),d=d.substring(0,A)):c<0&&(c=d.length)}else{if(b(e,2,T.length,"Base"),10==e)return K(g=new U(t),D+g.e+1,x);if(d=String(t),f="number"==typeof t){if(0*t!=0)return o(g,d,f,e);if(g.s=1/t<0?(d=d.slice(1),-1):1,U.DEBUG&&d.replace(/^0\.0*|\./,"").length>15)throw Error(h+t)}else g.s=45===d.charCodeAt(0)?(d=d.slice(1),-1):1;for(r=T.slice(0,e),c=A=0,l=d.length;A<l;A++)if(r.indexOf(i=d.charAt(A))<0){if("."==i){if(A>c){c=l;continue}}else if(!a&&(d==d.toUpperCase()&&(d=d.toLowerCase())||d==d.toLowerCase()&&(d=d.toUpperCase()))){a=!0,A=-1,c=0;continue}return o(g,String(t),f,e)}f=!1,(c=(d=n(d,e,10,g.s)).indexOf("."))>-1?d=d.replace(".",""):c=d.length}for(A=0;48===d.charCodeAt(A);A++);for(l=d.length;48===d.charCodeAt(--l););if(d=d.slice(A,++l)){if(l-=A,f&&U.DEBUG&&l>15&&(t>9007199254740991||t!==u(t)))throw Error(h+g.s*t);if((c=c-A-1)>N)g.c=g.e=null;else if(c<O)g.c=[g.e=0];else{if(g.e=c,g.c=[],A=(c+1)%14,c<0&&(A+=14),A<l){for(A&&g.c.push(+d.slice(0,A)),l-=14;A<l;)g.c.push(+d.slice(A,A+=14));A=14-(d=d.slice(A)).length}else A-=l;for(;A--;d+="0");g.c.push(+d)}}else g.c=[g.e=0]}function G(t,e,r,n){var i,o,a,s,c;if(null==r?r=x:b(r,0,8),!t.c)return t.toString();if(i=t.c[0],a=t.e,null==e)c=y(t.c),c=1==n||2==n&&(a<=M||a>=R)?E(c,a):m(c,a,"0");else if(o=(t=K(new U(t),e,r)).e,s=(c=y(t.c)).length,1==n||2==n&&(e<=o||o<=M)){for(;s<e;c+="0",s++);c=E(c,o)}else if(e-=a,c=m(c,o,"0"),o+1>s){if(--e>0)for(c+=".";e--;c+="0");}else if((e+=o-s)>0)for(o+1==s&&(c+=".");e--;c+="0");return t.s<0&&i?"-"+c:c}function H(t,e){for(var r,n=1,i=new U(t[0]);n<t.length;n++){if(!(r=new U(t[n])).s){i=r;break}e.call(i,r)&&(i=r)}return i}function Y(t,e,r){for(var n=1,i=e.length;!e[--i];e.pop());for(i=e[0];i>=10;i/=10,n++);return(r=n+14*r-1)>N?t.c=t.e=null:r<O?t.c=[t.e=0]:(t.e=r,t.c=e),t}function K(t,e,r,n){var i,o,a,s,c,f,h,g=t.c,p=d;if(g){t:{for(i=1,s=g[0];s>=10;s/=10,i++);if((o=e-i)<0)o+=14,a=e,h=(c=g[f=0])/p[i-a-1]%10|0;else if((f=A((o+1)/14))>=g.length){if(!n)break t;for(;g.length<=f;g.push(0));c=h=0,i=1,a=(o%=14)-14+1}else{for(c=s=g[f],i=1;s>=10;s/=10,i++);h=(a=(o%=14)-14+i)<0?0:c/p[i-a-1]%10|0}if(n=n||e<0||null!=g[f+1]||(a<0?c:c%p[i-a-1]),n=r<4?(h||n)&&(0==r||r==(t.s<0?3:2)):h>5||5==h&&(4==r||n||6==r&&(o>0?a>0?c/p[i-a]:0:g[f-1])%10&1||r==(t.s<0?8:7)),e<1||!g[0])return g.length=0,n?(e-=t.e+1,g[0]=p[(14-e%14)%14],t.e=-e||0):g[0]=t.e=0,t;if(0==o?(g.length=f,s=1,f--):(g.length=f+1,s=p[14-o],g[f]=a>0?u(c/p[i-a]%p[a])*s:0),n)for(;;){if(0==f){for(o=1,a=g[0];a>=10;a/=10,o++);for(a=g[0]+=s,s=1;a>=10;a/=10,s++);o!=s&&(t.e++,g[0]==l&&(g[0]=1));break}if(g[f]+=s,g[f]!=l)break;g[f--]=0,s=1}for(o=g.length;0===g[--o];g.pop());}t.e>N?t.c=t.e=null:t.e<O&&(t.c=[t.e=0])}return t}function q(t){var e,r=t.e;return null===r?t.toString():(e=y(t.c),e=r<=M||r>=R?E(e,r):m(e,r,"0"),t.s<0?"-"+e:e)}return U.clone=t,U.ROUND_UP=0,U.ROUND_DOWN=1,U.ROUND_CEIL=2,U.ROUND_FLOOR=3,U.ROUND_HALF_UP=4,U.ROUND_HALF_DOWN=5,U.ROUND_HALF_EVEN=6,U.ROUND_HALF_CEIL=7,U.ROUND_HALF_FLOOR=8,U.EUCLID=9,U.config=U.set=function(t){var e,r;if(null!=t){if("object"!=i(t))throw Error(f+"Object expected: "+t);if(t.hasOwnProperty(e="DECIMAL_PLACES")&&(b(r=t[e],0,g,e),D=r),t.hasOwnProperty(e="ROUNDING_MODE")&&(b(r=t[e],0,8,e),x=r),t.hasOwnProperty(e="EXPONENTIAL_AT")&&((r=t[e])&&r.pop?(b(r[0],-g,0,e),b(r[1],0,g,e),M=r[0],R=r[1]):(b(r,-g,g,e),M=-(R=r<0?-r:r))),t.hasOwnProperty(e="RANGE"))if((r=t[e])&&r.pop)b(r[0],-g,-1,e),b(r[1],1,g,e),O=r[0],N=r[1];else{if(b(r,-g,g,e),!r)throw Error(f+e+" cannot be zero: "+r);O=-(N=r<0?-r:r)}if(t.hasOwnProperty(e="CRYPTO")){if((r=t[e])!==!!r)throw Error(f+e+" not true or false: "+r);if(r){if("undefined"==typeof crypto||!crypto||!crypto.getRandomValues&&!crypto.randomBytes)throw P=!r,Error(f+"crypto unavailable");P=r}else P=r}if(t.hasOwnProperty(e="MODULO_MODE")&&(b(r=t[e],0,9,e),j=r),t.hasOwnProperty(e="POW_PRECISION")&&(b(r=t[e],0,g,e),L=r),t.hasOwnProperty(e="FORMAT")){if("object"!=i(r=t[e]))throw Error(f+e+" not an object: "+r);F=r}if(t.hasOwnProperty(e="ALPHABET")){if("string"!=typeof(r=t[e])||/^.$|[+-.\s]|(.).*\1/.test(r))throw Error(f+e+" invalid: "+r);T=r}}return{DECIMAL_PLACES:D,ROUNDING_MODE:x,EXPONENTIAL_AT:[M,R],RANGE:[O,N],CRYPTO:P,MODULO_MODE:j,POW_PRECISION:L,FORMAT:F,ALPHABET:T}},U.isBigNumber=function(t){if(!t||!0!==t._isBigNumber)return!1;if(!U.DEBUG)return!0;var e,r,n=t.c,i=t.e,o=t.s;t:if("[object Array]"=={}.toString.call(n)){if((1===o||-1===o)&&i>=-g&&i<=g&&i===u(i)){if(0===n[0]){if(0===i&&1===n.length)return!0;break t}if((e=(i+1)%14)<1&&(e+=14),String(n[0]).length==e){for(e=0;e<n.length;e++)if((r=n[e])<0||r>=l||r!==u(r))break t;if(0!==r)return!0}}}else if(null===n&&null===i&&(null===o||1===o||-1===o))return!0;throw Error(f+"Invalid BigNumber: "+t)},U.maximum=U.max=function(){return H(arguments,S.lt)},U.minimum=U.min=function(){return H(arguments,S.gt)},U.random=(a=9007199254740992*Math.random()&2097151?function(){return u(9007199254740992*Math.random())}:function(){return 8388608*(1073741824*Math.random()|0)+(8388608*Math.random()|0)},function(t){var e,r,n,i,o,s=0,c=[],h=new U(_);if(null==t?t=D:b(t,0,g),i=A(t/14),P)if(crypto.getRandomValues){for(e=crypto.getRandomValues(new Uint32Array(i*=2));s<i;)(o=131072*e[s]+(e[s+1]>>>11))>=9e15?(r=crypto.getRandomValues(new Uint32Array(2)),e[s]=r[0],e[s+1]=r[1]):(c.push(o%1e14),s+=2);s=i/2}else{if(!crypto.randomBytes)throw P=!1,Error(f+"crypto unavailable");for(e=crypto.randomBytes(i*=7);s<i;)(o=281474976710656*(31&e[s])+1099511627776*e[s+1]+4294967296*e[s+2]+16777216*e[s+3]+(e[s+4]<<16)+(e[s+5]<<8)+e[s+6])>=9e15?crypto.randomBytes(7).copy(e,s):(c.push(o%1e14),s+=7);s=i/7}if(!P)for(;s<i;)(o=a())<9e15&&(c[s++]=o%1e14);for(t%=14,(i=c[--s])&&t&&(o=d[14-t],c[s]=u(i/o)*o);0===c[s];c.pop(),s--);if(s<0)c=[n=0];else{for(n=-1;0===c[0];c.splice(0,1),n-=14);for(s=1,o=c[0];o>=10;o/=10,s++);s<14&&(n-=14-s)}return h.e=n,h.c=c,h}),U.sum=function(){for(var t=1,e=arguments,r=new U(e[0]);t<e.length;)r=r.plus(e[t++]);return r},n=function(){function t(t,e,r,n){for(var i,o,a=[0],s=0,c=t.length;s<c;){for(o=a.length;o--;a[o]*=e);for(a[0]+=n.indexOf(t.charAt(s++)),i=0;i<a.length;i++)a[i]>r-1&&(null==a[i+1]&&(a[i+1]=0),a[i+1]+=a[i]/r|0,a[i]%=r)}return a.reverse()}return function(e,n,i,o,a){var s,c,A,u,f,h,l,d,g=e.indexOf("."),p=D,I=x;for(g>=0&&(u=L,L=0,e=e.replace(".",""),h=(d=new U(n)).pow(e.length-g),L=u,d.c=t(m(y(h.c),h.e,"0"),10,i,"0123456789"),d.e=d.c.length),A=u=(l=t(e,n,i,a?(s=T,"0123456789"):(s="0123456789",T))).length;0==l[--u];l.pop());if(!l[0])return s.charAt(0);if(g<0?--A:(h.c=l,h.e=A,h.s=o,l=(h=r(h,d,p,I,i)).c,f=h.r,A=h.e),g=l[c=A+p+1],u=i/2,f=f||c<0||null!=l[c+1],f=I<4?(null!=g||f)&&(0==I||I==(h.s<0?3:2)):g>u||g==u&&(4==I||f||6==I&&1&l[c-1]||I==(h.s<0?8:7)),c<1||!l[0])e=f?m(s.charAt(1),-p,s.charAt(0)):s.charAt(0);else{if(l.length=c,f)for(--i;++l[--c]>i;)l[c]=0,c||(++A,l=[1].concat(l));for(u=l.length;!l[--u];);for(g=0,e="";g<=u;e+=s.charAt(l[g++]));e=m(e,A,s.charAt(0))}return e}}(),r=function(){function t(t,e,r){var n,i,o,a,s=0,c=t.length,A=e%1e7,u=e/1e7|0;for(t=t.slice();c--;)s=((i=A*(o=t[c]%1e7)+(n=u*o+(a=t[c]/1e7|0)*A)%1e7*1e7+s)/r|0)+(n/1e7|0)+u*a,t[c]=i%r;return s&&(t=[s].concat(t)),t}function e(t,e,r,n){var i,o;if(r!=n)o=r>n?1:-1;else for(i=o=0;i<r;i++)if(t[i]!=e[i]){o=t[i]>e[i]?1:-1;break}return o}function r(t,e,r,n){for(var i=0;r--;)t[r]-=i,i=t[r]<e[r]?1:0,t[r]=i*n+t[r]-e[r];for(;!t[0]&&t.length>1;t.splice(0,1));}return function(n,i,o,a,s){var c,A,f,h,d,g,y,I,b,v,E,m,C,w,B,Q,k,S=n.s==i.s?1:-1,_=n.c,D=i.c;if(!(_&&_[0]&&D&&D[0]))return new U(n.s&&i.s&&(_?!D||_[0]!=D[0]:D)?_&&0==_[0]||!D?0*S:S/0:NaN);for(b=(I=new U(S)).c=[],S=o+(A=n.e-i.e)+1,s||(s=l,A=p(n.e/14)-p(i.e/14),S=S/14|0),f=0;D[f]==(_[f]||0);f++);if(D[f]>(_[f]||0)&&A--,S<0)b.push(1),h=!0;else{for(w=_.length,Q=D.length,f=0,S+=2,(d=u(s/(D[0]+1)))>1&&(D=t(D,d,s),_=t(_,d,s),Q=D.length,w=_.length),C=Q,E=(v=_.slice(0,Q)).length;E<Q;v[E++]=0);k=D.slice(),k=[0].concat(k),B=D[0],D[1]>=s/2&&B++;do{if(d=0,(c=e(D,v,Q,E))<0){if(m=v[0],Q!=E&&(m=m*s+(v[1]||0)),(d=u(m/B))>1)for(d>=s&&(d=s-1),y=(g=t(D,d,s)).length,E=v.length;1==e(g,v,y,E);)d--,r(g,Q<y?k:D,y,s),y=g.length,c=1;else 0==d&&(c=d=1),y=(g=D.slice()).length;if(y<E&&(g=[0].concat(g)),r(v,g,E,s),E=v.length,-1==c)for(;e(D,v,Q,E)<1;)d++,r(v,Q<E?k:D,E,s),E=v.length}else 0===c&&(d++,v=[0]);b[f++]=d,v[0]?v[E++]=_[C]||0:(v=[_[C]],E=1)}while((C++<w||null!=v[0])&&S--);h=null!=v[0],b[0]||b.splice(0,1)}if(s==l){for(f=1,S=b[0];S>=10;S/=10,f++);K(I,o+(I.e=f+14*A-1)+1,a,h)}else I.e=A,I.r=+h;return I}}(),C=/^(-?)0([xbo])(?=\w[\w.]*$)/i,w=/^([^.]+)\.$/,B=/^\.([^.]+)$/,Q=/^-?(Infinity|NaN)$/,k=/^\s*\+(?=[\w.])|^\s+|\s+$/g,o=function(t,e,r,n){var i,o=r?e:e.replace(k,"");if(Q.test(o))t.s=isNaN(o)?null:o<0?-1:1;else{if(!r&&(o=o.replace(C,(function(t,e,r){return i="x"==(r=r.toLowerCase())?16:"b"==r?2:8,n&&n!=i?t:e})),n&&(i=n,o=o.replace(w,"$1").replace(B,"0.$1")),e!=o))return new U(o,i);if(U.DEBUG)throw Error(f+"Not a"+(n?" base "+n:"")+" number: "+e);t.s=null}t.c=t.e=null},S.absoluteValue=S.abs=function(){var t=new U(this);return t.s<0&&(t.s=1),t},S.comparedTo=function(t,e){return I(this,new U(t,e))},S.decimalPlaces=S.dp=function(t,e){var r,n,i,o=this;if(null!=t)return b(t,0,g),null==e?e=x:b(e,0,8),K(new U(o),t+o.e+1,e);if(!(r=o.c))return null;if(n=14*((i=r.length-1)-p(this.e/14)),i=r[i])for(;i%10==0;i/=10,n--);return n<0&&(n=0),n},S.dividedBy=S.div=function(t,e){return r(this,new U(t,e),D,x)},S.dividedToIntegerBy=S.idiv=function(t,e){return r(this,new U(t,e),0,1)},S.exponentiatedBy=S.pow=function(t,e){var r,n,i,o,a,s,c,h,l=this;if((t=new U(t)).c&&!t.isInteger())throw Error(f+"Exponent not an integer: "+q(t));if(null!=e&&(e=new U(e)),a=t.e>14,!l.c||!l.c[0]||1==l.c[0]&&!l.e&&1==l.c.length||!t.c||!t.c[0])return h=new U(Math.pow(+q(l),a?2-v(t):+q(t))),e?h.mod(e):h;if(s=t.s<0,e){if(e.c?!e.c[0]:!e.s)return new U(NaN);(n=!s&&l.isInteger()&&e.isInteger())&&(l=l.mod(e))}else{if(t.e>9&&(l.e>0||l.e<-1||(0==l.e?l.c[0]>1||a&&l.c[1]>=24e7:l.c[0]<8e13||a&&l.c[0]<=9999975e7)))return o=l.s<0&&v(t)?-0:0,l.e>-1&&(o=1/o),new U(s?1/o:o);L&&(o=A(L/14+2))}for(a?(r=new U(.5),s&&(t.s=1),c=v(t)):c=(i=Math.abs(+q(t)))%2,h=new U(_);;){if(c){if(!(h=h.times(l)).c)break;o?h.c.length>o&&(h.c.length=o):n&&(h=h.mod(e))}if(i){if(0===(i=u(i/2)))break;c=i%2}else if(K(t=t.times(r),t.e+1,1),t.e>14)c=v(t);else{if(0===(i=+q(t)))break;c=i%2}l=l.times(l),o?l.c&&l.c.length>o&&(l.c.length=o):n&&(l=l.mod(e))}return n?h:(s&&(h=_.div(h)),e?h.mod(e):o?K(h,L,x,void 0):h)},S.integerValue=function(t){var e=new U(this);return null==t?t=x:b(t,0,8),K(e,e.e+1,t)},S.isEqualTo=S.eq=function(t,e){return 0===I(this,new U(t,e))},S.isFinite=function(){return!!this.c},S.isGreaterThan=S.gt=function(t,e){return I(this,new U(t,e))>0},S.isGreaterThanOrEqualTo=S.gte=function(t,e){return 1===(e=I(this,new U(t,e)))||0===e},S.isInteger=function(){return!!this.c&&p(this.e/14)>this.c.length-2},S.isLessThan=S.lt=function(t,e){return I(this,new U(t,e))<0},S.isLessThanOrEqualTo=S.lte=function(t,e){return-1===(e=I(this,new U(t,e)))||0===e},S.isNaN=function(){return!this.s},S.isNegative=function(){return this.s<0},S.isPositive=function(){return this.s>0},S.isZero=function(){return!!this.c&&0==this.c[0]},S.minus=function(t,e){var r,n,i,o,a=this,s=a.s;if(e=(t=new U(t,e)).s,!s||!e)return new U(NaN);if(s!=e)return t.s=-e,a.plus(t);var c=a.e/14,A=t.e/14,u=a.c,f=t.c;if(!c||!A){if(!u||!f)return u?(t.s=-e,t):new U(f?a:NaN);if(!u[0]||!f[0])return f[0]?(t.s=-e,t):new U(u[0]?a:3==x?-0:0)}if(c=p(c),A=p(A),u=u.slice(),s=c-A){for((o=s<0)?(s=-s,i=u):(A=c,i=f),i.reverse(),e=s;e--;i.push(0));i.reverse()}else for(n=(o=(s=u.length)<(e=f.length))?s:e,s=e=0;e<n;e++)if(u[e]!=f[e]){o=u[e]<f[e];break}if(o&&(i=u,u=f,f=i,t.s=-t.s),(e=(n=f.length)-(r=u.length))>0)for(;e--;u[r++]=0);for(e=l-1;n>s;){if(u[--n]<f[n]){for(r=n;r&&!u[--r];u[r]=e);--u[r],u[n]+=l}u[n]-=f[n]}for(;0==u[0];u.splice(0,1),--A);return u[0]?Y(t,u,A):(t.s=3==x?-1:1,t.c=[t.e=0],t)},S.modulo=S.mod=function(t,e){var n,i,o=this;return t=new U(t,e),!o.c||!t.s||t.c&&!t.c[0]?new U(NaN):!t.c||o.c&&!o.c[0]?new U(o):(9==j?(i=t.s,t.s=1,n=r(o,t,0,3),t.s=i,n.s*=i):n=r(o,t,0,j),(t=o.minus(n.times(t))).c[0]||1!=j||(t.s=o.s),t)},S.multipliedBy=S.times=function(t,e){var r,n,i,o,a,s,c,A,u,f,h,d,g,y,I=this,b=I.c,v=(t=new U(t,e)).c;if(!(b&&v&&b[0]&&v[0]))return!I.s||!t.s||b&&!b[0]&&!v||v&&!v[0]&&!b?t.c=t.e=t.s=null:(t.s*=I.s,b&&v?(t.c=[0],t.e=0):t.c=t.e=null),t;for(n=p(I.e/14)+p(t.e/14),t.s*=I.s,(c=b.length)<(f=v.length)&&(g=b,b=v,v=g,i=c,c=f,f=i),i=c+f,g=[];i--;g.push(0));for(y=l,1e7,i=f;--i>=0;){for(r=0,h=v[i]%1e7,d=v[i]/1e7|0,o=i+(a=c);o>i;)r=((A=h*(A=b[--a]%1e7)+(s=d*A+(u=b[a]/1e7|0)*h)%1e7*1e7+g[o]+r)/y|0)+(s/1e7|0)+d*u,g[o--]=A%y;g[o]=r}return r?++n:g.splice(0,1),Y(t,g,n)},S.negated=function(){var t=new U(this);return t.s=-t.s||null,t},S.plus=function(t,e){var r,n=this,i=n.s;if(e=(t=new U(t,e)).s,!i||!e)return new U(NaN);if(i!=e)return t.s=-e,n.minus(t);var o=n.e/14,a=t.e/14,s=n.c,c=t.c;if(!o||!a){if(!s||!c)return new U(i/0);if(!s[0]||!c[0])return c[0]?t:new U(s[0]?n:0*i)}if(o=p(o),a=p(a),s=s.slice(),i=o-a){for(i>0?(a=o,r=c):(i=-i,r=s),r.reverse();i--;r.push(0));r.reverse()}for((i=s.length)-(e=c.length)<0&&(r=c,c=s,s=r,e=i),i=0;e;)i=(s[--e]=s[e]+c[e]+i)/l|0,s[e]=l===s[e]?0:s[e]%l;return i&&(s=[i].concat(s),++a),Y(t,s,a)},S.precision=S.sd=function(t,e){var r,n,i,o=this;if(null!=t&&t!==!!t)return b(t,1,g),null==e?e=x:b(e,0,8),K(new U(o),t,e);if(!(r=o.c))return null;if(n=14*(i=r.length-1)+1,i=r[i]){for(;i%10==0;i/=10,n--);for(i=r[0];i>=10;i/=10,n++);}return t&&o.e+1>n&&(n=o.e+1),n},S.shiftedBy=function(t){return b(t,-9007199254740991,9007199254740991),this.times("1e"+t)},S.squareRoot=S.sqrt=function(){var t,e,n,i,o,a=this,s=a.c,c=a.s,A=a.e,u=D+4,f=new U("0.5");if(1!==c||!s||!s[0])return new U(!c||c<0&&(!s||s[0])?NaN:s?a:1/0);if(0==(c=Math.sqrt(+q(a)))||c==1/0?(((e=y(s)).length+A)%2==0&&(e+="0"),c=Math.sqrt(+e),A=p((A+1)/2)-(A<0||A%2),n=new U(e=c==1/0?"1e"+A:(e=c.toExponential()).slice(0,e.indexOf("e")+1)+A)):n=new U(c+""),n.c[0])for((c=(A=n.e)+u)<3&&(c=0);;)if(o=n,n=f.times(o.plus(r(a,o,u,1))),y(o.c).slice(0,c)===(e=y(n.c)).slice(0,c)){if(n.e<A&&--c,"9999"!=(e=e.slice(c-3,c+1))&&(i||"4999"!=e)){+e&&(+e.slice(1)||"5"!=e.charAt(0))||(K(n,n.e+D+2,1),t=!n.times(n).eq(a));break}if(!i&&(K(o,o.e+D+2,0),o.times(o).eq(a))){n=o;break}u+=4,c+=4,i=1}return K(n,n.e+D+1,x,t)},S.toExponential=function(t,e){return null!=t&&(b(t,0,g),t++),G(this,t,e,1)},S.toFixed=function(t,e){return null!=t&&(b(t,0,g),t=t+this.e+1),G(this,t,e)},S.toFormat=function(t,e,r){var n,o=this;if(null==r)null!=t&&e&&"object"==i(e)?(r=e,e=null):t&&"object"==i(t)?(r=t,t=e=null):r=F;else if("object"!=i(r))throw Error(f+"Argument not an object: "+r);if(n=o.toFixed(t,e),o.c){var a,s=n.split("."),c=+r.groupSize,A=+r.secondaryGroupSize,u=r.groupSeparator||"",h=s[0],l=s[1],d=o.s<0,g=d?h.slice(1):h,p=g.length;if(A&&(a=c,c=A,A=a,p-=a),c>0&&p>0){for(a=p%c||c,h=g.substr(0,a);a<p;a+=c)h+=u+g.substr(a,c);A>0&&(h+=u+g.slice(a)),d&&(h="-"+h)}n=l?h+(r.decimalSeparator||"")+((A=+r.fractionGroupSize)?l.replace(new RegExp("\\d{"+A+"}\\B","g"),"$&"+(r.fractionGroupSeparator||"")):l):h}return(r.prefix||"")+n+(r.suffix||"")},S.toFraction=function(t){var e,n,i,o,a,s,c,A,u,h,l,g,p=this,I=p.c;if(null!=t&&(!(c=new U(t)).isInteger()&&(c.c||1!==c.s)||c.lt(_)))throw Error(f+"Argument "+(c.isInteger()?"out of range: ":"not an integer: ")+q(c));if(!I)return new U(p);for(e=new U(_),u=n=new U(_),i=A=new U(_),g=y(I),a=e.e=g.length-p.e-1,e.c[0]=d[(s=a%14)<0?14+s:s],t=!t||c.comparedTo(e)>0?a>0?e:u:c,s=N,N=1/0,c=new U(g),A.c[0]=0;h=r(c,e,0,1),1!=(o=n.plus(h.times(i))).comparedTo(t);)n=i,i=o,u=A.plus(h.times(o=u)),A=o,e=c.minus(h.times(o=e)),c=o;return o=r(t.minus(n),i,0,1),A=A.plus(o.times(u)),n=n.plus(o.times(i)),A.s=u.s=p.s,l=r(u,i,a*=2,x).minus(p).abs().comparedTo(r(A,n,a,x).minus(p).abs())<1?[u,i]:[A,n],N=s,l},S.toNumber=function(){return+q(this)},S.toPrecision=function(t,e){return null!=t&&b(t,1,g),G(this,t,e,2)},S.toString=function(t){var e,r=this,i=r.s,o=r.e;return null===o?i?(e="Infinity",i<0&&(e="-"+e)):e="NaN":(null==t?e=o<=M||o>=R?E(y(r.c),o):m(y(r.c),o,"0"):10===t?e=m(y((r=K(new U(r),D+o+1,x)).c),r.e,"0"):(b(t,2,T.length,"Base"),e=n(m(y(r.c),o,"0"),10,t,i,!0)),i<0&&r.c[0]&&(e="-"+e)),e},S.valueOf=S.toJSON=function(){return q(this)},S._isBigNumber=!0,c&&(S[Symbol.toStringTag]="BigNumber",S[Symbol.for("nodejs.util.inspect.custom")]=S.valueOf),null!=e&&U.set(e),U}()).default=a.BigNumber=a,void 0===(n=function(){return a}.call(e,r,e,t))||(t.exports=n)}()},function(t,e,r){t.exports={encode:r(186),decode:r(187),encodingLength:r(188)}},function(t,e){t.exports=function t(e,n,i){n=n||[];var o=i=i||0;for(;e>=r;)n[i++]=255&e|128,e/=128;for(;-128&e;)n[i++]=255&e|128,e>>>=7;return n[i]=0|e,t.bytes=i-o+1,n};var r=Math.pow(2,31)},function(t,e){t.exports=function t(e,r){var n,i=0,o=0,a=r=r||0,s=e.length;do{if(a>=s)throw t.bytes=0,new RangeError("Could not decode varint");n=e[a++],i+=o<28?(127&n)<<o:(127&n)*Math.pow(2,o),o+=7}while(n>=128);return t.bytes=a-r,i}},function(t,e){var r=Math.pow(2,7),n=Math.pow(2,14),i=Math.pow(2,21),o=Math.pow(2,28),a=Math.pow(2,35),s=Math.pow(2,42),c=Math.pow(2,49),A=Math.pow(2,56),u=Math.pow(2,63);t.exports=function(t){return t<r?1:t<n?2:t<i?3:t<o?4:t<a?5:t<s?6:t<c?7:t<A?8:t<u?9:10}},function(t,e,r){"use strict";r.r(e),r.d(e,"Deflate",(function(){return $e})),r.d(e,"Inflate",(function(){return nr})),r.d(e,"constants",(function(){return sr})),r.d(e,"default",(function(){return cr})),r.d(e,"deflate",(function(){return tr})),r.d(e,"deflateRaw",(function(){return er})),r.d(e,"gzip",(function(){return rr})),r.d(e,"inflate",(function(){return ir})),r.d(e,"inflateRaw",(function(){return or})),r.d(e,"ungzip",(function(){return ar}));function n(t){let e=t.length;for(;--e>=0;)t[e]=0}const i=new Uint8Array([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0]),o=new Uint8Array([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13]),a=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]),s=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),c=new Array(576);n(c);const A=new Array(60);n(A);const u=new Array(512);n(u);const f=new Array(256);n(f);const h=new Array(29);n(h);const l=new Array(30);function d(t,e,r,n,i){this.static_tree=t,this.extra_bits=e,this.extra_base=r,this.elems=n,this.max_length=i,this.has_stree=t&&t.length}let g,p,y;function I(t,e){this.dyn_tree=t,this.max_code=0,this.stat_desc=e}n(l);const b=t=>t<256?u[t]:u[256+(t>>>7)],v=(t,e)=>{t.pending_buf[t.pending++]=255&e,t.pending_buf[t.pending++]=e>>>8&255},E=(t,e,r)=>{t.bi_valid>16-r?(t.bi_buf|=e<<t.bi_valid&65535,v(t,t.bi_buf),t.bi_buf=e>>16-t.bi_valid,t.bi_valid+=r-16):(t.bi_buf|=e<<t.bi_valid&65535,t.bi_valid+=r)},m=(t,e,r)=>{E(t,r[2*e],r[2*e+1])},C=(t,e)=>{let r=0;do{r|=1&t,t>>>=1,r<<=1}while(--e>0);return r>>>1},w=(t,e,r)=>{const n=new Array(16);let i,o,a=0;for(i=1;i<=15;i++)a=a+r[i-1]<<1,n[i]=a;for(o=0;o<=e;o++){let e=t[2*o+1];0!==e&&(t[2*o]=C(n[e]++,e))}},B=t=>{let e;for(e=0;e<286;e++)t.dyn_ltree[2*e]=0;for(e=0;e<30;e++)t.dyn_dtree[2*e]=0;for(e=0;e<19;e++)t.bl_tree[2*e]=0;t.dyn_ltree[512]=1,t.opt_len=t.static_len=0,t.sym_next=t.matches=0},Q=t=>{t.bi_valid>8?v(t,t.bi_buf):t.bi_valid>0&&(t.pending_buf[t.pending++]=t.bi_buf),t.bi_buf=0,t.bi_valid=0},k=(t,e,r,n)=>{const i=2*e,o=2*r;return t[i]<t[o]||t[i]===t[o]&&n[e]<=n[r]},S=(t,e,r)=>{const n=t.heap[r];let i=r<<1;for(;i<=t.heap_len&&(i<t.heap_len&&k(e,t.heap[i+1],t.heap[i],t.depth)&&i++,!k(e,n,t.heap[i],t.depth));)t.heap[r]=t.heap[i],r=i,i<<=1;t.heap[r]=n},_=(t,e,r)=>{let n,a,s,c,A=0;if(0!==t.sym_next)do{n=255&t.pending_buf[t.sym_buf+A++],n+=(255&t.pending_buf[t.sym_buf+A++])<<8,a=t.pending_buf[t.sym_buf+A++],0===n?m(t,a,e):(s=f[a],m(t,s+256+1,e),c=i[s],0!==c&&(a-=h[s],E(t,a,c)),n--,s=b(n),m(t,s,r),c=o[s],0!==c&&(n-=l[s],E(t,n,c)))}while(A<t.sym_next);m(t,256,e)},D=(t,e)=>{const r=e.dyn_tree,n=e.stat_desc.static_tree,i=e.stat_desc.has_stree,o=e.stat_desc.elems;let a,s,c,A=-1;for(t.heap_len=0,t.heap_max=573,a=0;a<o;a++)0!==r[2*a]?(t.heap[++t.heap_len]=A=a,t.depth[a]=0):r[2*a+1]=0;for(;t.heap_len<2;)c=t.heap[++t.heap_len]=A<2?++A:0,r[2*c]=1,t.depth[c]=0,t.opt_len--,i&&(t.static_len-=n[2*c+1]);for(e.max_code=A,a=t.heap_len>>1;a>=1;a--)S(t,r,a);c=o;do{a=t.heap[1],t.heap[1]=t.heap[t.heap_len--],S(t,r,1),s=t.heap[1],t.heap[--t.heap_max]=a,t.heap[--t.heap_max]=s,r[2*c]=r[2*a]+r[2*s],t.depth[c]=(t.depth[a]>=t.depth[s]?t.depth[a]:t.depth[s])+1,r[2*a+1]=r[2*s+1]=c,t.heap[1]=c++,S(t,r,1)}while(t.heap_len>=2);t.heap[--t.heap_max]=t.heap[1],((t,e)=>{const r=e.dyn_tree,n=e.max_code,i=e.stat_desc.static_tree,o=e.stat_desc.has_stree,a=e.stat_desc.extra_bits,s=e.stat_desc.extra_base,c=e.stat_desc.max_length;let A,u,f,h,l,d,g=0;for(h=0;h<=15;h++)t.bl_count[h]=0;for(r[2*t.heap[t.heap_max]+1]=0,A=t.heap_max+1;A<573;A++)u=t.heap[A],h=r[2*r[2*u+1]+1]+1,h>c&&(h=c,g++),r[2*u+1]=h,u>n||(t.bl_count[h]++,l=0,u>=s&&(l=a[u-s]),d=r[2*u],t.opt_len+=d*(h+l),o&&(t.static_len+=d*(i[2*u+1]+l)));if(0!==g){do{for(h=c-1;0===t.bl_count[h];)h--;t.bl_count[h]--,t.bl_count[h+1]+=2,t.bl_count[c]--,g-=2}while(g>0);for(h=c;0!==h;h--)for(u=t.bl_count[h];0!==u;)f=t.heap[--A],f>n||(r[2*f+1]!==h&&(t.opt_len+=(h-r[2*f+1])*r[2*f],r[2*f+1]=h),u--)}})(t,e),w(r,A,t.bl_count)},x=(t,e,r)=>{let n,i,o=-1,a=e[1],s=0,c=7,A=4;for(0===a&&(c=138,A=3),e[2*(r+1)+1]=65535,n=0;n<=r;n++)i=a,a=e[2*(n+1)+1],++s<c&&i===a||(s<A?t.bl_tree[2*i]+=s:0!==i?(i!==o&&t.bl_tree[2*i]++,t.bl_tree[32]++):s<=10?t.bl_tree[34]++:t.bl_tree[36]++,s=0,o=i,0===a?(c=138,A=3):i===a?(c=6,A=3):(c=7,A=4))},M=(t,e,r)=>{let n,i,o=-1,a=e[1],s=0,c=7,A=4;for(0===a&&(c=138,A=3),n=0;n<=r;n++)if(i=a,a=e[2*(n+1)+1],!(++s<c&&i===a)){if(s<A)do{m(t,i,t.bl_tree)}while(0!=--s);else 0!==i?(i!==o&&(m(t,i,t.bl_tree),s--),m(t,16,t.bl_tree),E(t,s-3,2)):s<=10?(m(t,17,t.bl_tree),E(t,s-3,3)):(m(t,18,t.bl_tree),E(t,s-11,7));s=0,o=i,0===a?(c=138,A=3):i===a?(c=6,A=3):(c=7,A=4)}};let R=!1;const O=(t,e,r,n)=>{E(t,0+(n?1:0),3),Q(t),v(t,r),v(t,~r),r&&t.pending_buf.set(t.window.subarray(e,e+r),t.pending),t.pending+=r};var N={_tr_init:t=>{R||((()=>{let t,e,r,n,s;const I=new Array(16);for(r=0,n=0;n<28;n++)for(h[n]=r,t=0;t<1<<i[n];t++)f[r++]=n;for(f[r-1]=n,s=0,n=0;n<16;n++)for(l[n]=s,t=0;t<1<<o[n];t++)u[s++]=n;for(s>>=7;n<30;n++)for(l[n]=s<<7,t=0;t<1<<o[n]-7;t++)u[256+s++]=n;for(e=0;e<=15;e++)I[e]=0;for(t=0;t<=143;)c[2*t+1]=8,t++,I[8]++;for(;t<=255;)c[2*t+1]=9,t++,I[9]++;for(;t<=279;)c[2*t+1]=7,t++,I[7]++;for(;t<=287;)c[2*t+1]=8,t++,I[8]++;for(w(c,287,I),t=0;t<30;t++)A[2*t+1]=5,A[2*t]=C(t,5);g=new d(c,i,257,286,15),p=new d(A,o,0,30,15),y=new d(new Array(0),a,0,19,7)})(),R=!0),t.l_desc=new I(t.dyn_ltree,g),t.d_desc=new I(t.dyn_dtree,p),t.bl_desc=new I(t.bl_tree,y),t.bi_buf=0,t.bi_valid=0,B(t)},_tr_stored_block:O,_tr_flush_block:(t,e,r,n)=>{let i,o,a=0;t.level>0?(2===t.strm.data_type&&(t.strm.data_type=(t=>{let e,r=4093624447;for(e=0;e<=31;e++,r>>>=1)if(1&r&&0!==t.dyn_ltree[2*e])return 0;if(0!==t.dyn_ltree[18]||0!==t.dyn_ltree[20]||0!==t.dyn_ltree[26])return 1;for(e=32;e<256;e++)if(0!==t.dyn_ltree[2*e])return 1;return 0})(t)),D(t,t.l_desc),D(t,t.d_desc),a=(t=>{let e;for(x(t,t.dyn_ltree,t.l_desc.max_code),x(t,t.dyn_dtree,t.d_desc.max_code),D(t,t.bl_desc),e=18;e>=3&&0===t.bl_tree[2*s[e]+1];e--);return t.opt_len+=3*(e+1)+5+5+4,e})(t),i=t.opt_len+3+7>>>3,o=t.static_len+3+7>>>3,o<=i&&(i=o)):i=o=r+5,r+4<=i&&-1!==e?O(t,e,r,n):4===t.strategy||o===i?(E(t,2+(n?1:0),3),_(t,c,A)):(E(t,4+(n?1:0),3),((t,e,r,n)=>{let i;for(E(t,e-257,5),E(t,r-1,5),E(t,n-4,4),i=0;i<n;i++)E(t,t.bl_tree[2*s[i]+1],3);M(t,t.dyn_ltree,e-1),M(t,t.dyn_dtree,r-1)})(t,t.l_desc.max_code+1,t.d_desc.max_code+1,a+1),_(t,t.dyn_ltree,t.dyn_dtree)),B(t),n&&Q(t)},_tr_tally:(t,e,r)=>(t.pending_buf[t.sym_buf+t.sym_next++]=e,t.pending_buf[t.sym_buf+t.sym_next++]=e>>8,t.pending_buf[t.sym_buf+t.sym_next++]=r,0===e?t.dyn_ltree[2*r]++:(t.matches++,e--,t.dyn_ltree[2*(f[r]+256+1)]++,t.dyn_dtree[2*b(e)]++),t.sym_next===t.sym_end),_tr_align:t=>{E(t,2,3),m(t,256,c),(t=>{16===t.bi_valid?(v(t,t.bi_buf),t.bi_buf=0,t.bi_valid=0):t.bi_valid>=8&&(t.pending_buf[t.pending++]=255&t.bi_buf,t.bi_buf>>=8,t.bi_valid-=8)})(t)}};var P=(t,e,r,n)=>{let i=65535&t|0,o=t>>>16&65535|0,a=0;for(;0!==r;){a=r>2e3?2e3:r,r-=a;do{i=i+e[n++]|0,o=o+i|0}while(--a);i%=65521,o%=65521}return i|o<<16|0};const j=new Uint32Array((()=>{let t,e=[];for(var r=0;r<256;r++){t=r;for(var n=0;n<8;n++)t=1&t?3988292384^t>>>1:t>>>1;e[r]=t}return e})());var L=(t,e,r,n)=>{const i=j,o=n+r;t^=-1;for(let r=n;r<o;r++)t=t>>>8^i[255&(t^e[r])];return-1^t},F={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"},T={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8};const{_tr_init:U,_tr_stored_block:G,_tr_flush_block:H,_tr_tally:Y,_tr_align:K}=N,{Z_NO_FLUSH:q,Z_PARTIAL_FLUSH:J,Z_FULL_FLUSH:z,Z_FINISH:Z,Z_BLOCK:V,Z_OK:W,Z_STREAM_END:X,Z_STREAM_ERROR:$,Z_DATA_ERROR:tt,Z_BUF_ERROR:et,Z_DEFAULT_COMPRESSION:rt,Z_FILTERED:nt,Z_HUFFMAN_ONLY:it,Z_RLE:ot,Z_FIXED:at,Z_DEFAULT_STRATEGY:st,Z_UNKNOWN:ct,Z_DEFLATED:At}=T,ut=(t,e)=>(t.msg=F[e],e),ft=t=>2*t-(t>4?9:0),ht=t=>{let e=t.length;for(;--e>=0;)t[e]=0},lt=t=>{let e,r,n,i=t.w_size;e=t.hash_size,n=e;do{r=t.head[--n],t.head[n]=r>=i?r-i:0}while(--e);e=i,n=e;do{r=t.prev[--n],t.prev[n]=r>=i?r-i:0}while(--e)};let dt=(t,e,r)=>(e<<t.hash_shift^r)&t.hash_mask;const gt=t=>{const e=t.state;let r=e.pending;r>t.avail_out&&(r=t.avail_out),0!==r&&(t.output.set(e.pending_buf.subarray(e.pending_out,e.pending_out+r),t.next_out),t.next_out+=r,e.pending_out+=r,t.total_out+=r,t.avail_out-=r,e.pending-=r,0===e.pending&&(e.pending_out=0))},pt=(t,e)=>{H(t,t.block_start>=0?t.block_start:-1,t.strstart-t.block_start,e),t.block_start=t.strstart,gt(t.strm)},yt=(t,e)=>{t.pending_buf[t.pending++]=e},It=(t,e)=>{t.pending_buf[t.pending++]=e>>>8&255,t.pending_buf[t.pending++]=255&e},bt=(t,e,r,n)=>{let i=t.avail_in;return i>n&&(i=n),0===i?0:(t.avail_in-=i,e.set(t.input.subarray(t.next_in,t.next_in+i),r),1===t.state.wrap?t.adler=P(t.adler,e,i,r):2===t.state.wrap&&(t.adler=L(t.adler,e,i,r)),t.next_in+=i,t.total_in+=i,i)},vt=(t,e)=>{let r,n,i=t.max_chain_length,o=t.strstart,a=t.prev_length,s=t.nice_match;const c=t.strstart>t.w_size-262?t.strstart-(t.w_size-262):0,A=t.window,u=t.w_mask,f=t.prev,h=t.strstart+258;let l=A[o+a-1],d=A[o+a];t.prev_length>=t.good_match&&(i>>=2),s>t.lookahead&&(s=t.lookahead);do{if(r=e,A[r+a]===d&&A[r+a-1]===l&&A[r]===A[o]&&A[++r]===A[o+1]){o+=2,r++;do{}while(A[++o]===A[++r]&&A[++o]===A[++r]&&A[++o]===A[++r]&&A[++o]===A[++r]&&A[++o]===A[++r]&&A[++o]===A[++r]&&A[++o]===A[++r]&&A[++o]===A[++r]&&o<h);if(n=258-(h-o),o=h-258,n>a){if(t.match_start=e,a=n,n>=s)break;l=A[o+a-1],d=A[o+a]}}}while((e=f[e&u])>c&&0!=--i);return a<=t.lookahead?a:t.lookahead},Et=t=>{const e=t.w_size;let r,n,i;do{if(n=t.window_size-t.lookahead-t.strstart,t.strstart>=e+(e-262)&&(t.window.set(t.window.subarray(e,e+e-n),0),t.match_start-=e,t.strstart-=e,t.block_start-=e,t.insert>t.strstart&&(t.insert=t.strstart),lt(t),n+=e),0===t.strm.avail_in)break;if(r=bt(t.strm,t.window,t.strstart+t.lookahead,n),t.lookahead+=r,t.lookahead+t.insert>=3)for(i=t.strstart-t.insert,t.ins_h=t.window[i],t.ins_h=dt(t,t.ins_h,t.window[i+1]);t.insert&&(t.ins_h=dt(t,t.ins_h,t.window[i+3-1]),t.prev[i&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=i,i++,t.insert--,!(t.lookahead+t.insert<3)););}while(t.lookahead<262&&0!==t.strm.avail_in)},mt=(t,e)=>{let r,n,i,o=t.pending_buf_size-5>t.w_size?t.w_size:t.pending_buf_size-5,a=0,s=t.strm.avail_in;do{if(r=65535,i=t.bi_valid+42>>3,t.strm.avail_out<i)break;if(i=t.strm.avail_out-i,n=t.strstart-t.block_start,r>n+t.strm.avail_in&&(r=n+t.strm.avail_in),r>i&&(r=i),r<o&&(0===r&&e!==Z||e===q||r!==n+t.strm.avail_in))break;a=e===Z&&r===n+t.strm.avail_in?1:0,G(t,0,0,a),t.pending_buf[t.pending-4]=r,t.pending_buf[t.pending-3]=r>>8,t.pending_buf[t.pending-2]=~r,t.pending_buf[t.pending-1]=~r>>8,gt(t.strm),n&&(n>r&&(n=r),t.strm.output.set(t.window.subarray(t.block_start,t.block_start+n),t.strm.next_out),t.strm.next_out+=n,t.strm.avail_out-=n,t.strm.total_out+=n,t.block_start+=n,r-=n),r&&(bt(t.strm,t.strm.output,t.strm.next_out,r),t.strm.next_out+=r,t.strm.avail_out-=r,t.strm.total_out+=r)}while(0===a);return s-=t.strm.avail_in,s&&(s>=t.w_size?(t.matches=2,t.window.set(t.strm.input.subarray(t.strm.next_in-t.w_size,t.strm.next_in),0),t.strstart=t.w_size,t.insert=t.strstart):(t.window_size-t.strstart<=s&&(t.strstart-=t.w_size,t.window.set(t.window.subarray(t.w_size,t.w_size+t.strstart),0),t.matches<2&&t.matches++,t.insert>t.strstart&&(t.insert=t.strstart)),t.window.set(t.strm.input.subarray(t.strm.next_in-s,t.strm.next_in),t.strstart),t.strstart+=s,t.insert+=s>t.w_size-t.insert?t.w_size-t.insert:s),t.block_start=t.strstart),t.high_water<t.strstart&&(t.high_water=t.strstart),a?4:e!==q&&e!==Z&&0===t.strm.avail_in&&t.strstart===t.block_start?2:(i=t.window_size-t.strstart,t.strm.avail_in>i&&t.block_start>=t.w_size&&(t.block_start-=t.w_size,t.strstart-=t.w_size,t.window.set(t.window.subarray(t.w_size,t.w_size+t.strstart),0),t.matches<2&&t.matches++,i+=t.w_size,t.insert>t.strstart&&(t.insert=t.strstart)),i>t.strm.avail_in&&(i=t.strm.avail_in),i&&(bt(t.strm,t.window,t.strstart,i),t.strstart+=i,t.insert+=i>t.w_size-t.insert?t.w_size-t.insert:i),t.high_water<t.strstart&&(t.high_water=t.strstart),i=t.bi_valid+42>>3,i=t.pending_buf_size-i>65535?65535:t.pending_buf_size-i,o=i>t.w_size?t.w_size:i,n=t.strstart-t.block_start,(n>=o||(n||e===Z)&&e!==q&&0===t.strm.avail_in&&n<=i)&&(r=n>i?i:n,a=e===Z&&0===t.strm.avail_in&&r===n?1:0,G(t,t.block_start,r,a),t.block_start+=r,gt(t.strm)),a?3:1)},Ct=(t,e)=>{let r,n;for(;;){if(t.lookahead<262){if(Et(t),t.lookahead<262&&e===q)return 1;if(0===t.lookahead)break}if(r=0,t.lookahead>=3&&(t.ins_h=dt(t,t.ins_h,t.window[t.strstart+3-1]),r=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),0!==r&&t.strstart-r<=t.w_size-262&&(t.match_length=vt(t,r)),t.match_length>=3)if(n=Y(t,t.strstart-t.match_start,t.match_length-3),t.lookahead-=t.match_length,t.match_length<=t.max_lazy_match&&t.lookahead>=3){t.match_length--;do{t.strstart++,t.ins_h=dt(t,t.ins_h,t.window[t.strstart+3-1]),r=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart}while(0!=--t.match_length);t.strstart++}else t.strstart+=t.match_length,t.match_length=0,t.ins_h=t.window[t.strstart],t.ins_h=dt(t,t.ins_h,t.window[t.strstart+1]);else n=Y(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++;if(n&&(pt(t,!1),0===t.strm.avail_out))return 1}return t.insert=t.strstart<2?t.strstart:2,e===Z?(pt(t,!0),0===t.strm.avail_out?3:4):t.sym_next&&(pt(t,!1),0===t.strm.avail_out)?1:2},wt=(t,e)=>{let r,n,i;for(;;){if(t.lookahead<262){if(Et(t),t.lookahead<262&&e===q)return 1;if(0===t.lookahead)break}if(r=0,t.lookahead>=3&&(t.ins_h=dt(t,t.ins_h,t.window[t.strstart+3-1]),r=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),t.prev_length=t.match_length,t.prev_match=t.match_start,t.match_length=2,0!==r&&t.prev_length<t.max_lazy_match&&t.strstart-r<=t.w_size-262&&(t.match_length=vt(t,r),t.match_length<=5&&(t.strategy===nt||3===t.match_length&&t.strstart-t.match_start>4096)&&(t.match_length=2)),t.prev_length>=3&&t.match_length<=t.prev_length){i=t.strstart+t.lookahead-3,n=Y(t,t.strstart-1-t.prev_match,t.prev_length-3),t.lookahead-=t.prev_length-1,t.prev_length-=2;do{++t.strstart<=i&&(t.ins_h=dt(t,t.ins_h,t.window[t.strstart+3-1]),r=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart)}while(0!=--t.prev_length);if(t.match_available=0,t.match_length=2,t.strstart++,n&&(pt(t,!1),0===t.strm.avail_out))return 1}else if(t.match_available){if(n=Y(t,0,t.window[t.strstart-1]),n&&pt(t,!1),t.strstart++,t.lookahead--,0===t.strm.avail_out)return 1}else t.match_available=1,t.strstart++,t.lookahead--}return t.match_available&&(n=Y(t,0,t.window[t.strstart-1]),t.match_available=0),t.insert=t.strstart<2?t.strstart:2,e===Z?(pt(t,!0),0===t.strm.avail_out?3:4):t.sym_next&&(pt(t,!1),0===t.strm.avail_out)?1:2};function Bt(t,e,r,n,i){this.good_length=t,this.max_lazy=e,this.nice_length=r,this.max_chain=n,this.func=i}const Qt=[new Bt(0,0,0,0,mt),new Bt(4,4,8,4,Ct),new Bt(4,5,16,8,Ct),new Bt(4,6,32,32,Ct),new Bt(4,4,16,16,wt),new Bt(8,16,32,32,wt),new Bt(8,16,128,128,wt),new Bt(8,32,128,256,wt),new Bt(32,128,258,1024,wt),new Bt(32,258,258,4096,wt)];function kt(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=At,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new Uint16Array(1146),this.dyn_dtree=new Uint16Array(122),this.bl_tree=new Uint16Array(78),ht(this.dyn_ltree),ht(this.dyn_dtree),ht(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Uint16Array(16),this.heap=new Uint16Array(573),ht(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Uint16Array(573),ht(this.depth),this.sym_buf=0,this.lit_bufsize=0,this.sym_next=0,this.sym_end=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}const St=t=>{if(!t)return 1;const e=t.state;return!e||e.strm!==t||42!==e.status&&57!==e.status&&69!==e.status&&73!==e.status&&91!==e.status&&103!==e.status&&113!==e.status&&666!==e.status?1:0},_t=t=>{if(St(t))return ut(t,$);t.total_in=t.total_out=0,t.data_type=ct;const e=t.state;return e.pending=0,e.pending_out=0,e.wrap<0&&(e.wrap=-e.wrap),e.status=2===e.wrap?57:e.wrap?42:113,t.adler=2===e.wrap?0:1,e.last_flush=-2,U(e),W},Dt=t=>{const e=_t(t);var r;return e===W&&((r=t.state).window_size=2*r.w_size,ht(r.head),r.max_lazy_match=Qt[r.level].max_lazy,r.good_match=Qt[r.level].good_length,r.nice_match=Qt[r.level].nice_length,r.max_chain_length=Qt[r.level].max_chain,r.strstart=0,r.block_start=0,r.lookahead=0,r.insert=0,r.match_length=r.prev_length=2,r.match_available=0,r.ins_h=0),e},xt=(t,e,r,n,i,o)=>{if(!t)return $;let a=1;if(e===rt&&(e=6),n<0?(a=0,n=-n):n>15&&(a=2,n-=16),i<1||i>9||r!==At||n<8||n>15||e<0||e>9||o<0||o>at||8===n&&1!==a)return ut(t,$);8===n&&(n=9);const s=new kt;return t.state=s,s.strm=t,s.status=42,s.wrap=a,s.gzhead=null,s.w_bits=n,s.w_size=1<<s.w_bits,s.w_mask=s.w_size-1,s.hash_bits=i+7,s.hash_size=1<<s.hash_bits,s.hash_mask=s.hash_size-1,s.hash_shift=~~((s.hash_bits+3-1)/3),s.window=new Uint8Array(2*s.w_size),s.head=new Uint16Array(s.hash_size),s.prev=new Uint16Array(s.w_size),s.lit_bufsize=1<<i+6,s.pending_buf_size=4*s.lit_bufsize,s.pending_buf=new Uint8Array(s.pending_buf_size),s.sym_buf=s.lit_bufsize,s.sym_end=3*(s.lit_bufsize-1),s.level=e,s.strategy=o,s.method=r,Dt(t)};var Mt={deflateInit:(t,e)=>xt(t,e,At,15,8,st),deflateInit2:xt,deflateReset:Dt,deflateResetKeep:_t,deflateSetHeader:(t,e)=>St(t)||2!==t.state.wrap?$:(t.state.gzhead=e,W),deflate:(t,e)=>{if(St(t)||e>V||e<0)return t?ut(t,$):$;const r=t.state;if(!t.output||0!==t.avail_in&&!t.input||666===r.status&&e!==Z)return ut(t,0===t.avail_out?et:$);const n=r.last_flush;if(r.last_flush=e,0!==r.pending){if(gt(t),0===t.avail_out)return r.last_flush=-1,W}else if(0===t.avail_in&&ft(e)<=ft(n)&&e!==Z)return ut(t,et);if(666===r.status&&0!==t.avail_in)return ut(t,et);if(42===r.status&&0===r.wrap&&(r.status=113),42===r.status){let e=At+(r.w_bits-8<<4)<<8,n=-1;if(n=r.strategy>=it||r.level<2?0:r.level<6?1:6===r.level?2:3,e|=n<<6,0!==r.strstart&&(e|=32),e+=31-e%31,It(r,e),0!==r.strstart&&(It(r,t.adler>>>16),It(r,65535&t.adler)),t.adler=1,r.status=113,gt(t),0!==r.pending)return r.last_flush=-1,W}if(57===r.status)if(t.adler=0,yt(r,31),yt(r,139),yt(r,8),r.gzhead)yt(r,(r.gzhead.text?1:0)+(r.gzhead.hcrc?2:0)+(r.gzhead.extra?4:0)+(r.gzhead.name?8:0)+(r.gzhead.comment?16:0)),yt(r,255&r.gzhead.time),yt(r,r.gzhead.time>>8&255),yt(r,r.gzhead.time>>16&255),yt(r,r.gzhead.time>>24&255),yt(r,9===r.level?2:r.strategy>=it||r.level<2?4:0),yt(r,255&r.gzhead.os),r.gzhead.extra&&r.gzhead.extra.length&&(yt(r,255&r.gzhead.extra.length),yt(r,r.gzhead.extra.length>>8&255)),r.gzhead.hcrc&&(t.adler=L(t.adler,r.pending_buf,r.pending,0)),r.gzindex=0,r.status=69;else if(yt(r,0),yt(r,0),yt(r,0),yt(r,0),yt(r,0),yt(r,9===r.level?2:r.strategy>=it||r.level<2?4:0),yt(r,3),r.status=113,gt(t),0!==r.pending)return r.last_flush=-1,W;if(69===r.status){if(r.gzhead.extra){let e=r.pending,n=(65535&r.gzhead.extra.length)-r.gzindex;for(;r.pending+n>r.pending_buf_size;){let i=r.pending_buf_size-r.pending;if(r.pending_buf.set(r.gzhead.extra.subarray(r.gzindex,r.gzindex+i),r.pending),r.pending=r.pending_buf_size,r.gzhead.hcrc&&r.pending>e&&(t.adler=L(t.adler,r.pending_buf,r.pending-e,e)),r.gzindex+=i,gt(t),0!==r.pending)return r.last_flush=-1,W;e=0,n-=i}let i=new Uint8Array(r.gzhead.extra);r.pending_buf.set(i.subarray(r.gzindex,r.gzindex+n),r.pending),r.pending+=n,r.gzhead.hcrc&&r.pending>e&&(t.adler=L(t.adler,r.pending_buf,r.pending-e,e)),r.gzindex=0}r.status=73}if(73===r.status){if(r.gzhead.name){let e,n=r.pending;do{if(r.pending===r.pending_buf_size){if(r.gzhead.hcrc&&r.pending>n&&(t.adler=L(t.adler,r.pending_buf,r.pending-n,n)),gt(t),0!==r.pending)return r.last_flush=-1,W;n=0}e=r.gzindex<r.gzhead.name.length?255&r.gzhead.name.charCodeAt(r.gzindex++):0,yt(r,e)}while(0!==e);r.gzhead.hcrc&&r.pending>n&&(t.adler=L(t.adler,r.pending_buf,r.pending-n,n)),r.gzindex=0}r.status=91}if(91===r.status){if(r.gzhead.comment){let e,n=r.pending;do{if(r.pending===r.pending_buf_size){if(r.gzhead.hcrc&&r.pending>n&&(t.adler=L(t.adler,r.pending_buf,r.pending-n,n)),gt(t),0!==r.pending)return r.last_flush=-1,W;n=0}e=r.gzindex<r.gzhead.comment.length?255&r.gzhead.comment.charCodeAt(r.gzindex++):0,yt(r,e)}while(0!==e);r.gzhead.hcrc&&r.pending>n&&(t.adler=L(t.adler,r.pending_buf,r.pending-n,n))}r.status=103}if(103===r.status){if(r.gzhead.hcrc){if(r.pending+2>r.pending_buf_size&&(gt(t),0!==r.pending))return r.last_flush=-1,W;yt(r,255&t.adler),yt(r,t.adler>>8&255),t.adler=0}if(r.status=113,gt(t),0!==r.pending)return r.last_flush=-1,W}if(0!==t.avail_in||0!==r.lookahead||e!==q&&666!==r.status){let n=0===r.level?mt(r,e):r.strategy===it?((t,e)=>{let r;for(;;){if(0===t.lookahead&&(Et(t),0===t.lookahead)){if(e===q)return 1;break}if(t.match_length=0,r=Y(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++,r&&(pt(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,e===Z?(pt(t,!0),0===t.strm.avail_out?3:4):t.sym_next&&(pt(t,!1),0===t.strm.avail_out)?1:2})(r,e):r.strategy===ot?((t,e)=>{let r,n,i,o;const a=t.window;for(;;){if(t.lookahead<=258){if(Et(t),t.lookahead<=258&&e===q)return 1;if(0===t.lookahead)break}if(t.match_length=0,t.lookahead>=3&&t.strstart>0&&(i=t.strstart-1,n=a[i],n===a[++i]&&n===a[++i]&&n===a[++i])){o=t.strstart+258;do{}while(n===a[++i]&&n===a[++i]&&n===a[++i]&&n===a[++i]&&n===a[++i]&&n===a[++i]&&n===a[++i]&&n===a[++i]&&i<o);t.match_length=258-(o-i),t.match_length>t.lookahead&&(t.match_length=t.lookahead)}if(t.match_length>=3?(r=Y(t,1,t.match_length-3),t.lookahead-=t.match_length,t.strstart+=t.match_length,t.match_length=0):(r=Y(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++),r&&(pt(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,e===Z?(pt(t,!0),0===t.strm.avail_out?3:4):t.sym_next&&(pt(t,!1),0===t.strm.avail_out)?1:2})(r,e):Qt[r.level].func(r,e);if(3!==n&&4!==n||(r.status=666),1===n||3===n)return 0===t.avail_out&&(r.last_flush=-1),W;if(2===n&&(e===J?K(r):e!==V&&(G(r,0,0,!1),e===z&&(ht(r.head),0===r.lookahead&&(r.strstart=0,r.block_start=0,r.insert=0))),gt(t),0===t.avail_out))return r.last_flush=-1,W}return e!==Z?W:r.wrap<=0?X:(2===r.wrap?(yt(r,255&t.adler),yt(r,t.adler>>8&255),yt(r,t.adler>>16&255),yt(r,t.adler>>24&255),yt(r,255&t.total_in),yt(r,t.total_in>>8&255),yt(r,t.total_in>>16&255),yt(r,t.total_in>>24&255)):(It(r,t.adler>>>16),It(r,65535&t.adler)),gt(t),r.wrap>0&&(r.wrap=-r.wrap),0!==r.pending?W:X)},deflateEnd:t=>{if(St(t))return $;const e=t.state.status;return t.state=null,113===e?ut(t,tt):W},deflateSetDictionary:(t,e)=>{let r=e.length;if(St(t))return $;const n=t.state,i=n.wrap;if(2===i||1===i&&42!==n.status||n.lookahead)return $;if(1===i&&(t.adler=P(t.adler,e,r,0)),n.wrap=0,r>=n.w_size){0===i&&(ht(n.head),n.strstart=0,n.block_start=0,n.insert=0);let t=new Uint8Array(n.w_size);t.set(e.subarray(r-n.w_size,r),0),e=t,r=n.w_size}const o=t.avail_in,a=t.next_in,s=t.input;for(t.avail_in=r,t.next_in=0,t.input=e,Et(n);n.lookahead>=3;){let t=n.strstart,e=n.lookahead-2;do{n.ins_h=dt(n,n.ins_h,n.window[t+3-1]),n.prev[t&n.w_mask]=n.head[n.ins_h],n.head[n.ins_h]=t,t++}while(--e);n.strstart=t,n.lookahead=2,Et(n)}return n.strstart+=n.lookahead,n.block_start=n.strstart,n.insert=n.lookahead,n.lookahead=0,n.match_length=n.prev_length=2,n.match_available=0,t.next_in=a,t.input=s,t.avail_in=o,n.wrap=i,W},deflateInfo:"pako deflate (from Nodeca project)"};const Rt=(t,e)=>Object.prototype.hasOwnProperty.call(t,e);var Ot=function(t){const e=Array.prototype.slice.call(arguments,1);for(;e.length;){const r=e.shift();if(r){if("object"!=typeof r)throw new TypeError(r+"must be non-object");for(const e in r)Rt(r,e)&&(t[e]=r[e])}}return t},Nt=t=>{let e=0;for(let r=0,n=t.length;r<n;r++)e+=t[r].length;const r=new Uint8Array(e);for(let e=0,n=0,i=t.length;e<i;e++){let i=t[e];r.set(i,n),n+=i.length}return r};let Pt=!0;try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(t){Pt=!1}const jt=new Uint8Array(256);for(let t=0;t<256;t++)jt[t]=t>=252?6:t>=248?5:t>=240?4:t>=224?3:t>=192?2:1;jt[254]=jt[254]=1;var Lt=t=>{if("function"==typeof TextEncoder&&TextEncoder.prototype.encode)return(new TextEncoder).encode(t);let e,r,n,i,o,a=t.length,s=0;for(i=0;i<a;i++)r=t.charCodeAt(i),55296==(64512&r)&&i+1<a&&(n=t.charCodeAt(i+1),56320==(64512&n)&&(r=65536+(r-55296<<10)+(n-56320),i++)),s+=r<128?1:r<2048?2:r<65536?3:4;for(e=new Uint8Array(s),o=0,i=0;o<s;i++)r=t.charCodeAt(i),55296==(64512&r)&&i+1<a&&(n=t.charCodeAt(i+1),56320==(64512&n)&&(r=65536+(r-55296<<10)+(n-56320),i++)),r<128?e[o++]=r:r<2048?(e[o++]=192|r>>>6,e[o++]=128|63&r):r<65536?(e[o++]=224|r>>>12,e[o++]=128|r>>>6&63,e[o++]=128|63&r):(e[o++]=240|r>>>18,e[o++]=128|r>>>12&63,e[o++]=128|r>>>6&63,e[o++]=128|63&r);return e},Ft=(t,e)=>{const r=e||t.length;if("function"==typeof TextDecoder&&TextDecoder.prototype.decode)return(new TextDecoder).decode(t.subarray(0,e));let n,i;const o=new Array(2*r);for(i=0,n=0;n<r;){let e=t[n++];if(e<128){o[i++]=e;continue}let a=jt[e];if(a>4)o[i++]=65533,n+=a-1;else{for(e&=2===a?31:3===a?15:7;a>1&&n<r;)e=e<<6|63&t[n++],a--;a>1?o[i++]=65533:e<65536?o[i++]=e:(e-=65536,o[i++]=55296|e>>10&1023,o[i++]=56320|1023&e)}}return((t,e)=>{if(e<65534&&t.subarray&&Pt)return String.fromCharCode.apply(null,t.length===e?t:t.subarray(0,e));let r="";for(let n=0;n<e;n++)r+=String.fromCharCode(t[n]);return r})(o,i)},Tt=(t,e)=>{(e=e||t.length)>t.length&&(e=t.length);let r=e-1;for(;r>=0&&128==(192&t[r]);)r--;return r<0||0===r?e:r+jt[t[r]]>e?r:e};var Ut=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0};const Gt=Object.prototype.toString,{Z_NO_FLUSH:Ht,Z_SYNC_FLUSH:Yt,Z_FULL_FLUSH:Kt,Z_FINISH:qt,Z_OK:Jt,Z_STREAM_END:zt,Z_DEFAULT_COMPRESSION:Zt,Z_DEFAULT_STRATEGY:Vt,Z_DEFLATED:Wt}=T;function Xt(t){this.options=Ot({level:Zt,method:Wt,chunkSize:16384,windowBits:15,memLevel:8,strategy:Vt},t||{});let e=this.options;e.raw&&e.windowBits>0?e.windowBits=-e.windowBits:e.gzip&&e.windowBits>0&&e.windowBits<16&&(e.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new Ut,this.strm.avail_out=0;let r=Mt.deflateInit2(this.strm,e.level,e.method,e.windowBits,e.memLevel,e.strategy);if(r!==Jt)throw new Error(F[r]);if(e.header&&Mt.deflateSetHeader(this.strm,e.header),e.dictionary){let t;if(t="string"==typeof e.dictionary?Lt(e.dictionary):"[object ArrayBuffer]"===Gt.call(e.dictionary)?new Uint8Array(e.dictionary):e.dictionary,r=Mt.deflateSetDictionary(this.strm,t),r!==Jt)throw new Error(F[r]);this._dict_set=!0}}function $t(t,e){const r=new Xt(e);if(r.push(t,!0),r.err)throw r.msg||F[r.err];return r.result}Xt.prototype.push=function(t,e){const r=this.strm,n=this.options.chunkSize;let i,o;if(this.ended)return!1;for(o=e===~~e?e:!0===e?qt:Ht,"string"==typeof t?r.input=Lt(t):"[object ArrayBuffer]"===Gt.call(t)?r.input=new Uint8Array(t):r.input=t,r.next_in=0,r.avail_in=r.input.length;;)if(0===r.avail_out&&(r.output=new Uint8Array(n),r.next_out=0,r.avail_out=n),(o===Yt||o===Kt)&&r.avail_out<=6)this.onData(r.output.subarray(0,r.next_out)),r.avail_out=0;else{if(i=Mt.deflate(r,o),i===zt)return r.next_out>0&&this.onData(r.output.subarray(0,r.next_out)),i=Mt.deflateEnd(this.strm),this.onEnd(i),this.ended=!0,i===Jt;if(0!==r.avail_out){if(o>0&&r.next_out>0)this.onData(r.output.subarray(0,r.next_out)),r.avail_out=0;else if(0===r.avail_in)break}else this.onData(r.output)}return!0},Xt.prototype.onData=function(t){this.chunks.push(t)},Xt.prototype.onEnd=function(t){t===Jt&&(this.result=Nt(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg};var te={Deflate:Xt,deflate:$t,deflateRaw:function(t,e){return(e=e||{}).raw=!0,$t(t,e)},gzip:function(t,e){return(e=e||{}).gzip=!0,$t(t,e)},constants:T};var ee=function(t,e){let r,n,i,o,a,s,c,A,u,f,h,l,d,g,p,y,I,b,v,E,m,C,w,B;const Q=t.state;r=t.next_in,w=t.input,n=r+(t.avail_in-5),i=t.next_out,B=t.output,o=i-(e-t.avail_out),a=i+(t.avail_out-257),s=Q.dmax,c=Q.wsize,A=Q.whave,u=Q.wnext,f=Q.window,h=Q.hold,l=Q.bits,d=Q.lencode,g=Q.distcode,p=(1<<Q.lenbits)-1,y=(1<<Q.distbits)-1;t:do{l<15&&(h+=w[r++]<<l,l+=8,h+=w[r++]<<l,l+=8),I=d[h&p];e:for(;;){if(b=I>>>24,h>>>=b,l-=b,b=I>>>16&255,0===b)B[i++]=65535&I;else{if(!(16&b)){if(0==(64&b)){I=d[(65535&I)+(h&(1<<b)-1)];continue e}if(32&b){Q.mode=16191;break t}t.msg="invalid literal/length code",Q.mode=16209;break t}v=65535&I,b&=15,b&&(l<b&&(h+=w[r++]<<l,l+=8),v+=h&(1<<b)-1,h>>>=b,l-=b),l<15&&(h+=w[r++]<<l,l+=8,h+=w[r++]<<l,l+=8),I=g[h&y];r:for(;;){if(b=I>>>24,h>>>=b,l-=b,b=I>>>16&255,!(16&b)){if(0==(64&b)){I=g[(65535&I)+(h&(1<<b)-1)];continue r}t.msg="invalid distance code",Q.mode=16209;break t}if(E=65535&I,b&=15,l<b&&(h+=w[r++]<<l,l+=8,l<b&&(h+=w[r++]<<l,l+=8)),E+=h&(1<<b)-1,E>s){t.msg="invalid distance too far back",Q.mode=16209;break t}if(h>>>=b,l-=b,b=i-o,E>b){if(b=E-b,b>A&&Q.sane){t.msg="invalid distance too far back",Q.mode=16209;break t}if(m=0,C=f,0===u){if(m+=c-b,b<v){v-=b;do{B[i++]=f[m++]}while(--b);m=i-E,C=B}}else if(u<b){if(m+=c+u-b,b-=u,b<v){v-=b;do{B[i++]=f[m++]}while(--b);if(m=0,u<v){b=u,v-=b;do{B[i++]=f[m++]}while(--b);m=i-E,C=B}}}else if(m+=u-b,b<v){v-=b;do{B[i++]=f[m++]}while(--b);m=i-E,C=B}for(;v>2;)B[i++]=C[m++],B[i++]=C[m++],B[i++]=C[m++],v-=3;v&&(B[i++]=C[m++],v>1&&(B[i++]=C[m++]))}else{m=i-E;do{B[i++]=B[m++],B[i++]=B[m++],B[i++]=B[m++],v-=3}while(v>2);v&&(B[i++]=B[m++],v>1&&(B[i++]=B[m++]))}break}}break}}while(r<n&&i<a);v=l>>3,r-=v,l-=v<<3,h&=(1<<l)-1,t.next_in=r,t.next_out=i,t.avail_in=r<n?n-r+5:5-(r-n),t.avail_out=i<a?a-i+257:257-(i-a),Q.hold=h,Q.bits=l};const re=new Uint16Array([3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0]),ne=new Uint8Array([16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78]),ie=new Uint16Array([1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0]),oe=new Uint8Array([16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64]);var ae=(t,e,r,n,i,o,a,s)=>{const c=s.bits;let A,u,f,h,l,d,g=0,p=0,y=0,I=0,b=0,v=0,E=0,m=0,C=0,w=0,B=null;const Q=new Uint16Array(16),k=new Uint16Array(16);let S,_,D,x=null;for(g=0;g<=15;g++)Q[g]=0;for(p=0;p<n;p++)Q[e[r+p]]++;for(b=c,I=15;I>=1&&0===Q[I];I--);if(b>I&&(b=I),0===I)return i[o++]=20971520,i[o++]=20971520,s.bits=1,0;for(y=1;y<I&&0===Q[y];y++);for(b<y&&(b=y),m=1,g=1;g<=15;g++)if(m<<=1,m-=Q[g],m<0)return-1;if(m>0&&(0===t||1!==I))return-1;for(k[1]=0,g=1;g<15;g++)k[g+1]=k[g]+Q[g];for(p=0;p<n;p++)0!==e[r+p]&&(a[k[e[r+p]]++]=p);if(0===t?(B=x=a,d=20):1===t?(B=re,x=ne,d=257):(B=ie,x=oe,d=0),w=0,p=0,g=y,l=o,v=b,E=0,f=-1,C=1<<b,h=C-1,1===t&&C>852||2===t&&C>592)return 1;for(;;){S=g-E,a[p]+1<d?(_=0,D=a[p]):a[p]>=d?(_=x[a[p]-d],D=B[a[p]-d]):(_=96,D=0),A=1<<g-E,u=1<<v,y=u;do{u-=A,i[l+(w>>E)+u]=S<<24|_<<16|D|0}while(0!==u);for(A=1<<g-1;w&A;)A>>=1;if(0!==A?(w&=A-1,w+=A):w=0,p++,0==--Q[g]){if(g===I)break;g=e[r+a[p]]}if(g>b&&(w&h)!==f){for(0===E&&(E=b),l+=y,v=g-E,m=1<<v;v+E<I&&(m-=Q[v+E],!(m<=0));)v++,m<<=1;if(C+=1<<v,1===t&&C>852||2===t&&C>592)return 1;f=w&h,i[f]=b<<24|v<<16|l-o|0}}return 0!==w&&(i[l+w]=g-E<<24|64<<16|0),s.bits=b,0};const{Z_FINISH:se,Z_BLOCK:ce,Z_TREES:Ae,Z_OK:ue,Z_STREAM_END:fe,Z_NEED_DICT:he,Z_STREAM_ERROR:le,Z_DATA_ERROR:de,Z_MEM_ERROR:ge,Z_BUF_ERROR:pe,Z_DEFLATED:ye}=T,Ie=16209,be=t=>(t>>>24&255)+(t>>>8&65280)+((65280&t)<<8)+((255&t)<<24);function ve(){this.strm=null,this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new Uint16Array(320),this.work=new Uint16Array(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}const Ee=t=>{if(!t)return 1;const e=t.state;return!e||e.strm!==t||e.mode<16180||e.mode>16211?1:0},me=t=>{if(Ee(t))return le;const e=t.state;return t.total_in=t.total_out=e.total=0,t.msg="",e.wrap&&(t.adler=1&e.wrap),e.mode=16180,e.last=0,e.havedict=0,e.flags=-1,e.dmax=32768,e.head=null,e.hold=0,e.bits=0,e.lencode=e.lendyn=new Int32Array(852),e.distcode=e.distdyn=new Int32Array(592),e.sane=1,e.back=-1,ue},Ce=t=>{if(Ee(t))return le;const e=t.state;return e.wsize=0,e.whave=0,e.wnext=0,me(t)},we=(t,e)=>{let r;if(Ee(t))return le;const n=t.state;return e<0?(r=0,e=-e):(r=5+(e>>4),e<48&&(e&=15)),e&&(e<8||e>15)?le:(null!==n.window&&n.wbits!==e&&(n.window=null),n.wrap=r,n.wbits=e,Ce(t))},Be=(t,e)=>{if(!t)return le;const r=new ve;t.state=r,r.strm=t,r.window=null,r.mode=16180;const n=we(t,e);return n!==ue&&(t.state=null),n};let Qe,ke,Se=!0;const _e=t=>{if(Se){Qe=new Int32Array(512),ke=new Int32Array(32);let e=0;for(;e<144;)t.lens[e++]=8;for(;e<256;)t.lens[e++]=9;for(;e<280;)t.lens[e++]=7;for(;e<288;)t.lens[e++]=8;for(ae(1,t.lens,0,288,Qe,0,t.work,{bits:9}),e=0;e<32;)t.lens[e++]=5;ae(2,t.lens,0,32,ke,0,t.work,{bits:5}),Se=!1}t.lencode=Qe,t.lenbits=9,t.distcode=ke,t.distbits=5},De=(t,e,r,n)=>{let i;const o=t.state;return null===o.window&&(o.wsize=1<<o.wbits,o.wnext=0,o.whave=0,o.window=new Uint8Array(o.wsize)),n>=o.wsize?(o.window.set(e.subarray(r-o.wsize,r),0),o.wnext=0,o.whave=o.wsize):(i=o.wsize-o.wnext,i>n&&(i=n),o.window.set(e.subarray(r-n,r-n+i),o.wnext),(n-=i)?(o.window.set(e.subarray(r-n,r),0),o.wnext=n,o.whave=o.wsize):(o.wnext+=i,o.wnext===o.wsize&&(o.wnext=0),o.whave<o.wsize&&(o.whave+=i))),0};var xe={inflateReset:Ce,inflateReset2:we,inflateResetKeep:me,inflateInit:t=>Be(t,15),inflateInit2:Be,inflate:(t,e)=>{let r,n,i,o,a,s,c,A,u,f,h,l,d,g,p,y,I,b,v,E,m,C,w=0;const B=new Uint8Array(4);let Q,k;const S=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);if(Ee(t)||!t.output||!t.input&&0!==t.avail_in)return le;r=t.state,16191===r.mode&&(r.mode=16192),a=t.next_out,i=t.output,c=t.avail_out,o=t.next_in,n=t.input,s=t.avail_in,A=r.hold,u=r.bits,f=s,h=c,C=ue;t:for(;;)switch(r.mode){case 16180:if(0===r.wrap){r.mode=16192;break}for(;u<16;){if(0===s)break t;s--,A+=n[o++]<<u,u+=8}if(2&r.wrap&&35615===A){0===r.wbits&&(r.wbits=15),r.check=0,B[0]=255&A,B[1]=A>>>8&255,r.check=L(r.check,B,2,0),A=0,u=0,r.mode=16181;break}if(r.head&&(r.head.done=!1),!(1&r.wrap)||(((255&A)<<8)+(A>>8))%31){t.msg="incorrect header check",r.mode=Ie;break}if((15&A)!==ye){t.msg="unknown compression method",r.mode=Ie;break}if(A>>>=4,u-=4,m=8+(15&A),0===r.wbits&&(r.wbits=m),m>15||m>r.wbits){t.msg="invalid window size",r.mode=Ie;break}r.dmax=1<<r.wbits,r.flags=0,t.adler=r.check=1,r.mode=512&A?16189:16191,A=0,u=0;break;case 16181:for(;u<16;){if(0===s)break t;s--,A+=n[o++]<<u,u+=8}if(r.flags=A,(255&r.flags)!==ye){t.msg="unknown compression method",r.mode=Ie;break}if(57344&r.flags){t.msg="unknown header flags set",r.mode=Ie;break}r.head&&(r.head.text=A>>8&1),512&r.flags&&4&r.wrap&&(B[0]=255&A,B[1]=A>>>8&255,r.check=L(r.check,B,2,0)),A=0,u=0,r.mode=16182;case 16182:for(;u<32;){if(0===s)break t;s--,A+=n[o++]<<u,u+=8}r.head&&(r.head.time=A),512&r.flags&&4&r.wrap&&(B[0]=255&A,B[1]=A>>>8&255,B[2]=A>>>16&255,B[3]=A>>>24&255,r.check=L(r.check,B,4,0)),A=0,u=0,r.mode=16183;case 16183:for(;u<16;){if(0===s)break t;s--,A+=n[o++]<<u,u+=8}r.head&&(r.head.xflags=255&A,r.head.os=A>>8),512&r.flags&&4&r.wrap&&(B[0]=255&A,B[1]=A>>>8&255,r.check=L(r.check,B,2,0)),A=0,u=0,r.mode=16184;case 16184:if(1024&r.flags){for(;u<16;){if(0===s)break t;s--,A+=n[o++]<<u,u+=8}r.length=A,r.head&&(r.head.extra_len=A),512&r.flags&&4&r.wrap&&(B[0]=255&A,B[1]=A>>>8&255,r.check=L(r.check,B,2,0)),A=0,u=0}else r.head&&(r.head.extra=null);r.mode=16185;case 16185:if(1024&r.flags&&(l=r.length,l>s&&(l=s),l&&(r.head&&(m=r.head.extra_len-r.length,r.head.extra||(r.head.extra=new Uint8Array(r.head.extra_len)),r.head.extra.set(n.subarray(o,o+l),m)),512&r.flags&&4&r.wrap&&(r.check=L(r.check,n,l,o)),s-=l,o+=l,r.length-=l),r.length))break t;r.length=0,r.mode=16186;case 16186:if(2048&r.flags){if(0===s)break t;l=0;do{m=n[o+l++],r.head&&m&&r.length<65536&&(r.head.name+=String.fromCharCode(m))}while(m&&l<s);if(512&r.flags&&4&r.wrap&&(r.check=L(r.check,n,l,o)),s-=l,o+=l,m)break t}else r.head&&(r.head.name=null);r.length=0,r.mode=16187;case 16187:if(4096&r.flags){if(0===s)break t;l=0;do{m=n[o+l++],r.head&&m&&r.length<65536&&(r.head.comment+=String.fromCharCode(m))}while(m&&l<s);if(512&r.flags&&4&r.wrap&&(r.check=L(r.check,n,l,o)),s-=l,o+=l,m)break t}else r.head&&(r.head.comment=null);r.mode=16188;case 16188:if(512&r.flags){for(;u<16;){if(0===s)break t;s--,A+=n[o++]<<u,u+=8}if(4&r.wrap&&A!==(65535&r.check)){t.msg="header crc mismatch",r.mode=Ie;break}A=0,u=0}r.head&&(r.head.hcrc=r.flags>>9&1,r.head.done=!0),t.adler=r.check=0,r.mode=16191;break;case 16189:for(;u<32;){if(0===s)break t;s--,A+=n[o++]<<u,u+=8}t.adler=r.check=be(A),A=0,u=0,r.mode=16190;case 16190:if(0===r.havedict)return t.next_out=a,t.avail_out=c,t.next_in=o,t.avail_in=s,r.hold=A,r.bits=u,he;t.adler=r.check=1,r.mode=16191;case 16191:if(e===ce||e===Ae)break t;case 16192:if(r.last){A>>>=7&u,u-=7&u,r.mode=16206;break}for(;u<3;){if(0===s)break t;s--,A+=n[o++]<<u,u+=8}switch(r.last=1&A,A>>>=1,u-=1,3&A){case 0:r.mode=16193;break;case 1:if(_e(r),r.mode=16199,e===Ae){A>>>=2,u-=2;break t}break;case 2:r.mode=16196;break;case 3:t.msg="invalid block type",r.mode=Ie}A>>>=2,u-=2;break;case 16193:for(A>>>=7&u,u-=7&u;u<32;){if(0===s)break t;s--,A+=n[o++]<<u,u+=8}if((65535&A)!=(A>>>16^65535)){t.msg="invalid stored block lengths",r.mode=Ie;break}if(r.length=65535&A,A=0,u=0,r.mode=16194,e===Ae)break t;case 16194:r.mode=16195;case 16195:if(l=r.length,l){if(l>s&&(l=s),l>c&&(l=c),0===l)break t;i.set(n.subarray(o,o+l),a),s-=l,o+=l,c-=l,a+=l,r.length-=l;break}r.mode=16191;break;case 16196:for(;u<14;){if(0===s)break t;s--,A+=n[o++]<<u,u+=8}if(r.nlen=257+(31&A),A>>>=5,u-=5,r.ndist=1+(31&A),A>>>=5,u-=5,r.ncode=4+(15&A),A>>>=4,u-=4,r.nlen>286||r.ndist>30){t.msg="too many length or distance symbols",r.mode=Ie;break}r.have=0,r.mode=16197;case 16197:for(;r.have<r.ncode;){for(;u<3;){if(0===s)break t;s--,A+=n[o++]<<u,u+=8}r.lens[S[r.have++]]=7&A,A>>>=3,u-=3}for(;r.have<19;)r.lens[S[r.have++]]=0;if(r.lencode=r.lendyn,r.lenbits=7,Q={bits:r.lenbits},C=ae(0,r.lens,0,19,r.lencode,0,r.work,Q),r.lenbits=Q.bits,C){t.msg="invalid code lengths set",r.mode=Ie;break}r.have=0,r.mode=16198;case 16198:for(;r.have<r.nlen+r.ndist;){for(;w=r.lencode[A&(1<<r.lenbits)-1],p=w>>>24,y=w>>>16&255,I=65535&w,!(p<=u);){if(0===s)break t;s--,A+=n[o++]<<u,u+=8}if(I<16)A>>>=p,u-=p,r.lens[r.have++]=I;else{if(16===I){for(k=p+2;u<k;){if(0===s)break t;s--,A+=n[o++]<<u,u+=8}if(A>>>=p,u-=p,0===r.have){t.msg="invalid bit length repeat",r.mode=Ie;break}m=r.lens[r.have-1],l=3+(3&A),A>>>=2,u-=2}else if(17===I){for(k=p+3;u<k;){if(0===s)break t;s--,A+=n[o++]<<u,u+=8}A>>>=p,u-=p,m=0,l=3+(7&A),A>>>=3,u-=3}else{for(k=p+7;u<k;){if(0===s)break t;s--,A+=n[o++]<<u,u+=8}A>>>=p,u-=p,m=0,l=11+(127&A),A>>>=7,u-=7}if(r.have+l>r.nlen+r.ndist){t.msg="invalid bit length repeat",r.mode=Ie;break}for(;l--;)r.lens[r.have++]=m}}if(r.mode===Ie)break;if(0===r.lens[256]){t.msg="invalid code -- missing end-of-block",r.mode=Ie;break}if(r.lenbits=9,Q={bits:r.lenbits},C=ae(1,r.lens,0,r.nlen,r.lencode,0,r.work,Q),r.lenbits=Q.bits,C){t.msg="invalid literal/lengths set",r.mode=Ie;break}if(r.distbits=6,r.distcode=r.distdyn,Q={bits:r.distbits},C=ae(2,r.lens,r.nlen,r.ndist,r.distcode,0,r.work,Q),r.distbits=Q.bits,C){t.msg="invalid distances set",r.mode=Ie;break}if(r.mode=16199,e===Ae)break t;case 16199:r.mode=16200;case 16200:if(s>=6&&c>=258){t.next_out=a,t.avail_out=c,t.next_in=o,t.avail_in=s,r.hold=A,r.bits=u,ee(t,h),a=t.next_out,i=t.output,c=t.avail_out,o=t.next_in,n=t.input,s=t.avail_in,A=r.hold,u=r.bits,16191===r.mode&&(r.back=-1);break}for(r.back=0;w=r.lencode[A&(1<<r.lenbits)-1],p=w>>>24,y=w>>>16&255,I=65535&w,!(p<=u);){if(0===s)break t;s--,A+=n[o++]<<u,u+=8}if(y&&0==(240&y)){for(b=p,v=y,E=I;w=r.lencode[E+((A&(1<<b+v)-1)>>b)],p=w>>>24,y=w>>>16&255,I=65535&w,!(b+p<=u);){if(0===s)break t;s--,A+=n[o++]<<u,u+=8}A>>>=b,u-=b,r.back+=b}if(A>>>=p,u-=p,r.back+=p,r.length=I,0===y){r.mode=16205;break}if(32&y){r.back=-1,r.mode=16191;break}if(64&y){t.msg="invalid literal/length code",r.mode=Ie;break}r.extra=15&y,r.mode=16201;case 16201:if(r.extra){for(k=r.extra;u<k;){if(0===s)break t;s--,A+=n[o++]<<u,u+=8}r.length+=A&(1<<r.extra)-1,A>>>=r.extra,u-=r.extra,r.back+=r.extra}r.was=r.length,r.mode=16202;case 16202:for(;w=r.distcode[A&(1<<r.distbits)-1],p=w>>>24,y=w>>>16&255,I=65535&w,!(p<=u);){if(0===s)break t;s--,A+=n[o++]<<u,u+=8}if(0==(240&y)){for(b=p,v=y,E=I;w=r.distcode[E+((A&(1<<b+v)-1)>>b)],p=w>>>24,y=w>>>16&255,I=65535&w,!(b+p<=u);){if(0===s)break t;s--,A+=n[o++]<<u,u+=8}A>>>=b,u-=b,r.back+=b}if(A>>>=p,u-=p,r.back+=p,64&y){t.msg="invalid distance code",r.mode=Ie;break}r.offset=I,r.extra=15&y,r.mode=16203;case 16203:if(r.extra){for(k=r.extra;u<k;){if(0===s)break t;s--,A+=n[o++]<<u,u+=8}r.offset+=A&(1<<r.extra)-1,A>>>=r.extra,u-=r.extra,r.back+=r.extra}if(r.offset>r.dmax){t.msg="invalid distance too far back",r.mode=Ie;break}r.mode=16204;case 16204:if(0===c)break t;if(l=h-c,r.offset>l){if(l=r.offset-l,l>r.whave&&r.sane){t.msg="invalid distance too far back",r.mode=Ie;break}l>r.wnext?(l-=r.wnext,d=r.wsize-l):d=r.wnext-l,l>r.length&&(l=r.length),g=r.window}else g=i,d=a-r.offset,l=r.length;l>c&&(l=c),c-=l,r.length-=l;do{i[a++]=g[d++]}while(--l);0===r.length&&(r.mode=16200);break;case 16205:if(0===c)break t;i[a++]=r.length,c--,r.mode=16200;break;case 16206:if(r.wrap){for(;u<32;){if(0===s)break t;s--,A|=n[o++]<<u,u+=8}if(h-=c,t.total_out+=h,r.total+=h,4&r.wrap&&h&&(t.adler=r.check=r.flags?L(r.check,i,h,a-h):P(r.check,i,h,a-h)),h=c,4&r.wrap&&(r.flags?A:be(A))!==r.check){t.msg="incorrect data check",r.mode=Ie;break}A=0,u=0}r.mode=16207;case 16207:if(r.wrap&&r.flags){for(;u<32;){if(0===s)break t;s--,A+=n[o++]<<u,u+=8}if(4&r.wrap&&A!==(4294967295&r.total)){t.msg="incorrect length check",r.mode=Ie;break}A=0,u=0}r.mode=16208;case 16208:C=fe;break t;case Ie:C=de;break t;case 16210:return ge;case 16211:default:return le}return t.next_out=a,t.avail_out=c,t.next_in=o,t.avail_in=s,r.hold=A,r.bits=u,(r.wsize||h!==t.avail_out&&r.mode<Ie&&(r.mode<16206||e!==se))&&De(t,t.output,t.next_out,h-t.avail_out),f-=t.avail_in,h-=t.avail_out,t.total_in+=f,t.total_out+=h,r.total+=h,4&r.wrap&&h&&(t.adler=r.check=r.flags?L(r.check,i,h,t.next_out-h):P(r.check,i,h,t.next_out-h)),t.data_type=r.bits+(r.last?64:0)+(16191===r.mode?128:0)+(16199===r.mode||16194===r.mode?256:0),(0===f&&0===h||e===se)&&C===ue&&(C=pe),C},inflateEnd:t=>{if(Ee(t))return le;let e=t.state;return e.window&&(e.window=null),t.state=null,ue},inflateGetHeader:(t,e)=>{if(Ee(t))return le;const r=t.state;return 0==(2&r.wrap)?le:(r.head=e,e.done=!1,ue)},inflateSetDictionary:(t,e)=>{const r=e.length;let n,i,o;return Ee(t)?le:(n=t.state,0!==n.wrap&&16190!==n.mode?le:16190===n.mode&&(i=1,i=P(i,e,r,0),i!==n.check)?de:(o=De(t,e,r,r),o?(n.mode=16210,ge):(n.havedict=1,ue)))},inflateInfo:"pako inflate (from Nodeca project)"};var Me=function(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1};const Re=Object.prototype.toString,{Z_NO_FLUSH:Oe,Z_FINISH:Ne,Z_OK:Pe,Z_STREAM_END:je,Z_NEED_DICT:Le,Z_STREAM_ERROR:Fe,Z_DATA_ERROR:Te,Z_MEM_ERROR:Ue}=T;function Ge(t){this.options=Ot({chunkSize:65536,windowBits:15,to:""},t||{});const e=this.options;e.raw&&e.windowBits>=0&&e.windowBits<16&&(e.windowBits=-e.windowBits,0===e.windowBits&&(e.windowBits=-15)),!(e.windowBits>=0&&e.windowBits<16)||t&&t.windowBits||(e.windowBits+=32),e.windowBits>15&&e.windowBits<48&&0==(15&e.windowBits)&&(e.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new Ut,this.strm.avail_out=0;let r=xe.inflateInit2(this.strm,e.windowBits);if(r!==Pe)throw new Error(F[r]);if(this.header=new Me,xe.inflateGetHeader(this.strm,this.header),e.dictionary&&("string"==typeof e.dictionary?e.dictionary=Lt(e.dictionary):"[object ArrayBuffer]"===Re.call(e.dictionary)&&(e.dictionary=new Uint8Array(e.dictionary)),e.raw&&(r=xe.inflateSetDictionary(this.strm,e.dictionary),r!==Pe)))throw new Error(F[r])}function He(t,e){const r=new Ge(e);if(r.push(t),r.err)throw r.msg||F[r.err];return r.result}Ge.prototype.push=function(t,e){const r=this.strm,n=this.options.chunkSize,i=this.options.dictionary;let o,a,s;if(this.ended)return!1;for(a=e===~~e?e:!0===e?Ne:Oe,"[object ArrayBuffer]"===Re.call(t)?r.input=new Uint8Array(t):r.input=t,r.next_in=0,r.avail_in=r.input.length;;){for(0===r.avail_out&&(r.output=new Uint8Array(n),r.next_out=0,r.avail_out=n),o=xe.inflate(r,a),o===Le&&i&&(o=xe.inflateSetDictionary(r,i),o===Pe?o=xe.inflate(r,a):o===Te&&(o=Le));r.avail_in>0&&o===je&&r.state.wrap>0&&0!==t[r.next_in];)xe.inflateReset(r),o=xe.inflate(r,a);switch(o){case Fe:case Te:case Le:case Ue:return this.onEnd(o),this.ended=!0,!1}if(s=r.avail_out,r.next_out&&(0===r.avail_out||o===je))if("string"===this.options.to){let t=Tt(r.output,r.next_out),e=r.next_out-t,i=Ft(r.output,t);r.next_out=e,r.avail_out=n-e,e&&r.output.set(r.output.subarray(t,t+e),0),this.onData(i)}else this.onData(r.output.length===r.next_out?r.output:r.output.subarray(0,r.next_out));if(o!==Pe||0!==s){if(o===je)return o=xe.inflateEnd(this.strm),this.onEnd(o),this.ended=!0,!0;if(0===r.avail_in)break}}return!0},Ge.prototype.onData=function(t){this.chunks.push(t)},Ge.prototype.onEnd=function(t){t===Pe&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=Nt(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg};var Ye={Inflate:Ge,inflate:He,inflateRaw:function(t,e){return(e=e||{}).raw=!0,He(t,e)},ungzip:He,constants:T};const{Deflate:Ke,deflate:qe,deflateRaw:Je,gzip:ze}=te,{Inflate:Ze,inflate:Ve,inflateRaw:We,ungzip:Xe}=Ye;var $e=Ke,tr=qe,er=Je,rr=ze,nr=Ze,ir=Ve,or=We,ar=Xe,sr=T,cr={Deflate:Ke,deflate:qe,deflateRaw:Je,gzip:ze,Inflate:Ze,inflate:Ve,inflateRaw:We,ungzip:Xe,constants:T}},function(t,e){},function(t,e,r){"use strict";e.sha1=r(192),e.sha224=r(193),e.sha256=r(94),e.sha384=r(194),e.sha512=r(95)},function(t,e,r){"use strict";var n=r(15),i=r(30),o=r(93),a=n.rotl32,s=n.sum32,c=n.sum32_5,A=o.ft_1,u=i.BlockHash,f=[1518500249,1859775393,2400959708,3395469782];function h(){if(!(this instanceof h))return new h;u.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=new Array(80)}n.inherits(h,u),t.exports=h,h.blockSize=512,h.outSize=160,h.hmacStrength=80,h.padLength=64,h.prototype._update=function(t,e){for(var r=this.W,n=0;n<16;n++)r[n]=t[e+n];for(;n<r.length;n++)r[n]=a(r[n-3]^r[n-8]^r[n-14]^r[n-16],1);var i=this.h[0],o=this.h[1],u=this.h[2],h=this.h[3],l=this.h[4];for(n=0;n<r.length;n++){var d=~~(n/20),g=c(a(i,5),A(d,o,u,h),l,r[n],f[d]);l=h,h=u,u=a(o,30),o=i,i=g}this.h[0]=s(this.h[0],i),this.h[1]=s(this.h[1],o),this.h[2]=s(this.h[2],u),this.h[3]=s(this.h[3],h),this.h[4]=s(this.h[4],l)},h.prototype._digest=function(t){return"hex"===t?n.toHex32(this.h,"big"):n.split32(this.h,"big")}},function(t,e,r){"use strict";var n=r(15),i=r(94);function o(){if(!(this instanceof o))return new o;i.call(this),this.h=[3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428]}n.inherits(o,i),t.exports=o,o.blockSize=512,o.outSize=224,o.hmacStrength=192,o.padLength=64,o.prototype._digest=function(t){return"hex"===t?n.toHex32(this.h.slice(0,7),"big"):n.split32(this.h.slice(0,7),"big")}},function(t,e,r){"use strict";var n=r(15),i=r(95);function o(){if(!(this instanceof o))return new o;i.call(this),this.h=[3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428]}n.inherits(o,i),t.exports=o,o.blockSize=1024,o.outSize=384,o.hmacStrength=192,o.padLength=128,o.prototype._digest=function(t){return"hex"===t?n.toHex32(this.h.slice(0,12),"big"):n.split32(this.h.slice(0,12),"big")}},function(t,e,r){"use strict";var n=r(15),i=r(30),o=n.rotl32,a=n.sum32,s=n.sum32_3,c=n.sum32_4,A=i.BlockHash;function u(){if(!(this instanceof u))return new u;A.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.endian="little"}function f(t,e,r,n){return t<=15?e^r^n:t<=31?e&r|~e&n:t<=47?(e|~r)^n:t<=63?e&n|r&~n:e^(r|~n)}function h(t){return t<=15?0:t<=31?1518500249:t<=47?1859775393:t<=63?2400959708:2840853838}function l(t){return t<=15?1352829926:t<=31?1548603684:t<=47?1836072691:t<=63?2053994217:0}n.inherits(u,A),e.ripemd160=u,u.blockSize=512,u.outSize=160,u.hmacStrength=192,u.padLength=64,u.prototype._update=function(t,e){for(var r=this.h[0],n=this.h[1],i=this.h[2],A=this.h[3],u=this.h[4],I=r,b=n,v=i,E=A,m=u,C=0;C<80;C++){var w=a(o(c(r,f(C,n,i,A),t[d[C]+e],h(C)),p[C]),u);r=u,u=A,A=o(i,10),i=n,n=w,w=a(o(c(I,f(79-C,b,v,E),t[g[C]+e],l(C)),y[C]),m),I=m,m=E,E=o(v,10),v=b,b=w}w=s(this.h[1],i,E),this.h[1]=s(this.h[2],A,m),this.h[2]=s(this.h[3],u,I),this.h[3]=s(this.h[4],r,b),this.h[4]=s(this.h[0],n,v),this.h[0]=w},u.prototype._digest=function(t){return"hex"===t?n.toHex32(this.h,"little"):n.split32(this.h,"little")};var d=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13],g=[5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11],p=[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6],y=[8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11]},function(t,e,r){"use strict";var n=r(15),i=r(11);function o(t,e,r){if(!(this instanceof o))return new o(t,e,r);this.Hash=t,this.blockSize=t.blockSize/8,this.outSize=t.outSize/8,this.inner=null,this.outer=null,this._init(n.toArray(e,r))}t.exports=o,o.prototype._init=function(t){t.length>this.blockSize&&(t=(new this.Hash).update(t).digest()),i(t.length<=this.blockSize);for(var e=t.length;e<this.blockSize;e++)t.push(0);for(e=0;e<t.length;e++)t[e]^=54;for(this.inner=(new this.Hash).update(t),e=0;e<t.length;e++)t[e]^=106;this.outer=(new this.Hash).update(t)},o.prototype.update=function(t,e){return this.inner.update(t,e),this},o.prototype.digest=function(t){return this.outer.update(this.inner.digest()),this.outer.digest(t)}},function(t,e,r){(function(t,e){!function(t,r){"use strict";if(!t.setImmediate){var n,i,o,a,s,c=1,A={},u=!1,f=t.document,h=Object.getPrototypeOf&&Object.getPrototypeOf(t);h=h&&h.setTimeout?h:t,"[object process]"==={}.toString.call(t.process)?n=function(t){e.nextTick((function(){d(t)}))}:!function(){if(t.postMessage&&!t.importScripts){var e=!0,r=t.onmessage;return t.onmessage=function(){e=!1},t.postMessage("","*"),t.onmessage=r,e}}()?t.MessageChannel?((o=new MessageChannel).port1.onmessage=function(t){d(t.data)},n=function(t){o.port2.postMessage(t)}):f&&"onreadystatechange"in f.createElement("script")?(i=f.documentElement,n=function(t){var e=f.createElement("script");e.onreadystatechange=function(){d(t),e.onreadystatechange=null,i.removeChild(e),e=null},i.appendChild(e)}):n=function(t){setTimeout(d,0,t)}:(a="setImmediate$"+Math.random()+"$",s=function(e){e.source===t&&"string"==typeof e.data&&0===e.data.indexOf(a)&&d(+e.data.slice(a.length))},t.addEventListener?t.addEventListener("message",s,!1):t.attachEvent("onmessage",s),n=function(e){t.postMessage(a+e,"*")}),h.setImmediate=function(t){"function"!=typeof t&&(t=new Function(""+t));for(var e=new Array(arguments.length-1),r=0;r<e.length;r++)e[r]=arguments[r+1];var i={callback:t,args:e};return A[c]=i,n(c),c++},h.clearImmediate=l}function l(t){delete A[t]}function d(t){if(u)setTimeout(d,0,t);else{var e=A[t];if(e){u=!0;try{!function(t){var e=t.callback,r=t.args;switch(r.length){case 0:e();break;case 1:e(r[0]);break;case 2:e(r[0],r[1]);break;case 3:e(r[0],r[1],r[2]);break;default:e.apply(void 0,r)}}(e)}finally{l(t),u=!1}}}}}("undefined"==typeof self?void 0===t?this:t:self)}).call(this,r(8),r(9))},function(t,e,r){var n=r(85),i=r(29),o=r(37),a=r(20),s=r(21);function c(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function A(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?c(Object(r),!0).forEach((function(e){o(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):c(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}var u=r(97),f=r(199),h=r(200),l=r(100),d=l.ValidateLibrary,g=l.ValidateObject,p=l.ValidateVersion,y=l.ValidatePartHash,I=l.ValidateWriteToken,b=l.ValidateParameters,v=r(201);e.permissionLevels={owner:{short:"Owner Only",description:"Only the owner has access to the object and ability to change permissions",settings:{visibility:0,statusCode:-1,kmsConk:!1}},editable:{short:"Editable",description:"Members of the editors group have full access to the object and the ability to change permissions",settings:{visibility:0,statusCode:-1,kmsConk:!0}},viewable:{short:"Viewable",description:"In addition to editors, members of the 'accessor' group can have read-only access to the object including playing video and retrieving metadata, images and documents",settings:{visibility:0,statusCode:0,kmsConk:!0}},listable:{short:"Publicly Listable",description:"Anyone can list the public portion of this object but only accounts with specific rights can access",settings:{visibility:1,statusCode:0,kmsConk:!0}},public:{short:"Public",description:"Anyone can access this object",settings:{visibility:10,statusCode:0,kmsConk:!0}}},e.Visibility=function(){var t=s(a.mark((function t(e){var r,n,i,o=this;return a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=e.id,n=e.clearCache,t.prev=1,i=this.utils.HashToAddress(r),n&&delete this.visibilityInfo[i],this.visibilityInfo[i]||(this.visibilityInfo[i]=new Promise(function(){var t=s(a.mark((function t(e,n){return a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,o.authClient.ContractHasMethod({contractAddress:i,methodName:"visibility"});case 3:if(t.sent){t.next=7;break}return e(0),t.abrupt("return");case 7:return t.t0=e,t.next=10,o.CallContractMethod({contractAddress:o.utils.HashToAddress(r),methodName:"visibility"});case 10:t.t1=t.sent,(0,t.t0)(t.t1),t.next=17;break;case 14:t.prev=14,t.t2=t.catch(0),n(t.t2);case 17:case"end":return t.stop()}}),t,null,[[0,14]])})));return function(e,r){return t.apply(this,arguments)}}())),t.prev=5,t.next=8,this.visibilityInfo[i];case 8:return t.abrupt("return",t.sent);case 11:throw t.prev=11,t.t0=t.catch(5),delete this.visibilityInfo[i],t.t0;case 15:t.next=22;break;case 17:if(t.prev=17,t.t1=t.catch(1),"CALL_EXCEPTION"!==t.t1.code){t.next=21;break}return t.abrupt("return",0);case 21:throw t.t1;case 22:case"end":return t.stop()}}),t,this,[[1,17],[5,11]])})));return function(e){return t.apply(this,arguments)}}(),e.Permission=function(){var t=s(a.mark((function t(e){var r,n,i,o,s,c,A,u,f=this;return a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=e.objectId,n=e.clearCache,g(r),t.next=4,this.AccessType({id:r});case 4:if(t.t0=t.sent,t.t1=this.authClient.ACCESS_TYPES.OBJECT,t.t0===t.t1){t.next=8;break}throw Error("Permission only valid for normal content objects: "+r);case 8:return t.next=10,this.Visibility({id:r,clearCache:n});case 10:return i=t.sent,t.next=13,this.CallContractMethod({contractAddress:this.utils.HashToAddress(r),methodName:"addressKMS"});case 13:if(o=t.sent,s=o&&"ikms".concat(this.utils.AddressToHash(o)),c=!1,!s){t.next=27;break}return t.t2=this,t.next=20,this.ContentObjectLibraryId({objectId:r});case 20:return t.t3=t.sent,t.t4=r,t.t5="eluv.caps.".concat(s),t.t6={libraryId:t.t3,objectId:t.t4,metadataSubtree:t.t5},t.next=26,t.t2.ContentObjectMetadata.call(t.t2,t.t6);case 26:c=!!t.sent;case 27:return t.next=29,this.CallContractMethod({contractAddress:this.utils.HashToAddress(r),methodName:"statusCode"});case 29:return A=t.sent,A=parseInt(A._hex,16),(u=Object.keys(this.permissionLevels).filter((function(t){var e=f.permissionLevels[t].settings;return i>=e.visibility&&A>=e.statusCode&&c===e.kmsConk})))||(u=c?["editable"]:["owner"]),t.abrupt("return",u.slice(-1)[0]);case 34:case"end":return t.stop()}}),t,this)})));return function(e){return t.apply(this,arguments)}}(),e.DefaultKMSAddress=s(a.mark((function t(){var e,r,n,i=arguments;return a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e=i.length>0&&void 0!==i[0]?i[0]:{},r=e.tenantId,t.t0=r,!t.t0){t.next=8;break}return t.next=5,this.AccessType({id:r});case 5:t.t1=t.sent,t.t2=this.authClient.ACCESS_TYPES.TENANT,t.t0=t.t1===t.t2;case 8:if(!t.t0){t.next=14;break}return t.next=11,this.CallContractMethod({contractAddress:this.utils.HashToAddress(r),methodName:"addressKMS"});case 11:if(!(n=t.sent)){t.next=14;break}return t.abrupt("return",n);case 14:return t.next=16,this.CallContractMethod({contractAddress:this.contentSpaceAddress,methodName:"addressKMS"});case 16:return t.abrupt("return",t.sent);case 17:case"end":return t.stop()}}),t,this)}))),e.ContentSpaceId=function(){return this.contentSpaceId},e.ContentTypeOwner=function(){var t=s(a.mark((function t(e){var r,n,i,o;return a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=e.name,n=e.typeId,i=e.versionHash,t.next=3,this.ContentType({name:r,typeId:n,versionHash:i});case 3:return o=t.sent,t.t0=this.utils,t.next=7,this.ethClient.CallContractMethod({contractAddress:this.utils.HashToAddress(o.id),methodName:"owner",methodArgs:[]});case 7:return t.t1=t.sent,t.abrupt("return",t.t0.FormatAddress.call(t.t0,t.t1));case 9:case"end":return t.stop()}}),t,this)})));return function(e){return t.apply(this,arguments)}}(),e.ContentType=function(){var t=s(a.mark((function t(e){var r,n,i,o,s,c,A;return a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=e.name,n=e.typeId,i=e.versionHash,o=e.publicOnly,s=void 0!==o&&o,this.Log("Retrieving content type: ".concat(r||n||i)),i&&(n=this.utils.DecodeVersionHash(i).objectId),!r){t.next=13;break}return this.Log("Looking up type by name in content space metadata..."),t.prev=5,t.next=8,this.ContentObjectMetadata({libraryId:this.contentSpaceLibraryId,objectId:this.contentSpaceObjectId,metadataSubtree:u("public","contentTypes",r)});case 8:n=t.sent,t.next=13;break;case 11:t.prev=11,t.t0=t.catch(5);case 13:if(n){t.next=23;break}return this.Log("Looking up type by name in available types..."),t.next=17,this.ContentTypes();case 17:if(c=t.sent,!r){t.next=22;break}return t.abrupt("return",Object.values(c).find((function(t){return(t.name||"").toLowerCase()===r.toLowerCase()})));case 22:return t.abrupt("return",Object.values(c).find((function(t){return t.hash===i})));case 23:if(i){t.next=27;break}return t.next=26,this.LatestVersionHash({objectId:n});case 26:i=t.sent;case 27:if(t.prev=27,this.Log("Looking up type by ID..."),!s){t.next=39;break}return t.next=32,this.ContentObjectMetadata({libraryId:this.contentSpaceLibraryId,objectId:n,versionHash:i,metadataSubtree:"public"});case 32:if(t.t1=t.sent,t.t1){t.next=35;break}t.t1={};case 35:t.t2=t.t1,A={public:t.t2},t.next=45;break;case 39:return t.next=41,this.ContentObjectMetadata({libraryId:this.contentSpaceLibraryId,objectId:n,versionHash:i});case 41:if(t.t3=t.sent,t.t3){t.next=44;break}t.t3={};case 44:A=t.t3;case 45:return t.abrupt("return",{id:n,hash:i,name:A.public&&A.public.name||A.name||n,meta:A});case 48:throw t.prev=48,t.t4=t.catch(27),this.Log("Error looking up content type:"),this.Log(t.t4),new Error("Content Type ".concat(r||n," is invalid"));case 53:case"end":return t.stop()}}),t,this,[[5,11],[27,48]])})));return function(e){return t.apply(this,arguments)}}(),e.ContentTypes=s(a.mark((function t(){var e,r,n,i=this;return a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this.contentTypes=this.contentTypes||{},this.Log("Looking up all available content types"),t.next=4,this.Collection({collectionType:"contentTypes"});case 4:return e=t.sent,this.Log("Personally available types:"),this.Log(e),r={},t.prev=8,t.next=11,this.ContentObjectMetadata({libraryId:this.contentSpaceLibraryId,objectId:this.contentSpaceObjectId,metadataSubtree:"public/contentTypes"});case 11:if(t.t0=t.sent,t.t0){t.next=14;break}t.t0={};case 14:r=t.t0,t.next=19;break;case 17:t.prev=17,t.t1=t.catch(8);case 19:return n=Object.values(r).map((function(t){return i.utils.HashToAddress(t)})),this.Log("Content space types:"),this.Log(n),e=e.concat(n).filter((function(t){return t})).map((function(t){return i.utils.FormatAddress(t)})).filter((function(t,e,r){return r.indexOf(t)===e})),t.next=25,Promise.all(e.map(function(){var t=s(a.mark((function t(e){var r;return a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=i.utils.AddressToObjectId(e),i.contentTypes[r]){t.next=11;break}return t.prev=2,t.next=5,i.ContentType({typeId:r,publicOnly:!0});case 5:i.contentTypes[r]=t.sent,t.next=11;break;case 8:t.prev=8,t.t0=t.catch(2),console.error(t.t0);case 11:case"end":return t.stop()}}),t,null,[[2,8]])})));return function(e){return t.apply(this,arguments)}}()));case 25:return t.abrupt("return",this.contentTypes);case 26:case"end":return t.stop()}}),t,this,[[8,17]])}))),e.ContentLibraries=s(a.mark((function t(){var e,r=this;return a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.Collection({collectionType:"libraries"});case 2:return e=t.sent,t.abrupt("return",e.map((function(t){return r.utils.AddressToLibraryId(t)})));case 4:case"end":return t.stop()}}),t,this)}))),e.ContentLibrary=function(){var t=s(a.mark((function t(e){var r,n,i;return a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=e.libraryId,d(r),n=u("qlibs",r),t.t0=this.utils,t.t1=this.HttpClient,t.next=7,this.authClient.AuthorizationHeader({libraryId:r});case 7:return t.t2=t.sent,t.t3=n,t.t4={headers:t.t2,method:"GET",path:t.t3},t.t5=t.t1.Request.call(t.t1,t.t4),t.next=13,t.t0.ResponseToJson.call(t.t0,t.t5);case 13:return i=t.sent,t.abrupt("return",A(A({},i),{},{meta:i.meta||{}}));case 15:case"end":return t.stop()}}),t,this)})));return function(e){return t.apply(this,arguments)}}(),e.ContentLibraryOwner=function(){var t=s(a.mark((function t(e){var r;return a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=e.libraryId,d(r),t.t0=this.utils,t.next=5,this.ethClient.CallContractMethod({contractAddress:this.utils.HashToAddress(r),methodName:"owner",methodArgs:[]});case 5:return t.t1=t.sent,t.abrupt("return",t.t0.FormatAddress.call(t.t0,t.t1));case 7:case"end":return t.stop()}}),t,this)})));return function(e){return t.apply(this,arguments)}}(),e.LibraryContentTypes=function(){var t=s(a.mark((function t(e){var r,n,i,o=this;return a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=e.libraryId,d(r),this.Log("Retrieving library content types for ".concat(r)),t.next=5,this.ethClient.CallContractMethod({contractAddress:this.utils.HashToAddress(r),methodName:"contentTypesLength",methodArgs:[]});case 5:if(n=t.sent.toNumber(),this.Log("".concat(n," types")),0!==n){t.next=9;break}return t.abrupt("return",{});case 9:return i={},t.next=12,Promise.all(Array.from(new Array(n),function(){var t=s(a.mark((function t(e,n){var s,c;return a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,o.ethClient.CallContractMethod({contractAddress:o.utils.HashToAddress(r),methodName:"contentTypes",methodArgs:[n]});case 2:return s=t.sent,c=o.utils.AddressToObjectId(s),t.next=6,o.ContentType({typeId:c});case 6:i[c]=t.sent;case 7:case"end":return t.stop()}}),t)})));return function(e,r){return t.apply(this,arguments)}}()));case 12:return this.Log(i),t.abrupt("return",i);case 14:case"end":return t.stop()}}),t,this)})));return function(e){return t.apply(this,arguments)}}(),e.ContentObjects=function(){var t=s(a.mark((function t(e){var r,n,i,o,s,c,A;return a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=e.libraryId,n=e.filterOptions,i=void 0===n?{}:n,d(r),this.Log("Retrieving content objects from ".concat(r)),o=u("qlibs",r,"q"),s={filter:[]},i.cacheId&&(s.cache_id=i.cacheId),i.start&&(s.start=i.start),i.limit&&(s.limit=i.limit),i.select&&(s.select=i.select),i.sort&&(s.sort_by=i.sort,i.sortDesc&&(s.sort_descending=!0)),c={eq:":eq:",neq:":ne:",lt:":lt:",lte:":le:",gt:":gt:",gte:":ge:",cnt:":co:",ncnt:":nc:"},A=function(t){var e=t.key,r=t.type,n=t.filter;s.filter.push("".concat(e).concat(c[r]).concat(n))},i.filter&&(Array.isArray(i.filter)?i.filter.forEach((function(t){return A(t)})):A(i.filter)),this.Log("Filter options:"),this.Log(i),t.t0=this.utils,t.t1=this.HttpClient,t.next=19,this.authClient.AuthorizationHeader({libraryId:r});case 19:return t.t2=t.sent,t.t3=o,t.t4=s,t.t5={headers:t.t2,method:"GET",path:t.t3,queryParams:t.t4},t.t6=t.t1.Request.call(t.t1,t.t5),t.next=26,t.t0.ResponseToJson.call(t.t0,t.t6);case 26:return t.abrupt("return",t.sent);case 27:case"end":return t.stop()}}),t,this)})));return function(e){return t.apply(this,arguments)}}(),e.ContentObject=function(){var t=s(a.mark((function t(e){var r,n,i,o,s;return a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=e.libraryId,n=e.objectId,i=e.versionHash,o=e.writeToken,b({libraryId:r,objectId:n,versionHash:i}),this.Log("Retrieving content object: ".concat(r||""," ").concat(o||i||n)),i&&(n=this.utils.DecodeVersionHash(i).objectId),s=u("q",o||i||n),t.t0=this.utils,t.t1=this.HttpClient,t.next=9,this.authClient.AuthorizationHeader({libraryId:r,objectId:n,versionHash:i});case 9:return t.t2=t.sent,t.t3=s,t.t4={headers:t.t2,method:"GET",path:t.t3},t.t5=t.t1.Request.call(t.t1,t.t4),t.next=15,t.t0.ResponseToJson.call(t.t0,t.t5);case 15:return t.abrupt("return",t.sent);case 16:case"end":return t.stop()}}),t,this)})));return function(e){return t.apply(this,arguments)}}(),e.ContentObjectOwner=function(){var t=s(a.mark((function t(e){var r;return a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=e.objectId,g(r),this.Log("Retrieving content object owner: ".concat(r)),t.t0=this.utils,t.next=6,this.ethClient.CallContractMethod({contractAddress:this.utils.HashToAddress(r),methodName:"owner",methodArgs:[]});case 6:return t.t1=t.sent,t.abrupt("return",t.t0.FormatAddress.call(t.t0,t.t1));case 8:case"end":return t.stop()}}),t,this)})));return function(e){return t.apply(this,arguments)}}(),e.ContentObjectTenantId=function(){var t=s(a.mark((function t(e){var r,n;return a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=e.objectId,(n=e.versionHash)?p(n):g(r),n&&(r=this.utils.DecodeVersionHash(n).objectId),this.objectTenantIds[r]){t.next=7;break}return t.next=6,this.authClient.MakeElvMasterCall({methodName:"elv_getTenantById",params:[this.contentSpaceId,r]});case 6:this.objectTenantIds[r]=t.sent;case 7:return t.abrupt("return",this.objectTenantIds[r]);case 8:case"end":return t.stop()}}),t,this)})));return function(e){return t.apply(this,arguments)}}(),e.ContentObjectLibraryId=function(){var t=s(a.mark((function t(e){var r,n,i=this;return a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=e.objectId,(n=e.versionHash)?p(n):g(r),n&&(r=this.utils.DecodeVersionHash(n).objectId),t.next=5,this.authClient.AccessType(r);case 5:t.t0=t.sent,t.next=t.t0===this.authClient.ACCESS_TYPES.LIBRARY?8:t.t0===this.authClient.ACCESS_TYPES.OBJECT?9:t.t0===this.authClient.ACCESS_TYPES.OTHER?20:21;break;case 8:return t.abrupt("return",this.utils.AddressToLibraryId(this.utils.HashToAddress(r)));case 9:return this.objectLibraryIds[r]||(this.Log("Retrieving content object library ID: ".concat(r||n)),this.objectLibraryIds[r]=new Promise(function(){var t=s(a.mark((function t(e,n){return a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.t0=e,t.t1=i.utils,t.next=5,i.CallContractMethod({contractAddress:i.utils.HashToAddress(r),methodName:"libraryAddress"});case 5:t.t2=t.sent,t.t3=t.t1.AddressToLibraryId.call(t.t1,t.t2),(0,t.t0)(t.t3),t.next=13;break;case 10:t.prev=10,t.t4=t.catch(0),n(t.t4);case 13:case"end":return t.stop()}}),t,null,[[0,10]])})));return function(e,r){return t.apply(this,arguments)}}())),t.prev=10,t.next=13,this.objectLibraryIds[r];case 13:return t.abrupt("return",t.sent);case 16:throw t.prev=16,t.t1=t.catch(10),delete this.objectLibraryIds[r],t.t1;case 20:throw Error("Unable to retrieve library ID for ".concat(n||r,": Unknown type. (wrong network or deleted object?)"));case 21:return t.abrupt("return",this.contentSpaceLibraryId);case 22:case"end":return t.stop()}}),t,this,[[10,16]])})));return function(e){return t.apply(this,arguments)}}(),e.ProduceMetadataLinks=function(){var t=s(a.mark((function t(e){var r,n,o,c,f,h,l,d,g,p=this;return a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=e.libraryId,n=e.objectId,o=e.versionHash,c=e.path,f=void 0===c?"/":c,h=e.metadata,l=e.authorizationToken,d=e.noAuth,h&&"object"===i(h)){t.next=3;break}return t.abrupt("return",h);case 3:if(!Array.isArray(h)){t.next=7;break}return t.next=6,this.utils.LimitedMap(5,h,function(){var t=s(a.mark((function t(e,i){return a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,p.ProduceMetadataLinks({libraryId:r,objectId:n,versionHash:o,path:u(f,i.toString()),metadata:e,authorizationToken:l,noAuth:d});case 2:return t.abrupt("return",t.sent);case 3:case"end":return t.stop()}}),t)})));return function(e,r){return t.apply(this,arguments)}}());case 6:return t.abrupt("return",t.sent);case 7:if(!h["/"]||!h["/"].match(/\.\/(rep|files)\/.+/)&&!h["/"].match(/^\/?qfab\/([\w]+)\/?(rep|files)\/.+/)){t.next=16;break}return t.t0=A,t.t1=A({},h),t.t2={},t.next=13,this.LinkUrl({libraryId:r,objectId:n,versionHash:o,linkPath:f,authorizationToken:l,noAuth:d});case 13:return t.t3=t.sent,t.t4={url:t.t3},t.abrupt("return",(0,t.t0)(t.t1,t.t2,t.t4));case 16:return g={},t.next=19,this.utils.LimitedMap(5,Object.keys(h),function(){var t=s(a.mark((function t(e){return a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,p.ProduceMetadataLinks({libraryId:r,objectId:n,versionHash:o,path:u(f,e),metadata:h[e],authorizationToken:l,noAuth:d});case 2:g[e]=t.sent;case 3:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}());case 19:return t.abrupt("return",g);case 20:case"end":return t.stop()}}),t,this)})));return function(e){return t.apply(this,arguments)}}(),e.MetadataAuth=function(){var t=s(a.mark((function t(e){var r,n,i,o,s,c,A,u,f,h,l,d,g;return a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=e.libraryId,n=e.objectId,i=e.versionHash,o=e.path,s=void 0===o?"/":o,c=e.channelAuth,A=void 0!==c&&c,u=e.noAuth,f=void 0!==u&&u,b({libraryId:r,objectId:n,versionHash:i}),i&&(n=this.utils.DecodeVersionHash(i).objectId),f=this.noAuth||f||this.staticToken,h=f,f){t.next=14;break}return t.next=8,this.Visibility({id:n});case 8:return d=t.sent,t.next=11,this.AccessType({id:n});case 11:l=t.sent,h=(s||"").replace(/^\/+/,"").startsWith("public"),f=d>=10||h&&d>=1;case 14:if(!this.oauthToken){t.next=22;break}return t.next=17,this.authClient.KMSAddress({objectId:n,versionHash:i});case 17:if(!(g=t.sent)||this.utils.EqualAddress(g,this.utils.nullAddress)){t.next=22;break}return t.next=21,this.authClient.AuthorizationToken({libraryId:r,objectId:n,versionHash:i,channelAuth:!0,oauthToken:this.oauthToken});case 21:return t.abrupt("return",t.sent);case 22:if(this.inaccessibleLibraries[r]||!h||l!==this.authClient.ACCESS_TYPES.OBJECT||A){t.next=48;break}if(t.prev=23,t.t0=this.authClient,t.t1=r,t.t1){t.next=30;break}return t.next=29,this.ContentObjectLibraryId({objectId:n,versionHash:i});case 29:t.t1=t.sent;case 30:return t.t2=t.t1,t.t3=f,t.t4={libraryId:t.t2,noAuth:t.t3},t.next=35,t.t0.AuthorizationToken.call(t.t0,t.t4);case 35:return t.abrupt("return",t.sent);case 38:if(t.prev=38,t.t5=t.catch(23),!t.t5.message||!t.t5.message.toLowerCase().startsWith("access denied")){t.next=45;break}return this.inaccessibleLibraries[r]=!0,t.next=44,this.authClient.AuthorizationToken({libraryId:r,objectId:n,versionHash:i,noAuth:f,channelAuth:A});case 44:return t.abrupt("return",t.sent);case 45:throw t.t5;case 46:t.next=51;break;case 48:return t.next=50,this.authClient.AuthorizationToken({libraryId:r,objectId:n,versionHash:i,noAuth:f,channelAuth:A});case 50:return t.abrupt("return",t.sent);case 51:case"end":return t.stop()}}),t,this,[[23,38]])})));return function(e){return t.apply(this,arguments)}}(),e.ContentObjectMetadata=function(){var t=s(a.mark((function t(e){var r,n,i,o,s,c,h,l,d,g,p,y,I,E,m,C,w,B,Q,k,S,_,D,x,M,R,O,N,P,j,L,F=arguments;return a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=e.libraryId,n=e.objectId,i=e.versionHash,o=e.writeToken,s=e.metadataSubtree,c=void 0===s?"/":s,h=e.localizationSubtree,l=e.queryParams,d=void 0===l?{}:l,g=e.select,p=void 0===g?[]:g,y=e.remove,I=void 0===y?[]:y,E=e.authorizationToken,m=e.noAuth,C=void 0!==m&&m,w=e.resolveLinks,B=void 0!==w&&w,Q=e.resolveIncludeSource,k=void 0!==Q&&Q,S=e.resolveIgnoreErrors,_=void 0!==S&&S,D=e.linkDepthLimit,x=void 0===D?1:D,M=e.produceLinkUrls,R=void 0!==M&&M,b({libraryId:r,objectId:n,versionHash:i}),this.Log("Retrieving content object metadata: ".concat(r||""," ").concat(n||i," ").concat(o||"","\n Subtree: ").concat(c)),d=A({},d||{}),i&&(n=this.utils.DecodeVersionHash(i).objectId),O=u("q",o||i||n,"meta",c),i){t.next=12;break}if(r){t.next=11;break}return t.next=10,this.ContentObjectLibraryId({objectId:n});case 10:r=t.sent;case 11:O=u("qlibs",r,O);case 12:return t.next=14,this.MetadataAuth({libraryId:r,objectId:n,versionHash:i,path:c,noAuth:C});case 14:return N=t.sent,P=[E,d.authorization,N].flat().filter((function(t){return t})),delete d.authorization,t.prev=17,t.next=20,this.utils.ResponseToJson(this.HttpClient.Request({headers:{Authorization:P.map((function(t){return"Bearer ".concat(t)}))},queryParams:A(A({},d),{},{select:p,remove:I,link_depth:x,resolve:B,resolve_include_source:k,resolve_ignore_errors:_}),method:"GET",path:O}));case 20:j=t.sent,t.next=33;break;case 23:if(t.prev=23,t.t0=t.catch(17),404===t.t0.status){t.next=27;break}throw t.t0;case 27:if(!f.get(t.t0.body,"errors[0].cause.cause.cause.qwtoken")){t.next=32;break}throw t.t0;case 32:j="/"===c?{}:void 0;case 33:if(!R){t.next=37;break}return t.next=36,this.ProduceMetadataLinks({libraryId:r,objectId:n,versionHash:i,path:c,metadata:j,authorizationToken:E,noAuth:C});case 36:j=t.sent;case 37:if(h){t.next=39;break}return t.abrupt("return",j);case 39:return t.prev=39,t.next=42,this.ContentObjectMetadata(A(A({},F[0]),{},{metadataSubtree:h,localizationSubtree:void 0}));case 42:return L=t.sent,t.abrupt("return",v({},j,L,(function(t,e){return null===e||""===e?t:void 0})));case 46:return t.prev=46,t.t1=t.catch(39),this.Log(t.t1,!0),t.abrupt("return",j);case 50:case"end":return t.stop()}}),t,this,[[17,23],[39,46]])})));return function(e){return t.apply(this,arguments)}}(),e.AssetMetadata=function(){var t=s(a.mark((function t(e){var r,i,o,s,c,f,h,l,d,g=this;return a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=e.libraryId,i=e.objectId,o=e.versionHash,s=e.metadata,c=e.localization,f=e.noAuth,h=e.produceLinkUrls,l=void 0!==h&&h,b({libraryId:r,objectId:i,versionHash:o}),i||(i=this.utils.DecodeVersionHash(o).objectId),s){t.next=12;break}return t.next=6,this.ContentObjectMetadata({libraryId:r,objectId:i,versionHash:o,metadataSubtree:"public/asset_metadata",resolveLinks:!0,linkDepthLimit:2,resolveIgnoreErrors:!0,produceLinkUrls:l,noAuth:f});case 6:if(t.t0=t.sent,t.t0){t.next=9;break}t.t0={};case 9:s=t.t0,t.next=16;break;case 12:if(!l){t.next=16;break}return t.next=15,this.ProduceMetadataLinks({libraryId:r,objectId:i,versionHash:o,path:u("public","asset_metadata"),metadata:s,noAuth:f});case 15:s=t.sent;case 16:return s.info||(s.info={}),d=A({},s),c&&c.reverse().forEach((function(t){var e,r=(e=g.utils).SafeTraverse.apply(e,[s].concat(n(t)))||{};d=v({},d,r,(function(t,e){return null===e||""===e?t:void 0}))})),t.abrupt("return",d);case 20:case"end":return t.stop()}}),t,this)})));return function(e){return t.apply(this,arguments)}}(),e.ContentObjectVersions=function(){var t=s(a.mark((function t(e){var r,n,i;return a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=e.libraryId,n=e.objectId,b({libraryId:r,objectId:n}),this.Log("Retrieving content object versions: ".concat(r||""," ").concat(n)),i=u("qid",n),t.t0=this.utils,t.t1=this.HttpClient,t.next=8,this.authClient.AuthorizationHeader({libraryId:r,objectId:n});case 8:return t.t2=t.sent,t.t3=i,t.t4={headers:t.t2,method:"GET",path:t.t3},t.t5=t.t1.Request.call(t.t1,t.t4),t.abrupt("return",t.t0.ResponseToJson.call(t.t0,t.t5));case 13:case"end":return t.stop()}}),t,this)})));return function(e){return t.apply(this,arguments)}}(),e.LatestVersionHash=function(){var t=s(a.mark((function t(e){var r,n,i,o;return a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=e.objectId,(n=e.versionHash)&&(r=this.utils.DecodeVersionHash(n).objectId),g(r),t.prev=3,t.next=6,this.CallContractMethod({contractAddress:this.utils.HashToAddress(r),methodName:"objectHash"});case 6:i=t.sent,t.next=11;break;case 9:t.prev=9,t.t0=t.catch(3);case 11:if(i){t.next=20;break}return t.next=14,this.CallContractMethod({contractAddress:this.utils.HashToAddress(r),methodName:"countVersionHashes"});case 14:if((o=t.sent).toNumber()){t.next=17;break}throw Error("Unable to determine latest version hash for ".concat(n||r," - Item deleted?"));case 17:return t.next=19,this.CallContractMethod({contractAddress:this.utils.HashToAddress(r),methodName:"versionHashes",methodArgs:[o-1]});case 19:i=t.sent;case 20:return t.abrupt("return",i);case 21:case"end":return t.stop()}}),t,this,[[3,9]])})));return function(e){return t.apply(this,arguments)}}(),e.AvailableDRMs=s(a.mark((function t(){var e,r,n,i,o,s,c,A,u;return a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e=["clear","aes-128"],"undefined"!=typeof window){t.next=3;break}return t.abrupt("return",e);case 3:if(window.navigator&&window.navigator.userAgent&&((r=window.navigator.userAgent.match(/(iPad|iPhone|iphone|iPod).*?(OS |os |OS_)(\d+((_|\.)\d)?((_|\.)\d)?)/))&&r[3]&&(n=r[3].split("_"),i=parseInt(n[0]),o=parseInt(n[1]),(i>13||13===i&&o>=1)&&(e[1]="sample-aes",e[2]="fairplay")),/^((?!chrome|android).)*safari/i.test(window.navigator.userAgent)&&(s=window.navigator.userAgent.match(/.+Version\/(\d+)\.(\d+)/))&&s[2]&&(c=parseInt(s[1]),A=parseInt(s[2]),(c>13||13===c&&A>=1)&&(e[1]="sample-aes",e[2]="fairplay"))),"undefined"==typeof window||"function"==typeof window.navigator.requestMediaKeySystemAccess){t.next=6;break}return t.abrupt("return",e);case 6:return t.prev=6,u=[{initDataTypes:["cenc"],audioCapabilities:[{contentType:'audio/mp4;codecs="mp4a.40.2"'}],videoCapabilities:[{contentType:'video/mp4;codecs="avc1.42E01E"'}]}],t.next=10,navigator.requestMediaKeySystemAccess("com.widevine.alpha",u);case 10:e.push("widevine"),t.next=15;break;case 13:t.prev=13,t.t0=t.catch(6);case 15:return t.abrupt("return",e);case 16:case"end":return t.stop()}}),t,null,[[6,13]])}))),e.PlayoutPathResolution=function(){var t=s(a.mark((function t(e){var r,n,i,o,s,c,A,f,h,l,d,g,p,y,I,b,v;return a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=e.libraryId,n=e.objectId,i=e.versionHash,o=e.writeToken,s=e.linkPath,c=e.handler,A=e.offering,f=void 0===A?"":A,h=e.signedLink,l=void 0!==h&&h,d=e.authorizationToken,r){t.next=5;break}return t.next=4,this.ContentObjectLibraryId({objectId:n});case 4:r=t.sent;case 5:if(i){t.next=9;break}return t.next=8,this.LatestVersionHash({objectId:n});case 8:i=t.sent;case 9:if(g=u("qlibs",r,"q",o||i,"rep",c,f,"options.json"),!s){t.next=26;break}return t.next=13,this.ContentObjectMetadata({libraryId:r,objectId:n,versionHash:i,writeToken:o,metadataSubtree:s,resolveLinks:!1,resolveIgnoreErrors:!0,resolveIncludeSource:!0,authorizationToken:d});case 13:if(v=t.sent,b=!!v&&!!v["/"]&&!v["/"].endsWith("options.json"),g=u("qlibs",r,"q",o||i,"meta",s),l){t.next=25;break}return t.next=19,this.LinkTarget({libraryId:r,objectId:n,versionHash:i,writeToken:o,linkPath:s,linkInfo:v,authorizationToken:d});case 19:return I=t.sent,y=this.utils.DecodeVersionHash(I).objectId,t.next=23,this.ContentObjectLibraryId({objectId:y});case 23:p=t.sent,b||f||(g=u("q",I,"rep",c,"options.json"));case 25:b&&(g=u(g,f,"options.json"));case 26:return t.abrupt("return",{path:g,multiOfferingLink:b,linkTarget:{libraryId:p,objectId:y,versionHash:I}});case 27:case"end":return t.stop()}}),t,this)})));return function(e){return t.apply(this,arguments)}}(),e.AvailableOfferings=function(){var t=s(a.mark((function t(e){var r,n,i,o,s,c,A,u,f,h,l,d;return a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=e.objectId,n=e.versionHash,i=e.writeToken,o=e.linkPath,s=e.signedLink,c=e.directLink,A=e.handler,u=void 0===A?"playout":A,f=e.authorizationToken,r||(r=this.utils.DecodeVersionHash(n).objectId),!c){t.next=15;break}return t.t0=this,t.next=6,this.ContentObjectLibraryId({objectId:r});case 6:return t.t1=t.sent,t.t2=r,t.t3=n,t.t4=o,t.t5=f,t.t6={libraryId:t.t1,objectId:t.t2,versionHash:t.t3,metadataSubtree:t.t4,resolveLinks:!0,authorizationToken:t.t5},t.next=14,t.t0.ContentObjectMetadata.call(t.t0,t.t6);case 14:return t.abrupt("return",t.sent);case 15:return t.next=17,this.PlayoutPathResolution({objectId:r,versionHash:n,writeToken:i,linkPath:o,signedLink:s,handler:u,authorizationToken:f});case 17:return h=t.sent,l=h.path,t.prev=19,t.t7=f,t.next=23,this.authClient.AuthorizationToken({objectId:r,channelAuth:!0,oauthToken:this.oauthToken});case 23:return t.t8=t.sent,d=[t.t7,t.t8].flat().filter((function(t){return t})),t.next=27,this.utils.ResponseToJson(this.HttpClient.Request({path:l,method:"GET",headers:{Authorization:"Bearer ".concat(d.join(","))}}));case 27:return t.abrupt("return",t.sent);case 30:if(t.prev=30,t.t9=t.catch(19),!t.t9.status||500!==parseInt(t.t9.status)){t.next=34;break}return t.abrupt("return",{});case 34:throw t.t9;case 35:case"end":return t.stop()}}),t,this,[[19,30]])})));return function(e){return t.apply(this,arguments)}}(),e.PlayoutOptions=function(){var t=s(a.mark((function t(e){var r,n,i,c,f,h,l,d,y,I,b,v,E,m,C,w,B,Q,k,S,_,D,x,M,R,O,N,P,j,L,F,T,U,G,H,Y,K,q,J,z,Z,V,W,X,$,tt,et=this;return a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=e.offeringURI,n=e.objectId,i=e.versionHash,c=e.writeToken,f=e.linkPath,h=e.signedLink,l=void 0!==h&&h,d=e.protocols,y=void 0===d?["dash","hls"]:d,I=e.handler,b=void 0===I?"playout":I,v=e.offering,E=void 0===v?"default":v,m=e.playoutType,C=e.drms,w=void 0===C?[]:C,B=e.context,Q=e.hlsjsProfile,k=void 0===Q||Q,S=e.authorizationToken,_=e.options,D=void 0===_?{}:_,!r){t.next=8;break}if(x=r.match(/(hq__[^/]+)\/rep\/([^/]+)\/([^/]+)\/options.json/),i=x[1],b=x[2],E=x[3],i&&b&&E){t.next=8;break}throw Error("Invalid offering URI: ".concat(r));case 8:if(i?p(i):g(n),y=y.map((function(t){return t.toLowerCase()})),w=w.map((function(t){return t.toLowerCase()})),n){t.next=15;break}n=this.utils.DecodeVersionHash(i).objectId,t.next=19;break;case 15:if(i){t.next=19;break}return t.next=18,this.LatestVersionHash({objectId:n});case 18:i=t.sent;case 19:return t.next=21,this.ContentObjectLibraryId({objectId:n});case 21:if(M=t.sent,t.prev=22,f){t.next=29;break}return R=u("public","asset_metadata","sources",E),t.next=27,this.ContentObjectMetadata({libraryId:M,objectId:n,versionHash:i,metadataSubtree:R,authorizationToken:S});case 27:t.sent&&(f=R);case 29:t.next=33;break;case 31:t.prev=31,t.t0=t.catch(22);case 33:return t.next=35,this.PlayoutPathResolution({libraryId:M,objectId:n,versionHash:i,writeToken:c,linkPath:f,signedLink:l,handler:b,offering:E,authorizationToken:S});case 35:if(O=t.sent,N=O.path,P=O.linkTarget,t.t1=this.authClient,t.t2=P.objectId||n,t.t3=P.versionHash||i,t.t3){t.next=45;break}return t.next=44,this.LatestVersionHash({objectId:n});case 44:t.t3=t.sent;case 45:return t.t4=t.t3,t.t5=y,t.t6=w,t.t7=B,t.t8={objectId:t.t2,versionHash:t.t4,protocols:t.t5,drms:t.t6,context:t.t7},j=t.t1.AudienceData.call(t.t1,t.t8),t.t9=S,t.next=54,this.authClient.AuthorizationToken({libraryId:M,objectId:n,channelAuth:!0,oauthToken:this.oauthToken,audienceData:j});case 54:return t.t10=t.sent,L=[t.t9,t.t10].flat().filter((function(t){return t})),F=A({authorization:L,resolve:!!f},D),t.t11=Object,t.next=60,this.utils.ResponseToJson(this.HttpClient.Request({path:N,method:"GET",queryParams:F}));case 60:if(t.t12=t.sent,T=t.t11.values.call(t.t11,t.t12),l||!P.versionHash){t.next=68;break}return t.t13=S,t.next=66,this.authClient.AuthorizationToken({libraryId:P.libraryId,objectId:P.objectId,channelAuth:!0,oauthToken:this.oauthToken,audienceData:j});case 66:t.t14=t.sent,F.authorization=[t.t13,t.t14].flat().filter((function(t){return t}));case 68:U={},Y=0;case 70:if(!(Y<T.length)){t.next=116;break}if(K=T[Y],q=K.properties.protocol,J=K.properties.drm,G=G||K.sid,H=H||!!K.properties.multiview,G&&(F.sid=G),z=K.uri.split("?")[0],m&&(z=z.replace("playlist","playlist-".concat(m))),Z=K.properties.license_servers,V=K.properties.cert,k&&"hls"===q&&"aes-128"===J&&(F.player_profile="hls-js"),t.t15=A,t.t16=A({},U[q]||{}),t.t17={},t.t18=A,t.t19=A({},(U[q]||{}).playoutMethods||{}),t.t20={},t.t21=o,t.t22={},t.t23=J||"clear",!l){t.next=97;break}return t.next=94,this.LinkUrl({versionHash:i,linkPath:u(f,E,z),queryParams:F,noAuth:!0});case 94:t.t24=t.sent,t.next=100;break;case 97:return t.next=99,this.Rep({libraryId:P.libraryId||M,objectId:P.objectId||n,versionHash:P.versionHash||i,rep:u(b,E,z),noAuth:!0,queryParams:F});case 99:t.t24=t.sent;case 100:for(W in t.t25=t.t24,t.t26=J?o({},J,{licenseServers:Z,cert:V}):void 0,t.t27={playoutUrl:t.t25,drms:t.t26},t.t28=(0,t.t21)(t.t22,t.t23,t.t27),t.t29=(0,t.t18)(t.t19,t.t20,t.t28),t.t30={playoutMethods:t.t29},U[q]=(0,t.t15)(t.t16,t.t17,t.t30),U[q].playoutMethods)U[q].playoutMethods[W].drms&&U[q].playoutMethods[W].drms[J]&&U[q].playoutMethods[W].drms[J].cert&&((X=new URL(U[q].playoutMethods[W].playoutUrl)).pathname=X.pathname.split("/").slice(0,-1).concat(["drm.cert"]).join("/"),U[q].playoutMethods[W].drms[J].cert_url=X.toString());if($=y.includes(q),tt=w.includes(J||"clear")||0===w.length&&!J,$&&tt){t.next=112;break}return t.abrupt("continue",113);case 112:(!U[q].playoutUrl||J&&"clear"!==J)&&(U[q].playoutUrl=U[q].playoutMethods[J||"clear"].playoutUrl,U[q].drms=U[q].playoutMethods[J||"clear"].drms);case 113:Y++,t.next=70;break;case 116:return H&&G&&(U.sessionId=G,U.multiview=!0,U.AvailableViews=s(a.mark((function t(){return a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.t0=et.utils,t.next=3,et.HttpClient.Request({path:u("q",P.versionHash||i,"rep",b,E,"views.json"),method:"GET",queryParams:{sid:G,authorization:L}});case 3:return t.t1=t.sent,t.next=6,t.t0.ResponseToFormat.call(t.t0,"json",t.t1);case 6:return t.abrupt("return",t.sent);case 7:case"end":return t.stop()}}),t)}))),U.SwitchView=function(){var t=s(a.mark((function t(e){return a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,et.HttpClient.Request({path:u("q",P.versionHash||i,"rep",b,E,"select_view"),method:"POST",queryParams:{sid:G,authorization:L},body:{view:e}});case 2:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()),this.Log(U),t.abrupt("return",U);case 119:case"end":return t.stop()}}),t,this,[[22,31]])})));return function(e){return t.apply(this,arguments)}}(),e.BitmovinPlayoutOptions=function(){var t=s(a.mark((function t(e){var r,n,i,o,s,c,A,u,f,h,l,d,y,I,b,v,E,m,C,w,B,Q,k,S;return a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=e.objectId,n=e.versionHash,i=e.writeToken,o=e.linkPath,s=e.signedLink,c=void 0!==s&&s,A=e.protocols,u=void 0===A?["dash","hls"]:A,f=e.drms,h=void 0===f?[]:f,l=e.handler,d=void 0===l?"playout":l,y=e.offering,I=void 0===y?"default":y,b=e.playoutType,v=e.context,E=e.authorizationToken,m=e.options,C=void 0===m?{}:m,n?p(n):g(r),r||(r=this.utils.DecodeVersionHash(n).objectId),t.next=5,this.PlayoutOptions({objectId:r,versionHash:n,writeToken:i,linkPath:o,signedLink:c,protocols:u,drms:h,handler:d,offering:I,playoutType:b,hlsjsProfile:!1,context:v,authorizationToken:E,options:C});case 5:return delete(w=t.sent).playoutMethods,t.next=9,this.PlayoutPathResolution({objectId:r,versionHash:n,writeToken:i,linkPath:o,signedLink:c,handler:d,offering:I,authorizationToken:E});case 9:if(B=t.sent,Q=B.linkTarget,k=[],E&&k.push(E),!c&&Q.versionHash){t.next=21;break}return t.t0=k,t.next=17,this.authClient.AuthorizationToken({objectId:r,channelAuth:!0,oauthToken:this.oauthToken});case 17:t.t1=t.sent,t.t0.push.call(t.t0,t.t1),t.next=26;break;case 21:return t.t2=k,t.next=24,this.authClient.AuthorizationToken({libraryId:Q.libraryId,objectId:Q.objectId,channelAuth:!0,oauthToken:this.oauthToken});case 24:t.t3=t.sent,t.t2.push.call(t.t2,t.t3);case 26:return S={drm:{}},Object.keys(w).forEach((function(t){var e=w[t];S[t]=e.playoutUrl,e.drms&&Object.keys(e.drms).forEach((function(t){if(e.drms[t].licenseServers&&0!==e.drms[t].licenseServers.length){var r=function(t){return t.toLowerCase().startsWith("https")},n=e.drms[t].licenseServers;n.find(r)&&(n=n.filter(r));var i=n.sort((function(){return.5-Math.random()}))[0];S.drm[t]||(S.drm[t]={LA_URL:i,headers:{Authorization:"Bearer ".concat(k.flat().filter((function(t){return t})).join(","))}})}}))})),t.abrupt("return",S);case 29:case"end":return t.stop()}}),t,this)})));return function(e){return t.apply(this,arguments)}}(),e.CallBitcodeMethod=function(){var t=s(a.mark((function t(e){var r,n,i,o,s,c,A,f,h,l,d,g,p,y,I,v;return a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=e.libraryId,n=e.objectId,i=e.versionHash,o=e.writeToken,s=e.method,c=e.queryParams,A=void 0===c?{}:c,f=e.body,h=void 0===f?{}:f,l=e.headers,d=void 0===l?{}:l,g=e.constant,p=void 0===g||g,y=e.format,I=void 0===y?"json":y,b({libraryId:r,objectId:n,versionHash:i}),s){t.next=4;break}throw"Bitcode method not specified";case 4:if(i&&(n=this.utils.DecodeVersionHash(i).objectId),v=u("q",o||i||n,"call",s),r&&(v=u("qlibs",r,v)),d.authorization||d.Authorization){t.next=12;break}return t.next=11,this.authClient.AuthorizationHeader({libraryId:r,objectId:n,update:!p});case 11:d.Authorization=t.sent.Authorization;case 12:return this.Log("Calling bitcode method: ".concat(r||""," ").concat(n||i," ").concat(o||"","\n ").concat(p?"GET":"POST"," ").concat(v,"\n Query Params:\n ").concat(JSON.stringify(A||""),"\n Body:\n ").concat(JSON.stringify(h||""),"\n Headers\n ").concat(JSON.stringify(d||""))),t.t0=this.utils,t.t1=I,t.next=17,this.HttpClient.Request({body:h,headers:d,method:p?"GET":"POST",path:v,queryParams:A,allowFailover:!1});case 17:return t.t2=t.sent,t.abrupt("return",t.t0.ResponseToFormat.call(t.t0,t.t1,t.t2));case 19:case"end":return t.stop()}}),t,this)})));return function(e){return t.apply(this,arguments)}}(),e.Rep=function(){var t=s(a.mark((function t(e){var r,n,i,o,s,c,A,u,f,h,l,d,g,p,y,I;return a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=e.libraryId,n=e.objectId,i=e.versionHash,o=e.rep,s=e.queryParams,c=void 0===s?{}:s,A=e.service,u=void 0===A?"fabric":A,f=e.makeAccessRequest,h=void 0!==f&&f,l=e.channelAuth,d=void 0!==l&&l,g=e.noAuth,p=void 0!==g&&g,y=e.noCache,I=void 0!==y&&y,b({libraryId:r,objectId:n,versionHash:i}),o){t.next=4;break}throw"Rep not specified";case 4:return t.abrupt("return",this.FabricUrl({libraryId:r,objectId:n,versionHash:i,rep:o,queryParams:c,service:u,makeAccessRequest:h,channelAuth:d,noAuth:p,noCache:I}));case 5:case"end":return t.stop()}}),t,this)})));return function(e){return t.apply(this,arguments)}}(),e.PublicRep=function(){var t=s(a.mark((function t(e){var r,n,i,o,s,c,A,u;return a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=e.libraryId,n=e.objectId,i=e.versionHash,o=e.rep,s=e.queryParams,c=void 0===s?{}:s,A=e.service,u=void 0===A?"fabric":A,b({libraryId:r,objectId:n,versionHash:i}),o){t.next=4;break}throw"Rep not specified";case 4:return t.abrupt("return",this.FabricUrl({libraryId:r,objectId:n,versionHash:i,publicRep:o,queryParams:c,service:u,noAuth:!0}));case 5:case"end":return t.stop()}}),t,this)})));return function(e){return t.apply(this,arguments)}}(),e.FabricUrl=function(){var t=s(a.mark((function t(e){var r,n,i,o,s,c,f,h,l,d,g,p,y,I,v,E,m,C,w,B,Q,k,S;return a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=e.libraryId,n=e.objectId,i=e.versionHash,o=e.writeToken,s=e.partHash,c=e.rep,f=e.publicRep,h=e.call,l=e.queryParams,d=void 0===l?{}:l,g=e.service,p=void 0===g?"fabric":g,y=e.channelAuth,I=void 0!==y&&y,v=e.makeAccessRequest,E=void 0!==v&&v,m=e.noAuth,C=void 0!==m&&m,w=e.noCache,B=void 0!==w&&w,(n||i)&&b({libraryId:r,objectId:n,versionHash:i}),i&&(n=this.utils.DecodeVersionHash(i).objectId),this.Log("Building Fabric URL:\n libraryId: ".concat(r,"\n objectId: ").concat(n,"\n versionHash: ").concat(i,"\n writeToken: ").concat(o,"\n partHash: ").concat(s,"\n rep: ").concat(c,"\n publicRep: ").concat(f,"\n call: ").concat(h,"\n channelAuth: ").concat(I,"\n noAuth: ").concat(C,"\n noCache: ").concat(B,"\n queryParams: ").concat(JSON.stringify(d||{},null,2))),Q=[],d.authorization&&Q.push(d.authorization),C&&d.authorization){t.next=12;break}return t.t0=Q,t.next=10,this.authClient.AuthorizationToken({libraryId:r,objectId:n,versionHash:i,channelAuth:I,makeAccessRequest:E,noAuth:C,noCache:B});case 10:t.t1=t.sent,t.t0.push.call(t.t0,t.t1);case 12:if(d=A(A({},d),{},{authorization:Q.flat()}),!c&&!f||!n||i){t.next=17;break}return t.next=16,this.LatestVersionHash({objectId:n});case 16:i=t.sent;case 17:return k="",r?(k=u(k,"qlibs",r),(n||i)&&(k=u(k,"q",o||i||n))):i&&(k=u("q",i)),s?k=u(k,"data",s):c?k=u(k,"rep",c):f?k=u(k,"public",f):h&&(k=u(k,"call",h)),S=this.HttpClient,"search"===p?S=this.SearchHttpClient:"auth"===p&&(S=this.AuthHttpClient),t.abrupt("return",S.URL({path:k,queryParams:d}));case 23:case"end":return t.stop()}}),t,this)})));return function(e){return t.apply(this,arguments)}}(),e.FileUrl=function(){var t=s(a.mark((function t(e){var r,n,i,o,s,c,f,h,l,d,g,p;return a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=e.libraryId,n=e.objectId,i=e.versionHash,o=e.writeToken,s=e.filePath,c=e.queryParams,f=void 0===c?{}:c,h=e.noCache,l=void 0!==h&&h,b({libraryId:r,objectId:n,versionHash:i}),s){t.next=4;break}throw"File path not specified";case 4:return i&&(n=this.utils.DecodeVersionHash(i).objectId),d=r?u("qlibs",r,"q",o||i||n):u("q",i),t.next=8,this.authClient.AuthorizationToken({libraryId:r,objectId:n,noCache:l});case 8:return g=t.sent,f=A(A({},f),{},{authorization:g}),t.next=12,this.ContentObjectMetadata({libraryId:r,objectId:n,versionHash:i,writeToken:o,metadataSubtree:u("files",s)});case 12:return p=t.sent,p&&p["."].encryption&&"cgck"===p["."].encryption.scheme?(d=u(d,"rep","files_download",s),f["header-x_decryption_mode"]="decrypt"):d=u(d,"files",s),t.abrupt("return",this.HttpClient.URL({path:d,queryParams:f}));case 16:case"end":return t.stop()}}),t,this)})));return function(e){return t.apply(this,arguments)}}(),e.ContentObjectImageUrl=function(){var t=s(a.mark((function t(e){var r,n,i,o,s,c,A;return a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=e.libraryId,n=e.objectId,i=e.versionHash,o=e.height,s=e.imagePath,c=void 0===s?"public/display_image":s,b({libraryId:r,objectId:n,versionHash:i}),i){t.next=6;break}return t.next=5,this.LatestVersionHash({objectId:n});case 5:i=t.sent;case 6:if(this.Log("Retrieving content object image url: ".concat(r," ").concat(n," ").concat(i)),this.objectImageUrls[i]){t.next=26;break}return t.prev=8,t.next=11,this.ContentObjectMetadata({versionHash:i,metadataSubtree:c});case 11:if(t.sent){t.next=15;break}return this.Log("No image url set: ".concat(r," ").concat(n," ").concat(i)),t.abrupt("return");case 15:t.next=21;break;case 17:t.prev=17,t.t0=t.catch(8),this.Log("Unable to query for image metadata: ".concat(r," ").concat(n," ").concat(i),!0),this.Log(t.t0,!0);case 21:return A={},o&&!isNaN(parseInt(o))&&(A.height=parseInt(o)),t.next=25,this.LinkUrl({versionHash:i,linkPath:c,queryParams:A});case 25:this.objectImageUrls[i]=t.sent;case 26:return t.abrupt("return",this.objectImageUrls[i]);case 27:case"end":return t.stop()}}),t,this,[[8,17]])})));return function(e){return t.apply(this,arguments)}}(),e.ContentObjectGraph=function(){var t=s(a.mark((function t(e){var r,n,i,o,c,A,f,h,l,d,g=this;return a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=e.libraryId,n=e.objectId,i=e.versionHash,o=e.autoUpdate,c=void 0!==o&&o,A=e.select,b({libraryId:r,objectId:n,versionHash:i}),this.Log("Retrieving content object graph: ".concat(r||""," ").concat(n||i)),i&&(n=this.utils.DecodeVersionHash(i).objectId),f=u("q",i||n,"links"),t.prev=5,t.t0=this.utils,t.t1=this.HttpClient,t.next=10,this.authClient.AuthorizationHeader({libraryId:r,objectId:n,versionHash:i});case 10:return t.t2=t.sent,t.t3={auto_update:c,select:A},t.t4=f,t.t5={headers:t.t2,queryParams:t.t3,method:"GET",path:t.t4},t.t6=t.t1.Request.call(t.t1,t.t5),t.next=17,t.t0.ResponseToJson.call(t.t0,t.t6);case 17:return t.abrupt("return",t.sent);case 20:if(t.prev=20,t.t7=t.catch(5),t.prev=22,(l=t.t7.body.errors[0].cause.cause.cause.cycle)&&0!==l.length){t.next=26;break}throw t.t7;case 26:return d={},t.next=29,Promise.all(l.map(function(){var t=s(a.mark((function t(e){var r,n;return a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!d[e]){t.next=2;break}return t.abrupt("return");case 2:return r=g.utils.DecodeVersionHash(e).objectId,t.next=5,g.ContentObjectMetadata({versionHash:e,metadataSubtree:"public/asset_metadata/display_title"});case 5:if(t.t2=t.sent,t.t2){t.next=10;break}return t.next=9,g.ContentObjectMetadata({versionHash:e,metadataSubtree:"public/name"});case 9:t.t2=t.sent;case 10:if(t.t1=t.t2,t.t1){t.next=15;break}return t.next=14,g.ContentObjectMetadata({versionHash:e,metadataSubtree:"name"});case 14:t.t1=t.sent;case 15:if(t.t0=t.t1,t.t0){t.next=18;break}t.t0=r;case 18:n=t.t0,d[e]={name:n,objectId:r};case 20:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()));case 29:h=l.map((function(t){return"".concat(d[t].name," (").concat(d[t].objectId,")")})),t.next=35;break;case 32:throw t.prev=32,t.t8=t.catch(22),t.t7;case 35:throw new Error("Cycle found in links: ".concat(h.join(" -> ")));case 36:case"end":return t.stop()}}),t,this,[[5,20],[22,32]])})));return function(e){return t.apply(this,arguments)}}(),e.LinkTarget=function(){var t=s(a.mark((function t(e){var r,n,o,s,c,A,u,f,h;return a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=e.libraryId,n=e.objectId,o=e.versionHash,s=e.writeToken,c=e.linkPath,A=e.authorizationToken,u=e.linkInfo,b({libraryId:r,objectId:n,versionHash:o}),s&&I(s),o&&(n=this.utils.DecodeVersionHash(o).objectId),!s||r){t.next=8;break}return t.next=7,this.ContentObjectLibraryId({objectId:n});case 7:r=t.sent;case 8:if(u){t.next=12;break}return t.next=11,this.ContentObjectMetadata({libraryId:r,objectId:n,versionHash:o,writeToken:s,metadataSubtree:c,resolveLinks:!1,resolveIgnoreErrors:!0,resolveIncludeSource:!0,authorizationToken:A});case 11:u=t.sent;case 12:if(!u||!u["/"]){t.next=27;break}if((f=((u["/"]||"").match(/^\/?qfab\/([\w]+)\/?.+/)||[])[1])||(f=u["."].container),!f){t.next=19;break}return t.abrupt("return",f);case 19:if(!o){t.next=21;break}return t.abrupt("return",o);case 21:if(t.t0=o,t.t0){t.next=26;break}return t.next=25,this.LatestVersionHash({objectId:n});case 25:t.t0=t.sent;case 26:return t.abrupt("return",t.t0);case 27:return t.next=29,this.ContentObjectMetadata({libraryId:r,objectId:n,versionHash:o,writeToken:s,metadataSubtree:c,resolveIncludeSource:!0,authorizationToken:A});case 29:if((u=t.sent)&&u["."]){t.next=49;break}if("object"!==i(u)){t.next=38;break}if(t.t1=o,t.t1){t.next=37;break}return t.next=36,this.LatestVersionHash({objectId:n});case 36:t.t1=t.sent;case 37:return t.abrupt("return",t.t1);case 38:if(h=c.split("/").slice(0,-1).join("/")){t.next=46;break}if(t.t2=o,t.t2){t.next=45;break}return t.next=44,this.LatestVersionHash({objectId:n});case 44:t.t2=t.sent;case 45:return t.abrupt("return",t.t2);case 46:return t.next=48,this.ContentObjectMetadata({libraryId:r,objectId:n,versionHash:o,writeToken:s,metadataSubtree:h,resolveIncludeSource:!0,authorizationToken:A});case 48:u=t.sent;case 49:return t.abrupt("return",u["."].source);case 50:case"end":return t.stop()}}),t,this)})));return function(e){return t.apply(this,arguments)}}(),e.LinkUrl=function(){var t=s(a.mark((function t(e){var r,n,i,o,s,c,f,h,l,d,g,p,y,v,E;return a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=e.libraryId,n=e.objectId,i=e.versionHash,o=e.writeToken,s=e.linkPath,c=e.mimeType,f=e.authorizationToken,h=e.queryParams,l=void 0===h?{}:h,d=e.channelAuth,g=void 0!==d&&d,p=e.noAuth,y=void 0!==p&&p,b({libraryId:r,objectId:n,versionHash:i}),o&&I(o),s){t.next=5;break}throw Error("Link path not specified");case 5:return i&&(n=this.utils.DecodeVersionHash(i).objectId),v=r?u("qlibs",r,"q",o||i||n,"meta",s):u("q",i,"meta",s),E=[f],t.t0=E,t.next=11,this.MetadataAuth({libraryId:r,objectId:n,versionHash:i,path:s,channelAuth:g,noAuth:y});case 11:return t.t1=t.sent,t.t0.push.call(t.t0,t.t1),l.authorization&&E.push(l.authorization),l=A(A({},l),{},{authorization:E.flat().filter((function(t){return t})),resolve:!0}),c&&(l["header-accept"]=c),t.abrupt("return",this.HttpClient.URL({path:v,queryParams:l}));case 17:case"end":return t.stop()}}),t,this)})));return function(e){return t.apply(this,arguments)}}(),e.LinkData=function(){var t=s(a.mark((function t(e){var r,n,i,o,s,c,A,u,f,l,d;return a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=e.libraryId,n=e.objectId,i=e.versionHash,o=e.writeToken,s=e.linkPath,c=e.queryParams,A=void 0===c?{}:c,u=e.format,f=void 0===u?"json":u,l=e.channelAuth,t.next=3,this.LinkUrl({libraryId:r,objectId:n,versionHash:i,writeToken:o,linkPath:s,queryParams:A,channelAuth:l});case 3:return d=t.sent,t.t0=this.utils,t.t1=f,t.next=8,h.Fetch(d);case 8:return t.t2=t.sent,t.abrupt("return",t.t0.ResponseToFormat.call(t.t0,t.t1,t.t2));case 10:case"end":return t.stop()}}),t,this)})));return function(e){return t.apply(this,arguments)}}(),e.CreateEncryptionConk=function(){var t=s(a.mark((function t(e){var r,n,i,o,s,c,A,u,f,h,l;return a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=e.libraryId,n=e.objectId,i=e.versionHash,o=e.writeToken,s=e.createKMSConk,c=void 0===s||s,!this.signer.remoteSigner){t.next=3;break}return t.abrupt("return");case 3:if(b({libraryId:r,objectId:n,versionHash:i}),I(o),n||(n=client.DecodeVersionHash(i).objectId),r){t.next=10;break}return t.next=9,this.ContentObjectLibraryId({objectId:n});case 9:r=t.sent;case 10:return A="eluv.caps.iusr".concat(this.utils.AddressToHash(this.signer.address)),t.next=13,this.ContentObjectMetadata({libraryId:r,objectId:n,writeToken:o,metadataSubtree:A});case 13:if(!(u=t.sent)){t.next=20;break}return t.next=17,this.Crypto.DecryptCap(u,this.signer._signingKey().privateKey);case 17:this.encryptionConks[n]=t.sent,t.next=34;break;case 20:return t.next=22,this.Crypto.GeneratePrimaryConk({spaceId:this.contentSpaceId,objectId:n});case 22:return this.encryptionConks[n]=t.sent,t.t0=this,t.t1=r,t.t2=n,t.t3=o,t.t4=A,t.next=30,this.Crypto.EncryptConk(this.encryptionConks[n],this.signer._signingKey().publicKey);case 30:return t.t5=t.sent,t.t6={libraryId:t.t1,objectId:t.t2,writeToken:t.t3,metadataSubtree:t.t4,metadata:t.t5},t.next=34,t.t0.ReplaceMetadata.call(t.t0,t.t6);case 34:if(!c){t.next=64;break}return t.prev=35,t.next=38,this.authClient.KMSAddress({objectId:n});case 38:return f=t.sent,t.next=41,this.authClient.KMSInfo({objectId:n});case 41:return h=t.sent.publicKey,l="eluv.caps.ikms".concat(this.utils.AddressToHash(f)),t.next=45,this.ContentObjectMetadata({libraryId:r,objectId:n,writeToken:o,metadataSubtree:l});case 45:if(t.sent){t.next=58;break}return t.t7=this,t.t8=r,t.t9=n,t.t10=o,t.t11=l,t.next=54,this.Crypto.EncryptConk(this.encryptionConks[n],h);case 54:return t.t12=t.sent,t.t13={libraryId:t.t8,objectId:t.t9,writeToken:t.t10,metadataSubtree:t.t11,metadata:t.t12},t.next=58,t.t7.ReplaceMetadata.call(t.t7,t.t13);case 58:t.next=64;break;case 60:t.prev=60,t.t14=t.catch(35),console.error("Failed to create encryption cap for KMS:"),console.error(t.t14);case 64:return t.abrupt("return",this.encryptionConks[n]);case 65:case"end":return t.stop()}}),t,this,[[35,60]])})));return function(e){return t.apply(this,arguments)}}(),e.EncryptionConk=function(){var t=s(a.mark((function t(e){var r,n,i,o,s,c,A,u,f,h,l;return a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=e.libraryId,n=e.objectId,i=e.versionHash,o=e.writeToken,s=e.download,c=void 0!==s&&s,b({libraryId:r,objectId:n,versionHash:i}),o&&I(o),n||(n=client.DecodeVersionHash(i).objectId),t.next=6,this.authClient.Owner({id:n});case 6:return A=t.sent,u="eluv.caps.iusr".concat(this.utils.AddressToHash(this.signer.address)),t.next=10,this.ContentObjectMetadata({libraryId:r,objectId:n,versionHash:i,metadataSubtree:u});case 10:if(f=t.sent,this.utils.EqualAddress(A,this.signer.address)||f){t.next=21;break}if(!c){t.next=18;break}return t.next=15,this.authClient.ReEncryptionConk({libraryId:r,objectId:n,versionHash:i});case 15:return t.abrupt("return",t.sent);case 18:return t.next=20,this.authClient.EncryptionConk({libraryId:r,objectId:n,versionHash:i});case 20:return t.abrupt("return",t.sent);case 21:if(this.encryptionConks[n]){t.next=38;break}return h="eluv.caps.iusr".concat(this.utils.AddressToHash(this.signer.address)),t.next=25,this.ContentObjectMetadata({libraryId:r,objectId:n,versionHash:i,writeToken:o,metadataSubtree:h});case 25:if(!(l=t.sent)){t.next=32;break}return t.next=29,this.Crypto.DecryptCap(l,this.signer._signingKey().privateKey);case 29:this.encryptionConks[n]=t.sent,t.next=38;break;case 32:if(!o){t.next=37;break}return t.next=35,this.CreateEncryptionConk({libraryId:r,objectId:n,versionHash:i,writeToken:o,createKMSConk:!1});case 35:t.next=38;break;case 37:throw"No encryption conk present for "+n;case 38:return t.abrupt("return",this.encryptionConks[n]);case 39:case"end":return t.stop()}}),t,this)})));return function(e){return t.apply(this,arguments)}}(),e.Encrypt=function(){var t=s(a.mark((function t(e){var r,n,i,o,s,c;return a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=e.libraryId,n=e.objectId,i=e.writeToken,o=e.chunk,b({libraryId:r,objectId:n}),t.next=4,this.EncryptionConk({libraryId:r,objectId:n,writeToken:i});case 4:return s=t.sent,t.next=7,this.Crypto.Encrypt(s,o);case 7:return c=t.sent,t.abrupt("return",c.buffer.slice(c.byteOffset,c.byteOffset+c.byteLength));case 9:case"end":return t.stop()}}),t,this)})));return function(e){return t.apply(this,arguments)}}(),e.Decrypt=function(){var t=s(a.mark((function t(e){var r,n,i,o,s,c;return a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=e.libraryId,n=e.objectId,i=e.writeToken,o=e.chunk,b({libraryId:r,objectId:n}),t.next=4,this.EncryptionConk({libraryId:r,objectId:n,writeToken:i,download:!0});case 4:return s=t.sent,t.next=7,this.Crypto.Decrypt(s,o);case 7:return c=t.sent,t.abrupt("return",c.buffer.slice(c.byteOffset,c.byteOffset+c.byteLength));case 9:case"end":return t.stop()}}),t,this)})));return function(e){return t.apply(this,arguments)}}(),e.AccessType=function(){var t=s(a.mark((function t(e){var r;return a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=e.id,t.next=3,this.authClient.AccessType(r);case 3:return t.abrupt("return",t.sent);case 4:case"end":return t.stop()}}),t,this)})));return function(e){return t.apply(this,arguments)}}(),e.AccessInfo=function(){var t=s(a.mark((function t(e){var r,n,i;return a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=e.objectId,n=e.args,g(r),n||(n=[0,[],[]]),this.Log("Retrieving access info: ".concat(r)),t.next=6,this.ethClient.CallContractMethod({contractAddress:this.utils.HashToAddress(r),methodName:"getAccessInfo",methodArgs:n});case 6:return i=t.sent,this.Log(i),t.abrupt("return",{visibilityCode:i[0],visible:i[0]>=1,accessible:i[0]>=10,editable:i[0]>=100,hasAccess:0===i[1],accessCode:i[1],accessCharge:this.utils.WeiToEther(i[2]).toString()});case 9:case"end":return t.stop()}}),t,this)})));return function(e){return t.apply(this,arguments)}}(),e.AccessRequest=function(){var t=s(a.mark((function t(e){var r,n,i,o,s,c,A,u,f;return a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=e.libraryId,n=e.objectId,i=e.versionHash,o=e.args,s=void 0===o?[]:o,c=e.update,A=void 0!==c&&c,u=e.noCache,f=void 0!==u&&u,b({libraryId:r,objectId:n,versionHash:i}),i&&(n=this.utils.DecodeVersionHash(i).objectId),t.next=5,this.authClient.MakeAccessRequest({libraryId:r,objectId:n,versionHash:i,args:s,update:A,skipCache:!0,noCache:f});case 5:return t.abrupt("return",t.sent);case 6:case"end":return t.stop()}}),t,this)})));return function(e){return t.apply(this,arguments)}}(),e.SetAuthContext=function(t){var e=t.context;if(e&&Object.values(e).find((function(t){return"string"!=typeof t})))throw Error("Context must be a map of string->string");this.authContext=e},e.GenerateStateChannelToken=function(){var t=s(a.mark((function t(e){var r,n,i,o,s;return a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=e.objectId,n=e.versionHash,i=e.context,o=e.noCache,s=void 0!==o&&o,n?p(n):g(r),!n){t.next=6;break}r=this.utils.DecodeVersionHash(n).objectId,t.next=10;break;case 6:if(this.stateChannelAccess[r]){t.next=10;break}return t.next=9,this.LatestVersionHash({objectId:r});case 9:n=t.sent;case 10:return this.stateChannelAccess[r]=n,t.next=13,this.authClient.AuthorizationToken({objectId:r,channelAuth:!0,oauthToken:this.oauthToken,context:i,noCache:s});case 13:return t.abrupt("return",t.sent);case 14:case"end":return t.stop()}}),t,this)})));return function(e){return t.apply(this,arguments)}}(),e.FinalizeStateChannelAccess=function(){var t=s(a.mark((function t(e){var r,n,i;return a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=e.objectId,n=e.versionHash,i=e.percentComplete,n?p(n):g(r),!n){t.next=6;break}r=this.utils.DecodeVersionHash(n).objectId,t.next=13;break;case 6:if(!this.stateChannelAccess[r]){t.next=10;break}n=this.stateChannelAccess[r],t.next=13;break;case 10:return t.next=12,this.LatestVersionHash({objectId:r});case 12:n=t.sent;case 13:return this.stateChannelAccess[r]=void 0,t.next=16,this.authClient.ChannelContentFinalize({objectId:r,versionHash:n,percent:i});case 16:case"end":return t.stop()}}),t,this)})));return function(e){return t.apply(this,arguments)}}(),e.ContentObjectAccessComplete=function(){var t=s(a.mark((function t(e){var r,n,i;return a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=e.objectId,n=e.score,i=void 0===n?100:n,g(r),!(i<0||i>100)){t.next=4;break}throw Error("Invalid AccessComplete score: "+i);case 4:return t.next=6,this.authClient.AccessComplete({id:r,score:i});case 6:return t.abrupt("return",t.sent);case 7:case"end":return t.stop()}}),t,this)})));return function(e){return t.apply(this,arguments)}}(),e.Collection=function(){var t=s(a.mark((function t(e){var r;return a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=e.collectionType,["accessGroups","contentObjects","contentTypes","contracts","libraries"].includes(r)){t.next=4;break}throw new Error("Invalid collection type: "+r);case 4:if(!this.signer){t.next=10;break}return t.next=7,this.userProfileClient.WalletAddress();case 7:t.t0=t.sent,t.next=11;break;case 10:t.t0=void 0;case 11:if(t.t0){t.next=14;break}throw new Error("Unable to get collection: User wallet doesn't exist");case 14:return this.Log("Retrieving ".concat(r," contract collection for user ").concat(this.signer.address)),t.next=17,this.ethClient.MakeProviderCall({methodName:"send",args:["elv_getWalletCollection",[this.contentSpaceId,"iusr".concat(this.utils.AddressToHash(this.signer.address)),r]]});case 17:if(t.t1=t.sent,t.t1){t.next=20;break}t.t1=[];case 20:return t.abrupt("return",t.t1);case 21:case"end":return t.stop()}}),t,this)})));return function(e){return t.apply(this,arguments)}}(),e.VerifyContentObject=function(){var t=s(a.mark((function t(e){var r,n,i;return a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=e.libraryId,n=e.objectId,i=e.versionHash,b({libraryId:r,objectId:n,versionHash:i}),t.next=4,ContentObjectVerification.VerifyContentObject({client:this,libraryId:r,objectId:n,versionHash:i});case 4:return t.abrupt("return",t.sent);case 5:case"end":return t.stop()}}),t,this)})));return function(e){return t.apply(this,arguments)}}(),e.Proofs=function(){var t=s(a.mark((function t(e){var r,n,i,o,s;return a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=e.libraryId,n=e.objectId,i=e.versionHash,o=e.partHash,b({libraryId:r,objectId:n,versionHash:i}),y(o),i&&(n=this.utils.DecodeVersionHash(i).objectId),s=u("q",i||n,"data",o,"proofs"),t.t0=this.utils,t.t1=this.HttpClient,t.next=9,this.authClient.AuthorizationHeader({libraryId:r,objectId:n,versionHash:i});case 9:return t.t2=t.sent,t.t3=s,t.t4={headers:t.t2,method:"GET",path:t.t3},t.t5=t.t1.Request.call(t.t1,t.t4),t.abrupt("return",t.t0.ResponseToJson.call(t.t0,t.t5));case 14:case"end":return t.stop()}}),t,this)})));return function(e){return t.apply(this,arguments)}}(),e.QParts=function(){var t=s(a.mark((function t(e){var r,n,i,o,s,c;return a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=e.libraryId,n=e.objectId,i=e.partHash,o=e.format,s=void 0===o?"blob":o,b({libraryId:r,objectId:n,versionHash:versionHash}),y(i),c=u("qparts",i),t.t0=this.utils,t.t1=s,t.t2=this.HttpClient,t.next=9,this.authClient.AuthorizationHeader({libraryId:r,objectId:n,partHash:i});case 9:return t.t3=t.sent,t.t4=c,t.t5={headers:t.t3,method:"GET",path:t.t4},t.t6=t.t2.Request.call(t.t2,t.t5),t.abrupt("return",t.t0.ResponseToFormat.call(t.t0,t.t1,t.t6));case 14:case"end":return t.stop()}}),t,this)})));return function(e){return t.apply(this,arguments)}}()},function(t,e,r){(function(t){var r,n,i;function o(t){return(o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}!function(a,s){"use strict";"object"===o(t)&&"object"===o(t.exports)?t.exports=s():(n=[],void 0===(i="function"==typeof(r=s)?r.apply(e,n):r)||(t.exports=i))}(0,(function(){"use strict";var t=Object.prototype.toString;function e(t,e){return null!=t&&Object.prototype.hasOwnProperty.call(t,e)}function r(t){if(!t)return!0;if(i(t)&&0===t.length)return!0;if("string"!=typeof t){for(var r in t)if(e(t,r))return!1;return!0}return!1}function n(e){return t.call(e)}var i=Array.isArray||function(e){return"[object Array]"===t.call(e)};function a(t){var e=parseInt(t);return e.toString()===t?e:t}function s(t){var s,c,A=function t(e){return Object.keys(t).reduce((function(r,n){return"create"===n||"function"==typeof t[n]&&(r[n]=t[n].bind(t,e)),r}),{})};function u(t,e){if(s(t,e))return t[e]}function f(t,e,r,n){if("number"==typeof e&&(e=[e]),!e||0===e.length)return t;if("string"==typeof e)return f(t,e.split(".").map(a),r,n);var i=e[0],o=c(t,i);return 1===e.length?(void 0!==o&&n||(t[i]=r),o):(void 0===o&&("number"==typeof e[1]?t[i]=[]:t[i]={}),f(t[i],e.slice(1),r,n))}return s=(t=t||{}).includeInheritedProps?function(){return!0}:function(t,r){return"number"==typeof r&&Array.isArray(t)||e(t,r)},c=t.includeInheritedProps?function(t,e){"string"!=typeof e&&"number"!=typeof e&&(e=String(e));var r=u(t,e);if("__proto__"===e||"prototype"===e||"constructor"===e&&"function"==typeof r)throw new Error("For security reasons, object's magic properties cannot be set");return r}:function(t,e){return u(t,e)},A.has=function(r,n){if("number"==typeof n?n=[n]:"string"==typeof n&&(n=n.split(".")),!n||0===n.length)return!!r;for(var o=0;o<n.length;o++){var s=a(n[o]);if(!("number"==typeof s&&i(r)&&s<r.length||(t.includeInheritedProps?s in Object(r):e(r,s))))return!1;r=r[s]}return!0},A.ensureExists=function(t,e,r){return f(t,e,r,!0)},A.set=function(t,e,r,n){return f(t,e,r,n)},A.insert=function(t,e,r,n){var o=A.get(t,e);n=~~n,i(o)||A.set(t,e,o=[]),o.splice(n,0,r)},A.empty=function(t,e){var a,c;if(!r(e)&&(null!=t&&(a=A.get(t,e)))){if("string"==typeof a)return A.set(t,e,"");if(function(t){return"boolean"==typeof t||"[object Boolean]"===n(t)}(a))return A.set(t,e,!1);if("number"==typeof a)return A.set(t,e,0);if(i(a))a.length=0;else{if(!function(t){return"object"===o(t)&&"[object Object]"===n(t)}(a))return A.set(t,e,null);for(c in a)s(a,c)&&delete a[c]}}},A.push=function(t,e){var r=A.get(t,e);i(r)||A.set(t,e,r=[]),r.push.apply(r,Array.prototype.slice.call(arguments,2))},A.coalesce=function(t,e,r){for(var n,i=0,o=e.length;i<o;i++)if(void 0!==(n=A.get(t,e[i])))return n;return r},A.get=function(t,e,r){if("number"==typeof e&&(e=[e]),!e||0===e.length)return t;if(null==t)return r;if("string"==typeof e)return A.get(t,e.split("."),r);var n=a(e[0]),i=c(t,n);return void 0===i?r:1===e.length?i:A.get(t[n],e.slice(1),r)},A.del=function(t,e){if("number"==typeof e&&(e=[e]),null==t)return t;if(r(e))return t;if("string"==typeof e)return A.del(t,e.split("."));var n=a(e[0]);return c(t,n),s(t,n)?1!==e.length?A.del(t[n],e.slice(1)):(i(t)?t.splice(n,1):delete t[n],t):t},A}var c=s();return c.create=s,c.withInheritedProps=s({includeInheritedProps:!0}),c}))}).call(this,r(14)(t))},function(t,e,r){var n=r(20),i=r(21),o=r(52),a=r(53),s=r(89),c="undefined"!=typeof fetch?fetch:r(98).default,A=r(99).LogMessage,u=function(){"use strict";function t(e){var r=e.uris,n=e.debug;o(this,t),this.uris=r,this.uriIndex=0,this.debug=n,this.draftURIs={},this.retries=Math.max(3,r.length)}var e;return a(t,[{key:"Log",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];A(this,t,e)}},{key:"BaseURI",value:function(){return new s(this.uris[this.uriIndex])}},{key:"RecordWriteToken",value:function(t,e){if(!e)throw Error("RecordWriteToken() - nodeUrlStr not supplied");if(!t)throw Error("RecordWriteToken() - writeToken not supplied");this.draftURIs[t]=new s(e)}},{key:"RequestHeaders",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return e.Accept||(e.Accept="application/json"),"JSON"===t?e["Content-type"]="application/json":"BINARY"===t&&(e["Content-type"]="application/octet-stream"),e}},{key:"Request",value:(e=i(n.mark((function e(r){var i,o,a,s,c,A,u,f,h,l,d,g,p,y,I,b,v,E,m,C,w,B,Q,k,S,_;return n.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=r.method,o=r.path,a=r.queryParams,s=void 0===a?{}:a,c=r.body,A=r.bodyType,u=void 0===A?"JSON":A,f=r.headers,h=void 0===f?{}:f,l=r.attempts,d=void 0===l?0:l,g=r.allowFailover,p=void 0===g||g,y=r.forceFailover,I=void 0!==y&&y,b=r.allowRetry,v=void 0===b||b,E=this.BaseURI(),m=o.replace(/^\//,"").match(/(qlibs\/ilib[a-zA-Z0-9]+|q|qid)\/(tqw__[a-zA-Z0-9]+)/),(C=m?m[2]:void 0)&&(p=!1,this.draftURIs[C]?E=this.draftURIs[C]:this.draftURIs[C]=E),w=E.path(o).query(s).hash(""),B={method:i,headers:this.RequestHeaders(u,h)},"POST"!==i&&"PUT"!==i&&"DELETE"!==i||(c&&"JSON"===u?B.body=JSON.stringify(c):c&&(B.body=c)),this.Log("".concat(i," - ").concat(w.toString())),e.prev=9,e.next=12,t.Fetch(w.toString(),B);case 12:Q=e.sent,e.next=18;break;case 15:e.prev=15,e.t0=e.catch(9),Q={ok:!1,status:500,statusText:"ElvClient Error: "+e.t0.message,url:w.toString(),stack:e.t0.stack};case 18:if(Q.ok){e.next=47;break}if(!((parseInt(Q.status)>=500||I)&&v&&d<this.retries)){e.next=31;break}if(!p){e.next=25;break}this.uriIndex=(this.uriIndex+1)%this.uris.length,this.Log("HttpClient failing over from ".concat(E.toString(),": ").concat(d+1," attempts"),!0),e.next=28;break;case 25:return this.Log("HttpClient retrying request from ".concat(E.toString(),": ").concat(d+1," attempts"),!0),e.next=28,new Promise((function(t){return setTimeout(t,1e3)}));case 28:return e.next=30,this.Request({method:i,path:o,queryParams:s,body:c,bodyType:u,headers:h,attempts:d+1,forceFailover:I});case 30:return e.abrupt("return",e.sent);case 31:if(k=Q.headers&&Q.headers.get("content-type")||"",S="",!Q.text||!Q.json){e.next=44;break}if(!k.includes("application/json")){e.next=40;break}return e.next=37,Q.json();case 37:e.t1=e.sent,e.next=43;break;case 40:return e.next=42,Q.text();case 42:e.t1=e.sent;case 43:S=e.t1;case 44:throw _={name:"ElvHttpClientError",status:Q.status,statusText:Q.statusText,message:Q.statusText,url:w.toString(),body:S,requestParams:B},this.Log(JSON.stringify(_,null,2),!0),_;case 47:return this.Log("".concat(Q.status," - ").concat(i," ").concat(w.toString())),e.abrupt("return",Q);case 49:case"end":return e.stop()}}),e,this,[[9,15]])}))),function(t){return e.apply(this,arguments)})},{key:"URL",value:function(t){var e=t.path,r=t.queryParams,n=void 0===r?{}:r;return this.BaseURI().path(e).query(n).hash("").toString()}}],[{key:"Fetch",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return c(t,e)}}]),t}();t.exports=u},function(t,e,r){var n=r(202),i=r(259)((function(t,e,r,i){n(t,e,r,i)}));t.exports=i},function(t,e,r){var n=r(203),i=r(104),o=r(234),a=r(236),s=r(17),c=r(114),A=r(113);t.exports=function t(e,r,u,f,h){e!==r&&o(r,(function(o,c){if(h||(h=new n),s(o))a(e,r,c,u,t,f,h);else{var l=f?f(A(e,c),o,c+"",e,r,h):void 0;void 0===l&&(l=o),i(e,c,l)}}),c)}},function(t,e,r){var n=r(39),i=r(209),o=r(210),a=r(211),s=r(212),c=r(213);function A(t){var e=this.__data__=new n(t);this.size=e.size}A.prototype.clear=i,A.prototype.delete=o,A.prototype.get=a,A.prototype.has=s,A.prototype.set=c,t.exports=A},function(t,e){t.exports=function(){this.__data__=[],this.size=0}},function(t,e,r){var n=r(40),i=Array.prototype.splice;t.exports=function(t){var e=this.__data__,r=n(e,t);return!(r<0)&&(r==e.length-1?e.pop():i.call(e,r,1),--this.size,!0)}},function(t,e,r){var n=r(40);t.exports=function(t){var e=this.__data__,r=n(e,t);return r<0?void 0:e[r][1]}},function(t,e,r){var n=r(40);t.exports=function(t){return n(this.__data__,t)>-1}},function(t,e,r){var n=r(40);t.exports=function(t,e){var r=this.__data__,i=n(r,t);return i<0?(++this.size,r.push([t,e])):r[i][1]=e,this}},function(t,e,r){var n=r(39);t.exports=function(){this.__data__=new n,this.size=0}},function(t,e){t.exports=function(t){var e=this.__data__,r=e.delete(t);return this.size=e.size,r}},function(t,e){t.exports=function(t){return this.__data__.get(t)}},function(t,e){t.exports=function(t){return this.__data__.has(t)}},function(t,e,r){var n=r(39),i=r(101),o=r(221);t.exports=function(t,e){var r=this.__data__;if(r instanceof n){var a=r.__data__;if(!i||a.length<199)return a.push([t,e]),this.size=++r.size,this;r=this.__data__=new o(a)}return r.set(t,e),this.size=r.size,this}},function(t,e,r){var n=r(56),i=r(217),o=r(17),a=r(219),s=/^\[object .+?Constructor\]$/,c=Function.prototype,A=Object.prototype,u=c.toString,f=A.hasOwnProperty,h=RegExp("^"+u.call(f).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");t.exports=function(t){return!(!o(t)||i(t))&&(n(t)?h:s).test(a(t))}},function(t,e,r){var n=r(102),i=Object.prototype,o=i.hasOwnProperty,a=i.toString,s=n?n.toStringTag:void 0;t.exports=function(t){var e=o.call(t,s),r=t[s];try{t[s]=void 0;var n=!0}catch(t){}var i=a.call(t);return n&&(e?t[s]=r:delete t[s]),i}},function(t,e){var r=Object.prototype.toString;t.exports=function(t){return r.call(t)}},function(t,e,r){var n,i=r(218),o=(n=/[^.]+$/.exec(i&&i.keys&&i.keys.IE_PROTO||""))?"Symbol(src)_1."+n:"";t.exports=function(t){return!!o&&o in t}},function(t,e,r){var n=r(22)["__core-js_shared__"];t.exports=n},function(t,e){var r=Function.prototype.toString;t.exports=function(t){if(null!=t){try{return r.call(t)}catch(t){}try{return t+""}catch(t){}}return""}},function(t,e){t.exports=function(t,e){return null==t?void 0:t[e]}},function(t,e,r){var n=r(222),i=r(229),o=r(231),a=r(232),s=r(233);function c(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}c.prototype.clear=n,c.prototype.delete=i,c.prototype.get=o,c.prototype.has=a,c.prototype.set=s,t.exports=c},function(t,e,r){var n=r(223),i=r(39),o=r(101);t.exports=function(){this.size=0,this.__data__={hash:new n,map:new(o||i),string:new n}}},function(t,e,r){var n=r(224),i=r(225),o=r(226),a=r(227),s=r(228);function c(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}c.prototype.clear=n,c.prototype.delete=i,c.prototype.get=o,c.prototype.has=a,c.prototype.set=s,t.exports=c},function(t,e,r){var n=r(43);t.exports=function(){this.__data__=n?n(null):{},this.size=0}},function(t,e){t.exports=function(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}},function(t,e,r){var n=r(43),i=Object.prototype.hasOwnProperty;t.exports=function(t){var e=this.__data__;if(n){var r=e[t];return"__lodash_hash_undefined__"===r?void 0:r}return i.call(e,t)?e[t]:void 0}},function(t,e,r){var n=r(43),i=Object.prototype.hasOwnProperty;t.exports=function(t){var e=this.__data__;return n?void 0!==e[t]:i.call(e,t)}},function(t,e,r){var n=r(43);t.exports=function(t,e){var r=this.__data__;return this.size+=this.has(t)?0:1,r[t]=n&&void 0===e?"__lodash_hash_undefined__":e,this}},function(t,e,r){var n=r(44);t.exports=function(t){var e=n(this,t).delete(t);return this.size-=e?1:0,e}},function(t,e){function r(t){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}t.exports=function(t){var e=r(t);return"string"==e||"number"==e||"symbol"==e||"boolean"==e?"__proto__"!==t:null===t}},function(t,e,r){var n=r(44);t.exports=function(t){return n(this,t).get(t)}},function(t,e,r){var n=r(44);t.exports=function(t){return n(this,t).has(t)}},function(t,e,r){var n=r(44);t.exports=function(t,e){var r=n(this,t),i=r.size;return r.set(t,e),this.size+=r.size==i?0:1,this}},function(t,e,r){var n=r(235)();t.exports=n},function(t,e){t.exports=function(t){return function(e,r,n){for(var i=-1,o=Object(e),a=n(e),s=a.length;s--;){var c=a[t?s:++i];if(!1===r(o[c],c,o))break}return e}}},function(t,e,r){var n=r(104),i=r(237),o=r(238),a=r(241),s=r(242),c=r(108),A=r(109),u=r(246),f=r(111),h=r(56),l=r(17),d=r(248),g=r(112),p=r(113),y=r(252);t.exports=function(t,e,r,I,b,v,E){var m=p(t,r),C=p(e,r),w=E.get(C);if(w)n(t,r,w);else{var B=v?v(m,C,r+"",t,e,E):void 0,Q=void 0===B;if(Q){var k=A(C),S=!k&&f(C),_=!k&&!S&&g(C);B=C,k||S||_?A(m)?B=m:u(m)?B=a(m):S?(Q=!1,B=i(C,!0)):_?(Q=!1,B=o(C,!0)):B=[]:d(C)||c(C)?(B=m,c(m)?B=y(m):l(m)&&!h(m)||(B=s(C))):Q=!1}Q&&(E.set(C,B),b(B,C,I,v,E),E.delete(C)),n(t,r,B)}}},function(t,e,r){(function(t){function n(t){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var i=r(22),o="object"==n(e)&&e&&!e.nodeType&&e,a=o&&"object"==n(t)&&t&&!t.nodeType&&t,s=a&&a.exports===o?i.Buffer:void 0,c=s?s.allocUnsafe:void 0;t.exports=function(t,e){if(e)return t.slice();var r=t.length,n=c?c(r):new t.constructor(r);return t.copy(n),n}}).call(this,r(14)(t))},function(t,e,r){var n=r(239);t.exports=function(t,e){var r=e?n(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.length)}},function(t,e,r){var n=r(240);t.exports=function(t){var e=new t.constructor(t.byteLength);return new n(e).set(new n(t)),e}},function(t,e,r){var n=r(22).Uint8Array;t.exports=n},function(t,e){t.exports=function(t,e){var r=-1,n=t.length;for(e||(e=Array(n));++r<n;)e[r]=t[r];return e}},function(t,e,r){var n=r(243),i=r(106),o=r(107);t.exports=function(t){return"function"!=typeof t.constructor||o(t)?{}:n(i(t))}},function(t,e,r){var n=r(17),i=Object.create,o=function(){function t(){}return function(e){if(!n(e))return{};if(i)return i(e);t.prototype=e;var r=new t;return t.prototype=void 0,r}}();t.exports=o},function(t,e){t.exports=function(t,e){return function(r){return t(e(r))}}},function(t,e,r){var n=r(42),i=r(31);t.exports=function(t){return i(t)&&"[object Arguments]"==n(t)}},function(t,e,r){var n=r(58),i=r(31);t.exports=function(t){return i(t)&&n(t)}},function(t,e){t.exports=function(){return!1}},function(t,e,r){var n=r(42),i=r(106),o=r(31),a=Function.prototype,s=Object.prototype,c=a.toString,A=s.hasOwnProperty,u=c.call(Object);t.exports=function(t){if(!o(t)||"[object Object]"!=n(t))return!1;var e=i(t);if(null===e)return!0;var r=A.call(e,"constructor")&&e.constructor;return"function"==typeof r&&r instanceof r&&c.call(r)==u}},function(t,e,r){var n=r(42),i=r(110),o=r(31),a={};a["[object Float32Array]"]=a["[object Float64Array]"]=a["[object Int8Array]"]=a["[object Int16Array]"]=a["[object Int32Array]"]=a["[object Uint8Array]"]=a["[object Uint8ClampedArray]"]=a["[object Uint16Array]"]=a["[object Uint32Array]"]=!0,a["[object Arguments]"]=a["[object Array]"]=a["[object ArrayBuffer]"]=a["[object Boolean]"]=a["[object DataView]"]=a["[object Date]"]=a["[object Error]"]=a["[object Function]"]=a["[object Map]"]=a["[object Number]"]=a["[object Object]"]=a["[object RegExp]"]=a["[object Set]"]=a["[object String]"]=a["[object WeakMap]"]=!1,t.exports=function(t){return o(t)&&i(t.length)&&!!a[n(t)]}},function(t,e){t.exports=function(t){return function(e){return t(e)}}},function(t,e,r){(function(t){function n(t){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var i=r(103),o="object"==n(e)&&e&&!e.nodeType&&e,a=o&&"object"==n(t)&&t&&!t.nodeType&&t,s=a&&a.exports===o&&i.process,c=function(){try{var t=a&&a.require&&a.require("util").types;return t||s&&s.binding&&s.binding("util")}catch(t){}}();t.exports=c}).call(this,r(14)(t))},function(t,e,r){var n=r(253),i=r(114);t.exports=function(t){return n(t,i(t))}},function(t,e,r){var n=r(254),i=r(57);t.exports=function(t,e,r,o){var a=!r;r||(r={});for(var s=-1,c=e.length;++s<c;){var A=e[s],u=o?o(r[A],t[A],A,r,t):void 0;void 0===u&&(u=t[A]),a?i(r,A,u):n(r,A,u)}return r}},function(t,e,r){var n=r(57),i=r(41),o=Object.prototype.hasOwnProperty;t.exports=function(t,e,r){var a=t[e];o.call(t,e)&&i(a,r)&&(void 0!==r||e in t)||n(t,e,r)}},function(t,e,r){var n=r(256),i=r(108),o=r(109),a=r(111),s=r(115),c=r(112),A=Object.prototype.hasOwnProperty;t.exports=function(t,e){var r=o(t),u=!r&&i(t),f=!r&&!u&&a(t),h=!r&&!u&&!f&&c(t),l=r||u||f||h,d=l?n(t.length,String):[],g=d.length;for(var p in t)!e&&!A.call(t,p)||l&&("length"==p||f&&("offset"==p||"parent"==p)||h&&("buffer"==p||"byteLength"==p||"byteOffset"==p)||s(p,g))||d.push(p);return d}},function(t,e){t.exports=function(t,e){for(var r=-1,n=Array(t);++r<t;)n[r]=e(r);return n}},function(t,e,r){var n=r(17),i=r(107),o=r(258),a=Object.prototype.hasOwnProperty;t.exports=function(t){if(!n(t))return o(t);var e=i(t),r=[];for(var s in t)("constructor"!=s||!e&&a.call(t,s))&&r.push(s);return r}},function(t,e){t.exports=function(t){var e=[];if(null!=t)for(var r in Object(t))e.push(r);return e}},function(t,e,r){var n=r(260),i=r(267);t.exports=function(t){return n((function(e,r){var n=-1,o=r.length,a=o>1?r[o-1]:void 0,s=o>2?r[2]:void 0;for(a=t.length>3&&"function"==typeof a?(o--,a):void 0,s&&i(r[0],r[1],s)&&(a=o<3?void 0:a,o=1),e=Object(e);++n<o;){var c=r[n];c&&t(e,c,n,a)}return e}))}},function(t,e,r){var n=r(116),i=r(261),o=r(263);t.exports=function(t,e){return o(i(t,e,n),t+"")}},function(t,e,r){var n=r(262),i=Math.max;t.exports=function(t,e,r){return e=i(void 0===e?t.length-1:e,0),function(){for(var o=arguments,a=-1,s=i(o.length-e,0),c=Array(s);++a<s;)c[a]=o[e+a];a=-1;for(var A=Array(e+1);++a<e;)A[a]=o[a];return A[e]=r(c),n(t,this,A)}}},function(t,e){t.exports=function(t,e,r){switch(r.length){case 0:return t.call(e);case 1:return t.call(e,r[0]);case 2:return t.call(e,r[0],r[1]);case 3:return t.call(e,r[0],r[1],r[2])}return t.apply(e,r)}},function(t,e,r){var n=r(264),i=r(266)(n);t.exports=i},function(t,e,r){var n=r(265),i=r(105),o=r(116),a=i?function(t,e){return i(t,"toString",{configurable:!0,enumerable:!1,value:n(e),writable:!0})}:o;t.exports=a},function(t,e){t.exports=function(t){return function(){return t}}},function(t,e){var r=Date.now;t.exports=function(t){var e=0,n=0;return function(){var i=r(),o=16-(i-n);if(n=i,o>0){if(++e>=800)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}},function(t,e,r){function n(t){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var i=r(41),o=r(58),a=r(115),s=r(17);t.exports=function(t,e,r){if(!s(r))return!1;var c=n(e);return!!("number"==c?o(r)&&a(e,r.length):"string"==c&&e in r)&&i(r[e],t)}},function(t,e,r){(function(e){var n=r(20),i=r(21);void 0===globalThis.Buffer&&(globalThis.Buffer=r(5).Buffer);var o,a=r(88),s=r(117),c=r(38);if("undefined"==typeof crypto){var A=r(279);A.getRandomValues=function(t){return A.randomBytes(t.length)},globalThis.crypto=A}switch(c.Platform()){case c.PLATFORM_REACT_NATIVE:case c.PLATFORM_WEB:o=r(165).default;break;default:o=r(!function(){var t=new Error("Cannot find module '@eluvio/crypto/dist/elv-crypto.bundle.node'");throw t.code="MODULE_NOT_FOUND",t}()).default}var u,f,h,l,d,g={ElvCrypto:(d=i(n.mark((function t(){return n.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(t.prev=0,g.elvCrypto){t.next=5;break}return t.next=4,(new o).init();case 4:g.elvCrypto=t.sent;case 5:return t.abrupt("return",g.elvCrypto);case 8:t.prev=8,t.t0=t.catch(0),console.error("Error initializing ElvCrypto:"),console.error(t.t0);case 12:case"end":return t.stop()}}),t,null,[[0,8]])}))),function(){return d.apply(this,arguments)}),EncryptedSize:function(t){var e=Math.floor(t/1e6)*g.EncryptedBlockSize(1e6);return t%1e6!=0&&(e+=g.EncryptedBlockSize(t%1e6)),e},EncryptedBlockSize:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=129,n=608,i=48,o=12*(i-1),a=12*i,s=Math.floor(t/o)*a;return t%o!=0&&(s+=a),e?s+n:s+r},EncryptConk:function(t,r){return i(n.mark((function i(){var o,a,s,A,u,f;return n.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,g.ElvCrypto();case 2:return o=n.sent,r=new Uint8Array(e.from(r.replace("0x",""),"hex")),t=new Uint8Array(e.from(JSON.stringify(t))),n.next=7,o.encryptECIES(t,r);case 7:return a=n.sent,s=a.data,A=a.ephemeralKey,u=a.tag,f=e.concat([e.from(A),e.from(u),e.from(s)]),n.abrupt("return",c.B64(f));case 13:case"end":return n.stop()}}),i)})))()},DecryptCap:function(t,r){return i(n.mark((function i(){var o,a,s,c,A;return n.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,g.ElvCrypto();case 2:return o=n.sent,r=new Uint8Array(e.from(r.replace("0x",""),"hex")),t=e.from(t,"base64"),a=t.slice(0,65),s=t.slice(65,81),c=t.slice(81),A=o.decryptECIES(new Uint8Array(c),r,new Uint8Array(a),new Uint8Array(s)),n.abrupt("return",JSON.parse(e.from(A).toString()));case 10:case"end":return n.stop()}}),i)})))()},GeneratePrimaryConk:function(t){return i(n.mark((function r(){var i,o,s,c,A,u,f;return n.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return i=t.spaceId,o=t.objectId,r.next=3,g.ElvCrypto();case 3:return s=r.sent,c=s.generatePrimaryKeys(),A=c.secretKey,u=c.publicKey,f=s.generateSymmetricKey().key,r.abrupt("return",{symm_key:"kpsy".concat(a.encode(e.from(f))),secret_key:"kpsk".concat(a.encode(e.from(A))),public_key:"kppk".concat(a.encode(e.from(u))),sid:i,qid:o});case 7:case"end":return r.stop()}}),r)})))()},GenerateTargetConk:function(){return i(n.mark((function t(){var r,i,o,s;return n.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,g.ElvCrypto();case 2:return r=t.sent,i=r.generateTargetKeys(),o=i.secretKey,s=i.publicKey,t.abrupt("return",{secret_key:"kpsk".concat(a.encode(e.from(o))),public_key:"ktpk".concat(a.encode(e.from(s)))});case 5:case"end":return t.stop()}}),t)})))()},CapToConk:function(t){var e=function(t){return new Uint8Array(a.decode(t.slice(4)))};return{symmetricKey:e(t.symm_key),secretKey:e(t.secret_key),publicKey:e(t.public_key)}},EncryptionContext:function(t){return i(n.mark((function e(){var r,i,o,a,s,c,A;return n.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,g.ElvCrypto();case 2:return r=e.sent,i=g.CapToConk(t),o=i.symmetricKey,a=i.secretKey,(s=i.publicKey).length===r.PRIMARY_PK_KEY_SIZE?(A=r.CRYPTO_TYPE_PRIMARY,c=r.newPrimaryContext(s,a,o)):(A=r.CRYPTO_TYPE_TARGET,c=r.newTargetDecryptionContext(a,o)),e.abrupt("return",{context:c,type:A});case 6:case"end":return e.stop()}}),e)})))()},Encrypt:(l=i(n.mark((function t(r,i){var o,a,s,c,A;return n.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,g.OpenEncryptionStream(r);case 2:if(o=t.sent,e.isBuffer(i)||i instanceof ArrayBuffer){t.next=9;break}return t.t0=e,t.next=7,new Response(i).arrayBuffer();case 7:t.t1=t.sent,i=t.t0.from.call(t.t0,t.t1);case 9:for(a=new Uint8Array(i),s=0;s<a.length;s+=1e6)c=Math.min(a.length,s+1e6),o.write(a.slice(s,c));return o.end(),A=[],t.next=15,new Promise((function(t,e){o.on("data",(function(t){A.push(t)})).on("finish",(function(){t()})).on("error",(function(t){e(t)}))}));case 15:return t.abrupt("return",e.concat(A));case 16:case"end":return t.stop()}}),t)}))),function(t,e){return l.apply(this,arguments)}),OpenEncryptionStream:(h=i(n.mark((function t(e){var r,i,o,a,c;return n.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,g.ElvCrypto();case 2:return r=t.sent,t.next=5,g.EncryptionContext(e);case 5:return i=t.sent,o=i.context,a=new s.PassThrough,c=r.createCipher(o),t.abrupt("return",a.pipe(c).on("finish",(function(){o.free()})).on("error",(function(t){throw Error(t)})));case 10:case"end":return t.stop()}}),t)}))),function(t){return h.apply(this,arguments)}),Decrypt:(f=i(n.mark((function t(r,i){var o,a,s,c,A;return n.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,g.OpenDecryptionStream(r);case 2:for(o=t.sent,a=new Uint8Array(i),s=0;s<a.length;s+=1e6)c=Math.min(a.length,s+1e6),o.write(a.slice(s,c));return o.end(),A=[],t.next=9,new Promise((function(t,e){o.on("data",(function(t){A.push(t)})).on("finish",(function(){t()})).on("error",(function(t){e(t)}))}));case 9:return t.abrupt("return",e.concat(A));case 10:case"end":return t.stop()}}),t)}))),function(t,e){return f.apply(this,arguments)}),OpenDecryptionStream:(u=i(n.mark((function t(e){var r,i,o,a,c,A;return n.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,g.ElvCrypto();case 2:return r=t.sent,t.next=5,g.EncryptionContext(e);case 5:return i=t.sent,o=i.context,a=i.type,c=new s.PassThrough,A=r.createDecipher(a,o),t.abrupt("return",c.pipe(A).on("finish",(function(){o.free()})).on("error",(function(t){throw Error(t)})));case 11:case"end":return t.stop()}}),t)}))),function(t){return u.apply(this,arguments)})};t.exports=g}).call(this,r(5).Buffer)},function(t,e){var r={}.toString;t.exports=Array.isArray||function(t){return"[object Array]"==r.call(t)}},function(t,e){},function(t,e,r){"use strict";var n=r(60).Buffer,i=r(272);t.exports=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.head=null,this.tail=null,this.length=0}return t.prototype.push=function(t){var e={data:t,next:null};this.length>0?this.tail.next=e:this.head=e,this.tail=e,++this.length},t.prototype.unshift=function(t){var e={data:t,next:this.head};0===this.length&&(this.tail=e),this.head=e,++this.length},t.prototype.shift=function(){if(0!==this.length){var t=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,t}},t.prototype.clear=function(){this.head=this.tail=null,this.length=0},t.prototype.join=function(t){if(0===this.length)return"";for(var e=this.head,r=""+e.data;e=e.next;)r+=t+e.data;return r},t.prototype.concat=function(t){if(0===this.length)return n.alloc(0);if(1===this.length)return this.head.data;for(var e,r,i,o=n.allocUnsafe(t>>>0),a=this.head,s=0;a;)e=a.data,r=o,i=s,e.copy(r,i),s+=a.data.length,a=a.next;return o},t}(),i&&i.inspect&&i.inspect.custom&&(t.exports.prototype[i.inspect.custom]=function(){var t=i.inspect({length:this.length});return this.constructor.name+" "+t})},function(t,e){},function(t,e,r){var n=r(5),i=n.Buffer;function o(t,e){for(var r in t)e[r]=t[r]}function a(t,e,r){return i(t,e,r)}i.from&&i.alloc&&i.allocUnsafe&&i.allocUnsafeSlow?t.exports=n:(o(n,e),e.Buffer=a),o(i,a),a.from=function(t,e,r){if("number"==typeof t)throw new TypeError("Argument must not be a number");return i(t,e,r)},a.alloc=function(t,e,r){if("number"!=typeof t)throw new TypeError("Argument must be a number");var n=i(t);return void 0!==e?"string"==typeof r?n.fill(e,r):n.fill(e):n.fill(0),n},a.allocUnsafe=function(t){if("number"!=typeof t)throw new TypeError("Argument must be a number");return i(t)},a.allocUnsafeSlow=function(t){if("number"!=typeof t)throw new TypeError("Argument must be a number");return n.SlowBuffer(t)}},function(t,e,r){"use strict";t.exports=o;var n=r(122),i=Object.create(r(33));function o(t){if(!(this instanceof o))return new o(t);n.call(this,t)}i.inherits=r(3),i.inherits(o,n),o.prototype._transform=function(t,e,r){r(null,t)}},function(t,e,r){t.exports=r(61)},function(t,e,r){t.exports=r(18)},function(t,e,r){t.exports=r(59).Transform},function(t,e,r){t.exports=r(59).PassThrough},function(t,e,r){"use strict";e.randomBytes=e.rng=e.pseudoRandomBytes=e.prng=r(19),e.createHash=e.Hash=r(23),e.createHmac=e.Hmac=r(67);var n=r(133),i=Object.keys(n),o=["sha1","sha224","sha256","sha384","sha512","md5","rmd160"].concat(i);e.getHashes=function(){return o};var a=r(68);e.pbkdf2=a.pbkdf2,e.pbkdf2Sync=a.pbkdf2Sync;var s=r(139);e.Cipher=s.Cipher,e.createCipher=s.createCipher,e.Cipheriv=s.Cipheriv,e.createCipheriv=s.createCipheriv,e.Decipher=s.Decipher,e.createDecipher=s.createDecipher,e.Decipheriv=s.Decipheriv,e.createDecipheriv=s.createDecipheriv,e.getCiphers=s.getCiphers,e.listCiphers=s.listCiphers;var c=r(147);e.DiffieHellmanGroup=c.DiffieHellmanGroup,e.createDiffieHellmanGroup=c.createDiffieHellmanGroup,e.getDiffieHellman=c.getDiffieHellman,e.createDiffieHellman=c.createDiffieHellman,e.DiffieHellman=c.DiffieHellman;var A=r(150);e.createSign=A.createSign,e.Sign=A.Sign,e.createVerify=A.createVerify,e.Verify=A.Verify,e.createECDH=r(159);var u=r(160);e.publicEncrypt=u.publicEncrypt,e.privateEncrypt=u.privateEncrypt,e.publicDecrypt=u.publicDecrypt,e.privateDecrypt=u.privateDecrypt;var f=r(164);e.randomFill=f.randomFill,e.randomFillSync=f.randomFillSync,e.createCredentials=function(){throw new Error(["sorry, createCredentials is not implemented yet","we accept pull requests","https://github.com/crypto-browserify/crypto-browserify"].join("\n"))},e.constants={DH_CHECK_P_NOT_SAFE_PRIME:2,DH_CHECK_P_NOT_PRIME:1,DH_UNABLE_TO_CHECK_GENERATOR:4,DH_NOT_SUITABLE_GENERATOR:8,NPN_ENABLED:1,ALPN_ENABLED:1,RSA_PKCS1_PADDING:1,RSA_SSLV23_PADDING:2,RSA_NO_PADDING:3,RSA_PKCS1_OAEP_PADDING:4,RSA_X931_PADDING:5,RSA_PKCS1_PSS_PADDING:6,POINT_CONVERSION_COMPRESSED:2,POINT_CONVERSION_UNCOMPRESSED:4,POINT_CONVERSION_HYBRID:6}},function(t,e){},function(t,e,r){"use strict";function n(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function i(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function o(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}var a=r(5).Buffer,s=r(282).inspect,c=s&&s.custom||"inspect";t.exports=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.head=null,this.tail=null,this.length=0}var e,r,A;return e=t,(r=[{key:"push",value:function(t){var e={data:t,next:null};this.length>0?this.tail.next=e:this.head=e,this.tail=e,++this.length}},{key:"unshift",value:function(t){var e={data:t,next:this.head};0===this.length&&(this.tail=e),this.head=e,++this.length}},{key:"shift",value:function(){if(0!==this.length){var t=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,t}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(t){if(0===this.length)return"";for(var e=this.head,r=""+e.data;e=e.next;)r+=t+e.data;return r}},{key:"concat",value:function(t){if(0===this.length)return a.alloc(0);for(var e,r,n,i=a.allocUnsafe(t>>>0),o=this.head,s=0;o;)e=o.data,r=i,n=s,a.prototype.copy.call(e,r,n),s+=o.data.length,o=o.next;return i}},{key:"consume",value:function(t,e){var r;return t<this.head.data.length?(r=this.head.data.slice(0,t),this.head.data=this.head.data.slice(t)):r=t===this.head.data.length?this.shift():e?this._getString(t):this._getBuffer(t),r}},{key:"first",value:function(){return this.head.data}},{key:"_getString",value:function(t){var e=this.head,r=1,n=e.data;for(t-=n.length;e=e.next;){var i=e.data,o=t>i.length?i.length:t;if(o===i.length?n+=i:n+=i.slice(0,t),0==(t-=o)){o===i.length?(++r,e.next?this.head=e.next:this.head=this.tail=null):(this.head=e,e.data=i.slice(o));break}++r}return this.length-=r,n}},{key:"_getBuffer",value:function(t){var e=a.allocUnsafe(t),r=this.head,n=1;for(r.data.copy(e),t-=r.data.length;r=r.next;){var i=r.data,o=t>i.length?i.length:t;if(i.copy(e,e.length-t,0,o),0==(t-=o)){o===i.length?(++n,r.next?this.head=r.next:this.head=this.tail=null):(this.head=r,r.data=i.slice(o));break}++n}return this.length-=n,e}},{key:c,value:function(t,e){return s(this,function(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?n(Object(r),!0).forEach((function(e){i(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):n(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}({},e,{depth:0,customInspect:!1}))}}])&&o(e.prototype,r),A&&o(e,A),t}()},function(t,e){},function(t,e,r){"use strict";(function(e){var n;function i(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var o=r(64),a=Symbol("lastResolve"),s=Symbol("lastReject"),c=Symbol("error"),A=Symbol("ended"),u=Symbol("lastPromise"),f=Symbol("handlePromise"),h=Symbol("stream");function l(t,e){return{value:t,done:e}}function d(t){var e=t[a];if(null!==e){var r=t[h].read();null!==r&&(t[u]=null,t[a]=null,t[s]=null,e(l(r,!1)))}}function g(t){e.nextTick(d,t)}var p=Object.getPrototypeOf((function(){})),y=Object.setPrototypeOf((i(n={get stream(){return this[h]},next:function(){var t=this,r=this[c];if(null!==r)return Promise.reject(r);if(this[A])return Promise.resolve(l(void 0,!0));if(this[h].destroyed)return new Promise((function(r,n){e.nextTick((function(){t[c]?n(t[c]):r(l(void 0,!0))}))}));var n,i=this[u];if(i)n=new Promise(function(t,e){return function(r,n){t.then((function(){e[A]?r(l(void 0,!0)):e[f](r,n)}),n)}}(i,this));else{var o=this[h].read();if(null!==o)return Promise.resolve(l(o,!1));n=new Promise(this[f])}return this[u]=n,n}},Symbol.asyncIterator,(function(){return this})),i(n,"return",(function(){var t=this;return new Promise((function(e,r){t[h].destroy(null,(function(t){t?r(t):e(l(void 0,!0))}))}))})),n),p);t.exports=function(t){var e,r=Object.create(y,(i(e={},h,{value:t,writable:!0}),i(e,a,{value:null,writable:!0}),i(e,s,{value:null,writable:!0}),i(e,c,{value:null,writable:!0}),i(e,A,{value:t._readableState.endEmitted,writable:!0}),i(e,f,{value:function(t,e){var n=r[h].read();n?(r[u]=null,r[a]=null,r[s]=null,t(l(n,!1))):(r[a]=t,r[s]=e)},writable:!0}),e));return r[u]=null,o(t,(function(t){if(t&&"ERR_STREAM_PREMATURE_CLOSE"!==t.code){var e=r[s];return null!==e&&(r[u]=null,r[a]=null,r[s]=null,e(t)),void(r[c]=t)}var n=r[a];null!==n&&(r[u]=null,r[a]=null,r[s]=null,n(l(void 0,!0))),r[A]=!0})),t.on("readable",g.bind(null,r)),r}}).call(this,r(9))},function(t,e){t.exports=function(){throw new Error("Readable.from is not available in the browser")}},function(t,e,r){"use strict";t.exports=i;var n=r(129);function i(t){if(!(this instanceof i))return new i(t);n.call(this,t)}r(3)(i,n),i.prototype._transform=function(t,e,r){r(null,t)}},function(t,e,r){"use strict";var n;var i=r(24).codes,o=i.ERR_MISSING_ARGS,a=i.ERR_STREAM_DESTROYED;function s(t){if(t)throw t}function c(t,e,i,o){o=function(t){var e=!1;return function(){e||(e=!0,t.apply(void 0,arguments))}}(o);var s=!1;t.on("close",(function(){s=!0})),void 0===n&&(n=r(64)),n(t,{readable:e,writable:i},(function(t){if(t)return o(t);s=!0,o()}));var c=!1;return function(e){if(!s&&!c)return c=!0,function(t){return t.setHeader&&"function"==typeof t.abort}(t)?t.abort():"function"==typeof t.destroy?t.destroy():void o(e||new a("pipe"))}}function A(t){t()}function u(t,e){return t.pipe(e)}function f(t){return t.length?"function"!=typeof t[t.length-1]?s:t.pop():s}t.exports=function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];var n,i=f(e);if(Array.isArray(e[0])&&(e=e[0]),e.length<2)throw new o("streams");var a=e.map((function(t,r){var o=r<e.length-1;return c(t,o,r>0,(function(t){n||(n=t),t&&a.forEach(A),o||(a.forEach(A),i(n))}))}));return e.reduce(u)}},function(t,e,r){var n=r(3),i=r(26),o=r(4).Buffer,a=[1518500249,1859775393,-1894007588,-899497514],s=new Array(80);function c(){this.init(),this._w=s,i.call(this,64,56)}function A(t){return t<<30|t>>>2}function u(t,e,r,n){return 0===t?e&r|~e&n:2===t?e&r|e&n|r&n:e^r^n}n(c,i),c.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},c.prototype._update=function(t){for(var e,r=this._w,n=0|this._a,i=0|this._b,o=0|this._c,s=0|this._d,c=0|this._e,f=0;f<16;++f)r[f]=t.readInt32BE(4*f);for(;f<80;++f)r[f]=r[f-3]^r[f-8]^r[f-14]^r[f-16];for(var h=0;h<80;++h){var l=~~(h/20),d=0|((e=n)<<5|e>>>27)+u(l,i,o,s)+c+r[h]+a[l];c=s,s=o,o=A(i),i=n,n=d}this._a=n+this._a|0,this._b=i+this._b|0,this._c=o+this._c|0,this._d=s+this._d|0,this._e=c+this._e|0},c.prototype._hash=function(){var t=o.allocUnsafe(20);return t.writeInt32BE(0|this._a,0),t.writeInt32BE(0|this._b,4),t.writeInt32BE(0|this._c,8),t.writeInt32BE(0|this._d,12),t.writeInt32BE(0|this._e,16),t},t.exports=c},function(t,e,r){var n=r(3),i=r(26),o=r(4).Buffer,a=[1518500249,1859775393,-1894007588,-899497514],s=new Array(80);function c(){this.init(),this._w=s,i.call(this,64,56)}function A(t){return t<<5|t>>>27}function u(t){return t<<30|t>>>2}function f(t,e,r,n){return 0===t?e&r|~e&n:2===t?e&r|e&n|r&n:e^r^n}n(c,i),c.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},c.prototype._update=function(t){for(var e,r=this._w,n=0|this._a,i=0|this._b,o=0|this._c,s=0|this._d,c=0|this._e,h=0;h<16;++h)r[h]=t.readInt32BE(4*h);for(;h<80;++h)r[h]=(e=r[h-3]^r[h-8]^r[h-14]^r[h-16])<<1|e>>>31;for(var l=0;l<80;++l){var d=~~(l/20),g=A(n)+f(d,i,o,s)+c+r[l]+a[d]|0;c=s,s=o,o=u(i),i=n,n=g}this._a=n+this._a|0,this._b=i+this._b|0,this._c=o+this._c|0,this._d=s+this._d|0,this._e=c+this._e|0},c.prototype._hash=function(){var t=o.allocUnsafe(20);return t.writeInt32BE(0|this._a,0),t.writeInt32BE(0|this._b,4),t.writeInt32BE(0|this._c,8),t.writeInt32BE(0|this._d,12),t.writeInt32BE(0|this._e,16),t},t.exports=c},function(t,e,r){var n=r(3),i=r(130),o=r(26),a=r(4).Buffer,s=new Array(64);function c(){this.init(),this._w=s,o.call(this,64,56)}n(c,i),c.prototype.init=function(){return this._a=3238371032,this._b=914150663,this._c=812702999,this._d=4144912697,this._e=4290775857,this._f=1750603025,this._g=1694076839,this._h=3204075428,this},c.prototype._hash=function(){var t=a.allocUnsafe(28);return t.writeInt32BE(this._a,0),t.writeInt32BE(this._b,4),t.writeInt32BE(this._c,8),t.writeInt32BE(this._d,12),t.writeInt32BE(this._e,16),t.writeInt32BE(this._f,20),t.writeInt32BE(this._g,24),t},t.exports=c},function(t,e,r){var n=r(3),i=r(131),o=r(26),a=r(4).Buffer,s=new Array(160);function c(){this.init(),this._w=s,o.call(this,128,112)}n(c,i),c.prototype.init=function(){return this._ah=3418070365,this._bh=1654270250,this._ch=2438529370,this._dh=355462360,this._eh=1731405415,this._fh=2394180231,this._gh=3675008525,this._hh=1203062813,this._al=3238371032,this._bl=914150663,this._cl=812702999,this._dl=4144912697,this._el=4290775857,this._fl=1750603025,this._gl=1694076839,this._hl=3204075428,this},c.prototype._hash=function(){var t=a.allocUnsafe(48);function e(e,r,n){t.writeInt32BE(e,n),t.writeInt32BE(r,n+4)}return e(this._ah,this._al,0),e(this._bh,this._bl,8),e(this._ch,this._cl,16),e(this._dh,this._dl,24),e(this._eh,this._el,32),e(this._fh,this._fl,40),t},t.exports=c},function(t,e,r){"use strict";var n=r(3),i=r(4).Buffer,o=r(16),a=i.alloc(128);function s(t,e){o.call(this,"digest"),"string"==typeof e&&(e=i.from(e)),this._alg=t,this._key=e,e.length>64?e=t(e):e.length<64&&(e=i.concat([e,a],64));for(var r=this._ipad=i.allocUnsafe(64),n=this._opad=i.allocUnsafe(64),s=0;s<64;s++)r[s]=54^e[s],n[s]=92^e[s];this._hash=[r]}n(s,o),s.prototype._update=function(t){this._hash.push(t)},s.prototype._final=function(){var t=this._alg(i.concat(this._hash));return this._alg(i.concat([this._opad,t]))},t.exports=s},function(t,e,r){(function(e){var n,i,o=r(4).Buffer,a=r(135),s=r(136),c=r(137),A=r(138),u=e.crypto&&e.crypto.subtle,f={sha:"SHA-1","sha-1":"SHA-1",sha1:"SHA-1",sha256:"SHA-256","sha-256":"SHA-256",sha384:"SHA-384","sha-384":"SHA-384","sha-512":"SHA-512",sha512:"SHA-512"},h=[];function l(){return i||(i=e.process&&e.process.nextTick?e.process.nextTick:e.queueMicrotask?e.queueMicrotask:e.setImmediate?e.setImmediate:e.setTimeout)}function d(t,e,r,n,i){return u.importKey("raw",t,{name:"PBKDF2"},!1,["deriveBits"]).then((function(t){return u.deriveBits({name:"PBKDF2",salt:e,iterations:r,hash:{name:i}},t,n<<3)})).then((function(t){return o.from(t)}))}t.exports=function(t,r,i,g,p,y){"function"==typeof p&&(y=p,p=void 0);var I=f[(p=p||"sha1").toLowerCase()];if(I&&"function"==typeof e.Promise){if(a(i,g),t=A(t,s,"Password"),r=A(r,s,"Salt"),"function"!=typeof y)throw new Error("No callback provided to pbkdf2");!function(t,e){t.then((function(t){l()((function(){e(null,t)}))}),(function(t){l()((function(){e(t)}))}))}(function(t){if(e.process&&!e.process.browser)return Promise.resolve(!1);if(!u||!u.importKey||!u.deriveBits)return Promise.resolve(!1);if(void 0!==h[t])return h[t];var r=d(n=n||o.alloc(8),n,10,128,t).then((function(){return!0})).catch((function(){return!1}));return h[t]=r,r}(I).then((function(e){return e?d(t,r,i,g,I):c(t,r,i,g,p)})),y)}else l()((function(){var e;try{e=c(t,r,i,g,p)}catch(t){return y(t)}y(null,e)}))}}).call(this,r(8))},function(t,e,r){var n=r(16),i=r(294),o=r(3),a=r(4).Buffer,s={"des-ede3-cbc":i.CBC.instantiate(i.EDE),"des-ede3":i.EDE,"des-ede-cbc":i.CBC.instantiate(i.EDE),"des-ede":i.EDE,"des-cbc":i.CBC.instantiate(i.DES),"des-ecb":i.DES};function c(t){n.call(this);var e,r=t.mode.toLowerCase(),i=s[r];e=t.decrypt?"decrypt":"encrypt";var o=t.key;a.isBuffer(o)||(o=a.from(o)),"des-ede"!==r&&"des-ede-cbc"!==r||(o=a.concat([o,o.slice(0,8)]));var c=t.iv;a.isBuffer(c)||(c=a.from(c)),this._des=i.create({key:o,iv:c,type:e})}s.des=s["des-cbc"],s.des3=s["des-ede3-cbc"],t.exports=c,o(c,n),c.prototype._update=function(t){return a.from(this._des.update(t))},c.prototype._final=function(){return a.from(this._des.final())}},function(t,e,r){"use strict";e.utils=r(140),e.Cipher=r(69),e.DES=r(141),e.CBC=r(295),e.EDE=r(296)},function(t,e,r){"use strict";var n=r(11),i=r(3),o={};function a(t){n.equal(t.length,8,"Invalid IV length"),this.iv=new Array(8);for(var e=0;e<this.iv.length;e++)this.iv[e]=t[e]}e.instantiate=function(t){function e(e){t.call(this,e),this._cbcInit()}i(e,t);for(var r=Object.keys(o),n=0;n<r.length;n++){var a=r[n];e.prototype[a]=o[a]}return e.create=function(t){return new e(t)},e},o._cbcInit=function(){var t=new a(this.options.iv);this._cbcState=t},o._update=function(t,e,r,n){var i=this._cbcState,o=this.constructor.super_.prototype,a=i.iv;if("encrypt"===this.type){for(var s=0;s<this.blockSize;s++)a[s]^=t[e+s];o._update.call(this,a,0,r,n);for(s=0;s<this.blockSize;s++)a[s]=r[n+s]}else{o._update.call(this,t,e,r,n);for(s=0;s<this.blockSize;s++)r[n+s]^=a[s];for(s=0;s<this.blockSize;s++)a[s]=t[e+s]}}},function(t,e,r){"use strict";var n=r(11),i=r(3),o=r(69),a=r(141);function s(t,e){n.equal(e.length,24,"Invalid key length");var r=e.slice(0,8),i=e.slice(8,16),o=e.slice(16,24);this.ciphers="encrypt"===t?[a.create({type:"encrypt",key:r}),a.create({type:"decrypt",key:i}),a.create({type:"encrypt",key:o})]:[a.create({type:"decrypt",key:o}),a.create({type:"encrypt",key:i}),a.create({type:"decrypt",key:r})]}function c(t){o.call(this,t);var e=new s(this.type,this.options.key);this._edeState=e}i(c,o),t.exports=c,c.create=function(t){return new c(t)},c.prototype._update=function(t,e,r,n){var i=this._edeState;i.ciphers[0]._update(t,e,r,n),i.ciphers[1]._update(r,n,r,n),i.ciphers[2]._update(r,n,r,n)},c.prototype._pad=a.prototype._pad,c.prototype._unpad=a.prototype._unpad},function(t,e,r){var n=r(71),i=r(145),o=r(4).Buffer,a=r(146),s=r(16),c=r(46),A=r(47);function u(t,e,r){s.call(this),this._cache=new h,this._cipher=new c.AES(e),this._prev=o.from(r),this._mode=t,this._autopadding=!0}r(3)(u,s),u.prototype._update=function(t){var e,r;this._cache.add(t);for(var n=[];e=this._cache.get();)r=this._mode.encrypt(this,e),n.push(r);return o.concat(n)};var f=o.alloc(16,16);function h(){this.cache=o.allocUnsafe(0)}function l(t,e,r){var s=n[t.toLowerCase()];if(!s)throw new TypeError("invalid suite type");if("string"==typeof e&&(e=o.from(e)),e.length!==s.key/8)throw new TypeError("invalid key length "+e.length);if("string"==typeof r&&(r=o.from(r)),"GCM"!==s.mode&&r.length!==s.iv)throw new TypeError("invalid iv length "+r.length);return"stream"===s.type?new a(s.module,e,r):"auth"===s.type?new i(s.module,e,r):new u(s.module,e,r)}u.prototype._final=function(){var t=this._cache.flush();if(this._autopadding)return t=this._mode.encrypt(this,t),this._cipher.scrub(),t;if(!t.equals(f))throw this._cipher.scrub(),new Error("data not multiple of block length")},u.prototype.setAutoPadding=function(t){return this._autopadding=!!t,this},h.prototype.add=function(t){this.cache=o.concat([this.cache,t])},h.prototype.get=function(){if(this.cache.length>15){var t=this.cache.slice(0,16);return this.cache=this.cache.slice(16),t}return null},h.prototype.flush=function(){for(var t=16-this.cache.length,e=o.allocUnsafe(t),r=-1;++r<t;)e.writeUInt8(t,r);return o.concat([this.cache,e])},e.createCipheriv=l,e.createCipher=function(t,e){var r=n[t.toLowerCase()];if(!r)throw new TypeError("invalid suite type");var i=A(e,!1,r.key,r.iv);return l(t,i.key,i.iv)}},function(t,e){e.encrypt=function(t,e){return t._cipher.encryptBlock(e)},e.decrypt=function(t,e){return t._cipher.decryptBlock(e)}},function(t,e,r){var n=r(35);e.encrypt=function(t,e){var r=n(e,t._prev);return t._prev=t._cipher.encryptBlock(r),t._prev},e.decrypt=function(t,e){var r=t._prev;t._prev=e;var i=t._cipher.decryptBlock(e);return n(i,r)}},function(t,e,r){var n=r(4).Buffer,i=r(35);function o(t,e,r){var o=e.length,a=i(e,t._cache);return t._cache=t._cache.slice(o),t._prev=n.concat([t._prev,r?e:a]),a}e.encrypt=function(t,e,r){for(var i,a=n.allocUnsafe(0);e.length;){if(0===t._cache.length&&(t._cache=t._cipher.encryptBlock(t._prev),t._prev=n.allocUnsafe(0)),!(t._cache.length<=e.length)){a=n.concat([a,o(t,e,r)]);break}i=t._cache.length,a=n.concat([a,o(t,e.slice(0,i),r)]),e=e.slice(i)}return a}},function(t,e,r){var n=r(4).Buffer;function i(t,e,r){var i=t._cipher.encryptBlock(t._prev)[0]^e;return t._prev=n.concat([t._prev.slice(1),n.from([r?e:i])]),i}e.encrypt=function(t,e,r){for(var o=e.length,a=n.allocUnsafe(o),s=-1;++s<o;)a[s]=i(t,e[s],r);return a}},function(t,e,r){var n=r(4).Buffer;function i(t,e,r){for(var n,i,a=-1,s=0;++a<8;)n=e&1<<7-a?128:0,s+=(128&(i=t._cipher.encryptBlock(t._prev)[0]^n))>>a%8,t._prev=o(t._prev,r?n:i);return s}function o(t,e){var r=t.length,i=-1,o=n.allocUnsafe(t.length);for(t=n.concat([t,n.from([e])]);++i<r;)o[i]=t[i]<<1|t[i+1]>>7;return o}e.encrypt=function(t,e,r){for(var o=e.length,a=n.allocUnsafe(o),s=-1;++s<o;)a[s]=i(t,e[s],r);return a}},function(t,e,r){(function(t){var n=r(35);function i(t){return t._prev=t._cipher.encryptBlock(t._prev),t._prev}e.encrypt=function(e,r){for(;e._cache.length<r.length;)e._cache=t.concat([e._cache,i(e)]);var o=e._cache.slice(0,r.length);return e._cache=e._cache.slice(r.length),n(r,o)}}).call(this,r(5).Buffer)},function(t,e,r){var n=r(4).Buffer,i=n.alloc(16,0);function o(t){var e=n.allocUnsafe(16);return e.writeUInt32BE(t[0]>>>0,0),e.writeUInt32BE(t[1]>>>0,4),e.writeUInt32BE(t[2]>>>0,8),e.writeUInt32BE(t[3]>>>0,12),e}function a(t){this.h=t,this.state=n.alloc(16,0),this.cache=n.allocUnsafe(0)}a.prototype.ghash=function(t){for(var e=-1;++e<t.length;)this.state[e]^=t[e];this._multiply()},a.prototype._multiply=function(){for(var t,e,r,n=[(t=this.h).readUInt32BE(0),t.readUInt32BE(4),t.readUInt32BE(8),t.readUInt32BE(12)],i=[0,0,0,0],a=-1;++a<128;){for(0!=(this.state[~~(a/8)]&1<<7-a%8)&&(i[0]^=n[0],i[1]^=n[1],i[2]^=n[2],i[3]^=n[3]),r=0!=(1&n[3]),e=3;e>0;e--)n[e]=n[e]>>>1|(1&n[e-1])<<31;n[0]=n[0]>>>1,r&&(n[0]=n[0]^225<<24)}this.state=o(i)},a.prototype.update=function(t){var e;for(this.cache=n.concat([this.cache,t]);this.cache.length>=16;)e=this.cache.slice(0,16),this.cache=this.cache.slice(16),this.ghash(e)},a.prototype.final=function(t,e){return this.cache.length&&this.ghash(n.concat([this.cache,i],16)),this.ghash(o([0,t,0,e])),this.state},t.exports=a},function(t,e,r){var n=r(145),i=r(4).Buffer,o=r(71),a=r(146),s=r(16),c=r(46),A=r(47);function u(t,e,r){s.call(this),this._cache=new f,this._last=void 0,this._cipher=new c.AES(e),this._prev=i.from(r),this._mode=t,this._autopadding=!0}function f(){this.cache=i.allocUnsafe(0)}function h(t,e,r){var s=o[t.toLowerCase()];if(!s)throw new TypeError("invalid suite type");if("string"==typeof r&&(r=i.from(r)),"GCM"!==s.mode&&r.length!==s.iv)throw new TypeError("invalid iv length "+r.length);if("string"==typeof e&&(e=i.from(e)),e.length!==s.key/8)throw new TypeError("invalid key length "+e.length);return"stream"===s.type?new a(s.module,e,r,!0):"auth"===s.type?new n(s.module,e,r,!0):new u(s.module,e,r)}r(3)(u,s),u.prototype._update=function(t){var e,r;this._cache.add(t);for(var n=[];e=this._cache.get(this._autopadding);)r=this._mode.decrypt(this,e),n.push(r);return i.concat(n)},u.prototype._final=function(){var t=this._cache.flush();if(this._autopadding)return function(t){var e=t[15];if(e<1||e>16)throw new Error("unable to decrypt data");var r=-1;for(;++r<e;)if(t[r+(16-e)]!==e)throw new Error("unable to decrypt data");if(16===e)return;return t.slice(0,16-e)}(this._mode.decrypt(this,t));if(t)throw new Error("data not multiple of block length")},u.prototype.setAutoPadding=function(t){return this._autopadding=!!t,this},f.prototype.add=function(t){this.cache=i.concat([this.cache,t])},f.prototype.get=function(t){var e;if(t){if(this.cache.length>16)return e=this.cache.slice(0,16),this.cache=this.cache.slice(16),e}else if(this.cache.length>=16)return e=this.cache.slice(0,16),this.cache=this.cache.slice(16),e;return null},f.prototype.flush=function(){if(this.cache.length)return this.cache},e.createDecipher=function(t,e){var r=o[t.toLowerCase()];if(!r)throw new TypeError("invalid suite type");var n=A(e,!1,r.key,r.iv);return h(t,n.key,n.iv)},e.createDecipheriv=h},function(t,e){e["des-ecb"]={key:8,iv:0},e["des-cbc"]=e.des={key:8,iv:8},e["des-ede3-cbc"]=e.des3={key:24,iv:8},e["des-ede3"]={key:24,iv:0},e["des-ede-cbc"]={key:16,iv:8},e["des-ede"]={key:16,iv:0}},function(t,e){},function(t){t.exports=JSON.parse('{"modp1":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a63a3620ffffffffffffffff"},"modp2":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece65381ffffffffffffffff"},"modp5":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca237327ffffffffffffffff"},"modp14":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aacaa68ffffffffffffffff"},"modp15":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a93ad2caffffffffffffffff"},"modp16":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c934063199ffffffffffffffff"},"modp17":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c93402849236c3fab4d27c7026c1d4dcb2602646dec9751e763dba37bdf8ff9406ad9e530ee5db382f413001aeb06a53ed9027d831179727b0865a8918da3edbebcf9b14ed44ce6cbaced4bb1bdb7f1447e6cc254b332051512bd7af426fb8f401378cd2bf5983ca01c64b92ecf032ea15d1721d03f482d7ce6e74fef6d55e702f46980c82b5a84031900b1c9e59e7c97fbec7e8f323a97a7e36cc88be0f1d45b7ff585ac54bd407b22b4154aacc8f6d7ebf48e1d814cc5ed20f8037e0a79715eef29be32806a1d58bb7c5da76f550aa3d8a1fbff0eb19ccb1a313d55cda56c9ec2ef29632387fe8d76e3c0468043e8f663f4860ee12bf2d5b0b7474d6e694f91e6dcc4024ffffffffffffffff"},"modp18":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c93402849236c3fab4d27c7026c1d4dcb2602646dec9751e763dba37bdf8ff9406ad9e530ee5db382f413001aeb06a53ed9027d831179727b0865a8918da3edbebcf9b14ed44ce6cbaced4bb1bdb7f1447e6cc254b332051512bd7af426fb8f401378cd2bf5983ca01c64b92ecf032ea15d1721d03f482d7ce6e74fef6d55e702f46980c82b5a84031900b1c9e59e7c97fbec7e8f323a97a7e36cc88be0f1d45b7ff585ac54bd407b22b4154aacc8f6d7ebf48e1d814cc5ed20f8037e0a79715eef29be32806a1d58bb7c5da76f550aa3d8a1fbff0eb19ccb1a313d55cda56c9ec2ef29632387fe8d76e3c0468043e8f663f4860ee12bf2d5b0b7474d6e694f91e6dbe115974a3926f12fee5e438777cb6a932df8cd8bec4d073b931ba3bc832b68d9dd300741fa7bf8afc47ed2576f6936ba424663aab639c5ae4f5683423b4742bf1c978238f16cbe39d652de3fdb8befc848ad922222e04a4037c0713eb57a81a23f0c73473fc646cea306b4bcbc8862f8385ddfa9d4b7fa2c087e879683303ed5bdd3a062b3cf5b3a278a66d2a13f83f44f82ddf310ee074ab6a364597e899a0255dc164f31cc50846851df9ab48195ded7ea1b1d510bd7ee74d73faf36bc31ecfa268359046f4eb879f924009438b481c6cd7889a002ed5ee382bc9190da6fc026e479558e4475677e9aa9e3050e2765694dfc81f56e880b96e7160c980dd98edd3dfffffffffffffffff"}}')},function(t,e,r){(function(e){var n=r(2),i=new(r(149)),o=new n(24),a=new n(11),s=new n(10),c=new n(3),A=new n(7),u=r(148),f=r(19);function h(t,r){return r=r||"utf8",e.isBuffer(t)||(t=new e(t,r)),this._pub=new n(t),this}function l(t,r){return r=r||"utf8",e.isBuffer(t)||(t=new e(t,r)),this._priv=new n(t),this}t.exports=g;var d={};function g(t,e,r){this.setGenerator(e),this.__prime=new n(t),this._prime=n.mont(this.__prime),this._primeLen=t.length,this._pub=void 0,this._priv=void 0,this._primeCode=void 0,r?(this.setPublicKey=h,this.setPrivateKey=l):this._primeCode=8}function p(t,r){var n=new e(t.toArray());return r?n.toString(r):n}Object.defineProperty(g.prototype,"verifyError",{enumerable:!0,get:function(){return"number"!=typeof this._primeCode&&(this._primeCode=function(t,e){var r=e.toString("hex"),n=[r,t.toString(16)].join("_");if(n in d)return d[n];var f,h=0;if(t.isEven()||!u.simpleSieve||!u.fermatTest(t)||!i.test(t))return h+=1,h+="02"===r||"05"===r?8:4,d[n]=h,h;switch(i.test(t.shrn(1))||(h+=2),r){case"02":t.mod(o).cmp(a)&&(h+=8);break;case"05":(f=t.mod(s)).cmp(c)&&f.cmp(A)&&(h+=8);break;default:h+=4}return d[n]=h,h}(this.__prime,this.__gen)),this._primeCode}}),g.prototype.generateKeys=function(){return this._priv||(this._priv=new n(f(this._primeLen))),this._pub=this._gen.toRed(this._prime).redPow(this._priv).fromRed(),this.getPublicKey()},g.prototype.computeSecret=function(t){var r=(t=(t=new n(t)).toRed(this._prime)).redPow(this._priv).fromRed(),i=new e(r.toArray()),o=this.getPrime();if(i.length<o.length){var a=new e(o.length-i.length);a.fill(0),i=e.concat([a,i])}return i},g.prototype.getPublicKey=function(t){return p(this._pub,t)},g.prototype.getPrivateKey=function(t){return p(this._priv,t)},g.prototype.getPrime=function(t){return p(this.__prime,t)},g.prototype.getGenerator=function(t){return p(this._gen,t)},g.prototype.setGenerator=function(t,r){return r=r||"utf8",e.isBuffer(t)||(t=new e(t,r)),this.__gen=t,this._gen=new n(t),this}}).call(this,r(5).Buffer)},function(t,e,r){var n=r(4).Buffer,i=r(67),o=r(73),a=r(74).ec,s=r(2),c=r(49),A=r(158);function u(t,e,r,o){if((t=n.from(t.toArray())).length<e.byteLength()){var a=n.alloc(e.byteLength()-t.length);t=n.concat([a,t])}var s=r.length,c=function(t,e){t=(t=f(t,e)).mod(e);var r=n.from(t.toArray());if(r.length<e.byteLength()){var i=n.alloc(e.byteLength()-r.length);r=n.concat([i,r])}return r}(r,e),A=n.alloc(s);A.fill(1);var u=n.alloc(s);return u=i(o,u).update(A).update(n.from([0])).update(t).update(c).digest(),A=i(o,u).update(A).digest(),{k:u=i(o,u).update(A).update(n.from([1])).update(t).update(c).digest(),v:A=i(o,u).update(A).digest()}}function f(t,e){var r=new s(t),n=(t.length<<3)-e.bitLength();return n>0&&r.ishrn(n),r}function h(t,e,r){var o,a;do{for(o=n.alloc(0);8*o.length<t.bitLength();)e.v=i(r,e.k).update(e.v).digest(),o=n.concat([o,e.v]);a=f(o,t),e.k=i(r,e.k).update(e.v).update(n.from([0])).digest(),e.v=i(r,e.k).update(e.v).digest()}while(-1!==a.cmp(t));return a}function l(t,e,r,n){return t.toRed(s.mont(r)).redPow(e).fromRed().mod(n)}t.exports=function(t,e,r,i,d){var g=c(e);if(g.curve){if("ecdsa"!==i&&"ecdsa/rsa"!==i)throw new Error("wrong private key type");return function(t,e){var r=A[e.curve.join(".")];if(!r)throw new Error("unknown curve "+e.curve.join("."));var i=new a(r).keyFromPrivate(e.privateKey).sign(t);return n.from(i.toDER())}(t,g)}if("dsa"===g.type){if("dsa"!==i)throw new Error("wrong private key type");return function(t,e,r){var i,o=e.params.priv_key,a=e.params.p,c=e.params.q,A=e.params.g,d=new s(0),g=f(t,c).mod(c),p=!1,y=u(o,c,t,r);for(;!1===p;)i=h(c,y,r),d=l(A,i,a,c),0===(p=i.invm(c).imul(g.add(o.mul(d))).mod(c)).cmpn(0)&&(p=!1,d=new s(0));return function(t,e){t=t.toArray(),e=e.toArray(),128&t[0]&&(t=[0].concat(t));128&e[0]&&(e=[0].concat(e));var r=[48,t.length+e.length+4,2,t.length];return r=r.concat(t,[2,e.length],e),n.from(r)}(d,p)}(t,g,r)}if("rsa"!==i&&"ecdsa/rsa"!==i)throw new Error("wrong private key type");t=n.concat([d,t]);for(var p=g.modulus.byteLength(),y=[0,1];t.length+y.length+1<p;)y.push(255);y.push(0);for(var I=-1;++I<t.length;)y.push(t[I]);return o(y,g)},t.exports.getKey=u,t.exports.makeKey=h},function(t){t.exports=JSON.parse('{"name":"elliptic","version":"6.5.4","description":"EC cryptography","main":"lib/elliptic.js","files":["lib"],"scripts":{"lint":"eslint lib test","lint:fix":"npm run lint -- --fix","unit":"istanbul test _mocha --reporter=spec test/index.js","test":"npm run lint && npm run unit","version":"grunt dist && git add dist/"},"repository":{"type":"git","url":"git@github.com:indutny/elliptic"},"keywords":["EC","Elliptic","curve","Cryptography"],"author":"Fedor Indutny <fedor@indutny.com>","license":"MIT","bugs":{"url":"https://github.com/indutny/elliptic/issues"},"homepage":"https://github.com/indutny/elliptic","devDependencies":{"brfs":"^2.0.2","coveralls":"^3.1.0","eslint":"^7.6.0","grunt":"^1.2.1","grunt-browserify":"^5.3.0","grunt-cli":"^1.3.2","grunt-contrib-connect":"^3.0.0","grunt-contrib-copy":"^1.0.0","grunt-contrib-uglify":"^5.0.0","grunt-mocha-istanbul":"^5.0.2","grunt-saucelabs":"^9.0.1","istanbul":"^0.4.5","mocha":"^8.0.1"},"dependencies":{"bn.js":"^4.11.9","brorand":"^1.1.0","hash.js":"^1.0.0","hmac-drbg":"^1.0.1","inherits":"^2.0.4","minimalistic-assert":"^1.0.1","minimalistic-crypto-utils":"^1.0.1"}}')},function(t,e,r){"use strict";var n=r(12),i=r(2),o=r(3),a=r(48),s=n.assert;function c(t){a.call(this,"short",t),this.a=new i(t.a,16).toRed(this.red),this.b=new i(t.b,16).toRed(this.red),this.tinv=this.two.redInvm(),this.zeroA=0===this.a.fromRed().cmpn(0),this.threeA=0===this.a.fromRed().sub(this.p).cmpn(-3),this.endo=this._getEndomorphism(t),this._endoWnafT1=new Array(4),this._endoWnafT2=new Array(4)}function A(t,e,r,n){a.BasePoint.call(this,t,"affine"),null===e&&null===r?(this.x=null,this.y=null,this.inf=!0):(this.x=new i(e,16),this.y=new i(r,16),n&&(this.x.forceRed(this.curve.red),this.y.forceRed(this.curve.red)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.inf=!1)}function u(t,e,r,n){a.BasePoint.call(this,t,"jacobian"),null===e&&null===r&&null===n?(this.x=this.curve.one,this.y=this.curve.one,this.z=new i(0)):(this.x=new i(e,16),this.y=new i(r,16),this.z=new i(n,16)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.zOne=this.z===this.curve.one}o(c,a),t.exports=c,c.prototype._getEndomorphism=function(t){if(this.zeroA&&this.g&&this.n&&1===this.p.modn(3)){var e,r;if(t.beta)e=new i(t.beta,16).toRed(this.red);else{var n=this._getEndoRoots(this.p);e=(e=n[0].cmp(n[1])<0?n[0]:n[1]).toRed(this.red)}if(t.lambda)r=new i(t.lambda,16);else{var o=this._getEndoRoots(this.n);0===this.g.mul(o[0]).x.cmp(this.g.x.redMul(e))?r=o[0]:(r=o[1],s(0===this.g.mul(r).x.cmp(this.g.x.redMul(e))))}return{beta:e,lambda:r,basis:t.basis?t.basis.map((function(t){return{a:new i(t.a,16),b:new i(t.b,16)}})):this._getEndoBasis(r)}}},c.prototype._getEndoRoots=function(t){var e=t===this.p?this.red:i.mont(t),r=new i(2).toRed(e).redInvm(),n=r.redNeg(),o=new i(3).toRed(e).redNeg().redSqrt().redMul(r);return[n.redAdd(o).fromRed(),n.redSub(o).fromRed()]},c.prototype._getEndoBasis=function(t){for(var e,r,n,o,a,s,c,A,u,f=this.n.ushrn(Math.floor(this.n.bitLength()/2)),h=t,l=this.n.clone(),d=new i(1),g=new i(0),p=new i(0),y=new i(1),I=0;0!==h.cmpn(0);){var b=l.div(h);A=l.sub(b.mul(h)),u=p.sub(b.mul(d));var v=y.sub(b.mul(g));if(!n&&A.cmp(f)<0)e=c.neg(),r=d,n=A.neg(),o=u;else if(n&&2==++I)break;c=A,l=h,h=A,p=d,d=u,y=g,g=v}a=A.neg(),s=u;var E=n.sqr().add(o.sqr());return a.sqr().add(s.sqr()).cmp(E)>=0&&(a=e,s=r),n.negative&&(n=n.neg(),o=o.neg()),a.negative&&(a=a.neg(),s=s.neg()),[{a:n,b:o},{a:a,b:s}]},c.prototype._endoSplit=function(t){var e=this.endo.basis,r=e[0],n=e[1],i=n.b.mul(t).divRound(this.n),o=r.b.neg().mul(t).divRound(this.n),a=i.mul(r.a),s=o.mul(n.a),c=i.mul(r.b),A=o.mul(n.b);return{k1:t.sub(a).sub(s),k2:c.add(A).neg()}},c.prototype.pointFromX=function(t,e){(t=new i(t,16)).red||(t=t.toRed(this.red));var r=t.redSqr().redMul(t).redIAdd(t.redMul(this.a)).redIAdd(this.b),n=r.redSqrt();if(0!==n.redSqr().redSub(r).cmp(this.zero))throw new Error("invalid point");var o=n.fromRed().isOdd();return(e&&!o||!e&&o)&&(n=n.redNeg()),this.point(t,n)},c.prototype.validate=function(t){if(t.inf)return!0;var e=t.x,r=t.y,n=this.a.redMul(e),i=e.redSqr().redMul(e).redIAdd(n).redIAdd(this.b);return 0===r.redSqr().redISub(i).cmpn(0)},c.prototype._endoWnafMulAdd=function(t,e,r){for(var n=this._endoWnafT1,i=this._endoWnafT2,o=0;o<t.length;o++){var a=this._endoSplit(e[o]),s=t[o],c=s._getBeta();a.k1.negative&&(a.k1.ineg(),s=s.neg(!0)),a.k2.negative&&(a.k2.ineg(),c=c.neg(!0)),n[2*o]=s,n[2*o+1]=c,i[2*o]=a.k1,i[2*o+1]=a.k2}for(var A=this._wnafMulAdd(1,n,i,2*o,r),u=0;u<2*o;u++)n[u]=null,i[u]=null;return A},o(A,a.BasePoint),c.prototype.point=function(t,e,r){return new A(this,t,e,r)},c.prototype.pointFromJSON=function(t,e){return A.fromJSON(this,t,e)},A.prototype._getBeta=function(){if(this.curve.endo){var t=this.precomputed;if(t&&t.beta)return t.beta;var e=this.curve.point(this.x.redMul(this.curve.endo.beta),this.y);if(t){var r=this.curve,n=function(t){return r.point(t.x.redMul(r.endo.beta),t.y)};t.beta=e,e.precomputed={beta:null,naf:t.naf&&{wnd:t.naf.wnd,points:t.naf.points.map(n)},doubles:t.doubles&&{step:t.doubles.step,points:t.doubles.points.map(n)}}}return e}},A.prototype.toJSON=function(){return this.precomputed?[this.x,this.y,this.precomputed&&{doubles:this.precomputed.doubles&&{step:this.precomputed.doubles.step,points:this.precomputed.doubles.points.slice(1)},naf:this.precomputed.naf&&{wnd:this.precomputed.naf.wnd,points:this.precomputed.naf.points.slice(1)}}]:[this.x,this.y]},A.fromJSON=function(t,e,r){"string"==typeof e&&(e=JSON.parse(e));var n=t.point(e[0],e[1],r);if(!e[2])return n;function i(e){return t.point(e[0],e[1],r)}var o=e[2];return n.precomputed={beta:null,doubles:o.doubles&&{step:o.doubles.step,points:[n].concat(o.doubles.points.map(i))},naf:o.naf&&{wnd:o.naf.wnd,points:[n].concat(o.naf.points.map(i))}},n},A.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+">"},A.prototype.isInfinity=function(){return this.inf},A.prototype.add=function(t){if(this.inf)return t;if(t.inf)return this;if(this.eq(t))return this.dbl();if(this.neg().eq(t))return this.curve.point(null,null);if(0===this.x.cmp(t.x))return this.curve.point(null,null);var e=this.y.redSub(t.y);0!==e.cmpn(0)&&(e=e.redMul(this.x.redSub(t.x).redInvm()));var r=e.redSqr().redISub(this.x).redISub(t.x),n=e.redMul(this.x.redSub(r)).redISub(this.y);return this.curve.point(r,n)},A.prototype.dbl=function(){if(this.inf)return this;var t=this.y.redAdd(this.y);if(0===t.cmpn(0))return this.curve.point(null,null);var e=this.curve.a,r=this.x.redSqr(),n=t.redInvm(),i=r.redAdd(r).redIAdd(r).redIAdd(e).redMul(n),o=i.redSqr().redISub(this.x.redAdd(this.x)),a=i.redMul(this.x.redSub(o)).redISub(this.y);return this.curve.point(o,a)},A.prototype.getX=function(){return this.x.fromRed()},A.prototype.getY=function(){return this.y.fromRed()},A.prototype.mul=function(t){return t=new i(t,16),this.isInfinity()?this:this._hasDoubles(t)?this.curve._fixedNafMul(this,t):this.curve.endo?this.curve._endoWnafMulAdd([this],[t]):this.curve._wnafMul(this,t)},A.prototype.mulAdd=function(t,e,r){var n=[this,e],i=[t,r];return this.curve.endo?this.curve._endoWnafMulAdd(n,i):this.curve._wnafMulAdd(1,n,i,2)},A.prototype.jmulAdd=function(t,e,r){var n=[this,e],i=[t,r];return this.curve.endo?this.curve._endoWnafMulAdd(n,i,!0):this.curve._wnafMulAdd(1,n,i,2,!0)},A.prototype.eq=function(t){return this===t||this.inf===t.inf&&(this.inf||0===this.x.cmp(t.x)&&0===this.y.cmp(t.y))},A.prototype.neg=function(t){if(this.inf)return this;var e=this.curve.point(this.x,this.y.redNeg());if(t&&this.precomputed){var r=this.precomputed,n=function(t){return t.neg()};e.precomputed={naf:r.naf&&{wnd:r.naf.wnd,points:r.naf.points.map(n)},doubles:r.doubles&&{step:r.doubles.step,points:r.doubles.points.map(n)}}}return e},A.prototype.toJ=function(){return this.inf?this.curve.jpoint(null,null,null):this.curve.jpoint(this.x,this.y,this.curve.one)},o(u,a.BasePoint),c.prototype.jpoint=function(t,e,r){return new u(this,t,e,r)},u.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var t=this.z.redInvm(),e=t.redSqr(),r=this.x.redMul(e),n=this.y.redMul(e).redMul(t);return this.curve.point(r,n)},u.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},u.prototype.add=function(t){if(this.isInfinity())return t;if(t.isInfinity())return this;var e=t.z.redSqr(),r=this.z.redSqr(),n=this.x.redMul(e),i=t.x.redMul(r),o=this.y.redMul(e.redMul(t.z)),a=t.y.redMul(r.redMul(this.z)),s=n.redSub(i),c=o.redSub(a);if(0===s.cmpn(0))return 0!==c.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var A=s.redSqr(),u=A.redMul(s),f=n.redMul(A),h=c.redSqr().redIAdd(u).redISub(f).redISub(f),l=c.redMul(f.redISub(h)).redISub(o.redMul(u)),d=this.z.redMul(t.z).redMul(s);return this.curve.jpoint(h,l,d)},u.prototype.mixedAdd=function(t){if(this.isInfinity())return t.toJ();if(t.isInfinity())return this;var e=this.z.redSqr(),r=this.x,n=t.x.redMul(e),i=this.y,o=t.y.redMul(e).redMul(this.z),a=r.redSub(n),s=i.redSub(o);if(0===a.cmpn(0))return 0!==s.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var c=a.redSqr(),A=c.redMul(a),u=r.redMul(c),f=s.redSqr().redIAdd(A).redISub(u).redISub(u),h=s.redMul(u.redISub(f)).redISub(i.redMul(A)),l=this.z.redMul(a);return this.curve.jpoint(f,h,l)},u.prototype.dblp=function(t){if(0===t)return this;if(this.isInfinity())return this;if(!t)return this.dbl();var e;if(this.curve.zeroA||this.curve.threeA){var r=this;for(e=0;e<t;e++)r=r.dbl();return r}var n=this.curve.a,i=this.curve.tinv,o=this.x,a=this.y,s=this.z,c=s.redSqr().redSqr(),A=a.redAdd(a);for(e=0;e<t;e++){var u=o.redSqr(),f=A.redSqr(),h=f.redSqr(),l=u.redAdd(u).redIAdd(u).redIAdd(n.redMul(c)),d=o.redMul(f),g=l.redSqr().redISub(d.redAdd(d)),p=d.redISub(g),y=l.redMul(p);y=y.redIAdd(y).redISub(h);var I=A.redMul(s);e+1<t&&(c=c.redMul(h)),o=g,s=I,A=y}return this.curve.jpoint(o,A.redMul(i),s)},u.prototype.dbl=function(){return this.isInfinity()?this:this.curve.zeroA?this._zeroDbl():this.curve.threeA?this._threeDbl():this._dbl()},u.prototype._zeroDbl=function(){var t,e,r;if(this.zOne){var n=this.x.redSqr(),i=this.y.redSqr(),o=i.redSqr(),a=this.x.redAdd(i).redSqr().redISub(n).redISub(o);a=a.redIAdd(a);var s=n.redAdd(n).redIAdd(n),c=s.redSqr().redISub(a).redISub(a),A=o.redIAdd(o);A=(A=A.redIAdd(A)).redIAdd(A),t=c,e=s.redMul(a.redISub(c)).redISub(A),r=this.y.redAdd(this.y)}else{var u=this.x.redSqr(),f=this.y.redSqr(),h=f.redSqr(),l=this.x.redAdd(f).redSqr().redISub(u).redISub(h);l=l.redIAdd(l);var d=u.redAdd(u).redIAdd(u),g=d.redSqr(),p=h.redIAdd(h);p=(p=p.redIAdd(p)).redIAdd(p),t=g.redISub(l).redISub(l),e=d.redMul(l.redISub(t)).redISub(p),r=(r=this.y.redMul(this.z)).redIAdd(r)}return this.curve.jpoint(t,e,r)},u.prototype._threeDbl=function(){var t,e,r;if(this.zOne){var n=this.x.redSqr(),i=this.y.redSqr(),o=i.redSqr(),a=this.x.redAdd(i).redSqr().redISub(n).redISub(o);a=a.redIAdd(a);var s=n.redAdd(n).redIAdd(n).redIAdd(this.curve.a),c=s.redSqr().redISub(a).redISub(a);t=c;var A=o.redIAdd(o);A=(A=A.redIAdd(A)).redIAdd(A),e=s.redMul(a.redISub(c)).redISub(A),r=this.y.redAdd(this.y)}else{var u=this.z.redSqr(),f=this.y.redSqr(),h=this.x.redMul(f),l=this.x.redSub(u).redMul(this.x.redAdd(u));l=l.redAdd(l).redIAdd(l);var d=h.redIAdd(h),g=(d=d.redIAdd(d)).redAdd(d);t=l.redSqr().redISub(g),r=this.y.redAdd(this.z).redSqr().redISub(f).redISub(u);var p=f.redSqr();p=(p=(p=p.redIAdd(p)).redIAdd(p)).redIAdd(p),e=l.redMul(d.redISub(t)).redISub(p)}return this.curve.jpoint(t,e,r)},u.prototype._dbl=function(){var t=this.curve.a,e=this.x,r=this.y,n=this.z,i=n.redSqr().redSqr(),o=e.redSqr(),a=r.redSqr(),s=o.redAdd(o).redIAdd(o).redIAdd(t.redMul(i)),c=e.redAdd(e),A=(c=c.redIAdd(c)).redMul(a),u=s.redSqr().redISub(A.redAdd(A)),f=A.redISub(u),h=a.redSqr();h=(h=(h=h.redIAdd(h)).redIAdd(h)).redIAdd(h);var l=s.redMul(f).redISub(h),d=r.redAdd(r).redMul(n);return this.curve.jpoint(u,l,d)},u.prototype.trpl=function(){if(!this.curve.zeroA)return this.dbl().add(this);var t=this.x.redSqr(),e=this.y.redSqr(),r=this.z.redSqr(),n=e.redSqr(),i=t.redAdd(t).redIAdd(t),o=i.redSqr(),a=this.x.redAdd(e).redSqr().redISub(t).redISub(n),s=(a=(a=(a=a.redIAdd(a)).redAdd(a).redIAdd(a)).redISub(o)).redSqr(),c=n.redIAdd(n);c=(c=(c=c.redIAdd(c)).redIAdd(c)).redIAdd(c);var A=i.redIAdd(a).redSqr().redISub(o).redISub(s).redISub(c),u=e.redMul(A);u=(u=u.redIAdd(u)).redIAdd(u);var f=this.x.redMul(s).redISub(u);f=(f=f.redIAdd(f)).redIAdd(f);var h=this.y.redMul(A.redMul(c.redISub(A)).redISub(a.redMul(s)));h=(h=(h=h.redIAdd(h)).redIAdd(h)).redIAdd(h);var l=this.z.redAdd(a).redSqr().redISub(r).redISub(s);return this.curve.jpoint(f,h,l)},u.prototype.mul=function(t,e){return t=new i(t,e),this.curve._wnafMul(this,t)},u.prototype.eq=function(t){if("affine"===t.type)return this.eq(t.toJ());if(this===t)return!0;var e=this.z.redSqr(),r=t.z.redSqr();if(0!==this.x.redMul(r).redISub(t.x.redMul(e)).cmpn(0))return!1;var n=e.redMul(this.z),i=r.redMul(t.z);return 0===this.y.redMul(i).redISub(t.y.redMul(n)).cmpn(0)},u.prototype.eqXToP=function(t){var e=this.z.redSqr(),r=t.toRed(this.curve.red).redMul(e);if(0===this.x.cmp(r))return!0;for(var n=t.clone(),i=this.curve.redN.redMul(e);;){if(n.iadd(this.curve.n),n.cmp(this.curve.p)>=0)return!1;if(r.redIAdd(i),0===this.x.cmp(r))return!0}},u.prototype.inspect=function(){return this.isInfinity()?"<EC JPoint Infinity>":"<EC JPoint x: "+this.x.toString(16,2)+" y: "+this.y.toString(16,2)+" z: "+this.z.toString(16,2)+">"},u.prototype.isInfinity=function(){return 0===this.z.cmpn(0)}},function(t,e,r){"use strict";var n=r(2),i=r(3),o=r(48),a=r(12);function s(t){o.call(this,"mont",t),this.a=new n(t.a,16).toRed(this.red),this.b=new n(t.b,16).toRed(this.red),this.i4=new n(4).toRed(this.red).redInvm(),this.two=new n(2).toRed(this.red),this.a24=this.i4.redMul(this.a.redAdd(this.two))}function c(t,e,r){o.BasePoint.call(this,t,"projective"),null===e&&null===r?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new n(e,16),this.z=new n(r,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)))}i(s,o),t.exports=s,s.prototype.validate=function(t){var e=t.normalize().x,r=e.redSqr(),n=r.redMul(e).redAdd(r.redMul(this.a)).redAdd(e);return 0===n.redSqrt().redSqr().cmp(n)},i(c,o.BasePoint),s.prototype.decodePoint=function(t,e){return this.point(a.toArray(t,e),1)},s.prototype.point=function(t,e){return new c(this,t,e)},s.prototype.pointFromJSON=function(t){return c.fromJSON(this,t)},c.prototype.precompute=function(){},c.prototype._encode=function(){return this.getX().toArray("be",this.curve.p.byteLength())},c.fromJSON=function(t,e){return new c(t,e[0],e[1]||t.one)},c.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" z: "+this.z.fromRed().toString(16,2)+">"},c.prototype.isInfinity=function(){return 0===this.z.cmpn(0)},c.prototype.dbl=function(){var t=this.x.redAdd(this.z).redSqr(),e=this.x.redSub(this.z).redSqr(),r=t.redSub(e),n=t.redMul(e),i=r.redMul(e.redAdd(this.curve.a24.redMul(r)));return this.curve.point(n,i)},c.prototype.add=function(){throw new Error("Not supported on Montgomery curve")},c.prototype.diffAdd=function(t,e){var r=this.x.redAdd(this.z),n=this.x.redSub(this.z),i=t.x.redAdd(t.z),o=t.x.redSub(t.z).redMul(r),a=i.redMul(n),s=e.z.redMul(o.redAdd(a).redSqr()),c=e.x.redMul(o.redISub(a).redSqr());return this.curve.point(s,c)},c.prototype.mul=function(t){for(var e=t.clone(),r=this,n=this.curve.point(null,null),i=[];0!==e.cmpn(0);e.iushrn(1))i.push(e.andln(1));for(var o=i.length-1;o>=0;o--)0===i[o]?(r=r.diffAdd(n,this),n=n.dbl()):(n=r.diffAdd(n,this),r=r.dbl());return n},c.prototype.mulAdd=function(){throw new Error("Not supported on Montgomery curve")},c.prototype.jumlAdd=function(){throw new Error("Not supported on Montgomery curve")},c.prototype.eq=function(t){return 0===this.getX().cmp(t.getX())},c.prototype.normalize=function(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this},c.prototype.getX=function(){return this.normalize(),this.x.fromRed()}},function(t,e,r){"use strict";var n=r(12),i=r(2),o=r(3),a=r(48),s=n.assert;function c(t){this.twisted=1!=(0|t.a),this.mOneA=this.twisted&&-1==(0|t.a),this.extended=this.mOneA,a.call(this,"edwards",t),this.a=new i(t.a,16).umod(this.red.m),this.a=this.a.toRed(this.red),this.c=new i(t.c,16).toRed(this.red),this.c2=this.c.redSqr(),this.d=new i(t.d,16).toRed(this.red),this.dd=this.d.redAdd(this.d),s(!this.twisted||0===this.c.fromRed().cmpn(1)),this.oneC=1==(0|t.c)}function A(t,e,r,n,o){a.BasePoint.call(this,t,"projective"),null===e&&null===r&&null===n?(this.x=this.curve.zero,this.y=this.curve.one,this.z=this.curve.one,this.t=this.curve.zero,this.zOne=!0):(this.x=new i(e,16),this.y=new i(r,16),this.z=n?new i(n,16):this.curve.one,this.t=o&&new i(o,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.t&&!this.t.red&&(this.t=this.t.toRed(this.curve.red)),this.zOne=this.z===this.curve.one,this.curve.extended&&!this.t&&(this.t=this.x.redMul(this.y),this.zOne||(this.t=this.t.redMul(this.z.redInvm()))))}o(c,a),t.exports=c,c.prototype._mulA=function(t){return this.mOneA?t.redNeg():this.a.redMul(t)},c.prototype._mulC=function(t){return this.oneC?t:this.c.redMul(t)},c.prototype.jpoint=function(t,e,r,n){return this.point(t,e,r,n)},c.prototype.pointFromX=function(t,e){(t=new i(t,16)).red||(t=t.toRed(this.red));var r=t.redSqr(),n=this.c2.redSub(this.a.redMul(r)),o=this.one.redSub(this.c2.redMul(this.d).redMul(r)),a=n.redMul(o.redInvm()),s=a.redSqrt();if(0!==s.redSqr().redSub(a).cmp(this.zero))throw new Error("invalid point");var c=s.fromRed().isOdd();return(e&&!c||!e&&c)&&(s=s.redNeg()),this.point(t,s)},c.prototype.pointFromY=function(t,e){(t=new i(t,16)).red||(t=t.toRed(this.red));var r=t.redSqr(),n=r.redSub(this.c2),o=r.redMul(this.d).redMul(this.c2).redSub(this.a),a=n.redMul(o.redInvm());if(0===a.cmp(this.zero)){if(e)throw new Error("invalid point");return this.point(this.zero,t)}var s=a.redSqrt();if(0!==s.redSqr().redSub(a).cmp(this.zero))throw new Error("invalid point");return s.fromRed().isOdd()!==e&&(s=s.redNeg()),this.point(s,t)},c.prototype.validate=function(t){if(t.isInfinity())return!0;t.normalize();var e=t.x.redSqr(),r=t.y.redSqr(),n=e.redMul(this.a).redAdd(r),i=this.c2.redMul(this.one.redAdd(this.d.redMul(e).redMul(r)));return 0===n.cmp(i)},o(A,a.BasePoint),c.prototype.pointFromJSON=function(t){return A.fromJSON(this,t)},c.prototype.point=function(t,e,r,n){return new A(this,t,e,r,n)},A.fromJSON=function(t,e){return new A(t,e[0],e[1],e[2])},A.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+" z: "+this.z.fromRed().toString(16,2)+">"},A.prototype.isInfinity=function(){return 0===this.x.cmpn(0)&&(0===this.y.cmp(this.z)||this.zOne&&0===this.y.cmp(this.curve.c))},A.prototype._extDbl=function(){var t=this.x.redSqr(),e=this.y.redSqr(),r=this.z.redSqr();r=r.redIAdd(r);var n=this.curve._mulA(t),i=this.x.redAdd(this.y).redSqr().redISub(t).redISub(e),o=n.redAdd(e),a=o.redSub(r),s=n.redSub(e),c=i.redMul(a),A=o.redMul(s),u=i.redMul(s),f=a.redMul(o);return this.curve.point(c,A,f,u)},A.prototype._projDbl=function(){var t,e,r,n,i,o,a=this.x.redAdd(this.y).redSqr(),s=this.x.redSqr(),c=this.y.redSqr();if(this.curve.twisted){var A=(n=this.curve._mulA(s)).redAdd(c);this.zOne?(t=a.redSub(s).redSub(c).redMul(A.redSub(this.curve.two)),e=A.redMul(n.redSub(c)),r=A.redSqr().redSub(A).redSub(A)):(i=this.z.redSqr(),o=A.redSub(i).redISub(i),t=a.redSub(s).redISub(c).redMul(o),e=A.redMul(n.redSub(c)),r=A.redMul(o))}else n=s.redAdd(c),i=this.curve._mulC(this.z).redSqr(),o=n.redSub(i).redSub(i),t=this.curve._mulC(a.redISub(n)).redMul(o),e=this.curve._mulC(n).redMul(s.redISub(c)),r=n.redMul(o);return this.curve.point(t,e,r)},A.prototype.dbl=function(){return this.isInfinity()?this:this.curve.extended?this._extDbl():this._projDbl()},A.prototype._extAdd=function(t){var e=this.y.redSub(this.x).redMul(t.y.redSub(t.x)),r=this.y.redAdd(this.x).redMul(t.y.redAdd(t.x)),n=this.t.redMul(this.curve.dd).redMul(t.t),i=this.z.redMul(t.z.redAdd(t.z)),o=r.redSub(e),a=i.redSub(n),s=i.redAdd(n),c=r.redAdd(e),A=o.redMul(a),u=s.redMul(c),f=o.redMul(c),h=a.redMul(s);return this.curve.point(A,u,h,f)},A.prototype._projAdd=function(t){var e,r,n=this.z.redMul(t.z),i=n.redSqr(),o=this.x.redMul(t.x),a=this.y.redMul(t.y),s=this.curve.d.redMul(o).redMul(a),c=i.redSub(s),A=i.redAdd(s),u=this.x.redAdd(this.y).redMul(t.x.redAdd(t.y)).redISub(o).redISub(a),f=n.redMul(c).redMul(u);return this.curve.twisted?(e=n.redMul(A).redMul(a.redSub(this.curve._mulA(o))),r=c.redMul(A)):(e=n.redMul(A).redMul(a.redSub(o)),r=this.curve._mulC(c).redMul(A)),this.curve.point(f,e,r)},A.prototype.add=function(t){return this.isInfinity()?t:t.isInfinity()?this:this.curve.extended?this._extAdd(t):this._projAdd(t)},A.prototype.mul=function(t){return this._hasDoubles(t)?this.curve._fixedNafMul(this,t):this.curve._wnafMul(this,t)},A.prototype.mulAdd=function(t,e,r){return this.curve._wnafMulAdd(1,[this,e],[t,r],2,!1)},A.prototype.jmulAdd=function(t,e,r){return this.curve._wnafMulAdd(1,[this,e],[t,r],2,!0)},A.prototype.normalize=function(){if(this.zOne)return this;var t=this.z.redInvm();return this.x=this.x.redMul(t),this.y=this.y.redMul(t),this.t&&(this.t=this.t.redMul(t)),this.z=this.curve.one,this.zOne=!0,this},A.prototype.neg=function(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())},A.prototype.getX=function(){return this.normalize(),this.x.fromRed()},A.prototype.getY=function(){return this.normalize(),this.y.fromRed()},A.prototype.eq=function(t){return this===t||0===this.getX().cmp(t.getX())&&0===this.getY().cmp(t.getY())},A.prototype.eqXToP=function(t){var e=t.toRed(this.curve.red).redMul(this.z);if(0===this.x.cmp(e))return!0;for(var r=t.clone(),n=this.curve.redN.redMul(this.z);;){if(r.iadd(this.curve.n),r.cmp(this.curve.p)>=0)return!1;if(e.redIAdd(n),0===this.x.cmp(e))return!0}},A.prototype.toP=A.prototype.normalize,A.prototype.mixedAdd=A.prototype.add},function(t,e){t.exports={doubles:{step:4,points:[["e60fce93b59e9ec53011aabc21c23e97b2a31369b87a5ae9c44ee89e2a6dec0a","f7e3507399e595929db99f34f57937101296891e44d23f0be1f32cce69616821"],["8282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508","11f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26caf"],["175e159f728b865a72f99cc6c6fc846de0b93833fd2222ed73fce5b551e5b739","d3506e0d9e3c79eba4ef97a51ff71f5eacb5955add24345c6efa6ffee9fed695"],["363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640","4e273adfc732221953b445397f3363145b9a89008199ecb62003c7f3bee9de9"],["8b4b5f165df3c2be8c6244b5b745638843e4a781a15bcd1b69f79a55dffdf80c","4aad0a6f68d308b4b3fbd7813ab0da04f9e336546162ee56b3eff0c65fd4fd36"],["723cbaa6e5db996d6bf771c00bd548c7b700dbffa6c0e77bcb6115925232fcda","96e867b5595cc498a921137488824d6e2660a0653779494801dc069d9eb39f5f"],["eebfa4d493bebf98ba5feec812c2d3b50947961237a919839a533eca0e7dd7fa","5d9a8ca3970ef0f269ee7edaf178089d9ae4cdc3a711f712ddfd4fdae1de8999"],["100f44da696e71672791d0a09b7bde459f1215a29b3c03bfefd7835b39a48db0","cdd9e13192a00b772ec8f3300c090666b7ff4a18ff5195ac0fbd5cd62bc65a09"],["e1031be262c7ed1b1dc9227a4a04c017a77f8d4464f3b3852c8acde6e534fd2d","9d7061928940405e6bb6a4176597535af292dd419e1ced79a44f18f29456a00d"],["feea6cae46d55b530ac2839f143bd7ec5cf8b266a41d6af52d5e688d9094696d","e57c6b6c97dce1bab06e4e12bf3ecd5c981c8957cc41442d3155debf18090088"],["da67a91d91049cdcb367be4be6ffca3cfeed657d808583de33fa978bc1ec6cb1","9bacaa35481642bc41f463f7ec9780e5dec7adc508f740a17e9ea8e27a68be1d"],["53904faa0b334cdda6e000935ef22151ec08d0f7bb11069f57545ccc1a37b7c0","5bc087d0bc80106d88c9eccac20d3c1c13999981e14434699dcb096b022771c8"],["8e7bcd0bd35983a7719cca7764ca906779b53a043a9b8bcaeff959f43ad86047","10b7770b2a3da4b3940310420ca9514579e88e2e47fd68b3ea10047e8460372a"],["385eed34c1cdff21e6d0818689b81bde71a7f4f18397e6690a841e1599c43862","283bebc3e8ea23f56701de19e9ebf4576b304eec2086dc8cc0458fe5542e5453"],["6f9d9b803ecf191637c73a4413dfa180fddf84a5947fbc9c606ed86c3fac3a7","7c80c68e603059ba69b8e2a30e45c4d47ea4dd2f5c281002d86890603a842160"],["3322d401243c4e2582a2147c104d6ecbf774d163db0f5e5313b7e0e742d0e6bd","56e70797e9664ef5bfb019bc4ddaf9b72805f63ea2873af624f3a2e96c28b2a0"],["85672c7d2de0b7da2bd1770d89665868741b3f9af7643397721d74d28134ab83","7c481b9b5b43b2eb6374049bfa62c2e5e77f17fcc5298f44c8e3094f790313a6"],["948bf809b1988a46b06c9f1919413b10f9226c60f668832ffd959af60c82a0a","53a562856dcb6646dc6b74c5d1c3418c6d4dff08c97cd2bed4cb7f88d8c8e589"],["6260ce7f461801c34f067ce0f02873a8f1b0e44dfc69752accecd819f38fd8e8","bc2da82b6fa5b571a7f09049776a1ef7ecd292238051c198c1a84e95b2b4ae17"],["e5037de0afc1d8d43d8348414bbf4103043ec8f575bfdc432953cc8d2037fa2d","4571534baa94d3b5f9f98d09fb990bddbd5f5b03ec481f10e0e5dc841d755bda"],["e06372b0f4a207adf5ea905e8f1771b4e7e8dbd1c6a6c5b725866a0ae4fce725","7a908974bce18cfe12a27bb2ad5a488cd7484a7787104870b27034f94eee31dd"],["213c7a715cd5d45358d0bbf9dc0ce02204b10bdde2a3f58540ad6908d0559754","4b6dad0b5ae462507013ad06245ba190bb4850f5f36a7eeddff2c27534b458f2"],["4e7c272a7af4b34e8dbb9352a5419a87e2838c70adc62cddf0cc3a3b08fbd53c","17749c766c9d0b18e16fd09f6def681b530b9614bff7dd33e0b3941817dcaae6"],["fea74e3dbe778b1b10f238ad61686aa5c76e3db2be43057632427e2840fb27b6","6e0568db9b0b13297cf674deccb6af93126b596b973f7b77701d3db7f23cb96f"],["76e64113f677cf0e10a2570d599968d31544e179b760432952c02a4417bdde39","c90ddf8dee4e95cf577066d70681f0d35e2a33d2b56d2032b4b1752d1901ac01"],["c738c56b03b2abe1e8281baa743f8f9a8f7cc643df26cbee3ab150242bcbb891","893fb578951ad2537f718f2eacbfbbbb82314eef7880cfe917e735d9699a84c3"],["d895626548b65b81e264c7637c972877d1d72e5f3a925014372e9f6588f6c14b","febfaa38f2bc7eae728ec60818c340eb03428d632bb067e179363ed75d7d991f"],["b8da94032a957518eb0f6433571e8761ceffc73693e84edd49150a564f676e03","2804dfa44805a1e4d7c99cc9762808b092cc584d95ff3b511488e4e74efdf6e7"],["e80fea14441fb33a7d8adab9475d7fab2019effb5156a792f1a11778e3c0df5d","eed1de7f638e00771e89768ca3ca94472d155e80af322ea9fcb4291b6ac9ec78"],["a301697bdfcd704313ba48e51d567543f2a182031efd6915ddc07bbcc4e16070","7370f91cfb67e4f5081809fa25d40f9b1735dbf7c0a11a130c0d1a041e177ea1"],["90ad85b389d6b936463f9d0512678de208cc330b11307fffab7ac63e3fb04ed4","e507a3620a38261affdcbd9427222b839aefabe1582894d991d4d48cb6ef150"],["8f68b9d2f63b5f339239c1ad981f162ee88c5678723ea3351b7b444c9ec4c0da","662a9f2dba063986de1d90c2b6be215dbbea2cfe95510bfdf23cbf79501fff82"],["e4f3fb0176af85d65ff99ff9198c36091f48e86503681e3e6686fd5053231e11","1e63633ad0ef4f1c1661a6d0ea02b7286cc7e74ec951d1c9822c38576feb73bc"],["8c00fa9b18ebf331eb961537a45a4266c7034f2f0d4e1d0716fb6eae20eae29e","efa47267fea521a1a9dc343a3736c974c2fadafa81e36c54e7d2a4c66702414b"],["e7a26ce69dd4829f3e10cec0a9e98ed3143d084f308b92c0997fddfc60cb3e41","2a758e300fa7984b471b006a1aafbb18d0a6b2c0420e83e20e8a9421cf2cfd51"],["b6459e0ee3662ec8d23540c223bcbdc571cbcb967d79424f3cf29eb3de6b80ef","67c876d06f3e06de1dadf16e5661db3c4b3ae6d48e35b2ff30bf0b61a71ba45"],["d68a80c8280bb840793234aa118f06231d6f1fc67e73c5a5deda0f5b496943e8","db8ba9fff4b586d00c4b1f9177b0e28b5b0e7b8f7845295a294c84266b133120"],["324aed7df65c804252dc0270907a30b09612aeb973449cea4095980fc28d3d5d","648a365774b61f2ff130c0c35aec1f4f19213b0c7e332843967224af96ab7c84"],["4df9c14919cde61f6d51dfdbe5fee5dceec4143ba8d1ca888e8bd373fd054c96","35ec51092d8728050974c23a1d85d4b5d506cdc288490192ebac06cad10d5d"],["9c3919a84a474870faed8a9c1cc66021523489054d7f0308cbfc99c8ac1f98cd","ddb84f0f4a4ddd57584f044bf260e641905326f76c64c8e6be7e5e03d4fc599d"],["6057170b1dd12fdf8de05f281d8e06bb91e1493a8b91d4cc5a21382120a959e5","9a1af0b26a6a4807add9a2daf71df262465152bc3ee24c65e899be932385a2a8"],["a576df8e23a08411421439a4518da31880cef0fba7d4df12b1a6973eecb94266","40a6bf20e76640b2c92b97afe58cd82c432e10a7f514d9f3ee8be11ae1b28ec8"],["7778a78c28dec3e30a05fe9629de8c38bb30d1f5cf9a3a208f763889be58ad71","34626d9ab5a5b22ff7098e12f2ff580087b38411ff24ac563b513fc1fd9f43ac"],["928955ee637a84463729fd30e7afd2ed5f96274e5ad7e5cb09eda9c06d903ac","c25621003d3f42a827b78a13093a95eeac3d26efa8a8d83fc5180e935bcd091f"],["85d0fef3ec6db109399064f3a0e3b2855645b4a907ad354527aae75163d82751","1f03648413a38c0be29d496e582cf5663e8751e96877331582c237a24eb1f962"],["ff2b0dce97eece97c1c9b6041798b85dfdfb6d8882da20308f5404824526087e","493d13fef524ba188af4c4dc54d07936c7b7ed6fb90e2ceb2c951e01f0c29907"],["827fbbe4b1e880ea9ed2b2e6301b212b57f1ee148cd6dd28780e5e2cf856e241","c60f9c923c727b0b71bef2c67d1d12687ff7a63186903166d605b68baec293ec"],["eaa649f21f51bdbae7be4ae34ce6e5217a58fdce7f47f9aa7f3b58fa2120e2b3","be3279ed5bbbb03ac69a80f89879aa5a01a6b965f13f7e59d47a5305ba5ad93d"],["e4a42d43c5cf169d9391df6decf42ee541b6d8f0c9a137401e23632dda34d24f","4d9f92e716d1c73526fc99ccfb8ad34ce886eedfa8d8e4f13a7f7131deba9414"],["1ec80fef360cbdd954160fadab352b6b92b53576a88fea4947173b9d4300bf19","aeefe93756b5340d2f3a4958a7abbf5e0146e77f6295a07b671cdc1cc107cefd"],["146a778c04670c2f91b00af4680dfa8bce3490717d58ba889ddb5928366642be","b318e0ec3354028add669827f9d4b2870aaa971d2f7e5ed1d0b297483d83efd0"],["fa50c0f61d22e5f07e3acebb1aa07b128d0012209a28b9776d76a8793180eef9","6b84c6922397eba9b72cd2872281a68a5e683293a57a213b38cd8d7d3f4f2811"],["da1d61d0ca721a11b1a5bf6b7d88e8421a288ab5d5bba5220e53d32b5f067ec2","8157f55a7c99306c79c0766161c91e2966a73899d279b48a655fba0f1ad836f1"],["a8e282ff0c9706907215ff98e8fd416615311de0446f1e062a73b0610d064e13","7f97355b8db81c09abfb7f3c5b2515888b679a3e50dd6bd6cef7c73111f4cc0c"],["174a53b9c9a285872d39e56e6913cab15d59b1fa512508c022f382de8319497c","ccc9dc37abfc9c1657b4155f2c47f9e6646b3a1d8cb9854383da13ac079afa73"],["959396981943785c3d3e57edf5018cdbe039e730e4918b3d884fdff09475b7ba","2e7e552888c331dd8ba0386a4b9cd6849c653f64c8709385e9b8abf87524f2fd"],["d2a63a50ae401e56d645a1153b109a8fcca0a43d561fba2dbb51340c9d82b151","e82d86fb6443fcb7565aee58b2948220a70f750af484ca52d4142174dcf89405"],["64587e2335471eb890ee7896d7cfdc866bacbdbd3839317b3436f9b45617e073","d99fcdd5bf6902e2ae96dd6447c299a185b90a39133aeab358299e5e9faf6589"],["8481bde0e4e4d885b3a546d3e549de042f0aa6cea250e7fd358d6c86dd45e458","38ee7b8cba5404dd84a25bf39cecb2ca900a79c42b262e556d64b1b59779057e"],["13464a57a78102aa62b6979ae817f4637ffcfed3c4b1ce30bcd6303f6caf666b","69be159004614580ef7e433453ccb0ca48f300a81d0942e13f495a907f6ecc27"],["bc4a9df5b713fe2e9aef430bcc1dc97a0cd9ccede2f28588cada3a0d2d83f366","d3a81ca6e785c06383937adf4b798caa6e8a9fbfa547b16d758d666581f33c1"],["8c28a97bf8298bc0d23d8c749452a32e694b65e30a9472a3954ab30fe5324caa","40a30463a3305193378fedf31f7cc0eb7ae784f0451cb9459e71dc73cbef9482"],["8ea9666139527a8c1dd94ce4f071fd23c8b350c5a4bb33748c4ba111faccae0","620efabbc8ee2782e24e7c0cfb95c5d735b783be9cf0f8e955af34a30e62b945"],["dd3625faef5ba06074669716bbd3788d89bdde815959968092f76cc4eb9a9787","7a188fa3520e30d461da2501045731ca941461982883395937f68d00c644a573"],["f710d79d9eb962297e4f6232b40e8f7feb2bc63814614d692c12de752408221e","ea98e67232d3b3295d3b535532115ccac8612c721851617526ae47a9c77bfc82"]]},naf:{wnd:7,points:[["f9308a019258c31049344f85f89d5229b531c845836f99b08601f113bce036f9","388f7b0f632de8140fe337e62a37f3566500a99934c2231b6cb9fd7584b8e672"],["2f8bde4d1a07209355b4a7250a5c5128e88b84bddc619ab7cba8d569b240efe4","d8ac222636e5e3d6d4dba9dda6c9c426f788271bab0d6840dca87d3aa6ac62d6"],["5cbdf0646e5db4eaa398f365f2ea7a0e3d419b7e0330e39ce92bddedcac4f9bc","6aebca40ba255960a3178d6d861a54dba813d0b813fde7b5a5082628087264da"],["acd484e2f0c7f65309ad178a9f559abde09796974c57e714c35f110dfc27ccbe","cc338921b0a7d9fd64380971763b61e9add888a4375f8e0f05cc262ac64f9c37"],["774ae7f858a9411e5ef4246b70c65aac5649980be5c17891bbec17895da008cb","d984a032eb6b5e190243dd56d7b7b365372db1e2dff9d6a8301d74c9c953c61b"],["f28773c2d975288bc7d1d205c3748651b075fbc6610e58cddeeddf8f19405aa8","ab0902e8d880a89758212eb65cdaf473a1a06da521fa91f29b5cb52db03ed81"],["d7924d4f7d43ea965a465ae3095ff41131e5946f3c85f79e44adbcf8e27e080e","581e2872a86c72a683842ec228cc6defea40af2bd896d3a5c504dc9ff6a26b58"],["defdea4cdb677750a420fee807eacf21eb9898ae79b9768766e4faa04a2d4a34","4211ab0694635168e997b0ead2a93daeced1f4a04a95c0f6cfb199f69e56eb77"],["2b4ea0a797a443d293ef5cff444f4979f06acfebd7e86d277475656138385b6c","85e89bc037945d93b343083b5a1c86131a01f60c50269763b570c854e5c09b7a"],["352bbf4a4cdd12564f93fa332ce333301d9ad40271f8107181340aef25be59d5","321eb4075348f534d59c18259dda3e1f4a1b3b2e71b1039c67bd3d8bcf81998c"],["2fa2104d6b38d11b0230010559879124e42ab8dfeff5ff29dc9cdadd4ecacc3f","2de1068295dd865b64569335bd5dd80181d70ecfc882648423ba76b532b7d67"],["9248279b09b4d68dab21a9b066edda83263c3d84e09572e269ca0cd7f5453714","73016f7bf234aade5d1aa71bdea2b1ff3fc0de2a887912ffe54a32ce97cb3402"],["daed4f2be3a8bf278e70132fb0beb7522f570e144bf615c07e996d443dee8729","a69dce4a7d6c98e8d4a1aca87ef8d7003f83c230f3afa726ab40e52290be1c55"],["c44d12c7065d812e8acf28d7cbb19f9011ecd9e9fdf281b0e6a3b5e87d22e7db","2119a460ce326cdc76c45926c982fdac0e106e861edf61c5a039063f0e0e6482"],["6a245bf6dc698504c89a20cfded60853152b695336c28063b61c65cbd269e6b4","e022cf42c2bd4a708b3f5126f16a24ad8b33ba48d0423b6efd5e6348100d8a82"],["1697ffa6fd9de627c077e3d2fe541084ce13300b0bec1146f95ae57f0d0bd6a5","b9c398f186806f5d27561506e4557433a2cf15009e498ae7adee9d63d01b2396"],["605bdb019981718b986d0f07e834cb0d9deb8360ffb7f61df982345ef27a7479","2972d2de4f8d20681a78d93ec96fe23c26bfae84fb14db43b01e1e9056b8c49"],["62d14dab4150bf497402fdc45a215e10dcb01c354959b10cfe31c7e9d87ff33d","80fc06bd8cc5b01098088a1950eed0db01aa132967ab472235f5642483b25eaf"],["80c60ad0040f27dade5b4b06c408e56b2c50e9f56b9b8b425e555c2f86308b6f","1c38303f1cc5c30f26e66bad7fe72f70a65eed4cbe7024eb1aa01f56430bd57a"],["7a9375ad6167ad54aa74c6348cc54d344cc5dc9487d847049d5eabb0fa03c8fb","d0e3fa9eca8726909559e0d79269046bdc59ea10c70ce2b02d499ec224dc7f7"],["d528ecd9b696b54c907a9ed045447a79bb408ec39b68df504bb51f459bc3ffc9","eecf41253136e5f99966f21881fd656ebc4345405c520dbc063465b521409933"],["49370a4b5f43412ea25f514e8ecdad05266115e4a7ecb1387231808f8b45963","758f3f41afd6ed428b3081b0512fd62a54c3f3afbb5b6764b653052a12949c9a"],["77f230936ee88cbbd73df930d64702ef881d811e0e1498e2f1c13eb1fc345d74","958ef42a7886b6400a08266e9ba1b37896c95330d97077cbbe8eb3c7671c60d6"],["f2dac991cc4ce4b9ea44887e5c7c0bce58c80074ab9d4dbaeb28531b7739f530","e0dedc9b3b2f8dad4da1f32dec2531df9eb5fbeb0598e4fd1a117dba703a3c37"],["463b3d9f662621fb1b4be8fbbe2520125a216cdfc9dae3debcba4850c690d45b","5ed430d78c296c3543114306dd8622d7c622e27c970a1de31cb377b01af7307e"],["f16f804244e46e2a09232d4aff3b59976b98fac14328a2d1a32496b49998f247","cedabd9b82203f7e13d206fcdf4e33d92a6c53c26e5cce26d6579962c4e31df6"],["caf754272dc84563b0352b7a14311af55d245315ace27c65369e15f7151d41d1","cb474660ef35f5f2a41b643fa5e460575f4fa9b7962232a5c32f908318a04476"],["2600ca4b282cb986f85d0f1709979d8b44a09c07cb86d7c124497bc86f082120","4119b88753c15bd6a693b03fcddbb45d5ac6be74ab5f0ef44b0be9475a7e4b40"],["7635ca72d7e8432c338ec53cd12220bc01c48685e24f7dc8c602a7746998e435","91b649609489d613d1d5e590f78e6d74ecfc061d57048bad9e76f302c5b9c61"],["754e3239f325570cdbbf4a87deee8a66b7f2b33479d468fbc1a50743bf56cc18","673fb86e5bda30fb3cd0ed304ea49a023ee33d0197a695d0c5d98093c536683"],["e3e6bd1071a1e96aff57859c82d570f0330800661d1c952f9fe2694691d9b9e8","59c9e0bba394e76f40c0aa58379a3cb6a5a2283993e90c4167002af4920e37f5"],["186b483d056a033826ae73d88f732985c4ccb1f32ba35f4b4cc47fdcf04aa6eb","3b952d32c67cf77e2e17446e204180ab21fb8090895138b4a4a797f86e80888b"],["df9d70a6b9876ce544c98561f4be4f725442e6d2b737d9c91a8321724ce0963f","55eb2dafd84d6ccd5f862b785dc39d4ab157222720ef9da217b8c45cf2ba2417"],["5edd5cc23c51e87a497ca815d5dce0f8ab52554f849ed8995de64c5f34ce7143","efae9c8dbc14130661e8cec030c89ad0c13c66c0d17a2905cdc706ab7399a868"],["290798c2b6476830da12fe02287e9e777aa3fba1c355b17a722d362f84614fba","e38da76dcd440621988d00bcf79af25d5b29c094db2a23146d003afd41943e7a"],["af3c423a95d9f5b3054754efa150ac39cd29552fe360257362dfdecef4053b45","f98a3fd831eb2b749a93b0e6f35cfb40c8cd5aa667a15581bc2feded498fd9c6"],["766dbb24d134e745cccaa28c99bf274906bb66b26dcf98df8d2fed50d884249a","744b1152eacbe5e38dcc887980da38b897584a65fa06cedd2c924f97cbac5996"],["59dbf46f8c94759ba21277c33784f41645f7b44f6c596a58ce92e666191abe3e","c534ad44175fbc300f4ea6ce648309a042ce739a7919798cd85e216c4a307f6e"],["f13ada95103c4537305e691e74e9a4a8dd647e711a95e73cb62dc6018cfd87b8","e13817b44ee14de663bf4bc808341f326949e21a6a75c2570778419bdaf5733d"],["7754b4fa0e8aced06d4167a2c59cca4cda1869c06ebadfb6488550015a88522c","30e93e864e669d82224b967c3020b8fa8d1e4e350b6cbcc537a48b57841163a2"],["948dcadf5990e048aa3874d46abef9d701858f95de8041d2a6828c99e2262519","e491a42537f6e597d5d28a3224b1bc25df9154efbd2ef1d2cbba2cae5347d57e"],["7962414450c76c1689c7b48f8202ec37fb224cf5ac0bfa1570328a8a3d7c77ab","100b610ec4ffb4760d5c1fc133ef6f6b12507a051f04ac5760afa5b29db83437"],["3514087834964b54b15b160644d915485a16977225b8847bb0dd085137ec47ca","ef0afbb2056205448e1652c48e8127fc6039e77c15c2378b7e7d15a0de293311"],["d3cc30ad6b483e4bc79ce2c9dd8bc54993e947eb8df787b442943d3f7b527eaf","8b378a22d827278d89c5e9be8f9508ae3c2ad46290358630afb34db04eede0a4"],["1624d84780732860ce1c78fcbfefe08b2b29823db913f6493975ba0ff4847610","68651cf9b6da903e0914448c6cd9d4ca896878f5282be4c8cc06e2a404078575"],["733ce80da955a8a26902c95633e62a985192474b5af207da6df7b4fd5fc61cd4","f5435a2bd2badf7d485a4d8b8db9fcce3e1ef8e0201e4578c54673bc1dc5ea1d"],["15d9441254945064cf1a1c33bbd3b49f8966c5092171e699ef258dfab81c045c","d56eb30b69463e7234f5137b73b84177434800bacebfc685fc37bbe9efe4070d"],["a1d0fcf2ec9de675b612136e5ce70d271c21417c9d2b8aaaac138599d0717940","edd77f50bcb5a3cab2e90737309667f2641462a54070f3d519212d39c197a629"],["e22fbe15c0af8ccc5780c0735f84dbe9a790badee8245c06c7ca37331cb36980","a855babad5cd60c88b430a69f53a1a7a38289154964799be43d06d77d31da06"],["311091dd9860e8e20ee13473c1155f5f69635e394704eaa74009452246cfa9b3","66db656f87d1f04fffd1f04788c06830871ec5a64feee685bd80f0b1286d8374"],["34c1fd04d301be89b31c0442d3e6ac24883928b45a9340781867d4232ec2dbdf","9414685e97b1b5954bd46f730174136d57f1ceeb487443dc5321857ba73abee"],["f219ea5d6b54701c1c14de5b557eb42a8d13f3abbcd08affcc2a5e6b049b8d63","4cb95957e83d40b0f73af4544cccf6b1f4b08d3c07b27fb8d8c2962a400766d1"],["d7b8740f74a8fbaab1f683db8f45de26543a5490bca627087236912469a0b448","fa77968128d9c92ee1010f337ad4717eff15db5ed3c049b3411e0315eaa4593b"],["32d31c222f8f6f0ef86f7c98d3a3335ead5bcd32abdd94289fe4d3091aa824bf","5f3032f5892156e39ccd3d7915b9e1da2e6dac9e6f26e961118d14b8462e1661"],["7461f371914ab32671045a155d9831ea8793d77cd59592c4340f86cbc18347b5","8ec0ba238b96bec0cbdddcae0aa442542eee1ff50c986ea6b39847b3cc092ff6"],["ee079adb1df1860074356a25aa38206a6d716b2c3e67453d287698bad7b2b2d6","8dc2412aafe3be5c4c5f37e0ecc5f9f6a446989af04c4e25ebaac479ec1c8c1e"],["16ec93e447ec83f0467b18302ee620f7e65de331874c9dc72bfd8616ba9da6b5","5e4631150e62fb40d0e8c2a7ca5804a39d58186a50e497139626778e25b0674d"],["eaa5f980c245f6f038978290afa70b6bd8855897f98b6aa485b96065d537bd99","f65f5d3e292c2e0819a528391c994624d784869d7e6ea67fb18041024edc07dc"],["78c9407544ac132692ee1910a02439958ae04877151342ea96c4b6b35a49f51","f3e0319169eb9b85d5404795539a5e68fa1fbd583c064d2462b675f194a3ddb4"],["494f4be219a1a77016dcd838431aea0001cdc8ae7a6fc688726578d9702857a5","42242a969283a5f339ba7f075e36ba2af925ce30d767ed6e55f4b031880d562c"],["a598a8030da6d86c6bc7f2f5144ea549d28211ea58faa70ebf4c1e665c1fe9b5","204b5d6f84822c307e4b4a7140737aec23fc63b65b35f86a10026dbd2d864e6b"],["c41916365abb2b5d09192f5f2dbeafec208f020f12570a184dbadc3e58595997","4f14351d0087efa49d245b328984989d5caf9450f34bfc0ed16e96b58fa9913"],["841d6063a586fa475a724604da03bc5b92a2e0d2e0a36acfe4c73a5514742881","73867f59c0659e81904f9a1c7543698e62562d6744c169ce7a36de01a8d6154"],["5e95bb399a6971d376026947f89bde2f282b33810928be4ded112ac4d70e20d5","39f23f366809085beebfc71181313775a99c9aed7d8ba38b161384c746012865"],["36e4641a53948fd476c39f8a99fd974e5ec07564b5315d8bf99471bca0ef2f66","d2424b1b1abe4eb8164227b085c9aa9456ea13493fd563e06fd51cf5694c78fc"],["336581ea7bfbbb290c191a2f507a41cf5643842170e914faeab27c2c579f726","ead12168595fe1be99252129b6e56b3391f7ab1410cd1e0ef3dcdcabd2fda224"],["8ab89816dadfd6b6a1f2634fcf00ec8403781025ed6890c4849742706bd43ede","6fdcef09f2f6d0a044e654aef624136f503d459c3e89845858a47a9129cdd24e"],["1e33f1a746c9c5778133344d9299fcaa20b0938e8acff2544bb40284b8c5fb94","60660257dd11b3aa9c8ed618d24edff2306d320f1d03010e33a7d2057f3b3b6"],["85b7c1dcb3cec1b7ee7f30ded79dd20a0ed1f4cc18cbcfcfa410361fd8f08f31","3d98a9cdd026dd43f39048f25a8847f4fcafad1895d7a633c6fed3c35e999511"],["29df9fbd8d9e46509275f4b125d6d45d7fbe9a3b878a7af872a2800661ac5f51","b4c4fe99c775a606e2d8862179139ffda61dc861c019e55cd2876eb2a27d84b"],["a0b1cae06b0a847a3fea6e671aaf8adfdfe58ca2f768105c8082b2e449fce252","ae434102edde0958ec4b19d917a6a28e6b72da1834aff0e650f049503a296cf2"],["4e8ceafb9b3e9a136dc7ff67e840295b499dfb3b2133e4ba113f2e4c0e121e5","cf2174118c8b6d7a4b48f6d534ce5c79422c086a63460502b827ce62a326683c"],["d24a44e047e19b6f5afb81c7ca2f69080a5076689a010919f42725c2b789a33b","6fb8d5591b466f8fc63db50f1c0f1c69013f996887b8244d2cdec417afea8fa3"],["ea01606a7a6c9cdd249fdfcfacb99584001edd28abbab77b5104e98e8e3b35d4","322af4908c7312b0cfbfe369f7a7b3cdb7d4494bc2823700cfd652188a3ea98d"],["af8addbf2b661c8a6c6328655eb96651252007d8c5ea31be4ad196de8ce2131f","6749e67c029b85f52a034eafd096836b2520818680e26ac8f3dfbcdb71749700"],["e3ae1974566ca06cc516d47e0fb165a674a3dabcfca15e722f0e3450f45889","2aeabe7e4531510116217f07bf4d07300de97e4874f81f533420a72eeb0bd6a4"],["591ee355313d99721cf6993ffed1e3e301993ff3ed258802075ea8ced397e246","b0ea558a113c30bea60fc4775460c7901ff0b053d25ca2bdeee98f1a4be5d196"],["11396d55fda54c49f19aa97318d8da61fa8584e47b084945077cf03255b52984","998c74a8cd45ac01289d5833a7beb4744ff536b01b257be4c5767bea93ea57a4"],["3c5d2a1ba39c5a1790000738c9e0c40b8dcdfd5468754b6405540157e017aa7a","b2284279995a34e2f9d4de7396fc18b80f9b8b9fdd270f6661f79ca4c81bd257"],["cc8704b8a60a0defa3a99a7299f2e9c3fbc395afb04ac078425ef8a1793cc030","bdd46039feed17881d1e0862db347f8cf395b74fc4bcdc4e940b74e3ac1f1b13"],["c533e4f7ea8555aacd9777ac5cad29b97dd4defccc53ee7ea204119b2889b197","6f0a256bc5efdf429a2fb6242f1a43a2d9b925bb4a4b3a26bb8e0f45eb596096"],["c14f8f2ccb27d6f109f6d08d03cc96a69ba8c34eec07bbcf566d48e33da6593","c359d6923bb398f7fd4473e16fe1c28475b740dd098075e6c0e8649113dc3a38"],["a6cbc3046bc6a450bac24789fa17115a4c9739ed75f8f21ce441f72e0b90e6ef","21ae7f4680e889bb130619e2c0f95a360ceb573c70603139862afd617fa9b9f"],["347d6d9a02c48927ebfb86c1359b1caf130a3c0267d11ce6344b39f99d43cc38","60ea7f61a353524d1c987f6ecec92f086d565ab687870cb12689ff1e31c74448"],["da6545d2181db8d983f7dcb375ef5866d47c67b1bf31c8cf855ef7437b72656a","49b96715ab6878a79e78f07ce5680c5d6673051b4935bd897fea824b77dc208a"],["c40747cc9d012cb1a13b8148309c6de7ec25d6945d657146b9d5994b8feb1111","5ca560753be2a12fc6de6caf2cb489565db936156b9514e1bb5e83037e0fa2d4"],["4e42c8ec82c99798ccf3a610be870e78338c7f713348bd34c8203ef4037f3502","7571d74ee5e0fb92a7a8b33a07783341a5492144cc54bcc40a94473693606437"],["3775ab7089bc6af823aba2e1af70b236d251cadb0c86743287522a1b3b0dedea","be52d107bcfa09d8bcb9736a828cfa7fac8db17bf7a76a2c42ad961409018cf7"],["cee31cbf7e34ec379d94fb814d3d775ad954595d1314ba8846959e3e82f74e26","8fd64a14c06b589c26b947ae2bcf6bfa0149ef0be14ed4d80f448a01c43b1c6d"],["b4f9eaea09b6917619f6ea6a4eb5464efddb58fd45b1ebefcdc1a01d08b47986","39e5c9925b5a54b07433a4f18c61726f8bb131c012ca542eb24a8ac07200682a"],["d4263dfc3d2df923a0179a48966d30ce84e2515afc3dccc1b77907792ebcc60e","62dfaf07a0f78feb30e30d6295853ce189e127760ad6cf7fae164e122a208d54"],["48457524820fa65a4f8d35eb6930857c0032acc0a4a2de422233eeda897612c4","25a748ab367979d98733c38a1fa1c2e7dc6cc07db2d60a9ae7a76aaa49bd0f77"],["dfeeef1881101f2cb11644f3a2afdfc2045e19919152923f367a1767c11cceda","ecfb7056cf1de042f9420bab396793c0c390bde74b4bbdff16a83ae09a9a7517"],["6d7ef6b17543f8373c573f44e1f389835d89bcbc6062ced36c82df83b8fae859","cd450ec335438986dfefa10c57fea9bcc521a0959b2d80bbf74b190dca712d10"],["e75605d59102a5a2684500d3b991f2e3f3c88b93225547035af25af66e04541f","f5c54754a8f71ee540b9b48728473e314f729ac5308b06938360990e2bfad125"],["eb98660f4c4dfaa06a2be453d5020bc99a0c2e60abe388457dd43fefb1ed620c","6cb9a8876d9cb8520609af3add26cd20a0a7cd8a9411131ce85f44100099223e"],["13e87b027d8514d35939f2e6892b19922154596941888336dc3563e3b8dba942","fef5a3c68059a6dec5d624114bf1e91aac2b9da568d6abeb2570d55646b8adf1"],["ee163026e9fd6fe017c38f06a5be6fc125424b371ce2708e7bf4491691e5764a","1acb250f255dd61c43d94ccc670d0f58f49ae3fa15b96623e5430da0ad6c62b2"],["b268f5ef9ad51e4d78de3a750c2dc89b1e626d43505867999932e5db33af3d80","5f310d4b3c99b9ebb19f77d41c1dee018cf0d34fd4191614003e945a1216e423"],["ff07f3118a9df035e9fad85eb6c7bfe42b02f01ca99ceea3bf7ffdba93c4750d","438136d603e858a3a5c440c38eccbaddc1d2942114e2eddd4740d098ced1f0d8"],["8d8b9855c7c052a34146fd20ffb658bea4b9f69e0d825ebec16e8c3ce2b526a1","cdb559eedc2d79f926baf44fb84ea4d44bcf50fee51d7ceb30e2e7f463036758"],["52db0b5384dfbf05bfa9d472d7ae26dfe4b851ceca91b1eba54263180da32b63","c3b997d050ee5d423ebaf66a6db9f57b3180c902875679de924b69d84a7b375"],["e62f9490d3d51da6395efd24e80919cc7d0f29c3f3fa48c6fff543becbd43352","6d89ad7ba4876b0b22c2ca280c682862f342c8591f1daf5170e07bfd9ccafa7d"],["7f30ea2476b399b4957509c88f77d0191afa2ff5cb7b14fd6d8e7d65aaab1193","ca5ef7d4b231c94c3b15389a5f6311e9daff7bb67b103e9880ef4bff637acaec"],["5098ff1e1d9f14fb46a210fada6c903fef0fb7b4a1dd1d9ac60a0361800b7a00","9731141d81fc8f8084d37c6e7542006b3ee1b40d60dfe5362a5b132fd17ddc0"],["32b78c7de9ee512a72895be6b9cbefa6e2f3c4ccce445c96b9f2c81e2778ad58","ee1849f513df71e32efc3896ee28260c73bb80547ae2275ba497237794c8753c"],["e2cb74fddc8e9fbcd076eef2a7c72b0ce37d50f08269dfc074b581550547a4f7","d3aa2ed71c9dd2247a62df062736eb0baddea9e36122d2be8641abcb005cc4a4"],["8438447566d4d7bedadc299496ab357426009a35f235cb141be0d99cd10ae3a8","c4e1020916980a4da5d01ac5e6ad330734ef0d7906631c4f2390426b2edd791f"],["4162d488b89402039b584c6fc6c308870587d9c46f660b878ab65c82c711d67e","67163e903236289f776f22c25fb8a3afc1732f2b84b4e95dbda47ae5a0852649"],["3fad3fa84caf0f34f0f89bfd2dcf54fc175d767aec3e50684f3ba4a4bf5f683d","cd1bc7cb6cc407bb2f0ca647c718a730cf71872e7d0d2a53fa20efcdfe61826"],["674f2600a3007a00568c1a7ce05d0816c1fb84bf1370798f1c69532faeb1a86b","299d21f9413f33b3edf43b257004580b70db57da0b182259e09eecc69e0d38a5"],["d32f4da54ade74abb81b815ad1fb3b263d82d6c692714bcff87d29bd5ee9f08f","f9429e738b8e53b968e99016c059707782e14f4535359d582fc416910b3eea87"],["30e4e670435385556e593657135845d36fbb6931f72b08cb1ed954f1e3ce3ff6","462f9bce619898638499350113bbc9b10a878d35da70740dc695a559eb88db7b"],["be2062003c51cc3004682904330e4dee7f3dcd10b01e580bf1971b04d4cad297","62188bc49d61e5428573d48a74e1c655b1c61090905682a0d5558ed72dccb9bc"],["93144423ace3451ed29e0fb9ac2af211cb6e84a601df5993c419859fff5df04a","7c10dfb164c3425f5c71a3f9d7992038f1065224f72bb9d1d902a6d13037b47c"],["b015f8044f5fcbdcf21ca26d6c34fb8197829205c7b7d2a7cb66418c157b112c","ab8c1e086d04e813744a655b2df8d5f83b3cdc6faa3088c1d3aea1454e3a1d5f"],["d5e9e1da649d97d89e4868117a465a3a4f8a18de57a140d36b3f2af341a21b52","4cb04437f391ed73111a13cc1d4dd0db1693465c2240480d8955e8592f27447a"],["d3ae41047dd7ca065dbf8ed77b992439983005cd72e16d6f996a5316d36966bb","bd1aeb21ad22ebb22a10f0303417c6d964f8cdd7df0aca614b10dc14d125ac46"],["463e2763d885f958fc66cdd22800f0a487197d0a82e377b49f80af87c897b065","bfefacdb0e5d0fd7df3a311a94de062b26b80c61fbc97508b79992671ef7ca7f"],["7985fdfd127c0567c6f53ec1bb63ec3158e597c40bfe747c83cddfc910641917","603c12daf3d9862ef2b25fe1de289aed24ed291e0ec6708703a5bd567f32ed03"],["74a1ad6b5f76e39db2dd249410eac7f99e74c59cb83d2d0ed5ff1543da7703e9","cc6157ef18c9c63cd6193d83631bbea0093e0968942e8c33d5737fd790e0db08"],["30682a50703375f602d416664ba19b7fc9bab42c72747463a71d0896b22f6da3","553e04f6b018b4fa6c8f39e7f311d3176290d0e0f19ca73f17714d9977a22ff8"],["9e2158f0d7c0d5f26c3791efefa79597654e7a2b2464f52b1ee6c1347769ef57","712fcdd1b9053f09003a3481fa7762e9ffd7c8ef35a38509e2fbf2629008373"],["176e26989a43c9cfeba4029c202538c28172e566e3c4fce7322857f3be327d66","ed8cc9d04b29eb877d270b4878dc43c19aefd31f4eee09ee7b47834c1fa4b1c3"],["75d46efea3771e6e68abb89a13ad747ecf1892393dfc4f1b7004788c50374da8","9852390a99507679fd0b86fd2b39a868d7efc22151346e1a3ca4726586a6bed8"],["809a20c67d64900ffb698c4c825f6d5f2310fb0451c869345b7319f645605721","9e994980d9917e22b76b061927fa04143d096ccc54963e6a5ebfa5f3f8e286c1"],["1b38903a43f7f114ed4500b4eac7083fdefece1cf29c63528d563446f972c180","4036edc931a60ae889353f77fd53de4a2708b26b6f5da72ad3394119daf408f9"]]}}},function(t,e,r){"use strict";function n(t){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var i=r(2),o=r(317),a=r(12),s=r(75),c=r(72),A=a.assert,u=r(318),f=r(319);function h(t){if(!(this instanceof h))return new h(t);"string"==typeof t&&(A(Object.prototype.hasOwnProperty.call(s,t),"Unknown curve "+t),t=s[t]),t instanceof s.PresetCurve&&(t={curve:t}),this.curve=t.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=t.curve.g,this.g.precompute(t.curve.n.bitLength()+1),this.hash=t.hash||t.curve.hash}t.exports=h,h.prototype.keyPair=function(t){return new u(this,t)},h.prototype.keyFromPrivate=function(t,e){return u.fromPrivate(this,t,e)},h.prototype.keyFromPublic=function(t,e){return u.fromPublic(this,t,e)},h.prototype.genKeyPair=function(t){t||(t={});for(var e=new o({hash:this.hash,pers:t.pers,persEnc:t.persEnc||"utf8",entropy:t.entropy||c(this.hash.hmacStrength),entropyEnc:t.entropy&&t.entropyEnc||"utf8",nonce:this.n.toArray()}),r=this.n.byteLength(),n=this.n.sub(new i(2));;){var a=new i(e.generate(r));if(!(a.cmp(n)>0))return a.iaddn(1),this.keyFromPrivate(a)}},h.prototype._truncateToN=function(t,e){var r=8*t.byteLength()-this.n.bitLength();return r>0&&(t=t.ushrn(r)),!e&&t.cmp(this.n)>=0?t.sub(this.n):t},h.prototype.sign=function(t,e,r,a){"object"===n(r)&&(a=r,r=null),a||(a={}),e=this.keyFromPrivate(e,r),t=this._truncateToN(new i(t,16));for(var s=this.n.byteLength(),c=e.getPrivate().toArray("be",s),A=t.toArray("be",s),u=new o({hash:this.hash,entropy:c,nonce:A,pers:a.pers,persEnc:a.persEnc||"utf8"}),h=this.n.sub(new i(1)),l=0;;l++){var d=a.k?a.k(l):new i(u.generate(this.n.byteLength()));if(!((d=this._truncateToN(d,!0)).cmpn(1)<=0||d.cmp(h)>=0)){var g=this.g.mul(d);if(!g.isInfinity()){var p=g.getX(),y=p.umod(this.n);if(0!==y.cmpn(0)){var I=d.invm(this.n).mul(y.mul(e.getPrivate()).iadd(t));if(0!==(I=I.umod(this.n)).cmpn(0)){var b=(g.getY().isOdd()?1:0)|(0!==p.cmp(y)?2:0);return a.canonical&&I.cmp(this.nh)>0&&(I=this.n.sub(I),b^=1),new f({r:y,s:I,recoveryParam:b})}}}}}},h.prototype.verify=function(t,e,r,n){t=this._truncateToN(new i(t,16)),r=this.keyFromPublic(r,n);var o=(e=new f(e,"hex")).r,a=e.s;if(o.cmpn(1)<0||o.cmp(this.n)>=0)return!1;if(a.cmpn(1)<0||a.cmp(this.n)>=0)return!1;var s,c=a.invm(this.n),A=c.mul(t).umod(this.n),u=c.mul(o).umod(this.n);return this.curve._maxwellTrick?!(s=this.g.jmulAdd(A,r.getPublic(),u)).isInfinity()&&s.eqXToP(o):!(s=this.g.mulAdd(A,r.getPublic(),u)).isInfinity()&&0===s.getX().umod(this.n).cmp(o)},h.prototype.recoverPubKey=function(t,e,r,n){A((3&r)===r,"The recovery param is more than two bits"),e=new f(e,n);var o=this.n,a=new i(t),s=e.r,c=e.s,u=1&r,h=r>>1;if(s.cmp(this.curve.p.umod(this.curve.n))>=0&&h)throw new Error("Unable to find sencond key candinate");s=h?this.curve.pointFromX(s.add(this.curve.n),u):this.curve.pointFromX(s,u);var l=e.r.invm(o),d=o.sub(a).mul(l).umod(o),g=c.mul(l).umod(o);return this.g.mulAdd(d,s,g)},h.prototype.getKeyRecoveryParam=function(t,e,r,n){if(null!==(e=new f(e,n)).recoveryParam)return e.recoveryParam;for(var i=0;i<4;i++){var o;try{o=this.recoverPubKey(t,e,i)}catch(t){continue}if(o.eq(r))return i}throw new Error("Unable to find valid recovery factor")}},function(t,e,r){"use strict";var n=r(6),i=r(151),o=r(11);function a(t){if(!(this instanceof a))return new a(t);this.hash=t.hash,this.predResist=!!t.predResist,this.outLen=this.hash.outSize,this.minEntropy=t.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var e=i.toArray(t.entropy,t.entropyEnc||"hex"),r=i.toArray(t.nonce,t.nonceEnc||"hex"),n=i.toArray(t.pers,t.persEnc||"hex");o(e.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(e,r,n)}t.exports=a,a.prototype._init=function(t,e,r){var n=t.concat(e).concat(r);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var i=0;i<this.V.length;i++)this.K[i]=0,this.V[i]=1;this._update(n),this._reseed=1,this.reseedInterval=281474976710656},a.prototype._hmac=function(){return new n.hmac(this.hash,this.K)},a.prototype._update=function(t){var e=this._hmac().update(this.V).update([0]);t&&(e=e.update(t)),this.K=e.digest(),this.V=this._hmac().update(this.V).digest(),t&&(this.K=this._hmac().update(this.V).update([1]).update(t).digest(),this.V=this._hmac().update(this.V).digest())},a.prototype.reseed=function(t,e,r,n){"string"!=typeof e&&(n=r,r=e,e=null),t=i.toArray(t,e),r=i.toArray(r,n),o(t.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(t.concat(r||[])),this._reseed=1},a.prototype.generate=function(t,e,r,n){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");"string"!=typeof e&&(n=r,r=e,e=null),r&&(r=i.toArray(r,n||"hex"),this._update(r));for(var o=[];o.length<t;)this.V=this._hmac().update(this.V).digest(),o=o.concat(this.V);var a=o.slice(0,t);return this._update(r),this._reseed++,i.encode(a,e)}},function(t,e,r){"use strict";var n=r(2),i=r(12).assert;function o(t,e){this.ec=t,this.priv=null,this.pub=null,e.priv&&this._importPrivate(e.priv,e.privEnc),e.pub&&this._importPublic(e.pub,e.pubEnc)}t.exports=o,o.fromPublic=function(t,e,r){return e instanceof o?e:new o(t,{pub:e,pubEnc:r})},o.fromPrivate=function(t,e,r){return e instanceof o?e:new o(t,{priv:e,privEnc:r})},o.prototype.validate=function(){var t=this.getPublic();return t.isInfinity()?{result:!1,reason:"Invalid public key"}:t.validate()?t.mul(this.ec.curve.n).isInfinity()?{result:!0,reason:null}:{result:!1,reason:"Public key * N != O"}:{result:!1,reason:"Public key is not a point"}},o.prototype.getPublic=function(t,e){return"string"==typeof t&&(e=t,t=null),this.pub||(this.pub=this.ec.g.mul(this.priv)),e?this.pub.encode(e,t):this.pub},o.prototype.getPrivate=function(t){return"hex"===t?this.priv.toString(16,2):this.priv},o.prototype._importPrivate=function(t,e){this.priv=new n(t,e||16),this.priv=this.priv.umod(this.ec.curve.n)},o.prototype._importPublic=function(t,e){if(t.x||t.y)return"mont"===this.ec.curve.type?i(t.x,"Need x coordinate"):"short"!==this.ec.curve.type&&"edwards"!==this.ec.curve.type||i(t.x&&t.y,"Need both x and y coordinate"),void(this.pub=this.ec.curve.point(t.x,t.y));this.pub=this.ec.curve.decodePoint(t,e)},o.prototype.derive=function(t){return t.validate()||i(t.validate(),"public point not validated"),t.mul(this.priv).getX()},o.prototype.sign=function(t,e,r){return this.ec.sign(t,this,e,r)},o.prototype.verify=function(t,e){return this.ec.verify(t,e,this)},o.prototype.inspect=function(){return"<Key priv: "+(this.priv&&this.priv.toString(16,2))+" pub: "+(this.pub&&this.pub.inspect())+" >"}},function(t,e,r){"use strict";var n=r(2),i=r(12),o=i.assert;function a(t,e){if(t instanceof a)return t;this._importDER(t,e)||(o(t.r&&t.s,"Signature without r or s"),this.r=new n(t.r,16),this.s=new n(t.s,16),void 0===t.recoveryParam?this.recoveryParam=null:this.recoveryParam=t.recoveryParam)}function s(){this.place=0}function c(t,e){var r=t[e.place++];if(!(128&r))return r;var n=15&r;if(0===n||n>4)return!1;for(var i=0,o=0,a=e.place;o<n;o++,a++)i<<=8,i|=t[a],i>>>=0;return!(i<=127)&&(e.place=a,i)}function A(t){for(var e=0,r=t.length-1;!t[e]&&!(128&t[e+1])&&e<r;)e++;return 0===e?t:t.slice(e)}function u(t,e){if(e<128)t.push(e);else{var r=1+(Math.log(e)/Math.LN2>>>3);for(t.push(128|r);--r;)t.push(e>>>(r<<3)&255);t.push(e)}}t.exports=a,a.prototype._importDER=function(t,e){t=i.toArray(t,e);var r=new s;if(48!==t[r.place++])return!1;var o=c(t,r);if(!1===o)return!1;if(o+r.place!==t.length)return!1;if(2!==t[r.place++])return!1;var a=c(t,r);if(!1===a)return!1;var A=t.slice(r.place,a+r.place);if(r.place+=a,2!==t[r.place++])return!1;var u=c(t,r);if(!1===u)return!1;if(t.length!==u+r.place)return!1;var f=t.slice(r.place,u+r.place);if(0===A[0]){if(!(128&A[1]))return!1;A=A.slice(1)}if(0===f[0]){if(!(128&f[1]))return!1;f=f.slice(1)}return this.r=new n(A),this.s=new n(f),this.recoveryParam=null,!0},a.prototype.toDER=function(t){var e=this.r.toArray(),r=this.s.toArray();for(128&e[0]&&(e=[0].concat(e)),128&r[0]&&(r=[0].concat(r)),e=A(e),r=A(r);!(r[0]||128&r[1]);)r=r.slice(1);var n=[2];u(n,e.length),(n=n.concat(e)).push(2),u(n,r.length);var o=n.concat(r),a=[48];return u(a,o.length),a=a.concat(o),i.encode(a,t)}},function(t,e,r){"use strict";var n=r(6),i=r(75),o=r(12),a=o.assert,s=o.parseBytes,c=r(321),A=r(322);function u(t){if(a("ed25519"===t,"only tested with ed25519 so far"),!(this instanceof u))return new u(t);t=i[t].curve,this.curve=t,this.g=t.g,this.g.precompute(t.n.bitLength()+1),this.pointClass=t.point().constructor,this.encodingLength=Math.ceil(t.n.bitLength()/8),this.hash=n.sha512}t.exports=u,u.prototype.sign=function(t,e){t=s(t);var r=this.keyFromSecret(e),n=this.hashInt(r.messagePrefix(),t),i=this.g.mul(n),o=this.encodePoint(i),a=this.hashInt(o,r.pubBytes(),t).mul(r.priv()),c=n.add(a).umod(this.curve.n);return this.makeSignature({R:i,S:c,Rencoded:o})},u.prototype.verify=function(t,e,r){t=s(t),e=this.makeSignature(e);var n=this.keyFromPublic(r),i=this.hashInt(e.Rencoded(),n.pubBytes(),t),o=this.g.mul(e.S());return e.R().add(n.pub().mul(i)).eq(o)},u.prototype.hashInt=function(){for(var t=this.hash(),e=0;e<arguments.length;e++)t.update(arguments[e]);return o.intFromLE(t.digest()).umod(this.curve.n)},u.prototype.keyFromPublic=function(t){return c.fromPublic(this,t)},u.prototype.keyFromSecret=function(t){return c.fromSecret(this,t)},u.prototype.makeSignature=function(t){return t instanceof A?t:new A(this,t)},u.prototype.encodePoint=function(t){var e=t.getY().toArray("le",this.encodingLength);return e[this.encodingLength-1]|=t.getX().isOdd()?128:0,e},u.prototype.decodePoint=function(t){var e=(t=o.parseBytes(t)).length-1,r=t.slice(0,e).concat(-129&t[e]),n=0!=(128&t[e]),i=o.intFromLE(r);return this.curve.pointFromY(i,n)},u.prototype.encodeInt=function(t){return t.toArray("le",this.encodingLength)},u.prototype.decodeInt=function(t){return o.intFromLE(t)},u.prototype.isPoint=function(t){return t instanceof this.pointClass}},function(t,e,r){"use strict";var n=r(12),i=n.assert,o=n.parseBytes,a=n.cachedProperty;function s(t,e){this.eddsa=t,this._secret=o(e.secret),t.isPoint(e.pub)?this._pub=e.pub:this._pubBytes=o(e.pub)}s.fromPublic=function(t,e){return e instanceof s?e:new s(t,{pub:e})},s.fromSecret=function(t,e){return e instanceof s?e:new s(t,{secret:e})},s.prototype.secret=function(){return this._secret},a(s,"pubBytes",(function(){return this.eddsa.encodePoint(this.pub())})),a(s,"pub",(function(){return this._pubBytes?this.eddsa.decodePoint(this._pubBytes):this.eddsa.g.mul(this.priv())})),a(s,"privBytes",(function(){var t=this.eddsa,e=this.hash(),r=t.encodingLength-1,n=e.slice(0,t.encodingLength);return n[0]&=248,n[r]&=127,n[r]|=64,n})),a(s,"priv",(function(){return this.eddsa.decodeInt(this.privBytes())})),a(s,"hash",(function(){return this.eddsa.hash().update(this.secret()).digest()})),a(s,"messagePrefix",(function(){return this.hash().slice(this.eddsa.encodingLength)})),s.prototype.sign=function(t){return i(this._secret,"KeyPair can only verify"),this.eddsa.sign(t,this)},s.prototype.verify=function(t,e){return this.eddsa.verify(t,e,this)},s.prototype.getSecret=function(t){return i(this._secret,"KeyPair is public only"),n.encode(this.secret(),t)},s.prototype.getPublic=function(t){return n.encode(this.pubBytes(),t)},t.exports=s},function(t,e,r){"use strict";function n(t){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var i=r(2),o=r(12),a=o.assert,s=o.cachedProperty,c=o.parseBytes;function A(t,e){this.eddsa=t,"object"!==n(e)&&(e=c(e)),Array.isArray(e)&&(e={R:e.slice(0,t.encodingLength),S:e.slice(t.encodingLength)}),a(e.R&&e.S,"Signature without R or S"),t.isPoint(e.R)&&(this._R=e.R),e.S instanceof i&&(this._S=e.S),this._Rencoded=Array.isArray(e.R)?e.R:e.Rencoded,this._Sencoded=Array.isArray(e.S)?e.S:e.Sencoded}s(A,"S",(function(){return this.eddsa.decodeInt(this.Sencoded())})),s(A,"R",(function(){return this.eddsa.decodePoint(this.Rencoded())})),s(A,"Rencoded",(function(){return this.eddsa.encodePoint(this.R())})),s(A,"Sencoded",(function(){return this.eddsa.encodeInt(this.S())})),A.prototype.toBytes=function(){return this.Rencoded().concat(this.Sencoded())},A.prototype.toHex=function(){return o.encode(this.toBytes(),"hex").toUpperCase()},t.exports=A},function(t,e,r){"use strict";var n=r(153);e.certificate=r(329);var i=n.define("RSAPrivateKey",(function(){this.seq().obj(this.key("version").int(),this.key("modulus").int(),this.key("publicExponent").int(),this.key("privateExponent").int(),this.key("prime1").int(),this.key("prime2").int(),this.key("exponent1").int(),this.key("exponent2").int(),this.key("coefficient").int())}));e.RSAPrivateKey=i;var o=n.define("RSAPublicKey",(function(){this.seq().obj(this.key("modulus").int(),this.key("publicExponent").int())}));e.RSAPublicKey=o;var a=n.define("SubjectPublicKeyInfo",(function(){this.seq().obj(this.key("algorithm").use(s),this.key("subjectPublicKey").bitstr())}));e.PublicKey=a;var s=n.define("AlgorithmIdentifier",(function(){this.seq().obj(this.key("algorithm").objid(),this.key("none").null_().optional(),this.key("curve").objid().optional(),this.key("params").seq().obj(this.key("p").int(),this.key("q").int(),this.key("g").int()).optional())})),c=n.define("PrivateKeyInfo",(function(){this.seq().obj(this.key("version").int(),this.key("algorithm").use(s),this.key("subjectPrivateKey").octstr())}));e.PrivateKey=c;var A=n.define("EncryptedPrivateKeyInfo",(function(){this.seq().obj(this.key("algorithm").seq().obj(this.key("id").objid(),this.key("decrypt").seq().obj(this.key("kde").seq().obj(this.key("id").objid(),this.key("kdeparams").seq().obj(this.key("salt").octstr(),this.key("iters").int())),this.key("cipher").seq().obj(this.key("algo").objid(),this.key("iv").octstr()))),this.key("subjectPrivateKey").octstr())}));e.EncryptedPrivateKey=A;var u=n.define("DSAPrivateKey",(function(){this.seq().obj(this.key("version").int(),this.key("p").int(),this.key("q").int(),this.key("g").int(),this.key("pub_key").int(),this.key("priv_key").int())}));e.DSAPrivateKey=u,e.DSAparam=n.define("DSAparam",(function(){this.int()}));var f=n.define("ECPrivateKey",(function(){this.seq().obj(this.key("version").int(),this.key("privateKey").octstr(),this.key("parameters").optional().explicit(0).use(h),this.key("publicKey").optional().explicit(1).bitstr())}));e.ECPrivateKey=f;var h=n.define("ECParameters",(function(){this.choice({namedCurve:this.objid()})}));e.signature=n.define("signature",(function(){this.seq().obj(this.key("r").int(),this.key("s").int())}))},function(t,e,r){"use strict";var n=r(154),i=r(156),o=r(3);function a(t,e){this.name=t,this.body=e,this.decoders={},this.encoders={}}e.define=function(t,e){return new a(t,e)},a.prototype._createNamed=function(t){var e=this.name;function r(t){this._initNamed(t,e)}return o(r,t),r.prototype._initNamed=function(e,r){t.call(this,e,r)},new r(this)},a.prototype._getDecoder=function(t){return t=t||"der",this.decoders.hasOwnProperty(t)||(this.decoders[t]=this._createNamed(i[t])),this.decoders[t]},a.prototype.decode=function(t,e,r){return this._getDecoder(e).decode(t,r)},a.prototype._getEncoder=function(t){return t=t||"der",this.encoders.hasOwnProperty(t)||(this.encoders[t]=this._createNamed(n[t])),this.encoders[t]},a.prototype.encode=function(t,e,r){return this._getEncoder(e).encode(t,r)}},function(t,e,r){"use strict";var n=r(3),i=r(155);function o(t){i.call(this,t),this.enc="pem"}n(o,i),t.exports=o,o.prototype.encode=function(t,e){for(var r=i.prototype.encode.call(this,t).toString("base64"),n=["-----BEGIN "+e.label+"-----"],o=0;o<r.length;o+=64)n.push(r.slice(o,o+64));return n.push("-----END "+e.label+"-----"),n.join("\n")}},function(t,e,r){"use strict";var n=r(3),i=r(76).Buffer,o=r(157);function a(t){o.call(this,t),this.enc="pem"}n(a,o),t.exports=a,a.prototype.decode=function(t,e){for(var r=t.toString().split(/[\r\n]+/g),n=e.label.toUpperCase(),a=/^-----(BEGIN|END) ([^-]+)-----$/,s=-1,c=-1,A=0;A<r.length;A++){var u=r[A].match(a);if(null!==u&&u[2]===n){if(-1!==s){if("END"!==u[1])break;c=A;break}if("BEGIN"!==u[1])break;s=A}}if(-1===s||-1===c)throw new Error("PEM section not found for: "+n);var f=r.slice(s+1,c).join("");f.replace(/[^a-z0-9+/=]+/gi,"");var h=i.from(f,"base64");return o.prototype.decode.call(this,h,e)}},function(t,e,r){"use strict";var n=e;n.Reporter=r(78).Reporter,n.DecoderBuffer=r(36).DecoderBuffer,n.EncoderBuffer=r(36).EncoderBuffer,n.Node=r(77)},function(t,e,r){"use strict";var n=e;n._reverse=function(t){var e={};return Object.keys(t).forEach((function(r){(0|r)==r&&(r|=0);var n=t[r];e[n]=r})),e},n.der=r(79)},function(t,e,r){"use strict";var n=r(153),i=n.define("Time",(function(){this.choice({utcTime:this.utctime(),generalTime:this.gentime()})})),o=n.define("AttributeTypeValue",(function(){this.seq().obj(this.key("type").objid(),this.key("value").any())})),a=n.define("AlgorithmIdentifier",(function(){this.seq().obj(this.key("algorithm").objid(),this.key("parameters").optional(),this.key("curve").objid().optional())})),s=n.define("SubjectPublicKeyInfo",(function(){this.seq().obj(this.key("algorithm").use(a),this.key("subjectPublicKey").bitstr())})),c=n.define("RelativeDistinguishedName",(function(){this.setof(o)})),A=n.define("RDNSequence",(function(){this.seqof(c)})),u=n.define("Name",(function(){this.choice({rdnSequence:this.use(A)})})),f=n.define("Validity",(function(){this.seq().obj(this.key("notBefore").use(i),this.key("notAfter").use(i))})),h=n.define("Extension",(function(){this.seq().obj(this.key("extnID").objid(),this.key("critical").bool().def(!1),this.key("extnValue").octstr())})),l=n.define("TBSCertificate",(function(){this.seq().obj(this.key("version").explicit(0).int().optional(),this.key("serialNumber").int(),this.key("signature").use(a),this.key("issuer").use(u),this.key("validity").use(f),this.key("subject").use(u),this.key("subjectPublicKeyInfo").use(s),this.key("issuerUniqueID").implicit(1).bitstr().optional(),this.key("subjectUniqueID").implicit(2).bitstr().optional(),this.key("extensions").explicit(3).seqof(h).optional())})),d=n.define("X509Certificate",(function(){this.seq().obj(this.key("tbsCertificate").use(l),this.key("signatureAlgorithm").use(a),this.key("signatureValue").bitstr())}));t.exports=d},function(t){t.exports=JSON.parse('{"2.16.840.1.101.3.4.1.1":"aes-128-ecb","2.16.840.1.101.3.4.1.2":"aes-128-cbc","2.16.840.1.101.3.4.1.3":"aes-128-ofb","2.16.840.1.101.3.4.1.4":"aes-128-cfb","2.16.840.1.101.3.4.1.21":"aes-192-ecb","2.16.840.1.101.3.4.1.22":"aes-192-cbc","2.16.840.1.101.3.4.1.23":"aes-192-ofb","2.16.840.1.101.3.4.1.24":"aes-192-cfb","2.16.840.1.101.3.4.1.41":"aes-256-ecb","2.16.840.1.101.3.4.1.42":"aes-256-cbc","2.16.840.1.101.3.4.1.43":"aes-256-ofb","2.16.840.1.101.3.4.1.44":"aes-256-cfb"}')},function(t,e,r){var n=/Proc-Type: 4,ENCRYPTED[\n\r]+DEK-Info: AES-((?:128)|(?:192)|(?:256))-CBC,([0-9A-H]+)[\n\r]+([0-9A-z\n\r+/=]+)[\n\r]+/m,i=/^-----BEGIN ((?:.*? KEY)|CERTIFICATE)-----/m,o=/^-----BEGIN ((?:.*? KEY)|CERTIFICATE)-----([0-9A-z\n\r+/=]+)-----END \1-----$/m,a=r(47),s=r(70),c=r(4).Buffer;t.exports=function(t,e){var r,A=t.toString(),u=A.match(n);if(u){var f="aes"+u[1],h=c.from(u[2],"hex"),l=c.from(u[3].replace(/[\r\n]/g,""),"base64"),d=a(e,h.slice(0,8),parseInt(u[1],10)).key,g=[],p=s.createDecipheriv(f,d,h);g.push(p.update(l)),g.push(p.final()),r=c.concat(g)}else{var y=A.match(o);r=c.from(y[2].replace(/[\r\n]/g,""),"base64")}return{tag:A.match(i)[1],data:r}}},function(t,e,r){var n=r(4).Buffer,i=r(2),o=r(74).ec,a=r(49),s=r(158);function c(t,e){if(t.cmpn(0)<=0)throw new Error("invalid sig");if(t.cmp(e)>=e)throw new Error("invalid sig")}t.exports=function(t,e,r,A,u){var f=a(r);if("ec"===f.type){if("ecdsa"!==A&&"ecdsa/rsa"!==A)throw new Error("wrong public key type");return function(t,e,r){var n=s[r.data.algorithm.curve.join(".")];if(!n)throw new Error("unknown curve "+r.data.algorithm.curve.join("."));var i=new o(n),a=r.data.subjectPrivateKey.data;return i.verify(e,t,a)}(t,e,f)}if("dsa"===f.type){if("dsa"!==A)throw new Error("wrong public key type");return function(t,e,r){var n=r.data.p,o=r.data.q,s=r.data.g,A=r.data.pub_key,u=a.signature.decode(t,"der"),f=u.s,h=u.r;c(f,o),c(h,o);var l=i.mont(n),d=f.invm(o);return 0===s.toRed(l).redPow(new i(e).mul(d).mod(o)).fromRed().mul(A.toRed(l).redPow(h.mul(d).mod(o)).fromRed()).mod(n).mod(o).cmp(h)}(t,e,f)}if("rsa"!==A&&"ecdsa/rsa"!==A)throw new Error("wrong public key type");e=n.concat([u,e]);for(var h=f.modulus.byteLength(),l=[1],d=0;e.length+l.length+2<h;)l.push(255),d++;l.push(0);for(var g=-1;++g<e.length;)l.push(e[g]);l=n.from(l);var p=i.mont(f.modulus);t=(t=new i(t).toRed(p)).redPow(new i(f.publicExponent)),t=n.from(t.fromRed().toArray());var y=d<8?1:0;for(h=Math.min(t.length,l.length),t.length!==l.length&&(y=1),g=-1;++g<h;)y|=t[g]^l[g];return 0===y}},function(t,e,r){var n=r(49),i=r(19),o=r(23),a=r(161),s=r(162),c=r(2),A=r(163),u=r(73),f=r(4).Buffer;t.exports=function(t,e,r){var h;h=t.padding?t.padding:r?1:4;var l,d=n(t);if(4===h)l=function(t,e){var r=t.modulus.byteLength(),n=e.length,A=o("sha1").update(f.alloc(0)).digest(),u=A.length,h=2*u;if(n>r-h-2)throw new Error("message too long");var l=f.alloc(r-n-h-2),d=r-u-1,g=i(u),p=s(f.concat([A,l,f.alloc(1,1),e],d),a(g,d)),y=s(g,a(p,u));return new c(f.concat([f.alloc(1),y,p],r))}(d,e);else if(1===h)l=function(t,e,r){var n,o=e.length,a=t.modulus.byteLength();if(o>a-11)throw new Error("message too long");n=r?f.alloc(a-o-3,255):function(t){var e,r=f.allocUnsafe(t),n=0,o=i(2*t),a=0;for(;n<t;)a===o.length&&(o=i(2*t),a=0),(e=o[a++])&&(r[n++]=e);return r}(a-o-3);return new c(f.concat([f.from([0,r?1:2]),n,f.alloc(1),e],a))}(d,e,r);else{if(3!==h)throw new Error("unknown padding");if((l=new c(e)).cmp(d.modulus)>=0)throw new Error("data too long for modulus")}return r?u(l,d):A(l,d)}},function(t,e,r){var n=r(49),i=r(161),o=r(162),a=r(2),s=r(73),c=r(23),A=r(163),u=r(4).Buffer;t.exports=function(t,e,r){var f;f=t.padding?t.padding:r?1:4;var h,l=n(t),d=l.modulus.byteLength();if(e.length>d||new a(e).cmp(l.modulus)>=0)throw new Error("decryption error");h=r?A(new a(e),l):s(e,l);var g=u.alloc(d-h.length);if(h=u.concat([g,h],d),4===f)return function(t,e){var r=t.modulus.byteLength(),n=c("sha1").update(u.alloc(0)).digest(),a=n.length;if(0!==e[0])throw new Error("decryption error");var s=e.slice(1,a+1),A=e.slice(a+1),f=o(s,i(A,a)),h=o(A,i(f,r-a-1));if(function(t,e){t=u.from(t),e=u.from(e);var r=0,n=t.length;t.length!==e.length&&(r++,n=Math.min(t.length,e.length));var i=-1;for(;++i<n;)r+=t[i]^e[i];return r}(n,h.slice(0,a)))throw new Error("decryption error");var l=a;for(;0===h[l];)l++;if(1!==h[l++])throw new Error("decryption error");return h.slice(l)}(l,h);if(1===f)return function(t,e,r){var n=e.slice(0,2),i=2,o=0;for(;0!==e[i++];)if(i>=e.length){o++;break}var a=e.slice(2,i-1);("0002"!==n.toString("hex")&&!r||"0001"!==n.toString("hex")&&r)&&o++;a.length<8&&o++;if(o)throw new Error("decryption error");return e.slice(i)}(0,h,r);if(3===f)return h;throw new Error("unknown padding")}},function(t,e,r){(function(e){var n=r(63).Transform,i=r(3);function o(t){n.call(this,t),this._destroyed=!1}function a(t,e,r){r(null,t)}function s(t){return function(e,r,n){return"function"==typeof e&&(n=r,r=e,e={}),"function"!=typeof r&&(r=a),"function"!=typeof n&&(n=null),t(e,r,n)}}i(o,n),o.prototype.destroy=function(t){if(!this._destroyed){this._destroyed=!0;var r=this;e.nextTick((function(){t&&r.emit("error",t),r.emit("close")}))}},t.exports=s((function(t,e,r){var n=new o(t);return n._transform=e,r&&(n._flush=r),n})),t.exports.ctor=s((function(t,e,r){function n(e){if(!(this instanceof n))return new n(e);this.options=Object.assign({},t,e),o.call(this,this.options)}return i(n,o),n.prototype._transform=e,r&&(n.prototype._flush=r),n})),t.exports.obj=s((function(t,e,r){var n=new o(Object.assign({objectMode:!0,highWaterMark:16},t));return n._transform=e,r&&(n._flush=r),n}))}).call(this,r(9))},function(t,e){var r={}.toString;t.exports=Array.isArray||function(t){return"[object Array]"==r.call(t)}},function(t,e,r){(function(t){var n=r(37),i=r(20),o=r(21);function a(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function s(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?a(Object(r),!0).forEach((function(e){n(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):a(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}var c,A=r(38);A.Platform()===A.PLATFORM_NODE&&(globalThis.Response=r(98).Response,c=r(338));var u=r(97),f=r(100),h=f.ValidatePresence,l=f.ValidateWriteToken,d=f.ValidatePartHash,g=f.ValidateParameters;e.ListFiles=function(){var t=o(i.mark((function t(e){var r,n,o,a;return i.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=e.libraryId,n=e.objectId,o=e.versionHash,g({libraryId:r,objectId:n,versionHash:o}),o&&(n=this.utils.DecodeVersionHash(o).objectId),a=u("q",o||n,"meta","files"),t.t0=this.utils,t.t1=this.HttpClient,t.next=8,this.authClient.AuthorizationHeader({libraryId:r,objectId:n,versionHash:o});case 8:return t.t2=t.sent,t.t3=a,t.t4={headers:t.t2,method:"GET",path:t.t3},t.t5=t.t1.Request.call(t.t1,t.t4),t.abrupt("return",t.t0.ResponseToJson.call(t.t0,t.t5));case 13:case"end":return t.stop()}}),t,this)})));return function(e){return t.apply(this,arguments)}}(),e.UploadFilesFromS3=function(){var e=o(i.mark((function e(r){var n,o,a,c,A,u,f,h,d,p,y,I,b,v,E,m,C,w,B,Q,k,S,_,D,x,M,R,O,N;return i.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n=r.libraryId,o=r.objectId,a=r.writeToken,c=r.region,A=r.bucket,u=r.fileInfo,f=r.accessKey,h=r.secret,d=r.signedUrl,p=r.encryption,y=void 0===p?"none":p,I=r.copy,b=void 0!==I&&I,v=r.callback,g({libraryId:n,objectId:o}),l(a),E=/^s3:\/\/([^/]+)\//i,m=0;case 5:if(!(m<u.length)){e.next=18;break}if(C=u[m].source,!(w=E.exec(C))){e.next=15;break}if(w[1]===A){e.next=14;break}throw Error('Full S3 file path "'+C+"\" specified, but does not match provided bucket name '"+A+"'");case 14:u[m].source=C.replace(E,"");case 15:m++,e.next=5;break;case 18:if(this.Log("Uploading files from S3: ".concat(n," ").concat(o," ").concat(a)),"cgck"!==y){e.next=25;break}return e.next=22,this.EncryptionConk({libraryId:n,objectId:o,writeToken:a});case 22:Q=s(s({},Q=e.sent),{},{secret_key:""}),B="kp__".concat(this.utils.B58(t.from(JSON.stringify(Q))));case 25:return k={access_key_id:f,secret_access_key:h},d&&(k={signed_url:d}),S={encryption_key:B,access:{protocol:"s3",platform:"aws",path:A,storage_endpoint:{region:c},cloud_credentials:k}},_=u.map((function(t){return b?{op:"ingest-copy",path:t.path,encryption:{scheme:"cgck"===y?"cgck":"none"},ingest:{type:"key",path:t.source}}:{op:"add-reference",path:t.path,reference:{type:"key",path:t.source}}})),e.next=31,this.CreateFileUploadJob({libraryId:n,objectId:o,writeToken:a,ops:_,defaults:S});case 31:D=e.sent,x=D.id;case 33:return e.next=36,new Promise((function(t){return setTimeout(t,1e3)}));case 36:return e.next=38,this.UploadStatus({libraryId:n,objectId:o,writeToken:a,uploadId:x});case 38:if(!((M=e.sent).errors&&M.errors.length>1)){e.next=43;break}throw M.errors.join("\n");case 43:if(!M.error){e.next=48;break}throw this.Log("S3 file upload failed:\n".concat(JSON.stringify(M,null,2))),M.error;case 48:if("failed"!==M.status.toLowerCase()){e.next=50;break}throw"File upload failed";case 50:if(R=!1,b?(R=M.ingest_copy.done,v&&(O=M.ingest_copy.progress,v({done:R,uploaded:O.bytes.completed,total:O.bytes.total,uploadedFiles:O.files.completed,totalFiles:O.files.total,fileStatus:O.files.details}))):(R=M.add_reference.done,v&&(N=M.add_reference.progress,v({done:R,uploadedFiles:N.completed,totalFiles:N.total}))),!R){e.next=54;break}return e.abrupt("break",56);case 54:e.next=33;break;case 56:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}(),e.UploadFiles=function(){var e=o(i.mark((function e(r){var n,a,A,u,f,d,p,y,I,b,v,E,m,C,w,B,Q,k,S,_,D,x,M,R,O,N,P,j,L,F=this;return i.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=r.libraryId,a=r.objectId,A=r.writeToken,u=r.fileInfo,f=r.encryption,d=void 0===f?"none":f,p=r.callback,g({libraryId:n,objectId:a}),l(A),h("fileInfo",u),this.Log("Uploading files: ".concat(n," ").concat(a," ").concat(A)),"cgck"!==d){e.next=9;break}return e.next=8,this.EncryptionConk({libraryId:n,objectId:a,writeToken:A});case 8:y=e.sent;case 9:for(I={},b={},v=u,u=[],E=0;E<v.length;E++)(m=s(s({},v[E]),{},{data:void 0})).path=m.path.replace(/^\/+/,""),"cgck"===d&&(m.encryption={scheme:"cgck"}),b[m.path]=v[E].data,m.type="file",I[m.path]={uploaded:0,total:m.size},u.push(m);return this.Log(u),p&&p(I),e.next=18,this.CreateFileUploadJob({libraryId:n,objectId:a,writeToken:A,ops:u,encryption:d});case 18:C=e.sent,w=C.id,B=C.jobs,this.Log("Upload ID: ".concat(w)),this.Log(B),524288e3,Q=[],k=0,S=0,_=function(){var e=o(i.mark((function e(){var r,o,s,u,f,h;return i.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:r=0;case 1:if(!(r<B.length)){e.next=31;break}case 2:if(!(k-S>524288e3)){e.next=7;break}return e.next=5,new Promise((function(t){return setTimeout(t,500)}));case 5:e.next=2;break;case 7:return o=B[r],e.next=10,F.UploadJobStatus({libraryId:n,objectId:a,writeToken:A,uploadId:w,jobId:o});case 10:s=e.sent,u=0;case 12:if(!(u<s.files.length)){e.next=25;break}if(f=s.files[u],h=void 0,"number"==typeof b[f.path]?(h=t.alloc(f.len),c.readSync(b[f.path],h,0,f.len,f.off)):h=b[f.path].slice(f.off,f.off+f.len),"cgck"!==d){e.next=20;break}return e.next=19,F.Crypto.Encrypt(y,h);case 19:h=e.sent;case 20:s.files[u].data=h,k+=f.len;case 22:u++,e.next=12;break;case 25:return Q[r]=s,e.next=28,new Promise((function(t){return setTimeout(t,50)}));case 28:r++,e.next=1;break;case 31:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),D=function(){var t=o(i.mark((function t(e,r){var o,c,u,f;return i.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(Q[r]){t.next=5;break}return t.next=3,new Promise((function(t){return setTimeout(t,500)}));case 3:t.next=0;break;case 5:o=Q[r],c=o.files,u=i.mark((function t(){var o,u,h;return i.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:o=c[f],u=0,h=!1;case 3:return t.prev=3,t.next=6,F.UploadFileData({libraryId:n,objectId:a,writeToken:A,uploadId:w,jobId:e,filePath:o.path,fileData:o.data,encryption:d});case 6:h=!0,t.next=17;break;case 9:if(t.prev=9,t.t0=t.catch(3),F.Log(t.t0,!0),!((u+=1)>=10)){t.next=15;break}throw t.t0;case 15:return t.next=17,new Promise((function(t){return setTimeout(t,10*u*1e3)}));case 17:if(!h&&u<10){t.next=3;break}case 18:delete Q[r].files[f].data,S+=o.len,p&&(I[o.path]=s(s({},I[o.path]),{},{uploaded:I[o.path].uploaded+o.len}),p(I));case 21:case"end":return t.stop()}}),t,null,[[3,9]])})),f=0;case 9:if(!(f<c.length)){t.next=14;break}return t.delegateYield(u(),"t0",11);case 11:f++,t.next=9;break;case 14:case"end":return t.stop()}}),t)})));return function(e,r){return t.apply(this,arguments)}}(),_().catch((function(t){throw t})),x=Math.min(3,B.length),M=[],R=0;case 33:if(!(R<x)){e.next=43;break}return O=(new Date).getTime(),e.next=37,D(B[R],R);case 37:N=((new Date).getTime()-O)/1e3,P=Q[R].files.map((function(t){return t.len})).reduce((function(t,e){return t+e}),0),M.push(P/N/1048576);case 40:R++,e.next=33;break;case 43:return j=M.reduce((function(t,e){return t+e}),0)/x,L=Math.min(5,Math.ceil(j/2)),e.next=47,this.utils.LimitedMap(L,B,function(){var t=o(i.mark((function t(e,r){return i.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!(r<x)){t.next=2;break}return t.abrupt("return");case 2:return t.next=4,D(e,r);case 4:case"end":return t.stop()}}),t)})));return function(e,r){return t.apply(this,arguments)}}());case 47:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}(),e.CreateFileUploadJob=function(){var t=o(i.mark((function t(e){var r,n,o,a,s,c,A,f,h,d;return i.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=e.libraryId,n=e.objectId,o=e.writeToken,a=e.ops,s=e.defaults,c=void 0===s?{}:s,A=e.encryption,f=void 0===A?"none":A,g({libraryId:r,objectId:n}),l(o),this.Log("Creating file upload job: ".concat(r," ").concat(n," ").concat(o)),this.Log(a),"cgck"===f&&(c.encryption={scheme:"cgck"}),h={seq:0,seq_complete:!0,defaults:c,ops:a},d=u("q",o,"file_jobs"),t.t0=this.utils,t.t1=this.HttpClient,t.next=12,this.authClient.AuthorizationHeader({libraryId:r,objectId:n,update:!0,encryption:f});case 12:return t.t2=t.sent,t.t3=d,t.t4=h,t.t5={headers:t.t2,method:"POST",path:t.t3,body:t.t4,allowFailover:!1},t.t6=t.t1.Request.call(t.t1,t.t5),t.abrupt("return",t.t0.ResponseToJson.call(t.t0,t.t6));case 18:case"end":return t.stop()}}),t,this)})));return function(e){return t.apply(this,arguments)}}(),e.UploadStatus=function(){var t=o(i.mark((function t(e){var r,n,o,a,s;return i.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=e.libraryId,n=e.objectId,o=e.writeToken,a=e.uploadId,g({libraryId:r,objectId:n}),l(o),s=u("q",o,"file_jobs",a),t.t0=this.utils,t.t1=this.HttpClient,t.next=8,this.authClient.AuthorizationHeader({libraryId:r,objectId:n,update:!0});case 8:return t.t2=t.sent,t.t3=s,t.t4={headers:t.t2,method:"GET",path:t.t3,allowFailover:!1},t.t5=t.t1.Request.call(t.t1,t.t4),t.abrupt("return",t.t0.ResponseToJson.call(t.t0,t.t5));case 13:case"end":return t.stop()}}),t,this)})));return function(e){return t.apply(this,arguments)}}(),e.UploadJobStatus=function(){var t=o(i.mark((function t(e){var r,n,o,a,s,c;return i.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=e.libraryId,n=e.objectId,o=e.writeToken,a=e.uploadId,s=e.jobId,g({libraryId:r,objectId:n}),l(o),c=u("q",o,"file_jobs",a,"uploads",s),t.t0=this.utils,t.t1=this.HttpClient,t.next=8,this.authClient.AuthorizationHeader({libraryId:r,objectId:n,update:!0});case 8:return t.t2=t.sent,t.t3=c,t.t4={headers:t.t2,method:"GET",path:t.t3,allowFailover:!1},t.t5=t.t1.Request.call(t.t1,t.t4),t.next=14,t.t0.ResponseToJson.call(t.t0,t.t5);case 14:return t.abrupt("return",t.sent);case 15:case"end":return t.stop()}}),t,this)})));return function(e){return t.apply(this,arguments)}}(),e.UploadFileData=function(){var t=o(i.mark((function t(e){var r,n,o,a,c,A,f,h,d,p,y;return i.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=e.libraryId,n=e.objectId,o=e.writeToken,a=e.encryption,c=e.uploadId,A=e.jobId,f=e.filePath,h=e.fileData,g({libraryId:r,objectId:n}),l(o),t.next=5,this.UploadJobStatus({libraryId:r,objectId:n,writeToken:o,uploadId:c,jobId:A});case 5:if(d=t.sent,p=d.files.find((function(t){return t.path==f})),a&&"none"!==a&&(p=p.encrypted),0!==p.rem){t.next=12;break}return t.abrupt("return");case 12:p.skip&&(h=h.slice(p.skip));case 13:return y=u("q",o,"file_jobs",c,A),t.t0=this.utils,t.t1=this.HttpClient,t.t2=y,t.t3=h,t.t4=s,t.t5={"Content-type":"application/octet-stream"},t.next=22,this.authClient.AuthorizationHeader({libraryId:r,objectId:n,update:!0});case 22:return t.t6=t.sent,t.t7=(0,t.t4)(t.t5,t.t6),t.t8={method:"POST",path:t.t2,body:t.t3,bodyType:"BINARY",headers:t.t7,allowFailover:!1,allowRetry:!1},t.t9=t.t1.Request.call(t.t1,t.t8),t.next=28,t.t0.ResponseToJson.call(t.t0,t.t9);case 28:return t.abrupt("return",t.sent);case 29:case"end":return t.stop()}}),t,this)})));return function(e){return t.apply(this,arguments)}}(),e.FinalizeUploadJob=function(){var t=o(i.mark((function t(e){var r,n,o,a;return i.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=e.libraryId,n=e.objectId,o=e.writeToken,g({libraryId:r,objectId:n}),l(o),this.Log("Finalizing upload job: ".concat(r," ").concat(n," ").concat(o)),a=u("q",o,"files"),t.t0=this.HttpClient,t.t1=a,t.next=9,this.authClient.AuthorizationHeader({libraryId:r,objectId:n,update:!0});case 9:return t.t2=t.sent,t.t3={method:"POST",path:t.t1,bodyType:"BINARY",headers:t.t2,allowFailover:!1},t.next=13,t.t0.Request.call(t.t0,t.t3);case 13:case"end":return t.stop()}}),t,this)})));return function(e){return t.apply(this,arguments)}}(),e.CreateFileDirectories=function(){var t=o(i.mark((function t(e){var r,n,o,a,s;return i.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=e.libraryId,n=e.objectId,o=e.writeToken,a=e.filePaths,g({libraryId:r,objectId:n}),l(o),this.Log("Creating Directories: ".concat(r," ").concat(n," ").concat(o)),this.Log(a),s=a.map((function(t){return{op:"add",type:"directory",path:t}})),t.next=8,this.CreateFileUploadJob({libraryId:r,objectId:n,writeToken:o,ops:s});case 8:case"end":return t.stop()}}),t,this)})));return function(e){return t.apply(this,arguments)}}(),e.DeleteFiles=function(){var t=o(i.mark((function t(e){var r,n,o,a,s;return i.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=e.libraryId,n=e.objectId,o=e.writeToken,a=e.filePaths,g({libraryId:r,objectId:n}),l(o),this.Log("Deleting Files: ".concat(r," ").concat(n," ").concat(o)),this.Log(a),s=a.map((function(t){return{op:"del",path:t}})),t.next=8,this.CreateFileUploadJob({libraryId:r,objectId:n,writeToken:o,ops:s});case 8:case"end":return t.stop()}}),t,this)})));return function(e){return t.apply(this,arguments)}}(),e.DownloadFile=function(){var t=o(i.mark((function t(e){var r,n,o,a,c,A,f,l,d,p,y,I,b,v,E,m,C,w,B,Q,k,S=arguments;return i.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=e.libraryId,n=e.objectId,o=e.versionHash,a=e.writeToken,c=e.filePath,A=e.format,f=void 0===A?"arrayBuffer":A,l=e.chunked,d=void 0!==l&&l,p=e.chunkSize,y=e.clientSideDecryption,I=void 0!==y&&y,b=e.callback,g({libraryId:r,objectId:n,versionHash:o}),h("filePath",c),o&&(n=this.utils.DecodeVersionHash(o).objectId),t.next=6,this.ContentObjectMetadata({libraryId:r,objectId:n,versionHash:o,writeToken:a,metadataSubtree:u("files",c)});case 6:return v=t.sent,E=v&&v["."].encryption&&"cgck"===v["."].encryption.scheme,m=E?"cgck":void 0,C=E&&!I?u("q",a||o||n,"rep","files_download",c):u("q",a||o||n,"files",c),t.next=12,this.authClient.AuthorizationHeader({libraryId:r,objectId:n,versionHash:o,encryption:m,makeAccessRequest:"cgck"===m});case 12:return(w=t.sent).Accept="*/*",B="eluv.caps.iusr".concat(this.utils.AddressToHash(this.signer.address)),t.next=17,this.ContentObjectMetadata({libraryId:r,objectId:n,versionHash:o,metadataSubtree:B});case 17:if(Q=t.sent,t.t1=E,!t.t1){t.next=26;break}return t.t2=this.utils,t.t3=this.signer.address,t.next=24,this.ContentObjectOwner({objectId:n});case 24:t.t4=t.sent,t.t1=!t.t2.EqualAddress.call(t.t2,t.t3,t.t4);case 26:if(t.t0=t.t1,!t.t0){t.next=29;break}t.t0=!Q;case 29:if(!t.t0){t.next=31;break}w["X-Content-Fabric-Decryption-Mode"]="reencrypt";case 31:if(E&&!I&&(w["X-Content-Fabric-Decryption-Mode"]="decrypt",p=Number.MAX_SAFE_INTEGER),k=v["."].size,!E||!I){t.next=51;break}return t.t5=this,t.next=37,this.EncryptionConk({libraryId:r,objectId:n,versionHash:o,download:!0});case 37:return t.t6=t.sent,t.t7=C,t.t8=k,t.t9=w,t.t10=b,t.t11=f,t.t12=I,t.t13=d,t.t14={conk:t.t6,downloadPath:t.t7,bytesTotal:t.t8,headers:t.t9,callback:t.t10,format:t.t11,clientSideDecryption:t.t12,chunked:t.t13},t.next=48,t.t5.DownloadEncrypted.call(t.t5,t.t14);case 48:return t.abrupt("return",t.sent);case 51:return p||(p=1e7),t.prev=52,t.next=55,this.Download({downloadPath:C,bytesTotal:k,headers:w,callback:b,format:f,chunked:d,chunkSize:p});case 55:return t.abrupt("return",t.sent);case 58:if(t.prev=58,t.t15=t.catch(52),!E||I){t.next=62;break}return t.abrupt("return",this.DownloadFile(s(s({},S[0]),{},{clientSideDecryption:!0})));case 62:throw t.t15;case 63:case"end":return t.stop()}}),t,this,[[52,58]])})));return function(e){return t.apply(this,arguments)}}(),e.ContentParts=function(){var t=o(i.mark((function t(e){var r,n,o,a,s;return i.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=e.libraryId,n=e.objectId,o=e.versionHash,g({libraryId:r,objectId:n,versionHash:o}),this.Log("Retrieving parts: ".concat(r," ").concat(n||o)),o&&(n=this.utils.DecodeVersionHash(o).objectId),a=u("q",o||n,"parts"),t.t0=this.utils,t.t1=this.HttpClient,t.next=9,this.authClient.AuthorizationHeader({libraryId:r,objectId:n,versionHash:o});case 9:return t.t2=t.sent,t.t3=a,t.t4={headers:t.t2,method:"GET",path:t.t3},t.t5=t.t1.Request.call(t.t1,t.t4),t.next=15,t.t0.ResponseToJson.call(t.t0,t.t5);case 15:return s=t.sent,t.abrupt("return",s.parts);case 17:case"end":return t.stop()}}),t,this)})));return function(e){return t.apply(this,arguments)}}(),e.ContentPart=function(){var t=o(i.mark((function t(e){var r,n,o,a,s;return i.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=e.libraryId,n=e.objectId,o=e.versionHash,a=e.partHash,g({libraryId:r,objectId:n,versionHash:o}),d(a),this.Log("Retrieving part: ".concat(r," ").concat(n||o," ").concat(a)),o&&(n=this.utils.DecodeVersionHash(o).objectId),s=u("q",o||n,"parts",a),t.t0=this.utils,t.t1=this.HttpClient,t.next=10,this.authClient.AuthorizationHeader({libraryId:r,objectId:n,versionHash:o});case 10:return t.t2=t.sent,t.t3=s,t.t4={headers:t.t2,method:"GET",path:t.t3},t.t5=t.t1.Request.call(t.t1,t.t4),t.next=16,t.t0.ResponseToJson.call(t.t0,t.t5);case 16:return t.abrupt("return",t.sent);case 17:case"end":return t.stop()}}),t,this)})));return function(e){return t.apply(this,arguments)}}(),e.DownloadPart=function(){var t=o(i.mark((function t(e){var r,n,o,a,s,c,A,f,h,l,p,y,I,b,v,E,m;return i.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=e.libraryId,n=e.objectId,o=e.versionHash,a=e.writeToken,s=e.partHash,c=e.format,A=void 0===c?"arrayBuffer":c,f=e.chunked,h=void 0!==f&&f,l=e.chunkSize,p=void 0===l?1e7:l,y=e.callback,g({libraryId:r,objectId:n,versionHash:o}),d(s),o&&(n=this.utils.DecodeVersionHash(o).objectId),I=s.startsWith("hqpe"),b=I?"cgck":void 0,v=u("q",a||o||n,"data",s),t.next=9,this.authClient.AuthorizationHeader({libraryId:r,objectId:n,versionHash:o,encryption:b,makeAccessRequest:!0});case 9:return E=t.sent,t.next=12,this.ContentPart({libraryId:r,objectId:n,versionHash:o,partHash:s});case 12:if(m=t.sent.part.size,!I){t.next=37;break}return t.t0=this.utils,t.t1=this.signer.address,t.next=18,this.ContentObjectOwner({objectId:n});case 18:if(t.t2=t.sent,t.t0.EqualAddress.call(t.t0,t.t1,t.t2)){t.next=21;break}E["X-Content-Fabric-Decryption-Mode"]="reencrypt";case 21:return t.t3=this,t.next=24,this.EncryptionConk({libraryId:r,objectId:n,download:!0});case 24:return t.t4=t.sent,t.t5=v,t.t6=m,t.t7=E,t.t8=y,t.t9=A,t.t10=h,t.t11={conk:t.t4,downloadPath:t.t5,bytesTotal:t.t6,headers:t.t7,callback:t.t8,format:t.t9,chunked:t.t10},t.next=34,t.t3.DownloadEncrypted.call(t.t3,t.t11);case 34:return t.abrupt("return",t.sent);case 37:return t.next=39,this.Download({downloadPath:v,bytesTotal:m,headers:E,callback:y,format:A,chunked:h,chunkSize:p});case 39:return t.abrupt("return",t.sent);case 40:case"end":return t.stop()}}),t,this)})));return function(e){return t.apply(this,arguments)}}(),e.Download=function(){var e=o(i.mark((function e(r){var n,o,a,s,c,A,u,f,h,l,d,g,p,y,I;return i.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=r.downloadPath,o=r.headers,a=r.bytesTotal,s=r.chunked,c=void 0!==s&&s,A=r.chunkSize,u=void 0===A?2e6:A,f=r.callback,h=r.format,l=void 0===h?"arrayBuffer":h,!c||f){e.next=3;break}throw Error("No callback specified for chunked download");case 3:c||(d=[]),g=0,p=Math.ceil(a/u),y=0;case 7:if(!(y<p)){e.next=35;break}return o.Range="bytes=".concat(g,"-").concat(g+u-1),e.next=11,this.HttpClient.Request({path:n,headers:o,method:"GET"});case 11:if(I=e.sent,g=Math.min(g+u,a),!c){e.next=24;break}return e.t0=f,e.t1=g,e.t2=a,e.next=19,this.utils.ResponseToFormat(l,I);case 19:e.t3=e.sent,e.t4={bytesFinished:e.t1,bytesTotal:e.t2,chunk:e.t3},(0,e.t0)(e.t4),e.next=32;break;case 24:return e.t5=d,e.t6=t,e.next=28,I.arrayBuffer();case 28:e.t7=e.sent,e.t8=e.t6.from.call(e.t6,e.t7),e.t5.push.call(e.t5,e.t8),f&&f({bytesFinished:g,bytesTotal:a});case 32:y++,e.next=7;break;case 35:if(c){e.next=39;break}return e.next=38,this.utils.ResponseToFormat(l,new Response(t.concat(d)));case 38:return e.abrupt("return",e.sent);case 39:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}(),e.DownloadEncrypted=function(){var e=o(i.mark((function e(r){var n,a,s,c,A,u,f,h,l,d,g,p,y,I,b,v,E,m=this;return i.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=r.conk,a=r.downloadPath,s=r.bytesTotal,c=r.headers,A=r.callback,u=r.format,f=void 0===u?"arrayBuffer":u,h=r.chunked,!(l=void 0!==h&&h)||A){e.next=3;break}throw Error("No callback specified for chunked download");case 3:return d=n.public_key.startsWith("ktpk"),g=this.Crypto.EncryptedBlockSize(1e6,d),p=0,f=f.toLowerCase(),y=[],e.next=10,this.Crypto.OpenDecryptionStream(n);case 10:(I=e.sent).on("data",function(){var t=o(i.mark((function t(e){var r;return i.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!l){t.next=13;break}if("buffer"===f){t.next=10;break}if(r=e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength),"arraybuffer"!==f){t.next=7;break}e=r,t.next=10;break;case 7:return t.next=9,m.utils.ResponseToFormat(f,new Response(r));case 9:e=t.sent;case 10:A({bytesFinished:p,bytesTotal:s,chunk:e}),t.next=15;break;case 13:A&&A({bytesFinished:p,bytesTotal:s}),y.push(e);case 15:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()),b=Math.ceil(s/g),v=0;case 14:if(!(v<b)){e.next=30;break}return c.Range="bytes=".concat(p,"-").concat(p+g-1),e.next=18,this.HttpClient.Request({headers:c,method:"GET",path:a});case 18:return E=e.sent,p=Math.min(p+g,s),e.t0=I,e.t1=Uint8Array,e.next=24,E.arrayBuffer();case 24:e.t2=e.sent,e.t3=new e.t1(e.t2),e.t0.write.call(e.t0,e.t3);case 27:v++,e.next=14;break;case 30:return I.end(),e.next=33,new Promise((function(t){return I.on("finish",(function(){t()}))}));case 33:if(l){e.next=37;break}return e.next=36,this.utils.ResponseToFormat(f,new Response(t.concat(y)));case 36:return e.abrupt("return",e.sent);case 37:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}(),e.CreatePart=function(){var t=o(i.mark((function t(e){var r,n,o,a,s,c;return i.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=e.libraryId,n=e.objectId,o=e.writeToken,a=e.encryption,g({libraryId:r,objectId:n}),l(o),s=u("q",o,"parts"),t.t0=this.utils,t.t1=this.HttpClient,t.next=8,this.authClient.AuthorizationHeader({libraryId:r,objectId:n,update:!0,encryption:a});case 8:return t.t2=t.sent,t.t3=s,t.t4={headers:t.t2,method:"POST",path:t.t3,bodyType:"BINARY",body:"",allowFailover:!1},t.t5=t.t1.Request.call(t.t1,t.t4),t.next=14,t.t0.ResponseToJson.call(t.t0,t.t5);case 14:return c=t.sent,t.abrupt("return",c.part.write_token);case 16:case"end":return t.stop()}}),t,this)})));return function(e){return t.apply(this,arguments)}}(),e.UploadPartChunk=function(){var t=o(i.mark((function t(e){var r,n,o,a,s,c,A,f;return i.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=e.libraryId,n=e.objectId,o=e.writeToken,a=e.partWriteToken,s=e.chunk,c=e.encryption,g({libraryId:r,objectId:n}),l(o),!c||"none"===c){t.next=10;break}return t.next=6,this.EncryptionConk({libraryId:r,objectId:n,writeToken:o});case 6:return A=t.sent,t.next=9,this.Crypto.Encrypt(A,s);case 9:s=t.sent;case 10:return f=u("q",o,"parts"),t.t0=this.utils,t.t1=this.HttpClient,t.next=15,this.authClient.AuthorizationHeader({libraryId:r,objectId:n,update:!0,encryption:c});case 15:return t.t2=t.sent,t.t3=u(f,a),t.t4=s,t.t5={headers:t.t2,method:"POST",path:t.t3,body:t.t4,bodyType:"BINARY",allowFailover:!1},t.t6=t.t1.Request.call(t.t1,t.t5),t.next=22,t.t0.ResponseToJson.call(t.t0,t.t6);case 22:case"end":return t.stop()}}),t,this)})));return function(e){return t.apply(this,arguments)}}(),e.FinalizePart=function(){var t=o(i.mark((function t(e){var r,n,o,a,s,c;return i.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=e.libraryId,n=e.objectId,o=e.writeToken,a=e.partWriteToken,s=e.encryption,g({libraryId:r,objectId:n}),l(o),c=u("q",o,"parts"),t.t0=this.utils,t.t1=this.HttpClient,t.next=8,this.authClient.AuthorizationHeader({libraryId:r,objectId:n,update:!0,encryption:s});case 8:return t.t2=t.sent,t.t3=u(c,a),t.t4={headers:t.t2,method:"POST",path:t.t3,bodyType:"BINARY",body:"",allowFailover:!1},t.next=13,t.t1.Request.call(t.t1,t.t4);case 13:return t.t5=t.sent,t.next=16,t.t0.ResponseToJson.call(t.t0,t.t5);case 16:return t.abrupt("return",t.sent);case 17:case"end":return t.stop()}}),t,this)})));return function(e){return t.apply(this,arguments)}}(),e.UploadPart=function(){var t=o(i.mark((function t(e){var r,n,o,a,s,c,A,u,f,h,d,p,y;return i.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=e.libraryId,n=e.objectId,o=e.writeToken,a=e.data,s=e.encryption,c=void 0===s?"none":s,A=e.chunkSize,u=void 0===A?1e7:A,f=e.callback,g({libraryId:r,objectId:n}),l(o),t.next=5,this.CreatePart({libraryId:r,objectId:n,writeToken:o,encryption:c});case 5:h=t.sent,d=a.length||a.byteLength||a.size,f&&f({bytesFinished:0,bytesTotal:d}),p=0;case 9:if(!(p<d)){t.next=17;break}return y=a.slice(p,p+u),t.next=13,this.UploadPartChunk({libraryId:r,objectId:n,writeToken:o,partWriteToken:h,chunk:y,encryption:c});case 13:f&&f({bytesFinished:Math.min(p+u,d),bytesTotal:d});case 14:p+=u,t.next=9;break;case 17:return t.next=19,this.FinalizePart({libraryId:r,objectId:n,writeToken:o,partWriteToken:h,encryption:c});case 19:return t.abrupt("return",t.sent);case 20:case"end":return t.stop()}}),t,this)})));return function(e){return t.apply(this,arguments)}}(),e.DeletePart=function(){var t=o(i.mark((function t(e){var r,n,o,a,s;return i.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=e.libraryId,n=e.objectId,o=e.writeToken,a=e.partHash,g({libraryId:r,objectId:n}),l(o),d(a),s=u("q",o,"parts",a),t.t0=this.HttpClient,t.next=8,this.authClient.AuthorizationHeader({libraryId:r,objectId:n,update:!0});case 8:return t.t1=t.sent,t.t2=s,t.t3={headers:t.t1,method:"DELETE",path:t.t2,allowFailover:!1},t.next=13,t.t0.Request.call(t.t0,t.t3);case 13:case"end":return t.stop()}}),t,this)})));return function(e){return t.apply(this,arguments)}}()}).call(this,r(5).Buffer)},function(t,e){},function(t,e,r){"use strict";r.r(e),r.d(e,"ethers",(function(){return c})),r.d(e,"Signer",(function(){return Gn})),r.d(e,"Wallet",(function(){return bs})),r.d(e,"VoidSigner",(function(){return Hn})),r.d(e,"getDefaultProvider",(function(){return qh})),r.d(e,"providers",(function(){return o})),r.d(e,"BaseContract",(function(){return Ki})),r.d(e,"Contract",(function(){return qi})),r.d(e,"ContractFactory",(function(){return Ji})),r.d(e,"BigNumber",(function(){return b})),r.d(e,"FixedNumber",(function(){return co})),r.d(e,"constants",(function(){return i})),r.d(e,"errors",(function(){return h.a})),r.d(e,"logger",(function(){return El})),r.d(e,"utils",(function(){return s})),r.d(e,"wordlists",(function(){return ia})),r.d(e,"version",(function(){return vl})),r.d(e,"Wordlist",(function(){return zo}));var n={};r.r(n),r.d(n,"encode",(function(){return tt})),r.d(n,"decode",(function(){return nt}));var i={};r.r(i),r.d(i,"AddressZero",(function(){return ms})),r.d(i,"NegativeOne",(function(){return Oe})),r.d(i,"Zero",(function(){return Ne})),r.d(i,"One",(function(){return Pe})),r.d(i,"Two",(function(){return je})),r.d(i,"WeiPerEther",(function(){return Le})),r.d(i,"MaxUint256",(function(){return Fe})),r.d(i,"MinInt256",(function(){return Te})),r.d(i,"MaxInt256",(function(){return Ue})),r.d(i,"HashZero",(function(){return Cs})),r.d(i,"EtherSymbol",(function(){return ws}));var o={};r.r(o),r.d(o,"Provider",(function(){return kn})),r.d(o,"BaseProvider",(function(){return dA})),r.d(o,"Resolver",(function(){return fA})),r.d(o,"UrlJsonRpcProvider",(function(){return bu})),r.d(o,"FallbackProvider",(function(){return qf})),r.d(o,"AlchemyProvider",(function(){return Ru})),r.d(o,"AlchemyWebSocketProvider",(function(){return Mu})),r.d(o,"AnkrProvider",(function(){return Yu})),r.d(o,"CloudflareProvider",(function(){return nf})),r.d(o,"EtherscanProvider",(function(){return mf})),r.d(o,"InfuraProvider",(function(){return sh})),r.d(o,"InfuraWebSocketProvider",(function(){return ah})),r.d(o,"JsonRpcProvider",(function(){return TA})),r.d(o,"JsonRpcBatchProvider",(function(){return gh})),r.d(o,"NodesmithProvider",(function(){return wh})),r.d(o,"PocketProvider",(function(){return Rh})),r.d(o,"StaticJsonRpcProvider",(function(){return Iu})),r.d(o,"Web3Provider",(function(){return Yh})),r.d(o,"WebSocketProvider",(function(){return ru})),r.d(o,"IpcProvider",(function(){return Jf})),r.d(o,"JsonRpcSigner",(function(){return jA})),r.d(o,"getDefaultProvider",(function(){return qh})),r.d(o,"getNetwork",(function(){return Ms})),r.d(o,"isCommunityResource",(function(){return Mc})),r.d(o,"isCommunityResourcable",(function(){return xc})),r.d(o,"showThrottleMessage",(function(){return Oc})),r.d(o,"Formatter",(function(){return Dc}));var a={};r.r(a),r.d(a,"decode",(function(){return Rs})),r.d(a,"encode",(function(){return Os}));var s={};r.r(s),r.d(s,"AbiCoder",(function(){return zr})),r.d(s,"defaultAbiCoder",(function(){return Zr})),r.d(s,"Fragment",(function(){return Dr})),r.d(s,"ConstructorFragment",(function(){return Nr})),r.d(s,"ErrorFragment",(function(){return Lr})),r.d(s,"EventFragment",(function(){return xr})),r.d(s,"FunctionFragment",(function(){return Pr})),r.d(s,"ParamType",(function(){return Sr})),r.d(s,"FormatTypes",(function(){return Qr})),r.d(s,"checkResultErrors",(function(){return Y})),r.d(s,"Logger",(function(){return h.b})),r.d(s,"RLP",(function(){return n})),r.d(s,"_fetchData",(function(){return mc})),r.d(s,"fetchJson",(function(){return Cc})),r.d(s,"poll",(function(){return wc})),r.d(s,"checkProperties",(function(){return R})),r.d(s,"deepCopy",(function(){return j})),r.d(s,"defineReadOnly",(function(){return D})),r.d(s,"getStatic",(function(){return x})),r.d(s,"resolveProperties",(function(){return M})),r.d(s,"shallowCopy",(function(){return O})),r.d(s,"arrayify",(function(){return A.a})),r.d(s,"concat",(function(){return A.b})),r.d(s,"stripZeros",(function(){return A.o})),r.d(s,"zeroPad",(function(){return A.p})),r.d(s,"isBytes",(function(){return A.j})),r.d(s,"isBytesLike",(function(){return A.k})),r.d(s,"defaultPath",(function(){return ga})),r.d(s,"HDNode",(function(){return pa})),r.d(s,"SigningKey",(function(){return Vn})),r.d(s,"Interface",(function(){return ln})),r.d(s,"LogDescription",(function(){return sn})),r.d(s,"TransactionDescription",(function(){return cn})),r.d(s,"base58",(function(){return Po})),r.d(s,"base64",(function(){return a})),r.d(s,"hexlify",(function(){return A.i})),r.d(s,"isHexString",(function(){return A.l})),r.d(s,"hexConcat",(function(){return A.c})),r.d(s,"hexStripZeros",(function(){return A.f})),r.d(s,"hexValue",(function(){return A.g})),r.d(s,"hexZeroPad",(function(){return A.h})),r.d(s,"hexDataLength",(function(){return A.d})),r.d(s,"hexDataSlice",(function(){return A.e})),r.d(s,"nameprep",(function(){return ul})),r.d(s,"_toEscapedUtf8String",(function(){return Bt})),r.d(s,"toUtf8Bytes",(function(){return Ct})),r.d(s,"toUtf8CodePoints",(function(){return St})),r.d(s,"toUtf8String",(function(){return kt})),r.d(s,"Utf8ErrorFuncs",(function(){return Et})),r.d(s,"formatBytes32String",(function(){return fl})),r.d(s,"parseBytes32String",(function(){return hl})),r.d(s,"dnsEncode",(function(){return fc})),r.d(s,"hashMessage",(function(){return fo})),r.d(s,"namehash",(function(){return uc})),r.d(s,"isValidName",(function(){return Ac})),r.d(s,"id",(function(){return _t})),r.d(s,"_TypedDataEncoder",(function(){return xo})),r.d(s,"getAddress",(function(){return ht})),r.d(s,"getIcapAddress",(function(){return dt})),r.d(s,"getContractAddress",(function(){return gt})),r.d(s,"getCreate2Address",(function(){return pt})),r.d(s,"isAddress",(function(){return lt})),r.d(s,"formatEther",(function(){return Il})),r.d(s,"parseEther",(function(){return bl})),r.d(s,"formatUnits",(function(){return pl})),r.d(s,"parseUnits",(function(){return yl})),r.d(s,"commify",(function(){return gl})),r.d(s,"computeHmac",(function(){return Ho})),r.d(s,"keccak256",(function(){return V})),r.d(s,"ripemd160",(function(){return To})),r.d(s,"sha256",(function(){return Uo})),r.d(s,"sha512",(function(){return Go})),r.d(s,"randomBytes",(function(){return ma.a})),r.d(s,"shuffled",(function(){return Cf})),r.d(s,"solidityPack",(function(){return Wh})),r.d(s,"solidityKeccak256",(function(){return Xh})),r.d(s,"soliditySha256",(function(){return $h})),r.d(s,"splitSignature",(function(){return A.n})),r.d(s,"joinSignature",(function(){return A.m})),r.d(s,"accessListify",(function(){return Ai})),r.d(s,"parseTransaction",(function(){return gi})),r.d(s,"serializeTransaction",(function(){return li})),r.d(s,"TransactionTypes",(function(){return $n})),r.d(s,"getJsonWalletAddress",(function(){return as})),r.d(s,"computeAddress",(function(){return oi})),r.d(s,"recoverAddress",(function(){return ai})),r.d(s,"computePublicKey",(function(){return Xn})),r.d(s,"recoverPublicKey",(function(){return Wn})),r.d(s,"verifyMessage",(function(){return vs})),r.d(s,"verifyTypedData",(function(){return Es})),r.d(s,"getAccountPath",(function(){return Ea})),r.d(s,"mnemonicToEntropy",(function(){return Ia})),r.d(s,"entropyToMnemonic",(function(){return ba})),r.d(s,"isValidMnemonic",(function(){return va})),r.d(s,"mnemonicToSeed",(function(){return ya})),r.d(s,"SupportedAlgorithm",(function(){return Oo})),r.d(s,"UnicodeNormalizationForm",(function(){return yt})),r.d(s,"Utf8ErrorReason",(function(){return It})),r.d(s,"Indexed",(function(){return un}));var c={};r.r(c),r.d(c,"Signer",(function(){return Gn})),r.d(c,"Wallet",(function(){return bs})),r.d(c,"VoidSigner",(function(){return Hn})),r.d(c,"getDefaultProvider",(function(){return qh})),r.d(c,"providers",(function(){return o})),r.d(c,"BaseContract",(function(){return Ki})),r.d(c,"Contract",(function(){return qi})),r.d(c,"ContractFactory",(function(){return Ji})),r.d(c,"BigNumber",(function(){return b})),r.d(c,"FixedNumber",(function(){return co})),r.d(c,"constants",(function(){return i})),r.d(c,"errors",(function(){return h.a})),r.d(c,"logger",(function(){return El})),r.d(c,"utils",(function(){return s})),r.d(c,"wordlists",(function(){return ia})),r.d(c,"version",(function(){return vl})),r.d(c,"Wordlist",(function(){return zo}));var A=r(0),u=r(2),f=r.n(u),h=r(1);function l(t){return(l="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function d(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,(i=n.key,o=void 0,o=function(t,e){if("object"!==l(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==l(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(i,"string"),"symbol"===l(o)?o:String(o)),n)}var i,o}var g=f.a.BN,p=new h.b("bignumber/5.7.0"),y={};var I=!1,b=function(){function t(e,r){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),e!==y&&p.throwError("cannot call constructor directly; use BigNumber.from",h.b.errors.UNSUPPORTED_OPERATION,{operation:"new (BigNumber)"}),this._hex=r,this._isBigNumber=!0,Object.freeze(this)}var e,r,n;return e=t,n=[{key:"from",value:function(e){if(e instanceof t)return e;if("string"==typeof e)return e.match(/^-?0x[0-9a-f]+$/i)?new t(y,v(e)):e.match(/^-?[0-9]+$/)?new t(y,v(new g(e))):p.throwArgumentError("invalid BigNumber string","value",e);if("number"==typeof e)return e%1&&C("underflow","BigNumber.from",e),(e>=9007199254740991||e<=-9007199254740991)&&C("overflow","BigNumber.from",e),t.from(String(e));var r=e;if("bigint"==typeof r)return t.from(r.toString());if(Object(A.j)(r))return t.from(Object(A.i)(r));if(r)if(r.toHexString){var n=r.toHexString();if("string"==typeof n)return t.from(n)}else{var i=r._hex;if(null==i&&"BigNumber"===r.type&&(i=r.hex),"string"==typeof i&&(Object(A.l)(i)||"-"===i[0]&&Object(A.l)(i.substring(1))))return t.from(i)}return p.throwArgumentError("invalid BigNumber value","value",e)}},{key:"isBigNumber",value:function(t){return!(!t||!t._isBigNumber)}}],(r=[{key:"fromTwos",value:function(t){return E(m(this).fromTwos(t))}},{key:"toTwos",value:function(t){return E(m(this).toTwos(t))}},{key:"abs",value:function(){return"-"===this._hex[0]?t.from(this._hex.substring(1)):this}},{key:"add",value:function(t){return E(m(this).add(m(t)))}},{key:"sub",value:function(t){return E(m(this).sub(m(t)))}},{key:"div",value:function(e){return t.from(e).isZero()&&C("division-by-zero","div"),E(m(this).div(m(e)))}},{key:"mul",value:function(t){return E(m(this).mul(m(t)))}},{key:"mod",value:function(t){var e=m(t);return e.isNeg()&&C("division-by-zero","mod"),E(m(this).umod(e))}},{key:"pow",value:function(t){var e=m(t);return e.isNeg()&&C("negative-power","pow"),E(m(this).pow(e))}},{key:"and",value:function(t){var e=m(t);return(this.isNegative()||e.isNeg())&&C("unbound-bitwise-result","and"),E(m(this).and(e))}},{key:"or",value:function(t){var e=m(t);return(this.isNegative()||e.isNeg())&&C("unbound-bitwise-result","or"),E(m(this).or(e))}},{key:"xor",value:function(t){var e=m(t);return(this.isNegative()||e.isNeg())&&C("unbound-bitwise-result","xor"),E(m(this).xor(e))}},{key:"mask",value:function(t){return(this.isNegative()||t<0)&&C("negative-width","mask"),E(m(this).maskn(t))}},{key:"shl",value:function(t){return(this.isNegative()||t<0)&&C("negative-width","shl"),E(m(this).shln(t))}},{key:"shr",value:function(t){return(this.isNegative()||t<0)&&C("negative-width","shr"),E(m(this).shrn(t))}},{key:"eq",value:function(t){return m(this).eq(m(t))}},{key:"lt",value:function(t){return m(this).lt(m(t))}},{key:"lte",value:function(t){return m(this).lte(m(t))}},{key:"gt",value:function(t){return m(this).gt(m(t))}},{key:"gte",value:function(t){return m(this).gte(m(t))}},{key:"isNegative",value:function(){return"-"===this._hex[0]}},{key:"isZero",value:function(){return m(this).isZero()}},{key:"toNumber",value:function(){try{return m(this).toNumber()}catch(t){C("overflow","toNumber",this.toString())}return null}},{key:"toBigInt",value:function(){try{return BigInt(this.toString())}catch(t){}return p.throwError("this platform does not support BigInt",h.b.errors.UNSUPPORTED_OPERATION,{value:this.toString()})}},{key:"toString",value:function(){return arguments.length>0&&(10===arguments[0]?I||(I=!0,p.warn("BigNumber.toString does not accept any parameters; base-10 is assumed")):16===arguments[0]?p.throwError("BigNumber.toString does not accept any parameters; use bigNumber.toHexString()",h.b.errors.UNEXPECTED_ARGUMENT,{}):p.throwError("BigNumber.toString does not accept parameters",h.b.errors.UNEXPECTED_ARGUMENT,{})),m(this).toString(10)}},{key:"toHexString",value:function(){return this._hex}},{key:"toJSON",value:function(t){return{type:"BigNumber",hex:this.toHexString()}}}])&&d(e.prototype,r),n&&d(e,n),Object.defineProperty(e,"prototype",{writable:!1}),t}();function v(t){if("string"!=typeof t)return v(t.toString(16));if("-"===t[0])return"-"===(t=t.substring(1))[0]&&p.throwArgumentError("invalid hex","value",t),"0x00"===(t=v(t))?t:"-"+t;if("0x"!==t.substring(0,2)&&(t="0x"+t),"0x"===t)return"0x00";for(t.length%2&&(t="0x0"+t.substring(2));t.length>4&&"0x00"===t.substring(0,4);)t="0x"+t.substring(4);return t}function E(t){return b.from(v(t))}function m(t){var e=b.from(t).toHexString();return"-"===e[0]?new g("-"+e.substring(3),16):new g(e.substring(2),16)}function C(t,e,r){var n={fault:t,operation:e};return null!=r&&(n.value=r),p.throwError(t,h.b.errors.NUMERIC_FAULT,n)}function w(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,(i=n.key,o=void 0,o=function(t,e){if("object"!==k(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==k(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(i,"string"),"symbol"===k(o)?o:String(o)),n)}var i,o}function B(t,e,r){return e&&w(t.prototype,e),r&&w(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function Q(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */Q=function(){return t};var t={},e=Object.prototype,r=e.hasOwnProperty,n=Object.defineProperty||function(t,e,r){t[e]=r.value},i="function"==typeof Symbol?Symbol:{},o=i.iterator||"@@iterator",a=i.asyncIterator||"@@asyncIterator",s=i.toStringTag||"@@toStringTag";function c(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{c({},"")}catch(t){c=function(t,e,r){return t[e]=r}}function A(t,e,r,i){var o=e&&e.prototype instanceof h?e:h,a=Object.create(o.prototype),s=new B(i||[]);return n(a,"_invoke",{value:E(t,r,s)}),a}function u(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=A;var f={};function h(){}function l(){}function d(){}var g={};c(g,o,(function(){return this}));var p=Object.getPrototypeOf,y=p&&p(p(S([])));y&&y!==e&&r.call(y,o)&&(g=y);var I=d.prototype=h.prototype=Object.create(g);function b(t){["next","throw","return"].forEach((function(e){c(t,e,(function(t){return this._invoke(e,t)}))}))}function v(t,e){var i;n(this,"_invoke",{value:function(n,o){function a(){return new e((function(i,a){!function n(i,o,a,s){var c=u(t[i],t,o);if("throw"!==c.type){var A=c.arg,f=A.value;return f&&"object"==k(f)&&r.call(f,"__await")?e.resolve(f.__await).then((function(t){n("next",t,a,s)}),(function(t){n("throw",t,a,s)})):e.resolve(f).then((function(t){A.value=t,a(A)}),(function(t){return n("throw",t,a,s)}))}s(c.arg)}(n,o,i,a)}))}return i=i?i.then(a,a):a()}})}function E(t,e,r){var n="suspendedStart";return function(i,o){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===i)throw o;return _()}for(r.method=i,r.arg=o;;){var a=r.delegate;if(a){var s=m(a,r);if(s){if(s===f)continue;return s}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var c=u(t,e,r);if("normal"===c.type){if(n=r.done?"completed":"suspendedYield",c.arg===f)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(n="completed",r.method="throw",r.arg=c.arg)}}}function m(t,e){var r=e.method,n=t.iterator[r];if(void 0===n)return e.delegate=null,"throw"===r&&t.iterator.return&&(e.method="return",e.arg=void 0,m(t,e),"throw"===e.method)||"return"!==r&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+r+"' method")),f;var i=u(n,t.iterator,e.arg);if("throw"===i.type)return e.method="throw",e.arg=i.arg,e.delegate=null,f;var o=i.arg;return o?o.done?(e[t.resultName]=o.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,f):o:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,f)}function C(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function w(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function B(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(C,this),this.reset(!0)}function S(t){if(t){var e=t[o];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,i=function e(){for(;++n<t.length;)if(r.call(t,n))return e.value=t[n],e.done=!1,e;return e.value=void 0,e.done=!0,e};return i.next=i}}return{next:_}}function _(){return{value:void 0,done:!0}}return l.prototype=d,n(I,"constructor",{value:d,configurable:!0}),n(d,"constructor",{value:l,configurable:!0}),l.displayName=c(d,s,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===l||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,d):(t.__proto__=d,c(t,s,"GeneratorFunction")),t.prototype=Object.create(I),t},t.awrap=function(t){return{__await:t}},b(v.prototype),c(v.prototype,a,(function(){return this})),t.AsyncIterator=v,t.async=function(e,r,n,i,o){void 0===o&&(o=Promise);var a=new v(A(e,r,n,i),o);return t.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},b(I),c(I,s,"Generator"),c(I,o,(function(){return this})),c(I,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},t.values=S,B.prototype={constructor:B,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(w),!t)for(var e in this)"t"===e.charAt(0)&&r.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function n(r,n){return a.type="throw",a.arg=t,e.next=r,n&&(e.method="next",e.arg=void 0),!!n}for(var i=this.tryEntries.length-1;i>=0;--i){var o=this.tryEntries[i],a=o.completion;if("root"===o.tryLoc)return n("end");if(o.tryLoc<=this.prev){var s=r.call(o,"catchLoc"),c=r.call(o,"finallyLoc");if(s&&c){if(this.prev<o.catchLoc)return n(o.catchLoc,!0);if(this.prev<o.finallyLoc)return n(o.finallyLoc)}else if(s){if(this.prev<o.catchLoc)return n(o.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return n(o.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&r.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var o=i;break}}o&&("break"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc&&(o=null);var a=o?o.completion:{};return a.type=t,a.arg=e,o?(this.method="next",this.next=o.finallyLoc,f):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),f},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),w(r),f}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var i=n.arg;w(r)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:S(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),f}},t}function k(t){return(k="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var S=function(t,e,r,n){return new(r||(r=Promise))((function(i,o){function a(t){try{c(n.next(t))}catch(t){o(t)}}function s(t){try{c(n.throw(t))}catch(t){o(t)}}function c(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(a,s)}c((n=n.apply(t,e||[])).next())}))},_=new h.b("properties/5.7.0");function D(t,e,r){Object.defineProperty(t,e,{enumerable:!0,value:r,writable:!1})}function x(t,e){for(var r=0;r<32;r++){if(t[e])return t[e];if(!t.prototype||"object"!==k(t.prototype))break;t=Object.getPrototypeOf(t.prototype).constructor}return null}function M(t){return S(this,void 0,void 0,Q().mark((function e(){var r,n;return Q().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=Object.keys(t).map((function(e){var r=t[e];return Promise.resolve(r).then((function(t){return{key:e,value:t}}))})),e.next=3,Promise.all(r);case 3:return n=e.sent,e.abrupt("return",n.reduce((function(t,e){return t[e.key]=e.value,t}),{}));case 5:case"end":return e.stop()}}),e)})))}function R(t,e){t&&"object"===k(t)||_.throwArgumentError("invalid object","object",t),Object.keys(t).forEach((function(r){e[r]||_.throwArgumentError("invalid object key - "+r,"transaction:"+r,t)}))}function O(t){var e={};for(var r in t)e[r]=t[r];return e}var N={bigint:!0,boolean:!0,function:!0,number:!0,string:!0};function P(t){if(function t(e){if(null==e||N[k(e)])return!0;if(Array.isArray(e)||"object"===k(e)){if(!Object.isFrozen(e))return!1;for(var r=Object.keys(e),n=0;n<r.length;n++){var i=null;try{i=e[r[n]]}catch(t){continue}if(!t(i))return!1}return!0}return _.throwArgumentError("Cannot deepCopy ".concat(k(e)),"object",e)}(t))return t;if(Array.isArray(t))return Object.freeze(t.map((function(t){return j(t)})));if("object"===k(t)){var e={};for(var r in t){var n=t[r];void 0!==n&&D(e,r,j(n))}return e}return _.throwArgumentError("Cannot deepCopy ".concat(k(t)),"object",t)}function j(t){return P(t)}var L=B((function t(e){for(var r in function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),e)this[r]=j(e[r])}));function F(t){return(F="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function T(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function U(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,(i=n.key,o=void 0,o=function(t,e){if("object"!==F(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==F(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(i,"string"),"symbol"===F(o)?o:String(o)),n)}var i,o}function G(t,e,r){return e&&U(t.prototype,e),r&&U(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}var H=new h.b("abi/5.7.0");function Y(t){var e=[];return function t(r,n){if(Array.isArray(n))for(var i in n){var o=r.slice();o.push(i);try{t(o,n[i])}catch(t){e.push({path:o,error:t})}}}([],t),e}var K=function(){function t(e,r,n,i){T(this,t),this.name=e,this.type=r,this.localName=n,this.dynamic=i}return G(t,[{key:"_throwError",value:function(t,e){H.throwArgumentError(t,this.localName,e)}}]),t}(),q=function(){function t(e){T(this,t),D(this,"wordSize",e||32),this._data=[],this._dataLength=0,this._padding=new Uint8Array(e)}return G(t,[{key:"data",get:function(){return Object(A.c)(this._data)}},{key:"length",get:function(){return this._dataLength}},{key:"_writeData",value:function(t){return this._data.push(t),this._dataLength+=t.length,t.length}},{key:"appendWriter",value:function(t){return this._writeData(Object(A.b)(t._data))}},{key:"writeBytes",value:function(t){var e=Object(A.a)(t),r=e.length%this.wordSize;return r&&(e=Object(A.b)([e,this._padding.slice(r)])),this._writeData(e)}},{key:"_getValue",value:function(t){var e=Object(A.a)(b.from(t));return e.length>this.wordSize&&H.throwError("value out-of-bounds",h.b.errors.BUFFER_OVERRUN,{length:this.wordSize,offset:e.length}),e.length%this.wordSize&&(e=Object(A.b)([this._padding.slice(e.length%this.wordSize),e])),e}},{key:"writeValue",value:function(t){return this._writeData(this._getValue(t))}},{key:"writeUpdatableValue",value:function(){var t=this,e=this._data.length;return this._data.push(this._padding),this._dataLength+=this.wordSize,function(r){t._data[e]=t._getValue(r)}}}]),t}(),J=function(){function t(e,r,n,i){T(this,t),D(this,"_data",Object(A.a)(e)),D(this,"wordSize",r||32),D(this,"_coerceFunc",n),D(this,"allowLoose",i),this._offset=0}return G(t,[{key:"data",get:function(){return Object(A.i)(this._data)}},{key:"consumed",get:function(){return this._offset}},{key:"coerce",value:function(e,r){return this._coerceFunc?this._coerceFunc(e,r):t.coerce(e,r)}},{key:"_peekBytes",value:function(t,e,r){var n=Math.ceil(e/this.wordSize)*this.wordSize;return this._offset+n>this._data.length&&(this.allowLoose&&r&&this._offset+e<=this._data.length?n=e:H.throwError("data out-of-bounds",h.b.errors.BUFFER_OVERRUN,{length:this._data.length,offset:this._offset+n})),this._data.slice(this._offset,this._offset+n)}},{key:"subReader",value:function(e){return new t(this._data.slice(this._offset+e),this.wordSize,this._coerceFunc,this.allowLoose)}},{key:"readBytes",value:function(t,e){var r=this._peekBytes(0,t,!!e);return this._offset+=r.length,r.slice(0,t)}},{key:"readValue",value:function(){return b.from(this.readBytes(this.wordSize))}}],[{key:"coerce",value:function(t,e){var r=t.match("^u?int([0-9]+)$");return r&&parseInt(r[1])<=48&&(e=e.toNumber()),e}}]),t}(),z=r(167),Z=r.n(z);function V(t){return"0x"+Z.a.keccak_256(Object(A.a)(t))}var W=new h.b("rlp/5.7.0");function X(t){for(var e=[];t;)e.unshift(255&t),t>>=8;return e}function $(t,e,r){for(var n=0,i=0;i<r;i++)n=256*n+t[e+i];return n}function tt(t){return Object(A.i)(function t(e){if(Array.isArray(e)){var r=[];if(e.forEach((function(e){r=r.concat(t(e))})),r.length<=55)return r.unshift(192+r.length),r;var n=X(r.length);return n.unshift(247+n.length),n.concat(r)}Object(A.k)(e)||W.throwArgumentError("RLP object must be BytesLike","object",e);var i=Array.prototype.slice.call(Object(A.a)(e));if(1===i.length&&i[0]<=127)return i;if(i.length<=55)return i.unshift(128+i.length),i;var o=X(i.length);return o.unshift(183+o.length),o.concat(i)}(t))}function et(t,e,r,n){for(var i=[];r<e+1+n;){var o=rt(t,r);i.push(o.result),(r+=o.consumed)>e+1+n&&W.throwError("child data too short",h.b.errors.BUFFER_OVERRUN,{})}return{consumed:1+n,result:i}}function rt(t,e){if(0===t.length&&W.throwError("data too short",h.b.errors.BUFFER_OVERRUN,{}),t[e]>=248){var r=t[e]-247;e+1+r>t.length&&W.throwError("data short segment too short",h.b.errors.BUFFER_OVERRUN,{});var n=$(t,e+1,r);return e+1+r+n>t.length&&W.throwError("data long segment too short",h.b.errors.BUFFER_OVERRUN,{}),et(t,e,e+1+r,r+n)}if(t[e]>=192){var i=t[e]-192;return e+1+i>t.length&&W.throwError("data array too short",h.b.errors.BUFFER_OVERRUN,{}),et(t,e,e+1,i)}if(t[e]>=184){var o=t[e]-183;e+1+o>t.length&&W.throwError("data array too short",h.b.errors.BUFFER_OVERRUN,{});var a=$(t,e+1,o);return e+1+o+a>t.length&&W.throwError("data array too short",h.b.errors.BUFFER_OVERRUN,{}),{consumed:1+o+a,result:Object(A.i)(t.slice(e+1+o,e+1+o+a))}}if(t[e]>=128){var s=t[e]-128;return e+1+s>t.length&&W.throwError("data too short",h.b.errors.BUFFER_OVERRUN,{}),{consumed:1+s,result:Object(A.i)(t.slice(e+1,e+1+s))}}return{consumed:1,result:Object(A.i)(t[e])}}function nt(t){var e=Object(A.a)(t),r=rt(e,0);return r.consumed!==e.length&&W.throwArgumentError("invalid rlp data","data",t),r.result}var it=new h.b("address/5.7.0");function ot(t){Object(A.l)(t,20)||it.throwArgumentError("invalid address","address",t);for(var e=(t=t.toLowerCase()).substring(2).split(""),r=new Uint8Array(40),n=0;n<40;n++)r[n]=e[n].charCodeAt(0);for(var i=Object(A.a)(V(r)),o=0;o<40;o+=2)i[o>>1]>>4>=8&&(e[o]=e[o].toUpperCase()),(15&i[o>>1])>=8&&(e[o+1]=e[o+1].toUpperCase());return"0x"+e.join("")}for(var at={},st=0;st<10;st++)at[String(st)]=String(st);for(var ct=0;ct<26;ct++)at[String.fromCharCode(65+ct)]=String(10+ct);var At,ut=Math.floor((At=9007199254740991,Math.log10?Math.log10(At):Math.log(At)/Math.LN10));function ft(t){for(var e=(t=(t=t.toUpperCase()).substring(4)+t.substring(0,2)+"00").split("").map((function(t){return at[t]})).join("");e.length>=ut;){var r=e.substring(0,ut);e=parseInt(r,10)%97+e.substring(r.length)}for(var n=String(98-parseInt(e,10)%97);n.length<2;)n="0"+n;return n}function ht(t){var e,r=null;if("string"!=typeof t&&it.throwArgumentError("invalid address","address",t),t.match(/^(0x)?[0-9a-fA-F]{40}$/))"0x"!==t.substring(0,2)&&(t="0x"+t),r=ot(t),t.match(/([A-F].*[a-f])|([a-f].*[A-F])/)&&r!==t&&it.throwArgumentError("bad address checksum","address",t);else if(t.match(/^XE[0-9]{2}[0-9A-Za-z]{30,31}$/)){for(t.substring(2,4)!==ft(t)&&it.throwArgumentError("bad icap checksum","address",t),e=t.substring(4),r=new g(e,36).toString(16);r.length<40;)r="0"+r;r=ot("0x"+r)}else it.throwArgumentError("invalid address","address",t);return r}function lt(t){try{return ht(t),!0}catch(t){}return!1}function dt(t){for(var e,r=(e=ht(t).substring(2),new g(e,16).toString(36)).toUpperCase();r.length<30;)r="0"+r;return"XE"+ft("XE00"+r)+r}function gt(t){var e=null;try{e=ht(t.from)}catch(e){it.throwArgumentError("missing from address","transaction",t)}var r=Object(A.o)(Object(A.a)(b.from(t.nonce).toHexString()));return ht(Object(A.e)(V(tt([e,r])),12))}function pt(t,e,r){return 32!==Object(A.d)(e)&&it.throwArgumentError("salt must be 32 bytes","salt",e),32!==Object(A.d)(r)&&it.throwArgumentError("initCodeHash must be 32 bytes","initCodeHash",r),ht(Object(A.e)(V(Object(A.b)(["0xff",ht(t),e,r])),12))}var yt,It,bt=new h.b("strings/5.7.0");function vt(t,e,r,n,i){if(t===It.BAD_PREFIX||t===It.UNEXPECTED_CONTINUE){for(var o=0,a=e+1;a<r.length&&r[a]>>6==2;a++)o++;return o}return t===It.OVERRUN?r.length-e-1:0}!function(t){t.current="",t.NFC="NFC",t.NFD="NFD",t.NFKC="NFKC",t.NFKD="NFKD"}(yt||(yt={})),function(t){t.UNEXPECTED_CONTINUE="unexpected continuation byte",t.BAD_PREFIX="bad codepoint prefix",t.OVERRUN="string overrun",t.MISSING_CONTINUE="missing continuation byte",t.OUT_OF_RANGE="out of UTF-8 range",t.UTF16_SURROGATE="UTF-16 surrogate",t.OVERLONG="overlong representation"}(It||(It={}));var Et=Object.freeze({error:function(t,e,r,n,i){return bt.throwArgumentError("invalid codepoint at offset ".concat(e,"; ").concat(t),"bytes",r)},ignore:vt,replace:function(t,e,r,n,i){return t===It.OVERLONG?(n.push(i),0):(n.push(65533),vt(t,e,r))}});function mt(t,e){null==e&&(e=Et.error),t=Object(A.a)(t);for(var r=[],n=0;n<t.length;){var i=t[n++];if(i>>7!=0){var o=null,a=null;if(192==(224&i))o=1,a=127;else if(224==(240&i))o=2,a=2047;else{if(240!=(248&i)){n+=e(128==(192&i)?It.UNEXPECTED_CONTINUE:It.BAD_PREFIX,n-1,t,r);continue}o=3,a=65535}if(n-1+o>=t.length)n+=e(It.OVERRUN,n-1,t,r);else{for(var s=i&(1<<8-o-1)-1,c=0;c<o;c++){var u=t[n];if(128!=(192&u)){n+=e(It.MISSING_CONTINUE,n,t,r),s=null;break}s=s<<6|63&u,n++}null!==s&&(s>1114111?n+=e(It.OUT_OF_RANGE,n-1-o,t,r,s):s>=55296&&s<=57343?n+=e(It.UTF16_SURROGATE,n-1-o,t,r,s):s<=a?n+=e(It.OVERLONG,n-1-o,t,r,s):r.push(s))}}else r.push(i)}return r}function Ct(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:yt.current;e!=yt.current&&(bt.checkNormalize(),t=t.normalize(e));for(var r=[],n=0;n<t.length;n++){var i=t.charCodeAt(n);if(i<128)r.push(i);else if(i<2048)r.push(i>>6|192),r.push(63&i|128);else if(55296==(64512&i)){n++;var o=t.charCodeAt(n);if(n>=t.length||56320!=(64512&o))throw new Error("invalid utf-8 string");var a=65536+((1023&i)<<10)+(1023&o);r.push(a>>18|240),r.push(a>>12&63|128),r.push(a>>6&63|128),r.push(63&a|128)}else r.push(i>>12|224),r.push(i>>6&63|128),r.push(63&i|128)}return Object(A.a)(r)}function wt(t){var e="0000"+t.toString(16);return"\\u"+e.substring(e.length-4)}function Bt(t,e){return'"'+mt(t,e).map((function(t){if(t<256){switch(t){case 8:return"\\b";case 9:return"\\t";case 10:return"\\n";case 13:return"\\r";case 34:return'\\"';case 92:return"\\\\"}if(t>=32&&t<127)return String.fromCharCode(t)}return t<=65535?wt(t):wt(55296+((t-=65536)>>10&1023))+wt(56320+(1023&t))})).join("")+'"'}function Qt(t){return t.map((function(t){return t<=65535?String.fromCharCode(t):(t-=65536,String.fromCharCode(55296+(t>>10&1023),56320+(1023&t)))})).join("")}function kt(t,e){return Qt(mt(t,e))}function St(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:yt.current;return mt(Ct(t,e))}function _t(t){return V(Ct(t))}function Dt(t){return(Dt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function xt(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,(i=n.key,o=void 0,o=function(t,e){if("object"!==Dt(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==Dt(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(i,"string"),"symbol"===Dt(o)?o:String(o)),n)}var i,o}function Mt(t,e){return(Mt=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}function Rt(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=Nt(t);if(e){var i=Nt(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return Ot(this,r)}}function Ot(t,e){if(e&&("object"===Dt(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function Nt(t){return(Nt=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var Pt=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Mt(t,e)}(o,t);var e,r,n,i=Rt(o);function o(t){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,o),i.call(this,"address","address",t,!1)}return e=o,(r=[{key:"defaultValue",value:function(){return"0x0000000000000000000000000000000000000000"}},{key:"encode",value:function(t,e){try{e=ht(e)}catch(t){this._throwError(t.message,e)}return t.writeValue(e)}},{key:"decode",value:function(t){return ht(Object(A.h)(t.readValue().toHexString(),20))}}])&&xt(e.prototype,r),n&&xt(e,n),Object.defineProperty(e,"prototype",{writable:!1}),o}(K);function jt(t){return(jt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Lt(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,(i=n.key,o=void 0,o=function(t,e){if("object"!==jt(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==jt(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(i,"string"),"symbol"===jt(o)?o:String(o)),n)}var i,o}function Ft(t,e){return(Ft=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}function Tt(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=Gt(t);if(e){var i=Gt(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return Ut(this,r)}}function Ut(t,e){if(e&&("object"===jt(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function Gt(t){return(Gt=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var Ht=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Ft(t,e)}(o,t);var e,r,n,i=Tt(o);function o(t){var e;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,o),(e=i.call(this,t.name,t.type,void 0,t.dynamic)).coder=t,e}return e=o,(r=[{key:"defaultValue",value:function(){return this.coder.defaultValue()}},{key:"encode",value:function(t,e){return this.coder.encode(t,e)}},{key:"decode",value:function(t){return this.coder.decode(t)}}])&&Lt(e.prototype,r),n&&Lt(e,n),Object.defineProperty(e,"prototype",{writable:!1}),o}(K);function Yt(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,(i=n.key,o=void 0,o=function(t,e){if("object"!==Zt(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==Zt(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(i,"string"),"symbol"===Zt(o)?o:String(o)),n)}var i,o}function Kt(t,e){return(Kt=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}function qt(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=zt(t);if(e){var i=zt(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return Jt(this,r)}}function Jt(t,e){if(e&&("object"===Zt(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function zt(t){return(zt=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function Zt(t){return(Zt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var Vt=new h.b("abi/5.7.0");function Wt(t,e,r){var n=null;if(Array.isArray(r))n=r;else if(r&&"object"===Zt(r)){var i={};n=e.map((function(t){var e=t.localName;return e||Vt.throwError("cannot encode object for signature with missing names",h.b.errors.INVALID_ARGUMENT,{argument:"values",coder:t,value:r}),i[e]&&Vt.throwError("cannot encode object for signature with duplicate names",h.b.errors.INVALID_ARGUMENT,{argument:"values",coder:t,value:r}),i[e]=!0,r[e]}))}else Vt.throwArgumentError("invalid tuple value","tuple",r);e.length!==n.length&&Vt.throwArgumentError("types/value length mismatch","tuple",r);var o=new q(t.wordSize),a=new q(t.wordSize),s=[];e.forEach((function(t,e){var r=n[e];if(t.dynamic){var i=a.length;t.encode(a,r);var c=o.writeUpdatableValue();s.push((function(t){c(t+i)}))}else t.encode(o,r)})),s.forEach((function(t){t(o.length)}));var c=t.appendWriter(o);return c+=t.appendWriter(a)}function Xt(t,e){var r=[],n=t.subReader(0);e.forEach((function(e){var i=null;if(e.dynamic){var o=t.readValue(),a=n.subReader(o.toNumber());try{i=e.decode(a)}catch(t){if(t.code===h.b.errors.BUFFER_OVERRUN)throw t;(i=t).baseType=e.name,i.name=e.localName,i.type=e.type}}else try{i=e.decode(t)}catch(t){if(t.code===h.b.errors.BUFFER_OVERRUN)throw t;(i=t).baseType=e.name,i.name=e.localName,i.type=e.type}null!=i&&r.push(i)}));var i=e.reduce((function(t,e){var r=e.localName;return r&&(t[r]||(t[r]=0),t[r]++),t}),{});e.forEach((function(t,e){var n=t.localName;if(n&&1===i[n]&&("length"===n&&(n="_length"),null==r[n])){var o=r[e];o instanceof Error?Object.defineProperty(r,n,{enumerable:!0,get:function(){throw o}}):r[n]=o}}));for(var o=function(){var t=r[a];t instanceof Error&&Object.defineProperty(r,a,{enumerable:!0,get:function(){throw t}})},a=0;a<r.length;a++)o();return Object.freeze(r)}var $t=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Kt(t,e)}(o,t);var e,r,n,i=qt(o);function o(t,e,r){var n;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,o);var a=t.type+"["+(e>=0?e:"")+"]",s=-1===e||t.dynamic;return(n=i.call(this,"array",a,r,s)).coder=t,n.length=e,n}return e=o,(r=[{key:"defaultValue",value:function(){for(var t=this.coder.defaultValue(),e=[],r=0;r<this.length;r++)e.push(t);return e}},{key:"encode",value:function(t,e){Array.isArray(e)||this._throwError("expected array value",e);var r=this.length;-1===r&&(r=e.length,t.writeValue(e.length)),Vt.checkArgumentCount(e.length,r,"coder array"+(this.localName?" "+this.localName:""));for(var n=[],i=0;i<e.length;i++)n.push(this.coder);return Wt(t,n,e)}},{key:"decode",value:function(t){var e=this.length;-1===e&&32*(e=t.readValue().toNumber())>t._data.length&&Vt.throwError("insufficient data length",h.b.errors.BUFFER_OVERRUN,{length:t._data.length,count:e});for(var r=[],n=0;n<e;n++)r.push(new Ht(this.coder));return t.coerce(this.name,Xt(t,r))}}])&&Yt(e.prototype,r),n&&Yt(e,n),Object.defineProperty(e,"prototype",{writable:!1}),o}(K);function te(t){return(te="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function ee(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,(i=n.key,o=void 0,o=function(t,e){if("object"!==te(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==te(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(i,"string"),"symbol"===te(o)?o:String(o)),n)}var i,o}function re(t,e){return(re=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}function ne(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=oe(t);if(e){var i=oe(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return ie(this,r)}}function ie(t,e){if(e&&("object"===te(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function oe(t){return(oe=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var ae=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&re(t,e)}(o,t);var e,r,n,i=ne(o);function o(t){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,o),i.call(this,"bool","bool",t,!1)}return e=o,(r=[{key:"defaultValue",value:function(){return!1}},{key:"encode",value:function(t,e){return t.writeValue(e?1:0)}},{key:"decode",value:function(t){return t.coerce(this.type,!t.readValue().isZero())}}])&&ee(e.prototype,r),n&&ee(e,n),Object.defineProperty(e,"prototype",{writable:!1}),o}(K);function se(t){return(se="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function ce(){return(ce="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,r){var n=Ae(t,e);if(n){var i=Object.getOwnPropertyDescriptor(n,e);return i.get?i.get.call(arguments.length<3?t:r):i.value}}).apply(this,arguments)}function Ae(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=ye(t)););return t}function ue(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function fe(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,(i=n.key,o=void 0,o=function(t,e){if("object"!==se(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==se(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(i,"string"),"symbol"===se(o)?o:String(o)),n)}var i,o}function he(t,e,r){return e&&fe(t.prototype,e),r&&fe(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function le(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&de(t,e)}function de(t,e){return(de=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}function ge(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=ye(t);if(e){var i=ye(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return pe(this,r)}}function pe(t,e){if(e&&("object"===se(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function ye(t){return(ye=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var Ie=function(t){le(r,t);var e=ge(r);function r(t,n){return ue(this,r),e.call(this,t,t,n,!0)}return he(r,[{key:"defaultValue",value:function(){return"0x"}},{key:"encode",value:function(t,e){e=Object(A.a)(e);var r=t.writeValue(e.length);return r+=t.writeBytes(e)}},{key:"decode",value:function(t){return t.readBytes(t.readValue().toNumber(),!0)}}]),r}(K),be=function(t){le(r,t);var e=ge(r);function r(t){return ue(this,r),e.call(this,"bytes",t)}return he(r,[{key:"decode",value:function(t){return t.coerce(this.name,Object(A.i)(ce(ye(r.prototype),"decode",this).call(this,t)))}}]),r}(Ie);function ve(t){return(ve="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Ee(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,(i=n.key,o=void 0,o=function(t,e){if("object"!==ve(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==ve(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(i,"string"),"symbol"===ve(o)?o:String(o)),n)}var i,o}function me(t,e){return(me=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}function Ce(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=Be(t);if(e){var i=Be(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return we(this,r)}}function we(t,e){if(e&&("object"===ve(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function Be(t){return(Be=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var Qe=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&me(t,e)}(o,t);var e,r,n,i=Ce(o);function o(t,e){var r;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,o);var n="bytes"+String(t);return(r=i.call(this,n,n,e,!1)).size=t,r}return e=o,(r=[{key:"defaultValue",value:function(){return"0x0000000000000000000000000000000000000000000000000000000000000000".substring(0,2+2*this.size)}},{key:"encode",value:function(t,e){var r=Object(A.a)(e);return r.length!==this.size&&this._throwError("incorrect data length",e),t.writeBytes(r)}},{key:"decode",value:function(t){return t.coerce(this.name,Object(A.i)(t.readBytes(this.size)))}}])&&Ee(e.prototype,r),n&&Ee(e,n),Object.defineProperty(e,"prototype",{writable:!1}),o}(K);function ke(t){return(ke="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Se(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,(i=n.key,o=void 0,o=function(t,e){if("object"!==ke(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==ke(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(i,"string"),"symbol"===ke(o)?o:String(o)),n)}var i,o}function _e(t,e){return(_e=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}function De(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=Me(t);if(e){var i=Me(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return xe(this,r)}}function xe(t,e){if(e&&("object"===ke(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function Me(t){return(Me=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var Re=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&_e(t,e)}(o,t);var e,r,n,i=De(o);function o(t){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,o),i.call(this,"null","",t,!1)}return e=o,(r=[{key:"defaultValue",value:function(){return null}},{key:"encode",value:function(t,e){return null!=e&&this._throwError("not null",e),t.writeBytes([])}},{key:"decode",value:function(t){return t.readBytes(0),t.coerce(this.name,null)}}])&&Se(e.prototype,r),n&&Se(e,n),Object.defineProperty(e,"prototype",{writable:!1}),o}(K),Oe=b.from(-1),Ne=b.from(0),Pe=b.from(1),je=b.from(2),Le=b.from("1000000000000000000"),Fe=b.from("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"),Te=b.from("-0x8000000000000000000000000000000000000000000000000000000000000000"),Ue=b.from("0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");function Ge(t){return(Ge="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function He(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,(i=n.key,o=void 0,o=function(t,e){if("object"!==Ge(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==Ge(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(i,"string"),"symbol"===Ge(o)?o:String(o)),n)}var i,o}function Ye(t,e){return(Ye=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}function Ke(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=Je(t);if(e){var i=Je(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return qe(this,r)}}function qe(t,e){if(e&&("object"===Ge(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function Je(t){return(Je=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var ze=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Ye(t,e)}(o,t);var e,r,n,i=Ke(o);function o(t,e,r){var n;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,o);var a=(e?"int":"uint")+8*t;return(n=i.call(this,a,a,r,!1)).size=t,n.signed=e,n}return e=o,(r=[{key:"defaultValue",value:function(){return 0}},{key:"encode",value:function(t,e){var r=b.from(e),n=Fe.mask(8*t.wordSize);if(this.signed){var i=n.mask(8*this.size-1);(r.gt(i)||r.lt(i.add(Pe).mul(Oe)))&&this._throwError("value out-of-bounds",e)}else(r.lt(Ne)||r.gt(n.mask(8*this.size)))&&this._throwError("value out-of-bounds",e);return r=r.toTwos(8*this.size).mask(8*this.size),this.signed&&(r=r.fromTwos(8*this.size).toTwos(8*t.wordSize)),t.writeValue(r)}},{key:"decode",value:function(t){var e=t.readValue().mask(8*this.size);return this.signed&&(e=e.fromTwos(8*this.size)),t.coerce(this.name,e)}}])&&He(e.prototype,r),n&&He(e,n),Object.defineProperty(e,"prototype",{writable:!1}),o}(K);function Ze(t){return(Ze="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Ve(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,(i=n.key,o=void 0,o=function(t,e){if("object"!==Ze(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==Ze(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(i,"string"),"symbol"===Ze(o)?o:String(o)),n)}var i,o}function We(){return(We="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,r){var n=Xe(t,e);if(n){var i=Object.getOwnPropertyDescriptor(n,e);return i.get?i.get.call(arguments.length<3?t:r):i.value}}).apply(this,arguments)}function Xe(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=rr(t)););return t}function $e(t,e){return($e=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}function tr(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=rr(t);if(e){var i=rr(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return er(this,r)}}function er(t,e){if(e&&("object"===Ze(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function rr(t){return(rr=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var nr=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&$e(t,e)}(o,t);var e,r,n,i=tr(o);function o(t){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,o),i.call(this,"string",t)}return e=o,(r=[{key:"defaultValue",value:function(){return""}},{key:"encode",value:function(t,e){return We(rr(o.prototype),"encode",this).call(this,t,Ct(e))}},{key:"decode",value:function(t){return kt(We(rr(o.prototype),"decode",this).call(this,t))}}])&&Ve(e.prototype,r),n&&Ve(e,n),Object.defineProperty(e,"prototype",{writable:!1}),o}(Ie);function ir(t){return(ir="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function or(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,(i=n.key,o=void 0,o=function(t,e){if("object"!==ir(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==ir(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(i,"string"),"symbol"===ir(o)?o:String(o)),n)}var i,o}function ar(t,e){return(ar=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}function sr(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=Ar(t);if(e){var i=Ar(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return cr(this,r)}}function cr(t,e){if(e&&("object"===ir(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function Ar(t){return(Ar=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var ur=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&ar(t,e)}(o,t);var e,r,n,i=sr(o);function o(t,e){var r;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,o);var n=!1,a=[];t.forEach((function(t){t.dynamic&&(n=!0),a.push(t.type)}));var s="tuple("+a.join(",")+")";return(r=i.call(this,"tuple",s,e,n)).coders=t,r}return e=o,(r=[{key:"defaultValue",value:function(){var t=[];this.coders.forEach((function(e){t.push(e.defaultValue())}));var e=this.coders.reduce((function(t,e){var r=e.localName;return r&&(t[r]||(t[r]=0),t[r]++),t}),{});return this.coders.forEach((function(r,n){var i=r.localName;i&&1===e[i]&&("length"===i&&(i="_length"),null==t[i]&&(t[i]=t[n]))})),Object.freeze(t)}},{key:"encode",value:function(t,e){return Wt(t,this.coders,e)}},{key:"decode",value:function(t){return t.coerce(this.name,Xt(t,this.coders))}}])&&or(e.prototype,r),n&&or(e,n),Object.defineProperty(e,"prototype",{writable:!1}),o}(K);function fr(t){return(fr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function hr(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&lr(t,e)}function lr(t,e){return(lr=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}function dr(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=pr(t);if(e){var i=pr(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return gr(this,r)}}function gr(t,e){if(e&&("object"===fr(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function pr(t){return(pr=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function yr(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Ir(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,(i=n.key,o=void 0,o=function(t,e){if("object"!==fr(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==fr(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(i,"string"),"symbol"===fr(o)?o:String(o)),n)}var i,o}function br(t,e,r){return e&&Ir(t.prototype,e),r&&Ir(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}var vr=new h.b("abi/5.7.0"),Er={},mr={calldata:!0,memory:!0,storage:!0},Cr={calldata:!0,memory:!0};function wr(t,e){if("bytes"===t||"string"===t){if(mr[e])return!0}else if("address"===t){if("payable"===e)return!0}else if((t.indexOf("[")>=0||"tuple"===t)&&Cr[e])return!0;return(mr[e]||"payable"===e)&&vr.throwArgumentError("invalid modifier","name",e),!1}function Br(t,e){for(var r in e)D(t,r,e[r])}var Qr=Object.freeze({sighash:"sighash",minimal:"minimal",full:"full",json:"json"}),kr=new RegExp(/^(.*)\[([0-9]*)\]$/),Sr=function(){function t(e,r){yr(this,t),e!==Er&&vr.throwError("use fromString",h.b.errors.UNSUPPORTED_OPERATION,{operation:"new ParamType()"}),Br(this,r);var n=this.type.match(kr);Br(this,n?{arrayLength:parseInt(n[2]||"-1"),arrayChildren:t.fromObject({type:n[1],components:this.components}),baseType:"array"}:{arrayLength:null,arrayChildren:null,baseType:null!=this.components?"tuple":this.type}),this._isParamType=!0,Object.freeze(this)}return br(t,[{key:"format",value:function(t){if(t||(t=Qr.sighash),Qr[t]||vr.throwArgumentError("invalid format type","format",t),t===Qr.json){var e={type:"tuple"===this.baseType?"tuple":this.type,name:this.name||void 0};return"boolean"==typeof this.indexed&&(e.indexed=this.indexed),this.components&&(e.components=this.components.map((function(e){return JSON.parse(e.format(t))}))),JSON.stringify(e)}var r="";return"array"===this.baseType?(r+=this.arrayChildren.format(t),r+="["+(this.arrayLength<0?"":String(this.arrayLength))+"]"):"tuple"===this.baseType?(t!==Qr.sighash&&(r+=this.type),r+="("+this.components.map((function(e){return e.format(t)})).join(t===Qr.full?", ":",")+")"):r+=this.type,t!==Qr.sighash&&(!0===this.indexed&&(r+=" indexed"),t===Qr.full&&this.name&&(r+=" "+this.name)),r}}],[{key:"from",value:function(e,r){return"string"==typeof e?t.fromString(e,r):t.fromObject(e)}},{key:"fromObject",value:function(e){return t.isParamType(e)?e:new t(Er,{name:e.name||null,type:Fr(e.type),indexed:null==e.indexed?null:!!e.indexed,components:e.components?e.components.map(t.fromObject):null})}},{key:"fromString",value:function(e,r){return function(e){return t.fromObject({name:e.name,type:e.type,indexed:e.indexed,components:e.components})}(function(t,e){var r=t;function n(e){vr.throwArgumentError("unexpected character at position ".concat(e),"param",t)}function i(t){var r={type:"",name:"",parent:t,state:{allowType:!0}};return e&&(r.indexed=!1),r}t=t.replace(/\s/g," ");for(var o={type:"",name:"",state:{allowType:!0}},a=o,s=0;s<t.length;s++){var c=t[s];switch(c){case"(":a.state.allowType&&""===a.type?a.type="tuple":a.state.allowParams||n(s),a.state.allowType=!1,a.type=Fr(a.type),a.components=[i(a)],a=a.components[0];break;case")":delete a.state,"indexed"===a.name&&(e||n(s),a.indexed=!0,a.name=""),wr(a.type,a.name)&&(a.name=""),a.type=Fr(a.type);var A=a;(a=a.parent)||n(s),delete A.parent,a.state.allowParams=!1,a.state.allowName=!0,a.state.allowArray=!0;break;case",":delete a.state,"indexed"===a.name&&(e||n(s),a.indexed=!0,a.name=""),wr(a.type,a.name)&&(a.name=""),a.type=Fr(a.type);var u=i(a.parent);a.parent.components.push(u),delete a.parent,a=u;break;case" ":a.state.allowType&&""!==a.type&&(a.type=Fr(a.type),delete a.state.allowType,a.state.allowName=!0,a.state.allowParams=!0),a.state.allowName&&""!==a.name&&("indexed"===a.name?(e||n(s),a.indexed&&n(s),a.indexed=!0,a.name=""):wr(a.type,a.name)?a.name="":a.state.allowName=!1);break;case"[":a.state.allowArray||n(s),a.type+=c,a.state.allowArray=!1,a.state.allowName=!1,a.state.readArray=!0;break;case"]":a.state.readArray||n(s),a.type+=c,a.state.readArray=!1,a.state.allowArray=!0,a.state.allowName=!0;break;default:a.state.allowType?(a.type+=c,a.state.allowParams=!0,a.state.allowArray=!0):a.state.allowName?(a.name+=c,delete a.state.allowArray):a.state.readArray?a.type+=c:n(s)}}return a.parent&&vr.throwArgumentError("unexpected eof","param",t),delete o.state,"indexed"===a.name?(e||n(r.length-7),a.indexed&&n(r.length-7),a.indexed=!0,a.name=""):wr(a.type,a.name)&&(a.name=""),o.type=Fr(o.type),o}(e,!!r))}},{key:"isParamType",value:function(t){return!(null==t||!t._isParamType)}}]),t}();function _r(t,e){return function(t){t=t.trim();for(var e=[],r="",n=0,i=0;i<t.length;i++){var o=t[i];","===o&&0===n?(e.push(r),r=""):(r+=o,"("===o?n++:")"===o&&-1===--n&&vr.throwArgumentError("unbalanced parenthesis","value",t))}r&&e.push(r);return e}(t).map((function(t){return Sr.fromString(t,e)}))}var Dr=function(){function t(e,r){yr(this,t),e!==Er&&vr.throwError("use a static from method",h.b.errors.UNSUPPORTED_OPERATION,{operation:"new Fragment()"}),Br(this,r),this._isFragment=!0,Object.freeze(this)}return br(t,null,[{key:"from",value:function(e){return t.isFragment(e)?e:"string"==typeof e?t.fromString(e):t.fromObject(e)}},{key:"fromObject",value:function(e){if(t.isFragment(e))return e;switch(e.type){case"function":return Pr.fromObject(e);case"event":return xr.fromObject(e);case"constructor":return Nr.fromObject(e);case"error":return Lr.fromObject(e);case"fallback":case"receive":return null}return vr.throwArgumentError("invalid fragment object","value",e)}},{key:"fromString",value:function(t){return"event"===(t=(t=(t=t.replace(/\s/g," ")).replace(/\(/g," (").replace(/\)/g,") ").replace(/\s+/g," ")).trim()).split(" ")[0]?xr.fromString(t.substring(5).trim()):"function"===t.split(" ")[0]?Pr.fromString(t.substring(8).trim()):"constructor"===t.split("(")[0].trim()?Nr.fromString(t.trim()):"error"===t.split(" ")[0]?Lr.fromString(t.substring(5).trim()):vr.throwArgumentError("unsupported fragment","value",t)}},{key:"isFragment",value:function(t){return!(!t||!t._isFragment)}}]),t}(),xr=function(t){hr(r,t);var e=dr(r);function r(){return yr(this,r),e.apply(this,arguments)}return br(r,[{key:"format",value:function(t){if(t||(t=Qr.sighash),Qr[t]||vr.throwArgumentError("invalid format type","format",t),t===Qr.json)return JSON.stringify({type:"event",anonymous:this.anonymous,name:this.name,inputs:this.inputs.map((function(e){return JSON.parse(e.format(t))}))});var e="";return t!==Qr.sighash&&(e+="event "),e+=this.name+"("+this.inputs.map((function(e){return e.format(t)})).join(t===Qr.full?", ":",")+") ",t!==Qr.sighash&&this.anonymous&&(e+="anonymous "),e.trim()}}],[{key:"from",value:function(t){return"string"==typeof t?r.fromString(t):r.fromObject(t)}},{key:"fromObject",value:function(t){if(r.isEventFragment(t))return t;"event"!==t.type&&vr.throwArgumentError("invalid event object","value",t);var e={name:Ur(t.name),anonymous:t.anonymous,inputs:t.inputs?t.inputs.map(Sr.fromObject):[],type:"event"};return new r(Er,e)}},{key:"fromString",value:function(t){var e=t.match(Gr);e||vr.throwArgumentError("invalid event string","value",t);var n=!1;return e[3].split(" ").forEach((function(t){switch(t.trim()){case"anonymous":n=!0;break;case"":break;default:vr.warn("unknown modifier: "+t)}})),r.fromObject({name:e[1].trim(),anonymous:n,inputs:_r(e[2],!0),type:"event"})}},{key:"isEventFragment",value:function(t){return t&&t._isFragment&&"event"===t.type}}]),r}(Dr);function Mr(t,e){e.gas=null;var r=t.split("@");return 1!==r.length?(r.length>2&&vr.throwArgumentError("invalid human-readable ABI signature","value",t),r[1].match(/^[0-9]+$/)||vr.throwArgumentError("invalid human-readable ABI signature gas","value",t),e.gas=b.from(r[1]),r[0]):t}function Rr(t,e){e.constant=!1,e.payable=!1,e.stateMutability="nonpayable",t.split(" ").forEach((function(t){switch(t.trim()){case"constant":e.constant=!0;break;case"payable":e.payable=!0,e.stateMutability="payable";break;case"nonpayable":e.payable=!1,e.stateMutability="nonpayable";break;case"pure":e.constant=!0,e.stateMutability="pure";break;case"view":e.constant=!0,e.stateMutability="view";break;case"external":case"public":case"":break;default:console.log("unknown modifier: "+t)}}))}function Or(t){var e={constant:!1,payable:!0,stateMutability:"payable"};return null!=t.stateMutability?(e.stateMutability=t.stateMutability,e.constant="view"===e.stateMutability||"pure"===e.stateMutability,null!=t.constant&&!!t.constant!==e.constant&&vr.throwArgumentError("cannot have constant function with mutability "+e.stateMutability,"value",t),e.payable="payable"===e.stateMutability,null!=t.payable&&!!t.payable!==e.payable&&vr.throwArgumentError("cannot have payable function with mutability "+e.stateMutability,"value",t)):null!=t.payable?(e.payable=!!t.payable,null!=t.constant||e.payable||"constructor"===t.type||vr.throwArgumentError("unable to determine stateMutability","value",t),e.constant=!!t.constant,e.constant?e.stateMutability="view":e.stateMutability=e.payable?"payable":"nonpayable",e.payable&&e.constant&&vr.throwArgumentError("cannot have constant payable function","value",t)):null!=t.constant?(e.constant=!!t.constant,e.payable=!e.constant,e.stateMutability=e.constant?"view":"payable"):"constructor"!==t.type&&vr.throwArgumentError("unable to determine stateMutability","value",t),e}var Nr=function(t){hr(r,t);var e=dr(r);function r(){return yr(this,r),e.apply(this,arguments)}return br(r,[{key:"format",value:function(t){if(t||(t=Qr.sighash),Qr[t]||vr.throwArgumentError("invalid format type","format",t),t===Qr.json)return JSON.stringify({type:"constructor",stateMutability:"nonpayable"!==this.stateMutability?this.stateMutability:void 0,payable:this.payable,gas:this.gas?this.gas.toNumber():void 0,inputs:this.inputs.map((function(e){return JSON.parse(e.format(t))}))});t===Qr.sighash&&vr.throwError("cannot format a constructor for sighash",h.b.errors.UNSUPPORTED_OPERATION,{operation:"format(sighash)"});var e="constructor("+this.inputs.map((function(e){return e.format(t)})).join(t===Qr.full?", ":",")+") ";return this.stateMutability&&"nonpayable"!==this.stateMutability&&(e+=this.stateMutability+" "),e.trim()}}],[{key:"from",value:function(t){return"string"==typeof t?r.fromString(t):r.fromObject(t)}},{key:"fromObject",value:function(t){if(r.isConstructorFragment(t))return t;"constructor"!==t.type&&vr.throwArgumentError("invalid constructor object","value",t);var e=Or(t);e.constant&&vr.throwArgumentError("constructor cannot be constant","value",t);var n={name:null,type:t.type,inputs:t.inputs?t.inputs.map(Sr.fromObject):[],payable:e.payable,stateMutability:e.stateMutability,gas:t.gas?b.from(t.gas):null};return new r(Er,n)}},{key:"fromString",value:function(t){var e={type:"constructor"},n=(t=Mr(t,e)).match(Gr);return n&&"constructor"===n[1].trim()||vr.throwArgumentError("invalid constructor string","value",t),e.inputs=_r(n[2].trim(),!1),Rr(n[3].trim(),e),r.fromObject(e)}},{key:"isConstructorFragment",value:function(t){return t&&t._isFragment&&"constructor"===t.type}}]),r}(Dr),Pr=function(t){hr(r,t);var e=dr(r);function r(){return yr(this,r),e.apply(this,arguments)}return br(r,[{key:"format",value:function(t){if(t||(t=Qr.sighash),Qr[t]||vr.throwArgumentError("invalid format type","format",t),t===Qr.json)return JSON.stringify({type:"function",name:this.name,constant:this.constant,stateMutability:"nonpayable"!==this.stateMutability?this.stateMutability:void 0,payable:this.payable,gas:this.gas?this.gas.toNumber():void 0,inputs:this.inputs.map((function(e){return JSON.parse(e.format(t))})),outputs:this.outputs.map((function(e){return JSON.parse(e.format(t))}))});var e="";return t!==Qr.sighash&&(e+="function "),e+=this.name+"("+this.inputs.map((function(e){return e.format(t)})).join(t===Qr.full?", ":",")+") ",t!==Qr.sighash&&(this.stateMutability?"nonpayable"!==this.stateMutability&&(e+=this.stateMutability+" "):this.constant&&(e+="view "),this.outputs&&this.outputs.length&&(e+="returns ("+this.outputs.map((function(e){return e.format(t)})).join(", ")+") "),null!=this.gas&&(e+="@"+this.gas.toString()+" ")),e.trim()}}],[{key:"from",value:function(t){return"string"==typeof t?r.fromString(t):r.fromObject(t)}},{key:"fromObject",value:function(t){if(r.isFunctionFragment(t))return t;"function"!==t.type&&vr.throwArgumentError("invalid function object","value",t);var e=Or(t),n={type:t.type,name:Ur(t.name),constant:e.constant,inputs:t.inputs?t.inputs.map(Sr.fromObject):[],outputs:t.outputs?t.outputs.map(Sr.fromObject):[],payable:e.payable,stateMutability:e.stateMutability,gas:t.gas?b.from(t.gas):null};return new r(Er,n)}},{key:"fromString",value:function(t){var e={type:"function"},n=(t=Mr(t,e)).split(" returns ");n.length>2&&vr.throwArgumentError("invalid function string","value",t);var i=n[0].match(Gr);if(i||vr.throwArgumentError("invalid function signature","value",t),e.name=i[1].trim(),e.name&&Ur(e.name),e.inputs=_r(i[2],!1),Rr(i[3].trim(),e),n.length>1){var o=n[1].match(Gr);""==o[1].trim()&&""==o[3].trim()||vr.throwArgumentError("unexpected tokens","value",t),e.outputs=_r(o[2],!1)}else e.outputs=[];return r.fromObject(e)}},{key:"isFunctionFragment",value:function(t){return t&&t._isFragment&&"function"===t.type}}]),r}(Nr);function jr(t){var e=t.format();return"Error(string)"!==e&&"Panic(uint256)"!==e||vr.throwArgumentError("cannot specify user defined ".concat(e," error"),"fragment",t),t}var Lr=function(t){hr(r,t);var e=dr(r);function r(){return yr(this,r),e.apply(this,arguments)}return br(r,[{key:"format",value:function(t){if(t||(t=Qr.sighash),Qr[t]||vr.throwArgumentError("invalid format type","format",t),t===Qr.json)return JSON.stringify({type:"error",name:this.name,inputs:this.inputs.map((function(e){return JSON.parse(e.format(t))}))});var e="";return t!==Qr.sighash&&(e+="error "),(e+=this.name+"("+this.inputs.map((function(e){return e.format(t)})).join(t===Qr.full?", ":",")+") ").trim()}}],[{key:"from",value:function(t){return"string"==typeof t?r.fromString(t):r.fromObject(t)}},{key:"fromObject",value:function(t){if(r.isErrorFragment(t))return t;"error"!==t.type&&vr.throwArgumentError("invalid error object","value",t);var e={type:t.type,name:Ur(t.name),inputs:t.inputs?t.inputs.map(Sr.fromObject):[]};return jr(new r(Er,e))}},{key:"fromString",value:function(t){var e={type:"error"},n=t.match(Gr);return n||vr.throwArgumentError("invalid error signature","value",t),e.name=n[1].trim(),e.name&&Ur(e.name),e.inputs=_r(n[2],!1),jr(r.fromObject(e))}},{key:"isErrorFragment",value:function(t){return t&&t._isFragment&&"error"===t.type}}]),r}(Dr);function Fr(t){return t.match(/^uint($|[^1-9])/)?t="uint256"+t.substring(4):t.match(/^int($|[^1-9])/)&&(t="int256"+t.substring(3)),t}var Tr=new RegExp("^[a-zA-Z$_][a-zA-Z0-9$_]*$");function Ur(t){return t&&t.match(Tr)||vr.throwArgumentError('invalid identifier "'.concat(t,'"'),"value",t),t}var Gr=new RegExp("^([^)(]*)\\((.*)\\)([^)(]*)$");function Hr(t){return(Hr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Yr(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,(i=n.key,o=void 0,o=function(t,e){if("object"!==Hr(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==Hr(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(i,"string"),"symbol"===Hr(o)?o:String(o)),n)}var i,o}var Kr=new h.b("abi/5.7.0"),qr=new RegExp(/^bytes([0-9]*)$/),Jr=new RegExp(/^(u?int)([0-9]*)$/),zr=function(){function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),D(this,"coerceFunc",e||null)}var e,r,n;return e=t,(r=[{key:"_getCoder",value:function(t){var e=this;switch(t.baseType){case"address":return new Pt(t.name);case"bool":return new ae(t.name);case"string":return new nr(t.name);case"bytes":return new be(t.name);case"array":return new $t(this._getCoder(t.arrayChildren),t.arrayLength,t.name);case"tuple":return new ur((t.components||[]).map((function(t){return e._getCoder(t)})),t.name);case"":return new Re(t.name)}var r=t.type.match(Jr);if(r){var n=parseInt(r[2]||"256");return(0===n||n>256||n%8!=0)&&Kr.throwArgumentError("invalid "+r[1]+" bit length","param",t),new ze(n/8,"int"===r[1],t.name)}if(r=t.type.match(qr)){var i=parseInt(r[1]);return(0===i||i>32)&&Kr.throwArgumentError("invalid bytes length","param",t),new Qe(i,t.name)}return Kr.throwArgumentError("invalid type","type",t.type)}},{key:"_getWordSize",value:function(){return 32}},{key:"_getReader",value:function(t,e){return new J(t,this._getWordSize(),this.coerceFunc,e)}},{key:"_getWriter",value:function(){return new q(this._getWordSize())}},{key:"getDefaultValue",value:function(t){var e=this,r=t.map((function(t){return e._getCoder(Sr.from(t))}));return new ur(r,"_").defaultValue()}},{key:"encode",value:function(t,e){var r=this;t.length!==e.length&&Kr.throwError("types/values length mismatch",h.b.errors.INVALID_ARGUMENT,{count:{types:t.length,values:e.length},value:{types:t,values:e}});var n=t.map((function(t){return r._getCoder(Sr.from(t))})),i=new ur(n,"_"),o=this._getWriter();return i.encode(o,e),o.data}},{key:"decode",value:function(t,e,r){var n=this,i=t.map((function(t){return n._getCoder(Sr.from(t))}));return new ur(i,"_").decode(this._getReader(Object(A.a)(e),r))}}])&&Yr(e.prototype,r),n&&Yr(e,n),Object.defineProperty(e,"prototype",{writable:!1}),t}(),Zr=new zr;function Vr(t){return(Vr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Wr(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,(i=n.key,o=void 0,o=function(t,e){if("object"!==Vr(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==Vr(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(i,"string"),"symbol"===Vr(o)?o:String(o)),n)}var i,o}function Xr(t,e,r){return e&&Wr(t.prototype,e),r&&Wr(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function $r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function tn(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&en(t,e)}function en(t,e){return(en=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}function rn(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=on(t);if(e){var i=on(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return nn(this,r)}}function nn(t,e){if(e&&("object"===Vr(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function on(t){return(on=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var an=new h.b("abi/5.7.0"),sn=function(t){tn(r,t);var e=rn(r);function r(){return $r(this,r),e.apply(this,arguments)}return Xr(r)}(L),cn=function(t){tn(r,t);var e=rn(r);function r(){return $r(this,r),e.apply(this,arguments)}return Xr(r)}(L),An=function(t){tn(r,t);var e=rn(r);function r(){return $r(this,r),e.apply(this,arguments)}return Xr(r)}(L),un=function(t){tn(r,t);var e=rn(r);function r(){return $r(this,r),e.apply(this,arguments)}return Xr(r,null,[{key:"isIndexed",value:function(t){return!(!t||!t._isIndexed)}}]),r}(L),fn={"0x08c379a0":{signature:"Error(string)",name:"Error",inputs:["string"],reason:!0},"0x4e487b71":{signature:"Panic(uint256)",name:"Panic",inputs:["uint256"]}};function hn(t,e){var r=new Error("deferred error during ABI decoding triggered accessing ".concat(t));return r.error=e,r}var ln=function(){function t(e){var r=this;$r(this,t);D(this,"fragments",("string"==typeof e?JSON.parse(e):e).map((function(t){return Dr.from(t)})).filter((function(t){return null!=t}))),D(this,"_abiCoder",x(this instanceof t?this.constructor:void 0,"getAbiCoder")()),D(this,"functions",{}),D(this,"errors",{}),D(this,"events",{}),D(this,"structs",{}),this.fragments.forEach((function(t){var e=null;switch(t.type){case"constructor":return r.deploy?void an.warn("duplicate definition - constructor"):void D(r,"deploy",t);case"function":e=r.functions;break;case"event":e=r.events;break;case"error":e=r.errors;break;default:return}var n=t.format();e[n]?an.warn("duplicate definition - "+n):e[n]=t})),this.deploy||D(this,"deploy",Nr.from({payable:!1,type:"constructor"})),D(this,"_isInterface",!0)}return Xr(t,[{key:"format",value:function(t){t||(t=Qr.full),t===Qr.sighash&&an.throwArgumentError("interface does not support formatting sighash","format",t);var e=this.fragments.map((function(e){return e.format(t)}));return t===Qr.json?JSON.stringify(e.map((function(t){return JSON.parse(t)}))):e}},{key:"getFunction",value:function(t){if(Object(A.l)(t)){for(var e in this.functions)if(t===this.getSighash(e))return this.functions[e];an.throwArgumentError("no matching function","sighash",t)}if(-1===t.indexOf("(")){var r=t.trim(),n=Object.keys(this.functions).filter((function(t){return t.split("(")[0]===r}));return 0===n.length?an.throwArgumentError("no matching function","name",r):n.length>1&&an.throwArgumentError("multiple matching functions","name",r),this.functions[n[0]]}var i=this.functions[Pr.fromString(t).format()];return i||an.throwArgumentError("no matching function","signature",t),i}},{key:"getEvent",value:function(t){if(Object(A.l)(t)){var e=t.toLowerCase();for(var r in this.events)if(e===this.getEventTopic(r))return this.events[r];an.throwArgumentError("no matching event","topichash",e)}if(-1===t.indexOf("(")){var n=t.trim(),i=Object.keys(this.events).filter((function(t){return t.split("(")[0]===n}));return 0===i.length?an.throwArgumentError("no matching event","name",n):i.length>1&&an.throwArgumentError("multiple matching events","name",n),this.events[i[0]]}var o=this.events[xr.fromString(t).format()];return o||an.throwArgumentError("no matching event","signature",t),o}},{key:"getError",value:function(t){if(Object(A.l)(t)){var e=x(this.constructor,"getSighash");for(var r in this.errors){if(t===e(this.errors[r]))return this.errors[r]}an.throwArgumentError("no matching error","sighash",t)}if(-1===t.indexOf("(")){var n=t.trim(),i=Object.keys(this.errors).filter((function(t){return t.split("(")[0]===n}));return 0===i.length?an.throwArgumentError("no matching error","name",n):i.length>1&&an.throwArgumentError("multiple matching errors","name",n),this.errors[i[0]]}var o=this.errors[Pr.fromString(t).format()];return o||an.throwArgumentError("no matching error","signature",t),o}},{key:"getSighash",value:function(t){if("string"==typeof t)try{t=this.getFunction(t)}catch(e){try{t=this.getError(t)}catch(t){throw e}}return x(this.constructor,"getSighash")(t)}},{key:"getEventTopic",value:function(t){return"string"==typeof t&&(t=this.getEvent(t)),x(this.constructor,"getEventTopic")(t)}},{key:"_decodeParams",value:function(t,e){return this._abiCoder.decode(t,e)}},{key:"_encodeParams",value:function(t,e){return this._abiCoder.encode(t,e)}},{key:"encodeDeploy",value:function(t){return this._encodeParams(this.deploy.inputs,t||[])}},{key:"decodeErrorResult",value:function(t,e){"string"==typeof t&&(t=this.getError(t));var r=Object(A.a)(e);return Object(A.i)(r.slice(0,4))!==this.getSighash(t)&&an.throwArgumentError("data signature does not match error ".concat(t.name,"."),"data",Object(A.i)(r)),this._decodeParams(t.inputs,r.slice(4))}},{key:"encodeErrorResult",value:function(t,e){return"string"==typeof t&&(t=this.getError(t)),Object(A.i)(Object(A.b)([this.getSighash(t),this._encodeParams(t.inputs,e||[])]))}},{key:"decodeFunctionData",value:function(t,e){"string"==typeof t&&(t=this.getFunction(t));var r=Object(A.a)(e);return Object(A.i)(r.slice(0,4))!==this.getSighash(t)&&an.throwArgumentError("data signature does not match function ".concat(t.name,"."),"data",Object(A.i)(r)),this._decodeParams(t.inputs,r.slice(4))}},{key:"encodeFunctionData",value:function(t,e){return"string"==typeof t&&(t=this.getFunction(t)),Object(A.i)(Object(A.b)([this.getSighash(t),this._encodeParams(t.inputs,e||[])]))}},{key:"decodeFunctionResult",value:function(t,e){"string"==typeof t&&(t=this.getFunction(t));var r=Object(A.a)(e),n=null,i="",o=null,a=null,s=null;switch(r.length%this._abiCoder._getWordSize()){case 0:try{return this._abiCoder.decode(t.outputs,r)}catch(f){}break;case 4:var c=Object(A.i)(r.slice(0,4)),u=fn[c];if(u)o=this._abiCoder.decode(u.inputs,r.slice(4)),a=u.name,s=u.signature,u.reason&&(n=o[0]),"Error"===a?i="; VM Exception while processing transaction: reverted with reason string ".concat(JSON.stringify(o[0])):"Panic"===a&&(i="; VM Exception while processing transaction: reverted with panic code ".concat(o[0]));else try{var f=this.getError(c);o=this._abiCoder.decode(f.inputs,r.slice(4)),a=f.name,s=f.format()}catch(f){}}return an.throwError("call revert exception"+i,h.b.errors.CALL_EXCEPTION,{method:t.format(),data:Object(A.i)(e),errorArgs:o,errorName:a,errorSignature:s,reason:n})}},{key:"encodeFunctionResult",value:function(t,e){return"string"==typeof t&&(t=this.getFunction(t)),Object(A.i)(this._abiCoder.encode(t.outputs,e||[]))}},{key:"encodeFilterTopics",value:function(t,e){var r=this;"string"==typeof t&&(t=this.getEvent(t)),e.length>t.inputs.length&&an.throwError("too many arguments for "+t.format(),h.b.errors.UNEXPECTED_ARGUMENT,{argument:"values",value:e});var n=[];t.anonymous||n.push(this.getEventTopic(t));var i=function(t,e){return"string"===t.type?_t(e):"bytes"===t.type?V(Object(A.i)(e)):("bool"===t.type&&"boolean"==typeof e&&(e=e?"0x01":"0x00"),t.type.match(/^u?int/)&&(e=b.from(e).toHexString()),"address"===t.type&&r._abiCoder.encode(["address"],[e]),Object(A.h)(Object(A.i)(e),32))};for(e.forEach((function(e,r){var o=t.inputs[r];o.indexed?null==e?n.push(null):"array"===o.baseType||"tuple"===o.baseType?an.throwArgumentError("filtering with tuples or arrays not supported","contract."+o.name,e):Array.isArray(e)?n.push(e.map((function(t){return i(o,t)}))):n.push(i(o,e)):null!=e&&an.throwArgumentError("cannot filter non-indexed parameters; must be null","contract."+o.name,e)}));n.length&&null===n[n.length-1];)n.pop();return n}},{key:"encodeEventLog",value:function(t,e){var r=this;"string"==typeof t&&(t=this.getEvent(t));var n=[],i=[],o=[];return t.anonymous||n.push(this.getEventTopic(t)),e.length!==t.inputs.length&&an.throwArgumentError("event arguments/values mismatch","values",e),t.inputs.forEach((function(t,a){var s=e[a];if(t.indexed)if("string"===t.type)n.push(_t(s));else if("bytes"===t.type)n.push(V(s));else{if("tuple"===t.baseType||"array"===t.baseType)throw new Error("not implemented");n.push(r._abiCoder.encode([t.type],[s]))}else i.push(t),o.push(s)})),{data:this._abiCoder.encode(i,o),topics:n}}},{key:"decodeEventLog",value:function(t,e,r){if("string"==typeof t&&(t=this.getEvent(t)),null!=r&&!t.anonymous){var n=this.getEventTopic(t);Object(A.l)(r[0],32)&&r[0].toLowerCase()===n||an.throwError("fragment/topic mismatch",h.b.errors.INVALID_ARGUMENT,{argument:"topics[0]",expected:n,value:r[0]}),r=r.slice(1)}var i=[],o=[],a=[];t.inputs.forEach((function(t,e){t.indexed?"string"===t.type||"bytes"===t.type||"tuple"===t.baseType||"array"===t.baseType?(i.push(Sr.fromObject({type:"bytes32",name:t.name})),a.push(!0)):(i.push(t),a.push(!1)):(o.push(t),a.push(!1))}));var s=null!=r?this._abiCoder.decode(i,Object(A.b)(r)):null,c=this._abiCoder.decode(o,e,!0),u=[],f=0,l=0;t.inputs.forEach((function(t,e){if(t.indexed)if(null==s)u[e]=new un({_isIndexed:!0,hash:null});else if(a[e])u[e]=new un({_isIndexed:!0,hash:s[l++]});else try{u[e]=s[l++]}catch(t){u[e]=t}else try{u[e]=c[f++]}catch(t){u[e]=t}if(t.name&&null==u[t.name]){var r=u[e];r instanceof Error?Object.defineProperty(u,t.name,{enumerable:!0,get:function(){throw hn("property ".concat(JSON.stringify(t.name)),r)}}):u[t.name]=r}}));for(var d=function(t){var e=u[t];e instanceof Error&&Object.defineProperty(u,t,{enumerable:!0,get:function(){throw hn("index ".concat(t),e)}})},g=0;g<u.length;g++)d(g);return Object.freeze(u)}},{key:"parseTransaction",value:function(t){var e=this.getFunction(t.data.substring(0,10).toLowerCase());return e?new cn({args:this._abiCoder.decode(e.inputs,"0x"+t.data.substring(10)),functionFragment:e,name:e.name,signature:e.format(),sighash:this.getSighash(e),value:b.from(t.value||"0")}):null}},{key:"parseLog",value:function(t){var e=this.getEvent(t.topics[0]);return!e||e.anonymous?null:new sn({eventFragment:e,name:e.name,signature:e.format(),topic:this.getEventTopic(e),args:this.decodeEventLog(e,t.data,t.topics)})}},{key:"parseError",value:function(t){var e=Object(A.i)(t),r=this.getError(e.substring(0,10).toLowerCase());return r?new An({args:this._abiCoder.decode(r.inputs,"0x"+e.substring(10)),errorFragment:r,name:r.name,signature:r.format(),sighash:this.getSighash(r)}):null}}],[{key:"getAbiCoder",value:function(){return Zr}},{key:"getAddress",value:function(t){return ht(t)}},{key:"getSighash",value:function(t){return Object(A.e)(_t(t.format()),0,4)}},{key:"getEventTopic",value:function(t){return _t(t.format())}},{key:"isInterface",value:function(t){return!(!t||!t._isInterface)}}]),t}();function dn(t){return(dn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function gn(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */gn=function(){return t};var t={},e=Object.prototype,r=e.hasOwnProperty,n=Object.defineProperty||function(t,e,r){t[e]=r.value},i="function"==typeof Symbol?Symbol:{},o=i.iterator||"@@iterator",a=i.asyncIterator||"@@asyncIterator",s=i.toStringTag||"@@toStringTag";function c(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{c({},"")}catch(t){c=function(t,e,r){return t[e]=r}}function A(t,e,r,i){var o=e&&e.prototype instanceof h?e:h,a=Object.create(o.prototype),s=new B(i||[]);return n(a,"_invoke",{value:E(t,r,s)}),a}function u(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=A;var f={};function h(){}function l(){}function d(){}var g={};c(g,o,(function(){return this}));var p=Object.getPrototypeOf,y=p&&p(p(Q([])));y&&y!==e&&r.call(y,o)&&(g=y);var I=d.prototype=h.prototype=Object.create(g);function b(t){["next","throw","return"].forEach((function(e){c(t,e,(function(t){return this._invoke(e,t)}))}))}function v(t,e){var i;n(this,"_invoke",{value:function(n,o){function a(){return new e((function(i,a){!function n(i,o,a,s){var c=u(t[i],t,o);if("throw"!==c.type){var A=c.arg,f=A.value;return f&&"object"==dn(f)&&r.call(f,"__await")?e.resolve(f.__await).then((function(t){n("next",t,a,s)}),(function(t){n("throw",t,a,s)})):e.resolve(f).then((function(t){A.value=t,a(A)}),(function(t){return n("throw",t,a,s)}))}s(c.arg)}(n,o,i,a)}))}return i=i?i.then(a,a):a()}})}function E(t,e,r){var n="suspendedStart";return function(i,o){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===i)throw o;return k()}for(r.method=i,r.arg=o;;){var a=r.delegate;if(a){var s=m(a,r);if(s){if(s===f)continue;return s}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var c=u(t,e,r);if("normal"===c.type){if(n=r.done?"completed":"suspendedYield",c.arg===f)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(n="completed",r.method="throw",r.arg=c.arg)}}}function m(t,e){var r=e.method,n=t.iterator[r];if(void 0===n)return e.delegate=null,"throw"===r&&t.iterator.return&&(e.method="return",e.arg=void 0,m(t,e),"throw"===e.method)||"return"!==r&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+r+"' method")),f;var i=u(n,t.iterator,e.arg);if("throw"===i.type)return e.method="throw",e.arg=i.arg,e.delegate=null,f;var o=i.arg;return o?o.done?(e[t.resultName]=o.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,f):o:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,f)}function C(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function w(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function B(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(C,this),this.reset(!0)}function Q(t){if(t){var e=t[o];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,i=function e(){for(;++n<t.length;)if(r.call(t,n))return e.value=t[n],e.done=!1,e;return e.value=void 0,e.done=!0,e};return i.next=i}}return{next:k}}function k(){return{value:void 0,done:!0}}return l.prototype=d,n(I,"constructor",{value:d,configurable:!0}),n(d,"constructor",{value:l,configurable:!0}),l.displayName=c(d,s,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===l||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,d):(t.__proto__=d,c(t,s,"GeneratorFunction")),t.prototype=Object.create(I),t},t.awrap=function(t){return{__await:t}},b(v.prototype),c(v.prototype,a,(function(){return this})),t.AsyncIterator=v,t.async=function(e,r,n,i,o){void 0===o&&(o=Promise);var a=new v(A(e,r,n,i),o);return t.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},b(I),c(I,s,"Generator"),c(I,o,(function(){return this})),c(I,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},t.values=Q,B.prototype={constructor:B,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(w),!t)for(var e in this)"t"===e.charAt(0)&&r.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function n(r,n){return a.type="throw",a.arg=t,e.next=r,n&&(e.method="next",e.arg=void 0),!!n}for(var i=this.tryEntries.length-1;i>=0;--i){var o=this.tryEntries[i],a=o.completion;if("root"===o.tryLoc)return n("end");if(o.tryLoc<=this.prev){var s=r.call(o,"catchLoc"),c=r.call(o,"finallyLoc");if(s&&c){if(this.prev<o.catchLoc)return n(o.catchLoc,!0);if(this.prev<o.finallyLoc)return n(o.finallyLoc)}else if(s){if(this.prev<o.catchLoc)return n(o.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return n(o.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&r.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var o=i;break}}o&&("break"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc&&(o=null);var a=o?o.completion:{};return a.type=t,a.arg=e,o?(this.method="next",this.next=o.finallyLoc,f):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),f},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),w(r),f}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var i=n.arg;w(r)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:Q(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),f}},t}function pn(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function yn(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,(i=n.key,o=void 0,o=function(t,e){if("object"!==dn(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==dn(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(i,"string"),"symbol"===dn(o)?o:String(o)),n)}var i,o}function In(t,e,r){return e&&yn(t.prototype,e),r&&yn(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function bn(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&vn(t,e)}function vn(t,e){return(vn=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}function En(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=Cn(t);if(e){var i=Cn(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return mn(this,r)}}function mn(t,e){if(e&&("object"===dn(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function Cn(t){return(Cn=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var wn=function(t,e,r,n){return new(r||(r=Promise))((function(i,o){function a(t){try{c(n.next(t))}catch(t){o(t)}}function s(t){try{c(n.throw(t))}catch(t){o(t)}}function c(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(a,s)}c((n=n.apply(t,e||[])).next())}))},Bn=new h.b("abstract-provider/5.7.0"),Qn=function(t){bn(r,t);var e=En(r);function r(){return pn(this,r),e.apply(this,arguments)}return In(r,null,[{key:"isForkEvent",value:function(t){return!(!t||!t._isForkEvent)}}]),r}(L),kn=function(){function t(){pn(this,t),Bn.checkAbstract(this instanceof t?this.constructor:void 0,t),D(this,"_isProvider",!0)}return In(t,[{key:"getFeeData",value:function(){return wn(this,void 0,void 0,gn().mark((function t(){var e,r,n,i,o,a;return gn().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,M({block:this.getBlock("latest"),gasPrice:this.getGasPrice().catch((function(t){return null}))});case 2:return e=t.sent,r=e.block,n=e.gasPrice,i=null,o=null,a=null,r&&r.baseFeePerGas&&(i=r.baseFeePerGas,a=b.from("1500000000"),o=r.baseFeePerGas.mul(2).add(a)),t.abrupt("return",{lastBaseFeePerGas:i,maxFeePerGas:o,maxPriorityFeePerGas:a,gasPrice:n});case 8:case"end":return t.stop()}}),t,this)})))}},{key:"addListener",value:function(t,e){return this.on(t,e)}},{key:"removeListener",value:function(t,e){return this.off(t,e)}}],[{key:"isProvider",value:function(t){return!(!t||!t._isProvider)}}]),t}();function Sn(t){return(Sn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function _n(t,e){return(_n=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}function Dn(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=Rn(t);if(e){var i=Rn(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return xn(this,r)}}function xn(t,e){if(e&&("object"===Sn(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return Mn(t)}function Mn(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Rn(t){return(Rn=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function On(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */On=function(){return t};var t={},e=Object.prototype,r=e.hasOwnProperty,n=Object.defineProperty||function(t,e,r){t[e]=r.value},i="function"==typeof Symbol?Symbol:{},o=i.iterator||"@@iterator",a=i.asyncIterator||"@@asyncIterator",s=i.toStringTag||"@@toStringTag";function c(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{c({},"")}catch(t){c=function(t,e,r){return t[e]=r}}function A(t,e,r,i){var o=e&&e.prototype instanceof h?e:h,a=Object.create(o.prototype),s=new B(i||[]);return n(a,"_invoke",{value:E(t,r,s)}),a}function u(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=A;var f={};function h(){}function l(){}function d(){}var g={};c(g,o,(function(){return this}));var p=Object.getPrototypeOf,y=p&&p(p(Q([])));y&&y!==e&&r.call(y,o)&&(g=y);var I=d.prototype=h.prototype=Object.create(g);function b(t){["next","throw","return"].forEach((function(e){c(t,e,(function(t){return this._invoke(e,t)}))}))}function v(t,e){var i;n(this,"_invoke",{value:function(n,o){function a(){return new e((function(i,a){!function n(i,o,a,s){var c=u(t[i],t,o);if("throw"!==c.type){var A=c.arg,f=A.value;return f&&"object"==Sn(f)&&r.call(f,"__await")?e.resolve(f.__await).then((function(t){n("next",t,a,s)}),(function(t){n("throw",t,a,s)})):e.resolve(f).then((function(t){A.value=t,a(A)}),(function(t){return n("throw",t,a,s)}))}s(c.arg)}(n,o,i,a)}))}return i=i?i.then(a,a):a()}})}function E(t,e,r){var n="suspendedStart";return function(i,o){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===i)throw o;return k()}for(r.method=i,r.arg=o;;){var a=r.delegate;if(a){var s=m(a,r);if(s){if(s===f)continue;return s}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var c=u(t,e,r);if("normal"===c.type){if(n=r.done?"completed":"suspendedYield",c.arg===f)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(n="completed",r.method="throw",r.arg=c.arg)}}}function m(t,e){var r=e.method,n=t.iterator[r];if(void 0===n)return e.delegate=null,"throw"===r&&t.iterator.return&&(e.method="return",e.arg=void 0,m(t,e),"throw"===e.method)||"return"!==r&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+r+"' method")),f;var i=u(n,t.iterator,e.arg);if("throw"===i.type)return e.method="throw",e.arg=i.arg,e.delegate=null,f;var o=i.arg;return o?o.done?(e[t.resultName]=o.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,f):o:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,f)}function C(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function w(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function B(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(C,this),this.reset(!0)}function Q(t){if(t){var e=t[o];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,i=function e(){for(;++n<t.length;)if(r.call(t,n))return e.value=t[n],e.done=!1,e;return e.value=void 0,e.done=!0,e};return i.next=i}}return{next:k}}function k(){return{value:void 0,done:!0}}return l.prototype=d,n(I,"constructor",{value:d,configurable:!0}),n(d,"constructor",{value:l,configurable:!0}),l.displayName=c(d,s,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===l||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,d):(t.__proto__=d,c(t,s,"GeneratorFunction")),t.prototype=Object.create(I),t},t.awrap=function(t){return{__await:t}},b(v.prototype),c(v.prototype,a,(function(){return this})),t.AsyncIterator=v,t.async=function(e,r,n,i,o){void 0===o&&(o=Promise);var a=new v(A(e,r,n,i),o);return t.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},b(I),c(I,s,"Generator"),c(I,o,(function(){return this})),c(I,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},t.values=Q,B.prototype={constructor:B,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(w),!t)for(var e in this)"t"===e.charAt(0)&&r.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function n(r,n){return a.type="throw",a.arg=t,e.next=r,n&&(e.method="next",e.arg=void 0),!!n}for(var i=this.tryEntries.length-1;i>=0;--i){var o=this.tryEntries[i],a=o.completion;if("root"===o.tryLoc)return n("end");if(o.tryLoc<=this.prev){var s=r.call(o,"catchLoc"),c=r.call(o,"finallyLoc");if(s&&c){if(this.prev<o.catchLoc)return n(o.catchLoc,!0);if(this.prev<o.finallyLoc)return n(o.finallyLoc)}else if(s){if(this.prev<o.catchLoc)return n(o.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return n(o.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&r.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var o=i;break}}o&&("break"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc&&(o=null);var a=o?o.completion:{};return a.type=t,a.arg=e,o?(this.method="next",this.next=o.finallyLoc,f):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),f},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),w(r),f}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var i=n.arg;w(r)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:Q(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),f}},t}function Nn(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Pn(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,(i=n.key,o=void 0,o=function(t,e){if("object"!==Sn(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==Sn(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(i,"string"),"symbol"===Sn(o)?o:String(o)),n)}var i,o}function jn(t,e,r){return e&&Pn(t.prototype,e),r&&Pn(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}var Ln=function(t,e,r,n){return new(r||(r=Promise))((function(i,o){function a(t){try{c(n.next(t))}catch(t){o(t)}}function s(t){try{c(n.throw(t))}catch(t){o(t)}}function c(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(a,s)}c((n=n.apply(t,e||[])).next())}))},Fn=new h.b("abstract-signer/5.7.0"),Tn=["accessList","ccipReadEnabled","chainId","customData","data","from","gasLimit","gasPrice","maxFeePerGas","maxPriorityFeePerGas","nonce","to","type","value"],Un=[h.b.errors.INSUFFICIENT_FUNDS,h.b.errors.NONCE_EXPIRED,h.b.errors.REPLACEMENT_UNDERPRICED],Gn=function(){function t(){Nn(this,t),Fn.checkAbstract(this instanceof t?this.constructor:void 0,t),D(this,"_isSigner",!0)}return jn(t,[{key:"getBalance",value:function(t){return Ln(this,void 0,void 0,On().mark((function e(){return On().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this._checkProvider("getBalance"),e.next=3,this.provider.getBalance(this.getAddress(),t);case 3:return e.abrupt("return",e.sent);case 4:case"end":return e.stop()}}),e,this)})))}},{key:"getTransactionCount",value:function(t){return Ln(this,void 0,void 0,On().mark((function e(){return On().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this._checkProvider("getTransactionCount"),e.next=3,this.provider.getTransactionCount(this.getAddress(),t);case 3:return e.abrupt("return",e.sent);case 4:case"end":return e.stop()}}),e,this)})))}},{key:"estimateGas",value:function(t){return Ln(this,void 0,void 0,On().mark((function e(){var r;return On().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this._checkProvider("estimateGas"),e.next=3,M(this.checkTransaction(t));case 3:return r=e.sent,e.next=6,this.provider.estimateGas(r);case 6:return e.abrupt("return",e.sent);case 7:case"end":return e.stop()}}),e,this)})))}},{key:"call",value:function(t,e){return Ln(this,void 0,void 0,On().mark((function r(){var n;return On().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return this._checkProvider("call"),r.next=3,M(this.checkTransaction(t));case 3:return n=r.sent,r.next=6,this.provider.call(n,e);case 6:return r.abrupt("return",r.sent);case 7:case"end":return r.stop()}}),r,this)})))}},{key:"sendTransaction",value:function(t){return Ln(this,void 0,void 0,On().mark((function e(){var r,n;return On().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this._checkProvider("sendTransaction"),e.next=3,this.populateTransaction(t);case 3:return r=e.sent,e.next=6,this.signTransaction(r);case 6:return n=e.sent,e.next=9,this.provider.sendTransaction(n);case 9:return e.abrupt("return",e.sent);case 10:case"end":return e.stop()}}),e,this)})))}},{key:"getChainId",value:function(){return Ln(this,void 0,void 0,On().mark((function t(){var e;return On().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this._checkProvider("getChainId"),t.next=3,this.provider.getNetwork();case 3:return e=t.sent,t.abrupt("return",e.chainId);case 5:case"end":return t.stop()}}),t,this)})))}},{key:"getGasPrice",value:function(){return Ln(this,void 0,void 0,On().mark((function t(){return On().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this._checkProvider("getGasPrice"),t.next=3,this.provider.getGasPrice();case 3:return t.abrupt("return",t.sent);case 4:case"end":return t.stop()}}),t,this)})))}},{key:"getFeeData",value:function(){return Ln(this,void 0,void 0,On().mark((function t(){return On().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this._checkProvider("getFeeData"),t.next=3,this.provider.getFeeData();case 3:return t.abrupt("return",t.sent);case 4:case"end":return t.stop()}}),t,this)})))}},{key:"resolveName",value:function(t){return Ln(this,void 0,void 0,On().mark((function e(){return On().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this._checkProvider("resolveName"),e.next=3,this.provider.resolveName(t);case 3:return e.abrupt("return",e.sent);case 4:case"end":return e.stop()}}),e,this)})))}},{key:"checkTransaction",value:function(t){for(var e in t)-1===Tn.indexOf(e)&&Fn.throwArgumentError("invalid transaction key: "+e,"transaction",t);var r=O(t);return null==r.from?r.from=this.getAddress():r.from=Promise.all([Promise.resolve(r.from),this.getAddress()]).then((function(e){return e[0].toLowerCase()!==e[1].toLowerCase()&&Fn.throwArgumentError("from address mismatch","transaction",t),e[0]})),r}},{key:"populateTransaction",value:function(t){return Ln(this,void 0,void 0,On().mark((function e(){var r,n,i,o,a=this;return On().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,M(this.checkTransaction(t));case 2:if(null!=(r=e.sent).to&&(r.to=Promise.resolve(r.to).then((function(t){return Ln(a,void 0,void 0,On().mark((function e(){var r;return On().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!=t){e.next=2;break}return e.abrupt("return",null);case 2:return e.next=4,this.resolveName(t);case 4:return null==(r=e.sent)&&Fn.throwArgumentError("provided ENS name resolves to null","tx.to",t),e.abrupt("return",r);case 7:case"end":return e.stop()}}),e,this)})))})),r.to.catch((function(t){}))),n=null!=r.maxFeePerGas||null!=r.maxPriorityFeePerGas,null==r.gasPrice||2!==r.type&&!n?0!==r.type&&1!==r.type||!n||Fn.throwArgumentError("pre-eip-1559 transaction do not support maxFeePerGas/maxPriorityFeePerGas","transaction",t):Fn.throwArgumentError("eip-1559 transaction do not support gasPrice","transaction",t),2!==r.type&&null!=r.type||null==r.maxFeePerGas||null==r.maxPriorityFeePerGas){e.next=10;break}r.type=2,e.next=18;break;case 10:if(0!==r.type&&1!==r.type){e.next=14;break}null==r.gasPrice&&(r.gasPrice=this.getGasPrice()),e.next=18;break;case 14:return e.next=16,this.getFeeData();case 16:i=e.sent,null==r.type?null!=i.maxFeePerGas&&null!=i.maxPriorityFeePerGas?(r.type=2,null!=r.gasPrice?(o=r.gasPrice,delete r.gasPrice,r.maxFeePerGas=o,r.maxPriorityFeePerGas=o):(null==r.maxFeePerGas&&(r.maxFeePerGas=i.maxFeePerGas),null==r.maxPriorityFeePerGas&&(r.maxPriorityFeePerGas=i.maxPriorityFeePerGas))):null!=i.gasPrice?(n&&Fn.throwError("network does not support EIP-1559",h.b.errors.UNSUPPORTED_OPERATION,{operation:"populateTransaction"}),null==r.gasPrice&&(r.gasPrice=i.gasPrice),r.type=0):Fn.throwError("failed to get consistent fee data",h.b.errors.UNSUPPORTED_OPERATION,{operation:"signer.getFeeData"}):2===r.type&&(null==r.maxFeePerGas&&(r.maxFeePerGas=i.maxFeePerGas),null==r.maxPriorityFeePerGas&&(r.maxPriorityFeePerGas=i.maxPriorityFeePerGas));case 18:return null==r.nonce&&(r.nonce=this.getTransactionCount("pending")),null==r.gasLimit&&(r.gasLimit=this.estimateGas(r).catch((function(t){if(Un.indexOf(t.code)>=0)throw t;return Fn.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",h.b.errors.UNPREDICTABLE_GAS_LIMIT,{error:t,tx:r})}))),null==r.chainId?r.chainId=this.getChainId():r.chainId=Promise.all([Promise.resolve(r.chainId),this.getChainId()]).then((function(e){return 0!==e[1]&&e[0]!==e[1]&&Fn.throwArgumentError("chainId address mismatch","transaction",t),e[0]})),e.next=23,M(r);case 23:return e.abrupt("return",e.sent);case 24:case"end":return e.stop()}}),e,this)})))}},{key:"_checkProvider",value:function(t){this.provider||Fn.throwError("missing provider",h.b.errors.UNSUPPORTED_OPERATION,{operation:t||"_checkProvider"})}}],[{key:"isSigner",value:function(t){return!(!t||!t._isSigner)}}]),t}(),Hn=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&_n(t,e)}(r,t);var e=Dn(r);function r(t,n){var i;return Nn(this,r),D(Mn(i=e.call(this)),"address",t),D(Mn(i),"provider",n||null),i}return jn(r,[{key:"getAddress",value:function(){return Promise.resolve(this.address)}},{key:"_fail",value:function(t,e){return Promise.resolve().then((function(){Fn.throwError(t,h.b.errors.UNSUPPORTED_OPERATION,{operation:e})}))}},{key:"signMessage",value:function(t){return this._fail("VoidSigner cannot sign messages","signMessage")}},{key:"signTransaction",value:function(t){return this._fail("VoidSigner cannot sign transactions","signTransaction")}},{key:"_signTypedData",value:function(t,e,r){return this._fail("VoidSigner cannot sign typed data","signTypedData")}},{key:"connect",value:function(t){return new r(this.address,t)}}]),r}(Gn),Yn=r(166);function Kn(t){return(Kn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function qn(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,(i=n.key,o=void 0,o=function(t,e){if("object"!==Kn(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==Kn(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(i,"string"),"symbol"===Kn(o)?o:String(o)),n)}var i,o}var Jn=new h.b("signing-key/5.7.0"),zn=null;function Zn(){return zn||(zn=new Yn.a("secp256k1")),zn}var Vn=function(){function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),D(this,"curve","secp256k1"),D(this,"privateKey",Object(A.i)(e)),32!==Object(A.d)(this.privateKey)&&Jn.throwArgumentError("invalid private key","privateKey","[[ REDACTED ]]");var r=Zn().keyFromPrivate(Object(A.a)(this.privateKey));D(this,"publicKey","0x"+r.getPublic(!1,"hex")),D(this,"compressedPublicKey","0x"+r.getPublic(!0,"hex")),D(this,"_isSigningKey",!0)}var e,r,n;return e=t,n=[{key:"isSigningKey",value:function(t){return!(!t||!t._isSigningKey)}}],(r=[{key:"_addPoint",value:function(t){var e=Zn().keyFromPublic(Object(A.a)(this.publicKey)),r=Zn().keyFromPublic(Object(A.a)(t));return"0x"+e.pub.add(r.pub).encodeCompressed("hex")}},{key:"signDigest",value:function(t){var e=Zn().keyFromPrivate(Object(A.a)(this.privateKey)),r=Object(A.a)(t);32!==r.length&&Jn.throwArgumentError("bad digest length","digest",t);var n=e.sign(r,{canonical:!0});return Object(A.n)({recoveryParam:n.recoveryParam,r:Object(A.h)("0x"+n.r.toString(16),32),s:Object(A.h)("0x"+n.s.toString(16),32)})}},{key:"computeSharedSecret",value:function(t){var e=Zn().keyFromPrivate(Object(A.a)(this.privateKey)),r=Zn().keyFromPublic(Object(A.a)(Xn(t)));return Object(A.h)("0x"+e.derive(r.getPublic()).toString(16),32)}}])&&qn(e.prototype,r),n&&qn(e,n),Object.defineProperty(e,"prototype",{writable:!1}),t}();function Wn(t,e){var r=Object(A.n)(e),n={r:Object(A.a)(r.r),s:Object(A.a)(r.s)};return"0x"+Zn().recoverPubKey(Object(A.a)(t),n,r.recoveryParam).encode("hex",!1)}function Xn(t,e){var r=Object(A.a)(t);if(32===r.length){var n=new Vn(r);return e?"0x"+Zn().keyFromPrivate(r).getPublic(!0,"hex"):n.publicKey}return 33===r.length?e?Object(A.i)(r):"0x"+Zn().keyFromPublic(r).getPublic(!1,"hex"):65===r.length?e?"0x"+Zn().keyFromPublic(r).getPublic(!0,"hex"):Object(A.i)(r):Jn.throwArgumentError("invalid public or private key","key","[REDACTED]")}var $n,ti=new h.b("transactions/5.7.0");function ei(t){return"0x"===t?null:ht(t)}function ri(t){return"0x"===t?Ne:b.from(t)}!function(t){t[t.legacy=0]="legacy",t[t.eip2930=1]="eip2930",t[t.eip1559=2]="eip1559"}($n||($n={}));var ni=[{name:"nonce",maxLength:32,numeric:!0},{name:"gasPrice",maxLength:32,numeric:!0},{name:"gasLimit",maxLength:32,numeric:!0},{name:"to",length:20},{name:"value",maxLength:32,numeric:!0},{name:"data"}],ii={chainId:!0,data:!0,gasLimit:!0,gasPrice:!0,nonce:!0,to:!0,type:!0,value:!0};function oi(t){var e=Xn(t);return ht(Object(A.e)(V(Object(A.e)(e,1)),12))}function ai(t,e){return oi(Wn(Object(A.a)(t),e))}function si(t,e){var r=Object(A.o)(b.from(t).toHexString());return r.length>32&&ti.throwArgumentError("invalid length for "+e,"transaction:"+e,t),r}function ci(t,e){return{address:ht(t),storageKeys:(e||[]).map((function(e,r){return 32!==Object(A.d)(e)&&ti.throwArgumentError("invalid access list storageKey","accessList[".concat(t,":").concat(r,"]"),e),e.toLowerCase()}))}}function Ai(t){if(Array.isArray(t))return t.map((function(t,e){return Array.isArray(t)?(t.length>2&&ti.throwArgumentError("access list expected to be [ address, storageKeys[] ]","value[".concat(e,"]"),t),ci(t[0],t[1])):ci(t.address,t.storageKeys)}));var e=Object.keys(t).map((function(e){var r=t[e].reduce((function(t,e){return t[e]=!0,t}),{});return ci(e,Object.keys(r).sort())}));return e.sort((function(t,e){return t.address.localeCompare(e.address)})),e}function ui(t){return Ai(t).map((function(t){return[t.address,t.storageKeys]}))}function fi(t,e){if(null!=t.gasPrice){var r=b.from(t.gasPrice),n=b.from(t.maxFeePerGas||0);r.eq(n)||ti.throwArgumentError("mismatch EIP-1559 gasPrice != maxFeePerGas","tx",{gasPrice:r,maxFeePerGas:n})}var i=[si(t.chainId||0,"chainId"),si(t.nonce||0,"nonce"),si(t.maxPriorityFeePerGas||0,"maxPriorityFeePerGas"),si(t.maxFeePerGas||0,"maxFeePerGas"),si(t.gasLimit||0,"gasLimit"),null!=t.to?ht(t.to):"0x",si(t.value||0,"value"),t.data||"0x",ui(t.accessList||[])];if(e){var o=Object(A.n)(e);i.push(si(o.recoveryParam,"recoveryParam")),i.push(Object(A.o)(o.r)),i.push(Object(A.o)(o.s))}return Object(A.c)(["0x02",tt(i)])}function hi(t,e){var r=[si(t.chainId||0,"chainId"),si(t.nonce||0,"nonce"),si(t.gasPrice||0,"gasPrice"),si(t.gasLimit||0,"gasLimit"),null!=t.to?ht(t.to):"0x",si(t.value||0,"value"),t.data||"0x",ui(t.accessList||[])];if(e){var n=Object(A.n)(e);r.push(si(n.recoveryParam,"recoveryParam")),r.push(Object(A.o)(n.r)),r.push(Object(A.o)(n.s))}return Object(A.c)(["0x01",tt(r)])}function li(t,e){if(null==t.type||0===t.type)return null!=t.accessList&&ti.throwArgumentError("untyped transactions do not support accessList; include type: 1","transaction",t),function(t,e){R(t,ii);var r=[];ni.forEach((function(e){var n=t[e.name]||[],i={};e.numeric&&(i.hexPad="left"),n=Object(A.a)(Object(A.i)(n,i)),e.length&&n.length!==e.length&&n.length>0&&ti.throwArgumentError("invalid length for "+e.name,"transaction:"+e.name,n),e.maxLength&&(n=Object(A.o)(n)).length>e.maxLength&&ti.throwArgumentError("invalid length for "+e.name,"transaction:"+e.name,n),r.push(Object(A.i)(n))}));var n=0;if(null!=t.chainId?"number"!=typeof(n=t.chainId)&&ti.throwArgumentError("invalid transaction.chainId","transaction",t):e&&!Object(A.k)(e)&&e.v>28&&(n=Math.floor((e.v-35)/2)),0!==n&&(r.push(Object(A.i)(n)),r.push("0x"),r.push("0x")),!e)return tt(r);var i=Object(A.n)(e),o=27+i.recoveryParam;return 0!==n?(r.pop(),r.pop(),r.pop(),o+=2*n+8,i.v>28&&i.v!==o&&ti.throwArgumentError("transaction.chainId/signature.v mismatch","signature",e)):i.v!==o&&ti.throwArgumentError("transaction.chainId/signature.v mismatch","signature",e),r.push(Object(A.i)(o)),r.push(Object(A.o)(Object(A.a)(i.r))),r.push(Object(A.o)(Object(A.a)(i.s))),tt(r)}(t,e);switch(t.type){case 1:return hi(t,e);case 2:return fi(t,e)}return ti.throwError("unsupported transaction type: ".concat(t.type),h.b.errors.UNSUPPORTED_OPERATION,{operation:"serializeTransaction",transactionType:t.type})}function di(t,e,r){try{var n=ri(e[0]).toNumber();if(0!==n&&1!==n)throw new Error("bad recid");t.v=n}catch(t){ti.throwArgumentError("invalid v for transaction type: 1","v",e[0])}t.r=Object(A.h)(e[1],32),t.s=Object(A.h)(e[2],32);try{var i=V(r(t));t.from=ai(i,{r:t.r,s:t.s,recoveryParam:t.v})}catch(t){}}function gi(t){var e=Object(A.a)(t);if(e[0]>127)return function(t){var e=nt(t);9!==e.length&&6!==e.length&&ti.throwArgumentError("invalid raw transaction","rawTransaction",t);var r={nonce:ri(e[0]).toNumber(),gasPrice:ri(e[1]),gasLimit:ri(e[2]),to:ei(e[3]),value:ri(e[4]),data:e[5],chainId:0};if(6===e.length)return r;try{r.v=b.from(e[6]).toNumber()}catch(t){return r}if(r.r=Object(A.h)(e[7],32),r.s=Object(A.h)(e[8],32),b.from(r.r).isZero()&&b.from(r.s).isZero())r.chainId=r.v,r.v=0;else{r.chainId=Math.floor((r.v-35)/2),r.chainId<0&&(r.chainId=0);var n=r.v-27,i=e.slice(0,6);0!==r.chainId&&(i.push(Object(A.i)(r.chainId)),i.push("0x"),i.push("0x"),n-=2*r.chainId+8);var o=V(tt(i));try{r.from=ai(o,{r:Object(A.i)(r.r),s:Object(A.i)(r.s),recoveryParam:n})}catch(t){}r.hash=V(t)}return r.type=null,r}(e);switch(e[0]){case 1:return function(t){var e=nt(t.slice(1));8!==e.length&&11!==e.length&&ti.throwArgumentError("invalid component count for transaction type: 1","payload",Object(A.i)(t));var r={type:1,chainId:ri(e[0]).toNumber(),nonce:ri(e[1]).toNumber(),gasPrice:ri(e[2]),gasLimit:ri(e[3]),to:ei(e[4]),value:ri(e[5]),data:e[6],accessList:Ai(e[7])};return 8===e.length||(r.hash=V(t),di(r,e.slice(8),hi)),r}(e);case 2:return function(t){var e=nt(t.slice(1));9!==e.length&&12!==e.length&&ti.throwArgumentError("invalid component count for transaction type: 2","payload",Object(A.i)(t));var r=ri(e[2]),n=ri(e[3]),i={type:2,chainId:ri(e[0]).toNumber(),nonce:ri(e[1]).toNumber(),maxPriorityFeePerGas:r,maxFeePerGas:n,gasPrice:null,gasLimit:ri(e[4]),to:ei(e[5]),value:ri(e[6]),data:e[7],accessList:Ai(e[8])};return 9===e.length||(i.hash=V(t),di(i,e.slice(9),fi)),i}(e)}return ti.throwError("unsupported transaction type: ".concat(e[0]),h.b.errors.UNSUPPORTED_OPERATION,{operation:"parseTransaction",transactionType:e[0]})}function pi(t){return function(t){if(Array.isArray(t))return yi(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(!t)return;if("string"==typeof t)return yi(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return yi(t,e)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function yi(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function Ii(){return(Ii="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,r){var n=bi(t,e);if(n){var i=Object.getOwnPropertyDescriptor(n,e);return i.get?i.get.call(arguments.length<3?t:r):i.value}}).apply(this,arguments)}function bi(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=Bi(t)););return t}function vi(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Ei(t,e)}function Ei(t,e){return(Ei=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}function mi(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=Bi(t);if(e){var i=Bi(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return Ci(this,r)}}function Ci(t,e){if(e&&("object"===_i(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return wi(t)}function wi(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Bi(t){return(Bi=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function Qi(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function ki(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,(i=n.key,o=void 0,o=function(t,e){if("object"!==_i(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==_i(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(i,"string"),"symbol"===_i(o)?o:String(o)),n)}var i,o}function Si(t,e,r){return e&&ki(t.prototype,e),r&&ki(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function _i(t){return(_i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Di(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */Di=function(){return t};var t={},e=Object.prototype,r=e.hasOwnProperty,n=Object.defineProperty||function(t,e,r){t[e]=r.value},i="function"==typeof Symbol?Symbol:{},o=i.iterator||"@@iterator",a=i.asyncIterator||"@@asyncIterator",s=i.toStringTag||"@@toStringTag";function c(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{c({},"")}catch(t){c=function(t,e,r){return t[e]=r}}function A(t,e,r,i){var o=e&&e.prototype instanceof h?e:h,a=Object.create(o.prototype),s=new B(i||[]);return n(a,"_invoke",{value:E(t,r,s)}),a}function u(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=A;var f={};function h(){}function l(){}function d(){}var g={};c(g,o,(function(){return this}));var p=Object.getPrototypeOf,y=p&&p(p(Q([])));y&&y!==e&&r.call(y,o)&&(g=y);var I=d.prototype=h.prototype=Object.create(g);function b(t){["next","throw","return"].forEach((function(e){c(t,e,(function(t){return this._invoke(e,t)}))}))}function v(t,e){var i;n(this,"_invoke",{value:function(n,o){function a(){return new e((function(i,a){!function n(i,o,a,s){var c=u(t[i],t,o);if("throw"!==c.type){var A=c.arg,f=A.value;return f&&"object"==_i(f)&&r.call(f,"__await")?e.resolve(f.__await).then((function(t){n("next",t,a,s)}),(function(t){n("throw",t,a,s)})):e.resolve(f).then((function(t){A.value=t,a(A)}),(function(t){return n("throw",t,a,s)}))}s(c.arg)}(n,o,i,a)}))}return i=i?i.then(a,a):a()}})}function E(t,e,r){var n="suspendedStart";return function(i,o){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===i)throw o;return k()}for(r.method=i,r.arg=o;;){var a=r.delegate;if(a){var s=m(a,r);if(s){if(s===f)continue;return s}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var c=u(t,e,r);if("normal"===c.type){if(n=r.done?"completed":"suspendedYield",c.arg===f)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(n="completed",r.method="throw",r.arg=c.arg)}}}function m(t,e){var r=e.method,n=t.iterator[r];if(void 0===n)return e.delegate=null,"throw"===r&&t.iterator.return&&(e.method="return",e.arg=void 0,m(t,e),"throw"===e.method)||"return"!==r&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+r+"' method")),f;var i=u(n,t.iterator,e.arg);if("throw"===i.type)return e.method="throw",e.arg=i.arg,e.delegate=null,f;var o=i.arg;return o?o.done?(e[t.resultName]=o.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,f):o:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,f)}function C(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function w(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function B(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(C,this),this.reset(!0)}function Q(t){if(t){var e=t[o];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,i=function e(){for(;++n<t.length;)if(r.call(t,n))return e.value=t[n],e.done=!1,e;return e.value=void 0,e.done=!0,e};return i.next=i}}return{next:k}}function k(){return{value:void 0,done:!0}}return l.prototype=d,n(I,"constructor",{value:d,configurable:!0}),n(d,"constructor",{value:l,configurable:!0}),l.displayName=c(d,s,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===l||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,d):(t.__proto__=d,c(t,s,"GeneratorFunction")),t.prototype=Object.create(I),t},t.awrap=function(t){return{__await:t}},b(v.prototype),c(v.prototype,a,(function(){return this})),t.AsyncIterator=v,t.async=function(e,r,n,i,o){void 0===o&&(o=Promise);var a=new v(A(e,r,n,i),o);return t.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},b(I),c(I,s,"Generator"),c(I,o,(function(){return this})),c(I,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},t.values=Q,B.prototype={constructor:B,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(w),!t)for(var e in this)"t"===e.charAt(0)&&r.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function n(r,n){return a.type="throw",a.arg=t,e.next=r,n&&(e.method="next",e.arg=void 0),!!n}for(var i=this.tryEntries.length-1;i>=0;--i){var o=this.tryEntries[i],a=o.completion;if("root"===o.tryLoc)return n("end");if(o.tryLoc<=this.prev){var s=r.call(o,"catchLoc"),c=r.call(o,"finallyLoc");if(s&&c){if(this.prev<o.catchLoc)return n(o.catchLoc,!0);if(this.prev<o.finallyLoc)return n(o.finallyLoc)}else if(s){if(this.prev<o.catchLoc)return n(o.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return n(o.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&r.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var o=i;break}}o&&("break"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc&&(o=null);var a=o?o.completion:{};return a.type=t,a.arg=e,o?(this.method="next",this.next=o.finallyLoc,f):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),f},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),w(r),f}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var i=n.arg;w(r)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:Q(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),f}},t}var xi=function(t,e,r,n){return new(r||(r=Promise))((function(i,o){function a(t){try{c(n.next(t))}catch(t){o(t)}}function s(t){try{c(n.throw(t))}catch(t){o(t)}}function c(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(a,s)}c((n=n.apply(t,e||[])).next())}))},Mi=new h.b("contracts/5.7.0"),Ri={chainId:!0,data:!0,from:!0,gasLimit:!0,gasPrice:!0,nonce:!0,to:!0,value:!0,type:!0,accessList:!0,maxFeePerGas:!0,maxPriorityFeePerGas:!0,customData:!0,ccipReadEnabled:!0};function Oi(t,e){return xi(this,void 0,void 0,Di().mark((function r(){var n,i;return Di().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,e;case 2:return"string"!=typeof(n=r.sent)&&Mi.throwArgumentError("invalid address or ENS name","name",n),r.prev=4,r.abrupt("return",ht(n));case 8:r.prev=8,r.t0=r.catch(4);case 10:return t||Mi.throwError("a provider or signer is needed to resolve ENS names",h.b.errors.UNSUPPORTED_OPERATION,{operation:"resolveName"}),r.next=13,t.resolveName(n);case 13:return null==(i=r.sent)&&Mi.throwArgumentError("resolver or addr is not configured for ENS name","name",n),r.abrupt("return",i);case 16:case"end":return r.stop()}}),r,null,[[4,8]])})))}function Ni(t,e,r){return xi(this,void 0,void 0,Di().mark((function n(){return Di().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(!Array.isArray(r)){n.next=4;break}return n.next=3,Promise.all(r.map((function(r,n){return Ni(t,Array.isArray(e)?e[n]:e[r.name],r)})));case 3:return n.abrupt("return",n.sent);case 4:if("address"!==r.type){n.next=8;break}return n.next=7,Oi(t,e);case 7:return n.abrupt("return",n.sent);case 8:if("tuple"!==r.type){n.next=12;break}return n.next=11,Ni(t,e,r.components);case 11:return n.abrupt("return",n.sent);case 12:if("array"!==r.baseType){n.next=18;break}if(Array.isArray(e)){n.next=15;break}return n.abrupt("return",Promise.reject(Mi.makeError("invalid value for array",h.b.errors.INVALID_ARGUMENT,{argument:"value",value:e})));case 15:return n.next=17,Promise.all(e.map((function(e){return Ni(t,e,r.arrayChildren)})));case 17:return n.abrupt("return",n.sent);case 18:return n.abrupt("return",e);case 19:case"end":return n.stop()}}),n)})))}function Pi(t,e,r){return xi(this,void 0,void 0,Di().mark((function n(){var i,o,a,s,c,u,f,l,d,g,p=this;return Di().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return i={},r.length===e.inputs.length+1&&"object"===_i(r[r.length-1])&&(i=O(r.pop())),Mi.checkArgumentCount(r.length,e.inputs.length,"passed to contract"),t.signer?i.from?i.from=M({override:Oi(t.signer,i.from),signer:t.signer.getAddress()}).then((function(t){return xi(p,void 0,void 0,Di().mark((function e(){return Di().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return ht(t.signer)!==t.override&&Mi.throwError("Contract with a Signer cannot override from",h.b.errors.UNSUPPORTED_OPERATION,{operation:"overrides.from"}),e.abrupt("return",t.override);case 2:case"end":return e.stop()}}),e)})))})):i.from=t.signer.getAddress():i.from&&(i.from=Oi(t.provider,i.from)),n.next=6,M({args:Ni(t.signer||t.provider,r,e.inputs),address:t.resolvedAddress,overrides:M(i)||{}});case 6:if(o=n.sent,a=t.interface.encodeFunctionData(e,o.args),s={data:a,to:o.address},null!=(c=o.overrides).nonce&&(s.nonce=b.from(c.nonce).toNumber()),null!=c.gasLimit&&(s.gasLimit=b.from(c.gasLimit)),null!=c.gasPrice&&(s.gasPrice=b.from(c.gasPrice)),null!=c.maxFeePerGas&&(s.maxFeePerGas=b.from(c.maxFeePerGas)),null!=c.maxPriorityFeePerGas&&(s.maxPriorityFeePerGas=b.from(c.maxPriorityFeePerGas)),null!=c.from&&(s.from=c.from),null!=c.type&&(s.type=c.type),null!=c.accessList&&(s.accessList=Ai(c.accessList)),null==s.gasLimit&&null!=e.gas){for(u=21e3,f=Object(A.a)(a),l=0;l<f.length;l++)u+=4,f[l]&&(u+=64);s.gasLimit=b.from(e.gas).add(u)}return c.value&&((d=b.from(c.value)).isZero()||e.payable||Mi.throwError("non-payable method cannot override value",h.b.errors.UNSUPPORTED_OPERATION,{operation:"overrides.value",value:i.value}),s.value=d),c.customData&&(s.customData=O(c.customData)),c.ccipReadEnabled&&(s.ccipReadEnabled=!!c.ccipReadEnabled),delete i.nonce,delete i.gasLimit,delete i.gasPrice,delete i.from,delete i.value,delete i.type,delete i.accessList,delete i.maxFeePerGas,delete i.maxPriorityFeePerGas,delete i.customData,delete i.ccipReadEnabled,(g=Object.keys(i).filter((function(t){return null!=i[t]}))).length&&Mi.throwError("cannot override ".concat(g.map((function(t){return JSON.stringify(t)})).join(",")),h.b.errors.UNSUPPORTED_OPERATION,{operation:"overrides",overrides:g}),n.abrupt("return",s);case 36:case"end":return n.stop()}}),n)})))}function ji(t,e){var r=e.wait.bind(e);e.wait=function(e){return r(e).then((function(e){return e.events=e.logs.map((function(r){var n=j(r),i=null;try{i=t.interface.parseLog(r)}catch(t){}return i&&(n.args=i.args,n.decode=function(e,r){return t.interface.decodeEventLog(i.eventFragment,e,r)},n.event=i.name,n.eventSignature=i.signature),n.removeListener=function(){return t.provider},n.getBlock=function(){return t.provider.getBlock(e.blockHash)},n.getTransaction=function(){return t.provider.getTransaction(e.transactionHash)},n.getTransactionReceipt=function(){return Promise.resolve(e)},n})),e}))}}function Li(t,e,r){var n=t.signer||t.provider;return function(){for(var i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];return xi(this,void 0,void 0,Di().mark((function i(){var a,s,c,A,u;return Di().wrap((function(i){for(;;)switch(i.prev=i.next){case 0:if(a=void 0,o.length!==e.inputs.length+1||"object"!==_i(o[o.length-1])){i.next=9;break}if(null==(s=O(o.pop())).blockTag){i.next=7;break}return i.next=6,s.blockTag;case 6:a=i.sent;case 7:delete s.blockTag,o.push(s);case 9:if(null==t.deployTransaction){i.next=12;break}return i.next=12,t._deployed(a);case 12:return i.next=14,Pi(t,e,o);case 14:return c=i.sent,i.next=17,n.call(c,a);case 17:return A=i.sent,i.prev=18,u=t.interface.decodeFunctionResult(e,A),r&&1===e.outputs.length&&(u=u[0]),i.abrupt("return",u);case 24:throw i.prev=24,i.t0=i.catch(18),i.t0.code===h.b.errors.CALL_EXCEPTION&&(i.t0.address=t.address,i.t0.args=o,i.t0.transaction=c),i.t0;case 28:case"end":return i.stop()}}),i,null,[[18,24]])})))}}function Fi(t,e,r){return e.constant?Li(t,e,r):function(t,e){return function(){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return xi(this,void 0,void 0,Di().mark((function r(){var i,o;return Di().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(t.signer||Mi.throwError("sending a transaction requires a signer",h.b.errors.UNSUPPORTED_OPERATION,{operation:"sendTransaction"}),null==t.deployTransaction){r.next=4;break}return r.next=4,t._deployed();case 4:return r.next=6,Pi(t,e,n);case 6:return i=r.sent,r.next=9,t.signer.sendTransaction(i);case 9:return o=r.sent,ji(t,o),r.abrupt("return",o);case 12:case"end":return r.stop()}}),r)})))}}(t,e)}function Ti(t){return!t.address||null!=t.topics&&0!==t.topics.length?(t.address||"*")+"@"+(t.topics?t.topics.map((function(t){return Array.isArray(t)?t.join("|"):t})).join(":"):""):"*"}var Ui=function(){function t(e,r){Qi(this,t),D(this,"tag",e),D(this,"filter",r),this._listeners=[]}return Si(t,[{key:"addListener",value:function(t,e){this._listeners.push({listener:t,once:e})}},{key:"removeListener",value:function(t){var e=!1;this._listeners=this._listeners.filter((function(r){return!(!e&&r.listener===t)||(e=!0,!1)}))}},{key:"removeAllListeners",value:function(){this._listeners=[]}},{key:"listeners",value:function(){return this._listeners.map((function(t){return t.listener}))}},{key:"listenerCount",value:function(){return this._listeners.length}},{key:"run",value:function(t){var e=this,r=this.listenerCount();return this._listeners=this._listeners.filter((function(r){var n=t.slice();return setTimeout((function(){r.listener.apply(e,n)}),0),!r.once})),r}},{key:"prepareEvent",value:function(t){}},{key:"getEmit",value:function(t){return[t]}}]),t}(),Gi=function(t){vi(r,t);var e=mi(r);function r(){return Qi(this,r),e.call(this,"error",null)}return Si(r)}(Ui),Hi=function(t){vi(r,t);var e=mi(r);function r(t,n,i,o){var a;Qi(this,r);var s={address:t},c=n.getEventTopic(i);return o?(c!==o[0]&&Mi.throwArgumentError("topic mismatch","topics",o),s.topics=o.slice()):s.topics=[c],D(wi(a=e.call(this,Ti(s),s)),"address",t),D(wi(a),"interface",n),D(wi(a),"fragment",i),a}return Si(r,[{key:"prepareEvent",value:function(t){var e=this;Ii(Bi(r.prototype),"prepareEvent",this).call(this,t),t.event=this.fragment.name,t.eventSignature=this.fragment.format(),t.decode=function(t,r){return e.interface.decodeEventLog(e.fragment,t,r)};try{t.args=this.interface.decodeEventLog(this.fragment,t.data,t.topics)}catch(e){t.args=null,t.decodeError=e}}},{key:"getEmit",value:function(t){var e=Y(t.args);if(e.length)throw e[0].error;var r=(t.args||[]).slice();return r.push(t),r}}]),r}(Ui),Yi=function(t){vi(r,t);var e=mi(r);function r(t,n){var i;return Qi(this,r),D(wi(i=e.call(this,"*",{address:t})),"address",t),D(wi(i),"interface",n),i}return Si(r,[{key:"prepareEvent",value:function(t){var e=this;Ii(Bi(r.prototype),"prepareEvent",this).call(this,t);try{var n=this.interface.parseLog(t);t.event=n.name,t.eventSignature=n.signature,t.decode=function(t,r){return e.interface.decodeEventLog(n.eventFragment,t,r)},t.args=n.args}catch(t){}}}]),r}(Ui),Ki=function(){function t(e,r,n){var i=this;Qi(this,t),D(this,"interface",x(this instanceof t?this.constructor:void 0,"getInterface")(r)),null==n?(D(this,"provider",null),D(this,"signer",null)):Gn.isSigner(n)?(D(this,"provider",n.provider||null),D(this,"signer",n)):kn.isProvider(n)?(D(this,"provider",n),D(this,"signer",null)):Mi.throwArgumentError("invalid signer or provider","signerOrProvider",n),D(this,"callStatic",{}),D(this,"estimateGas",{}),D(this,"functions",{}),D(this,"populateTransaction",{}),D(this,"filters",{});var o={};if(Object.keys(this.interface.events).forEach((function(t){var e=i.interface.events[t];D(i.filters,t,(function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return{address:i.address,topics:i.interface.encodeFilterTopics(e,r)}})),o[e.name]||(o[e.name]=[]),o[e.name].push(t)})),Object.keys(o).forEach((function(t){var e=o[t];1===e.length?D(i.filters,t,i.filters[e[0]]):Mi.warn("Duplicate definition of ".concat(t," (").concat(e.join(", "),")"))})),D(this,"_runningEvents",{}),D(this,"_wrappedEmits",{}),null==e&&Mi.throwArgumentError("invalid contract address or ENS name","addressOrName",e),D(this,"address",e),this.provider)D(this,"resolvedAddress",Oi(this.provider,e));else try{D(this,"resolvedAddress",Promise.resolve(ht(e)))}catch(t){Mi.throwError("provider is required to use ENS name as contract address",h.b.errors.UNSUPPORTED_OPERATION,{operation:"new Contract"})}this.resolvedAddress.catch((function(t){}));var a={},s={};Object.keys(this.interface.functions).forEach((function(t){var e=i.interface.functions[t];if(s[t])Mi.warn("Duplicate ABI entry for ".concat(JSON.stringify(t)));else{s[t]=!0;var r=e.name;a["%".concat(r)]||(a["%".concat(r)]=[]),a["%".concat(r)].push(t),null==i[t]&&D(i,t,Fi(i,e,!0)),null==i.functions[t]&&D(i.functions,t,Fi(i,e,!1)),null==i.callStatic[t]&&D(i.callStatic,t,Li(i,e,!0)),null==i.populateTransaction[t]&&D(i.populateTransaction,t,function(t,e){return function(){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return Pi(t,e,n)}}(i,e)),null==i.estimateGas[t]&&D(i.estimateGas,t,function(t,e){var r=t.signer||t.provider;return function(){for(var n=arguments.length,i=new Array(n),o=0;o<n;o++)i[o]=arguments[o];return xi(this,void 0,void 0,Di().mark((function n(){var o;return Di().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return r||Mi.throwError("estimate require a provider or signer",h.b.errors.UNSUPPORTED_OPERATION,{operation:"estimateGas"}),n.next=3,Pi(t,e,i);case 3:return o=n.sent,n.next=6,r.estimateGas(o);case 6:return n.abrupt("return",n.sent);case 7:case"end":return n.stop()}}),n)})))}}(i,e))}})),Object.keys(a).forEach((function(t){var e=a[t];if(!(e.length>1)){t=t.substring(1);var r=e[0];try{null==i[t]&&D(i,t,i[r])}catch(t){}null==i.functions[t]&&D(i.functions,t,i.functions[r]),null==i.callStatic[t]&&D(i.callStatic,t,i.callStatic[r]),null==i.populateTransaction[t]&&D(i.populateTransaction,t,i.populateTransaction[r]),null==i.estimateGas[t]&&D(i.estimateGas,t,i.estimateGas[r])}}))}return Si(t,[{key:"deployed",value:function(){return this._deployed()}},{key:"_deployed",value:function(t){var e=this;return this._deployedPromise||(this.deployTransaction?this._deployedPromise=this.deployTransaction.wait().then((function(){return e})):this._deployedPromise=this.provider.getCode(this.address,t).then((function(t){return"0x"===t&&Mi.throwError("contract not deployed",h.b.errors.UNSUPPORTED_OPERATION,{contractAddress:e.address,operation:"getDeployed"}),e}))),this._deployedPromise}},{key:"fallback",value:function(t){var e=this;this.signer||Mi.throwError("sending a transactions require a signer",h.b.errors.UNSUPPORTED_OPERATION,{operation:"sendTransaction(fallback)"});var r=O(t||{});return["from","to"].forEach((function(t){null!=r[t]&&Mi.throwError("cannot override "+t,h.b.errors.UNSUPPORTED_OPERATION,{operation:t})})),r.to=this.resolvedAddress,this.deployed().then((function(){return e.signer.sendTransaction(r)}))}},{key:"connect",value:function(t){"string"==typeof t&&(t=new Hn(t,this.provider));var e=new this.constructor(this.address,this.interface,t);return this.deployTransaction&&D(e,"deployTransaction",this.deployTransaction),e}},{key:"attach",value:function(t){return new this.constructor(t,this.interface,this.signer||this.provider)}},{key:"_normalizeRunningEvent",value:function(t){return this._runningEvents[t.tag]?this._runningEvents[t.tag]:t}},{key:"_getRunningEvent",value:function(t){if("string"==typeof t){if("error"===t)return this._normalizeRunningEvent(new Gi);if("event"===t)return this._normalizeRunningEvent(new Ui("event",null));if("*"===t)return this._normalizeRunningEvent(new Yi(this.address,this.interface));var e=this.interface.getEvent(t);return this._normalizeRunningEvent(new Hi(this.address,this.interface,e))}if(t.topics&&t.topics.length>0){try{var r=t.topics[0];if("string"!=typeof r)throw new Error("invalid topic");var n=this.interface.getEvent(r);return this._normalizeRunningEvent(new Hi(this.address,this.interface,n,t.topics))}catch(t){}var i={address:this.address,topics:t.topics};return this._normalizeRunningEvent(new Ui(Ti(i),i))}return this._normalizeRunningEvent(new Yi(this.address,this.interface))}},{key:"_checkRunningEvents",value:function(t){if(0===t.listenerCount()){delete this._runningEvents[t.tag];var e=this._wrappedEmits[t.tag];e&&t.filter&&(this.provider.off(t.filter,e),delete this._wrappedEmits[t.tag])}}},{key:"_wrapEvent",value:function(t,e,r){var n=this,i=j(e);return i.removeListener=function(){r&&(t.removeListener(r),n._checkRunningEvents(t))},i.getBlock=function(){return n.provider.getBlock(e.blockHash)},i.getTransaction=function(){return n.provider.getTransaction(e.transactionHash)},i.getTransactionReceipt=function(){return n.provider.getTransactionReceipt(e.transactionHash)},t.prepareEvent(i),i}},{key:"_addEventListener",value:function(t,e,r){var n=this;if(this.provider||Mi.throwError("events require a provider or a signer with a provider",h.b.errors.UNSUPPORTED_OPERATION,{operation:"once"}),t.addListener(e,r),this._runningEvents[t.tag]=t,!this._wrappedEmits[t.tag]){var i=function(r){var i=n._wrapEvent(t,r,e);if(null==i.decodeError)try{var o=t.getEmit(i);n.emit.apply(n,[t.filter].concat(pi(o)))}catch(t){i.decodeError=t.error}null!=t.filter&&n.emit("event",i),null!=i.decodeError&&n.emit("error",i.decodeError,i)};this._wrappedEmits[t.tag]=i,null!=t.filter&&this.provider.on(t.filter,i)}}},{key:"queryFilter",value:function(t,e,r){var n=this,i=this._getRunningEvent(t),o=O(i.filter);return"string"==typeof e&&Object(A.l)(e,32)?(null!=r&&Mi.throwArgumentError("cannot specify toBlock with blockhash","toBlock",r),o.blockHash=e):(o.fromBlock=null!=e?e:0,o.toBlock=null!=r?r:"latest"),this.provider.getLogs(o).then((function(t){return t.map((function(t){return n._wrapEvent(i,t,null)}))}))}},{key:"on",value:function(t,e){return this._addEventListener(this._getRunningEvent(t),e,!1),this}},{key:"once",value:function(t,e){return this._addEventListener(this._getRunningEvent(t),e,!0),this}},{key:"emit",value:function(t){if(!this.provider)return!1;for(var e=this._getRunningEvent(t),r=arguments.length,n=new Array(r>1?r-1:0),i=1;i<r;i++)n[i-1]=arguments[i];var o=e.run(n)>0;return this._checkRunningEvents(e),o}},{key:"listenerCount",value:function(t){var e=this;return this.provider?null==t?Object.keys(this._runningEvents).reduce((function(t,r){return t+e._runningEvents[r].listenerCount()}),0):this._getRunningEvent(t).listenerCount():0}},{key:"listeners",value:function(t){if(!this.provider)return[];if(null==t){var e=[];for(var r in this._runningEvents)this._runningEvents[r].listeners().forEach((function(t){e.push(t)}));return e}return this._getRunningEvent(t).listeners()}},{key:"removeAllListeners",value:function(t){if(!this.provider)return this;if(null==t){for(var e in this._runningEvents){var r=this._runningEvents[e];r.removeAllListeners(),this._checkRunningEvents(r)}return this}var n=this._getRunningEvent(t);return n.removeAllListeners(),this._checkRunningEvents(n),this}},{key:"off",value:function(t,e){if(!this.provider)return this;var r=this._getRunningEvent(t);return r.removeListener(e),this._checkRunningEvents(r),this}},{key:"removeListener",value:function(t,e){return this.off(t,e)}}],[{key:"getContractAddress",value:function(t){return gt(t)}},{key:"getInterface",value:function(t){return ln.isInterface(t)?t:new ln(t)}},{key:"isIndexed",value:function(t){return un.isIndexed(t)}}]),t}(),qi=function(t){vi(r,t);var e=mi(r);function r(){return Qi(this,r),e.apply(this,arguments)}return Si(r)}(Ki),Ji=function(){function t(e,r,n){Qi(this,t);var i=null;"0x"!==(i="string"==typeof r?r:Object(A.j)(r)?Object(A.i)(r):r&&"string"==typeof r.object?r.object:"!").substring(0,2)&&(i="0x"+i),(!Object(A.l)(i)||i.length%2)&&Mi.throwArgumentError("invalid bytecode","bytecode",r),n&&!Gn.isSigner(n)&&Mi.throwArgumentError("invalid signer","signer",n),D(this,"bytecode",i),D(this,"interface",x(this instanceof t?this.constructor:void 0,"getInterface")(e)),D(this,"signer",n||null)}return Si(t,[{key:"getDeployTransaction",value:function(){for(var t={},e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];if(r.length===this.interface.deploy.inputs.length+1&&"object"===_i(r[r.length-1]))for(var i in t=O(r.pop()))if(!Ri[i])throw new Error("unknown transaction override "+i);if(["data","from","to"].forEach((function(e){null!=t[e]&&Mi.throwError("cannot override "+e,h.b.errors.UNSUPPORTED_OPERATION,{operation:e})})),t.value){var o=b.from(t.value);o.isZero()||this.interface.deploy.payable||Mi.throwError("non-payable constructor cannot override value",h.b.errors.UNSUPPORTED_OPERATION,{operation:"overrides.value",value:t.value})}return Mi.checkArgumentCount(r.length,this.interface.deploy.inputs.length," in Contract constructor"),t.data=Object(A.i)(Object(A.b)([this.bytecode,this.interface.encodeDeploy(r)])),t}},{key:"deploy",value:function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];return xi(this,void 0,void 0,Di().mark((function t(){var r,n,i,o,a,s;return Di().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r={},e.length===this.interface.deploy.inputs.length+1&&(r=e.pop()),Mi.checkArgumentCount(e.length,this.interface.deploy.inputs.length," in Contract constructor"),t.next=5,Ni(this.signer,e,this.interface.deploy.inputs);case 5:return(n=t.sent).push(r),i=this.getDeployTransaction.apply(this,pi(n)),t.next=10,this.signer.sendTransaction(i);case 10:return o=t.sent,a=x(this.constructor,"getContractAddress")(o),ji(s=x(this.constructor,"getContract")(a,this.interface,this.signer),o),D(s,"deployTransaction",o),t.abrupt("return",s);case 16:case"end":return t.stop()}}),t,this)})))}},{key:"attach",value:function(t){return this.constructor.getContract(t,this.interface,this.signer)}},{key:"connect",value:function(t){return new this.constructor(this.interface,this.bytecode,t)}}],[{key:"fromSolidity",value:function(t,e){null==t&&Mi.throwError("missing compiler output",h.b.errors.MISSING_ARGUMENT,{argument:"compilerOutput"}),"string"==typeof t&&(t=JSON.parse(t));var r=t.abi,n=null;return t.bytecode?n=t.bytecode:t.evm&&t.evm.bytecode&&(n=t.evm.bytecode),new this(r,n,e)}},{key:"getInterface",value:function(t){return qi.getInterface(t)}},{key:"getContractAddress",value:function(t){return gt(t)}},{key:"getContract",value:function(t,e,r){return new qi(t,e,r)}}]),t}();function zi(t){return(zi="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Zi(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Vi(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,(i=n.key,o=void 0,o=function(t,e){if("object"!==zi(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==zi(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(i,"string"),"symbol"===zi(o)?o:String(o)),n)}var i,o}function Wi(t,e,r){return e&&Vi(t.prototype,e),r&&Vi(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}var Xi=new h.b("bignumber/5.7.0"),$i={},to=b.from(0),eo=b.from(-1);function ro(t,e,r,n){var i={fault:e,operation:r};return void 0!==n&&(i.value=n),Xi.throwError(t,h.b.errors.NUMERIC_FAULT,i)}for(var no="0";no.length<256;)no+=no;function io(t){if("number"!=typeof t)try{t=b.from(t).toNumber()}catch(t){}return"number"==typeof t&&t>=0&&t<=256&&!(t%1)?"1"+no.substring(0,t):Xi.throwArgumentError("invalid decimal size","decimals",t)}function oo(t,e){null==e&&(e=0);var r=io(e),n=(t=b.from(t)).lt(to);n&&(t=t.mul(eo));for(var i=t.mod(r).toString();i.length<r.length-1;)i="0"+i;i=i.match(/^([0-9]*[1-9]|0)(0*)/)[1];var o=t.div(r).toString();return t=1===r.length?o:o+"."+i,n&&(t="-"+t),t}function ao(t,e){null==e&&(e=0);var r=io(e);"string"==typeof t&&t.match(/^-?[0-9.]+$/)||Xi.throwArgumentError("invalid decimal value","value",t);var n="-"===t.substring(0,1);n&&(t=t.substring(1)),"."===t&&Xi.throwArgumentError("missing value","value",t);var i=t.split(".");i.length>2&&Xi.throwArgumentError("too many decimal points","value",t);var o=i[0],a=i[1];for(o||(o="0"),a||(a="0");"0"===a[a.length-1];)a=a.substring(0,a.length-1);for(a.length>r.length-1&&ro("fractional component exceeds decimals","underflow","parseFixed"),""===a&&(a="0");a.length<r.length-1;)a+="0";var s=b.from(o),c=b.from(a),A=s.mul(r).add(c);return n&&(A=A.mul(eo)),A}var so=function(){function t(e,r,n,i){Zi(this,t),e!==$i&&Xi.throwError("cannot use FixedFormat constructor; use FixedFormat.from",h.b.errors.UNSUPPORTED_OPERATION,{operation:"new FixedFormat"}),this.signed=r,this.width=n,this.decimals=i,this.name=(r?"":"u")+"fixed"+String(n)+"x"+String(i),this._multiplier=io(i),Object.freeze(this)}return Wi(t,null,[{key:"from",value:function(e){if(e instanceof t)return e;"number"==typeof e&&(e="fixed128x".concat(e));var r=!0,n=128,i=18;if("string"==typeof e)if("fixed"===e);else if("ufixed"===e)r=!1;else{var o=e.match(/^(u?)fixed([0-9]+)x([0-9]+)$/);o||Xi.throwArgumentError("invalid fixed format","format",e),r="u"!==o[1],n=parseInt(o[2]),i=parseInt(o[3])}else if(e){var a=function(t,r,n){return null==e[t]?n:(zi(e[t])!==r&&Xi.throwArgumentError("invalid fixed format ("+t+" not "+r+")","format."+t,e[t]),e[t])};r=a("signed","boolean",r),n=a("width","number",n),i=a("decimals","number",i)}return n%8&&Xi.throwArgumentError("invalid fixed format width (not byte aligned)","format.width",n),i>80&&Xi.throwArgumentError("invalid fixed format (decimals too large)","format.decimals",i),new t($i,r,n,i)}}]),t}(),co=function(){function t(e,r,n,i){Zi(this,t),e!==$i&&Xi.throwError("cannot use FixedNumber constructor; use FixedNumber.from",h.b.errors.UNSUPPORTED_OPERATION,{operation:"new FixedFormat"}),this.format=i,this._hex=r,this._value=n,this._isFixedNumber=!0,Object.freeze(this)}return Wi(t,[{key:"_checkFormat",value:function(t){this.format.name!==t.format.name&&Xi.throwArgumentError("incompatible format; use fixedNumber.toFormat","other",t)}},{key:"addUnsafe",value:function(e){this._checkFormat(e);var r=ao(this._value,this.format.decimals),n=ao(e._value,e.format.decimals);return t.fromValue(r.add(n),this.format.decimals,this.format)}},{key:"subUnsafe",value:function(e){this._checkFormat(e);var r=ao(this._value,this.format.decimals),n=ao(e._value,e.format.decimals);return t.fromValue(r.sub(n),this.format.decimals,this.format)}},{key:"mulUnsafe",value:function(e){this._checkFormat(e);var r=ao(this._value,this.format.decimals),n=ao(e._value,e.format.decimals);return t.fromValue(r.mul(n).div(this.format._multiplier),this.format.decimals,this.format)}},{key:"divUnsafe",value:function(e){this._checkFormat(e);var r=ao(this._value,this.format.decimals),n=ao(e._value,e.format.decimals);return t.fromValue(r.mul(this.format._multiplier).div(n),this.format.decimals,this.format)}},{key:"floor",value:function(){var e=this.toString().split(".");1===e.length&&e.push("0");var r=t.from(e[0],this.format),n=!e[1].match(/^(0*)$/);return this.isNegative()&&n&&(r=r.subUnsafe(Ao.toFormat(r.format))),r}},{key:"ceiling",value:function(){var e=this.toString().split(".");1===e.length&&e.push("0");var r=t.from(e[0],this.format),n=!e[1].match(/^(0*)$/);return!this.isNegative()&&n&&(r=r.addUnsafe(Ao.toFormat(r.format))),r}},{key:"round",value:function(e){null==e&&(e=0);var r=this.toString().split(".");if(1===r.length&&r.push("0"),(e<0||e>80||e%1)&&Xi.throwArgumentError("invalid decimal count","decimals",e),r[1].length<=e)return this;var n=t.from("1"+no.substring(0,e),this.format),i=uo.toFormat(this.format);return this.mulUnsafe(n).addUnsafe(i).floor().divUnsafe(n)}},{key:"isZero",value:function(){return"0.0"===this._value||"0"===this._value}},{key:"isNegative",value:function(){return"-"===this._value[0]}},{key:"toString",value:function(){return this._value}},{key:"toHexString",value:function(t){if(null==t)return this._hex;t%8&&Xi.throwArgumentError("invalid byte width","width",t);var e=b.from(this._hex).fromTwos(this.format.width).toTwos(t).toHexString();return Object(A.h)(e,t/8)}},{key:"toUnsafeFloat",value:function(){return parseFloat(this.toString())}},{key:"toFormat",value:function(e){return t.fromString(this._value,e)}}],[{key:"fromValue",value:function(e,r,n){return null!=n||null==r||function(t){return null!=t&&(b.isBigNumber(t)||"number"==typeof t&&t%1==0||"string"==typeof t&&!!t.match(/^-?[0-9]+$/)||Object(A.l)(t)||"bigint"==typeof t||Object(A.j)(t))}(r)||(n=r,r=null),null==r&&(r=0),null==n&&(n="fixed"),t.fromString(oo(e,r),so.from(n))}},{key:"fromString",value:function(e,r){null==r&&(r="fixed");var n=so.from(r),i=ao(e,n.decimals);!n.signed&&i.lt(to)&&ro("unsigned value cannot be negative","overflow","value",e);var o=null;n.signed?o=i.toTwos(n.width).toHexString():(o=i.toHexString(),o=Object(A.h)(o,n.width/8));var a=oo(i,n.decimals);return new t($i,o,a,n)}},{key:"fromBytes",value:function(e,r){null==r&&(r="fixed");var n=so.from(r);if(Object(A.a)(e).length>n.width/8)throw new Error("overflow");var i=b.from(e);n.signed&&(i=i.fromTwos(n.width));var o=i.toTwos((n.signed?0:1)+n.width).toHexString(),a=oo(i,n.decimals);return new t($i,o,a,n)}},{key:"from",value:function(e,r){if("string"==typeof e)return t.fromString(e,r);if(Object(A.j)(e))return t.fromBytes(e,r);try{return t.fromValue(e,0,r)}catch(t){if(t.code!==h.b.errors.INVALID_ARGUMENT)throw t}return Xi.throwArgumentError("invalid FixedNumber value","value",e)}},{key:"isFixedNumber",value:function(t){return!(!t||!t._isFixedNumber)}}]),t}(),Ao=co.from(1),uo=co.from("0.5");function fo(t){return"string"==typeof t&&(t=Ct(t)),V(Object(A.b)([Ct("Ethereum Signed Message:\n"),Ct(String(t.length)),t]))}function ho(t){return(ho="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function lo(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */lo=function(){return t};var t={},e=Object.prototype,r=e.hasOwnProperty,n=Object.defineProperty||function(t,e,r){t[e]=r.value},i="function"==typeof Symbol?Symbol:{},o=i.iterator||"@@iterator",a=i.asyncIterator||"@@asyncIterator",s=i.toStringTag||"@@toStringTag";function c(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{c({},"")}catch(t){c=function(t,e,r){return t[e]=r}}function A(t,e,r,i){var o=e&&e.prototype instanceof h?e:h,a=Object.create(o.prototype),s=new B(i||[]);return n(a,"_invoke",{value:E(t,r,s)}),a}function u(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=A;var f={};function h(){}function l(){}function d(){}var g={};c(g,o,(function(){return this}));var p=Object.getPrototypeOf,y=p&&p(p(Q([])));y&&y!==e&&r.call(y,o)&&(g=y);var I=d.prototype=h.prototype=Object.create(g);function b(t){["next","throw","return"].forEach((function(e){c(t,e,(function(t){return this._invoke(e,t)}))}))}function v(t,e){var i;n(this,"_invoke",{value:function(n,o){function a(){return new e((function(i,a){!function n(i,o,a,s){var c=u(t[i],t,o);if("throw"!==c.type){var A=c.arg,f=A.value;return f&&"object"==ho(f)&&r.call(f,"__await")?e.resolve(f.__await).then((function(t){n("next",t,a,s)}),(function(t){n("throw",t,a,s)})):e.resolve(f).then((function(t){A.value=t,a(A)}),(function(t){return n("throw",t,a,s)}))}s(c.arg)}(n,o,i,a)}))}return i=i?i.then(a,a):a()}})}function E(t,e,r){var n="suspendedStart";return function(i,o){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===i)throw o;return k()}for(r.method=i,r.arg=o;;){var a=r.delegate;if(a){var s=m(a,r);if(s){if(s===f)continue;return s}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var c=u(t,e,r);if("normal"===c.type){if(n=r.done?"completed":"suspendedYield",c.arg===f)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(n="completed",r.method="throw",r.arg=c.arg)}}}function m(t,e){var r=e.method,n=t.iterator[r];if(void 0===n)return e.delegate=null,"throw"===r&&t.iterator.return&&(e.method="return",e.arg=void 0,m(t,e),"throw"===e.method)||"return"!==r&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+r+"' method")),f;var i=u(n,t.iterator,e.arg);if("throw"===i.type)return e.method="throw",e.arg=i.arg,e.delegate=null,f;var o=i.arg;return o?o.done?(e[t.resultName]=o.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,f):o:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,f)}function C(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function w(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function B(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(C,this),this.reset(!0)}function Q(t){if(t){var e=t[o];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,i=function e(){for(;++n<t.length;)if(r.call(t,n))return e.value=t[n],e.done=!1,e;return e.value=void 0,e.done=!0,e};return i.next=i}}return{next:k}}function k(){return{value:void 0,done:!0}}return l.prototype=d,n(I,"constructor",{value:d,configurable:!0}),n(d,"constructor",{value:l,configurable:!0}),l.displayName=c(d,s,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===l||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,d):(t.__proto__=d,c(t,s,"GeneratorFunction")),t.prototype=Object.create(I),t},t.awrap=function(t){return{__await:t}},b(v.prototype),c(v.prototype,a,(function(){return this})),t.AsyncIterator=v,t.async=function(e,r,n,i,o){void 0===o&&(o=Promise);var a=new v(A(e,r,n,i),o);return t.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},b(I),c(I,s,"Generator"),c(I,o,(function(){return this})),c(I,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},t.values=Q,B.prototype={constructor:B,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(w),!t)for(var e in this)"t"===e.charAt(0)&&r.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function n(r,n){return a.type="throw",a.arg=t,e.next=r,n&&(e.method="next",e.arg=void 0),!!n}for(var i=this.tryEntries.length-1;i>=0;--i){var o=this.tryEntries[i],a=o.completion;if("root"===o.tryLoc)return n("end");if(o.tryLoc<=this.prev){var s=r.call(o,"catchLoc"),c=r.call(o,"finallyLoc");if(s&&c){if(this.prev<o.catchLoc)return n(o.catchLoc,!0);if(this.prev<o.finallyLoc)return n(o.finallyLoc)}else if(s){if(this.prev<o.catchLoc)return n(o.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return n(o.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&r.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var o=i;break}}o&&("break"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc&&(o=null);var a=o?o.completion:{};return a.type=t,a.arg=e,o?(this.method="next",this.next=o.finallyLoc,f):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),f},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),w(r),f}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var i=n.arg;w(r)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:Q(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),f}},t}function go(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,(i=n.key,o=void 0,o=function(t,e){if("object"!==ho(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==ho(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(i,"string"),"symbol"===ho(o)?o:String(o)),n)}var i,o}var po=function(t,e,r,n){return new(r||(r=Promise))((function(i,o){function a(t){try{c(n.next(t))}catch(t){o(t)}}function s(t){try{c(n.throw(t))}catch(t){o(t)}}function c(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(a,s)}c((n=n.apply(t,e||[])).next())}))},yo=new h.b("hash/5.7.0"),Io=new Uint8Array(32);Io.fill(0);var bo=b.from(-1),vo=b.from(0),Eo=b.from(1),mo=b.from("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");var Co=Object(A.h)(Eo.toHexString(),32),wo=Object(A.h)(vo.toHexString(),32),Bo={name:"string",version:"string",chainId:"uint256",verifyingContract:"address",salt:"bytes32"},Qo=["name","version","chainId","verifyingContract","salt"];function ko(t){return function(e){return"string"!=typeof e&&yo.throwArgumentError("invalid domain value for ".concat(JSON.stringify(t)),"domain.".concat(t),e),e}}var So={name:ko("name"),version:ko("version"),chainId:function(t){try{return b.from(t).toString()}catch(t){}return yo.throwArgumentError('invalid domain value for "chainId"',"domain.chainId",t)},verifyingContract:function(t){try{return ht(t).toLowerCase()}catch(t){}return yo.throwArgumentError('invalid domain value "verifyingContract"',"domain.verifyingContract",t)},salt:function(t){try{var e=Object(A.a)(t);if(32!==e.length)throw new Error("bad length");return Object(A.i)(e)}catch(t){}return yo.throwArgumentError('invalid domain value "salt"',"domain.salt",t)}};function _o(t){var e=t.match(/^(u?)int(\d*)$/);if(e){var r=""===e[1],n=parseInt(e[2]||"256");(n%8!=0||n>256||e[2]&&e[2]!==String(n))&&yo.throwArgumentError("invalid numeric width","type",t);var i=mo.mask(r?n-1:n),o=r?i.add(Eo).mul(bo):vo;return function(e){var r=b.from(e);return(r.lt(o)||r.gt(i))&&yo.throwArgumentError("value out-of-bounds for ".concat(t),"value",e),Object(A.h)(r.toTwos(256).toHexString(),32)}}var a=t.match(/^bytes(\d+)$/);if(a){var s=parseInt(a[1]);return(0===s||s>32||a[1]!==String(s))&&yo.throwArgumentError("invalid bytes width","type",t),function(e){return Object(A.a)(e).length!==s&&yo.throwArgumentError("invalid length for ".concat(t),"value",e),function(t){var e=Object(A.a)(t),r=e.length%32;return r?Object(A.c)([e,Io.slice(r)]):Object(A.i)(e)}(e)}}switch(t){case"address":return function(t){return Object(A.h)(ht(t),32)};case"bool":return function(t){return t?Co:wo};case"bytes":return function(t){return V(t)};case"string":return function(t){return _t(t)}}return null}function Do(t,e){return"".concat(t,"(").concat(e.map((function(t){var e=t.name;return t.type+" "+e})).join(","),")")}var xo=function(){function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),D(this,"types",Object.freeze(j(e))),D(this,"_encoderCache",{}),D(this,"_types",{});var r={},n={},i={};Object.keys(e).forEach((function(t){r[t]={},n[t]=[],i[t]={}}));var o=function(t){var i={};e[t].forEach((function(o){i[o.name]&&yo.throwArgumentError("duplicate variable name ".concat(JSON.stringify(o.name)," in ").concat(JSON.stringify(t)),"types",e),i[o.name]=!0;var a=o.type.match(/^([^\x5b]*)(\x5b|$)/)[1];a===t&&yo.throwArgumentError("circular type reference to ".concat(JSON.stringify(a)),"types",e),_o(a)||(n[a]||yo.throwArgumentError("unknown type ".concat(JSON.stringify(a)),"types",e),n[a].push(t),r[t][a]=!0)}))};for(var a in e)o(a);var s=Object.keys(n).filter((function(t){return 0===n[t].length}));for(var c in 0===s.length?yo.throwArgumentError("missing primary type","types",e):s.length>1&&yo.throwArgumentError("ambiguous primary types or unused types: ".concat(s.map((function(t){return JSON.stringify(t)})).join(", ")),"types",e),D(this,"primaryType",s[0]),function t(o,a){a[o]&&yo.throwArgumentError("circular type reference to ".concat(JSON.stringify(o)),"types",e),a[o]=!0,Object.keys(r[o]).forEach((function(e){n[e]&&(t(e,a),Object.keys(a).forEach((function(t){i[t][e]=!0})))})),delete a[o]}(this.primaryType,{}),i){var A=Object.keys(i[c]);A.sort(),this._types[c]=Do(c,e[c])+A.map((function(t){return Do(t,e[t])})).join("")}}var e,r,n;return e=t,n=[{key:"from",value:function(e){return new t(e)}},{key:"getPrimaryType",value:function(e){return t.from(e).primaryType}},{key:"hashStruct",value:function(e,r,n){return t.from(r).hashStruct(e,n)}},{key:"hashDomain",value:function(e){var r=[];for(var n in e){var i=Bo[n];i||yo.throwArgumentError("invalid typed-data domain key: ".concat(JSON.stringify(n)),"domain",e),r.push({name:n,type:i})}return r.sort((function(t,e){return Qo.indexOf(t.name)-Qo.indexOf(e.name)})),t.hashStruct("EIP712Domain",{EIP712Domain:r},e)}},{key:"encode",value:function(e,r,n){return Object(A.c)(["0x1901",t.hashDomain(e),t.from(r).hash(n)])}},{key:"hash",value:function(e,r,n){return V(t.encode(e,r,n))}},{key:"resolveNames",value:function(e,r,n,i){return po(this,void 0,void 0,lo().mark((function o(){var a,s,c;return lo().wrap((function(o){for(;;)switch(o.prev=o.next){case 0:e=O(e),a={},e.verifyingContract&&!Object(A.l)(e.verifyingContract,20)&&(a[e.verifyingContract]="0x"),(s=t.from(r)).visit(n,(function(t,e){return"address"!==t||Object(A.l)(e,20)||(a[e]="0x"),e})),o.t0=lo().keys(a);case 6:if((o.t1=o.t0()).done){o.next=13;break}return c=o.t1.value,o.next=10,i(c);case 10:a[c]=o.sent,o.next=6;break;case 13:return e.verifyingContract&&a[e.verifyingContract]&&(e.verifyingContract=a[e.verifyingContract]),n=s.visit(n,(function(t,e){return"address"===t&&a[e]?a[e]:e})),o.abrupt("return",{domain:e,value:n});case 16:case"end":return o.stop()}}),o)})))}},{key:"getPayload",value:function(e,r,n){t.hashDomain(e);var i={},o=[];Qo.forEach((function(t){var r=e[t];null!=r&&(i[t]=So[t](r),o.push({name:t,type:Bo[t]}))}));var a=t.from(r),s=O(r);return s.EIP712Domain?yo.throwArgumentError("types must not contain EIP712Domain type","types.EIP712Domain",r):s.EIP712Domain=o,a.encode(n),{types:s,domain:i,primaryType:a.primaryType,message:a.visit(n,(function(t,e){if(t.match(/^bytes(\d*)/))return Object(A.i)(Object(A.a)(e));if(t.match(/^u?int/))return b.from(e).toString();switch(t){case"address":return e.toLowerCase();case"bool":return!!e;case"string":return"string"!=typeof e&&yo.throwArgumentError("invalid string","value",e),e}return yo.throwArgumentError("unsupported type","type",t)}))}}}],(r=[{key:"getEncoder",value:function(t){var e=this._encoderCache[t];return e||(e=this._encoderCache[t]=this._getEncoder(t)),e}},{key:"_getEncoder",value:function(t){var e=this,r=_o(t);if(r)return r;var n=t.match(/^(.*)(\x5b(\d*)\x5d)$/);if(n){var i=n[1],o=this.getEncoder(i),a=parseInt(n[3]);return function(t){a>=0&&t.length!==a&&yo.throwArgumentError("array length mismatch; expected length ${ arrayLength }","value",t);var r=t.map(o);return e._types[i]&&(r=r.map(V)),V(Object(A.c)(r))}}var s=this.types[t];if(s){var c=_t(this._types[t]);return function(t){var r=s.map((function(r){var n=r.name,i=r.type,o=e.getEncoder(i)(t[n]);return e._types[i]?V(o):o}));return r.unshift(c),Object(A.c)(r)}}return yo.throwArgumentError("unknown type: ".concat(t),"type",t)}},{key:"encodeType",value:function(t){var e=this._types[t];return e||yo.throwArgumentError("unknown type: ".concat(JSON.stringify(t)),"name",t),e}},{key:"encodeData",value:function(t,e){return this.getEncoder(t)(e)}},{key:"hashStruct",value:function(t,e){return V(this.encodeData(t,e))}},{key:"encode",value:function(t){return this.encodeData(this.primaryType,t)}},{key:"hash",value:function(t){return this.hashStruct(this.primaryType,t)}},{key:"_visit",value:function(t,e,r){var n=this;if(_o(t))return r(t,e);var i=t.match(/^(.*)(\x5b(\d*)\x5d)$/);if(i){var o=i[1],a=parseInt(i[3]);return a>=0&&e.length!==a&&yo.throwArgumentError("array length mismatch; expected length ${ arrayLength }","value",e),e.map((function(t){return n._visit(o,t,r)}))}var s=this.types[t];return s?s.reduce((function(t,i){var o=i.name,a=i.type;return t[o]=n._visit(a,e[o],r),t}),{}):yo.throwArgumentError("unknown type: ".concat(t),"type",t)}},{key:"visit",value:function(t,e){return this._visit(this.primaryType,t,e)}}])&&go(e.prototype,r),n&&go(e,n),Object.defineProperty(e,"prototype",{writable:!1}),t}();function Mo(t){return(Mo="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Ro(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,(i=n.key,o=void 0,o=function(t,e){if("object"!==Mo(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==Mo(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(i,"string"),"symbol"===Mo(o)?o:String(o)),n)}var i,o}var Oo,No=function(){function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),D(this,"alphabet",e),D(this,"base",e.length),D(this,"_alphabetMap",{}),D(this,"_leader",e.charAt(0));for(var r=0;r<e.length;r++)this._alphabetMap[e.charAt(r)]=r}var e,r,n;return e=t,(r=[{key:"encode",value:function(t){var e=Object(A.a)(t);if(0===e.length)return"";for(var r=[0],n=0;n<e.length;++n){for(var i=e[n],o=0;o<r.length;++o)i+=r[o]<<8,r[o]=i%this.base,i=i/this.base|0;for(;i>0;)r.push(i%this.base),i=i/this.base|0}for(var a="",s=0;0===e[s]&&s<e.length-1;++s)a+=this._leader;for(var c=r.length-1;c>=0;--c)a+=this.alphabet[r[c]];return a}},{key:"decode",value:function(t){if("string"!=typeof t)throw new TypeError("Expected String");var e=[];if(0===t.length)return new Uint8Array(e);e.push(0);for(var r=0;r<t.length;r++){var n=this._alphabetMap[t[r]];if(void 0===n)throw new Error("Non-base"+this.base+" character");for(var i=n,o=0;o<e.length;++o)i+=e[o]*this.base,e[o]=255&i,i>>=8;for(;i>0;)e.push(255&i),i>>=8}for(var a=0;t[a]===this._leader&&a<t.length-1;++a)e.push(0);return Object(A.a)(new Uint8Array(e.reverse()))}}])&&Ro(e.prototype,r),n&&Ro(e,n),Object.defineProperty(e,"prototype",{writable:!1}),t}(),Po=(new No("abcdefghijklmnopqrstuvwxyz234567"),new No("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz")),jo=r(6),Lo=r.n(jo);!function(t){t.sha256="sha256",t.sha512="sha512"}(Oo||(Oo={}));var Fo=new h.b("sha2/5.7.0");function To(t){return"0x"+Lo.a.ripemd160().update(Object(A.a)(t)).digest("hex")}function Uo(t){return"0x"+Lo.a.sha256().update(Object(A.a)(t)).digest("hex")}function Go(t){return"0x"+Lo.a.sha512().update(Object(A.a)(t)).digest("hex")}function Ho(t,e,r){return Oo[t]||Fo.throwError("unsupported algorithm "+t,h.b.errors.UNSUPPORTED_OPERATION,{operation:"hmac",algorithm:t}),"0x"+Lo.a.hmac(Lo.a[t],Object(A.a)(e)).update(Object(A.a)(r)).digest("hex")}function Yo(t,e,r,n,i){var o;t=Object(A.a)(t),e=Object(A.a)(e);var a,s,c=1,u=new Uint8Array(n),f=new Uint8Array(e.length+4);f.set(e);for(var h=1;h<=c;h++){f[e.length]=h>>24&255,f[e.length+1]=h>>16&255,f[e.length+2]=h>>8&255,f[e.length+3]=255&h;var l=Object(A.a)(Ho(i,t,f));o||(o=l.length,s=new Uint8Array(o),a=n-((c=Math.ceil(n/o))-1)*o),s.set(l);for(var d=1;d<r;d++){l=Object(A.a)(Ho(i,t,l));for(var g=0;g<o;g++)s[g]^=l[g]}var p=(h-1)*o,y=h===c?a:o;u.set(Object(A.a)(s).slice(0,y),p)}return Object(A.i)(u)}function Ko(t){return(Ko="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function qo(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,(i=n.key,o=void 0,o=function(t,e){if("object"!==Ko(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==Ko(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(i,"string"),"symbol"===Ko(o)?o:String(o)),n)}var i,o}var Jo=new h.b("wordlists/5.7.0"),zo=function(){function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),Jo.checkAbstract(this instanceof t?this.constructor:void 0,t),D(this,"locale",e)}var e,r,n;return e=t,n=[{key:"check",value:function(t){for(var e=[],r=0;r<2048;r++){var n=t.getWord(r);if(r!==t.getWordIndex(n))return"0x";e.push(n)}return _t(e.join("\n")+"\n")}},{key:"register",value:function(t,e){e||(e=t.locale)}}],(r=[{key:"split",value:function(t){return t.toLowerCase().split(/ +/g)}},{key:"join",value:function(t){return t.join(" ")}}])&&qo(e.prototype,r),n&&qo(e,n),Object.defineProperty(e,"prototype",{writable:!1}),t}();function Zo(t){return(Zo="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Vo(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,(i=n.key,o=void 0,o=function(t,e){if("object"!==Zo(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==Zo(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(i,"string"),"symbol"===Zo(o)?o:String(o)),n)}var i,o}function Wo(t,e){return(Wo=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}function Xo(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=ta(t);if(e){var i=ta(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return $o(this,r)}}function $o(t,e){if(e&&("object"===Zo(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function ta(t){return(ta=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var ea=null;function ra(t){if(null==ea&&(ea="AbandonAbilityAbleAboutAboveAbsentAbsorbAbstractAbsurdAbuseAccessAccidentAccountAccuseAchieveAcidAcousticAcquireAcrossActActionActorActressActualAdaptAddAddictAddressAdjustAdmitAdultAdvanceAdviceAerobicAffairAffordAfraidAgainAgeAgentAgreeAheadAimAirAirportAisleAlarmAlbumAlcoholAlertAlienAllAlleyAllowAlmostAloneAlphaAlreadyAlsoAlterAlwaysAmateurAmazingAmongAmountAmusedAnalystAnchorAncientAngerAngleAngryAnimalAnkleAnnounceAnnualAnotherAnswerAntennaAntiqueAnxietyAnyApartApologyAppearAppleApproveAprilArchArcticAreaArenaArgueArmArmedArmorArmyAroundArrangeArrestArriveArrowArtArtefactArtistArtworkAskAspectAssaultAssetAssistAssumeAsthmaAthleteAtomAttackAttendAttitudeAttractAuctionAuditAugustAuntAuthorAutoAutumnAverageAvocadoAvoidAwakeAwareAwayAwesomeAwfulAwkwardAxisBabyBachelorBaconBadgeBagBalanceBalconyBallBambooBananaBannerBarBarelyBargainBarrelBaseBasicBasketBattleBeachBeanBeautyBecauseBecomeBeefBeforeBeginBehaveBehindBelieveBelowBeltBenchBenefitBestBetrayBetterBetweenBeyondBicycleBidBikeBindBiologyBirdBirthBitterBlackBladeBlameBlanketBlastBleakBlessBlindBloodBlossomBlouseBlueBlurBlushBoardBoatBodyBoilBombBoneBonusBookBoostBorderBoringBorrowBossBottomBounceBoxBoyBracketBrainBrandBrassBraveBreadBreezeBrickBridgeBriefBrightBringBriskBroccoliBrokenBronzeBroomBrotherBrownBrushBubbleBuddyBudgetBuffaloBuildBulbBulkBulletBundleBunkerBurdenBurgerBurstBusBusinessBusyButterBuyerBuzzCabbageCabinCableCactusCageCakeCallCalmCameraCampCanCanalCancelCandyCannonCanoeCanvasCanyonCapableCapitalCaptainCarCarbonCardCargoCarpetCarryCartCaseCashCasinoCastleCasualCatCatalogCatchCategoryCattleCaughtCauseCautionCaveCeilingCeleryCementCensusCenturyCerealCertainChairChalkChampionChangeChaosChapterChargeChaseChatCheapCheckCheeseChefCherryChestChickenChiefChildChimneyChoiceChooseChronicChuckleChunkChurnCigarCinnamonCircleCitizenCityCivilClaimClapClarifyClawClayCleanClerkCleverClickClientCliffClimbClinicClipClockClogCloseClothCloudClownClubClumpClusterClutchCoachCoastCoconutCodeCoffeeCoilCoinCollectColorColumnCombineComeComfortComicCommonCompanyConcertConductConfirmCongressConnectConsiderControlConvinceCookCoolCopperCopyCoralCoreCornCorrectCostCottonCouchCountryCoupleCourseCousinCoverCoyoteCrackCradleCraftCramCraneCrashCraterCrawlCrazyCreamCreditCreekCrewCricketCrimeCrispCriticCropCrossCrouchCrowdCrucialCruelCruiseCrumbleCrunchCrushCryCrystalCubeCultureCupCupboardCuriousCurrentCurtainCurveCushionCustomCuteCycleDadDamageDampDanceDangerDaringDashDaughterDawnDayDealDebateDebrisDecadeDecemberDecideDeclineDecorateDecreaseDeerDefenseDefineDefyDegreeDelayDeliverDemandDemiseDenialDentistDenyDepartDependDepositDepthDeputyDeriveDescribeDesertDesignDeskDespairDestroyDetailDetectDevelopDeviceDevoteDiagramDialDiamondDiaryDiceDieselDietDifferDigitalDignityDilemmaDinnerDinosaurDirectDirtDisagreeDiscoverDiseaseDishDismissDisorderDisplayDistanceDivertDivideDivorceDizzyDoctorDocumentDogDollDolphinDomainDonateDonkeyDonorDoorDoseDoubleDoveDraftDragonDramaDrasticDrawDreamDressDriftDrillDrinkDripDriveDropDrumDryDuckDumbDuneDuringDustDutchDutyDwarfDynamicEagerEagleEarlyEarnEarthEasilyEastEasyEchoEcologyEconomyEdgeEditEducateEffortEggEightEitherElbowElderElectricElegantElementElephantElevatorEliteElseEmbarkEmbodyEmbraceEmergeEmotionEmployEmpowerEmptyEnableEnactEndEndlessEndorseEnemyEnergyEnforceEngageEngineEnhanceEnjoyEnlistEnoughEnrichEnrollEnsureEnterEntireEntryEnvelopeEpisodeEqualEquipEraEraseErodeErosionErrorEruptEscapeEssayEssenceEstateEternalEthicsEvidenceEvilEvokeEvolveExactExampleExcessExchangeExciteExcludeExcuseExecuteExerciseExhaustExhibitExileExistExitExoticExpandExpectExpireExplainExposeExpressExtendExtraEyeEyebrowFabricFaceFacultyFadeFaintFaithFallFalseFameFamilyFamousFanFancyFantasyFarmFashionFatFatalFatherFatigueFaultFavoriteFeatureFebruaryFederalFeeFeedFeelFemaleFenceFestivalFetchFeverFewFiberFictionFieldFigureFileFilmFilterFinalFindFineFingerFinishFireFirmFirstFiscalFishFitFitnessFixFlagFlameFlashFlatFlavorFleeFlightFlipFloatFlockFloorFlowerFluidFlushFlyFoamFocusFogFoilFoldFollowFoodFootForceForestForgetForkFortuneForumForwardFossilFosterFoundFoxFragileFrameFrequentFreshFriendFringeFrogFrontFrostFrownFrozenFruitFuelFunFunnyFurnaceFuryFutureGadgetGainGalaxyGalleryGameGapGarageGarbageGardenGarlicGarmentGasGaspGateGatherGaugeGazeGeneralGeniusGenreGentleGenuineGestureGhostGiantGiftGiggleGingerGiraffeGirlGiveGladGlanceGlareGlassGlideGlimpseGlobeGloomGloryGloveGlowGlueGoatGoddessGoldGoodGooseGorillaGospelGossipGovernGownGrabGraceGrainGrantGrapeGrassGravityGreatGreenGridGriefGritGroceryGroupGrowGruntGuardGuessGuideGuiltGuitarGunGymHabitHairHalfHammerHamsterHandHappyHarborHardHarshHarvestHatHaveHawkHazardHeadHealthHeartHeavyHedgehogHeightHelloHelmetHelpHenHeroHiddenHighHillHintHipHireHistoryHobbyHockeyHoldHoleHolidayHollowHomeHoneyHoodHopeHornHorrorHorseHospitalHostHotelHourHoverHubHugeHumanHumbleHumorHundredHungryHuntHurdleHurryHurtHusbandHybridIceIconIdeaIdentifyIdleIgnoreIllIllegalIllnessImageImitateImmenseImmuneImpactImposeImproveImpulseInchIncludeIncomeIncreaseIndexIndicateIndoorIndustryInfantInflictInformInhaleInheritInitialInjectInjuryInmateInnerInnocentInputInquiryInsaneInsectInsideInspireInstallIntactInterestIntoInvestInviteInvolveIronIslandIsolateIssueItemIvoryJacketJaguarJarJazzJealousJeansJellyJewelJobJoinJokeJourneyJoyJudgeJuiceJumpJungleJuniorJunkJustKangarooKeenKeepKetchupKeyKickKidKidneyKindKingdomKissKitKitchenKiteKittenKiwiKneeKnifeKnockKnowLabLabelLaborLadderLadyLakeLampLanguageLaptopLargeLaterLatinLaughLaundryLavaLawLawnLawsuitLayerLazyLeaderLeafLearnLeaveLectureLeftLegLegalLegendLeisureLemonLendLengthLensLeopardLessonLetterLevelLiarLibertyLibraryLicenseLifeLiftLightLikeLimbLimitLinkLionLiquidListLittleLiveLizardLoadLoanLobsterLocalLockLogicLonelyLongLoopLotteryLoudLoungeLoveLoyalLuckyLuggageLumberLunarLunchLuxuryLyricsMachineMadMagicMagnetMaidMailMainMajorMakeMammalManManageMandateMangoMansionManualMapleMarbleMarchMarginMarineMarketMarriageMaskMassMasterMatchMaterialMathMatrixMatterMaximumMazeMeadowMeanMeasureMeatMechanicMedalMediaMelodyMeltMemberMemoryMentionMenuMercyMergeMeritMerryMeshMessageMetalMethodMiddleMidnightMilkMillionMimicMindMinimumMinorMinuteMiracleMirrorMiseryMissMistakeMixMixedMixtureMobileModelModifyMomMomentMonitorMonkeyMonsterMonthMoonMoralMoreMorningMosquitoMotherMotionMotorMountainMouseMoveMovieMuchMuffinMuleMultiplyMuscleMuseumMushroomMusicMustMutualMyselfMysteryMythNaiveNameNapkinNarrowNastyNationNatureNearNeckNeedNegativeNeglectNeitherNephewNerveNestNetNetworkNeutralNeverNewsNextNiceNightNobleNoiseNomineeNoodleNormalNorthNoseNotableNoteNothingNoticeNovelNowNuclearNumberNurseNutOakObeyObjectObligeObscureObserveObtainObviousOccurOceanOctoberOdorOffOfferOfficeOftenOilOkayOldOliveOlympicOmitOnceOneOnionOnlineOnlyOpenOperaOpinionOpposeOptionOrangeOrbitOrchardOrderOrdinaryOrganOrientOriginalOrphanOstrichOtherOutdoorOuterOutputOutsideOvalOvenOverOwnOwnerOxygenOysterOzonePactPaddlePagePairPalacePalmPandaPanelPanicPantherPaperParadeParentParkParrotPartyPassPatchPathPatientPatrolPatternPausePavePaymentPeacePeanutPearPeasantPelicanPenPenaltyPencilPeoplePepperPerfectPermitPersonPetPhonePhotoPhrasePhysicalPianoPicnicPicturePiecePigPigeonPillPilotPinkPioneerPipePistolPitchPizzaPlacePlanetPlasticPlatePlayPleasePledgePluckPlugPlungePoemPoetPointPolarPolePolicePondPonyPoolPopularPortionPositionPossiblePostPotatoPotteryPovertyPowderPowerPracticePraisePredictPreferPreparePresentPrettyPreventPricePridePrimaryPrintPriorityPrisonPrivatePrizeProblemProcessProduceProfitProgramProjectPromoteProofPropertyProsperProtectProudProvidePublicPuddingPullPulpPulsePumpkinPunchPupilPuppyPurchasePurityPurposePursePushPutPuzzlePyramidQualityQuantumQuarterQuestionQuickQuitQuizQuoteRabbitRaccoonRaceRackRadarRadioRailRainRaiseRallyRampRanchRandomRangeRapidRareRateRatherRavenRawRazorReadyRealReasonRebelRebuildRecallReceiveRecipeRecordRecycleReduceReflectReformRefuseRegionRegretRegularRejectRelaxReleaseReliefRelyRemainRememberRemindRemoveRenderRenewRentReopenRepairRepeatReplaceReportRequireRescueResembleResistResourceResponseResultRetireRetreatReturnReunionRevealReviewRewardRhythmRibRibbonRiceRichRideRidgeRifleRightRigidRingRiotRippleRiskRitualRivalRiverRoadRoastRobotRobustRocketRomanceRoofRookieRoomRoseRotateRoughRoundRouteRoyalRubberRudeRugRuleRunRunwayRuralSadSaddleSadnessSafeSailSaladSalmonSalonSaltSaluteSameSampleSandSatisfySatoshiSauceSausageSaveSayScaleScanScareScatterSceneSchemeSchoolScienceScissorsScorpionScoutScrapScreenScriptScrubSeaSearchSeasonSeatSecondSecretSectionSecuritySeedSeekSegmentSelectSellSeminarSeniorSenseSentenceSeriesServiceSessionSettleSetupSevenShadowShaftShallowShareShedShellSheriffShieldShiftShineShipShiverShockShoeShootShopShortShoulderShoveShrimpShrugShuffleShySiblingSickSideSiegeSightSignSilentSilkSillySilverSimilarSimpleSinceSingSirenSisterSituateSixSizeSkateSketchSkiSkillSkinSkirtSkullSlabSlamSleepSlenderSliceSlideSlightSlimSloganSlotSlowSlushSmallSmartSmileSmokeSmoothSnackSnakeSnapSniffSnowSoapSoccerSocialSockSodaSoftSolarSoldierSolidSolutionSolveSomeoneSongSoonSorrySortSoulSoundSoupSourceSouthSpaceSpareSpatialSpawnSpeakSpecialSpeedSpellSpendSphereSpiceSpiderSpikeSpinSpiritSplitSpoilSponsorSpoonSportSpotSpraySpreadSpringSpySquareSqueezeSquirrelStableStadiumStaffStageStairsStampStandStartStateStaySteakSteelStemStepStereoStickStillStingStockStomachStoneStoolStoryStoveStrategyStreetStrikeStrongStruggleStudentStuffStumbleStyleSubjectSubmitSubwaySuccessSuchSuddenSufferSugarSuggestSuitSummerSunSunnySunsetSuperSupplySupremeSureSurfaceSurgeSurpriseSurroundSurveySuspectSustainSwallowSwampSwapSwarmSwearSweetSwiftSwimSwingSwitchSwordSymbolSymptomSyrupSystemTableTackleTagTailTalentTalkTankTapeTargetTaskTasteTattooTaxiTeachTeamTellTenTenantTennisTentTermTestTextThankThatThemeThenTheoryThereTheyThingThisThoughtThreeThriveThrowThumbThunderTicketTideTigerTiltTimberTimeTinyTipTiredTissueTitleToastTobaccoTodayToddlerToeTogetherToiletTokenTomatoTomorrowToneTongueTonightToolToothTopTopicToppleTorchTornadoTortoiseTossTotalTouristTowardTowerTownToyTrackTradeTrafficTragicTrainTransferTrapTrashTravelTrayTreatTreeTrendTrialTribeTrickTriggerTrimTripTrophyTroubleTruckTrueTrulyTrumpetTrustTruthTryTubeTuitionTumbleTunaTunnelTurkeyTurnTurtleTwelveTwentyTwiceTwinTwistTwoTypeTypicalUglyUmbrellaUnableUnawareUncleUncoverUnderUndoUnfairUnfoldUnhappyUniformUniqueUnitUniverseUnknownUnlockUntilUnusualUnveilUpdateUpgradeUpholdUponUpperUpsetUrbanUrgeUsageUseUsedUsefulUselessUsualUtilityVacantVacuumVagueValidValleyValveVanVanishVaporVariousVastVaultVehicleVelvetVendorVentureVenueVerbVerifyVersionVeryVesselVeteranViableVibrantViciousVictoryVideoViewVillageVintageViolinVirtualVirusVisaVisitVisualVitalVividVocalVoiceVoidVolcanoVolumeVoteVoyageWageWagonWaitWalkWallWalnutWantWarfareWarmWarriorWashWaspWasteWaterWaveWayWealthWeaponWearWeaselWeatherWebWeddingWeekendWeirdWelcomeWestWetWhaleWhatWheatWheelWhenWhereWhipWhisperWideWidthWifeWildWillWinWindowWineWingWinkWinnerWinterWireWisdomWiseWishWitnessWolfWomanWonderWoodWoolWordWorkWorldWorryWorthWrapWreckWrestleWristWriteWrongYardYearYellowYouYoungYouthZebraZeroZoneZoo".replace(/([A-Z])/g," $1").toLowerCase().substring(1).split(" "),"0x3c8acc1e7b08d8e76f9fda015ef48dc8c710a73cb7e0f77b2c18a9b5a7adde60"!==zo.check(t)))throw ea=null,new Error("BIP39 Wordlist for en (English) FAILED")}var na=new(function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Wo(t,e)}(o,t);var e,r,n,i=Xo(o);function o(){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,o),i.call(this,"en")}return e=o,(r=[{key:"getWord",value:function(t){return ra(this),ea[t]}},{key:"getWordIndex",value:function(t){return ra(this),ea.indexOf(t)}}])&&Vo(e.prototype,r),n&&Vo(e,n),Object.defineProperty(e,"prototype",{writable:!1}),o}(zo));zo.register(na);var ia={en:na};function oa(t){return(oa="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function aa(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,(i=n.key,o=void 0,o=function(t,e){if("object"!==oa(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==oa(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(i,"string"),"symbol"===oa(o)?o:String(o)),n)}var i,o}var sa=new h.b("hdnode/5.7.0"),ca=b.from("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),Aa=Ct("Bitcoin seed");function ua(t){return(1<<t)-1<<8-t}function fa(t){return Object(A.h)(Object(A.i)(t),32)}function ha(t){return Po.encode(Object(A.b)([t,Object(A.e)(Uo(Uo(t)),0,4)]))}function la(t){if(null==t)return ia.en;if("string"==typeof t){var e=ia[t];return null==e&&sa.throwArgumentError("unknown locale","wordlist",t),e}return t}var da={},ga="m/44'/60'/0'/0/0",pa=function(){function t(e,r,n,i,o,a,s,c){if(function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),e!==da)throw new Error("HDNode constructor cannot be called directly");if(r){var u=new Vn(r);D(this,"privateKey",u.privateKey),D(this,"publicKey",u.compressedPublicKey)}else D(this,"privateKey",null),D(this,"publicKey",Object(A.i)(n));D(this,"parentFingerprint",i),D(this,"fingerprint",Object(A.e)(To(Uo(this.publicKey)),0,4)),D(this,"address",oi(this.publicKey)),D(this,"chainCode",o),D(this,"index",a),D(this,"depth",s),null==c?(D(this,"mnemonic",null),D(this,"path",null)):"string"==typeof c?(D(this,"mnemonic",null),D(this,"path",c)):(D(this,"mnemonic",c),D(this,"path",c.path))}var e,r,n;return e=t,n=[{key:"_fromSeed",value:function(e,r){var n=Object(A.a)(e);if(n.length<16||n.length>64)throw new Error("invalid seed");var i=Object(A.a)(Ho(Oo.sha512,Aa,n));return new t(da,fa(i.slice(0,32)),null,"0x00000000",fa(i.slice(32)),0,0,r)}},{key:"fromMnemonic",value:function(e,r,n){return e=ba(Ia(e,n=la(n)),n),t._fromSeed(ya(e,r),{phrase:e,path:"m",locale:n.locale})}},{key:"fromSeed",value:function(e){return t._fromSeed(e,null)}},{key:"fromExtendedKey",value:function(e){var r=Po.decode(e);82===r.length&&ha(r.slice(0,78))===e||sa.throwArgumentError("invalid extended key","extendedKey","[REDACTED]");var n=r[4],i=Object(A.i)(r.slice(5,9)),o=parseInt(Object(A.i)(r.slice(9,13)).substring(2),16),a=Object(A.i)(r.slice(13,45)),s=r.slice(45,78);switch(Object(A.i)(r.slice(0,4))){case"0x0488b21e":case"0x043587cf":return new t(da,null,Object(A.i)(s),i,a,o,n,null);case"0x0488ade4":case"0x04358394 ":if(0!==s[0])break;return new t(da,Object(A.i)(s.slice(1)),null,i,a,o,n,null)}return sa.throwArgumentError("invalid extended key","extendedKey","[REDACTED]")}}],(r=[{key:"extendedKey",get:function(){if(this.depth>=256)throw new Error("Depth too large!");return ha(Object(A.b)([null!=this.privateKey?"0x0488ADE4":"0x0488B21E",Object(A.i)(this.depth),this.parentFingerprint,Object(A.h)(Object(A.i)(this.index),4),this.chainCode,null!=this.privateKey?Object(A.b)(["0x00",this.privateKey]):this.publicKey]))}},{key:"neuter",value:function(){return new t(da,null,this.publicKey,this.parentFingerprint,this.chainCode,this.index,this.depth,this.path)}},{key:"_derive",value:function(e){if(e>4294967295)throw new Error("invalid index - "+String(e));var r=this.path;r&&(r+="/"+(2147483647&e));var n=new Uint8Array(37);if(2147483648&e){if(!this.privateKey)throw new Error("cannot derive child of neutered node");n.set(Object(A.a)(this.privateKey),1),r&&(r+="'")}else n.set(Object(A.a)(this.publicKey));for(var i=24;i>=0;i-=8)n[33+(i>>3)]=e>>24-i&255;var o=Object(A.a)(Ho(Oo.sha512,this.chainCode,n)),a=o.slice(0,32),s=o.slice(32),c=null,u=null;this.privateKey?c=fa(b.from(a).add(this.privateKey).mod(ca)):u=new Vn(Object(A.i)(a))._addPoint(this.publicKey);var f=r,h=this.mnemonic;return h&&(f=Object.freeze({phrase:h.phrase,path:r,locale:h.locale||"en"})),new t(da,c,u,this.fingerprint,fa(s),e,this.depth+1,f)}},{key:"derivePath",value:function(t){var e=t.split("/");if(0===e.length||"m"===e[0]&&0!==this.depth)throw new Error("invalid path - "+t);"m"===e[0]&&e.shift();for(var r=this,n=0;n<e.length;n++){var i=e[n];if(i.match(/^[0-9]+'$/)){var o=parseInt(i.substring(0,i.length-1));if(o>=2147483648)throw new Error("invalid path index - "+i);r=r._derive(2147483648+o)}else{if(!i.match(/^[0-9]+$/))throw new Error("invalid path component - "+i);var a=parseInt(i);if(a>=2147483648)throw new Error("invalid path index - "+i);r=r._derive(a)}}return r}}])&&aa(e.prototype,r),n&&aa(e,n),Object.defineProperty(e,"prototype",{writable:!1}),t}();function ya(t,e){e||(e="");var r=Ct("mnemonic"+e,yt.NFKD);return Yo(Ct(t,yt.NFKD),r,2048,64,"sha512")}function Ia(t,e){e=la(e),sa.checkNormalize();var r=e.split(t);if(r.length%3!=0)throw new Error("invalid mnemonic");for(var n=Object(A.a)(new Uint8Array(Math.ceil(11*r.length/8))),i=0,o=0;o<r.length;o++){var a=e.getWordIndex(r[o].normalize("NFKD"));if(-1===a)throw new Error("invalid mnemonic");for(var s=0;s<11;s++)a&1<<10-s&&(n[i>>3]|=1<<7-i%8),i++}var c=32*r.length/3,u=ua(r.length/3);if((Object(A.a)(Uo(n.slice(0,c/8)))[0]&u)!==(n[n.length-1]&u))throw new Error("invalid checksum");return Object(A.i)(n.slice(0,c/8))}function ba(t,e){if(e=la(e),(t=Object(A.a)(t)).length%4!=0||t.length<16||t.length>32)throw new Error("invalid entropy");for(var r=[0],n=11,i=0;i<t.length;i++)n>8?(r[r.length-1]<<=8,r[r.length-1]|=t[i],n-=8):(r[r.length-1]<<=n,r[r.length-1]|=t[i]>>8-n,r.push(t[i]&(1<<8-n)-1),n+=3);var o=t.length/4,a=Object(A.a)(Uo(t))[0]&ua(o);return r[r.length-1]<<=o,r[r.length-1]|=a>>8-o,e.join(r.map((function(t){return e.getWord(t)})))}function va(t,e){try{return Ia(t,e),!0}catch(t){}return!1}function Ea(t){return("number"!=typeof t||t<0||t>=2147483648||t%1)&&sa.throwArgumentError("invalid account index","index",t),"m/44'/60'/".concat(t,"'/0/0")}var ma=r(340),Ca=r(13),wa=r.n(Ca),Ba=r(50),Qa=r.n(Ba);function ka(t){return"string"==typeof t&&"0x"!==t.substring(0,2)&&(t="0x"+t),Object(A.a)(t)}function Sa(t,e){for(t=String(t);t.length<e;)t="0"+t;return t}function _a(t){return"string"==typeof t?Ct(t,yt.NFKC):Object(A.a)(t)}function Da(t,e){for(var r=t,n=e.toLowerCase().split("/"),i=0;i<n.length;i++){var o=null;for(var a in r)if(a.toLowerCase()===n[i]){o=r[a];break}if(null===o)return null;r=o}return r}function xa(t){var e=Object(A.a)(t);e[6]=15&e[6]|64,e[8]=63&e[8]|128;var r=Object(A.i)(e);return[r.substring(2,10),r.substring(10,14),r.substring(14,18),r.substring(18,22),r.substring(22,34)].join("-")}function Ma(t){return(Ma="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Ra(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */Ra=function(){return t};var t={},e=Object.prototype,r=e.hasOwnProperty,n=Object.defineProperty||function(t,e,r){t[e]=r.value},i="function"==typeof Symbol?Symbol:{},o=i.iterator||"@@iterator",a=i.asyncIterator||"@@asyncIterator",s=i.toStringTag||"@@toStringTag";function c(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{c({},"")}catch(t){c=function(t,e,r){return t[e]=r}}function A(t,e,r,i){var o=e&&e.prototype instanceof h?e:h,a=Object.create(o.prototype),s=new B(i||[]);return n(a,"_invoke",{value:E(t,r,s)}),a}function u(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=A;var f={};function h(){}function l(){}function d(){}var g={};c(g,o,(function(){return this}));var p=Object.getPrototypeOf,y=p&&p(p(Q([])));y&&y!==e&&r.call(y,o)&&(g=y);var I=d.prototype=h.prototype=Object.create(g);function b(t){["next","throw","return"].forEach((function(e){c(t,e,(function(t){return this._invoke(e,t)}))}))}function v(t,e){var i;n(this,"_invoke",{value:function(n,o){function a(){return new e((function(i,a){!function n(i,o,a,s){var c=u(t[i],t,o);if("throw"!==c.type){var A=c.arg,f=A.value;return f&&"object"==Ma(f)&&r.call(f,"__await")?e.resolve(f.__await).then((function(t){n("next",t,a,s)}),(function(t){n("throw",t,a,s)})):e.resolve(f).then((function(t){A.value=t,a(A)}),(function(t){return n("throw",t,a,s)}))}s(c.arg)}(n,o,i,a)}))}return i=i?i.then(a,a):a()}})}function E(t,e,r){var n="suspendedStart";return function(i,o){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===i)throw o;return k()}for(r.method=i,r.arg=o;;){var a=r.delegate;if(a){var s=m(a,r);if(s){if(s===f)continue;return s}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var c=u(t,e,r);if("normal"===c.type){if(n=r.done?"completed":"suspendedYield",c.arg===f)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(n="completed",r.method="throw",r.arg=c.arg)}}}function m(t,e){var r=e.method,n=t.iterator[r];if(void 0===n)return e.delegate=null,"throw"===r&&t.iterator.return&&(e.method="return",e.arg=void 0,m(t,e),"throw"===e.method)||"return"!==r&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+r+"' method")),f;var i=u(n,t.iterator,e.arg);if("throw"===i.type)return e.method="throw",e.arg=i.arg,e.delegate=null,f;var o=i.arg;return o?o.done?(e[t.resultName]=o.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,f):o:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,f)}function C(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function w(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function B(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(C,this),this.reset(!0)}function Q(t){if(t){var e=t[o];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,i=function e(){for(;++n<t.length;)if(r.call(t,n))return e.value=t[n],e.done=!1,e;return e.value=void 0,e.done=!0,e};return i.next=i}}return{next:k}}function k(){return{value:void 0,done:!0}}return l.prototype=d,n(I,"constructor",{value:d,configurable:!0}),n(d,"constructor",{value:l,configurable:!0}),l.displayName=c(d,s,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===l||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,d):(t.__proto__=d,c(t,s,"GeneratorFunction")),t.prototype=Object.create(I),t},t.awrap=function(t){return{__await:t}},b(v.prototype),c(v.prototype,a,(function(){return this})),t.AsyncIterator=v,t.async=function(e,r,n,i,o){void 0===o&&(o=Promise);var a=new v(A(e,r,n,i),o);return t.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},b(I),c(I,s,"Generator"),c(I,o,(function(){return this})),c(I,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},t.values=Q,B.prototype={constructor:B,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(w),!t)for(var e in this)"t"===e.charAt(0)&&r.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function n(r,n){return a.type="throw",a.arg=t,e.next=r,n&&(e.method="next",e.arg=void 0),!!n}for(var i=this.tryEntries.length-1;i>=0;--i){var o=this.tryEntries[i],a=o.completion;if("root"===o.tryLoc)return n("end");if(o.tryLoc<=this.prev){var s=r.call(o,"catchLoc"),c=r.call(o,"finallyLoc");if(s&&c){if(this.prev<o.catchLoc)return n(o.catchLoc,!0);if(this.prev<o.finallyLoc)return n(o.finallyLoc)}else if(s){if(this.prev<o.catchLoc)return n(o.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return n(o.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&r.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var o=i;break}}o&&("break"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc&&(o=null);var a=o?o.completion:{};return a.type=t,a.arg=e,o?(this.method="next",this.next=o.finallyLoc,f):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),f},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),w(r),f}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var i=n.arg;w(r)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:Q(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),f}},t}function Oa(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Na(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,(i=n.key,o=void 0,o=function(t,e){if("object"!==Ma(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==Ma(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(i,"string"),"symbol"===Ma(o)?o:String(o)),n)}var i,o}function Pa(t,e){return(Pa=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}function ja(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=Fa(t);if(e){var i=Fa(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return La(this,r)}}function La(t,e){if(e&&("object"===Ma(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function Fa(t){return(Fa=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var Ta=function(t,e,r,n){return new(r||(r=Promise))((function(i,o){function a(t){try{c(n.next(t))}catch(t){o(t)}}function s(t){try{c(n.throw(t))}catch(t){o(t)}}function c(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(a,s)}c((n=n.apply(t,e||[])).next())}))},Ua=new h.b("json-wallets/5.7.0");function Ga(t){return null!=t&&t.mnemonic&&t.mnemonic.phrase}var Ha=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Pa(t,e)}(o,t);var e,r,n,i=ja(o);function o(){return Oa(this,o),i.apply(this,arguments)}return e=o,(r=[{key:"isKeystoreAccount",value:function(t){return!(!t||!t._isKeystoreAccount)}}])&&Na(e.prototype,r),n&&Na(e,n),Object.defineProperty(e,"prototype",{writable:!1}),o}(L);function Ya(t,e){var r=ka(Da(t,"crypto/ciphertext"));if(Object(A.i)(V(Object(A.b)([e.slice(16,32),r]))).substring(2)!==Da(t,"crypto/mac").toLowerCase())throw new Error("invalid password");var n=function(t,e,r){if("aes-128-ctr"===Da(t,"crypto/cipher")){var n=ka(Da(t,"crypto/cipherparams/iv")),i=new wa.a.Counter(n),o=new wa.a.ModeOfOperation.ctr(e,i);return Object(A.a)(o.decrypt(r))}return null}(t,e.slice(0,16),r);n||Ua.throwError("unsupported cipher",h.b.errors.UNSUPPORTED_OPERATION,{operation:"decrypt"});var i=e.slice(32,64),o=oi(n);if(t.address){var a=t.address.toLowerCase();if("0x"!==a.substring(0,2)&&(a="0x"+a),ht(a)!==o)throw new Error("address mismatch")}var s={_isKeystoreAccount:!0,address:o,privateKey:Object(A.i)(n)};if("0.1"===Da(t,"x-ethers/version")){var c=ka(Da(t,"x-ethers/mnemonicCiphertext")),u=ka(Da(t,"x-ethers/mnemonicCounter")),f=new wa.a.Counter(u),l=new wa.a.ModeOfOperation.ctr(i,f),d=Da(t,"x-ethers/path")||ga,g=Da(t,"x-ethers/locale")||"en",p=Object(A.a)(l.decrypt(c));try{var y=ba(p,g),I=pa.fromMnemonic(y,null,g).derivePath(d);if(I.privateKey!=s.privateKey)throw new Error("mnemonic mismatch");s.mnemonic=I.mnemonic}catch(t){if(t.code!==h.b.errors.INVALID_ARGUMENT||"wordlist"!==t.argument)throw t}}return new Ha(s)}function Ka(t,e,r,n,i){return Object(A.a)(Yo(t,e,r,n,i))}function qa(t,e,r,n,i){return Promise.resolve(Ka(t,e,r,n,i))}function Ja(t,e,r,n,i){var o=_a(e),a=Da(t,"crypto/kdf");if(a&&"string"==typeof a){var s=function(t,e){return Ua.throwArgumentError("invalid key-derivation function parameters",t,e)};if("scrypt"===a.toLowerCase()){var c=ka(Da(t,"crypto/kdfparams/salt")),A=parseInt(Da(t,"crypto/kdfparams/n")),u=parseInt(Da(t,"crypto/kdfparams/r")),f=parseInt(Da(t,"crypto/kdfparams/p"));A&&u&&f||s("kdf",a),0!=(A&A-1)&&s("N",A);var h=parseInt(Da(t,"crypto/kdfparams/dklen"));return 32!==h&&s("dklen",h),n(o,c,A,u,f,64,i)}if("pbkdf2"===a.toLowerCase()){var l=ka(Da(t,"crypto/kdfparams/salt")),d=null,g=Da(t,"crypto/kdfparams/prf");"hmac-sha256"===g?d="sha256":"hmac-sha512"===g?d="sha512":s("prf",g);var p=parseInt(Da(t,"crypto/kdfparams/c")),y=parseInt(Da(t,"crypto/kdfparams/dklen"));return 32!==y&&s("dklen",y),r(o,l,p,y,d)}}return Ua.throwArgumentError("unsupported key-derivation function","kdf",a)}function za(t){return(za="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Za(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Va(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,(i=n.key,o=void 0,o=function(t,e){if("object"!==za(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==za(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(i,"string"),"symbol"===za(o)?o:String(o)),n)}var i,o}function Wa(t,e){return(Wa=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}function Xa(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=ts(t);if(e){var i=ts(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return $a(this,r)}}function $a(t,e){if(e&&("object"===za(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function ts(t){return(ts=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var es=new h.b("json-wallets/5.7.0"),rs=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Wa(t,e)}(o,t);var e,r,n,i=Xa(o);function o(){return Za(this,o),i.apply(this,arguments)}return e=o,(r=[{key:"isCrowdsaleAccount",value:function(t){return!(!t||!t._isCrowdsaleAccount)}}])&&Va(e.prototype,r),n&&Va(e,n),Object.defineProperty(e,"prototype",{writable:!1}),o}(L);function ns(t,e){var r=JSON.parse(t);e=_a(e);var n=ht(Da(r,"ethaddr")),i=ka(Da(r,"encseed"));i&&i.length%16==0||es.throwArgumentError("invalid encseed","json",t);for(var o=Object(A.a)(Yo(e,e,2e3,32,"sha256")).slice(0,16),a=i.slice(0,16),s=i.slice(16),c=new wa.a.ModeOfOperation.cbc(o,a),u=wa.a.padding.pkcs7.strip(Object(A.a)(c.decrypt(s))),f="",h=0;h<u.length;h++)f+=String.fromCharCode(u[h]);var l=V(Ct(f));return new rs({_isCrowdsaleAccount:!0,address:n,privateKey:l})}function is(t){var e=null;try{e=JSON.parse(t)}catch(t){return!1}return e.encseed&&e.ethaddr}function os(t){var e=null;try{e=JSON.parse(t)}catch(t){return!1}return!(!e.version||parseInt(e.version)!==e.version||3!==parseInt(e.version))}function as(t){if(is(t))try{return ht(JSON.parse(t).ethaddr)}catch(t){return null}if(os(t))try{return ht(JSON.parse(t).address)}catch(t){return null}return null}function ss(t,e,r){if(is(t)){r&&r(0);var n=ns(t,e);return r&&r(1),Promise.resolve(n)}return os(t)?function(t,e,r){return Ta(this,void 0,void 0,Ra().mark((function n(){var i,o;return Ra().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return i=JSON.parse(t),n.next=3,Ja(i,e,qa,Qa.a.scrypt,r);case 3:return o=n.sent,n.abrupt("return",Ya(i,o));case 5:case"end":return n.stop()}}),n)})))}(t,e,r):Promise.reject(new Error("invalid JSON wallet"))}function cs(t,e){if(is(t))return ns(t,e);if(os(t))return function(t,e){var r=JSON.parse(t);return Ya(r,Ja(r,e,Ka,Qa.a.syncScrypt))}(t,e);throw new Error("invalid JSON wallet")}function As(t){return(As="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function us(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */us=function(){return t};var t={},e=Object.prototype,r=e.hasOwnProperty,n=Object.defineProperty||function(t,e,r){t[e]=r.value},i="function"==typeof Symbol?Symbol:{},o=i.iterator||"@@iterator",a=i.asyncIterator||"@@asyncIterator",s=i.toStringTag||"@@toStringTag";function c(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{c({},"")}catch(t){c=function(t,e,r){return t[e]=r}}function A(t,e,r,i){var o=e&&e.prototype instanceof h?e:h,a=Object.create(o.prototype),s=new B(i||[]);return n(a,"_invoke",{value:E(t,r,s)}),a}function u(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=A;var f={};function h(){}function l(){}function d(){}var g={};c(g,o,(function(){return this}));var p=Object.getPrototypeOf,y=p&&p(p(Q([])));y&&y!==e&&r.call(y,o)&&(g=y);var I=d.prototype=h.prototype=Object.create(g);function b(t){["next","throw","return"].forEach((function(e){c(t,e,(function(t){return this._invoke(e,t)}))}))}function v(t,e){var i;n(this,"_invoke",{value:function(n,o){function a(){return new e((function(i,a){!function n(i,o,a,s){var c=u(t[i],t,o);if("throw"!==c.type){var A=c.arg,f=A.value;return f&&"object"==As(f)&&r.call(f,"__await")?e.resolve(f.__await).then((function(t){n("next",t,a,s)}),(function(t){n("throw",t,a,s)})):e.resolve(f).then((function(t){A.value=t,a(A)}),(function(t){return n("throw",t,a,s)}))}s(c.arg)}(n,o,i,a)}))}return i=i?i.then(a,a):a()}})}function E(t,e,r){var n="suspendedStart";return function(i,o){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===i)throw o;return k()}for(r.method=i,r.arg=o;;){var a=r.delegate;if(a){var s=m(a,r);if(s){if(s===f)continue;return s}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var c=u(t,e,r);if("normal"===c.type){if(n=r.done?"completed":"suspendedYield",c.arg===f)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(n="completed",r.method="throw",r.arg=c.arg)}}}function m(t,e){var r=e.method,n=t.iterator[r];if(void 0===n)return e.delegate=null,"throw"===r&&t.iterator.return&&(e.method="return",e.arg=void 0,m(t,e),"throw"===e.method)||"return"!==r&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+r+"' method")),f;var i=u(n,t.iterator,e.arg);if("throw"===i.type)return e.method="throw",e.arg=i.arg,e.delegate=null,f;var o=i.arg;return o?o.done?(e[t.resultName]=o.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,f):o:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,f)}function C(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function w(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function B(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(C,this),this.reset(!0)}function Q(t){if(t){var e=t[o];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,i=function e(){for(;++n<t.length;)if(r.call(t,n))return e.value=t[n],e.done=!1,e;return e.value=void 0,e.done=!0,e};return i.next=i}}return{next:k}}function k(){return{value:void 0,done:!0}}return l.prototype=d,n(I,"constructor",{value:d,configurable:!0}),n(d,"constructor",{value:l,configurable:!0}),l.displayName=c(d,s,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===l||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,d):(t.__proto__=d,c(t,s,"GeneratorFunction")),t.prototype=Object.create(I),t},t.awrap=function(t){return{__await:t}},b(v.prototype),c(v.prototype,a,(function(){return this})),t.AsyncIterator=v,t.async=function(e,r,n,i,o){void 0===o&&(o=Promise);var a=new v(A(e,r,n,i),o);return t.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},b(I),c(I,s,"Generator"),c(I,o,(function(){return this})),c(I,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},t.values=Q,B.prototype={constructor:B,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(w),!t)for(var e in this)"t"===e.charAt(0)&&r.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function n(r,n){return a.type="throw",a.arg=t,e.next=r,n&&(e.method="next",e.arg=void 0),!!n}for(var i=this.tryEntries.length-1;i>=0;--i){var o=this.tryEntries[i],a=o.completion;if("root"===o.tryLoc)return n("end");if(o.tryLoc<=this.prev){var s=r.call(o,"catchLoc"),c=r.call(o,"finallyLoc");if(s&&c){if(this.prev<o.catchLoc)return n(o.catchLoc,!0);if(this.prev<o.finallyLoc)return n(o.finallyLoc)}else if(s){if(this.prev<o.catchLoc)return n(o.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return n(o.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&r.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var o=i;break}}o&&("break"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc&&(o=null);var a=o?o.completion:{};return a.type=t,a.arg=e,o?(this.method="next",this.next=o.finallyLoc,f):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),f},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),w(r),f}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var i=n.arg;w(r)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:Q(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),f}},t}function fs(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,(i=n.key,o=void 0,o=function(t,e){if("object"!==As(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==As(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(i,"string"),"symbol"===As(o)?o:String(o)),n)}var i,o}function hs(t,e){return(hs=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}function ls(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=ps(t);if(e){var i=ps(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return ds(this,r)}}function ds(t,e){if(e&&("object"===As(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return gs(t)}function gs(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function ps(t){return(ps=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var ys=function(t,e,r,n){return new(r||(r=Promise))((function(i,o){function a(t){try{c(n.next(t))}catch(t){o(t)}}function s(t){try{c(n.throw(t))}catch(t){o(t)}}function c(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(a,s)}c((n=n.apply(t,e||[])).next())}))},Is=new h.b("wallet/5.7.0");var bs=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&hs(t,e)}(o,t);var e,r,n,i=ls(o);function o(t,e){var r,n;if(function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,o),r=i.call(this),null!=(n=t)&&Object(A.l)(n.privateKey,32)&&null!=n.address){var a=new Vn(t.privateKey);if(D(gs(r),"_signingKey",(function(){return a})),D(gs(r),"address",oi(r.publicKey)),r.address!==ht(t.address)&&Is.throwArgumentError("privateKey/address mismatch","privateKey","[REDACTED]"),function(t){var e=t.mnemonic;return e&&e.phrase}(t)){var s=t.mnemonic;D(gs(r),"_mnemonic",(function(){return{phrase:s.phrase,path:s.path||ga,locale:s.locale||"en"}}));var c=r.mnemonic;oi(pa.fromMnemonic(c.phrase,null,c.locale).derivePath(c.path).privateKey)!==r.address&&Is.throwArgumentError("mnemonic/address mismatch","privateKey","[REDACTED]")}else D(gs(r),"_mnemonic",(function(){return null}))}else{if(Vn.isSigningKey(t))"secp256k1"!==t.curve&&Is.throwArgumentError("unsupported curve; must be secp256k1","privateKey","[REDACTED]"),D(gs(r),"_signingKey",(function(){return t}));else{"string"==typeof t&&t.match(/^[0-9a-f]*$/i)&&64===t.length&&(t="0x"+t);var u=new Vn(t);D(gs(r),"_signingKey",(function(){return u}))}D(gs(r),"_mnemonic",(function(){return null})),D(gs(r),"address",oi(r.publicKey))}return e&&!kn.isProvider(e)&&Is.throwArgumentError("invalid provider","provider",e),D(gs(r),"provider",e||null),r}return e=o,n=[{key:"createRandom",value:function(t){var e=Object(ma.a)(16);t||(t={}),t.extraEntropy&&(e=Object(A.a)(Object(A.e)(V(Object(A.b)([e,t.extraEntropy])),0,16)));var r=ba(e,t.locale);return o.fromMnemonic(r,t.path,t.locale)}},{key:"fromEncryptedJson",value:function(t,e,r){return ss(t,e,r).then((function(t){return new o(t)}))}},{key:"fromEncryptedJsonSync",value:function(t,e){return new o(cs(t,e))}},{key:"fromMnemonic",value:function(t,e,r){return e||(e=ga),new o(pa.fromMnemonic(t,null,r).derivePath(e))}}],(r=[{key:"mnemonic",get:function(){return this._mnemonic()}},{key:"privateKey",get:function(){return this._signingKey().privateKey}},{key:"publicKey",get:function(){return this._signingKey().publicKey}},{key:"getAddress",value:function(){return Promise.resolve(this.address)}},{key:"connect",value:function(t){return new o(this,t)}},{key:"signTransaction",value:function(t){var e=this;return M(t).then((function(r){null!=r.from&&(ht(r.from)!==e.address&&Is.throwArgumentError("transaction from address mismatch","transaction.from",t.from),delete r.from);var n=e._signingKey().signDigest(V(li(r)));return li(r,n)}))}},{key:"signMessage",value:function(t){return ys(this,void 0,void 0,us().mark((function e(){return us().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",Object(A.m)(this._signingKey().signDigest(fo(t))));case 1:case"end":return e.stop()}}),e,this)})))}},{key:"_signTypedData",value:function(t,e,r){return ys(this,void 0,void 0,us().mark((function n(){var i,o=this;return us().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,xo.resolveNames(t,e,r,(function(t){return null==o.provider&&Is.throwError("cannot resolve ENS names without a provider",h.b.errors.UNSUPPORTED_OPERATION,{operation:"resolveName",value:t}),o.provider.resolveName(t)}));case 2:return i=n.sent,n.abrupt("return",Object(A.m)(this._signingKey().signDigest(xo.hash(i.domain,e,i.value))));case 4:case"end":return n.stop()}}),n,this)})))}},{key:"encrypt",value:function(t,e,r){if("function"!=typeof e||r||(r=e,e={}),r&&"function"!=typeof r)throw new Error("invalid callback");return e||(e={}),function(t,e,r,n){try{if(ht(t.address)!==oi(t.privateKey))throw new Error("address/privateKey mismatch");if(Ga(t)){var i=t.mnemonic;if(pa.fromMnemonic(i.phrase,null,i.locale).derivePath(i.path||ga).privateKey!=t.privateKey)throw new Error("mnemonic mismatch")}}catch(t){return Promise.reject(t)}"function"!=typeof r||n||(n=r,r={}),r||(r={});var o=Object(A.a)(t.privateKey),a=_a(e),s=null,c=null,u=null;if(Ga(t)){var f=t.mnemonic;s=Object(A.a)(Ia(f.phrase,f.locale||"en")),c=f.path||ga,u=f.locale||"en"}var h=r.client;h||(h="ethers.js");var l=null;l=r.salt?Object(A.a)(r.salt):Object(ma.a)(32);var d=null;if(r.iv){if(16!==(d=Object(A.a)(r.iv)).length)throw new Error("invalid iv")}else d=Object(ma.a)(16);var g=null;if(r.uuid){if(16!==(g=Object(A.a)(r.uuid)).length)throw new Error("invalid uuid")}else g=Object(ma.a)(16);var p=1<<17,y=8,I=1;return r.scrypt&&(r.scrypt.N&&(p=r.scrypt.N),r.scrypt.r&&(y=r.scrypt.r),r.scrypt.p&&(I=r.scrypt.p)),Qa.a.scrypt(a,l,p,y,I,64,n).then((function(e){var r=(e=Object(A.a)(e)).slice(0,16),n=e.slice(16,32),i=e.slice(32,64),a=new wa.a.Counter(d),f=new wa.a.ModeOfOperation.ctr(r,a),b=Object(A.a)(f.encrypt(o)),v=V(Object(A.b)([n,b])),E={address:t.address.substring(2).toLowerCase(),id:xa(g),version:3,crypto:{cipher:"aes-128-ctr",cipherparams:{iv:Object(A.i)(d).substring(2)},ciphertext:Object(A.i)(b).substring(2),kdf:"scrypt",kdfparams:{salt:Object(A.i)(l).substring(2),n:p,dklen:32,p:I,r:y},mac:v.substring(2)}};if(s){var m=Object(ma.a)(16),C=new wa.a.Counter(m),w=new wa.a.ModeOfOperation.ctr(i,C),B=Object(A.a)(w.encrypt(s)),Q=new Date,k=Q.getUTCFullYear()+"-"+Sa(Q.getUTCMonth()+1,2)+"-"+Sa(Q.getUTCDate(),2)+"T"+Sa(Q.getUTCHours(),2)+"-"+Sa(Q.getUTCMinutes(),2)+"-"+Sa(Q.getUTCSeconds(),2)+".0Z";E["x-ethers"]={client:h,gethFilename:"UTC--"+k+"--"+E.address,mnemonicCounter:Object(A.i)(m).substring(2),mnemonicCiphertext:Object(A.i)(B).substring(2),path:c,locale:u,version:"0.1"}}return JSON.stringify(E)}))}(this,t,e,r)}}])&&fs(e.prototype,r),n&&fs(e,n),Object.defineProperty(e,"prototype",{writable:!1}),o}(Gn);function vs(t,e){return ai(fo(t),e)}function Es(t,e,r,n){return ai(xo.hash(t,e,r),n)}var ms="0x0000000000000000000000000000000000000000",Cs="0x0000000000000000000000000000000000000000000000000000000000000000",ws="Ξ",Bs=new h.b("networks/5.7.1");function Qs(t){var e=function(e,r){null==r&&(r={});var n=[];if(e.InfuraProvider&&"-"!==r.infura)try{n.push(new e.InfuraProvider(t,r.infura))}catch(t){}if(e.EtherscanProvider&&"-"!==r.etherscan)try{n.push(new e.EtherscanProvider(t,r.etherscan))}catch(t){}if(e.AlchemyProvider&&"-"!==r.alchemy)try{n.push(new e.AlchemyProvider(t,r.alchemy))}catch(t){}if(e.PocketProvider&&"-"!==r.pocket){try{var i=new e.PocketProvider(t,r.pocket);i.network&&-1===["goerli","ropsten","rinkeby","sepolia"].indexOf(i.network.name)&&n.push(i)}catch(t){}}if(e.CloudflareProvider&&"-"!==r.cloudflare)try{n.push(new e.CloudflareProvider(t))}catch(t){}if(e.AnkrProvider&&"-"!==r.ankr)try{var o=new e.AnkrProvider(t,r.ankr);o.network&&-1===["ropsten"].indexOf(o.network.name)&&n.push(o)}catch(t){}if(0===n.length)return null;if(e.FallbackProvider){var a=1;return null!=r.quorum?a=r.quorum:"homestead"===t&&(a=2),new e.FallbackProvider(n,a)}return n[0]};return e.renetwork=function(t){return Qs(t)},e}function ks(t,e){var r=function(r,n){return r.JsonRpcProvider?new r.JsonRpcProvider(t,e):null};return r.renetwork=function(e){return ks(t,e)},r}var Ss={chainId:1,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"homestead",_defaultProvider:Qs("homestead")},_s={chainId:3,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"ropsten",_defaultProvider:Qs("ropsten")},Ds={chainId:63,name:"classicMordor",_defaultProvider:ks("https://www.ethercluster.com/mordor","classicMordor")},xs={unspecified:{chainId:0,name:"unspecified"},homestead:Ss,mainnet:Ss,morden:{chainId:2,name:"morden"},ropsten:_s,testnet:_s,rinkeby:{chainId:4,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"rinkeby",_defaultProvider:Qs("rinkeby")},kovan:{chainId:42,name:"kovan",_defaultProvider:Qs("kovan")},goerli:{chainId:5,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"goerli",_defaultProvider:Qs("goerli")},kintsugi:{chainId:1337702,name:"kintsugi"},sepolia:{chainId:11155111,name:"sepolia",_defaultProvider:Qs("sepolia")},classic:{chainId:61,name:"classic",_defaultProvider:ks("https://www.ethercluster.com/etc","classic")},classicMorden:{chainId:62,name:"classicMorden"},classicMordor:Ds,classicTestnet:Ds,classicKotti:{chainId:6,name:"classicKotti",_defaultProvider:ks("https://www.ethercluster.com/kotti","classicKotti")},xdai:{chainId:100,name:"xdai"},matic:{chainId:137,name:"matic",_defaultProvider:Qs("matic")},maticmum:{chainId:80001,name:"maticmum"},optimism:{chainId:10,name:"optimism",_defaultProvider:Qs("optimism")},"optimism-kovan":{chainId:69,name:"optimism-kovan"},"optimism-goerli":{chainId:420,name:"optimism-goerli"},arbitrum:{chainId:42161,name:"arbitrum"},"arbitrum-rinkeby":{chainId:421611,name:"arbitrum-rinkeby"},"arbitrum-goerli":{chainId:421613,name:"arbitrum-goerli"},bnb:{chainId:56,name:"bnb"},bnbt:{chainId:97,name:"bnbt"}};function Ms(t){if(null==t)return null;if("number"==typeof t){for(var e in xs){var r=xs[e];if(r.chainId===t)return{name:r.name,chainId:r.chainId,ensAddress:r.ensAddress||null,_defaultProvider:r._defaultProvider||null}}return{chainId:t,name:"unknown"}}if("string"==typeof t){var n=xs[t];return null==n?null:{name:n.name,chainId:n.chainId,ensAddress:n.ensAddress,_defaultProvider:n._defaultProvider||null}}var i=xs[t.name];if(!i)return"number"!=typeof t.chainId&&Bs.throwArgumentError("invalid network chainId","network",t),t;0!==t.chainId&&t.chainId!==i.chainId&&Bs.throwArgumentError("network chainId mismatch","network",t);var o,a=t._defaultProvider||null;return null==a&&i._defaultProvider&&(a=(o=i._defaultProvider)&&"function"==typeof o.renetwork?i._defaultProvider.renetwork(t):i._defaultProvider),{name:t.name,chainId:i.chainId,ensAddress:t.ensAddress||i.ensAddress||null,_defaultProvider:a}}function Rs(t){t=atob(t);for(var e=[],r=0;r<t.length;r++)e.push(t.charCodeAt(r));return Object(A.a)(e)}function Os(t){t=Object(A.a)(t);for(var e="",r=0;r<t.length;r++)e+=String.fromCharCode(t[r]);return btoa(e)}function Ns(t,e){null==e&&(e=1);var r=[],n=r.forEach;return function t(e,i){n.call(e,(function(e){i>0&&Array.isArray(e)?t(e,i-1):r.push(e)}))}(t,e),r}function Ps(t){return function(t){var e=0;return function(){return t[e++]}}(function(t){var e=0;function r(){return t[e++]<<8|t[e++]}for(var n=r(),i=1,o=[0,1],a=1;a<n;a++)o.push(i+=r());var s=r(),c=e;e+=s;var A=0,u=0;function f(){return 0==A&&(u=u<<8|t[e++],A=8),u>>--A&1}for(var h=Math.pow(2,31),l=h>>>1,d=l>>1,g=h-1,p=0,y=0;y<31;y++)p=p<<1|f();for(var I=[],b=0,v=h;;){for(var E=Math.floor(((p-b+1)*i-1)/v),m=0,C=n;C-m>1;){var w=m+C>>>1;E<o[w]?C=w:m=w}if(0==m)break;I.push(m);for(var B=b+Math.floor(v*o[m]/i),Q=b+Math.floor(v*o[m+1]/i)-1;0==((B^Q)&l);)p=p<<1&g|f(),B=B<<1&g,Q=Q<<1&g|1;for(;B&~Q&d;)p=p&l|p<<1&g>>>1|f(),B=B<<1^l,Q=(Q^l)<<1|l|1;b=B,v=1+Q-B}var k=n-4;return I.map((function(e){switch(e-k){case 3:return k+65792+(t[c++]<<16|t[c++]<<8|t[c++]);case 2:return k+256+(t[c++]<<8|t[c++]);case 1:return k+t[c++];default:return e-1}}))}(t))}function js(t){return 1&t?~t>>1:t>>1}function Ls(t,e){for(var r=Array(t),n=0,i=-1;n<t;n++)r[n]=i+=1+e();return r}function Fs(t,e){for(var r=Array(t),n=0,i=0;n<t;n++)r[n]=i+=js(e());return r}function Ts(t,e){for(var r=Ls(t(),t),n=t(),i=Ls(n,t),o=function(t,e){for(var r=Array(t),n=0;n<t;n++)r[n]=1+e();return r}(n,t),a=0;a<n;a++)for(var s=0;s<o[a];s++)r.push(i[a]+s);return e?r.map((function(t){return e[t]})):r}function Us(t,e,r){for(var n=Array(t).fill(void 0).map((function(){return[]})),i=0;i<e;i++)Fs(t,r).forEach((function(t,e){return n[e].push(t)}));return n}function Gs(t,e){var r=1+e(),n=e(),i=function(t){for(var e=[];;){var r=t();if(0==r)break;e.push(r)}return e}(e);return Ns(Us(i.length,1+t,e).map((function(t,e){var o=t[0],a=t.slice(1);return Array(i[e]).fill(void 0).map((function(t,e){var i=e*n;return[o+e*r,a.map((function(t){return t+i}))]}))})))}function Hs(t,e){return Us(1+e(),1+t,e).map((function(t){return[t[0],t.slice(1)]}))}function Ys(t){return function(t){if(Array.isArray(t))return qs(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||Ks(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Ks(t,e){if(t){if("string"==typeof t)return qs(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?qs(t,e):void 0}}function qs(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}var Js,zs,Zs=Ps(Rs("AEQF2AO2DEsA2wIrAGsBRABxAN8AZwCcAEwAqgA0AGwAUgByADcATAAVAFYAIQAyACEAKAAYAFgAGwAjABQAMAAmADIAFAAfABQAKwATACoADgAbAA8AHQAYABoAGQAxADgALAAoADwAEwA9ABMAGgARAA4ADwAWABMAFgAIAA8AHgQXBYMA5BHJAS8JtAYoAe4AExozi0UAH21tAaMnBT8CrnIyhrMDhRgDygIBUAEHcoFHUPe8AXBjAewCjgDQR8IICIcEcQLwATXCDgzvHwBmBoHNAqsBdBcUAykgDhAMShskMgo8AY8jqAQfAUAfHw8BDw87MioGlCIPBwZCa4ELatMAAMspJVgsDl8AIhckSg8XAHdvTwBcIQEiDT4OPhUqbyECAEoAS34Aej8Ybx83JgT/Xw8gHxZ/7w8RICxPHA9vBw+Pfw8PHwAPFv+fAsAvCc8vEr8ivwD/EQ8Bol8OEBa/A78hrwAPCU8vESNvvwWfHwNfAVoDHr+ZAAED34YaAdJPAK7PLwSEgDLHAGo1Pz8Pvx9fUwMrpb8O/58VTzAPIBoXIyQJNF8hpwIVAT8YGAUADDNBaX3RAMomJCg9EhUeA29MABsZBTMNJipjOhc19gcIDR8bBwQHEggCWi6DIgLuAQYA+BAFCha3A5XiAEsqM7UFFgFLhAMjFTMYE1Klnw74nRVBG/ASCm0BYRN/BrsU3VoWy+S0vV8LQx+vN8gF2AC2AK5EAWwApgYDKmAAroQ0NDQ0AT+OCg7wAAIHRAbpNgVcBV0APTA5BfbPFgMLzcYL/QqqA82eBALKCjQCjqYCht0/k2+OAsXQAoP3ASTKDgDw6ACKAUYCMpIKJpRaAE4A5womABzZvs0REEKiACIQAd5QdAECAj4Ywg/wGqY2AVgAYADYvAoCGAEubA0gvAY2ALAAbpbvqpyEAGAEpgQAJgAG7gAgAEACmghUFwCqAMpAINQIwC4DthRAAPcycKgApoIdABwBfCisABoATwBqASIAvhnSBP8aH/ECeAKXAq40NjgDBTwFYQU6AXs3oABgAD4XNgmcCY1eCl5tIFZeUqGgyoNHABgAEQAaABNwWQAmABMATPMa3T34ADldyprmM1M2XociUQgLzvwAXT3xABgAEQAaABNwIGFAnADD8AAgAD4BBJWzaCcIAIEBFMAWwKoAAdq9BWAF5wLQpALEtQAKUSGkahR4GnJM+gsAwCgeFAiUAECQ0BQuL8AAIAAAADKeIheclvFqQAAETr4iAMxIARMgAMIoHhQIAn0E0pDQFC4HhznoAAAAIAI2C0/4lvFqQAAETgBJJwYCAy4ABgYAFAA8MBKYEH4eRhTkAjYeFcgACAYAeABsOqyQ5gRwDayqugEgaIIAtgoACgDmEABmBAWGme5OBJJA2m4cDeoAmITWAXwrMgOgAGwBCh6CBXYF1Tzg1wKAAFdiuABRAFwAXQBsAG8AdgBrAHYAbwCEAHEwfxQBVE5TEQADVFhTBwBDANILAqcCzgLTApQCrQL6vAAMAL8APLhNBKkE6glGKTAU4Dr4N2EYEwBCkABKk8rHAbYBmwIoAiU4Ajf/Aq4CowCAANIChzgaNBsCsTgeODcFXrgClQKdAqQBiQGYAqsCsjTsNHsfNPA0ixsAWTWiOAMFPDQSNCk2BDZHNow2TTZUNhk28Jk9VzI3QkEoAoICoQKwAqcAQAAxBV4FXbS9BW47YkIXP1ciUqs05DS/FwABUwJW11e6nHuYZmSh/RAYA8oMKvZ8KASoUAJYWAJ6ILAsAZSoqjpgA0ocBIhmDgDWAAawRDQoAAcuAj5iAHABZiR2AIgiHgCaAU68ACxuHAG0ygM8MiZIAlgBdF4GagJqAPZOHAMuBgoATkYAsABiAHgAMLoGDPj0HpKEBAAOJgAuALggTAHWAeAMEDbd20Uege0ADwAWADkAQgA9OHd+2MUQZBBhBgNNDkxxPxUQArEPqwvqERoM1irQ090ANK4H8ANYB/ADWANYB/AH8ANYB/ADWANYA1gDWBwP8B/YxRBkD00EcgWTBZAE2wiIJk4RhgctCNdUEnQjHEwDSgEBIypJITuYMxAlR0wRTQgIATZHbKx9PQNMMbBU+pCnA9AyVDlxBgMedhKlAC8PeCE1uk6DekxxpQpQT7NX9wBFBgASqwAS5gBJDSgAUCwGPQBI4zTYABNGAE2bAE3KAExdGABKaAbgAFBXAFCOAFBJABI2SWdObALDOq0//QomCZhvwHdTBkIQHCemEPgMNAG2ATwN7kvZBPIGPATKH34ZGg/OlZ0Ipi3eDO4m5C6igFsj9iqEBe5L9TzeC05RaQ9aC2YJ5DpkgU8DIgEOIowK3g06CG4Q9ArKbA3mEUYHOgPWSZsApgcCCxIdNhW2JhFirQsKOXgG/Br3C5AmsBMqev0F1BoiBk4BKhsAANAu6IWxWjJcHU9gBgQLJiPIFKlQIQ0mQLh4SRocBxYlqgKSQ3FKiFE3HpQh9zw+DWcuFFF9B/Y8BhlQC4I8n0asRQ8R0z6OPUkiSkwtBDaALDAnjAnQD4YMunxzAVoJIgmyDHITMhEYN8YIOgcaLpclJxYIIkaWYJsE+KAD9BPSAwwFQAlCBxQDthwuEy8VKgUOgSXYAvQ21i60ApBWgQEYBcwPJh/gEFFH4Q7qCJwCZgOEJewALhUiABginAhEZABgj9lTBi7MCMhqbSN1A2gU6GIRdAeSDlgHqBw0FcAc4nDJXgyGCSiksAlcAXYJmgFgBOQICjVcjKEgQmdUi1kYnCBiQUBd/QIyDGYVoES+h3kCjA9sEhwBNgF0BzoNAgJ4Ee4RbBCWCOyGBTW2M/k6JgRQIYQgEgooA1BszwsoJvoM+WoBpBJjAw00PnfvZ6xgtyUX/gcaMsZBYSHyC5NPzgydGsIYQ1QvGeUHwAP0GvQn60FYBgADpAQUOk4z7wS+C2oIjAlAAEoOpBgH2BhrCnKM0QEyjAG4mgNYkoQCcJAGOAcMAGgMiAV65gAeAqgIpAAGANADWAA6Aq4HngAaAIZCAT4DKDABIuYCkAOUCDLMAZYwAfQqBBzEDBYA+DhuSwLDsgKAa2ajBd5ZAo8CSjYBTiYEBk9IUgOwcuIA3ABMBhTgSAEWrEvMG+REAeBwLADIAPwABjYHBkIBzgH0bgC4AWALMgmjtLYBTuoqAIQAFmwB2AKKAN4ANgCA8gFUAE4FWvoF1AJQSgESMhksWGIBvAMgATQBDgB6BsyOpsoIIARuB9QCEBwV4gLvLwe2AgMi4BPOQsYCvd9WADIXUu5eZwqoCqdeaAC0YTQHMnM9UQAPH6k+yAdy/BZIiQImSwBQ5gBQQzSaNTFWSTYBpwGqKQK38AFtqwBI/wK37gK3rQK3sAK6280C0gK33AK3zxAAUEIAUD9SklKDArekArw5AEQAzAHCO147WTteO1k7XjtZO147WTteO1kDmChYI03AVU0oJqkKbV9GYewMpw3VRMk6ShPcYFJgMxPJLbgUwhXPJVcZPhq9JwYl5VUKDwUt1GYxCC00dhe9AEApaYNCY4ceMQpMHOhTklT5LRwAskujM7ANrRsWREEFSHXuYisWDwojAmSCAmJDXE6wXDchAqH4AmiZAmYKAp+FOBwMAmY8AmYnBG8EgAN/FAN+kzkHOXgYOYM6JCQCbB4CMjc4CwJtyAJtr/CLADRoRiwBaADfAOIASwYHmQyOAP8MwwAOtgJ3MAJ2o0ACeUxEAni7Hl3cRa9G9AJ8QAJ6yQJ9CgJ88UgBSH5kJQAsFklZSlwWGErNAtECAtDNSygDiFADh+dExpEzAvKiXQQDA69Lz0wuJgTQTU1NsAKLQAKK2cIcCB5EaAa4Ao44Ao5dQZiCAo7aAo5deVG1UzYLUtVUhgKT/AKTDQDqAB1VH1WwVdEHLBwplocy4nhnRTw6ApegAu+zWCKpAFomApaQApZ9nQCqWa1aCoJOADwClrYClk9cRVzSApnMApllXMtdCBoCnJw5wzqeApwXAp+cAp65iwAeEDIrEAKd8gKekwC2PmE1YfACntQCoG8BqgKeoCACnk+mY8lkKCYsAiewAiZ/AqD8AqBN2AKmMAKlzwKoAAB+AqfzaH1osgAESmodatICrOQCrK8CrWgCrQMCVx4CVd0CseLYAx9PbJgCsr4OArLpGGzhbWRtSWADJc4Ctl08QG6RAylGArhfArlIFgK5K3hwN3DiAr0aAy2zAzISAr6JcgMDM3ICvhtzI3NQAsPMAsMFc4N0TDZGdOEDPKgDPJsDPcACxX0CxkgCxhGKAshqUgLIRQLJUALJLwJkngLd03h6YniveSZL0QMYpGcDAmH1GfSVJXsMXpNevBICz2wCz20wTFTT9BSgAMeuAs90ASrrA04TfkwGAtwoAtuLAtJQA1JdA1NgAQIDVY2AikABzBfuYUZ2AILPg44C2sgC2d+EEYRKpz0DhqYAMANkD4ZyWvoAVgLfZgLeuXR4AuIw7RUB8zEoAfScAfLTiALr9ALpcXoAAur6AurlAPpIAboC7ooC652Wq5cEAu5AA4XhmHpw4XGiAvMEAGoDjheZlAL3FAORbwOSiAL3mQL52gL4Z5odmqy8OJsfA52EAv77ARwAOp8dn7QDBY4DpmsDptoA0sYDBmuhiaIGCgMMSgFgASACtgNGAJwEgLpoBgC8BGzAEowcggCEDC6kdjoAJAM0C5IKRoABZCgiAIzw3AYBLACkfng9ogigkgNmWAN6AEQCvrkEVqTGAwCsBRbAA+4iQkMCHR072jI2PTbUNsk2RjY5NvA23TZKNiU3EDcZN5I+RTxDRTBCJkK5VBYKFhZfwQCWygU3AJBRHpu+OytgNxa61A40GMsYjsn7BVwFXQVcBV0FaAVdBVwFXQVcBV0FXAVdBVwFXUsaCNyKAK4AAQUHBwKU7oICoW1e7jAEzgPxA+YDwgCkBFDAwADABKzAAOxFLhitA1UFTDeyPkM+bj51QkRCuwTQWWQ8X+0AWBYzsACNA8xwzAGm7EZ/QisoCTAbLDs6fnLfb8H2GccsbgFw13M1HAVkBW/Jxsm9CNRO8E8FDD0FBQw9FkcClOYCoMFegpDfADgcMiA2AJQACB8AsigKAIzIEAJKeBIApY5yPZQIAKQiHb4fvj5BKSRPQrZCOz0oXyxgOywfKAnGbgMClQaCAkILXgdeCD9IIGUgQj5fPoY+dT52Ao5CM0dAX9BTVG9SDzFwWTQAbxBzJF/lOEIQQglCCkKJIAls5AcClQICoKPMODEFxhi6KSAbiyfIRrMjtCgdWCAkPlFBIitCsEJRzAbMAV/OEyQzDg0OAQQEJ36i328/Mk9AybDJsQlq3tDRApUKAkFzXf1d/j9uALYP6hCoFgCTGD8kPsFKQiobrm0+zj0KSD8kPnVCRBwMDyJRTHFgMTJa5rwXQiQ2YfI/JD7BMEJEHGINTw4TOFlIRzwJO0icMQpyPyQ+wzJCRBv6DVgnKB01NgUKj2bwYzMqCoBkznBgEF+zYDIocwRIX+NgHj4HICNfh2C4CwdwFWpTG/lgUhYGAwRfv2Ts8mAaXzVgml/XYIJfuWC4HI1gUF9pYJZgMR6ilQHMAOwLAlDRefC0in4AXAEJA6PjCwc0IamOANMMCAECRQDFNRTZBgd+CwQlRA+r6+gLBDEFBnwUBXgKATIArwAGRAAHA3cDdAN2A3kDdwN9A3oDdQN7A30DfAN4A3oDfQAYEAAlAtYASwMAUAFsAHcKAHcAmgB3AHUAdQB2AHVu8UgAygDAAHcAdQB1AHYAdQALCgB3AAsAmgB3AAsCOwB3AAtu8UgAygDAAHgKAJoAdwB3AHUAdQB2AHUAeAB1AHUAdgB1bvFIAMoAwAALCgCaAHcACwB3AAsCOwB3AAtu8UgAygDAAH4ACwGgALcBpwC6AahdAu0COwLtbvFIAMoAwAALCgCaAu0ACwLtAAsCOwLtAAtu8UgAygDAA24ACwNvAAu0VsQAAzsAABCkjUIpAAsAUIusOggWcgMeBxVsGwL67U/2HlzmWOEeOgALASvuAAseAfpKUpnpGgYJDCIZM6YyARUE9ThqAD5iXQgnAJYJPnOzw0ZAEZxEKsIAkA4DhAHnTAIDxxUDK0lxCQlPYgIvIQVYJQBVqE1GakUAKGYiDToSBA1EtAYAXQJYAIF8GgMHRyAAIAjOe9YncekRAA0KACUrjwE7Ayc6AAYWAqaiKG4McEcqANoN3+Mg9TwCBhIkuCny+JwUQ29L008JluRxu3K+oAdqiHOqFH0AG5SUIfUJ5SxCGfxdipRzqTmT4V5Zb+r1Uo4Vm+NqSSEl2mNvR2JhIa8SpYO6ntdwFXHCWTCK8f2+Hxo7uiG3drDycAuKIMP5bhi06ACnqArH1rz4Rqg//lm6SgJGEVbF9xJHISaR6HxqxSnkw6shDnelHKNEfGUXSJRJ1GcsmtJw25xrZMDK9gXSm1/YMkdX4/6NKYOdtk/NQ3/NnDASjTc3fPjIjW/5sVfVObX2oTDWkr1dF9f3kxBsD3/3aQO8hPfRz+e0uEiJqt1161griu7gz8hDDwtpy+F+BWtefnKHZPAxcZoWbnznhJpy0e842j36bcNzGnIEusgGX0a8ZxsnjcSsPDZ09yZ36fCQbriHeQ72JRMILNl6ePPf2HWoVwgWAm1fb3V2sAY0+B6rAXqSwPBgseVmoqsBTSrm91+XasMYYySI8eeRxH3ZvHkMz3BQ5aJ3iUVbYPNM3/7emRtjlsMgv/9VyTsyt/mK+8fgWeT6SoFaclXqn42dAIsvAarF5vNNWHzKSkKQ/8Hfk5ZWK7r9yliOsooyBjRhfkHP4Q2DkWXQi6FG/9r/IwbmkV5T7JSopHKn1pJwm9tb5Ot0oyN1Z2mPpKXHTxx2nlK08fKk1hEYA8WgVVWL5lgx0iTv+KdojJeU23ZDjmiubXOxVXJKKi2Wjuh2HLZOFLiSC7Tls5SMh4f+Pj6xUSrNjFqLGehRNB8lC0QSLNmkJJx/wSG3MnjE9T1CkPwJI0wH2lfzwETIiVqUxg0dfu5q39Gt+hwdcxkhhNvQ4TyrBceof3Mhs/IxFci1HmHr4FMZgXEEczPiGCx0HRwzAqDq2j9AVm1kwN0mRVLWLylgtoPNapF5cY4Y1wJh/e0BBwZj44YgZrDNqvD/9Hv7GFYdUQeDJuQ3EWI4HaKqavU1XjC/n41kT4L79kqGq0kLhdTZvgP3TA3fS0ozVz+5piZsoOtIvBUFoMKbNcmBL6YxxaUAusHB38XrS8dQMnQwJfUUkpRoGr5AUeWicvBTzyK9g77+yCkf5PAysL7r/JjcZgrbvRpMW9iyaxZvKO6ceZN2EwIxKwVFPuvFuiEPGCoagbMo+SpydLrXqBzNCDGFCrO/rkcwa2xhokQZ5CdZ0AsU3JfSqJ6n5I14YA+P/uAgfhPU84Tlw7cEFfp7AEE8ey4sP12PTt4Cods1GRgDOB5xvyiR5m+Bx8O5nBCNctU8BevfV5A08x6RHd5jcwPTMDSZJOedIZ1cGQ704lxbAzqZOP05ZxaOghzSdvFBHYqomATARyAADK4elP8Ly3IrUZKfWh23Xy20uBUmLS4Pfagu9+oyVa2iPgqRP3F2CTUsvJ7+RYnN8fFZbU/HVvxvcFFDKkiTqV5UBZ3Gz54JAKByi9hkKMZJvuGgcSYXFmw08UyoQyVdfTD1/dMkCHXcTGAKeROgArsvmRrQTLUOXioOHGK2QkjHuoYFgXciZoTJd6Fs5q1QX1G+p/e26hYsEf7QZD1nnIyl/SFkNtYYmmBhpBrxl9WbY0YpHWRuw2Ll/tj9mD8P4snVzJl4F9J+1arVeTb9E5r2ILH04qStjxQNwn3m4YNqxmaNbLAqW2TN6LidwuJRqS+NXbtqxoeDXpxeGWmxzSkWxjkyCkX4NQRme6q5SAcC+M7+9ETfA/EwrzQajKakCwYyeunP6ZFlxU2oMEn1Pz31zeStW74G406ZJFCl1wAXIoUKkWotYEpOuXB1uVNxJ63dpJEqfxBeptwIHNrPz8BllZoIcBoXwgfJ+8VAUnVPvRvexnw0Ma/WiGYuJO5y8QTvEYBigFmhUxY5RqzE8OcywN/8m4UYrlaniJO75XQ6KSo9+tWHlu+hMi0UVdiKQp7NelnoZUzNaIyBPVeOwK6GNp+FfHuPOoyhaWuNvTYFkvxscMQWDh+zeFCFkgwbXftiV23ywJ4+uwRqmg9k3KzwIQpzppt8DBBOMbrqwQM5Gb05sEwdKzMiAqOloaA/lr0KA+1pr0/+HiWoiIjHA/wir2nIuS3PeU/ji3O6ZwoxcR1SZ9FhtLC5S0FIzFhbBWcGVP/KpxOPSiUoAdWUpqKH++6Scz507iCcxYI6rdMBICPJZea7OcmeFw5mObJSiqpjg2UoWNIs+cFhyDSt6geV5qgi3FunmwwDoGSMgerFOZGX1m0dMCYo5XOruxO063dwENK9DbnVM9wYFREzh4vyU1WYYJ/LRRp6oxgjqP/X5a8/4Af6p6NWkQferzBmXme0zY/4nwMJm/wd1tIqSwGz+E3xPEAOoZlJit3XddD7/BT1pllzOx+8bmQtANQ/S6fZexc6qi3W+Q2xcmXTUhuS5mpHQRvcxZUN0S5+PL9lXWUAaRZhEH8hTdAcuNMMCuVNKTEGtSUKNi3O6KhSaTzck8csZ2vWRZ+d7mW8c4IKwXIYd25S/zIftPkwPzufjEvOHWVD1m+FjpDVUTV0DGDuHj6QnaEwLu/dEgdLQOg9E1Sro9XHJ8ykLAwtPu+pxqKDuFexqON1sKQm7rwbE1E68UCfA/erovrTCG+DBSNg0l4goDQvZN6uNlbyLpcZAwj2UclycvLpIZMgv4yRlpb3YuMftozorbcGVHt/VeDV3+Fdf1TP0iuaCsPi2G4XeGhsyF1ubVDxkoJhmniQ0/jSg/eYML9KLfnCFgISWkp91eauR3IQvED0nAPXK+6hPCYs+n3+hCZbiskmVMG2da+0EsZPonUeIY8EbfusQXjsK/eFDaosbPjEfQS0RKG7yj5GG69M7MeO1HmiUYocgygJHL6M1qzUDDwUSmr99V7Sdr2F3JjQAJY+F0yH33Iv3+C9M38eML7gTgmNu/r2bUMiPvpYbZ6v1/IaESirBHNa7mPKn4dEmYg7v/+HQgPN1G79jBQ1+soydfDC2r+h2Bl/KIc5KjMK7OH6nb1jLsNf0EHVe2KBiE51ox636uyG6Lho0t3J34L5QY/ilE3mikaF4HKXG1mG1rCevT1Vv6GavltxoQe/bMrpZvRggnBxSEPEeEzkEdOxTnPXHVjUYdw8JYvjB/o7Eegc3Ma+NUxLLnsK0kJlinPmUHzHGtrk5+CAbVzFOBqpyy3QVUnzTDfC/0XD94/okH+OB+i7g9lolhWIjSnfIb+Eq43ZXOWmwvjyV/qqD+t0e+7mTEM74qP/Ozt8nmC7mRpyu63OB4KnUzFc074SqoyPUAgM+/TJGFo6T44EHnQU4X4z6qannVqgw/U7zCpwcmXV1AubIrvOmkKHazJAR55ePjp5tLBsN8vAqs3NAHdcEHOR2xQ0lsNAFzSUuxFQCFYvXLZJdOj9p4fNq6p0HBGUik2YzaI4xySy91KzhQ0+q1hjxvImRwPRf76tChlRkhRCi74NXZ9qUNeIwP+s5p+3m5nwPdNOHgSLD79n7O9m1n1uDHiMntq4nkYwV5OZ1ENbXxFd4PgrlvavZsyUO4MqYlqqn1O8W/I1dEZq5dXhrbETLaZIbC2Kj/Aa/QM+fqUOHdf0tXAQ1huZ3cmWECWSXy/43j35+Mvq9xws7JKseriZ1pEWKc8qlzNrGPUGcVgOa9cPJYIJsGnJTAUsEcDOEVULO5x0rXBijc1lgXEzQQKhROf8zIV82w8eswc78YX11KYLWQRcgHNJElBxfXr72lS2RBSl07qTKorO2uUDZr3sFhYsvnhLZn0A94KRzJ/7DEGIAhW5ZWFpL8gEwu1aLA9MuWZzNwl8Oze9Y+bX+v9gywRVnoB5I/8kXTXU3141yRLYrIOOz6SOnyHNy4SieqzkBXharjfjqq1q6tklaEbA8Qfm2DaIPs7OTq/nvJBjKfO2H9bH2cCMh1+5gspfycu8f/cuuRmtDjyqZ7uCIMyjdV3a+p3fqmXsRx4C8lujezIFHnQiVTXLXuI1XrwN3+siYYj2HHTvESUx8DlOTXpak9qFRK+L3mgJ1WsD7F4cu1aJoFoYQnu+wGDMOjJM3kiBQWHCcvhJ/HRdxodOQp45YZaOTA22Nb4XKCVxqkbwMYFhzYQYIAnCW8FW14uf98jhUG2zrKhQQ0q0CEq0t5nXyvUyvR8DvD69LU+g3i+HFWQMQ8PqZuHD+sNKAV0+M6EJC0szq7rEr7B5bQ8BcNHzvDMc9eqB5ZCQdTf80Obn4uzjwpYU7SISdtV0QGa9D3Wrh2BDQtpBKxaNFV+/Cy2P/Sv+8s7Ud0Fd74X4+o/TNztWgETUapy+majNQ68Lq3ee0ZO48VEbTZYiH1Co4OlfWef82RWeyUXo7woM03PyapGfikTnQinoNq5z5veLpeMV3HCAMTaZmA1oGLAn7XS3XYsz+XK7VMQsc4XKrmDXOLU/pSXVNUq8dIqTba///3x6LiLS6xs1xuCAYSfcQ3+rQgmu7uvf3THKt5Ooo97TqcbRqxx7EASizaQCBQllG/rYxVapMLgtLbZS64w1MDBMXX+PQpBKNwqUKOf2DDRDUXQf9EhOS0Qj4nTmlA8dzSLz/G1d+Ud8MTy/6ghhdiLpeerGY/UlDOfiuqFsMUU5/UYlP+BAmgRLuNpvrUaLlVkrqDievNVEAwF+4CoM1MZTmjxjJMsKJq+u8Zd7tNCUFy6LiyYXRJQ4VyvEQFFaCGKsxIwQkk7EzZ6LTJq2hUuPhvAW+gQnSG6J+MszC+7QCRHcnqDdyNRJ6T9xyS87A6MDutbzKGvGktpbXqtzWtXb9HsfK2cBMomjN9a4y+TaJLnXxAeX/HWzmf4cR4vALt/P4w4qgKY04ml4ZdLOinFYS6cup3G/1ie4+t1eOnpBNlqGqs75ilzkT4+DsZQxNvaSKJ//6zIbbk/M7LOhFmRc/1R+kBtz7JFGdZm/COotIdvQoXpTqP/1uqEUmCb/QWoGLMwO5ANcHzxdY48IGP5+J+zKOTBFZ4Pid+GTM+Wq12MV/H86xEJptBa6T+p3kgpwLedManBHC2GgNrFpoN2xnrMz9WFWX/8/ygSBkavq2Uv7FdCsLEYLu9LLIvAU0bNRDtzYl+/vXmjpIvuJFYjmI0im6QEYqnIeMsNjXG4vIutIGHijeAG/9EDBozKV5cldkHbLxHh25vT+ZEzbhXlqvpzKJwcEgfNwLAKFeo0/pvEE10XDB+EXRTXtSzJozQKFFAJhMxYkVaCW+E9AL7tMeU8acxidHqzb6lX4691UsDpy/LLRmT+epgW56+5Cw8tB4kMUv6s9lh3eRKbyGs+H/4mQMaYzPTf2OOdokEn+zzgvoD3FqNKk8QqGAXVsqcGdXrT62fSPkR2vROFi68A6se86UxRUk4cajfPyCC4G5wDhD+zNq4jodQ4u4n/m37Lr36n4LIAAsVr02dFi9AiwA81MYs2rm4eDlDNmdMRvEKRHfBwW5DdMNp0jPFZMeARqF/wL4XBfd+EMLBfMzpH5GH6NaW+1vrvMdg+VxDzatk3MXgO3ro3P/DpcC6+Mo4MySJhKJhSR01SGGGp5hPWmrrUgrv3lDnP+HhcI3nt3YqBoVAVTBAQT5iuhTg8nvPtd8ZeYj6w1x6RqGUBrSku7+N1+BaasZvjTk64RoIDlL8brpEcJx3OmY7jLoZsswdtmhfC/G21llXhITOwmvRDDeTTPbyASOa16cF5/A1fZAidJpqju3wYAy9avPR1ya6eNp9K8XYrrtuxlqi+bDKwlfrYdR0RRiKRVTLOH85+ZY7XSmzRpfZBJjaTa81VDcJHpZnZnSQLASGYW9l51ZV/h7eVzTi3Hv6hUsgc/51AqJRTkpbFVLXXszoBL8nBX0u/0jBLT8nH+fJePbrwURT58OY+UieRjd1vs04w0VG5VN2U6MoGZkQzKN/ptz0Q366dxoTGmj7i1NQGHi9GgnquXFYdrCfZBmeb7s0T6yrdlZH5cZuwHFyIJ/kAtGsTg0xH5taAAq44BAk1CPk9KVVbqQzrCUiFdF/6gtlPQ8bHHc1G1W92MXGZ5HEHftyLYs8mbD/9xYRUWkHmlM0zC2ilJlnNgV4bfALpQghxOUoZL7VTqtCHIaQSXm+YUMnpkXybnV+A6xlm2CVy8fn0Xlm2XRa0+zzOa21JWWmixfiPMSCZ7qA4rS93VN3pkpF1s5TonQjisHf7iU9ZGvUPOAKZcR1pbeVf/Ul7OhepGCaId9wOtqo7pJ7yLcBZ0pFkOF28y4zEI/kcUNmutBHaQpBdNM8vjCS6HZRokkeo88TBAjGyG7SR+6vUgTcyK9Imalj0kuxz0wmK+byQU11AiJFk/ya5dNduRClcnU64yGu/ieWSeOos1t3ep+RPIWQ2pyTYVbZltTbsb7NiwSi3AV+8KLWk7LxCnfZUetEM8ThnsSoGH38/nyAwFguJp8FjvlHtcWZuU4hPva0rHfr0UhOOJ/F6vS62FW7KzkmRll2HEc7oUq4fyi5T70Vl7YVIfsPHUCdHesf9Lk7WNVWO75JDkYbMI8TOW8JKVtLY9d6UJRITO8oKo0xS+o99Yy04iniGHAaGj88kEWgwv0OrHdY/nr76DOGNS59hXCGXzTKUvDl9iKpLSWYN1lxIeyywdNpTkhay74w2jFT6NS8qkjo5CxA1yfSYwp6AJIZNKIeEK5PJAW7ORgWgwp0VgzYpqovMrWxbu+DGZ6Lhie1RAqpzm8VUzKJOH3mCzWuTOLsN3VT/dv2eeYe9UjbR8YTBsLz7q60VN1sU51k+um1f8JxD5pPhbhSC8rRaB454tmh6YUWrJI3+GWY0qeWioj/tbkYITOkJaeuGt4JrJvHA+l0Gu7kY7XOaa05alMnRWVCXqFgLIwSY4uF59Ue5SU4QKuc/HamDxbr0x6csCetXGoP7Qn1Bk/J9DsynO/UD6iZ1Hyrz+jit0hDCwi/E9OjgKTbB3ZQKQ/0ZOvevfNHG0NK4Aj3Cp7NpRk07RT1i/S0EL93Ag8GRgKI9CfpajKyK6+Jj/PI1KO5/85VAwz2AwzP8FTBb075IxCXv6T9RVvWT2tUaqxDS92zrGUbWzUYk9mSs82pECH+fkqsDt93VW++4YsR/dHCYcQSYTO/KaBMDj9LSD/J/+z20Kq8XvZUAIHtm9hRPP3ItbuAu2Hm5lkPs92pd7kCxgRs0xOVBnZ13ccdA0aunrwv9SdqElJRC3g+oCu+nXyCgmXUs9yMjTMAIHfxZV+aPKcZeUBWt057Xo85Ks1Ir5gzEHCWqZEhrLZMuF11ziGtFQUds/EESajhagzcKsxamcSZxGth4UII+adPhQkUnx2WyN+4YWR+r3f8MnkyGFuR4zjzxJS8WsQYR5PTyRaD9ixa6Mh741nBHbzfjXHskGDq179xaRNrCIB1z1xRfWfjqw2pHc1zk9xlPpL8sQWAIuETZZhbnmL54rceXVNRvUiKrrqIkeogsl0XXb17ylNb0f4GA9Wd44vffEG8FSZGHEL2fbaTGRcSiCeA8PmA/f6Hz8HCS76fXUHwgwkzSwlI71ekZ7Fapmlk/KC+Hs8hUcw3N2LN5LhkVYyizYFl/uPeVP5lsoJHhhfWvvSWruCUW1ZcJOeuTbrDgywJ/qG07gZJplnTvLcYdNaH0KMYOYMGX+rB4NGPFmQsNaIwlWrfCezxre8zXBrsMT+edVLbLqN1BqB76JH4BvZTqUIMfGwPGEn+EnmTV86fPBaYbFL3DFEhjB45CewkXEAtJxk4/Ms2pPXnaRqdky0HOYdcUcE2zcXq4vaIvW2/v0nHFJH2XXe22ueDmq/18XGtELSq85j9X8q0tcNSSKJIX8FTuJF/Pf8j5PhqG2u+osvsLxYrvvfeVJL+4tkcXcr9JV7v0ERmj/X6fM3NC4j6dS1+9Umr2oPavqiAydTZPLMNRGY23LO9zAVDly7jD+70G5TPPLdhRIl4WxcYjLnM+SNcJ26FOrkrISUtPObIz5Zb3AG612krnpy15RMW+1cQjlnWFI6538qky9axd2oJmHIHP08KyP0ubGO+TQNOYuv2uh17yCIvR8VcStw7o1g0NM60sk+8Tq7YfIBJrtp53GkvzXH7OA0p8/n/u1satf/VJhtR1l8Wa6Gmaug7haSpaCaYQax6ta0mkutlb+eAOSG1aobM81D9A4iS1RRlzBBoVX6tU1S6WE2N9ORY6DfeLRC4l9Rvr5h95XDWB2mR1d4WFudpsgVYwiTwT31ljskD8ZyDOlm5DkGh9N/UB/0AI5Xvb8ZBmai2hQ4BWMqFwYnzxwB26YHSOv9WgY3JXnvoN+2R4rqGVh/LLDMtpFP+SpMGJNWvbIl5SOodbCczW2RKleksPoUeGEzrjtKHVdtZA+kfqO+rVx/iclCqwoopepvJpSTDjT+b9GWylGRF8EDbGlw6eUzmJM95Ovoz+kwLX3c2fTjFeYEsE7vUZm3mqdGJuKh2w9/QGSaqRHs99aScGOdDqkFcACoqdbBoQqqjamhH6Q9ng39JCg3lrGJwd50Qk9ovnqBTr8MME7Ps2wiVfygUmPoUBJJfJWX5Nda0nuncbFkA==")),Vs=new Set(Ts(Zs)),Ws=new Set(Ts(Zs)),Xs=function(t){for(var e=[];;){var r=t();if(0==r)break;e.push(Gs(r,t))}for(;;){var n=t()-1;if(n<0)break;e.push(Hs(n,t))}return function(t){for(var e={},r=0;r<t.length;r++){var n=t[r];e[n[0]]=n[1]}return e}(Ns(e))}(Zs),$s=(zs=Ts(Js=Zs).sort((function(t,e){return t-e})),function t(){for(var e=[];;){var r=Ts(Js,zs);if(0==r.length)break;e.push({set:new Set(r),node:t()})}e.sort((function(t,e){return e.set.size-t.set.size}));var n=Js();return{branches:e,valid:n%3,fe0f:!!(1&(n=n/3|0)),save:1==(n>>=1),check:2==n}}());function tc(t){return St(t)}function ec(t){return t.filter((function(t){return 65039!=t}))}function rc(t){var e,r=function(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=Ks(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw o}}}}(t.split("."));try{for(r.s();!(e=r.n()).done;){var n=e.value,i=tc(n);try{for(var o=i.lastIndexOf(95)-1;o>=0;o--)if(95!==i[o])throw new Error("underscore only allowed at start");if(i.length>=4&&i.every((function(t){return t<128}))&&45===i[2]&&45===i[3])throw new Error("invalid label extension")}catch(t){throw new Error('Invalid label "'.concat(n,'": ').concat(t.message))}}}catch(t){r.e(t)}finally{r.f()}return t}function nc(t){return rc(function(t,e){var r=tc(t).reverse(),n=[];for(;r.length;){var i=ic(r);if(i)n.push.apply(n,Ys(e(i)));else{var o=r.pop();if(Vs.has(o))n.push(o);else if(!Ws.has(o)){var a=Xs[o];if(!a)throw new Error("Disallowed codepoint: 0x".concat(o.toString(16).toUpperCase()));n.push.apply(n,Ys(a))}}}return rc((s=String.fromCodePoint.apply(String,n),s.normalize("NFC")));var s}(t,ec))}function ic(t,e){var r,n,i,o=$s,a=[],s=t.length;e&&(e.length=0);for(var c=function(){var c=t[--s];if(!(o=null===(r=o.branches.find((function(t){return t.set.has(c)})))||void 0===r?void 0:r.node))return"break";if(o.save)i=c;else if(o.check&&c===i)return"break";a.push(c),o.fe0f&&(a.push(65039),s>0&&65039==t[s-1]&&s--),o.valid&&(n=a.slice(),2==o.valid&&n.splice(1,1),e&&e.push.apply(e,Ys(t.slice(s).reverse())),t.length=s)};s;){if("break"===c())break}return n}var oc=new h.b("hash/5.7.0"),ac=new Uint8Array(32);function sc(t){if(0===t.length)throw new Error("invalid ENS name; empty component");return t}function cc(t){var e=Ct(nc(t)),r=[];if(0===t.length)return r;for(var n=0,i=0;i<e.length;i++){46===e[i]&&(r.push(sc(e.slice(n,i))),n=i+1)}if(n>=e.length)throw new Error("invalid ENS name; empty component");return r.push(sc(e.slice(n))),r}function Ac(t){try{return 0!==cc(t).length}catch(t){}return!1}function uc(t){"string"!=typeof t&&oc.throwArgumentError("invalid ENS name; not a string","name",t);for(var e=ac,r=cc(t);r.length;)e=V(Object(A.b)([e,V(r.pop())]));return Object(A.i)(e)}function fc(t){return Object(A.i)(Object(A.b)(cc(t).map((function(t){if(t.length>63)throw new Error("invalid DNS encoded entry; length exceeds 63 bytes");var e=new Uint8Array(t.length+1);return e.set(t,1),e[0]=e.length-1,e}))))+"00"}ac.fill(0);function hc(t){return(hc="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function lc(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */lc=function(){return t};var t={},e=Object.prototype,r=e.hasOwnProperty,n=Object.defineProperty||function(t,e,r){t[e]=r.value},i="function"==typeof Symbol?Symbol:{},o=i.iterator||"@@iterator",a=i.asyncIterator||"@@asyncIterator",s=i.toStringTag||"@@toStringTag";function c(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{c({},"")}catch(t){c=function(t,e,r){return t[e]=r}}function A(t,e,r,i){var o=e&&e.prototype instanceof h?e:h,a=Object.create(o.prototype),s=new B(i||[]);return n(a,"_invoke",{value:E(t,r,s)}),a}function u(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=A;var f={};function h(){}function l(){}function d(){}var g={};c(g,o,(function(){return this}));var p=Object.getPrototypeOf,y=p&&p(p(Q([])));y&&y!==e&&r.call(y,o)&&(g=y);var I=d.prototype=h.prototype=Object.create(g);function b(t){["next","throw","return"].forEach((function(e){c(t,e,(function(t){return this._invoke(e,t)}))}))}function v(t,e){var i;n(this,"_invoke",{value:function(n,o){function a(){return new e((function(i,a){!function n(i,o,a,s){var c=u(t[i],t,o);if("throw"!==c.type){var A=c.arg,f=A.value;return f&&"object"==hc(f)&&r.call(f,"__await")?e.resolve(f.__await).then((function(t){n("next",t,a,s)}),(function(t){n("throw",t,a,s)})):e.resolve(f).then((function(t){A.value=t,a(A)}),(function(t){return n("throw",t,a,s)}))}s(c.arg)}(n,o,i,a)}))}return i=i?i.then(a,a):a()}})}function E(t,e,r){var n="suspendedStart";return function(i,o){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===i)throw o;return k()}for(r.method=i,r.arg=o;;){var a=r.delegate;if(a){var s=m(a,r);if(s){if(s===f)continue;return s}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var c=u(t,e,r);if("normal"===c.type){if(n=r.done?"completed":"suspendedYield",c.arg===f)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(n="completed",r.method="throw",r.arg=c.arg)}}}function m(t,e){var r=e.method,n=t.iterator[r];if(void 0===n)return e.delegate=null,"throw"===r&&t.iterator.return&&(e.method="return",e.arg=void 0,m(t,e),"throw"===e.method)||"return"!==r&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+r+"' method")),f;var i=u(n,t.iterator,e.arg);if("throw"===i.type)return e.method="throw",e.arg=i.arg,e.delegate=null,f;var o=i.arg;return o?o.done?(e[t.resultName]=o.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,f):o:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,f)}function C(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function w(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function B(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(C,this),this.reset(!0)}function Q(t){if(t){var e=t[o];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,i=function e(){for(;++n<t.length;)if(r.call(t,n))return e.value=t[n],e.done=!1,e;return e.value=void 0,e.done=!0,e};return i.next=i}}return{next:k}}function k(){return{value:void 0,done:!0}}return l.prototype=d,n(I,"constructor",{value:d,configurable:!0}),n(d,"constructor",{value:l,configurable:!0}),l.displayName=c(d,s,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===l||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,d):(t.__proto__=d,c(t,s,"GeneratorFunction")),t.prototype=Object.create(I),t},t.awrap=function(t){return{__await:t}},b(v.prototype),c(v.prototype,a,(function(){return this})),t.AsyncIterator=v,t.async=function(e,r,n,i,o){void 0===o&&(o=Promise);var a=new v(A(e,r,n,i),o);return t.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},b(I),c(I,s,"Generator"),c(I,o,(function(){return this})),c(I,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},t.values=Q,B.prototype={constructor:B,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(w),!t)for(var e in this)"t"===e.charAt(0)&&r.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function n(r,n){return a.type="throw",a.arg=t,e.next=r,n&&(e.method="next",e.arg=void 0),!!n}for(var i=this.tryEntries.length-1;i>=0;--i){var o=this.tryEntries[i],a=o.completion;if("root"===o.tryLoc)return n("end");if(o.tryLoc<=this.prev){var s=r.call(o,"catchLoc"),c=r.call(o,"finallyLoc");if(s&&c){if(this.prev<o.catchLoc)return n(o.catchLoc,!0);if(this.prev<o.finallyLoc)return n(o.finallyLoc)}else if(s){if(this.prev<o.catchLoc)return n(o.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return n(o.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&r.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var o=i;break}}o&&("break"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc&&(o=null);var a=o?o.completion:{};return a.type=t,a.arg=e,o?(this.method="next",this.next=o.finallyLoc,f):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),f},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),w(r),f}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var i=n.arg;w(r)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:Q(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),f}},t}var dc=function(t,e,r,n){return new(r||(r=Promise))((function(i,o){function a(t){try{c(n.next(t))}catch(t){o(t)}}function s(t){try{c(n.throw(t))}catch(t){o(t)}}function c(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(a,s)}c((n=n.apply(t,e||[])).next())}))};function gc(t,e){return dc(this,void 0,void 0,lc().mark((function r(){var n,i,o,a,s;return lc().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return null==e&&(e={}),n={method:e.method||"GET",headers:e.headers||{},body:e.body||void 0},!0!==e.skipFetchSetup&&(n.mode="cors",n.cache="no-cache",n.credentials="same-origin",n.redirect="follow",n.referrer="client"),null!=e.fetchOptions&&((i=e.fetchOptions).mode&&(n.mode=i.mode),i.cache&&(n.cache=i.cache),i.credentials&&(n.credentials=i.credentials),i.redirect&&(n.redirect=i.redirect),i.referrer&&(n.referrer=i.referrer)),r.next=7,fetch(t,n);case 7:return o=r.sent,r.next=10,o.arrayBuffer();case 10:return a=r.sent,s={},o.headers.forEach?o.headers.forEach((function(t,e){s[e.toLowerCase()]=t})):o.headers.keys().forEach((function(t){s[t.toLowerCase()]=o.headers.get(t)})),r.abrupt("return",{headers:s,statusCode:o.status,statusMessage:o.statusText,body:Object(A.a)(new Uint8Array(a))});case 14:case"end":return r.stop()}}),r)})))}function pc(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */pc=function(){return t};var t={},e=Object.prototype,r=e.hasOwnProperty,n=Object.defineProperty||function(t,e,r){t[e]=r.value},i="function"==typeof Symbol?Symbol:{},o=i.iterator||"@@iterator",a=i.asyncIterator||"@@asyncIterator",s=i.toStringTag||"@@toStringTag";function c(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{c({},"")}catch(t){c=function(t,e,r){return t[e]=r}}function A(t,e,r,i){var o=e&&e.prototype instanceof h?e:h,a=Object.create(o.prototype),s=new B(i||[]);return n(a,"_invoke",{value:E(t,r,s)}),a}function u(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=A;var f={};function h(){}function l(){}function d(){}var g={};c(g,o,(function(){return this}));var p=Object.getPrototypeOf,y=p&&p(p(Q([])));y&&y!==e&&r.call(y,o)&&(g=y);var I=d.prototype=h.prototype=Object.create(g);function b(t){["next","throw","return"].forEach((function(e){c(t,e,(function(t){return this._invoke(e,t)}))}))}function v(t,e){var i;n(this,"_invoke",{value:function(n,o){function a(){return new e((function(i,a){!function n(i,o,a,s){var c=u(t[i],t,o);if("throw"!==c.type){var A=c.arg,f=A.value;return f&&"object"==yc(f)&&r.call(f,"__await")?e.resolve(f.__await).then((function(t){n("next",t,a,s)}),(function(t){n("throw",t,a,s)})):e.resolve(f).then((function(t){A.value=t,a(A)}),(function(t){return n("throw",t,a,s)}))}s(c.arg)}(n,o,i,a)}))}return i=i?i.then(a,a):a()}})}function E(t,e,r){var n="suspendedStart";return function(i,o){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===i)throw o;return k()}for(r.method=i,r.arg=o;;){var a=r.delegate;if(a){var s=m(a,r);if(s){if(s===f)continue;return s}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var c=u(t,e,r);if("normal"===c.type){if(n=r.done?"completed":"suspendedYield",c.arg===f)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(n="completed",r.method="throw",r.arg=c.arg)}}}function m(t,e){var r=e.method,n=t.iterator[r];if(void 0===n)return e.delegate=null,"throw"===r&&t.iterator.return&&(e.method="return",e.arg=void 0,m(t,e),"throw"===e.method)||"return"!==r&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+r+"' method")),f;var i=u(n,t.iterator,e.arg);if("throw"===i.type)return e.method="throw",e.arg=i.arg,e.delegate=null,f;var o=i.arg;return o?o.done?(e[t.resultName]=o.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,f):o:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,f)}function C(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function w(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function B(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(C,this),this.reset(!0)}function Q(t){if(t){var e=t[o];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,i=function e(){for(;++n<t.length;)if(r.call(t,n))return e.value=t[n],e.done=!1,e;return e.value=void 0,e.done=!0,e};return i.next=i}}return{next:k}}function k(){return{value:void 0,done:!0}}return l.prototype=d,n(I,"constructor",{value:d,configurable:!0}),n(d,"constructor",{value:l,configurable:!0}),l.displayName=c(d,s,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===l||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,d):(t.__proto__=d,c(t,s,"GeneratorFunction")),t.prototype=Object.create(I),t},t.awrap=function(t){return{__await:t}},b(v.prototype),c(v.prototype,a,(function(){return this})),t.AsyncIterator=v,t.async=function(e,r,n,i,o){void 0===o&&(o=Promise);var a=new v(A(e,r,n,i),o);return t.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},b(I),c(I,s,"Generator"),c(I,o,(function(){return this})),c(I,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},t.values=Q,B.prototype={constructor:B,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(w),!t)for(var e in this)"t"===e.charAt(0)&&r.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function n(r,n){return a.type="throw",a.arg=t,e.next=r,n&&(e.method="next",e.arg=void 0),!!n}for(var i=this.tryEntries.length-1;i>=0;--i){var o=this.tryEntries[i],a=o.completion;if("root"===o.tryLoc)return n("end");if(o.tryLoc<=this.prev){var s=r.call(o,"catchLoc"),c=r.call(o,"finallyLoc");if(s&&c){if(this.prev<o.catchLoc)return n(o.catchLoc,!0);if(this.prev<o.finallyLoc)return n(o.finallyLoc)}else if(s){if(this.prev<o.catchLoc)return n(o.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return n(o.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&r.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var o=i;break}}o&&("break"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc&&(o=null);var a=o?o.completion:{};return a.type=t,a.arg=e,o?(this.method="next",this.next=o.finallyLoc,f):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),f},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),w(r),f}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var i=n.arg;w(r)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:Q(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),f}},t}function yc(t){return(yc="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var Ic=function(t,e,r,n){return new(r||(r=Promise))((function(i,o){function a(t){try{c(n.next(t))}catch(t){o(t)}}function s(t){try{c(n.throw(t))}catch(t){o(t)}}function c(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(a,s)}c((n=n.apply(t,e||[])).next())}))},bc=new h.b("web/5.7.1");function vc(t){return new Promise((function(e){setTimeout(e,t)}))}function Ec(t,e){if(null==t)return null;if("string"==typeof t)return t;if(Object(A.k)(t)){if(e&&("text"===e.split("/")[0]||"application/json"===e.split(";")[0].trim()))try{return kt(t)}catch(t){}return Object(A.i)(t)}return t}function mc(t,e,r){var n="object"===yc(t)&&null!=t.throttleLimit?t.throttleLimit:12;bc.assertArgument(n>0&&n%1==0,"invalid connection throttle limit","connection.throttleLimit",n);var i="object"===yc(t)?t.throttleCallback:null,o="object"===yc(t)&&"number"==typeof t.throttleSlotInterval?t.throttleSlotInterval:100;bc.assertArgument(o>0&&o%1==0,"invalid connection throttle slot interval","connection.throttleSlotInterval",o);var a="object"===yc(t)&&!!t.errorPassThrough,s={},c=null,A={method:"GET"},u=!1,f=12e4;if("string"==typeof t)c=t;else if("object"===yc(t)){if(null!=t&&null!=t.url||bc.throwArgumentError("missing URL","connection.url",t),c=t.url,"number"==typeof t.timeout&&t.timeout>0&&(f=t.timeout),t.headers)for(var l in t.headers)s[l.toLowerCase()]={key:l,value:String(t.headers[l])},["if-none-match","if-modified-since"].indexOf(l.toLowerCase())>=0&&(u=!0);if(A.allowGzip=!!t.allowGzip,null!=t.user&&null!=t.password){"https:"!==c.substring(0,6)&&!0!==t.allowInsecureAuthentication&&bc.throwError("basic authentication requires a secure https url",h.b.errors.INVALID_ARGUMENT,{argument:"url",url:c,user:t.user,password:"[REDACTED]"});var d=t.user+":"+t.password;s.authorization={key:"Authorization",value:"Basic "+Os(Ct(d))}}null!=t.skipFetchSetup&&(A.skipFetchSetup=!!t.skipFetchSetup),null!=t.fetchOptions&&(A.fetchOptions=O(t.fetchOptions))}var g,p=new RegExp("^data:([^;:]*)?(;base64)?,(.*)$","i"),y=c?c.match(p):null;if(y)try{var I={statusCode:200,statusMessage:"OK",headers:{"content-type":y[1]||"text/plain"},body:y[2]?Rs(y[3]):(g=y[3],Ct(g.replace(/%([0-9a-f][0-9a-f])/gi,(function(t,e){return String.fromCharCode(parseInt(e,16))}))))},b=I.body;return r&&(b=r(I.body,I)),Promise.resolve(b)}catch(t){bc.throwError("processing response error",h.b.errors.SERVER_ERROR,{body:Ec(y[1],y[2]),error:t,requestBody:null,requestMethod:"GET",url:c})}e&&(A.method="POST",A.body=e,null==s["content-type"]&&(s["content-type"]={key:"Content-Type",value:"application/octet-stream"}),null==s["content-length"]&&(s["content-length"]={key:"Content-Length",value:String(e.length)}));var v={};Object.keys(s).forEach((function(t){var e=s[t];v[e.key]=e.value})),A.headers=v;var E,m=(E=null,{promise:new Promise((function(t,e){f&&(E=setTimeout((function(){null!=E&&(E=null,e(bc.makeError("timeout",h.b.errors.TIMEOUT,{requestBody:Ec(A.body,v["content-type"]),requestMethod:A.method,timeout:f,url:c})))}),f))})),cancel:function(){null!=E&&(clearTimeout(E),E=null)}}),C=function(){return Ic(this,void 0,void 0,pc().mark((function t(){var e,s,f,l,d,g,p,y,I,b;return pc().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:e=0;case 1:if(!(e<n)){t.next=65;break}return s=null,t.prev=3,t.next=6,gc(c,A);case 6:if(s=t.sent,!(e<n)){t.next=28;break}if(301!==s.statusCode&&302!==s.statusCode){t.next=15;break}if(f=s.headers.location||"","GET"!==A.method||!f.match(/^https:/)){t.next=13;break}return c=s.headers.location,t.abrupt("continue",62);case 13:t.next=28;break;case 15:if(429!==s.statusCode){t.next=28;break}if(l=!0,!i){t.next=21;break}return t.next=20,i(e,c);case 20:l=t.sent;case 21:if(!l){t.next=28;break}return d=0,g=s.headers["retry-after"],d="string"==typeof g&&g.match(/^[1-9][0-9]*$/)?1e3*parseInt(g):o*parseInt(String(Math.random()*Math.pow(2,e))),t.next=27,vc(d);case 27:return t.abrupt("continue",62);case 28:t.next=34;break;case 30:t.prev=30,t.t0=t.catch(3),null==(s=t.t0.response)&&(m.cancel(),bc.throwError("missing response",h.b.errors.SERVER_ERROR,{requestBody:Ec(A.body,v["content-type"]),requestMethod:A.method,serverError:t.t0,url:c}));case 34:if(p=s.body,u&&304===s.statusCode?p=null:!a&&(s.statusCode<200||s.statusCode>=300)&&(m.cancel(),bc.throwError("bad response",h.b.errors.SERVER_ERROR,{status:s.statusCode,headers:s.headers,body:Ec(p,s.headers?s.headers["content-type"]:null),requestBody:Ec(A.body,v["content-type"]),requestMethod:A.method,url:c})),!r){t.next=60;break}return t.prev=37,t.next=40,r(p,s);case 40:return y=t.sent,m.cancel(),t.abrupt("return",y);case 45:if(t.prev=45,t.t1=t.catch(37),!(t.t1.throttleRetry&&e<n)){t.next=58;break}if(I=!0,!i){t.next=53;break}return t.next=52,i(e,c);case 52:I=t.sent;case 53:if(!I){t.next=58;break}return b=o*parseInt(String(Math.random()*Math.pow(2,e))),t.next=57,vc(b);case 57:return t.abrupt("continue",62);case 58:m.cancel(),bc.throwError("processing response error",h.b.errors.SERVER_ERROR,{body:Ec(p,s.headers?s.headers["content-type"]:null),error:t.t1,requestBody:Ec(A.body,v["content-type"]),requestMethod:A.method,url:c});case 60:return m.cancel(),t.abrupt("return",p);case 62:e++,t.next=1;break;case 65:return t.abrupt("return",bc.throwError("failed response",h.b.errors.SERVER_ERROR,{requestBody:Ec(A.body,v["content-type"]),requestMethod:A.method,url:c}));case 66:case"end":return t.stop()}}),t,null,[[3,30],[37,45]])})))}();return Promise.race([m.promise,C])}function Cc(t,e,r){var n=null;if(null!=e){n=Ct(e);var i="string"==typeof t?{url:t}:O(t);if(i.headers)0!==Object.keys(i.headers).filter((function(t){return"content-type"===t.toLowerCase()})).length||(i.headers=O(i.headers),i.headers["content-type"]="application/json");else i.headers={"content-type":"application/json"};t=i}return mc(t,n,(function(t,e){var n=null;if(null!=t)try{n=JSON.parse(kt(t))}catch(e){bc.throwError("invalid JSON",h.b.errors.SERVER_ERROR,{body:t,error:e})}return r&&(n=r(n,e)),n}))}function wc(t,e){return e||(e={}),null==(e=O(e)).floor&&(e.floor=0),null==e.ceiling&&(e.ceiling=1e4),null==e.interval&&(e.interval=250),new Promise((function(r,n){var i=null,o=!1,a=function(){return!o&&(o=!0,i&&clearTimeout(i),!0)};e.timeout&&(i=setTimeout((function(){a()&&n(new Error("timeout"))}),e.timeout));var s=e.retryLimit,c=0;!function i(){return t().then((function(t){if(void 0!==t)a()&&r(t);else if(e.oncePoll)e.oncePoll.once("poll",i);else if(e.onceBlock)e.onceBlock.once("block",i);else if(!o){if(++c>s)return void(a()&&n(new Error("retry limit reached")));var A=e.interval*parseInt(String(Math.random()*Math.pow(2,c)));A<e.floor&&(A=e.floor),A>e.ceiling&&(A=e.ceiling),setTimeout(i,A)}return null}),(function(t){a()&&n(t)}))}()}))}var Bc=r(80),Qc=r.n(Bc);function kc(t){return(kc="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Sc(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,(i=n.key,o=void 0,o=function(t,e){if("object"!==kc(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==kc(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(i,"string"),"symbol"===kc(o)?o:String(o)),n)}var i,o}var _c=new h.b("providers/5.7.2"),Dc=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.formats=this.getDefaultFormats()}var e,r,n;return e=t,n=[{key:"check",value:function(t,e){var r={};for(var n in t)try{var i=t[n](e[n]);void 0!==i&&(r[n]=i)}catch(t){throw t.checkKey=n,t.checkValue=e[n],t}return r}},{key:"allowNull",value:function(t,e){return function(r){return null==r?e:t(r)}}},{key:"allowFalsish",value:function(t,e){return function(r){return r?t(r):e}}},{key:"arrayOf",value:function(t){return function(e){if(!Array.isArray(e))throw new Error("not an array");var r=[];return e.forEach((function(e){r.push(t(e))})),r}}}],(r=[{key:"getDefaultFormats",value:function(){var e=this,r={},n=this.address.bind(this),i=this.bigNumber.bind(this),o=this.blockTag.bind(this),a=this.data.bind(this),s=this.hash.bind(this),c=this.hex.bind(this),A=this.number.bind(this),u=this.type.bind(this);return r.transaction={hash:s,type:u,accessList:t.allowNull(this.accessList.bind(this),null),blockHash:t.allowNull(s,null),blockNumber:t.allowNull(A,null),transactionIndex:t.allowNull(A,null),confirmations:t.allowNull(A,null),from:n,gasPrice:t.allowNull(i),maxPriorityFeePerGas:t.allowNull(i),maxFeePerGas:t.allowNull(i),gasLimit:i,to:t.allowNull(n,null),value:i,nonce:A,data:a,r:t.allowNull(this.uint256),s:t.allowNull(this.uint256),v:t.allowNull(A),creates:t.allowNull(n,null),raw:t.allowNull(a)},r.transactionRequest={from:t.allowNull(n),nonce:t.allowNull(A),gasLimit:t.allowNull(i),gasPrice:t.allowNull(i),maxPriorityFeePerGas:t.allowNull(i),maxFeePerGas:t.allowNull(i),to:t.allowNull(n),value:t.allowNull(i),data:t.allowNull((function(t){return e.data(t,!0)})),type:t.allowNull(A),accessList:t.allowNull(this.accessList.bind(this),null)},r.receiptLog={transactionIndex:A,blockNumber:A,transactionHash:s,address:n,topics:t.arrayOf(s),data:a,logIndex:A,blockHash:s},r.receipt={to:t.allowNull(this.address,null),from:t.allowNull(this.address,null),contractAddress:t.allowNull(n,null),transactionIndex:A,root:t.allowNull(c),gasUsed:i,logsBloom:t.allowNull(a),blockHash:s,transactionHash:s,logs:t.arrayOf(this.receiptLog.bind(this)),blockNumber:A,confirmations:t.allowNull(A,null),cumulativeGasUsed:i,effectiveGasPrice:t.allowNull(i),status:t.allowNull(A),type:u},r.block={hash:t.allowNull(s),parentHash:s,number:A,timestamp:A,nonce:t.allowNull(c),difficulty:this.difficulty.bind(this),gasLimit:i,gasUsed:i,miner:t.allowNull(n),extraData:a,transactions:t.allowNull(t.arrayOf(s)),baseFeePerGas:t.allowNull(i)},r.blockWithTransactions=O(r.block),r.blockWithTransactions.transactions=t.allowNull(t.arrayOf(this.transactionResponse.bind(this))),r.filter={fromBlock:t.allowNull(o,void 0),toBlock:t.allowNull(o,void 0),blockHash:t.allowNull(s,void 0),address:t.allowNull(n,void 0),topics:t.allowNull(this.topics.bind(this),void 0)},r.filterLog={blockNumber:t.allowNull(A),blockHash:t.allowNull(s),transactionIndex:A,removed:t.allowNull(this.boolean.bind(this)),address:n,data:t.allowFalsish(a,"0x"),topics:t.arrayOf(s),transactionHash:s,logIndex:A},r}},{key:"accessList",value:function(t){return Ai(t||[])}},{key:"number",value:function(t){return"0x"===t?0:b.from(t).toNumber()}},{key:"type",value:function(t){return"0x"===t||null==t?0:b.from(t).toNumber()}},{key:"bigNumber",value:function(t){return b.from(t)}},{key:"boolean",value:function(t){if("boolean"==typeof t)return t;if("string"==typeof t){if("true"===(t=t.toLowerCase()))return!0;if("false"===t)return!1}throw new Error("invalid boolean - "+t)}},{key:"hex",value:function(t,e){return"string"==typeof t&&(e||"0x"===t.substring(0,2)||(t="0x"+t),Object(A.l)(t))?t.toLowerCase():_c.throwArgumentError("invalid hash","value",t)}},{key:"data",value:function(t,e){var r=this.hex(t,e);if(r.length%2!=0)throw new Error("invalid data; odd-length - "+t);return r}},{key:"address",value:function(t){return ht(t)}},{key:"callAddress",value:function(t){if(!Object(A.l)(t,32))return null;var e=ht(Object(A.e)(t,12));return e===ms?null:e}},{key:"contractAddress",value:function(t){return gt(t)}},{key:"blockTag",value:function(t){if(null==t)return"latest";if("earliest"===t)return"0x0";switch(t){case"earliest":return"0x0";case"latest":case"pending":case"safe":case"finalized":return t}if("number"==typeof t||Object(A.l)(t))return Object(A.g)(t);throw new Error("invalid blockTag")}},{key:"hash",value:function(t,e){var r=this.hex(t,e);return 32!==Object(A.d)(r)?_c.throwArgumentError("invalid hash","value",t):r}},{key:"difficulty",value:function(t){if(null==t)return null;var e=b.from(t);try{return e.toNumber()}catch(t){}return null}},{key:"uint256",value:function(t){if(!Object(A.l)(t))throw new Error("invalid uint256");return Object(A.h)(t,32)}},{key:"_block",value:function(e,r){null!=e.author&&null==e.miner&&(e.miner=e.author);var n=null!=e._difficulty?e._difficulty:e.difficulty,i=t.check(r,e);return i._difficulty=null==n?null:b.from(n),i}},{key:"block",value:function(t){return this._block(t,this.formats.block)}},{key:"blockWithTransactions",value:function(t){return this._block(t,this.formats.blockWithTransactions)}},{key:"transactionRequest",value:function(e){return t.check(this.formats.transactionRequest,e)}},{key:"transactionResponse",value:function(e){null!=e.gas&&null==e.gasLimit&&(e.gasLimit=e.gas),e.to&&b.from(e.to).isZero()&&(e.to="0x0000000000000000000000000000000000000000"),null!=e.input&&null==e.data&&(e.data=e.input),null==e.to&&null==e.creates&&(e.creates=this.contractAddress(e)),1!==e.type&&2!==e.type||null!=e.accessList||(e.accessList=[]);var r=t.check(this.formats.transaction,e);if(null!=e.chainId){var n=e.chainId;Object(A.l)(n)&&(n=b.from(n).toNumber()),r.chainId=n}else{var i=e.networkId;null==i&&null==r.v&&(i=e.chainId),Object(A.l)(i)&&(i=b.from(i).toNumber()),"number"!=typeof i&&null!=r.v&&((i=(r.v-35)/2)<0&&(i=0),i=parseInt(i)),"number"!=typeof i&&(i=0),r.chainId=i}return r.blockHash&&"x"===r.blockHash.replace(/0/g,"")&&(r.blockHash=null),r}},{key:"transaction",value:function(t){return gi(t)}},{key:"receiptLog",value:function(e){return t.check(this.formats.receiptLog,e)}},{key:"receipt",value:function(e){var r=t.check(this.formats.receipt,e);if(null!=r.root)if(r.root.length<=4){var n=b.from(r.root).toNumber();0===n||1===n?(null!=r.status&&r.status!==n&&_c.throwArgumentError("alt-root-status/status mismatch","value",{root:r.root,status:r.status}),r.status=n,delete r.root):_c.throwArgumentError("invalid alt-root-status","value.root",r.root)}else 66!==r.root.length&&_c.throwArgumentError("invalid root hash","value.root",r.root);return null!=r.status&&(r.byzantium=!0),r}},{key:"topics",value:function(t){var e=this;return Array.isArray(t)?t.map((function(t){return e.topics(t)})):null!=t?this.hash(t,!0):null}},{key:"filter",value:function(e){return t.check(this.formats.filter,e)}},{key:"filterLog",value:function(e){return t.check(this.formats.filterLog,e)}}])&&Sc(e.prototype,r),n&&Sc(e,n),Object.defineProperty(e,"prototype",{writable:!1}),t}();function xc(t){return t&&"function"==typeof t.isCommunityResource}function Mc(t){return xc(t)&&t.isCommunityResource()}var Rc=!1;function Oc(){Rc||(Rc=!0,console.log("========= NOTICE ========="),console.log("Request-Rate Exceeded (this message will not be repeated)"),console.log(""),console.log("The default API keys for each service are provided as a highly-throttled,"),console.log("community resource for low-traffic projects and early prototyping."),console.log(""),console.log("While your application will continue to function, we highly recommended"),console.log("signing up for your own API keys to improve performance, increase your"),console.log("request rate/limit and enable other perks, such as metrics and advanced APIs."),console.log(""),console.log("For more details: https://docs.ethers.io/api-keys/"),console.log("=========================="))}function Nc(t,e){return(Nc=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}function Pc(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=Fc(t);if(e){var i=Fc(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return jc(this,r)}}function jc(t,e){if(e&&("object"===Yc(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return Lc(t)}function Lc(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Fc(t){return(Fc=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function Tc(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */Tc=function(){return t};var t={},e=Object.prototype,r=e.hasOwnProperty,n=Object.defineProperty||function(t,e,r){t[e]=r.value},i="function"==typeof Symbol?Symbol:{},o=i.iterator||"@@iterator",a=i.asyncIterator||"@@asyncIterator",s=i.toStringTag||"@@toStringTag";function c(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{c({},"")}catch(t){c=function(t,e,r){return t[e]=r}}function A(t,e,r,i){var o=e&&e.prototype instanceof h?e:h,a=Object.create(o.prototype),s=new B(i||[]);return n(a,"_invoke",{value:E(t,r,s)}),a}function u(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=A;var f={};function h(){}function l(){}function d(){}var g={};c(g,o,(function(){return this}));var p=Object.getPrototypeOf,y=p&&p(p(Q([])));y&&y!==e&&r.call(y,o)&&(g=y);var I=d.prototype=h.prototype=Object.create(g);function b(t){["next","throw","return"].forEach((function(e){c(t,e,(function(t){return this._invoke(e,t)}))}))}function v(t,e){var i;n(this,"_invoke",{value:function(n,o){function a(){return new e((function(i,a){!function n(i,o,a,s){var c=u(t[i],t,o);if("throw"!==c.type){var A=c.arg,f=A.value;return f&&"object"==Yc(f)&&r.call(f,"__await")?e.resolve(f.__await).then((function(t){n("next",t,a,s)}),(function(t){n("throw",t,a,s)})):e.resolve(f).then((function(t){A.value=t,a(A)}),(function(t){return n("throw",t,a,s)}))}s(c.arg)}(n,o,i,a)}))}return i=i?i.then(a,a):a()}})}function E(t,e,r){var n="suspendedStart";return function(i,o){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===i)throw o;return k()}for(r.method=i,r.arg=o;;){var a=r.delegate;if(a){var s=m(a,r);if(s){if(s===f)continue;return s}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var c=u(t,e,r);if("normal"===c.type){if(n=r.done?"completed":"suspendedYield",c.arg===f)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(n="completed",r.method="throw",r.arg=c.arg)}}}function m(t,e){var r=e.method,n=t.iterator[r];if(void 0===n)return e.delegate=null,"throw"===r&&t.iterator.return&&(e.method="return",e.arg=void 0,m(t,e),"throw"===e.method)||"return"!==r&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+r+"' method")),f;var i=u(n,t.iterator,e.arg);if("throw"===i.type)return e.method="throw",e.arg=i.arg,e.delegate=null,f;var o=i.arg;return o?o.done?(e[t.resultName]=o.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,f):o:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,f)}function C(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function w(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function B(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(C,this),this.reset(!0)}function Q(t){if(t){var e=t[o];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,i=function e(){for(;++n<t.length;)if(r.call(t,n))return e.value=t[n],e.done=!1,e;return e.value=void 0,e.done=!0,e};return i.next=i}}return{next:k}}function k(){return{value:void 0,done:!0}}return l.prototype=d,n(I,"constructor",{value:d,configurable:!0}),n(d,"constructor",{value:l,configurable:!0}),l.displayName=c(d,s,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===l||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,d):(t.__proto__=d,c(t,s,"GeneratorFunction")),t.prototype=Object.create(I),t},t.awrap=function(t){return{__await:t}},b(v.prototype),c(v.prototype,a,(function(){return this})),t.AsyncIterator=v,t.async=function(e,r,n,i,o){void 0===o&&(o=Promise);var a=new v(A(e,r,n,i),o);return t.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},b(I),c(I,s,"Generator"),c(I,o,(function(){return this})),c(I,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},t.values=Q,B.prototype={constructor:B,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(w),!t)for(var e in this)"t"===e.charAt(0)&&r.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function n(r,n){return a.type="throw",a.arg=t,e.next=r,n&&(e.method="next",e.arg=void 0),!!n}for(var i=this.tryEntries.length-1;i>=0;--i){var o=this.tryEntries[i],a=o.completion;if("root"===o.tryLoc)return n("end");if(o.tryLoc<=this.prev){var s=r.call(o,"catchLoc"),c=r.call(o,"finallyLoc");if(s&&c){if(this.prev<o.catchLoc)return n(o.catchLoc,!0);if(this.prev<o.finallyLoc)return n(o.finallyLoc)}else if(s){if(this.prev<o.catchLoc)return n(o.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return n(o.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&r.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var o=i;break}}o&&("break"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc&&(o=null);var a=o?o.completion:{};return a.type=t,a.arg=e,o?(this.method="next",this.next=o.finallyLoc,f):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),f},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),w(r),f}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var i=n.arg;w(r)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:Q(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),f}},t}function Uc(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Gc(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,(i=n.key,o=void 0,o=function(t,e){if("object"!==Yc(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==Yc(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(i,"string"),"symbol"===Yc(o)?o:String(o)),n)}var i,o}function Hc(t,e,r){return e&&Gc(t.prototype,e),r&&Gc(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function Yc(t){return(Yc="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var Kc=function(t,e,r,n){return new(r||(r=Promise))((function(i,o){function a(t){try{c(n.next(t))}catch(t){o(t)}}function s(t){try{c(n.throw(t))}catch(t){o(t)}}function c(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(a,s)}c((n=n.apply(t,e||[])).next())}))},qc=new h.b("providers/5.7.2");function Jc(t){return null==t?"null":(32!==Object(A.d)(t)&&qc.throwArgumentError("invalid topic","topic",t),t.toLowerCase())}function zc(t){for(t=t.slice();t.length>0&&null==t[t.length-1];)t.pop();return t.map((function(t){if(Array.isArray(t)){var e={};t.forEach((function(t){e[Jc(t)]=!0}));var r=Object.keys(e);return r.sort(),r.join("|")}return Jc(t)})).join("&")}function Zc(t){if("string"==typeof t){if(t=t.toLowerCase(),32===Object(A.d)(t))return"tx:"+t;if(-1===t.indexOf(":"))return t}else{if(Array.isArray(t))return"filter:*:"+zc(t);if(Qn.isForkEvent(t))throw qc.warn("not implemented"),new Error("not implemented");if(t&&"object"===Yc(t))return"filter:"+(t.address||"*")+":"+zc(t.topics||[])}throw new Error("invalid event - "+t)}function Vc(){return(new Date).getTime()}function Wc(t){return new Promise((function(e){setTimeout(e,t)}))}var Xc=["block","network","pending","poll"],$c=function(){function t(e,r,n){Uc(this,t),D(this,"tag",e),D(this,"listener",r),D(this,"once",n),this._lastBlockNumber=-2,this._inflight=!1}return Hc(t,[{key:"event",get:function(){switch(this.type){case"tx":return this.hash;case"filter":return this.filter}return this.tag}},{key:"type",get:function(){return this.tag.split(":")[0]}},{key:"hash",get:function(){var t=this.tag.split(":");return"tx"!==t[0]?null:t[1]}},{key:"filter",get:function(){var t=this.tag.split(":");if("filter"!==t[0])return null;var e,r=t[1],n=""===(e=t[2])?[]:e.split(/&/g).map((function(t){if(""===t)return[];var e=t.split("|").map((function(t){return"null"===t?null:t}));return 1===e.length?e[0]:e})),i={};return n.length>0&&(i.topics=n),r&&"*"!==r&&(i.address=r),i}},{key:"pollable",value:function(){return this.tag.indexOf(":")>=0||Xc.indexOf(this.tag)>=0}}]),t}(),tA={0:{symbol:"btc",p2pkh:0,p2sh:5,prefix:"bc"},2:{symbol:"ltc",p2pkh:48,p2sh:50,prefix:"ltc"},3:{symbol:"doge",p2pkh:30,p2sh:22},60:{symbol:"eth",ilk:"eth"},61:{symbol:"etc",ilk:"eth"},700:{symbol:"xdai",ilk:"eth"}};function eA(t){return Object(A.h)(b.from(t).toHexString(),32)}function rA(t){return Po.encode(Object(A.b)([t,Object(A.e)(Uo(Uo(t)),0,4)]))}var nA=new RegExp("^(ipfs)://(.*)$","i"),iA=[new RegExp("^(https)://(.*)$","i"),new RegExp("^(data):(.*)$","i"),nA,new RegExp("^eip155:[0-9]+/(erc[0-9]+):(.*)$","i")];function oA(t,e){try{return kt(aA(t,e))}catch(t){}return null}function aA(t,e){if("0x"===t)return null;var r=b.from(Object(A.e)(t,e,e+32)).toNumber(),n=b.from(Object(A.e)(t,r,r+32)).toNumber();return Object(A.e)(t,r+32,r+32+n)}function sA(t){return t.match(/^ipfs:\/\/ipfs\//i)?t=t.substring(12):t.match(/^ipfs:\/\//i)?t=t.substring(7):qc.throwArgumentError("unsupported IPFS format","link",t),"https://gateway.ipfs.io/ipfs/".concat(t)}function cA(t){var e=Object(A.a)(t);if(e.length>32)throw new Error("internal; should not happen");var r=new Uint8Array(32);return r.set(e,32-e.length),r}function AA(t){if(t.length%32==0)return t;var e=new Uint8Array(32*Math.ceil(t.length/32));return e.set(t),e}function uA(t){for(var e=[],r=0,n=0;n<t.length;n++)e.push(null),r+=32;for(var i=0;i<t.length;i++){var o=Object(A.a)(t[i]);e[i]=cA(r),e.push(cA(o.length)),e.push(AA(o)),r+=32+32*Math.ceil(o.length/32)}return Object(A.c)(e)}var fA=function(){function t(e,r,n,i){Uc(this,t),D(this,"provider",e),D(this,"name",n),D(this,"address",e.formatter.address(r)),D(this,"_resolvedAddress",i)}return Hc(t,[{key:"supportsWildcard",value:function(){var t=this;return this._supportsEip2544||(this._supportsEip2544=this.provider.call({to:this.address,data:"0x01ffc9a79061b92300000000000000000000000000000000000000000000000000000000"}).then((function(t){return b.from(t).eq(1)})).catch((function(e){if(e.code===h.b.errors.CALL_EXCEPTION)return!1;throw t._supportsEip2544=null,e}))),this._supportsEip2544}},{key:"_fetch",value:function(t,e){return Kc(this,void 0,void 0,Tc().mark((function r(){var n,i,o;return Tc().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return n={to:this.address,ccipReadEnabled:!0,data:Object(A.c)([t,uc(this.name),e||"0x"])},i=!1,r.next=4,this.supportsWildcard();case 4:if(!r.sent){r.next=7;break}i=!0,n.data=Object(A.c)(["0x9061b923",uA([fc(this.name),n.data])]);case 7:return r.prev=7,r.next=10,this.provider.call(n);case 10:return o=r.sent,Object(A.a)(o).length%32==4&&qc.throwError("resolver threw error",h.b.errors.CALL_EXCEPTION,{transaction:n,data:o}),i&&(o=aA(o,0)),r.abrupt("return",o);case 16:if(r.prev=16,r.t0=r.catch(7),r.t0.code!==h.b.errors.CALL_EXCEPTION){r.next=20;break}return r.abrupt("return",null);case 20:throw r.t0;case 21:case"end":return r.stop()}}),r,this,[[7,16]])})))}},{key:"_fetchBytes",value:function(t,e){return Kc(this,void 0,void 0,Tc().mark((function r(){var n;return Tc().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,this._fetch(t,e);case 2:if(null==(n=r.sent)){r.next=5;break}return r.abrupt("return",aA(n,0));case 5:return r.abrupt("return",null);case 6:case"end":return r.stop()}}),r,this)})))}},{key:"_getAddress",value:function(t,e){var r=tA[String(t)];if(null==r&&qc.throwError("unsupported coin type: ".concat(t),h.b.errors.UNSUPPORTED_OPERATION,{operation:"getAddress(".concat(t,")")}),"eth"===r.ilk)return this.provider.formatter.address(e);var n=Object(A.a)(e);if(null!=r.p2pkh){var i=e.match(/^0x76a9([0-9a-f][0-9a-f])([0-9a-f]*)88ac$/);if(i){var o=parseInt(i[1],16);if(i[2].length===2*o&&o>=1&&o<=75)return rA(Object(A.b)([[r.p2pkh],"0x"+i[2]]))}}if(null!=r.p2sh){var a=e.match(/^0xa9([0-9a-f][0-9a-f])([0-9a-f]*)87$/);if(a){var s=parseInt(a[1],16);if(a[2].length===2*s&&s>=1&&s<=75)return rA(Object(A.b)([[r.p2sh],"0x"+a[2]]))}}if(null!=r.prefix){var c=n[1],u=n[0];if(0===u?20!==c&&32!==c&&(u=-1):u=-1,u>=0&&n.length===2+c&&c>=1&&c<=75){var f=Qc.a.toWords(n.slice(2));return f.unshift(u),Qc.a.encode(r.prefix,f)}}return null}},{key:"getAddress",value:function(t){return Kc(this,void 0,void 0,Tc().mark((function e(){var r,n,i;return Tc().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null==t&&(t=60),60!==t){e.next=16;break}return e.prev=2,e.next=5,this._fetch("0x3b3b57de");case 5:if("0x"!==(r=e.sent)&&r!==Cs){e.next=8;break}return e.abrupt("return",null);case 8:return e.abrupt("return",this.provider.formatter.callAddress(r));case 11:if(e.prev=11,e.t0=e.catch(2),e.t0.code!==h.b.errors.CALL_EXCEPTION){e.next=15;break}return e.abrupt("return",null);case 15:throw e.t0;case 16:return e.next=18,this._fetchBytes("0xf1cb7e06",eA(t));case 18:if(null!=(n=e.sent)&&"0x"!==n){e.next=21;break}return e.abrupt("return",null);case 21:return null==(i=this._getAddress(t,n))&&qc.throwError("invalid or unsupported coin data",h.b.errors.UNSUPPORTED_OPERATION,{operation:"getAddress(".concat(t,")"),coinType:t,data:n}),e.abrupt("return",i);case 24:case"end":return e.stop()}}),e,this,[[2,11]])})))}},{key:"getAvatar",value:function(){return Kc(this,void 0,void 0,Tc().mark((function t(){var e,r,n,i,o,a,s,c,u,f,h,l,d,g,p,y;return Tc().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e=[{type:"name",content:this.name}],t.prev=1,t.next=4,this.getText("avatar");case 4:if(null!=(r=t.sent)){t.next=7;break}return t.abrupt("return",null);case 7:n=0;case 8:if(!(n<iA.length)){t.next=91;break}if(null!=(i=r.match(iA[n]))){t.next=12;break}return t.abrupt("continue",88);case 12:o=i[1].toLowerCase(),t.t0=o,t.next="https"===t.t0?16:"data"===t.t0?18:"ipfs"===t.t0?20:"erc721"===t.t0||"erc1155"===t.t0?22:88;break;case 16:return e.push({type:"url",content:r}),t.abrupt("return",{linkage:e,url:r});case 18:return e.push({type:"data",content:r}),t.abrupt("return",{linkage:e,url:r});case 20:return e.push({type:"ipfs",content:r}),t.abrupt("return",{linkage:e,url:sA(r)});case 22:if(a="erc721"===o?"0xc87b56dd":"0x0e89341c",e.push({type:o,content:r}),t.t1=this._resolvedAddress,t.t1){t.next=29;break}return t.next=28,this.getAddress();case 28:t.t1=t.sent;case 29:if(s=t.t1,2===(c=(i[2]||"").split("/")).length){t.next=33;break}return t.abrupt("return",null);case 33:return t.next=35,this.provider.formatter.address(c[0]);case 35:if(u=t.sent,f=Object(A.h)(b.from(c[1]).toHexString(),32),"erc721"!==o){t.next=48;break}return t.t2=this.provider.formatter,t.next=41,this.provider.call({to:u,data:Object(A.c)(["0x6352211e",f])});case 41:if(t.t3=t.sent,h=t.t2.callAddress.call(t.t2,t.t3),s===h){t.next=45;break}return t.abrupt("return",null);case 45:e.push({type:"owner",content:h}),t.next=57;break;case 48:if("erc1155"!==o){t.next=57;break}return t.t4=b,t.next=52,this.provider.call({to:u,data:Object(A.c)(["0x00fdd58e",Object(A.h)(s,32),f])});case 52:if(t.t5=t.sent,!(l=t.t4.from.call(t.t4,t.t5)).isZero()){t.next=56;break}return t.abrupt("return",null);case 56:e.push({type:"balance",content:l.toString()});case 57:return d={to:this.provider.formatter.address(c[0]),data:Object(A.c)([a,f])},t.t6=oA,t.next=61,this.provider.call(d);case 61:if(t.t7=t.sent,null!=(g=(0,t.t6)(t.t7,0))){t.next=65;break}return t.abrupt("return",null);case 65:return e.push({type:"metadata-url-base",content:g}),"erc1155"===o&&(g=g.replace("{id}",f.substring(2)),e.push({type:"metadata-url-expanded",content:g})),g.match(/^ipfs:/i)&&(g=sA(g)),e.push({type:"metadata-url",content:g}),t.next=71,Cc(g);case 71:if(p=t.sent){t.next=74;break}return t.abrupt("return",null);case 74:if(e.push({type:"metadata",content:JSON.stringify(p)}),"string"==typeof(y=p.image)){t.next=78;break}return t.abrupt("return",null);case 78:if(!y.match(/^(https:\/\/|data:)/i)){t.next=81;break}t.next=86;break;case 81:if(null!=y.match(nA)){t.next=84;break}return t.abrupt("return",null);case 84:e.push({type:"url-ipfs",content:y}),y=sA(y);case 86:return e.push({type:"url",content:y}),t.abrupt("return",{linkage:e,url:y});case 88:n++,t.next=8;break;case 91:t.next=95;break;case 93:t.prev=93,t.t8=t.catch(1);case 95:return t.abrupt("return",null);case 96:case"end":return t.stop()}}),t,this,[[1,93]])})))}},{key:"getContentHash",value:function(){return Kc(this,void 0,void 0,Tc().mark((function t(){var e,r,n,i,o,a,s,c,A;return Tc().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this._fetchBytes("0xbc1c58d1");case 2:if(null!=(e=t.sent)&&"0x"!==e){t.next=5;break}return t.abrupt("return",null);case 5:if(!(r=e.match(/^0xe3010170(([0-9a-f][0-9a-f])([0-9a-f][0-9a-f])([0-9a-f]*))$/))){t.next=10;break}if(n=parseInt(r[3],16),r[4].length!==2*n){t.next=10;break}return t.abrupt("return","ipfs://"+Po.encode("0x"+r[1]));case 10:if(!(i=e.match(/^0xe5010172(([0-9a-f][0-9a-f])([0-9a-f][0-9a-f])([0-9a-f]*))$/))){t.next=15;break}if(o=parseInt(i[3],16),i[4].length!==2*o){t.next=15;break}return t.abrupt("return","ipns://"+Po.encode("0x"+i[1]));case 15:if(!(a=e.match(/^0xe40101fa011b20([0-9a-f]*)$/))){t.next=19;break}if(64!==a[1].length){t.next=19;break}return t.abrupt("return","bzz://"+a[1]);case 19:if(!(s=e.match(/^0x90b2c605([0-9a-f]*)$/))){t.next=25;break}if(68!==s[1].length){t.next=25;break}return c={"=":"","+":"-","/":"_"},A=Os("0x"+s[1]).replace(/[=+\/]/g,(function(t){return c[t]})),t.abrupt("return","sia://"+A);case 25:return t.abrupt("return",qc.throwError("invalid or unsupported content hash data",h.b.errors.UNSUPPORTED_OPERATION,{operation:"getContentHash()",data:e}));case 26:case"end":return t.stop()}}),t,this)})))}},{key:"getText",value:function(t){return Kc(this,void 0,void 0,Tc().mark((function e(){var r,n;return Tc().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=Ct(t),(r=Object(A.b)([eA(64),eA(r.length),r])).length%32!=0&&(r=Object(A.b)([r,Object(A.h)("0x",32-t.length%32)])),e.next=5,this._fetchBytes("0x59d1d43c",Object(A.i)(r));case 5:if(null!=(n=e.sent)&&"0x"!==n){e.next=8;break}return e.abrupt("return",null);case 8:return e.abrupt("return",kt(n));case 9:case"end":return e.stop()}}),e,this)})))}}]),t}(),hA=null,lA=1,dA=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Nc(t,e)}(r,t);var e=Pc(r);function r(t){var n;if(Uc(this,r),(n=e.call(this))._events=[],n._emitted={block:-2},n.disableCcipRead=!1,n.formatter=(this instanceof r?this.constructor:void 0).getFormatter(),D(Lc(n),"anyNetwork","any"===t),n.anyNetwork&&(t=n.detectNetwork()),t instanceof Promise)n._networkPromise=t,t.catch((function(t){})),n._ready().catch((function(t){}));else{var i=x(this instanceof r?this.constructor:void 0,"getNetwork")(t);i?(D(Lc(n),"_network",i),n.emit("network",i,null)):qc.throwArgumentError("invalid network","network",t)}return n._maxInternalBlockNumber=-1024,n._lastBlockNumber=-2,n._maxFilterBlockRange=10,n._pollingInterval=4e3,n._fastQueryDate=0,n}return Hc(r,[{key:"_ready",value:function(){return Kc(this,void 0,void 0,Tc().mark((function t(){var e;return Tc().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(null!=this._network){t.next=17;break}if(e=null,!this._networkPromise){t.next=11;break}return t.prev=3,t.next=6,this._networkPromise;case 6:e=t.sent,t.next=11;break;case 9:t.prev=9,t.t0=t.catch(3);case 11:if(null!=e){t.next=15;break}return t.next=14,this.detectNetwork();case 14:e=t.sent;case 15:e||qc.throwError("no network detected",h.b.errors.UNKNOWN_ERROR,{}),null==this._network&&(this.anyNetwork?this._network=e:D(this,"_network",e),this.emit("network",e,null));case 17:return t.abrupt("return",this._network);case 18:case"end":return t.stop()}}),t,this,[[3,9]])})))}},{key:"ready",get:function(){var t=this;return wc((function(){return t._ready().then((function(t){return t}),(function(t){if(t.code!==h.b.errors.NETWORK_ERROR||"noNetwork"!==t.event)throw t}))}))}},{key:"ccipReadFetch",value:function(t,e,r){return Kc(this,void 0,void 0,Tc().mark((function n(){var i,o,a,s,c,A,u,f,l;return Tc().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(!this.disableCcipRead&&0!==r.length){n.next=2;break}return n.abrupt("return",null);case 2:i=t.to.toLowerCase(),o=e.toLowerCase(),a=[],s=0;case 6:if(!(s<r.length)){n.next=22;break}return c=r[s],A=c.replace("{sender}",i).replace("{data}",o),u=c.indexOf("{data}")>=0?null:JSON.stringify({data:o,sender:i}),n.next=12,Cc({url:A,errorPassThrough:!0},u,(function(t,e){return t.status=e.statusCode,t}));case 12:if(!(f=n.sent).data){n.next=15;break}return n.abrupt("return",f.data);case 15:if(l=f.message||"unknown error",!(f.status>=400&&f.status<500)){n.next=18;break}return n.abrupt("return",qc.throwError("response not found during CCIP fetch: ".concat(l),h.b.errors.SERVER_ERROR,{url:c,errorMessage:l}));case 18:a.push(l);case 19:s++,n.next=6;break;case 22:return n.abrupt("return",qc.throwError("error encountered during CCIP fetch: ".concat(a.map((function(t){return JSON.stringify(t)})).join(", ")),h.b.errors.SERVER_ERROR,{urls:r,errorMessages:a}));case 23:case"end":return n.stop()}}),n,this)})))}},{key:"_getInternalBlockNumber",value:function(t){return Kc(this,void 0,void 0,Tc().mark((function e(){var r,n,i,o,a=this;return Tc().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._ready();case 2:if(!(t>0)){e.next=20;break}case 3:if(!this._internalBlockNumber){e.next=20;break}return r=this._internalBlockNumber,e.prev=5,e.next=8,r;case 8:if(n=e.sent,!(Vc()-n.respTime<=t)){e.next=11;break}return e.abrupt("return",n.blockNumber);case 11:return e.abrupt("break",20);case 14:if(e.prev=14,e.t0=e.catch(5),this._internalBlockNumber!==r){e.next=18;break}return e.abrupt("break",20);case 18:e.next=3;break;case 20:return i=Vc(),o=M({blockNumber:this.perform("getBlockNumber",{}),networkError:this.getNetwork().then((function(t){return null}),(function(t){return t}))}).then((function(t){var e=t.blockNumber,r=t.networkError;if(r)throw a._internalBlockNumber===o&&(a._internalBlockNumber=null),r;var n=Vc();return(e=b.from(e).toNumber())<a._maxInternalBlockNumber&&(e=a._maxInternalBlockNumber),a._maxInternalBlockNumber=e,a._setFastBlockNumber(e),{blockNumber:e,reqTime:i,respTime:n}})),this._internalBlockNumber=o,o.catch((function(t){a._internalBlockNumber===o&&(a._internalBlockNumber=null)})),e.next=26,o;case 26:return e.abrupt("return",e.sent.blockNumber);case 27:case"end":return e.stop()}}),e,this,[[5,14]])})))}},{key:"poll",value:function(){return Kc(this,void 0,void 0,Tc().mark((function t(){var e,r,n,i,o=this;return Tc().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e=lA++,r=[],n=null,t.prev=3,t.next=6,this._getInternalBlockNumber(100+this.pollingInterval/2);case 6:n=t.sent,t.next=13;break;case 9:return t.prev=9,t.t0=t.catch(3),this.emit("error",t.t0),t.abrupt("return");case 13:if(this._setFastBlockNumber(n),this.emit("poll",e,n),n!==this._lastBlockNumber){t.next=18;break}return this.emit("didPoll",e),t.abrupt("return");case 18:if(-2===this._emitted.block&&(this._emitted.block=n-1),Math.abs(this._emitted.block-n)>1e3)qc.warn("network block skew detected; skipping block events (emitted=".concat(this._emitted.block," blockNumber").concat(n,")")),this.emit("error",qc.makeError("network block skew detected",h.b.errors.NETWORK_ERROR,{blockNumber:n,event:"blockSkew",previousBlockNumber:this._emitted.block})),this.emit("block",n);else for(i=this._emitted.block+1;i<=n;i++)this.emit("block",i);return this._emitted.block!==n&&(this._emitted.block=n,Object.keys(this._emitted).forEach((function(t){if("block"!==t){var e=o._emitted[t];"pending"!==e&&n-e>12&&delete o._emitted[t]}}))),-2===this._lastBlockNumber&&(this._lastBlockNumber=n-1),this._events.forEach((function(t){switch(t.type){case"tx":var e=t.hash,i=o.getTransactionReceipt(e).then((function(t){return t&&null!=t.blockNumber?(o._emitted["t:"+e]=t.blockNumber,o.emit(e,t),null):null})).catch((function(t){o.emit("error",t)}));r.push(i);break;case"filter":if(!t._inflight){t._inflight=!0,-2===t._lastBlockNumber&&(t._lastBlockNumber=n-1);var a=t.filter;a.fromBlock=t._lastBlockNumber+1,a.toBlock=n;var s=a.toBlock-o._maxFilterBlockRange;s>a.fromBlock&&(a.fromBlock=s),a.fromBlock<0&&(a.fromBlock=0);var c=o.getLogs(a).then((function(e){t._inflight=!1,0!==e.length&&e.forEach((function(e){e.blockNumber>t._lastBlockNumber&&(t._lastBlockNumber=e.blockNumber),o._emitted["b:"+e.blockHash]=e.blockNumber,o._emitted["t:"+e.transactionHash]=e.blockNumber,o.emit(a,e)}))})).catch((function(e){o.emit("error",e),t._inflight=!1}));r.push(c)}}})),this._lastBlockNumber=n,Promise.all(r).then((function(){o.emit("didPoll",e)})).catch((function(t){o.emit("error",t)})),t.abrupt("return");case 26:case"end":return t.stop()}}),t,this,[[3,9]])})))}},{key:"resetEventsBlock",value:function(t){this._lastBlockNumber=t-1,this.polling&&this.poll()}},{key:"network",get:function(){return this._network}},{key:"detectNetwork",value:function(){return Kc(this,void 0,void 0,Tc().mark((function t(){return Tc().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",qc.throwError("provider does not support network detection",h.b.errors.UNSUPPORTED_OPERATION,{operation:"provider.detectNetwork"}));case 1:case"end":return t.stop()}}),t)})))}},{key:"getNetwork",value:function(){return Kc(this,void 0,void 0,Tc().mark((function t(){var e,r,n;return Tc().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this._ready();case 2:return e=t.sent,t.next=5,this.detectNetwork();case 5:if(r=t.sent,e.chainId===r.chainId){t.next=23;break}if(!this.anyNetwork){t.next=20;break}return this._network=r,this._lastBlockNumber=-2,this._fastBlockNumber=null,this._fastBlockNumberPromise=null,this._fastQueryDate=0,this._emitted.block=-2,this._maxInternalBlockNumber=-1024,this._internalBlockNumber=null,this.emit("network",r,e),t.next=19,Wc(0);case 19:return t.abrupt("return",this._network);case 20:throw n=qc.makeError("underlying network changed",h.b.errors.NETWORK_ERROR,{event:"changed",network:e,detectedNetwork:r}),this.emit("error",n),n;case 23:return t.abrupt("return",e);case 24:case"end":return t.stop()}}),t,this)})))}},{key:"blockNumber",get:function(){var t=this;return this._getInternalBlockNumber(100+this.pollingInterval/2).then((function(e){t._setFastBlockNumber(e)}),(function(t){})),null!=this._fastBlockNumber?this._fastBlockNumber:-1}},{key:"polling",get:function(){return null!=this._poller},set:function(t){var e=this;t&&!this._poller?(this._poller=setInterval((function(){e.poll()}),this.pollingInterval),this._bootstrapPoll||(this._bootstrapPoll=setTimeout((function(){e.poll(),e._bootstrapPoll=setTimeout((function(){e._poller||e.poll(),e._bootstrapPoll=null}),e.pollingInterval)}),0))):!t&&this._poller&&(clearInterval(this._poller),this._poller=null)}},{key:"pollingInterval",get:function(){return this._pollingInterval},set:function(t){var e=this;if("number"!=typeof t||t<=0||parseInt(String(t))!=t)throw new Error("invalid polling interval");this._pollingInterval=t,this._poller&&(clearInterval(this._poller),this._poller=setInterval((function(){e.poll()}),this._pollingInterval))}},{key:"_getFastBlockNumber",value:function(){var t=this,e=Vc();return e-this._fastQueryDate>2*this._pollingInterval&&(this._fastQueryDate=e,this._fastBlockNumberPromise=this.getBlockNumber().then((function(e){return(null==t._fastBlockNumber||e>t._fastBlockNumber)&&(t._fastBlockNumber=e),t._fastBlockNumber}))),this._fastBlockNumberPromise}},{key:"_setFastBlockNumber",value:function(t){null!=this._fastBlockNumber&&t<this._fastBlockNumber||(this._fastQueryDate=Vc(),(null==this._fastBlockNumber||t>this._fastBlockNumber)&&(this._fastBlockNumber=t,this._fastBlockNumberPromise=Promise.resolve(t)))}},{key:"waitForTransaction",value:function(t,e,r){return Kc(this,void 0,void 0,Tc().mark((function n(){return Tc().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.abrupt("return",this._waitForTransaction(t,null==e?1:e,r||0,null));case 1:case"end":return n.stop()}}),n,this)})))}},{key:"_waitForTransaction",value:function(t,e,r,n){return Kc(this,void 0,void 0,Tc().mark((function i(){var o,a=this;return Tc().wrap((function(i){for(;;)switch(i.prev=i.next){case 0:return i.next=2,this.getTransactionReceipt(t);case 2:if(!(((o=i.sent)?o.confirmations:0)>=e)){i.next=5;break}return i.abrupt("return",o);case 5:return i.abrupt("return",new Promise((function(i,o){var s=[],c=!1,A=function(){return!!c||(c=!0,s.forEach((function(t){t()})),!1)},u=function(t){t.confirmations<e||A()||i(t)};if(a.on(t,u),s.push((function(){a.removeListener(t,u)})),n){var f=n.startBlock,l=null,d=function r(i){return Kc(a,void 0,void 0,Tc().mark((function a(){var s=this;return Tc().wrap((function(a){for(;;)switch(a.prev=a.next){case 0:if(!c){a.next=2;break}return a.abrupt("return");case 2:return a.next=4,Wc(1e3);case 4:this.getTransactionCount(n.from).then((function(a){return Kc(s,void 0,void 0,Tc().mark((function s(){var u,d,g,p,y,I;return Tc().wrap((function(s){for(;;)switch(s.prev=s.next){case 0:if(!c){s.next=2;break}return s.abrupt("return");case 2:if(!(a<=n.nonce)){s.next=6;break}f=i,s.next=41;break;case 6:return s.next=8,this.getTransaction(t);case 8:if(!(u=s.sent)||null==u.blockNumber){s.next=11;break}return s.abrupt("return");case 11:null==l&&(l=f-3)<n.startBlock&&(l=n.startBlock);case 12:if(!(l<=i)){s.next=41;break}if(!c){s.next=15;break}return s.abrupt("return");case 15:return s.next=17,this.getBlockWithTransactions(l);case 17:d=s.sent,g=0;case 19:if(!(g<d.transactions.length)){s.next=38;break}if((p=d.transactions[g]).hash!==t){s.next=23;break}return s.abrupt("return");case 23:if(p.from!==n.from||p.nonce!==n.nonce){s.next=35;break}if(!c){s.next=26;break}return s.abrupt("return");case 26:return s.next=28,this.waitForTransaction(p.hash,e);case 28:if(y=s.sent,!A()){s.next=31;break}return s.abrupt("return");case 31:return I="replaced",p.data===n.data&&p.to===n.to&&p.value.eq(n.value)?I="repriced":"0x"===p.data&&p.from===p.to&&p.value.isZero()&&(I="cancelled"),o(qc.makeError("transaction was replaced",h.b.errors.TRANSACTION_REPLACED,{cancelled:"replaced"===I||"cancelled"===I,reason:I,replacement:this._wrapTransaction(p),hash:t,receipt:y})),s.abrupt("return");case 35:g++,s.next=19;break;case 38:l++,s.next=12;break;case 41:if(!c){s.next=43;break}return s.abrupt("return");case 43:this.once("block",r);case 44:case"end":return s.stop()}}),s,this)})))}),(function(t){c||s.once("block",r)}));case 5:case"end":return a.stop()}}),a,this)})))};if(c)return;a.once("block",d),s.push((function(){a.removeListener("block",d)}))}if("number"==typeof r&&r>0){var g=setTimeout((function(){A()||o(qc.makeError("timeout exceeded",h.b.errors.TIMEOUT,{timeout:r}))}),r);g.unref&&g.unref(),s.push((function(){clearTimeout(g)}))}})));case 6:case"end":return i.stop()}}),i,this)})))}},{key:"getBlockNumber",value:function(){return Kc(this,void 0,void 0,Tc().mark((function t(){return Tc().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",this._getInternalBlockNumber(0));case 1:case"end":return t.stop()}}),t,this)})))}},{key:"getGasPrice",value:function(){return Kc(this,void 0,void 0,Tc().mark((function t(){var e;return Tc().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.getNetwork();case 2:return t.next=4,this.perform("getGasPrice",{});case 4:return e=t.sent,t.prev=5,t.abrupt("return",b.from(e));case 9:return t.prev=9,t.t0=t.catch(5),t.abrupt("return",qc.throwError("bad result from backend",h.b.errors.SERVER_ERROR,{method:"getGasPrice",result:e,error:t.t0}));case 12:case"end":return t.stop()}}),t,this,[[5,9]])})))}},{key:"getBalance",value:function(t,e){return Kc(this,void 0,void 0,Tc().mark((function r(){var n,i;return Tc().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,this.getNetwork();case 2:return r.next=4,M({address:this._getAddress(t),blockTag:this._getBlockTag(e)});case 4:return n=r.sent,r.next=7,this.perform("getBalance",n);case 7:return i=r.sent,r.prev=8,r.abrupt("return",b.from(i));case 12:return r.prev=12,r.t0=r.catch(8),r.abrupt("return",qc.throwError("bad result from backend",h.b.errors.SERVER_ERROR,{method:"getBalance",params:n,result:i,error:r.t0}));case 15:case"end":return r.stop()}}),r,this,[[8,12]])})))}},{key:"getTransactionCount",value:function(t,e){return Kc(this,void 0,void 0,Tc().mark((function r(){var n,i;return Tc().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,this.getNetwork();case 2:return r.next=4,M({address:this._getAddress(t),blockTag:this._getBlockTag(e)});case 4:return n=r.sent,r.next=7,this.perform("getTransactionCount",n);case 7:return i=r.sent,r.prev=8,r.abrupt("return",b.from(i).toNumber());case 12:return r.prev=12,r.t0=r.catch(8),r.abrupt("return",qc.throwError("bad result from backend",h.b.errors.SERVER_ERROR,{method:"getTransactionCount",params:n,result:i,error:r.t0}));case 15:case"end":return r.stop()}}),r,this,[[8,12]])})))}},{key:"getCode",value:function(t,e){return Kc(this,void 0,void 0,Tc().mark((function r(){var n,i;return Tc().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,this.getNetwork();case 2:return r.next=4,M({address:this._getAddress(t),blockTag:this._getBlockTag(e)});case 4:return n=r.sent,r.next=7,this.perform("getCode",n);case 7:return i=r.sent,r.prev=8,r.abrupt("return",Object(A.i)(i));case 12:return r.prev=12,r.t0=r.catch(8),r.abrupt("return",qc.throwError("bad result from backend",h.b.errors.SERVER_ERROR,{method:"getCode",params:n,result:i,error:r.t0}));case 15:case"end":return r.stop()}}),r,this,[[8,12]])})))}},{key:"getStorageAt",value:function(t,e,r){return Kc(this,void 0,void 0,Tc().mark((function n(){var i,o;return Tc().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,this.getNetwork();case 2:return n.next=4,M({address:this._getAddress(t),blockTag:this._getBlockTag(r),position:Promise.resolve(e).then((function(t){return Object(A.g)(t)}))});case 4:return i=n.sent,n.next=7,this.perform("getStorageAt",i);case 7:return o=n.sent,n.prev=8,n.abrupt("return",Object(A.i)(o));case 12:return n.prev=12,n.t0=n.catch(8),n.abrupt("return",qc.throwError("bad result from backend",h.b.errors.SERVER_ERROR,{method:"getStorageAt",params:i,result:o,error:n.t0}));case 15:case"end":return n.stop()}}),n,this,[[8,12]])})))}},{key:"_wrapTransaction",value:function(t,e,r){var n=this;if(null!=e&&32!==Object(A.d)(e))throw new Error("invalid response - sendTransaction");var i=t;return null!=e&&t.hash!==e&&qc.throwError("Transaction hash mismatch from Provider.sendTransaction.",h.b.errors.UNKNOWN_ERROR,{expectedHash:t.hash,returnedHash:e}),i.wait=function(e,i){return Kc(n,void 0,void 0,Tc().mark((function n(){var o,a;return Tc().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return null==e&&(e=1),null==i&&(i=0),o=void 0,0!==e&&null!=r&&(o={data:t.data,from:t.from,nonce:t.nonce,to:t.to,value:t.value,startBlock:r}),n.next=6,this._waitForTransaction(t.hash,e,i,o);case 6:if(null!=(a=n.sent)||0!==e){n.next=9;break}return n.abrupt("return",null);case 9:return this._emitted["t:"+t.hash]=a.blockNumber,0===a.status&&qc.throwError("transaction failed",h.b.errors.CALL_EXCEPTION,{transactionHash:t.hash,transaction:t,receipt:a}),n.abrupt("return",a);case 12:case"end":return n.stop()}}),n,this)})))},i}},{key:"sendTransaction",value:function(t){return Kc(this,void 0,void 0,Tc().mark((function e(){var r,n,i,o;return Tc().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.getNetwork();case 2:return e.next=4,Promise.resolve(t).then((function(t){return Object(A.i)(t)}));case 4:return r=e.sent,null==(n=this.formatter.transaction(t)).confirmations&&(n.confirmations=0),e.next=9,this._getInternalBlockNumber(100+2*this.pollingInterval);case 9:return i=e.sent,e.prev=10,e.next=13,this.perform("sendTransaction",{signedTransaction:r});case 13:return o=e.sent,e.abrupt("return",this._wrapTransaction(n,o,i));case 17:throw e.prev=17,e.t0=e.catch(10),e.t0.transaction=n,e.t0.transactionHash=n.hash,e.t0;case 22:case"end":return e.stop()}}),e,this,[[10,17]])})))}},{key:"_getTransactionRequest",value:function(t){return Kc(this,void 0,void 0,Tc().mark((function e(){var r,n,i=this;return Tc().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t;case 2:return r=e.sent,n={},["from","to"].forEach((function(t){null!=r[t]&&(n[t]=Promise.resolve(r[t]).then((function(t){return t?i._getAddress(t):null})))})),["gasLimit","gasPrice","maxFeePerGas","maxPriorityFeePerGas","value"].forEach((function(t){null!=r[t]&&(n[t]=Promise.resolve(r[t]).then((function(t){return t?b.from(t):null})))})),["type"].forEach((function(t){null!=r[t]&&(n[t]=Promise.resolve(r[t]).then((function(t){return null!=t?t:null})))})),r.accessList&&(n.accessList=this.formatter.accessList(r.accessList)),["data"].forEach((function(t){null!=r[t]&&(n[t]=Promise.resolve(r[t]).then((function(t){return t?Object(A.i)(t):null})))})),e.t0=this.formatter,e.next=12,M(n);case 12:return e.t1=e.sent,e.abrupt("return",e.t0.transactionRequest.call(e.t0,e.t1));case 14:case"end":return e.stop()}}),e,this)})))}},{key:"_getFilter",value:function(t){return Kc(this,void 0,void 0,Tc().mark((function e(){var r,n=this;return Tc().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t;case 2:return t=e.sent,r={},null!=t.address&&(r.address=this._getAddress(t.address)),["blockHash","topics"].forEach((function(e){null!=t[e]&&(r[e]=t[e])})),["fromBlock","toBlock"].forEach((function(e){null!=t[e]&&(r[e]=n._getBlockTag(t[e]))})),e.t0=this.formatter,e.next=10,M(r);case 10:return e.t1=e.sent,e.abrupt("return",e.t0.filter.call(e.t0,e.t1));case 12:case"end":return e.stop()}}),e,this)})))}},{key:"_call",value:function(t,e,r){return Kc(this,void 0,void 0,Tc().mark((function n(){var i,o,a,s,c,u,f,l,d,g,p,y,I,v,E;return Tc().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return r>=10&&qc.throwError("CCIP read exceeded maximum redirections",h.b.errors.SERVER_ERROR,{redirects:r,transaction:t}),i=t.to,n.next=4,this.perform("call",{transaction:t,blockTag:e});case 4:if(o=n.sent,!(r>=0&&"latest"===e&&null!=i&&"0x556f1830"===o.substring(0,10)&&Object(A.d)(o)%32==4)){n.next=31;break}for(n.prev=6,a=Object(A.e)(o,4),s=Object(A.e)(a,0,32),b.from(s).eq(i)||qc.throwError("CCIP Read sender did not match",h.b.errors.CALL_EXCEPTION,{name:"OffchainLookup",signature:"OffchainLookup(address,string[],bytes,bytes4,bytes)",transaction:t,data:o}),c=[],u=b.from(Object(A.e)(a,32,64)).toNumber(),f=b.from(Object(A.e)(a,u,u+32)).toNumber(),l=Object(A.e)(a,u+32),d=0;d<f;d++)null==(g=oA(l,32*d))&&qc.throwError("CCIP Read contained corrupt URL string",h.b.errors.CALL_EXCEPTION,{name:"OffchainLookup",signature:"OffchainLookup(address,string[],bytes,bytes4,bytes)",transaction:t,data:o}),c.push(g);return p=aA(a,64),b.from(Object(A.e)(a,100,128)).isZero()||qc.throwError("CCIP Read callback selector included junk",h.b.errors.CALL_EXCEPTION,{name:"OffchainLookup",signature:"OffchainLookup(address,string[],bytes,bytes4,bytes)",transaction:t,data:o}),y=Object(A.e)(a,96,100),I=aA(a,128),n.next=21,this.ccipReadFetch(t,p,c);case 21:return null==(v=n.sent)&&qc.throwError("CCIP Read disabled or provided no URLs",h.b.errors.CALL_EXCEPTION,{name:"OffchainLookup",signature:"OffchainLookup(address,string[],bytes,bytes4,bytes)",transaction:t,data:o}),E={to:i,data:Object(A.c)([y,uA([v,I])])},n.abrupt("return",this._call(E,e,r+1));case 27:if(n.prev=27,n.t0=n.catch(6),n.t0.code!==h.b.errors.SERVER_ERROR){n.next=31;break}throw n.t0;case 31:return n.prev=31,n.abrupt("return",Object(A.i)(o));case 35:return n.prev=35,n.t1=n.catch(31),n.abrupt("return",qc.throwError("bad result from backend",h.b.errors.SERVER_ERROR,{method:"call",params:{transaction:t,blockTag:e},result:o,error:n.t1}));case 38:case"end":return n.stop()}}),n,this,[[6,27],[31,35]])})))}},{key:"call",value:function(t,e){return Kc(this,void 0,void 0,Tc().mark((function r(){var n;return Tc().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,this.getNetwork();case 2:return r.next=4,M({transaction:this._getTransactionRequest(t),blockTag:this._getBlockTag(e),ccipReadEnabled:Promise.resolve(t.ccipReadEnabled)});case 4:return n=r.sent,r.abrupt("return",this._call(n.transaction,n.blockTag,n.ccipReadEnabled?0:-1));case 6:case"end":return r.stop()}}),r,this)})))}},{key:"estimateGas",value:function(t){return Kc(this,void 0,void 0,Tc().mark((function e(){var r,n;return Tc().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.getNetwork();case 2:return e.next=4,M({transaction:this._getTransactionRequest(t)});case 4:return r=e.sent,e.next=7,this.perform("estimateGas",r);case 7:return n=e.sent,e.prev=8,e.abrupt("return",b.from(n));case 12:return e.prev=12,e.t0=e.catch(8),e.abrupt("return",qc.throwError("bad result from backend",h.b.errors.SERVER_ERROR,{method:"estimateGas",params:r,result:n,error:e.t0}));case 15:case"end":return e.stop()}}),e,this,[[8,12]])})))}},{key:"_getAddress",value:function(t){return Kc(this,void 0,void 0,Tc().mark((function e(){var r;return Tc().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t;case 2:return"string"!=typeof(t=e.sent)&&qc.throwArgumentError("invalid address or ENS name","name",t),e.next=6,this.resolveName(t);case 6:return null==(r=e.sent)&&qc.throwError("ENS name not configured",h.b.errors.UNSUPPORTED_OPERATION,{operation:"resolveName(".concat(JSON.stringify(t),")")}),e.abrupt("return",r);case 9:case"end":return e.stop()}}),e,this)})))}},{key:"_getBlock",value:function(t,e){return Kc(this,void 0,void 0,Tc().mark((function r(){var n,i,o=this;return Tc().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,this.getNetwork();case 2:return r.next=4,t;case 4:if(t=r.sent,n=-128,i={includeTransactions:!!e},!Object(A.l)(t,32)){r.next=11;break}i.blockHash=t,r.next=21;break;case 11:return r.prev=11,r.next=14,this._getBlockTag(t);case 14:i.blockTag=r.sent,Object(A.l)(i.blockTag)&&(n=parseInt(i.blockTag.substring(2),16)),r.next=21;break;case 18:r.prev=18,r.t0=r.catch(11),qc.throwArgumentError("invalid block hash or block tag","blockHashOrBlockTag",t);case 21:return r.abrupt("return",wc((function(){return Kc(o,void 0,void 0,Tc().mark((function t(){var r,o,a,s,c,A,u=this;return Tc().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.perform("getBlock",i);case 2:if(null!=(r=t.sent)){t.next=11;break}if(null==i.blockHash){t.next=7;break}if(null!=this._emitted["b:"+i.blockHash]){t.next=7;break}return t.abrupt("return",null);case 7:if(null==i.blockTag){t.next=10;break}if(!(n>this._emitted.block)){t.next=10;break}return t.abrupt("return",null);case 10:return t.abrupt("return",void 0);case 11:if(!e){t.next=34;break}o=null,a=0;case 14:if(!(a<r.transactions.length)){t.next=31;break}if(null!=(s=r.transactions[a]).blockNumber){t.next=20;break}s.confirmations=0,t.next=28;break;case 20:if(null!=s.confirmations){t.next=28;break}if(null!=o){t.next=25;break}return t.next=24,this._getInternalBlockNumber(100+2*this.pollingInterval);case 24:o=t.sent;case 25:(c=o-s.blockNumber+1)<=0&&(c=1),s.confirmations=c;case 28:a++,t.next=14;break;case 31:return(A=this.formatter.blockWithTransactions(r)).transactions=A.transactions.map((function(t){return u._wrapTransaction(t)})),t.abrupt("return",A);case 34:return t.abrupt("return",this.formatter.block(r));case 35:case"end":return t.stop()}}),t,this)})))}),{oncePoll:this}));case 22:case"end":return r.stop()}}),r,this,[[11,18]])})))}},{key:"getBlock",value:function(t){return this._getBlock(t,!1)}},{key:"getBlockWithTransactions",value:function(t){return this._getBlock(t,!0)}},{key:"getTransaction",value:function(t){return Kc(this,void 0,void 0,Tc().mark((function e(){var r,n=this;return Tc().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.getNetwork();case 2:return e.next=4,t;case 4:return t=e.sent,r={transactionHash:this.formatter.hash(t,!0)},e.abrupt("return",wc((function(){return Kc(n,void 0,void 0,Tc().mark((function e(){var n,i,o,a;return Tc().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.perform("getTransaction",r);case 2:if(null!=(n=e.sent)){e.next=7;break}if(null!=this._emitted["t:"+t]){e.next=6;break}return e.abrupt("return",null);case 6:return e.abrupt("return",void 0);case 7:if(null!=(i=this.formatter.transactionResponse(n)).blockNumber){e.next=12;break}i.confirmations=0,e.next=19;break;case 12:if(null!=i.confirmations){e.next=19;break}return e.next=15,this._getInternalBlockNumber(100+2*this.pollingInterval);case 15:o=e.sent,(a=o-i.blockNumber+1)<=0&&(a=1),i.confirmations=a;case 19:return e.abrupt("return",this._wrapTransaction(i));case 20:case"end":return e.stop()}}),e,this)})))}),{oncePoll:this}));case 7:case"end":return e.stop()}}),e,this)})))}},{key:"getTransactionReceipt",value:function(t){return Kc(this,void 0,void 0,Tc().mark((function e(){var r,n=this;return Tc().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.getNetwork();case 2:return e.next=4,t;case 4:return t=e.sent,r={transactionHash:this.formatter.hash(t,!0)},e.abrupt("return",wc((function(){return Kc(n,void 0,void 0,Tc().mark((function e(){var n,i,o,a;return Tc().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.perform("getTransactionReceipt",r);case 2:if(null!=(n=e.sent)){e.next=7;break}if(null!=this._emitted["t:"+t]){e.next=6;break}return e.abrupt("return",null);case 6:return e.abrupt("return",void 0);case 7:if(null!=n.blockHash){e.next=9;break}return e.abrupt("return",void 0);case 9:if(null!=(i=this.formatter.receipt(n)).blockNumber){e.next=14;break}i.confirmations=0,e.next=21;break;case 14:if(null!=i.confirmations){e.next=21;break}return e.next=17,this._getInternalBlockNumber(100+2*this.pollingInterval);case 17:o=e.sent,(a=o-i.blockNumber+1)<=0&&(a=1),i.confirmations=a;case 21:return e.abrupt("return",i);case 22:case"end":return e.stop()}}),e,this)})))}),{oncePoll:this}));case 7:case"end":return e.stop()}}),e,this)})))}},{key:"getLogs",value:function(t){return Kc(this,void 0,void 0,Tc().mark((function e(){var r,n;return Tc().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.getNetwork();case 2:return e.next=4,M({filter:this._getFilter(t)});case 4:return r=e.sent,e.next=7,this.perform("getLogs",r);case 7:return(n=e.sent).forEach((function(t){null==t.removed&&(t.removed=!1)})),e.abrupt("return",Dc.arrayOf(this.formatter.filterLog.bind(this.formatter))(n));case 10:case"end":return e.stop()}}),e,this)})))}},{key:"getEtherPrice",value:function(){return Kc(this,void 0,void 0,Tc().mark((function t(){return Tc().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.getNetwork();case 2:return t.abrupt("return",this.perform("getEtherPrice",{}));case 3:case"end":return t.stop()}}),t,this)})))}},{key:"_getBlockTag",value:function(t){return Kc(this,void 0,void 0,Tc().mark((function e(){var r;return Tc().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t;case 2:if(!("number"==typeof(t=e.sent)&&t<0)){e.next=11;break}return t%1&&qc.throwArgumentError("invalid BlockTag","blockTag",t),e.next=7,this._getInternalBlockNumber(100+2*this.pollingInterval);case 7:return r=e.sent,(r+=t)<0&&(r=0),e.abrupt("return",this.formatter.blockTag(r));case 11:return e.abrupt("return",this.formatter.blockTag(t));case 12:case"end":return e.stop()}}),e,this)})))}},{key:"getResolver",value:function(t){return Kc(this,void 0,void 0,Tc().mark((function e(){var r,n,i;return Tc().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:r=t;case 1:if(""!==r&&"."!==r){e.next=4;break}return e.abrupt("return",null);case 4:if("eth"===t||"eth"!==r){e.next=6;break}return e.abrupt("return",null);case 6:return e.next=8,this._getResolver(r,"getResolver");case 8:if(null==(n=e.sent)){e.next=19;break}if(i=new fA(this,n,t),e.t0=r!==t,!e.t0){e.next=16;break}return e.next=15,i.supportsWildcard();case 15:e.t0=!e.sent;case 16:if(!e.t0){e.next=18;break}return e.abrupt("return",null);case 18:return e.abrupt("return",i);case 19:r=r.split(".").slice(1).join("."),e.next=1;break;case 22:case"end":return e.stop()}}),e,this)})))}},{key:"_getResolver",value:function(t,e){return Kc(this,void 0,void 0,Tc().mark((function r(){var n,i;return Tc().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return null==e&&(e="ENS"),r.next=3,this.getNetwork();case 3:return(n=r.sent).ensAddress||qc.throwError("network does not support ENS",h.b.errors.UNSUPPORTED_OPERATION,{operation:e,network:n.name}),r.prev=5,r.next=8,this.call({to:n.ensAddress,data:"0x0178b8bf"+uc(t).substring(2)});case 8:return i=r.sent,r.abrupt("return",this.formatter.callAddress(i));case 12:r.prev=12,r.t0=r.catch(5);case 14:return r.abrupt("return",null);case 15:case"end":return r.stop()}}),r,this,[[5,12]])})))}},{key:"resolveName",value:function(t){return Kc(this,void 0,void 0,Tc().mark((function e(){var r;return Tc().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t;case 2:return t=e.sent,e.prev=3,e.abrupt("return",Promise.resolve(this.formatter.address(t)));case 7:if(e.prev=7,e.t0=e.catch(3),!Object(A.l)(t)){e.next=11;break}throw e.t0;case 11:return"string"!=typeof t&&qc.throwArgumentError("invalid ENS name","name",t),e.next=14,this.getResolver(t);case 14:if(r=e.sent){e.next=17;break}return e.abrupt("return",null);case 17:return e.next=19,r.getAddress();case 19:return e.abrupt("return",e.sent);case 20:case"end":return e.stop()}}),e,this,[[3,7]])})))}},{key:"lookupAddress",value:function(t){return Kc(this,void 0,void 0,Tc().mark((function e(){var r,n,i;return Tc().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t;case 2:return t=e.sent,t=this.formatter.address(t),r=t.substring(2).toLowerCase()+".addr.reverse",e.next=7,this._getResolver(r,"lookupAddress");case 7:if(null!=(n=e.sent)){e.next=10;break}return e.abrupt("return",null);case 10:return e.t0=oA,e.next=13,this.call({to:n,data:"0x691f3431"+uc(r).substring(2)});case 13:return e.t1=e.sent,i=(0,e.t0)(e.t1,0),e.next=17,this.resolveName(i);case 17:if(e.sent==t){e.next=20;break}return e.abrupt("return",null);case 20:return e.abrupt("return",i);case 21:case"end":return e.stop()}}),e,this)})))}},{key:"getAvatar",value:function(t){return Kc(this,void 0,void 0,Tc().mark((function e(){var r,n,i,o,a,s,c;return Tc().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=null,!Object(A.l)(t)){e.next=40;break}return n=this.formatter.address(t),i=n.substring(2).toLowerCase()+".addr.reverse",e.next=6,this._getResolver(i,"getAvatar");case 6:if(o=e.sent){e.next=9;break}return e.abrupt("return",null);case 9:return r=new fA(this,o,i),e.prev=10,e.next=13,r.getAvatar();case 13:if(!(a=e.sent)){e.next=16;break}return e.abrupt("return",a.url);case 16:e.next=22;break;case 18:if(e.prev=18,e.t0=e.catch(10),e.t0.code===h.b.errors.CALL_EXCEPTION){e.next=22;break}throw e.t0;case 22:return e.prev=22,e.t1=oA,e.next=26,this.call({to:o,data:"0x691f3431"+uc(i).substring(2)});case 26:return e.t2=e.sent,s=(0,e.t1)(e.t2,0),e.next=30,this.getResolver(s);case 30:r=e.sent,e.next=38;break;case 33:if(e.prev=33,e.t3=e.catch(22),e.t3.code===h.b.errors.CALL_EXCEPTION){e.next=37;break}throw e.t3;case 37:return e.abrupt("return",null);case 38:e.next=45;break;case 40:return e.next=42,this.getResolver(t);case 42:if(r=e.sent){e.next=45;break}return e.abrupt("return",null);case 45:return e.next=47,r.getAvatar();case 47:if(null!=(c=e.sent)){e.next=50;break}return e.abrupt("return",null);case 50:return e.abrupt("return",c.url);case 51:case"end":return e.stop()}}),e,this,[[10,18],[22,33]])})))}},{key:"perform",value:function(t,e){return qc.throwError(t+" not implemented",h.b.errors.NOT_IMPLEMENTED,{operation:t})}},{key:"_startEvent",value:function(t){this.polling=this._events.filter((function(t){return t.pollable()})).length>0}},{key:"_stopEvent",value:function(t){this.polling=this._events.filter((function(t){return t.pollable()})).length>0}},{key:"_addEventListener",value:function(t,e,r){var n=new $c(Zc(t),e,r);return this._events.push(n),this._startEvent(n),this}},{key:"on",value:function(t,e){return this._addEventListener(t,e,!1)}},{key:"once",value:function(t,e){return this._addEventListener(t,e,!0)}},{key:"emit",value:function(t){for(var e=this,r=arguments.length,n=new Array(r>1?r-1:0),i=1;i<r;i++)n[i-1]=arguments[i];var o=!1,a=[],s=Zc(t);return this._events=this._events.filter((function(t){return t.tag!==s||(setTimeout((function(){t.listener.apply(e,n)}),0),o=!0,!t.once||(a.push(t),!1))})),a.forEach((function(t){e._stopEvent(t)})),o}},{key:"listenerCount",value:function(t){if(!t)return this._events.length;var e=Zc(t);return this._events.filter((function(t){return t.tag===e})).length}},{key:"listeners",value:function(t){if(null==t)return this._events.map((function(t){return t.listener}));var e=Zc(t);return this._events.filter((function(t){return t.tag===e})).map((function(t){return t.listener}))}},{key:"off",value:function(t,e){var r=this;if(null==e)return this.removeAllListeners(t);var n=[],i=!1,o=Zc(t);return this._events=this._events.filter((function(t){return t.tag!==o||t.listener!=e||(!!i||(i=!0,n.push(t),!1))})),n.forEach((function(t){r._stopEvent(t)})),this}},{key:"removeAllListeners",value:function(t){var e=this,r=[];if(null==t)r=this._events,this._events=[];else{var n=Zc(t);this._events=this._events.filter((function(t){return t.tag!==n||(r.push(t),!1)}))}return r.forEach((function(t){e._stopEvent(t)})),this}}],[{key:"getFormatter",value:function(){return null==hA&&(hA=new Dc),hA}},{key:"getNetwork",value:function(t){return Ms(null==t?"homestead":t)}}]),r}(kn);function gA(){return(gA="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,r){var n=pA(t,e);if(n){var i=Object.getOwnPropertyDescriptor(n,e);return i.get?i.get.call(arguments.length<3?t:r):i.value}}).apply(this,arguments)}function pA(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=QA(t)););return t}function yA(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */yA=function(){return t};var t={},e=Object.prototype,r=e.hasOwnProperty,n=Object.defineProperty||function(t,e,r){t[e]=r.value},i="function"==typeof Symbol?Symbol:{},o=i.iterator||"@@iterator",a=i.asyncIterator||"@@asyncIterator",s=i.toStringTag||"@@toStringTag";function c(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{c({},"")}catch(t){c=function(t,e,r){return t[e]=r}}function A(t,e,r,i){var o=e&&e.prototype instanceof h?e:h,a=Object.create(o.prototype),s=new B(i||[]);return n(a,"_invoke",{value:E(t,r,s)}),a}function u(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=A;var f={};function h(){}function l(){}function d(){}var g={};c(g,o,(function(){return this}));var p=Object.getPrototypeOf,y=p&&p(p(Q([])));y&&y!==e&&r.call(y,o)&&(g=y);var I=d.prototype=h.prototype=Object.create(g);function b(t){["next","throw","return"].forEach((function(e){c(t,e,(function(t){return this._invoke(e,t)}))}))}function v(t,e){var i;n(this,"_invoke",{value:function(n,o){function a(){return new e((function(i,a){!function n(i,o,a,s){var c=u(t[i],t,o);if("throw"!==c.type){var A=c.arg,f=A.value;return f&&"object"==kA(f)&&r.call(f,"__await")?e.resolve(f.__await).then((function(t){n("next",t,a,s)}),(function(t){n("throw",t,a,s)})):e.resolve(f).then((function(t){A.value=t,a(A)}),(function(t){return n("throw",t,a,s)}))}s(c.arg)}(n,o,i,a)}))}return i=i?i.then(a,a):a()}})}function E(t,e,r){var n="suspendedStart";return function(i,o){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===i)throw o;return k()}for(r.method=i,r.arg=o;;){var a=r.delegate;if(a){var s=m(a,r);if(s){if(s===f)continue;return s}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var c=u(t,e,r);if("normal"===c.type){if(n=r.done?"completed":"suspendedYield",c.arg===f)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(n="completed",r.method="throw",r.arg=c.arg)}}}function m(t,e){var r=e.method,n=t.iterator[r];if(void 0===n)return e.delegate=null,"throw"===r&&t.iterator.return&&(e.method="return",e.arg=void 0,m(t,e),"throw"===e.method)||"return"!==r&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+r+"' method")),f;var i=u(n,t.iterator,e.arg);if("throw"===i.type)return e.method="throw",e.arg=i.arg,e.delegate=null,f;var o=i.arg;return o?o.done?(e[t.resultName]=o.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,f):o:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,f)}function C(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function w(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function B(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(C,this),this.reset(!0)}function Q(t){if(t){var e=t[o];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,i=function e(){for(;++n<t.length;)if(r.call(t,n))return e.value=t[n],e.done=!1,e;return e.value=void 0,e.done=!0,e};return i.next=i}}return{next:k}}function k(){return{value:void 0,done:!0}}return l.prototype=d,n(I,"constructor",{value:d,configurable:!0}),n(d,"constructor",{value:l,configurable:!0}),l.displayName=c(d,s,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===l||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,d):(t.__proto__=d,c(t,s,"GeneratorFunction")),t.prototype=Object.create(I),t},t.awrap=function(t){return{__await:t}},b(v.prototype),c(v.prototype,a,(function(){return this})),t.AsyncIterator=v,t.async=function(e,r,n,i,o){void 0===o&&(o=Promise);var a=new v(A(e,r,n,i),o);return t.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},b(I),c(I,s,"Generator"),c(I,o,(function(){return this})),c(I,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},t.values=Q,B.prototype={constructor:B,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(w),!t)for(var e in this)"t"===e.charAt(0)&&r.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function n(r,n){return a.type="throw",a.arg=t,e.next=r,n&&(e.method="next",e.arg=void 0),!!n}for(var i=this.tryEntries.length-1;i>=0;--i){var o=this.tryEntries[i],a=o.completion;if("root"===o.tryLoc)return n("end");if(o.tryLoc<=this.prev){var s=r.call(o,"catchLoc"),c=r.call(o,"finallyLoc");if(s&&c){if(this.prev<o.catchLoc)return n(o.catchLoc,!0);if(this.prev<o.finallyLoc)return n(o.finallyLoc)}else if(s){if(this.prev<o.catchLoc)return n(o.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return n(o.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&r.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var o=i;break}}o&&("break"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc&&(o=null);var a=o?o.completion:{};return a.type=t,a.arg=e,o?(this.method="next",this.next=o.finallyLoc,f):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),f},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),w(r),f}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var i=n.arg;w(r)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:Q(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),f}},t}function IA(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function bA(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,(i=n.key,o=void 0,o=function(t,e){if("object"!==kA(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==kA(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(i,"string"),"symbol"===kA(o)?o:String(o)),n)}var i,o}function vA(t,e,r){return e&&bA(t.prototype,e),r&&bA(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function EA(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&mA(t,e)}function mA(t,e){return(mA=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}function CA(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=QA(t);if(e){var i=QA(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return wA(this,r)}}function wA(t,e){if(e&&("object"===kA(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return BA(t)}function BA(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function QA(t){return(QA=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function kA(t){return(kA="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var SA=function(t,e,r,n){return new(r||(r=Promise))((function(i,o){function a(t){try{c(n.next(t))}catch(t){o(t)}}function s(t){try{c(n.throw(t))}catch(t){o(t)}}function c(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(a,s)}c((n=n.apply(t,e||[])).next())}))},_A=new h.b("providers/5.7.2"),DA=["call","estimateGas"];function xA(t,e){if(null==t)return null;if("string"==typeof t.message&&t.message.match("reverted")){var r=Object(A.l)(t.data)?t.data:null;if(!e||r)return{message:t.message,data:r}}if("object"===kA(t)){for(var n in t){var i=xA(t[n],e);if(i)return i}return null}if("string"==typeof t)try{return xA(JSON.parse(t),e)}catch(t){}return null}function MA(t,e,r){var n=r.transaction||r.signedTransaction;if("call"===t){var i=xA(e,!0);if(i)return i.data;_A.throwError("missing revert data in call exception; Transaction reverted without a reason string",h.b.errors.CALL_EXCEPTION,{data:"0x",transaction:n,error:e})}if("estimateGas"===t){var o=xA(e.body,!1);null==o&&(o=xA(e,!1)),o&&_A.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",h.b.errors.UNPREDICTABLE_GAS_LIMIT,{reason:o.message,method:t,transaction:n,error:e})}var a=e.message;throw e.code===h.b.errors.SERVER_ERROR&&e.error&&"string"==typeof e.error.message?a=e.error.message:"string"==typeof e.body?a=e.body:"string"==typeof e.responseText&&(a=e.responseText),(a=(a||"").toLowerCase()).match(/insufficient funds|base fee exceeds gas limit|InsufficientFunds/i)&&_A.throwError("insufficient funds for intrinsic transaction cost",h.b.errors.INSUFFICIENT_FUNDS,{error:e,method:t,transaction:n}),a.match(/nonce (is )?too low/i)&&_A.throwError("nonce has already been used",h.b.errors.NONCE_EXPIRED,{error:e,method:t,transaction:n}),a.match(/replacement transaction underpriced|transaction gas price.*too low/i)&&_A.throwError("replacement fee too low",h.b.errors.REPLACEMENT_UNDERPRICED,{error:e,method:t,transaction:n}),a.match(/only replay-protected/i)&&_A.throwError("legacy pre-eip-155 transactions not supported",h.b.errors.UNSUPPORTED_OPERATION,{error:e,method:t,transaction:n}),DA.indexOf(t)>=0&&a.match(/gas required exceeds allowance|always failing transaction|execution reverted|revert/)&&_A.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",h.b.errors.UNPREDICTABLE_GAS_LIMIT,{error:e,method:t,transaction:n}),e}function RA(t){return new Promise((function(e){setTimeout(e,t)}))}function OA(t){if(t.error){var e=new Error(t.error.message);throw e.code=t.error.code,e.data=t.error.data,e}return t.result}function NA(t){return t?t.toLowerCase():t}var PA={},jA=function(t){EA(r,t);var e=CA(r);function r(t,n,i){var o;if(IA(this,r),o=e.call(this),t!==PA)throw new Error("do not call the JsonRpcSigner constructor directly; use provider.getSigner");return D(BA(o),"provider",n),null==i&&(i=0),"string"==typeof i?(D(BA(o),"_address",o.provider.formatter.address(i)),D(BA(o),"_index",null)):"number"==typeof i?(D(BA(o),"_index",i),D(BA(o),"_address",null)):_A.throwArgumentError("invalid address or index","addressOrIndex",i),o}return vA(r,[{key:"connect",value:function(t){return _A.throwError("cannot alter JSON-RPC Signer connection",h.b.errors.UNSUPPORTED_OPERATION,{operation:"connect"})}},{key:"connectUnchecked",value:function(){return new LA(PA,this.provider,this._address||this._index)}},{key:"getAddress",value:function(){var t=this;return this._address?Promise.resolve(this._address):this.provider.send("eth_accounts",[]).then((function(e){return e.length<=t._index&&_A.throwError("unknown account #"+t._index,h.b.errors.UNSUPPORTED_OPERATION,{operation:"getAddress"}),t.provider.formatter.address(e[t._index])}))}},{key:"sendUncheckedTransaction",value:function(t){var e=this;t=O(t);var r=this.getAddress().then((function(t){return t&&(t=t.toLowerCase()),t}));if(null==t.gasLimit){var n=O(t);n.from=r,t.gasLimit=this.provider.estimateGas(n)}return null!=t.to&&(t.to=Promise.resolve(t.to).then((function(t){return SA(e,void 0,void 0,yA().mark((function e(){var r;return yA().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!=t){e.next=2;break}return e.abrupt("return",null);case 2:return e.next=4,this.provider.resolveName(t);case 4:return null==(r=e.sent)&&_A.throwArgumentError("provided ENS name resolves to null","tx.to",t),e.abrupt("return",r);case 7:case"end":return e.stop()}}),e,this)})))}))),M({tx:M(t),sender:r}).then((function(r){var n=r.tx,i=r.sender;null!=n.from?n.from.toLowerCase()!==i&&_A.throwArgumentError("from address mismatch","transaction",t):n.from=i;var o=e.provider.constructor.hexlifyTransaction(n,{from:!0});return e.provider.send("eth_sendTransaction",[o]).then((function(t){return t}),(function(t){return"string"==typeof t.message&&t.message.match(/user denied/i)&&_A.throwError("user rejected transaction",h.b.errors.ACTION_REJECTED,{action:"sendTransaction",transaction:n}),MA("sendTransaction",t,o)}))}))}},{key:"signTransaction",value:function(t){return _A.throwError("signing transactions is unsupported",h.b.errors.UNSUPPORTED_OPERATION,{operation:"signTransaction"})}},{key:"sendTransaction",value:function(t){return SA(this,void 0,void 0,yA().mark((function e(){var r,n,i=this;return yA().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.provider._getInternalBlockNumber(100+2*this.provider.pollingInterval);case 2:return r=e.sent,e.next=5,this.sendUncheckedTransaction(t);case 5:return n=e.sent,e.prev=6,e.next=9,wc((function(){return SA(i,void 0,void 0,yA().mark((function t(){var e;return yA().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.provider.getTransaction(n);case 2:if(null!==(e=t.sent)){t.next=5;break}return t.abrupt("return",void 0);case 5:return t.abrupt("return",this.provider._wrapTransaction(e,n,r));case 6:case"end":return t.stop()}}),t,this)})))}),{oncePoll:this.provider});case 9:return e.abrupt("return",e.sent);case 12:throw e.prev=12,e.t0=e.catch(6),e.t0.transactionHash=n,e.t0;case 16:case"end":return e.stop()}}),e,this,[[6,12]])})))}},{key:"signMessage",value:function(t){return SA(this,void 0,void 0,yA().mark((function e(){var r,n;return yA().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r="string"==typeof t?Ct(t):t,e.next=3,this.getAddress();case 3:return n=e.sent,e.prev=4,e.next=7,this.provider.send("personal_sign",[Object(A.i)(r),n.toLowerCase()]);case 7:return e.abrupt("return",e.sent);case 10:throw e.prev=10,e.t0=e.catch(4),"string"==typeof e.t0.message&&e.t0.message.match(/user denied/i)&&_A.throwError("user rejected signing",h.b.errors.ACTION_REJECTED,{action:"signMessage",from:n,messageData:t}),e.t0;case 14:case"end":return e.stop()}}),e,this,[[4,10]])})))}},{key:"_legacySignMessage",value:function(t){return SA(this,void 0,void 0,yA().mark((function e(){var r,n;return yA().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r="string"==typeof t?Ct(t):t,e.next=3,this.getAddress();case 3:return n=e.sent,e.prev=4,e.next=7,this.provider.send("eth_sign",[n.toLowerCase(),Object(A.i)(r)]);case 7:return e.abrupt("return",e.sent);case 10:throw e.prev=10,e.t0=e.catch(4),"string"==typeof e.t0.message&&e.t0.message.match(/user denied/i)&&_A.throwError("user rejected signing",h.b.errors.ACTION_REJECTED,{action:"_legacySignMessage",from:n,messageData:t}),e.t0;case 14:case"end":return e.stop()}}),e,this,[[4,10]])})))}},{key:"_signTypedData",value:function(t,e,r){return SA(this,void 0,void 0,yA().mark((function n(){var i,o,a=this;return yA().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,xo.resolveNames(t,e,r,(function(t){return a.provider.resolveName(t)}));case 2:return i=n.sent,n.next=5,this.getAddress();case 5:return o=n.sent,n.prev=6,n.next=9,this.provider.send("eth_signTypedData_v4",[o.toLowerCase(),JSON.stringify(xo.getPayload(i.domain,e,i.value))]);case 9:return n.abrupt("return",n.sent);case 12:throw n.prev=12,n.t0=n.catch(6),"string"==typeof n.t0.message&&n.t0.message.match(/user denied/i)&&_A.throwError("user rejected signing",h.b.errors.ACTION_REJECTED,{action:"_signTypedData",from:o,messageData:{domain:i.domain,types:e,value:i.value}}),n.t0;case 16:case"end":return n.stop()}}),n,this,[[6,12]])})))}},{key:"unlock",value:function(t){return SA(this,void 0,void 0,yA().mark((function e(){var r,n;return yA().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=this.provider,e.next=3,this.getAddress();case 3:return n=e.sent,e.abrupt("return",r.send("personal_unlockAccount",[n.toLowerCase(),t,null]));case 5:case"end":return e.stop()}}),e,this)})))}}]),r}(Gn),LA=function(t){EA(r,t);var e=CA(r);function r(){return IA(this,r),e.apply(this,arguments)}return vA(r,[{key:"sendTransaction",value:function(t){var e=this;return this.sendUncheckedTransaction(t).then((function(t){return{hash:t,nonce:null,gasLimit:null,gasPrice:null,data:null,value:null,chainId:null,confirmations:0,from:null,wait:function(r){return e.provider.waitForTransaction(t,r)}}}))}}]),r}(jA),FA={chainId:!0,data:!0,gasLimit:!0,gasPrice:!0,nonce:!0,to:!0,value:!0,type:!0,accessList:!0,maxFeePerGas:!0,maxPriorityFeePerGas:!0},TA=function(t){EA(r,t);var e=CA(r);function r(t,n){var i;IA(this,r);var o=n;return null==o&&(o=new Promise((function(t,e){setTimeout((function(){i.detectNetwork().then((function(e){t(e)}),(function(t){e(t)}))}),0)}))),i=e.call(this,o),t||(t=x(i.constructor,"defaultUrl")()),D(BA(i),"connection","string"==typeof t?Object.freeze({url:t}):Object.freeze(O(t))),i._nextId=42,i}return vA(r,[{key:"_cache",get:function(){return null==this._eventLoopCache&&(this._eventLoopCache={}),this._eventLoopCache}},{key:"detectNetwork",value:function(){var t=this;return this._cache.detectNetwork||(this._cache.detectNetwork=this._uncachedDetectNetwork(),setTimeout((function(){t._cache.detectNetwork=null}),0)),this._cache.detectNetwork}},{key:"_uncachedDetectNetwork",value:function(){return SA(this,void 0,void 0,yA().mark((function t(){var e,r;return yA().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,RA(0);case 2:return e=null,t.prev=3,t.next=6,this.send("eth_chainId",[]);case 6:e=t.sent,t.next=19;break;case 9:return t.prev=9,t.t0=t.catch(3),t.prev=11,t.next=14,this.send("net_version",[]);case 14:e=t.sent,t.next=19;break;case 17:t.prev=17,t.t1=t.catch(11);case 19:if(null==e){t.next=28;break}return r=x(this.constructor,"getNetwork"),t.prev=21,t.abrupt("return",r(b.from(e).toNumber()));case 25:return t.prev=25,t.t2=t.catch(21),t.abrupt("return",_A.throwError("could not detect network",h.b.errors.NETWORK_ERROR,{chainId:e,event:"invalidNetwork",serverError:t.t2}));case 28:return t.abrupt("return",_A.throwError("could not detect network",h.b.errors.NETWORK_ERROR,{event:"noNetwork"}));case 29:case"end":return t.stop()}}),t,this,[[3,9],[11,17],[21,25]])})))}},{key:"getSigner",value:function(t){return new jA(PA,this,t)}},{key:"getUncheckedSigner",value:function(t){return this.getSigner(t).connectUnchecked()}},{key:"listAccounts",value:function(){var t=this;return this.send("eth_accounts",[]).then((function(e){return e.map((function(e){return t.formatter.address(e)}))}))}},{key:"send",value:function(t,e){var r=this,n={method:t,params:e,id:this._nextId++,jsonrpc:"2.0"};this.emit("debug",{action:"request",request:j(n),provider:this});var i=["eth_chainId","eth_blockNumber"].indexOf(t)>=0;if(i&&this._cache[t])return this._cache[t];var o=Cc(this.connection,JSON.stringify(n),OA).then((function(t){return r.emit("debug",{action:"response",request:n,response:t,provider:r}),t}),(function(t){throw r.emit("debug",{action:"response",error:t,request:n,provider:r}),t}));return i&&(this._cache[t]=o,setTimeout((function(){r._cache[t]=null}),0)),o}},{key:"prepareRequest",value:function(t,e){switch(t){case"getBlockNumber":return["eth_blockNumber",[]];case"getGasPrice":return["eth_gasPrice",[]];case"getBalance":return["eth_getBalance",[NA(e.address),e.blockTag]];case"getTransactionCount":return["eth_getTransactionCount",[NA(e.address),e.blockTag]];case"getCode":return["eth_getCode",[NA(e.address),e.blockTag]];case"getStorageAt":return["eth_getStorageAt",[NA(e.address),Object(A.h)(e.position,32),e.blockTag]];case"sendTransaction":return["eth_sendRawTransaction",[e.signedTransaction]];case"getBlock":return e.blockTag?["eth_getBlockByNumber",[e.blockTag,!!e.includeTransactions]]:e.blockHash?["eth_getBlockByHash",[e.blockHash,!!e.includeTransactions]]:null;case"getTransaction":return["eth_getTransactionByHash",[e.transactionHash]];case"getTransactionReceipt":return["eth_getTransactionReceipt",[e.transactionHash]];case"call":return["eth_call",[x(this.constructor,"hexlifyTransaction")(e.transaction,{from:!0}),e.blockTag]];case"estimateGas":return["eth_estimateGas",[x(this.constructor,"hexlifyTransaction")(e.transaction,{from:!0})]];case"getLogs":return e.filter&&null!=e.filter.address&&(e.filter.address=NA(e.filter.address)),["eth_getLogs",[e.filter]]}return null}},{key:"perform",value:function(t,e){return SA(this,void 0,void 0,yA().mark((function r(){var n,i,o;return yA().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if("call"!==t&&"estimateGas"!==t){r.next=8;break}if(!(n=e.transaction)||null==n.type||!b.from(n.type).isZero()){r.next=8;break}if(null!=n.maxFeePerGas||null!=n.maxPriorityFeePerGas){r.next=8;break}return r.next=6,this.getFeeData();case 6:null==(i=r.sent).maxFeePerGas&&null==i.maxPriorityFeePerGas&&((e=O(e)).transaction=O(n),delete e.transaction.type);case 8:return null==(o=this.prepareRequest(t,e))&&_A.throwError(t+" not implemented",h.b.errors.NOT_IMPLEMENTED,{operation:t}),r.prev=10,r.next=13,this.send(o[0],o[1]);case 13:return r.abrupt("return",r.sent);case 16:return r.prev=16,r.t0=r.catch(10),r.abrupt("return",MA(t,r.t0,e));case 19:case"end":return r.stop()}}),r,this,[[10,16]])})))}},{key:"_startEvent",value:function(t){"pending"===t.tag&&this._startPending(),gA(QA(r.prototype),"_startEvent",this).call(this,t)}},{key:"_startPending",value:function(){if(null==this._pendingFilter){var t=this,e=this.send("eth_newPendingTransactionFilter",[]);this._pendingFilter=e,e.then((function(r){return function n(){t.send("eth_getFilterChanges",[r]).then((function(r){if(t._pendingFilter!=e)return null;var n=Promise.resolve();return r.forEach((function(e){t._emitted["t:"+e.toLowerCase()]="pending",n=n.then((function(){return t.getTransaction(e).then((function(e){return t.emit("pending",e),null}))}))})),n.then((function(){return RA(1e3)}))})).then((function(){if(t._pendingFilter==e)return setTimeout((function(){n()}),0),null;t.send("eth_uninstallFilter",[r])})).catch((function(t){}))}(),r})).catch((function(t){}))}}},{key:"_stopEvent",value:function(t){"pending"===t.tag&&0===this.listenerCount("pending")&&(this._pendingFilter=null),gA(QA(r.prototype),"_stopEvent",this).call(this,t)}}],[{key:"defaultUrl",value:function(){return"http://localhost:8545"}},{key:"hexlifyTransaction",value:function(t,e){var r=O(FA);if(e)for(var n in e)e[n]&&(r[n]=!0);R(t,r);var i={};return["chainId","gasLimit","gasPrice","type","maxFeePerGas","maxPriorityFeePerGas","nonce","value"].forEach((function(e){if(null!=t[e]){var r=Object(A.g)(b.from(t[e]));"gasLimit"===e&&(e="gas"),i[e]=r}})),["from","to","data"].forEach((function(e){null!=t[e]&&(i[e]=Object(A.i)(t[e]))})),t.accessList&&(i.accessList=Ai(t.accessList)),i}}]),r}(dA),UA=null;try{if(null==(UA=WebSocket))throw new Error("inject please")}catch(t){var GA=new h.b("providers/5.7.2");UA=function(){GA.throwError("WebSockets not supported in this environment",h.b.errors.UNSUPPORTED_OPERATION,{operation:"new WebSocket()"})}}function HA(t){return(HA="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function YA(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */YA=function(){return t};var t={},e=Object.prototype,r=e.hasOwnProperty,n=Object.defineProperty||function(t,e,r){t[e]=r.value},i="function"==typeof Symbol?Symbol:{},o=i.iterator||"@@iterator",a=i.asyncIterator||"@@asyncIterator",s=i.toStringTag||"@@toStringTag";function c(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{c({},"")}catch(t){c=function(t,e,r){return t[e]=r}}function A(t,e,r,i){var o=e&&e.prototype instanceof h?e:h,a=Object.create(o.prototype),s=new B(i||[]);return n(a,"_invoke",{value:E(t,r,s)}),a}function u(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=A;var f={};function h(){}function l(){}function d(){}var g={};c(g,o,(function(){return this}));var p=Object.getPrototypeOf,y=p&&p(p(Q([])));y&&y!==e&&r.call(y,o)&&(g=y);var I=d.prototype=h.prototype=Object.create(g);function b(t){["next","throw","return"].forEach((function(e){c(t,e,(function(t){return this._invoke(e,t)}))}))}function v(t,e){var i;n(this,"_invoke",{value:function(n,o){function a(){return new e((function(i,a){!function n(i,o,a,s){var c=u(t[i],t,o);if("throw"!==c.type){var A=c.arg,f=A.value;return f&&"object"==HA(f)&&r.call(f,"__await")?e.resolve(f.__await).then((function(t){n("next",t,a,s)}),(function(t){n("throw",t,a,s)})):e.resolve(f).then((function(t){A.value=t,a(A)}),(function(t){return n("throw",t,a,s)}))}s(c.arg)}(n,o,i,a)}))}return i=i?i.then(a,a):a()}})}function E(t,e,r){var n="suspendedStart";return function(i,o){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===i)throw o;return k()}for(r.method=i,r.arg=o;;){var a=r.delegate;if(a){var s=m(a,r);if(s){if(s===f)continue;return s}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var c=u(t,e,r);if("normal"===c.type){if(n=r.done?"completed":"suspendedYield",c.arg===f)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(n="completed",r.method="throw",r.arg=c.arg)}}}function m(t,e){var r=e.method,n=t.iterator[r];if(void 0===n)return e.delegate=null,"throw"===r&&t.iterator.return&&(e.method="return",e.arg=void 0,m(t,e),"throw"===e.method)||"return"!==r&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+r+"' method")),f;var i=u(n,t.iterator,e.arg);if("throw"===i.type)return e.method="throw",e.arg=i.arg,e.delegate=null,f;var o=i.arg;return o?o.done?(e[t.resultName]=o.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,f):o:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,f)}function C(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function w(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function B(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(C,this),this.reset(!0)}function Q(t){if(t){var e=t[o];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,i=function e(){for(;++n<t.length;)if(r.call(t,n))return e.value=t[n],e.done=!1,e;return e.value=void 0,e.done=!0,e};return i.next=i}}return{next:k}}function k(){return{value:void 0,done:!0}}return l.prototype=d,n(I,"constructor",{value:d,configurable:!0}),n(d,"constructor",{value:l,configurable:!0}),l.displayName=c(d,s,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===l||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,d):(t.__proto__=d,c(t,s,"GeneratorFunction")),t.prototype=Object.create(I),t},t.awrap=function(t){return{__await:t}},b(v.prototype),c(v.prototype,a,(function(){return this})),t.AsyncIterator=v,t.async=function(e,r,n,i,o){void 0===o&&(o=Promise);var a=new v(A(e,r,n,i),o);return t.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},b(I),c(I,s,"Generator"),c(I,o,(function(){return this})),c(I,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},t.values=Q,B.prototype={constructor:B,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(w),!t)for(var e in this)"t"===e.charAt(0)&&r.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function n(r,n){return a.type="throw",a.arg=t,e.next=r,n&&(e.method="next",e.arg=void 0),!!n}for(var i=this.tryEntries.length-1;i>=0;--i){var o=this.tryEntries[i],a=o.completion;if("root"===o.tryLoc)return n("end");if(o.tryLoc<=this.prev){var s=r.call(o,"catchLoc"),c=r.call(o,"finallyLoc");if(s&&c){if(this.prev<o.catchLoc)return n(o.catchLoc,!0);if(this.prev<o.finallyLoc)return n(o.finallyLoc)}else if(s){if(this.prev<o.catchLoc)return n(o.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return n(o.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&r.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var o=i;break}}o&&("break"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc&&(o=null);var a=o?o.completion:{};return a.type=t,a.arg=e,o?(this.method="next",this.next=o.finallyLoc,f):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),f},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),w(r),f}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var i=n.arg;w(r)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:Q(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),f}},t}function KA(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,(i=n.key,o=void 0,o=function(t,e){if("object"!==HA(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==HA(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(i,"string"),"symbol"===HA(o)?o:String(o)),n)}var i,o}function qA(t,e){return(qA=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}function JA(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=XA(t);if(e){var i=XA(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return zA(this,r)}}function zA(t,e){if(e&&("object"===HA(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return ZA(t)}function ZA(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function VA(){return(VA="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,r){var n=WA(t,e);if(n){var i=Object.getOwnPropertyDescriptor(n,e);return i.get?i.get.call(arguments.length<3?t:r):i.value}}).apply(this,arguments)}function WA(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=XA(t)););return t}function XA(t){return(XA=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var $A=function(t,e,r,n){return new(r||(r=Promise))((function(i,o){function a(t){try{c(n.next(t))}catch(t){o(t)}}function s(t){try{c(n.throw(t))}catch(t){o(t)}}function c(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(a,s)}c((n=n.apply(t,e||[])).next())}))},tu=new h.b("providers/5.7.2"),eu=1,ru=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&qA(t,e)}(o,t);var e,r,n,i=JA(o);function o(t,e){var r,n;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,o),"any"===e&&tu.throwError("WebSocketProvider does not support 'any' network yet",h.b.errors.UNSUPPORTED_OPERATION,{operation:"network:any"}),(n="string"==typeof t?i.call(this,t,e):i.call(this,"_websocket",e))._pollingInterval=-1,n._wsReady=!1,D(ZA(n),"_websocket","string"==typeof t?new UA(n.connection.url):t),D(ZA(n),"_requests",{}),D(ZA(n),"_subs",{}),D(ZA(n),"_subIds",{}),D(ZA(n),"_detectNetwork",VA((r=ZA(n),XA(o.prototype)),"detectNetwork",r).call(r)),n.websocket.onopen=function(){n._wsReady=!0,Object.keys(n._requests).forEach((function(t){n.websocket.send(n._requests[t].payload)}))},n.websocket.onmessage=function(t){var e=t.data,r=JSON.parse(e);if(null!=r.id){var i=String(r.id),o=n._requests[i];if(delete n._requests[i],void 0!==r.result)o.callback(null,r.result),n.emit("debug",{action:"response",request:JSON.parse(o.payload),response:r.result,provider:ZA(n)});else{var a=null;r.error?(D(a=new Error(r.error.message||"unknown error"),"code",r.error.code||null),D(a,"response",e)):a=new Error("unknown error"),o.callback(a,void 0),n.emit("debug",{action:"response",error:a,request:JSON.parse(o.payload),provider:ZA(n)})}}else if("eth_subscription"===r.method){var s=n._subs[r.params.subscription];s&&s.processFunc(r.params.result)}else console.warn("this should not happen")};var a=setInterval((function(){n.emit("poll")}),1e3);return a.unref&&a.unref(),zA(n)}return e=o,n=[{key:"defaultUrl",value:function(){return"ws://localhost:8546"}}],(r=[{key:"websocket",get:function(){return this._websocket}},{key:"detectNetwork",value:function(){return this._detectNetwork}},{key:"pollingInterval",get:function(){return 0},set:function(t){tu.throwError("cannot set polling interval on WebSocketProvider",h.b.errors.UNSUPPORTED_OPERATION,{operation:"setPollingInterval"})}},{key:"resetEventsBlock",value:function(t){tu.throwError("cannot reset events block on WebSocketProvider",h.b.errors.UNSUPPORTED_OPERATION,{operation:"resetEventBlock"})}},{key:"poll",value:function(){return $A(this,void 0,void 0,YA().mark((function t(){return YA().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",null);case 1:case"end":return t.stop()}}),t)})))}},{key:"polling",set:function(t){t&&tu.throwError("cannot set polling on WebSocketProvider",h.b.errors.UNSUPPORTED_OPERATION,{operation:"setPolling"})}},{key:"send",value:function(t,e){var r=this,n=eu++;return new Promise((function(i,o){var a=JSON.stringify({method:t,params:e,id:n,jsonrpc:"2.0"});r.emit("debug",{action:"request",request:JSON.parse(a),provider:r}),r._requests[String(n)]={callback:function(t,e){return t?o(t):i(e)},payload:a},r._wsReady&&r.websocket.send(a)}))}},{key:"_subscribe",value:function(t,e,r){return $A(this,void 0,void 0,YA().mark((function n(){var i,o,a=this;return YA().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return null==(i=this._subIds[t])&&(i=Promise.all(e).then((function(t){return a.send("eth_subscribe",t)})),this._subIds[t]=i),n.next=4,i;case 4:o=n.sent,this._subs[o]={tag:t,processFunc:r};case 6:case"end":return n.stop()}}),n,this)})))}},{key:"_startEvent",value:function(t){var e=this;switch(t.type){case"block":this._subscribe("block",["newHeads"],(function(t){var r=b.from(t.number).toNumber();e._emitted.block=r,e.emit("block",r)}));break;case"pending":this._subscribe("pending",["newPendingTransactions"],(function(t){e.emit("pending",t)}));break;case"filter":this._subscribe(t.tag,["logs",this._getFilter(t.filter)],(function(r){null==r.removed&&(r.removed=!1),e.emit(t.filter,e.formatter.filterLog(r))}));break;case"tx":var r=function(t){var r=t.hash;e.getTransactionReceipt(r).then((function(t){t&&e.emit(r,t)}))};r(t),this._subscribe("tx",["newHeads"],(function(t){e._events.filter((function(t){return"tx"===t.type})).forEach(r)}));break;case"debug":case"poll":case"willPoll":case"didPoll":case"error":break;default:console.log("unhandled:",t)}}},{key:"_stopEvent",value:function(t){var e=this,r=t.tag;if("tx"===t.type){if(this._events.filter((function(t){return"tx"===t.type})).length)return;r="tx"}else if(this.listenerCount(t.event))return;var n=this._subIds[r];n&&(delete this._subIds[r],n.then((function(t){e._subs[t]&&(delete e._subs[t],e.send("eth_unsubscribe",[t]))})))}},{key:"destroy",value:function(){return $A(this,void 0,void 0,YA().mark((function t(){var e=this;return YA().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(this.websocket.readyState!==UA.CONNECTING){t.next=3;break}return t.next=3,new Promise((function(t){e.websocket.onopen=function(){t(!0)},e.websocket.onerror=function(){t(!1)}}));case 3:this.websocket.close(1e3);case 4:case"end":return t.stop()}}),t,this)})))}}])&&KA(e.prototype,r),n&&KA(e,n),Object.defineProperty(e,"prototype",{writable:!1}),o}(TA);function nu(t){return(nu="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function iu(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */iu=function(){return t};var t={},e=Object.prototype,r=e.hasOwnProperty,n=Object.defineProperty||function(t,e,r){t[e]=r.value},i="function"==typeof Symbol?Symbol:{},o=i.iterator||"@@iterator",a=i.asyncIterator||"@@asyncIterator",s=i.toStringTag||"@@toStringTag";function c(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{c({},"")}catch(t){c=function(t,e,r){return t[e]=r}}function A(t,e,r,i){var o=e&&e.prototype instanceof h?e:h,a=Object.create(o.prototype),s=new B(i||[]);return n(a,"_invoke",{value:E(t,r,s)}),a}function u(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=A;var f={};function h(){}function l(){}function d(){}var g={};c(g,o,(function(){return this}));var p=Object.getPrototypeOf,y=p&&p(p(Q([])));y&&y!==e&&r.call(y,o)&&(g=y);var I=d.prototype=h.prototype=Object.create(g);function b(t){["next","throw","return"].forEach((function(e){c(t,e,(function(t){return this._invoke(e,t)}))}))}function v(t,e){var i;n(this,"_invoke",{value:function(n,o){function a(){return new e((function(i,a){!function n(i,o,a,s){var c=u(t[i],t,o);if("throw"!==c.type){var A=c.arg,f=A.value;return f&&"object"==nu(f)&&r.call(f,"__await")?e.resolve(f.__await).then((function(t){n("next",t,a,s)}),(function(t){n("throw",t,a,s)})):e.resolve(f).then((function(t){A.value=t,a(A)}),(function(t){return n("throw",t,a,s)}))}s(c.arg)}(n,o,i,a)}))}return i=i?i.then(a,a):a()}})}function E(t,e,r){var n="suspendedStart";return function(i,o){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===i)throw o;return k()}for(r.method=i,r.arg=o;;){var a=r.delegate;if(a){var s=m(a,r);if(s){if(s===f)continue;return s}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var c=u(t,e,r);if("normal"===c.type){if(n=r.done?"completed":"suspendedYield",c.arg===f)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(n="completed",r.method="throw",r.arg=c.arg)}}}function m(t,e){var r=e.method,n=t.iterator[r];if(void 0===n)return e.delegate=null,"throw"===r&&t.iterator.return&&(e.method="return",e.arg=void 0,m(t,e),"throw"===e.method)||"return"!==r&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+r+"' method")),f;var i=u(n,t.iterator,e.arg);if("throw"===i.type)return e.method="throw",e.arg=i.arg,e.delegate=null,f;var o=i.arg;return o?o.done?(e[t.resultName]=o.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,f):o:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,f)}function C(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function w(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function B(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(C,this),this.reset(!0)}function Q(t){if(t){var e=t[o];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,i=function e(){for(;++n<t.length;)if(r.call(t,n))return e.value=t[n],e.done=!1,e;return e.value=void 0,e.done=!0,e};return i.next=i}}return{next:k}}function k(){return{value:void 0,done:!0}}return l.prototype=d,n(I,"constructor",{value:d,configurable:!0}),n(d,"constructor",{value:l,configurable:!0}),l.displayName=c(d,s,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===l||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,d):(t.__proto__=d,c(t,s,"GeneratorFunction")),t.prototype=Object.create(I),t},t.awrap=function(t){return{__await:t}},b(v.prototype),c(v.prototype,a,(function(){return this})),t.AsyncIterator=v,t.async=function(e,r,n,i,o){void 0===o&&(o=Promise);var a=new v(A(e,r,n,i),o);return t.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},b(I),c(I,s,"Generator"),c(I,o,(function(){return this})),c(I,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},t.values=Q,B.prototype={constructor:B,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(w),!t)for(var e in this)"t"===e.charAt(0)&&r.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function n(r,n){return a.type="throw",a.arg=t,e.next=r,n&&(e.method="next",e.arg=void 0),!!n}for(var i=this.tryEntries.length-1;i>=0;--i){var o=this.tryEntries[i],a=o.completion;if("root"===o.tryLoc)return n("end");if(o.tryLoc<=this.prev){var s=r.call(o,"catchLoc"),c=r.call(o,"finallyLoc");if(s&&c){if(this.prev<o.catchLoc)return n(o.catchLoc,!0);if(this.prev<o.finallyLoc)return n(o.finallyLoc)}else if(s){if(this.prev<o.catchLoc)return n(o.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return n(o.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&r.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var o=i;break}}o&&("break"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc&&(o=null);var a=o?o.completion:{};return a.type=t,a.arg=e,o?(this.method="next",this.next=o.finallyLoc,f):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),f},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),w(r),f}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var i=n.arg;w(r)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:Q(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),f}},t}function ou(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function au(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,(i=n.key,o=void 0,o=function(t,e){if("object"!==nu(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==nu(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(i,"string"),"symbol"===nu(o)?o:String(o)),n)}var i,o}function su(t,e,r){return e&&au(t.prototype,e),r&&au(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function cu(){return(cu="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,r){var n=Au(t,e);if(n){var i=Object.getOwnPropertyDescriptor(n,e);return i.get?i.get.call(arguments.length<3?t:r):i.value}}).apply(this,arguments)}function Au(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=gu(t)););return t}function uu(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&fu(t,e)}function fu(t,e){return(fu=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}function hu(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=gu(t);if(e){var i=gu(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return lu(this,r)}}function lu(t,e){if(e&&("object"===nu(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return du(t)}function du(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function gu(t){return(gu=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var pu=function(t,e,r,n){return new(r||(r=Promise))((function(i,o){function a(t){try{c(n.next(t))}catch(t){o(t)}}function s(t){try{c(n.throw(t))}catch(t){o(t)}}function c(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(a,s)}c((n=n.apply(t,e||[])).next())}))},yu=new h.b("providers/5.7.2"),Iu=function(t){uu(r,t);var e=hu(r);function r(){return ou(this,r),e.apply(this,arguments)}return su(r,[{key:"detectNetwork",value:function(){var t=this,e=Object.create(null,{detectNetwork:{get:function(){return cu(gu(r.prototype),"detectNetwork",t)}}});return pu(this,void 0,void 0,iu().mark((function t(){var r;return iu().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(null!=(r=this.network)){t.next=7;break}return t.next=4,e.detectNetwork.call(this);case 4:(r=t.sent)||yu.throwError("no network detected",h.b.errors.UNKNOWN_ERROR,{}),null==this._network&&(D(this,"_network",r),this.emit("network",r,null));case 7:return t.abrupt("return",r);case 8:case"end":return t.stop()}}),t,this)})))}}]),r}(TA),bu=function(t){uu(r,t);var e=hu(r);function r(t,n){var i;ou(this,r),yu.checkAbstract(this instanceof r?this.constructor:void 0,r),t=x(this instanceof r?this.constructor:void 0,"getNetwork")(t),n=x(this instanceof r?this.constructor:void 0,"getApiKey")(n);var o=x(this instanceof r?this.constructor:void 0,"getUrl")(t,n);return i=e.call(this,o,t),"string"==typeof n?D(du(i),"apiKey",n):null!=n&&Object.keys(n).forEach((function(t){D(du(i),t,n[t])})),i}return su(r,[{key:"_startPending",value:function(){yu.warn("WARNING: API provider does not support pending filters")}},{key:"isCommunityResource",value:function(){return!1}},{key:"getSigner",value:function(t){return yu.throwError("API provider does not support signing",h.b.errors.UNSUPPORTED_OPERATION,{operation:"getSigner"})}},{key:"listAccounts",value:function(){return Promise.resolve([])}}],[{key:"getApiKey",value:function(t){return t}},{key:"getUrl",value:function(t,e){return yu.throwError("not implemented; sub-classes must override getUrl",h.b.errors.NOT_IMPLEMENTED,{operation:"getUrl"})}}]),r}(Iu);function vu(t){return(vu="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Eu(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function mu(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,(i=n.key,o=void 0,o=function(t,e){if("object"!==vu(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==vu(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(i,"string"),"symbol"===vu(o)?o:String(o)),n)}var i,o}function Cu(t,e,r){return e&&mu(t.prototype,e),r&&mu(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function wu(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Bu(t,e)}function Bu(t,e){return(Bu=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}function Qu(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=_u(t);if(e){var i=_u(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return ku(this,r)}}function ku(t,e){if(e&&("object"===vu(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return Su(t)}function Su(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function _u(t){return(_u=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var Du=new h.b("providers/5.7.2"),xu="_gg7wSSi0KMBsdKnGVfHDueq6xMB9EkC",Mu=function(t){wu(r,t);var e=Qu(r);function r(t,n){var i;Eu(this,r);var o=new Ru(t,n),a=o.connection.url.replace(/^http/i,"ws").replace(".alchemyapi.",".ws.alchemyapi.");return D(Su(i=e.call(this,a,o.network)),"apiKey",o.apiKey),i}return Cu(r,[{key:"isCommunityResource",value:function(){return this.apiKey===xu}}]),r}(ru),Ru=function(t){wu(r,t);var e=Qu(r);function r(){return Eu(this,r),e.apply(this,arguments)}return Cu(r,[{key:"isCommunityResource",value:function(){return this.apiKey===xu}}],[{key:"getWebSocketProvider",value:function(t,e){return new Mu(t,e)}},{key:"getApiKey",value:function(t){return null==t?xu:(t&&"string"!=typeof t&&Du.throwArgumentError("invalid apiKey","apiKey",t),t)}},{key:"getUrl",value:function(t,e){var r=null;switch(t.name){case"homestead":r="eth-mainnet.alchemyapi.io/v2/";break;case"goerli":r="eth-goerli.g.alchemy.com/v2/";break;case"matic":r="polygon-mainnet.g.alchemy.com/v2/";break;case"maticmum":r="polygon-mumbai.g.alchemy.com/v2/";break;case"arbitrum":r="arb-mainnet.g.alchemy.com/v2/";break;case"arbitrum-goerli":r="arb-goerli.g.alchemy.com/v2/";break;case"optimism":r="opt-mainnet.g.alchemy.com/v2/";break;case"optimism-goerli":r="opt-goerli.g.alchemy.com/v2/";break;default:Du.throwArgumentError("unsupported network","network",arguments[0])}return{allowGzip:!0,url:"https://"+r+e,throttleCallback:function(t,r){return e===xu&&Oc(),Promise.resolve(!0)}}}}]),r}(bu);function Ou(t){return(Ou="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Nu(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Pu(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,(i=n.key,o=void 0,o=function(t,e){if("object"!==Ou(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==Ou(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(i,"string"),"symbol"===Ou(o)?o:String(o)),n)}var i,o}function ju(t,e){return(ju=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}function Lu(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=Tu(t);if(e){var i=Tu(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return Fu(this,r)}}function Fu(t,e){if(e&&("object"===Ou(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function Tu(t){return(Tu=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var Uu=new h.b("providers/5.7.2"),Gu="9f7d929b018cdffb338517efa06f58359e86ff1ffd350bc889738523659e7972";function Hu(t){switch(t){case"homestead":return"rpc.ankr.com/eth/";case"ropsten":return"rpc.ankr.com/eth_ropsten/";case"rinkeby":return"rpc.ankr.com/eth_rinkeby/";case"goerli":return"rpc.ankr.com/eth_goerli/";case"matic":return"rpc.ankr.com/polygon/";case"arbitrum":return"rpc.ankr.com/arbitrum/"}return Uu.throwArgumentError("unsupported network","name",t)}var Yu=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&ju(t,e)}(o,t);var e,r,n,i=Lu(o);function o(){return Nu(this,o),i.apply(this,arguments)}return e=o,n=[{key:"getApiKey",value:function(t){return null==t?Gu:t}},{key:"getUrl",value:function(t,e){null==e&&(e=Gu);var r={allowGzip:!0,url:"https://"+Hu(t.name)+e,throttleCallback:function(t,r){return e.apiKey===Gu&&Oc(),Promise.resolve(!0)}};return null!=e.projectSecret&&(r.user="",r.password=e.projectSecret),r}}],(r=[{key:"isCommunityResource",value:function(){return this.apiKey===Gu}}])&&Pu(e.prototype,r),n&&Pu(e,n),Object.defineProperty(e,"prototype",{writable:!1}),o}(bu);function Ku(t){return(Ku="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function qu(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */qu=function(){return t};var t={},e=Object.prototype,r=e.hasOwnProperty,n=Object.defineProperty||function(t,e,r){t[e]=r.value},i="function"==typeof Symbol?Symbol:{},o=i.iterator||"@@iterator",a=i.asyncIterator||"@@asyncIterator",s=i.toStringTag||"@@toStringTag";function c(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{c({},"")}catch(t){c=function(t,e,r){return t[e]=r}}function A(t,e,r,i){var o=e&&e.prototype instanceof h?e:h,a=Object.create(o.prototype),s=new B(i||[]);return n(a,"_invoke",{value:E(t,r,s)}),a}function u(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=A;var f={};function h(){}function l(){}function d(){}var g={};c(g,o,(function(){return this}));var p=Object.getPrototypeOf,y=p&&p(p(Q([])));y&&y!==e&&r.call(y,o)&&(g=y);var I=d.prototype=h.prototype=Object.create(g);function b(t){["next","throw","return"].forEach((function(e){c(t,e,(function(t){return this._invoke(e,t)}))}))}function v(t,e){var i;n(this,"_invoke",{value:function(n,o){function a(){return new e((function(i,a){!function n(i,o,a,s){var c=u(t[i],t,o);if("throw"!==c.type){var A=c.arg,f=A.value;return f&&"object"==Ku(f)&&r.call(f,"__await")?e.resolve(f.__await).then((function(t){n("next",t,a,s)}),(function(t){n("throw",t,a,s)})):e.resolve(f).then((function(t){A.value=t,a(A)}),(function(t){return n("throw",t,a,s)}))}s(c.arg)}(n,o,i,a)}))}return i=i?i.then(a,a):a()}})}function E(t,e,r){var n="suspendedStart";return function(i,o){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===i)throw o;return k()}for(r.method=i,r.arg=o;;){var a=r.delegate;if(a){var s=m(a,r);if(s){if(s===f)continue;return s}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var c=u(t,e,r);if("normal"===c.type){if(n=r.done?"completed":"suspendedYield",c.arg===f)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(n="completed",r.method="throw",r.arg=c.arg)}}}function m(t,e){var r=e.method,n=t.iterator[r];if(void 0===n)return e.delegate=null,"throw"===r&&t.iterator.return&&(e.method="return",e.arg=void 0,m(t,e),"throw"===e.method)||"return"!==r&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+r+"' method")),f;var i=u(n,t.iterator,e.arg);if("throw"===i.type)return e.method="throw",e.arg=i.arg,e.delegate=null,f;var o=i.arg;return o?o.done?(e[t.resultName]=o.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,f):o:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,f)}function C(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function w(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function B(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(C,this),this.reset(!0)}function Q(t){if(t){var e=t[o];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,i=function e(){for(;++n<t.length;)if(r.call(t,n))return e.value=t[n],e.done=!1,e;return e.value=void 0,e.done=!0,e};return i.next=i}}return{next:k}}function k(){return{value:void 0,done:!0}}return l.prototype=d,n(I,"constructor",{value:d,configurable:!0}),n(d,"constructor",{value:l,configurable:!0}),l.displayName=c(d,s,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===l||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,d):(t.__proto__=d,c(t,s,"GeneratorFunction")),t.prototype=Object.create(I),t},t.awrap=function(t){return{__await:t}},b(v.prototype),c(v.prototype,a,(function(){return this})),t.AsyncIterator=v,t.async=function(e,r,n,i,o){void 0===o&&(o=Promise);var a=new v(A(e,r,n,i),o);return t.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},b(I),c(I,s,"Generator"),c(I,o,(function(){return this})),c(I,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},t.values=Q,B.prototype={constructor:B,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(w),!t)for(var e in this)"t"===e.charAt(0)&&r.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function n(r,n){return a.type="throw",a.arg=t,e.next=r,n&&(e.method="next",e.arg=void 0),!!n}for(var i=this.tryEntries.length-1;i>=0;--i){var o=this.tryEntries[i],a=o.completion;if("root"===o.tryLoc)return n("end");if(o.tryLoc<=this.prev){var s=r.call(o,"catchLoc"),c=r.call(o,"finallyLoc");if(s&&c){if(this.prev<o.catchLoc)return n(o.catchLoc,!0);if(this.prev<o.finallyLoc)return n(o.finallyLoc)}else if(s){if(this.prev<o.catchLoc)return n(o.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return n(o.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&r.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var o=i;break}}o&&("break"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc&&(o=null);var a=o?o.completion:{};return a.type=t,a.arg=e,o?(this.method="next",this.next=o.finallyLoc,f):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),f},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),w(r),f}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var i=n.arg;w(r)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:Q(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),f}},t}function Ju(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function zu(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,(i=n.key,o=void 0,o=function(t,e){if("object"!==Ku(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==Ku(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(i,"string"),"symbol"===Ku(o)?o:String(o)),n)}var i,o}function Zu(){return(Zu="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,r){var n=Vu(t,e);if(n){var i=Object.getOwnPropertyDescriptor(n,e);return i.get?i.get.call(arguments.length<3?t:r):i.value}}).apply(this,arguments)}function Vu(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=tf(t)););return t}function Wu(t,e){return(Wu=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}function Xu(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=tf(t);if(e){var i=tf(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return $u(this,r)}}function $u(t,e){if(e&&("object"===Ku(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function tf(t){return(tf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var ef=function(t,e,r,n){return new(r||(r=Promise))((function(i,o){function a(t){try{c(n.next(t))}catch(t){o(t)}}function s(t){try{c(n.throw(t))}catch(t){o(t)}}function c(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(a,s)}c((n=n.apply(t,e||[])).next())}))},rf=new h.b("providers/5.7.2"),nf=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Wu(t,e)}(o,t);var e,r,n,i=Xu(o);function o(){return Ju(this,o),i.apply(this,arguments)}return e=o,n=[{key:"getApiKey",value:function(t){return null!=t&&rf.throwArgumentError("apiKey not supported for cloudflare","apiKey",t),null}},{key:"getUrl",value:function(t,e){var r=null;switch(t.name){case"homestead":r="https://cloudflare-eth.com/";break;default:rf.throwArgumentError("unsupported network","network",arguments[0])}return r}}],(r=[{key:"perform",value:function(t,e){var r=this,n=Object.create(null,{perform:{get:function(){return Zu(tf(o.prototype),"perform",r)}}});return ef(this,void 0,void 0,qu().mark((function r(){var i;return qu().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if("getBlockNumber"!==t){r.next=5;break}return r.next=3,n.perform.call(this,"getBlock",{blockTag:"latest"});case 3:return i=r.sent,r.abrupt("return",i.number);case 5:return r.abrupt("return",n.perform.call(this,t,e));case 6:case"end":return r.stop()}}),r,this)})))}}])&&zu(e.prototype,r),n&&zu(e,n),Object.defineProperty(e,"prototype",{writable:!1}),o}(bu);function of(t){return(of="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function af(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */af=function(){return t};var t={},e=Object.prototype,r=e.hasOwnProperty,n=Object.defineProperty||function(t,e,r){t[e]=r.value},i="function"==typeof Symbol?Symbol:{},o=i.iterator||"@@iterator",a=i.asyncIterator||"@@asyncIterator",s=i.toStringTag||"@@toStringTag";function c(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{c({},"")}catch(t){c=function(t,e,r){return t[e]=r}}function A(t,e,r,i){var o=e&&e.prototype instanceof h?e:h,a=Object.create(o.prototype),s=new B(i||[]);return n(a,"_invoke",{value:E(t,r,s)}),a}function u(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=A;var f={};function h(){}function l(){}function d(){}var g={};c(g,o,(function(){return this}));var p=Object.getPrototypeOf,y=p&&p(p(Q([])));y&&y!==e&&r.call(y,o)&&(g=y);var I=d.prototype=h.prototype=Object.create(g);function b(t){["next","throw","return"].forEach((function(e){c(t,e,(function(t){return this._invoke(e,t)}))}))}function v(t,e){var i;n(this,"_invoke",{value:function(n,o){function a(){return new e((function(i,a){!function n(i,o,a,s){var c=u(t[i],t,o);if("throw"!==c.type){var A=c.arg,f=A.value;return f&&"object"==of(f)&&r.call(f,"__await")?e.resolve(f.__await).then((function(t){n("next",t,a,s)}),(function(t){n("throw",t,a,s)})):e.resolve(f).then((function(t){A.value=t,a(A)}),(function(t){return n("throw",t,a,s)}))}s(c.arg)}(n,o,i,a)}))}return i=i?i.then(a,a):a()}})}function E(t,e,r){var n="suspendedStart";return function(i,o){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===i)throw o;return k()}for(r.method=i,r.arg=o;;){var a=r.delegate;if(a){var s=m(a,r);if(s){if(s===f)continue;return s}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var c=u(t,e,r);if("normal"===c.type){if(n=r.done?"completed":"suspendedYield",c.arg===f)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(n="completed",r.method="throw",r.arg=c.arg)}}}function m(t,e){var r=e.method,n=t.iterator[r];if(void 0===n)return e.delegate=null,"throw"===r&&t.iterator.return&&(e.method="return",e.arg=void 0,m(t,e),"throw"===e.method)||"return"!==r&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+r+"' method")),f;var i=u(n,t.iterator,e.arg);if("throw"===i.type)return e.method="throw",e.arg=i.arg,e.delegate=null,f;var o=i.arg;return o?o.done?(e[t.resultName]=o.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,f):o:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,f)}function C(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function w(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function B(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(C,this),this.reset(!0)}function Q(t){if(t){var e=t[o];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,i=function e(){for(;++n<t.length;)if(r.call(t,n))return e.value=t[n],e.done=!1,e;return e.value=void 0,e.done=!0,e};return i.next=i}}return{next:k}}function k(){return{value:void 0,done:!0}}return l.prototype=d,n(I,"constructor",{value:d,configurable:!0}),n(d,"constructor",{value:l,configurable:!0}),l.displayName=c(d,s,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===l||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,d):(t.__proto__=d,c(t,s,"GeneratorFunction")),t.prototype=Object.create(I),t},t.awrap=function(t){return{__await:t}},b(v.prototype),c(v.prototype,a,(function(){return this})),t.AsyncIterator=v,t.async=function(e,r,n,i,o){void 0===o&&(o=Promise);var a=new v(A(e,r,n,i),o);return t.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},b(I),c(I,s,"Generator"),c(I,o,(function(){return this})),c(I,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},t.values=Q,B.prototype={constructor:B,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(w),!t)for(var e in this)"t"===e.charAt(0)&&r.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function n(r,n){return a.type="throw",a.arg=t,e.next=r,n&&(e.method="next",e.arg=void 0),!!n}for(var i=this.tryEntries.length-1;i>=0;--i){var o=this.tryEntries[i],a=o.completion;if("root"===o.tryLoc)return n("end");if(o.tryLoc<=this.prev){var s=r.call(o,"catchLoc"),c=r.call(o,"finallyLoc");if(s&&c){if(this.prev<o.catchLoc)return n(o.catchLoc,!0);if(this.prev<o.finallyLoc)return n(o.finallyLoc)}else if(s){if(this.prev<o.catchLoc)return n(o.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return n(o.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&r.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var o=i;break}}o&&("break"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc&&(o=null);var a=o?o.completion:{};return a.type=t,a.arg=e,o?(this.method="next",this.next=o.finallyLoc,f):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),f},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),w(r),f}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var i=n.arg;w(r)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:Q(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),f}},t}function sf(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,(i=n.key,o=void 0,o=function(t,e){if("object"!==of(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==of(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(i,"string"),"symbol"===of(o)?o:String(o)),n)}var i,o}function cf(){return(cf="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,r){var n=Af(t,e);if(n){var i=Object.getOwnPropertyDescriptor(n,e);return i.get?i.get.call(arguments.length<3?t:r):i.value}}).apply(this,arguments)}function Af(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=df(t)););return t}function uf(t,e){return(uf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}function ff(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=df(t);if(e){var i=df(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return hf(this,r)}}function hf(t,e){if(e&&("object"===of(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return lf(t)}function lf(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function df(t){return(df=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var gf=function(t,e,r,n){return new(r||(r=Promise))((function(i,o){function a(t){try{c(n.next(t))}catch(t){o(t)}}function s(t){try{c(n.throw(t))}catch(t){o(t)}}function c(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(a,s)}c((n=n.apply(t,e||[])).next())}))},pf=new h.b("providers/5.7.2");function yf(t){var e={};for(var r in t)if(null!=t[r]){var n=t[r];"type"===r&&0===n||(n={type:!0,gasLimit:!0,gasPrice:!0,maxFeePerGs:!0,maxPriorityFeePerGas:!0,nonce:!0,value:!0}[r]?Object(A.g)(Object(A.i)(n)):"accessList"===r?"["+Ai(n).map((function(t){return'{address:"'.concat(t.address,'",storageKeys:["').concat(t.storageKeys.join('","'),'"]}')})).join(",")+"]":Object(A.i)(n),e[r]=n)}return e}function If(t){if(0==t.status&&("No records found"===t.message||"No transactions found"===t.message))return t.result;if(1!=t.status||"string"!=typeof t.message||!t.message.match(/^OK/)){var e=new Error("invalid response");throw e.result=JSON.stringify(t),(t.result||"").toLowerCase().indexOf("rate limit")>=0&&(e.throttleRetry=!0),e}return t.result}function bf(t){if(t&&0==t.status&&"NOTOK"==t.message&&(t.result||"").toLowerCase().indexOf("rate limit")>=0){var e=new Error("throttled response");throw e.result=JSON.stringify(t),e.throttleRetry=!0,e}if("2.0"!=t.jsonrpc){var r=new Error("invalid response");throw r.result=JSON.stringify(t),r}if(t.error){var n=new Error(t.error.message||"unknown error");throw t.error.code&&(n.code=t.error.code),t.error.data&&(n.data=t.error.data),n}return t.result}function vf(t){if("pending"===t)throw new Error("pending not supported");return"latest"===t?t:parseInt(t.substring(2),16)}function Ef(t,e,r){if("call"===t&&e.code===h.b.errors.SERVER_ERROR){var n=e.error;if(n&&(n.message.match(/reverted/i)||n.message.match(/VM execution error/i))){var i=n.data;if(i&&(i="0x"+i.replace(/^.*0x/i,"")),Object(A.l)(i))return i;pf.throwError("missing revert data in call exception",h.b.errors.CALL_EXCEPTION,{error:e,data:"0x"})}}var o=e.message;throw e.code===h.b.errors.SERVER_ERROR&&(e.error&&"string"==typeof e.error.message?o=e.error.message:"string"==typeof e.body?o=e.body:"string"==typeof e.responseText&&(o=e.responseText)),(o=(o||"").toLowerCase()).match(/insufficient funds/)&&pf.throwError("insufficient funds for intrinsic transaction cost",h.b.errors.INSUFFICIENT_FUNDS,{error:e,method:t,transaction:r}),o.match(/same hash was already imported|transaction nonce is too low|nonce too low/)&&pf.throwError("nonce has already been used",h.b.errors.NONCE_EXPIRED,{error:e,method:t,transaction:r}),o.match(/another transaction with same nonce/)&&pf.throwError("replacement fee too low",h.b.errors.REPLACEMENT_UNDERPRICED,{error:e,method:t,transaction:r}),o.match(/execution failed due to an exception|execution reverted/)&&pf.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",h.b.errors.UNPREDICTABLE_GAS_LIMIT,{error:e,method:t,transaction:r}),e}var mf=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&uf(t,e)}(o,t);var e,r,n,i=ff(o);function o(t,e){var r;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,o),D(lf(r=i.call(this,t)),"baseUrl",r.getBaseUrl()),D(lf(r),"apiKey",e||null),r}return e=o,(r=[{key:"getBaseUrl",value:function(){switch(this.network?this.network.name:"invalid"){case"homestead":return"https://api.etherscan.io";case"goerli":return"https://api-goerli.etherscan.io";case"sepolia":return"https://api-sepolia.etherscan.io";case"matic":return"https://api.polygonscan.com";case"maticmum":return"https://api-testnet.polygonscan.com";case"arbitrum":return"https://api.arbiscan.io";case"arbitrum-goerli":return"https://api-goerli.arbiscan.io";case"optimism":return"https://api-optimistic.etherscan.io";case"optimism-goerli":return"https://api-goerli-optimistic.etherscan.io"}return pf.throwArgumentError("unsupported network","network",this.network.name)}},{key:"getUrl",value:function(t,e){var r=Object.keys(e).reduce((function(t,r){var n=e[r];return null!=n&&(t+="&".concat(r,"=").concat(n)),t}),""),n=this.apiKey?"&apikey=".concat(this.apiKey):"";return"".concat(this.baseUrl,"/api?module=").concat(t).concat(r).concat(n)}},{key:"getPostUrl",value:function(){return"".concat(this.baseUrl,"/api")}},{key:"getPostData",value:function(t,e){return e.module=t,e.apikey=this.apiKey,e}},{key:"fetch",value:function(t,e,r){return gf(this,void 0,void 0,af().mark((function n(){var i,o,a,s,c,A,u=this;return af().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return i=r?this.getPostUrl():this.getUrl(t,e),o=r?this.getPostData(t,e):null,a="proxy"===t?bf:If,this.emit("debug",{action:"request",request:i,provider:this}),s={url:i,throttleSlotInterval:1e3,throttleCallback:function(t,e){return u.isCommunityResource()&&Oc(),Promise.resolve(!0)}},c=null,o&&(s.headers={"content-type":"application/x-www-form-urlencoded; charset=UTF-8"},c=Object.keys(o).map((function(t){return"".concat(t,"=").concat(o[t])})).join("&")),n.next=9,Cc(s,c,a||bf);case 9:return A=n.sent,this.emit("debug",{action:"response",request:i,response:j(A),provider:this}),n.abrupt("return",A);case 12:case"end":return n.stop()}}),n,this)})))}},{key:"detectNetwork",value:function(){return gf(this,void 0,void 0,af().mark((function t(){return af().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",this.network);case 1:case"end":return t.stop()}}),t,this)})))}},{key:"perform",value:function(t,e){var r=this,n=Object.create(null,{perform:{get:function(){return cf(df(o.prototype),"perform",r)}}});return gf(this,void 0,void 0,af().mark((function r(){var i,o,a,s,c,A,u,f,l;return af().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:r.t0=t,r.next="getBlockNumber"===r.t0?3:"getGasPrice"===r.t0?4:"getBalance"===r.t0?5:"getTransactionCount"===r.t0?6:"getCode"===r.t0?7:"getStorageAt"===r.t0?8:"sendTransaction"===r.t0?9:"getBlock"===r.t0?10:"getTransaction"===r.t0?13:"getTransactionReceipt"===r.t0?14:"call"===r.t0?15:"estimateGas"===r.t0?29:"getLogs"===r.t0?41:"getEtherPrice"===r.t0?65:72;break;case 3:return r.abrupt("return",this.fetch("proxy",{action:"eth_blockNumber"}));case 4:return r.abrupt("return",this.fetch("proxy",{action:"eth_gasPrice"}));case 5:return r.abrupt("return",this.fetch("account",{action:"balance",address:e.address,tag:e.blockTag}));case 6:return r.abrupt("return",this.fetch("proxy",{action:"eth_getTransactionCount",address:e.address,tag:e.blockTag}));case 7:return r.abrupt("return",this.fetch("proxy",{action:"eth_getCode",address:e.address,tag:e.blockTag}));case 8:return r.abrupt("return",this.fetch("proxy",{action:"eth_getStorageAt",address:e.address,position:e.position,tag:e.blockTag}));case 9:return r.abrupt("return",this.fetch("proxy",{action:"eth_sendRawTransaction",hex:e.signedTransaction},!0).catch((function(t){return Ef("sendTransaction",t,e.signedTransaction)})));case 10:if(!e.blockTag){r.next=12;break}return r.abrupt("return",this.fetch("proxy",{action:"eth_getBlockByNumber",tag:e.blockTag,boolean:e.includeTransactions?"true":"false"}));case 12:throw new Error("getBlock by blockHash not implemented");case 13:return r.abrupt("return",this.fetch("proxy",{action:"eth_getTransactionByHash",txhash:e.transactionHash}));case 14:return r.abrupt("return",this.fetch("proxy",{action:"eth_getTransactionReceipt",txhash:e.transactionHash}));case 15:if("latest"===e.blockTag){r.next=17;break}throw new Error("EtherscanProvider does not support blockTag for call");case 17:return(i=yf(e.transaction)).module="proxy",i.action="eth_call",r.prev=20,r.next=23,this.fetch("proxy",i,!0);case 23:return r.abrupt("return",r.sent);case 26:return r.prev=26,r.t1=r.catch(20),r.abrupt("return",Ef("call",r.t1,e.transaction));case 29:return(o=yf(e.transaction)).module="proxy",o.action="eth_estimateGas",r.prev=32,r.next=35,this.fetch("proxy",o,!0);case 35:return r.abrupt("return",r.sent);case 38:return r.prev=38,r.t2=r.catch(32),r.abrupt("return",Ef("estimateGas",r.t2,e.transaction));case 41:return a={action:"getLogs"},e.filter.fromBlock&&(a.fromBlock=vf(e.filter.fromBlock)),e.filter.toBlock&&(a.toBlock=vf(e.filter.toBlock)),e.filter.address&&(a.address=e.filter.address),e.filter.topics&&e.filter.topics.length>0&&(e.filter.topics.length>1&&pf.throwError("unsupported topic count",h.b.errors.UNSUPPORTED_OPERATION,{topics:e.filter.topics}),1===e.filter.topics.length&&("string"==typeof(s=e.filter.topics[0])&&66===s.length||pf.throwError("unsupported topic format",h.b.errors.UNSUPPORTED_OPERATION,{topic0:s}),a.topic0=s)),r.next=48,this.fetch("logs",a);case 48:c=r.sent,A={},u=0;case 51:if(!(u<c.length)){r.next=64;break}if(null==(f=c[u]).blockHash){r.next=55;break}return r.abrupt("continue",61);case 55:if(null!=A[f.blockNumber]){r.next=60;break}return r.next=58,this.getBlock(f.blockNumber);case 58:(l=r.sent)&&(A[f.blockNumber]=l.hash);case 60:f.blockHash=A[f.blockNumber];case 61:u++,r.next=51;break;case 64:return r.abrupt("return",c);case 65:if("homestead"===this.network.name){r.next=67;break}return r.abrupt("return",0);case 67:return r.t3=parseFloat,r.next=70,this.fetch("stats",{action:"ethprice"});case 70:return r.t4=r.sent.ethusd,r.abrupt("return",(0,r.t3)(r.t4));case 72:return r.abrupt("break",73);case 73:return r.abrupt("return",n.perform.call(this,t,e));case 74:case"end":return r.stop()}}),r,this,[[20,26],[32,38]])})))}},{key:"getHistory",value:function(t,e,r){return gf(this,void 0,void 0,af().mark((function n(){var i,o,a=this;return af().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,this.resolveName(t);case 2:return n.t0=n.sent,n.t1=null==e?0:e,n.t2=null==r?99999999:r,i={action:"txlist",address:n.t0,startblock:n.t1,endblock:n.t2,sort:"asc"},n.next=8,this.fetch("account",i);case 8:return o=n.sent,n.abrupt("return",o.map((function(t){["contractAddress","to"].forEach((function(e){""==t[e]&&delete t[e]})),null==t.creates&&null!=t.contractAddress&&(t.creates=t.contractAddress);var e=a.formatter.transactionResponse(t);return t.timeStamp&&(e.timestamp=parseInt(t.timeStamp)),e})));case 10:case"end":return n.stop()}}),n,this)})))}},{key:"isCommunityResource",value:function(){return null==this.apiKey}}])&&sf(e.prototype,r),n&&sf(e,n),Object.defineProperty(e,"prototype",{writable:!1}),o}(dA);function Cf(t){for(var e=(t=t.slice()).length-1;e>0;e--){var r=Math.floor(Math.random()*(e+1)),n=t[e];t[e]=t[r],t[r]=n}return t}function wf(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,(i=n.key,o=void 0,o=function(t,e){if("object"!==xf(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==xf(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(i,"string"),"symbol"===xf(o)?o:String(o)),n)}var i,o}function Bf(t,e){return(Bf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}function Qf(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=_f(t);if(e){var i=_f(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return kf(this,r)}}function kf(t,e){if(e&&("object"===xf(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return Sf(t)}function Sf(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function _f(t){return(_f=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function Df(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */Df=function(){return t};var t={},e=Object.prototype,r=e.hasOwnProperty,n=Object.defineProperty||function(t,e,r){t[e]=r.value},i="function"==typeof Symbol?Symbol:{},o=i.iterator||"@@iterator",a=i.asyncIterator||"@@asyncIterator",s=i.toStringTag||"@@toStringTag";function c(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{c({},"")}catch(t){c=function(t,e,r){return t[e]=r}}function A(t,e,r,i){var o=e&&e.prototype instanceof h?e:h,a=Object.create(o.prototype),s=new B(i||[]);return n(a,"_invoke",{value:E(t,r,s)}),a}function u(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=A;var f={};function h(){}function l(){}function d(){}var g={};c(g,o,(function(){return this}));var p=Object.getPrototypeOf,y=p&&p(p(Q([])));y&&y!==e&&r.call(y,o)&&(g=y);var I=d.prototype=h.prototype=Object.create(g);function b(t){["next","throw","return"].forEach((function(e){c(t,e,(function(t){return this._invoke(e,t)}))}))}function v(t,e){var i;n(this,"_invoke",{value:function(n,o){function a(){return new e((function(i,a){!function n(i,o,a,s){var c=u(t[i],t,o);if("throw"!==c.type){var A=c.arg,f=A.value;return f&&"object"==xf(f)&&r.call(f,"__await")?e.resolve(f.__await).then((function(t){n("next",t,a,s)}),(function(t){n("throw",t,a,s)})):e.resolve(f).then((function(t){A.value=t,a(A)}),(function(t){return n("throw",t,a,s)}))}s(c.arg)}(n,o,i,a)}))}return i=i?i.then(a,a):a()}})}function E(t,e,r){var n="suspendedStart";return function(i,o){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===i)throw o;return k()}for(r.method=i,r.arg=o;;){var a=r.delegate;if(a){var s=m(a,r);if(s){if(s===f)continue;return s}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var c=u(t,e,r);if("normal"===c.type){if(n=r.done?"completed":"suspendedYield",c.arg===f)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(n="completed",r.method="throw",r.arg=c.arg)}}}function m(t,e){var r=e.method,n=t.iterator[r];if(void 0===n)return e.delegate=null,"throw"===r&&t.iterator.return&&(e.method="return",e.arg=void 0,m(t,e),"throw"===e.method)||"return"!==r&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+r+"' method")),f;var i=u(n,t.iterator,e.arg);if("throw"===i.type)return e.method="throw",e.arg=i.arg,e.delegate=null,f;var o=i.arg;return o?o.done?(e[t.resultName]=o.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,f):o:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,f)}function C(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function w(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function B(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(C,this),this.reset(!0)}function Q(t){if(t){var e=t[o];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,i=function e(){for(;++n<t.length;)if(r.call(t,n))return e.value=t[n],e.done=!1,e;return e.value=void 0,e.done=!0,e};return i.next=i}}return{next:k}}function k(){return{value:void 0,done:!0}}return l.prototype=d,n(I,"constructor",{value:d,configurable:!0}),n(d,"constructor",{value:l,configurable:!0}),l.displayName=c(d,s,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===l||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,d):(t.__proto__=d,c(t,s,"GeneratorFunction")),t.prototype=Object.create(I),t},t.awrap=function(t){return{__await:t}},b(v.prototype),c(v.prototype,a,(function(){return this})),t.AsyncIterator=v,t.async=function(e,r,n,i,o){void 0===o&&(o=Promise);var a=new v(A(e,r,n,i),o);return t.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},b(I),c(I,s,"Generator"),c(I,o,(function(){return this})),c(I,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},t.values=Q,B.prototype={constructor:B,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(w),!t)for(var e in this)"t"===e.charAt(0)&&r.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function n(r,n){return a.type="throw",a.arg=t,e.next=r,n&&(e.method="next",e.arg=void 0),!!n}for(var i=this.tryEntries.length-1;i>=0;--i){var o=this.tryEntries[i],a=o.completion;if("root"===o.tryLoc)return n("end");if(o.tryLoc<=this.prev){var s=r.call(o,"catchLoc"),c=r.call(o,"finallyLoc");if(s&&c){if(this.prev<o.catchLoc)return n(o.catchLoc,!0);if(this.prev<o.finallyLoc)return n(o.finallyLoc)}else if(s){if(this.prev<o.catchLoc)return n(o.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return n(o.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&r.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var o=i;break}}o&&("break"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc&&(o=null);var a=o?o.completion:{};return a.type=t,a.arg=e,o?(this.method="next",this.next=o.finallyLoc,f):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),f},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),w(r),f}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var i=n.arg;w(r)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:Q(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),f}},t}function xf(t){return(xf="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var Mf=function(t,e,r,n){return new(r||(r=Promise))((function(i,o){function a(t){try{c(n.next(t))}catch(t){o(t)}}function s(t){try{c(n.throw(t))}catch(t){o(t)}}function c(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(a,s)}c((n=n.apply(t,e||[])).next())}))},Rf=new h.b("providers/5.7.2");function Of(){return(new Date).getTime()}function Nf(t){for(var e=null,r=0;r<t.length;r++){var n=t[r];if(null==n)return null;e?e.name===n.name&&e.chainId===n.chainId&&(e.ensAddress===n.ensAddress||null==e.ensAddress&&null==n.ensAddress)||Rf.throwArgumentError("provider mismatch","networks",t):e=n}return e}function Pf(t,e){t=t.slice().sort();var r=Math.floor(t.length/2);if(t.length%2)return t[r];var n=t[r-1],i=t[r];return null!=e&&Math.abs(n-i)>e?null:(n+i)/2}function jf(t){if(null===t)return"null";if("number"==typeof t||"boolean"==typeof t)return JSON.stringify(t);if("string"==typeof t)return t;if(b.isBigNumber(t))return t.toString();if(Array.isArray(t))return JSON.stringify(t.map((function(t){return jf(t)})));if("object"===xf(t)){var e=Object.keys(t);return e.sort(),"{"+e.map((function(e){var r=t[e];return r="function"==typeof r?"[function]":jf(r),JSON.stringify(e)+":"+r})).join(",")+"}"}throw new Error("unknown value type: "+xf(t))}var Lf=1;function Ff(t){var e=null,r=null,n=new Promise((function(n){e=function(){r&&(clearTimeout(r),r=null),n()},r=setTimeout(e,t)}));return{cancel:e,getPromise:function(){return n},wait:function(t){return n=n.then(t)}}}var Tf=[h.b.errors.CALL_EXCEPTION,h.b.errors.INSUFFICIENT_FUNDS,h.b.errors.NONCE_EXPIRED,h.b.errors.REPLACEMENT_UNDERPRICED,h.b.errors.UNPREDICTABLE_GAS_LIMIT],Uf=["address","args","errorArgs","errorSignature","method","transaction"];function Gf(t,e){var r={weight:t.weight};return Object.defineProperty(r,"provider",{get:function(){return t.provider}}),t.start&&(r.start=t.start),e&&(r.duration=e-t.start),t.done&&(t.error?r.error=t.error:r.result=t.result||null),r}function Hf(t,e,r){var n=jf;switch(e){case"getBlockNumber":return function(e){var r=e.map((function(t){return t.result})),n=Pf(e.map((function(t){return t.result})),2);if(null!=n)return n=Math.ceil(n),r.indexOf(n+1)>=0&&n++,n>=t._highestBlockNumber&&(t._highestBlockNumber=n),t._highestBlockNumber};case"getGasPrice":return function(t){var e=t.map((function(t){return t.result}));return e.sort(),e[Math.floor(e.length/2)]};case"getEtherPrice":return function(t){return Pf(t.map((function(t){return t.result})))};case"getBalance":case"getTransactionCount":case"getCode":case"getStorageAt":case"call":case"estimateGas":case"getLogs":break;case"getTransaction":case"getTransactionReceipt":n=function(t){return null==t?null:((t=O(t)).confirmations=-1,jf(t))};break;case"getBlock":n=r.includeTransactions?function(t){return null==t?null:((t=O(t)).transactions=t.transactions.map((function(t){return(t=O(t)).confirmations=-1,t})),jf(t))}:function(t){return null==t?null:jf(t)};break;default:throw new Error("unknown method: "+e)}return function(t,e){return function(r){var n={};r.forEach((function(e){var r=t(e.result);n[r]||(n[r]={count:0,result:e.result}),n[r].count++}));for(var i=Object.keys(n),o=0;o<i.length;o++){var a=n[i[o]];if(a.count>=e)return a.result}}}(n,t.quorum)}function Yf(t,e){return Mf(this,void 0,void 0,Df().mark((function r(){var n;return Df().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(!(null!=(n=t.provider).blockNumber&&n.blockNumber>=e||-1===e)){r.next=3;break}return r.abrupt("return",n);case 3:return r.abrupt("return",wc((function(){return new Promise((function(r,i){setTimeout((function(){return n.blockNumber>=e?r(n):t.cancelled?r(null):r(void 0)}),0)}))}),{oncePoll:n}));case 4:case"end":return r.stop()}}),r)})))}function Kf(t,e,r,n){return Mf(this,void 0,void 0,Df().mark((function i(){var o,a;return Df().wrap((function(i){for(;;)switch(i.prev=i.next){case 0:o=t.provider,i.t0=r,i.next="getBlockNumber"===i.t0||"getGasPrice"===i.t0?4:"getEtherPrice"===i.t0?5:"getBalance"===i.t0||"getTransactionCount"===i.t0||"getCode"===i.t0?8:"getStorageAt"===i.t0?13:"getBlock"===i.t0?18:"call"===i.t0||"estimateGas"===i.t0?23:"getTransaction"===i.t0||"getTransactionReceipt"===i.t0?30:"getLogs"===i.t0?31:37;break;case 4:return i.abrupt("return",o[r]());case 5:if(!o.getEtherPrice){i.next=7;break}return i.abrupt("return",o.getEtherPrice());case 7:return i.abrupt("break",37);case 8:if(!n.blockTag||!Object(A.l)(n.blockTag)){i.next=12;break}return i.next=11,Yf(t,e);case 11:o=i.sent;case 12:return i.abrupt("return",o[r](n.address,n.blockTag||"latest"));case 13:if(!n.blockTag||!Object(A.l)(n.blockTag)){i.next=17;break}return i.next=16,Yf(t,e);case 16:o=i.sent;case 17:return i.abrupt("return",o.getStorageAt(n.address,n.position,n.blockTag||"latest"));case 18:if(!n.blockTag||!Object(A.l)(n.blockTag)){i.next=22;break}return i.next=21,Yf(t,e);case 21:o=i.sent;case 22:return i.abrupt("return",o[n.includeTransactions?"getBlockWithTransactions":"getBlock"](n.blockTag||n.blockHash));case 23:if(!n.blockTag||!Object(A.l)(n.blockTag)){i.next=27;break}return i.next=26,Yf(t,e);case 26:o=i.sent;case 27:if("call"!==r||!n.blockTag){i.next=29;break}return i.abrupt("return",o[r](n.transaction,n.blockTag));case 29:return i.abrupt("return",o[r](n.transaction));case 30:return i.abrupt("return",o[r](n.transactionHash));case 31:if(!((a=n.filter).fromBlock&&Object(A.l)(a.fromBlock)||a.toBlock&&Object(A.l)(a.toBlock))){i.next=36;break}return i.next=35,Yf(t,e);case 35:o=i.sent;case 36:return i.abrupt("return",o.getLogs(a));case 37:return i.abrupt("return",Rf.throwError("unknown method error",h.b.errors.UNKNOWN_ERROR,{method:r,params:n}));case 38:case"end":return i.stop()}}),i)})))}var qf=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Bf(t,e)}(o,t);var e,r,n,i=Qf(o);function o(t,e){var r;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,o),0===t.length&&Rf.throwArgumentError("missing providers","providers",t);var n=t.map((function(t,e){if(kn.isProvider(t)){var r=Mc(t)?2e3:750;return Object.freeze({provider:t,weight:1,stallTimeout:r,priority:1})}var n=O(t);null==n.priority&&(n.priority=1),null==n.stallTimeout&&(n.stallTimeout=Mc(t)?2e3:750),null==n.weight&&(n.weight=1);var i=n.weight;return(i%1||i>512||i<1)&&Rf.throwArgumentError("invalid weight; must be integer in [1, 512]","providers[".concat(e,"].weight"),i),Object.freeze(n)})),a=n.reduce((function(t,e){return t+e.weight}),0);null==e?e=a/2:e>a&&Rf.throwArgumentError("quorum will always fail; larger than total weight","quorum",e);var s=Nf(n.map((function(t){return t.provider.network})));return null==s&&(s=new Promise((function(t,e){setTimeout((function(){r.detectNetwork().then(t,e)}),0)}))),D(Sf(r=i.call(this,s)),"providerConfigs",Object.freeze(n)),D(Sf(r),"quorum",e),r._highestBlockNumber=-1,r}return e=o,(r=[{key:"detectNetwork",value:function(){return Mf(this,void 0,void 0,Df().mark((function t(){var e;return Df().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,Promise.all(this.providerConfigs.map((function(t){return t.provider.getNetwork()})));case 2:return e=t.sent,t.abrupt("return",Nf(e));case 4:case"end":return t.stop()}}),t,this)})))}},{key:"perform",value:function(t,e){return Mf(this,void 0,void 0,Df().mark((function r(){var n,i,o,a,s,c,A,u,f,l,d=this;return Df().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if("sendTransaction"!==t){r.next=13;break}return r.next=3,Promise.all(this.providerConfigs.map((function(t){return t.provider.sendTransaction(e.signedTransaction).then((function(t){return t.hash}),(function(t){return t}))})));case 3:n=r.sent,i=0;case 5:if(!(i<n.length)){r.next=12;break}if("string"!=typeof(o=n[i])){r.next=9;break}return r.abrupt("return",o);case 9:i++,r.next=5;break;case 12:throw n[0];case 13:if(-1!==this._highestBlockNumber||"getBlockNumber"===t){r.next=16;break}return r.next=16,this.getBlockNumber();case 16:a=Hf(this,t,e),(s=Cf(this.providerConfigs.map(O))).sort((function(t,e){return t.priority-e.priority})),c=this._highestBlockNumber,A=0,u=!0,f=Df().mark((function r(){var n,i,o,f,h,l,g;return Df().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:n=Of(),i=s.filter((function(t){return t.runner&&n-t.start<t.stallTimeout})).reduce((function(t,e){return t+e.weight}),0),o=Df().mark((function r(){var n,o;return Df().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:n=s[A++],o=Lf++,n.start=Of(),n.staller=Ff(n.stallTimeout),n.staller.wait((function(){n.staller=null})),n.runner=Kf(n,c,t,e).then((function(r){n.done=!0,n.result=r,d.listenerCount("debug")&&d.emit("debug",{action:"request",rid:o,backend:Gf(n,Of()),request:{method:t,params:j(e)},provider:d})}),(function(r){n.done=!0,n.error=r,d.listenerCount("debug")&&d.emit("debug",{action:"request",rid:o,backend:Gf(n,Of()),request:{method:t,params:j(e)},provider:d})})),d.listenerCount("debug")&&d.emit("debug",{action:"request",rid:o,backend:Gf(n,null),request:{method:t,params:j(e)},provider:d}),i+=n.weight;case 8:case"end":return r.stop()}}),r)}));case 3:if(!(i<d.quorum&&A<s.length)){r.next=7;break}return r.delegateYield(o(),"t0",5);case 5:r.next=3;break;case 7:if(f=[],s.forEach((function(t){!t.done&&t.runner&&(f.push(t.runner),t.staller&&f.push(t.staller.getPromise()))})),!f.length){r.next=12;break}return r.next=12,Promise.race(f);case 12:if(!((h=s.filter((function(t){return t.done&&null==t.error}))).length>=d.quorum)){r.next=22;break}if(void 0===(l=a(h))){r.next=18;break}return s.forEach((function(t){t.staller&&t.staller.cancel(),t.cancelled=!0})),r.abrupt("return",{v:l});case 18:if(u){r.next=21;break}return r.next=21,Ff(100).getPromise();case 21:u=!1;case 22:if(g=s.reduce((function(t,e){if(!e.done||null==e.error)return t;var r=e.error.code;return Tf.indexOf(r)>=0&&(t[r]||(t[r]={error:e.error,weight:0}),t[r].weight+=e.weight),t}),{}),Object.keys(g).forEach((function(t){var e=g[t];if(!(e.weight<d.quorum)){s.forEach((function(t){t.staller&&t.staller.cancel(),t.cancelled=!0}));var r=e.error,n={};Uf.forEach((function(t){null!=r[t]&&(n[t]=r[t])})),Rf.throwError(r.reason||r.message,t,n)}})),0!==s.filter((function(t){return!t.done})).length){r.next=26;break}return r.abrupt("return","break");case 26:case"end":return r.stop()}}),r)}));case 23:return r.delegateYield(f(),"t0",25);case 25:if("break"!==(l=r.t0)){r.next=28;break}return r.abrupt("break",32);case 28:if("object"!==xf(l)){r.next=30;break}return r.abrupt("return",l.v);case 30:r.next=23;break;case 32:return s.forEach((function(t){t.staller&&t.staller.cancel(),t.cancelled=!0})),r.abrupt("return",Rf.throwError("failed to meet quorum",h.b.errors.SERVER_ERROR,{method:t,params:e,results:s.map((function(t){return Gf(t)})),provider:this}));case 34:case"end":return r.stop()}}),r,this)})))}}])&&wf(e.prototype,r),n&&wf(e,n),Object.defineProperty(e,"prototype",{writable:!1}),o}(dA),Jf=null;function zf(t){return(zf="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Zf(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Vf(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,(i=n.key,o=void 0,o=function(t,e){if("object"!==zf(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==zf(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(i,"string"),"symbol"===zf(o)?o:String(o)),n)}var i,o}function Wf(t,e,r){return e&&Vf(t.prototype,e),r&&Vf(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function Xf(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&$f(t,e)}function $f(t,e){return($f=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}function th(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=nh(t);if(e){var i=nh(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return eh(this,r)}}function eh(t,e){if(e&&("object"===zf(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return rh(t)}function rh(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function nh(t){return(nh=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var ih=new h.b("providers/5.7.2"),oh="84842078b09946638c03157f83405213",ah=function(t){Xf(r,t);var e=th(r);function r(t,n){var i;Zf(this,r);var o=new sh(t,n),a=o.connection;a.password&&ih.throwError("INFURA WebSocket project secrets unsupported",h.b.errors.UNSUPPORTED_OPERATION,{operation:"InfuraProvider.getWebSocketProvider()"});var s=a.url.replace(/^http/i,"ws").replace("/v3/","/ws/v3/");return D(rh(i=e.call(this,s,t)),"apiKey",o.projectId),D(rh(i),"projectId",o.projectId),D(rh(i),"projectSecret",o.projectSecret),i}return Wf(r,[{key:"isCommunityResource",value:function(){return this.projectId===oh}}]),r}(ru),sh=function(t){Xf(r,t);var e=th(r);function r(){return Zf(this,r),e.apply(this,arguments)}return Wf(r,[{key:"isCommunityResource",value:function(){return this.projectId===oh}}],[{key:"getWebSocketProvider",value:function(t,e){return new ah(t,e)}},{key:"getApiKey",value:function(t){var e={apiKey:oh,projectId:oh,projectSecret:null};return null==t||("string"==typeof t?e.projectId=t:null!=t.projectSecret?(ih.assertArgument("string"==typeof t.projectId,"projectSecret requires a projectId","projectId",t.projectId),ih.assertArgument("string"==typeof t.projectSecret,"invalid projectSecret","projectSecret","[REDACTED]"),e.projectId=t.projectId,e.projectSecret=t.projectSecret):t.projectId&&(e.projectId=t.projectId),e.apiKey=e.projectId),e}},{key:"getUrl",value:function(t,e){var r=null;switch(t?t.name:"unknown"){case"homestead":r="mainnet.infura.io";break;case"goerli":r="goerli.infura.io";break;case"sepolia":r="sepolia.infura.io";break;case"matic":r="polygon-mainnet.infura.io";break;case"maticmum":r="polygon-mumbai.infura.io";break;case"optimism":r="optimism-mainnet.infura.io";break;case"optimism-goerli":r="optimism-goerli.infura.io";break;case"arbitrum":r="arbitrum-mainnet.infura.io";break;case"arbitrum-goerli":r="arbitrum-goerli.infura.io";break;default:ih.throwError("unsupported network",h.b.errors.INVALID_ARGUMENT,{argument:"network",value:t})}var n={allowGzip:!0,url:"https://"+r+"/v3/"+e.projectId,throttleCallback:function(t,r){return e.projectId===oh&&Oc(),Promise.resolve(!0)}};return null!=e.projectSecret&&(n.user="",n.password=e.projectSecret),n}}]),r}(bu);function ch(t){return(ch="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Ah(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function uh(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,(i=n.key,o=void 0,o=function(t,e){if("object"!==ch(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==ch(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(i,"string"),"symbol"===ch(o)?o:String(o)),n)}var i,o}function fh(t,e){return(fh=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}function hh(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=dh(t);if(e){var i=dh(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return lh(this,r)}}function lh(t,e){if(e&&("object"===ch(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function dh(t){return(dh=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var gh=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&fh(t,e)}(o,t);var e,r,n,i=hh(o);function o(){return Ah(this,o),i.apply(this,arguments)}return e=o,(r=[{key:"send",value:function(t,e){var r=this,n={method:t,params:e,id:this._nextId++,jsonrpc:"2.0"};null==this._pendingBatch&&(this._pendingBatch=[]);var i={request:n,resolve:null,reject:null},o=new Promise((function(t,e){i.resolve=t,i.reject=e}));return this._pendingBatch.push(i),this._pendingBatchAggregator||(this._pendingBatchAggregator=setTimeout((function(){var t=r._pendingBatch;r._pendingBatch=null,r._pendingBatchAggregator=null;var e=t.map((function(t){return t.request}));return r.emit("debug",{action:"requestBatch",request:j(e),provider:r}),Cc(r.connection,JSON.stringify(e)).then((function(n){r.emit("debug",{action:"response",request:e,response:n,provider:r}),t.forEach((function(t,e){var r=n[e];if(r.error){var i=new Error(r.error.message);i.code=r.error.code,i.data=r.error.data,t.reject(i)}else t.resolve(r.result)}))}),(function(n){r.emit("debug",{action:"response",error:n,request:e,provider:r}),t.forEach((function(t){t.reject(n)}))}))}),10)),o}}])&&uh(e.prototype,r),n&&uh(e,n),Object.defineProperty(e,"prototype",{writable:!1}),o}(TA);function ph(t){return(ph="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function yh(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Ih(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,(i=n.key,o=void 0,o=function(t,e){if("object"!==ph(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==ph(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(i,"string"),"symbol"===ph(o)?o:String(o)),n)}var i,o}function bh(t,e){return(bh=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}function vh(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=mh(t);if(e){var i=mh(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return Eh(this,r)}}function Eh(t,e){if(e&&("object"===ph(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function mh(t){return(mh=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var Ch=new h.b("providers/5.7.2"),wh=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&bh(t,e)}(o,t);var e,r,n,i=vh(o);function o(){return yh(this,o),i.apply(this,arguments)}return e=o,n=[{key:"getApiKey",value:function(t){return t&&"string"!=typeof t&&Ch.throwArgumentError("invalid apiKey","apiKey",t),t||"ETHERS_JS_SHARED"}},{key:"getUrl",value:function(t,e){Ch.warn("NodeSmith will be discontinued on 2019-12-20; please migrate to another platform.");var r=null;switch(t.name){case"homestead":r="https://ethereum.api.nodesmith.io/v1/mainnet/jsonrpc";break;case"ropsten":r="https://ethereum.api.nodesmith.io/v1/ropsten/jsonrpc";break;case"rinkeby":r="https://ethereum.api.nodesmith.io/v1/rinkeby/jsonrpc";break;case"goerli":r="https://ethereum.api.nodesmith.io/v1/goerli/jsonrpc";break;case"kovan":r="https://ethereum.api.nodesmith.io/v1/kovan/jsonrpc";break;default:Ch.throwArgumentError("unsupported network","network",arguments[0])}return r+"?apiKey="+e}}],(r=null)&&Ih(e.prototype,r),n&&Ih(e,n),Object.defineProperty(e,"prototype",{writable:!1}),o}(bu);function Bh(t){return(Bh="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Qh(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function kh(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,(i=n.key,o=void 0,o=function(t,e){if("object"!==Bh(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==Bh(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(i,"string"),"symbol"===Bh(o)?o:String(o)),n)}var i,o}function Sh(t,e){return(Sh=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}function _h(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=xh(t);if(e){var i=xh(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return Dh(this,r)}}function Dh(t,e){if(e&&("object"===Bh(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function xh(t){return(xh=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var Mh=new h.b("providers/5.7.2"),Rh=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Sh(t,e)}(o,t);var e,r,n,i=_h(o);function o(){return Qh(this,o),i.apply(this,arguments)}return e=o,n=[{key:"getApiKey",value:function(t){var e={applicationId:null,loadBalancer:!0,applicationSecretKey:null};return null==t?e.applicationId="62e1ad51b37b8e00394bda3b":"string"==typeof t?e.applicationId=t:null!=t.applicationSecretKey?(e.applicationId=t.applicationId,e.applicationSecretKey=t.applicationSecretKey):t.applicationId?e.applicationId=t.applicationId:Mh.throwArgumentError("unsupported PocketProvider apiKey","apiKey",t),e}},{key:"getUrl",value:function(t,e){var r=null;switch(t?t.name:"unknown"){case"goerli":r="eth-goerli.gateway.pokt.network";break;case"homestead":r="eth-mainnet.gateway.pokt.network";break;case"kovan":r="poa-kovan.gateway.pokt.network";break;case"matic":r="poly-mainnet.gateway.pokt.network";break;case"maticmum":r="polygon-mumbai-rpc.gateway.pokt.network";break;case"rinkeby":r="eth-rinkeby.gateway.pokt.network";break;case"ropsten":r="eth-ropsten.gateway.pokt.network";break;default:Mh.throwError("unsupported network",h.b.errors.INVALID_ARGUMENT,{argument:"network",value:t})}var n={headers:{},url:"https://".concat(r,"/v1/lb/").concat(e.applicationId)};return null!=e.applicationSecretKey&&(n.user="",n.password=e.applicationSecretKey),n}}],(r=[{key:"isCommunityResource",value:function(){return"62e1ad51b37b8e00394bda3b"===this.applicationId}}])&&kh(e.prototype,r),n&&kh(e,n),Object.defineProperty(e,"prototype",{writable:!1}),o}(bu);function Oh(t){return(Oh="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Nh(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,(i=n.key,o=void 0,o=function(t,e){if("object"!==Oh(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==Oh(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(i,"string"),"symbol"===Oh(o)?o:String(o)),n)}var i,o}function Ph(t,e){return(Ph=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}function jh(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=Th(t);if(e){var i=Th(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return Lh(this,r)}}function Lh(t,e){if(e&&("object"===Oh(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return Fh(t)}function Fh(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Th(t){return(Th=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var Uh=new h.b("providers/5.7.2"),Gh=1;function Hh(t,e){var r="Web3LegacyFetcher";return function(t,n){var i=this,o={method:t,params:n,id:Gh++,jsonrpc:"2.0"};return new Promise((function(t,n){i.emit("debug",{action:"request",fetcher:r,request:j(o),provider:i}),e(o,(function(e,a){if(e)return i.emit("debug",{action:"response",fetcher:r,error:e,request:o,provider:i}),n(e);if(i.emit("debug",{action:"response",fetcher:r,request:o,response:a,provider:i}),a.error){var s=new Error(a.error.message);return s.code=a.error.code,s.data=a.error.data,n(s)}t(a.result)}))}))}}var Yh=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Ph(t,e)}(o,t);var e,r,n,i=jh(o);function o(t,e){var r;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,o),null==t&&Uh.throwArgumentError("missing provider","provider",t);var n=null,a=null,s=null;return"function"==typeof t?(n="unknown:",a=t):(!(n=t.host||t.path||"")&&t.isMetaMask&&(n="metamask"),s=t,t.request?(""===n&&(n="eip-1193:"),a=function(t){return function(e,r){var n=this;null==r&&(r=[]);var i={method:e,params:r};return this.emit("debug",{action:"request",fetcher:"Eip1193Fetcher",request:j(i),provider:this}),t.request(i).then((function(t){return n.emit("debug",{action:"response",fetcher:"Eip1193Fetcher",request:i,response:t,provider:n}),t}),(function(t){throw n.emit("debug",{action:"response",fetcher:"Eip1193Fetcher",request:i,error:t,provider:n}),t}))}}(t)):t.sendAsync?a=Hh(0,t.sendAsync.bind(t)):t.send?a=Hh(0,t.send.bind(t)):Uh.throwArgumentError("unsupported provider","provider",t),n||(n="unknown:")),D(Fh(r=i.call(this,n,e)),"jsonRpcFetchFunc",a),D(Fh(r),"provider",s),r}return e=o,(r=[{key:"send",value:function(t,e){return this.jsonRpcFetchFunc(t,e)}}])&&Nh(e.prototype,r),n&&Nh(e,n),Object.defineProperty(e,"prototype",{writable:!1}),o}(TA),Kh=new h.b("providers/5.7.2");function qh(t,e){if(null==t&&(t="homestead"),"string"==typeof t){var r=t.match(/^(ws|http)s?:/i);if(r)switch(r[1].toLowerCase()){case"http":case"https":return new TA(t);case"ws":case"wss":return new ru(t);default:Kh.throwArgumentError("unsupported URL scheme","network",t)}}var n=Ms(t);return n&&n._defaultProvider||Kh.throwError("unsupported getDefaultProvider network",h.b.errors.NETWORK_ERROR,{operation:"getDefaultProvider",network:t}),n._defaultProvider({FallbackProvider:qf,AlchemyProvider:Ru,AnkrProvider:Yu,CloudflareProvider:nf,EtherscanProvider:mf,InfuraProvider:sh,JsonRpcProvider:TA,NodesmithProvider:wh,PocketProvider:Rh,Web3Provider:Yh,IpcProvider:Jf},e)}var Jh=new RegExp("^bytes([0-9]+)$"),zh=new RegExp("^(u?int)([0-9]*)$"),Zh=new RegExp("^(.*)\\[([0-9]*)\\]$"),Vh=new h.b("solidity/5.7.0");function Wh(t,e){t.length!=e.length&&Vh.throwArgumentError("wrong number of values; expected ${ types.length }","values",e);var r=[];return t.forEach((function(t,n){r.push(function t(e,r,n){switch(e){case"address":return n?Object(A.p)(r,32):Object(A.a)(r);case"string":return Ct(r);case"bytes":return Object(A.a)(r);case"bool":return r=r?"0x01":"0x00",n?Object(A.p)(r,32):Object(A.a)(r)}var i=e.match(zh);if(i){var o=parseInt(i[2]||"256");return(i[2]&&String(o)!==i[2]||o%8!=0||0===o||o>256)&&Vh.throwArgumentError("invalid number type","type",e),n&&(o=256),r=b.from(r).toTwos(o),Object(A.p)(r,o/8)}if(i=e.match(Jh)){var a=parseInt(i[1]);return(String(a)!==i[1]||0===a||a>32)&&Vh.throwArgumentError("invalid bytes type","type",e),Object(A.a)(r).byteLength!==a&&Vh.throwArgumentError("invalid value for ".concat(e),"value",r),n?Object(A.a)((r+"0000000000000000000000000000000000000000000000000000000000000000").substring(0,66)):r}if((i=e.match(Zh))&&Array.isArray(r)){var s=i[1];parseInt(i[2]||String(r.length))!=r.length&&Vh.throwArgumentError("invalid array length for ".concat(e),"value",r);var c=[];return r.forEach((function(e){c.push(t(s,e,!0))})),Object(A.b)(c)}return Vh.throwArgumentError("invalid type","type",e)}(t,e[n]))})),Object(A.i)(Object(A.b)(r))}function Xh(t,e){return V(Wh(t,e))}function $h(t,e){return Uo(Wh(t,e))}function tl(t,e){e||(e=function(t){return[parseInt(t,16)]});var r=0,n={};return t.split(",").forEach((function(t){var i=t.split(":");r+=parseInt(i[0],16),n[r]=e(i[1])})),n}function el(t){var e=0;return t.split(",").map((function(t){var r=t.split("-");return 1===r.length?r[1]="0":""===r[1]&&(r[1]="1"),{l:e+parseInt(r[0],16),h:e=parseInt(r[1],16)}}))}function rl(t,e){for(var r=0,n=0;n<e.length;n++){var i=e[n];if(t>=(r+=i.l)&&t<=r+i.h&&(t-r)%(i.d||1)==0){if(i.e&&-1!==i.e.indexOf(t-r))continue;return i}}return null}var nl=el("221,13-1b,5f-,40-10,51-f,11-3,3-3,2-2,2-4,8,2,15,2d,28-8,88,48,27-,3-5,11-20,27-,8,28,3-5,12,18,b-a,1c-4,6-16,2-d,2-2,2,1b-4,17-9,8f-,10,f,1f-2,1c-34,33-14e,4,36-,13-,6-2,1a-f,4,9-,3-,17,8,2-2,5-,2,8-,3-,4-8,2-3,3,6-,16-6,2-,7-3,3-,17,8,3,3,3-,2,6-3,3-,4-a,5,2-6,10-b,4,8,2,4,17,8,3,6-,b,4,4-,2-e,2-4,b-10,4,9-,3-,17,8,3-,5-,9-2,3-,4-7,3-3,3,4-3,c-10,3,7-2,4,5-2,3,2,3-2,3-2,4-2,9,4-3,6-2,4,5-8,2-e,d-d,4,9,4,18,b,6-3,8,4,5-6,3-8,3-3,b-11,3,9,4,18,b,6-3,8,4,5-6,3-6,2,3-3,b-11,3,9,4,18,11-3,7-,4,5-8,2-7,3-3,b-11,3,13-2,19,a,2-,8-2,2-3,7,2,9-11,4-b,3b-3,1e-24,3,2-,3,2-,2-5,5,8,4,2,2-,3,e,4-,6,2,7-,b-,3-21,49,23-5,1c-3,9,25,10-,2-2f,23,6,3,8-2,5-5,1b-45,27-9,2a-,2-3,5b-4,45-4,53-5,8,40,2,5-,8,2,5-,28,2,5-,20,2,5-,8,2,5-,8,8,18,20,2,5-,8,28,14-5,1d-22,56-b,277-8,1e-2,52-e,e,8-a,18-8,15-b,e,4,3-b,5e-2,b-15,10,b-5,59-7,2b-555,9d-3,5b-5,17-,7-,27-,7-,9,2,2,2,20-,36,10,f-,7,14-,4,a,54-3,2-6,6-5,9-,1c-10,13-1d,1c-14,3c-,10-6,32-b,240-30,28-18,c-14,a0,115-,3,66-,b-76,5,5-,1d,24,2,5-2,2,8-,35-2,19,f-10,1d-3,311-37f,1b,5a-b,d7-19,d-3,41,57-,68-4,29-3,5f,29-37,2e-2,25-c,2c-2,4e-3,30,78-3,64-,20,19b7-49,51a7-59,48e-2,38-738,2ba5-5b,222f-,3c-94,8-b,6-4,1b,6,2,3,3,6d-20,16e-f,41-,37-7,2e-2,11-f,5-b,18-,b,14,5-3,6,88-,2,bf-2,7-,7-,7-,4-2,8,8-9,8-2ff,20,5-b,1c-b4,27-,27-cbb1,f7-9,28-2,b5-221,56,48,3-,2-,3-,5,d,2,5,3,42,5-,9,8,1d,5,6,2-2,8,153-3,123-3,33-27fd,a6da-5128,21f-5df,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3,2-1d,61-ff7d"),il="ad,34f,1806,180b,180c,180d,200b,200c,200d,2060,feff".split(",").map((function(t){return parseInt(t,16)})),ol=[{h:25,s:32,l:65},{h:30,s:32,e:[23],l:127},{h:54,s:1,e:[48],l:64,d:2},{h:14,s:1,l:57,d:2},{h:44,s:1,l:17,d:2},{h:10,s:1,e:[2,6,8],l:61,d:2},{h:16,s:1,l:68,d:2},{h:84,s:1,e:[18,24,66],l:19,d:2},{h:26,s:32,e:[17],l:435},{h:22,s:1,l:71,d:2},{h:15,s:80,l:40},{h:31,s:32,l:16},{h:32,s:1,l:80,d:2},{h:52,s:1,l:42,d:2},{h:12,s:1,l:55,d:2},{h:40,s:1,e:[38],l:15,d:2},{h:14,s:1,l:48,d:2},{h:37,s:48,l:49},{h:148,s:1,l:6351,d:2},{h:88,s:1,l:160,d:2},{h:15,s:16,l:704},{h:25,s:26,l:854},{h:25,s:32,l:55915},{h:37,s:40,l:1247},{h:25,s:-119711,l:53248},{h:25,s:-119763,l:52},{h:25,s:-119815,l:52},{h:25,s:-119867,e:[1,4,5,7,8,11,12,17],l:52},{h:25,s:-119919,l:52},{h:24,s:-119971,e:[2,7,8,17],l:52},{h:24,s:-120023,e:[2,7,13,15,16,17],l:52},{h:25,s:-120075,l:52},{h:25,s:-120127,l:52},{h:25,s:-120179,l:52},{h:25,s:-120231,l:52},{h:25,s:-120283,l:52},{h:25,s:-120335,l:52},{h:24,s:-119543,e:[17],l:56},{h:24,s:-119601,e:[17],l:58},{h:24,s:-119659,e:[17],l:58},{h:24,s:-119717,e:[17],l:58},{h:24,s:-119775,e:[17],l:58}],al=tl("b5:3bc,c3:ff,7:73,2:253,5:254,3:256,1:257,5:259,1:25b,3:260,1:263,2:269,1:268,5:26f,1:272,2:275,7:280,3:283,5:288,3:28a,1:28b,5:292,3f:195,1:1bf,29:19e,125:3b9,8b:3b2,1:3b8,1:3c5,3:3c6,1:3c0,1a:3ba,1:3c1,1:3c3,2:3b8,1:3b5,1bc9:3b9,1c:1f76,1:1f77,f:1f7a,1:1f7b,d:1f78,1:1f79,1:1f7c,1:1f7d,107:63,5:25b,4:68,1:68,1:68,3:69,1:69,1:6c,3:6e,4:70,1:71,1:72,1:72,1:72,7:7a,2:3c9,2:7a,2:6b,1:e5,1:62,1:63,3:65,1:66,2:6d,b:3b3,1:3c0,6:64,1b574:3b8,1a:3c3,20:3b8,1a:3c3,20:3b8,1a:3c3,20:3b8,1a:3c3,20:3b8,1a:3c3"),sl=tl("179:1,2:1,2:1,5:1,2:1,a:4f,a:1,8:1,2:1,2:1,3:1,5:1,3:1,4:1,2:1,3:1,4:1,8:2,1:1,2:2,1:1,2:2,27:2,195:26,2:25,1:25,1:25,2:40,2:3f,1:3f,33:1,11:-6,1:-9,1ac7:-3a,6d:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,b:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,c:-8,2:-8,2:-8,2:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,49:-8,1:-8,1:-4a,1:-4a,d:-56,1:-56,1:-56,1:-56,d:-8,1:-8,f:-8,1:-8,3:-7"),cl=tl("df:00730073,51:00690307,19:02BC006E,a7:006A030C,18a:002003B9,16:03B903080301,20:03C503080301,1d7:05650582,190f:00680331,1:00740308,1:0077030A,1:0079030A,1:006102BE,b6:03C50313,2:03C503130300,2:03C503130301,2:03C503130342,2a:1F0003B9,1:1F0103B9,1:1F0203B9,1:1F0303B9,1:1F0403B9,1:1F0503B9,1:1F0603B9,1:1F0703B9,1:1F0003B9,1:1F0103B9,1:1F0203B9,1:1F0303B9,1:1F0403B9,1:1F0503B9,1:1F0603B9,1:1F0703B9,1:1F2003B9,1:1F2103B9,1:1F2203B9,1:1F2303B9,1:1F2403B9,1:1F2503B9,1:1F2603B9,1:1F2703B9,1:1F2003B9,1:1F2103B9,1:1F2203B9,1:1F2303B9,1:1F2403B9,1:1F2503B9,1:1F2603B9,1:1F2703B9,1:1F6003B9,1:1F6103B9,1:1F6203B9,1:1F6303B9,1:1F6403B9,1:1F6503B9,1:1F6603B9,1:1F6703B9,1:1F6003B9,1:1F6103B9,1:1F6203B9,1:1F6303B9,1:1F6403B9,1:1F6503B9,1:1F6603B9,1:1F6703B9,3:1F7003B9,1:03B103B9,1:03AC03B9,2:03B10342,1:03B1034203B9,5:03B103B9,6:1F7403B9,1:03B703B9,1:03AE03B9,2:03B70342,1:03B7034203B9,5:03B703B9,6:03B903080300,1:03B903080301,3:03B90342,1:03B903080342,b:03C503080300,1:03C503080301,1:03C10313,2:03C50342,1:03C503080342,b:1F7C03B9,1:03C903B9,1:03CE03B9,2:03C90342,1:03C9034203B9,5:03C903B9,ac:00720073,5b:00B00063,6:00B00066,d:006E006F,a:0073006D,1:00740065006C,1:0074006D,124f:006800700061,2:00610075,2:006F0076,b:00700061,1:006E0061,1:03BC0061,1:006D0061,1:006B0061,1:006B0062,1:006D0062,1:00670062,3:00700066,1:006E0066,1:03BC0066,4:0068007A,1:006B0068007A,1:006D0068007A,1:00670068007A,1:00740068007A,15:00700061,1:006B00700061,1:006D00700061,1:006700700061,8:00700076,1:006E0076,1:03BC0076,1:006D0076,1:006B0076,1:006D0076,1:00700077,1:006E0077,1:03BC0077,1:006D0077,1:006B0077,1:006D0077,1:006B03C9,1:006D03C9,2:00620071,3:00632215006B0067,1:0063006F002E,1:00640062,1:00670079,2:00680070,2:006B006B,1:006B006D,9:00700068,2:00700070006D,1:00700072,2:00730076,1:00770062,c723:00660066,1:00660069,1:0066006C,1:006600660069,1:00660066006C,1:00730074,1:00730074,d:05740576,1:05740565,1:0574056B,1:057E0576,1:0574056D",(function(t){if(t.length%4!=0)throw new Error("bad data");for(var e=[],r=0;r<t.length;r+=4)e.push(parseInt(t.substring(r,r+4),16));return e})),Al=el("80-20,2a0-,39c,32,f71,18e,7f2-f,19-7,30-4,7-5,f81-b,5,a800-20ff,4d1-1f,110,fa-6,d174-7,2e84-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,2,1f-5f,ff7f-20001");function ul(t){if(t.match(/^[a-z0-9-]*$/i)&&t.length<=59)return t.toLowerCase();var e,r=St(t);e=r.map((function(t){if(il.indexOf(t)>=0)return[];if(t>=65024&&t<=65039)return[];var e=function(t){var e=rl(t,ol);if(e)return[t+e.s];var r=al[t];if(r)return r;var n=sl[t];if(n)return[t+n[0]];var i=cl[t];return i||null}(t);return e||[t]})),(r=St(Qt(r=e.reduce((function(t,e){return e.forEach((function(e){t.push(e)})),t}),[])),yt.NFKC)).forEach((function(t){if(rl(t,Al))throw new Error("STRINGPREP_CONTAINS_PROHIBITED")})),r.forEach((function(t){if(rl(t,nl))throw new Error("STRINGPREP_CONTAINS_UNASSIGNED")}));var n=Qt(r);if("-"===n.substring(0,1)||"--"===n.substring(2,4)||"-"===n.substring(n.length-1))throw new Error("invalid hyphen");return n}function fl(t){var e=Ct(t);if(e.length>31)throw new Error("bytes32 string must be less than 32 bytes");return Object(A.i)(Object(A.b)([e,Cs]).slice(0,32))}function hl(t){var e=Object(A.a)(t);if(32!==e.length)throw new Error("invalid bytes32 - not 32 bytes long");if(0!==e[31])throw new Error("invalid bytes32 string - no null terminator");for(var r=31;0===e[r-1];)r--;return kt(e.slice(0,r))}var ll=new h.b("units/5.7.0"),dl=["wei","kwei","mwei","gwei","szabo","finney","ether"];function gl(t){var e=String(t).split(".");(e.length>2||!e[0].match(/^-?[0-9]*$/)||e[1]&&!e[1].match(/^[0-9]*$/)||"."===t||"-."===t)&&ll.throwArgumentError("invalid value","value",t);var r=e[0],n="";for("-"===r.substring(0,1)&&(n="-",r=r.substring(1));"0"===r.substring(0,1);)r=r.substring(1);""===r&&(r="0");var i="";for(2===e.length&&(i="."+(e[1]||"0"));i.length>2&&"0"===i[i.length-1];)i=i.substring(0,i.length-1);for(var o=[];r.length;){if(r.length<=3){o.unshift(r);break}var a=r.length-3;o.unshift(r.substring(a)),r=r.substring(0,a)}return n+o.join(",")+i}function pl(t,e){if("string"==typeof e){var r=dl.indexOf(e);-1!==r&&(e=3*r)}return oo(t,null!=e?e:18)}function yl(t,e){if("string"!=typeof t&&ll.throwArgumentError("value must be a string","value",t),"string"==typeof e){var r=dl.indexOf(e);-1!==r&&(e=3*r)}return ao(t,null!=e?e:18)}function Il(t){return pl(t,18)}function bl(t){return yl(t,18)}var vl="ethers/5.7.2",El=new h.b(vl);try{var ml=window;null==ml._ethers&&(ml._ethers=c)}catch(t){}},function(t,e,r){"use strict";(function(t){r.d(e,"a",(function(){return A}));var n=r(0),i=r(1),o=r(168),a=new i.b(o.a);var s=function(){if("undefined"!=typeof self)return self;if("undefined"!=typeof window)return window;if(void 0!==t)return t;throw new Error("unable to locate global object")}(),c=s.crypto||s.msCrypto;function A(t){(t<=0||t>1024||t%1||t!=t)&&a.throwArgumentError("invalid length","length",t);var e=new Uint8Array(t);return c.getRandomValues(e),Object(n.a)(e)}c&&c.getRandomValues||(a.warn("WARNING: Missing strong random number source"),c={getRandomValues:function(t){return a.throwError("no secure random source avaialble",i.b.errors.UNSUPPORTED_OPERATION,{operation:"crypto.getRandomValues"})}})}).call(this,r(8))}])}));
|