@ultrade/shared 1.0.18 → 1.0.20
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/browser/constants/index.js +1 -1
- package/dist/browser/helpers/assert.helper.js +1 -1
- package/dist/browser/helpers/atomic.helper.js +1 -1
- package/dist/browser/helpers/balance.helper.js +1 -1
- package/dist/browser/helpers/codex/common.helper.js +2 -2
- package/dist/browser/helpers/codex/index.js +2 -2
- package/dist/browser/helpers/codex/mbr.helper.js +1 -1
- package/dist/browser/helpers/codex/mna.helper.js +1 -1
- package/dist/browser/helpers/codex/order.helper.js +1 -1
- package/dist/browser/helpers/codex/setGlobal.helper.js +1 -1
- package/dist/browser/helpers/codex/transfer.helper.js +2 -2
- package/dist/browser/helpers/codex/txn.helper.js +1 -1
- package/dist/browser/helpers/codex.helper.js +6 -6
- package/dist/browser/helpers/eth.helper.js +2 -2
- package/dist/browser/helpers/withdraw.helper.js +2 -2
- package/dist/constants/frontend.d.ts +33 -0
- package/dist/constants/index.d.ts +1 -0
- package/dist/node/constants/index.js +1 -1
- package/dist/node/helpers/assert.helper.js +1 -1
- package/dist/node/helpers/atomic.helper.js +1 -1
- package/dist/node/helpers/balance.helper.js +1 -1
- package/dist/node/helpers/codex/common.helper.js +2 -2
- package/dist/node/helpers/codex/index.js +2 -2
- package/dist/node/helpers/codex/mbr.helper.js +1 -1
- package/dist/node/helpers/codex/mna.helper.js +1 -1
- package/dist/node/helpers/codex/order.helper.js +1 -1
- package/dist/node/helpers/codex/setGlobal.helper.js +1 -1
- package/dist/node/helpers/codex/transfer.helper.js +2 -2
- package/dist/node/helpers/codex/txn.helper.js +1 -1
- package/dist/node/helpers/codex.helper.js +6 -6
- package/dist/node/helpers/eth.helper.js +2 -2
- package/dist/node/helpers/withdraw.helper.js +2 -2
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
function fr(){throw new Error("setTimeout has not been defined")}function gr(){throw new Error("clearTimeout has not been defined")}var O=fr,k=gr;typeof globalThis.setTimeout=="function"&&(O=setTimeout);typeof globalThis.clearTimeout=="function"&&(k=clearTimeout);function hr(t){if(O===setTimeout)return setTimeout(t,0);if((O===fr||!O)&&setTimeout)return O=setTimeout,setTimeout(t,0);try{return O(t,0)}catch{try{return O.call(null,t,0)}catch{return O.call(this,t,0)}}}function ue(t){if(k===clearTimeout)return clearTimeout(t);if((k===gr||!k)&&clearTimeout)return k=clearTimeout,clearTimeout(t);try{return k(t)}catch{try{return k.call(null,t)}catch{return k.call(this,t)}}}var B=[],F=!1,P,G=-1;function pe(){!F||!P||(F=!1,P.length?B=P.concat(B):G=-1,B.length&&xr())}function xr(){if(!F){var t=hr(pe);F=!0;for(var r=B.length;r;){for(P=B,B=[];++G<r;)P&&P[G].run();G=-1,r=B.length}P=null,F=!1,ue(t)}}function le(t){var r=new Array(arguments.length-1);if(arguments.length>1)for(var e=1;e<arguments.length;e++)r[e-1]=arguments[e];B.push(new br(t,r)),B.length===1&&!F&&hr(xr)}function br(t,r){this.fun=t,this.array=r}br.prototype.run=function(){this.fun.apply(null,this.array)};var me="browser",de="browser",fe=!0,ge={},he=[],xe="",be={},Ee={},Ae={};function U(){}var Te=U,ye=U,_e=U,Ie=U,we=U,Ne=U,Re=U;function Se(t){throw new Error("process.binding is not supported")}function Be(){return"/"}function De(t){throw new Error("process.chdir is not supported")}function Ce(){return 0}var v=globalThis.performance||{},Oe=v.now||v.mozNow||v.msNow||v.oNow||v.webkitNow||function(){return new Date().getTime()};function ke(t){var r=Oe.call(v)*.001,e=Math.floor(r),n=Math.floor(r%1*1e9);return t&&(e=e-t[0],n=n-t[1],n<0&&(e--,n+=1e9)),[e,n]}var Pe=new Date;function Ue(){var t=new Date,r=t-Pe;return r/1e3}var m={nextTick:le,title:me,browser:fe,env:ge,argv:he,version:xe,versions:be,on:Te,addListener:ye,once:_e,off:Ie,removeListener:we,removeAllListeners:Ne,emit:Re,binding:Se,cwd:Be,chdir:De,umask:Ce,hrtime:ke,platform:de,release:Ee,config:Ae,uptime:Ue},dr={};Object.keys(dr).forEach(t=>{let r=t.split("."),e=m;for(let n=0;n<r.length;n++){let o=r[n];n===r.length-1?e[o]=dr[t]:e=e[o]||(e[o]={})}});var w=[],_=[],Le=typeof Uint8Array<"u"?Uint8Array:Array,or=!1;function yr(){or=!0;for(var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",r=0,e=t.length;r<e;++r)w[r]=t[r],_[t.charCodeAt(r)]=r;_[45]=62,_[95]=63}function Me(t){or||yr();var r,e,n,o,i,a,c=t.length;if(c%4>0)throw new Error("Invalid string. Length must be a multiple of 4");i=t[c-2]==="="?2:t[c-1]==="="?1:0,a=new Le(c*3/4-i),n=i>0?c-4:c;var p=0;for(r=0,e=0;r<n;r+=4,e+=3)o=_[t.charCodeAt(r)]<<18|_[t.charCodeAt(r+1)]<<12|_[t.charCodeAt(r+2)]<<6|_[t.charCodeAt(r+3)],a[p++]=o>>16&255,a[p++]=o>>8&255,a[p++]=o&255;return i===2?(o=_[t.charCodeAt(r)]<<2|_[t.charCodeAt(r+1)]>>4,a[p++]=o&255):i===1&&(o=_[t.charCodeAt(r)]<<10|_[t.charCodeAt(r+1)]<<4|_[t.charCodeAt(r+2)]>>2,a[p++]=o>>8&255,a[p++]=o&255),a}function ve(t){return w[t>>18&63]+w[t>>12&63]+w[t>>6&63]+w[t&63]}function Fe(t,r,e){for(var n,o=[],i=r;i<e;i+=3)n=(t[i]<<16)+(t[i+1]<<8)+t[i+2],o.push(ve(n));return o.join("")}function Er(t){or||yr();for(var r,e=t.length,n=e%3,o="",i=[],a=16383,c=0,p=e-n;c<p;c+=a)i.push(Fe(t,c,c+a>p?p:c+a));return n===1?(r=t[e-1],o+=w[r>>2],o+=w[r<<4&63],o+="=="):n===2&&(r=(t[e-2]<<8)+t[e-1],o+=w[r>>10],o+=w[r>>4&63],o+=w[r<<2&63],o+="="),i.push(o),i.join("")}s.TYPED_ARRAY_SUPPORT=globalThis.TYPED_ARRAY_SUPPORT!==void 0?globalThis.TYPED_ARRAY_SUPPORT:!0;function W(){return s.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function D(t,r){if(W()<r)throw new RangeError("Invalid typed array length");return s.TYPED_ARRAY_SUPPORT?(t=new Uint8Array(r),t.__proto__=s.prototype):(t===null&&(t=new s(r)),t.length=r),t}function s(t,r,e){if(!s.TYPED_ARRAY_SUPPORT&&!(this instanceof s))return new s(t,r,e);if(typeof t=="number"){if(typeof r=="string")throw new Error("If encoding is specified then the first argument must be a string");return ir(this,t)}return _r(this,t,r,e)}s.poolSize=8192;s._augment=function(t){return t.__proto__=s.prototype,t};function _r(t,r,e,n){if(typeof r=="number")throw new TypeError('"value" argument must not be a number');return typeof ArrayBuffer<"u"&&r instanceof ArrayBuffer?We(t,r,e,n):typeof r=="string"?Ge(t,r,e):Ke(t,r)}s.from=function(t,r,e){return _r(null,t,r,e)};s.kMaxLength=W();s.TYPED_ARRAY_SUPPORT&&(s.prototype.__proto__=Uint8Array.prototype,s.__proto__=Uint8Array,typeof Symbol<"u"&&Symbol.species&&s[Symbol.species]);function Ir(t){if(typeof t!="number")throw new TypeError('"size" argument must be a number');if(t<0)throw new RangeError('"size" argument must not be negative')}function Ye(t,r,e,n){return Ir(r),r<=0?D(t,r):e!==void 0?typeof n=="string"?D(t,r).fill(e,n):D(t,r).fill(e):D(t,r)}s.alloc=function(t,r,e){return Ye(null,t,r,e)};function ir(t,r){if(Ir(r),t=D(t,r<0?0:ar(r)|0),!s.TYPED_ARRAY_SUPPORT)for(var e=0;e<r;++e)t[e]=0;return t}s.allocUnsafe=function(t){return ir(null,t)};s.allocUnsafeSlow=function(t){return ir(null,t)};function Ge(t,r,e){if((typeof e!="string"||e==="")&&(e="utf8"),!s.isEncoding(e))throw new TypeError('"encoding" must be a valid string encoding');var n=wr(r,e)|0;t=D(t,n);var o=t.write(r,e);return o!==n&&(t=t.slice(0,o)),t}function nr(t,r){var e=r.length<0?0:ar(r.length)|0;t=D(t,e);for(var n=0;n<e;n+=1)t[n]=r[n]&255;return t}function We(t,r,e,n){if(r.byteLength,e<0||r.byteLength<e)throw new RangeError("'offset' is out of bounds");if(r.byteLength<e+(n||0))throw new RangeError("'length' is out of bounds");return e===void 0&&n===void 0?r=new Uint8Array(r):n===void 0?r=new Uint8Array(r,e):r=new Uint8Array(r,e,n),s.TYPED_ARRAY_SUPPORT?(t=r,t.__proto__=s.prototype):t=nr(t,r),t}function Ke(t,r){if(N(r)){var e=ar(r.length)|0;return t=D(t,e),t.length===0||r.copy(t,0,0,e),t}if(r){if(typeof ArrayBuffer<"u"&&r.buffer instanceof ArrayBuffer||"length"in r)return typeof r.length!="number"||ct(r.length)?D(t,0):nr(t,r);if(r.type==="Buffer"&&Array.isArray(r.data))return nr(t,r.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function ar(t){if(t>=W())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+W().toString(16)+" bytes");return t|0}s.isBuffer=ut;function N(t){return!!(t!=null&&t._isBuffer)}s.compare=function(r,e){if(!N(r)||!N(e))throw new TypeError("Arguments must be Buffers");if(r===e)return 0;for(var n=r.length,o=e.length,i=0,a=Math.min(n,o);i<a;++i)if(r[i]!==e[i]){n=r[i],o=e[i];break}return n<o?-1:o<n?1:0};s.isEncoding=function(r){switch(String(r).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}};s.concat=function(r,e){if(!Array.isArray(r))throw new TypeError('"list" argument must be an Array of Buffers');if(r.length===0)return s.alloc(0);var n;if(e===void 0)for(e=0,n=0;n<r.length;++n)e+=r[n].length;var o=s.allocUnsafe(e),i=0;for(n=0;n<r.length;++n){var a=r[n];if(!N(a))throw new TypeError('"list" argument must be an Array of Buffers');a.copy(o,i),i+=a.length}return o};function wr(t,r){if(N(t))return t.length;if(typeof ArrayBuffer<"u"&&typeof ArrayBuffer.isView=="function"&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;typeof t!="string"&&(t=""+t);var e=t.length;if(e===0)return 0;for(var n=!1;;)switch(r){case"ascii":case"latin1":case"binary":return e;case"utf8":case"utf-8":case void 0:return K(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return e*2;case"hex":return e>>>1;case"base64":return Or(t).length;default:if(n)return K(t).length;r=(""+r).toLowerCase(),n=!0}}s.byteLength=wr;function He(t,r,e){var n=!1;if((r===void 0||r<0)&&(r=0),r>this.length||((e===void 0||e>this.length)&&(e=this.length),e<=0)||(e>>>=0,r>>>=0,e<=r))return"";for(t||(t="utf8");;)switch(t){case"hex":return rt(this,r,e);case"utf8":case"utf-8":return Sr(this,r,e);case"ascii":return Qe(this,r,e);case"latin1":case"binary":return Ze(this,r,e);case"base64":return Je(this,r,e);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return et(this,r,e);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}s.prototype._isBuffer=!0;function L(t,r,e){var n=t[r];t[r]=t[e],t[e]=n}s.prototype.swap16=function(){var r=this.length;if(r%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var e=0;e<r;e+=2)L(this,e,e+1);return this};s.prototype.swap32=function(){var r=this.length;if(r%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var e=0;e<r;e+=4)L(this,e,e+3),L(this,e+1,e+2);return this};s.prototype.swap64=function(){var r=this.length;if(r%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var e=0;e<r;e+=8)L(this,e,e+7),L(this,e+1,e+6),L(this,e+2,e+5),L(this,e+3,e+4);return this};s.prototype.toString=function(){var r=this.length|0;return r===0?"":arguments.length===0?Sr(this,0,r):He.apply(this,arguments)};s.prototype.equals=function(r){if(!N(r))throw new TypeError("Argument must be a Buffer");return this===r?!0:s.compare(this,r)===0};s.prototype.compare=function(r,e,n,o,i){if(!N(r))throw new TypeError("Argument must be a Buffer");if(e===void 0&&(e=0),n===void 0&&(n=r?r.length:0),o===void 0&&(o=0),i===void 0&&(i=this.length),e<0||n>r.length||o<0||i>this.length)throw new RangeError("out of range index");if(o>=i&&e>=n)return 0;if(o>=i)return-1;if(e>=n)return 1;if(e>>>=0,n>>>=0,o>>>=0,i>>>=0,this===r)return 0;for(var a=i-o,c=n-e,p=Math.min(a,c),d=this.slice(o,i),f=r.slice(e,n),l=0;l<p;++l)if(d[l]!==f[l]){a=d[l],c=f[l];break}return a<c?-1:c<a?1:0};function Nr(t,r,e,n,o){if(t.length===0)return-1;if(typeof e=="string"?(n=e,e=0):e>2147483647?e=2147483647:e<-2147483648&&(e=-2147483648),e=+e,isNaN(e)&&(e=o?0:t.length-1),e<0&&(e=t.length+e),e>=t.length){if(o)return-1;e=t.length-1}else if(e<0)if(o)e=0;else return-1;if(typeof r=="string"&&(r=s.from(r,n)),N(r))return r.length===0?-1:Ar(t,r,e,n,o);if(typeof r=="number")return r=r&255,s.TYPED_ARRAY_SUPPORT&&typeof Uint8Array.prototype.indexOf=="function"?o?Uint8Array.prototype.indexOf.call(t,r,e):Uint8Array.prototype.lastIndexOf.call(t,r,e):Ar(t,[r],e,n,o);throw new TypeError("val must be string, number or Buffer")}function Ar(t,r,e,n,o){var i=1,a=t.length,c=r.length;if(n!==void 0&&(n=String(n).toLowerCase(),n==="ucs2"||n==="ucs-2"||n==="utf16le"||n==="utf-16le")){if(t.length<2||r.length<2)return-1;i=2,a/=2,c/=2,e/=2}function p(g,y){return i===1?g[y]:g.readUInt16BE(y*i)}var d;if(o){var f=-1;for(d=e;d<a;d++)if(p(t,d)===p(r,f===-1?0:d-f)){if(f===-1&&(f=d),d-f+1===c)return f*i}else f!==-1&&(d-=d-f),f=-1}else for(e+c>a&&(e=a-c),d=e;d>=0;d--){for(var l=!0,h=0;h<c;h++)if(p(t,d+h)!==p(r,h)){l=!1;break}if(l)return d}return-1}s.prototype.includes=function(r,e,n){return this.indexOf(r,e,n)!==-1};s.prototype.indexOf=function(r,e,n){return Nr(this,r,e,n,!0)};s.prototype.lastIndexOf=function(r,e,n){return Nr(this,r,e,n,!1)};function Ve(t,r,e,n){e=Number(e)||0;var o=t.length-e;n?(n=Number(n),n>o&&(n=o)):n=o;var i=r.length;if(i%2!==0)throw new TypeError("Invalid hex string");n>i/2&&(n=i/2);for(var a=0;a<n;++a){var c=parseInt(r.substr(a*2,2),16);if(isNaN(c))return a;t[e+a]=c}return a}function $e(t,r,e,n){return $(K(r,t.length-e),t,e,n)}function Rr(t,r,e,n){return $(at(r),t,e,n)}function ze(t,r,e,n){return Rr(t,r,e,n)}function Xe(t,r,e,n){return $(Or(r),t,e,n)}function qe(t,r,e,n){return $(st(r,t.length-e),t,e,n)}s.prototype.write=function(r,e,n,o){if(e===void 0)o="utf8",n=this.length,e=0;else if(n===void 0&&typeof e=="string")o=e,n=this.length,e=0;else if(isFinite(e))e=e|0,isFinite(n)?(n=n|0,o===void 0&&(o="utf8")):(o=n,n=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var i=this.length-e;if((n===void 0||n>i)&&(n=i),r.length>0&&(n<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");o||(o="utf8");for(var a=!1;;)switch(o){case"hex":return Ve(this,r,e,n);case"utf8":case"utf-8":return $e(this,r,e,n);case"ascii":return Rr(this,r,e,n);case"latin1":case"binary":return ze(this,r,e,n);case"base64":return Xe(this,r,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return qe(this,r,e,n);default:if(a)throw new TypeError("Unknown encoding: "+o);o=(""+o).toLowerCase(),a=!0}};s.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function Je(t,r,e){return r===0&&e===t.length?Er(t):Er(t.slice(r,e))}function Sr(t,r,e){e=Math.min(t.length,e);for(var n=[],o=r;o<e;){var i=t[o],a=null,c=i>239?4:i>223?3:i>191?2:1;if(o+c<=e){var p,d,f,l;switch(c){case 1:i<128&&(a=i);break;case 2:p=t[o+1],(p&192)===128&&(l=(i&31)<<6|p&63,l>127&&(a=l));break;case 3:p=t[o+1],d=t[o+2],(p&192)===128&&(d&192)===128&&(l=(i&15)<<12|(p&63)<<6|d&63,l>2047&&(l<55296||l>57343)&&(a=l));break;case 4:p=t[o+1],d=t[o+2],f=t[o+3],(p&192)===128&&(d&192)===128&&(f&192)===128&&(l=(i&15)<<18|(p&63)<<12|(d&63)<<6|f&63,l>65535&&l<1114112&&(a=l))}}a===null?(a=65533,c=1):a>65535&&(a-=65536,n.push(a>>>10&1023|55296),a=56320|a&1023),n.push(a),o+=c}return je(n)}var Tr=4096;function je(t){var r=t.length;if(r<=Tr)return String.fromCharCode.apply(String,t);for(var e="",n=0;n<r;)e+=String.fromCharCode.apply(String,t.slice(n,n+=Tr));return e}function Qe(t,r,e){var n="";e=Math.min(t.length,e);for(var o=r;o<e;++o)n+=String.fromCharCode(t[o]&127);return n}function Ze(t,r,e){var n="";e=Math.min(t.length,e);for(var o=r;o<e;++o)n+=String.fromCharCode(t[o]);return n}function rt(t,r,e){var n=t.length;(!r||r<0)&&(r=0),(!e||e<0||e>n)&&(e=n);for(var o="",i=r;i<e;++i)o+=it(t[i]);return o}function et(t,r,e){for(var n=t.slice(r,e),o="",i=0;i<n.length;i+=2)o+=String.fromCharCode(n[i]+n[i+1]*256);return o}s.prototype.slice=function(r,e){var n=this.length;r=~~r,e=e===void 0?n:~~e,r<0?(r+=n,r<0&&(r=0)):r>n&&(r=n),e<0?(e+=n,e<0&&(e=0)):e>n&&(e=n),e<r&&(e=r);var o;if(s.TYPED_ARRAY_SUPPORT)o=this.subarray(r,e),o.__proto__=s.prototype;else{var i=e-r;o=new s(i,void 0);for(var a=0;a<i;++a)o[a]=this[a+r]}return o};function b(t,r,e){if(t%1!==0||t<0)throw new RangeError("offset is not uint");if(t+r>e)throw new RangeError("Trying to access beyond buffer length")}s.prototype.readUIntLE=function(r,e,n){r=r|0,e=e|0,n||b(r,e,this.length);for(var o=this[r],i=1,a=0;++a<e&&(i*=256);)o+=this[r+a]*i;return o};s.prototype.readUIntBE=function(r,e,n){r=r|0,e=e|0,n||b(r,e,this.length);for(var o=this[r+--e],i=1;e>0&&(i*=256);)o+=this[r+--e]*i;return o};s.prototype.readUInt8=function(r,e){return e||b(r,1,this.length),this[r]};s.prototype.readUInt16LE=function(r,e){return e||b(r,2,this.length),this[r]|this[r+1]<<8};s.prototype.readUInt16BE=function(r,e){return e||b(r,2,this.length),this[r]<<8|this[r+1]};s.prototype.readUInt32LE=function(r,e){return e||b(r,4,this.length),(this[r]|this[r+1]<<8|this[r+2]<<16)+this[r+3]*16777216};s.prototype.readUInt32BE=function(r,e){return e||b(r,4,this.length),this[r]*16777216+(this[r+1]<<16|this[r+2]<<8|this[r+3])};s.prototype.readIntLE=function(r,e,n){r=r|0,e=e|0,n||b(r,e,this.length);for(var o=this[r],i=1,a=0;++a<e&&(i*=256);)o+=this[r+a]*i;return i*=128,o>=i&&(o-=Math.pow(2,8*e)),o};s.prototype.readIntBE=function(r,e,n){r=r|0,e=e|0,n||b(r,e,this.length);for(var o=e,i=1,a=this[r+--o];o>0&&(i*=256);)a+=this[r+--o]*i;return i*=128,a>=i&&(a-=Math.pow(2,8*e)),a};s.prototype.readInt8=function(r,e){return e||b(r,1,this.length),this[r]&128?(255-this[r]+1)*-1:this[r]};s.prototype.readInt16LE=function(r,e){e||b(r,2,this.length);var n=this[r]|this[r+1]<<8;return n&32768?n|4294901760:n};s.prototype.readInt16BE=function(r,e){e||b(r,2,this.length);var n=this[r+1]|this[r]<<8;return n&32768?n|4294901760:n};s.prototype.readInt32LE=function(r,e){return e||b(r,4,this.length),this[r]|this[r+1]<<8|this[r+2]<<16|this[r+3]<<24};s.prototype.readInt32BE=function(r,e){return e||b(r,4,this.length),this[r]<<24|this[r+1]<<16|this[r+2]<<8|this[r+3]};s.prototype.readFloatLE=function(r,e){return e||b(r,4,this.length),z(this,r,!0,23,4)};s.prototype.readFloatBE=function(r,e){return e||b(r,4,this.length),z(this,r,!1,23,4)};s.prototype.readDoubleLE=function(r,e){return e||b(r,8,this.length),z(this,r,!0,52,8)};s.prototype.readDoubleBE=function(r,e){return e||b(r,8,this.length),z(this,r,!1,52,8)};function A(t,r,e,n,o,i){if(!N(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(r>o||r<i)throw new RangeError('"value" argument is out of bounds');if(e+n>t.length)throw new RangeError("Index out of range")}s.prototype.writeUIntLE=function(r,e,n,o){if(r=+r,e=e|0,n=n|0,!o){var i=Math.pow(2,8*n)-1;A(this,r,e,n,i,0)}var a=1,c=0;for(this[e]=r&255;++c<n&&(a*=256);)this[e+c]=r/a&255;return e+n};s.prototype.writeUIntBE=function(r,e,n,o){if(r=+r,e=e|0,n=n|0,!o){var i=Math.pow(2,8*n)-1;A(this,r,e,n,i,0)}var a=n-1,c=1;for(this[e+a]=r&255;--a>=0&&(c*=256);)this[e+a]=r/c&255;return e+n};s.prototype.writeUInt8=function(r,e,n){return r=+r,e=e|0,n||A(this,r,e,1,255,0),s.TYPED_ARRAY_SUPPORT||(r=Math.floor(r)),this[e]=r&255,e+1};function H(t,r,e,n){r<0&&(r=65535+r+1);for(var o=0,i=Math.min(t.length-e,2);o<i;++o)t[e+o]=(r&255<<8*(n?o:1-o))>>>(n?o:1-o)*8}s.prototype.writeUInt16LE=function(r,e,n){return r=+r,e=e|0,n||A(this,r,e,2,65535,0),s.TYPED_ARRAY_SUPPORT?(this[e]=r&255,this[e+1]=r>>>8):H(this,r,e,!0),e+2};s.prototype.writeUInt16BE=function(r,e,n){return r=+r,e=e|0,n||A(this,r,e,2,65535,0),s.TYPED_ARRAY_SUPPORT?(this[e]=r>>>8,this[e+1]=r&255):H(this,r,e,!1),e+2};function V(t,r,e,n){r<0&&(r=4294967295+r+1);for(var o=0,i=Math.min(t.length-e,4);o<i;++o)t[e+o]=r>>>(n?o:3-o)*8&255}s.prototype.writeUInt32LE=function(r,e,n){return r=+r,e=e|0,n||A(this,r,e,4,4294967295,0),s.TYPED_ARRAY_SUPPORT?(this[e+3]=r>>>24,this[e+2]=r>>>16,this[e+1]=r>>>8,this[e]=r&255):V(this,r,e,!0),e+4};s.prototype.writeUInt32BE=function(r,e,n){return r=+r,e=e|0,n||A(this,r,e,4,4294967295,0),s.TYPED_ARRAY_SUPPORT?(this[e]=r>>>24,this[e+1]=r>>>16,this[e+2]=r>>>8,this[e+3]=r&255):V(this,r,e,!1),e+4};s.prototype.writeIntLE=function(r,e,n,o){if(r=+r,e=e|0,!o){var i=Math.pow(2,8*n-1);A(this,r,e,n,i-1,-i)}var a=0,c=1,p=0;for(this[e]=r&255;++a<n&&(c*=256);)r<0&&p===0&&this[e+a-1]!==0&&(p=1),this[e+a]=(r/c>>0)-p&255;return e+n};s.prototype.writeIntBE=function(r,e,n,o){if(r=+r,e=e|0,!o){var i=Math.pow(2,8*n-1);A(this,r,e,n,i-1,-i)}var a=n-1,c=1,p=0;for(this[e+a]=r&255;--a>=0&&(c*=256);)r<0&&p===0&&this[e+a+1]!==0&&(p=1),this[e+a]=(r/c>>0)-p&255;return e+n};s.prototype.writeInt8=function(r,e,n){return r=+r,e=e|0,n||A(this,r,e,1,127,-128),s.TYPED_ARRAY_SUPPORT||(r=Math.floor(r)),r<0&&(r=255+r+1),this[e]=r&255,e+1};s.prototype.writeInt16LE=function(r,e,n){return r=+r,e=e|0,n||A(this,r,e,2,32767,-32768),s.TYPED_ARRAY_SUPPORT?(this[e]=r&255,this[e+1]=r>>>8):H(this,r,e,!0),e+2};s.prototype.writeInt16BE=function(r,e,n){return r=+r,e=e|0,n||A(this,r,e,2,32767,-32768),s.TYPED_ARRAY_SUPPORT?(this[e]=r>>>8,this[e+1]=r&255):H(this,r,e,!1),e+2};s.prototype.writeInt32LE=function(r,e,n){return r=+r,e=e|0,n||A(this,r,e,4,2147483647,-2147483648),s.TYPED_ARRAY_SUPPORT?(this[e]=r&255,this[e+1]=r>>>8,this[e+2]=r>>>16,this[e+3]=r>>>24):V(this,r,e,!0),e+4};s.prototype.writeInt32BE=function(r,e,n){return r=+r,e=e|0,n||A(this,r,e,4,2147483647,-2147483648),r<0&&(r=4294967295+r+1),s.TYPED_ARRAY_SUPPORT?(this[e]=r>>>24,this[e+1]=r>>>16,this[e+2]=r>>>8,this[e+3]=r&255):V(this,r,e,!1),e+4};function Br(t,r,e,n,o,i){if(e+n>t.length)throw new RangeError("Index out of range");if(e<0)throw new RangeError("Index out of range")}function Dr(t,r,e,n,o){return o||Br(t,r,e,4,34028234663852886e22,-34028234663852886e22),Pr(t,r,e,n,23,4),e+4}s.prototype.writeFloatLE=function(r,e,n){return Dr(this,r,e,!0,n)};s.prototype.writeFloatBE=function(r,e,n){return Dr(this,r,e,!1,n)};function Cr(t,r,e,n,o){return o||Br(t,r,e,8,17976931348623157e292,-17976931348623157e292),Pr(t,r,e,n,52,8),e+8}s.prototype.writeDoubleLE=function(r,e,n){return Cr(this,r,e,!0,n)};s.prototype.writeDoubleBE=function(r,e,n){return Cr(this,r,e,!1,n)};s.prototype.copy=function(r,e,n,o){if(n||(n=0),!o&&o!==0&&(o=this.length),e>=r.length&&(e=r.length),e||(e=0),o>0&&o<n&&(o=n),o===n||r.length===0||this.length===0)return 0;if(e<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("sourceStart out of bounds");if(o<0)throw new RangeError("sourceEnd out of bounds");o>this.length&&(o=this.length),r.length-e<o-n&&(o=r.length-e+n);var i=o-n,a;if(this===r&&n<e&&e<o)for(a=i-1;a>=0;--a)r[a+e]=this[a+n];else if(i<1e3||!s.TYPED_ARRAY_SUPPORT)for(a=0;a<i;++a)r[a+e]=this[a+n];else Uint8Array.prototype.set.call(r,this.subarray(n,n+i),e);return i};s.prototype.fill=function(r,e,n,o){if(typeof r=="string"){if(typeof e=="string"?(o=e,e=0,n=this.length):typeof n=="string"&&(o=n,n=this.length),r.length===1){var i=r.charCodeAt(0);i<256&&(r=i)}if(o!==void 0&&typeof o!="string")throw new TypeError("encoding must be a string");if(typeof o=="string"&&!s.isEncoding(o))throw new TypeError("Unknown encoding: "+o)}else typeof r=="number"&&(r=r&255);if(e<0||this.length<e||this.length<n)throw new RangeError("Out of range index");if(n<=e)return this;e=e>>>0,n=n===void 0?this.length:n>>>0,r||(r=0);var a;if(typeof r=="number")for(a=e;a<n;++a)this[a]=r;else{var c=N(r)?r:K(new s(r,o).toString()),p=c.length;for(a=0;a<n-e;++a)this[a+e]=c[a%p]}return this};var tt=/[^+\/0-9A-Za-z-_]/g;function nt(t){if(t=ot(t).replace(tt,""),t.length<2)return"";for(;t.length%4!==0;)t=t+"=";return t}function ot(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}function it(t){return t<16?"0"+t.toString(16):t.toString(16)}function K(t,r){r=r||1/0;for(var e,n=t.length,o=null,i=[],a=0;a<n;++a){if(e=t.charCodeAt(a),e>55295&&e<57344){if(!o){if(e>56319){(r-=3)>-1&&i.push(239,191,189);continue}else if(a+1===n){(r-=3)>-1&&i.push(239,191,189);continue}o=e;continue}if(e<56320){(r-=3)>-1&&i.push(239,191,189),o=e;continue}e=(o-55296<<10|e-56320)+65536}else o&&(r-=3)>-1&&i.push(239,191,189);if(o=null,e<128){if((r-=1)<0)break;i.push(e)}else if(e<2048){if((r-=2)<0)break;i.push(e>>6|192,e&63|128)}else if(e<65536){if((r-=3)<0)break;i.push(e>>12|224,e>>6&63|128,e&63|128)}else if(e<1114112){if((r-=4)<0)break;i.push(e>>18|240,e>>12&63|128,e>>6&63|128,e&63|128)}else throw new Error("Invalid code point")}return i}function at(t){for(var r=[],e=0;e<t.length;++e)r.push(t.charCodeAt(e)&255);return r}function st(t,r){for(var e,n,o,i=[],a=0;a<t.length&&!((r-=2)<0);++a)e=t.charCodeAt(a),n=e>>8,o=e%256,i.push(o),i.push(n);return i}function Or(t){return Me(nt(t))}function $(t,r,e,n){for(var o=0;o<n&&!(o+e>=r.length||o>=t.length);++o)r[o+e]=t[o];return o}function ct(t){return t!==t}function ut(t){return t!=null&&(!!t._isBuffer||kr(t)||pt(t))}function kr(t){return!!t.constructor&&typeof t.constructor.isBuffer=="function"&&t.constructor.isBuffer(t)}function pt(t){return typeof t.readFloatLE=="function"&&typeof t.slice=="function"&&kr(t.slice(0,0))}function z(t,r,e,n,o){var i,a,c=o*8-n-1,p=(1<<c)-1,d=p>>1,f=-7,l=e?o-1:0,h=e?-1:1,g=t[r+l];for(l+=h,i=g&(1<<-f)-1,g>>=-f,f+=c;f>0;i=i*256+t[r+l],l+=h,f-=8);for(a=i&(1<<-f)-1,i>>=-f,f+=n;f>0;a=a*256+t[r+l],l+=h,f-=8);if(i===0)i=1-d;else{if(i===p)return a?NaN:(g?-1:1)*(1/0);a=a+Math.pow(2,n),i=i-d}return(g?-1:1)*a*Math.pow(2,i-n)}function Pr(t,r,e,n,o,i){var a,c,p,d=i*8-o-1,f=(1<<d)-1,l=f>>1,h=o===23?Math.pow(2,-24)-Math.pow(2,-77):0,g=n?0:i-1,y=n?1:-1,tr=r<0||r===0&&1/r<0?1:0;for(r=Math.abs(r),isNaN(r)||r===1/0?(c=isNaN(r)?1:0,a=f):(a=Math.floor(Math.log(r)/Math.LN2),r*(p=Math.pow(2,-a))<1&&(a--,p*=2),a+l>=1?r+=h/p:r+=h*Math.pow(2,1-l),r*p>=2&&(a++,p/=2),a+l>=f?(c=0,a=f):a+l>=1?(c=(r*p-1)*Math.pow(2,o),a=a+l):(c=r*Math.pow(2,l-1)*Math.pow(2,o),a=0));o>=8;t[e+g]=c&255,g+=y,c/=256,o-=8);for(a=a<<o|c,d+=o;d>0;t[e+g]=a&255,g+=y,a/=256,d-=8);t[e+g-y]|=tr*128}import*as x from"ethereumjs-util";import wu from"algosdk";import*as cn from"bs58";import Wo from"algosdk";import Nn,{decodeAddress as Rn,encodeAddress as Sn}from"algosdk";var R=[],I=[],lt=typeof Uint8Array<"u"?Uint8Array:Array,cr=!1;function vr(){cr=!0;for(var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",r=0,e=t.length;r<e;++r)R[r]=t[r],I[t.charCodeAt(r)]=r;I[45]=62,I[95]=63}function mt(t){cr||vr();var r,e,n,o,i,a,c=t.length;if(c%4>0)throw new Error("Invalid string. Length must be a multiple of 4");i=t[c-2]==="="?2:t[c-1]==="="?1:0,a=new lt(c*3/4-i),n=i>0?c-4:c;var p=0;for(r=0,e=0;r<n;r+=4,e+=3)o=I[t.charCodeAt(r)]<<18|I[t.charCodeAt(r+1)]<<12|I[t.charCodeAt(r+2)]<<6|I[t.charCodeAt(r+3)],a[p++]=o>>16&255,a[p++]=o>>8&255,a[p++]=o&255;return i===2?(o=I[t.charCodeAt(r)]<<2|I[t.charCodeAt(r+1)]>>4,a[p++]=o&255):i===1&&(o=I[t.charCodeAt(r)]<<10|I[t.charCodeAt(r+1)]<<4|I[t.charCodeAt(r+2)]>>2,a[p++]=o>>8&255,a[p++]=o&255),a}function dt(t){return R[t>>18&63]+R[t>>12&63]+R[t>>6&63]+R[t&63]}function ft(t,r,e){for(var n,o=[],i=r;i<e;i+=3)n=(t[i]<<16)+(t[i+1]<<8)+t[i+2],o.push(dt(n));return o.join("")}function Ur(t){cr||vr();for(var r,e=t.length,n=e%3,o="",i=[],a=16383,c=0,p=e-n;c<p;c+=a)i.push(ft(t,c,c+a>p?p:c+a));return n===1?(r=t[e-1],o+=R[r>>2],o+=R[r<<4&63],o+="=="):n===2&&(r=(t[e-2]<<8)+t[e-1],o+=R[r>>10],o+=R[r>>4&63],o+=R[r<<2&63],o+="="),i.push(o),i.join("")}function J(t,r,e,n,o){var i,a,c=o*8-n-1,p=(1<<c)-1,d=p>>1,f=-7,l=e?o-1:0,h=e?-1:1,g=t[r+l];for(l+=h,i=g&(1<<-f)-1,g>>=-f,f+=c;f>0;i=i*256+t[r+l],l+=h,f-=8);for(a=i&(1<<-f)-1,i>>=-f,f+=n;f>0;a=a*256+t[r+l],l+=h,f-=8);if(i===0)i=1-d;else{if(i===p)return a?NaN:(g?-1:1)*(1/0);a=a+Math.pow(2,n),i=i-d}return(g?-1:1)*a*Math.pow(2,i-n)}function Fr(t,r,e,n,o,i){var a,c,p,d=i*8-o-1,f=(1<<d)-1,l=f>>1,h=o===23?Math.pow(2,-24)-Math.pow(2,-77):0,g=n?0:i-1,y=n?1:-1,tr=r<0||r===0&&1/r<0?1:0;for(r=Math.abs(r),isNaN(r)||r===1/0?(c=isNaN(r)?1:0,a=f):(a=Math.floor(Math.log(r)/Math.LN2),r*(p=Math.pow(2,-a))<1&&(a--,p*=2),a+l>=1?r+=h/p:r+=h*Math.pow(2,1-l),r*p>=2&&(a++,p/=2),a+l>=f?(c=0,a=f):a+l>=1?(c=(r*p-1)*Math.pow(2,o),a=a+l):(c=r*Math.pow(2,l-1)*Math.pow(2,o),a=0));o>=8;t[e+g]=c&255,g+=y,c/=256,o-=8);for(a=a<<o|c,d+=o;d>0;t[e+g]=a&255,g+=y,a/=256,d-=8);t[e+g-y]|=tr*128}var gt={}.toString,Yr=Array.isArray||function(t){return gt.call(t)=="[object Array]"};var ht=50;u.TYPED_ARRAY_SUPPORT=globalThis.TYPED_ARRAY_SUPPORT!==void 0?globalThis.TYPED_ARRAY_SUPPORT:!0;var Tn=X();function X(){return u.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function C(t,r){if(X()<r)throw new RangeError("Invalid typed array length");return u.TYPED_ARRAY_SUPPORT?(t=new Uint8Array(r),t.__proto__=u.prototype):(t===null&&(t=new u(r)),t.length=r),t}function u(t,r,e){if(!u.TYPED_ARRAY_SUPPORT&&!(this instanceof u))return new u(t,r,e);if(typeof t=="number"){if(typeof r=="string")throw new Error("If encoding is specified then the first argument must be a string");return ur(this,t)}return Gr(this,t,r,e)}u.poolSize=8192;u._augment=function(t){return t.__proto__=u.prototype,t};function Gr(t,r,e,n){if(typeof r=="number")throw new TypeError('"value" argument must not be a number');return typeof ArrayBuffer<"u"&&r instanceof ArrayBuffer?Et(t,r,e,n):typeof r=="string"?bt(t,r,e):At(t,r)}u.from=function(t,r,e){return Gr(null,t,r,e)};u.TYPED_ARRAY_SUPPORT&&(u.prototype.__proto__=Uint8Array.prototype,u.__proto__=Uint8Array);function Wr(t){if(typeof t!="number")throw new TypeError('"size" argument must be a number');if(t<0)throw new RangeError('"size" argument must not be negative')}function xt(t,r,e,n){return Wr(r),r<=0?C(t,r):e!==void 0?typeof n=="string"?C(t,r).fill(e,n):C(t,r).fill(e):C(t,r)}u.alloc=function(t,r,e){return xt(null,t,r,e)};function ur(t,r){if(Wr(r),t=C(t,r<0?0:pr(r)|0),!u.TYPED_ARRAY_SUPPORT)for(var e=0;e<r;++e)t[e]=0;return t}u.allocUnsafe=function(t){return ur(null,t)};u.allocUnsafeSlow=function(t){return ur(null,t)};function bt(t,r,e){if((typeof e!="string"||e==="")&&(e="utf8"),!u.isEncoding(e))throw new TypeError('"encoding" must be a valid string encoding');var n=Kr(r,e)|0;t=C(t,n);var o=t.write(r,e);return o!==n&&(t=t.slice(0,o)),t}function sr(t,r){var e=r.length<0?0:pr(r.length)|0;t=C(t,e);for(var n=0;n<e;n+=1)t[n]=r[n]&255;return t}function Et(t,r,e,n){if(r.byteLength,e<0||r.byteLength<e)throw new RangeError("'offset' is out of bounds");if(r.byteLength<e+(n||0))throw new RangeError("'length' is out of bounds");return e===void 0&&n===void 0?r=new Uint8Array(r):n===void 0?r=new Uint8Array(r,e):r=new Uint8Array(r,e,n),u.TYPED_ARRAY_SUPPORT?(t=r,t.__proto__=u.prototype):t=sr(t,r),t}function At(t,r){if(S(r)){var e=pr(r.length)|0;return t=C(t,e),t.length===0||r.copy(t,0,0,e),t}if(r){if(typeof ArrayBuffer<"u"&&r.buffer instanceof ArrayBuffer||"length"in r)return typeof r.length!="number"||Ft(r.length)?C(t,0):sr(t,r);if(r.type==="Buffer"&&Yr(r.data))return sr(t,r.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function pr(t){if(t>=X())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+X().toString(16)+" bytes");return t|0}u.isBuffer=Yt;function S(t){return!!(t!=null&&t._isBuffer)}u.compare=function(r,e){if(!S(r)||!S(e))throw new TypeError("Arguments must be Buffers");if(r===e)return 0;for(var n=r.length,o=e.length,i=0,a=Math.min(n,o);i<a;++i)if(r[i]!==e[i]){n=r[i],o=e[i];break}return n<o?-1:o<n?1:0};u.isEncoding=function(r){switch(String(r).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}};u.concat=function(r,e){if(!Yr(r))throw new TypeError('"list" argument must be an Array of Buffers');if(r.length===0)return u.alloc(0);var n;if(e===void 0)for(e=0,n=0;n<r.length;++n)e+=r[n].length;var o=u.allocUnsafe(e),i=0;for(n=0;n<r.length;++n){var a=r[n];if(!S(a))throw new TypeError('"list" argument must be an Array of Buffers');a.copy(o,i),i+=a.length}return o};function Kr(t,r){if(S(t))return t.length;if(typeof ArrayBuffer<"u"&&typeof ArrayBuffer.isView=="function"&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;typeof t!="string"&&(t=""+t);var e=t.length;if(e===0)return 0;for(var n=!1;;)switch(r){case"ascii":case"latin1":case"binary":return e;case"utf8":case"utf-8":case void 0:return q(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return e*2;case"hex":return e>>>1;case"base64":return Jr(t).length;default:if(n)return q(t).length;r=(""+r).toLowerCase(),n=!0}}u.byteLength=Kr;function Tt(t,r,e){var n=!1;if((r===void 0||r<0)&&(r=0),r>this.length||((e===void 0||e>this.length)&&(e=this.length),e<=0)||(e>>>=0,r>>>=0,e<=r))return"";for(t||(t="utf8");;)switch(t){case"hex":return Ct(this,r,e);case"utf8":case"utf-8":return $r(this,r,e);case"ascii":return Bt(this,r,e);case"latin1":case"binary":return Dt(this,r,e);case"base64":return Rt(this,r,e);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Ot(this,r,e);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}u.prototype._isBuffer=!0;function M(t,r,e){var n=t[r];t[r]=t[e],t[e]=n}u.prototype.swap16=function(){var r=this.length;if(r%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var e=0;e<r;e+=2)M(this,e,e+1);return this};u.prototype.swap32=function(){var r=this.length;if(r%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var e=0;e<r;e+=4)M(this,e,e+3),M(this,e+1,e+2);return this};u.prototype.swap64=function(){var r=this.length;if(r%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var e=0;e<r;e+=8)M(this,e,e+7),M(this,e+1,e+6),M(this,e+2,e+5),M(this,e+3,e+4);return this};u.prototype.toString=function(){var r=this.length|0;return r===0?"":arguments.length===0?$r(this,0,r):Tt.apply(this,arguments)};u.prototype.equals=function(r){if(!S(r))throw new TypeError("Argument must be a Buffer");return this===r?!0:u.compare(this,r)===0};u.prototype.inspect=function(){var r="",e=ht;return this.length>0&&(r=this.toString("hex",0,e).match(/.{2}/g).join(" "),this.length>e&&(r+=" ... ")),"<Buffer "+r+">"};u.prototype.compare=function(r,e,n,o,i){if(!S(r))throw new TypeError("Argument must be a Buffer");if(e===void 0&&(e=0),n===void 0&&(n=r?r.length:0),o===void 0&&(o=0),i===void 0&&(i=this.length),e<0||n>r.length||o<0||i>this.length)throw new RangeError("out of range index");if(o>=i&&e>=n)return 0;if(o>=i)return-1;if(e>=n)return 1;if(e>>>=0,n>>>=0,o>>>=0,i>>>=0,this===r)return 0;for(var a=i-o,c=n-e,p=Math.min(a,c),d=this.slice(o,i),f=r.slice(e,n),l=0;l<p;++l)if(d[l]!==f[l]){a=d[l],c=f[l];break}return a<c?-1:c<a?1:0};function Hr(t,r,e,n,o){if(t.length===0)return-1;if(typeof e=="string"?(n=e,e=0):e>2147483647?e=2147483647:e<-2147483648&&(e=-2147483648),e=+e,isNaN(e)&&(e=o?0:t.length-1),e<0&&(e=t.length+e),e>=t.length){if(o)return-1;e=t.length-1}else if(e<0)if(o)e=0;else return-1;if(typeof r=="string"&&(r=u.from(r,n)),S(r))return r.length===0?-1:Lr(t,r,e,n,o);if(typeof r=="number")return r=r&255,u.TYPED_ARRAY_SUPPORT&&typeof Uint8Array.prototype.indexOf=="function"?o?Uint8Array.prototype.indexOf.call(t,r,e):Uint8Array.prototype.lastIndexOf.call(t,r,e):Lr(t,[r],e,n,o);throw new TypeError("val must be string, number or Buffer")}function Lr(t,r,e,n,o){var i=1,a=t.length,c=r.length;if(n!==void 0&&(n=String(n).toLowerCase(),n==="ucs2"||n==="ucs-2"||n==="utf16le"||n==="utf-16le")){if(t.length<2||r.length<2)return-1;i=2,a/=2,c/=2,e/=2}function p(g,y){return i===1?g[y]:g.readUInt16BE(y*i)}var d;if(o){var f=-1;for(d=e;d<a;d++)if(p(t,d)===p(r,f===-1?0:d-f)){if(f===-1&&(f=d),d-f+1===c)return f*i}else f!==-1&&(d-=d-f),f=-1}else for(e+c>a&&(e=a-c),d=e;d>=0;d--){for(var l=!0,h=0;h<c;h++)if(p(t,d+h)!==p(r,h)){l=!1;break}if(l)return d}return-1}u.prototype.includes=function(r,e,n){return this.indexOf(r,e,n)!==-1};u.prototype.indexOf=function(r,e,n){return Hr(this,r,e,n,!0)};u.prototype.lastIndexOf=function(r,e,n){return Hr(this,r,e,n,!1)};function yt(t,r,e,n){e=Number(e)||0;var o=t.length-e;n?(n=Number(n),n>o&&(n=o)):n=o;var i=r.length;if(i%2!==0)throw new TypeError("Invalid hex string");n>i/2&&(n=i/2);for(var a=0;a<n;++a){var c=parseInt(r.substr(a*2,2),16);if(isNaN(c))return a;t[e+a]=c}return a}function _t(t,r,e,n){return Z(q(r,t.length-e),t,e,n)}function Vr(t,r,e,n){return Z(Mt(r),t,e,n)}function It(t,r,e,n){return Vr(t,r,e,n)}function wt(t,r,e,n){return Z(Jr(r),t,e,n)}function Nt(t,r,e,n){return Z(vt(r,t.length-e),t,e,n)}u.prototype.write=function(r,e,n,o){if(e===void 0)o="utf8",n=this.length,e=0;else if(n===void 0&&typeof e=="string")o=e,n=this.length,e=0;else if(isFinite(e))e=e|0,isFinite(n)?(n=n|0,o===void 0&&(o="utf8")):(o=n,n=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var i=this.length-e;if((n===void 0||n>i)&&(n=i),r.length>0&&(n<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");o||(o="utf8");for(var a=!1;;)switch(o){case"hex":return yt(this,r,e,n);case"utf8":case"utf-8":return _t(this,r,e,n);case"ascii":return Vr(this,r,e,n);case"latin1":case"binary":return It(this,r,e,n);case"base64":return wt(this,r,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Nt(this,r,e,n);default:if(a)throw new TypeError("Unknown encoding: "+o);o=(""+o).toLowerCase(),a=!0}};u.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function Rt(t,r,e){return r===0&&e===t.length?Ur(t):Ur(t.slice(r,e))}function $r(t,r,e){e=Math.min(t.length,e);for(var n=[],o=r;o<e;){var i=t[o],a=null,c=i>239?4:i>223?3:i>191?2:1;if(o+c<=e){var p,d,f,l;switch(c){case 1:i<128&&(a=i);break;case 2:p=t[o+1],(p&192)===128&&(l=(i&31)<<6|p&63,l>127&&(a=l));break;case 3:p=t[o+1],d=t[o+2],(p&192)===128&&(d&192)===128&&(l=(i&15)<<12|(p&63)<<6|d&63,l>2047&&(l<55296||l>57343)&&(a=l));break;case 4:p=t[o+1],d=t[o+2],f=t[o+3],(p&192)===128&&(d&192)===128&&(f&192)===128&&(l=(i&15)<<18|(p&63)<<12|(d&63)<<6|f&63,l>65535&&l<1114112&&(a=l))}}a===null?(a=65533,c=1):a>65535&&(a-=65536,n.push(a>>>10&1023|55296),a=56320|a&1023),n.push(a),o+=c}return St(n)}var Mr=4096;function St(t){var r=t.length;if(r<=Mr)return String.fromCharCode.apply(String,t);for(var e="",n=0;n<r;)e+=String.fromCharCode.apply(String,t.slice(n,n+=Mr));return e}function Bt(t,r,e){var n="";e=Math.min(t.length,e);for(var o=r;o<e;++o)n+=String.fromCharCode(t[o]&127);return n}function Dt(t,r,e){var n="";e=Math.min(t.length,e);for(var o=r;o<e;++o)n+=String.fromCharCode(t[o]);return n}function Ct(t,r,e){var n=t.length;(!r||r<0)&&(r=0),(!e||e<0||e>n)&&(e=n);for(var o="",i=r;i<e;++i)o+=Lt(t[i]);return o}function Ot(t,r,e){for(var n=t.slice(r,e),o="",i=0;i<n.length;i+=2)o+=String.fromCharCode(n[i]+n[i+1]*256);return o}u.prototype.slice=function(r,e){var n=this.length;r=~~r,e=e===void 0?n:~~e,r<0?(r+=n,r<0&&(r=0)):r>n&&(r=n),e<0?(e+=n,e<0&&(e=0)):e>n&&(e=n),e<r&&(e=r);var o;if(u.TYPED_ARRAY_SUPPORT)o=this.subarray(r,e),o.__proto__=u.prototype;else{var i=e-r;o=new u(i,void 0);for(var a=0;a<i;++a)o[a]=this[a+r]}return o};function E(t,r,e){if(t%1!==0||t<0)throw new RangeError("offset is not uint");if(t+r>e)throw new RangeError("Trying to access beyond buffer length")}u.prototype.readUIntLE=function(r,e,n){r=r|0,e=e|0,n||E(r,e,this.length);for(var o=this[r],i=1,a=0;++a<e&&(i*=256);)o+=this[r+a]*i;return o};u.prototype.readUIntBE=function(r,e,n){r=r|0,e=e|0,n||E(r,e,this.length);for(var o=this[r+--e],i=1;e>0&&(i*=256);)o+=this[r+--e]*i;return o};u.prototype.readUInt8=function(r,e){return e||E(r,1,this.length),this[r]};u.prototype.readUInt16LE=function(r,e){return e||E(r,2,this.length),this[r]|this[r+1]<<8};u.prototype.readUInt16BE=function(r,e){return e||E(r,2,this.length),this[r]<<8|this[r+1]};u.prototype.readUInt32LE=function(r,e){return e||E(r,4,this.length),(this[r]|this[r+1]<<8|this[r+2]<<16)+this[r+3]*16777216};u.prototype.readUInt32BE=function(r,e){return e||E(r,4,this.length),this[r]*16777216+(this[r+1]<<16|this[r+2]<<8|this[r+3])};u.prototype.readIntLE=function(r,e,n){r=r|0,e=e|0,n||E(r,e,this.length);for(var o=this[r],i=1,a=0;++a<e&&(i*=256);)o+=this[r+a]*i;return i*=128,o>=i&&(o-=Math.pow(2,8*e)),o};u.prototype.readIntBE=function(r,e,n){r=r|0,e=e|0,n||E(r,e,this.length);for(var o=e,i=1,a=this[r+--o];o>0&&(i*=256);)a+=this[r+--o]*i;return i*=128,a>=i&&(a-=Math.pow(2,8*e)),a};u.prototype.readInt8=function(r,e){return e||E(r,1,this.length),this[r]&128?(255-this[r]+1)*-1:this[r]};u.prototype.readInt16LE=function(r,e){e||E(r,2,this.length);var n=this[r]|this[r+1]<<8;return n&32768?n|4294901760:n};u.prototype.readInt16BE=function(r,e){e||E(r,2,this.length);var n=this[r+1]|this[r]<<8;return n&32768?n|4294901760:n};u.prototype.readInt32LE=function(r,e){return e||E(r,4,this.length),this[r]|this[r+1]<<8|this[r+2]<<16|this[r+3]<<24};u.prototype.readInt32BE=function(r,e){return e||E(r,4,this.length),this[r]<<24|this[r+1]<<16|this[r+2]<<8|this[r+3]};u.prototype.readFloatLE=function(r,e){return e||E(r,4,this.length),J(this,r,!0,23,4)};u.prototype.readFloatBE=function(r,e){return e||E(r,4,this.length),J(this,r,!1,23,4)};u.prototype.readDoubleLE=function(r,e){return e||E(r,8,this.length),J(this,r,!0,52,8)};u.prototype.readDoubleBE=function(r,e){return e||E(r,8,this.length),J(this,r,!1,52,8)};function T(t,r,e,n,o,i){if(!S(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(r>o||r<i)throw new RangeError('"value" argument is out of bounds');if(e+n>t.length)throw new RangeError("Index out of range")}u.prototype.writeUIntLE=function(r,e,n,o){if(r=+r,e=e|0,n=n|0,!o){var i=Math.pow(2,8*n)-1;T(this,r,e,n,i,0)}var a=1,c=0;for(this[e]=r&255;++c<n&&(a*=256);)this[e+c]=r/a&255;return e+n};u.prototype.writeUIntBE=function(r,e,n,o){if(r=+r,e=e|0,n=n|0,!o){var i=Math.pow(2,8*n)-1;T(this,r,e,n,i,0)}var a=n-1,c=1;for(this[e+a]=r&255;--a>=0&&(c*=256);)this[e+a]=r/c&255;return e+n};u.prototype.writeUInt8=function(r,e,n){return r=+r,e=e|0,n||T(this,r,e,1,255,0),u.TYPED_ARRAY_SUPPORT||(r=Math.floor(r)),this[e]=r&255,e+1};function j(t,r,e,n){r<0&&(r=65535+r+1);for(var o=0,i=Math.min(t.length-e,2);o<i;++o)t[e+o]=(r&255<<8*(n?o:1-o))>>>(n?o:1-o)*8}u.prototype.writeUInt16LE=function(r,e,n){return r=+r,e=e|0,n||T(this,r,e,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[e]=r&255,this[e+1]=r>>>8):j(this,r,e,!0),e+2};u.prototype.writeUInt16BE=function(r,e,n){return r=+r,e=e|0,n||T(this,r,e,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[e]=r>>>8,this[e+1]=r&255):j(this,r,e,!1),e+2};function Q(t,r,e,n){r<0&&(r=4294967295+r+1);for(var o=0,i=Math.min(t.length-e,4);o<i;++o)t[e+o]=r>>>(n?o:3-o)*8&255}u.prototype.writeUInt32LE=function(r,e,n){return r=+r,e=e|0,n||T(this,r,e,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[e+3]=r>>>24,this[e+2]=r>>>16,this[e+1]=r>>>8,this[e]=r&255):Q(this,r,e,!0),e+4};u.prototype.writeUInt32BE=function(r,e,n){return r=+r,e=e|0,n||T(this,r,e,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[e]=r>>>24,this[e+1]=r>>>16,this[e+2]=r>>>8,this[e+3]=r&255):Q(this,r,e,!1),e+4};u.prototype.writeIntLE=function(r,e,n,o){if(r=+r,e=e|0,!o){var i=Math.pow(2,8*n-1);T(this,r,e,n,i-1,-i)}var a=0,c=1,p=0;for(this[e]=r&255;++a<n&&(c*=256);)r<0&&p===0&&this[e+a-1]!==0&&(p=1),this[e+a]=(r/c>>0)-p&255;return e+n};u.prototype.writeIntBE=function(r,e,n,o){if(r=+r,e=e|0,!o){var i=Math.pow(2,8*n-1);T(this,r,e,n,i-1,-i)}var a=n-1,c=1,p=0;for(this[e+a]=r&255;--a>=0&&(c*=256);)r<0&&p===0&&this[e+a+1]!==0&&(p=1),this[e+a]=(r/c>>0)-p&255;return e+n};u.prototype.writeInt8=function(r,e,n){return r=+r,e=e|0,n||T(this,r,e,1,127,-128),u.TYPED_ARRAY_SUPPORT||(r=Math.floor(r)),r<0&&(r=255+r+1),this[e]=r&255,e+1};u.prototype.writeInt16LE=function(r,e,n){return r=+r,e=e|0,n||T(this,r,e,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[e]=r&255,this[e+1]=r>>>8):j(this,r,e,!0),e+2};u.prototype.writeInt16BE=function(r,e,n){return r=+r,e=e|0,n||T(this,r,e,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[e]=r>>>8,this[e+1]=r&255):j(this,r,e,!1),e+2};u.prototype.writeInt32LE=function(r,e,n){return r=+r,e=e|0,n||T(this,r,e,4,2147483647,-2147483648),u.TYPED_ARRAY_SUPPORT?(this[e]=r&255,this[e+1]=r>>>8,this[e+2]=r>>>16,this[e+3]=r>>>24):Q(this,r,e,!0),e+4};u.prototype.writeInt32BE=function(r,e,n){return r=+r,e=e|0,n||T(this,r,e,4,2147483647,-2147483648),r<0&&(r=4294967295+r+1),u.TYPED_ARRAY_SUPPORT?(this[e]=r>>>24,this[e+1]=r>>>16,this[e+2]=r>>>8,this[e+3]=r&255):Q(this,r,e,!1),e+4};function zr(t,r,e,n,o,i){if(e+n>t.length)throw new RangeError("Index out of range");if(e<0)throw new RangeError("Index out of range")}function Xr(t,r,e,n,o){return o||zr(t,r,e,4),Fr(t,r,e,n,23,4),e+4}u.prototype.writeFloatLE=function(r,e,n){return Xr(this,r,e,!0,n)};u.prototype.writeFloatBE=function(r,e,n){return Xr(this,r,e,!1,n)};function qr(t,r,e,n,o){return o||zr(t,r,e,8),Fr(t,r,e,n,52,8),e+8}u.prototype.writeDoubleLE=function(r,e,n){return qr(this,r,e,!0,n)};u.prototype.writeDoubleBE=function(r,e,n){return qr(this,r,e,!1,n)};u.prototype.copy=function(r,e,n,o){if(n||(n=0),!o&&o!==0&&(o=this.length),e>=r.length&&(e=r.length),e||(e=0),o>0&&o<n&&(o=n),o===n||r.length===0||this.length===0)return 0;if(e<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("sourceStart out of bounds");if(o<0)throw new RangeError("sourceEnd out of bounds");o>this.length&&(o=this.length),r.length-e<o-n&&(o=r.length-e+n);var i=o-n,a;if(this===r&&n<e&&e<o)for(a=i-1;a>=0;--a)r[a+e]=this[a+n];else if(i<1e3||!u.TYPED_ARRAY_SUPPORT)for(a=0;a<i;++a)r[a+e]=this[a+n];else Uint8Array.prototype.set.call(r,this.subarray(n,n+i),e);return i};u.prototype.fill=function(r,e,n,o){if(typeof r=="string"){if(typeof e=="string"?(o=e,e=0,n=this.length):typeof n=="string"&&(o=n,n=this.length),r.length===1){var i=r.charCodeAt(0);i<256&&(r=i)}if(o!==void 0&&typeof o!="string")throw new TypeError("encoding must be a string");if(typeof o=="string"&&!u.isEncoding(o))throw new TypeError("Unknown encoding: "+o)}else typeof r=="number"&&(r=r&255);if(e<0||this.length<e||this.length<n)throw new RangeError("Out of range index");if(n<=e)return this;e=e>>>0,n=n===void 0?this.length:n>>>0,r||(r=0);var a;if(typeof r=="number")for(a=e;a<n;++a)this[a]=r;else{var c=S(r)?r:q(new u(r,o).toString()),p=c.length;for(a=0;a<n-e;++a)this[a+e]=c[a%p]}return this};var kt=/[^+\/0-9A-Za-z-_]/g;function Pt(t){if(t=Ut(t).replace(kt,""),t.length<2)return"";for(;t.length%4!==0;)t=t+"=";return t}function Ut(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}function Lt(t){return t<16?"0"+t.toString(16):t.toString(16)}function q(t,r){r=r||1/0;for(var e,n=t.length,o=null,i=[],a=0;a<n;++a){if(e=t.charCodeAt(a),e>55295&&e<57344){if(!o){if(e>56319){(r-=3)>-1&&i.push(239,191,189);continue}else if(a+1===n){(r-=3)>-1&&i.push(239,191,189);continue}o=e;continue}if(e<56320){(r-=3)>-1&&i.push(239,191,189),o=e;continue}e=(o-55296<<10|e-56320)+65536}else o&&(r-=3)>-1&&i.push(239,191,189);if(o=null,e<128){if((r-=1)<0)break;i.push(e)}else if(e<2048){if((r-=2)<0)break;i.push(e>>6|192,e&63|128)}else if(e<65536){if((r-=3)<0)break;i.push(e>>12|224,e>>6&63|128,e&63|128)}else if(e<1114112){if((r-=4)<0)break;i.push(e>>18|240,e>>12&63|128,e>>6&63|128,e&63|128)}else throw new Error("Invalid code point")}return i}function Mt(t){for(var r=[],e=0;e<t.length;++e)r.push(t.charCodeAt(e)&255);return r}function vt(t,r){for(var e,n,o,i=[],a=0;a<t.length&&!((r-=2)<0);++a)e=t.charCodeAt(a),n=e>>8,o=e%256,i.push(o),i.push(n);return i}function Jr(t){return mt(Pt(t))}function Z(t,r,e,n){for(var o=0;o<n&&!(o+e>=r.length||o>=t.length);++o)r[o+e]=t[o];return o}function Ft(t){return t!==t}function Yt(t){return t!=null&&(!!t._isBuffer||jr(t)||Gt(t))}function jr(t){return!!t.constructor&&typeof t.constructor.isBuffer=="function"&&t.constructor.isBuffer(t)}function Gt(t){return typeof t.readFloatLE=="function"&&typeof t.slice=="function"&&jr(t.slice(0,0))}import{encodeAddress as Wt,decodeAddress as Pn}from"algosdk";function lr(t){return new Uint8Array(u.from(t))}import Kt from"bignumber.js";Kt.config({DECIMAL_PLACES:40,EXPONENTIAL_AT:45});var Zn=`{"theme1":{"value":"${m.env.FRONTEND_URL}/Theme%3DDark.svg","active":true},"theme2":{"value":"${m.env.FRONTEND_URL}/Theme%3DLight.svg","active":true},"theme3":{"value":"${m.env.FRONTEND_URL}/Theme%3DLight.svg","active":true}}`;var Qr={V1_1:"v1_1",V2:"v2"},no={[Qr.V1_1]:{testnet:62368684,mainnet:552635992},[Qr.V2]:{testnet:148607e3,mainnet:1002541853}};import su from"algosdk";import*as nn from"bs58";import Qo from"algosdk";import si from"algosdk";import $i from"algosdk";var _i={SMALLESTUNIT:m.env.SMALLEST_UNIT},Ii={SMALLEST_UNITS:m.env.SMALLEST_UNIT};var Bi=["point-system.discordEnabled","point-system.telegramBotName","point-system.telegramBotId","point-system.telegramEnabled","point-system.telegramGroupId","point-system.telegramGroupName","point-system.twitterAccountId","point-system.twitterAccountName","point-system.twitterEnabled","point-system.twitterJobEnabled","point-system.guideLink"];import uc from"algosdk";var ee=(o=>(o.GLOBAL_PAIR_DELISTING="GLOBAL_PAIR_DELISTING",o.GLOBAL_NEW_PAIR_LISTING="GLOBAL_NEW_PAIR_LISTING",o.GLOBAL_SYSTEM_MAINTENANCE="GLOBAL_SYSTEM_MAINTENANCE",o.GLOBAL_SMART_CONTRACT_UPDATE="GLOBAL_SMART_CONTRACT_UPDATE",o))(ee||{}),te=(n=>(n.ACCOUNT_POINTS_UNLOCK_ACHIEVEMENT="ACCOUNT_POINTS_UNLOCK_ACHIEVEMENT",n.ACCOUNT_KYC_STATUS_CHANGED="ACCOUNT_KYC_STATUS_CHANGED",n.ACCOUNT_AFFILIATE_DASHBOARD_UNLOCKED="ACCOUNT_AFFILIATE_DASHBOARD_UNLOCKED",n))(te||{}),ns={...ee,...te};import Nc from"algosdk";var un=(t,r)=>r===8?"MX":r===1?"":`Ethereum Signed Message:
|
|
2
|
-
${t.length}`,ae=(t,r,e)=>{let n=s.from(t,r);return s.concat([lr(
|
|
1
|
+
function fr(){throw new Error("setTimeout has not been defined")}function gr(){throw new Error("clearTimeout has not been defined")}var C=fr,P=gr;typeof globalThis.setTimeout=="function"&&(C=setTimeout);typeof globalThis.clearTimeout=="function"&&(P=clearTimeout);function hr(t){if(C===setTimeout)return setTimeout(t,0);if((C===fr||!C)&&setTimeout)return C=setTimeout,setTimeout(t,0);try{return C(t,0)}catch{try{return C.call(null,t,0)}catch{return C.call(this,t,0)}}}function ue(t){if(P===clearTimeout)return clearTimeout(t);if((P===gr||!P)&&clearTimeout)return P=clearTimeout,clearTimeout(t);try{return P(t)}catch{try{return P.call(null,t)}catch{return P.call(this,t)}}}var O=[],F=!1,k,G=-1;function pe(){!F||!k||(F=!1,k.length?O=k.concat(O):G=-1,O.length&&xr())}function xr(){if(!F){var t=hr(pe);F=!0;for(var r=O.length;r;){for(k=O,O=[];++G<r;)k&&k[G].run();G=-1,r=O.length}k=null,F=!1,ue(t)}}function le(t){var r=new Array(arguments.length-1);if(arguments.length>1)for(var e=1;e<arguments.length;e++)r[e-1]=arguments[e];O.push(new Er(t,r)),O.length===1&&!F&&hr(xr)}function Er(t,r){this.fun=t,this.array=r}Er.prototype.run=function(){this.fun.apply(null,this.array)};var me="browser",de="browser",fe=!0,ge={},he=[],xe="",Ee={},be={},Ae={};function U(){}var Te=U,_e=U,ye=U,Ie=U,Re=U,we=U,Ne=U;function Se(t){throw new Error("process.binding is not supported")}function Oe(){return"/"}function Be(t){throw new Error("process.chdir is not supported")}function De(){return 0}var v=globalThis.performance||{},Ce=v.now||v.mozNow||v.msNow||v.oNow||v.webkitNow||function(){return new Date().getTime()};function Pe(t){var r=Ce.call(v)*.001,e=Math.floor(r),n=Math.floor(r%1*1e9);return t&&(e=e-t[0],n=n-t[1],n<0&&(e--,n+=1e9)),[e,n]}var ke=new Date;function Ue(){var t=new Date,r=t-ke;return r/1e3}var l={nextTick:le,title:me,browser:fe,env:ge,argv:he,version:xe,versions:Ee,on:Te,addListener:_e,once:ye,off:Ie,removeListener:Re,removeAllListeners:we,emit:Ne,binding:Se,cwd:Oe,chdir:Be,umask:De,hrtime:Pe,platform:de,release:be,config:Ae,uptime:Ue},dr={};Object.keys(dr).forEach(t=>{let r=t.split("."),e=l;for(let n=0;n<r.length;n++){let o=r[n];n===r.length-1?e[o]=dr[t]:e=e[o]||(e[o]={})}});var R=[],y=[],Le=typeof Uint8Array<"u"?Uint8Array:Array,or=!1;function _r(){or=!0;for(var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",r=0,e=t.length;r<e;++r)R[r]=t[r],y[t.charCodeAt(r)]=r;y[45]=62,y[95]=63}function Me(t){or||_r();var r,e,n,o,i,a,c=t.length;if(c%4>0)throw new Error("Invalid string. Length must be a multiple of 4");i=t[c-2]==="="?2:t[c-1]==="="?1:0,a=new Le(c*3/4-i),n=i>0?c-4:c;var p=0;for(r=0,e=0;r<n;r+=4,e+=3)o=y[t.charCodeAt(r)]<<18|y[t.charCodeAt(r+1)]<<12|y[t.charCodeAt(r+2)]<<6|y[t.charCodeAt(r+3)],a[p++]=o>>16&255,a[p++]=o>>8&255,a[p++]=o&255;return i===2?(o=y[t.charCodeAt(r)]<<2|y[t.charCodeAt(r+1)]>>4,a[p++]=o&255):i===1&&(o=y[t.charCodeAt(r)]<<10|y[t.charCodeAt(r+1)]<<4|y[t.charCodeAt(r+2)]>>2,a[p++]=o>>8&255,a[p++]=o&255),a}function ve(t){return R[t>>18&63]+R[t>>12&63]+R[t>>6&63]+R[t&63]}function Fe(t,r,e){for(var n,o=[],i=r;i<e;i+=3)n=(t[i]<<16)+(t[i+1]<<8)+t[i+2],o.push(ve(n));return o.join("")}function br(t){or||_r();for(var r,e=t.length,n=e%3,o="",i=[],a=16383,c=0,p=e-n;c<p;c+=a)i.push(Fe(t,c,c+a>p?p:c+a));return n===1?(r=t[e-1],o+=R[r>>2],o+=R[r<<4&63],o+="=="):n===2&&(r=(t[e-2]<<8)+t[e-1],o+=R[r>>10],o+=R[r>>4&63],o+=R[r<<2&63],o+="="),i.push(o),i.join("")}s.TYPED_ARRAY_SUPPORT=globalThis.TYPED_ARRAY_SUPPORT!==void 0?globalThis.TYPED_ARRAY_SUPPORT:!0;function K(){return s.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function B(t,r){if(K()<r)throw new RangeError("Invalid typed array length");return s.TYPED_ARRAY_SUPPORT?(t=new Uint8Array(r),t.__proto__=s.prototype):(t===null&&(t=new s(r)),t.length=r),t}function s(t,r,e){if(!s.TYPED_ARRAY_SUPPORT&&!(this instanceof s))return new s(t,r,e);if(typeof t=="number"){if(typeof r=="string")throw new Error("If encoding is specified then the first argument must be a string");return ir(this,t)}return yr(this,t,r,e)}s.poolSize=8192;s._augment=function(t){return t.__proto__=s.prototype,t};function yr(t,r,e,n){if(typeof r=="number")throw new TypeError('"value" argument must not be a number');return typeof ArrayBuffer<"u"&&r instanceof ArrayBuffer?Ke(t,r,e,n):typeof r=="string"?Ge(t,r,e):We(t,r)}s.from=function(t,r,e){return yr(null,t,r,e)};s.kMaxLength=K();s.TYPED_ARRAY_SUPPORT&&(s.prototype.__proto__=Uint8Array.prototype,s.__proto__=Uint8Array,typeof Symbol<"u"&&Symbol.species&&s[Symbol.species]);function Ir(t){if(typeof t!="number")throw new TypeError('"size" argument must be a number');if(t<0)throw new RangeError('"size" argument must not be negative')}function Ye(t,r,e,n){return Ir(r),r<=0?B(t,r):e!==void 0?typeof n=="string"?B(t,r).fill(e,n):B(t,r).fill(e):B(t,r)}s.alloc=function(t,r,e){return Ye(null,t,r,e)};function ir(t,r){if(Ir(r),t=B(t,r<0?0:ar(r)|0),!s.TYPED_ARRAY_SUPPORT)for(var e=0;e<r;++e)t[e]=0;return t}s.allocUnsafe=function(t){return ir(null,t)};s.allocUnsafeSlow=function(t){return ir(null,t)};function Ge(t,r,e){if((typeof e!="string"||e==="")&&(e="utf8"),!s.isEncoding(e))throw new TypeError('"encoding" must be a valid string encoding');var n=Rr(r,e)|0;t=B(t,n);var o=t.write(r,e);return o!==n&&(t=t.slice(0,o)),t}function nr(t,r){var e=r.length<0?0:ar(r.length)|0;t=B(t,e);for(var n=0;n<e;n+=1)t[n]=r[n]&255;return t}function Ke(t,r,e,n){if(r.byteLength,e<0||r.byteLength<e)throw new RangeError("'offset' is out of bounds");if(r.byteLength<e+(n||0))throw new RangeError("'length' is out of bounds");return e===void 0&&n===void 0?r=new Uint8Array(r):n===void 0?r=new Uint8Array(r,e):r=new Uint8Array(r,e,n),s.TYPED_ARRAY_SUPPORT?(t=r,t.__proto__=s.prototype):t=nr(t,r),t}function We(t,r){if(w(r)){var e=ar(r.length)|0;return t=B(t,e),t.length===0||r.copy(t,0,0,e),t}if(r){if(typeof ArrayBuffer<"u"&&r.buffer instanceof ArrayBuffer||"length"in r)return typeof r.length!="number"||ct(r.length)?B(t,0):nr(t,r);if(r.type==="Buffer"&&Array.isArray(r.data))return nr(t,r.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function ar(t){if(t>=K())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+K().toString(16)+" bytes");return t|0}s.isBuffer=ut;function w(t){return!!(t!=null&&t._isBuffer)}s.compare=function(r,e){if(!w(r)||!w(e))throw new TypeError("Arguments must be Buffers");if(r===e)return 0;for(var n=r.length,o=e.length,i=0,a=Math.min(n,o);i<a;++i)if(r[i]!==e[i]){n=r[i],o=e[i];break}return n<o?-1:o<n?1:0};s.isEncoding=function(r){switch(String(r).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}};s.concat=function(r,e){if(!Array.isArray(r))throw new TypeError('"list" argument must be an Array of Buffers');if(r.length===0)return s.alloc(0);var n;if(e===void 0)for(e=0,n=0;n<r.length;++n)e+=r[n].length;var o=s.allocUnsafe(e),i=0;for(n=0;n<r.length;++n){var a=r[n];if(!w(a))throw new TypeError('"list" argument must be an Array of Buffers');a.copy(o,i),i+=a.length}return o};function Rr(t,r){if(w(t))return t.length;if(typeof ArrayBuffer<"u"&&typeof ArrayBuffer.isView=="function"&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;typeof t!="string"&&(t=""+t);var e=t.length;if(e===0)return 0;for(var n=!1;;)switch(r){case"ascii":case"latin1":case"binary":return e;case"utf8":case"utf-8":case void 0:return W(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return e*2;case"hex":return e>>>1;case"base64":return Cr(t).length;default:if(n)return W(t).length;r=(""+r).toLowerCase(),n=!0}}s.byteLength=Rr;function He(t,r,e){var n=!1;if((r===void 0||r<0)&&(r=0),r>this.length||((e===void 0||e>this.length)&&(e=this.length),e<=0)||(e>>>=0,r>>>=0,e<=r))return"";for(t||(t="utf8");;)switch(t){case"hex":return rt(this,r,e);case"utf8":case"utf-8":return Sr(this,r,e);case"ascii":return Qe(this,r,e);case"latin1":case"binary":return Ze(this,r,e);case"base64":return Je(this,r,e);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return et(this,r,e);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}s.prototype._isBuffer=!0;function L(t,r,e){var n=t[r];t[r]=t[e],t[e]=n}s.prototype.swap16=function(){var r=this.length;if(r%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var e=0;e<r;e+=2)L(this,e,e+1);return this};s.prototype.swap32=function(){var r=this.length;if(r%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var e=0;e<r;e+=4)L(this,e,e+3),L(this,e+1,e+2);return this};s.prototype.swap64=function(){var r=this.length;if(r%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var e=0;e<r;e+=8)L(this,e,e+7),L(this,e+1,e+6),L(this,e+2,e+5),L(this,e+3,e+4);return this};s.prototype.toString=function(){var r=this.length|0;return r===0?"":arguments.length===0?Sr(this,0,r):He.apply(this,arguments)};s.prototype.equals=function(r){if(!w(r))throw new TypeError("Argument must be a Buffer");return this===r?!0:s.compare(this,r)===0};s.prototype.compare=function(r,e,n,o,i){if(!w(r))throw new TypeError("Argument must be a Buffer");if(e===void 0&&(e=0),n===void 0&&(n=r?r.length:0),o===void 0&&(o=0),i===void 0&&(i=this.length),e<0||n>r.length||o<0||i>this.length)throw new RangeError("out of range index");if(o>=i&&e>=n)return 0;if(o>=i)return-1;if(e>=n)return 1;if(e>>>=0,n>>>=0,o>>>=0,i>>>=0,this===r)return 0;for(var a=i-o,c=n-e,p=Math.min(a,c),d=this.slice(o,i),f=r.slice(e,n),m=0;m<p;++m)if(d[m]!==f[m]){a=d[m],c=f[m];break}return a<c?-1:c<a?1:0};function wr(t,r,e,n,o){if(t.length===0)return-1;if(typeof e=="string"?(n=e,e=0):e>2147483647?e=2147483647:e<-2147483648&&(e=-2147483648),e=+e,isNaN(e)&&(e=o?0:t.length-1),e<0&&(e=t.length+e),e>=t.length){if(o)return-1;e=t.length-1}else if(e<0)if(o)e=0;else return-1;if(typeof r=="string"&&(r=s.from(r,n)),w(r))return r.length===0?-1:Ar(t,r,e,n,o);if(typeof r=="number")return r=r&255,s.TYPED_ARRAY_SUPPORT&&typeof Uint8Array.prototype.indexOf=="function"?o?Uint8Array.prototype.indexOf.call(t,r,e):Uint8Array.prototype.lastIndexOf.call(t,r,e):Ar(t,[r],e,n,o);throw new TypeError("val must be string, number or Buffer")}function Ar(t,r,e,n,o){var i=1,a=t.length,c=r.length;if(n!==void 0&&(n=String(n).toLowerCase(),n==="ucs2"||n==="ucs-2"||n==="utf16le"||n==="utf-16le")){if(t.length<2||r.length<2)return-1;i=2,a/=2,c/=2,e/=2}function p(g,_){return i===1?g[_]:g.readUInt16BE(_*i)}var d;if(o){var f=-1;for(d=e;d<a;d++)if(p(t,d)===p(r,f===-1?0:d-f)){if(f===-1&&(f=d),d-f+1===c)return f*i}else f!==-1&&(d-=d-f),f=-1}else for(e+c>a&&(e=a-c),d=e;d>=0;d--){for(var m=!0,h=0;h<c;h++)if(p(t,d+h)!==p(r,h)){m=!1;break}if(m)return d}return-1}s.prototype.includes=function(r,e,n){return this.indexOf(r,e,n)!==-1};s.prototype.indexOf=function(r,e,n){return wr(this,r,e,n,!0)};s.prototype.lastIndexOf=function(r,e,n){return wr(this,r,e,n,!1)};function Ve(t,r,e,n){e=Number(e)||0;var o=t.length-e;n?(n=Number(n),n>o&&(n=o)):n=o;var i=r.length;if(i%2!==0)throw new TypeError("Invalid hex string");n>i/2&&(n=i/2);for(var a=0;a<n;++a){var c=parseInt(r.substr(a*2,2),16);if(isNaN(c))return a;t[e+a]=c}return a}function $e(t,r,e,n){return $(W(r,t.length-e),t,e,n)}function Nr(t,r,e,n){return $(at(r),t,e,n)}function Xe(t,r,e,n){return Nr(t,r,e,n)}function ze(t,r,e,n){return $(Cr(r),t,e,n)}function qe(t,r,e,n){return $(st(r,t.length-e),t,e,n)}s.prototype.write=function(r,e,n,o){if(e===void 0)o="utf8",n=this.length,e=0;else if(n===void 0&&typeof e=="string")o=e,n=this.length,e=0;else if(isFinite(e))e=e|0,isFinite(n)?(n=n|0,o===void 0&&(o="utf8")):(o=n,n=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var i=this.length-e;if((n===void 0||n>i)&&(n=i),r.length>0&&(n<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");o||(o="utf8");for(var a=!1;;)switch(o){case"hex":return Ve(this,r,e,n);case"utf8":case"utf-8":return $e(this,r,e,n);case"ascii":return Nr(this,r,e,n);case"latin1":case"binary":return Xe(this,r,e,n);case"base64":return ze(this,r,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return qe(this,r,e,n);default:if(a)throw new TypeError("Unknown encoding: "+o);o=(""+o).toLowerCase(),a=!0}};s.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function Je(t,r,e){return r===0&&e===t.length?br(t):br(t.slice(r,e))}function Sr(t,r,e){e=Math.min(t.length,e);for(var n=[],o=r;o<e;){var i=t[o],a=null,c=i>239?4:i>223?3:i>191?2:1;if(o+c<=e){var p,d,f,m;switch(c){case 1:i<128&&(a=i);break;case 2:p=t[o+1],(p&192)===128&&(m=(i&31)<<6|p&63,m>127&&(a=m));break;case 3:p=t[o+1],d=t[o+2],(p&192)===128&&(d&192)===128&&(m=(i&15)<<12|(p&63)<<6|d&63,m>2047&&(m<55296||m>57343)&&(a=m));break;case 4:p=t[o+1],d=t[o+2],f=t[o+3],(p&192)===128&&(d&192)===128&&(f&192)===128&&(m=(i&15)<<18|(p&63)<<12|(d&63)<<6|f&63,m>65535&&m<1114112&&(a=m))}}a===null?(a=65533,c=1):a>65535&&(a-=65536,n.push(a>>>10&1023|55296),a=56320|a&1023),n.push(a),o+=c}return je(n)}var Tr=4096;function je(t){var r=t.length;if(r<=Tr)return String.fromCharCode.apply(String,t);for(var e="",n=0;n<r;)e+=String.fromCharCode.apply(String,t.slice(n,n+=Tr));return e}function Qe(t,r,e){var n="";e=Math.min(t.length,e);for(var o=r;o<e;++o)n+=String.fromCharCode(t[o]&127);return n}function Ze(t,r,e){var n="";e=Math.min(t.length,e);for(var o=r;o<e;++o)n+=String.fromCharCode(t[o]);return n}function rt(t,r,e){var n=t.length;(!r||r<0)&&(r=0),(!e||e<0||e>n)&&(e=n);for(var o="",i=r;i<e;++i)o+=it(t[i]);return o}function et(t,r,e){for(var n=t.slice(r,e),o="",i=0;i<n.length;i+=2)o+=String.fromCharCode(n[i]+n[i+1]*256);return o}s.prototype.slice=function(r,e){var n=this.length;r=~~r,e=e===void 0?n:~~e,r<0?(r+=n,r<0&&(r=0)):r>n&&(r=n),e<0?(e+=n,e<0&&(e=0)):e>n&&(e=n),e<r&&(e=r);var o;if(s.TYPED_ARRAY_SUPPORT)o=this.subarray(r,e),o.__proto__=s.prototype;else{var i=e-r;o=new s(i,void 0);for(var a=0;a<i;++a)o[a]=this[a+r]}return o};function E(t,r,e){if(t%1!==0||t<0)throw new RangeError("offset is not uint");if(t+r>e)throw new RangeError("Trying to access beyond buffer length")}s.prototype.readUIntLE=function(r,e,n){r=r|0,e=e|0,n||E(r,e,this.length);for(var o=this[r],i=1,a=0;++a<e&&(i*=256);)o+=this[r+a]*i;return o};s.prototype.readUIntBE=function(r,e,n){r=r|0,e=e|0,n||E(r,e,this.length);for(var o=this[r+--e],i=1;e>0&&(i*=256);)o+=this[r+--e]*i;return o};s.prototype.readUInt8=function(r,e){return e||E(r,1,this.length),this[r]};s.prototype.readUInt16LE=function(r,e){return e||E(r,2,this.length),this[r]|this[r+1]<<8};s.prototype.readUInt16BE=function(r,e){return e||E(r,2,this.length),this[r]<<8|this[r+1]};s.prototype.readUInt32LE=function(r,e){return e||E(r,4,this.length),(this[r]|this[r+1]<<8|this[r+2]<<16)+this[r+3]*16777216};s.prototype.readUInt32BE=function(r,e){return e||E(r,4,this.length),this[r]*16777216+(this[r+1]<<16|this[r+2]<<8|this[r+3])};s.prototype.readIntLE=function(r,e,n){r=r|0,e=e|0,n||E(r,e,this.length);for(var o=this[r],i=1,a=0;++a<e&&(i*=256);)o+=this[r+a]*i;return i*=128,o>=i&&(o-=Math.pow(2,8*e)),o};s.prototype.readIntBE=function(r,e,n){r=r|0,e=e|0,n||E(r,e,this.length);for(var o=e,i=1,a=this[r+--o];o>0&&(i*=256);)a+=this[r+--o]*i;return i*=128,a>=i&&(a-=Math.pow(2,8*e)),a};s.prototype.readInt8=function(r,e){return e||E(r,1,this.length),this[r]&128?(255-this[r]+1)*-1:this[r]};s.prototype.readInt16LE=function(r,e){e||E(r,2,this.length);var n=this[r]|this[r+1]<<8;return n&32768?n|4294901760:n};s.prototype.readInt16BE=function(r,e){e||E(r,2,this.length);var n=this[r+1]|this[r]<<8;return n&32768?n|4294901760:n};s.prototype.readInt32LE=function(r,e){return e||E(r,4,this.length),this[r]|this[r+1]<<8|this[r+2]<<16|this[r+3]<<24};s.prototype.readInt32BE=function(r,e){return e||E(r,4,this.length),this[r]<<24|this[r+1]<<16|this[r+2]<<8|this[r+3]};s.prototype.readFloatLE=function(r,e){return e||E(r,4,this.length),X(this,r,!0,23,4)};s.prototype.readFloatBE=function(r,e){return e||E(r,4,this.length),X(this,r,!1,23,4)};s.prototype.readDoubleLE=function(r,e){return e||E(r,8,this.length),X(this,r,!0,52,8)};s.prototype.readDoubleBE=function(r,e){return e||E(r,8,this.length),X(this,r,!1,52,8)};function A(t,r,e,n,o,i){if(!w(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(r>o||r<i)throw new RangeError('"value" argument is out of bounds');if(e+n>t.length)throw new RangeError("Index out of range")}s.prototype.writeUIntLE=function(r,e,n,o){if(r=+r,e=e|0,n=n|0,!o){var i=Math.pow(2,8*n)-1;A(this,r,e,n,i,0)}var a=1,c=0;for(this[e]=r&255;++c<n&&(a*=256);)this[e+c]=r/a&255;return e+n};s.prototype.writeUIntBE=function(r,e,n,o){if(r=+r,e=e|0,n=n|0,!o){var i=Math.pow(2,8*n)-1;A(this,r,e,n,i,0)}var a=n-1,c=1;for(this[e+a]=r&255;--a>=0&&(c*=256);)this[e+a]=r/c&255;return e+n};s.prototype.writeUInt8=function(r,e,n){return r=+r,e=e|0,n||A(this,r,e,1,255,0),s.TYPED_ARRAY_SUPPORT||(r=Math.floor(r)),this[e]=r&255,e+1};function H(t,r,e,n){r<0&&(r=65535+r+1);for(var o=0,i=Math.min(t.length-e,2);o<i;++o)t[e+o]=(r&255<<8*(n?o:1-o))>>>(n?o:1-o)*8}s.prototype.writeUInt16LE=function(r,e,n){return r=+r,e=e|0,n||A(this,r,e,2,65535,0),s.TYPED_ARRAY_SUPPORT?(this[e]=r&255,this[e+1]=r>>>8):H(this,r,e,!0),e+2};s.prototype.writeUInt16BE=function(r,e,n){return r=+r,e=e|0,n||A(this,r,e,2,65535,0),s.TYPED_ARRAY_SUPPORT?(this[e]=r>>>8,this[e+1]=r&255):H(this,r,e,!1),e+2};function V(t,r,e,n){r<0&&(r=4294967295+r+1);for(var o=0,i=Math.min(t.length-e,4);o<i;++o)t[e+o]=r>>>(n?o:3-o)*8&255}s.prototype.writeUInt32LE=function(r,e,n){return r=+r,e=e|0,n||A(this,r,e,4,4294967295,0),s.TYPED_ARRAY_SUPPORT?(this[e+3]=r>>>24,this[e+2]=r>>>16,this[e+1]=r>>>8,this[e]=r&255):V(this,r,e,!0),e+4};s.prototype.writeUInt32BE=function(r,e,n){return r=+r,e=e|0,n||A(this,r,e,4,4294967295,0),s.TYPED_ARRAY_SUPPORT?(this[e]=r>>>24,this[e+1]=r>>>16,this[e+2]=r>>>8,this[e+3]=r&255):V(this,r,e,!1),e+4};s.prototype.writeIntLE=function(r,e,n,o){if(r=+r,e=e|0,!o){var i=Math.pow(2,8*n-1);A(this,r,e,n,i-1,-i)}var a=0,c=1,p=0;for(this[e]=r&255;++a<n&&(c*=256);)r<0&&p===0&&this[e+a-1]!==0&&(p=1),this[e+a]=(r/c>>0)-p&255;return e+n};s.prototype.writeIntBE=function(r,e,n,o){if(r=+r,e=e|0,!o){var i=Math.pow(2,8*n-1);A(this,r,e,n,i-1,-i)}var a=n-1,c=1,p=0;for(this[e+a]=r&255;--a>=0&&(c*=256);)r<0&&p===0&&this[e+a+1]!==0&&(p=1),this[e+a]=(r/c>>0)-p&255;return e+n};s.prototype.writeInt8=function(r,e,n){return r=+r,e=e|0,n||A(this,r,e,1,127,-128),s.TYPED_ARRAY_SUPPORT||(r=Math.floor(r)),r<0&&(r=255+r+1),this[e]=r&255,e+1};s.prototype.writeInt16LE=function(r,e,n){return r=+r,e=e|0,n||A(this,r,e,2,32767,-32768),s.TYPED_ARRAY_SUPPORT?(this[e]=r&255,this[e+1]=r>>>8):H(this,r,e,!0),e+2};s.prototype.writeInt16BE=function(r,e,n){return r=+r,e=e|0,n||A(this,r,e,2,32767,-32768),s.TYPED_ARRAY_SUPPORT?(this[e]=r>>>8,this[e+1]=r&255):H(this,r,e,!1),e+2};s.prototype.writeInt32LE=function(r,e,n){return r=+r,e=e|0,n||A(this,r,e,4,2147483647,-2147483648),s.TYPED_ARRAY_SUPPORT?(this[e]=r&255,this[e+1]=r>>>8,this[e+2]=r>>>16,this[e+3]=r>>>24):V(this,r,e,!0),e+4};s.prototype.writeInt32BE=function(r,e,n){return r=+r,e=e|0,n||A(this,r,e,4,2147483647,-2147483648),r<0&&(r=4294967295+r+1),s.TYPED_ARRAY_SUPPORT?(this[e]=r>>>24,this[e+1]=r>>>16,this[e+2]=r>>>8,this[e+3]=r&255):V(this,r,e,!1),e+4};function Or(t,r,e,n,o,i){if(e+n>t.length)throw new RangeError("Index out of range");if(e<0)throw new RangeError("Index out of range")}function Br(t,r,e,n,o){return o||Or(t,r,e,4,34028234663852886e22,-34028234663852886e22),kr(t,r,e,n,23,4),e+4}s.prototype.writeFloatLE=function(r,e,n){return Br(this,r,e,!0,n)};s.prototype.writeFloatBE=function(r,e,n){return Br(this,r,e,!1,n)};function Dr(t,r,e,n,o){return o||Or(t,r,e,8,17976931348623157e292,-17976931348623157e292),kr(t,r,e,n,52,8),e+8}s.prototype.writeDoubleLE=function(r,e,n){return Dr(this,r,e,!0,n)};s.prototype.writeDoubleBE=function(r,e,n){return Dr(this,r,e,!1,n)};s.prototype.copy=function(r,e,n,o){if(n||(n=0),!o&&o!==0&&(o=this.length),e>=r.length&&(e=r.length),e||(e=0),o>0&&o<n&&(o=n),o===n||r.length===0||this.length===0)return 0;if(e<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("sourceStart out of bounds");if(o<0)throw new RangeError("sourceEnd out of bounds");o>this.length&&(o=this.length),r.length-e<o-n&&(o=r.length-e+n);var i=o-n,a;if(this===r&&n<e&&e<o)for(a=i-1;a>=0;--a)r[a+e]=this[a+n];else if(i<1e3||!s.TYPED_ARRAY_SUPPORT)for(a=0;a<i;++a)r[a+e]=this[a+n];else Uint8Array.prototype.set.call(r,this.subarray(n,n+i),e);return i};s.prototype.fill=function(r,e,n,o){if(typeof r=="string"){if(typeof e=="string"?(o=e,e=0,n=this.length):typeof n=="string"&&(o=n,n=this.length),r.length===1){var i=r.charCodeAt(0);i<256&&(r=i)}if(o!==void 0&&typeof o!="string")throw new TypeError("encoding must be a string");if(typeof o=="string"&&!s.isEncoding(o))throw new TypeError("Unknown encoding: "+o)}else typeof r=="number"&&(r=r&255);if(e<0||this.length<e||this.length<n)throw new RangeError("Out of range index");if(n<=e)return this;e=e>>>0,n=n===void 0?this.length:n>>>0,r||(r=0);var a;if(typeof r=="number")for(a=e;a<n;++a)this[a]=r;else{var c=w(r)?r:W(new s(r,o).toString()),p=c.length;for(a=0;a<n-e;++a)this[a+e]=c[a%p]}return this};var tt=/[^+\/0-9A-Za-z-_]/g;function nt(t){if(t=ot(t).replace(tt,""),t.length<2)return"";for(;t.length%4!==0;)t=t+"=";return t}function ot(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}function it(t){return t<16?"0"+t.toString(16):t.toString(16)}function W(t,r){r=r||1/0;for(var e,n=t.length,o=null,i=[],a=0;a<n;++a){if(e=t.charCodeAt(a),e>55295&&e<57344){if(!o){if(e>56319){(r-=3)>-1&&i.push(239,191,189);continue}else if(a+1===n){(r-=3)>-1&&i.push(239,191,189);continue}o=e;continue}if(e<56320){(r-=3)>-1&&i.push(239,191,189),o=e;continue}e=(o-55296<<10|e-56320)+65536}else o&&(r-=3)>-1&&i.push(239,191,189);if(o=null,e<128){if((r-=1)<0)break;i.push(e)}else if(e<2048){if((r-=2)<0)break;i.push(e>>6|192,e&63|128)}else if(e<65536){if((r-=3)<0)break;i.push(e>>12|224,e>>6&63|128,e&63|128)}else if(e<1114112){if((r-=4)<0)break;i.push(e>>18|240,e>>12&63|128,e>>6&63|128,e&63|128)}else throw new Error("Invalid code point")}return i}function at(t){for(var r=[],e=0;e<t.length;++e)r.push(t.charCodeAt(e)&255);return r}function st(t,r){for(var e,n,o,i=[],a=0;a<t.length&&!((r-=2)<0);++a)e=t.charCodeAt(a),n=e>>8,o=e%256,i.push(o),i.push(n);return i}function Cr(t){return Me(nt(t))}function $(t,r,e,n){for(var o=0;o<n&&!(o+e>=r.length||o>=t.length);++o)r[o+e]=t[o];return o}function ct(t){return t!==t}function ut(t){return t!=null&&(!!t._isBuffer||Pr(t)||pt(t))}function Pr(t){return!!t.constructor&&typeof t.constructor.isBuffer=="function"&&t.constructor.isBuffer(t)}function pt(t){return typeof t.readFloatLE=="function"&&typeof t.slice=="function"&&Pr(t.slice(0,0))}function X(t,r,e,n,o){var i,a,c=o*8-n-1,p=(1<<c)-1,d=p>>1,f=-7,m=e?o-1:0,h=e?-1:1,g=t[r+m];for(m+=h,i=g&(1<<-f)-1,g>>=-f,f+=c;f>0;i=i*256+t[r+m],m+=h,f-=8);for(a=i&(1<<-f)-1,i>>=-f,f+=n;f>0;a=a*256+t[r+m],m+=h,f-=8);if(i===0)i=1-d;else{if(i===p)return a?NaN:(g?-1:1)*(1/0);a=a+Math.pow(2,n),i=i-d}return(g?-1:1)*a*Math.pow(2,i-n)}function kr(t,r,e,n,o,i){var a,c,p,d=i*8-o-1,f=(1<<d)-1,m=f>>1,h=o===23?Math.pow(2,-24)-Math.pow(2,-77):0,g=n?0:i-1,_=n?1:-1,tr=r<0||r===0&&1/r<0?1:0;for(r=Math.abs(r),isNaN(r)||r===1/0?(c=isNaN(r)?1:0,a=f):(a=Math.floor(Math.log(r)/Math.LN2),r*(p=Math.pow(2,-a))<1&&(a--,p*=2),a+m>=1?r+=h/p:r+=h*Math.pow(2,1-m),r*p>=2&&(a++,p/=2),a+m>=f?(c=0,a=f):a+m>=1?(c=(r*p-1)*Math.pow(2,o),a=a+m):(c=r*Math.pow(2,m-1)*Math.pow(2,o),a=0));o>=8;t[e+g]=c&255,g+=_,c/=256,o-=8);for(a=a<<o|c,d+=o;d>0;t[e+g]=a&255,g+=_,a/=256,d-=8);t[e+g-_]|=tr*128}import*as x from"ethereumjs-util";import zu from"algosdk";import*as pn from"bs58";import Ho from"algosdk";import Sn,{decodeAddress as On,encodeAddress as Bn}from"algosdk";var N=[],I=[],lt=typeof Uint8Array<"u"?Uint8Array:Array,cr=!1;function vr(){cr=!0;for(var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",r=0,e=t.length;r<e;++r)N[r]=t[r],I[t.charCodeAt(r)]=r;I[45]=62,I[95]=63}function mt(t){cr||vr();var r,e,n,o,i,a,c=t.length;if(c%4>0)throw new Error("Invalid string. Length must be a multiple of 4");i=t[c-2]==="="?2:t[c-1]==="="?1:0,a=new lt(c*3/4-i),n=i>0?c-4:c;var p=0;for(r=0,e=0;r<n;r+=4,e+=3)o=I[t.charCodeAt(r)]<<18|I[t.charCodeAt(r+1)]<<12|I[t.charCodeAt(r+2)]<<6|I[t.charCodeAt(r+3)],a[p++]=o>>16&255,a[p++]=o>>8&255,a[p++]=o&255;return i===2?(o=I[t.charCodeAt(r)]<<2|I[t.charCodeAt(r+1)]>>4,a[p++]=o&255):i===1&&(o=I[t.charCodeAt(r)]<<10|I[t.charCodeAt(r+1)]<<4|I[t.charCodeAt(r+2)]>>2,a[p++]=o>>8&255,a[p++]=o&255),a}function dt(t){return N[t>>18&63]+N[t>>12&63]+N[t>>6&63]+N[t&63]}function ft(t,r,e){for(var n,o=[],i=r;i<e;i+=3)n=(t[i]<<16)+(t[i+1]<<8)+t[i+2],o.push(dt(n));return o.join("")}function Ur(t){cr||vr();for(var r,e=t.length,n=e%3,o="",i=[],a=16383,c=0,p=e-n;c<p;c+=a)i.push(ft(t,c,c+a>p?p:c+a));return n===1?(r=t[e-1],o+=N[r>>2],o+=N[r<<4&63],o+="=="):n===2&&(r=(t[e-2]<<8)+t[e-1],o+=N[r>>10],o+=N[r>>4&63],o+=N[r<<2&63],o+="="),i.push(o),i.join("")}function J(t,r,e,n,o){var i,a,c=o*8-n-1,p=(1<<c)-1,d=p>>1,f=-7,m=e?o-1:0,h=e?-1:1,g=t[r+m];for(m+=h,i=g&(1<<-f)-1,g>>=-f,f+=c;f>0;i=i*256+t[r+m],m+=h,f-=8);for(a=i&(1<<-f)-1,i>>=-f,f+=n;f>0;a=a*256+t[r+m],m+=h,f-=8);if(i===0)i=1-d;else{if(i===p)return a?NaN:(g?-1:1)*(1/0);a=a+Math.pow(2,n),i=i-d}return(g?-1:1)*a*Math.pow(2,i-n)}function Fr(t,r,e,n,o,i){var a,c,p,d=i*8-o-1,f=(1<<d)-1,m=f>>1,h=o===23?Math.pow(2,-24)-Math.pow(2,-77):0,g=n?0:i-1,_=n?1:-1,tr=r<0||r===0&&1/r<0?1:0;for(r=Math.abs(r),isNaN(r)||r===1/0?(c=isNaN(r)?1:0,a=f):(a=Math.floor(Math.log(r)/Math.LN2),r*(p=Math.pow(2,-a))<1&&(a--,p*=2),a+m>=1?r+=h/p:r+=h*Math.pow(2,1-m),r*p>=2&&(a++,p/=2),a+m>=f?(c=0,a=f):a+m>=1?(c=(r*p-1)*Math.pow(2,o),a=a+m):(c=r*Math.pow(2,m-1)*Math.pow(2,o),a=0));o>=8;t[e+g]=c&255,g+=_,c/=256,o-=8);for(a=a<<o|c,d+=o;d>0;t[e+g]=a&255,g+=_,a/=256,d-=8);t[e+g-_]|=tr*128}var gt={}.toString,Yr=Array.isArray||function(t){return gt.call(t)=="[object Array]"};var ht=50;u.TYPED_ARRAY_SUPPORT=globalThis.TYPED_ARRAY_SUPPORT!==void 0?globalThis.TYPED_ARRAY_SUPPORT:!0;var yn=z();function z(){return u.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function D(t,r){if(z()<r)throw new RangeError("Invalid typed array length");return u.TYPED_ARRAY_SUPPORT?(t=new Uint8Array(r),t.__proto__=u.prototype):(t===null&&(t=new u(r)),t.length=r),t}function u(t,r,e){if(!u.TYPED_ARRAY_SUPPORT&&!(this instanceof u))return new u(t,r,e);if(typeof t=="number"){if(typeof r=="string")throw new Error("If encoding is specified then the first argument must be a string");return ur(this,t)}return Gr(this,t,r,e)}u.poolSize=8192;u._augment=function(t){return t.__proto__=u.prototype,t};function Gr(t,r,e,n){if(typeof r=="number")throw new TypeError('"value" argument must not be a number');return typeof ArrayBuffer<"u"&&r instanceof ArrayBuffer?bt(t,r,e,n):typeof r=="string"?Et(t,r,e):At(t,r)}u.from=function(t,r,e){return Gr(null,t,r,e)};u.TYPED_ARRAY_SUPPORT&&(u.prototype.__proto__=Uint8Array.prototype,u.__proto__=Uint8Array);function Kr(t){if(typeof t!="number")throw new TypeError('"size" argument must be a number');if(t<0)throw new RangeError('"size" argument must not be negative')}function xt(t,r,e,n){return Kr(r),r<=0?D(t,r):e!==void 0?typeof n=="string"?D(t,r).fill(e,n):D(t,r).fill(e):D(t,r)}u.alloc=function(t,r,e){return xt(null,t,r,e)};function ur(t,r){if(Kr(r),t=D(t,r<0?0:pr(r)|0),!u.TYPED_ARRAY_SUPPORT)for(var e=0;e<r;++e)t[e]=0;return t}u.allocUnsafe=function(t){return ur(null,t)};u.allocUnsafeSlow=function(t){return ur(null,t)};function Et(t,r,e){if((typeof e!="string"||e==="")&&(e="utf8"),!u.isEncoding(e))throw new TypeError('"encoding" must be a valid string encoding');var n=Wr(r,e)|0;t=D(t,n);var o=t.write(r,e);return o!==n&&(t=t.slice(0,o)),t}function sr(t,r){var e=r.length<0?0:pr(r.length)|0;t=D(t,e);for(var n=0;n<e;n+=1)t[n]=r[n]&255;return t}function bt(t,r,e,n){if(r.byteLength,e<0||r.byteLength<e)throw new RangeError("'offset' is out of bounds");if(r.byteLength<e+(n||0))throw new RangeError("'length' is out of bounds");return e===void 0&&n===void 0?r=new Uint8Array(r):n===void 0?r=new Uint8Array(r,e):r=new Uint8Array(r,e,n),u.TYPED_ARRAY_SUPPORT?(t=r,t.__proto__=u.prototype):t=sr(t,r),t}function At(t,r){if(S(r)){var e=pr(r.length)|0;return t=D(t,e),t.length===0||r.copy(t,0,0,e),t}if(r){if(typeof ArrayBuffer<"u"&&r.buffer instanceof ArrayBuffer||"length"in r)return typeof r.length!="number"||Ft(r.length)?D(t,0):sr(t,r);if(r.type==="Buffer"&&Yr(r.data))return sr(t,r.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function pr(t){if(t>=z())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+z().toString(16)+" bytes");return t|0}u.isBuffer=Yt;function S(t){return!!(t!=null&&t._isBuffer)}u.compare=function(r,e){if(!S(r)||!S(e))throw new TypeError("Arguments must be Buffers");if(r===e)return 0;for(var n=r.length,o=e.length,i=0,a=Math.min(n,o);i<a;++i)if(r[i]!==e[i]){n=r[i],o=e[i];break}return n<o?-1:o<n?1:0};u.isEncoding=function(r){switch(String(r).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}};u.concat=function(r,e){if(!Yr(r))throw new TypeError('"list" argument must be an Array of Buffers');if(r.length===0)return u.alloc(0);var n;if(e===void 0)for(e=0,n=0;n<r.length;++n)e+=r[n].length;var o=u.allocUnsafe(e),i=0;for(n=0;n<r.length;++n){var a=r[n];if(!S(a))throw new TypeError('"list" argument must be an Array of Buffers');a.copy(o,i),i+=a.length}return o};function Wr(t,r){if(S(t))return t.length;if(typeof ArrayBuffer<"u"&&typeof ArrayBuffer.isView=="function"&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;typeof t!="string"&&(t=""+t);var e=t.length;if(e===0)return 0;for(var n=!1;;)switch(r){case"ascii":case"latin1":case"binary":return e;case"utf8":case"utf-8":case void 0:return q(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return e*2;case"hex":return e>>>1;case"base64":return Jr(t).length;default:if(n)return q(t).length;r=(""+r).toLowerCase(),n=!0}}u.byteLength=Wr;function Tt(t,r,e){var n=!1;if((r===void 0||r<0)&&(r=0),r>this.length||((e===void 0||e>this.length)&&(e=this.length),e<=0)||(e>>>=0,r>>>=0,e<=r))return"";for(t||(t="utf8");;)switch(t){case"hex":return Dt(this,r,e);case"utf8":case"utf-8":return $r(this,r,e);case"ascii":return Ot(this,r,e);case"latin1":case"binary":return Bt(this,r,e);case"base64":return Nt(this,r,e);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Ct(this,r,e);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}u.prototype._isBuffer=!0;function M(t,r,e){var n=t[r];t[r]=t[e],t[e]=n}u.prototype.swap16=function(){var r=this.length;if(r%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var e=0;e<r;e+=2)M(this,e,e+1);return this};u.prototype.swap32=function(){var r=this.length;if(r%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var e=0;e<r;e+=4)M(this,e,e+3),M(this,e+1,e+2);return this};u.prototype.swap64=function(){var r=this.length;if(r%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var e=0;e<r;e+=8)M(this,e,e+7),M(this,e+1,e+6),M(this,e+2,e+5),M(this,e+3,e+4);return this};u.prototype.toString=function(){var r=this.length|0;return r===0?"":arguments.length===0?$r(this,0,r):Tt.apply(this,arguments)};u.prototype.equals=function(r){if(!S(r))throw new TypeError("Argument must be a Buffer");return this===r?!0:u.compare(this,r)===0};u.prototype.inspect=function(){var r="",e=ht;return this.length>0&&(r=this.toString("hex",0,e).match(/.{2}/g).join(" "),this.length>e&&(r+=" ... ")),"<Buffer "+r+">"};u.prototype.compare=function(r,e,n,o,i){if(!S(r))throw new TypeError("Argument must be a Buffer");if(e===void 0&&(e=0),n===void 0&&(n=r?r.length:0),o===void 0&&(o=0),i===void 0&&(i=this.length),e<0||n>r.length||o<0||i>this.length)throw new RangeError("out of range index");if(o>=i&&e>=n)return 0;if(o>=i)return-1;if(e>=n)return 1;if(e>>>=0,n>>>=0,o>>>=0,i>>>=0,this===r)return 0;for(var a=i-o,c=n-e,p=Math.min(a,c),d=this.slice(o,i),f=r.slice(e,n),m=0;m<p;++m)if(d[m]!==f[m]){a=d[m],c=f[m];break}return a<c?-1:c<a?1:0};function Hr(t,r,e,n,o){if(t.length===0)return-1;if(typeof e=="string"?(n=e,e=0):e>2147483647?e=2147483647:e<-2147483648&&(e=-2147483648),e=+e,isNaN(e)&&(e=o?0:t.length-1),e<0&&(e=t.length+e),e>=t.length){if(o)return-1;e=t.length-1}else if(e<0)if(o)e=0;else return-1;if(typeof r=="string"&&(r=u.from(r,n)),S(r))return r.length===0?-1:Lr(t,r,e,n,o);if(typeof r=="number")return r=r&255,u.TYPED_ARRAY_SUPPORT&&typeof Uint8Array.prototype.indexOf=="function"?o?Uint8Array.prototype.indexOf.call(t,r,e):Uint8Array.prototype.lastIndexOf.call(t,r,e):Lr(t,[r],e,n,o);throw new TypeError("val must be string, number or Buffer")}function Lr(t,r,e,n,o){var i=1,a=t.length,c=r.length;if(n!==void 0&&(n=String(n).toLowerCase(),n==="ucs2"||n==="ucs-2"||n==="utf16le"||n==="utf-16le")){if(t.length<2||r.length<2)return-1;i=2,a/=2,c/=2,e/=2}function p(g,_){return i===1?g[_]:g.readUInt16BE(_*i)}var d;if(o){var f=-1;for(d=e;d<a;d++)if(p(t,d)===p(r,f===-1?0:d-f)){if(f===-1&&(f=d),d-f+1===c)return f*i}else f!==-1&&(d-=d-f),f=-1}else for(e+c>a&&(e=a-c),d=e;d>=0;d--){for(var m=!0,h=0;h<c;h++)if(p(t,d+h)!==p(r,h)){m=!1;break}if(m)return d}return-1}u.prototype.includes=function(r,e,n){return this.indexOf(r,e,n)!==-1};u.prototype.indexOf=function(r,e,n){return Hr(this,r,e,n,!0)};u.prototype.lastIndexOf=function(r,e,n){return Hr(this,r,e,n,!1)};function _t(t,r,e,n){e=Number(e)||0;var o=t.length-e;n?(n=Number(n),n>o&&(n=o)):n=o;var i=r.length;if(i%2!==0)throw new TypeError("Invalid hex string");n>i/2&&(n=i/2);for(var a=0;a<n;++a){var c=parseInt(r.substr(a*2,2),16);if(isNaN(c))return a;t[e+a]=c}return a}function yt(t,r,e,n){return Z(q(r,t.length-e),t,e,n)}function Vr(t,r,e,n){return Z(Mt(r),t,e,n)}function It(t,r,e,n){return Vr(t,r,e,n)}function Rt(t,r,e,n){return Z(Jr(r),t,e,n)}function wt(t,r,e,n){return Z(vt(r,t.length-e),t,e,n)}u.prototype.write=function(r,e,n,o){if(e===void 0)o="utf8",n=this.length,e=0;else if(n===void 0&&typeof e=="string")o=e,n=this.length,e=0;else if(isFinite(e))e=e|0,isFinite(n)?(n=n|0,o===void 0&&(o="utf8")):(o=n,n=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var i=this.length-e;if((n===void 0||n>i)&&(n=i),r.length>0&&(n<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");o||(o="utf8");for(var a=!1;;)switch(o){case"hex":return _t(this,r,e,n);case"utf8":case"utf-8":return yt(this,r,e,n);case"ascii":return Vr(this,r,e,n);case"latin1":case"binary":return It(this,r,e,n);case"base64":return Rt(this,r,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return wt(this,r,e,n);default:if(a)throw new TypeError("Unknown encoding: "+o);o=(""+o).toLowerCase(),a=!0}};u.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function Nt(t,r,e){return r===0&&e===t.length?Ur(t):Ur(t.slice(r,e))}function $r(t,r,e){e=Math.min(t.length,e);for(var n=[],o=r;o<e;){var i=t[o],a=null,c=i>239?4:i>223?3:i>191?2:1;if(o+c<=e){var p,d,f,m;switch(c){case 1:i<128&&(a=i);break;case 2:p=t[o+1],(p&192)===128&&(m=(i&31)<<6|p&63,m>127&&(a=m));break;case 3:p=t[o+1],d=t[o+2],(p&192)===128&&(d&192)===128&&(m=(i&15)<<12|(p&63)<<6|d&63,m>2047&&(m<55296||m>57343)&&(a=m));break;case 4:p=t[o+1],d=t[o+2],f=t[o+3],(p&192)===128&&(d&192)===128&&(f&192)===128&&(m=(i&15)<<18|(p&63)<<12|(d&63)<<6|f&63,m>65535&&m<1114112&&(a=m))}}a===null?(a=65533,c=1):a>65535&&(a-=65536,n.push(a>>>10&1023|55296),a=56320|a&1023),n.push(a),o+=c}return St(n)}var Mr=4096;function St(t){var r=t.length;if(r<=Mr)return String.fromCharCode.apply(String,t);for(var e="",n=0;n<r;)e+=String.fromCharCode.apply(String,t.slice(n,n+=Mr));return e}function Ot(t,r,e){var n="";e=Math.min(t.length,e);for(var o=r;o<e;++o)n+=String.fromCharCode(t[o]&127);return n}function Bt(t,r,e){var n="";e=Math.min(t.length,e);for(var o=r;o<e;++o)n+=String.fromCharCode(t[o]);return n}function Dt(t,r,e){var n=t.length;(!r||r<0)&&(r=0),(!e||e<0||e>n)&&(e=n);for(var o="",i=r;i<e;++i)o+=Lt(t[i]);return o}function Ct(t,r,e){for(var n=t.slice(r,e),o="",i=0;i<n.length;i+=2)o+=String.fromCharCode(n[i]+n[i+1]*256);return o}u.prototype.slice=function(r,e){var n=this.length;r=~~r,e=e===void 0?n:~~e,r<0?(r+=n,r<0&&(r=0)):r>n&&(r=n),e<0?(e+=n,e<0&&(e=0)):e>n&&(e=n),e<r&&(e=r);var o;if(u.TYPED_ARRAY_SUPPORT)o=this.subarray(r,e),o.__proto__=u.prototype;else{var i=e-r;o=new u(i,void 0);for(var a=0;a<i;++a)o[a]=this[a+r]}return o};function b(t,r,e){if(t%1!==0||t<0)throw new RangeError("offset is not uint");if(t+r>e)throw new RangeError("Trying to access beyond buffer length")}u.prototype.readUIntLE=function(r,e,n){r=r|0,e=e|0,n||b(r,e,this.length);for(var o=this[r],i=1,a=0;++a<e&&(i*=256);)o+=this[r+a]*i;return o};u.prototype.readUIntBE=function(r,e,n){r=r|0,e=e|0,n||b(r,e,this.length);for(var o=this[r+--e],i=1;e>0&&(i*=256);)o+=this[r+--e]*i;return o};u.prototype.readUInt8=function(r,e){return e||b(r,1,this.length),this[r]};u.prototype.readUInt16LE=function(r,e){return e||b(r,2,this.length),this[r]|this[r+1]<<8};u.prototype.readUInt16BE=function(r,e){return e||b(r,2,this.length),this[r]<<8|this[r+1]};u.prototype.readUInt32LE=function(r,e){return e||b(r,4,this.length),(this[r]|this[r+1]<<8|this[r+2]<<16)+this[r+3]*16777216};u.prototype.readUInt32BE=function(r,e){return e||b(r,4,this.length),this[r]*16777216+(this[r+1]<<16|this[r+2]<<8|this[r+3])};u.prototype.readIntLE=function(r,e,n){r=r|0,e=e|0,n||b(r,e,this.length);for(var o=this[r],i=1,a=0;++a<e&&(i*=256);)o+=this[r+a]*i;return i*=128,o>=i&&(o-=Math.pow(2,8*e)),o};u.prototype.readIntBE=function(r,e,n){r=r|0,e=e|0,n||b(r,e,this.length);for(var o=e,i=1,a=this[r+--o];o>0&&(i*=256);)a+=this[r+--o]*i;return i*=128,a>=i&&(a-=Math.pow(2,8*e)),a};u.prototype.readInt8=function(r,e){return e||b(r,1,this.length),this[r]&128?(255-this[r]+1)*-1:this[r]};u.prototype.readInt16LE=function(r,e){e||b(r,2,this.length);var n=this[r]|this[r+1]<<8;return n&32768?n|4294901760:n};u.prototype.readInt16BE=function(r,e){e||b(r,2,this.length);var n=this[r+1]|this[r]<<8;return n&32768?n|4294901760:n};u.prototype.readInt32LE=function(r,e){return e||b(r,4,this.length),this[r]|this[r+1]<<8|this[r+2]<<16|this[r+3]<<24};u.prototype.readInt32BE=function(r,e){return e||b(r,4,this.length),this[r]<<24|this[r+1]<<16|this[r+2]<<8|this[r+3]};u.prototype.readFloatLE=function(r,e){return e||b(r,4,this.length),J(this,r,!0,23,4)};u.prototype.readFloatBE=function(r,e){return e||b(r,4,this.length),J(this,r,!1,23,4)};u.prototype.readDoubleLE=function(r,e){return e||b(r,8,this.length),J(this,r,!0,52,8)};u.prototype.readDoubleBE=function(r,e){return e||b(r,8,this.length),J(this,r,!1,52,8)};function T(t,r,e,n,o,i){if(!S(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(r>o||r<i)throw new RangeError('"value" argument is out of bounds');if(e+n>t.length)throw new RangeError("Index out of range")}u.prototype.writeUIntLE=function(r,e,n,o){if(r=+r,e=e|0,n=n|0,!o){var i=Math.pow(2,8*n)-1;T(this,r,e,n,i,0)}var a=1,c=0;for(this[e]=r&255;++c<n&&(a*=256);)this[e+c]=r/a&255;return e+n};u.prototype.writeUIntBE=function(r,e,n,o){if(r=+r,e=e|0,n=n|0,!o){var i=Math.pow(2,8*n)-1;T(this,r,e,n,i,0)}var a=n-1,c=1;for(this[e+a]=r&255;--a>=0&&(c*=256);)this[e+a]=r/c&255;return e+n};u.prototype.writeUInt8=function(r,e,n){return r=+r,e=e|0,n||T(this,r,e,1,255,0),u.TYPED_ARRAY_SUPPORT||(r=Math.floor(r)),this[e]=r&255,e+1};function j(t,r,e,n){r<0&&(r=65535+r+1);for(var o=0,i=Math.min(t.length-e,2);o<i;++o)t[e+o]=(r&255<<8*(n?o:1-o))>>>(n?o:1-o)*8}u.prototype.writeUInt16LE=function(r,e,n){return r=+r,e=e|0,n||T(this,r,e,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[e]=r&255,this[e+1]=r>>>8):j(this,r,e,!0),e+2};u.prototype.writeUInt16BE=function(r,e,n){return r=+r,e=e|0,n||T(this,r,e,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[e]=r>>>8,this[e+1]=r&255):j(this,r,e,!1),e+2};function Q(t,r,e,n){r<0&&(r=4294967295+r+1);for(var o=0,i=Math.min(t.length-e,4);o<i;++o)t[e+o]=r>>>(n?o:3-o)*8&255}u.prototype.writeUInt32LE=function(r,e,n){return r=+r,e=e|0,n||T(this,r,e,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[e+3]=r>>>24,this[e+2]=r>>>16,this[e+1]=r>>>8,this[e]=r&255):Q(this,r,e,!0),e+4};u.prototype.writeUInt32BE=function(r,e,n){return r=+r,e=e|0,n||T(this,r,e,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[e]=r>>>24,this[e+1]=r>>>16,this[e+2]=r>>>8,this[e+3]=r&255):Q(this,r,e,!1),e+4};u.prototype.writeIntLE=function(r,e,n,o){if(r=+r,e=e|0,!o){var i=Math.pow(2,8*n-1);T(this,r,e,n,i-1,-i)}var a=0,c=1,p=0;for(this[e]=r&255;++a<n&&(c*=256);)r<0&&p===0&&this[e+a-1]!==0&&(p=1),this[e+a]=(r/c>>0)-p&255;return e+n};u.prototype.writeIntBE=function(r,e,n,o){if(r=+r,e=e|0,!o){var i=Math.pow(2,8*n-1);T(this,r,e,n,i-1,-i)}var a=n-1,c=1,p=0;for(this[e+a]=r&255;--a>=0&&(c*=256);)r<0&&p===0&&this[e+a+1]!==0&&(p=1),this[e+a]=(r/c>>0)-p&255;return e+n};u.prototype.writeInt8=function(r,e,n){return r=+r,e=e|0,n||T(this,r,e,1,127,-128),u.TYPED_ARRAY_SUPPORT||(r=Math.floor(r)),r<0&&(r=255+r+1),this[e]=r&255,e+1};u.prototype.writeInt16LE=function(r,e,n){return r=+r,e=e|0,n||T(this,r,e,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[e]=r&255,this[e+1]=r>>>8):j(this,r,e,!0),e+2};u.prototype.writeInt16BE=function(r,e,n){return r=+r,e=e|0,n||T(this,r,e,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[e]=r>>>8,this[e+1]=r&255):j(this,r,e,!1),e+2};u.prototype.writeInt32LE=function(r,e,n){return r=+r,e=e|0,n||T(this,r,e,4,2147483647,-2147483648),u.TYPED_ARRAY_SUPPORT?(this[e]=r&255,this[e+1]=r>>>8,this[e+2]=r>>>16,this[e+3]=r>>>24):Q(this,r,e,!0),e+4};u.prototype.writeInt32BE=function(r,e,n){return r=+r,e=e|0,n||T(this,r,e,4,2147483647,-2147483648),r<0&&(r=4294967295+r+1),u.TYPED_ARRAY_SUPPORT?(this[e]=r>>>24,this[e+1]=r>>>16,this[e+2]=r>>>8,this[e+3]=r&255):Q(this,r,e,!1),e+4};function Xr(t,r,e,n,o,i){if(e+n>t.length)throw new RangeError("Index out of range");if(e<0)throw new RangeError("Index out of range")}function zr(t,r,e,n,o){return o||Xr(t,r,e,4),Fr(t,r,e,n,23,4),e+4}u.prototype.writeFloatLE=function(r,e,n){return zr(this,r,e,!0,n)};u.prototype.writeFloatBE=function(r,e,n){return zr(this,r,e,!1,n)};function qr(t,r,e,n,o){return o||Xr(t,r,e,8),Fr(t,r,e,n,52,8),e+8}u.prototype.writeDoubleLE=function(r,e,n){return qr(this,r,e,!0,n)};u.prototype.writeDoubleBE=function(r,e,n){return qr(this,r,e,!1,n)};u.prototype.copy=function(r,e,n,o){if(n||(n=0),!o&&o!==0&&(o=this.length),e>=r.length&&(e=r.length),e||(e=0),o>0&&o<n&&(o=n),o===n||r.length===0||this.length===0)return 0;if(e<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("sourceStart out of bounds");if(o<0)throw new RangeError("sourceEnd out of bounds");o>this.length&&(o=this.length),r.length-e<o-n&&(o=r.length-e+n);var i=o-n,a;if(this===r&&n<e&&e<o)for(a=i-1;a>=0;--a)r[a+e]=this[a+n];else if(i<1e3||!u.TYPED_ARRAY_SUPPORT)for(a=0;a<i;++a)r[a+e]=this[a+n];else Uint8Array.prototype.set.call(r,this.subarray(n,n+i),e);return i};u.prototype.fill=function(r,e,n,o){if(typeof r=="string"){if(typeof e=="string"?(o=e,e=0,n=this.length):typeof n=="string"&&(o=n,n=this.length),r.length===1){var i=r.charCodeAt(0);i<256&&(r=i)}if(o!==void 0&&typeof o!="string")throw new TypeError("encoding must be a string");if(typeof o=="string"&&!u.isEncoding(o))throw new TypeError("Unknown encoding: "+o)}else typeof r=="number"&&(r=r&255);if(e<0||this.length<e||this.length<n)throw new RangeError("Out of range index");if(n<=e)return this;e=e>>>0,n=n===void 0?this.length:n>>>0,r||(r=0);var a;if(typeof r=="number")for(a=e;a<n;++a)this[a]=r;else{var c=S(r)?r:q(new u(r,o).toString()),p=c.length;for(a=0;a<n-e;++a)this[a+e]=c[a%p]}return this};var Pt=/[^+\/0-9A-Za-z-_]/g;function kt(t){if(t=Ut(t).replace(Pt,""),t.length<2)return"";for(;t.length%4!==0;)t=t+"=";return t}function Ut(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}function Lt(t){return t<16?"0"+t.toString(16):t.toString(16)}function q(t,r){r=r||1/0;for(var e,n=t.length,o=null,i=[],a=0;a<n;++a){if(e=t.charCodeAt(a),e>55295&&e<57344){if(!o){if(e>56319){(r-=3)>-1&&i.push(239,191,189);continue}else if(a+1===n){(r-=3)>-1&&i.push(239,191,189);continue}o=e;continue}if(e<56320){(r-=3)>-1&&i.push(239,191,189),o=e;continue}e=(o-55296<<10|e-56320)+65536}else o&&(r-=3)>-1&&i.push(239,191,189);if(o=null,e<128){if((r-=1)<0)break;i.push(e)}else if(e<2048){if((r-=2)<0)break;i.push(e>>6|192,e&63|128)}else if(e<65536){if((r-=3)<0)break;i.push(e>>12|224,e>>6&63|128,e&63|128)}else if(e<1114112){if((r-=4)<0)break;i.push(e>>18|240,e>>12&63|128,e>>6&63|128,e&63|128)}else throw new Error("Invalid code point")}return i}function Mt(t){for(var r=[],e=0;e<t.length;++e)r.push(t.charCodeAt(e)&255);return r}function vt(t,r){for(var e,n,o,i=[],a=0;a<t.length&&!((r-=2)<0);++a)e=t.charCodeAt(a),n=e>>8,o=e%256,i.push(o),i.push(n);return i}function Jr(t){return mt(kt(t))}function Z(t,r,e,n){for(var o=0;o<n&&!(o+e>=r.length||o>=t.length);++o)r[o+e]=t[o];return o}function Ft(t){return t!==t}function Yt(t){return t!=null&&(!!t._isBuffer||jr(t)||Gt(t))}function jr(t){return!!t.constructor&&typeof t.constructor.isBuffer=="function"&&t.constructor.isBuffer(t)}function Gt(t){return typeof t.readFloatLE=="function"&&typeof t.slice=="function"&&jr(t.slice(0,0))}import{encodeAddress as Kt,decodeAddress as Ln}from"algosdk";function lr(t){return new Uint8Array(u.from(t))}import Wt from"bignumber.js";Wt.config({DECIMAL_PLACES:40,EXPONENTIAL_AT:45});var eo=`{"theme1":{"value":"${l.env.FRONTEND_URL}/Theme%3DDark.svg","active":true},"theme2":{"value":"${l.env.FRONTEND_URL}/Theme%3DLight.svg","active":true},"theme3":{"value":"${l.env.FRONTEND_URL}/Theme%3DLight.svg","active":true}}`;var Qr={V1_1:"v1_1",V2:"v2"},io={[Qr.V1_1]:{testnet:62368684,mainnet:552635992},[Qr.V2]:{testnet:148607e3,mainnet:1002541853}};import Bu from"algosdk";import*as an from"bs58";import ri from"algosdk";import ui from"algosdk";import ga from"algosdk";var Ri={SMALLESTUNIT:l.env.SMALLEST_UNIT},wi={SMALLEST_UNITS:l.env.SMALLEST_UNIT};var Di=["point-system.discordEnabled","point-system.telegramBotName","point-system.telegramBotId","point-system.telegramEnabled","point-system.telegramGroupId","point-system.telegramGroupName","point-system.twitterAccountId","point-system.twitterAccountName","point-system.twitterEnabled","point-system.twitterJobEnabled","point-system.guideLink"];var vi=l.env.REACT_APP_API_URL,Fi=l.env.REACT_APP_SOCKET_URL,Yi=l.env.REACT_APP_ALGO_SERVER,Gi=l.env.REACT_APP_ALGO_SERVER_PORT||"",Ki=l.env.REACT_APP_ALGOD_TOKEN||"",Wi=l.env.REACT_APP_DISPENSER_LINK,Hi=l.env.REACT_APP_FRONTEND_LINK||"",Vi=l.env.REACT_APP_ALGO_EXPLORER_LINK,$i=l.env.REACT_APP_ALGO_EXPLORER_ASSETS_URL,Xi=(l.env.REACT_APP_REQUIRE_ACCESS_CODE||"").toLowerCase()==="true",zi=l.env.REACT_APP_USERBACK_ACCESS_TOKEN,qi=(l.env.REACT_APP_EXT_ORDER_TYPES||"").toLowerCase()==="true";var Ji=.001*10**6,ji=.002*10**6;var Qi=l.env.REACT_APP_MASTER_APP_ID||"406",Zi=l.env.REACT_APP_AGG_APP_ID||"408",qt=Number(l.env.REACT_APP_CODEX_APP_ID||"467960617");console.log("CODEX_APP_ID",qt);var Jt=l.env.REACT_APP_ALGO_NETWORK||"";var ra=Jt.toLowerCase()==="mainnet"?"mainnet":"testnet";import Cc from"algosdk";var ee=(o=>(o.GLOBAL_PAIR_DELISTING="GLOBAL_PAIR_DELISTING",o.GLOBAL_NEW_PAIR_LISTING="GLOBAL_NEW_PAIR_LISTING",o.GLOBAL_SYSTEM_MAINTENANCE="GLOBAL_SYSTEM_MAINTENANCE",o.GLOBAL_SMART_CONTRACT_UPDATE="GLOBAL_SMART_CONTRACT_UPDATE",o))(ee||{}),te=(n=>(n.ACCOUNT_POINTS_UNLOCK_ACHIEVEMENT="ACCOUNT_POINTS_UNLOCK_ACHIEVEMENT",n.ACCOUNT_KYC_STATUS_CHANGED="ACCOUNT_KYC_STATUS_CHANGED",n.ACCOUNT_AFFILIATE_DASHBOARD_UNLOCKED="ACCOUNT_AFFILIATE_DASHBOARD_UNLOCKED",n))(te||{}),ws={...ee,...te};import qc from"algosdk";var ln=(t,r)=>r===8?"MX":r===1?"":`Ethereum Signed Message:
|
|
2
|
+
${t.length}`,ae=(t,r,e)=>{let n=s.from(t,r);return s.concat([lr(ln(n,e)),n])},se=t=>{switch(t){case"ALGORAND":return 8;case"SOLANA":return 1;case"EVM":return 5;default:return 5}};function sn(t){let r=x.fromSigned(s.from(t));return BigInt(r.toString())}function dn(t){return x.toUnsigned(new x.BN(String(t)))}function cn(t){let r=dn(t);if(r.length>32)throw new Error("Invalid value. The buffer length of the value is more than 32");return new Uint8Array(x.setLengthLeft(r,32))}var un=t=>{if(t.length!==32)throw new Error("Invalid address bytes. The address buffer length is not equel 32");let r=s.from(t).toString("hex");if(r.slice(0,24)!=="000000000000000000000000")throw console.log("normalizedAddress",r),new Error("Invalid normalized address");let e="0x"+r.slice(-40);if(!gn(e))throw new Error("Invalid hex address");return e},mn=t=>new Uint8Array(x.setLengthLeft(mr(t),32)),mr=t=>s.from(fn(t),"hex"),fn=t=>t.startsWith("0x")?t.slice(2):t,gn=t=>x.isValidAddress(t),ce=(t,r)=>{let e=x.keccak256(t),{r:n,s:o,v:i}=x.fromRpcSig(r);return x.ecrecover(e,i,n,o)},np=(t,r,e,n)=>hn(ae(e,n,se("EVM")),t,r),hn=(t,r,e)=>{let n=ce(t,r);return x.bufferToHex(x.publicToAddress(n)).toLowerCase()===e.toLowerCase()},oe=t=>new Uint8Array(x.keccak256(s.from(t)));export{sn as decode32Bytes,mn as decodeAndNormalizeAddress,mr as decodeHexString,cn as encode32Bytes,un as encodeAddress,dn as encodeBigNumber,gn as isAddress,oe as keccak256,ce as recoverPublicKey,fn as unpadHexPrefix,hn as verifyMessage,np as verifySignature};
|
|
3
3
|
/*!
|
|
4
4
|
* The buffer module from node.js, for the browser.
|
|
5
5
|
*
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
function Re(){throw new Error("setTimeout has not been defined")}function Oe(){throw new Error("clearTimeout has not been defined")}var U=Re,M=Oe;typeof globalThis.setTimeout=="function"&&(U=setTimeout);typeof globalThis.clearTimeout=="function"&&(M=clearTimeout);function ke(t){if(U===setTimeout)return setTimeout(t,0);if((U===Re||!U)&&setTimeout)return U=setTimeout,setTimeout(t,0);try{return U(t,0)}catch{try{return U.call(null,t,0)}catch{return U.call(this,t,0)}}}function Or(t){if(M===clearTimeout)return clearTimeout(t);if((M===Oe||!M)&&clearTimeout)return M=clearTimeout,clearTimeout(t);try{return M(t)}catch{try{return M.call(null,t)}catch{return M.call(this,t)}}}var O=[],H=!1,v,j=-1;function kr(){!H||!v||(H=!1,v.length?O=v.concat(O):j=-1,O.length&&Be())}function Be(){if(!H){var t=ke(kr);H=!0;for(var e=O.length;e;){for(v=O,O=[];++j<e;)v&&v[j].run();j=-1,e=O.length}v=null,H=!1,Or(t)}}function Br(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)e[r-1]=arguments[r];O.push(new Pe(t,e)),O.length===1&&!H&&ke(Be)}function Pe(t,e){this.fun=t,this.array=e}Pe.prototype.run=function(){this.fun.apply(null,this.array)};var Pr="browser",Ur="browser",Mr=!0,Lr={},vr=[],Fr="",Wr={},Yr={},Gr={};function F(){}var Kr=F,Hr=F,Vr=F,$r=F,zr=F,qr=F,Xr=F;function Jr(t){throw new Error("process.binding is not supported")}function jr(){return"/"}function Qr(t){throw new Error("process.chdir is not supported")}function Zr(){return 0}var K=globalThis.performance||{},et=K.now||K.mozNow||K.msNow||K.oNow||K.webkitNow||function(){return new Date().getTime()};function rt(t){var e=et.call(K)*.001,r=Math.floor(e),n=Math.floor(e%1*1e9);return t&&(r=r-t[0],n=n-t[1],n<0&&(r--,n+=1e9)),[r,n]}var tt=new Date;function nt(){var t=new Date,e=t-tt;return e/1e3}var u={nextTick:Br,title:Pr,browser:Mr,env:Lr,argv:vr,version:Fr,versions:Wr,on:Kr,addListener:Hr,once:Vr,off:$r,removeListener:zr,removeAllListeners:qr,emit:Xr,binding:Jr,cwd:jr,chdir:Qr,umask:Zr,hrtime:rt,platform:Ur,release:Yr,config:Gr,uptime:nt},Ne={};Object.keys(Ne).forEach(t=>{let e=t.split("."),r=u;for(let n=0;n<e.length;n++){let i=e[n];n===e.length-1?r[i]=Ne[t]:r=r[i]||(r[i]={})}});var w=[],_=[],it=typeof Uint8Array<"u"?Uint8Array:Array,le=!1;function ve(){le=!0;for(var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",e=0,r=t.length;e<r;++e)w[e]=t[e],_[t.charCodeAt(e)]=e;_[45]=62,_[95]=63}function ot(t){le||ve();var e,r,n,i,o,a,c=t.length;if(c%4>0)throw new Error("Invalid string. Length must be a multiple of 4");o=t[c-2]==="="?2:t[c-1]==="="?1:0,a=new it(c*3/4-o),n=o>0?c-4:c;var d=0;for(e=0,r=0;e<n;e+=4,r+=3)i=_[t.charCodeAt(e)]<<18|_[t.charCodeAt(e+1)]<<12|_[t.charCodeAt(e+2)]<<6|_[t.charCodeAt(e+3)],a[d++]=i>>16&255,a[d++]=i>>8&255,a[d++]=i&255;return o===2?(i=_[t.charCodeAt(e)]<<2|_[t.charCodeAt(e+1)]>>4,a[d++]=i&255):o===1&&(i=_[t.charCodeAt(e)]<<10|_[t.charCodeAt(e+1)]<<4|_[t.charCodeAt(e+2)]>>2,a[d++]=i>>8&255,a[d++]=i&255),a}function at(t){return w[t>>18&63]+w[t>>12&63]+w[t>>6&63]+w[t&63]}function st(t,e,r){for(var n,i=[],o=e;o<r;o+=3)n=(t[o]<<16)+(t[o+1]<<8)+t[o+2],i.push(at(n));return i.join("")}function Ue(t){le||ve();for(var e,r=t.length,n=r%3,i="",o=[],a=16383,c=0,d=r-n;c<d;c+=a)o.push(st(t,c,c+a>d?d:c+a));return n===1?(e=t[r-1],i+=w[e>>2],i+=w[e<<4&63],i+="=="):n===2&&(e=(t[r-2]<<8)+t[r-1],i+=w[e>>10],i+=w[e>>4&63],i+=w[e<<2&63],i+="="),o.push(i),o.join("")}s.TYPED_ARRAY_SUPPORT=globalThis.TYPED_ARRAY_SUPPORT!==void 0?globalThis.TYPED_ARRAY_SUPPORT:!0;function Q(){return s.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function k(t,e){if(Q()<e)throw new RangeError("Invalid typed array length");return s.TYPED_ARRAY_SUPPORT?(t=new Uint8Array(e),t.__proto__=s.prototype):(t===null&&(t=new s(e)),t.length=e),t}function s(t,e,r){if(!s.TYPED_ARRAY_SUPPORT&&!(this instanceof s))return new s(t,e,r);if(typeof t=="number"){if(typeof e=="string")throw new Error("If encoding is specified then the first argument must be a string");return ge(this,t)}return Fe(this,t,e,r)}s.poolSize=8192;s._augment=function(t){return t.__proto__=s.prototype,t};function Fe(t,e,r,n){if(typeof e=="number")throw new TypeError('"value" argument must not be a number');return typeof ArrayBuffer<"u"&&e instanceof ArrayBuffer?pt(t,e,r,n):typeof e=="string"?ut(t,e,r):dt(t,e)}s.from=function(t,e,r){return Fe(null,t,e,r)};s.kMaxLength=Q();s.TYPED_ARRAY_SUPPORT&&(s.prototype.__proto__=Uint8Array.prototype,s.__proto__=Uint8Array,typeof Symbol<"u"&&Symbol.species&&s[Symbol.species]);function We(t){if(typeof t!="number")throw new TypeError('"size" argument must be a number');if(t<0)throw new RangeError('"size" argument must not be negative')}function ct(t,e,r,n){return We(e),e<=0?k(t,e):r!==void 0?typeof n=="string"?k(t,e).fill(r,n):k(t,e).fill(r):k(t,e)}s.alloc=function(t,e,r){return ct(null,t,e,r)};function ge(t,e){if(We(e),t=k(t,e<0?0:fe(e)|0),!s.TYPED_ARRAY_SUPPORT)for(var r=0;r<e;++r)t[r]=0;return t}s.allocUnsafe=function(t){return ge(null,t)};s.allocUnsafeSlow=function(t){return ge(null,t)};function ut(t,e,r){if((typeof r!="string"||r==="")&&(r="utf8"),!s.isEncoding(r))throw new TypeError('"encoding" must be a valid string encoding');var n=Ye(e,r)|0;t=k(t,n);var i=t.write(e,r);return i!==n&&(t=t.slice(0,i)),t}function me(t,e){var r=e.length<0?0:fe(e.length)|0;t=k(t,r);for(var n=0;n<r;n+=1)t[n]=e[n]&255;return t}function pt(t,e,r,n){if(e.byteLength,r<0||e.byteLength<r)throw new RangeError("'offset' is out of bounds");if(e.byteLength<r+(n||0))throw new RangeError("'length' is out of bounds");return r===void 0&&n===void 0?e=new Uint8Array(e):n===void 0?e=new Uint8Array(e,r):e=new Uint8Array(e,r,n),s.TYPED_ARRAY_SUPPORT?(t=e,t.__proto__=s.prototype):t=me(t,e),t}function dt(t,e){if(D(e)){var r=fe(e.length)|0;return t=k(t,r),t.length===0||e.copy(t,0,0,r),t}if(e){if(typeof ArrayBuffer<"u"&&e.buffer instanceof ArrayBuffer||"length"in e)return typeof e.length!="number"||Rt(e.length)?k(t,0):me(t,e);if(e.type==="Buffer"&&Array.isArray(e.data))return me(t,e.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function fe(t){if(t>=Q())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+Q().toString(16)+" bytes");return t|0}s.isBuffer=Ot;function D(t){return!!(t!=null&&t._isBuffer)}s.compare=function(e,r){if(!D(e)||!D(r))throw new TypeError("Arguments must be Buffers");if(e===r)return 0;for(var n=e.length,i=r.length,o=0,a=Math.min(n,i);o<a;++o)if(e[o]!==r[o]){n=e[o],i=r[o];break}return n<i?-1:i<n?1:0};s.isEncoding=function(e){switch(String(e).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}};s.concat=function(e,r){if(!Array.isArray(e))throw new TypeError('"list" argument must be an Array of Buffers');if(e.length===0)return s.alloc(0);var n;if(r===void 0)for(r=0,n=0;n<e.length;++n)r+=e[n].length;var i=s.allocUnsafe(r),o=0;for(n=0;n<e.length;++n){var a=e[n];if(!D(a))throw new TypeError('"list" argument must be an Array of Buffers');a.copy(i,o),o+=a.length}return i};function Ye(t,e){if(D(t))return t.length;if(typeof ArrayBuffer<"u"&&typeof ArrayBuffer.isView=="function"&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;typeof t!="string"&&(t=""+t);var r=t.length;if(r===0)return 0;for(var n=!1;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":case void 0:return Z(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return r*2;case"hex":return r>>>1;case"base64":return qe(t).length;default:if(n)return Z(t).length;e=(""+e).toLowerCase(),n=!0}}s.byteLength=Ye;function mt(t,e,r){var n=!1;if((e===void 0||e<0)&&(e=0),e>this.length||((r===void 0||r>this.length)&&(r=this.length),r<=0)||(r>>>=0,e>>>=0,r<=e))return"";for(t||(t="utf8");;)switch(t){case"hex":return Tt(this,e,r);case"utf8":case"utf-8":return He(this,e,r);case"ascii":return yt(this,e,r);case"latin1":case"binary":return It(this,e,r);case"base64":return xt(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Et(this,e,r);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}s.prototype._isBuffer=!0;function W(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}s.prototype.swap16=function(){var e=this.length;if(e%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var r=0;r<e;r+=2)W(this,r,r+1);return this};s.prototype.swap32=function(){var e=this.length;if(e%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var r=0;r<e;r+=4)W(this,r,r+3),W(this,r+1,r+2);return this};s.prototype.swap64=function(){var e=this.length;if(e%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var r=0;r<e;r+=8)W(this,r,r+7),W(this,r+1,r+6),W(this,r+2,r+5),W(this,r+3,r+4);return this};s.prototype.toString=function(){var e=this.length|0;return e===0?"":arguments.length===0?He(this,0,e):mt.apply(this,arguments)};s.prototype.equals=function(e){if(!D(e))throw new TypeError("Argument must be a Buffer");return this===e?!0:s.compare(this,e)===0};s.prototype.compare=function(e,r,n,i,o){if(!D(e))throw new TypeError("Argument must be a Buffer");if(r===void 0&&(r=0),n===void 0&&(n=e?e.length:0),i===void 0&&(i=0),o===void 0&&(o=this.length),r<0||n>e.length||i<0||o>this.length)throw new RangeError("out of range index");if(i>=o&&r>=n)return 0;if(i>=o)return-1;if(r>=n)return 1;if(r>>>=0,n>>>=0,i>>>=0,o>>>=0,this===e)return 0;for(var a=o-i,c=n-r,d=Math.min(a,c),l=this.slice(i,o),g=e.slice(r,n),m=0;m<d;++m)if(l[m]!==g[m]){a=l[m],c=g[m];break}return a<c?-1:c<a?1:0};function Ge(t,e,r,n,i){if(t.length===0)return-1;if(typeof r=="string"?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,isNaN(r)&&(r=i?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(i)return-1;r=t.length-1}else if(r<0)if(i)r=0;else return-1;if(typeof e=="string"&&(e=s.from(e,n)),D(e))return e.length===0?-1:Me(t,e,r,n,i);if(typeof e=="number")return e=e&255,s.TYPED_ARRAY_SUPPORT&&typeof Uint8Array.prototype.indexOf=="function"?i?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):Me(t,[e],r,n,i);throw new TypeError("val must be string, number or Buffer")}function Me(t,e,r,n,i){var o=1,a=t.length,c=e.length;if(n!==void 0&&(n=String(n).toLowerCase(),n==="ucs2"||n==="ucs-2"||n==="utf16le"||n==="utf-16le")){if(t.length<2||e.length<2)return-1;o=2,a/=2,c/=2,r/=2}function d(f,y){return o===1?f[y]:f.readUInt16BE(y*o)}var l;if(i){var g=-1;for(l=r;l<a;l++)if(d(t,l)===d(e,g===-1?0:l-g)){if(g===-1&&(g=l),l-g+1===c)return g*o}else g!==-1&&(l-=l-g),g=-1}else for(r+c>a&&(r=a-c),l=r;l>=0;l--){for(var m=!0,b=0;b<c;b++)if(d(t,l+b)!==d(e,b)){m=!1;break}if(m)return l}return-1}s.prototype.includes=function(e,r,n){return this.indexOf(e,r,n)!==-1};s.prototype.indexOf=function(e,r,n){return Ge(this,e,r,n,!0)};s.prototype.lastIndexOf=function(e,r,n){return Ge(this,e,r,n,!1)};function lt(t,e,r,n){r=Number(r)||0;var i=t.length-r;n?(n=Number(n),n>i&&(n=i)):n=i;var o=e.length;if(o%2!==0)throw new TypeError("Invalid hex string");n>o/2&&(n=o/2);for(var a=0;a<n;++a){var c=parseInt(e.substr(a*2,2),16);if(isNaN(c))return a;t[r+a]=c}return a}function gt(t,e,r,n){return te(Z(e,t.length-r),t,r,n)}function Ke(t,e,r,n){return te(Dt(e),t,r,n)}function ft(t,e,r,n){return Ke(t,e,r,n)}function bt(t,e,r,n){return te(qe(e),t,r,n)}function ht(t,e,r,n){return te(Nt(e,t.length-r),t,r,n)}s.prototype.write=function(e,r,n,i){if(r===void 0)i="utf8",n=this.length,r=0;else if(n===void 0&&typeof r=="string")i=r,n=this.length,r=0;else if(isFinite(r))r=r|0,isFinite(n)?(n=n|0,i===void 0&&(i="utf8")):(i=n,n=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var o=this.length-r;if((n===void 0||n>o)&&(n=o),e.length>0&&(n<0||r<0)||r>this.length)throw new RangeError("Attempt to write outside buffer bounds");i||(i="utf8");for(var a=!1;;)switch(i){case"hex":return lt(this,e,r,n);case"utf8":case"utf-8":return gt(this,e,r,n);case"ascii":return Ke(this,e,r,n);case"latin1":case"binary":return ft(this,e,r,n);case"base64":return bt(this,e,r,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ht(this,e,r,n);default:if(a)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),a=!0}};s.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function xt(t,e,r){return e===0&&r===t.length?Ue(t):Ue(t.slice(e,r))}function He(t,e,r){r=Math.min(t.length,r);for(var n=[],i=e;i<r;){var o=t[i],a=null,c=o>239?4:o>223?3:o>191?2:1;if(i+c<=r){var d,l,g,m;switch(c){case 1:o<128&&(a=o);break;case 2:d=t[i+1],(d&192)===128&&(m=(o&31)<<6|d&63,m>127&&(a=m));break;case 3:d=t[i+1],l=t[i+2],(d&192)===128&&(l&192)===128&&(m=(o&15)<<12|(d&63)<<6|l&63,m>2047&&(m<55296||m>57343)&&(a=m));break;case 4:d=t[i+1],l=t[i+2],g=t[i+3],(d&192)===128&&(l&192)===128&&(g&192)===128&&(m=(o&15)<<18|(d&63)<<12|(l&63)<<6|g&63,m>65535&&m<1114112&&(a=m))}}a===null?(a=65533,c=1):a>65535&&(a-=65536,n.push(a>>>10&1023|55296),a=56320|a&1023),n.push(a),i+=c}return At(n)}var Le=4096;function At(t){var e=t.length;if(e<=Le)return String.fromCharCode.apply(String,t);for(var r="",n=0;n<e;)r+=String.fromCharCode.apply(String,t.slice(n,n+=Le));return r}function yt(t,e,r){var n="";r=Math.min(t.length,r);for(var i=e;i<r;++i)n+=String.fromCharCode(t[i]&127);return n}function It(t,e,r){var n="";r=Math.min(t.length,r);for(var i=e;i<r;++i)n+=String.fromCharCode(t[i]);return n}function Tt(t,e,r){var n=t.length;(!e||e<0)&&(e=0),(!r||r<0||r>n)&&(r=n);for(var i="",o=e;o<r;++o)i+=wt(t[o]);return i}function Et(t,e,r){for(var n=t.slice(e,r),i="",o=0;o<n.length;o+=2)i+=String.fromCharCode(n[o]+n[o+1]*256);return i}s.prototype.slice=function(e,r){var n=this.length;e=~~e,r=r===void 0?n:~~r,e<0?(e+=n,e<0&&(e=0)):e>n&&(e=n),r<0?(r+=n,r<0&&(r=0)):r>n&&(r=n),r<e&&(r=e);var i;if(s.TYPED_ARRAY_SUPPORT)i=this.subarray(e,r),i.__proto__=s.prototype;else{var o=r-e;i=new s(o,void 0);for(var a=0;a<o;++a)i[a]=this[a+e]}return i};function h(t,e,r){if(t%1!==0||t<0)throw new RangeError("offset is not uint");if(t+e>r)throw new RangeError("Trying to access beyond buffer length")}s.prototype.readUIntLE=function(e,r,n){e=e|0,r=r|0,n||h(e,r,this.length);for(var i=this[e],o=1,a=0;++a<r&&(o*=256);)i+=this[e+a]*o;return i};s.prototype.readUIntBE=function(e,r,n){e=e|0,r=r|0,n||h(e,r,this.length);for(var i=this[e+--r],o=1;r>0&&(o*=256);)i+=this[e+--r]*o;return i};s.prototype.readUInt8=function(e,r){return r||h(e,1,this.length),this[e]};s.prototype.readUInt16LE=function(e,r){return r||h(e,2,this.length),this[e]|this[e+1]<<8};s.prototype.readUInt16BE=function(e,r){return r||h(e,2,this.length),this[e]<<8|this[e+1]};s.prototype.readUInt32LE=function(e,r){return r||h(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+this[e+3]*16777216};s.prototype.readUInt32BE=function(e,r){return r||h(e,4,this.length),this[e]*16777216+(this[e+1]<<16|this[e+2]<<8|this[e+3])};s.prototype.readIntLE=function(e,r,n){e=e|0,r=r|0,n||h(e,r,this.length);for(var i=this[e],o=1,a=0;++a<r&&(o*=256);)i+=this[e+a]*o;return o*=128,i>=o&&(i-=Math.pow(2,8*r)),i};s.prototype.readIntBE=function(e,r,n){e=e|0,r=r|0,n||h(e,r,this.length);for(var i=r,o=1,a=this[e+--i];i>0&&(o*=256);)a+=this[e+--i]*o;return o*=128,a>=o&&(a-=Math.pow(2,8*r)),a};s.prototype.readInt8=function(e,r){return r||h(e,1,this.length),this[e]&128?(255-this[e]+1)*-1:this[e]};s.prototype.readInt16LE=function(e,r){r||h(e,2,this.length);var n=this[e]|this[e+1]<<8;return n&32768?n|4294901760:n};s.prototype.readInt16BE=function(e,r){r||h(e,2,this.length);var n=this[e+1]|this[e]<<8;return n&32768?n|4294901760:n};s.prototype.readInt32LE=function(e,r){return r||h(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24};s.prototype.readInt32BE=function(e,r){return r||h(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]};s.prototype.readFloatLE=function(e,r){return r||h(e,4,this.length),ne(this,e,!0,23,4)};s.prototype.readFloatBE=function(e,r){return r||h(e,4,this.length),ne(this,e,!1,23,4)};s.prototype.readDoubleLE=function(e,r){return r||h(e,8,this.length),ne(this,e,!0,52,8)};s.prototype.readDoubleBE=function(e,r){return r||h(e,8,this.length),ne(this,e,!1,52,8)};function I(t,e,r,n,i,o){if(!D(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>i||e<o)throw new RangeError('"value" argument is out of bounds');if(r+n>t.length)throw new RangeError("Index out of range")}s.prototype.writeUIntLE=function(e,r,n,i){if(e=+e,r=r|0,n=n|0,!i){var o=Math.pow(2,8*n)-1;I(this,e,r,n,o,0)}var a=1,c=0;for(this[r]=e&255;++c<n&&(a*=256);)this[r+c]=e/a&255;return r+n};s.prototype.writeUIntBE=function(e,r,n,i){if(e=+e,r=r|0,n=n|0,!i){var o=Math.pow(2,8*n)-1;I(this,e,r,n,o,0)}var a=n-1,c=1;for(this[r+a]=e&255;--a>=0&&(c*=256);)this[r+a]=e/c&255;return r+n};s.prototype.writeUInt8=function(e,r,n){return e=+e,r=r|0,n||I(this,e,r,1,255,0),s.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[r]=e&255,r+1};function ee(t,e,r,n){e<0&&(e=65535+e+1);for(var i=0,o=Math.min(t.length-r,2);i<o;++i)t[r+i]=(e&255<<8*(n?i:1-i))>>>(n?i:1-i)*8}s.prototype.writeUInt16LE=function(e,r,n){return e=+e,r=r|0,n||I(this,e,r,2,65535,0),s.TYPED_ARRAY_SUPPORT?(this[r]=e&255,this[r+1]=e>>>8):ee(this,e,r,!0),r+2};s.prototype.writeUInt16BE=function(e,r,n){return e=+e,r=r|0,n||I(this,e,r,2,65535,0),s.TYPED_ARRAY_SUPPORT?(this[r]=e>>>8,this[r+1]=e&255):ee(this,e,r,!1),r+2};function re(t,e,r,n){e<0&&(e=4294967295+e+1);for(var i=0,o=Math.min(t.length-r,4);i<o;++i)t[r+i]=e>>>(n?i:3-i)*8&255}s.prototype.writeUInt32LE=function(e,r,n){return e=+e,r=r|0,n||I(this,e,r,4,4294967295,0),s.TYPED_ARRAY_SUPPORT?(this[r+3]=e>>>24,this[r+2]=e>>>16,this[r+1]=e>>>8,this[r]=e&255):re(this,e,r,!0),r+4};s.prototype.writeUInt32BE=function(e,r,n){return e=+e,r=r|0,n||I(this,e,r,4,4294967295,0),s.TYPED_ARRAY_SUPPORT?(this[r]=e>>>24,this[r+1]=e>>>16,this[r+2]=e>>>8,this[r+3]=e&255):re(this,e,r,!1),r+4};s.prototype.writeIntLE=function(e,r,n,i){if(e=+e,r=r|0,!i){var o=Math.pow(2,8*n-1);I(this,e,r,n,o-1,-o)}var a=0,c=1,d=0;for(this[r]=e&255;++a<n&&(c*=256);)e<0&&d===0&&this[r+a-1]!==0&&(d=1),this[r+a]=(e/c>>0)-d&255;return r+n};s.prototype.writeIntBE=function(e,r,n,i){if(e=+e,r=r|0,!i){var o=Math.pow(2,8*n-1);I(this,e,r,n,o-1,-o)}var a=n-1,c=1,d=0;for(this[r+a]=e&255;--a>=0&&(c*=256);)e<0&&d===0&&this[r+a+1]!==0&&(d=1),this[r+a]=(e/c>>0)-d&255;return r+n};s.prototype.writeInt8=function(e,r,n){return e=+e,r=r|0,n||I(this,e,r,1,127,-128),s.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[r]=e&255,r+1};s.prototype.writeInt16LE=function(e,r,n){return e=+e,r=r|0,n||I(this,e,r,2,32767,-32768),s.TYPED_ARRAY_SUPPORT?(this[r]=e&255,this[r+1]=e>>>8):ee(this,e,r,!0),r+2};s.prototype.writeInt16BE=function(e,r,n){return e=+e,r=r|0,n||I(this,e,r,2,32767,-32768),s.TYPED_ARRAY_SUPPORT?(this[r]=e>>>8,this[r+1]=e&255):ee(this,e,r,!1),r+2};s.prototype.writeInt32LE=function(e,r,n){return e=+e,r=r|0,n||I(this,e,r,4,2147483647,-2147483648),s.TYPED_ARRAY_SUPPORT?(this[r]=e&255,this[r+1]=e>>>8,this[r+2]=e>>>16,this[r+3]=e>>>24):re(this,e,r,!0),r+4};s.prototype.writeInt32BE=function(e,r,n){return e=+e,r=r|0,n||I(this,e,r,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),s.TYPED_ARRAY_SUPPORT?(this[r]=e>>>24,this[r+1]=e>>>16,this[r+2]=e>>>8,this[r+3]=e&255):re(this,e,r,!1),r+4};function Ve(t,e,r,n,i,o){if(r+n>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function $e(t,e,r,n,i){return i||Ve(t,e,r,4,34028234663852886e22,-34028234663852886e22),Je(t,e,r,n,23,4),r+4}s.prototype.writeFloatLE=function(e,r,n){return $e(this,e,r,!0,n)};s.prototype.writeFloatBE=function(e,r,n){return $e(this,e,r,!1,n)};function ze(t,e,r,n,i){return i||Ve(t,e,r,8,17976931348623157e292,-17976931348623157e292),Je(t,e,r,n,52,8),r+8}s.prototype.writeDoubleLE=function(e,r,n){return ze(this,e,r,!0,n)};s.prototype.writeDoubleBE=function(e,r,n){return ze(this,e,r,!1,n)};s.prototype.copy=function(e,r,n,i){if(n||(n=0),!i&&i!==0&&(i=this.length),r>=e.length&&(r=e.length),r||(r=0),i>0&&i<n&&(i=n),i===n||e.length===0||this.length===0)return 0;if(r<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("sourceStart out of bounds");if(i<0)throw new RangeError("sourceEnd out of bounds");i>this.length&&(i=this.length),e.length-r<i-n&&(i=e.length-r+n);var o=i-n,a;if(this===e&&n<r&&r<i)for(a=o-1;a>=0;--a)e[a+r]=this[a+n];else if(o<1e3||!s.TYPED_ARRAY_SUPPORT)for(a=0;a<o;++a)e[a+r]=this[a+n];else Uint8Array.prototype.set.call(e,this.subarray(n,n+o),r);return o};s.prototype.fill=function(e,r,n,i){if(typeof e=="string"){if(typeof r=="string"?(i=r,r=0,n=this.length):typeof n=="string"&&(i=n,n=this.length),e.length===1){var o=e.charCodeAt(0);o<256&&(e=o)}if(i!==void 0&&typeof i!="string")throw new TypeError("encoding must be a string");if(typeof i=="string"&&!s.isEncoding(i))throw new TypeError("Unknown encoding: "+i)}else typeof e=="number"&&(e=e&255);if(r<0||this.length<r||this.length<n)throw new RangeError("Out of range index");if(n<=r)return this;r=r>>>0,n=n===void 0?this.length:n>>>0,e||(e=0);var a;if(typeof e=="number")for(a=r;a<n;++a)this[a]=e;else{var c=D(e)?e:Z(new s(e,i).toString()),d=c.length;for(a=0;a<n-r;++a)this[a+r]=c[a%d]}return this};var _t=/[^+\/0-9A-Za-z-_]/g;function St(t){if(t=Ct(t).replace(_t,""),t.length<2)return"";for(;t.length%4!==0;)t=t+"=";return t}function Ct(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}function wt(t){return t<16?"0"+t.toString(16):t.toString(16)}function Z(t,e){e=e||1/0;for(var r,n=t.length,i=null,o=[],a=0;a<n;++a){if(r=t.charCodeAt(a),r>55295&&r<57344){if(!i){if(r>56319){(e-=3)>-1&&o.push(239,191,189);continue}else if(a+1===n){(e-=3)>-1&&o.push(239,191,189);continue}i=r;continue}if(r<56320){(e-=3)>-1&&o.push(239,191,189),i=r;continue}r=(i-55296<<10|r-56320)+65536}else i&&(e-=3)>-1&&o.push(239,191,189);if(i=null,r<128){if((e-=1)<0)break;o.push(r)}else if(r<2048){if((e-=2)<0)break;o.push(r>>6|192,r&63|128)}else if(r<65536){if((e-=3)<0)break;o.push(r>>12|224,r>>6&63|128,r&63|128)}else if(r<1114112){if((e-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,r&63|128)}else throw new Error("Invalid code point")}return o}function Dt(t){for(var e=[],r=0;r<t.length;++r)e.push(t.charCodeAt(r)&255);return e}function Nt(t,e){for(var r,n,i,o=[],a=0;a<t.length&&!((e-=2)<0);++a)r=t.charCodeAt(a),n=r>>8,i=r%256,o.push(i),o.push(n);return o}function qe(t){return ot(St(t))}function te(t,e,r,n){for(var i=0;i<n&&!(i+r>=e.length||i>=t.length);++i)e[i+r]=t[i];return i}function Rt(t){return t!==t}function Ot(t){return t!=null&&(!!t._isBuffer||Xe(t)||kt(t))}function Xe(t){return!!t.constructor&&typeof t.constructor.isBuffer=="function"&&t.constructor.isBuffer(t)}function kt(t){return typeof t.readFloatLE=="function"&&typeof t.slice=="function"&&Xe(t.slice(0,0))}function ne(t,e,r,n,i){var o,a,c=i*8-n-1,d=(1<<c)-1,l=d>>1,g=-7,m=r?i-1:0,b=r?-1:1,f=t[e+m];for(m+=b,o=f&(1<<-g)-1,f>>=-g,g+=c;g>0;o=o*256+t[e+m],m+=b,g-=8);for(a=o&(1<<-g)-1,o>>=-g,g+=n;g>0;a=a*256+t[e+m],m+=b,g-=8);if(o===0)o=1-l;else{if(o===d)return a?NaN:(f?-1:1)*(1/0);a=a+Math.pow(2,n),o=o-l}return(f?-1:1)*a*Math.pow(2,o-n)}function Je(t,e,r,n,i,o){var a,c,d,l=o*8-i-1,g=(1<<l)-1,m=g>>1,b=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,f=n?0:o-1,y=n?1:-1,X=e<0||e===0&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(c=isNaN(e)?1:0,a=g):(a=Math.floor(Math.log(e)/Math.LN2),e*(d=Math.pow(2,-a))<1&&(a--,d*=2),a+m>=1?e+=b/d:e+=b*Math.pow(2,1-m),e*d>=2&&(a++,d/=2),a+m>=g?(c=0,a=g):a+m>=1?(c=(e*d-1)*Math.pow(2,i),a=a+m):(c=e*Math.pow(2,m-1)*Math.pow(2,i),a=0));i>=8;t[r+f]=c&255,f+=y,c/=256,i-=8);for(a=a<<i|c,l+=i;l>0;t[r+f]=a&255,f+=y,a/=256,l-=8);t[r+f-y]|=X*128}import{PublicKey as q}from"@solana/web3.js";var V={"0x4343545055534443000000000000000000000000000000000000000000000000":65537};import Gu from"algosdk";import*as Dr from"bs58";import fn from"algosdk";import ti,{decodeAddress as ni,encodeAddress as ii}from"algosdk";var N=[],S=[],Bt=typeof Uint8Array<"u"?Uint8Array:Array,he=!1;function er(){he=!0;for(var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",e=0,r=t.length;e<r;++e)N[e]=t[e],S[t.charCodeAt(e)]=e;S[45]=62,S[95]=63}function Pt(t){he||er();var e,r,n,i,o,a,c=t.length;if(c%4>0)throw new Error("Invalid string. Length must be a multiple of 4");o=t[c-2]==="="?2:t[c-1]==="="?1:0,a=new Bt(c*3/4-o),n=o>0?c-4:c;var d=0;for(e=0,r=0;e<n;e+=4,r+=3)i=S[t.charCodeAt(e)]<<18|S[t.charCodeAt(e+1)]<<12|S[t.charCodeAt(e+2)]<<6|S[t.charCodeAt(e+3)],a[d++]=i>>16&255,a[d++]=i>>8&255,a[d++]=i&255;return o===2?(i=S[t.charCodeAt(e)]<<2|S[t.charCodeAt(e+1)]>>4,a[d++]=i&255):o===1&&(i=S[t.charCodeAt(e)]<<10|S[t.charCodeAt(e+1)]<<4|S[t.charCodeAt(e+2)]>>2,a[d++]=i>>8&255,a[d++]=i&255),a}function Ut(t){return N[t>>18&63]+N[t>>12&63]+N[t>>6&63]+N[t&63]}function Mt(t,e,r){for(var n,i=[],o=e;o<r;o+=3)n=(t[o]<<16)+(t[o+1]<<8)+t[o+2],i.push(Ut(n));return i.join("")}function je(t){he||er();for(var e,r=t.length,n=r%3,i="",o=[],a=16383,c=0,d=r-n;c<d;c+=a)o.push(Mt(t,c,c+a>d?d:c+a));return n===1?(e=t[r-1],i+=N[e>>2],i+=N[e<<4&63],i+="=="):n===2&&(e=(t[r-2]<<8)+t[r-1],i+=N[e>>10],i+=N[e>>4&63],i+=N[e<<2&63],i+="="),o.push(i),o.join("")}function ae(t,e,r,n,i){var o,a,c=i*8-n-1,d=(1<<c)-1,l=d>>1,g=-7,m=r?i-1:0,b=r?-1:1,f=t[e+m];for(m+=b,o=f&(1<<-g)-1,f>>=-g,g+=c;g>0;o=o*256+t[e+m],m+=b,g-=8);for(a=o&(1<<-g)-1,o>>=-g,g+=n;g>0;a=a*256+t[e+m],m+=b,g-=8);if(o===0)o=1-l;else{if(o===d)return a?NaN:(f?-1:1)*(1/0);a=a+Math.pow(2,n),o=o-l}return(f?-1:1)*a*Math.pow(2,o-n)}function rr(t,e,r,n,i,o){var a,c,d,l=o*8-i-1,g=(1<<l)-1,m=g>>1,b=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,f=n?0:o-1,y=n?1:-1,X=e<0||e===0&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(c=isNaN(e)?1:0,a=g):(a=Math.floor(Math.log(e)/Math.LN2),e*(d=Math.pow(2,-a))<1&&(a--,d*=2),a+m>=1?e+=b/d:e+=b*Math.pow(2,1-m),e*d>=2&&(a++,d/=2),a+m>=g?(c=0,a=g):a+m>=1?(c=(e*d-1)*Math.pow(2,i),a=a+m):(c=e*Math.pow(2,m-1)*Math.pow(2,i),a=0));i>=8;t[r+f]=c&255,f+=y,c/=256,i-=8);for(a=a<<i|c,l+=i;l>0;t[r+f]=a&255,f+=y,a/=256,l-=8);t[r+f-y]|=X*128}var Lt={}.toString,tr=Array.isArray||function(t){return Lt.call(t)=="[object Array]"};var vt=50;p.TYPED_ARRAY_SUPPORT=globalThis.TYPED_ARRAY_SUPPORT!==void 0?globalThis.TYPED_ARRAY_SUPPORT:!0;var jn=ie();function ie(){return p.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function B(t,e){if(ie()<e)throw new RangeError("Invalid typed array length");return p.TYPED_ARRAY_SUPPORT?(t=new Uint8Array(e),t.__proto__=p.prototype):(t===null&&(t=new p(e)),t.length=e),t}function p(t,e,r){if(!p.TYPED_ARRAY_SUPPORT&&!(this instanceof p))return new p(t,e,r);if(typeof t=="number"){if(typeof e=="string")throw new Error("If encoding is specified then the first argument must be a string");return xe(this,t)}return nr(this,t,e,r)}p.poolSize=8192;p._augment=function(t){return t.__proto__=p.prototype,t};function nr(t,e,r,n){if(typeof e=="number")throw new TypeError('"value" argument must not be a number');return typeof ArrayBuffer<"u"&&e instanceof ArrayBuffer?Yt(t,e,r,n):typeof e=="string"?Wt(t,e,r):Gt(t,e)}p.from=function(t,e,r){return nr(null,t,e,r)};p.TYPED_ARRAY_SUPPORT&&(p.prototype.__proto__=Uint8Array.prototype,p.__proto__=Uint8Array);function ir(t){if(typeof t!="number")throw new TypeError('"size" argument must be a number');if(t<0)throw new RangeError('"size" argument must not be negative')}function Ft(t,e,r,n){return ir(e),e<=0?B(t,e):r!==void 0?typeof n=="string"?B(t,e).fill(r,n):B(t,e).fill(r):B(t,e)}p.alloc=function(t,e,r){return Ft(null,t,e,r)};function xe(t,e){if(ir(e),t=B(t,e<0?0:Ae(e)|0),!p.TYPED_ARRAY_SUPPORT)for(var r=0;r<e;++r)t[r]=0;return t}p.allocUnsafe=function(t){return xe(null,t)};p.allocUnsafeSlow=function(t){return xe(null,t)};function Wt(t,e,r){if((typeof r!="string"||r==="")&&(r="utf8"),!p.isEncoding(r))throw new TypeError('"encoding" must be a valid string encoding');var n=or(e,r)|0;t=B(t,n);var i=t.write(e,r);return i!==n&&(t=t.slice(0,i)),t}function be(t,e){var r=e.length<0?0:Ae(e.length)|0;t=B(t,r);for(var n=0;n<r;n+=1)t[n]=e[n]&255;return t}function Yt(t,e,r,n){if(e.byteLength,r<0||e.byteLength<r)throw new RangeError("'offset' is out of bounds");if(e.byteLength<r+(n||0))throw new RangeError("'length' is out of bounds");return r===void 0&&n===void 0?e=new Uint8Array(e):n===void 0?e=new Uint8Array(e,r):e=new Uint8Array(e,r,n),p.TYPED_ARRAY_SUPPORT?(t=e,t.__proto__=p.prototype):t=be(t,e),t}function Gt(t,e){if(R(e)){var r=Ae(e.length)|0;return t=B(t,r),t.length===0||e.copy(t,0,0,r),t}if(e){if(typeof ArrayBuffer<"u"&&e.buffer instanceof ArrayBuffer||"length"in e)return typeof e.length!="number"||cn(e.length)?B(t,0):be(t,e);if(e.type==="Buffer"&&tr(e.data))return be(t,e.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function Ae(t){if(t>=ie())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+ie().toString(16)+" bytes");return t|0}p.isBuffer=un;function R(t){return!!(t!=null&&t._isBuffer)}p.compare=function(e,r){if(!R(e)||!R(r))throw new TypeError("Arguments must be Buffers");if(e===r)return 0;for(var n=e.length,i=r.length,o=0,a=Math.min(n,i);o<a;++o)if(e[o]!==r[o]){n=e[o],i=r[o];break}return n<i?-1:i<n?1:0};p.isEncoding=function(e){switch(String(e).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}};p.concat=function(e,r){if(!tr(e))throw new TypeError('"list" argument must be an Array of Buffers');if(e.length===0)return p.alloc(0);var n;if(r===void 0)for(r=0,n=0;n<e.length;++n)r+=e[n].length;var i=p.allocUnsafe(r),o=0;for(n=0;n<e.length;++n){var a=e[n];if(!R(a))throw new TypeError('"list" argument must be an Array of Buffers');a.copy(i,o),o+=a.length}return i};function or(t,e){if(R(t))return t.length;if(typeof ArrayBuffer<"u"&&typeof ArrayBuffer.isView=="function"&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;typeof t!="string"&&(t=""+t);var r=t.length;if(r===0)return 0;for(var n=!1;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":case void 0:return oe(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return r*2;case"hex":return r>>>1;case"base64":return mr(t).length;default:if(n)return oe(t).length;e=(""+e).toLowerCase(),n=!0}}p.byteLength=or;function Kt(t,e,r){var n=!1;if((e===void 0||e<0)&&(e=0),e>this.length||((r===void 0||r>this.length)&&(r=this.length),r<=0)||(r>>>=0,e>>>=0,r<=e))return"";for(t||(t="utf8");;)switch(t){case"hex":return Zt(this,e,r);case"utf8":case"utf-8":return cr(this,e,r);case"ascii":return jt(this,e,r);case"latin1":case"binary":return Qt(this,e,r);case"base64":return Xt(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return en(this,e,r);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}p.prototype._isBuffer=!0;function Y(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}p.prototype.swap16=function(){var e=this.length;if(e%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var r=0;r<e;r+=2)Y(this,r,r+1);return this};p.prototype.swap32=function(){var e=this.length;if(e%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var r=0;r<e;r+=4)Y(this,r,r+3),Y(this,r+1,r+2);return this};p.prototype.swap64=function(){var e=this.length;if(e%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var r=0;r<e;r+=8)Y(this,r,r+7),Y(this,r+1,r+6),Y(this,r+2,r+5),Y(this,r+3,r+4);return this};p.prototype.toString=function(){var e=this.length|0;return e===0?"":arguments.length===0?cr(this,0,e):Kt.apply(this,arguments)};p.prototype.equals=function(e){if(!R(e))throw new TypeError("Argument must be a Buffer");return this===e?!0:p.compare(this,e)===0};p.prototype.inspect=function(){var e="",r=vt;return this.length>0&&(e=this.toString("hex",0,r).match(/.{2}/g).join(" "),this.length>r&&(e+=" ... ")),"<Buffer "+e+">"};p.prototype.compare=function(e,r,n,i,o){if(!R(e))throw new TypeError("Argument must be a Buffer");if(r===void 0&&(r=0),n===void 0&&(n=e?e.length:0),i===void 0&&(i=0),o===void 0&&(o=this.length),r<0||n>e.length||i<0||o>this.length)throw new RangeError("out of range index");if(i>=o&&r>=n)return 0;if(i>=o)return-1;if(r>=n)return 1;if(r>>>=0,n>>>=0,i>>>=0,o>>>=0,this===e)return 0;for(var a=o-i,c=n-r,d=Math.min(a,c),l=this.slice(i,o),g=e.slice(r,n),m=0;m<d;++m)if(l[m]!==g[m]){a=l[m],c=g[m];break}return a<c?-1:c<a?1:0};function ar(t,e,r,n,i){if(t.length===0)return-1;if(typeof r=="string"?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,isNaN(r)&&(r=i?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(i)return-1;r=t.length-1}else if(r<0)if(i)r=0;else return-1;if(typeof e=="string"&&(e=p.from(e,n)),R(e))return e.length===0?-1:Qe(t,e,r,n,i);if(typeof e=="number")return e=e&255,p.TYPED_ARRAY_SUPPORT&&typeof Uint8Array.prototype.indexOf=="function"?i?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):Qe(t,[e],r,n,i);throw new TypeError("val must be string, number or Buffer")}function Qe(t,e,r,n,i){var o=1,a=t.length,c=e.length;if(n!==void 0&&(n=String(n).toLowerCase(),n==="ucs2"||n==="ucs-2"||n==="utf16le"||n==="utf-16le")){if(t.length<2||e.length<2)return-1;o=2,a/=2,c/=2,r/=2}function d(f,y){return o===1?f[y]:f.readUInt16BE(y*o)}var l;if(i){var g=-1;for(l=r;l<a;l++)if(d(t,l)===d(e,g===-1?0:l-g)){if(g===-1&&(g=l),l-g+1===c)return g*o}else g!==-1&&(l-=l-g),g=-1}else for(r+c>a&&(r=a-c),l=r;l>=0;l--){for(var m=!0,b=0;b<c;b++)if(d(t,l+b)!==d(e,b)){m=!1;break}if(m)return l}return-1}p.prototype.includes=function(e,r,n){return this.indexOf(e,r,n)!==-1};p.prototype.indexOf=function(e,r,n){return ar(this,e,r,n,!0)};p.prototype.lastIndexOf=function(e,r,n){return ar(this,e,r,n,!1)};function Ht(t,e,r,n){r=Number(r)||0;var i=t.length-r;n?(n=Number(n),n>i&&(n=i)):n=i;var o=e.length;if(o%2!==0)throw new TypeError("Invalid hex string");n>o/2&&(n=o/2);for(var a=0;a<n;++a){var c=parseInt(e.substr(a*2,2),16);if(isNaN(c))return a;t[r+a]=c}return a}function Vt(t,e,r,n){return ue(oe(e,t.length-r),t,r,n)}function sr(t,e,r,n){return ue(an(e),t,r,n)}function $t(t,e,r,n){return sr(t,e,r,n)}function zt(t,e,r,n){return ue(mr(e),t,r,n)}function qt(t,e,r,n){return ue(sn(e,t.length-r),t,r,n)}p.prototype.write=function(e,r,n,i){if(r===void 0)i="utf8",n=this.length,r=0;else if(n===void 0&&typeof r=="string")i=r,n=this.length,r=0;else if(isFinite(r))r=r|0,isFinite(n)?(n=n|0,i===void 0&&(i="utf8")):(i=n,n=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var o=this.length-r;if((n===void 0||n>o)&&(n=o),e.length>0&&(n<0||r<0)||r>this.length)throw new RangeError("Attempt to write outside buffer bounds");i||(i="utf8");for(var a=!1;;)switch(i){case"hex":return Ht(this,e,r,n);case"utf8":case"utf-8":return Vt(this,e,r,n);case"ascii":return sr(this,e,r,n);case"latin1":case"binary":return $t(this,e,r,n);case"base64":return zt(this,e,r,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return qt(this,e,r,n);default:if(a)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),a=!0}};p.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function Xt(t,e,r){return e===0&&r===t.length?je(t):je(t.slice(e,r))}function cr(t,e,r){r=Math.min(t.length,r);for(var n=[],i=e;i<r;){var o=t[i],a=null,c=o>239?4:o>223?3:o>191?2:1;if(i+c<=r){var d,l,g,m;switch(c){case 1:o<128&&(a=o);break;case 2:d=t[i+1],(d&192)===128&&(m=(o&31)<<6|d&63,m>127&&(a=m));break;case 3:d=t[i+1],l=t[i+2],(d&192)===128&&(l&192)===128&&(m=(o&15)<<12|(d&63)<<6|l&63,m>2047&&(m<55296||m>57343)&&(a=m));break;case 4:d=t[i+1],l=t[i+2],g=t[i+3],(d&192)===128&&(l&192)===128&&(g&192)===128&&(m=(o&15)<<18|(d&63)<<12|(l&63)<<6|g&63,m>65535&&m<1114112&&(a=m))}}a===null?(a=65533,c=1):a>65535&&(a-=65536,n.push(a>>>10&1023|55296),a=56320|a&1023),n.push(a),i+=c}return Jt(n)}var Ze=4096;function Jt(t){var e=t.length;if(e<=Ze)return String.fromCharCode.apply(String,t);for(var r="",n=0;n<e;)r+=String.fromCharCode.apply(String,t.slice(n,n+=Ze));return r}function jt(t,e,r){var n="";r=Math.min(t.length,r);for(var i=e;i<r;++i)n+=String.fromCharCode(t[i]&127);return n}function Qt(t,e,r){var n="";r=Math.min(t.length,r);for(var i=e;i<r;++i)n+=String.fromCharCode(t[i]);return n}function Zt(t,e,r){var n=t.length;(!e||e<0)&&(e=0),(!r||r<0||r>n)&&(r=n);for(var i="",o=e;o<r;++o)i+=on(t[o]);return i}function en(t,e,r){for(var n=t.slice(e,r),i="",o=0;o<n.length;o+=2)i+=String.fromCharCode(n[o]+n[o+1]*256);return i}p.prototype.slice=function(e,r){var n=this.length;e=~~e,r=r===void 0?n:~~r,e<0?(e+=n,e<0&&(e=0)):e>n&&(e=n),r<0?(r+=n,r<0&&(r=0)):r>n&&(r=n),r<e&&(r=e);var i;if(p.TYPED_ARRAY_SUPPORT)i=this.subarray(e,r),i.__proto__=p.prototype;else{var o=r-e;i=new p(o,void 0);for(var a=0;a<o;++a)i[a]=this[a+e]}return i};function x(t,e,r){if(t%1!==0||t<0)throw new RangeError("offset is not uint");if(t+e>r)throw new RangeError("Trying to access beyond buffer length")}p.prototype.readUIntLE=function(e,r,n){e=e|0,r=r|0,n||x(e,r,this.length);for(var i=this[e],o=1,a=0;++a<r&&(o*=256);)i+=this[e+a]*o;return i};p.prototype.readUIntBE=function(e,r,n){e=e|0,r=r|0,n||x(e,r,this.length);for(var i=this[e+--r],o=1;r>0&&(o*=256);)i+=this[e+--r]*o;return i};p.prototype.readUInt8=function(e,r){return r||x(e,1,this.length),this[e]};p.prototype.readUInt16LE=function(e,r){return r||x(e,2,this.length),this[e]|this[e+1]<<8};p.prototype.readUInt16BE=function(e,r){return r||x(e,2,this.length),this[e]<<8|this[e+1]};p.prototype.readUInt32LE=function(e,r){return r||x(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+this[e+3]*16777216};p.prototype.readUInt32BE=function(e,r){return r||x(e,4,this.length),this[e]*16777216+(this[e+1]<<16|this[e+2]<<8|this[e+3])};p.prototype.readIntLE=function(e,r,n){e=e|0,r=r|0,n||x(e,r,this.length);for(var i=this[e],o=1,a=0;++a<r&&(o*=256);)i+=this[e+a]*o;return o*=128,i>=o&&(i-=Math.pow(2,8*r)),i};p.prototype.readIntBE=function(e,r,n){e=e|0,r=r|0,n||x(e,r,this.length);for(var i=r,o=1,a=this[e+--i];i>0&&(o*=256);)a+=this[e+--i]*o;return o*=128,a>=o&&(a-=Math.pow(2,8*r)),a};p.prototype.readInt8=function(e,r){return r||x(e,1,this.length),this[e]&128?(255-this[e]+1)*-1:this[e]};p.prototype.readInt16LE=function(e,r){r||x(e,2,this.length);var n=this[e]|this[e+1]<<8;return n&32768?n|4294901760:n};p.prototype.readInt16BE=function(e,r){r||x(e,2,this.length);var n=this[e+1]|this[e]<<8;return n&32768?n|4294901760:n};p.prototype.readInt32LE=function(e,r){return r||x(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24};p.prototype.readInt32BE=function(e,r){return r||x(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]};p.prototype.readFloatLE=function(e,r){return r||x(e,4,this.length),ae(this,e,!0,23,4)};p.prototype.readFloatBE=function(e,r){return r||x(e,4,this.length),ae(this,e,!1,23,4)};p.prototype.readDoubleLE=function(e,r){return r||x(e,8,this.length),ae(this,e,!0,52,8)};p.prototype.readDoubleBE=function(e,r){return r||x(e,8,this.length),ae(this,e,!1,52,8)};function T(t,e,r,n,i,o){if(!R(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>i||e<o)throw new RangeError('"value" argument is out of bounds');if(r+n>t.length)throw new RangeError("Index out of range")}p.prototype.writeUIntLE=function(e,r,n,i){if(e=+e,r=r|0,n=n|0,!i){var o=Math.pow(2,8*n)-1;T(this,e,r,n,o,0)}var a=1,c=0;for(this[r]=e&255;++c<n&&(a*=256);)this[r+c]=e/a&255;return r+n};p.prototype.writeUIntBE=function(e,r,n,i){if(e=+e,r=r|0,n=n|0,!i){var o=Math.pow(2,8*n)-1;T(this,e,r,n,o,0)}var a=n-1,c=1;for(this[r+a]=e&255;--a>=0&&(c*=256);)this[r+a]=e/c&255;return r+n};p.prototype.writeUInt8=function(e,r,n){return e=+e,r=r|0,n||T(this,e,r,1,255,0),p.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[r]=e&255,r+1};function se(t,e,r,n){e<0&&(e=65535+e+1);for(var i=0,o=Math.min(t.length-r,2);i<o;++i)t[r+i]=(e&255<<8*(n?i:1-i))>>>(n?i:1-i)*8}p.prototype.writeUInt16LE=function(e,r,n){return e=+e,r=r|0,n||T(this,e,r,2,65535,0),p.TYPED_ARRAY_SUPPORT?(this[r]=e&255,this[r+1]=e>>>8):se(this,e,r,!0),r+2};p.prototype.writeUInt16BE=function(e,r,n){return e=+e,r=r|0,n||T(this,e,r,2,65535,0),p.TYPED_ARRAY_SUPPORT?(this[r]=e>>>8,this[r+1]=e&255):se(this,e,r,!1),r+2};function ce(t,e,r,n){e<0&&(e=4294967295+e+1);for(var i=0,o=Math.min(t.length-r,4);i<o;++i)t[r+i]=e>>>(n?i:3-i)*8&255}p.prototype.writeUInt32LE=function(e,r,n){return e=+e,r=r|0,n||T(this,e,r,4,4294967295,0),p.TYPED_ARRAY_SUPPORT?(this[r+3]=e>>>24,this[r+2]=e>>>16,this[r+1]=e>>>8,this[r]=e&255):ce(this,e,r,!0),r+4};p.prototype.writeUInt32BE=function(e,r,n){return e=+e,r=r|0,n||T(this,e,r,4,4294967295,0),p.TYPED_ARRAY_SUPPORT?(this[r]=e>>>24,this[r+1]=e>>>16,this[r+2]=e>>>8,this[r+3]=e&255):ce(this,e,r,!1),r+4};p.prototype.writeIntLE=function(e,r,n,i){if(e=+e,r=r|0,!i){var o=Math.pow(2,8*n-1);T(this,e,r,n,o-1,-o)}var a=0,c=1,d=0;for(this[r]=e&255;++a<n&&(c*=256);)e<0&&d===0&&this[r+a-1]!==0&&(d=1),this[r+a]=(e/c>>0)-d&255;return r+n};p.prototype.writeIntBE=function(e,r,n,i){if(e=+e,r=r|0,!i){var o=Math.pow(2,8*n-1);T(this,e,r,n,o-1,-o)}var a=n-1,c=1,d=0;for(this[r+a]=e&255;--a>=0&&(c*=256);)e<0&&d===0&&this[r+a+1]!==0&&(d=1),this[r+a]=(e/c>>0)-d&255;return r+n};p.prototype.writeInt8=function(e,r,n){return e=+e,r=r|0,n||T(this,e,r,1,127,-128),p.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[r]=e&255,r+1};p.prototype.writeInt16LE=function(e,r,n){return e=+e,r=r|0,n||T(this,e,r,2,32767,-32768),p.TYPED_ARRAY_SUPPORT?(this[r]=e&255,this[r+1]=e>>>8):se(this,e,r,!0),r+2};p.prototype.writeInt16BE=function(e,r,n){return e=+e,r=r|0,n||T(this,e,r,2,32767,-32768),p.TYPED_ARRAY_SUPPORT?(this[r]=e>>>8,this[r+1]=e&255):se(this,e,r,!1),r+2};p.prototype.writeInt32LE=function(e,r,n){return e=+e,r=r|0,n||T(this,e,r,4,2147483647,-2147483648),p.TYPED_ARRAY_SUPPORT?(this[r]=e&255,this[r+1]=e>>>8,this[r+2]=e>>>16,this[r+3]=e>>>24):ce(this,e,r,!0),r+4};p.prototype.writeInt32BE=function(e,r,n){return e=+e,r=r|0,n||T(this,e,r,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),p.TYPED_ARRAY_SUPPORT?(this[r]=e>>>24,this[r+1]=e>>>16,this[r+2]=e>>>8,this[r+3]=e&255):ce(this,e,r,!1),r+4};function ur(t,e,r,n,i,o){if(r+n>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function pr(t,e,r,n,i){return i||ur(t,e,r,4),rr(t,e,r,n,23,4),r+4}p.prototype.writeFloatLE=function(e,r,n){return pr(this,e,r,!0,n)};p.prototype.writeFloatBE=function(e,r,n){return pr(this,e,r,!1,n)};function dr(t,e,r,n,i){return i||ur(t,e,r,8),rr(t,e,r,n,52,8),r+8}p.prototype.writeDoubleLE=function(e,r,n){return dr(this,e,r,!0,n)};p.prototype.writeDoubleBE=function(e,r,n){return dr(this,e,r,!1,n)};p.prototype.copy=function(e,r,n,i){if(n||(n=0),!i&&i!==0&&(i=this.length),r>=e.length&&(r=e.length),r||(r=0),i>0&&i<n&&(i=n),i===n||e.length===0||this.length===0)return 0;if(r<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("sourceStart out of bounds");if(i<0)throw new RangeError("sourceEnd out of bounds");i>this.length&&(i=this.length),e.length-r<i-n&&(i=e.length-r+n);var o=i-n,a;if(this===e&&n<r&&r<i)for(a=o-1;a>=0;--a)e[a+r]=this[a+n];else if(o<1e3||!p.TYPED_ARRAY_SUPPORT)for(a=0;a<o;++a)e[a+r]=this[a+n];else Uint8Array.prototype.set.call(e,this.subarray(n,n+o),r);return o};p.prototype.fill=function(e,r,n,i){if(typeof e=="string"){if(typeof r=="string"?(i=r,r=0,n=this.length):typeof n=="string"&&(i=n,n=this.length),e.length===1){var o=e.charCodeAt(0);o<256&&(e=o)}if(i!==void 0&&typeof i!="string")throw new TypeError("encoding must be a string");if(typeof i=="string"&&!p.isEncoding(i))throw new TypeError("Unknown encoding: "+i)}else typeof e=="number"&&(e=e&255);if(r<0||this.length<r||this.length<n)throw new RangeError("Out of range index");if(n<=r)return this;r=r>>>0,n=n===void 0?this.length:n>>>0,e||(e=0);var a;if(typeof e=="number")for(a=r;a<n;++a)this[a]=e;else{var c=R(e)?e:oe(new p(e,i).toString()),d=c.length;for(a=0;a<n-r;++a)this[a+r]=c[a%d]}return this};var rn=/[^+\/0-9A-Za-z-_]/g;function tn(t){if(t=nn(t).replace(rn,""),t.length<2)return"";for(;t.length%4!==0;)t=t+"=";return t}function nn(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}function on(t){return t<16?"0"+t.toString(16):t.toString(16)}function oe(t,e){e=e||1/0;for(var r,n=t.length,i=null,o=[],a=0;a<n;++a){if(r=t.charCodeAt(a),r>55295&&r<57344){if(!i){if(r>56319){(e-=3)>-1&&o.push(239,191,189);continue}else if(a+1===n){(e-=3)>-1&&o.push(239,191,189);continue}i=r;continue}if(r<56320){(e-=3)>-1&&o.push(239,191,189),i=r;continue}r=(i-55296<<10|r-56320)+65536}else i&&(e-=3)>-1&&o.push(239,191,189);if(i=null,r<128){if((e-=1)<0)break;o.push(r)}else if(r<2048){if((e-=2)<0)break;o.push(r>>6|192,r&63|128)}else if(r<65536){if((e-=3)<0)break;o.push(r>>12|224,r>>6&63|128,r&63|128)}else if(r<1114112){if((e-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,r&63|128)}else throw new Error("Invalid code point")}return o}function an(t){for(var e=[],r=0;r<t.length;++r)e.push(t.charCodeAt(r)&255);return e}function sn(t,e){for(var r,n,i,o=[],a=0;a<t.length&&!((e-=2)<0);++a)r=t.charCodeAt(a),n=r>>8,i=r%256,o.push(i),o.push(n);return o}function mr(t){return Pt(tn(t))}function ue(t,e,r,n){for(var i=0;i<n&&!(i+r>=e.length||i>=t.length);++i)e[i+r]=t[i];return i}function cn(t){return t!==t}function un(t){return t!=null&&(!!t._isBuffer||lr(t)||pn(t))}function lr(t){return!!t.constructor&&typeof t.constructor.isBuffer=="function"&&t.constructor.isBuffer(t)}function pn(t){return typeof t.readFloatLE=="function"&&typeof t.slice=="function"&&lr(t.slice(0,0))}import{encodeAddress as dn,decodeAddress as pi}from"algosdk";function P(t){return t.reduce((e,r)=>Uint8Array.from([...e,...r]))}function ye(t){return new Uint8Array(p.from(t))}function gr(t){return p.from(t).toString("utf-8")}function fr(t){return p.from(t).toString("base64")}function Ie(t){return p.from(t,"base64")}import mn from"bignumber.js";mn.config({DECIMAL_PLACES:40,EXPONENTIAL_AT:45});var Ni=`{"theme1":{"value":"${u.env.FRONTEND_URL}/Theme%3DDark.svg","active":true},"theme2":{"value":"${u.env.FRONTEND_URL}/Theme%3DLight.svg","active":true},"theme3":{"value":"${u.env.FRONTEND_URL}/Theme%3DLight.svg","active":true}}`;var br={V1_1:"v1_1",V2:"v2"},Bi={[br.V1_1]:{testnet:62368684,mainnet:552635992},[br.V2]:{testnet:148607e3,mainnet:1002541853}};var hr=t=>fn.decodeAddress(t.toUpperCase()).publicKey;import*as A from"ethereumjs-util";function Te(t){let e=A.fromSigned(s.from(t));return BigInt(e.toString())}function hn(t){return A.toUnsigned(new A.BN(String(t)))}function $(t){let e=hn(t);if(e.length>32)throw new Error("Invalid value. The buffer length of the value is more than 32");return new Uint8Array(A.setLengthLeft(e,32))}var xr=t=>{if(t.length!==32)throw new Error("Invalid address bytes. The address buffer length is not equel 32");let e=s.from(t).toString("hex");if(e.slice(0,24)!=="000000000000000000000000")throw console.log("normalizedAddress",e),new Error("Invalid normalized address");let r="0x"+e.slice(-40);if(!An(r))throw new Error("Invalid hex address");return r},Ar=t=>new Uint8Array(A.setLengthLeft(pe(t),32)),pe=t=>s.from(xn(t),"hex"),xn=t=>t.startsWith("0x")?t.slice(2):t,An=t=>A.isValidAddress(t);var Ee=t=>new Uint8Array(A.keccak256(s.from(t)));import L from"algosdk";import*as Ce from"bs58";import ko from"algosdk";import Yo from"algosdk";import ya from"algosdk";var jo={SMALLESTUNIT:u.env.SMALLEST_UNIT},Qo={SMALLEST_UNITS:u.env.SMALLEST_UNIT};var na=["point-system.discordEnabled","point-system.telegramBotName","point-system.telegramBotId","point-system.telegramEnabled","point-system.telegramGroupId","point-system.telegramGroupName","point-system.twitterAccountId","point-system.twitterAccountName","point-system.twitterEnabled","point-system.twitterJobEnabled","point-system.guideLink"];var Tr=t=>`By signing this message, you confirm that the wallet is a trusted one ${t}; Data: `;import Bc from"algosdk";var Er=(i=>(i.GLOBAL_PAIR_DELISTING="GLOBAL_PAIR_DELISTING",i.GLOBAL_NEW_PAIR_LISTING="GLOBAL_NEW_PAIR_LISTING",i.GLOBAL_SYSTEM_MAINTENANCE="GLOBAL_SYSTEM_MAINTENANCE",i.GLOBAL_SMART_CONTRACT_UPDATE="GLOBAL_SMART_CONTRACT_UPDATE",i))(Er||{}),_r=(n=>(n.ACCOUNT_POINTS_UNLOCK_ACHIEVEMENT="ACCOUNT_POINTS_UNLOCK_ACHIEVEMENT",n.ACCOUNT_KYC_STATUS_CHANGED="ACCOUNT_KYC_STATUS_CHANGED",n.ACCOUNT_AFFILIATE_DASHBOARD_UNLOCKED="ACCOUNT_AFFILIATE_DASHBOARD_UNLOCKED",n))(_r||{}),Ds={...Er,..._r};import zc from"algosdk";var E=(t,e,r)=>{switch(e){case"8B":return L.encodeUint64(Number(t));case"32B":return $(t);case"str":return ye(String(t));case"address":return G(String(t),r);case"token":return wr(String(t),r);case"float":{var n=s.alloc(8);return n.writeDoubleBE(Number(t),0),new Uint8Array(n)}case"bool":return new Uint8Array(s.from(L.encodeUint64(Number(t))).subarray(-1));case"2B":return new Uint8Array(s.from(L.encodeUint64(Number(t))).subarray(-2));case"4B":return new Uint8Array(s.from(L.encodeUint64(Number(t))).subarray(-4));default:return s.from(t.toString())}},C=(t,e,r)=>{switch(e){case"8B":return L.decodeUint64(t,"safe");case"32B":return Te(t);case"str":return gr(t);case"address":return Cr(t,r);case"token":return Dn(t,r);case"float":return s.from(t).readDoubleBE(0);case"bool":case"2B":return C(t,"8B");default:return s.from(t).toString()}};var Cr=(t,e)=>e===8?L.encodeAddress(t):e===1?Ce.encode(t):xr(t),Dn=(t,e)=>{let r=s.from(t).toString("hex");return r.startsWith("0x")||(r="0x"+r),V[r]?r:e===8?String(Te(t)):e===1?Ce.encode(t):Cr(t,e)};var wr=(t,e)=>e===8?$(+t):V[t]?new Uint8Array(pe(String(t))):G(String(t),e);var Se=(t,e,r,n)=>{let i=G(t,e),o=L.encodeUint64(e),a=L.encodeUint64(n),c=wr(r,n);return P([i,o,c,a])};var we=(t,e)=>P([Nn(t),Sr(e)]),Nn=t=>new Uint8Array(s.from(t+`
|
|
2
|
-
`,"utf-8")),Sr=t=>new Uint8Array(s.from(fr(t)));var de=t=>s.from(Ee(t)).toString("hex");var z=(t,e,r)=>{let n=s.from(t,e),
|
|
1
|
+
function Ne(){throw new Error("setTimeout has not been defined")}function Oe(){throw new Error("clearTimeout has not been defined")}var U=Ne,M=Oe;typeof globalThis.setTimeout=="function"&&(U=setTimeout);typeof globalThis.clearTimeout=="function"&&(M=clearTimeout);function ke(t){if(U===setTimeout)return setTimeout(t,0);if((U===Ne||!U)&&setTimeout)return U=setTimeout,setTimeout(t,0);try{return U(t,0)}catch{try{return U.call(null,t,0)}catch{return U.call(this,t,0)}}}function Or(t){if(M===clearTimeout)return clearTimeout(t);if((M===Oe||!M)&&clearTimeout)return M=clearTimeout,clearTimeout(t);try{return M(t)}catch{try{return M.call(null,t)}catch{return M.call(this,t)}}}var O=[],H=!1,v,j=-1;function kr(){!H||!v||(H=!1,v.length?O=v.concat(O):j=-1,O.length&&Pe())}function Pe(){if(!H){var t=ke(kr);H=!0;for(var e=O.length;e;){for(v=O,O=[];++j<e;)v&&v[j].run();j=-1,e=O.length}v=null,H=!1,Or(t)}}function Pr(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)e[r-1]=arguments[r];O.push(new Be(t,e)),O.length===1&&!H&&ke(Pe)}function Be(t,e){this.fun=t,this.array=e}Be.prototype.run=function(){this.fun.apply(null,this.array)};var Br="browser",Ur="browser",Mr=!0,Lr={},vr=[],Fr="",Wr={},Yr={},Gr={};function F(){}var Kr=F,Hr=F,Vr=F,$r=F,zr=F,Xr=F,qr=F;function Jr(t){throw new Error("process.binding is not supported")}function jr(){return"/"}function Qr(t){throw new Error("process.chdir is not supported")}function Zr(){return 0}var K=globalThis.performance||{},et=K.now||K.mozNow||K.msNow||K.oNow||K.webkitNow||function(){return new Date().getTime()};function rt(t){var e=et.call(K)*.001,r=Math.floor(e),n=Math.floor(e%1*1e9);return t&&(r=r-t[0],n=n-t[1],n<0&&(r--,n+=1e9)),[r,n]}var tt=new Date;function nt(){var t=new Date,e=t-tt;return e/1e3}var c={nextTick:Pr,title:Br,browser:Mr,env:Lr,argv:vr,version:Fr,versions:Wr,on:Kr,addListener:Hr,once:Vr,off:$r,removeListener:zr,removeAllListeners:Xr,emit:qr,binding:Jr,cwd:jr,chdir:Qr,umask:Zr,hrtime:rt,platform:Ur,release:Yr,config:Gr,uptime:nt},Re={};Object.keys(Re).forEach(t=>{let e=t.split("."),r=c;for(let n=0;n<e.length;n++){let o=e[n];n===e.length-1?r[o]=Re[t]:r=r[o]||(r[o]={})}});var D=[],_=[],ot=typeof Uint8Array<"u"?Uint8Array:Array,le=!1;function ve(){le=!0;for(var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",e=0,r=t.length;e<r;++e)D[e]=t[e],_[t.charCodeAt(e)]=e;_[45]=62,_[95]=63}function it(t){le||ve();var e,r,n,o,i,a,u=t.length;if(u%4>0)throw new Error("Invalid string. Length must be a multiple of 4");i=t[u-2]==="="?2:t[u-1]==="="?1:0,a=new ot(u*3/4-i),n=i>0?u-4:u;var d=0;for(e=0,r=0;e<n;e+=4,r+=3)o=_[t.charCodeAt(e)]<<18|_[t.charCodeAt(e+1)]<<12|_[t.charCodeAt(e+2)]<<6|_[t.charCodeAt(e+3)],a[d++]=o>>16&255,a[d++]=o>>8&255,a[d++]=o&255;return i===2?(o=_[t.charCodeAt(e)]<<2|_[t.charCodeAt(e+1)]>>4,a[d++]=o&255):i===1&&(o=_[t.charCodeAt(e)]<<10|_[t.charCodeAt(e+1)]<<4|_[t.charCodeAt(e+2)]>>2,a[d++]=o>>8&255,a[d++]=o&255),a}function at(t){return D[t>>18&63]+D[t>>12&63]+D[t>>6&63]+D[t&63]}function st(t,e,r){for(var n,o=[],i=e;i<r;i+=3)n=(t[i]<<16)+(t[i+1]<<8)+t[i+2],o.push(at(n));return o.join("")}function Ue(t){le||ve();for(var e,r=t.length,n=r%3,o="",i=[],a=16383,u=0,d=r-n;u<d;u+=a)i.push(st(t,u,u+a>d?d:u+a));return n===1?(e=t[r-1],o+=D[e>>2],o+=D[e<<4&63],o+="=="):n===2&&(e=(t[r-2]<<8)+t[r-1],o+=D[e>>10],o+=D[e>>4&63],o+=D[e<<2&63],o+="="),i.push(o),i.join("")}s.TYPED_ARRAY_SUPPORT=globalThis.TYPED_ARRAY_SUPPORT!==void 0?globalThis.TYPED_ARRAY_SUPPORT:!0;function Q(){return s.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function k(t,e){if(Q()<e)throw new RangeError("Invalid typed array length");return s.TYPED_ARRAY_SUPPORT?(t=new Uint8Array(e),t.__proto__=s.prototype):(t===null&&(t=new s(e)),t.length=e),t}function s(t,e,r){if(!s.TYPED_ARRAY_SUPPORT&&!(this instanceof s))return new s(t,e,r);if(typeof t=="number"){if(typeof e=="string")throw new Error("If encoding is specified then the first argument must be a string");return ge(this,t)}return Fe(this,t,e,r)}s.poolSize=8192;s._augment=function(t){return t.__proto__=s.prototype,t};function Fe(t,e,r,n){if(typeof e=="number")throw new TypeError('"value" argument must not be a number');return typeof ArrayBuffer<"u"&&e instanceof ArrayBuffer?pt(t,e,r,n):typeof e=="string"?ut(t,e,r):dt(t,e)}s.from=function(t,e,r){return Fe(null,t,e,r)};s.kMaxLength=Q();s.TYPED_ARRAY_SUPPORT&&(s.prototype.__proto__=Uint8Array.prototype,s.__proto__=Uint8Array,typeof Symbol<"u"&&Symbol.species&&s[Symbol.species]);function We(t){if(typeof t!="number")throw new TypeError('"size" argument must be a number');if(t<0)throw new RangeError('"size" argument must not be negative')}function ct(t,e,r,n){return We(e),e<=0?k(t,e):r!==void 0?typeof n=="string"?k(t,e).fill(r,n):k(t,e).fill(r):k(t,e)}s.alloc=function(t,e,r){return ct(null,t,e,r)};function ge(t,e){if(We(e),t=k(t,e<0?0:fe(e)|0),!s.TYPED_ARRAY_SUPPORT)for(var r=0;r<e;++r)t[r]=0;return t}s.allocUnsafe=function(t){return ge(null,t)};s.allocUnsafeSlow=function(t){return ge(null,t)};function ut(t,e,r){if((typeof r!="string"||r==="")&&(r="utf8"),!s.isEncoding(r))throw new TypeError('"encoding" must be a valid string encoding');var n=Ye(e,r)|0;t=k(t,n);var o=t.write(e,r);return o!==n&&(t=t.slice(0,o)),t}function me(t,e){var r=e.length<0?0:fe(e.length)|0;t=k(t,r);for(var n=0;n<r;n+=1)t[n]=e[n]&255;return t}function pt(t,e,r,n){if(e.byteLength,r<0||e.byteLength<r)throw new RangeError("'offset' is out of bounds");if(e.byteLength<r+(n||0))throw new RangeError("'length' is out of bounds");return r===void 0&&n===void 0?e=new Uint8Array(e):n===void 0?e=new Uint8Array(e,r):e=new Uint8Array(e,r,n),s.TYPED_ARRAY_SUPPORT?(t=e,t.__proto__=s.prototype):t=me(t,e),t}function dt(t,e){if(w(e)){var r=fe(e.length)|0;return t=k(t,r),t.length===0||e.copy(t,0,0,r),t}if(e){if(typeof ArrayBuffer<"u"&&e.buffer instanceof ArrayBuffer||"length"in e)return typeof e.length!="number"||Nt(e.length)?k(t,0):me(t,e);if(e.type==="Buffer"&&Array.isArray(e.data))return me(t,e.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function fe(t){if(t>=Q())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+Q().toString(16)+" bytes");return t|0}s.isBuffer=Ot;function w(t){return!!(t!=null&&t._isBuffer)}s.compare=function(e,r){if(!w(e)||!w(r))throw new TypeError("Arguments must be Buffers");if(e===r)return 0;for(var n=e.length,o=r.length,i=0,a=Math.min(n,o);i<a;++i)if(e[i]!==r[i]){n=e[i],o=r[i];break}return n<o?-1:o<n?1:0};s.isEncoding=function(e){switch(String(e).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}};s.concat=function(e,r){if(!Array.isArray(e))throw new TypeError('"list" argument must be an Array of Buffers');if(e.length===0)return s.alloc(0);var n;if(r===void 0)for(r=0,n=0;n<e.length;++n)r+=e[n].length;var o=s.allocUnsafe(r),i=0;for(n=0;n<e.length;++n){var a=e[n];if(!w(a))throw new TypeError('"list" argument must be an Array of Buffers');a.copy(o,i),i+=a.length}return o};function Ye(t,e){if(w(t))return t.length;if(typeof ArrayBuffer<"u"&&typeof ArrayBuffer.isView=="function"&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;typeof t!="string"&&(t=""+t);var r=t.length;if(r===0)return 0;for(var n=!1;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":case void 0:return Z(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return r*2;case"hex":return r>>>1;case"base64":return Xe(t).length;default:if(n)return Z(t).length;e=(""+e).toLowerCase(),n=!0}}s.byteLength=Ye;function mt(t,e,r){var n=!1;if((e===void 0||e<0)&&(e=0),e>this.length||((r===void 0||r>this.length)&&(r=this.length),r<=0)||(r>>>=0,e>>>=0,r<=e))return"";for(t||(t="utf8");;)switch(t){case"hex":return yt(this,e,r);case"utf8":case"utf-8":return He(this,e,r);case"ascii":return It(this,e,r);case"latin1":case"binary":return Tt(this,e,r);case"base64":return ht(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Et(this,e,r);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}s.prototype._isBuffer=!0;function W(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}s.prototype.swap16=function(){var e=this.length;if(e%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var r=0;r<e;r+=2)W(this,r,r+1);return this};s.prototype.swap32=function(){var e=this.length;if(e%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var r=0;r<e;r+=4)W(this,r,r+3),W(this,r+1,r+2);return this};s.prototype.swap64=function(){var e=this.length;if(e%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var r=0;r<e;r+=8)W(this,r,r+7),W(this,r+1,r+6),W(this,r+2,r+5),W(this,r+3,r+4);return this};s.prototype.toString=function(){var e=this.length|0;return e===0?"":arguments.length===0?He(this,0,e):mt.apply(this,arguments)};s.prototype.equals=function(e){if(!w(e))throw new TypeError("Argument must be a Buffer");return this===e?!0:s.compare(this,e)===0};s.prototype.compare=function(e,r,n,o,i){if(!w(e))throw new TypeError("Argument must be a Buffer");if(r===void 0&&(r=0),n===void 0&&(n=e?e.length:0),o===void 0&&(o=0),i===void 0&&(i=this.length),r<0||n>e.length||o<0||i>this.length)throw new RangeError("out of range index");if(o>=i&&r>=n)return 0;if(o>=i)return-1;if(r>=n)return 1;if(r>>>=0,n>>>=0,o>>>=0,i>>>=0,this===e)return 0;for(var a=i-o,u=n-r,d=Math.min(a,u),l=this.slice(o,i),g=e.slice(r,n),m=0;m<d;++m)if(l[m]!==g[m]){a=l[m],u=g[m];break}return a<u?-1:u<a?1:0};function Ge(t,e,r,n,o){if(t.length===0)return-1;if(typeof r=="string"?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,isNaN(r)&&(r=o?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(o)return-1;r=t.length-1}else if(r<0)if(o)r=0;else return-1;if(typeof e=="string"&&(e=s.from(e,n)),w(e))return e.length===0?-1:Me(t,e,r,n,o);if(typeof e=="number")return e=e&255,s.TYPED_ARRAY_SUPPORT&&typeof Uint8Array.prototype.indexOf=="function"?o?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):Me(t,[e],r,n,o);throw new TypeError("val must be string, number or Buffer")}function Me(t,e,r,n,o){var i=1,a=t.length,u=e.length;if(n!==void 0&&(n=String(n).toLowerCase(),n==="ucs2"||n==="ucs-2"||n==="utf16le"||n==="utf-16le")){if(t.length<2||e.length<2)return-1;i=2,a/=2,u/=2,r/=2}function d(f,I){return i===1?f[I]:f.readUInt16BE(I*i)}var l;if(o){var g=-1;for(l=r;l<a;l++)if(d(t,l)===d(e,g===-1?0:l-g)){if(g===-1&&(g=l),l-g+1===u)return g*i}else g!==-1&&(l-=l-g),g=-1}else for(r+u>a&&(r=a-u),l=r;l>=0;l--){for(var m=!0,b=0;b<u;b++)if(d(t,l+b)!==d(e,b)){m=!1;break}if(m)return l}return-1}s.prototype.includes=function(e,r,n){return this.indexOf(e,r,n)!==-1};s.prototype.indexOf=function(e,r,n){return Ge(this,e,r,n,!0)};s.prototype.lastIndexOf=function(e,r,n){return Ge(this,e,r,n,!1)};function lt(t,e,r,n){r=Number(r)||0;var o=t.length-r;n?(n=Number(n),n>o&&(n=o)):n=o;var i=e.length;if(i%2!==0)throw new TypeError("Invalid hex string");n>i/2&&(n=i/2);for(var a=0;a<n;++a){var u=parseInt(e.substr(a*2,2),16);if(isNaN(u))return a;t[r+a]=u}return a}function gt(t,e,r,n){return te(Z(e,t.length-r),t,r,n)}function Ke(t,e,r,n){return te(wt(e),t,r,n)}function ft(t,e,r,n){return Ke(t,e,r,n)}function bt(t,e,r,n){return te(Xe(e),t,r,n)}function xt(t,e,r,n){return te(Rt(e,t.length-r),t,r,n)}s.prototype.write=function(e,r,n,o){if(r===void 0)o="utf8",n=this.length,r=0;else if(n===void 0&&typeof r=="string")o=r,n=this.length,r=0;else if(isFinite(r))r=r|0,isFinite(n)?(n=n|0,o===void 0&&(o="utf8")):(o=n,n=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var i=this.length-r;if((n===void 0||n>i)&&(n=i),e.length>0&&(n<0||r<0)||r>this.length)throw new RangeError("Attempt to write outside buffer bounds");o||(o="utf8");for(var a=!1;;)switch(o){case"hex":return lt(this,e,r,n);case"utf8":case"utf-8":return gt(this,e,r,n);case"ascii":return Ke(this,e,r,n);case"latin1":case"binary":return ft(this,e,r,n);case"base64":return bt(this,e,r,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return xt(this,e,r,n);default:if(a)throw new TypeError("Unknown encoding: "+o);o=(""+o).toLowerCase(),a=!0}};s.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function ht(t,e,r){return e===0&&r===t.length?Ue(t):Ue(t.slice(e,r))}function He(t,e,r){r=Math.min(t.length,r);for(var n=[],o=e;o<r;){var i=t[o],a=null,u=i>239?4:i>223?3:i>191?2:1;if(o+u<=r){var d,l,g,m;switch(u){case 1:i<128&&(a=i);break;case 2:d=t[o+1],(d&192)===128&&(m=(i&31)<<6|d&63,m>127&&(a=m));break;case 3:d=t[o+1],l=t[o+2],(d&192)===128&&(l&192)===128&&(m=(i&15)<<12|(d&63)<<6|l&63,m>2047&&(m<55296||m>57343)&&(a=m));break;case 4:d=t[o+1],l=t[o+2],g=t[o+3],(d&192)===128&&(l&192)===128&&(g&192)===128&&(m=(i&15)<<18|(d&63)<<12|(l&63)<<6|g&63,m>65535&&m<1114112&&(a=m))}}a===null?(a=65533,u=1):a>65535&&(a-=65536,n.push(a>>>10&1023|55296),a=56320|a&1023),n.push(a),o+=u}return At(n)}var Le=4096;function At(t){var e=t.length;if(e<=Le)return String.fromCharCode.apply(String,t);for(var r="",n=0;n<e;)r+=String.fromCharCode.apply(String,t.slice(n,n+=Le));return r}function It(t,e,r){var n="";r=Math.min(t.length,r);for(var o=e;o<r;++o)n+=String.fromCharCode(t[o]&127);return n}function Tt(t,e,r){var n="";r=Math.min(t.length,r);for(var o=e;o<r;++o)n+=String.fromCharCode(t[o]);return n}function yt(t,e,r){var n=t.length;(!e||e<0)&&(e=0),(!r||r<0||r>n)&&(r=n);for(var o="",i=e;i<r;++i)o+=Dt(t[i]);return o}function Et(t,e,r){for(var n=t.slice(e,r),o="",i=0;i<n.length;i+=2)o+=String.fromCharCode(n[i]+n[i+1]*256);return o}s.prototype.slice=function(e,r){var n=this.length;e=~~e,r=r===void 0?n:~~r,e<0?(e+=n,e<0&&(e=0)):e>n&&(e=n),r<0?(r+=n,r<0&&(r=0)):r>n&&(r=n),r<e&&(r=e);var o;if(s.TYPED_ARRAY_SUPPORT)o=this.subarray(e,r),o.__proto__=s.prototype;else{var i=r-e;o=new s(i,void 0);for(var a=0;a<i;++a)o[a]=this[a+e]}return o};function x(t,e,r){if(t%1!==0||t<0)throw new RangeError("offset is not uint");if(t+e>r)throw new RangeError("Trying to access beyond buffer length")}s.prototype.readUIntLE=function(e,r,n){e=e|0,r=r|0,n||x(e,r,this.length);for(var o=this[e],i=1,a=0;++a<r&&(i*=256);)o+=this[e+a]*i;return o};s.prototype.readUIntBE=function(e,r,n){e=e|0,r=r|0,n||x(e,r,this.length);for(var o=this[e+--r],i=1;r>0&&(i*=256);)o+=this[e+--r]*i;return o};s.prototype.readUInt8=function(e,r){return r||x(e,1,this.length),this[e]};s.prototype.readUInt16LE=function(e,r){return r||x(e,2,this.length),this[e]|this[e+1]<<8};s.prototype.readUInt16BE=function(e,r){return r||x(e,2,this.length),this[e]<<8|this[e+1]};s.prototype.readUInt32LE=function(e,r){return r||x(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+this[e+3]*16777216};s.prototype.readUInt32BE=function(e,r){return r||x(e,4,this.length),this[e]*16777216+(this[e+1]<<16|this[e+2]<<8|this[e+3])};s.prototype.readIntLE=function(e,r,n){e=e|0,r=r|0,n||x(e,r,this.length);for(var o=this[e],i=1,a=0;++a<r&&(i*=256);)o+=this[e+a]*i;return i*=128,o>=i&&(o-=Math.pow(2,8*r)),o};s.prototype.readIntBE=function(e,r,n){e=e|0,r=r|0,n||x(e,r,this.length);for(var o=r,i=1,a=this[e+--o];o>0&&(i*=256);)a+=this[e+--o]*i;return i*=128,a>=i&&(a-=Math.pow(2,8*r)),a};s.prototype.readInt8=function(e,r){return r||x(e,1,this.length),this[e]&128?(255-this[e]+1)*-1:this[e]};s.prototype.readInt16LE=function(e,r){r||x(e,2,this.length);var n=this[e]|this[e+1]<<8;return n&32768?n|4294901760:n};s.prototype.readInt16BE=function(e,r){r||x(e,2,this.length);var n=this[e+1]|this[e]<<8;return n&32768?n|4294901760:n};s.prototype.readInt32LE=function(e,r){return r||x(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24};s.prototype.readInt32BE=function(e,r){return r||x(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]};s.prototype.readFloatLE=function(e,r){return r||x(e,4,this.length),ne(this,e,!0,23,4)};s.prototype.readFloatBE=function(e,r){return r||x(e,4,this.length),ne(this,e,!1,23,4)};s.prototype.readDoubleLE=function(e,r){return r||x(e,8,this.length),ne(this,e,!0,52,8)};s.prototype.readDoubleBE=function(e,r){return r||x(e,8,this.length),ne(this,e,!1,52,8)};function T(t,e,r,n,o,i){if(!w(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>o||e<i)throw new RangeError('"value" argument is out of bounds');if(r+n>t.length)throw new RangeError("Index out of range")}s.prototype.writeUIntLE=function(e,r,n,o){if(e=+e,r=r|0,n=n|0,!o){var i=Math.pow(2,8*n)-1;T(this,e,r,n,i,0)}var a=1,u=0;for(this[r]=e&255;++u<n&&(a*=256);)this[r+u]=e/a&255;return r+n};s.prototype.writeUIntBE=function(e,r,n,o){if(e=+e,r=r|0,n=n|0,!o){var i=Math.pow(2,8*n)-1;T(this,e,r,n,i,0)}var a=n-1,u=1;for(this[r+a]=e&255;--a>=0&&(u*=256);)this[r+a]=e/u&255;return r+n};s.prototype.writeUInt8=function(e,r,n){return e=+e,r=r|0,n||T(this,e,r,1,255,0),s.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[r]=e&255,r+1};function ee(t,e,r,n){e<0&&(e=65535+e+1);for(var o=0,i=Math.min(t.length-r,2);o<i;++o)t[r+o]=(e&255<<8*(n?o:1-o))>>>(n?o:1-o)*8}s.prototype.writeUInt16LE=function(e,r,n){return e=+e,r=r|0,n||T(this,e,r,2,65535,0),s.TYPED_ARRAY_SUPPORT?(this[r]=e&255,this[r+1]=e>>>8):ee(this,e,r,!0),r+2};s.prototype.writeUInt16BE=function(e,r,n){return e=+e,r=r|0,n||T(this,e,r,2,65535,0),s.TYPED_ARRAY_SUPPORT?(this[r]=e>>>8,this[r+1]=e&255):ee(this,e,r,!1),r+2};function re(t,e,r,n){e<0&&(e=4294967295+e+1);for(var o=0,i=Math.min(t.length-r,4);o<i;++o)t[r+o]=e>>>(n?o:3-o)*8&255}s.prototype.writeUInt32LE=function(e,r,n){return e=+e,r=r|0,n||T(this,e,r,4,4294967295,0),s.TYPED_ARRAY_SUPPORT?(this[r+3]=e>>>24,this[r+2]=e>>>16,this[r+1]=e>>>8,this[r]=e&255):re(this,e,r,!0),r+4};s.prototype.writeUInt32BE=function(e,r,n){return e=+e,r=r|0,n||T(this,e,r,4,4294967295,0),s.TYPED_ARRAY_SUPPORT?(this[r]=e>>>24,this[r+1]=e>>>16,this[r+2]=e>>>8,this[r+3]=e&255):re(this,e,r,!1),r+4};s.prototype.writeIntLE=function(e,r,n,o){if(e=+e,r=r|0,!o){var i=Math.pow(2,8*n-1);T(this,e,r,n,i-1,-i)}var a=0,u=1,d=0;for(this[r]=e&255;++a<n&&(u*=256);)e<0&&d===0&&this[r+a-1]!==0&&(d=1),this[r+a]=(e/u>>0)-d&255;return r+n};s.prototype.writeIntBE=function(e,r,n,o){if(e=+e,r=r|0,!o){var i=Math.pow(2,8*n-1);T(this,e,r,n,i-1,-i)}var a=n-1,u=1,d=0;for(this[r+a]=e&255;--a>=0&&(u*=256);)e<0&&d===0&&this[r+a+1]!==0&&(d=1),this[r+a]=(e/u>>0)-d&255;return r+n};s.prototype.writeInt8=function(e,r,n){return e=+e,r=r|0,n||T(this,e,r,1,127,-128),s.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[r]=e&255,r+1};s.prototype.writeInt16LE=function(e,r,n){return e=+e,r=r|0,n||T(this,e,r,2,32767,-32768),s.TYPED_ARRAY_SUPPORT?(this[r]=e&255,this[r+1]=e>>>8):ee(this,e,r,!0),r+2};s.prototype.writeInt16BE=function(e,r,n){return e=+e,r=r|0,n||T(this,e,r,2,32767,-32768),s.TYPED_ARRAY_SUPPORT?(this[r]=e>>>8,this[r+1]=e&255):ee(this,e,r,!1),r+2};s.prototype.writeInt32LE=function(e,r,n){return e=+e,r=r|0,n||T(this,e,r,4,2147483647,-2147483648),s.TYPED_ARRAY_SUPPORT?(this[r]=e&255,this[r+1]=e>>>8,this[r+2]=e>>>16,this[r+3]=e>>>24):re(this,e,r,!0),r+4};s.prototype.writeInt32BE=function(e,r,n){return e=+e,r=r|0,n||T(this,e,r,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),s.TYPED_ARRAY_SUPPORT?(this[r]=e>>>24,this[r+1]=e>>>16,this[r+2]=e>>>8,this[r+3]=e&255):re(this,e,r,!1),r+4};function Ve(t,e,r,n,o,i){if(r+n>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function $e(t,e,r,n,o){return o||Ve(t,e,r,4,34028234663852886e22,-34028234663852886e22),Je(t,e,r,n,23,4),r+4}s.prototype.writeFloatLE=function(e,r,n){return $e(this,e,r,!0,n)};s.prototype.writeFloatBE=function(e,r,n){return $e(this,e,r,!1,n)};function ze(t,e,r,n,o){return o||Ve(t,e,r,8,17976931348623157e292,-17976931348623157e292),Je(t,e,r,n,52,8),r+8}s.prototype.writeDoubleLE=function(e,r,n){return ze(this,e,r,!0,n)};s.prototype.writeDoubleBE=function(e,r,n){return ze(this,e,r,!1,n)};s.prototype.copy=function(e,r,n,o){if(n||(n=0),!o&&o!==0&&(o=this.length),r>=e.length&&(r=e.length),r||(r=0),o>0&&o<n&&(o=n),o===n||e.length===0||this.length===0)return 0;if(r<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("sourceStart out of bounds");if(o<0)throw new RangeError("sourceEnd out of bounds");o>this.length&&(o=this.length),e.length-r<o-n&&(o=e.length-r+n);var i=o-n,a;if(this===e&&n<r&&r<o)for(a=i-1;a>=0;--a)e[a+r]=this[a+n];else if(i<1e3||!s.TYPED_ARRAY_SUPPORT)for(a=0;a<i;++a)e[a+r]=this[a+n];else Uint8Array.prototype.set.call(e,this.subarray(n,n+i),r);return i};s.prototype.fill=function(e,r,n,o){if(typeof e=="string"){if(typeof r=="string"?(o=r,r=0,n=this.length):typeof n=="string"&&(o=n,n=this.length),e.length===1){var i=e.charCodeAt(0);i<256&&(e=i)}if(o!==void 0&&typeof o!="string")throw new TypeError("encoding must be a string");if(typeof o=="string"&&!s.isEncoding(o))throw new TypeError("Unknown encoding: "+o)}else typeof e=="number"&&(e=e&255);if(r<0||this.length<r||this.length<n)throw new RangeError("Out of range index");if(n<=r)return this;r=r>>>0,n=n===void 0?this.length:n>>>0,e||(e=0);var a;if(typeof e=="number")for(a=r;a<n;++a)this[a]=e;else{var u=w(e)?e:Z(new s(e,o).toString()),d=u.length;for(a=0;a<n-r;++a)this[a+r]=u[a%d]}return this};var _t=/[^+\/0-9A-Za-z-_]/g;function St(t){if(t=Ct(t).replace(_t,""),t.length<2)return"";for(;t.length%4!==0;)t=t+"=";return t}function Ct(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}function Dt(t){return t<16?"0"+t.toString(16):t.toString(16)}function Z(t,e){e=e||1/0;for(var r,n=t.length,o=null,i=[],a=0;a<n;++a){if(r=t.charCodeAt(a),r>55295&&r<57344){if(!o){if(r>56319){(e-=3)>-1&&i.push(239,191,189);continue}else if(a+1===n){(e-=3)>-1&&i.push(239,191,189);continue}o=r;continue}if(r<56320){(e-=3)>-1&&i.push(239,191,189),o=r;continue}r=(o-55296<<10|r-56320)+65536}else o&&(e-=3)>-1&&i.push(239,191,189);if(o=null,r<128){if((e-=1)<0)break;i.push(r)}else if(r<2048){if((e-=2)<0)break;i.push(r>>6|192,r&63|128)}else if(r<65536){if((e-=3)<0)break;i.push(r>>12|224,r>>6&63|128,r&63|128)}else if(r<1114112){if((e-=4)<0)break;i.push(r>>18|240,r>>12&63|128,r>>6&63|128,r&63|128)}else throw new Error("Invalid code point")}return i}function wt(t){for(var e=[],r=0;r<t.length;++r)e.push(t.charCodeAt(r)&255);return e}function Rt(t,e){for(var r,n,o,i=[],a=0;a<t.length&&!((e-=2)<0);++a)r=t.charCodeAt(a),n=r>>8,o=r%256,i.push(o),i.push(n);return i}function Xe(t){return it(St(t))}function te(t,e,r,n){for(var o=0;o<n&&!(o+r>=e.length||o>=t.length);++o)e[o+r]=t[o];return o}function Nt(t){return t!==t}function Ot(t){return t!=null&&(!!t._isBuffer||qe(t)||kt(t))}function qe(t){return!!t.constructor&&typeof t.constructor.isBuffer=="function"&&t.constructor.isBuffer(t)}function kt(t){return typeof t.readFloatLE=="function"&&typeof t.slice=="function"&&qe(t.slice(0,0))}function ne(t,e,r,n,o){var i,a,u=o*8-n-1,d=(1<<u)-1,l=d>>1,g=-7,m=r?o-1:0,b=r?-1:1,f=t[e+m];for(m+=b,i=f&(1<<-g)-1,f>>=-g,g+=u;g>0;i=i*256+t[e+m],m+=b,g-=8);for(a=i&(1<<-g)-1,i>>=-g,g+=n;g>0;a=a*256+t[e+m],m+=b,g-=8);if(i===0)i=1-l;else{if(i===d)return a?NaN:(f?-1:1)*(1/0);a=a+Math.pow(2,n),i=i-l}return(f?-1:1)*a*Math.pow(2,i-n)}function Je(t,e,r,n,o,i){var a,u,d,l=i*8-o-1,g=(1<<l)-1,m=g>>1,b=o===23?Math.pow(2,-24)-Math.pow(2,-77):0,f=n?0:i-1,I=n?1:-1,q=e<0||e===0&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(u=isNaN(e)?1:0,a=g):(a=Math.floor(Math.log(e)/Math.LN2),e*(d=Math.pow(2,-a))<1&&(a--,d*=2),a+m>=1?e+=b/d:e+=b*Math.pow(2,1-m),e*d>=2&&(a++,d/=2),a+m>=g?(u=0,a=g):a+m>=1?(u=(e*d-1)*Math.pow(2,o),a=a+m):(u=e*Math.pow(2,m-1)*Math.pow(2,o),a=0));o>=8;t[r+f]=u&255,f+=I,u/=256,o-=8);for(a=a<<o|u,l+=o;l>0;t[r+f]=a&255,f+=I,a/=256,l-=8);t[r+f-I]|=q*128}import{PublicKey as X}from"@solana/web3.js";var V={"0x4343545055534443000000000000000000000000000000000000000000000000":65537};import dp from"algosdk";import*as wr from"bs58";import fn from"algosdk";import oo,{decodeAddress as io,encodeAddress as ao}from"algosdk";var R=[],S=[],Pt=typeof Uint8Array<"u"?Uint8Array:Array,xe=!1;function er(){xe=!0;for(var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",e=0,r=t.length;e<r;++e)R[e]=t[e],S[t.charCodeAt(e)]=e;S[45]=62,S[95]=63}function Bt(t){xe||er();var e,r,n,o,i,a,u=t.length;if(u%4>0)throw new Error("Invalid string. Length must be a multiple of 4");i=t[u-2]==="="?2:t[u-1]==="="?1:0,a=new Pt(u*3/4-i),n=i>0?u-4:u;var d=0;for(e=0,r=0;e<n;e+=4,r+=3)o=S[t.charCodeAt(e)]<<18|S[t.charCodeAt(e+1)]<<12|S[t.charCodeAt(e+2)]<<6|S[t.charCodeAt(e+3)],a[d++]=o>>16&255,a[d++]=o>>8&255,a[d++]=o&255;return i===2?(o=S[t.charCodeAt(e)]<<2|S[t.charCodeAt(e+1)]>>4,a[d++]=o&255):i===1&&(o=S[t.charCodeAt(e)]<<10|S[t.charCodeAt(e+1)]<<4|S[t.charCodeAt(e+2)]>>2,a[d++]=o>>8&255,a[d++]=o&255),a}function Ut(t){return R[t>>18&63]+R[t>>12&63]+R[t>>6&63]+R[t&63]}function Mt(t,e,r){for(var n,o=[],i=e;i<r;i+=3)n=(t[i]<<16)+(t[i+1]<<8)+t[i+2],o.push(Ut(n));return o.join("")}function je(t){xe||er();for(var e,r=t.length,n=r%3,o="",i=[],a=16383,u=0,d=r-n;u<d;u+=a)i.push(Mt(t,u,u+a>d?d:u+a));return n===1?(e=t[r-1],o+=R[e>>2],o+=R[e<<4&63],o+="=="):n===2&&(e=(t[r-2]<<8)+t[r-1],o+=R[e>>10],o+=R[e>>4&63],o+=R[e<<2&63],o+="="),i.push(o),i.join("")}function ae(t,e,r,n,o){var i,a,u=o*8-n-1,d=(1<<u)-1,l=d>>1,g=-7,m=r?o-1:0,b=r?-1:1,f=t[e+m];for(m+=b,i=f&(1<<-g)-1,f>>=-g,g+=u;g>0;i=i*256+t[e+m],m+=b,g-=8);for(a=i&(1<<-g)-1,i>>=-g,g+=n;g>0;a=a*256+t[e+m],m+=b,g-=8);if(i===0)i=1-l;else{if(i===d)return a?NaN:(f?-1:1)*(1/0);a=a+Math.pow(2,n),i=i-l}return(f?-1:1)*a*Math.pow(2,i-n)}function rr(t,e,r,n,o,i){var a,u,d,l=i*8-o-1,g=(1<<l)-1,m=g>>1,b=o===23?Math.pow(2,-24)-Math.pow(2,-77):0,f=n?0:i-1,I=n?1:-1,q=e<0||e===0&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(u=isNaN(e)?1:0,a=g):(a=Math.floor(Math.log(e)/Math.LN2),e*(d=Math.pow(2,-a))<1&&(a--,d*=2),a+m>=1?e+=b/d:e+=b*Math.pow(2,1-m),e*d>=2&&(a++,d/=2),a+m>=g?(u=0,a=g):a+m>=1?(u=(e*d-1)*Math.pow(2,o),a=a+m):(u=e*Math.pow(2,m-1)*Math.pow(2,o),a=0));o>=8;t[r+f]=u&255,f+=I,u/=256,o-=8);for(a=a<<o|u,l+=o;l>0;t[r+f]=a&255,f+=I,a/=256,l-=8);t[r+f-I]|=q*128}var Lt={}.toString,tr=Array.isArray||function(t){return Lt.call(t)=="[object Array]"};var vt=50;p.TYPED_ARRAY_SUPPORT=globalThis.TYPED_ARRAY_SUPPORT!==void 0?globalThis.TYPED_ARRAY_SUPPORT:!0;var Zn=oe();function oe(){return p.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function P(t,e){if(oe()<e)throw new RangeError("Invalid typed array length");return p.TYPED_ARRAY_SUPPORT?(t=new Uint8Array(e),t.__proto__=p.prototype):(t===null&&(t=new p(e)),t.length=e),t}function p(t,e,r){if(!p.TYPED_ARRAY_SUPPORT&&!(this instanceof p))return new p(t,e,r);if(typeof t=="number"){if(typeof e=="string")throw new Error("If encoding is specified then the first argument must be a string");return he(this,t)}return nr(this,t,e,r)}p.poolSize=8192;p._augment=function(t){return t.__proto__=p.prototype,t};function nr(t,e,r,n){if(typeof e=="number")throw new TypeError('"value" argument must not be a number');return typeof ArrayBuffer<"u"&&e instanceof ArrayBuffer?Yt(t,e,r,n):typeof e=="string"?Wt(t,e,r):Gt(t,e)}p.from=function(t,e,r){return nr(null,t,e,r)};p.TYPED_ARRAY_SUPPORT&&(p.prototype.__proto__=Uint8Array.prototype,p.__proto__=Uint8Array);function or(t){if(typeof t!="number")throw new TypeError('"size" argument must be a number');if(t<0)throw new RangeError('"size" argument must not be negative')}function Ft(t,e,r,n){return or(e),e<=0?P(t,e):r!==void 0?typeof n=="string"?P(t,e).fill(r,n):P(t,e).fill(r):P(t,e)}p.alloc=function(t,e,r){return Ft(null,t,e,r)};function he(t,e){if(or(e),t=P(t,e<0?0:Ae(e)|0),!p.TYPED_ARRAY_SUPPORT)for(var r=0;r<e;++r)t[r]=0;return t}p.allocUnsafe=function(t){return he(null,t)};p.allocUnsafeSlow=function(t){return he(null,t)};function Wt(t,e,r){if((typeof r!="string"||r==="")&&(r="utf8"),!p.isEncoding(r))throw new TypeError('"encoding" must be a valid string encoding');var n=ir(e,r)|0;t=P(t,n);var o=t.write(e,r);return o!==n&&(t=t.slice(0,o)),t}function be(t,e){var r=e.length<0?0:Ae(e.length)|0;t=P(t,r);for(var n=0;n<r;n+=1)t[n]=e[n]&255;return t}function Yt(t,e,r,n){if(e.byteLength,r<0||e.byteLength<r)throw new RangeError("'offset' is out of bounds");if(e.byteLength<r+(n||0))throw new RangeError("'length' is out of bounds");return r===void 0&&n===void 0?e=new Uint8Array(e):n===void 0?e=new Uint8Array(e,r):e=new Uint8Array(e,r,n),p.TYPED_ARRAY_SUPPORT?(t=e,t.__proto__=p.prototype):t=be(t,e),t}function Gt(t,e){if(N(e)){var r=Ae(e.length)|0;return t=P(t,r),t.length===0||e.copy(t,0,0,r),t}if(e){if(typeof ArrayBuffer<"u"&&e.buffer instanceof ArrayBuffer||"length"in e)return typeof e.length!="number"||cn(e.length)?P(t,0):be(t,e);if(e.type==="Buffer"&&tr(e.data))return be(t,e.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function Ae(t){if(t>=oe())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+oe().toString(16)+" bytes");return t|0}p.isBuffer=un;function N(t){return!!(t!=null&&t._isBuffer)}p.compare=function(e,r){if(!N(e)||!N(r))throw new TypeError("Arguments must be Buffers");if(e===r)return 0;for(var n=e.length,o=r.length,i=0,a=Math.min(n,o);i<a;++i)if(e[i]!==r[i]){n=e[i],o=r[i];break}return n<o?-1:o<n?1:0};p.isEncoding=function(e){switch(String(e).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}};p.concat=function(e,r){if(!tr(e))throw new TypeError('"list" argument must be an Array of Buffers');if(e.length===0)return p.alloc(0);var n;if(r===void 0)for(r=0,n=0;n<e.length;++n)r+=e[n].length;var o=p.allocUnsafe(r),i=0;for(n=0;n<e.length;++n){var a=e[n];if(!N(a))throw new TypeError('"list" argument must be an Array of Buffers');a.copy(o,i),i+=a.length}return o};function ir(t,e){if(N(t))return t.length;if(typeof ArrayBuffer<"u"&&typeof ArrayBuffer.isView=="function"&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;typeof t!="string"&&(t=""+t);var r=t.length;if(r===0)return 0;for(var n=!1;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":case void 0:return ie(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return r*2;case"hex":return r>>>1;case"base64":return mr(t).length;default:if(n)return ie(t).length;e=(""+e).toLowerCase(),n=!0}}p.byteLength=ir;function Kt(t,e,r){var n=!1;if((e===void 0||e<0)&&(e=0),e>this.length||((r===void 0||r>this.length)&&(r=this.length),r<=0)||(r>>>=0,e>>>=0,r<=e))return"";for(t||(t="utf8");;)switch(t){case"hex":return Zt(this,e,r);case"utf8":case"utf-8":return cr(this,e,r);case"ascii":return jt(this,e,r);case"latin1":case"binary":return Qt(this,e,r);case"base64":return qt(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return en(this,e,r);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}p.prototype._isBuffer=!0;function Y(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}p.prototype.swap16=function(){var e=this.length;if(e%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var r=0;r<e;r+=2)Y(this,r,r+1);return this};p.prototype.swap32=function(){var e=this.length;if(e%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var r=0;r<e;r+=4)Y(this,r,r+3),Y(this,r+1,r+2);return this};p.prototype.swap64=function(){var e=this.length;if(e%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var r=0;r<e;r+=8)Y(this,r,r+7),Y(this,r+1,r+6),Y(this,r+2,r+5),Y(this,r+3,r+4);return this};p.prototype.toString=function(){var e=this.length|0;return e===0?"":arguments.length===0?cr(this,0,e):Kt.apply(this,arguments)};p.prototype.equals=function(e){if(!N(e))throw new TypeError("Argument must be a Buffer");return this===e?!0:p.compare(this,e)===0};p.prototype.inspect=function(){var e="",r=vt;return this.length>0&&(e=this.toString("hex",0,r).match(/.{2}/g).join(" "),this.length>r&&(e+=" ... ")),"<Buffer "+e+">"};p.prototype.compare=function(e,r,n,o,i){if(!N(e))throw new TypeError("Argument must be a Buffer");if(r===void 0&&(r=0),n===void 0&&(n=e?e.length:0),o===void 0&&(o=0),i===void 0&&(i=this.length),r<0||n>e.length||o<0||i>this.length)throw new RangeError("out of range index");if(o>=i&&r>=n)return 0;if(o>=i)return-1;if(r>=n)return 1;if(r>>>=0,n>>>=0,o>>>=0,i>>>=0,this===e)return 0;for(var a=i-o,u=n-r,d=Math.min(a,u),l=this.slice(o,i),g=e.slice(r,n),m=0;m<d;++m)if(l[m]!==g[m]){a=l[m],u=g[m];break}return a<u?-1:u<a?1:0};function ar(t,e,r,n,o){if(t.length===0)return-1;if(typeof r=="string"?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,isNaN(r)&&(r=o?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(o)return-1;r=t.length-1}else if(r<0)if(o)r=0;else return-1;if(typeof e=="string"&&(e=p.from(e,n)),N(e))return e.length===0?-1:Qe(t,e,r,n,o);if(typeof e=="number")return e=e&255,p.TYPED_ARRAY_SUPPORT&&typeof Uint8Array.prototype.indexOf=="function"?o?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):Qe(t,[e],r,n,o);throw new TypeError("val must be string, number or Buffer")}function Qe(t,e,r,n,o){var i=1,a=t.length,u=e.length;if(n!==void 0&&(n=String(n).toLowerCase(),n==="ucs2"||n==="ucs-2"||n==="utf16le"||n==="utf-16le")){if(t.length<2||e.length<2)return-1;i=2,a/=2,u/=2,r/=2}function d(f,I){return i===1?f[I]:f.readUInt16BE(I*i)}var l;if(o){var g=-1;for(l=r;l<a;l++)if(d(t,l)===d(e,g===-1?0:l-g)){if(g===-1&&(g=l),l-g+1===u)return g*i}else g!==-1&&(l-=l-g),g=-1}else for(r+u>a&&(r=a-u),l=r;l>=0;l--){for(var m=!0,b=0;b<u;b++)if(d(t,l+b)!==d(e,b)){m=!1;break}if(m)return l}return-1}p.prototype.includes=function(e,r,n){return this.indexOf(e,r,n)!==-1};p.prototype.indexOf=function(e,r,n){return ar(this,e,r,n,!0)};p.prototype.lastIndexOf=function(e,r,n){return ar(this,e,r,n,!1)};function Ht(t,e,r,n){r=Number(r)||0;var o=t.length-r;n?(n=Number(n),n>o&&(n=o)):n=o;var i=e.length;if(i%2!==0)throw new TypeError("Invalid hex string");n>i/2&&(n=i/2);for(var a=0;a<n;++a){var u=parseInt(e.substr(a*2,2),16);if(isNaN(u))return a;t[r+a]=u}return a}function Vt(t,e,r,n){return ue(ie(e,t.length-r),t,r,n)}function sr(t,e,r,n){return ue(an(e),t,r,n)}function $t(t,e,r,n){return sr(t,e,r,n)}function zt(t,e,r,n){return ue(mr(e),t,r,n)}function Xt(t,e,r,n){return ue(sn(e,t.length-r),t,r,n)}p.prototype.write=function(e,r,n,o){if(r===void 0)o="utf8",n=this.length,r=0;else if(n===void 0&&typeof r=="string")o=r,n=this.length,r=0;else if(isFinite(r))r=r|0,isFinite(n)?(n=n|0,o===void 0&&(o="utf8")):(o=n,n=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var i=this.length-r;if((n===void 0||n>i)&&(n=i),e.length>0&&(n<0||r<0)||r>this.length)throw new RangeError("Attempt to write outside buffer bounds");o||(o="utf8");for(var a=!1;;)switch(o){case"hex":return Ht(this,e,r,n);case"utf8":case"utf-8":return Vt(this,e,r,n);case"ascii":return sr(this,e,r,n);case"latin1":case"binary":return $t(this,e,r,n);case"base64":return zt(this,e,r,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Xt(this,e,r,n);default:if(a)throw new TypeError("Unknown encoding: "+o);o=(""+o).toLowerCase(),a=!0}};p.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function qt(t,e,r){return e===0&&r===t.length?je(t):je(t.slice(e,r))}function cr(t,e,r){r=Math.min(t.length,r);for(var n=[],o=e;o<r;){var i=t[o],a=null,u=i>239?4:i>223?3:i>191?2:1;if(o+u<=r){var d,l,g,m;switch(u){case 1:i<128&&(a=i);break;case 2:d=t[o+1],(d&192)===128&&(m=(i&31)<<6|d&63,m>127&&(a=m));break;case 3:d=t[o+1],l=t[o+2],(d&192)===128&&(l&192)===128&&(m=(i&15)<<12|(d&63)<<6|l&63,m>2047&&(m<55296||m>57343)&&(a=m));break;case 4:d=t[o+1],l=t[o+2],g=t[o+3],(d&192)===128&&(l&192)===128&&(g&192)===128&&(m=(i&15)<<18|(d&63)<<12|(l&63)<<6|g&63,m>65535&&m<1114112&&(a=m))}}a===null?(a=65533,u=1):a>65535&&(a-=65536,n.push(a>>>10&1023|55296),a=56320|a&1023),n.push(a),o+=u}return Jt(n)}var Ze=4096;function Jt(t){var e=t.length;if(e<=Ze)return String.fromCharCode.apply(String,t);for(var r="",n=0;n<e;)r+=String.fromCharCode.apply(String,t.slice(n,n+=Ze));return r}function jt(t,e,r){var n="";r=Math.min(t.length,r);for(var o=e;o<r;++o)n+=String.fromCharCode(t[o]&127);return n}function Qt(t,e,r){var n="";r=Math.min(t.length,r);for(var o=e;o<r;++o)n+=String.fromCharCode(t[o]);return n}function Zt(t,e,r){var n=t.length;(!e||e<0)&&(e=0),(!r||r<0||r>n)&&(r=n);for(var o="",i=e;i<r;++i)o+=on(t[i]);return o}function en(t,e,r){for(var n=t.slice(e,r),o="",i=0;i<n.length;i+=2)o+=String.fromCharCode(n[i]+n[i+1]*256);return o}p.prototype.slice=function(e,r){var n=this.length;e=~~e,r=r===void 0?n:~~r,e<0?(e+=n,e<0&&(e=0)):e>n&&(e=n),r<0?(r+=n,r<0&&(r=0)):r>n&&(r=n),r<e&&(r=e);var o;if(p.TYPED_ARRAY_SUPPORT)o=this.subarray(e,r),o.__proto__=p.prototype;else{var i=r-e;o=new p(i,void 0);for(var a=0;a<i;++a)o[a]=this[a+e]}return o};function h(t,e,r){if(t%1!==0||t<0)throw new RangeError("offset is not uint");if(t+e>r)throw new RangeError("Trying to access beyond buffer length")}p.prototype.readUIntLE=function(e,r,n){e=e|0,r=r|0,n||h(e,r,this.length);for(var o=this[e],i=1,a=0;++a<r&&(i*=256);)o+=this[e+a]*i;return o};p.prototype.readUIntBE=function(e,r,n){e=e|0,r=r|0,n||h(e,r,this.length);for(var o=this[e+--r],i=1;r>0&&(i*=256);)o+=this[e+--r]*i;return o};p.prototype.readUInt8=function(e,r){return r||h(e,1,this.length),this[e]};p.prototype.readUInt16LE=function(e,r){return r||h(e,2,this.length),this[e]|this[e+1]<<8};p.prototype.readUInt16BE=function(e,r){return r||h(e,2,this.length),this[e]<<8|this[e+1]};p.prototype.readUInt32LE=function(e,r){return r||h(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+this[e+3]*16777216};p.prototype.readUInt32BE=function(e,r){return r||h(e,4,this.length),this[e]*16777216+(this[e+1]<<16|this[e+2]<<8|this[e+3])};p.prototype.readIntLE=function(e,r,n){e=e|0,r=r|0,n||h(e,r,this.length);for(var o=this[e],i=1,a=0;++a<r&&(i*=256);)o+=this[e+a]*i;return i*=128,o>=i&&(o-=Math.pow(2,8*r)),o};p.prototype.readIntBE=function(e,r,n){e=e|0,r=r|0,n||h(e,r,this.length);for(var o=r,i=1,a=this[e+--o];o>0&&(i*=256);)a+=this[e+--o]*i;return i*=128,a>=i&&(a-=Math.pow(2,8*r)),a};p.prototype.readInt8=function(e,r){return r||h(e,1,this.length),this[e]&128?(255-this[e]+1)*-1:this[e]};p.prototype.readInt16LE=function(e,r){r||h(e,2,this.length);var n=this[e]|this[e+1]<<8;return n&32768?n|4294901760:n};p.prototype.readInt16BE=function(e,r){r||h(e,2,this.length);var n=this[e+1]|this[e]<<8;return n&32768?n|4294901760:n};p.prototype.readInt32LE=function(e,r){return r||h(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24};p.prototype.readInt32BE=function(e,r){return r||h(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]};p.prototype.readFloatLE=function(e,r){return r||h(e,4,this.length),ae(this,e,!0,23,4)};p.prototype.readFloatBE=function(e,r){return r||h(e,4,this.length),ae(this,e,!1,23,4)};p.prototype.readDoubleLE=function(e,r){return r||h(e,8,this.length),ae(this,e,!0,52,8)};p.prototype.readDoubleBE=function(e,r){return r||h(e,8,this.length),ae(this,e,!1,52,8)};function y(t,e,r,n,o,i){if(!N(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>o||e<i)throw new RangeError('"value" argument is out of bounds');if(r+n>t.length)throw new RangeError("Index out of range")}p.prototype.writeUIntLE=function(e,r,n,o){if(e=+e,r=r|0,n=n|0,!o){var i=Math.pow(2,8*n)-1;y(this,e,r,n,i,0)}var a=1,u=0;for(this[r]=e&255;++u<n&&(a*=256);)this[r+u]=e/a&255;return r+n};p.prototype.writeUIntBE=function(e,r,n,o){if(e=+e,r=r|0,n=n|0,!o){var i=Math.pow(2,8*n)-1;y(this,e,r,n,i,0)}var a=n-1,u=1;for(this[r+a]=e&255;--a>=0&&(u*=256);)this[r+a]=e/u&255;return r+n};p.prototype.writeUInt8=function(e,r,n){return e=+e,r=r|0,n||y(this,e,r,1,255,0),p.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[r]=e&255,r+1};function se(t,e,r,n){e<0&&(e=65535+e+1);for(var o=0,i=Math.min(t.length-r,2);o<i;++o)t[r+o]=(e&255<<8*(n?o:1-o))>>>(n?o:1-o)*8}p.prototype.writeUInt16LE=function(e,r,n){return e=+e,r=r|0,n||y(this,e,r,2,65535,0),p.TYPED_ARRAY_SUPPORT?(this[r]=e&255,this[r+1]=e>>>8):se(this,e,r,!0),r+2};p.prototype.writeUInt16BE=function(e,r,n){return e=+e,r=r|0,n||y(this,e,r,2,65535,0),p.TYPED_ARRAY_SUPPORT?(this[r]=e>>>8,this[r+1]=e&255):se(this,e,r,!1),r+2};function ce(t,e,r,n){e<0&&(e=4294967295+e+1);for(var o=0,i=Math.min(t.length-r,4);o<i;++o)t[r+o]=e>>>(n?o:3-o)*8&255}p.prototype.writeUInt32LE=function(e,r,n){return e=+e,r=r|0,n||y(this,e,r,4,4294967295,0),p.TYPED_ARRAY_SUPPORT?(this[r+3]=e>>>24,this[r+2]=e>>>16,this[r+1]=e>>>8,this[r]=e&255):ce(this,e,r,!0),r+4};p.prototype.writeUInt32BE=function(e,r,n){return e=+e,r=r|0,n||y(this,e,r,4,4294967295,0),p.TYPED_ARRAY_SUPPORT?(this[r]=e>>>24,this[r+1]=e>>>16,this[r+2]=e>>>8,this[r+3]=e&255):ce(this,e,r,!1),r+4};p.prototype.writeIntLE=function(e,r,n,o){if(e=+e,r=r|0,!o){var i=Math.pow(2,8*n-1);y(this,e,r,n,i-1,-i)}var a=0,u=1,d=0;for(this[r]=e&255;++a<n&&(u*=256);)e<0&&d===0&&this[r+a-1]!==0&&(d=1),this[r+a]=(e/u>>0)-d&255;return r+n};p.prototype.writeIntBE=function(e,r,n,o){if(e=+e,r=r|0,!o){var i=Math.pow(2,8*n-1);y(this,e,r,n,i-1,-i)}var a=n-1,u=1,d=0;for(this[r+a]=e&255;--a>=0&&(u*=256);)e<0&&d===0&&this[r+a+1]!==0&&(d=1),this[r+a]=(e/u>>0)-d&255;return r+n};p.prototype.writeInt8=function(e,r,n){return e=+e,r=r|0,n||y(this,e,r,1,127,-128),p.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[r]=e&255,r+1};p.prototype.writeInt16LE=function(e,r,n){return e=+e,r=r|0,n||y(this,e,r,2,32767,-32768),p.TYPED_ARRAY_SUPPORT?(this[r]=e&255,this[r+1]=e>>>8):se(this,e,r,!0),r+2};p.prototype.writeInt16BE=function(e,r,n){return e=+e,r=r|0,n||y(this,e,r,2,32767,-32768),p.TYPED_ARRAY_SUPPORT?(this[r]=e>>>8,this[r+1]=e&255):se(this,e,r,!1),r+2};p.prototype.writeInt32LE=function(e,r,n){return e=+e,r=r|0,n||y(this,e,r,4,2147483647,-2147483648),p.TYPED_ARRAY_SUPPORT?(this[r]=e&255,this[r+1]=e>>>8,this[r+2]=e>>>16,this[r+3]=e>>>24):ce(this,e,r,!0),r+4};p.prototype.writeInt32BE=function(e,r,n){return e=+e,r=r|0,n||y(this,e,r,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),p.TYPED_ARRAY_SUPPORT?(this[r]=e>>>24,this[r+1]=e>>>16,this[r+2]=e>>>8,this[r+3]=e&255):ce(this,e,r,!1),r+4};function ur(t,e,r,n,o,i){if(r+n>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function pr(t,e,r,n,o){return o||ur(t,e,r,4),rr(t,e,r,n,23,4),r+4}p.prototype.writeFloatLE=function(e,r,n){return pr(this,e,r,!0,n)};p.prototype.writeFloatBE=function(e,r,n){return pr(this,e,r,!1,n)};function dr(t,e,r,n,o){return o||ur(t,e,r,8),rr(t,e,r,n,52,8),r+8}p.prototype.writeDoubleLE=function(e,r,n){return dr(this,e,r,!0,n)};p.prototype.writeDoubleBE=function(e,r,n){return dr(this,e,r,!1,n)};p.prototype.copy=function(e,r,n,o){if(n||(n=0),!o&&o!==0&&(o=this.length),r>=e.length&&(r=e.length),r||(r=0),o>0&&o<n&&(o=n),o===n||e.length===0||this.length===0)return 0;if(r<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("sourceStart out of bounds");if(o<0)throw new RangeError("sourceEnd out of bounds");o>this.length&&(o=this.length),e.length-r<o-n&&(o=e.length-r+n);var i=o-n,a;if(this===e&&n<r&&r<o)for(a=i-1;a>=0;--a)e[a+r]=this[a+n];else if(i<1e3||!p.TYPED_ARRAY_SUPPORT)for(a=0;a<i;++a)e[a+r]=this[a+n];else Uint8Array.prototype.set.call(e,this.subarray(n,n+i),r);return i};p.prototype.fill=function(e,r,n,o){if(typeof e=="string"){if(typeof r=="string"?(o=r,r=0,n=this.length):typeof n=="string"&&(o=n,n=this.length),e.length===1){var i=e.charCodeAt(0);i<256&&(e=i)}if(o!==void 0&&typeof o!="string")throw new TypeError("encoding must be a string");if(typeof o=="string"&&!p.isEncoding(o))throw new TypeError("Unknown encoding: "+o)}else typeof e=="number"&&(e=e&255);if(r<0||this.length<r||this.length<n)throw new RangeError("Out of range index");if(n<=r)return this;r=r>>>0,n=n===void 0?this.length:n>>>0,e||(e=0);var a;if(typeof e=="number")for(a=r;a<n;++a)this[a]=e;else{var u=N(e)?e:ie(new p(e,o).toString()),d=u.length;for(a=0;a<n-r;++a)this[a+r]=u[a%d]}return this};var rn=/[^+\/0-9A-Za-z-_]/g;function tn(t){if(t=nn(t).replace(rn,""),t.length<2)return"";for(;t.length%4!==0;)t=t+"=";return t}function nn(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}function on(t){return t<16?"0"+t.toString(16):t.toString(16)}function ie(t,e){e=e||1/0;for(var r,n=t.length,o=null,i=[],a=0;a<n;++a){if(r=t.charCodeAt(a),r>55295&&r<57344){if(!o){if(r>56319){(e-=3)>-1&&i.push(239,191,189);continue}else if(a+1===n){(e-=3)>-1&&i.push(239,191,189);continue}o=r;continue}if(r<56320){(e-=3)>-1&&i.push(239,191,189),o=r;continue}r=(o-55296<<10|r-56320)+65536}else o&&(e-=3)>-1&&i.push(239,191,189);if(o=null,r<128){if((e-=1)<0)break;i.push(r)}else if(r<2048){if((e-=2)<0)break;i.push(r>>6|192,r&63|128)}else if(r<65536){if((e-=3)<0)break;i.push(r>>12|224,r>>6&63|128,r&63|128)}else if(r<1114112){if((e-=4)<0)break;i.push(r>>18|240,r>>12&63|128,r>>6&63|128,r&63|128)}else throw new Error("Invalid code point")}return i}function an(t){for(var e=[],r=0;r<t.length;++r)e.push(t.charCodeAt(r)&255);return e}function sn(t,e){for(var r,n,o,i=[],a=0;a<t.length&&!((e-=2)<0);++a)r=t.charCodeAt(a),n=r>>8,o=r%256,i.push(o),i.push(n);return i}function mr(t){return Bt(tn(t))}function ue(t,e,r,n){for(var o=0;o<n&&!(o+r>=e.length||o>=t.length);++o)e[o+r]=t[o];return o}function cn(t){return t!==t}function un(t){return t!=null&&(!!t._isBuffer||lr(t)||pn(t))}function lr(t){return!!t.constructor&&typeof t.constructor.isBuffer=="function"&&t.constructor.isBuffer(t)}function pn(t){return typeof t.readFloatLE=="function"&&typeof t.slice=="function"&&lr(t.slice(0,0))}import{encodeAddress as dn,decodeAddress as lo}from"algosdk";function B(t){return t.reduce((e,r)=>Uint8Array.from([...e,...r]))}function Ie(t){return new Uint8Array(p.from(t))}function gr(t){return p.from(t).toString("utf-8")}function fr(t){return p.from(t).toString("base64")}function Te(t){return p.from(t,"base64")}import mn from"bignumber.js";mn.config({DECIMAL_PLACES:40,EXPONENTIAL_AT:45});var ko=`{"theme1":{"value":"${c.env.FRONTEND_URL}/Theme%3DDark.svg","active":true},"theme2":{"value":"${c.env.FRONTEND_URL}/Theme%3DLight.svg","active":true},"theme3":{"value":"${c.env.FRONTEND_URL}/Theme%3DLight.svg","active":true}}`;var br={V1_1:"v1_1",V2:"v2"},Mo={[br.V1_1]:{testnet:62368684,mainnet:552635992},[br.V2]:{testnet:148607e3,mainnet:1002541853}};var xr=t=>fn.decodeAddress(t.toUpperCase()).publicKey;import*as A from"ethereumjs-util";function ye(t){let e=A.fromSigned(s.from(t));return BigInt(e.toString())}function xn(t){return A.toUnsigned(new A.BN(String(t)))}function $(t){let e=xn(t);if(e.length>32)throw new Error("Invalid value. The buffer length of the value is more than 32");return new Uint8Array(A.setLengthLeft(e,32))}var hr=t=>{if(t.length!==32)throw new Error("Invalid address bytes. The address buffer length is not equel 32");let e=s.from(t).toString("hex");if(e.slice(0,24)!=="000000000000000000000000")throw console.log("normalizedAddress",e),new Error("Invalid normalized address");let r="0x"+e.slice(-40);if(!An(r))throw new Error("Invalid hex address");return r},Ar=t=>new Uint8Array(A.setLengthLeft(pe(t),32)),pe=t=>s.from(hn(t),"hex"),hn=t=>t.startsWith("0x")?t.slice(2):t,An=t=>A.isValidAddress(t);var Ee=t=>new Uint8Array(A.keccak256(s.from(t)));import L from"algosdk";import*as Ce from"bs58";import Bi from"algosdk";import Ki from"algosdk";import Ka from"algosdk";var Zi={SMALLESTUNIT:c.env.SMALLEST_UNIT},ea={SMALLEST_UNITS:c.env.SMALLEST_UNIT};var ia=["point-system.discordEnabled","point-system.telegramBotName","point-system.telegramBotId","point-system.telegramEnabled","point-system.telegramGroupId","point-system.telegramGroupName","point-system.twitterAccountId","point-system.twitterAccountName","point-system.twitterEnabled","point-system.twitterJobEnabled","point-system.guideLink"];var yr=t=>`By signing this message, you confirm that the wallet is a trusted one ${t}; Data: `;var ma=c.env.REACT_APP_API_URL,la=c.env.REACT_APP_SOCKET_URL,ga=c.env.REACT_APP_ALGO_SERVER,fa=c.env.REACT_APP_ALGO_SERVER_PORT||"",ba=c.env.REACT_APP_ALGOD_TOKEN||"",xa=c.env.REACT_APP_DISPENSER_LINK,ha=c.env.REACT_APP_FRONTEND_LINK||"",Aa=c.env.REACT_APP_ALGO_EXPLORER_LINK,Ia=c.env.REACT_APP_ALGO_EXPLORER_ASSETS_URL,Ta=(c.env.REACT_APP_REQUIRE_ACCESS_CODE||"").toLowerCase()==="true",ya=c.env.REACT_APP_USERBACK_ACCESS_TOKEN,Ea=(c.env.REACT_APP_EXT_ORDER_TYPES||"").toLowerCase()==="true";var _a=.001*10**6,Sa=.002*10**6;var Ca=c.env.REACT_APP_MASTER_APP_ID||"406",Da=c.env.REACT_APP_AGG_APP_ID||"408",Tn=Number(c.env.REACT_APP_CODEX_APP_ID||"467960617");console.log("CODEX_APP_ID",Tn);var yn=c.env.REACT_APP_ALGO_NETWORK||"";var wa=yn.toLowerCase()==="mainnet"?"mainnet":"testnet";import tu from"algosdk";var Er=(o=>(o.GLOBAL_PAIR_DELISTING="GLOBAL_PAIR_DELISTING",o.GLOBAL_NEW_PAIR_LISTING="GLOBAL_NEW_PAIR_LISTING",o.GLOBAL_SYSTEM_MAINTENANCE="GLOBAL_SYSTEM_MAINTENANCE",o.GLOBAL_SMART_CONTRACT_UPDATE="GLOBAL_SMART_CONTRACT_UPDATE",o))(Er||{}),_r=(n=>(n.ACCOUNT_POINTS_UNLOCK_ACHIEVEMENT="ACCOUNT_POINTS_UNLOCK_ACHIEVEMENT",n.ACCOUNT_KYC_STATUS_CHANGED="ACCOUNT_KYC_STATUS_CHANGED",n.ACCOUNT_AFFILIATE_DASHBOARD_UNLOCKED="ACCOUNT_AFFILIATE_DASHBOARD_UNLOCKED",n))(_r||{}),js={...Er,..._r};import bu from"algosdk";var E=(t,e,r)=>{switch(e){case"8B":return L.encodeUint64(Number(t));case"32B":return $(t);case"str":return Ie(String(t));case"address":return G(String(t),r);case"token":return Dr(String(t),r);case"float":{var n=s.alloc(8);return n.writeDoubleBE(Number(t),0),new Uint8Array(n)}case"bool":return new Uint8Array(s.from(L.encodeUint64(Number(t))).subarray(-1));case"2B":return new Uint8Array(s.from(L.encodeUint64(Number(t))).subarray(-2));case"4B":return new Uint8Array(s.from(L.encodeUint64(Number(t))).subarray(-4));default:return s.from(t.toString())}},C=(t,e,r)=>{switch(e){case"8B":return L.decodeUint64(t,"safe");case"32B":return ye(t);case"str":return gr(t);case"address":return Cr(t,r);case"token":return Nn(t,r);case"float":return s.from(t).readDoubleBE(0);case"bool":case"2B":return C(t,"8B");default:return s.from(t).toString()}};var Cr=(t,e)=>e===8?L.encodeAddress(t):e===1?Ce.encode(t):hr(t),Nn=(t,e)=>{let r=s.from(t).toString("hex");return r.startsWith("0x")||(r="0x"+r),V[r]?r:e===8?String(ye(t)):e===1?Ce.encode(t):Cr(t,e)};var Dr=(t,e)=>e===8?$(+t):V[t]?new Uint8Array(pe(String(t))):G(String(t),e);var Se=(t,e,r,n)=>{let o=G(t,e),i=L.encodeUint64(e),a=L.encodeUint64(n),u=Dr(r,n);return B([o,i,u,a])};var De=(t,e)=>B([On(t),Sr(e)]),On=t=>new Uint8Array(s.from(t+`
|
|
2
|
+
`,"utf-8")),Sr=t=>new Uint8Array(s.from(fr(t)));var de=t=>s.from(Ee(t)).toString("hex");var z=(t,e,r)=>{let n=s.from(t,e),o=n.subarray(n.length-r),i=s.from(o).toString();return Te(i)};var G=(t,e)=>e===8?xr(t):e===1?wr.decode(t):Ar(t);var Pn=new X("TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"),Bn=new X("ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL");function Un(t,e,r=!1,n=Pn,o=Bn){if(!r&&!X.isOnCurve(e.toBuffer()))throw new Error("TokenOwnerOffCurveError");let[i]=X.findProgramAddressSync([e.toBuffer(),n.toBuffer(),t.toBuffer()],o);return i}var rl=(t,e,r)=>{let n=t==="MainNet"?"EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v":"4zMMC9srt5Ri5X14GAgXhaHii3GnPAEERYPJgZJDncDU";if(Nr(e,r))return n},tl=c.env.ALGO_NETWORK==="MainNet"?"EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v":"4zMMC9srt5Ri5X14GAgXhaHii3GnPAEERYPJgZJDncDU",Nr=(t,e)=>V[t]&&e===1,Mn=(t,e="hex")=>z(t,e,248),nl=t=>de(Mn(t,"hex")),ol=(t,e="hex")=>{let r=z(t,e,248),n=Number(C(r.subarray(32,40),"8B")),o=Number(C(r.subarray(104,112),"8B"));return{loginAddress:String(C(r.subarray(0,32),"address",n)),loginChainId:n,tokenIndex:String(C(r.subarray(40,72),"token",o)),tokenChainId:o,recipient:String(C(r.subarray(72,104),"address",o)),recipientChainId:o,tokenAmount:String(C(r.subarray(112,144),"32B")),isNative:!!C(r.subarray(144,145),"bool"),fee:Number(C(r.subarray(145,177),"32B")),random:Number(C(r.subarray(177,185),"8B"))}},il=(t,e)=>{let{loginAddress:r,loginChainId:n,recipient:o,recipientChainId:i,tokenAmount:a,tokenIndex:u,isNative:d,fee:l,random:g,solanaUsdc:m}=t,b=G(o,i);if(Nr(String(u),i)){let q=new X(m),we=Un(q,new X(o));console.log("associatedTokenAddress",we.toBase58()),b=G(we.toBase58(),i)}let f=Se(r,n,u,i),I=B([f.slice(0,72),b,E(i,"8B"),$(a),E(+d,"bool"),$(l),E(g,"8B")]);return De(e||JSON.stringify(t),I)},Ln={EVM:5,ALGORAND:8,SOLANA:1},al=t=>{let e=[E(t.address,"address",Ln[t.type]),E(t.name,"str"),E(t.type,"str"),E(t.description||"","str")],r=s.concat(e),n=yr(t.address);return De(n,r)};export{Bn as ASSOCIATED_TOKEN_PROGRAM_ID,tl as SOLANA_USDC,Pn as TOKEN_PROGRAM_ID,nl as calcWithdrawHash,al as createWithdrawalWalletMsg,ol as decodeWithdrawMsg,Un as getAssociatedTokenAddressSync,rl as getSolanaUsdc,Mn as getWithdrawBytesFromMsg,Nr as isSolanaCctp,il as makeWithdrawMsg};
|
|
3
3
|
/*!
|
|
4
4
|
* The buffer module from node.js, for the browser.
|
|
5
5
|
*
|