@ultrade/shared 1.0.16 → 1.0.18
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/common/index.js +1 -1
- package/dist/browser/common/mappers/index.js +1 -1
- package/dist/browser/common/mappers/trade.mapper.js +1 -1
- package/dist/browser/constants/index.js +1 -1
- package/dist/browser/enums/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/order.helper.js +1 -1
- package/dist/browser/helpers/pair.helper.js +1 -1
- package/dist/browser/helpers/withdraw.helper.js +2 -2
- package/dist/browser/interfaces/index.js +1 -1
- package/dist/constants/settings.d.ts +2 -0
- package/dist/enums/index.d.ts +1 -0
- package/dist/enums/settings.enum.d.ts +37 -0
- package/dist/helpers/codex.helper.d.ts +2 -2
- package/dist/interfaces/index.d.ts +1 -0
- package/dist/interfaces/order.interface.d.ts +1 -1
- package/dist/interfaces/pair.interface.d.ts +13 -0
- package/dist/interfaces/settings.interface.d.ts +25 -0
- package/dist/node/common/index.js +1 -1
- package/dist/node/common/mappers/index.js +1 -1
- package/dist/node/common/mappers/trade.mapper.js +1 -1
- package/dist/node/constants/index.js +1 -1
- package/dist/node/enums/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/order.helper.js +1 -1
- package/dist/node/helpers/pair.helper.js +1 -1
- package/dist/node/helpers/withdraw.helper.js +2 -2
- package/dist/node/interfaces/index.js +1 -1
- package/package.json +27 -10
|
@@ -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,U,G=-1;function pe(){!F||!U||(F=!1,U.length?B=U.concat(B):G=-1,B.length&&xr())}function xr(){if(!F){var t=hr(pe);F=!0;for(var r=B.length;r;){for(U=B,B=[];++G<r;)U&&U[G].run();G=-1,r=B.length}U=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 P(){}var Te=P,ye=P,_e=P,Ie=P,we=P,Ne=P,Re=P;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 Ue=new Date;function Pe(){var t=new Date,r=t-Ue;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:Pe},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),Ur(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),Ur(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 Ur(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 Tu 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 Pr(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?Pr(t):Pr(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 Ut(t){if(t=Pt(t).replace(kt,""),t.length<2)return"";for(;t.length%4!==0;)t=t+"=";return t}function Pt(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(Ut(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 Un}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 nu 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 ic 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 yc 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(un(n,e)),n])},se=t=>{switch(t){case"ALGORAND":return 8;case"SOLANA":return 1;case"EVM":return 5;default:return 5}};function on(t){let r=x.fromSigned(s.from(t));return BigInt(r.toString())}function ln(t){return x.toUnsigned(new x.BN(String(t)))}function an(t){let r=ln(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 sn=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(!dn(e))throw new Error("Invalid hex address");return e},pn=t=>new Uint8Array(x.setLengthLeft(mr(t),32)),mr=t=>s.from(mn(t),"hex"),mn=t=>t.startsWith("0x")?t.slice(2):t,dn=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)},
|
|
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(un(n,e)),n])},se=t=>{switch(t){case"ALGORAND":return 8;case"SOLANA":return 1;case"EVM":return 5;default:return 5}};function on(t){let r=x.fromSigned(s.from(t));return BigInt(r.toString())}function ln(t){return x.toUnsigned(new x.BN(String(t)))}function an(t){let r=ln(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 sn=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(!dn(e))throw new Error("Invalid hex address");return e},pn=t=>new Uint8Array(x.setLengthLeft(mr(t),32)),mr=t=>s.from(mn(t),"hex"),mn=t=>t.startsWith("0x")?t.slice(2):t,dn=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)},Pu=(t,r,e,n)=>fn(ae(e,n,se("EVM")),t,r),fn=(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{on as decode32Bytes,pn as decodeAndNormalizeAddress,mr as decodeHexString,an as encode32Bytes,sn as encodeAddress,ln as encodeBigNumber,dn as isAddress,oe as keccak256,ce as recoverPublicKey,mn as unpadHexPrefix,fn as verifyMessage,Pu as verifySignature};
|
|
3
3
|
/*!
|
|
4
4
|
* The buffer module from node.js, for the browser.
|
|
5
5
|
*
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
function K(){throw new Error("setTimeout has not been defined")}function z(){throw new Error("clearTimeout has not been defined")}var d=K,N=z;typeof globalThis.setTimeout=="function"&&(d=setTimeout);typeof globalThis.clearTimeout=="function"&&(N=clearTimeout);function J(e){if(d===setTimeout)return setTimeout(e,0);if((d===K||!d)&&setTimeout)return d=setTimeout,setTimeout(e,0);try{return d(e,0)}catch{try{return d.call(null,e,0)}catch{return d.call(this,e,0)}}}function Ir(e){if(N===clearTimeout)return clearTimeout(e);if((N===z||!N)&&clearTimeout)return N=clearTimeout,clearTimeout(e);try{return N(e)}catch{try{return N.call(null,e)}catch{return N.call(this,e)}}}var T=[],v=!1,b,U=-1;function Ar(){!v||!b||(v=!1,b.length?T=b.concat(T):U=-1,T.length&&X())}function X(){if(!v){var e=J(Ar);v=!0;for(var r=T.length;r;){for(b=T,T=[];++U<r;)b&&b[U].run();U=-1,r=T.length}b=null,v=!1,Ir(e)}}function _r(e){var r=new Array(arguments.length-1);if(arguments.length>1)for(var t=1;t<arguments.length;t++)r[t-1]=arguments[t];T.push(new q(e,r)),T.length===1&&!v&&J(X)}function q(e,r){this.fun=e,this.array=r}q.prototype.run=function(){this.fun.apply(null,this.array)};var wr="browser",Tr="browser",Rr=!0,dr={},Nr=[],br="",Cr={},gr={},Or={};function C(){}var Dr=C,vr=C,Lr=C,yr=C,Ur=C,Sr=C,Pr=C;function Br(e){throw new Error("process.binding is not supported")}function kr(){return"/"}function Mr(e){throw new Error("process.chdir is not supported")}function Yr(){return 0}var D=globalThis.performance||{},Fr=D.now||D.mozNow||D.msNow||D.oNow||D.webkitNow||function(){return new Date().getTime()};function Gr(e){var r=Fr.call(D)*.001,t=Math.floor(r),i=Math.floor(r%1*1e9);return e&&(t=t-e[0],i=i-e[1],i<0&&(t--,i+=1e9)),[t,i]}var Wr=new Date;function Vr(){var e=new Date,r=e-Wr;return r/1e3}var l={nextTick:_r,title:wr,browser:Rr,env:dr,argv:Nr,version:br,versions:Cr,on:Dr,addListener:vr,once:Lr,off:yr,removeListener:Ur,removeAllListeners:Sr,emit:Pr,binding:Br,cwd:kr,chdir:Mr,umask:Yr,hrtime:Gr,platform:Tr,release:gr,config:Or,uptime:Vr},H={};Object.keys(H).forEach(e=>{let r=e.split("."),t=l;for(let i=0;i<r.length;i++){let n=r[i];i===r.length-1?t[n]=H[e]:t=t[n]||(t[n]={})}});var _=[],I=[],Hr=typeof Uint8Array<"u"?Uint8Array:Array,G=!1;function j(){G=!0;for(var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",r=0,t=e.length;r<t;++r)_[r]=e[r],I[e.charCodeAt(r)]=r;I[45]=62,I[95]=63}function Kr(e){G||j();var r,t,i,n,o,p,c=e.length;if(c%4>0)throw new Error("Invalid string. Length must be a multiple of 4");o=e[c-2]==="="?2:e[c-1]==="="?1:0,p=new Hr(c*3/4-o),i=o>0?c-4:c;var a=0;for(r=0,t=0;r<i;r+=4,t+=3)n=I[e.charCodeAt(r)]<<18|I[e.charCodeAt(r+1)]<<12|I[e.charCodeAt(r+2)]<<6|I[e.charCodeAt(r+3)],p[a++]=n>>16&255,p[a++]=n>>8&255,p[a++]=n&255;return o===2?(n=I[e.charCodeAt(r)]<<2|I[e.charCodeAt(r+1)]>>4,p[a++]=n&255):o===1&&(n=I[e.charCodeAt(r)]<<10|I[e.charCodeAt(r+1)]<<4|I[e.charCodeAt(r+2)]>>2,p[a++]=n>>8&255,p[a++]=n&255),p}function zr(e){return _[e>>18&63]+_[e>>12&63]+_[e>>6&63]+_[e&63]}function Jr(e,r,t){for(var i,n=[],o=r;o<t;o+=3)i=(e[o]<<16)+(e[o+1]<<8)+e[o+2],n.push(zr(i));return n.join("")}function Q(e){G||j();for(var r,t=e.length,i=t%3,n="",o=[],p=16383,c=0,a=t-i;c<a;c+=p)o.push(Jr(e,c,c+p>a?a:c+p));return i===1?(r=e[t-1],n+=_[r>>2],n+=_[r<<4&63],n+="=="):i===2&&(r=(e[t-2]<<8)+e[t-1],n+=_[r>>10],n+=_[r>>4&63],n+=_[r<<2&63],n+="="),o.push(n),o.join("")}h.TYPED_ARRAY_SUPPORT=globalThis.TYPED_ARRAY_SUPPORT!==void 0?globalThis.TYPED_ARRAY_SUPPORT:!0;function S(){return h.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function R(e,r){if(S()<r)throw new RangeError("Invalid typed array length");return h.TYPED_ARRAY_SUPPORT?(e=new Uint8Array(r),e.__proto__=h.prototype):(e===null&&(e=new h(r)),e.length=r),e}function h(e,r,t){if(!h.TYPED_ARRAY_SUPPORT&&!(this instanceof h))return new h(e,r,t);if(typeof e=="number"){if(typeof r=="string")throw new Error("If encoding is specified then the first argument must be a string");return W(this,e)}return rr(this,e,r,t)}h.poolSize=8192;h._augment=function(e){return e.__proto__=h.prototype,e};function rr(e,r,t,i){if(typeof r=="number")throw new TypeError('"value" argument must not be a number');return typeof ArrayBuffer<"u"&&r instanceof ArrayBuffer?Qr(e,r,t,i):typeof r=="string"?qr(e,r,t):Zr(e,r)}h.from=function(e,r,t){return rr(null,e,r,t)};h.kMaxLength=S();h.TYPED_ARRAY_SUPPORT&&(h.prototype.__proto__=Uint8Array.prototype,h.__proto__=Uint8Array,typeof Symbol<"u"&&Symbol.species&&h[Symbol.species]);function tr(e){if(typeof e!="number")throw new TypeError('"size" argument must be a number');if(e<0)throw new RangeError('"size" argument must not be negative')}function Xr(e,r,t,i){return tr(r),r<=0?R(e,r):t!==void 0?typeof i=="string"?R(e,r).fill(t,i):R(e,r).fill(t):R(e,r)}h.alloc=function(e,r,t){return Xr(null,e,r,t)};function W(e,r){if(tr(r),e=R(e,r<0?0:V(r)|0),!h.TYPED_ARRAY_SUPPORT)for(var t=0;t<r;++t)e[t]=0;return e}h.allocUnsafe=function(e){return W(null,e)};h.allocUnsafeSlow=function(e){return W(null,e)};function qr(e,r,t){if((typeof t!="string"||t==="")&&(t="utf8"),!h.isEncoding(t))throw new TypeError('"encoding" must be a valid string encoding');var i=er(r,t)|0;e=R(e,i);var n=e.write(r,t);return n!==i&&(e=e.slice(0,n)),e}function F(e,r){var t=r.length<0?0:V(r.length)|0;e=R(e,t);for(var i=0;i<t;i+=1)e[i]=r[i]&255;return e}function Qr(e,r,t,i){if(r.byteLength,t<0||r.byteLength<t)throw new RangeError("'offset' is out of bounds");if(r.byteLength<t+(i||0))throw new RangeError("'length' is out of bounds");return t===void 0&&i===void 0?r=new Uint8Array(r):i===void 0?r=new Uint8Array(r,t):r=new Uint8Array(r,t,i),h.TYPED_ARRAY_SUPPORT?(e=r,e.__proto__=h.prototype):e=F(e,r),e}function Zr(e,r){if(w(r)){var t=V(r.length)|0;return e=R(e,t),e.length===0||r.copy(e,0,0,t),e}if(r){if(typeof ArrayBuffer<"u"&&r.buffer instanceof ArrayBuffer||"length"in r)return typeof r.length!="number"||xt(r.length)?R(e,0):F(e,r);if(r.type==="Buffer"&&Array.isArray(r.data))return F(e,r.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function V(e){if(e>=S())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+S().toString(16)+" bytes");return e|0}h.isBuffer=It;function w(e){return!!(e!=null&&e._isBuffer)}h.compare=function(r,t){if(!w(r)||!w(t))throw new TypeError("Arguments must be Buffers");if(r===t)return 0;for(var i=r.length,n=t.length,o=0,p=Math.min(i,n);o<p;++o)if(r[o]!==t[o]){i=r[o],n=t[o];break}return i<n?-1:n<i?1:0};h.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}};h.concat=function(r,t){if(!Array.isArray(r))throw new TypeError('"list" argument must be an Array of Buffers');if(r.length===0)return h.alloc(0);var i;if(t===void 0)for(t=0,i=0;i<r.length;++i)t+=r[i].length;var n=h.allocUnsafe(t),o=0;for(i=0;i<r.length;++i){var p=r[i];if(!w(p))throw new TypeError('"list" argument must be an Array of Buffers');p.copy(n,o),o+=p.length}return n};function er(e,r){if(w(e))return e.length;if(typeof ArrayBuffer<"u"&&typeof ArrayBuffer.isView=="function"&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;typeof e!="string"&&(e=""+e);var t=e.length;if(t===0)return 0;for(var i=!1;;)switch(r){case"ascii":case"latin1":case"binary":return t;case"utf8":case"utf-8":case void 0:return P(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return t*2;case"hex":return t>>>1;case"base64":return ar(e).length;default:if(i)return P(e).length;r=(""+r).toLowerCase(),i=!0}}h.byteLength=er;function $r(e,r,t){var i=!1;if((r===void 0||r<0)&&(r=0),r>this.length||((t===void 0||t>this.length)&&(t=this.length),t<=0)||(t>>>=0,r>>>=0,t<=r))return"";for(e||(e="utf8");;)switch(e){case"hex":return ct(this,r,t);case"utf8":case"utf-8":return or(this,r,t);case"ascii":return pt(this,r,t);case"latin1":case"binary":return ht(this,r,t);case"base64":return nt(this,r,t);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return at(this,r,t);default:if(i)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),i=!0}}h.prototype._isBuffer=!0;function g(e,r,t){var i=e[r];e[r]=e[t],e[t]=i}h.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 t=0;t<r;t+=2)g(this,t,t+1);return this};h.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 t=0;t<r;t+=4)g(this,t,t+3),g(this,t+1,t+2);return this};h.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 t=0;t<r;t+=8)g(this,t,t+7),g(this,t+1,t+6),g(this,t+2,t+5),g(this,t+3,t+4);return this};h.prototype.toString=function(){var r=this.length|0;return r===0?"":arguments.length===0?or(this,0,r):$r.apply(this,arguments)};h.prototype.equals=function(r){if(!w(r))throw new TypeError("Argument must be a Buffer");return this===r?!0:h.compare(this,r)===0};h.prototype.compare=function(r,t,i,n,o){if(!w(r))throw new TypeError("Argument must be a Buffer");if(t===void 0&&(t=0),i===void 0&&(i=r?r.length:0),n===void 0&&(n=0),o===void 0&&(o=this.length),t<0||i>r.length||n<0||o>this.length)throw new RangeError("out of range index");if(n>=o&&t>=i)return 0;if(n>=o)return-1;if(t>=i)return 1;if(t>>>=0,i>>>=0,n>>>=0,o>>>=0,this===r)return 0;for(var p=o-n,c=i-t,a=Math.min(p,c),f=this.slice(n,o),u=r.slice(t,i),s=0;s<a;++s)if(f[s]!==u[s]){p=f[s],c=u[s];break}return p<c?-1:c<p?1:0};function ir(e,r,t,i,n){if(e.length===0)return-1;if(typeof t=="string"?(i=t,t=0):t>2147483647?t=2147483647:t<-2147483648&&(t=-2147483648),t=+t,isNaN(t)&&(t=n?0:e.length-1),t<0&&(t=e.length+t),t>=e.length){if(n)return-1;t=e.length-1}else if(t<0)if(n)t=0;else return-1;if(typeof r=="string"&&(r=h.from(r,i)),w(r))return r.length===0?-1:Z(e,r,t,i,n);if(typeof r=="number")return r=r&255,h.TYPED_ARRAY_SUPPORT&&typeof Uint8Array.prototype.indexOf=="function"?n?Uint8Array.prototype.indexOf.call(e,r,t):Uint8Array.prototype.lastIndexOf.call(e,r,t):Z(e,[r],t,i,n);throw new TypeError("val must be string, number or Buffer")}function Z(e,r,t,i,n){var o=1,p=e.length,c=r.length;if(i!==void 0&&(i=String(i).toLowerCase(),i==="ucs2"||i==="ucs-2"||i==="utf16le"||i==="utf-16le")){if(e.length<2||r.length<2)return-1;o=2,p/=2,c/=2,t/=2}function a(x,O){return o===1?x[O]:x.readUInt16BE(O*o)}var f;if(n){var u=-1;for(f=t;f<p;f++)if(a(e,f)===a(r,u===-1?0:f-u)){if(u===-1&&(u=f),f-u+1===c)return u*o}else u!==-1&&(f-=f-u),u=-1}else for(t+c>p&&(t=p-c),f=t;f>=0;f--){for(var s=!0,A=0;A<c;A++)if(a(e,f+A)!==a(r,A)){s=!1;break}if(s)return f}return-1}h.prototype.includes=function(r,t,i){return this.indexOf(r,t,i)!==-1};h.prototype.indexOf=function(r,t,i){return ir(this,r,t,i,!0)};h.prototype.lastIndexOf=function(r,t,i){return ir(this,r,t,i,!1)};function jr(e,r,t,i){t=Number(t)||0;var n=e.length-t;i?(i=Number(i),i>n&&(i=n)):i=n;var o=r.length;if(o%2!==0)throw new TypeError("Invalid hex string");i>o/2&&(i=o/2);for(var p=0;p<i;++p){var c=parseInt(r.substr(p*2,2),16);if(isNaN(c))return p;e[t+p]=c}return p}function rt(e,r,t,i){return M(P(r,e.length-t),e,t,i)}function nr(e,r,t,i){return M(Et(r),e,t,i)}function tt(e,r,t,i){return nr(e,r,t,i)}function et(e,r,t,i){return M(ar(r),e,t,i)}function it(e,r,t,i){return M(mt(r,e.length-t),e,t,i)}h.prototype.write=function(r,t,i,n){if(t===void 0)n="utf8",i=this.length,t=0;else if(i===void 0&&typeof t=="string")n=t,i=this.length,t=0;else if(isFinite(t))t=t|0,isFinite(i)?(i=i|0,n===void 0&&(n="utf8")):(n=i,i=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var o=this.length-t;if((i===void 0||i>o)&&(i=o),r.length>0&&(i<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var p=!1;;)switch(n){case"hex":return jr(this,r,t,i);case"utf8":case"utf-8":return rt(this,r,t,i);case"ascii":return nr(this,r,t,i);case"latin1":case"binary":return tt(this,r,t,i);case"base64":return et(this,r,t,i);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return it(this,r,t,i);default:if(p)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),p=!0}};h.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function nt(e,r,t){return r===0&&t===e.length?Q(e):Q(e.slice(r,t))}function or(e,r,t){t=Math.min(e.length,t);for(var i=[],n=r;n<t;){var o=e[n],p=null,c=o>239?4:o>223?3:o>191?2:1;if(n+c<=t){var a,f,u,s;switch(c){case 1:o<128&&(p=o);break;case 2:a=e[n+1],(a&192)===128&&(s=(o&31)<<6|a&63,s>127&&(p=s));break;case 3:a=e[n+1],f=e[n+2],(a&192)===128&&(f&192)===128&&(s=(o&15)<<12|(a&63)<<6|f&63,s>2047&&(s<55296||s>57343)&&(p=s));break;case 4:a=e[n+1],f=e[n+2],u=e[n+3],(a&192)===128&&(f&192)===128&&(u&192)===128&&(s=(o&15)<<18|(a&63)<<12|(f&63)<<6|u&63,s>65535&&s<1114112&&(p=s))}}p===null?(p=65533,c=1):p>65535&&(p-=65536,i.push(p>>>10&1023|55296),p=56320|p&1023),i.push(p),n+=c}return ot(i)}var $=4096;function ot(e){var r=e.length;if(r<=$)return String.fromCharCode.apply(String,e);for(var t="",i=0;i<r;)t+=String.fromCharCode.apply(String,e.slice(i,i+=$));return t}function pt(e,r,t){var i="";t=Math.min(e.length,t);for(var n=r;n<t;++n)i+=String.fromCharCode(e[n]&127);return i}function ht(e,r,t){var i="";t=Math.min(e.length,t);for(var n=r;n<t;++n)i+=String.fromCharCode(e[n]);return i}function ct(e,r,t){var i=e.length;(!r||r<0)&&(r=0),(!t||t<0||t>i)&&(t=i);for(var n="",o=r;o<t;++o)n+=lt(e[o]);return n}function at(e,r,t){for(var i=e.slice(r,t),n="",o=0;o<i.length;o+=2)n+=String.fromCharCode(i[o]+i[o+1]*256);return n}h.prototype.slice=function(r,t){var i=this.length;r=~~r,t=t===void 0?i:~~t,r<0?(r+=i,r<0&&(r=0)):r>i&&(r=i),t<0?(t+=i,t<0&&(t=0)):t>i&&(t=i),t<r&&(t=r);var n;if(h.TYPED_ARRAY_SUPPORT)n=this.subarray(r,t),n.__proto__=h.prototype;else{var o=t-r;n=new h(o,void 0);for(var p=0;p<o;++p)n[p]=this[p+r]}return n};function E(e,r,t){if(e%1!==0||e<0)throw new RangeError("offset is not uint");if(e+r>t)throw new RangeError("Trying to access beyond buffer length")}h.prototype.readUIntLE=function(r,t,i){r=r|0,t=t|0,i||E(r,t,this.length);for(var n=this[r],o=1,p=0;++p<t&&(o*=256);)n+=this[r+p]*o;return n};h.prototype.readUIntBE=function(r,t,i){r=r|0,t=t|0,i||E(r,t,this.length);for(var n=this[r+--t],o=1;t>0&&(o*=256);)n+=this[r+--t]*o;return n};h.prototype.readUInt8=function(r,t){return t||E(r,1,this.length),this[r]};h.prototype.readUInt16LE=function(r,t){return t||E(r,2,this.length),this[r]|this[r+1]<<8};h.prototype.readUInt16BE=function(r,t){return t||E(r,2,this.length),this[r]<<8|this[r+1]};h.prototype.readUInt32LE=function(r,t){return t||E(r,4,this.length),(this[r]|this[r+1]<<8|this[r+2]<<16)+this[r+3]*16777216};h.prototype.readUInt32BE=function(r,t){return t||E(r,4,this.length),this[r]*16777216+(this[r+1]<<16|this[r+2]<<8|this[r+3])};h.prototype.readIntLE=function(r,t,i){r=r|0,t=t|0,i||E(r,t,this.length);for(var n=this[r],o=1,p=0;++p<t&&(o*=256);)n+=this[r+p]*o;return o*=128,n>=o&&(n-=Math.pow(2,8*t)),n};h.prototype.readIntBE=function(r,t,i){r=r|0,t=t|0,i||E(r,t,this.length);for(var n=t,o=1,p=this[r+--n];n>0&&(o*=256);)p+=this[r+--n]*o;return o*=128,p>=o&&(p-=Math.pow(2,8*t)),p};h.prototype.readInt8=function(r,t){return t||E(r,1,this.length),this[r]&128?(255-this[r]+1)*-1:this[r]};h.prototype.readInt16LE=function(r,t){t||E(r,2,this.length);var i=this[r]|this[r+1]<<8;return i&32768?i|4294901760:i};h.prototype.readInt16BE=function(r,t){t||E(r,2,this.length);var i=this[r+1]|this[r]<<8;return i&32768?i|4294901760:i};h.prototype.readInt32LE=function(r,t){return t||E(r,4,this.length),this[r]|this[r+1]<<8|this[r+2]<<16|this[r+3]<<24};h.prototype.readInt32BE=function(r,t){return t||E(r,4,this.length),this[r]<<24|this[r+1]<<16|this[r+2]<<8|this[r+3]};h.prototype.readFloatLE=function(r,t){return t||E(r,4,this.length),Y(this,r,!0,23,4)};h.prototype.readFloatBE=function(r,t){return t||E(r,4,this.length),Y(this,r,!1,23,4)};h.prototype.readDoubleLE=function(r,t){return t||E(r,8,this.length),Y(this,r,!0,52,8)};h.prototype.readDoubleBE=function(r,t){return t||E(r,8,this.length),Y(this,r,!1,52,8)};function m(e,r,t,i,n,o){if(!w(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(r>n||r<o)throw new RangeError('"value" argument is out of bounds');if(t+i>e.length)throw new RangeError("Index out of range")}h.prototype.writeUIntLE=function(r,t,i,n){if(r=+r,t=t|0,i=i|0,!n){var o=Math.pow(2,8*i)-1;m(this,r,t,i,o,0)}var p=1,c=0;for(this[t]=r&255;++c<i&&(p*=256);)this[t+c]=r/p&255;return t+i};h.prototype.writeUIntBE=function(r,t,i,n){if(r=+r,t=t|0,i=i|0,!n){var o=Math.pow(2,8*i)-1;m(this,r,t,i,o,0)}var p=i-1,c=1;for(this[t+p]=r&255;--p>=0&&(c*=256);)this[t+p]=r/c&255;return t+i};h.prototype.writeUInt8=function(r,t,i){return r=+r,t=t|0,i||m(this,r,t,1,255,0),h.TYPED_ARRAY_SUPPORT||(r=Math.floor(r)),this[t]=r&255,t+1};function B(e,r,t,i){r<0&&(r=65535+r+1);for(var n=0,o=Math.min(e.length-t,2);n<o;++n)e[t+n]=(r&255<<8*(i?n:1-n))>>>(i?n:1-n)*8}h.prototype.writeUInt16LE=function(r,t,i){return r=+r,t=t|0,i||m(this,r,t,2,65535,0),h.TYPED_ARRAY_SUPPORT?(this[t]=r&255,this[t+1]=r>>>8):B(this,r,t,!0),t+2};h.prototype.writeUInt16BE=function(r,t,i){return r=+r,t=t|0,i||m(this,r,t,2,65535,0),h.TYPED_ARRAY_SUPPORT?(this[t]=r>>>8,this[t+1]=r&255):B(this,r,t,!1),t+2};function k(e,r,t,i){r<0&&(r=4294967295+r+1);for(var n=0,o=Math.min(e.length-t,4);n<o;++n)e[t+n]=r>>>(i?n:3-n)*8&255}h.prototype.writeUInt32LE=function(r,t,i){return r=+r,t=t|0,i||m(this,r,t,4,4294967295,0),h.TYPED_ARRAY_SUPPORT?(this[t+3]=r>>>24,this[t+2]=r>>>16,this[t+1]=r>>>8,this[t]=r&255):k(this,r,t,!0),t+4};h.prototype.writeUInt32BE=function(r,t,i){return r=+r,t=t|0,i||m(this,r,t,4,4294967295,0),h.TYPED_ARRAY_SUPPORT?(this[t]=r>>>24,this[t+1]=r>>>16,this[t+2]=r>>>8,this[t+3]=r&255):k(this,r,t,!1),t+4};h.prototype.writeIntLE=function(r,t,i,n){if(r=+r,t=t|0,!n){var o=Math.pow(2,8*i-1);m(this,r,t,i,o-1,-o)}var p=0,c=1,a=0;for(this[t]=r&255;++p<i&&(c*=256);)r<0&&a===0&&this[t+p-1]!==0&&(a=1),this[t+p]=(r/c>>0)-a&255;return t+i};h.prototype.writeIntBE=function(r,t,i,n){if(r=+r,t=t|0,!n){var o=Math.pow(2,8*i-1);m(this,r,t,i,o-1,-o)}var p=i-1,c=1,a=0;for(this[t+p]=r&255;--p>=0&&(c*=256);)r<0&&a===0&&this[t+p+1]!==0&&(a=1),this[t+p]=(r/c>>0)-a&255;return t+i};h.prototype.writeInt8=function(r,t,i){return r=+r,t=t|0,i||m(this,r,t,1,127,-128),h.TYPED_ARRAY_SUPPORT||(r=Math.floor(r)),r<0&&(r=255+r+1),this[t]=r&255,t+1};h.prototype.writeInt16LE=function(r,t,i){return r=+r,t=t|0,i||m(this,r,t,2,32767,-32768),h.TYPED_ARRAY_SUPPORT?(this[t]=r&255,this[t+1]=r>>>8):B(this,r,t,!0),t+2};h.prototype.writeInt16BE=function(r,t,i){return r=+r,t=t|0,i||m(this,r,t,2,32767,-32768),h.TYPED_ARRAY_SUPPORT?(this[t]=r>>>8,this[t+1]=r&255):B(this,r,t,!1),t+2};h.prototype.writeInt32LE=function(r,t,i){return r=+r,t=t|0,i||m(this,r,t,4,2147483647,-2147483648),h.TYPED_ARRAY_SUPPORT?(this[t]=r&255,this[t+1]=r>>>8,this[t+2]=r>>>16,this[t+3]=r>>>24):k(this,r,t,!0),t+4};h.prototype.writeInt32BE=function(r,t,i){return r=+r,t=t|0,i||m(this,r,t,4,2147483647,-2147483648),r<0&&(r=4294967295+r+1),h.TYPED_ARRAY_SUPPORT?(this[t]=r>>>24,this[t+1]=r>>>16,this[t+2]=r>>>8,this[t+3]=r&255):k(this,r,t,!1),t+4};function pr(e,r,t,i,n,o){if(t+i>e.length)throw new RangeError("Index out of range");if(t<0)throw new RangeError("Index out of range")}function hr(e,r,t,i,n){return n||pr(e,r,t,4,34028234663852886e22,-34028234663852886e22),fr(e,r,t,i,23,4),t+4}h.prototype.writeFloatLE=function(r,t,i){return hr(this,r,t,!0,i)};h.prototype.writeFloatBE=function(r,t,i){return hr(this,r,t,!1,i)};function cr(e,r,t,i,n){return n||pr(e,r,t,8,17976931348623157e292,-17976931348623157e292),fr(e,r,t,i,52,8),t+8}h.prototype.writeDoubleLE=function(r,t,i){return cr(this,r,t,!0,i)};h.prototype.writeDoubleBE=function(r,t,i){return cr(this,r,t,!1,i)};h.prototype.copy=function(r,t,i,n){if(i||(i=0),!n&&n!==0&&(n=this.length),t>=r.length&&(t=r.length),t||(t=0),n>0&&n<i&&(n=i),n===i||r.length===0||this.length===0)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(i<0||i>=this.length)throw new RangeError("sourceStart out of bounds");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),r.length-t<n-i&&(n=r.length-t+i);var o=n-i,p;if(this===r&&i<t&&t<n)for(p=o-1;p>=0;--p)r[p+t]=this[p+i];else if(o<1e3||!h.TYPED_ARRAY_SUPPORT)for(p=0;p<o;++p)r[p+t]=this[p+i];else Uint8Array.prototype.set.call(r,this.subarray(i,i+o),t);return o};h.prototype.fill=function(r,t,i,n){if(typeof r=="string"){if(typeof t=="string"?(n=t,t=0,i=this.length):typeof i=="string"&&(n=i,i=this.length),r.length===1){var o=r.charCodeAt(0);o<256&&(r=o)}if(n!==void 0&&typeof n!="string")throw new TypeError("encoding must be a string");if(typeof n=="string"&&!h.isEncoding(n))throw new TypeError("Unknown encoding: "+n)}else typeof r=="number"&&(r=r&255);if(t<0||this.length<t||this.length<i)throw new RangeError("Out of range index");if(i<=t)return this;t=t>>>0,i=i===void 0?this.length:i>>>0,r||(r=0);var p;if(typeof r=="number")for(p=t;p<i;++p)this[p]=r;else{var c=w(r)?r:P(new h(r,n).toString()),a=c.length;for(p=0;p<i-t;++p)this[p+t]=c[p%a]}return this};var st=/[^+\/0-9A-Za-z-_]/g;function ft(e){if(e=ut(e).replace(st,""),e.length<2)return"";for(;e.length%4!==0;)e=e+"=";return e}function ut(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}function lt(e){return e<16?"0"+e.toString(16):e.toString(16)}function P(e,r){r=r||1/0;for(var t,i=e.length,n=null,o=[],p=0;p<i;++p){if(t=e.charCodeAt(p),t>55295&&t<57344){if(!n){if(t>56319){(r-=3)>-1&&o.push(239,191,189);continue}else if(p+1===i){(r-=3)>-1&&o.push(239,191,189);continue}n=t;continue}if(t<56320){(r-=3)>-1&&o.push(239,191,189),n=t;continue}t=(n-55296<<10|t-56320)+65536}else n&&(r-=3)>-1&&o.push(239,191,189);if(n=null,t<128){if((r-=1)<0)break;o.push(t)}else if(t<2048){if((r-=2)<0)break;o.push(t>>6|192,t&63|128)}else if(t<65536){if((r-=3)<0)break;o.push(t>>12|224,t>>6&63|128,t&63|128)}else if(t<1114112){if((r-=4)<0)break;o.push(t>>18|240,t>>12&63|128,t>>6&63|128,t&63|128)}else throw new Error("Invalid code point")}return o}function Et(e){for(var r=[],t=0;t<e.length;++t)r.push(e.charCodeAt(t)&255);return r}function mt(e,r){for(var t,i,n,o=[],p=0;p<e.length&&!((r-=2)<0);++p)t=e.charCodeAt(p),i=t>>8,n=t%256,o.push(n),o.push(i);return o}function ar(e){return Kr(ft(e))}function M(e,r,t,i){for(var n=0;n<i&&!(n+t>=r.length||n>=e.length);++n)r[n+t]=e[n];return n}function xt(e){return e!==e}function It(e){return e!=null&&(!!e._isBuffer||sr(e)||At(e))}function sr(e){return!!e.constructor&&typeof e.constructor.isBuffer=="function"&&e.constructor.isBuffer(e)}function At(e){return typeof e.readFloatLE=="function"&&typeof e.slice=="function"&&sr(e.slice(0,0))}function Y(e,r,t,i,n){var o,p,c=n*8-i-1,a=(1<<c)-1,f=a>>1,u=-7,s=t?n-1:0,A=t?-1:1,x=e[r+s];for(s+=A,o=x&(1<<-u)-1,x>>=-u,u+=c;u>0;o=o*256+e[r+s],s+=A,u-=8);for(p=o&(1<<-u)-1,o>>=-u,u+=i;u>0;p=p*256+e[r+s],s+=A,u-=8);if(o===0)o=1-f;else{if(o===a)return p?NaN:(x?-1:1)*(1/0);p=p+Math.pow(2,i),o=o-f}return(x?-1:1)*p*Math.pow(2,o-i)}function fr(e,r,t,i,n,o){var p,c,a,f=o*8-n-1,u=(1<<f)-1,s=u>>1,A=n===23?Math.pow(2,-24)-Math.pow(2,-77):0,x=i?0:o-1,O=i?1:-1,xr=r<0||r===0&&1/r<0?1:0;for(r=Math.abs(r),isNaN(r)||r===1/0?(c=isNaN(r)?1:0,p=u):(p=Math.floor(Math.log(r)/Math.LN2),r*(a=Math.pow(2,-p))<1&&(p--,a*=2),p+s>=1?r+=A/a:r+=A*Math.pow(2,1-s),r*a>=2&&(p++,a/=2),p+s>=u?(c=0,p=u):p+s>=1?(c=(r*a-1)*Math.pow(2,n),p=p+s):(c=r*Math.pow(2,s-1)*Math.pow(2,n),p=0));n>=8;e[t+x]=c&255,x+=O,c/=256,n-=8);for(p=p<<n|c,f+=n;f>0;e[t+x]=p&255,x+=O,p/=256,f-=8);e[t+x-O]|=xr*128}var ur=(t=>(t[t.Buy=0]="Buy",t[t.Sell=1]="Sell",t))(ur||{}),L=ur;var lr=(n=>(n[n.Limit=0]="Limit",n[n.IOC=1]="IOC",n[n.POST=2]="POST",n[n.Market=3]="Market",n))(lr||{}),y=lr;var Er=(n=>(n.GLOBAL_PAIR_DELISTING="GLOBAL_PAIR_DELISTING",n.GLOBAL_NEW_PAIR_LISTING="GLOBAL_NEW_PAIR_LISTING",n.GLOBAL_SYSTEM_MAINTENANCE="GLOBAL_SYSTEM_MAINTENANCE",n.GLOBAL_SMART_CONTRACT_UPDATE="GLOBAL_SMART_CONTRACT_UPDATE",n))(Er||{}),mr=(i=>(i.ACCOUNT_POINTS_UNLOCK_ACHIEVEMENT="ACCOUNT_POINTS_UNLOCK_ACHIEVEMENT",i.ACCOUNT_KYC_STATUS_CHANGED="ACCOUNT_KYC_STATUS_CHANGED",i.ACCOUNT_AFFILIATE_DASHBOARD_UNLOCKED="ACCOUNT_AFFILIATE_DASHBOARD_UNLOCKED",i))(mr||{}),Oe={...Er,...mr};function Di(e){switch(e){case"B":return L.Buy;case"S":return L.Sell;default:throw new Error("Unknown order side short type: "+e)}}function vi(e){switch(e){case L.Buy:return"B";case L.Sell:return"S";default:throw new Error("Unknown order side type: "+e)}}function Li(e){switch(e){case"I":return y.IOC;case"P":return y.POST;case"M":return y.Market;case"L":default:return y.Limit}}function yi(e){switch(e){case"B":return"BUY";case"S":return"SELL";default:throw new Error("Unknown order side short type: "+e)}}function Ui(e){switch(e){case"I":return"IOC";case"P":return"POST";case"M":return"Market";case"L":default:return"Limit"}}export{Di as mapOrderSideFromShort,yi as mapOrderSideFromShortToLong,vi as mapOrderSideToShort,Li as mapOrderTypeShort,Ui as mapOrderTypeShortToLong};
|
|
1
|
+
function K(){throw new Error("setTimeout has not been defined")}function z(){throw new Error("clearTimeout has not been defined")}var N=K,d=z;typeof globalThis.setTimeout=="function"&&(N=setTimeout);typeof globalThis.clearTimeout=="function"&&(d=clearTimeout);function J(t){if(N===setTimeout)return setTimeout(t,0);if((N===K||!N)&&setTimeout)return N=setTimeout,setTimeout(t,0);try{return N(t,0)}catch{try{return N.call(null,t,0)}catch{return N.call(this,t,0)}}}function _r(t){if(d===clearTimeout)return clearTimeout(t);if((d===z||!d)&&clearTimeout)return d=clearTimeout,clearTimeout(t);try{return d(t)}catch{try{return d.call(null,t)}catch{return d.call(this,t)}}}var I=[],y=!1,b,U=-1;function xr(){!y||!b||(y=!1,b.length?I=b.concat(I):U=-1,I.length&&X())}function X(){if(!y){var t=J(xr);y=!0;for(var r=I.length;r;){for(b=I,I=[];++U<r;)b&&b[U].run();U=-1,r=I.length}b=null,y=!1,_r(t)}}function Tr(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];I.push(new q(t,r)),I.length===1&&!y&&J(X)}function q(t,r){this.fun=t,this.array=r}q.prototype.run=function(){this.fun.apply(null,this.array)};var wr="browser",Ir="browser",Rr=!0,Nr={},dr=[],br="",Cr={},Or={},Dr={};function C(){}var Lr=C,yr=C,vr=C,gr=C,Ur=C,Pr=C,Br=C;function Sr(t){throw new Error("process.binding is not supported")}function Mr(){return"/"}function Fr(t){throw new Error("process.chdir is not supported")}function kr(){return 0}var L=globalThis.performance||{},Yr=L.now||L.mozNow||L.msNow||L.oNow||L.webkitNow||function(){return new Date().getTime()};function Gr(t){var r=Yr.call(L)*.001,e=Math.floor(r),i=Math.floor(r%1*1e9);return t&&(e=e-t[0],i=i-t[1],i<0&&(e--,i+=1e9)),[e,i]}var Wr=new Date;function Hr(){var t=new Date,r=t-Wr;return r/1e3}var l={nextTick:Tr,title:wr,browser:Rr,env:Nr,argv:dr,version:br,versions:Cr,on:Lr,addListener:yr,once:vr,off:gr,removeListener:Ur,removeAllListeners:Pr,emit:Br,binding:Sr,cwd:Mr,chdir:Fr,umask:kr,hrtime:Gr,platform:Ir,release:Or,config:Dr,uptime:Hr},V={};Object.keys(V).forEach(t=>{let r=t.split("."),e=l;for(let i=0;i<r.length;i++){let n=r[i];i===r.length-1?e[n]=V[t]:e=e[n]||(e[n]={})}});var T=[],_=[],Vr=typeof Uint8Array<"u"?Uint8Array:Array,G=!1;function j(){G=!0;for(var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",r=0,e=t.length;r<e;++r)T[r]=t[r],_[t.charCodeAt(r)]=r;_[45]=62,_[95]=63}function Kr(t){G||j();var r,e,i,n,o,p,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,p=new Vr(c*3/4-o),i=o>0?c-4:c;var h=0;for(r=0,e=0;r<i;r+=4,e+=3)n=_[t.charCodeAt(r)]<<18|_[t.charCodeAt(r+1)]<<12|_[t.charCodeAt(r+2)]<<6|_[t.charCodeAt(r+3)],p[h++]=n>>16&255,p[h++]=n>>8&255,p[h++]=n&255;return o===2?(n=_[t.charCodeAt(r)]<<2|_[t.charCodeAt(r+1)]>>4,p[h++]=n&255):o===1&&(n=_[t.charCodeAt(r)]<<10|_[t.charCodeAt(r+1)]<<4|_[t.charCodeAt(r+2)]>>2,p[h++]=n>>8&255,p[h++]=n&255),p}function zr(t){return T[t>>18&63]+T[t>>12&63]+T[t>>6&63]+T[t&63]}function Jr(t,r,e){for(var i,n=[],o=r;o<e;o+=3)i=(t[o]<<16)+(t[o+1]<<8)+t[o+2],n.push(zr(i));return n.join("")}function Q(t){G||j();for(var r,e=t.length,i=e%3,n="",o=[],p=16383,c=0,h=e-i;c<h;c+=p)o.push(Jr(t,c,c+p>h?h:c+p));return i===1?(r=t[e-1],n+=T[r>>2],n+=T[r<<4&63],n+="=="):i===2&&(r=(t[e-2]<<8)+t[e-1],n+=T[r>>10],n+=T[r>>4&63],n+=T[r<<2&63],n+="="),o.push(n),o.join("")}a.TYPED_ARRAY_SUPPORT=globalThis.TYPED_ARRAY_SUPPORT!==void 0?globalThis.TYPED_ARRAY_SUPPORT:!0;function P(){return a.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function R(t,r){if(P()<r)throw new RangeError("Invalid typed array length");return a.TYPED_ARRAY_SUPPORT?(t=new Uint8Array(r),t.__proto__=a.prototype):(t===null&&(t=new a(r)),t.length=r),t}function a(t,r,e){if(!a.TYPED_ARRAY_SUPPORT&&!(this instanceof a))return new a(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 W(this,t)}return rr(this,t,r,e)}a.poolSize=8192;a._augment=function(t){return t.__proto__=a.prototype,t};function rr(t,r,e,i){if(typeof r=="number")throw new TypeError('"value" argument must not be a number');return typeof ArrayBuffer<"u"&&r instanceof ArrayBuffer?Qr(t,r,e,i):typeof r=="string"?qr(t,r,e):Zr(t,r)}a.from=function(t,r,e){return rr(null,t,r,e)};a.kMaxLength=P();a.TYPED_ARRAY_SUPPORT&&(a.prototype.__proto__=Uint8Array.prototype,a.__proto__=Uint8Array,typeof Symbol<"u"&&Symbol.species&&a[Symbol.species]);function er(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 Xr(t,r,e,i){return er(r),r<=0?R(t,r):e!==void 0?typeof i=="string"?R(t,r).fill(e,i):R(t,r).fill(e):R(t,r)}a.alloc=function(t,r,e){return Xr(null,t,r,e)};function W(t,r){if(er(r),t=R(t,r<0?0:H(r)|0),!a.TYPED_ARRAY_SUPPORT)for(var e=0;e<r;++e)t[e]=0;return t}a.allocUnsafe=function(t){return W(null,t)};a.allocUnsafeSlow=function(t){return W(null,t)};function qr(t,r,e){if((typeof e!="string"||e==="")&&(e="utf8"),!a.isEncoding(e))throw new TypeError('"encoding" must be a valid string encoding');var i=tr(r,e)|0;t=R(t,i);var n=t.write(r,e);return n!==i&&(t=t.slice(0,n)),t}function Y(t,r){var e=r.length<0?0:H(r.length)|0;t=R(t,e);for(var i=0;i<e;i+=1)t[i]=r[i]&255;return t}function Qr(t,r,e,i){if(r.byteLength,e<0||r.byteLength<e)throw new RangeError("'offset' is out of bounds");if(r.byteLength<e+(i||0))throw new RangeError("'length' is out of bounds");return e===void 0&&i===void 0?r=new Uint8Array(r):i===void 0?r=new Uint8Array(r,e):r=new Uint8Array(r,e,i),a.TYPED_ARRAY_SUPPORT?(t=r,t.__proto__=a.prototype):t=Y(t,r),t}function Zr(t,r){if(w(r)){var e=H(r.length)|0;return t=R(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"||Ae(r.length)?R(t,0):Y(t,r);if(r.type==="Buffer"&&Array.isArray(r.data))return Y(t,r.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function H(t){if(t>=P())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+P().toString(16)+" bytes");return t|0}a.isBuffer=_e;function w(t){return!!(t!=null&&t._isBuffer)}a.compare=function(r,e){if(!w(r)||!w(e))throw new TypeError("Arguments must be Buffers");if(r===e)return 0;for(var i=r.length,n=e.length,o=0,p=Math.min(i,n);o<p;++o)if(r[o]!==e[o]){i=r[o],n=e[o];break}return i<n?-1:n<i?1:0};a.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}};a.concat=function(r,e){if(!Array.isArray(r))throw new TypeError('"list" argument must be an Array of Buffers');if(r.length===0)return a.alloc(0);var i;if(e===void 0)for(e=0,i=0;i<r.length;++i)e+=r[i].length;var n=a.allocUnsafe(e),o=0;for(i=0;i<r.length;++i){var p=r[i];if(!w(p))throw new TypeError('"list" argument must be an Array of Buffers');p.copy(n,o),o+=p.length}return n};function tr(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 i=!1;;)switch(r){case"ascii":case"latin1":case"binary":return e;case"utf8":case"utf-8":case void 0:return B(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return e*2;case"hex":return e>>>1;case"base64":return hr(t).length;default:if(i)return B(t).length;r=(""+r).toLowerCase(),i=!0}}a.byteLength=tr;function $r(t,r,e){var i=!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 ce(this,r,e);case"utf8":case"utf-8":return or(this,r,e);case"ascii":return pe(this,r,e);case"latin1":case"binary":return ae(this,r,e);case"base64":return ne(this,r,e);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return he(this,r,e);default:if(i)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),i=!0}}a.prototype._isBuffer=!0;function O(t,r,e){var i=t[r];t[r]=t[e],t[e]=i}a.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)O(this,e,e+1);return this};a.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)O(this,e,e+3),O(this,e+1,e+2);return this};a.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)O(this,e,e+7),O(this,e+1,e+6),O(this,e+2,e+5),O(this,e+3,e+4);return this};a.prototype.toString=function(){var r=this.length|0;return r===0?"":arguments.length===0?or(this,0,r):$r.apply(this,arguments)};a.prototype.equals=function(r){if(!w(r))throw new TypeError("Argument must be a Buffer");return this===r?!0:a.compare(this,r)===0};a.prototype.compare=function(r,e,i,n,o){if(!w(r))throw new TypeError("Argument must be a Buffer");if(e===void 0&&(e=0),i===void 0&&(i=r?r.length:0),n===void 0&&(n=0),o===void 0&&(o=this.length),e<0||i>r.length||n<0||o>this.length)throw new RangeError("out of range index");if(n>=o&&e>=i)return 0;if(n>=o)return-1;if(e>=i)return 1;if(e>>>=0,i>>>=0,n>>>=0,o>>>=0,this===r)return 0;for(var p=o-n,c=i-e,h=Math.min(p,c),u=this.slice(n,o),f=r.slice(e,i),s=0;s<h;++s)if(u[s]!==f[s]){p=u[s],c=f[s];break}return p<c?-1:c<p?1:0};function ir(t,r,e,i,n){if(t.length===0)return-1;if(typeof e=="string"?(i=e,e=0):e>2147483647?e=2147483647:e<-2147483648&&(e=-2147483648),e=+e,isNaN(e)&&(e=n?0:t.length-1),e<0&&(e=t.length+e),e>=t.length){if(n)return-1;e=t.length-1}else if(e<0)if(n)e=0;else return-1;if(typeof r=="string"&&(r=a.from(r,i)),w(r))return r.length===0?-1:Z(t,r,e,i,n);if(typeof r=="number")return r=r&255,a.TYPED_ARRAY_SUPPORT&&typeof Uint8Array.prototype.indexOf=="function"?n?Uint8Array.prototype.indexOf.call(t,r,e):Uint8Array.prototype.lastIndexOf.call(t,r,e):Z(t,[r],e,i,n);throw new TypeError("val must be string, number or Buffer")}function Z(t,r,e,i,n){var o=1,p=t.length,c=r.length;if(i!==void 0&&(i=String(i).toLowerCase(),i==="ucs2"||i==="ucs-2"||i==="utf16le"||i==="utf-16le")){if(t.length<2||r.length<2)return-1;o=2,p/=2,c/=2,e/=2}function h(A,D){return o===1?A[D]:A.readUInt16BE(D*o)}var u;if(n){var f=-1;for(u=e;u<p;u++)if(h(t,u)===h(r,f===-1?0:u-f)){if(f===-1&&(f=u),u-f+1===c)return f*o}else f!==-1&&(u-=u-f),f=-1}else for(e+c>p&&(e=p-c),u=e;u>=0;u--){for(var s=!0,x=0;x<c;x++)if(h(t,u+x)!==h(r,x)){s=!1;break}if(s)return u}return-1}a.prototype.includes=function(r,e,i){return this.indexOf(r,e,i)!==-1};a.prototype.indexOf=function(r,e,i){return ir(this,r,e,i,!0)};a.prototype.lastIndexOf=function(r,e,i){return ir(this,r,e,i,!1)};function jr(t,r,e,i){e=Number(e)||0;var n=t.length-e;i?(i=Number(i),i>n&&(i=n)):i=n;var o=r.length;if(o%2!==0)throw new TypeError("Invalid hex string");i>o/2&&(i=o/2);for(var p=0;p<i;++p){var c=parseInt(r.substr(p*2,2),16);if(isNaN(c))return p;t[e+p]=c}return p}function re(t,r,e,i){return F(B(r,t.length-e),t,e,i)}function nr(t,r,e,i){return F(Ee(r),t,e,i)}function ee(t,r,e,i){return nr(t,r,e,i)}function te(t,r,e,i){return F(hr(r),t,e,i)}function ie(t,r,e,i){return F(me(r,t.length-e),t,e,i)}a.prototype.write=function(r,e,i,n){if(e===void 0)n="utf8",i=this.length,e=0;else if(i===void 0&&typeof e=="string")n=e,i=this.length,e=0;else if(isFinite(e))e=e|0,isFinite(i)?(i=i|0,n===void 0&&(n="utf8")):(n=i,i=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var o=this.length-e;if((i===void 0||i>o)&&(i=o),r.length>0&&(i<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var p=!1;;)switch(n){case"hex":return jr(this,r,e,i);case"utf8":case"utf-8":return re(this,r,e,i);case"ascii":return nr(this,r,e,i);case"latin1":case"binary":return ee(this,r,e,i);case"base64":return te(this,r,e,i);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ie(this,r,e,i);default:if(p)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),p=!0}};a.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function ne(t,r,e){return r===0&&e===t.length?Q(t):Q(t.slice(r,e))}function or(t,r,e){e=Math.min(t.length,e);for(var i=[],n=r;n<e;){var o=t[n],p=null,c=o>239?4:o>223?3:o>191?2:1;if(n+c<=e){var h,u,f,s;switch(c){case 1:o<128&&(p=o);break;case 2:h=t[n+1],(h&192)===128&&(s=(o&31)<<6|h&63,s>127&&(p=s));break;case 3:h=t[n+1],u=t[n+2],(h&192)===128&&(u&192)===128&&(s=(o&15)<<12|(h&63)<<6|u&63,s>2047&&(s<55296||s>57343)&&(p=s));break;case 4:h=t[n+1],u=t[n+2],f=t[n+3],(h&192)===128&&(u&192)===128&&(f&192)===128&&(s=(o&15)<<18|(h&63)<<12|(u&63)<<6|f&63,s>65535&&s<1114112&&(p=s))}}p===null?(p=65533,c=1):p>65535&&(p-=65536,i.push(p>>>10&1023|55296),p=56320|p&1023),i.push(p),n+=c}return oe(i)}var $=4096;function oe(t){var r=t.length;if(r<=$)return String.fromCharCode.apply(String,t);for(var e="",i=0;i<r;)e+=String.fromCharCode.apply(String,t.slice(i,i+=$));return e}function pe(t,r,e){var i="";e=Math.min(t.length,e);for(var n=r;n<e;++n)i+=String.fromCharCode(t[n]&127);return i}function ae(t,r,e){var i="";e=Math.min(t.length,e);for(var n=r;n<e;++n)i+=String.fromCharCode(t[n]);return i}function ce(t,r,e){var i=t.length;(!r||r<0)&&(r=0),(!e||e<0||e>i)&&(e=i);for(var n="",o=r;o<e;++o)n+=le(t[o]);return n}function he(t,r,e){for(var i=t.slice(r,e),n="",o=0;o<i.length;o+=2)n+=String.fromCharCode(i[o]+i[o+1]*256);return n}a.prototype.slice=function(r,e){var i=this.length;r=~~r,e=e===void 0?i:~~e,r<0?(r+=i,r<0&&(r=0)):r>i&&(r=i),e<0?(e+=i,e<0&&(e=0)):e>i&&(e=i),e<r&&(e=r);var n;if(a.TYPED_ARRAY_SUPPORT)n=this.subarray(r,e),n.__proto__=a.prototype;else{var o=e-r;n=new a(o,void 0);for(var p=0;p<o;++p)n[p]=this[p+r]}return n};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")}a.prototype.readUIntLE=function(r,e,i){r=r|0,e=e|0,i||E(r,e,this.length);for(var n=this[r],o=1,p=0;++p<e&&(o*=256);)n+=this[r+p]*o;return n};a.prototype.readUIntBE=function(r,e,i){r=r|0,e=e|0,i||E(r,e,this.length);for(var n=this[r+--e],o=1;e>0&&(o*=256);)n+=this[r+--e]*o;return n};a.prototype.readUInt8=function(r,e){return e||E(r,1,this.length),this[r]};a.prototype.readUInt16LE=function(r,e){return e||E(r,2,this.length),this[r]|this[r+1]<<8};a.prototype.readUInt16BE=function(r,e){return e||E(r,2,this.length),this[r]<<8|this[r+1]};a.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};a.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])};a.prototype.readIntLE=function(r,e,i){r=r|0,e=e|0,i||E(r,e,this.length);for(var n=this[r],o=1,p=0;++p<e&&(o*=256);)n+=this[r+p]*o;return o*=128,n>=o&&(n-=Math.pow(2,8*e)),n};a.prototype.readIntBE=function(r,e,i){r=r|0,e=e|0,i||E(r,e,this.length);for(var n=e,o=1,p=this[r+--n];n>0&&(o*=256);)p+=this[r+--n]*o;return o*=128,p>=o&&(p-=Math.pow(2,8*e)),p};a.prototype.readInt8=function(r,e){return e||E(r,1,this.length),this[r]&128?(255-this[r]+1)*-1:this[r]};a.prototype.readInt16LE=function(r,e){e||E(r,2,this.length);var i=this[r]|this[r+1]<<8;return i&32768?i|4294901760:i};a.prototype.readInt16BE=function(r,e){e||E(r,2,this.length);var i=this[r+1]|this[r]<<8;return i&32768?i|4294901760:i};a.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};a.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]};a.prototype.readFloatLE=function(r,e){return e||E(r,4,this.length),k(this,r,!0,23,4)};a.prototype.readFloatBE=function(r,e){return e||E(r,4,this.length),k(this,r,!1,23,4)};a.prototype.readDoubleLE=function(r,e){return e||E(r,8,this.length),k(this,r,!0,52,8)};a.prototype.readDoubleBE=function(r,e){return e||E(r,8,this.length),k(this,r,!1,52,8)};function m(t,r,e,i,n,o){if(!w(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(r>n||r<o)throw new RangeError('"value" argument is out of bounds');if(e+i>t.length)throw new RangeError("Index out of range")}a.prototype.writeUIntLE=function(r,e,i,n){if(r=+r,e=e|0,i=i|0,!n){var o=Math.pow(2,8*i)-1;m(this,r,e,i,o,0)}var p=1,c=0;for(this[e]=r&255;++c<i&&(p*=256);)this[e+c]=r/p&255;return e+i};a.prototype.writeUIntBE=function(r,e,i,n){if(r=+r,e=e|0,i=i|0,!n){var o=Math.pow(2,8*i)-1;m(this,r,e,i,o,0)}var p=i-1,c=1;for(this[e+p]=r&255;--p>=0&&(c*=256);)this[e+p]=r/c&255;return e+i};a.prototype.writeUInt8=function(r,e,i){return r=+r,e=e|0,i||m(this,r,e,1,255,0),a.TYPED_ARRAY_SUPPORT||(r=Math.floor(r)),this[e]=r&255,e+1};function S(t,r,e,i){r<0&&(r=65535+r+1);for(var n=0,o=Math.min(t.length-e,2);n<o;++n)t[e+n]=(r&255<<8*(i?n:1-n))>>>(i?n:1-n)*8}a.prototype.writeUInt16LE=function(r,e,i){return r=+r,e=e|0,i||m(this,r,e,2,65535,0),a.TYPED_ARRAY_SUPPORT?(this[e]=r&255,this[e+1]=r>>>8):S(this,r,e,!0),e+2};a.prototype.writeUInt16BE=function(r,e,i){return r=+r,e=e|0,i||m(this,r,e,2,65535,0),a.TYPED_ARRAY_SUPPORT?(this[e]=r>>>8,this[e+1]=r&255):S(this,r,e,!1),e+2};function M(t,r,e,i){r<0&&(r=4294967295+r+1);for(var n=0,o=Math.min(t.length-e,4);n<o;++n)t[e+n]=r>>>(i?n:3-n)*8&255}a.prototype.writeUInt32LE=function(r,e,i){return r=+r,e=e|0,i||m(this,r,e,4,4294967295,0),a.TYPED_ARRAY_SUPPORT?(this[e+3]=r>>>24,this[e+2]=r>>>16,this[e+1]=r>>>8,this[e]=r&255):M(this,r,e,!0),e+4};a.prototype.writeUInt32BE=function(r,e,i){return r=+r,e=e|0,i||m(this,r,e,4,4294967295,0),a.TYPED_ARRAY_SUPPORT?(this[e]=r>>>24,this[e+1]=r>>>16,this[e+2]=r>>>8,this[e+3]=r&255):M(this,r,e,!1),e+4};a.prototype.writeIntLE=function(r,e,i,n){if(r=+r,e=e|0,!n){var o=Math.pow(2,8*i-1);m(this,r,e,i,o-1,-o)}var p=0,c=1,h=0;for(this[e]=r&255;++p<i&&(c*=256);)r<0&&h===0&&this[e+p-1]!==0&&(h=1),this[e+p]=(r/c>>0)-h&255;return e+i};a.prototype.writeIntBE=function(r,e,i,n){if(r=+r,e=e|0,!n){var o=Math.pow(2,8*i-1);m(this,r,e,i,o-1,-o)}var p=i-1,c=1,h=0;for(this[e+p]=r&255;--p>=0&&(c*=256);)r<0&&h===0&&this[e+p+1]!==0&&(h=1),this[e+p]=(r/c>>0)-h&255;return e+i};a.prototype.writeInt8=function(r,e,i){return r=+r,e=e|0,i||m(this,r,e,1,127,-128),a.TYPED_ARRAY_SUPPORT||(r=Math.floor(r)),r<0&&(r=255+r+1),this[e]=r&255,e+1};a.prototype.writeInt16LE=function(r,e,i){return r=+r,e=e|0,i||m(this,r,e,2,32767,-32768),a.TYPED_ARRAY_SUPPORT?(this[e]=r&255,this[e+1]=r>>>8):S(this,r,e,!0),e+2};a.prototype.writeInt16BE=function(r,e,i){return r=+r,e=e|0,i||m(this,r,e,2,32767,-32768),a.TYPED_ARRAY_SUPPORT?(this[e]=r>>>8,this[e+1]=r&255):S(this,r,e,!1),e+2};a.prototype.writeInt32LE=function(r,e,i){return r=+r,e=e|0,i||m(this,r,e,4,2147483647,-2147483648),a.TYPED_ARRAY_SUPPORT?(this[e]=r&255,this[e+1]=r>>>8,this[e+2]=r>>>16,this[e+3]=r>>>24):M(this,r,e,!0),e+4};a.prototype.writeInt32BE=function(r,e,i){return r=+r,e=e|0,i||m(this,r,e,4,2147483647,-2147483648),r<0&&(r=4294967295+r+1),a.TYPED_ARRAY_SUPPORT?(this[e]=r>>>24,this[e+1]=r>>>16,this[e+2]=r>>>8,this[e+3]=r&255):M(this,r,e,!1),e+4};function pr(t,r,e,i,n,o){if(e+i>t.length)throw new RangeError("Index out of range");if(e<0)throw new RangeError("Index out of range")}function ar(t,r,e,i,n){return n||pr(t,r,e,4,34028234663852886e22,-34028234663852886e22),ur(t,r,e,i,23,4),e+4}a.prototype.writeFloatLE=function(r,e,i){return ar(this,r,e,!0,i)};a.prototype.writeFloatBE=function(r,e,i){return ar(this,r,e,!1,i)};function cr(t,r,e,i,n){return n||pr(t,r,e,8,17976931348623157e292,-17976931348623157e292),ur(t,r,e,i,52,8),e+8}a.prototype.writeDoubleLE=function(r,e,i){return cr(this,r,e,!0,i)};a.prototype.writeDoubleBE=function(r,e,i){return cr(this,r,e,!1,i)};a.prototype.copy=function(r,e,i,n){if(i||(i=0),!n&&n!==0&&(n=this.length),e>=r.length&&(e=r.length),e||(e=0),n>0&&n<i&&(n=i),n===i||r.length===0||this.length===0)return 0;if(e<0)throw new RangeError("targetStart out of bounds");if(i<0||i>=this.length)throw new RangeError("sourceStart out of bounds");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),r.length-e<n-i&&(n=r.length-e+i);var o=n-i,p;if(this===r&&i<e&&e<n)for(p=o-1;p>=0;--p)r[p+e]=this[p+i];else if(o<1e3||!a.TYPED_ARRAY_SUPPORT)for(p=0;p<o;++p)r[p+e]=this[p+i];else Uint8Array.prototype.set.call(r,this.subarray(i,i+o),e);return o};a.prototype.fill=function(r,e,i,n){if(typeof r=="string"){if(typeof e=="string"?(n=e,e=0,i=this.length):typeof i=="string"&&(n=i,i=this.length),r.length===1){var o=r.charCodeAt(0);o<256&&(r=o)}if(n!==void 0&&typeof n!="string")throw new TypeError("encoding must be a string");if(typeof n=="string"&&!a.isEncoding(n))throw new TypeError("Unknown encoding: "+n)}else typeof r=="number"&&(r=r&255);if(e<0||this.length<e||this.length<i)throw new RangeError("Out of range index");if(i<=e)return this;e=e>>>0,i=i===void 0?this.length:i>>>0,r||(r=0);var p;if(typeof r=="number")for(p=e;p<i;++p)this[p]=r;else{var c=w(r)?r:B(new a(r,n).toString()),h=c.length;for(p=0;p<i-e;++p)this[p+e]=c[p%h]}return this};var se=/[^+\/0-9A-Za-z-_]/g;function ue(t){if(t=fe(t).replace(se,""),t.length<2)return"";for(;t.length%4!==0;)t=t+"=";return t}function fe(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}function le(t){return t<16?"0"+t.toString(16):t.toString(16)}function B(t,r){r=r||1/0;for(var e,i=t.length,n=null,o=[],p=0;p<i;++p){if(e=t.charCodeAt(p),e>55295&&e<57344){if(!n){if(e>56319){(r-=3)>-1&&o.push(239,191,189);continue}else if(p+1===i){(r-=3)>-1&&o.push(239,191,189);continue}n=e;continue}if(e<56320){(r-=3)>-1&&o.push(239,191,189),n=e;continue}e=(n-55296<<10|e-56320)+65536}else n&&(r-=3)>-1&&o.push(239,191,189);if(n=null,e<128){if((r-=1)<0)break;o.push(e)}else if(e<2048){if((r-=2)<0)break;o.push(e>>6|192,e&63|128)}else if(e<65536){if((r-=3)<0)break;o.push(e>>12|224,e>>6&63|128,e&63|128)}else if(e<1114112){if((r-=4)<0)break;o.push(e>>18|240,e>>12&63|128,e>>6&63|128,e&63|128)}else throw new Error("Invalid code point")}return o}function Ee(t){for(var r=[],e=0;e<t.length;++e)r.push(t.charCodeAt(e)&255);return r}function me(t,r){for(var e,i,n,o=[],p=0;p<t.length&&!((r-=2)<0);++p)e=t.charCodeAt(p),i=e>>8,n=e%256,o.push(n),o.push(i);return o}function hr(t){return Kr(ue(t))}function F(t,r,e,i){for(var n=0;n<i&&!(n+e>=r.length||n>=t.length);++n)r[n+e]=t[n];return n}function Ae(t){return t!==t}function _e(t){return t!=null&&(!!t._isBuffer||sr(t)||xe(t))}function sr(t){return!!t.constructor&&typeof t.constructor.isBuffer=="function"&&t.constructor.isBuffer(t)}function xe(t){return typeof t.readFloatLE=="function"&&typeof t.slice=="function"&&sr(t.slice(0,0))}function k(t,r,e,i,n){var o,p,c=n*8-i-1,h=(1<<c)-1,u=h>>1,f=-7,s=e?n-1:0,x=e?-1:1,A=t[r+s];for(s+=x,o=A&(1<<-f)-1,A>>=-f,f+=c;f>0;o=o*256+t[r+s],s+=x,f-=8);for(p=o&(1<<-f)-1,o>>=-f,f+=i;f>0;p=p*256+t[r+s],s+=x,f-=8);if(o===0)o=1-u;else{if(o===h)return p?NaN:(A?-1:1)*(1/0);p=p+Math.pow(2,i),o=o-u}return(A?-1:1)*p*Math.pow(2,o-i)}function ur(t,r,e,i,n,o){var p,c,h,u=o*8-n-1,f=(1<<u)-1,s=f>>1,x=n===23?Math.pow(2,-24)-Math.pow(2,-77):0,A=i?0:o-1,D=i?1:-1,Ar=r<0||r===0&&1/r<0?1:0;for(r=Math.abs(r),isNaN(r)||r===1/0?(c=isNaN(r)?1:0,p=f):(p=Math.floor(Math.log(r)/Math.LN2),r*(h=Math.pow(2,-p))<1&&(p--,h*=2),p+s>=1?r+=x/h:r+=x*Math.pow(2,1-s),r*h>=2&&(p++,h/=2),p+s>=f?(c=0,p=f):p+s>=1?(c=(r*h-1)*Math.pow(2,n),p=p+s):(c=r*Math.pow(2,s-1)*Math.pow(2,n),p=0));n>=8;t[e+A]=c&255,A+=D,c/=256,n-=8);for(p=p<<n|c,u+=n;u>0;t[e+A]=p&255,A+=D,p/=256,u-=8);t[e+A-D]|=Ar*128}var fr=(e=>(e[e.Buy=0]="Buy",e[e.Sell=1]="Sell",e))(fr||{}),v=fr;var lr=(n=>(n[n.Limit=0]="Limit",n[n.IOC=1]="IOC",n[n.POST=2]="POST",n[n.Market=3]="Market",n))(lr||{}),g=lr;var Er=(n=>(n.GLOBAL_PAIR_DELISTING="GLOBAL_PAIR_DELISTING",n.GLOBAL_NEW_PAIR_LISTING="GLOBAL_NEW_PAIR_LISTING",n.GLOBAL_SYSTEM_MAINTENANCE="GLOBAL_SYSTEM_MAINTENANCE",n.GLOBAL_SMART_CONTRACT_UPDATE="GLOBAL_SMART_CONTRACT_UPDATE",n))(Er||{}),mr=(i=>(i.ACCOUNT_POINTS_UNLOCK_ACHIEVEMENT="ACCOUNT_POINTS_UNLOCK_ACHIEVEMENT",i.ACCOUNT_KYC_STATUS_CHANGED="ACCOUNT_KYC_STATUS_CHANGED",i.ACCOUNT_AFFILIATE_DASHBOARD_UNLOCKED="ACCOUNT_AFFILIATE_DASHBOARD_UNLOCKED",i))(mr||{}),Dt={...Er,...mr};function Ui(t){switch(t){case"B":return v.Buy;case"S":return v.Sell;default:throw new Error("Unknown order side short type: "+t)}}function Pi(t){switch(t){case v.Buy:return"B";case v.Sell:return"S";default:throw new Error("Unknown order side type: "+t)}}function Bi(t){switch(t){case"I":return g.IOC;case"P":return g.POST;case"M":return g.Market;case"L":default:return g.Limit}}function Si(t){switch(t){case"B":return"BUY";case"S":return"SELL";default:throw new Error("Unknown order side short type: "+t)}}function Mi(t){switch(t){case"I":return"IOC";case"P":return"POST";case"M":return"Market";case"L":default:return"Limit"}}export{Ui as mapOrderSideFromShort,Si as mapOrderSideFromShortToLong,Pi as mapOrderSideToShort,Bi as mapOrderTypeShort,Mi as mapOrderTypeShortToLong};
|
|
2
2
|
/*! Bundled license information:
|
|
3
3
|
|
|
4
4
|
@esbuild-plugins/node-globals-polyfill/Buffer.js:
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
function H(){throw new Error("setTimeout has not been defined")}function K(){throw new Error("clearTimeout has not been defined")}var b=H,d=K;typeof globalThis.setTimeout=="function"&&(b=setTimeout);typeof globalThis.clearTimeout=="function"&&(d=clearTimeout);function z(e){if(b===setTimeout)return setTimeout(e,0);if((b===H||!b)&&setTimeout)return b=setTimeout,setTimeout(e,0);try{return b(e,0)}catch{try{return b.call(null,e,0)}catch{return b.call(this,e,0)}}}function mr(e){if(d===clearTimeout)return clearTimeout(e);if((d===K||!d)&&clearTimeout)return d=clearTimeout,clearTimeout(e);try{return d(e)}catch{try{return d.call(null,e)}catch{return d.call(this,e)}}}var R=[],O=!1,C,y=-1;function xr(){!O||!C||(O=!1,C.length?R=C.concat(R):y=-1,R.length&&J())}function J(){if(!O){var e=z(xr);O=!0;for(var r=R.length;r;){for(C=R,R=[];++y<r;)C&&C[y].run();y=-1,r=R.length}C=null,O=!1,mr(e)}}function _r(e){var r=new Array(arguments.length-1);if(arguments.length>1)for(var t=1;t<arguments.length;t++)r[t-1]=arguments[t];R.push(new X(e,r)),R.length===1&&!O&&z(J)}function X(e,r){this.fun=e,this.array=r}X.prototype.run=function(){this.fun.apply(null,this.array)};var Ir="browser",Ar="browser",wr=!0,Rr={},Tr=[],Nr="",br={},dr={},Cr={};function g(){}var gr=g,Dr=g,vr=g,Or=g,Lr=g,yr=g,Ur=g;function Pr(e){throw new Error("process.binding is not supported")}function Br(){return"/"}function Sr(e){throw new Error("process.chdir is not supported")}function Mr(){return 0}var v=globalThis.performance||{},kr=v.now||v.mozNow||v.msNow||v.oNow||v.webkitNow||function(){return new Date().getTime()};function Yr(e){var r=kr.call(v)*.001,t=Math.floor(r),i=Math.floor(r%1*1e9);return e&&(t=t-e[0],i=i-e[1],i<0&&(t--,i+=1e9)),[t,i]}var Fr=new Date;function Gr(){var e=new Date,r=e-Fr;return r/1e3}var l={nextTick:_r,title:Ir,browser:wr,env:Rr,argv:Tr,version:Nr,versions:br,on:gr,addListener:Dr,once:vr,off:Or,removeListener:Lr,removeAllListeners:yr,emit:Ur,binding:Pr,cwd:Br,chdir:Sr,umask:Mr,hrtime:Yr,platform:Ar,release:dr,config:Cr,uptime:Gr},V={};Object.keys(V).forEach(e=>{let r=e.split("."),t=l;for(let i=0;i<r.length;i++){let n=r[i];i===r.length-1?t[n]=V[e]:t=t[n]||(t[n]={})}});var A=[],I=[],Wr=typeof Uint8Array<"u"?Uint8Array:Array,F=!1;function $(){F=!0;for(var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",r=0,t=e.length;r<t;++r)A[r]=e[r],I[e.charCodeAt(r)]=r;I[45]=62,I[95]=63}function Vr(e){F||$();var r,t,i,n,o,p,c=e.length;if(c%4>0)throw new Error("Invalid string. Length must be a multiple of 4");o=e[c-2]==="="?2:e[c-1]==="="?1:0,p=new Wr(c*3/4-o),i=o>0?c-4:c;var h=0;for(r=0,t=0;r<i;r+=4,t+=3)n=I[e.charCodeAt(r)]<<18|I[e.charCodeAt(r+1)]<<12|I[e.charCodeAt(r+2)]<<6|I[e.charCodeAt(r+3)],p[h++]=n>>16&255,p[h++]=n>>8&255,p[h++]=n&255;return o===2?(n=I[e.charCodeAt(r)]<<2|I[e.charCodeAt(r+1)]>>4,p[h++]=n&255):o===1&&(n=I[e.charCodeAt(r)]<<10|I[e.charCodeAt(r+1)]<<4|I[e.charCodeAt(r+2)]>>2,p[h++]=n>>8&255,p[h++]=n&255),p}function Hr(e){return A[e>>18&63]+A[e>>12&63]+A[e>>6&63]+A[e&63]}function Kr(e,r,t){for(var i,n=[],o=r;o<t;o+=3)i=(e[o]<<16)+(e[o+1]<<8)+e[o+2],n.push(Hr(i));return n.join("")}function q(e){F||$();for(var r,t=e.length,i=t%3,n="",o=[],p=16383,c=0,h=t-i;c<h;c+=p)o.push(Kr(e,c,c+p>h?h:c+p));return i===1?(r=e[t-1],n+=A[r>>2],n+=A[r<<4&63],n+="=="):i===2&&(r=(e[t-2]<<8)+e[t-1],n+=A[r>>10],n+=A[r>>4&63],n+=A[r<<2&63],n+="="),o.push(n),o.join("")}a.TYPED_ARRAY_SUPPORT=globalThis.TYPED_ARRAY_SUPPORT!==void 0?globalThis.TYPED_ARRAY_SUPPORT:!0;function U(){return a.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function T(e,r){if(U()<r)throw new RangeError("Invalid typed array length");return a.TYPED_ARRAY_SUPPORT?(e=new Uint8Array(r),e.__proto__=a.prototype):(e===null&&(e=new a(r)),e.length=r),e}function a(e,r,t){if(!a.TYPED_ARRAY_SUPPORT&&!(this instanceof a))return new a(e,r,t);if(typeof e=="number"){if(typeof r=="string")throw new Error("If encoding is specified then the first argument must be a string");return G(this,e)}return j(this,e,r,t)}a.poolSize=8192;a._augment=function(e){return e.__proto__=a.prototype,e};function j(e,r,t,i){if(typeof r=="number")throw new TypeError('"value" argument must not be a number');return typeof ArrayBuffer<"u"&&r instanceof ArrayBuffer?Xr(e,r,t,i):typeof r=="string"?Jr(e,r,t):qr(e,r)}a.from=function(e,r,t){return j(null,e,r,t)};a.kMaxLength=U();a.TYPED_ARRAY_SUPPORT&&(a.prototype.__proto__=Uint8Array.prototype,a.__proto__=Uint8Array,typeof Symbol<"u"&&Symbol.species&&a[Symbol.species]);function rr(e){if(typeof e!="number")throw new TypeError('"size" argument must be a number');if(e<0)throw new RangeError('"size" argument must not be negative')}function zr(e,r,t,i){return rr(r),r<=0?T(e,r):t!==void 0?typeof i=="string"?T(e,r).fill(t,i):T(e,r).fill(t):T(e,r)}a.alloc=function(e,r,t){return zr(null,e,r,t)};function G(e,r){if(rr(r),e=T(e,r<0?0:W(r)|0),!a.TYPED_ARRAY_SUPPORT)for(var t=0;t<r;++t)e[t]=0;return e}a.allocUnsafe=function(e){return G(null,e)};a.allocUnsafeSlow=function(e){return G(null,e)};function Jr(e,r,t){if((typeof t!="string"||t==="")&&(t="utf8"),!a.isEncoding(t))throw new TypeError('"encoding" must be a valid string encoding');var i=tr(r,t)|0;e=T(e,i);var n=e.write(r,t);return n!==i&&(e=e.slice(0,n)),e}function Y(e,r){var t=r.length<0?0:W(r.length)|0;e=T(e,t);for(var i=0;i<t;i+=1)e[i]=r[i]&255;return e}function Xr(e,r,t,i){if(r.byteLength,t<0||r.byteLength<t)throw new RangeError("'offset' is out of bounds");if(r.byteLength<t+(i||0))throw new RangeError("'length' is out of bounds");return t===void 0&&i===void 0?r=new Uint8Array(r):i===void 0?r=new Uint8Array(r,t):r=new Uint8Array(r,t,i),a.TYPED_ARRAY_SUPPORT?(e=r,e.__proto__=a.prototype):e=Y(e,r),e}function qr(e,r){if(w(r)){var t=W(r.length)|0;return e=T(e,t),e.length===0||r.copy(e,0,0,t),e}if(r){if(typeof ArrayBuffer<"u"&&r.buffer instanceof ArrayBuffer||"length"in r)return typeof r.length!="number"||Et(r.length)?T(e,0):Y(e,r);if(r.type==="Buffer"&&Array.isArray(r.data))return Y(e,r.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function W(e){if(e>=U())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+U().toString(16)+" bytes");return e|0}a.isBuffer=mt;function w(e){return!!(e!=null&&e._isBuffer)}a.compare=function(r,t){if(!w(r)||!w(t))throw new TypeError("Arguments must be Buffers");if(r===t)return 0;for(var i=r.length,n=t.length,o=0,p=Math.min(i,n);o<p;++o)if(r[o]!==t[o]){i=r[o],n=t[o];break}return i<n?-1:n<i?1:0};a.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}};a.concat=function(r,t){if(!Array.isArray(r))throw new TypeError('"list" argument must be an Array of Buffers');if(r.length===0)return a.alloc(0);var i;if(t===void 0)for(t=0,i=0;i<r.length;++i)t+=r[i].length;var n=a.allocUnsafe(t),o=0;for(i=0;i<r.length;++i){var p=r[i];if(!w(p))throw new TypeError('"list" argument must be an Array of Buffers');p.copy(n,o),o+=p.length}return n};function tr(e,r){if(w(e))return e.length;if(typeof ArrayBuffer<"u"&&typeof ArrayBuffer.isView=="function"&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;typeof e!="string"&&(e=""+e);var t=e.length;if(t===0)return 0;for(var i=!1;;)switch(r){case"ascii":case"latin1":case"binary":return t;case"utf8":case"utf-8":case void 0:return P(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return t*2;case"hex":return t>>>1;case"base64":return cr(e).length;default:if(i)return P(e).length;r=(""+r).toLowerCase(),i=!0}}a.byteLength=tr;function Qr(e,r,t){var i=!1;if((r===void 0||r<0)&&(r=0),r>this.length||((t===void 0||t>this.length)&&(t=this.length),t<=0)||(t>>>=0,r>>>=0,t<=r))return"";for(e||(e="utf8");;)switch(e){case"hex":return pt(this,r,t);case"utf8":case"utf-8":return nr(this,r,t);case"ascii":return nt(this,r,t);case"latin1":case"binary":return ot(this,r,t);case"base64":return et(this,r,t);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return at(this,r,t);default:if(i)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),i=!0}}a.prototype._isBuffer=!0;function D(e,r,t){var i=e[r];e[r]=e[t],e[t]=i}a.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 t=0;t<r;t+=2)D(this,t,t+1);return this};a.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 t=0;t<r;t+=4)D(this,t,t+3),D(this,t+1,t+2);return this};a.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 t=0;t<r;t+=8)D(this,t,t+7),D(this,t+1,t+6),D(this,t+2,t+5),D(this,t+3,t+4);return this};a.prototype.toString=function(){var r=this.length|0;return r===0?"":arguments.length===0?nr(this,0,r):Qr.apply(this,arguments)};a.prototype.equals=function(r){if(!w(r))throw new TypeError("Argument must be a Buffer");return this===r?!0:a.compare(this,r)===0};a.prototype.compare=function(r,t,i,n,o){if(!w(r))throw new TypeError("Argument must be a Buffer");if(t===void 0&&(t=0),i===void 0&&(i=r?r.length:0),n===void 0&&(n=0),o===void 0&&(o=this.length),t<0||i>r.length||n<0||o>this.length)throw new RangeError("out of range index");if(n>=o&&t>=i)return 0;if(n>=o)return-1;if(t>=i)return 1;if(t>>>=0,i>>>=0,n>>>=0,o>>>=0,this===r)return 0;for(var p=o-n,c=i-t,h=Math.min(p,c),s=this.slice(n,o),u=r.slice(t,i),f=0;f<h;++f)if(s[f]!==u[f]){p=s[f],c=u[f];break}return p<c?-1:c<p?1:0};function er(e,r,t,i,n){if(e.length===0)return-1;if(typeof t=="string"?(i=t,t=0):t>2147483647?t=2147483647:t<-2147483648&&(t=-2147483648),t=+t,isNaN(t)&&(t=n?0:e.length-1),t<0&&(t=e.length+t),t>=e.length){if(n)return-1;t=e.length-1}else if(t<0)if(n)t=0;else return-1;if(typeof r=="string"&&(r=a.from(r,i)),w(r))return r.length===0?-1:Q(e,r,t,i,n);if(typeof r=="number")return r=r&255,a.TYPED_ARRAY_SUPPORT&&typeof Uint8Array.prototype.indexOf=="function"?n?Uint8Array.prototype.indexOf.call(e,r,t):Uint8Array.prototype.lastIndexOf.call(e,r,t):Q(e,[r],t,i,n);throw new TypeError("val must be string, number or Buffer")}function Q(e,r,t,i,n){var o=1,p=e.length,c=r.length;if(i!==void 0&&(i=String(i).toLowerCase(),i==="ucs2"||i==="ucs-2"||i==="utf16le"||i==="utf-16le")){if(e.length<2||r.length<2)return-1;o=2,p/=2,c/=2,t/=2}function h(m,N){return o===1?m[N]:m.readUInt16BE(N*o)}var s;if(n){var u=-1;for(s=t;s<p;s++)if(h(e,s)===h(r,u===-1?0:s-u)){if(u===-1&&(u=s),s-u+1===c)return u*o}else u!==-1&&(s-=s-u),u=-1}else for(t+c>p&&(t=p-c),s=t;s>=0;s--){for(var f=!0,_=0;_<c;_++)if(h(e,s+_)!==h(r,_)){f=!1;break}if(f)return s}return-1}a.prototype.includes=function(r,t,i){return this.indexOf(r,t,i)!==-1};a.prototype.indexOf=function(r,t,i){return er(this,r,t,i,!0)};a.prototype.lastIndexOf=function(r,t,i){return er(this,r,t,i,!1)};function Zr(e,r,t,i){t=Number(t)||0;var n=e.length-t;i?(i=Number(i),i>n&&(i=n)):i=n;var o=r.length;if(o%2!==0)throw new TypeError("Invalid hex string");i>o/2&&(i=o/2);for(var p=0;p<i;++p){var c=parseInt(r.substr(p*2,2),16);if(isNaN(c))return p;e[t+p]=c}return p}function $r(e,r,t,i){return M(P(r,e.length-t),e,t,i)}function ir(e,r,t,i){return M(ut(r),e,t,i)}function jr(e,r,t,i){return ir(e,r,t,i)}function rt(e,r,t,i){return M(cr(r),e,t,i)}function tt(e,r,t,i){return M(lt(r,e.length-t),e,t,i)}a.prototype.write=function(r,t,i,n){if(t===void 0)n="utf8",i=this.length,t=0;else if(i===void 0&&typeof t=="string")n=t,i=this.length,t=0;else if(isFinite(t))t=t|0,isFinite(i)?(i=i|0,n===void 0&&(n="utf8")):(n=i,i=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var o=this.length-t;if((i===void 0||i>o)&&(i=o),r.length>0&&(i<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var p=!1;;)switch(n){case"hex":return Zr(this,r,t,i);case"utf8":case"utf-8":return $r(this,r,t,i);case"ascii":return ir(this,r,t,i);case"latin1":case"binary":return jr(this,r,t,i);case"base64":return rt(this,r,t,i);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return tt(this,r,t,i);default:if(p)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),p=!0}};a.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function et(e,r,t){return r===0&&t===e.length?q(e):q(e.slice(r,t))}function nr(e,r,t){t=Math.min(e.length,t);for(var i=[],n=r;n<t;){var o=e[n],p=null,c=o>239?4:o>223?3:o>191?2:1;if(n+c<=t){var h,s,u,f;switch(c){case 1:o<128&&(p=o);break;case 2:h=e[n+1],(h&192)===128&&(f=(o&31)<<6|h&63,f>127&&(p=f));break;case 3:h=e[n+1],s=e[n+2],(h&192)===128&&(s&192)===128&&(f=(o&15)<<12|(h&63)<<6|s&63,f>2047&&(f<55296||f>57343)&&(p=f));break;case 4:h=e[n+1],s=e[n+2],u=e[n+3],(h&192)===128&&(s&192)===128&&(u&192)===128&&(f=(o&15)<<18|(h&63)<<12|(s&63)<<6|u&63,f>65535&&f<1114112&&(p=f))}}p===null?(p=65533,c=1):p>65535&&(p-=65536,i.push(p>>>10&1023|55296),p=56320|p&1023),i.push(p),n+=c}return it(i)}var Z=4096;function it(e){var r=e.length;if(r<=Z)return String.fromCharCode.apply(String,e);for(var t="",i=0;i<r;)t+=String.fromCharCode.apply(String,e.slice(i,i+=Z));return t}function nt(e,r,t){var i="";t=Math.min(e.length,t);for(var n=r;n<t;++n)i+=String.fromCharCode(e[n]&127);return i}function ot(e,r,t){var i="";t=Math.min(e.length,t);for(var n=r;n<t;++n)i+=String.fromCharCode(e[n]);return i}function pt(e,r,t){var i=e.length;(!r||r<0)&&(r=0),(!t||t<0||t>i)&&(t=i);for(var n="",o=r;o<t;++o)n+=ft(e[o]);return n}function at(e,r,t){for(var i=e.slice(r,t),n="",o=0;o<i.length;o+=2)n+=String.fromCharCode(i[o]+i[o+1]*256);return n}a.prototype.slice=function(r,t){var i=this.length;r=~~r,t=t===void 0?i:~~t,r<0?(r+=i,r<0&&(r=0)):r>i&&(r=i),t<0?(t+=i,t<0&&(t=0)):t>i&&(t=i),t<r&&(t=r);var n;if(a.TYPED_ARRAY_SUPPORT)n=this.subarray(r,t),n.__proto__=a.prototype;else{var o=t-r;n=new a(o,void 0);for(var p=0;p<o;++p)n[p]=this[p+r]}return n};function E(e,r,t){if(e%1!==0||e<0)throw new RangeError("offset is not uint");if(e+r>t)throw new RangeError("Trying to access beyond buffer length")}a.prototype.readUIntLE=function(r,t,i){r=r|0,t=t|0,i||E(r,t,this.length);for(var n=this[r],o=1,p=0;++p<t&&(o*=256);)n+=this[r+p]*o;return n};a.prototype.readUIntBE=function(r,t,i){r=r|0,t=t|0,i||E(r,t,this.length);for(var n=this[r+--t],o=1;t>0&&(o*=256);)n+=this[r+--t]*o;return n};a.prototype.readUInt8=function(r,t){return t||E(r,1,this.length),this[r]};a.prototype.readUInt16LE=function(r,t){return t||E(r,2,this.length),this[r]|this[r+1]<<8};a.prototype.readUInt16BE=function(r,t){return t||E(r,2,this.length),this[r]<<8|this[r+1]};a.prototype.readUInt32LE=function(r,t){return t||E(r,4,this.length),(this[r]|this[r+1]<<8|this[r+2]<<16)+this[r+3]*16777216};a.prototype.readUInt32BE=function(r,t){return t||E(r,4,this.length),this[r]*16777216+(this[r+1]<<16|this[r+2]<<8|this[r+3])};a.prototype.readIntLE=function(r,t,i){r=r|0,t=t|0,i||E(r,t,this.length);for(var n=this[r],o=1,p=0;++p<t&&(o*=256);)n+=this[r+p]*o;return o*=128,n>=o&&(n-=Math.pow(2,8*t)),n};a.prototype.readIntBE=function(r,t,i){r=r|0,t=t|0,i||E(r,t,this.length);for(var n=t,o=1,p=this[r+--n];n>0&&(o*=256);)p+=this[r+--n]*o;return o*=128,p>=o&&(p-=Math.pow(2,8*t)),p};a.prototype.readInt8=function(r,t){return t||E(r,1,this.length),this[r]&128?(255-this[r]+1)*-1:this[r]};a.prototype.readInt16LE=function(r,t){t||E(r,2,this.length);var i=this[r]|this[r+1]<<8;return i&32768?i|4294901760:i};a.prototype.readInt16BE=function(r,t){t||E(r,2,this.length);var i=this[r+1]|this[r]<<8;return i&32768?i|4294901760:i};a.prototype.readInt32LE=function(r,t){return t||E(r,4,this.length),this[r]|this[r+1]<<8|this[r+2]<<16|this[r+3]<<24};a.prototype.readInt32BE=function(r,t){return t||E(r,4,this.length),this[r]<<24|this[r+1]<<16|this[r+2]<<8|this[r+3]};a.prototype.readFloatLE=function(r,t){return t||E(r,4,this.length),k(this,r,!0,23,4)};a.prototype.readFloatBE=function(r,t){return t||E(r,4,this.length),k(this,r,!1,23,4)};a.prototype.readDoubleLE=function(r,t){return t||E(r,8,this.length),k(this,r,!0,52,8)};a.prototype.readDoubleBE=function(r,t){return t||E(r,8,this.length),k(this,r,!1,52,8)};function x(e,r,t,i,n,o){if(!w(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(r>n||r<o)throw new RangeError('"value" argument is out of bounds');if(t+i>e.length)throw new RangeError("Index out of range")}a.prototype.writeUIntLE=function(r,t,i,n){if(r=+r,t=t|0,i=i|0,!n){var o=Math.pow(2,8*i)-1;x(this,r,t,i,o,0)}var p=1,c=0;for(this[t]=r&255;++c<i&&(p*=256);)this[t+c]=r/p&255;return t+i};a.prototype.writeUIntBE=function(r,t,i,n){if(r=+r,t=t|0,i=i|0,!n){var o=Math.pow(2,8*i)-1;x(this,r,t,i,o,0)}var p=i-1,c=1;for(this[t+p]=r&255;--p>=0&&(c*=256);)this[t+p]=r/c&255;return t+i};a.prototype.writeUInt8=function(r,t,i){return r=+r,t=t|0,i||x(this,r,t,1,255,0),a.TYPED_ARRAY_SUPPORT||(r=Math.floor(r)),this[t]=r&255,t+1};function B(e,r,t,i){r<0&&(r=65535+r+1);for(var n=0,o=Math.min(e.length-t,2);n<o;++n)e[t+n]=(r&255<<8*(i?n:1-n))>>>(i?n:1-n)*8}a.prototype.writeUInt16LE=function(r,t,i){return r=+r,t=t|0,i||x(this,r,t,2,65535,0),a.TYPED_ARRAY_SUPPORT?(this[t]=r&255,this[t+1]=r>>>8):B(this,r,t,!0),t+2};a.prototype.writeUInt16BE=function(r,t,i){return r=+r,t=t|0,i||x(this,r,t,2,65535,0),a.TYPED_ARRAY_SUPPORT?(this[t]=r>>>8,this[t+1]=r&255):B(this,r,t,!1),t+2};function S(e,r,t,i){r<0&&(r=4294967295+r+1);for(var n=0,o=Math.min(e.length-t,4);n<o;++n)e[t+n]=r>>>(i?n:3-n)*8&255}a.prototype.writeUInt32LE=function(r,t,i){return r=+r,t=t|0,i||x(this,r,t,4,4294967295,0),a.TYPED_ARRAY_SUPPORT?(this[t+3]=r>>>24,this[t+2]=r>>>16,this[t+1]=r>>>8,this[t]=r&255):S(this,r,t,!0),t+4};a.prototype.writeUInt32BE=function(r,t,i){return r=+r,t=t|0,i||x(this,r,t,4,4294967295,0),a.TYPED_ARRAY_SUPPORT?(this[t]=r>>>24,this[t+1]=r>>>16,this[t+2]=r>>>8,this[t+3]=r&255):S(this,r,t,!1),t+4};a.prototype.writeIntLE=function(r,t,i,n){if(r=+r,t=t|0,!n){var o=Math.pow(2,8*i-1);x(this,r,t,i,o-1,-o)}var p=0,c=1,h=0;for(this[t]=r&255;++p<i&&(c*=256);)r<0&&h===0&&this[t+p-1]!==0&&(h=1),this[t+p]=(r/c>>0)-h&255;return t+i};a.prototype.writeIntBE=function(r,t,i,n){if(r=+r,t=t|0,!n){var o=Math.pow(2,8*i-1);x(this,r,t,i,o-1,-o)}var p=i-1,c=1,h=0;for(this[t+p]=r&255;--p>=0&&(c*=256);)r<0&&h===0&&this[t+p+1]!==0&&(h=1),this[t+p]=(r/c>>0)-h&255;return t+i};a.prototype.writeInt8=function(r,t,i){return r=+r,t=t|0,i||x(this,r,t,1,127,-128),a.TYPED_ARRAY_SUPPORT||(r=Math.floor(r)),r<0&&(r=255+r+1),this[t]=r&255,t+1};a.prototype.writeInt16LE=function(r,t,i){return r=+r,t=t|0,i||x(this,r,t,2,32767,-32768),a.TYPED_ARRAY_SUPPORT?(this[t]=r&255,this[t+1]=r>>>8):B(this,r,t,!0),t+2};a.prototype.writeInt16BE=function(r,t,i){return r=+r,t=t|0,i||x(this,r,t,2,32767,-32768),a.TYPED_ARRAY_SUPPORT?(this[t]=r>>>8,this[t+1]=r&255):B(this,r,t,!1),t+2};a.prototype.writeInt32LE=function(r,t,i){return r=+r,t=t|0,i||x(this,r,t,4,2147483647,-2147483648),a.TYPED_ARRAY_SUPPORT?(this[t]=r&255,this[t+1]=r>>>8,this[t+2]=r>>>16,this[t+3]=r>>>24):S(this,r,t,!0),t+4};a.prototype.writeInt32BE=function(r,t,i){return r=+r,t=t|0,i||x(this,r,t,4,2147483647,-2147483648),r<0&&(r=4294967295+r+1),a.TYPED_ARRAY_SUPPORT?(this[t]=r>>>24,this[t+1]=r>>>16,this[t+2]=r>>>8,this[t+3]=r&255):S(this,r,t,!1),t+4};function or(e,r,t,i,n,o){if(t+i>e.length)throw new RangeError("Index out of range");if(t<0)throw new RangeError("Index out of range")}function pr(e,r,t,i,n){return n||or(e,r,t,4,34028234663852886e22,-34028234663852886e22),sr(e,r,t,i,23,4),t+4}a.prototype.writeFloatLE=function(r,t,i){return pr(this,r,t,!0,i)};a.prototype.writeFloatBE=function(r,t,i){return pr(this,r,t,!1,i)};function ar(e,r,t,i,n){return n||or(e,r,t,8,17976931348623157e292,-17976931348623157e292),sr(e,r,t,i,52,8),t+8}a.prototype.writeDoubleLE=function(r,t,i){return ar(this,r,t,!0,i)};a.prototype.writeDoubleBE=function(r,t,i){return ar(this,r,t,!1,i)};a.prototype.copy=function(r,t,i,n){if(i||(i=0),!n&&n!==0&&(n=this.length),t>=r.length&&(t=r.length),t||(t=0),n>0&&n<i&&(n=i),n===i||r.length===0||this.length===0)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(i<0||i>=this.length)throw new RangeError("sourceStart out of bounds");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),r.length-t<n-i&&(n=r.length-t+i);var o=n-i,p;if(this===r&&i<t&&t<n)for(p=o-1;p>=0;--p)r[p+t]=this[p+i];else if(o<1e3||!a.TYPED_ARRAY_SUPPORT)for(p=0;p<o;++p)r[p+t]=this[p+i];else Uint8Array.prototype.set.call(r,this.subarray(i,i+o),t);return o};a.prototype.fill=function(r,t,i,n){if(typeof r=="string"){if(typeof t=="string"?(n=t,t=0,i=this.length):typeof i=="string"&&(n=i,i=this.length),r.length===1){var o=r.charCodeAt(0);o<256&&(r=o)}if(n!==void 0&&typeof n!="string")throw new TypeError("encoding must be a string");if(typeof n=="string"&&!a.isEncoding(n))throw new TypeError("Unknown encoding: "+n)}else typeof r=="number"&&(r=r&255);if(t<0||this.length<t||this.length<i)throw new RangeError("Out of range index");if(i<=t)return this;t=t>>>0,i=i===void 0?this.length:i>>>0,r||(r=0);var p;if(typeof r=="number")for(p=t;p<i;++p)this[p]=r;else{var c=w(r)?r:P(new a(r,n).toString()),h=c.length;for(p=0;p<i-t;++p)this[p+t]=c[p%h]}return this};var ct=/[^+\/0-9A-Za-z-_]/g;function ht(e){if(e=st(e).replace(ct,""),e.length<2)return"";for(;e.length%4!==0;)e=e+"=";return e}function st(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}function ft(e){return e<16?"0"+e.toString(16):e.toString(16)}function P(e,r){r=r||1/0;for(var t,i=e.length,n=null,o=[],p=0;p<i;++p){if(t=e.charCodeAt(p),t>55295&&t<57344){if(!n){if(t>56319){(r-=3)>-1&&o.push(239,191,189);continue}else if(p+1===i){(r-=3)>-1&&o.push(239,191,189);continue}n=t;continue}if(t<56320){(r-=3)>-1&&o.push(239,191,189),n=t;continue}t=(n-55296<<10|t-56320)+65536}else n&&(r-=3)>-1&&o.push(239,191,189);if(n=null,t<128){if((r-=1)<0)break;o.push(t)}else if(t<2048){if((r-=2)<0)break;o.push(t>>6|192,t&63|128)}else if(t<65536){if((r-=3)<0)break;o.push(t>>12|224,t>>6&63|128,t&63|128)}else if(t<1114112){if((r-=4)<0)break;o.push(t>>18|240,t>>12&63|128,t>>6&63|128,t&63|128)}else throw new Error("Invalid code point")}return o}function ut(e){for(var r=[],t=0;t<e.length;++t)r.push(e.charCodeAt(t)&255);return r}function lt(e,r){for(var t,i,n,o=[],p=0;p<e.length&&!((r-=2)<0);++p)t=e.charCodeAt(p),i=t>>8,n=t%256,o.push(n),o.push(i);return o}function cr(e){return Vr(ht(e))}function M(e,r,t,i){for(var n=0;n<i&&!(n+t>=r.length||n>=e.length);++n)r[n+t]=e[n];return n}function Et(e){return e!==e}function mt(e){return e!=null&&(!!e._isBuffer||hr(e)||xt(e))}function hr(e){return!!e.constructor&&typeof e.constructor.isBuffer=="function"&&e.constructor.isBuffer(e)}function xt(e){return typeof e.readFloatLE=="function"&&typeof e.slice=="function"&&hr(e.slice(0,0))}function k(e,r,t,i,n){var o,p,c=n*8-i-1,h=(1<<c)-1,s=h>>1,u=-7,f=t?n-1:0,_=t?-1:1,m=e[r+f];for(f+=_,o=m&(1<<-u)-1,m>>=-u,u+=c;u>0;o=o*256+e[r+f],f+=_,u-=8);for(p=o&(1<<-u)-1,o>>=-u,u+=i;u>0;p=p*256+e[r+f],f+=_,u-=8);if(o===0)o=1-s;else{if(o===h)return p?NaN:(m?-1:1)*(1/0);p=p+Math.pow(2,i),o=o-s}return(m?-1:1)*p*Math.pow(2,o-i)}function sr(e,r,t,i,n,o){var p,c,h,s=o*8-n-1,u=(1<<s)-1,f=u>>1,_=n===23?Math.pow(2,-24)-Math.pow(2,-77):0,m=i?0:o-1,N=i?1:-1,Er=r<0||r===0&&1/r<0?1:0;for(r=Math.abs(r),isNaN(r)||r===1/0?(c=isNaN(r)?1:0,p=u):(p=Math.floor(Math.log(r)/Math.LN2),r*(h=Math.pow(2,-p))<1&&(p--,h*=2),p+f>=1?r+=_/h:r+=_*Math.pow(2,1-f),r*h>=2&&(p++,h/=2),p+f>=u?(c=0,p=u):p+f>=1?(c=(r*h-1)*Math.pow(2,n),p=p+f):(c=r*Math.pow(2,f-1)*Math.pow(2,n),p=0));n>=8;e[t+m]=c&255,m+=N,c/=256,n-=8);for(p=p<<n|c,s+=n;s>0;e[t+m]=p&255,m+=N,p/=256,s-=8);e[t+m-N]|=Er*128}var fr=(s=>(s.MFT_AUDIO_LINK="mft.audioLink",s.MFT_TITLE="mft.title",s.MODE_PRE_SALE="mode.preSale",s.MAKER_FEE="makerFee",s.TAKER_FEE="takerFee",s.VIEW_BASE_COIN_ICON_LINK="view.baseCoinIconLink",s.VIEW_BASE_COIN_MARKET_LINK="view.baseCoinMarketLink",s.VIEW_PRICE_COIN_ICON_LINK="view.priceCoinIconLink",s.VIEW_PRICE_COIN_MARKET_LINK="view.priceCoinMarketLink",s))(fr||{}),L=fr;var ur=(n=>(n.GLOBAL_PAIR_DELISTING="GLOBAL_PAIR_DELISTING",n.GLOBAL_NEW_PAIR_LISTING="GLOBAL_NEW_PAIR_LISTING",n.GLOBAL_SYSTEM_MAINTENANCE="GLOBAL_SYSTEM_MAINTENANCE",n.GLOBAL_SMART_CONTRACT_UPDATE="GLOBAL_SMART_CONTRACT_UPDATE",n))(ur||{}),lr=(i=>(i.ACCOUNT_POINTS_UNLOCK_ACHIEVEMENT="ACCOUNT_POINTS_UNLOCK_ACHIEVEMENT",i.ACCOUNT_KYC_STATUS_CHANGED="ACCOUNT_KYC_STATUS_CHANGED",i.ACCOUNT_AFFILIATE_DASHBOARD_UNLOCKED="ACCOUNT_AFFILIATE_DASHBOARD_UNLOCKED",i))(lr||{}),ge={...ur,...lr};var vi=e=>{let{base_id:r,base_chain_id:t,base_decimal:i,base_currency:n,price_id:o,price_chain_id:p,price_decimal:c,price_currency:h}=e,[s,u]=[[r,t,i,n],[o,p,c,h]].map(([f,_,m,N])=>({address:f,chainId:_,decimal:m,name:N}));return{baseAsset:s,priceAsset:u}},_t=(e,r)=>e?.reduce((t,i)=>{let{settingId:n,value:o}=i;return i.companyId&&i.companyId!==r||(n===L.MODE_PRE_SALE?t[n]=JSON.parse(o):t[n]=o),t},{}),Oi=(e,r,t)=>{let i=_t(e,r),n=t==="M"?L.MAKER_FEE:L.TAKER_FEE,o=Number(i[n]);if(o)return o};export{Oi as extractPairFee,vi as fetchTokensFromPair,_t as parsePairSettings};
|
|
1
|
+
function V(){throw new Error("setTimeout has not been defined")}function K(){throw new Error("clearTimeout has not been defined")}var b=V,C=K;typeof globalThis.setTimeout=="function"&&(b=setTimeout);typeof globalThis.clearTimeout=="function"&&(C=clearTimeout);function z(t){if(b===setTimeout)return setTimeout(t,0);if((b===V||!b)&&setTimeout)return b=setTimeout,setTimeout(t,0);try{return b(t,0)}catch{try{return b.call(null,t,0)}catch{return b.call(this,t,0)}}}function mr(t){if(C===clearTimeout)return clearTimeout(t);if((C===K||!C)&&clearTimeout)return C=clearTimeout,clearTimeout(t);try{return C(t)}catch{try{return C.call(null,t)}catch{return C.call(this,t)}}}var R=[],L=!1,D,g=-1;function Ar(){!L||!D||(L=!1,D.length?R=D.concat(R):g=-1,R.length&&J())}function J(){if(!L){var t=z(Ar);L=!0;for(var r=R.length;r;){for(D=R,R=[];++g<r;)D&&D[g].run();g=-1,r=R.length}D=null,L=!1,mr(t)}}function _r(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];R.push(new X(t,r)),R.length===1&&!L&&z(J)}function X(t,r){this.fun=t,this.array=r}X.prototype.run=function(){this.fun.apply(null,this.array)};var xr="browser",Tr="browser",Ir=!0,Rr={},wr=[],Nr="",br={},Cr={},Dr={};function d(){}var dr=d,Or=d,vr=d,Lr=d,yr=d,gr=d,Ur=d;function Pr(t){throw new Error("process.binding is not supported")}function Br(){return"/"}function Mr(t){throw new Error("process.chdir is not supported")}function Fr(){return 0}var v=globalThis.performance||{},kr=v.now||v.mozNow||v.msNow||v.oNow||v.webkitNow||function(){return new Date().getTime()};function Gr(t){var r=kr.call(v)*.001,e=Math.floor(r),i=Math.floor(r%1*1e9);return t&&(e=e-t[0],i=i-t[1],i<0&&(e--,i+=1e9)),[e,i]}var Yr=new Date;function Sr(){var t=new Date,r=t-Yr;return r/1e3}var l={nextTick:_r,title:xr,browser:Ir,env:Rr,argv:wr,version:Nr,versions:br,on:dr,addListener:Or,once:vr,off:Lr,removeListener:yr,removeAllListeners:gr,emit:Ur,binding:Pr,cwd:Br,chdir:Mr,umask:Fr,hrtime:Gr,platform:Tr,release:Cr,config:Dr,uptime:Sr},H={};Object.keys(H).forEach(t=>{let r=t.split("."),e=l;for(let i=0;i<r.length;i++){let n=r[i];i===r.length-1?e[n]=H[t]:e=e[n]||(e[n]={})}});var T=[],x=[],Wr=typeof Uint8Array<"u"?Uint8Array:Array,Y=!1;function $(){Y=!0;for(var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",r=0,e=t.length;r<e;++r)T[r]=t[r],x[t.charCodeAt(r)]=r;x[45]=62,x[95]=63}function Hr(t){Y||$();var r,e,i,n,o,p,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,p=new Wr(c*3/4-o),i=o>0?c-4:c;var h=0;for(r=0,e=0;r<i;r+=4,e+=3)n=x[t.charCodeAt(r)]<<18|x[t.charCodeAt(r+1)]<<12|x[t.charCodeAt(r+2)]<<6|x[t.charCodeAt(r+3)],p[h++]=n>>16&255,p[h++]=n>>8&255,p[h++]=n&255;return o===2?(n=x[t.charCodeAt(r)]<<2|x[t.charCodeAt(r+1)]>>4,p[h++]=n&255):o===1&&(n=x[t.charCodeAt(r)]<<10|x[t.charCodeAt(r+1)]<<4|x[t.charCodeAt(r+2)]>>2,p[h++]=n>>8&255,p[h++]=n&255),p}function Vr(t){return T[t>>18&63]+T[t>>12&63]+T[t>>6&63]+T[t&63]}function Kr(t,r,e){for(var i,n=[],o=r;o<e;o+=3)i=(t[o]<<16)+(t[o+1]<<8)+t[o+2],n.push(Vr(i));return n.join("")}function q(t){Y||$();for(var r,e=t.length,i=e%3,n="",o=[],p=16383,c=0,h=e-i;c<h;c+=p)o.push(Kr(t,c,c+p>h?h:c+p));return i===1?(r=t[e-1],n+=T[r>>2],n+=T[r<<4&63],n+="=="):i===2&&(r=(t[e-2]<<8)+t[e-1],n+=T[r>>10],n+=T[r>>4&63],n+=T[r<<2&63],n+="="),o.push(n),o.join("")}a.TYPED_ARRAY_SUPPORT=globalThis.TYPED_ARRAY_SUPPORT!==void 0?globalThis.TYPED_ARRAY_SUPPORT:!0;function U(){return a.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function w(t,r){if(U()<r)throw new RangeError("Invalid typed array length");return a.TYPED_ARRAY_SUPPORT?(t=new Uint8Array(r),t.__proto__=a.prototype):(t===null&&(t=new a(r)),t.length=r),t}function a(t,r,e){if(!a.TYPED_ARRAY_SUPPORT&&!(this instanceof a))return new a(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 S(this,t)}return j(this,t,r,e)}a.poolSize=8192;a._augment=function(t){return t.__proto__=a.prototype,t};function j(t,r,e,i){if(typeof r=="number")throw new TypeError('"value" argument must not be a number');return typeof ArrayBuffer<"u"&&r instanceof ArrayBuffer?Xr(t,r,e,i):typeof r=="string"?Jr(t,r,e):qr(t,r)}a.from=function(t,r,e){return j(null,t,r,e)};a.kMaxLength=U();a.TYPED_ARRAY_SUPPORT&&(a.prototype.__proto__=Uint8Array.prototype,a.__proto__=Uint8Array,typeof Symbol<"u"&&Symbol.species&&a[Symbol.species]);function rr(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 zr(t,r,e,i){return rr(r),r<=0?w(t,r):e!==void 0?typeof i=="string"?w(t,r).fill(e,i):w(t,r).fill(e):w(t,r)}a.alloc=function(t,r,e){return zr(null,t,r,e)};function S(t,r){if(rr(r),t=w(t,r<0?0:W(r)|0),!a.TYPED_ARRAY_SUPPORT)for(var e=0;e<r;++e)t[e]=0;return t}a.allocUnsafe=function(t){return S(null,t)};a.allocUnsafeSlow=function(t){return S(null,t)};function Jr(t,r,e){if((typeof e!="string"||e==="")&&(e="utf8"),!a.isEncoding(e))throw new TypeError('"encoding" must be a valid string encoding');var i=er(r,e)|0;t=w(t,i);var n=t.write(r,e);return n!==i&&(t=t.slice(0,n)),t}function G(t,r){var e=r.length<0?0:W(r.length)|0;t=w(t,e);for(var i=0;i<e;i+=1)t[i]=r[i]&255;return t}function Xr(t,r,e,i){if(r.byteLength,e<0||r.byteLength<e)throw new RangeError("'offset' is out of bounds");if(r.byteLength<e+(i||0))throw new RangeError("'length' is out of bounds");return e===void 0&&i===void 0?r=new Uint8Array(r):i===void 0?r=new Uint8Array(r,e):r=new Uint8Array(r,e,i),a.TYPED_ARRAY_SUPPORT?(t=r,t.__proto__=a.prototype):t=G(t,r),t}function qr(t,r){if(I(r)){var e=W(r.length)|0;return t=w(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"||Ee(r.length)?w(t,0):G(t,r);if(r.type==="Buffer"&&Array.isArray(r.data))return G(t,r.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function W(t){if(t>=U())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+U().toString(16)+" bytes");return t|0}a.isBuffer=me;function I(t){return!!(t!=null&&t._isBuffer)}a.compare=function(r,e){if(!I(r)||!I(e))throw new TypeError("Arguments must be Buffers");if(r===e)return 0;for(var i=r.length,n=e.length,o=0,p=Math.min(i,n);o<p;++o)if(r[o]!==e[o]){i=r[o],n=e[o];break}return i<n?-1:n<i?1:0};a.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}};a.concat=function(r,e){if(!Array.isArray(r))throw new TypeError('"list" argument must be an Array of Buffers');if(r.length===0)return a.alloc(0);var i;if(e===void 0)for(e=0,i=0;i<r.length;++i)e+=r[i].length;var n=a.allocUnsafe(e),o=0;for(i=0;i<r.length;++i){var p=r[i];if(!I(p))throw new TypeError('"list" argument must be an Array of Buffers');p.copy(n,o),o+=p.length}return n};function er(t,r){if(I(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 i=!1;;)switch(r){case"ascii":case"latin1":case"binary":return e;case"utf8":case"utf-8":case void 0:return P(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(i)return P(t).length;r=(""+r).toLowerCase(),i=!0}}a.byteLength=er;function Qr(t,r,e){var i=!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 pe(this,r,e);case"utf8":case"utf-8":return nr(this,r,e);case"ascii":return ne(this,r,e);case"latin1":case"binary":return oe(this,r,e);case"base64":return te(this,r,e);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ae(this,r,e);default:if(i)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),i=!0}}a.prototype._isBuffer=!0;function O(t,r,e){var i=t[r];t[r]=t[e],t[e]=i}a.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)O(this,e,e+1);return this};a.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)O(this,e,e+3),O(this,e+1,e+2);return this};a.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)O(this,e,e+7),O(this,e+1,e+6),O(this,e+2,e+5),O(this,e+3,e+4);return this};a.prototype.toString=function(){var r=this.length|0;return r===0?"":arguments.length===0?nr(this,0,r):Qr.apply(this,arguments)};a.prototype.equals=function(r){if(!I(r))throw new TypeError("Argument must be a Buffer");return this===r?!0:a.compare(this,r)===0};a.prototype.compare=function(r,e,i,n,o){if(!I(r))throw new TypeError("Argument must be a Buffer");if(e===void 0&&(e=0),i===void 0&&(i=r?r.length:0),n===void 0&&(n=0),o===void 0&&(o=this.length),e<0||i>r.length||n<0||o>this.length)throw new RangeError("out of range index");if(n>=o&&e>=i)return 0;if(n>=o)return-1;if(e>=i)return 1;if(e>>>=0,i>>>=0,n>>>=0,o>>>=0,this===r)return 0;for(var p=o-n,c=i-e,h=Math.min(p,c),s=this.slice(n,o),u=r.slice(e,i),f=0;f<h;++f)if(s[f]!==u[f]){p=s[f],c=u[f];break}return p<c?-1:c<p?1:0};function tr(t,r,e,i,n){if(t.length===0)return-1;if(typeof e=="string"?(i=e,e=0):e>2147483647?e=2147483647:e<-2147483648&&(e=-2147483648),e=+e,isNaN(e)&&(e=n?0:t.length-1),e<0&&(e=t.length+e),e>=t.length){if(n)return-1;e=t.length-1}else if(e<0)if(n)e=0;else return-1;if(typeof r=="string"&&(r=a.from(r,i)),I(r))return r.length===0?-1:Q(t,r,e,i,n);if(typeof r=="number")return r=r&255,a.TYPED_ARRAY_SUPPORT&&typeof Uint8Array.prototype.indexOf=="function"?n?Uint8Array.prototype.indexOf.call(t,r,e):Uint8Array.prototype.lastIndexOf.call(t,r,e):Q(t,[r],e,i,n);throw new TypeError("val must be string, number or Buffer")}function Q(t,r,e,i,n){var o=1,p=t.length,c=r.length;if(i!==void 0&&(i=String(i).toLowerCase(),i==="ucs2"||i==="ucs-2"||i==="utf16le"||i==="utf-16le")){if(t.length<2||r.length<2)return-1;o=2,p/=2,c/=2,e/=2}function h(m,N){return o===1?m[N]:m.readUInt16BE(N*o)}var s;if(n){var u=-1;for(s=e;s<p;s++)if(h(t,s)===h(r,u===-1?0:s-u)){if(u===-1&&(u=s),s-u+1===c)return u*o}else u!==-1&&(s-=s-u),u=-1}else for(e+c>p&&(e=p-c),s=e;s>=0;s--){for(var f=!0,_=0;_<c;_++)if(h(t,s+_)!==h(r,_)){f=!1;break}if(f)return s}return-1}a.prototype.includes=function(r,e,i){return this.indexOf(r,e,i)!==-1};a.prototype.indexOf=function(r,e,i){return tr(this,r,e,i,!0)};a.prototype.lastIndexOf=function(r,e,i){return tr(this,r,e,i,!1)};function Zr(t,r,e,i){e=Number(e)||0;var n=t.length-e;i?(i=Number(i),i>n&&(i=n)):i=n;var o=r.length;if(o%2!==0)throw new TypeError("Invalid hex string");i>o/2&&(i=o/2);for(var p=0;p<i;++p){var c=parseInt(r.substr(p*2,2),16);if(isNaN(c))return p;t[e+p]=c}return p}function $r(t,r,e,i){return F(P(r,t.length-e),t,e,i)}function ir(t,r,e,i){return F(ue(r),t,e,i)}function jr(t,r,e,i){return ir(t,r,e,i)}function re(t,r,e,i){return F(cr(r),t,e,i)}function ee(t,r,e,i){return F(le(r,t.length-e),t,e,i)}a.prototype.write=function(r,e,i,n){if(e===void 0)n="utf8",i=this.length,e=0;else if(i===void 0&&typeof e=="string")n=e,i=this.length,e=0;else if(isFinite(e))e=e|0,isFinite(i)?(i=i|0,n===void 0&&(n="utf8")):(n=i,i=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var o=this.length-e;if((i===void 0||i>o)&&(i=o),r.length>0&&(i<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var p=!1;;)switch(n){case"hex":return Zr(this,r,e,i);case"utf8":case"utf-8":return $r(this,r,e,i);case"ascii":return ir(this,r,e,i);case"latin1":case"binary":return jr(this,r,e,i);case"base64":return re(this,r,e,i);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ee(this,r,e,i);default:if(p)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),p=!0}};a.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function te(t,r,e){return r===0&&e===t.length?q(t):q(t.slice(r,e))}function nr(t,r,e){e=Math.min(t.length,e);for(var i=[],n=r;n<e;){var o=t[n],p=null,c=o>239?4:o>223?3:o>191?2:1;if(n+c<=e){var h,s,u,f;switch(c){case 1:o<128&&(p=o);break;case 2:h=t[n+1],(h&192)===128&&(f=(o&31)<<6|h&63,f>127&&(p=f));break;case 3:h=t[n+1],s=t[n+2],(h&192)===128&&(s&192)===128&&(f=(o&15)<<12|(h&63)<<6|s&63,f>2047&&(f<55296||f>57343)&&(p=f));break;case 4:h=t[n+1],s=t[n+2],u=t[n+3],(h&192)===128&&(s&192)===128&&(u&192)===128&&(f=(o&15)<<18|(h&63)<<12|(s&63)<<6|u&63,f>65535&&f<1114112&&(p=f))}}p===null?(p=65533,c=1):p>65535&&(p-=65536,i.push(p>>>10&1023|55296),p=56320|p&1023),i.push(p),n+=c}return ie(i)}var Z=4096;function ie(t){var r=t.length;if(r<=Z)return String.fromCharCode.apply(String,t);for(var e="",i=0;i<r;)e+=String.fromCharCode.apply(String,t.slice(i,i+=Z));return e}function ne(t,r,e){var i="";e=Math.min(t.length,e);for(var n=r;n<e;++n)i+=String.fromCharCode(t[n]&127);return i}function oe(t,r,e){var i="";e=Math.min(t.length,e);for(var n=r;n<e;++n)i+=String.fromCharCode(t[n]);return i}function pe(t,r,e){var i=t.length;(!r||r<0)&&(r=0),(!e||e<0||e>i)&&(e=i);for(var n="",o=r;o<e;++o)n+=fe(t[o]);return n}function ae(t,r,e){for(var i=t.slice(r,e),n="",o=0;o<i.length;o+=2)n+=String.fromCharCode(i[o]+i[o+1]*256);return n}a.prototype.slice=function(r,e){var i=this.length;r=~~r,e=e===void 0?i:~~e,r<0?(r+=i,r<0&&(r=0)):r>i&&(r=i),e<0?(e+=i,e<0&&(e=0)):e>i&&(e=i),e<r&&(e=r);var n;if(a.TYPED_ARRAY_SUPPORT)n=this.subarray(r,e),n.__proto__=a.prototype;else{var o=e-r;n=new a(o,void 0);for(var p=0;p<o;++p)n[p]=this[p+r]}return n};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")}a.prototype.readUIntLE=function(r,e,i){r=r|0,e=e|0,i||E(r,e,this.length);for(var n=this[r],o=1,p=0;++p<e&&(o*=256);)n+=this[r+p]*o;return n};a.prototype.readUIntBE=function(r,e,i){r=r|0,e=e|0,i||E(r,e,this.length);for(var n=this[r+--e],o=1;e>0&&(o*=256);)n+=this[r+--e]*o;return n};a.prototype.readUInt8=function(r,e){return e||E(r,1,this.length),this[r]};a.prototype.readUInt16LE=function(r,e){return e||E(r,2,this.length),this[r]|this[r+1]<<8};a.prototype.readUInt16BE=function(r,e){return e||E(r,2,this.length),this[r]<<8|this[r+1]};a.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};a.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])};a.prototype.readIntLE=function(r,e,i){r=r|0,e=e|0,i||E(r,e,this.length);for(var n=this[r],o=1,p=0;++p<e&&(o*=256);)n+=this[r+p]*o;return o*=128,n>=o&&(n-=Math.pow(2,8*e)),n};a.prototype.readIntBE=function(r,e,i){r=r|0,e=e|0,i||E(r,e,this.length);for(var n=e,o=1,p=this[r+--n];n>0&&(o*=256);)p+=this[r+--n]*o;return o*=128,p>=o&&(p-=Math.pow(2,8*e)),p};a.prototype.readInt8=function(r,e){return e||E(r,1,this.length),this[r]&128?(255-this[r]+1)*-1:this[r]};a.prototype.readInt16LE=function(r,e){e||E(r,2,this.length);var i=this[r]|this[r+1]<<8;return i&32768?i|4294901760:i};a.prototype.readInt16BE=function(r,e){e||E(r,2,this.length);var i=this[r+1]|this[r]<<8;return i&32768?i|4294901760:i};a.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};a.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]};a.prototype.readFloatLE=function(r,e){return e||E(r,4,this.length),k(this,r,!0,23,4)};a.prototype.readFloatBE=function(r,e){return e||E(r,4,this.length),k(this,r,!1,23,4)};a.prototype.readDoubleLE=function(r,e){return e||E(r,8,this.length),k(this,r,!0,52,8)};a.prototype.readDoubleBE=function(r,e){return e||E(r,8,this.length),k(this,r,!1,52,8)};function A(t,r,e,i,n,o){if(!I(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(r>n||r<o)throw new RangeError('"value" argument is out of bounds');if(e+i>t.length)throw new RangeError("Index out of range")}a.prototype.writeUIntLE=function(r,e,i,n){if(r=+r,e=e|0,i=i|0,!n){var o=Math.pow(2,8*i)-1;A(this,r,e,i,o,0)}var p=1,c=0;for(this[e]=r&255;++c<i&&(p*=256);)this[e+c]=r/p&255;return e+i};a.prototype.writeUIntBE=function(r,e,i,n){if(r=+r,e=e|0,i=i|0,!n){var o=Math.pow(2,8*i)-1;A(this,r,e,i,o,0)}var p=i-1,c=1;for(this[e+p]=r&255;--p>=0&&(c*=256);)this[e+p]=r/c&255;return e+i};a.prototype.writeUInt8=function(r,e,i){return r=+r,e=e|0,i||A(this,r,e,1,255,0),a.TYPED_ARRAY_SUPPORT||(r=Math.floor(r)),this[e]=r&255,e+1};function B(t,r,e,i){r<0&&(r=65535+r+1);for(var n=0,o=Math.min(t.length-e,2);n<o;++n)t[e+n]=(r&255<<8*(i?n:1-n))>>>(i?n:1-n)*8}a.prototype.writeUInt16LE=function(r,e,i){return r=+r,e=e|0,i||A(this,r,e,2,65535,0),a.TYPED_ARRAY_SUPPORT?(this[e]=r&255,this[e+1]=r>>>8):B(this,r,e,!0),e+2};a.prototype.writeUInt16BE=function(r,e,i){return r=+r,e=e|0,i||A(this,r,e,2,65535,0),a.TYPED_ARRAY_SUPPORT?(this[e]=r>>>8,this[e+1]=r&255):B(this,r,e,!1),e+2};function M(t,r,e,i){r<0&&(r=4294967295+r+1);for(var n=0,o=Math.min(t.length-e,4);n<o;++n)t[e+n]=r>>>(i?n:3-n)*8&255}a.prototype.writeUInt32LE=function(r,e,i){return r=+r,e=e|0,i||A(this,r,e,4,4294967295,0),a.TYPED_ARRAY_SUPPORT?(this[e+3]=r>>>24,this[e+2]=r>>>16,this[e+1]=r>>>8,this[e]=r&255):M(this,r,e,!0),e+4};a.prototype.writeUInt32BE=function(r,e,i){return r=+r,e=e|0,i||A(this,r,e,4,4294967295,0),a.TYPED_ARRAY_SUPPORT?(this[e]=r>>>24,this[e+1]=r>>>16,this[e+2]=r>>>8,this[e+3]=r&255):M(this,r,e,!1),e+4};a.prototype.writeIntLE=function(r,e,i,n){if(r=+r,e=e|0,!n){var o=Math.pow(2,8*i-1);A(this,r,e,i,o-1,-o)}var p=0,c=1,h=0;for(this[e]=r&255;++p<i&&(c*=256);)r<0&&h===0&&this[e+p-1]!==0&&(h=1),this[e+p]=(r/c>>0)-h&255;return e+i};a.prototype.writeIntBE=function(r,e,i,n){if(r=+r,e=e|0,!n){var o=Math.pow(2,8*i-1);A(this,r,e,i,o-1,-o)}var p=i-1,c=1,h=0;for(this[e+p]=r&255;--p>=0&&(c*=256);)r<0&&h===0&&this[e+p+1]!==0&&(h=1),this[e+p]=(r/c>>0)-h&255;return e+i};a.prototype.writeInt8=function(r,e,i){return r=+r,e=e|0,i||A(this,r,e,1,127,-128),a.TYPED_ARRAY_SUPPORT||(r=Math.floor(r)),r<0&&(r=255+r+1),this[e]=r&255,e+1};a.prototype.writeInt16LE=function(r,e,i){return r=+r,e=e|0,i||A(this,r,e,2,32767,-32768),a.TYPED_ARRAY_SUPPORT?(this[e]=r&255,this[e+1]=r>>>8):B(this,r,e,!0),e+2};a.prototype.writeInt16BE=function(r,e,i){return r=+r,e=e|0,i||A(this,r,e,2,32767,-32768),a.TYPED_ARRAY_SUPPORT?(this[e]=r>>>8,this[e+1]=r&255):B(this,r,e,!1),e+2};a.prototype.writeInt32LE=function(r,e,i){return r=+r,e=e|0,i||A(this,r,e,4,2147483647,-2147483648),a.TYPED_ARRAY_SUPPORT?(this[e]=r&255,this[e+1]=r>>>8,this[e+2]=r>>>16,this[e+3]=r>>>24):M(this,r,e,!0),e+4};a.prototype.writeInt32BE=function(r,e,i){return r=+r,e=e|0,i||A(this,r,e,4,2147483647,-2147483648),r<0&&(r=4294967295+r+1),a.TYPED_ARRAY_SUPPORT?(this[e]=r>>>24,this[e+1]=r>>>16,this[e+2]=r>>>8,this[e+3]=r&255):M(this,r,e,!1),e+4};function or(t,r,e,i,n,o){if(e+i>t.length)throw new RangeError("Index out of range");if(e<0)throw new RangeError("Index out of range")}function pr(t,r,e,i,n){return n||or(t,r,e,4,34028234663852886e22,-34028234663852886e22),sr(t,r,e,i,23,4),e+4}a.prototype.writeFloatLE=function(r,e,i){return pr(this,r,e,!0,i)};a.prototype.writeFloatBE=function(r,e,i){return pr(this,r,e,!1,i)};function ar(t,r,e,i,n){return n||or(t,r,e,8,17976931348623157e292,-17976931348623157e292),sr(t,r,e,i,52,8),e+8}a.prototype.writeDoubleLE=function(r,e,i){return ar(this,r,e,!0,i)};a.prototype.writeDoubleBE=function(r,e,i){return ar(this,r,e,!1,i)};a.prototype.copy=function(r,e,i,n){if(i||(i=0),!n&&n!==0&&(n=this.length),e>=r.length&&(e=r.length),e||(e=0),n>0&&n<i&&(n=i),n===i||r.length===0||this.length===0)return 0;if(e<0)throw new RangeError("targetStart out of bounds");if(i<0||i>=this.length)throw new RangeError("sourceStart out of bounds");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),r.length-e<n-i&&(n=r.length-e+i);var o=n-i,p;if(this===r&&i<e&&e<n)for(p=o-1;p>=0;--p)r[p+e]=this[p+i];else if(o<1e3||!a.TYPED_ARRAY_SUPPORT)for(p=0;p<o;++p)r[p+e]=this[p+i];else Uint8Array.prototype.set.call(r,this.subarray(i,i+o),e);return o};a.prototype.fill=function(r,e,i,n){if(typeof r=="string"){if(typeof e=="string"?(n=e,e=0,i=this.length):typeof i=="string"&&(n=i,i=this.length),r.length===1){var o=r.charCodeAt(0);o<256&&(r=o)}if(n!==void 0&&typeof n!="string")throw new TypeError("encoding must be a string");if(typeof n=="string"&&!a.isEncoding(n))throw new TypeError("Unknown encoding: "+n)}else typeof r=="number"&&(r=r&255);if(e<0||this.length<e||this.length<i)throw new RangeError("Out of range index");if(i<=e)return this;e=e>>>0,i=i===void 0?this.length:i>>>0,r||(r=0);var p;if(typeof r=="number")for(p=e;p<i;++p)this[p]=r;else{var c=I(r)?r:P(new a(r,n).toString()),h=c.length;for(p=0;p<i-e;++p)this[p+e]=c[p%h]}return this};var ce=/[^+\/0-9A-Za-z-_]/g;function he(t){if(t=se(t).replace(ce,""),t.length<2)return"";for(;t.length%4!==0;)t=t+"=";return t}function se(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}function fe(t){return t<16?"0"+t.toString(16):t.toString(16)}function P(t,r){r=r||1/0;for(var e,i=t.length,n=null,o=[],p=0;p<i;++p){if(e=t.charCodeAt(p),e>55295&&e<57344){if(!n){if(e>56319){(r-=3)>-1&&o.push(239,191,189);continue}else if(p+1===i){(r-=3)>-1&&o.push(239,191,189);continue}n=e;continue}if(e<56320){(r-=3)>-1&&o.push(239,191,189),n=e;continue}e=(n-55296<<10|e-56320)+65536}else n&&(r-=3)>-1&&o.push(239,191,189);if(n=null,e<128){if((r-=1)<0)break;o.push(e)}else if(e<2048){if((r-=2)<0)break;o.push(e>>6|192,e&63|128)}else if(e<65536){if((r-=3)<0)break;o.push(e>>12|224,e>>6&63|128,e&63|128)}else if(e<1114112){if((r-=4)<0)break;o.push(e>>18|240,e>>12&63|128,e>>6&63|128,e&63|128)}else throw new Error("Invalid code point")}return o}function ue(t){for(var r=[],e=0;e<t.length;++e)r.push(t.charCodeAt(e)&255);return r}function le(t,r){for(var e,i,n,o=[],p=0;p<t.length&&!((r-=2)<0);++p)e=t.charCodeAt(p),i=e>>8,n=e%256,o.push(n),o.push(i);return o}function cr(t){return Hr(he(t))}function F(t,r,e,i){for(var n=0;n<i&&!(n+e>=r.length||n>=t.length);++n)r[n+e]=t[n];return n}function Ee(t){return t!==t}function me(t){return t!=null&&(!!t._isBuffer||hr(t)||Ae(t))}function hr(t){return!!t.constructor&&typeof t.constructor.isBuffer=="function"&&t.constructor.isBuffer(t)}function Ae(t){return typeof t.readFloatLE=="function"&&typeof t.slice=="function"&&hr(t.slice(0,0))}function k(t,r,e,i,n){var o,p,c=n*8-i-1,h=(1<<c)-1,s=h>>1,u=-7,f=e?n-1:0,_=e?-1:1,m=t[r+f];for(f+=_,o=m&(1<<-u)-1,m>>=-u,u+=c;u>0;o=o*256+t[r+f],f+=_,u-=8);for(p=o&(1<<-u)-1,o>>=-u,u+=i;u>0;p=p*256+t[r+f],f+=_,u-=8);if(o===0)o=1-s;else{if(o===h)return p?NaN:(m?-1:1)*(1/0);p=p+Math.pow(2,i),o=o-s}return(m?-1:1)*p*Math.pow(2,o-i)}function sr(t,r,e,i,n,o){var p,c,h,s=o*8-n-1,u=(1<<s)-1,f=u>>1,_=n===23?Math.pow(2,-24)-Math.pow(2,-77):0,m=i?0:o-1,N=i?1:-1,Er=r<0||r===0&&1/r<0?1:0;for(r=Math.abs(r),isNaN(r)||r===1/0?(c=isNaN(r)?1:0,p=u):(p=Math.floor(Math.log(r)/Math.LN2),r*(h=Math.pow(2,-p))<1&&(p--,h*=2),p+f>=1?r+=_/h:r+=_*Math.pow(2,1-f),r*h>=2&&(p++,h/=2),p+f>=u?(c=0,p=u):p+f>=1?(c=(r*h-1)*Math.pow(2,n),p=p+f):(c=r*Math.pow(2,f-1)*Math.pow(2,n),p=0));n>=8;t[e+m]=c&255,m+=N,c/=256,n-=8);for(p=p<<n|c,s+=n;s>0;t[e+m]=p&255,m+=N,p/=256,s-=8);t[e+m-N]|=Er*128}var fr=(s=>(s.MFT_AUDIO_LINK="mft.audioLink",s.MFT_TITLE="mft.title",s.MODE_PRE_SALE="mode.preSale",s.MAKER_FEE="makerFee",s.TAKER_FEE="takerFee",s.VIEW_BASE_COIN_ICON_LINK="view.baseCoinIconLink",s.VIEW_BASE_COIN_MARKET_LINK="view.baseCoinMarketLink",s.VIEW_PRICE_COIN_ICON_LINK="view.priceCoinIconLink",s.VIEW_PRICE_COIN_MARKET_LINK="view.priceCoinMarketLink",s))(fr||{}),y=fr;var ur=(n=>(n.GLOBAL_PAIR_DELISTING="GLOBAL_PAIR_DELISTING",n.GLOBAL_NEW_PAIR_LISTING="GLOBAL_NEW_PAIR_LISTING",n.GLOBAL_SYSTEM_MAINTENANCE="GLOBAL_SYSTEM_MAINTENANCE",n.GLOBAL_SMART_CONTRACT_UPDATE="GLOBAL_SMART_CONTRACT_UPDATE",n))(ur||{}),lr=(i=>(i.ACCOUNT_POINTS_UNLOCK_ACHIEVEMENT="ACCOUNT_POINTS_UNLOCK_ACHIEVEMENT",i.ACCOUNT_KYC_STATUS_CHANGED="ACCOUNT_KYC_STATUS_CHANGED",i.ACCOUNT_AFFILIATE_DASHBOARD_UNLOCKED="ACCOUNT_AFFILIATE_DASHBOARD_UNLOCKED",i))(lr||{}),dt={...ur,...lr};var Ui=t=>{let{base_id:r,base_chain_id:e,base_decimal:i,base_currency:n,price_id:o,price_chain_id:p,price_decimal:c,price_currency:h}=t,[s,u]=[[r,e,i,n],[o,p,c,h]].map(([f,_,m,N])=>({address:f,chainId:_,decimal:m,name:N}));return{baseAsset:s,priceAsset:u}},_e=(t,r)=>t?.reduce((e,i)=>{let{settingId:n,value:o}=i;return i.companyId&&i.companyId!==r||(n===y.MODE_PRE_SALE?e[n]=JSON.parse(o):e[n]=o),e},{}),Pi=(t,r,e)=>{let i=_e(t,r),n=e==="M"?y.MAKER_FEE:y.TAKER_FEE,o=Number(i[n]);if(o)return o};export{Pi as extractPairFee,Ui as fetchTokensFromPair,_e as parsePairSettings};
|
|
2
2
|
/*! Bundled license information:
|
|
3
3
|
|
|
4
4
|
@esbuild-plugins/node-globals-polyfill/Buffer.js:
|