@sofaws/dapp-core
Version:
A library to hold the main logic for a dapp on the Elrond Network
1 lines • 470 kB
JavaScript
"use strict";var GN=Object.create;var ps=Object.defineProperty,HN=Object.defineProperties,$N=Object.getOwnPropertyDescriptor,zN=Object.getOwnPropertyDescriptors,VN=Object.getOwnPropertyNames,zp=Object.getOwnPropertySymbols,qN=Object.getPrototypeOf,hd=Object.prototype.hasOwnProperty,sy=Object.prototype.propertyIsEnumerable;var iy=(e,t,r)=>t in e?ps(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,E=(e,t)=>{for(var r in t||(t={}))hd.call(t,r)&&iy(e,r,t[r]);if(zp)for(var r of zp(t))sy.call(t,r)&&iy(e,r,t[r]);return e},q=(e,t)=>HN(e,zN(t));var ko=(e,t)=>{var r={};for(var s in e)hd.call(e,s)&&t.indexOf(s)<0&&(r[s]=e[s]);if(e!=null&&zp)for(var s of zp(e))t.indexOf(s)<0&&sy.call(e,s)&&(r[s]=e[s]);return r};var se=(e,t)=>()=>(e&&(t=e(e=0)),t);var cs=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),ur=(e,t)=>{for(var r in t)ps(e,r,{get:t[r],enumerable:!0})},py=(e,t,r,s)=>{if(t&&typeof t=="object"||typeof t=="function")for(let p of VN(t))!hd.call(e,p)&&p!==r&&ps(e,p,{get:()=>t[p],enumerable:!(s=$N(t,p))||s.enumerable});return e};var v=(e,t,r)=>(r=e!=null?GN(qN(e)):{},py(t||!e||!e.__esModule?ps(r,"default",{value:e,enumerable:!0}):r,e)),ms=e=>py(ps({},"__esModule",{value:!0}),e);var $=(e,t,r)=>new Promise((s,p)=>{var u=x=>{try{T(r.next(x))}catch(b){p(b)}},f=x=>{try{T(r.throw(x))}catch(b){p(b)}},T=x=>x.done?s(x.value):Promise.resolve(x.value).then(u,f);T((r=r.apply(e,t)).next())});var ly=cs(Vp=>{"use strict";a();Vp.byteLength=XN;Vp.toByteArray=jN;Vp.fromByteArray=QN;var rn=[],Et=[],KN=typeof Uint8Array!="undefined"?Uint8Array:Array,yd="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(Vr=0,cy=yd.length;Vr<cy;++Vr)rn[Vr]=yd[Vr],Et[yd.charCodeAt(Vr)]=Vr;var Vr,cy;Et["-".charCodeAt(0)]=62;Et["_".charCodeAt(0)]=63;function my(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");r===-1&&(r=t);var s=r===t?0:4-r%4;return[r,s]}function XN(e){var t=my(e),r=t[0],s=t[1];return(r+s)*3/4-s}function ZN(e,t,r){return(t+r)*3/4-r}function jN(e){var t,r=my(e),s=r[0],p=r[1],u=new KN(ZN(e,s,p)),f=0,T=p>0?s-4:s,x;for(x=0;x<T;x+=4)t=Et[e.charCodeAt(x)]<<18|Et[e.charCodeAt(x+1)]<<12|Et[e.charCodeAt(x+2)]<<6|Et[e.charCodeAt(x+3)],u[f++]=t>>16&255,u[f++]=t>>8&255,u[f++]=t&255;return p===2&&(t=Et[e.charCodeAt(x)]<<2|Et[e.charCodeAt(x+1)]>>4,u[f++]=t&255),p===1&&(t=Et[e.charCodeAt(x)]<<10|Et[e.charCodeAt(x+1)]<<4|Et[e.charCodeAt(x+2)]>>2,u[f++]=t>>8&255,u[f++]=t&255),u}function YN(e){return rn[e>>18&63]+rn[e>>12&63]+rn[e>>6&63]+rn[e&63]}function JN(e,t,r){for(var s,p=[],u=t;u<r;u+=3)s=(e[u]<<16&16711680)+(e[u+1]<<8&65280)+(e[u+2]&255),p.push(YN(s));return p.join("")}function QN(e){for(var t,r=e.length,s=r%3,p=[],u=16383,f=0,T=r-s;f<T;f+=u)p.push(JN(e,f,f+u>T?T:f+u));return s===1?(t=e[r-1],p.push(rn[t>>2]+rn[t<<4&63]+"==")):s===2&&(t=(e[r-2]<<8)+e[r-1],p.push(rn[t>>10]+rn[t>>4&63]+rn[t<<2&63]+"=")),p.join("")}});var dy=cs(Td=>{a();Td.read=function(e,t,r,s,p){var u,f,T=p*8-s-1,x=(1<<T)-1,b=x>>1,S=-7,N=r?p-1:0,L=r?-1:1,I=e[t+N];for(N+=L,u=I&(1<<-S)-1,I>>=-S,S+=T;S>0;u=u*256+e[t+N],N+=L,S-=8);for(f=u&(1<<-S)-1,u>>=-S,S+=s;S>0;f=f*256+e[t+N],N+=L,S-=8);if(u===0)u=1-b;else{if(u===x)return f?NaN:(I?-1:1)*(1/0);f=f+Math.pow(2,s),u=u-b}return(I?-1:1)*f*Math.pow(2,u-s)};Td.write=function(e,t,r,s,p,u){var f,T,x,b=u*8-p-1,S=(1<<b)-1,N=S>>1,L=p===23?Math.pow(2,-24)-Math.pow(2,-77):0,I=s?0:u-1,W=s?1:-1,G=t<0||t===0&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(T=isNaN(t)?1:0,f=S):(f=Math.floor(Math.log(t)/Math.LN2),t*(x=Math.pow(2,-f))<1&&(f--,x*=2),f+N>=1?t+=L/x:t+=L*Math.pow(2,1-N),t*x>=2&&(f++,x/=2),f+N>=S?(T=0,f=S):f+N>=1?(T=(t*x-1)*Math.pow(2,p),f=f+N):(T=t*Math.pow(2,N-1)*Math.pow(2,p),f=0));p>=8;e[r+I]=T&255,I+=W,T/=256,p-=8);for(f=f<<p|T,b+=p;b>0;e[r+I]=f&255,I+=W,f/=256,b-=8);e[r+I-W]|=G*128}});var Cy=cs(Va=>{"use strict";a();var xd=ly(),za=dy(),_y=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;Va.Buffer=M;Va.SlowBuffer=aA;Va.INSPECT_MAX_BYTES=50;var qp=2147483647;Va.kMaxLength=qp;M.TYPED_ARRAY_SUPPORT=eA();!M.TYPED_ARRAY_SUPPORT&&typeof console!="undefined"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function eA(){try{var e=new Uint8Array(1),t={foo:function(){return 42}};return Object.setPrototypeOf(t,Uint8Array.prototype),Object.setPrototypeOf(e,t),e.foo()===42}catch(r){return!1}}Object.defineProperty(M.prototype,"parent",{enumerable:!0,get:function(){if(!!M.isBuffer(this))return this.buffer}});Object.defineProperty(M.prototype,"offset",{enumerable:!0,get:function(){if(!!M.isBuffer(this))return this.byteOffset}});function Fn(e){if(e>qp)throw new RangeError('The value "'+e+'" is invalid for option "size"');var t=new Uint8Array(e);return Object.setPrototypeOf(t,M.prototype),t}function M(e,t,r){if(typeof e=="number"){if(typeof t=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return Sd(e)}return gy(e,t,r)}M.poolSize=8192;function gy(e,t,r){if(typeof e=="string")return tA(e,t);if(ArrayBuffer.isView(e))return nA(e);if(e==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(an(e,ArrayBuffer)||e&&an(e.buffer,ArrayBuffer)||typeof SharedArrayBuffer!="undefined"&&(an(e,SharedArrayBuffer)||e&&an(e.buffer,SharedArrayBuffer)))return vd(e,t,r);if(typeof e=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');var s=e.valueOf&&e.valueOf();if(s!=null&&s!==e)return M.from(s,t,r);var p=rA(e);if(p)return p;if(typeof Symbol!="undefined"&&Symbol.toPrimitive!=null&&typeof e[Symbol.toPrimitive]=="function")return M.from(e[Symbol.toPrimitive]("string"),t,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}M.from=function(e,t,r){return gy(e,t,r)};Object.setPrototypeOf(M.prototype,Uint8Array.prototype);Object.setPrototypeOf(M,Uint8Array);function hy(e){if(typeof e!="number")throw new TypeError('"size" argument must be of type number');if(e<0)throw new RangeError('The value "'+e+'" is invalid for option "size"')}function oA(e,t,r){return hy(e),e<=0?Fn(e):t!==void 0?typeof r=="string"?Fn(e).fill(t,r):Fn(e).fill(t):Fn(e)}M.alloc=function(e,t,r){return oA(e,t,r)};function Sd(e){return hy(e),Fn(e<0?0:Cd(e)|0)}M.allocUnsafe=function(e){return Sd(e)};M.allocUnsafeSlow=function(e){return Sd(e)};function tA(e,t){if((typeof t!="string"||t==="")&&(t="utf8"),!M.isEncoding(t))throw new TypeError("Unknown encoding: "+t);var r=yy(e,t)|0,s=Fn(r),p=s.write(e,t);return p!==r&&(s=s.slice(0,p)),s}function bd(e){for(var t=e.length<0?0:Cd(e.length)|0,r=Fn(t),s=0;s<t;s+=1)r[s]=e[s]&255;return r}function nA(e){if(an(e,Uint8Array)){var t=new Uint8Array(e);return vd(t.buffer,t.byteOffset,t.byteLength)}return bd(e)}function vd(e,t,r){if(t<0||e.byteLength<t)throw new RangeError('"offset" is outside of buffer bounds');if(e.byteLength<t+(r||0))throw new RangeError('"length" is outside of buffer bounds');var s;return t===void 0&&r===void 0?s=new Uint8Array(e):r===void 0?s=new Uint8Array(e,t):s=new Uint8Array(e,t,r),Object.setPrototypeOf(s,M.prototype),s}function rA(e){if(M.isBuffer(e)){var t=Cd(e.length)|0,r=Fn(t);return r.length===0||e.copy(r,0,0,t),r}if(e.length!==void 0)return typeof e.length!="number"||kd(e.length)?Fn(0):bd(e);if(e.type==="Buffer"&&Array.isArray(e.data))return bd(e.data)}function Cd(e){if(e>=qp)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+qp.toString(16)+" bytes");return e|0}function aA(e){return+e!=e&&(e=0),M.alloc(+e)}M.isBuffer=function(t){return t!=null&&t._isBuffer===!0&&t!==M.prototype};M.compare=function(t,r){if(an(t,Uint8Array)&&(t=M.from(t,t.offset,t.byteLength)),an(r,Uint8Array)&&(r=M.from(r,r.offset,r.byteLength)),!M.isBuffer(t)||!M.isBuffer(r))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(t===r)return 0;for(var s=t.length,p=r.length,u=0,f=Math.min(s,p);u<f;++u)if(t[u]!==r[u]){s=t[u],p=r[u];break}return s<p?-1:p<s?1:0};M.isEncoding=function(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}};M.concat=function(t,r){if(!Array.isArray(t))throw new TypeError('"list" argument must be an Array of Buffers');if(t.length===0)return M.alloc(0);var s;if(r===void 0)for(r=0,s=0;s<t.length;++s)r+=t[s].length;var p=M.allocUnsafe(r),u=0;for(s=0;s<t.length;++s){var f=t[s];if(an(f,Uint8Array))u+f.length>p.length?M.from(f).copy(p,u):Uint8Array.prototype.set.call(p,f,u);else if(M.isBuffer(f))f.copy(p,u);else throw new TypeError('"list" argument must be an Array of Buffers');u+=f.length}return p};function yy(e,t){if(M.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||an(e,ArrayBuffer))return e.byteLength;if(typeof e!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);var r=e.length,s=arguments.length>2&&arguments[2]===!0;if(!s&&r===0)return 0;for(var p=!1;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return wd(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return r*2;case"hex":return r>>>1;case"base64":return Sy(e).length;default:if(p)return s?-1:wd(e).length;t=(""+t).toLowerCase(),p=!0}}M.byteLength=yy;function iA(e,t,r){var s=!1;if((t===void 0||t<0)&&(t=0),t>this.length||((r===void 0||r>this.length)&&(r=this.length),r<=0)||(r>>>=0,t>>>=0,r<=t))return"";for(e||(e="utf8");;)switch(e){case"hex":return gA(this,t,r);case"utf8":case"utf-8":return xy(this,t,r);case"ascii":return uA(this,t,r);case"latin1":case"binary":return fA(this,t,r);case"base64":return dA(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return hA(this,t,r);default:if(s)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),s=!0}}M.prototype._isBuffer=!0;function qr(e,t,r){var s=e[t];e[t]=e[r],e[r]=s}M.prototype.swap16=function(){var t=this.length;if(t%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var r=0;r<t;r+=2)qr(this,r,r+1);return this};M.prototype.swap32=function(){var t=this.length;if(t%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var r=0;r<t;r+=4)qr(this,r,r+3),qr(this,r+1,r+2);return this};M.prototype.swap64=function(){var t=this.length;if(t%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var r=0;r<t;r+=8)qr(this,r,r+7),qr(this,r+1,r+6),qr(this,r+2,r+5),qr(this,r+3,r+4);return this};M.prototype.toString=function(){var t=this.length;return t===0?"":arguments.length===0?xy(this,0,t):iA.apply(this,arguments)};M.prototype.toLocaleString=M.prototype.toString;M.prototype.equals=function(t){if(!M.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t?!0:M.compare(this,t)===0};M.prototype.inspect=function(){var t="",r=Va.INSPECT_MAX_BYTES;return t=this.toString("hex",0,r).replace(/(.{2})/g,"$1 ").trim(),this.length>r&&(t+=" ... "),"<Buffer "+t+">"};_y&&(M.prototype[_y]=M.prototype.inspect);M.prototype.compare=function(t,r,s,p,u){if(an(t,Uint8Array)&&(t=M.from(t,t.offset,t.byteLength)),!M.isBuffer(t))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof t);if(r===void 0&&(r=0),s===void 0&&(s=t?t.length:0),p===void 0&&(p=0),u===void 0&&(u=this.length),r<0||s>t.length||p<0||u>this.length)throw new RangeError("out of range index");if(p>=u&&r>=s)return 0;if(p>=u)return-1;if(r>=s)return 1;if(r>>>=0,s>>>=0,p>>>=0,u>>>=0,this===t)return 0;for(var f=u-p,T=s-r,x=Math.min(f,T),b=this.slice(p,u),S=t.slice(r,s),N=0;N<x;++N)if(b[N]!==S[N]){f=b[N],T=S[N];break}return f<T?-1:T<f?1:0};function Ty(e,t,r,s,p){if(e.length===0)return-1;if(typeof r=="string"?(s=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,kd(r)&&(r=p?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(p)return-1;r=e.length-1}else if(r<0)if(p)r=0;else return-1;if(typeof t=="string"&&(t=M.from(t,s)),M.isBuffer(t))return t.length===0?-1:uy(e,t,r,s,p);if(typeof t=="number")return t=t&255,typeof Uint8Array.prototype.indexOf=="function"?p?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):uy(e,[t],r,s,p);throw new TypeError("val must be string, number or Buffer")}function uy(e,t,r,s,p){var u=1,f=e.length,T=t.length;if(s!==void 0&&(s=String(s).toLowerCase(),s==="ucs2"||s==="ucs-2"||s==="utf16le"||s==="utf-16le")){if(e.length<2||t.length<2)return-1;u=2,f/=2,T/=2,r/=2}function x(I,W){return u===1?I[W]:I.readUInt16BE(W*u)}var b;if(p){var S=-1;for(b=r;b<f;b++)if(x(e,b)===x(t,S===-1?0:b-S)){if(S===-1&&(S=b),b-S+1===T)return S*u}else S!==-1&&(b-=b-S),S=-1}else for(r+T>f&&(r=f-T),b=r;b>=0;b--){for(var N=!0,L=0;L<T;L++)if(x(e,b+L)!==x(t,L)){N=!1;break}if(N)return b}return-1}M.prototype.includes=function(t,r,s){return this.indexOf(t,r,s)!==-1};M.prototype.indexOf=function(t,r,s){return Ty(this,t,r,s,!0)};M.prototype.lastIndexOf=function(t,r,s){return Ty(this,t,r,s,!1)};function sA(e,t,r,s){r=Number(r)||0;var p=e.length-r;s?(s=Number(s),s>p&&(s=p)):s=p;var u=t.length;s>u/2&&(s=u/2);for(var f=0;f<s;++f){var T=parseInt(t.substr(f*2,2),16);if(kd(T))return f;e[r+f]=T}return f}function pA(e,t,r,s){return Kp(wd(t,e.length-r),e,r,s)}function cA(e,t,r,s){return Kp(xA(t),e,r,s)}function mA(e,t,r,s){return Kp(Sy(t),e,r,s)}function lA(e,t,r,s){return Kp(bA(t,e.length-r),e,r,s)}M.prototype.write=function(t,r,s,p){if(r===void 0)p="utf8",s=this.length,r=0;else if(s===void 0&&typeof r=="string")p=r,s=this.length,r=0;else if(isFinite(r))r=r>>>0,isFinite(s)?(s=s>>>0,p===void 0&&(p="utf8")):(p=s,s=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var u=this.length-r;if((s===void 0||s>u)&&(s=u),t.length>0&&(s<0||r<0)||r>this.length)throw new RangeError("Attempt to write outside buffer bounds");p||(p="utf8");for(var f=!1;;)switch(p){case"hex":return sA(this,t,r,s);case"utf8":case"utf-8":return pA(this,t,r,s);case"ascii":case"latin1":case"binary":return cA(this,t,r,s);case"base64":return mA(this,t,r,s);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return lA(this,t,r,s);default:if(f)throw new TypeError("Unknown encoding: "+p);p=(""+p).toLowerCase(),f=!0}};M.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function dA(e,t,r){return t===0&&r===e.length?xd.fromByteArray(e):xd.fromByteArray(e.slice(t,r))}function xy(e,t,r){r=Math.min(e.length,r);for(var s=[],p=t;p<r;){var u=e[p],f=null,T=u>239?4:u>223?3:u>191?2:1;if(p+T<=r){var x,b,S,N;switch(T){case 1:u<128&&(f=u);break;case 2:x=e[p+1],(x&192)===128&&(N=(u&31)<<6|x&63,N>127&&(f=N));break;case 3:x=e[p+1],b=e[p+2],(x&192)===128&&(b&192)===128&&(N=(u&15)<<12|(x&63)<<6|b&63,N>2047&&(N<55296||N>57343)&&(f=N));break;case 4:x=e[p+1],b=e[p+2],S=e[p+3],(x&192)===128&&(b&192)===128&&(S&192)===128&&(N=(u&15)<<18|(x&63)<<12|(b&63)<<6|S&63,N>65535&&N<1114112&&(f=N))}}f===null?(f=65533,T=1):f>65535&&(f-=65536,s.push(f>>>10&1023|55296),f=56320|f&1023),s.push(f),p+=T}return _A(s)}var fy=4096;function _A(e){var t=e.length;if(t<=fy)return String.fromCharCode.apply(String,e);for(var r="",s=0;s<t;)r+=String.fromCharCode.apply(String,e.slice(s,s+=fy));return r}function uA(e,t,r){var s="";r=Math.min(e.length,r);for(var p=t;p<r;++p)s+=String.fromCharCode(e[p]&127);return s}function fA(e,t,r){var s="";r=Math.min(e.length,r);for(var p=t;p<r;++p)s+=String.fromCharCode(e[p]);return s}function gA(e,t,r){var s=e.length;(!t||t<0)&&(t=0),(!r||r<0||r>s)&&(r=s);for(var p="",u=t;u<r;++u)p+=vA[e[u]];return p}function hA(e,t,r){for(var s=e.slice(t,r),p="",u=0;u<s.length-1;u+=2)p+=String.fromCharCode(s[u]+s[u+1]*256);return p}M.prototype.slice=function(t,r){var s=this.length;t=~~t,r=r===void 0?s:~~r,t<0?(t+=s,t<0&&(t=0)):t>s&&(t=s),r<0?(r+=s,r<0&&(r=0)):r>s&&(r=s),r<t&&(r=t);var p=this.subarray(t,r);return Object.setPrototypeOf(p,M.prototype),p};function To(e,t,r){if(e%1!==0||e<0)throw new RangeError("offset is not uint");if(e+t>r)throw new RangeError("Trying to access beyond buffer length")}M.prototype.readUintLE=M.prototype.readUIntLE=function(t,r,s){t=t>>>0,r=r>>>0,s||To(t,r,this.length);for(var p=this[t],u=1,f=0;++f<r&&(u*=256);)p+=this[t+f]*u;return p};M.prototype.readUintBE=M.prototype.readUIntBE=function(t,r,s){t=t>>>0,r=r>>>0,s||To(t,r,this.length);for(var p=this[t+--r],u=1;r>0&&(u*=256);)p+=this[t+--r]*u;return p};M.prototype.readUint8=M.prototype.readUInt8=function(t,r){return t=t>>>0,r||To(t,1,this.length),this[t]};M.prototype.readUint16LE=M.prototype.readUInt16LE=function(t,r){return t=t>>>0,r||To(t,2,this.length),this[t]|this[t+1]<<8};M.prototype.readUint16BE=M.prototype.readUInt16BE=function(t,r){return t=t>>>0,r||To(t,2,this.length),this[t]<<8|this[t+1]};M.prototype.readUint32LE=M.prototype.readUInt32LE=function(t,r){return t=t>>>0,r||To(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+this[t+3]*16777216};M.prototype.readUint32BE=M.prototype.readUInt32BE=function(t,r){return t=t>>>0,r||To(t,4,this.length),this[t]*16777216+(this[t+1]<<16|this[t+2]<<8|this[t+3])};M.prototype.readIntLE=function(t,r,s){t=t>>>0,r=r>>>0,s||To(t,r,this.length);for(var p=this[t],u=1,f=0;++f<r&&(u*=256);)p+=this[t+f]*u;return u*=128,p>=u&&(p-=Math.pow(2,8*r)),p};M.prototype.readIntBE=function(t,r,s){t=t>>>0,r=r>>>0,s||To(t,r,this.length);for(var p=r,u=1,f=this[t+--p];p>0&&(u*=256);)f+=this[t+--p]*u;return u*=128,f>=u&&(f-=Math.pow(2,8*r)),f};M.prototype.readInt8=function(t,r){return t=t>>>0,r||To(t,1,this.length),this[t]&128?(255-this[t]+1)*-1:this[t]};M.prototype.readInt16LE=function(t,r){t=t>>>0,r||To(t,2,this.length);var s=this[t]|this[t+1]<<8;return s&32768?s|4294901760:s};M.prototype.readInt16BE=function(t,r){t=t>>>0,r||To(t,2,this.length);var s=this[t+1]|this[t]<<8;return s&32768?s|4294901760:s};M.prototype.readInt32LE=function(t,r){return t=t>>>0,r||To(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24};M.prototype.readInt32BE=function(t,r){return t=t>>>0,r||To(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]};M.prototype.readFloatLE=function(t,r){return t=t>>>0,r||To(t,4,this.length),za.read(this,t,!0,23,4)};M.prototype.readFloatBE=function(t,r){return t=t>>>0,r||To(t,4,this.length),za.read(this,t,!1,23,4)};M.prototype.readDoubleLE=function(t,r){return t=t>>>0,r||To(t,8,this.length),za.read(this,t,!0,52,8)};M.prototype.readDoubleBE=function(t,r){return t=t>>>0,r||To(t,8,this.length),za.read(this,t,!1,52,8)};function Xo(e,t,r,s,p,u){if(!M.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>p||t<u)throw new RangeError('"value" argument is out of bounds');if(r+s>e.length)throw new RangeError("Index out of range")}M.prototype.writeUintLE=M.prototype.writeUIntLE=function(t,r,s,p){if(t=+t,r=r>>>0,s=s>>>0,!p){var u=Math.pow(2,8*s)-1;Xo(this,t,r,s,u,0)}var f=1,T=0;for(this[r]=t&255;++T<s&&(f*=256);)this[r+T]=t/f&255;return r+s};M.prototype.writeUintBE=M.prototype.writeUIntBE=function(t,r,s,p){if(t=+t,r=r>>>0,s=s>>>0,!p){var u=Math.pow(2,8*s)-1;Xo(this,t,r,s,u,0)}var f=s-1,T=1;for(this[r+f]=t&255;--f>=0&&(T*=256);)this[r+f]=t/T&255;return r+s};M.prototype.writeUint8=M.prototype.writeUInt8=function(t,r,s){return t=+t,r=r>>>0,s||Xo(this,t,r,1,255,0),this[r]=t&255,r+1};M.prototype.writeUint16LE=M.prototype.writeUInt16LE=function(t,r,s){return t=+t,r=r>>>0,s||Xo(this,t,r,2,65535,0),this[r]=t&255,this[r+1]=t>>>8,r+2};M.prototype.writeUint16BE=M.prototype.writeUInt16BE=function(t,r,s){return t=+t,r=r>>>0,s||Xo(this,t,r,2,65535,0),this[r]=t>>>8,this[r+1]=t&255,r+2};M.prototype.writeUint32LE=M.prototype.writeUInt32LE=function(t,r,s){return t=+t,r=r>>>0,s||Xo(this,t,r,4,4294967295,0),this[r+3]=t>>>24,this[r+2]=t>>>16,this[r+1]=t>>>8,this[r]=t&255,r+4};M.prototype.writeUint32BE=M.prototype.writeUInt32BE=function(t,r,s){return t=+t,r=r>>>0,s||Xo(this,t,r,4,4294967295,0),this[r]=t>>>24,this[r+1]=t>>>16,this[r+2]=t>>>8,this[r+3]=t&255,r+4};M.prototype.writeIntLE=function(t,r,s,p){if(t=+t,r=r>>>0,!p){var u=Math.pow(2,8*s-1);Xo(this,t,r,s,u-1,-u)}var f=0,T=1,x=0;for(this[r]=t&255;++f<s&&(T*=256);)t<0&&x===0&&this[r+f-1]!==0&&(x=1),this[r+f]=(t/T>>0)-x&255;return r+s};M.prototype.writeIntBE=function(t,r,s,p){if(t=+t,r=r>>>0,!p){var u=Math.pow(2,8*s-1);Xo(this,t,r,s,u-1,-u)}var f=s-1,T=1,x=0;for(this[r+f]=t&255;--f>=0&&(T*=256);)t<0&&x===0&&this[r+f+1]!==0&&(x=1),this[r+f]=(t/T>>0)-x&255;return r+s};M.prototype.writeInt8=function(t,r,s){return t=+t,r=r>>>0,s||Xo(this,t,r,1,127,-128),t<0&&(t=255+t+1),this[r]=t&255,r+1};M.prototype.writeInt16LE=function(t,r,s){return t=+t,r=r>>>0,s||Xo(this,t,r,2,32767,-32768),this[r]=t&255,this[r+1]=t>>>8,r+2};M.prototype.writeInt16BE=function(t,r,s){return t=+t,r=r>>>0,s||Xo(this,t,r,2,32767,-32768),this[r]=t>>>8,this[r+1]=t&255,r+2};M.prototype.writeInt32LE=function(t,r,s){return t=+t,r=r>>>0,s||Xo(this,t,r,4,2147483647,-2147483648),this[r]=t&255,this[r+1]=t>>>8,this[r+2]=t>>>16,this[r+3]=t>>>24,r+4};M.prototype.writeInt32BE=function(t,r,s){return t=+t,r=r>>>0,s||Xo(this,t,r,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),this[r]=t>>>24,this[r+1]=t>>>16,this[r+2]=t>>>8,this[r+3]=t&255,r+4};function by(e,t,r,s,p,u){if(r+s>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function vy(e,t,r,s,p){return t=+t,r=r>>>0,p||by(e,t,r,4,34028234663852886e22,-34028234663852886e22),za.write(e,t,r,s,23,4),r+4}M.prototype.writeFloatLE=function(t,r,s){return vy(this,t,r,!0,s)};M.prototype.writeFloatBE=function(t,r,s){return vy(this,t,r,!1,s)};function wy(e,t,r,s,p){return t=+t,r=r>>>0,p||by(e,t,r,8,17976931348623157e292,-17976931348623157e292),za.write(e,t,r,s,52,8),r+8}M.prototype.writeDoubleLE=function(t,r,s){return wy(this,t,r,!0,s)};M.prototype.writeDoubleBE=function(t,r,s){return wy(this,t,r,!1,s)};M.prototype.copy=function(t,r,s,p){if(!M.isBuffer(t))throw new TypeError("argument should be a Buffer");if(s||(s=0),!p&&p!==0&&(p=this.length),r>=t.length&&(r=t.length),r||(r=0),p>0&&p<s&&(p=s),p===s||t.length===0||this.length===0)return 0;if(r<0)throw new RangeError("targetStart out of bounds");if(s<0||s>=this.length)throw new RangeError("Index out of range");if(p<0)throw new RangeError("sourceEnd out of bounds");p>this.length&&(p=this.length),t.length-r<p-s&&(p=t.length-r+s);var u=p-s;return this===t&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(r,s,p):Uint8Array.prototype.set.call(t,this.subarray(s,p),r),u};M.prototype.fill=function(t,r,s,p){if(typeof t=="string"){if(typeof r=="string"?(p=r,r=0,s=this.length):typeof s=="string"&&(p=s,s=this.length),p!==void 0&&typeof p!="string")throw new TypeError("encoding must be a string");if(typeof p=="string"&&!M.isEncoding(p))throw new TypeError("Unknown encoding: "+p);if(t.length===1){var u=t.charCodeAt(0);(p==="utf8"&&u<128||p==="latin1")&&(t=u)}}else typeof t=="number"?t=t&255:typeof t=="boolean"&&(t=Number(t));if(r<0||this.length<r||this.length<s)throw new RangeError("Out of range index");if(s<=r)return this;r=r>>>0,s=s===void 0?this.length:s>>>0,t||(t=0);var f;if(typeof t=="number")for(f=r;f<s;++f)this[f]=t;else{var T=M.isBuffer(t)?t:M.from(t,p),x=T.length;if(x===0)throw new TypeError('The value "'+t+'" is invalid for argument "value"');for(f=0;f<s-r;++f)this[f+r]=T[f%x]}return this};var yA=/[^+/0-9A-Za-z-_]/g;function TA(e){if(e=e.split("=")[0],e=e.trim().replace(yA,""),e.length<2)return"";for(;e.length%4!==0;)e=e+"=";return e}function wd(e,t){t=t||1/0;for(var r,s=e.length,p=null,u=[],f=0;f<s;++f){if(r=e.charCodeAt(f),r>55295&&r<57344){if(!p){if(r>56319){(t-=3)>-1&&u.push(239,191,189);continue}else if(f+1===s){(t-=3)>-1&&u.push(239,191,189);continue}p=r;continue}if(r<56320){(t-=3)>-1&&u.push(239,191,189),p=r;continue}r=(p-55296<<10|r-56320)+65536}else p&&(t-=3)>-1&&u.push(239,191,189);if(p=null,r<128){if((t-=1)<0)break;u.push(r)}else if(r<2048){if((t-=2)<0)break;u.push(r>>6|192,r&63|128)}else if(r<65536){if((t-=3)<0)break;u.push(r>>12|224,r>>6&63|128,r&63|128)}else if(r<1114112){if((t-=4)<0)break;u.push(r>>18|240,r>>12&63|128,r>>6&63|128,r&63|128)}else throw new Error("Invalid code point")}return u}function xA(e){for(var t=[],r=0;r<e.length;++r)t.push(e.charCodeAt(r)&255);return t}function bA(e,t){for(var r,s,p,u=[],f=0;f<e.length&&!((t-=2)<0);++f)r=e.charCodeAt(f),s=r>>8,p=r%256,u.push(p),u.push(s);return u}function Sy(e){return xd.toByteArray(TA(e))}function Kp(e,t,r,s){for(var p=0;p<s&&!(p+r>=t.length||p>=e.length);++p)t[p+r]=e[p];return p}function an(e,t){return e instanceof t||e!=null&&e.constructor!=null&&e.constructor.name!=null&&e.constructor.name===t.name}function kd(e){return e!==e}var vA=function(){for(var e="0123456789abcdef",t=new Array(256),r=0;r<16;++r)for(var s=r*16,p=0;p<16;++p)t[s+p]=e[r]+e[p];return t}()});var Ly=cs((f6,Iy)=>{a();var oo=Iy.exports={},sn,pn;function Nd(){throw new Error("setTimeout has not been defined")}function Ad(){throw new Error("clearTimeout has not been defined")}(function(){try{typeof setTimeout=="function"?sn=setTimeout:sn=Nd}catch(e){sn=Nd}try{typeof clearTimeout=="function"?pn=clearTimeout:pn=Ad}catch(e){pn=Ad}})();function ky(e){if(sn===setTimeout)return setTimeout(e,0);if((sn===Nd||!sn)&&setTimeout)return sn=setTimeout,setTimeout(e,0);try{return sn(e,0)}catch(t){try{return sn.call(null,e,0)}catch(r){return sn.call(this,e,0)}}}function wA(e){if(pn===clearTimeout)return clearTimeout(e);if((pn===Ad||!pn)&&clearTimeout)return pn=clearTimeout,clearTimeout(e);try{return pn(e)}catch(t){try{return pn.call(null,e)}catch(r){return pn.call(this,e)}}}var Wn=[],qa=!1,Kr,Xp=-1;function SA(){!qa||!Kr||(qa=!1,Kr.length?Wn=Kr.concat(Wn):Xp=-1,Wn.length&&Ny())}function Ny(){if(!qa){var e=ky(SA);qa=!0;for(var t=Wn.length;t;){for(Kr=Wn,Wn=[];++Xp<t;)Kr&&Kr[Xp].run();Xp=-1,t=Wn.length}Kr=null,qa=!1,wA(e)}}oo.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)t[r-1]=arguments[r];Wn.push(new Ay(e,t)),Wn.length===1&&!qa&&ky(Ny)};function Ay(e,t){this.fun=e,this.array=t}Ay.prototype.run=function(){this.fun.apply(null,this.array)};oo.title="browser";oo.browser=!0;oo.env={};oo.argv=[];oo.version="";oo.versions={};function On(){}oo.on=On;oo.addListener=On;oo.once=On;oo.off=On;oo.removeListener=On;oo.removeAllListeners=On;oo.emit=On;oo.prependListener=On;oo.prependOnceListener=On;oo.listeners=function(e){return[]};oo.binding=function(e){throw new Error("process.binding is not supported")};oo.cwd=function(){return"/"};oo.chdir=function(e){throw new Error("process.chdir is not supported")};oo.umask=function(){return 0}});var l,_,CA,d,a=se(()=>{l=v(Cy()),_=v(Ly()),CA=function(e){function t(){var s=this||self;return delete e.prototype.__magic__,s}if(typeof globalThis=="object")return globalThis;if(this)return t();e.defineProperty(e.prototype,"__magic__",{configurable:!0,get:t});var r=__magic__;return r}(Object),d=CA});var Ka,Zp=se(()=>{"use strict";a();Ka=()=>Date.now()/1e3});var Ey,Id=se(()=>{"use strict";a();Ey=e=>new Date().setMilliseconds(new Date().getMilliseconds()+e)/1e3});var Dy,Py=se(()=>{"use strict";a();Dy=e=>new Date().setSeconds(new Date().getSeconds()+e)/1e3});var jp=se(()=>{"use strict";a();Zp();Id();Py()});var Ed={};ur(Ed,{getItem:()=>NA,localStorageKeys:()=>cn,removeItem:()=>AA,setItem:()=>kA});var cn,Ld,kA,NA,AA,Xa=se(()=>{"use strict";a();jp();cn={loginExpiresAt:"dapp-core-login-expires-at",logoutEvent:"dapp-core-logout-event"},Ld=typeof localStorage!="undefined",kA=({key:e,data:t,expires:r})=>{!Ld||localStorage.setItem(String(e),JSON.stringify({expires:r,data:t}))},NA=e=>{if(!Ld)return;let t=localStorage.getItem(String(e));if(!t)return null;let r=JSON.parse(t);return!r||!r.hasOwnProperty("expires")||!r.hasOwnProperty("data")?null:Ka()>=r.expires?(localStorage.removeItem(String(e)),null):r.data},AA=e=>{!Ld||localStorage.removeItem(String(e))}});var Dd={};ur(Dd,{clear:()=>Wy,getItem:()=>By,removeItem:()=>Fy,setItem:()=>My,storage:()=>IA});var My,By,Fy,Wy,IA,Oy=se(()=>{"use strict";a();My=({key:e,data:t,expires:r})=>{sessionStorage.setItem(String(e),JSON.stringify({expires:r,data:t}))},By=e=>{let t=sessionStorage.getItem(String(e));if(!t)return null;let r=JSON.parse(t);return!r||!r.hasOwnProperty("expires")||!r.hasOwnProperty("data")?null:Date.now()>=r.expires?(sessionStorage.removeItem(String(e)),null):r.data},Fy=e=>sessionStorage.removeItem(String(e)),Wy=()=>sessionStorage.clear(),IA={setItem:My,getItem:By,removeItem:Fy,clear:Wy}});var Zo,Xr=se(()=>{"use strict";a();Xa();Oy();Zo={session:Dd,local:Ed}});function ls(){return new Date().setHours(new Date().getHours()+24)}function ds(e){Zo.local.setItem({key:cn.loginExpiresAt,data:e,expires:e})}var Pd=se(()=>{"use strict";a();Xr();Xa()});var ze=se(()=>{"use strict";a()});var Uy,Za,Ry,Gy,Hy,$y,fr,Zr=se(()=>{"use strict";a();Uy="error when signing",Za="Transaction canceled",Ry="error signing transaction",Gy="provider not initialized",Hy="You need a signer/valid signer to send a transaction,use either WalletProvider, LedgerProvider or WalletConnect",$y="Undefined transaction status",fr="Action not allowed. User is logged in. Call logout() first"});var zy=se(()=>{"use strict";a()});var _s,Dt,Ve=se(()=>{"use strict";a();_s=(s=>(s.nft="nft",s.esdt="esdt",s.egld="egld",s))(_s||{}),Dt=(p=>(p.raw="raw",p.text="text",p.decimal="decimal",p.smart="smart",p))(Dt||{})});var Vy=se(()=>{"use strict";a()});var qy=se(()=>{"use strict";a()});var Ky=se(()=>{"use strict";a()});var Xy=se(()=>{"use strict";a()});var uo=se(()=>{"use strict";a();zy();Ve();ze();Vy();qy();Ky();Xy()});var us,Zy,$6,jy,z6,Yy,Yp,V6,LA,fs=se(()=>{"use strict";a();uo();us={devnet:{id:"devnet",chainId:"D",name:"Devnet",egldLabel:"xEGLD",decimals:"18",digits:"4",gasPerDataByte:"1500",walletConnectDeepLink:"https://maiar.page.link/?apn=com.elrond.maiar.wallet&isi=1519405832&ibi=com.elrond.maiar.wallet&link=https://maiar.com/",walletConnectBridgeAddresses:["https://bridge.walletconnect.org"],walletConnectV2RelayAddresses:["wss://relay.walletconnect.com"],walletAddress:"https://devnet-wallet.elrond.com",apiAddress:"https://devnet-api.elrond.com",explorerAddress:"http://devnet-explorer.elrond.com",apiTimeout:"4000"},testnet:{id:"testnet",chainId:"T",name:"Testnet",egldLabel:"xEGLD",decimals:"18",digits:"4",gasPerDataByte:"1500",walletConnectDeepLink:"https://maiar.page.link/?apn=com.elrond.maiar.wallet&isi=1519405832&ibi=com.elrond.maiar.wallet&link=https://maiar.com/",walletConnectBridgeAddresses:["https://bridge.walletconnect.org"],walletConnectV2RelayAddresses:["wss://relay.walletconnect.com"],walletAddress:"https://testnet-wallet.elrond.com",apiAddress:"https://testnet-api.elrond.com",explorerAddress:"http://testnet-explorer.elrond.com",apiTimeout:"4000"},mainnet:{id:"mainnet",chainId:"1",name:"Mainnet",egldLabel:"xEGLD",decimals:"18",digits:"4",gasPerDataByte:"1500",walletConnectDeepLink:"https://maiar.page.link/?apn=com.elrond.maiar.wallet&isi=1519405832&ibi=com.elrond.maiar.wallet&link=https://maiar.com/",walletConnectBridgeAddresses:["https://bridge.walletconnect.org"],walletConnectV2RelayAddresses:["wss://relay.walletconnect.com"],walletAddress:"https://wallet.elrond.com",apiAddress:"https://api.elrond.com",explorerAddress:"https://explorer.elrond.com",apiTimeout:"4000"}},{chainId:Zy,egldLabel:$6}=us["devnet"],{chainId:jy,egldLabel:z6}=us["testnet"],{chainId:Yy,egldLabel:Yp}=us["mainnet"],V6={["devnet"]:Zy,["testnet"]:jy,["mainnet"]:Yy},LA={[Zy]:"devnet",[jy]:"testnet",[Yy]:"mainnet"}});var Md,Bd=se(()=>{"use strict";a();Md={36864:{code:"codeSuccess",message:"Success"},27013:{code:"ERR_USER_DENIED",message:"Rejected by user"},27904:{code:"ERR_UNKNOWN_INSTRUCTION",message:"Unknown instruction"},28160:{code:"ERR_WRONG_CLA",message:"Wrong CLA"},28161:{code:"ERR_INVALID_ARGUMENTS",message:"Invalid arguments"},28162:{code:"ERR_INVALID_MESSAGE",message:"Invalid message"},28163:{code:"ERR_INVALID_P1",message:"Invalid P1"},28164:{code:"ERR_MESSAGE_TOO_LONG",message:"Message too long"},28165:{code:"ERR_RECEIVER_TOO_LONG",message:"Receiver too long"},28166:{code:"ERR_AMOUNT_TOO_LONG",message:"Amount too long"},28167:{code:"ERR_CONTRACT_DATA_DISABLED",message:"Contract data disabled in app options"},28168:{code:"ERR_MESSAGE_INCOMPLETE",message:"Message incomplete"},28176:{code:"ERR_SIGNATURE_FAILED",message:"Signature failed"},28169:{code:"ERR_WRONG_TX_VERSION",message:"Wrong TX version"},28170:{code:"ERR_NONCE_TOO_LONG",message:"Nonce too long"},28171:{code:"ERR_INVALID_AMOUNT",message:"Invalid amount"},28172:{code:"ERR_INVALID_FEE",message:"Invalid fee"},28173:{code:"ERR_PRETTY_FAILED",message:"Pretty failed"},28174:{code:"ERR_DATA_TOO_LONG",message:"Data too long"},28175:{code:"ERR_WRONG_TX_OPTIONS",message:"Invalid transaction options"},28177:{code:"ERR_SIGN_TX_DEPRECATED",message:"Regular transaction signing is deprecated in this version. Use hash signing."}}});var Jy=se(()=>{"use strict";a()});var ja,Fd=se(()=>{"use strict";a();ja="transaction-status-toast-id"});var gs,Jp,xo,jr,Qy,e0,Qp,o0,t0,hs,ec,n0,r0,a0,We,jo,pe=se(()=>{"use strict";a();Zr();fs();Bd();Jy();Fd();gs=5e4,Jp=1e9,xo=18,jr=4,Qy=1,e0=1,Qp=4294967295,o0=4294967280,t0="/dapp/init",hs="signSession",ec="logout",n0="login",r0="cancelSignTx",a0="refundedGas",We="N/A",jo="0"});var Wd,Po,Yo,Jo=se(()=>{"use strict";a();Wd=require("@reduxjs/toolkit");pe();Po=(0,Wd.createAction)(ec),Yo=(0,Wd.createAction)(n0,e=>({payload:e}))});var s0,i0,p0,cD,Ya,c0,Kt,oc,m0,l0,d0,Od=se(()=>{"use strict";a();s0=require("@reduxjs/toolkit");Pd();ze();Jo();i0={loginMethod:"",walletConnectLogin:null,ledgerLogin:null,tokenLogin:null,walletLogin:null,extensionLogin:null,isLoginSessionInvalid:!1},p0=(0,s0.createSlice)({name:"loginInfoSlice",initialState:i0,reducers:{setLoginMethod:(e,t)=>{e.loginMethod=t.payload},setTokenLogin:(e,t)=>{e.tokenLogin=t.payload},setTokenLoginSignature:(e,t)=>{(e==null?void 0:e.tokenLogin)!=null&&(e.tokenLogin.signature=t.payload)},setWalletLogin:(e,t)=>{e.walletLogin=t.payload},setWalletConnectLogin:(e,t)=>{e.walletConnectLogin=t.payload},setLedgerLogin:(e,t)=>{e.ledgerLogin=t.payload},invalidateLoginSession:e=>{e.isLoginSessionInvalid=!0}},extraReducers:e=>{e.addCase(Po,()=>i0),e.addCase(Yo,(t,r)=>{t.loginMethod=r.payload.loginMethod,ds(ls())})}}),{setLoginMethod:cD,setWalletConnectLogin:Ya,setLedgerLogin:c0,setTokenLogin:Kt,setTokenLoginSignature:oc,setWalletLogin:m0,invalidateLoginSession:l0}=p0.actions,d0=p0.reducer});var _0,u0,Ja,ys=se(()=>{"use strict";a();_0=!1,u0=(e=!0)=>{_0=e},Ja=(e,t=0)=>{_0||setTimeout(()=>{window.location.href=e},t)}});function Un({callbackRoute:e,onLoginRedirect:t,options:r}){let s=Boolean(e),p=typeof t=="function",u=p?0:EA;s&&e!=null&&setTimeout(()=>{if(p)return t(e,r);window.location.pathname.includes(e)||Ja(e)},u)}var EA,f0=se(()=>{"use strict";a();ys();EA=200});function Ud(e){return e[Math.floor(Math.random()*e.length)]}var g0=se(()=>{"use strict";a()});function Yr(e){let t=null;if((e==null?void 0:e.statusCode)in Md){let r=e==null?void 0:e.statusCode,{message:s}=Md[r];t=MA.includes(r)?h0:s}return{errorMessage:t,defaultErrorMessage:h0}}var h0,DA,PA,MA,Rd=se(()=>{"use strict";a();Bd();h0="Check if Elrond app is open on Ledger",DA=28161,PA=28160,MA=[DA,PA]});var Qa=se(()=>{"use strict";a();f0();g0();Rd()});var y0,T0,Gd,BA,x0,wD,SD,b0,Hd=se(()=>{"use strict";a();y0=require("@reduxjs/toolkit"),T0=v(require("lodash.omit"));Qa();Gd={id:"not-configured",chainId:"",name:"NOT CONFIGURED",egldLabel:"",decimals:"18",digits:"4",gasPerDataByte:"1500",walletConnectDeepLink:"",walletConnectBridgeAddress:"",walletConnectV2RelayAddress:"",walletConnectV2ProjectId:"",walletAddress:"",apiAddress:"",explorerAddress:"",apiTimeout:"4000"},BA={network:Gd,chainID:"-1"},x0=(0,y0.createSlice)({name:"appConfig",initialState:BA,reducers:{initializeNetworkConfig:(e,t)=>{let r=Ud(t.payload.walletConnectBridgeAddresses),s=Ud(t.payload.walletConnectV2RelayAddresses),p=(0,T0.default)(t.payload,"walletConnectBridgeAddresses","walletConnectV2RelayAddresses");e.network=q(E(E({},e.network),p),{walletConnectBridgeAddress:r,walletConnectV2RelayAddress:s})},setChainID:(e,t)=>{e.chainID=t.payload}}}),{initializeNetworkConfig:wD,setChainID:SD}=x0.actions,b0=x0.reducer});var zd,v0,w0,tc,$d,S0,Vd,DD,qd,PD,Kd,C0,MD,BD,FD,FA,k0,Xd=se(()=>{"use strict";a();zd=require("@elrondnetwork/erdjs"),v0=require("@reduxjs/toolkit"),w0=require("redux-persist");pe();Xr();Xa();Jo();tc={balance:"...",address:"",nonce:0,txCount:0,scrCount:0,claimableRewards:jo},$d={address:"",websocketEvent:null,accounts:{"":tc},ledgerAccount:null,publicKey:"",walletConnectAccount:null,isAccountLoading:!0,accountLoadingError:null},S0=(0,v0.createSlice)({name:"accountInfoSlice",initialState:$d,reducers:{setAddress:(e,t)=>{let r=t.payload;e.address=r,e.publicKey=new zd.Address(r).hex()},setAccount:(e,t)=>{let r=e.address===t.payload.address;e.accounts={[e.address]:r?t.payload:tc},e.isAccountLoading=!1,e.accountLoadingError=null},setAccountNonce:(e,t)=>{let{address:r}=e;e.accounts[r].nonce=t.payload},setAccountShard:(e,t)=>{e.shard=t.payload},setLedgerAccount:(e,t)=>{e.ledgerAccount=t.payload},updateLedgerAccount:(e,t)=>{e.ledgerAccount!=null&&(e.ledgerAccount.index=t.payload.index,e.ledgerAccount.address=t.payload.address)},setWalletConnectAccount:(e,t)=>{e.walletConnectAccount=t.payload},setIsAccountLoading:(e,t)=>{e.isAccountLoading=t.payload,e.accountLoadingError=null},setAccountLoadingError:(e,t)=>{e.accountLoadingError=t.payload,e.isAccountLoading=!1},setWebsocketEvent:(e,t)=>{e.websocketEvent={timestamp:Date.now(),message:t.payload}}},extraReducers:e=>{e.addCase(Po,()=>(Zo.local.removeItem(cn.loginExpiresAt),$d)),e.addCase(Yo,(t,r)=>{let{address:s}=r.payload;t.address=s,t.publicKey=new zd.Address(s).hex()}),e.addCase(w0.REHYDRATE,(t,r)=>{var b;if(!((b=r.payload)!=null&&b.account))return;let{account:s}=r.payload,{address:p,shard:u,accounts:f,publicKey:T}=s;t.address=p,t.shard=u;let x=f&&p in f;t.accounts=x?f:$d.accounts,t.publicKey=T})}}),{setAccount:Vd,setAddress:DD,setAccountNonce:qd,setAccountShard:PD,setLedgerAccount:Kd,updateLedgerAccount:C0,setWalletConnectAccount:MD,setIsAccountLoading:BD,setAccountLoadingError:FD,setWebsocketEvent:FA}=S0.actions,k0=S0.reducer});function mn(e){return e!=null&&(zA(e)||xs(e))}function oi(e){return e!=null&&(VA(e)||XA(e))}function ti(e){return e!=null&&(qA(e)||ZA(e))}function Ts(e){return e!=null&&KA(e)}function zA(e){return e!=null&&WA.includes(e)}function VA(e){return e!=null&&OA.includes(e)}function qA(e){return e!=null&&UA.includes(e)}function KA(e){return e!=null&&RA.includes(e)}function xs(e){return e!=null&&GA.includes(e)}function XA(e){return e!=null&&HA.includes(e)}function ZA(e){return e!=null&&$A.includes(e)}var WA,OA,UA,RA,GA,HA,$A,ln=se(()=>{"use strict";a();ze();WA=["sent"],OA=["success"],UA=["fail","cancelled","timedOut"],RA=["timedOut"],GA=["pending"],HA=["success"],$A=["fail","invalid"]});var N0,A0,bs,jA,I0,L0,E0,YA,Jr,JA,D0,VD,P0,Qr,Gn,nc,rc=se(()=>{"use strict";a();N0=require("@reduxjs/toolkit"),A0=require("redux-persist");ze();ln();Jo();bs={signedTransactions:{},transactionsToSign:null,signTransactionsError:null,signTransactionsCancelMessage:null,customTransactionInformationForSessionId:{}},jA={signWithoutSending:!1,sessionInformation:null,redirectAfterSign:!1},I0=(0,N0.createSlice)({name:"transactionsSlice",initialState:bs,reducers:{moveTransactionsToSignedState:(e,t)=>{var x,b;let{sessionId:r,transactions:s,errorMessage:p,status:u,redirectRoute:f}=t.payload,T=((x=e.customTransactionInformationForSessionId)==null?void 0:x[r])||jA;e.signedTransactions[r]={transactions:s,status:u,errorMessage:p,redirectRoute:f,customTransactionInformation:T},((b=e==null?void 0:e.transactionsToSign)==null?void 0:b.sessionId)===r&&(e.transactionsToSign=bs.transactionsToSign)},clearSignedTransaction:(e,t)=>{e.signedTransactions[t.payload]&&delete e.signedTransactions[t.payload]},clearTransactionToSign:e=>{e!=null&&e.transactionsToSign&&(e.transactionsToSign=null)},updateSignedTransaction:(e,t)=>{e.signedTransactions=E(E({},e.signedTransactions),t.payload)},updateSignedTransactions:(e,t)=>{let{sessionId:r,status:s,errorMessage:p,transactions:u}=t.payload;e.signedTransactions[r]!=null&&(e.signedTransactions[r].status=s,p!=null&&(e.signedTransactions[r].errorMessage=p),u!=null&&(e.signedTransactions[r].transactions=u))},updateSignedTransactionStatus:(e,t)=>{var T,x,b,S,N,L;let{sessionId:r,status:s,errorMessage:p,transactionHash:u}=t.payload,f=(x=(T=e.signedTransactions)==null?void 0:T[r])==null?void 0:x.transactions;if(f!=null){e.signedTransactions[r].transactions=f.map(G=>G.hash===u?q(E({},G),{status:s,errorMessage:p}):G);let I=(S=(b=e.signedTransactions[r])==null?void 0:b.transactions)==null?void 0:S.every(G=>oi(G.status)),W=(L=(N=e.signedTransactions[r])==null?void 0:N.transactions)==null?void 0:L.every(G=>ti(G.status));I&&(e.signedTransactions[r].status="success"),W&&(e.signedTransactions[r].status="fail")}},setTransactionsToSign:(e,t)=>{e.transactionsToSign=t.payload;let{sessionId:r,customTransactionInformation:s}=t.payload;e.customTransactionInformationForSessionId[r]=s,e.signTransactionsError=null},clearAllTransactionsToSign:e=>{e.transactionsToSign=bs.transactionsToSign,e.signTransactionsError=null},clearAllSignedTransactions:e=>{e.signedTransactions=bs.signedTransactions},setSignTransactionsError:(e,t)=>{e.signTransactionsError=t.payload},setSignTransactionsCancelMessage:(e,t)=>{e.signTransactionsCancelMessage=t.payload}},extraReducers:e=>{e.addCase(Po,()=>bs),e.addCase(A0.REHYDRATE,(t,r)=>{var f;if(t.signTransactionsCancelMessage=null,!((f=r.payload)!=null&&f.transactions))return;let{signedTransactions:s,customTransactionInformationForSessionId:p}=r.payload.transactions,u=Object.entries(s).reduce((T,[x,b])=>{let S=new Date(x),N=new Date;return N.setHours(N.getHours()+5),N-S>0||(T[x]=b),T},{});p!=null&&(t.customTransactionInformationForSessionId=p),s!=null&&(t.signedTransactions=u)})}}),{updateSignedTransactionStatus:L0,updateSignedTransactions:E0,setTransactionsToSign:YA,clearAllTransactionsToSign:Jr,clearAllSignedTransactions:JA,clearSignedTransaction:D0,clearTransactionToSign:VD,setSignTransactionsError:P0,setSignTransactionsCancelMessage:Qr,moveTransactionsToSignedState:Gn}=I0.actions,nc=I0.reducer});var M0,jd,Yd,Jd,QA,Zd,B0,ZD,eI,ni,ac,ic=se(()=>{"use strict";a();M0=require("@reduxjs/toolkit");Jo();jd="Transaction failed",Yd="Transaction successful",Jd="Processing transaction",QA="Transaction submitted",Zd={},B0=(0,M0.createSlice)({name:"transactionsInfo",initialState:Zd,reducers:{setTransactionsDisplayInfo(e,t){let{sessionId:r,transactionsDisplayInfo:s}=t.payload;r!=null&&(e[r]={errorMessage:(s==null?void 0:s.errorMessage)||jd,successMessage:(s==null?void 0:s.successMessage)||Yd,processingMessage:(s==null?void 0:s.processingMessage)||Jd,submittedMessage:(s==null?void 0:s.submittedMessage)||QA,transactionDuration:s==null?void 0:s.transactionDuration})},clearTransactionsInfoForSessionId(e,t){t.payload!=null&&delete e[t.payload]},clearTransactionsInfo:()=>Zd},extraReducers:e=>{e.addCase(Po,()=>Zd)}}),{clearTransactionsInfo:ZD,setTransactionsDisplayInfo:eI,clearTransactionsInfoForSessionId:ni}=B0.actions,ac=B0.reducer});var W0,F0,O0,QD,oI,eP,U0,R0,Qd=se(()=>{"use strict";a();W0=require("@reduxjs/toolkit");Jo();F0={},O0=(0,W0.createSlice)({name:"modalsSlice",initialState:F0,reducers:{setTxSubmittedModal:(e,t)=>{e.txSubmittedModal=t.payload},setNotificationModal:(e,t)=>{e.notificationModal=t.payload},clearTxSubmittedModal:e=>{e.txSubmittedModal=void 0},clearNotificationModal:e=>{e.notificationModal=void 0}},extraReducers:e=>{e.addCase(Po,()=>F0)}}),{setTxSubmittedModal:QD,setNotificationModal:oI,clearTxSubmittedModal:eP,clearNotificationModal:U0}=O0.actions,R0=O0.reducer});var H0,$0,G0,z0,tI,ri,V0,q0,K0,X0,sc,pc=se(()=>{"use strict";a();H0=require("@reduxjs/toolkit"),$0=require("redux-persist");Fd();uo();Zp();Jo();G0={customToasts:[],transactionToasts:[],failTransactionToast:null},z0=(0,H0.createSlice)({name:"toastsSlice",initialState:G0,reducers:{addCustomToast:(e,t)=>{e.customToasts.push(q(E({},t.payload),{type:"custom",toastId:t.payload.toastId||`custom-toast-${e.customToasts.length+1}`}))},removeCustomToast:(e,t)=>{e.customToasts=e.customToasts.filter(r=>r.toastId!==t.payload)},addTransactionToast:(e,t)=>{e.transactionToasts.push({type:"transaction",startTimestamp:Ka(),toastId:t.payload||`custom-toast-${e.transactionToasts.length+1}`})},removeTransactionToast:(e,t)=>{e.transactionToasts=e.transactionToasts.filter(r=>r.toastId!==t.payload)},addFailTransactionToast:(e,t)=>{e.failTransactionToast=q(E({},t.payload),{toastId:ja})},removeFailTransactionToast:e=>{e.failTransactionToast=null}},extraReducers:e=>{e.addCase(Po,()=>G0),e.addCase($0.REHYDRATE,(t,r)=>{var p,u;let s=(u=(p=r.customToasts)==null?void 0:p.filter(f=>!("component"in f)))!=null?u:[];t.customToasts=s})}}),{addCustomToast:tI,removeCustomToast:ri,addTransactionToast:V0,removeTransactionToast:q0,addFailTransactionToast:K0,removeFailTransactionToast:X0}=z0.actions,sc=z0.reducer});var Me=se(()=>{"use strict";a();Od();Hd();Xd();rc();ic();Qd();pc()});var e_=se(()=>{"use strict";a()});var J0,Y0,Q0,o_,NP,AP,IP,LP,eT,oT,t_=se(()=>{"use strict";a();J0=require("@reduxjs/toolkit");Jo();Y0={visible:!1,modal:{showHeader:!0,showFooter:!1,headerText:"",footerText:""}},Q0=(0,J0.createSlice)({name:"dappModalsSlice",initialState:Y0,reducers:{setDappModalVisibility:(e,t)=>{e.visible=t.payload},setDappModalHeaderVisibility:(e,t)=>{e.modal.showHeader=t.payload},setDappModalFooterVisibility:(e,t)=>{e.modal.showFooter=t.payload},setDappModalHeaderText:(e,t)=>{e.modal.headerText=t.payload},setDappModalFooterText:(e,t)=>{e.modal.footerText=t.payload},setDappModalConfig:(e,t)=>{e.modal=E({},t.payload)}},extraReducers:e=>{e.addCase(Po,()=>Y0)}}),{setDappModalVisibility:o_,setDappModalHeaderVisibility:NP,setDappModalFooterVisibility:AP,setDappModalHeaderText:IP,setDappModalFooterText:LP,setDappModalConfig:eT}=Q0.actions,oT=Q0.reducer});var tT,iI,sI,ai,mc=se(()=>{"use strict";a();tT=require("@reduxjs/toolkit");e_();Xd();t_();Od();Qd();Hd();pc();ic();rc();iI={["account"]:k0,["networkConfig"]:b0,["loginInfo"]:d0,["modals"]:R0,["dappModal"]:oT,["toasts"]:sc,["transactions"]:nc,["transactionsInfo"]:ac},sI=(e={})=>(0,tT.combineReducers)(E(E({},iI),e)),ai=sI});var aT={};ur(aT,{default:()=>uI});function n_(e,t=[]){return{key:e,version:1,storage:rT.default,blacklist:t}}var ea,nT,rT,pI,cI,mI,lI,dI,_I,uI,iT=se(()=>{"use strict";a();ea=require("redux-persist"),nT=v(require("redux-persist/lib/storage")),rT=v(require("redux-persist/lib/storage/session"));mc();Me();pc();ic();rc();e_();pI={2:e=>q(E({},e),{networkConfig:Gd})};cI=n_("dapp-core-transactionsInfo"),mI=n_("dapp-core-transactions",["transactionsToSign"]),lI=n_("dapp-core-toasts"),dI={key:"dapp-core-store",version:2,storage:nT.default,whitelist:["account","loginInfo","modals","networkConfig"],migrate:(0,ea.createMigrate)(pI,{debug:!1})},_I={["toasts"]:(0,ea.persistReducer)(lI,sc),["transactions"]:(0,ea.persistReducer)(mI,nc),["transactionsInfo"]:(0,ea.persistReducer)(cI,ac)},uI=(0,ea.persistReducer)(dI,ai(_I))});var sT={};ur(sT,{default:()=>fI});var fI,pT=se(()=>{"use strict";a();mc();fI=ai()});var cT={};ur(cT,{default:()=>hI});var Pt,gI,hI,mT=se(()=>{"use strict";a();Pt=require("redux-persist"),gI=[Pt.FLUSH,Pt.REHYDRATE,Pt.PAUSE,Pt.PERSIST,Pt.PURGE,Pt.REGISTER],hI=gI});var _T={};ur(_T,{default:()=>dT});function dT(e){return(0,lT.persistStore)(e)}var lT,uT=se(()=>{"use strict";a();lT=require("redux-persist")});var Vv=cs((Pi,Gs)=>{a();(function(){var e,t="4.17.21",r=200,s="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",p="Expected a function",u="Invalid `variable` option passed into `_.template`",f="__lodash_hash_undefined__",T=500,x="__lodash_placeholder__",b=1,S=2,N=4,L=1,I=2,W=1,G=2,K=4,Q=8,U=16,R=32,H=64,ee=128,ye=256,Ce=512,Ne=30,co="...",mo=800,ie=16,ke=1,Ge=2,Ae=3,ae=1/0,fe=9007199254740991,J=17976931348623157e292,V=0/0,Z=4294967295,le=Z-1,io=Z>>>1,Sn=[["ary",ee],["bind",W],["bindKey",G],["curry",Q],["curryRight",U],["flip",Ce],["partial",R],["partialRight",H],["rearg",ye]],He="[object Arguments]",en="[object Array]",vt="[object AsyncFunction]",at="[object Boolean]",$o="[object Date]",Cn="[object DOMException]",Br="[object Error]",ep="[object Function]",If="[object GeneratorFunction]",Gt="[object Map]",Hi="[object Number]",rS="[object Null]",kn="[object Object]",Lf="[object Promise]",aS="[object Proxy]",$i="[object RegExp]",Ht="[object Set]",zi="[object String]",op="[object Symbol]",iS="[object Undefined]",Vi="[object WeakMap]",sS="[object WeakSet]",qi="[object ArrayBuffer]",La="[object DataView]",jm="[object Float32Array]",Ym="[object Float64Array]",Jm="[object Int8Array]",Qm="[object Int16Array]",el="[object Int32Array]",ol="[object Uint8Array]",tl="[object Uint8ClampedArray]",nl="[object Uint16Array]",rl="[object Uint32Array]",pS=/\b__p \+= '';/g,cS=/\b(__p \+=) '' \+/g,mS=/(__e\(.*?\)|\b__t\)) \+\n'';/g,Ef=/&(?:amp|lt|gt|quot|#39);/g,Df=/[&<>"']/g,lS=RegExp(Ef.source),dS=RegExp(Df.source),_S=/<%-([\s\S]+?)%>/g,uS=/<%([\s\S]+?)%>/g,Pf=/<%=([\s\S]+?)%>/g,fS=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,gS=/^\w*$/,hS=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,al=/[\\^$.*+?()[\]{}|]/g,yS=RegExp(al.source),il=/^\s+/,TS=/\s/,xS=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,bS=/\{\n\/\* \[wrapped with (.+)\] \*/,vS=/,? & /,wS=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,SS=/[()=,{}\[\]\/\s]/,CS=/\\(\\)?/g,kS=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,Mf=/\w*$/,NS=/^[-+]0x[0-9a-f]+$/i,AS=/^0b[01]+$/i,IS=/^\[object .+?Constructor\]$/,LS=/^0o[0-7]+$/