@ultrade/shared 1.0.20 → 1.0.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/browser/constants/index.js +1 -1
- package/dist/browser/helpers/assert.helper.js +1 -1
- package/dist/browser/helpers/atomic.helper.js +1 -1
- package/dist/browser/helpers/balance.helper.js +1 -1
- package/dist/browser/helpers/codex/common.helper.js +1 -1
- package/dist/browser/helpers/codex/index.js +1 -1
- 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 +4 -4
- package/dist/browser/helpers/eth.helper.js +1 -1
- package/dist/browser/helpers/index.js +1 -1
- package/dist/browser/helpers/pointSystem.helper.js +1 -1
- package/dist/browser/types/index.js +1 -1
- package/dist/node/constants/index.js +1 -1
- package/dist/node/helpers/algo.helper.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 +1 -1
- 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/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 +1 -1
- package/dist/node/helpers/index.js +1 -1
- package/dist/node/helpers/pointSystem.helper.js +1 -1
- package/dist/node/helpers/withdraw.helper.js +2 -2
- package/dist/node/types/index.js +1 -1
- package/dist/{types → src/types}/settings.type.d.ts +39 -3
- package/package.json +1 -1
- /package/dist/{common → src/common}/auth.helper.d.ts +0 -0
- /package/dist/{common → src/common}/big-number.helper.d.ts +0 -0
- /package/dist/{common → src/common}/index.d.ts +0 -0
- /package/dist/{common → src/common}/mappers/codexAsset.mapper.d.ts +0 -0
- /package/dist/{common → src/common}/mappers/codexBalance.mapper.d.ts +0 -0
- /package/dist/{common → src/common}/mappers/index.d.ts +0 -0
- /package/dist/{common → src/common}/mappers/trade.mapper.d.ts +0 -0
- /package/dist/{common → src/common}/utils/assert.d.ts +0 -0
- /package/dist/{common → src/common}/utils/decode.d.ts +0 -0
- /package/dist/{common → src/common}/utils/index.d.ts +0 -0
- /package/dist/{common → src/common}/utils/social.d.ts +0 -0
- /package/dist/{common → src/common}/utils/stat.d.ts +0 -0
- /package/dist/{constants → src/constants}/auth.d.ts +0 -0
- /package/dist/{constants → src/constants}/cctp.d.ts +0 -0
- /package/dist/{constants → src/constants}/codex.d.ts +0 -0
- /package/dist/{constants → src/constants}/frontend.d.ts +0 -0
- /package/dist/{constants → src/constants}/index.d.ts +0 -0
- /package/dist/{constants → src/constants}/response.d.ts +0 -0
- /package/dist/{constants → src/constants}/settings.d.ts +0 -0
- /package/dist/{constants → src/constants}/withdrawalWalletsMessage.d.ts +0 -0
- /package/dist/{enums → src/enums}/chains.enum.d.ts +0 -0
- /package/dist/{enums → src/enums}/db/account/index.d.ts +0 -0
- /package/dist/{enums → src/enums}/db/affiliate.enum.d.ts +0 -0
- /package/dist/{enums → src/enums}/db/available-pair-settings.enum.d.ts +0 -0
- /package/dist/{enums → src/enums}/db/common.enum.d.ts +0 -0
- /package/dist/{enums → src/enums}/db/component/index.d.ts +0 -0
- /package/dist/{enums → src/enums}/db/index.d.ts +0 -0
- /package/dist/{enums → src/enums}/db/market-maker.enum.d.ts +0 -0
- /package/dist/{enums → src/enums}/db/notification-center/userNotification.enum.d.ts +0 -0
- /package/dist/{enums → src/enums}/db/order-side.enum.d.ts +0 -0
- /package/dist/{enums → src/enums}/db/order-status.enum.d.ts +0 -0
- /package/dist/{enums → src/enums}/db/order-type.enum.d.ts +0 -0
- /package/dist/{enums → src/enums}/db/relayer.enum.d.ts +0 -0
- /package/dist/{enums → src/enums}/db/setting-type.enum.d.ts +0 -0
- /package/dist/{enums → src/enums}/db/social-action.enum.d.ts +0 -0
- /package/dist/{enums → src/enums}/db/social-prompt.enum.d.ts +0 -0
- /package/dist/{enums → src/enums}/db/social.enum.d.ts +0 -0
- /package/dist/{enums → src/enums}/db/state-type.enum.d.ts +0 -0
- /package/dist/{enums → src/enums}/db/trade.enums.d.ts +0 -0
- /package/dist/{enums → src/enums}/db/tradingKeyType.enum.d.ts +0 -0
- /package/dist/{enums → src/enums}/db/upgrade.enum.d.ts +0 -0
- /package/dist/{enums → src/enums}/db/withdrawal-wallet.enum.d.ts +0 -0
- /package/dist/{enums → src/enums}/index.d.ts +0 -0
- /package/dist/{enums → src/enums}/maintenanceMode.enum.d.ts +0 -0
- /package/dist/{enums → src/enums}/notification.enum.d.ts +0 -0
- /package/dist/{enums → src/enums}/rabbitMq.d.ts +0 -0
- /package/dist/{enums → src/enums}/settings.enum.d.ts +0 -0
- /package/dist/{enums → src/enums}/social.enum.d.ts +0 -0
- /package/dist/{helpers → src/helpers}/Encoding.d.ts +0 -0
- /package/dist/{helpers → src/helpers}/algo.helper.d.ts +0 -0
- /package/dist/{helpers → src/helpers}/assert.helper.d.ts +0 -0
- /package/dist/{helpers → src/helpers}/atomic.helper.d.ts +0 -0
- /package/dist/{helpers → src/helpers}/balance.helper.d.ts +0 -0
- /package/dist/{helpers → src/helpers}/codex/common.helper.d.ts +0 -0
- /package/dist/{helpers → src/helpers}/codex/index.d.ts +0 -0
- /package/dist/{helpers → src/helpers}/codex/mbr.helper.d.ts +0 -0
- /package/dist/{helpers → src/helpers}/codex/mna.helper.d.ts +0 -0
- /package/dist/{helpers → src/helpers}/codex/order.helper.d.ts +0 -0
- /package/dist/{helpers → src/helpers}/codex/setGlobal.helper.d.ts +0 -0
- /package/dist/{helpers → src/helpers}/codex/transfer.helper.d.ts +0 -0
- /package/dist/{helpers → src/helpers}/codex/txn.helper.d.ts +0 -0
- /package/dist/{helpers → src/helpers}/codex.helper.d.ts +0 -0
- /package/dist/{helpers → src/helpers}/eth.helper.d.ts +0 -0
- /package/dist/{helpers → src/helpers}/index.d.ts +0 -0
- /package/dist/{helpers → src/helpers}/interval.helpers.d.ts +0 -0
- /package/dist/{helpers → src/helpers}/liquidity.helper.d.ts +0 -0
- /package/dist/{helpers → src/helpers}/order.helper.d.ts +0 -0
- /package/dist/{helpers → src/helpers}/pair.helper.d.ts +0 -0
- /package/dist/{helpers → src/helpers}/pointSystem.helper.d.ts +0 -0
- /package/dist/{helpers → src/helpers}/ticker.helpers.d.ts +0 -0
- /package/dist/{helpers → src/helpers}/vaa.helper.d.ts +0 -0
- /package/dist/{helpers → src/helpers}/withdraw.helper.d.ts +0 -0
- /package/dist/{interfaces → src/interfaces}/accountInfo.interface.d.ts +0 -0
- /package/dist/{interfaces → src/interfaces}/api/affiliate.interface.d.ts +0 -0
- /package/dist/{interfaces → src/interfaces}/api/index.d.ts +0 -0
- /package/dist/{interfaces → src/interfaces}/cache.interface.d.ts +0 -0
- /package/dist/{interfaces → src/interfaces}/db/baseModel.interface.d.ts +0 -0
- /package/dist/{interfaces → src/interfaces}/db/hummingbot/index.d.ts +0 -0
- /package/dist/{interfaces → src/interfaces}/db/index.d.ts +0 -0
- /package/dist/{interfaces → src/interfaces}/db/market/index.d.ts +0 -0
- /package/dist/{interfaces → src/interfaces}/db/marketing/index.d.ts +0 -0
- /package/dist/{interfaces → src/interfaces}/db/notification_center/index.d.ts +0 -0
- /package/dist/{interfaces → src/interfaces}/db/relayer/index.d.ts +0 -0
- /package/dist/{interfaces → src/interfaces}/db/social/index.d.ts +0 -0
- /package/dist/{interfaces → src/interfaces}/db/softDeleteModel.interface.d.ts +0 -0
- /package/dist/{interfaces → src/interfaces}/db/white_label/index.d.ts +0 -0
- /package/dist/{interfaces → src/interfaces}/db/withdrawal_wallets/index.d.ts +0 -0
- /package/dist/{interfaces → src/interfaces}/dto/index.d.ts +0 -0
- /package/dist/{interfaces → src/interfaces}/emailService.interface.d.ts +0 -0
- /package/dist/{interfaces → src/interfaces}/index.d.ts +0 -0
- /package/dist/{interfaces → src/interfaces}/kmsService.interface.d.ts +0 -0
- /package/dist/{interfaces → src/interfaces}/last-look-trade.interface.d.ts +0 -0
- /package/dist/{interfaces → src/interfaces}/market.interface.d.ts +0 -0
- /package/dist/{interfaces → src/interfaces}/order.interface.d.ts +0 -0
- /package/dist/{interfaces → src/interfaces}/pagination.interface.d.ts +0 -0
- /package/dist/{interfaces → src/interfaces}/pair.interface.d.ts +0 -0
- /package/dist/{interfaces → src/interfaces}/query.interface.d.ts +0 -0
- /package/dist/{interfaces → src/interfaces}/services/accountCache.interface.d.ts +0 -0
- /package/dist/{interfaces → src/interfaces}/services/algod.interface.d.ts +0 -0
- /package/dist/{interfaces → src/interfaces}/services/balances.interface.d.ts +0 -0
- /package/dist/{interfaces → src/interfaces}/services/coin-market-cap.interface.d.ts +0 -0
- /package/dist/{interfaces → src/interfaces}/services/index.d.ts +0 -0
- /package/dist/{interfaces → src/interfaces}/services/price-model.interface.d.ts +0 -0
- /package/dist/{interfaces → src/interfaces}/services/price-service.interface.d.ts +0 -0
- /package/dist/{interfaces → src/interfaces}/services/socialActivity.interface.d.ts +0 -0
- /package/dist/{interfaces → src/interfaces}/services/tmc.interface.d.ts +0 -0
- /package/dist/{interfaces → src/interfaces}/settings.interface.d.ts +0 -0
- /package/dist/{interfaces → src/interfaces}/streaming.interface.d.ts +0 -0
- /package/dist/{interfaces → src/interfaces}/timestream.interface.d.ts +0 -0
- /package/dist/{interfaces → src/interfaces}/trading.interface.d.ts +0 -0
- /package/dist/{interfaces → src/interfaces}/tradingKey.interface.d.ts +0 -0
- /package/dist/{interfaces → src/interfaces}/transfer.interface.d.ts +0 -0
- /package/dist/{interfaces → src/interfaces}/wallet.interface.d.ts +0 -0
- /package/dist/{interfaces → src/interfaces}/withdrawalWallets.interface.d.ts +0 -0
- /package/dist/{types → src/types}/algo-order.type.d.ts +0 -0
- /package/dist/{types → src/types}/amm/amm.d.ts +0 -0
- /package/dist/{types → src/types}/api/request.types.d.ts +0 -0
- /package/dist/{types → src/types}/codex.types.d.ts +0 -0
- /package/dist/{types → src/types}/hummingbots.types.d.ts +0 -0
- /package/dist/{types → src/types}/index.d.ts +0 -0
- /package/dist/{types → src/types}/notification.type.d.ts +0 -0
- /package/dist/{types → src/types}/state.type.d.ts +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
function W(){throw new Error("setTimeout has not been defined")}function H(){throw new Error("clearTimeout has not been defined")}var x=W,I=H;typeof globalThis.setTimeout=="function"&&(x=setTimeout);typeof globalThis.clearTimeout=="function"&&(I=clearTimeout);function V(t){if(x===setTimeout)return setTimeout(t,0);if((x===W||!x)&&setTimeout)return x=setTimeout,setTimeout(t,0);try{return x(t,0)}catch{try{return x.call(null,t,0)}catch{return x.call(this,t,0)}}}function sr(t){if(I===clearTimeout)return clearTimeout(t);if((I===H||!I)&&clearTimeout)return I=clearTimeout,clearTimeout(t);try{return I(t)}catch{try{return I.call(null,t)}catch{return I.call(this,t)}}}var b=[],D=!1,w,P=-1;function fr(){!D||!w||(D=!1,w.length?b=w.concat(b):P=-1,b.length&&X())}function X(){if(!D){var t=V(fr);D=!0;for(var r=b.length;r;){for(w=b,b=[];++P<r;)w&&w[P].run();P=-1,r=b.length}w=null,D=!1,sr(t)}}function pr(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 Q(t,r)),b.length===1&&!D&&V(X)}function Q(t,r){this.fun=t,this.array=r}Q.prototype.run=function(){this.fun.apply(null,this.array)};var _r="browser",hr="browser",Tr=!0,Ar={},dr=[],Rr="",mr={},br={},gr={};function S(){}var xr=S,Ir=S,wr=S,Sr=S,Nr=S,Or=S,yr=S;function Dr(t){throw new Error("process.binding is not supported")}function Pr(){return"/"}function Cr(t){throw new Error("process.chdir is not supported")}function Lr(){return 0}var y=globalThis.performance||{},vr=y.now||y.mozNow||y.msNow||y.oNow||y.webkitNow||function(){return new Date().getTime()};function Mr(t){var r=vr.call(y)*.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 Ur=new Date;function Br(){var t=new Date,r=t-Ur;return r/1e3}var p={nextTick:pr,title:_r,browser:Tr,env:Ar,argv:dr,version:Rr,versions:mr,on:xr,addListener:Ir,once:wr,off:Sr,removeListener:Nr,removeAllListeners:Or,emit:yr,binding:Dr,cwd:Pr,chdir:Cr,umask:Lr,hrtime:Mr,platform:hr,release:br,config:gr,uptime:Br},K={};Object.keys(K).forEach(t=>{let r=t.split("."),e=p;for(let n=0;n<r.length;n++){let i=r[n];n===r.length-1?e[i]=K[t]:e=e[i]||(e[i]={})}});var R=[],A=[],kr=typeof Uint8Array<"u"?Uint8Array:Array,Y=!1;function Z(){Y=!0;for(var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",r=0,e=t.length;r<e;++r)R[r]=t[r],A[t.charCodeAt(r)]=r;A[45]=62,A[95]=63}function Yr(t){Y||Z();var r,e,n,i,o,a,c=t.length;if(c%4>0)throw new Error("Invalid string. Length must be a multiple of 4");o=t[c-2]==="="?2:t[c-1]==="="?1:0,a=new kr(c*3/4-o),n=o>0?c-4:c;var E=0;for(r=0,e=0;r<n;r+=4,e+=3)i=A[t.charCodeAt(r)]<<18|A[t.charCodeAt(r+1)]<<12|A[t.charCodeAt(r+2)]<<6|A[t.charCodeAt(r+3)],a[E++]=i>>16&255,a[E++]=i>>8&255,a[E++]=i&255;return o===2?(i=A[t.charCodeAt(r)]<<2|A[t.charCodeAt(r+1)]>>4,a[E++]=i&255):o===1&&(i=A[t.charCodeAt(r)]<<10|A[t.charCodeAt(r+1)]<<4|A[t.charCodeAt(r+2)]>>2,a[E++]=i>>8&255,a[E++]=i&255),a}function Fr(t){return R[t>>18&63]+R[t>>12&63]+R[t>>6&63]+R[t&63]}function Gr(t,r,e){for(var n,i=[],o=r;o<e;o+=3)n=(t[o]<<16)+(t[o+1]<<8)+t[o+2],i.push(Fr(n));return i.join("")}function q(t){Y||Z();for(var r,e=t.length,n=e%3,i="",o=[],a=16383,c=0,E=e-n;c<E;c+=a)o.push(Gr(t,c,c+a>E?E:c+a));return n===1?(r=t[e-1],i+=R[r>>2],i+=R[r<<4&63],i+="=="):n===2&&(r=(t[e-2]<<8)+t[e-1],i+=R[r>>10],i+=R[r>>4&63],i+=R[r<<2&63],i+="="),o.push(i),o.join("")}u.TYPED_ARRAY_SUPPORT=globalThis.TYPED_ARRAY_SUPPORT!==void 0?globalThis.TYPED_ARRAY_SUPPORT:!0;function C(){return u.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function g(t,r){if(C()<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 F(this,t)}return z(this,t,r,e)}u.poolSize=8192;u._augment=function(t){return t.__proto__=u.prototype,t};function z(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?Hr(t,r,e,n):typeof r=="string"?Wr(t,r,e):Vr(t,r)}u.from=function(t,r,e){return z(null,t,r,e)};u.kMaxLength=C();u.TYPED_ARRAY_SUPPORT&&(u.prototype.__proto__=Uint8Array.prototype,u.__proto__=Uint8Array,typeof Symbol<"u"&&Symbol.species&&u[Symbol.species]);function j(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 Kr(t,r,e,n){return j(r),r<=0?g(t,r):e!==void 0?typeof n=="string"?g(t,r).fill(e,n):g(t,r).fill(e):g(t,r)}u.alloc=function(t,r,e){return Kr(null,t,r,e)};function F(t,r){if(j(r),t=g(t,r<0?0:G(r)|0),!u.TYPED_ARRAY_SUPPORT)for(var e=0;e<r;++e)t[e]=0;return t}u.allocUnsafe=function(t){return F(null,t)};u.allocUnsafeSlow=function(t){return F(null,t)};function Wr(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=rr(r,e)|0;t=g(t,n);var i=t.write(r,e);return i!==n&&(t=t.slice(0,i)),t}function k(t,r){var e=r.length<0?0:G(r.length)|0;t=g(t,e);for(var n=0;n<e;n+=1)t[n]=r[n]&255;return t}function Hr(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=k(t,r),t}function Vr(t,r){if(m(r)){var e=G(r.length)|0;return t=g(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"||le(r.length)?g(t,0):k(t,r);if(r.type==="Buffer"&&Array.isArray(r.data))return k(t,r.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function G(t){if(t>=C())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+C().toString(16)+" bytes");return t|0}u.isBuffer=se;function m(t){return!!(t!=null&&t._isBuffer)}u.compare=function(r,e){if(!m(r)||!m(e))throw new TypeError("Arguments must be Buffers");if(r===e)return 0;for(var n=r.length,i=e.length,o=0,a=Math.min(n,i);o<a;++o)if(r[o]!==e[o]){n=r[o],i=e[o];break}return n<i?-1:i<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(!Array.isArray(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 i=u.allocUnsafe(e),o=0;for(n=0;n<r.length;++n){var a=r[n];if(!m(a))throw new TypeError('"list" argument must be an Array of Buffers');a.copy(i,o),o+=a.length}return i};function rr(t,r){if(m(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 L(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return e*2;case"hex":return e>>>1;case"base64":return ur(t).length;default:if(n)return L(t).length;r=(""+r).toLowerCase(),n=!0}}u.byteLength=rr;function Xr(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 te(this,r,e);case"utf8":case"utf-8":return nr(this,r,e);case"ascii":return re(this,r,e);case"latin1":case"binary":return ee(this,r,e);case"base64":return zr(this,r,e);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ne(this,r,e);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}u.prototype._isBuffer=!0;function N(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)N(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)N(this,e,e+3),N(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)N(this,e,e+7),N(this,e+1,e+6),N(this,e+2,e+5),N(this,e+3,e+4);return this};u.prototype.toString=function(){var r=this.length|0;return r===0?"":arguments.length===0?nr(this,0,r):Xr.apply(this,arguments)};u.prototype.equals=function(r){if(!m(r))throw new TypeError("Argument must be a Buffer");return this===r?!0:u.compare(this,r)===0};u.prototype.compare=function(r,e,n,i,o){if(!m(r))throw new TypeError("Argument must be a Buffer");if(e===void 0&&(e=0),n===void 0&&(n=r?r.length:0),i===void 0&&(i=0),o===void 0&&(o=this.length),e<0||n>r.length||i<0||o>this.length)throw new RangeError("out of range index");if(i>=o&&e>=n)return 0;if(i>=o)return-1;if(e>=n)return 1;if(e>>>=0,n>>>=0,i>>>=0,o>>>=0,this===r)return 0;for(var a=o-i,c=n-e,E=Math.min(a,c),s=this.slice(i,o),f=r.slice(e,n),l=0;l<E;++l)if(s[l]!==f[l]){a=s[l],c=f[l];break}return a<c?-1:c<a?1:0};function er(t,r,e,n,i){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=i?0:t.length-1),e<0&&(e=t.length+e),e>=t.length){if(i)return-1;e=t.length-1}else if(e<0)if(i)e=0;else return-1;if(typeof r=="string"&&(r=u.from(r,n)),m(r))return r.length===0?-1:J(t,r,e,n,i);if(typeof r=="number")return r=r&255,u.TYPED_ARRAY_SUPPORT&&typeof Uint8Array.prototype.indexOf=="function"?i?Uint8Array.prototype.indexOf.call(t,r,e):Uint8Array.prototype.lastIndexOf.call(t,r,e):J(t,[r],e,n,i);throw new TypeError("val must be string, number or Buffer")}function J(t,r,e,n,i){var o=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;o=2,a/=2,c/=2,e/=2}function E(T,O){return o===1?T[O]:T.readUInt16BE(O*o)}var s;if(i){var f=-1;for(s=e;s<a;s++)if(E(t,s)===E(r,f===-1?0:s-f)){if(f===-1&&(f=s),s-f+1===c)return f*o}else f!==-1&&(s-=s-f),f=-1}else for(e+c>a&&(e=a-c),s=e;s>=0;s--){for(var l=!0,d=0;d<c;d++)if(E(t,s+d)!==E(r,d)){l=!1;break}if(l)return s}return-1}u.prototype.includes=function(r,e,n){return this.indexOf(r,e,n)!==-1};u.prototype.indexOf=function(r,e,n){return er(this,r,e,n,!0)};u.prototype.lastIndexOf=function(r,e,n){return er(this,r,e,n,!1)};function Qr(t,r,e,n){e=Number(e)||0;var i=t.length-e;n?(n=Number(n),n>i&&(n=i)):n=i;var o=r.length;if(o%2!==0)throw new TypeError("Invalid hex string");n>o/2&&(n=o/2);for(var a=0;a<n;++a){var c=parseInt(r.substr(a*2,2),16);if(isNaN(c))return a;t[e+a]=c}return a}function qr(t,r,e,n){return U(L(r,t.length-e),t,e,n)}function tr(t,r,e,n){return U(ce(r),t,e,n)}function Jr(t,r,e,n){return tr(t,r,e,n)}function $r(t,r,e,n){return U(ur(r),t,e,n)}function Zr(t,r,e,n){return U(Ee(r,t.length-e),t,e,n)}u.prototype.write=function(r,e,n,i){if(e===void 0)i="utf8",n=this.length,e=0;else if(n===void 0&&typeof e=="string")i=e,n=this.length,e=0;else if(isFinite(e))e=e|0,isFinite(n)?(n=n|0,i===void 0&&(i="utf8")):(i=n,n=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var o=this.length-e;if((n===void 0||n>o)&&(n=o),r.length>0&&(n<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");i||(i="utf8");for(var a=!1;;)switch(i){case"hex":return Qr(this,r,e,n);case"utf8":case"utf-8":return qr(this,r,e,n);case"ascii":return tr(this,r,e,n);case"latin1":case"binary":return Jr(this,r,e,n);case"base64":return $r(this,r,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Zr(this,r,e,n);default:if(a)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),a=!0}};u.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function zr(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 n=[],i=r;i<e;){var o=t[i],a=null,c=o>239?4:o>223?3:o>191?2:1;if(i+c<=e){var E,s,f,l;switch(c){case 1:o<128&&(a=o);break;case 2:E=t[i+1],(E&192)===128&&(l=(o&31)<<6|E&63,l>127&&(a=l));break;case 3:E=t[i+1],s=t[i+2],(E&192)===128&&(s&192)===128&&(l=(o&15)<<12|(E&63)<<6|s&63,l>2047&&(l<55296||l>57343)&&(a=l));break;case 4:E=t[i+1],s=t[i+2],f=t[i+3],(E&192)===128&&(s&192)===128&&(f&192)===128&&(l=(o&15)<<18|(E&63)<<12|(s&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),i+=c}return jr(n)}var $=4096;function jr(t){var r=t.length;if(r<=$)return String.fromCharCode.apply(String,t);for(var e="",n=0;n<r;)e+=String.fromCharCode.apply(String,t.slice(n,n+=$));return e}function re(t,r,e){var n="";e=Math.min(t.length,e);for(var i=r;i<e;++i)n+=String.fromCharCode(t[i]&127);return n}function ee(t,r,e){var n="";e=Math.min(t.length,e);for(var i=r;i<e;++i)n+=String.fromCharCode(t[i]);return n}function te(t,r,e){var n=t.length;(!r||r<0)&&(r=0),(!e||e<0||e>n)&&(e=n);for(var i="",o=r;o<e;++o)i+=ue(t[o]);return i}function ne(t,r,e){for(var n=t.slice(r,e),i="",o=0;o<n.length;o+=2)i+=String.fromCharCode(n[o]+n[o+1]*256);return i}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 i;if(u.TYPED_ARRAY_SUPPORT)i=this.subarray(r,e),i.__proto__=u.prototype;else{var o=e-r;i=new u(o,void 0);for(var a=0;a<o;++a)i[a]=this[a+r]}return i};function _(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||_(r,e,this.length);for(var i=this[r],o=1,a=0;++a<e&&(o*=256);)i+=this[r+a]*o;return i};u.prototype.readUIntBE=function(r,e,n){r=r|0,e=e|0,n||_(r,e,this.length);for(var i=this[r+--e],o=1;e>0&&(o*=256);)i+=this[r+--e]*o;return i};u.prototype.readUInt8=function(r,e){return e||_(r,1,this.length),this[r]};u.prototype.readUInt16LE=function(r,e){return e||_(r,2,this.length),this[r]|this[r+1]<<8};u.prototype.readUInt16BE=function(r,e){return e||_(r,2,this.length),this[r]<<8|this[r+1]};u.prototype.readUInt32LE=function(r,e){return 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||_(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||_(r,e,this.length);for(var i=this[r],o=1,a=0;++a<e&&(o*=256);)i+=this[r+a]*o;return o*=128,i>=o&&(i-=Math.pow(2,8*e)),i};u.prototype.readIntBE=function(r,e,n){r=r|0,e=e|0,n||_(r,e,this.length);for(var i=e,o=1,a=this[r+--i];i>0&&(o*=256);)a+=this[r+--i]*o;return o*=128,a>=o&&(a-=Math.pow(2,8*e)),a};u.prototype.readInt8=function(r,e){return e||_(r,1,this.length),this[r]&128?(255-this[r]+1)*-1:this[r]};u.prototype.readInt16LE=function(r,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||_(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||_(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||_(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||_(r,4,this.length),B(this,r,!0,23,4)};u.prototype.readFloatBE=function(r,e){return e||_(r,4,this.length),B(this,r,!1,23,4)};u.prototype.readDoubleLE=function(r,e){return e||_(r,8,this.length),B(this,r,!0,52,8)};u.prototype.readDoubleBE=function(r,e){return e||_(r,8,this.length),B(this,r,!1,52,8)};function h(t,r,e,n,i,o){if(!m(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(r>i||r<o)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,i){if(r=+r,e=e|0,n=n|0,!i){var o=Math.pow(2,8*n)-1;h(this,r,e,n,o,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,i){if(r=+r,e=e|0,n=n|0,!i){var o=Math.pow(2,8*n)-1;h(this,r,e,n,o,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||h(this,r,e,1,255,0),u.TYPED_ARRAY_SUPPORT||(r=Math.floor(r)),this[e]=r&255,e+1};function v(t,r,e,n){r<0&&(r=65535+r+1);for(var i=0,o=Math.min(t.length-e,2);i<o;++i)t[e+i]=(r&255<<8*(n?i:1-i))>>>(n?i:1-i)*8}u.prototype.writeUInt16LE=function(r,e,n){return r=+r,e=e|0,n||h(this,r,e,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[e]=r&255,this[e+1]=r>>>8):v(this,r,e,!0),e+2};u.prototype.writeUInt16BE=function(r,e,n){return r=+r,e=e|0,n||h(this,r,e,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[e]=r>>>8,this[e+1]=r&255):v(this,r,e,!1),e+2};function M(t,r,e,n){r<0&&(r=4294967295+r+1);for(var i=0,o=Math.min(t.length-e,4);i<o;++i)t[e+i]=r>>>(n?i:3-i)*8&255}u.prototype.writeUInt32LE=function(r,e,n){return r=+r,e=e|0,n||h(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):M(this,r,e,!0),e+4};u.prototype.writeUInt32BE=function(r,e,n){return r=+r,e=e|0,n||h(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):M(this,r,e,!1),e+4};u.prototype.writeIntLE=function(r,e,n,i){if(r=+r,e=e|0,!i){var o=Math.pow(2,8*n-1);h(this,r,e,n,o-1,-o)}var a=0,c=1,E=0;for(this[e]=r&255;++a<n&&(c*=256);)r<0&&E===0&&this[e+a-1]!==0&&(E=1),this[e+a]=(r/c>>0)-E&255;return e+n};u.prototype.writeIntBE=function(r,e,n,i){if(r=+r,e=e|0,!i){var o=Math.pow(2,8*n-1);h(this,r,e,n,o-1,-o)}var a=n-1,c=1,E=0;for(this[e+a]=r&255;--a>=0&&(c*=256);)r<0&&E===0&&this[e+a+1]!==0&&(E=1),this[e+a]=(r/c>>0)-E&255;return e+n};u.prototype.writeInt8=function(r,e,n){return r=+r,e=e|0,n||h(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||h(this,r,e,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[e]=r&255,this[e+1]=r>>>8):v(this,r,e,!0),e+2};u.prototype.writeInt16BE=function(r,e,n){return r=+r,e=e|0,n||h(this,r,e,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[e]=r>>>8,this[e+1]=r&255):v(this,r,e,!1),e+2};u.prototype.writeInt32LE=function(r,e,n){return r=+r,e=e|0,n||h(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):M(this,r,e,!0),e+4};u.prototype.writeInt32BE=function(r,e,n){return r=+r,e=e|0,n||h(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):M(this,r,e,!1),e+4};function ir(t,r,e,n,i,o){if(e+n>t.length)throw new RangeError("Index out of range");if(e<0)throw new RangeError("Index out of range")}function or(t,r,e,n,i){return i||ir(t,r,e,4,34028234663852886e22,-34028234663852886e22),Er(t,r,e,n,23,4),e+4}u.prototype.writeFloatLE=function(r,e,n){return or(this,r,e,!0,n)};u.prototype.writeFloatBE=function(r,e,n){return or(this,r,e,!1,n)};function ar(t,r,e,n,i){return i||ir(t,r,e,8,17976931348623157e292,-17976931348623157e292),Er(t,r,e,n,52,8),e+8}u.prototype.writeDoubleLE=function(r,e,n){return ar(this,r,e,!0,n)};u.prototype.writeDoubleBE=function(r,e,n){return ar(this,r,e,!1,n)};u.prototype.copy=function(r,e,n,i){if(n||(n=0),!i&&i!==0&&(i=this.length),e>=r.length&&(e=r.length),e||(e=0),i>0&&i<n&&(i=n),i===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(i<0)throw new RangeError("sourceEnd out of bounds");i>this.length&&(i=this.length),r.length-e<i-n&&(i=r.length-e+n);var o=i-n,a;if(this===r&&n<e&&e<i)for(a=o-1;a>=0;--a)r[a+e]=this[a+n];else if(o<1e3||!u.TYPED_ARRAY_SUPPORT)for(a=0;a<o;++a)r[a+e]=this[a+n];else Uint8Array.prototype.set.call(r,this.subarray(n,n+o),e);return o};u.prototype.fill=function(r,e,n,i){if(typeof r=="string"){if(typeof e=="string"?(i=e,e=0,n=this.length):typeof n=="string"&&(i=n,n=this.length),r.length===1){var o=r.charCodeAt(0);o<256&&(r=o)}if(i!==void 0&&typeof i!="string")throw new TypeError("encoding must be a string");if(typeof i=="string"&&!u.isEncoding(i))throw new TypeError("Unknown encoding: "+i)}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=m(r)?r:L(new u(r,i).toString()),E=c.length;for(a=0;a<n-e;++a)this[a+e]=c[a%E]}return this};var ie=/[^+\/0-9A-Za-z-_]/g;function oe(t){if(t=ae(t).replace(ie,""),t.length<2)return"";for(;t.length%4!==0;)t=t+"=";return t}function ae(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}function ue(t){return t<16?"0"+t.toString(16):t.toString(16)}function L(t,r){r=r||1/0;for(var e,n=t.length,i=null,o=[],a=0;a<n;++a){if(e=t.charCodeAt(a),e>55295&&e<57344){if(!i){if(e>56319){(r-=3)>-1&&o.push(239,191,189);continue}else if(a+1===n){(r-=3)>-1&&o.push(239,191,189);continue}i=e;continue}if(e<56320){(r-=3)>-1&&o.push(239,191,189),i=e;continue}e=(i-55296<<10|e-56320)+65536}else i&&(r-=3)>-1&&o.push(239,191,189);if(i=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 ce(t){for(var r=[],e=0;e<t.length;++e)r.push(t.charCodeAt(e)&255);return r}function Ee(t,r){for(var e,n,i,o=[],a=0;a<t.length&&!((r-=2)<0);++a)e=t.charCodeAt(a),n=e>>8,i=e%256,o.push(i),o.push(n);return o}function ur(t){return Yr(oe(t))}function U(t,r,e,n){for(var i=0;i<n&&!(i+e>=r.length||i>=t.length);++i)r[i+e]=t[i];return i}function le(t){return t!==t}function se(t){return t!=null&&(!!t._isBuffer||cr(t)||fe(t))}function cr(t){return!!t.constructor&&typeof t.constructor.isBuffer=="function"&&t.constructor.isBuffer(t)}function fe(t){return typeof t.readFloatLE=="function"&&typeof t.slice=="function"&&cr(t.slice(0,0))}function B(t,r,e,n,i){var o,a,c=i*8-n-1,E=(1<<c)-1,s=E>>1,f=-7,l=e?i-1:0,d=e?-1:1,T=t[r+l];for(l+=d,o=T&(1<<-f)-1,T>>=-f,f+=c;f>0;o=o*256+t[r+l],l+=d,f-=8);for(a=o&(1<<-f)-1,o>>=-f,f+=n;f>0;a=a*256+t[r+l],l+=d,f-=8);if(o===0)o=1-s;else{if(o===E)return a?NaN:(T?-1:1)*(1/0);a=a+Math.pow(2,n),o=o-s}return(T?-1:1)*a*Math.pow(2,o-n)}function Er(t,r,e,n,i,o){var a,c,E,s=o*8-i-1,f=(1<<s)-1,l=f>>1,d=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,T=n?0:o-1,O=n?1:-1,lr=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*(E=Math.pow(2,-a))<1&&(a--,E*=2),a+l>=1?r+=d/E:r+=d*Math.pow(2,1-l),r*E>=2&&(a++,E/=2),a+l>=f?(c=0,a=f):a+l>=1?(c=(r*E-1)*Math.pow(2,i),a=a+l):(c=r*Math.pow(2,l-1)*Math.pow(2,i),a=0));i>=8;t[e+T]=c&255,T+=O,c/=256,i-=8);for(a=a<<i|c,s+=i;s>0;t[e+T]=a&255,T+=O,a/=256,s-=8);t[e+T-O]|=lr*128}var xe=864e5,Ie=30;var Oe=18,ye=1e5,De=1e3,Pe=9e4,Ce=30,Le=60,ve=328,Me=1,Ue=18,Be=36,ke=248;var Ke={"0x4343545055534443000000000000000000000000000000000000000000000000":65537};var Xe={SUCCESS:200,CREATED:201,ACCEPTED:202,NOCONTENT:204,BADREQUEST:400,FORBIDDEN:403,NOTFOUND:404,TIMEOUT:408,TOOMANYREQ:429,INTERNALSERVER:500,BADGATEWAYS:502,SERVICEUNAVILABLE:503,GATEWAYTIMEOUT:504},Qe={INSERT:"Data has been saved successfully.",ERROR:"Some error has been occured. Please try again.",SUCCESS:"Your request is executed successfully!",REQUIRED:"coin_type or price param is required",CAPTCHATEXTNOTFOUND:"Captcha text not found.",CAPTCHA_VERIFICATION_FAILED:"Captcha is not verified.",NOTEMPTY:"coin_type or price should not be empty",PAIR_LIST:"Pair list",PAIR_STATUS:"Pair status has been changed",ACTIVE_USERS:"Active Users",SETTINGS_NOT_FOUND:"No settings found in DB.",TRADE_IS_HALT:"Trading is disabled.",KYC_REQUIRED:"KYC is required for this action.",EMAIL_NOT_VERIFIED:"Your email is not verified.Please verify first.",NOT_BETA_USER:"Trade only works for beta user.",WRONG_PAIR_KEY:"Pair key not found.",PAIRDISABLED:"Temporarily order placement has been disabled for this pair. Please try again later.",BALANCE_NOT_SUFFICIENT:"You have insufficient balance.",MIN_TRADE_NOT_MATCHED:"Minimum trade limit does not matched.",ORDER_PLACED_SUCCESSFULLY:"Order has been placed successfully.",ORDER_NOT_FOUND:"Sorry this order id does not found.",ORDER_ALREADY_MATCHED:"Order already matched.",ORDER_ALREADY_CANCELED:"Order already cancelled.",ORDER_CANCELED_SUCCESSFULLY:"order successfully cancelled",ORDER_LIST:"Order list fetched successfully.",ORDER_EXIT:"Successfully exited from the position.",PAIRERR:"please provide pair param",ORDERSIDE:"side param is required",ORDERTYPE:"type param is required",ORDERIDREQ:"order_id param is required",ORDERDETAIL:"order detail",COMMODITYORICE:"commodity price",COMMODITYSPOT:"commodity spot updated",TOKEN_INSERTED:"ERC token has been added",PARAMREQ:"Parameter missing",EXIST:"Token Already Exist",BREACHEDTOKENS:"List of breached tokens",API_EXPOSE:{TOKEN_NOT_FOUND:"Token not found, Please get token and set to header.",ERROR:"Something went wrong, Please try again later"},LIMITED_UNITS:"ONLY {{units}} units are available. You can place your order with this amount",UNITS_UNAVAIL:"Amount unavailable",ORDER:{ERROR:"An error has been occured",UNITS_UNAVAIL:"Amount unavailable",LIMITED_UNITS:"ONLY {{units}} units are available. You can place your order with this amount",PLACED:"Order has been placed",NOPARAMS:"empty body params",ORDER_NOT_FOUND:"Sorry this order id not found.",ORDER_ALREADY_MATCHED:"Order already matched.",ORDER_ALREADY_CANCELED:"Order already cancelled.",ORDER_CANCELED_SUCCESSFULLY:"Order cancelled successfully"},DOMAIN_NOT_FOUND:"domain not found"},qe={SMALLESTUNIT:p.env.SMALLEST_UNIT},Je={SMALLEST_UNITS:p.env.SMALLEST_UNIT},$e={AVAILABLE_ASSETS_PER_USER:1,AVAILABLE_ASSETS_PER_IP:3};var rt=`{"theme1":{"value":"${p.env.FRONTEND_URL}/Theme%3DDark.svg","active":true},"theme2":{"value":"${p.env.FRONTEND_URL}/Theme%3DLight.svg","active":true},"theme3":{"value":"${p.env.FRONTEND_URL}/Theme%3DLight.svg","active":true}}`;var at=["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"],ut=["obdex","kycTradeRequirementEnabled","newTab","reportButtons"],ct=["geoblock","pinnedPairs","customMenuItems","chartInt"];var ft=t=>`By signing this message, you confirm that the wallet is a trusted one ${t}; Data: `;var Tt=p.env.REACT_APP_API_URL,At=p.env.REACT_APP_SOCKET_URL,dt=p.env.REACT_APP_ALGO_SERVER,Rt=p.env.REACT_APP_ALGO_SERVER_PORT||"",mt=p.env.REACT_APP_ALGOD_TOKEN||"",bt=p.env.REACT_APP_DISPENSER_LINK,pe=p.env.REACT_APP_FRONTEND_LINK||"",gt=p.env.REACT_APP_ALGO_EXPLORER_LINK,xt=p.env.REACT_APP_ALGO_EXPLORER_ASSETS_URL,It=(p.env.REACT_APP_REQUIRE_ACCESS_CODE||"").toLowerCase()==="true",wt=p.env.REACT_APP_USERBACK_ACCESS_TOKEN,St=(p.env.REACT_APP_EXT_ORDER_TYPES||"").toLowerCase()==="true",Nt=4,Ot=100,yt=50,Dt=50,Pt=.001*10**6,Ct=.002*10**6,Lt="Ultrade",vt=["theme1","theme2","theme3"],Mt=p.env.REACT_APP_MASTER_APP_ID||"406",Ut=p.env.REACT_APP_AGG_APP_ID||"408",_e=Number(p.env.REACT_APP_CODEX_APP_ID||"467960617");console.log("CODEX_APP_ID",_e);var Bt=3e3,he=p.env.REACT_APP_ALGO_NETWORK||"",kt=.3,Yt=1,Ft=pe==="https://dev.ultradedev.net",Gt="00:00",Kt=1e6,Te=he.toLowerCase()==="mainnet"?"mainnet":"testnet",Wt=/[^\p{L}\p{N} .,!?:@$%()_-]/gui,Ht=Te==="mainnet"?416001:416002;export{Ut as AGG_APP_ID,mt as ALGOD_TOKEN,xt as ALGO_EXPLORER_ASSETS_URL,gt as ALGO_EXPLORER_LINK,he as ALGO_NETWORK,dt as ALGO_SERVER,Rt as ALGO_SERVER_PORT,Tt as API_HOST,Ct as APP_CLOSEOUT_FEE,qe as BIGNUMBER,ut as BOOLEAN_SETTINGS,Je as CALCULATIONS,Ke as CCTP_UNIFIED_ASSETS,_e as CODEX_APP_ID,xe as DAY_MILLISECONDS,kt as DEFAULT_AGG_FEE,Pe as DEFAULT_FEE_SHARE,Ce as DEFAULT_ORDER_EXPIRATION_DAYS,bt as DISPENSER_LINK,Lt as EXCHANGE_NAME,Ie as EXPIRE_DAYS,St as EXT_ORDER_TYPES,Oe as FACTOR_PRICE_DECIMAL,ye as FEE_SCALE,De as FRONTEND_FEE_SCALE,pe as FRONTEND_LINK,Kt as GASLIMIT,Nt as GLOWL_DECIMAL,Ft as IS_DEV,ct as JSON_ARRAY_SETTINGS,Dt as MARKET_TRADES_SIZE,Mt as MASTER_APP_ID,Ue as MAX_TOKEN_DECIMAL,Le as MIN_ORDER_EXPIRATION_MINS,Te as NETWORK,yt as ORDER_BOOK_BUFFER,Ot as ORDER_BOOK_SIZE,ve as ORDER_DATA_BYTES_LENGTH,Me as ORDER_MSG_VERSION,Bt as PLATFORM_FEE,Ht as PeraChainId,at as PointSystemSettingsIds,It as REACT_APP_REQUIRE_ACCESS_CODE,Xe as RESPONSES,Qe as RES_MSG,$e as SERVER,Be as SHARE_DATA_LENGTH,At as SOCKET_URL,vt as THEMES,Yt as ULTRADE_ID,wt as USERBACK_ACCESS_TOKEN,ke as WITHDRAW_DATA_BYTES_LENGTH,Pt as WITHDRAW_FEE,Gt as ZERO_TIMER,ft as messageForSigning,Wt as sanitizeRegex};
|
|
1
|
+
function W(){throw new Error("setTimeout has not been defined")}function H(){throw new Error("clearTimeout has not been defined")}var x=W,I=H;typeof globalThis.setTimeout=="function"&&(x=setTimeout);typeof globalThis.clearTimeout=="function"&&(I=clearTimeout);function V(t){if(x===setTimeout)return setTimeout(t,0);if((x===W||!x)&&setTimeout)return x=setTimeout,setTimeout(t,0);try{return x(t,0)}catch{try{return x.call(null,t,0)}catch{return x.call(this,t,0)}}}function sr(t){if(I===clearTimeout)return clearTimeout(t);if((I===H||!I)&&clearTimeout)return I=clearTimeout,clearTimeout(t);try{return I(t)}catch{try{return I.call(null,t)}catch{return I.call(this,t)}}}var m=[],D=!1,w,P=-1;function fr(){!D||!w||(D=!1,w.length?m=w.concat(m):P=-1,m.length&&X())}function X(){if(!D){var t=V(fr);D=!0;for(var r=m.length;r;){for(w=m,m=[];++P<r;)w&&w[P].run();P=-1,r=m.length}w=null,D=!1,sr(t)}}function pr(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];m.push(new Q(t,r)),m.length===1&&!D&&V(X)}function Q(t,r){this.fun=t,this.array=r}Q.prototype.run=function(){this.fun.apply(null,this.array)};var _r="browser",hr="browser",Tr=!0,dr={},Ar=[],gr="",br={},mr={},Rr={};function S(){}var xr=S,Ir=S,wr=S,Sr=S,Nr=S,yr=S,Or=S;function Dr(t){throw new Error("process.binding is not supported")}function Pr(){return"/"}function Cr(t){throw new Error("process.chdir is not supported")}function Lr(){return 0}var O=globalThis.performance||{},vr=O.now||O.mozNow||O.msNow||O.oNow||O.webkitNow||function(){return new Date().getTime()};function Mr(t){var r=vr.call(O)*.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 Ur=new Date;function kr(){var t=new Date,r=t-Ur;return r/1e3}var p={nextTick:pr,title:_r,browser:Tr,env:dr,argv:Ar,version:gr,versions:br,on:xr,addListener:Ir,once:wr,off:Sr,removeListener:Nr,removeAllListeners:yr,emit:Or,binding:Dr,cwd:Pr,chdir:Cr,umask:Lr,hrtime:Mr,platform:hr,release:mr,config:Rr,uptime:kr},K={};Object.keys(K).forEach(t=>{let r=t.split("."),e=p;for(let n=0;n<r.length;n++){let i=r[n];n===r.length-1?e[i]=K[t]:e=e[i]||(e[i]={})}});var g=[],d=[],Br=typeof Uint8Array<"u"?Uint8Array:Array,Y=!1;function Z(){Y=!0;for(var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",r=0,e=t.length;r<e;++r)g[r]=t[r],d[t.charCodeAt(r)]=r;d[45]=62,d[95]=63}function Yr(t){Y||Z();var r,e,n,i,o,a,c=t.length;if(c%4>0)throw new Error("Invalid string. Length must be a multiple of 4");o=t[c-2]==="="?2:t[c-1]==="="?1:0,a=new Br(c*3/4-o),n=o>0?c-4:c;var E=0;for(r=0,e=0;r<n;r+=4,e+=3)i=d[t.charCodeAt(r)]<<18|d[t.charCodeAt(r+1)]<<12|d[t.charCodeAt(r+2)]<<6|d[t.charCodeAt(r+3)],a[E++]=i>>16&255,a[E++]=i>>8&255,a[E++]=i&255;return o===2?(i=d[t.charCodeAt(r)]<<2|d[t.charCodeAt(r+1)]>>4,a[E++]=i&255):o===1&&(i=d[t.charCodeAt(r)]<<10|d[t.charCodeAt(r+1)]<<4|d[t.charCodeAt(r+2)]>>2,a[E++]=i>>8&255,a[E++]=i&255),a}function Fr(t){return g[t>>18&63]+g[t>>12&63]+g[t>>6&63]+g[t&63]}function Gr(t,r,e){for(var n,i=[],o=r;o<e;o+=3)n=(t[o]<<16)+(t[o+1]<<8)+t[o+2],i.push(Fr(n));return i.join("")}function q(t){Y||Z();for(var r,e=t.length,n=e%3,i="",o=[],a=16383,c=0,E=e-n;c<E;c+=a)o.push(Gr(t,c,c+a>E?E:c+a));return n===1?(r=t[e-1],i+=g[r>>2],i+=g[r<<4&63],i+="=="):n===2&&(r=(t[e-2]<<8)+t[e-1],i+=g[r>>10],i+=g[r>>4&63],i+=g[r<<2&63],i+="="),o.push(i),o.join("")}u.TYPED_ARRAY_SUPPORT=globalThis.TYPED_ARRAY_SUPPORT!==void 0?globalThis.TYPED_ARRAY_SUPPORT:!0;function C(){return u.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function R(t,r){if(C()<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 F(this,t)}return z(this,t,r,e)}u.poolSize=8192;u._augment=function(t){return t.__proto__=u.prototype,t};function z(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?Hr(t,r,e,n):typeof r=="string"?Wr(t,r,e):Vr(t,r)}u.from=function(t,r,e){return z(null,t,r,e)};u.kMaxLength=C();u.TYPED_ARRAY_SUPPORT&&(u.prototype.__proto__=Uint8Array.prototype,u.__proto__=Uint8Array,typeof Symbol<"u"&&Symbol.species&&u[Symbol.species]);function j(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 Kr(t,r,e,n){return j(r),r<=0?R(t,r):e!==void 0?typeof n=="string"?R(t,r).fill(e,n):R(t,r).fill(e):R(t,r)}u.alloc=function(t,r,e){return Kr(null,t,r,e)};function F(t,r){if(j(r),t=R(t,r<0?0:G(r)|0),!u.TYPED_ARRAY_SUPPORT)for(var e=0;e<r;++e)t[e]=0;return t}u.allocUnsafe=function(t){return F(null,t)};u.allocUnsafeSlow=function(t){return F(null,t)};function Wr(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=rr(r,e)|0;t=R(t,n);var i=t.write(r,e);return i!==n&&(t=t.slice(0,i)),t}function B(t,r){var e=r.length<0?0:G(r.length)|0;t=R(t,e);for(var n=0;n<e;n+=1)t[n]=r[n]&255;return t}function Hr(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=B(t,r),t}function Vr(t,r){if(b(r)){var e=G(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"||le(r.length)?R(t,0):B(t,r);if(r.type==="Buffer"&&Array.isArray(r.data))return B(t,r.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function G(t){if(t>=C())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+C().toString(16)+" bytes");return t|0}u.isBuffer=se;function b(t){return!!(t!=null&&t._isBuffer)}u.compare=function(r,e){if(!b(r)||!b(e))throw new TypeError("Arguments must be Buffers");if(r===e)return 0;for(var n=r.length,i=e.length,o=0,a=Math.min(n,i);o<a;++o)if(r[o]!==e[o]){n=r[o],i=e[o];break}return n<i?-1:i<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(!Array.isArray(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 i=u.allocUnsafe(e),o=0;for(n=0;n<r.length;++n){var a=r[n];if(!b(a))throw new TypeError('"list" argument must be an Array of Buffers');a.copy(i,o),o+=a.length}return i};function rr(t,r){if(b(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 L(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return e*2;case"hex":return e>>>1;case"base64":return ur(t).length;default:if(n)return L(t).length;r=(""+r).toLowerCase(),n=!0}}u.byteLength=rr;function Xr(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 te(this,r,e);case"utf8":case"utf-8":return nr(this,r,e);case"ascii":return re(this,r,e);case"latin1":case"binary":return ee(this,r,e);case"base64":return zr(this,r,e);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ne(this,r,e);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}u.prototype._isBuffer=!0;function N(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)N(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)N(this,e,e+3),N(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)N(this,e,e+7),N(this,e+1,e+6),N(this,e+2,e+5),N(this,e+3,e+4);return this};u.prototype.toString=function(){var r=this.length|0;return r===0?"":arguments.length===0?nr(this,0,r):Xr.apply(this,arguments)};u.prototype.equals=function(r){if(!b(r))throw new TypeError("Argument must be a Buffer");return this===r?!0:u.compare(this,r)===0};u.prototype.compare=function(r,e,n,i,o){if(!b(r))throw new TypeError("Argument must be a Buffer");if(e===void 0&&(e=0),n===void 0&&(n=r?r.length:0),i===void 0&&(i=0),o===void 0&&(o=this.length),e<0||n>r.length||i<0||o>this.length)throw new RangeError("out of range index");if(i>=o&&e>=n)return 0;if(i>=o)return-1;if(e>=n)return 1;if(e>>>=0,n>>>=0,i>>>=0,o>>>=0,this===r)return 0;for(var a=o-i,c=n-e,E=Math.min(a,c),s=this.slice(i,o),f=r.slice(e,n),l=0;l<E;++l)if(s[l]!==f[l]){a=s[l],c=f[l];break}return a<c?-1:c<a?1:0};function er(t,r,e,n,i){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=i?0:t.length-1),e<0&&(e=t.length+e),e>=t.length){if(i)return-1;e=t.length-1}else if(e<0)if(i)e=0;else return-1;if(typeof r=="string"&&(r=u.from(r,n)),b(r))return r.length===0?-1:J(t,r,e,n,i);if(typeof r=="number")return r=r&255,u.TYPED_ARRAY_SUPPORT&&typeof Uint8Array.prototype.indexOf=="function"?i?Uint8Array.prototype.indexOf.call(t,r,e):Uint8Array.prototype.lastIndexOf.call(t,r,e):J(t,[r],e,n,i);throw new TypeError("val must be string, number or Buffer")}function J(t,r,e,n,i){var o=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;o=2,a/=2,c/=2,e/=2}function E(T,y){return o===1?T[y]:T.readUInt16BE(y*o)}var s;if(i){var f=-1;for(s=e;s<a;s++)if(E(t,s)===E(r,f===-1?0:s-f)){if(f===-1&&(f=s),s-f+1===c)return f*o}else f!==-1&&(s-=s-f),f=-1}else for(e+c>a&&(e=a-c),s=e;s>=0;s--){for(var l=!0,A=0;A<c;A++)if(E(t,s+A)!==E(r,A)){l=!1;break}if(l)return s}return-1}u.prototype.includes=function(r,e,n){return this.indexOf(r,e,n)!==-1};u.prototype.indexOf=function(r,e,n){return er(this,r,e,n,!0)};u.prototype.lastIndexOf=function(r,e,n){return er(this,r,e,n,!1)};function Qr(t,r,e,n){e=Number(e)||0;var i=t.length-e;n?(n=Number(n),n>i&&(n=i)):n=i;var o=r.length;if(o%2!==0)throw new TypeError("Invalid hex string");n>o/2&&(n=o/2);for(var a=0;a<n;++a){var c=parseInt(r.substr(a*2,2),16);if(isNaN(c))return a;t[e+a]=c}return a}function qr(t,r,e,n){return U(L(r,t.length-e),t,e,n)}function tr(t,r,e,n){return U(ce(r),t,e,n)}function Jr(t,r,e,n){return tr(t,r,e,n)}function $r(t,r,e,n){return U(ur(r),t,e,n)}function Zr(t,r,e,n){return U(Ee(r,t.length-e),t,e,n)}u.prototype.write=function(r,e,n,i){if(e===void 0)i="utf8",n=this.length,e=0;else if(n===void 0&&typeof e=="string")i=e,n=this.length,e=0;else if(isFinite(e))e=e|0,isFinite(n)?(n=n|0,i===void 0&&(i="utf8")):(i=n,n=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var o=this.length-e;if((n===void 0||n>o)&&(n=o),r.length>0&&(n<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");i||(i="utf8");for(var a=!1;;)switch(i){case"hex":return Qr(this,r,e,n);case"utf8":case"utf-8":return qr(this,r,e,n);case"ascii":return tr(this,r,e,n);case"latin1":case"binary":return Jr(this,r,e,n);case"base64":return $r(this,r,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Zr(this,r,e,n);default:if(a)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),a=!0}};u.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function zr(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 n=[],i=r;i<e;){var o=t[i],a=null,c=o>239?4:o>223?3:o>191?2:1;if(i+c<=e){var E,s,f,l;switch(c){case 1:o<128&&(a=o);break;case 2:E=t[i+1],(E&192)===128&&(l=(o&31)<<6|E&63,l>127&&(a=l));break;case 3:E=t[i+1],s=t[i+2],(E&192)===128&&(s&192)===128&&(l=(o&15)<<12|(E&63)<<6|s&63,l>2047&&(l<55296||l>57343)&&(a=l));break;case 4:E=t[i+1],s=t[i+2],f=t[i+3],(E&192)===128&&(s&192)===128&&(f&192)===128&&(l=(o&15)<<18|(E&63)<<12|(s&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),i+=c}return jr(n)}var $=4096;function jr(t){var r=t.length;if(r<=$)return String.fromCharCode.apply(String,t);for(var e="",n=0;n<r;)e+=String.fromCharCode.apply(String,t.slice(n,n+=$));return e}function re(t,r,e){var n="";e=Math.min(t.length,e);for(var i=r;i<e;++i)n+=String.fromCharCode(t[i]&127);return n}function ee(t,r,e){var n="";e=Math.min(t.length,e);for(var i=r;i<e;++i)n+=String.fromCharCode(t[i]);return n}function te(t,r,e){var n=t.length;(!r||r<0)&&(r=0),(!e||e<0||e>n)&&(e=n);for(var i="",o=r;o<e;++o)i+=ue(t[o]);return i}function ne(t,r,e){for(var n=t.slice(r,e),i="",o=0;o<n.length;o+=2)i+=String.fromCharCode(n[o]+n[o+1]*256);return i}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 i;if(u.TYPED_ARRAY_SUPPORT)i=this.subarray(r,e),i.__proto__=u.prototype;else{var o=e-r;i=new u(o,void 0);for(var a=0;a<o;++a)i[a]=this[a+r]}return i};function _(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||_(r,e,this.length);for(var i=this[r],o=1,a=0;++a<e&&(o*=256);)i+=this[r+a]*o;return i};u.prototype.readUIntBE=function(r,e,n){r=r|0,e=e|0,n||_(r,e,this.length);for(var i=this[r+--e],o=1;e>0&&(o*=256);)i+=this[r+--e]*o;return i};u.prototype.readUInt8=function(r,e){return e||_(r,1,this.length),this[r]};u.prototype.readUInt16LE=function(r,e){return e||_(r,2,this.length),this[r]|this[r+1]<<8};u.prototype.readUInt16BE=function(r,e){return e||_(r,2,this.length),this[r]<<8|this[r+1]};u.prototype.readUInt32LE=function(r,e){return 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||_(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||_(r,e,this.length);for(var i=this[r],o=1,a=0;++a<e&&(o*=256);)i+=this[r+a]*o;return o*=128,i>=o&&(i-=Math.pow(2,8*e)),i};u.prototype.readIntBE=function(r,e,n){r=r|0,e=e|0,n||_(r,e,this.length);for(var i=e,o=1,a=this[r+--i];i>0&&(o*=256);)a+=this[r+--i]*o;return o*=128,a>=o&&(a-=Math.pow(2,8*e)),a};u.prototype.readInt8=function(r,e){return e||_(r,1,this.length),this[r]&128?(255-this[r]+1)*-1:this[r]};u.prototype.readInt16LE=function(r,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||_(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||_(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||_(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||_(r,4,this.length),k(this,r,!0,23,4)};u.prototype.readFloatBE=function(r,e){return e||_(r,4,this.length),k(this,r,!1,23,4)};u.prototype.readDoubleLE=function(r,e){return e||_(r,8,this.length),k(this,r,!0,52,8)};u.prototype.readDoubleBE=function(r,e){return e||_(r,8,this.length),k(this,r,!1,52,8)};function h(t,r,e,n,i,o){if(!b(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(r>i||r<o)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,i){if(r=+r,e=e|0,n=n|0,!i){var o=Math.pow(2,8*n)-1;h(this,r,e,n,o,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,i){if(r=+r,e=e|0,n=n|0,!i){var o=Math.pow(2,8*n)-1;h(this,r,e,n,o,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||h(this,r,e,1,255,0),u.TYPED_ARRAY_SUPPORT||(r=Math.floor(r)),this[e]=r&255,e+1};function v(t,r,e,n){r<0&&(r=65535+r+1);for(var i=0,o=Math.min(t.length-e,2);i<o;++i)t[e+i]=(r&255<<8*(n?i:1-i))>>>(n?i:1-i)*8}u.prototype.writeUInt16LE=function(r,e,n){return r=+r,e=e|0,n||h(this,r,e,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[e]=r&255,this[e+1]=r>>>8):v(this,r,e,!0),e+2};u.prototype.writeUInt16BE=function(r,e,n){return r=+r,e=e|0,n||h(this,r,e,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[e]=r>>>8,this[e+1]=r&255):v(this,r,e,!1),e+2};function M(t,r,e,n){r<0&&(r=4294967295+r+1);for(var i=0,o=Math.min(t.length-e,4);i<o;++i)t[e+i]=r>>>(n?i:3-i)*8&255}u.prototype.writeUInt32LE=function(r,e,n){return r=+r,e=e|0,n||h(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):M(this,r,e,!0),e+4};u.prototype.writeUInt32BE=function(r,e,n){return r=+r,e=e|0,n||h(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):M(this,r,e,!1),e+4};u.prototype.writeIntLE=function(r,e,n,i){if(r=+r,e=e|0,!i){var o=Math.pow(2,8*n-1);h(this,r,e,n,o-1,-o)}var a=0,c=1,E=0;for(this[e]=r&255;++a<n&&(c*=256);)r<0&&E===0&&this[e+a-1]!==0&&(E=1),this[e+a]=(r/c>>0)-E&255;return e+n};u.prototype.writeIntBE=function(r,e,n,i){if(r=+r,e=e|0,!i){var o=Math.pow(2,8*n-1);h(this,r,e,n,o-1,-o)}var a=n-1,c=1,E=0;for(this[e+a]=r&255;--a>=0&&(c*=256);)r<0&&E===0&&this[e+a+1]!==0&&(E=1),this[e+a]=(r/c>>0)-E&255;return e+n};u.prototype.writeInt8=function(r,e,n){return r=+r,e=e|0,n||h(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||h(this,r,e,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[e]=r&255,this[e+1]=r>>>8):v(this,r,e,!0),e+2};u.prototype.writeInt16BE=function(r,e,n){return r=+r,e=e|0,n||h(this,r,e,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[e]=r>>>8,this[e+1]=r&255):v(this,r,e,!1),e+2};u.prototype.writeInt32LE=function(r,e,n){return r=+r,e=e|0,n||h(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):M(this,r,e,!0),e+4};u.prototype.writeInt32BE=function(r,e,n){return r=+r,e=e|0,n||h(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):M(this,r,e,!1),e+4};function ir(t,r,e,n,i,o){if(e+n>t.length)throw new RangeError("Index out of range");if(e<0)throw new RangeError("Index out of range")}function or(t,r,e,n,i){return i||ir(t,r,e,4,34028234663852886e22,-34028234663852886e22),Er(t,r,e,n,23,4),e+4}u.prototype.writeFloatLE=function(r,e,n){return or(this,r,e,!0,n)};u.prototype.writeFloatBE=function(r,e,n){return or(this,r,e,!1,n)};function ar(t,r,e,n,i){return i||ir(t,r,e,8,17976931348623157e292,-17976931348623157e292),Er(t,r,e,n,52,8),e+8}u.prototype.writeDoubleLE=function(r,e,n){return ar(this,r,e,!0,n)};u.prototype.writeDoubleBE=function(r,e,n){return ar(this,r,e,!1,n)};u.prototype.copy=function(r,e,n,i){if(n||(n=0),!i&&i!==0&&(i=this.length),e>=r.length&&(e=r.length),e||(e=0),i>0&&i<n&&(i=n),i===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(i<0)throw new RangeError("sourceEnd out of bounds");i>this.length&&(i=this.length),r.length-e<i-n&&(i=r.length-e+n);var o=i-n,a;if(this===r&&n<e&&e<i)for(a=o-1;a>=0;--a)r[a+e]=this[a+n];else if(o<1e3||!u.TYPED_ARRAY_SUPPORT)for(a=0;a<o;++a)r[a+e]=this[a+n];else Uint8Array.prototype.set.call(r,this.subarray(n,n+o),e);return o};u.prototype.fill=function(r,e,n,i){if(typeof r=="string"){if(typeof e=="string"?(i=e,e=0,n=this.length):typeof n=="string"&&(i=n,n=this.length),r.length===1){var o=r.charCodeAt(0);o<256&&(r=o)}if(i!==void 0&&typeof i!="string")throw new TypeError("encoding must be a string");if(typeof i=="string"&&!u.isEncoding(i))throw new TypeError("Unknown encoding: "+i)}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=b(r)?r:L(new u(r,i).toString()),E=c.length;for(a=0;a<n-e;++a)this[a+e]=c[a%E]}return this};var ie=/[^+\/0-9A-Za-z-_]/g;function oe(t){if(t=ae(t).replace(ie,""),t.length<2)return"";for(;t.length%4!==0;)t=t+"=";return t}function ae(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}function ue(t){return t<16?"0"+t.toString(16):t.toString(16)}function L(t,r){r=r||1/0;for(var e,n=t.length,i=null,o=[],a=0;a<n;++a){if(e=t.charCodeAt(a),e>55295&&e<57344){if(!i){if(e>56319){(r-=3)>-1&&o.push(239,191,189);continue}else if(a+1===n){(r-=3)>-1&&o.push(239,191,189);continue}i=e;continue}if(e<56320){(r-=3)>-1&&o.push(239,191,189),i=e;continue}e=(i-55296<<10|e-56320)+65536}else i&&(r-=3)>-1&&o.push(239,191,189);if(i=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 ce(t){for(var r=[],e=0;e<t.length;++e)r.push(t.charCodeAt(e)&255);return r}function Ee(t,r){for(var e,n,i,o=[],a=0;a<t.length&&!((r-=2)<0);++a)e=t.charCodeAt(a),n=e>>8,i=e%256,o.push(i),o.push(n);return o}function ur(t){return Yr(oe(t))}function U(t,r,e,n){for(var i=0;i<n&&!(i+e>=r.length||i>=t.length);++i)r[i+e]=t[i];return i}function le(t){return t!==t}function se(t){return t!=null&&(!!t._isBuffer||cr(t)||fe(t))}function cr(t){return!!t.constructor&&typeof t.constructor.isBuffer=="function"&&t.constructor.isBuffer(t)}function fe(t){return typeof t.readFloatLE=="function"&&typeof t.slice=="function"&&cr(t.slice(0,0))}function k(t,r,e,n,i){var o,a,c=i*8-n-1,E=(1<<c)-1,s=E>>1,f=-7,l=e?i-1:0,A=e?-1:1,T=t[r+l];for(l+=A,o=T&(1<<-f)-1,T>>=-f,f+=c;f>0;o=o*256+t[r+l],l+=A,f-=8);for(a=o&(1<<-f)-1,o>>=-f,f+=n;f>0;a=a*256+t[r+l],l+=A,f-=8);if(o===0)o=1-s;else{if(o===E)return a?NaN:(T?-1:1)*(1/0);a=a+Math.pow(2,n),o=o-s}return(T?-1:1)*a*Math.pow(2,o-n)}function Er(t,r,e,n,i,o){var a,c,E,s=o*8-i-1,f=(1<<s)-1,l=f>>1,A=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,T=n?0:o-1,y=n?1:-1,lr=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*(E=Math.pow(2,-a))<1&&(a--,E*=2),a+l>=1?r+=A/E:r+=A*Math.pow(2,1-l),r*E>=2&&(a++,E/=2),a+l>=f?(c=0,a=f):a+l>=1?(c=(r*E-1)*Math.pow(2,i),a=a+l):(c=r*Math.pow(2,l-1)*Math.pow(2,i),a=0));i>=8;t[e+T]=c&255,T+=y,c/=256,i-=8);for(a=a<<i|c,s+=i;s>0;t[e+T]=a&255,T+=y,a/=256,s-=8);t[e+T-y]|=lr*128}var xe=864e5,Ie=30;var ye=18,Oe=1e5,De=1e3,Pe=9e4,Ce=30,Le=60,ve=328,Me=1,Ue=18,ke=36,Be=248;var Ke={"0x4343545055534443000000000000000000000000000000000000000000000000":65537};var Xe={SUCCESS:200,CREATED:201,ACCEPTED:202,NOCONTENT:204,BADREQUEST:400,FORBIDDEN:403,NOTFOUND:404,TIMEOUT:408,TOOMANYREQ:429,INTERNALSERVER:500,BADGATEWAYS:502,SERVICEUNAVILABLE:503,GATEWAYTIMEOUT:504},Qe={INSERT:"Data has been saved successfully.",ERROR:"Some error has been occured. Please try again.",SUCCESS:"Your request is executed successfully!",REQUIRED:"coin_type or price param is required",CAPTCHATEXTNOTFOUND:"Captcha text not found.",CAPTCHA_VERIFICATION_FAILED:"Captcha is not verified.",NOTEMPTY:"coin_type or price should not be empty",PAIR_LIST:"Pair list",PAIR_STATUS:"Pair status has been changed",ACTIVE_USERS:"Active Users",SETTINGS_NOT_FOUND:"No settings found in DB.",TRADE_IS_HALT:"Trading is disabled.",KYC_REQUIRED:"KYC is required for this action.",EMAIL_NOT_VERIFIED:"Your email is not verified.Please verify first.",NOT_BETA_USER:"Trade only works for beta user.",WRONG_PAIR_KEY:"Pair key not found.",PAIRDISABLED:"Temporarily order placement has been disabled for this pair. Please try again later.",BALANCE_NOT_SUFFICIENT:"You have insufficient balance.",MIN_TRADE_NOT_MATCHED:"Minimum trade limit does not matched.",ORDER_PLACED_SUCCESSFULLY:"Order has been placed successfully.",ORDER_NOT_FOUND:"Sorry this order id does not found.",ORDER_ALREADY_MATCHED:"Order already matched.",ORDER_ALREADY_CANCELED:"Order already cancelled.",ORDER_CANCELED_SUCCESSFULLY:"order successfully cancelled",ORDER_LIST:"Order list fetched successfully.",ORDER_EXIT:"Successfully exited from the position.",PAIRERR:"please provide pair param",ORDERSIDE:"side param is required",ORDERTYPE:"type param is required",ORDERIDREQ:"order_id param is required",ORDERDETAIL:"order detail",COMMODITYORICE:"commodity price",COMMODITYSPOT:"commodity spot updated",TOKEN_INSERTED:"ERC token has been added",PARAMREQ:"Parameter missing",EXIST:"Token Already Exist",BREACHEDTOKENS:"List of breached tokens",API_EXPOSE:{TOKEN_NOT_FOUND:"Token not found, Please get token and set to header.",ERROR:"Something went wrong, Please try again later"},LIMITED_UNITS:"ONLY {{units}} units are available. You can place your order with this amount",UNITS_UNAVAIL:"Amount unavailable",ORDER:{ERROR:"An error has been occured",UNITS_UNAVAIL:"Amount unavailable",LIMITED_UNITS:"ONLY {{units}} units are available. You can place your order with this amount",PLACED:"Order has been placed",NOPARAMS:"empty body params",ORDER_NOT_FOUND:"Sorry this order id not found.",ORDER_ALREADY_MATCHED:"Order already matched.",ORDER_ALREADY_CANCELED:"Order already cancelled.",ORDER_CANCELED_SUCCESSFULLY:"Order cancelled successfully"},DOMAIN_NOT_FOUND:"domain not found"},qe={SMALLESTUNIT:p.env.SMALLEST_UNIT},Je={SMALLEST_UNITS:p.env.SMALLEST_UNIT},$e={AVAILABLE_ASSETS_PER_USER:1,AVAILABLE_ASSETS_PER_IP:3};var rt=`{"theme1":{"value":"${p.env.FRONTEND_URL}/Theme%3DDark.svg","active":true},"theme2":{"value":"${p.env.FRONTEND_URL}/Theme%3DLight.svg","active":true},"theme3":{"value":"${p.env.FRONTEND_URL}/Theme%3DLight.svg","active":true}}`;var at=["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"],ut=["obdex","kycTradeRequirementEnabled","newTab","reportButtons"],ct=["geoblock","pinnedPairs","customMenuItems","chartInt"];var ft=t=>`By signing this message, you confirm that the wallet is a trusted one ${t}; Data: `;var Tt=p.env.REACT_APP_API_URL,dt=p.env.REACT_APP_SOCKET_URL,At=p.env.REACT_APP_ALGO_SERVER,gt=p.env.REACT_APP_ALGO_SERVER_PORT||"",bt=p.env.REACT_APP_ALGOD_TOKEN||"",mt=p.env.REACT_APP_DISPENSER_LINK,pe=p.env.REACT_APP_FRONTEND_LINK||"",Rt=p.env.REACT_APP_ALGO_EXPLORER_LINK,xt=p.env.REACT_APP_ALGO_EXPLORER_ASSETS_URL,It=(p.env.REACT_APP_REQUIRE_ACCESS_CODE||"").toLowerCase()==="true",wt=p.env.REACT_APP_USERBACK_ACCESS_TOKEN,St=(p.env.REACT_APP_EXT_ORDER_TYPES||"").toLowerCase()==="true",Nt=4,yt=100,Ot=50,Dt=50,Pt=.001*10**6,Ct=.002*10**6,Lt="Ultrade",vt=["theme1","theme2","theme3"],Mt=p.env.REACT_APP_MASTER_APP_ID||"406",Ut=p.env.REACT_APP_AGG_APP_ID||"408",_e=Number(p.env.REACT_APP_CODEX_APP_ID||"467960617");console.log("CODEX_APP_ID",_e);var kt=3e3,he=p.env.REACT_APP_ALGO_NETWORK||"",Bt=.3,Yt=1,Ft=pe==="https://dev.ultradedev.net",Gt="00:00",Kt=1e6,Te=he.toLowerCase()==="mainnet"?"mainnet":"testnet",Wt=/[^\p{L}\p{N} .,!?:@$%()_-]/gui,Ht=Te==="mainnet"?416001:416002;export{Ut as AGG_APP_ID,bt as ALGOD_TOKEN,xt as ALGO_EXPLORER_ASSETS_URL,Rt as ALGO_EXPLORER_LINK,he as ALGO_NETWORK,At as ALGO_SERVER,gt as ALGO_SERVER_PORT,Tt as API_HOST,Ct as APP_CLOSEOUT_FEE,qe as BIGNUMBER,ut as BOOLEAN_SETTINGS,Je as CALCULATIONS,Ke as CCTP_UNIFIED_ASSETS,_e as CODEX_APP_ID,xe as DAY_MILLISECONDS,Bt as DEFAULT_AGG_FEE,Pe as DEFAULT_FEE_SHARE,Ce as DEFAULT_ORDER_EXPIRATION_DAYS,mt as DISPENSER_LINK,Lt as EXCHANGE_NAME,Ie as EXPIRE_DAYS,St as EXT_ORDER_TYPES,ye as FACTOR_PRICE_DECIMAL,Oe as FEE_SCALE,De as FRONTEND_FEE_SCALE,pe as FRONTEND_LINK,Kt as GASLIMIT,Nt as GLOWL_DECIMAL,Ft as IS_DEV,ct as JSON_ARRAY_SETTINGS,Dt as MARKET_TRADES_SIZE,Mt as MASTER_APP_ID,Ue as MAX_TOKEN_DECIMAL,Le as MIN_ORDER_EXPIRATION_MINS,Te as NETWORK,Ot as ORDER_BOOK_BUFFER,yt as ORDER_BOOK_SIZE,ve as ORDER_DATA_BYTES_LENGTH,Me as ORDER_MSG_VERSION,kt as PLATFORM_FEE,Ht as PeraChainId,at as PointSystemSettingsIds,It as REACT_APP_REQUIRE_ACCESS_CODE,Xe as RESPONSES,Qe as RES_MSG,$e as SERVER,ke as SHARE_DATA_LENGTH,dt as SOCKET_URL,vt as THEMES,Yt as ULTRADE_ID,wt as USERBACK_ACCESS_TOKEN,Be as WITHDRAW_DATA_BYTES_LENGTH,Pt as WITHDRAW_FEE,Gt as ZERO_TIMER,ft as messageForSigning,Wt as sanitizeRegex};
|
|
2
2
|
/*! Bundled license information:
|
|
3
3
|
|
|
4
4
|
@esbuild-plugins/node-globals-polyfill/Buffer.js:
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
function Q(){throw new Error("setTimeout has not been defined")}function $(){throw new Error("clearTimeout has not been defined")}var x=Q,N=$;typeof globalThis.setTimeout=="function"&&(x=setTimeout);typeof globalThis.clearTimeout=="function"&&(N=clearTimeout);function Z(t){if(x===setTimeout)return setTimeout(t,0);if((x===Q||!x)&&setTimeout)return x=setTimeout,setTimeout(t,0);try{return x(t,0)}catch{try{return x.call(null,t,0)}catch{return x.call(this,t,0)}}}function xr(t){if(N===clearTimeout)return clearTimeout(t);if((N===$||!N)&&clearTimeout)return N=clearTimeout,clearTimeout(t);try{return N(t)}catch{try{return N.call(null,t)}catch{return N.call(this,t)}}}var I=[],y=!1,O,U=-1;function Nr(){!y||!O||(y=!1,O.length?I=O.concat(I):U=-1,I.length&&j())}function j(){if(!y){var t=Z(Nr);y=!0;for(var r=I.length;r;){for(O=I,I=[];++U<r;)O&&O[U].run();U=-1,r=I.length}O=null,y=!1,xr(t)}}function Or(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 rr(t,r)),I.length===1&&!y&&Z(j)}function rr(t,r){this.fun=t,this.array=r}rr.prototype.run=function(){this.fun.apply(null,this.array)};var Dr="browser",Cr="browser",wr=!0,Lr={},Sr=[],yr="",Pr={},vr={},Mr={};function D(){}var Ur=D,Br=D,kr=D,Fr=D,Yr=D,Gr=D,Hr=D;function Kr(t){throw new Error("process.binding is not supported")}function Wr(){return"/"}function Vr(t){throw new Error("process.chdir is not supported")}function Xr(){return 0}var S=globalThis.performance||{},qr=S.now||S.mozNow||S.msNow||S.oNow||S.webkitNow||function(){return new Date().getTime()};function zr(t){var r=qr.call(S)*.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 Jr=new Date;function Qr(){var t=new Date,r=t-Jr;return r/1e3}var s={nextTick:Or,title:Dr,browser:wr,env:Lr,argv:Sr,version:yr,versions:Pr,on:Ur,addListener:Br,once:kr,off:Fr,removeListener:Yr,removeAllListeners:Gr,emit:Hr,binding:Kr,cwd:Wr,chdir:Vr,umask:Xr,hrtime:zr,platform:Cr,release:vr,config:Mr,uptime:Qr},J={};Object.keys(J).forEach(t=>{let r=t.split("."),e=s;for(let n=0;n<r.length;n++){let o=r[n];n===r.length-1?e[o]=J[t]:e=e[o]||(e[o]={})}});var d=[],b=[],$r=typeof Uint8Array<"u"?Uint8Array:Array,V=!1;function or(){V=!0;for(var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",r=0,e=t.length;r<e;++r)d[r]=t[r],b[t.charCodeAt(r)]=r;b[45]=62,b[95]=63}function Zr(t){V||or();var r,e,n,o,a,p,c=t.length;if(c%4>0)throw new Error("Invalid string. Length must be a multiple of 4");a=t[c-2]==="="?2:t[c-1]==="="?1:0,p=new $r(c*3/4-a),n=a>0?c-4:c;var u=0;for(r=0,e=0;r<n;r+=4,e+=3)o=b[t.charCodeAt(r)]<<18|b[t.charCodeAt(r+1)]<<12|b[t.charCodeAt(r+2)]<<6|b[t.charCodeAt(r+3)],p[u++]=o>>16&255,p[u++]=o>>8&255,p[u++]=o&255;return a===2?(o=b[t.charCodeAt(r)]<<2|b[t.charCodeAt(r+1)]>>4,p[u++]=o&255):a===1&&(o=b[t.charCodeAt(r)]<<10|b[t.charCodeAt(r+1)]<<4|b[t.charCodeAt(r+2)]>>2,p[u++]=o>>8&255,p[u++]=o&255),p}function jr(t){return d[t>>18&63]+d[t>>12&63]+d[t>>6&63]+d[t&63]}function re(t,r,e){for(var n,o=[],a=r;a<e;a+=3)n=(t[a]<<16)+(t[a+1]<<8)+t[a+2],o.push(jr(n));return o.join("")}function er(t){V||or();for(var r,e=t.length,n=e%3,o="",a=[],p=16383,c=0,u=e-n;c<u;c+=p)a.push(re(t,c,c+p>u?u:c+p));return n===1?(r=t[e-1],o+=d[r>>2],o+=d[r<<4&63],o+="=="):n===2&&(r=(t[e-2]<<8)+t[e-1],o+=d[r>>10],o+=d[r>>4&63],o+=d[r<<2&63],o+="="),a.push(o),a.join("")}i.TYPED_ARRAY_SUPPORT=globalThis.TYPED_ARRAY_SUPPORT!==void 0?globalThis.TYPED_ARRAY_SUPPORT:!0;function B(){return i.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function g(t,r){if(B()<r)throw new RangeError("Invalid typed array length");return i.TYPED_ARRAY_SUPPORT?(t=new Uint8Array(r),t.__proto__=i.prototype):(t===null&&(t=new i(r)),t.length=r),t}function i(t,r,e){if(!i.TYPED_ARRAY_SUPPORT&&!(this instanceof i))return new i(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 X(this,t)}return ir(this,t,r,e)}i.poolSize=8192;i._augment=function(t){return t.__proto__=i.prototype,t};function ir(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?ne(t,r,e,n):typeof r=="string"?te(t,r,e):oe(t,r)}i.from=function(t,r,e){return ir(null,t,r,e)};i.kMaxLength=B();i.TYPED_ARRAY_SUPPORT&&(i.prototype.__proto__=Uint8Array.prototype,i.__proto__=Uint8Array,typeof Symbol<"u"&&Symbol.species&&i[Symbol.species]);function ar(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 ee(t,r,e,n){return ar(r),r<=0?g(t,r):e!==void 0?typeof n=="string"?g(t,r).fill(e,n):g(t,r).fill(e):g(t,r)}i.alloc=function(t,r,e){return ee(null,t,r,e)};function X(t,r){if(ar(r),t=g(t,r<0?0:q(r)|0),!i.TYPED_ARRAY_SUPPORT)for(var e=0;e<r;++e)t[e]=0;return t}i.allocUnsafe=function(t){return X(null,t)};i.allocUnsafeSlow=function(t){return X(null,t)};function te(t,r,e){if((typeof e!="string"||e==="")&&(e="utf8"),!i.isEncoding(e))throw new TypeError('"encoding" must be a valid string encoding');var n=pr(r,e)|0;t=g(t,n);var o=t.write(r,e);return o!==n&&(t=t.slice(0,o)),t}function W(t,r){var e=r.length<0?0:q(r.length)|0;t=g(t,e);for(var n=0;n<e;n+=1)t[n]=r[n]&255;return t}function ne(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),i.TYPED_ARRAY_SUPPORT?(t=r,t.__proto__=i.prototype):t=W(t,r),t}function oe(t,r){if(R(r)){var e=q(r.length)|0;return t=g(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"||ge(r.length)?g(t,0):W(t,r);if(r.type==="Buffer"&&Array.isArray(r.data))return W(t,r.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function q(t){if(t>=B())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+B().toString(16)+" bytes");return t|0}i.isBuffer=xe;function R(t){return!!(t!=null&&t._isBuffer)}i.compare=function(r,e){if(!R(r)||!R(e))throw new TypeError("Arguments must be Buffers");if(r===e)return 0;for(var n=r.length,o=e.length,a=0,p=Math.min(n,o);a<p;++a)if(r[a]!==e[a]){n=r[a],o=e[a];break}return n<o?-1:o<n?1:0};i.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}};i.concat=function(r,e){if(!Array.isArray(r))throw new TypeError('"list" argument must be an Array of Buffers');if(r.length===0)return i.alloc(0);var n;if(e===void 0)for(e=0,n=0;n<r.length;++n)e+=r[n].length;var o=i.allocUnsafe(e),a=0;for(n=0;n<r.length;++n){var p=r[n];if(!R(p))throw new TypeError('"list" argument must be an Array of Buffers');p.copy(o,a),a+=p.length}return o};function pr(t,r){if(R(t))return t.length;if(typeof ArrayBuffer<"u"&&typeof ArrayBuffer.isView=="function"&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;typeof t!="string"&&(t=""+t);var 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 hr(t).length;default:if(n)return k(t).length;r=(""+r).toLowerCase(),n=!0}}i.byteLength=pr;function ie(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 me(this,r,e);case"utf8":case"utf-8":return ur(this,r,e);case"ascii":return _e(this,r,e);case"latin1":case"binary":return he(this,r,e);case"base64":return Ee(this,r,e);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Te(this,r,e);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}i.prototype._isBuffer=!0;function C(t,r,e){var n=t[r];t[r]=t[e],t[e]=n}i.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)C(this,e,e+1);return this};i.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)C(this,e,e+3),C(this,e+1,e+2);return this};i.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)C(this,e,e+7),C(this,e+1,e+6),C(this,e+2,e+5),C(this,e+3,e+4);return this};i.prototype.toString=function(){var r=this.length|0;return r===0?"":arguments.length===0?ur(this,0,r):ie.apply(this,arguments)};i.prototype.equals=function(r){if(!R(r))throw new TypeError("Argument must be a Buffer");return this===r?!0:i.compare(this,r)===0};i.prototype.compare=function(r,e,n,o,a){if(!R(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),a===void 0&&(a=this.length),e<0||n>r.length||o<0||a>this.length)throw new RangeError("out of range index");if(o>=a&&e>=n)return 0;if(o>=a)return-1;if(e>=n)return 1;if(e>>>=0,n>>>=0,o>>>=0,a>>>=0,this===r)return 0;for(var p=a-o,c=n-e,u=Math.min(p,c),l=this.slice(o,a),_=r.slice(e,n),E=0;E<u;++E)if(l[E]!==_[E]){p=l[E],c=_[E];break}return p<c?-1:c<p?1:0};function sr(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=i.from(r,n)),R(r))return r.length===0?-1:tr(t,r,e,n,o);if(typeof r=="number")return r=r&255,i.TYPED_ARRAY_SUPPORT&&typeof Uint8Array.prototype.indexOf=="function"?o?Uint8Array.prototype.indexOf.call(t,r,e):Uint8Array.prototype.lastIndexOf.call(t,r,e):tr(t,[r],e,n,o);throw new TypeError("val must be string, number or Buffer")}function tr(t,r,e,n,o){var a=1,p=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;a=2,p/=2,c/=2,e/=2}function u(f,L){return a===1?f[L]:f.readUInt16BE(L*a)}var l;if(o){var _=-1;for(l=e;l<p;l++)if(u(t,l)===u(r,_===-1?0:l-_)){if(_===-1&&(_=l),l-_+1===c)return _*a}else _!==-1&&(l-=l-_),_=-1}else for(e+c>p&&(e=p-c),l=e;l>=0;l--){for(var E=!0,A=0;A<c;A++)if(u(t,l+A)!==u(r,A)){E=!1;break}if(E)return l}return-1}i.prototype.includes=function(r,e,n){return this.indexOf(r,e,n)!==-1};i.prototype.indexOf=function(r,e,n){return sr(this,r,e,n,!0)};i.prototype.lastIndexOf=function(r,e,n){return sr(this,r,e,n,!1)};function ae(t,r,e,n){e=Number(e)||0;var o=t.length-e;n?(n=Number(n),n>o&&(n=o)):n=o;var a=r.length;if(a%2!==0)throw new TypeError("Invalid hex string");n>a/2&&(n=a/2);for(var p=0;p<n;++p){var c=parseInt(r.substr(p*2,2),16);if(isNaN(c))return p;t[e+p]=c}return p}function pe(t,r,e,n){return G(k(r,t.length-e),t,e,n)}function cr(t,r,e,n){return G(Re(r),t,e,n)}function se(t,r,e,n){return cr(t,r,e,n)}function ce(t,r,e,n){return G(hr(r),t,e,n)}function ue(t,r,e,n){return G(Ie(r,t.length-e),t,e,n)}i.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 a=this.length-e;if((n===void 0||n>a)&&(n=a),r.length>0&&(n<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");o||(o="utf8");for(var p=!1;;)switch(o){case"hex":return ae(this,r,e,n);case"utf8":case"utf-8":return pe(this,r,e,n);case"ascii":return cr(this,r,e,n);case"latin1":case"binary":return se(this,r,e,n);case"base64":return ce(this,r,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ue(this,r,e,n);default:if(p)throw new TypeError("Unknown encoding: "+o);o=(""+o).toLowerCase(),p=!0}};i.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function Ee(t,r,e){return r===0&&e===t.length?er(t):er(t.slice(r,e))}function ur(t,r,e){e=Math.min(t.length,e);for(var n=[],o=r;o<e;){var a=t[o],p=null,c=a>239?4:a>223?3:a>191?2:1;if(o+c<=e){var u,l,_,E;switch(c){case 1:a<128&&(p=a);break;case 2:u=t[o+1],(u&192)===128&&(E=(a&31)<<6|u&63,E>127&&(p=E));break;case 3:u=t[o+1],l=t[o+2],(u&192)===128&&(l&192)===128&&(E=(a&15)<<12|(u&63)<<6|l&63,E>2047&&(E<55296||E>57343)&&(p=E));break;case 4:u=t[o+1],l=t[o+2],_=t[o+3],(u&192)===128&&(l&192)===128&&(_&192)===128&&(E=(a&15)<<18|(u&63)<<12|(l&63)<<6|_&63,E>65535&&E<1114112&&(p=E))}}p===null?(p=65533,c=1):p>65535&&(p-=65536,n.push(p>>>10&1023|55296),p=56320|p&1023),n.push(p),o+=c}return le(n)}var nr=4096;function le(t){var r=t.length;if(r<=nr)return String.fromCharCode.apply(String,t);for(var e="",n=0;n<r;)e+=String.fromCharCode.apply(String,t.slice(n,n+=nr));return e}function _e(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 he(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 me(t,r,e){var n=t.length;(!r||r<0)&&(r=0),(!e||e<0||e>n)&&(e=n);for(var o="",a=r;a<e;++a)o+=de(t[a]);return o}function Te(t,r,e){for(var n=t.slice(r,e),o="",a=0;a<n.length;a+=2)o+=String.fromCharCode(n[a]+n[a+1]*256);return o}i.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(i.TYPED_ARRAY_SUPPORT)o=this.subarray(r,e),o.__proto__=i.prototype;else{var a=e-r;o=new i(a,void 0);for(var p=0;p<a;++p)o[p]=this[p+r]}return o};function h(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")}i.prototype.readUIntLE=function(r,e,n){r=r|0,e=e|0,n||h(r,e,this.length);for(var o=this[r],a=1,p=0;++p<e&&(a*=256);)o+=this[r+p]*a;return o};i.prototype.readUIntBE=function(r,e,n){r=r|0,e=e|0,n||h(r,e,this.length);for(var o=this[r+--e],a=1;e>0&&(a*=256);)o+=this[r+--e]*a;return o};i.prototype.readUInt8=function(r,e){return e||h(r,1,this.length),this[r]};i.prototype.readUInt16LE=function(r,e){return e||h(r,2,this.length),this[r]|this[r+1]<<8};i.prototype.readUInt16BE=function(r,e){return e||h(r,2,this.length),this[r]<<8|this[r+1]};i.prototype.readUInt32LE=function(r,e){return e||h(r,4,this.length),(this[r]|this[r+1]<<8|this[r+2]<<16)+this[r+3]*16777216};i.prototype.readUInt32BE=function(r,e){return e||h(r,4,this.length),this[r]*16777216+(this[r+1]<<16|this[r+2]<<8|this[r+3])};i.prototype.readIntLE=function(r,e,n){r=r|0,e=e|0,n||h(r,e,this.length);for(var o=this[r],a=1,p=0;++p<e&&(a*=256);)o+=this[r+p]*a;return a*=128,o>=a&&(o-=Math.pow(2,8*e)),o};i.prototype.readIntBE=function(r,e,n){r=r|0,e=e|0,n||h(r,e,this.length);for(var o=e,a=1,p=this[r+--o];o>0&&(a*=256);)p+=this[r+--o]*a;return a*=128,p>=a&&(p-=Math.pow(2,8*e)),p};i.prototype.readInt8=function(r,e){return e||h(r,1,this.length),this[r]&128?(255-this[r]+1)*-1:this[r]};i.prototype.readInt16LE=function(r,e){e||h(r,2,this.length);var n=this[r]|this[r+1]<<8;return n&32768?n|4294901760:n};i.prototype.readInt16BE=function(r,e){e||h(r,2,this.length);var n=this[r+1]|this[r]<<8;return n&32768?n|4294901760:n};i.prototype.readInt32LE=function(r,e){return e||h(r,4,this.length),this[r]|this[r+1]<<8|this[r+2]<<16|this[r+3]<<24};i.prototype.readInt32BE=function(r,e){return e||h(r,4,this.length),this[r]<<24|this[r+1]<<16|this[r+2]<<8|this[r+3]};i.prototype.readFloatLE=function(r,e){return e||h(r,4,this.length),H(this,r,!0,23,4)};i.prototype.readFloatBE=function(r,e){return e||h(r,4,this.length),H(this,r,!1,23,4)};i.prototype.readDoubleLE=function(r,e){return e||h(r,8,this.length),H(this,r,!0,52,8)};i.prototype.readDoubleBE=function(r,e){return e||h(r,8,this.length),H(this,r,!1,52,8)};function T(t,r,e,n,o,a){if(!R(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(r>o||r<a)throw new RangeError('"value" argument is out of bounds');if(e+n>t.length)throw new RangeError("Index out of range")}i.prototype.writeUIntLE=function(r,e,n,o){if(r=+r,e=e|0,n=n|0,!o){var a=Math.pow(2,8*n)-1;T(this,r,e,n,a,0)}var p=1,c=0;for(this[e]=r&255;++c<n&&(p*=256);)this[e+c]=r/p&255;return e+n};i.prototype.writeUIntBE=function(r,e,n,o){if(r=+r,e=e|0,n=n|0,!o){var a=Math.pow(2,8*n)-1;T(this,r,e,n,a,0)}var p=n-1,c=1;for(this[e+p]=r&255;--p>=0&&(c*=256);)this[e+p]=r/c&255;return e+n};i.prototype.writeUInt8=function(r,e,n){return r=+r,e=e|0,n||T(this,r,e,1,255,0),i.TYPED_ARRAY_SUPPORT||(r=Math.floor(r)),this[e]=r&255,e+1};function F(t,r,e,n){r<0&&(r=65535+r+1);for(var o=0,a=Math.min(t.length-e,2);o<a;++o)t[e+o]=(r&255<<8*(n?o:1-o))>>>(n?o:1-o)*8}i.prototype.writeUInt16LE=function(r,e,n){return r=+r,e=e|0,n||T(this,r,e,2,65535,0),i.TYPED_ARRAY_SUPPORT?(this[e]=r&255,this[e+1]=r>>>8):F(this,r,e,!0),e+2};i.prototype.writeUInt16BE=function(r,e,n){return r=+r,e=e|0,n||T(this,r,e,2,65535,0),i.TYPED_ARRAY_SUPPORT?(this[e]=r>>>8,this[e+1]=r&255):F(this,r,e,!1),e+2};function Y(t,r,e,n){r<0&&(r=4294967295+r+1);for(var o=0,a=Math.min(t.length-e,4);o<a;++o)t[e+o]=r>>>(n?o:3-o)*8&255}i.prototype.writeUInt32LE=function(r,e,n){return r=+r,e=e|0,n||T(this,r,e,4,4294967295,0),i.TYPED_ARRAY_SUPPORT?(this[e+3]=r>>>24,this[e+2]=r>>>16,this[e+1]=r>>>8,this[e]=r&255):Y(this,r,e,!0),e+4};i.prototype.writeUInt32BE=function(r,e,n){return r=+r,e=e|0,n||T(this,r,e,4,4294967295,0),i.TYPED_ARRAY_SUPPORT?(this[e]=r>>>24,this[e+1]=r>>>16,this[e+2]=r>>>8,this[e+3]=r&255):Y(this,r,e,!1),e+4};i.prototype.writeIntLE=function(r,e,n,o){if(r=+r,e=e|0,!o){var a=Math.pow(2,8*n-1);T(this,r,e,n,a-1,-a)}var p=0,c=1,u=0;for(this[e]=r&255;++p<n&&(c*=256);)r<0&&u===0&&this[e+p-1]!==0&&(u=1),this[e+p]=(r/c>>0)-u&255;return e+n};i.prototype.writeIntBE=function(r,e,n,o){if(r=+r,e=e|0,!o){var a=Math.pow(2,8*n-1);T(this,r,e,n,a-1,-a)}var p=n-1,c=1,u=0;for(this[e+p]=r&255;--p>=0&&(c*=256);)r<0&&u===0&&this[e+p+1]!==0&&(u=1),this[e+p]=(r/c>>0)-u&255;return e+n};i.prototype.writeInt8=function(r,e,n){return r=+r,e=e|0,n||T(this,r,e,1,127,-128),i.TYPED_ARRAY_SUPPORT||(r=Math.floor(r)),r<0&&(r=255+r+1),this[e]=r&255,e+1};i.prototype.writeInt16LE=function(r,e,n){return r=+r,e=e|0,n||T(this,r,e,2,32767,-32768),i.TYPED_ARRAY_SUPPORT?(this[e]=r&255,this[e+1]=r>>>8):F(this,r,e,!0),e+2};i.prototype.writeInt16BE=function(r,e,n){return r=+r,e=e|0,n||T(this,r,e,2,32767,-32768),i.TYPED_ARRAY_SUPPORT?(this[e]=r>>>8,this[e+1]=r&255):F(this,r,e,!1),e+2};i.prototype.writeInt32LE=function(r,e,n){return r=+r,e=e|0,n||T(this,r,e,4,2147483647,-2147483648),i.TYPED_ARRAY_SUPPORT?(this[e]=r&255,this[e+1]=r>>>8,this[e+2]=r>>>16,this[e+3]=r>>>24):Y(this,r,e,!0),e+4};i.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),i.TYPED_ARRAY_SUPPORT?(this[e]=r>>>24,this[e+1]=r>>>16,this[e+2]=r>>>8,this[e+3]=r&255):Y(this,r,e,!1),e+4};function Er(t,r,e,n,o,a){if(e+n>t.length)throw new RangeError("Index out of range");if(e<0)throw new RangeError("Index out of range")}function lr(t,r,e,n,o){return o||Er(t,r,e,4,34028234663852886e22,-34028234663852886e22),Tr(t,r,e,n,23,4),e+4}i.prototype.writeFloatLE=function(r,e,n){return lr(this,r,e,!0,n)};i.prototype.writeFloatBE=function(r,e,n){return lr(this,r,e,!1,n)};function _r(t,r,e,n,o){return o||Er(t,r,e,8,17976931348623157e292,-17976931348623157e292),Tr(t,r,e,n,52,8),e+8}i.prototype.writeDoubleLE=function(r,e,n){return _r(this,r,e,!0,n)};i.prototype.writeDoubleBE=function(r,e,n){return _r(this,r,e,!1,n)};i.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 a=o-n,p;if(this===r&&n<e&&e<o)for(p=a-1;p>=0;--p)r[p+e]=this[p+n];else if(a<1e3||!i.TYPED_ARRAY_SUPPORT)for(p=0;p<a;++p)r[p+e]=this[p+n];else Uint8Array.prototype.set.call(r,this.subarray(n,n+a),e);return a};i.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 a=r.charCodeAt(0);a<256&&(r=a)}if(o!==void 0&&typeof o!="string")throw new TypeError("encoding must be a string");if(typeof o=="string"&&!i.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 p;if(typeof r=="number")for(p=e;p<n;++p)this[p]=r;else{var c=R(r)?r:k(new i(r,o).toString()),u=c.length;for(p=0;p<n-e;++p)this[p+e]=c[p%u]}return this};var fe=/[^+\/0-9A-Za-z-_]/g;function be(t){if(t=Ae(t).replace(fe,""),t.length<2)return"";for(;t.length%4!==0;)t=t+"=";return t}function Ae(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}function de(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,a=[],p=0;p<n;++p){if(e=t.charCodeAt(p),e>55295&&e<57344){if(!o){if(e>56319){(r-=3)>-1&&a.push(239,191,189);continue}else if(p+1===n){(r-=3)>-1&&a.push(239,191,189);continue}o=e;continue}if(e<56320){(r-=3)>-1&&a.push(239,191,189),o=e;continue}e=(o-55296<<10|e-56320)+65536}else o&&(r-=3)>-1&&a.push(239,191,189);if(o=null,e<128){if((r-=1)<0)break;a.push(e)}else if(e<2048){if((r-=2)<0)break;a.push(e>>6|192,e&63|128)}else if(e<65536){if((r-=3)<0)break;a.push(e>>12|224,e>>6&63|128,e&63|128)}else if(e<1114112){if((r-=4)<0)break;a.push(e>>18|240,e>>12&63|128,e>>6&63|128,e&63|128)}else throw new Error("Invalid code point")}return a}function Re(t){for(var r=[],e=0;e<t.length;++e)r.push(t.charCodeAt(e)&255);return r}function Ie(t,r){for(var e,n,o,a=[],p=0;p<t.length&&!((r-=2)<0);++p)e=t.charCodeAt(p),n=e>>8,o=e%256,a.push(o),a.push(n);return a}function hr(t){return Zr(be(t))}function G(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 ge(t){return t!==t}function xe(t){return t!=null&&(!!t._isBuffer||mr(t)||Ne(t))}function mr(t){return!!t.constructor&&typeof t.constructor.isBuffer=="function"&&t.constructor.isBuffer(t)}function Ne(t){return typeof t.readFloatLE=="function"&&typeof t.slice=="function"&&mr(t.slice(0,0))}function H(t,r,e,n,o){var a,p,c=o*8-n-1,u=(1<<c)-1,l=u>>1,_=-7,E=e?o-1:0,A=e?-1:1,f=t[r+E];for(E+=A,a=f&(1<<-_)-1,f>>=-_,_+=c;_>0;a=a*256+t[r+E],E+=A,_-=8);for(p=a&(1<<-_)-1,a>>=-_,_+=n;_>0;p=p*256+t[r+E],E+=A,_-=8);if(a===0)a=1-l;else{if(a===u)return p?NaN:(f?-1:1)*(1/0);p=p+Math.pow(2,n),a=a-l}return(f?-1:1)*p*Math.pow(2,a-n)}function Tr(t,r,e,n,o,a){var p,c,u,l=a*8-o-1,_=(1<<l)-1,E=_>>1,A=o===23?Math.pow(2,-24)-Math.pow(2,-77):0,f=n?0:a-1,L=n?1:-1,gr=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=_):(p=Math.floor(Math.log(r)/Math.LN2),r*(u=Math.pow(2,-p))<1&&(p--,u*=2),p+E>=1?r+=A/u:r+=A*Math.pow(2,1-E),r*u>=2&&(p++,u/=2),p+E>=_?(c=0,p=_):p+E>=1?(c=(r*u-1)*Math.pow(2,o),p=p+E):(c=r*Math.pow(2,E-1)*Math.pow(2,o),p=0));o>=8;t[e+f]=c&255,f+=L,c/=256,o-=8);for(p=p<<o|c,l+=o;l>0;t[e+f]=p&255,f+=L,p/=256,l-=8);t[e+f-L]|=gr*128}import z from"bignumber.js";z.config({DECIMAL_PLACES:40,EXPONENTIAL_AT:45});function fr(t,r){return M(t,r,"*")}function K(t,r){return!!M(t,r,">=")}function P(t,r){return!!M(t,r,">")}function w(t,r){return!!M(t,r,"==")}function Oe(t,r){return M(t,r,"mod")}function v(t,r){return w(Oe(t,r),0)}function M(t,r,e){switch(t=new z(String(t)),r=new z(String(r)),e.toLowerCase()){case"-":return t.minus(r).toString();case"+":return t.plus(r).toString();case"*":case"x":return t.multipliedBy(r).toString();case"\xF7":case"/":return t.dividedBy(r).toString();case">=":return t.isGreaterThanOrEqualTo(r);case">":return t.isGreaterThan(r);case"<=":return t.isLessThanOrEqualTo(r);case"<":return t.isLessThan(r);case"==":return t.isEqualTo(r);case"mod":return t.modulo(r);default:break}}var br=(t,r)=>String(t).toLowerCase()===String(r).toLowerCase();var rt={SMALLESTUNIT:s.env.SMALLEST_UNIT},et={SMALLEST_UNITS:s.env.SMALLEST_UNIT};var it=`{"theme1":{"value":"${s.env.FRONTEND_URL}/Theme%3DDark.svg","active":true},"theme2":{"value":"${s.env.FRONTEND_URL}/Theme%3DLight.svg","active":true},"theme3":{"value":"${s.env.FRONTEND_URL}/Theme%3DLight.svg","active":true}}`;var Et=["point-system.discordEnabled","point-system.telegramBotName","point-system.telegramBotId","point-system.telegramEnabled","point-system.telegramGroupId","point-system.telegramGroupName","point-system.twitterAccountId","point-system.twitterAccountName","point-system.twitterEnabled","point-system.twitterJobEnabled","point-system.guideLink"];var bt=s.env.REACT_APP_API_URL,At=s.env.REACT_APP_SOCKET_URL,dt=s.env.REACT_APP_ALGO_SERVER,Rt=s.env.REACT_APP_ALGO_SERVER_PORT||"",It=s.env.REACT_APP_ALGOD_TOKEN||"",gt=s.env.REACT_APP_DISPENSER_LINK,xt=s.env.REACT_APP_FRONTEND_LINK||"",Nt=s.env.REACT_APP_ALGO_EXPLORER_LINK,Ot=s.env.REACT_APP_ALGO_EXPLORER_ASSETS_URL,Dt=(s.env.REACT_APP_REQUIRE_ACCESS_CODE||"").toLowerCase()==="true",Ct=s.env.REACT_APP_USERBACK_ACCESS_TOKEN,wt=(s.env.REACT_APP_EXT_ORDER_TYPES||"").toLowerCase()==="true";var Lt=.001*10**6,St=.002*10**6;var yt=s.env.REACT_APP_MASTER_APP_ID||"406",Pt=s.env.REACT_APP_AGG_APP_ID||"408",De=Number(s.env.REACT_APP_CODEX_APP_ID||"467960617");console.log("CODEX_APP_ID",De);var Ce=s.env.REACT_APP_ALGO_NETWORK||"";var vt=Ce.toLowerCase()==="mainnet"?"mainnet":"testnet";var Ar=(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))(Ar||{}),dr=(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))(dr||{}),Zn={...Ar,...dr};var ui=(t,r)=>{Ir("base",{address:String(t.baseTokenAddress),chainId:t.baseTokenChainId},r.baseAsset),Ir("price",{address:String(t.priceTokenAddress),chainId:t.priceTokenChainId},r.priceAsset),Se(t,r)},Ir=(t,r,e)=>{m(Number(r.chainId)===Number(e.chainId),`Invalid ${t}TokenChainId, must be ${e.chainId}`),m(e.chainId===1&&String(r.address)===String(e.address)||e.chainId===8&&Number(r.address)===Number(e.address)||br(r.address,e.address),`Invalid ${t}TokenAddress, must be ${e.address}`)},Ei=t=>{m(t.expiredTime>=Math.floor(Date.now()/1e3)+3600,"Expiration time shorter than 1 hour")},Se=(t,r)=>{if(m(w(1,t.version),`Invalid order message version. Current is ${1}`),m(w(t.decimalPrice,0)||w(fr(t.decimalPrice,10**18),t.price),"Invalid price or decimalPrice"),m(!isNaN(t.random),"Invalid random, must be a number"),m(t.random>0,"Invalid random, must be greater than 0"),m(t.random<=Number.MAX_SAFE_INTEGER,"Invalid random, must no more than 2^53-1"),m(t.expiredTime>=Math.floor(Date.now()/1e3),"Invalid expiration time"),m(["B","S"].includes(t.orderSide),"Invalid order side"),m(["L","P","I","M"].includes(t.orderType),"Invalid order type"),t.orderType==="M"&&t.orderSide==="S")m(w(t.price,0)&&P(t.amount,0),"Invalid market order amount or price"),m(v(t.amount,r.min_size_increment)&&K(t.amount,r.min_order_size),"Invalid market order amount");else{if(t.orderType==="M"&&t.orderSide==="B"&&w(t.amount,0))throw new Error("Buy murket order by total is not implemented yet");t.orderType==="M"&&t.orderSide==="B"&&P(t.amount,0)?m(P(t.price,0)&&v(t.amount,r.min_size_increment)&&K(t.amount,r.min_order_size),"Invalid buy market order by amount"):(m(P(t.price,0)&&P(t.amount,0),"Invalid order amount or price is zero"),m(v(t.amount,r.min_size_increment)&&K(t.amount,r.min_order_size)&&v(t.price,r.min_price_increment),"Invalid order amount or price"))}},m=(t,r)=>{if(!t)throw new Error(r)};export{Se as assertOrder,ui as assertOrderData,Ei as assertOrderExpirationAtCreationMoment};
|
|
1
|
+
function Q(){throw new Error("setTimeout has not been defined")}function $(){throw new Error("clearTimeout has not been defined")}var x=Q,N=$;typeof globalThis.setTimeout=="function"&&(x=setTimeout);typeof globalThis.clearTimeout=="function"&&(N=clearTimeout);function Z(t){if(x===setTimeout)return setTimeout(t,0);if((x===Q||!x)&&setTimeout)return x=setTimeout,setTimeout(t,0);try{return x(t,0)}catch{try{return x.call(null,t,0)}catch{return x.call(this,t,0)}}}function xr(t){if(N===clearTimeout)return clearTimeout(t);if((N===$||!N)&&clearTimeout)return N=clearTimeout,clearTimeout(t);try{return N(t)}catch{try{return N.call(null,t)}catch{return N.call(this,t)}}}var g=[],y=!1,O,U=-1;function Nr(){!y||!O||(y=!1,O.length?g=O.concat(g):U=-1,g.length&&j())}function j(){if(!y){var t=Z(Nr);y=!0;for(var r=g.length;r;){for(O=g,g=[];++U<r;)O&&O[U].run();U=-1,r=g.length}O=null,y=!1,xr(t)}}function Or(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];g.push(new rr(t,r)),g.length===1&&!y&&Z(j)}function rr(t,r){this.fun=t,this.array=r}rr.prototype.run=function(){this.fun.apply(null,this.array)};var Dr="browser",Cr="browser",wr=!0,Lr={},Sr=[],yr="",Pr={},vr={},Mr={};function D(){}var Ur=D,kr=D,Br=D,Fr=D,Yr=D,Gr=D,Hr=D;function Kr(t){throw new Error("process.binding is not supported")}function Wr(){return"/"}function Vr(t){throw new Error("process.chdir is not supported")}function Xr(){return 0}var S=globalThis.performance||{},qr=S.now||S.mozNow||S.msNow||S.oNow||S.webkitNow||function(){return new Date().getTime()};function zr(t){var r=qr.call(S)*.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 Jr=new Date;function Qr(){var t=new Date,r=t-Jr;return r/1e3}var s={nextTick:Or,title:Dr,browser:wr,env:Lr,argv:Sr,version:yr,versions:Pr,on:Ur,addListener:kr,once:Br,off:Fr,removeListener:Yr,removeAllListeners:Gr,emit:Hr,binding:Kr,cwd:Wr,chdir:Vr,umask:Xr,hrtime:zr,platform:Cr,release:vr,config:Mr,uptime:Qr},J={};Object.keys(J).forEach(t=>{let r=t.split("."),e=s;for(let n=0;n<r.length;n++){let o=r[n];n===r.length-1?e[o]=J[t]:e=e[o]||(e[o]={})}});var A=[],b=[],$r=typeof Uint8Array<"u"?Uint8Array:Array,V=!1;function or(){V=!0;for(var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",r=0,e=t.length;r<e;++r)A[r]=t[r],b[t.charCodeAt(r)]=r;b[45]=62,b[95]=63}function Zr(t){V||or();var r,e,n,o,a,p,c=t.length;if(c%4>0)throw new Error("Invalid string. Length must be a multiple of 4");a=t[c-2]==="="?2:t[c-1]==="="?1:0,p=new $r(c*3/4-a),n=a>0?c-4:c;var u=0;for(r=0,e=0;r<n;r+=4,e+=3)o=b[t.charCodeAt(r)]<<18|b[t.charCodeAt(r+1)]<<12|b[t.charCodeAt(r+2)]<<6|b[t.charCodeAt(r+3)],p[u++]=o>>16&255,p[u++]=o>>8&255,p[u++]=o&255;return a===2?(o=b[t.charCodeAt(r)]<<2|b[t.charCodeAt(r+1)]>>4,p[u++]=o&255):a===1&&(o=b[t.charCodeAt(r)]<<10|b[t.charCodeAt(r+1)]<<4|b[t.charCodeAt(r+2)]>>2,p[u++]=o>>8&255,p[u++]=o&255),p}function jr(t){return A[t>>18&63]+A[t>>12&63]+A[t>>6&63]+A[t&63]}function re(t,r,e){for(var n,o=[],a=r;a<e;a+=3)n=(t[a]<<16)+(t[a+1]<<8)+t[a+2],o.push(jr(n));return o.join("")}function er(t){V||or();for(var r,e=t.length,n=e%3,o="",a=[],p=16383,c=0,u=e-n;c<u;c+=p)a.push(re(t,c,c+p>u?u:c+p));return n===1?(r=t[e-1],o+=A[r>>2],o+=A[r<<4&63],o+="=="):n===2&&(r=(t[e-2]<<8)+t[e-1],o+=A[r>>10],o+=A[r>>4&63],o+=A[r<<2&63],o+="="),a.push(o),a.join("")}i.TYPED_ARRAY_SUPPORT=globalThis.TYPED_ARRAY_SUPPORT!==void 0?globalThis.TYPED_ARRAY_SUPPORT:!0;function k(){return i.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function I(t,r){if(k()<r)throw new RangeError("Invalid typed array length");return i.TYPED_ARRAY_SUPPORT?(t=new Uint8Array(r),t.__proto__=i.prototype):(t===null&&(t=new i(r)),t.length=r),t}function i(t,r,e){if(!i.TYPED_ARRAY_SUPPORT&&!(this instanceof i))return new i(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 X(this,t)}return ir(this,t,r,e)}i.poolSize=8192;i._augment=function(t){return t.__proto__=i.prototype,t};function ir(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?ne(t,r,e,n):typeof r=="string"?te(t,r,e):oe(t,r)}i.from=function(t,r,e){return ir(null,t,r,e)};i.kMaxLength=k();i.TYPED_ARRAY_SUPPORT&&(i.prototype.__proto__=Uint8Array.prototype,i.__proto__=Uint8Array,typeof Symbol<"u"&&Symbol.species&&i[Symbol.species]);function ar(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 ee(t,r,e,n){return ar(r),r<=0?I(t,r):e!==void 0?typeof n=="string"?I(t,r).fill(e,n):I(t,r).fill(e):I(t,r)}i.alloc=function(t,r,e){return ee(null,t,r,e)};function X(t,r){if(ar(r),t=I(t,r<0?0:q(r)|0),!i.TYPED_ARRAY_SUPPORT)for(var e=0;e<r;++e)t[e]=0;return t}i.allocUnsafe=function(t){return X(null,t)};i.allocUnsafeSlow=function(t){return X(null,t)};function te(t,r,e){if((typeof e!="string"||e==="")&&(e="utf8"),!i.isEncoding(e))throw new TypeError('"encoding" must be a valid string encoding');var n=pr(r,e)|0;t=I(t,n);var o=t.write(r,e);return o!==n&&(t=t.slice(0,o)),t}function W(t,r){var e=r.length<0?0:q(r.length)|0;t=I(t,e);for(var n=0;n<e;n+=1)t[n]=r[n]&255;return t}function ne(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),i.TYPED_ARRAY_SUPPORT?(t=r,t.__proto__=i.prototype):t=W(t,r),t}function oe(t,r){if(R(r)){var e=q(r.length)|0;return t=I(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"||Ie(r.length)?I(t,0):W(t,r);if(r.type==="Buffer"&&Array.isArray(r.data))return W(t,r.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function q(t){if(t>=k())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+k().toString(16)+" bytes");return t|0}i.isBuffer=xe;function R(t){return!!(t!=null&&t._isBuffer)}i.compare=function(r,e){if(!R(r)||!R(e))throw new TypeError("Arguments must be Buffers");if(r===e)return 0;for(var n=r.length,o=e.length,a=0,p=Math.min(n,o);a<p;++a)if(r[a]!==e[a]){n=r[a],o=e[a];break}return n<o?-1:o<n?1:0};i.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}};i.concat=function(r,e){if(!Array.isArray(r))throw new TypeError('"list" argument must be an Array of Buffers');if(r.length===0)return i.alloc(0);var n;if(e===void 0)for(e=0,n=0;n<r.length;++n)e+=r[n].length;var o=i.allocUnsafe(e),a=0;for(n=0;n<r.length;++n){var p=r[n];if(!R(p))throw new TypeError('"list" argument must be an Array of Buffers');p.copy(o,a),a+=p.length}return o};function pr(t,r){if(R(t))return t.length;if(typeof ArrayBuffer<"u"&&typeof ArrayBuffer.isView=="function"&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;typeof t!="string"&&(t=""+t);var 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 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(n)return B(t).length;r=(""+r).toLowerCase(),n=!0}}i.byteLength=pr;function ie(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 me(this,r,e);case"utf8":case"utf-8":return ur(this,r,e);case"ascii":return _e(this,r,e);case"latin1":case"binary":return he(this,r,e);case"base64":return Ee(this,r,e);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Te(this,r,e);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}i.prototype._isBuffer=!0;function C(t,r,e){var n=t[r];t[r]=t[e],t[e]=n}i.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)C(this,e,e+1);return this};i.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)C(this,e,e+3),C(this,e+1,e+2);return this};i.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)C(this,e,e+7),C(this,e+1,e+6),C(this,e+2,e+5),C(this,e+3,e+4);return this};i.prototype.toString=function(){var r=this.length|0;return r===0?"":arguments.length===0?ur(this,0,r):ie.apply(this,arguments)};i.prototype.equals=function(r){if(!R(r))throw new TypeError("Argument must be a Buffer");return this===r?!0:i.compare(this,r)===0};i.prototype.compare=function(r,e,n,o,a){if(!R(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),a===void 0&&(a=this.length),e<0||n>r.length||o<0||a>this.length)throw new RangeError("out of range index");if(o>=a&&e>=n)return 0;if(o>=a)return-1;if(e>=n)return 1;if(e>>>=0,n>>>=0,o>>>=0,a>>>=0,this===r)return 0;for(var p=a-o,c=n-e,u=Math.min(p,c),l=this.slice(o,a),_=r.slice(e,n),E=0;E<u;++E)if(l[E]!==_[E]){p=l[E],c=_[E];break}return p<c?-1:c<p?1:0};function sr(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=i.from(r,n)),R(r))return r.length===0?-1:tr(t,r,e,n,o);if(typeof r=="number")return r=r&255,i.TYPED_ARRAY_SUPPORT&&typeof Uint8Array.prototype.indexOf=="function"?o?Uint8Array.prototype.indexOf.call(t,r,e):Uint8Array.prototype.lastIndexOf.call(t,r,e):tr(t,[r],e,n,o);throw new TypeError("val must be string, number or Buffer")}function tr(t,r,e,n,o){var a=1,p=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;a=2,p/=2,c/=2,e/=2}function u(f,L){return a===1?f[L]:f.readUInt16BE(L*a)}var l;if(o){var _=-1;for(l=e;l<p;l++)if(u(t,l)===u(r,_===-1?0:l-_)){if(_===-1&&(_=l),l-_+1===c)return _*a}else _!==-1&&(l-=l-_),_=-1}else for(e+c>p&&(e=p-c),l=e;l>=0;l--){for(var E=!0,d=0;d<c;d++)if(u(t,l+d)!==u(r,d)){E=!1;break}if(E)return l}return-1}i.prototype.includes=function(r,e,n){return this.indexOf(r,e,n)!==-1};i.prototype.indexOf=function(r,e,n){return sr(this,r,e,n,!0)};i.prototype.lastIndexOf=function(r,e,n){return sr(this,r,e,n,!1)};function ae(t,r,e,n){e=Number(e)||0;var o=t.length-e;n?(n=Number(n),n>o&&(n=o)):n=o;var a=r.length;if(a%2!==0)throw new TypeError("Invalid hex string");n>a/2&&(n=a/2);for(var p=0;p<n;++p){var c=parseInt(r.substr(p*2,2),16);if(isNaN(c))return p;t[e+p]=c}return p}function pe(t,r,e,n){return G(B(r,t.length-e),t,e,n)}function cr(t,r,e,n){return G(Re(r),t,e,n)}function se(t,r,e,n){return cr(t,r,e,n)}function ce(t,r,e,n){return G(hr(r),t,e,n)}function ue(t,r,e,n){return G(ge(r,t.length-e),t,e,n)}i.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 a=this.length-e;if((n===void 0||n>a)&&(n=a),r.length>0&&(n<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");o||(o="utf8");for(var p=!1;;)switch(o){case"hex":return ae(this,r,e,n);case"utf8":case"utf-8":return pe(this,r,e,n);case"ascii":return cr(this,r,e,n);case"latin1":case"binary":return se(this,r,e,n);case"base64":return ce(this,r,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ue(this,r,e,n);default:if(p)throw new TypeError("Unknown encoding: "+o);o=(""+o).toLowerCase(),p=!0}};i.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function Ee(t,r,e){return r===0&&e===t.length?er(t):er(t.slice(r,e))}function ur(t,r,e){e=Math.min(t.length,e);for(var n=[],o=r;o<e;){var a=t[o],p=null,c=a>239?4:a>223?3:a>191?2:1;if(o+c<=e){var u,l,_,E;switch(c){case 1:a<128&&(p=a);break;case 2:u=t[o+1],(u&192)===128&&(E=(a&31)<<6|u&63,E>127&&(p=E));break;case 3:u=t[o+1],l=t[o+2],(u&192)===128&&(l&192)===128&&(E=(a&15)<<12|(u&63)<<6|l&63,E>2047&&(E<55296||E>57343)&&(p=E));break;case 4:u=t[o+1],l=t[o+2],_=t[o+3],(u&192)===128&&(l&192)===128&&(_&192)===128&&(E=(a&15)<<18|(u&63)<<12|(l&63)<<6|_&63,E>65535&&E<1114112&&(p=E))}}p===null?(p=65533,c=1):p>65535&&(p-=65536,n.push(p>>>10&1023|55296),p=56320|p&1023),n.push(p),o+=c}return le(n)}var nr=4096;function le(t){var r=t.length;if(r<=nr)return String.fromCharCode.apply(String,t);for(var e="",n=0;n<r;)e+=String.fromCharCode.apply(String,t.slice(n,n+=nr));return e}function _e(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 he(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 me(t,r,e){var n=t.length;(!r||r<0)&&(r=0),(!e||e<0||e>n)&&(e=n);for(var o="",a=r;a<e;++a)o+=Ae(t[a]);return o}function Te(t,r,e){for(var n=t.slice(r,e),o="",a=0;a<n.length;a+=2)o+=String.fromCharCode(n[a]+n[a+1]*256);return o}i.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(i.TYPED_ARRAY_SUPPORT)o=this.subarray(r,e),o.__proto__=i.prototype;else{var a=e-r;o=new i(a,void 0);for(var p=0;p<a;++p)o[p]=this[p+r]}return o};function h(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")}i.prototype.readUIntLE=function(r,e,n){r=r|0,e=e|0,n||h(r,e,this.length);for(var o=this[r],a=1,p=0;++p<e&&(a*=256);)o+=this[r+p]*a;return o};i.prototype.readUIntBE=function(r,e,n){r=r|0,e=e|0,n||h(r,e,this.length);for(var o=this[r+--e],a=1;e>0&&(a*=256);)o+=this[r+--e]*a;return o};i.prototype.readUInt8=function(r,e){return e||h(r,1,this.length),this[r]};i.prototype.readUInt16LE=function(r,e){return e||h(r,2,this.length),this[r]|this[r+1]<<8};i.prototype.readUInt16BE=function(r,e){return e||h(r,2,this.length),this[r]<<8|this[r+1]};i.prototype.readUInt32LE=function(r,e){return e||h(r,4,this.length),(this[r]|this[r+1]<<8|this[r+2]<<16)+this[r+3]*16777216};i.prototype.readUInt32BE=function(r,e){return e||h(r,4,this.length),this[r]*16777216+(this[r+1]<<16|this[r+2]<<8|this[r+3])};i.prototype.readIntLE=function(r,e,n){r=r|0,e=e|0,n||h(r,e,this.length);for(var o=this[r],a=1,p=0;++p<e&&(a*=256);)o+=this[r+p]*a;return a*=128,o>=a&&(o-=Math.pow(2,8*e)),o};i.prototype.readIntBE=function(r,e,n){r=r|0,e=e|0,n||h(r,e,this.length);for(var o=e,a=1,p=this[r+--o];o>0&&(a*=256);)p+=this[r+--o]*a;return a*=128,p>=a&&(p-=Math.pow(2,8*e)),p};i.prototype.readInt8=function(r,e){return e||h(r,1,this.length),this[r]&128?(255-this[r]+1)*-1:this[r]};i.prototype.readInt16LE=function(r,e){e||h(r,2,this.length);var n=this[r]|this[r+1]<<8;return n&32768?n|4294901760:n};i.prototype.readInt16BE=function(r,e){e||h(r,2,this.length);var n=this[r+1]|this[r]<<8;return n&32768?n|4294901760:n};i.prototype.readInt32LE=function(r,e){return e||h(r,4,this.length),this[r]|this[r+1]<<8|this[r+2]<<16|this[r+3]<<24};i.prototype.readInt32BE=function(r,e){return e||h(r,4,this.length),this[r]<<24|this[r+1]<<16|this[r+2]<<8|this[r+3]};i.prototype.readFloatLE=function(r,e){return e||h(r,4,this.length),H(this,r,!0,23,4)};i.prototype.readFloatBE=function(r,e){return e||h(r,4,this.length),H(this,r,!1,23,4)};i.prototype.readDoubleLE=function(r,e){return e||h(r,8,this.length),H(this,r,!0,52,8)};i.prototype.readDoubleBE=function(r,e){return e||h(r,8,this.length),H(this,r,!1,52,8)};function T(t,r,e,n,o,a){if(!R(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(r>o||r<a)throw new RangeError('"value" argument is out of bounds');if(e+n>t.length)throw new RangeError("Index out of range")}i.prototype.writeUIntLE=function(r,e,n,o){if(r=+r,e=e|0,n=n|0,!o){var a=Math.pow(2,8*n)-1;T(this,r,e,n,a,0)}var p=1,c=0;for(this[e]=r&255;++c<n&&(p*=256);)this[e+c]=r/p&255;return e+n};i.prototype.writeUIntBE=function(r,e,n,o){if(r=+r,e=e|0,n=n|0,!o){var a=Math.pow(2,8*n)-1;T(this,r,e,n,a,0)}var p=n-1,c=1;for(this[e+p]=r&255;--p>=0&&(c*=256);)this[e+p]=r/c&255;return e+n};i.prototype.writeUInt8=function(r,e,n){return r=+r,e=e|0,n||T(this,r,e,1,255,0),i.TYPED_ARRAY_SUPPORT||(r=Math.floor(r)),this[e]=r&255,e+1};function F(t,r,e,n){r<0&&(r=65535+r+1);for(var o=0,a=Math.min(t.length-e,2);o<a;++o)t[e+o]=(r&255<<8*(n?o:1-o))>>>(n?o:1-o)*8}i.prototype.writeUInt16LE=function(r,e,n){return r=+r,e=e|0,n||T(this,r,e,2,65535,0),i.TYPED_ARRAY_SUPPORT?(this[e]=r&255,this[e+1]=r>>>8):F(this,r,e,!0),e+2};i.prototype.writeUInt16BE=function(r,e,n){return r=+r,e=e|0,n||T(this,r,e,2,65535,0),i.TYPED_ARRAY_SUPPORT?(this[e]=r>>>8,this[e+1]=r&255):F(this,r,e,!1),e+2};function Y(t,r,e,n){r<0&&(r=4294967295+r+1);for(var o=0,a=Math.min(t.length-e,4);o<a;++o)t[e+o]=r>>>(n?o:3-o)*8&255}i.prototype.writeUInt32LE=function(r,e,n){return r=+r,e=e|0,n||T(this,r,e,4,4294967295,0),i.TYPED_ARRAY_SUPPORT?(this[e+3]=r>>>24,this[e+2]=r>>>16,this[e+1]=r>>>8,this[e]=r&255):Y(this,r,e,!0),e+4};i.prototype.writeUInt32BE=function(r,e,n){return r=+r,e=e|0,n||T(this,r,e,4,4294967295,0),i.TYPED_ARRAY_SUPPORT?(this[e]=r>>>24,this[e+1]=r>>>16,this[e+2]=r>>>8,this[e+3]=r&255):Y(this,r,e,!1),e+4};i.prototype.writeIntLE=function(r,e,n,o){if(r=+r,e=e|0,!o){var a=Math.pow(2,8*n-1);T(this,r,e,n,a-1,-a)}var p=0,c=1,u=0;for(this[e]=r&255;++p<n&&(c*=256);)r<0&&u===0&&this[e+p-1]!==0&&(u=1),this[e+p]=(r/c>>0)-u&255;return e+n};i.prototype.writeIntBE=function(r,e,n,o){if(r=+r,e=e|0,!o){var a=Math.pow(2,8*n-1);T(this,r,e,n,a-1,-a)}var p=n-1,c=1,u=0;for(this[e+p]=r&255;--p>=0&&(c*=256);)r<0&&u===0&&this[e+p+1]!==0&&(u=1),this[e+p]=(r/c>>0)-u&255;return e+n};i.prototype.writeInt8=function(r,e,n){return r=+r,e=e|0,n||T(this,r,e,1,127,-128),i.TYPED_ARRAY_SUPPORT||(r=Math.floor(r)),r<0&&(r=255+r+1),this[e]=r&255,e+1};i.prototype.writeInt16LE=function(r,e,n){return r=+r,e=e|0,n||T(this,r,e,2,32767,-32768),i.TYPED_ARRAY_SUPPORT?(this[e]=r&255,this[e+1]=r>>>8):F(this,r,e,!0),e+2};i.prototype.writeInt16BE=function(r,e,n){return r=+r,e=e|0,n||T(this,r,e,2,32767,-32768),i.TYPED_ARRAY_SUPPORT?(this[e]=r>>>8,this[e+1]=r&255):F(this,r,e,!1),e+2};i.prototype.writeInt32LE=function(r,e,n){return r=+r,e=e|0,n||T(this,r,e,4,2147483647,-2147483648),i.TYPED_ARRAY_SUPPORT?(this[e]=r&255,this[e+1]=r>>>8,this[e+2]=r>>>16,this[e+3]=r>>>24):Y(this,r,e,!0),e+4};i.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),i.TYPED_ARRAY_SUPPORT?(this[e]=r>>>24,this[e+1]=r>>>16,this[e+2]=r>>>8,this[e+3]=r&255):Y(this,r,e,!1),e+4};function Er(t,r,e,n,o,a){if(e+n>t.length)throw new RangeError("Index out of range");if(e<0)throw new RangeError("Index out of range")}function lr(t,r,e,n,o){return o||Er(t,r,e,4,34028234663852886e22,-34028234663852886e22),Tr(t,r,e,n,23,4),e+4}i.prototype.writeFloatLE=function(r,e,n){return lr(this,r,e,!0,n)};i.prototype.writeFloatBE=function(r,e,n){return lr(this,r,e,!1,n)};function _r(t,r,e,n,o){return o||Er(t,r,e,8,17976931348623157e292,-17976931348623157e292),Tr(t,r,e,n,52,8),e+8}i.prototype.writeDoubleLE=function(r,e,n){return _r(this,r,e,!0,n)};i.prototype.writeDoubleBE=function(r,e,n){return _r(this,r,e,!1,n)};i.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 a=o-n,p;if(this===r&&n<e&&e<o)for(p=a-1;p>=0;--p)r[p+e]=this[p+n];else if(a<1e3||!i.TYPED_ARRAY_SUPPORT)for(p=0;p<a;++p)r[p+e]=this[p+n];else Uint8Array.prototype.set.call(r,this.subarray(n,n+a),e);return a};i.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 a=r.charCodeAt(0);a<256&&(r=a)}if(o!==void 0&&typeof o!="string")throw new TypeError("encoding must be a string");if(typeof o=="string"&&!i.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 p;if(typeof r=="number")for(p=e;p<n;++p)this[p]=r;else{var c=R(r)?r:B(new i(r,o).toString()),u=c.length;for(p=0;p<n-e;++p)this[p+e]=c[p%u]}return this};var fe=/[^+\/0-9A-Za-z-_]/g;function be(t){if(t=de(t).replace(fe,""),t.length<2)return"";for(;t.length%4!==0;)t=t+"=";return t}function de(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}function Ae(t){return t<16?"0"+t.toString(16):t.toString(16)}function B(t,r){r=r||1/0;for(var e,n=t.length,o=null,a=[],p=0;p<n;++p){if(e=t.charCodeAt(p),e>55295&&e<57344){if(!o){if(e>56319){(r-=3)>-1&&a.push(239,191,189);continue}else if(p+1===n){(r-=3)>-1&&a.push(239,191,189);continue}o=e;continue}if(e<56320){(r-=3)>-1&&a.push(239,191,189),o=e;continue}e=(o-55296<<10|e-56320)+65536}else o&&(r-=3)>-1&&a.push(239,191,189);if(o=null,e<128){if((r-=1)<0)break;a.push(e)}else if(e<2048){if((r-=2)<0)break;a.push(e>>6|192,e&63|128)}else if(e<65536){if((r-=3)<0)break;a.push(e>>12|224,e>>6&63|128,e&63|128)}else if(e<1114112){if((r-=4)<0)break;a.push(e>>18|240,e>>12&63|128,e>>6&63|128,e&63|128)}else throw new Error("Invalid code point")}return a}function Re(t){for(var r=[],e=0;e<t.length;++e)r.push(t.charCodeAt(e)&255);return r}function ge(t,r){for(var e,n,o,a=[],p=0;p<t.length&&!((r-=2)<0);++p)e=t.charCodeAt(p),n=e>>8,o=e%256,a.push(o),a.push(n);return a}function hr(t){return Zr(be(t))}function G(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 Ie(t){return t!==t}function xe(t){return t!=null&&(!!t._isBuffer||mr(t)||Ne(t))}function mr(t){return!!t.constructor&&typeof t.constructor.isBuffer=="function"&&t.constructor.isBuffer(t)}function Ne(t){return typeof t.readFloatLE=="function"&&typeof t.slice=="function"&&mr(t.slice(0,0))}function H(t,r,e,n,o){var a,p,c=o*8-n-1,u=(1<<c)-1,l=u>>1,_=-7,E=e?o-1:0,d=e?-1:1,f=t[r+E];for(E+=d,a=f&(1<<-_)-1,f>>=-_,_+=c;_>0;a=a*256+t[r+E],E+=d,_-=8);for(p=a&(1<<-_)-1,a>>=-_,_+=n;_>0;p=p*256+t[r+E],E+=d,_-=8);if(a===0)a=1-l;else{if(a===u)return p?NaN:(f?-1:1)*(1/0);p=p+Math.pow(2,n),a=a-l}return(f?-1:1)*p*Math.pow(2,a-n)}function Tr(t,r,e,n,o,a){var p,c,u,l=a*8-o-1,_=(1<<l)-1,E=_>>1,d=o===23?Math.pow(2,-24)-Math.pow(2,-77):0,f=n?0:a-1,L=n?1:-1,Ir=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=_):(p=Math.floor(Math.log(r)/Math.LN2),r*(u=Math.pow(2,-p))<1&&(p--,u*=2),p+E>=1?r+=d/u:r+=d*Math.pow(2,1-E),r*u>=2&&(p++,u/=2),p+E>=_?(c=0,p=_):p+E>=1?(c=(r*u-1)*Math.pow(2,o),p=p+E):(c=r*Math.pow(2,E-1)*Math.pow(2,o),p=0));o>=8;t[e+f]=c&255,f+=L,c/=256,o-=8);for(p=p<<o|c,l+=o;l>0;t[e+f]=p&255,f+=L,p/=256,l-=8);t[e+f-L]|=Ir*128}import z from"bignumber.js";z.config({DECIMAL_PLACES:40,EXPONENTIAL_AT:45});function fr(t,r){return M(t,r,"*")}function K(t,r){return!!M(t,r,">=")}function P(t,r){return!!M(t,r,">")}function w(t,r){return!!M(t,r,"==")}function Oe(t,r){return M(t,r,"mod")}function v(t,r){return w(Oe(t,r),0)}function M(t,r,e){switch(t=new z(String(t)),r=new z(String(r)),e.toLowerCase()){case"-":return t.minus(r).toString();case"+":return t.plus(r).toString();case"*":case"x":return t.multipliedBy(r).toString();case"\xF7":case"/":return t.dividedBy(r).toString();case">=":return t.isGreaterThanOrEqualTo(r);case">":return t.isGreaterThan(r);case"<=":return t.isLessThanOrEqualTo(r);case"<":return t.isLessThan(r);case"==":return t.isEqualTo(r);case"mod":return t.modulo(r);default:break}}var br=(t,r)=>String(t).toLowerCase()===String(r).toLowerCase();var rt={SMALLESTUNIT:s.env.SMALLEST_UNIT},et={SMALLEST_UNITS:s.env.SMALLEST_UNIT};var it=`{"theme1":{"value":"${s.env.FRONTEND_URL}/Theme%3DDark.svg","active":true},"theme2":{"value":"${s.env.FRONTEND_URL}/Theme%3DLight.svg","active":true},"theme3":{"value":"${s.env.FRONTEND_URL}/Theme%3DLight.svg","active":true}}`;var Et=["point-system.discordEnabled","point-system.telegramBotName","point-system.telegramBotId","point-system.telegramEnabled","point-system.telegramGroupId","point-system.telegramGroupName","point-system.twitterAccountId","point-system.twitterAccountName","point-system.twitterEnabled","point-system.twitterJobEnabled","point-system.guideLink"];var bt=s.env.REACT_APP_API_URL,dt=s.env.REACT_APP_SOCKET_URL,At=s.env.REACT_APP_ALGO_SERVER,Rt=s.env.REACT_APP_ALGO_SERVER_PORT||"",gt=s.env.REACT_APP_ALGOD_TOKEN||"",It=s.env.REACT_APP_DISPENSER_LINK,xt=s.env.REACT_APP_FRONTEND_LINK||"",Nt=s.env.REACT_APP_ALGO_EXPLORER_LINK,Ot=s.env.REACT_APP_ALGO_EXPLORER_ASSETS_URL,Dt=(s.env.REACT_APP_REQUIRE_ACCESS_CODE||"").toLowerCase()==="true",Ct=s.env.REACT_APP_USERBACK_ACCESS_TOKEN,wt=(s.env.REACT_APP_EXT_ORDER_TYPES||"").toLowerCase()==="true";var Lt=.001*10**6,St=.002*10**6;var yt=s.env.REACT_APP_MASTER_APP_ID||"406",Pt=s.env.REACT_APP_AGG_APP_ID||"408",De=Number(s.env.REACT_APP_CODEX_APP_ID||"467960617");console.log("CODEX_APP_ID",De);var Ce=s.env.REACT_APP_ALGO_NETWORK||"";var vt=Ce.toLowerCase()==="mainnet"?"mainnet":"testnet";var dr=(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))(dr||{}),Ar=(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))(Ar||{}),Zn={...dr,...Ar};var ui=(t,r)=>{gr("base",{address:String(t.baseTokenAddress),chainId:t.baseTokenChainId},r.baseAsset),gr("price",{address:String(t.priceTokenAddress),chainId:t.priceTokenChainId},r.priceAsset),Se(t,r)},gr=(t,r,e)=>{m(Number(r.chainId)===Number(e.chainId),`Invalid ${t}TokenChainId, must be ${e.chainId}`),m(e.chainId===1&&String(r.address)===String(e.address)||e.chainId===8&&Number(r.address)===Number(e.address)||br(r.address,e.address),`Invalid ${t}TokenAddress, must be ${e.address}`)},Ei=t=>{m(t.expiredTime>=Math.floor(Date.now()/1e3)+3600,"Expiration time shorter than 1 hour")},Se=(t,r)=>{if(m(w(1,t.version),`Invalid order message version. Current is ${1}`),m(w(t.decimalPrice,0)||w(fr(t.decimalPrice,10**18),t.price),"Invalid price or decimalPrice"),m(!isNaN(t.random),"Invalid random, must be a number"),m(t.random>0,"Invalid random, must be greater than 0"),m(t.random<=Number.MAX_SAFE_INTEGER,"Invalid random, must no more than 2^53-1"),m(t.expiredTime>=Math.floor(Date.now()/1e3),"Invalid expiration time"),m(["B","S"].includes(t.orderSide),"Invalid order side"),m(["L","P","I","M"].includes(t.orderType),"Invalid order type"),t.orderType==="M"&&t.orderSide==="S")m(w(t.price,0)&&P(t.amount,0),"Invalid market order amount or price"),m(v(t.amount,r.min_size_increment)&&K(t.amount,r.min_order_size),"Invalid market order amount");else{if(t.orderType==="M"&&t.orderSide==="B"&&w(t.amount,0))throw new Error("Buy murket order by total is not implemented yet");t.orderType==="M"&&t.orderSide==="B"&&P(t.amount,0)?m(P(t.price,0)&&v(t.amount,r.min_size_increment)&&K(t.amount,r.min_order_size),"Invalid buy market order by amount"):(m(P(t.price,0)&&P(t.amount,0),"Invalid order amount or price is zero"),m(v(t.amount,r.min_size_increment)&&K(t.amount,r.min_order_size)&&v(t.price,r.min_price_increment),"Invalid order amount or price"))}},m=(t,r)=>{if(!t)throw new Error(r)};export{Se as assertOrder,ui as assertOrderData,Ei as assertOrderExpirationAtCreationMoment};
|
|
2
2
|
/*! Bundled license information:
|
|
3
3
|
|
|
4
4
|
@esbuild-plugins/node-globals-polyfill/Buffer.js:
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
function X(){throw new Error("setTimeout has not been defined")}function Q(){throw new Error("clearTimeout has not been defined")}var x=X,I=Q;typeof globalThis.setTimeout=="function"&&(x=setTimeout);typeof globalThis.clearTimeout=="function"&&(I=clearTimeout);function q(t){if(x===setTimeout)return setTimeout(t,0);if((x===X||!x)&&setTimeout)return x=setTimeout,setTimeout(t,0);try{return x(t,0)}catch{try{return x.call(null,t,0)}catch{return x.call(this,t,0)}}}function hr(t){if(I===clearTimeout)return clearTimeout(t);if((I===Q||!I)&&clearTimeout)return I=clearTimeout,clearTimeout(t);try{return I(t)}catch{try{return I.call(null,t)}catch{return I.call(this,t)}}}var d=[],P=!1,S,D=-1;function gr(){!P||!S||(P=!1,S.length?d=S.concat(d):D=-1,d.length&&$())}function $(){if(!P){var t=q(gr);P=!0;for(var r=d.length;r;){for(S=d,d=[];++D<r;)S&&S[D].run();D=-1,r=d.length}S=null,P=!1,hr(t)}}function mr(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];d.push(new J(t,r)),d.length===1&&!P&&q($)}function J(t,r){this.fun=t,this.array=r}J.prototype.run=function(){this.fun.apply(null,this.array)};var br="browser",Ar="browser",dr=!0,Rr={},xr=[],Ir="",Sr={},wr={},Nr={};function w(){}var Or=w,yr=w,Pr=w,Dr=w,Lr=w,Cr=w,vr=w;function Ur(t){throw new Error("process.binding is not supported")}function Mr(){return"/"}function Br(t){throw new Error("process.chdir is not supported")}function kr(){return 0}var y=globalThis.performance||{},Yr=y.now||y.mozNow||y.msNow||y.oNow||y.webkitNow||function(){return new Date().getTime()};function Fr(t){var r=Yr.call(y)*.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 Gr=new Date;function Kr(){var t=new Date,r=t-Gr;return r/1e3}var l={nextTick:mr,title:br,browser:dr,env:Rr,argv:xr,version:Ir,versions:Sr,on:Or,addListener:yr,once:Pr,off:Dr,removeListener:Lr,removeAllListeners:Cr,emit:vr,binding:Ur,cwd:Mr,chdir:Br,umask:kr,hrtime:Fr,platform:Ar,release:wr,config:Nr,uptime:Kr},V={};Object.keys(V).forEach(t=>{let r=t.split("."),e=l;for(let n=0;n<r.length;n++){let i=r[n];n===r.length-1?e[i]=V[t]:e=e[i]||(e[i]={})}});var b=[],g=[],Hr=typeof Uint8Array<"u"?Uint8Array:Array,Y=!1;function rr(){Y=!0;for(var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",r=0,e=t.length;r<e;++r)b[r]=t[r],g[t.charCodeAt(r)]=r;g[45]=62,g[95]=63}function Wr(t){Y||rr();var r,e,n,i,o,a,c=t.length;if(c%4>0)throw new Error("Invalid string. Length must be a multiple of 4");o=t[c-2]==="="?2:t[c-1]==="="?1:0,a=new Hr(c*3/4-o),n=o>0?c-4:c;var s=0;for(r=0,e=0;r<n;r+=4,e+=3)i=g[t.charCodeAt(r)]<<18|g[t.charCodeAt(r+1)]<<12|g[t.charCodeAt(r+2)]<<6|g[t.charCodeAt(r+3)],a[s++]=i>>16&255,a[s++]=i>>8&255,a[s++]=i&255;return o===2?(i=g[t.charCodeAt(r)]<<2|g[t.charCodeAt(r+1)]>>4,a[s++]=i&255):o===1&&(i=g[t.charCodeAt(r)]<<10|g[t.charCodeAt(r+1)]<<4|g[t.charCodeAt(r+2)]>>2,a[s++]=i>>8&255,a[s++]=i&255),a}function Vr(t){return b[t>>18&63]+b[t>>12&63]+b[t>>6&63]+b[t&63]}function Xr(t,r,e){for(var n,i=[],o=r;o<e;o+=3)n=(t[o]<<16)+(t[o+1]<<8)+t[o+2],i.push(Vr(n));return i.join("")}function Z(t){Y||rr();for(var r,e=t.length,n=e%3,i="",o=[],a=16383,c=0,s=e-n;c<s;c+=a)o.push(Xr(t,c,c+a>s?s:c+a));return n===1?(r=t[e-1],i+=b[r>>2],i+=b[r<<4&63],i+="=="):n===2&&(r=(t[e-2]<<8)+t[e-1],i+=b[r>>10],i+=b[r>>4&63],i+=b[r<<2&63],i+="="),o.push(i),o.join("")}u.TYPED_ARRAY_SUPPORT=globalThis.TYPED_ARRAY_SUPPORT!==void 0?globalThis.TYPED_ARRAY_SUPPORT:!0;function L(){return u.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function R(t,r){if(L()<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 F(this,t)}return er(this,t,r,e)}u.poolSize=8192;u._augment=function(t){return t.__proto__=u.prototype,t};function er(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?$r(t,r,e,n):typeof r=="string"?qr(t,r,e):Jr(t,r)}u.from=function(t,r,e){return er(null,t,r,e)};u.kMaxLength=L();u.TYPED_ARRAY_SUPPORT&&(u.prototype.__proto__=Uint8Array.prototype,u.__proto__=Uint8Array,typeof Symbol<"u"&&Symbol.species&&u[Symbol.species]);function tr(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 Qr(t,r,e,n){return tr(r),r<=0?R(t,r):e!==void 0?typeof n=="string"?R(t,r).fill(e,n):R(t,r).fill(e):R(t,r)}u.alloc=function(t,r,e){return Qr(null,t,r,e)};function F(t,r){if(tr(r),t=R(t,r<0?0:G(r)|0),!u.TYPED_ARRAY_SUPPORT)for(var e=0;e<r;++e)t[e]=0;return t}u.allocUnsafe=function(t){return F(null,t)};u.allocUnsafeSlow=function(t){return F(null,t)};function qr(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=nr(r,e)|0;t=R(t,n);var i=t.write(r,e);return i!==n&&(t=t.slice(0,i)),t}function k(t,r){var e=r.length<0?0:G(r.length)|0;t=R(t,e);for(var n=0;n<e;n+=1)t[n]=r[n]&255;return t}function $r(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=k(t,r),t}function Jr(t,r){if(A(r)){var e=G(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"||Te(r.length)?R(t,0):k(t,r);if(r.type==="Buffer"&&Array.isArray(r.data))return k(t,r.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function G(t){if(t>=L())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+L().toString(16)+" bytes");return t|0}u.isBuffer=he;function A(t){return!!(t!=null&&t._isBuffer)}u.compare=function(r,e){if(!A(r)||!A(e))throw new TypeError("Arguments must be Buffers");if(r===e)return 0;for(var n=r.length,i=e.length,o=0,a=Math.min(n,i);o<a;++o)if(r[o]!==e[o]){n=r[o],i=e[o];break}return n<i?-1:i<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(!Array.isArray(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 i=u.allocUnsafe(e),o=0;for(n=0;n<r.length;++n){var a=r[n];if(!A(a))throw new TypeError('"list" argument must be an Array of Buffers');a.copy(i,o),o+=a.length}return i};function nr(t,r){if(A(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 C(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return e*2;case"hex":return e>>>1;case"base64":return Er(t).length;default:if(n)return C(t).length;r=(""+r).toLowerCase(),n=!0}}u.byteLength=nr;function Zr(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 ue(this,r,e);case"utf8":case"utf-8":return ar(this,r,e);case"ascii":return oe(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 ce(this,r,e);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}u.prototype._isBuffer=!0;function N(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)N(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)N(this,e,e+3),N(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)N(this,e,e+7),N(this,e+1,e+6),N(this,e+2,e+5),N(this,e+3,e+4);return this};u.prototype.toString=function(){var r=this.length|0;return r===0?"":arguments.length===0?ar(this,0,r):Zr.apply(this,arguments)};u.prototype.equals=function(r){if(!A(r))throw new TypeError("Argument must be a Buffer");return this===r?!0:u.compare(this,r)===0};u.prototype.compare=function(r,e,n,i,o){if(!A(r))throw new TypeError("Argument must be a Buffer");if(e===void 0&&(e=0),n===void 0&&(n=r?r.length:0),i===void 0&&(i=0),o===void 0&&(o=this.length),e<0||n>r.length||i<0||o>this.length)throw new RangeError("out of range index");if(i>=o&&e>=n)return 0;if(i>=o)return-1;if(e>=n)return 1;if(e>>>=0,n>>>=0,i>>>=0,o>>>=0,this===r)return 0;for(var a=o-i,c=n-e,s=Math.min(a,c),f=this.slice(i,o),p=r.slice(e,n),E=0;E<s;++E)if(f[E]!==p[E]){a=f[E],c=p[E];break}return a<c?-1:c<a?1:0};function ir(t,r,e,n,i){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=i?0:t.length-1),e<0&&(e=t.length+e),e>=t.length){if(i)return-1;e=t.length-1}else if(e<0)if(i)e=0;else return-1;if(typeof r=="string"&&(r=u.from(r,n)),A(r))return r.length===0?-1:z(t,r,e,n,i);if(typeof r=="number")return r=r&255,u.TYPED_ARRAY_SUPPORT&&typeof Uint8Array.prototype.indexOf=="function"?i?Uint8Array.prototype.indexOf.call(t,r,e):Uint8Array.prototype.lastIndexOf.call(t,r,e):z(t,[r],e,n,i);throw new TypeError("val must be string, number or Buffer")}function z(t,r,e,n,i){var o=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;o=2,a/=2,c/=2,e/=2}function s(h,O){return o===1?h[O]:h.readUInt16BE(O*o)}var f;if(i){var p=-1;for(f=e;f<a;f++)if(s(t,f)===s(r,p===-1?0:f-p)){if(p===-1&&(p=f),f-p+1===c)return p*o}else p!==-1&&(f-=f-p),p=-1}else for(e+c>a&&(e=a-c),f=e;f>=0;f--){for(var E=!0,m=0;m<c;m++)if(s(t,f+m)!==s(r,m)){E=!1;break}if(E)return f}return-1}u.prototype.includes=function(r,e,n){return this.indexOf(r,e,n)!==-1};u.prototype.indexOf=function(r,e,n){return ir(this,r,e,n,!0)};u.prototype.lastIndexOf=function(r,e,n){return ir(this,r,e,n,!1)};function zr(t,r,e,n){e=Number(e)||0;var i=t.length-e;n?(n=Number(n),n>i&&(n=i)):n=i;var o=r.length;if(o%2!==0)throw new TypeError("Invalid hex string");n>o/2&&(n=o/2);for(var a=0;a<n;++a){var c=parseInt(r.substr(a*2,2),16);if(isNaN(c))return a;t[e+a]=c}return a}function jr(t,r,e,n){return M(C(r,t.length-e),t,e,n)}function or(t,r,e,n){return M(pe(r),t,e,n)}function re(t,r,e,n){return or(t,r,e,n)}function ee(t,r,e,n){return M(Er(r),t,e,n)}function te(t,r,e,n){return M(_e(r,t.length-e),t,e,n)}u.prototype.write=function(r,e,n,i){if(e===void 0)i="utf8",n=this.length,e=0;else if(n===void 0&&typeof e=="string")i=e,n=this.length,e=0;else if(isFinite(e))e=e|0,isFinite(n)?(n=n|0,i===void 0&&(i="utf8")):(i=n,n=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var o=this.length-e;if((n===void 0||n>o)&&(n=o),r.length>0&&(n<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");i||(i="utf8");for(var a=!1;;)switch(i){case"hex":return zr(this,r,e,n);case"utf8":case"utf-8":return jr(this,r,e,n);case"ascii":return or(this,r,e,n);case"latin1":case"binary":return re(this,r,e,n);case"base64":return ee(this,r,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return te(this,r,e,n);default:if(a)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),a=!0}};u.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?Z(t):Z(t.slice(r,e))}function ar(t,r,e){e=Math.min(t.length,e);for(var n=[],i=r;i<e;){var o=t[i],a=null,c=o>239?4:o>223?3:o>191?2:1;if(i+c<=e){var s,f,p,E;switch(c){case 1:o<128&&(a=o);break;case 2:s=t[i+1],(s&192)===128&&(E=(o&31)<<6|s&63,E>127&&(a=E));break;case 3:s=t[i+1],f=t[i+2],(s&192)===128&&(f&192)===128&&(E=(o&15)<<12|(s&63)<<6|f&63,E>2047&&(E<55296||E>57343)&&(a=E));break;case 4:s=t[i+1],f=t[i+2],p=t[i+3],(s&192)===128&&(f&192)===128&&(p&192)===128&&(E=(o&15)<<18|(s&63)<<12|(f&63)<<6|p&63,E>65535&&E<1114112&&(a=E))}}a===null?(a=65533,c=1):a>65535&&(a-=65536,n.push(a>>>10&1023|55296),a=56320|a&1023),n.push(a),i+=c}return ie(n)}var j=4096;function ie(t){var r=t.length;if(r<=j)return String.fromCharCode.apply(String,t);for(var e="",n=0;n<r;)e+=String.fromCharCode.apply(String,t.slice(n,n+=j));return e}function oe(t,r,e){var n="";e=Math.min(t.length,e);for(var i=r;i<e;++i)n+=String.fromCharCode(t[i]&127);return n}function ae(t,r,e){var n="";e=Math.min(t.length,e);for(var i=r;i<e;++i)n+=String.fromCharCode(t[i]);return n}function ue(t,r,e){var n=t.length;(!r||r<0)&&(r=0),(!e||e<0||e>n)&&(e=n);for(var i="",o=r;o<e;++o)i+=fe(t[o]);return i}function ce(t,r,e){for(var n=t.slice(r,e),i="",o=0;o<n.length;o+=2)i+=String.fromCharCode(n[o]+n[o+1]*256);return i}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 i;if(u.TYPED_ARRAY_SUPPORT)i=this.subarray(r,e),i.__proto__=u.prototype;else{var o=e-r;i=new u(o,void 0);for(var a=0;a<o;++a)i[a]=this[a+r]}return i};function _(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||_(r,e,this.length);for(var i=this[r],o=1,a=0;++a<e&&(o*=256);)i+=this[r+a]*o;return i};u.prototype.readUIntBE=function(r,e,n){r=r|0,e=e|0,n||_(r,e,this.length);for(var i=this[r+--e],o=1;e>0&&(o*=256);)i+=this[r+--e]*o;return i};u.prototype.readUInt8=function(r,e){return e||_(r,1,this.length),this[r]};u.prototype.readUInt16LE=function(r,e){return e||_(r,2,this.length),this[r]|this[r+1]<<8};u.prototype.readUInt16BE=function(r,e){return e||_(r,2,this.length),this[r]<<8|this[r+1]};u.prototype.readUInt32LE=function(r,e){return 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||_(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||_(r,e,this.length);for(var i=this[r],o=1,a=0;++a<e&&(o*=256);)i+=this[r+a]*o;return o*=128,i>=o&&(i-=Math.pow(2,8*e)),i};u.prototype.readIntBE=function(r,e,n){r=r|0,e=e|0,n||_(r,e,this.length);for(var i=e,o=1,a=this[r+--i];i>0&&(o*=256);)a+=this[r+--i]*o;return o*=128,a>=o&&(a-=Math.pow(2,8*e)),a};u.prototype.readInt8=function(r,e){return e||_(r,1,this.length),this[r]&128?(255-this[r]+1)*-1:this[r]};u.prototype.readInt16LE=function(r,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||_(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||_(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||_(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||_(r,4,this.length),B(this,r,!0,23,4)};u.prototype.readFloatBE=function(r,e){return e||_(r,4,this.length),B(this,r,!1,23,4)};u.prototype.readDoubleLE=function(r,e){return e||_(r,8,this.length),B(this,r,!0,52,8)};u.prototype.readDoubleBE=function(r,e){return e||_(r,8,this.length),B(this,r,!1,52,8)};function T(t,r,e,n,i,o){if(!A(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(r>i||r<o)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,i){if(r=+r,e=e|0,n=n|0,!i){var o=Math.pow(2,8*n)-1;T(this,r,e,n,o,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,i){if(r=+r,e=e|0,n=n|0,!i){var o=Math.pow(2,8*n)-1;T(this,r,e,n,o,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 v(t,r,e,n){r<0&&(r=65535+r+1);for(var i=0,o=Math.min(t.length-e,2);i<o;++i)t[e+i]=(r&255<<8*(n?i:1-i))>>>(n?i:1-i)*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):v(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):v(this,r,e,!1),e+2};function U(t,r,e,n){r<0&&(r=4294967295+r+1);for(var i=0,o=Math.min(t.length-e,4);i<o;++i)t[e+i]=r>>>(n?i:3-i)*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):U(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):U(this,r,e,!1),e+4};u.prototype.writeIntLE=function(r,e,n,i){if(r=+r,e=e|0,!i){var o=Math.pow(2,8*n-1);T(this,r,e,n,o-1,-o)}var a=0,c=1,s=0;for(this[e]=r&255;++a<n&&(c*=256);)r<0&&s===0&&this[e+a-1]!==0&&(s=1),this[e+a]=(r/c>>0)-s&255;return e+n};u.prototype.writeIntBE=function(r,e,n,i){if(r=+r,e=e|0,!i){var o=Math.pow(2,8*n-1);T(this,r,e,n,o-1,-o)}var a=n-1,c=1,s=0;for(this[e+a]=r&255;--a>=0&&(c*=256);)r<0&&s===0&&this[e+a+1]!==0&&(s=1),this[e+a]=(r/c>>0)-s&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):v(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):v(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):U(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):U(this,r,e,!1),e+4};function ur(t,r,e,n,i,o){if(e+n>t.length)throw new RangeError("Index out of range");if(e<0)throw new RangeError("Index out of range")}function cr(t,r,e,n,i){return i||ur(t,r,e,4,34028234663852886e22,-34028234663852886e22),fr(t,r,e,n,23,4),e+4}u.prototype.writeFloatLE=function(r,e,n){return cr(this,r,e,!0,n)};u.prototype.writeFloatBE=function(r,e,n){return cr(this,r,e,!1,n)};function sr(t,r,e,n,i){return i||ur(t,r,e,8,17976931348623157e292,-17976931348623157e292),fr(t,r,e,n,52,8),e+8}u.prototype.writeDoubleLE=function(r,e,n){return sr(this,r,e,!0,n)};u.prototype.writeDoubleBE=function(r,e,n){return sr(this,r,e,!1,n)};u.prototype.copy=function(r,e,n,i){if(n||(n=0),!i&&i!==0&&(i=this.length),e>=r.length&&(e=r.length),e||(e=0),i>0&&i<n&&(i=n),i===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(i<0)throw new RangeError("sourceEnd out of bounds");i>this.length&&(i=this.length),r.length-e<i-n&&(i=r.length-e+n);var o=i-n,a;if(this===r&&n<e&&e<i)for(a=o-1;a>=0;--a)r[a+e]=this[a+n];else if(o<1e3||!u.TYPED_ARRAY_SUPPORT)for(a=0;a<o;++a)r[a+e]=this[a+n];else Uint8Array.prototype.set.call(r,this.subarray(n,n+o),e);return o};u.prototype.fill=function(r,e,n,i){if(typeof r=="string"){if(typeof e=="string"?(i=e,e=0,n=this.length):typeof n=="string"&&(i=n,n=this.length),r.length===1){var o=r.charCodeAt(0);o<256&&(r=o)}if(i!==void 0&&typeof i!="string")throw new TypeError("encoding must be a string");if(typeof i=="string"&&!u.isEncoding(i))throw new TypeError("Unknown encoding: "+i)}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=A(r)?r:C(new u(r,i).toString()),s=c.length;for(a=0;a<n-e;++a)this[a+e]=c[a%s]}return this};var se=/[^+\/0-9A-Za-z-_]/g;function Ee(t){if(t=le(t).replace(se,""),t.length<2)return"";for(;t.length%4!==0;)t=t+"=";return t}function le(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 C(t,r){r=r||1/0;for(var e,n=t.length,i=null,o=[],a=0;a<n;++a){if(e=t.charCodeAt(a),e>55295&&e<57344){if(!i){if(e>56319){(r-=3)>-1&&o.push(239,191,189);continue}else if(a+1===n){(r-=3)>-1&&o.push(239,191,189);continue}i=e;continue}if(e<56320){(r-=3)>-1&&o.push(239,191,189),i=e;continue}e=(i-55296<<10|e-56320)+65536}else i&&(r-=3)>-1&&o.push(239,191,189);if(i=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 pe(t){for(var r=[],e=0;e<t.length;++e)r.push(t.charCodeAt(e)&255);return r}function _e(t,r){for(var e,n,i,o=[],a=0;a<t.length&&!((r-=2)<0);++a)e=t.charCodeAt(a),n=e>>8,i=e%256,o.push(i),o.push(n);return o}function Er(t){return Wr(Ee(t))}function M(t,r,e,n){for(var i=0;i<n&&!(i+e>=r.length||i>=t.length);++i)r[i+e]=t[i];return i}function Te(t){return t!==t}function he(t){return t!=null&&(!!t._isBuffer||lr(t)||ge(t))}function lr(t){return!!t.constructor&&typeof t.constructor.isBuffer=="function"&&t.constructor.isBuffer(t)}function ge(t){return typeof t.readFloatLE=="function"&&typeof t.slice=="function"&&lr(t.slice(0,0))}function B(t,r,e,n,i){var o,a,c=i*8-n-1,s=(1<<c)-1,f=s>>1,p=-7,E=e?i-1:0,m=e?-1:1,h=t[r+E];for(E+=m,o=h&(1<<-p)-1,h>>=-p,p+=c;p>0;o=o*256+t[r+E],E+=m,p-=8);for(a=o&(1<<-p)-1,o>>=-p,p+=n;p>0;a=a*256+t[r+E],E+=m,p-=8);if(o===0)o=1-f;else{if(o===s)return a?NaN:(h?-1:1)*(1/0);a=a+Math.pow(2,n),o=o-f}return(h?-1:1)*a*Math.pow(2,o-n)}function fr(t,r,e,n,i,o){var a,c,s,f=o*8-i-1,p=(1<<f)-1,E=p>>1,m=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,h=n?0:o-1,O=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=p):(a=Math.floor(Math.log(r)/Math.LN2),r*(s=Math.pow(2,-a))<1&&(a--,s*=2),a+E>=1?r+=m/s:r+=m*Math.pow(2,1-E),r*s>=2&&(a++,s/=2),a+E>=p?(c=0,a=p):a+E>=1?(c=(r*s-1)*Math.pow(2,i),a=a+E):(c=r*Math.pow(2,E-1)*Math.pow(2,i),a=0));i>=8;t[e+h]=c&255,h+=O,c/=256,i-=8);for(a=a<<i|c,f+=i;f>0;t[e+h]=a&255,h+=O,a/=256,f-=8);t[e+h-O]|=Tr*128}import K from"bignumber.js";K.config({DECIMAL_PLACES:40,EXPONENTIAL_AT:45});function pr(t,r){return _r(t,r,"*")}function H(t,r){return _r(t,r,"/")}function _r(t,r,e){switch(t=new K(String(t)),r=new K(String(r)),e.toLowerCase()){case"-":return t.minus(r).toString();case"+":return t.plus(r).toString();case"*":case"x":return t.multipliedBy(r).toString();case"\xF7":case"/":return t.dividedBy(r).toString();case">=":return t.isGreaterThanOrEqualTo(r);case">":return t.isGreaterThan(r);case"<=":return t.isLessThanOrEqualTo(r);case"<":return t.isLessThan(r);case"==":return t.isEqualTo(r);case"mod":return t.modulo(r);default:break}}var Fe={SMALLESTUNIT:l.env.SMALLEST_UNIT},Ge={SMALLEST_UNITS:l.env.SMALLEST_UNIT};var Ve=`{"theme1":{"value":"${l.env.FRONTEND_URL}/Theme%3DDark.svg","active":true},"theme2":{"value":"${l.env.FRONTEND_URL}/Theme%3DLight.svg","active":true},"theme3":{"value":"${l.env.FRONTEND_URL}/Theme%3DLight.svg","active":true}}`;var Ze=["point-system.discordEnabled","point-system.telegramBotName","point-system.telegramBotId","point-system.telegramEnabled","point-system.telegramGroupId","point-system.telegramGroupName","point-system.twitterAccountId","point-system.twitterAccountName","point-system.twitterEnabled","point-system.twitterJobEnabled","point-system.guideLink"];var it=l.env.REACT_APP_API_URL,ot=l.env.REACT_APP_SOCKET_URL,at=l.env.REACT_APP_ALGO_SERVER,ut=l.env.REACT_APP_ALGO_SERVER_PORT||"",ct=l.env.REACT_APP_ALGOD_TOKEN||"",st=l.env.REACT_APP_DISPENSER_LINK,Et=l.env.REACT_APP_FRONTEND_LINK||"",lt=l.env.REACT_APP_ALGO_EXPLORER_LINK,ft=l.env.REACT_APP_ALGO_EXPLORER_ASSETS_URL,pt=(l.env.REACT_APP_REQUIRE_ACCESS_CODE||"").toLowerCase()==="true",_t=l.env.REACT_APP_USERBACK_ACCESS_TOKEN,Tt=(l.env.REACT_APP_EXT_ORDER_TYPES||"").toLowerCase()==="true";var ht=.001*10**6,gt=.002*10**6;var mt=l.env.REACT_APP_MASTER_APP_ID||"406",bt=l.env.REACT_APP_AGG_APP_ID||"408",me=Number(l.env.REACT_APP_CODEX_APP_ID||"467960617");console.log("CODEX_APP_ID",me);var be=l.env.REACT_APP_ALGO_NETWORK||"";var At=be.toLowerCase()==="mainnet"?"mainnet":"testnet";var Mt=t=>pr(t,10**18),Bt=(t,r)=>H(t,10**(18-r)),Ae=(t,r)=>H(t,10**r),kt=t=>Ae(t,18);export{Bt as defactorPrice,Mt as factorPrice,Ae as toDecimal,kt as toDecimalPrice};
|
|
1
|
+
function X(){throw new Error("setTimeout has not been defined")}function Q(){throw new Error("clearTimeout has not been defined")}var x=X,I=Q;typeof globalThis.setTimeout=="function"&&(x=setTimeout);typeof globalThis.clearTimeout=="function"&&(I=clearTimeout);function q(t){if(x===setTimeout)return setTimeout(t,0);if((x===X||!x)&&setTimeout)return x=setTimeout,setTimeout(t,0);try{return x(t,0)}catch{try{return x.call(null,t,0)}catch{return x.call(this,t,0)}}}function Tr(t){if(I===clearTimeout)return clearTimeout(t);if((I===Q||!I)&&clearTimeout)return I=clearTimeout,clearTimeout(t);try{return I(t)}catch{try{return I.call(null,t)}catch{return I.call(this,t)}}}var A=[],P=!1,w,D=-1;function gr(){!P||!w||(P=!1,w.length?A=w.concat(A):D=-1,A.length&&$())}function $(){if(!P){var t=q(gr);P=!0;for(var r=A.length;r;){for(w=A,A=[];++D<r;)w&&w[D].run();D=-1,r=A.length}w=null,P=!1,Tr(t)}}function br(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];A.push(new J(t,r)),A.length===1&&!P&&q($)}function J(t,r){this.fun=t,this.array=r}J.prototype.run=function(){this.fun.apply(null,this.array)};var mr="browser",dr="browser",Ar=!0,Rr={},xr=[],Ir="",wr={},Sr={},Nr={};function S(){}var Or=S,yr=S,Pr=S,Dr=S,Lr=S,Cr=S,vr=S;function Ur(t){throw new Error("process.binding is not supported")}function Mr(){return"/"}function Br(t){throw new Error("process.chdir is not supported")}function kr(){return 0}var y=globalThis.performance||{},Yr=y.now||y.mozNow||y.msNow||y.oNow||y.webkitNow||function(){return new Date().getTime()};function Fr(t){var r=Yr.call(y)*.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 Gr=new Date;function Kr(){var t=new Date,r=t-Gr;return r/1e3}var E={nextTick:br,title:mr,browser:Ar,env:Rr,argv:xr,version:Ir,versions:wr,on:Or,addListener:yr,once:Pr,off:Dr,removeListener:Lr,removeAllListeners:Cr,emit:vr,binding:Ur,cwd:Mr,chdir:Br,umask:kr,hrtime:Fr,platform:dr,release:Sr,config:Nr,uptime:Kr},V={};Object.keys(V).forEach(t=>{let r=t.split("."),e=E;for(let n=0;n<r.length;n++){let i=r[n];n===r.length-1?e[i]=V[t]:e=e[i]||(e[i]={})}});var m=[],g=[],Hr=typeof Uint8Array<"u"?Uint8Array:Array,Y=!1;function rr(){Y=!0;for(var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",r=0,e=t.length;r<e;++r)m[r]=t[r],g[t.charCodeAt(r)]=r;g[45]=62,g[95]=63}function Wr(t){Y||rr();var r,e,n,i,o,a,c=t.length;if(c%4>0)throw new Error("Invalid string. Length must be a multiple of 4");o=t[c-2]==="="?2:t[c-1]==="="?1:0,a=new Hr(c*3/4-o),n=o>0?c-4:c;var s=0;for(r=0,e=0;r<n;r+=4,e+=3)i=g[t.charCodeAt(r)]<<18|g[t.charCodeAt(r+1)]<<12|g[t.charCodeAt(r+2)]<<6|g[t.charCodeAt(r+3)],a[s++]=i>>16&255,a[s++]=i>>8&255,a[s++]=i&255;return o===2?(i=g[t.charCodeAt(r)]<<2|g[t.charCodeAt(r+1)]>>4,a[s++]=i&255):o===1&&(i=g[t.charCodeAt(r)]<<10|g[t.charCodeAt(r+1)]<<4|g[t.charCodeAt(r+2)]>>2,a[s++]=i>>8&255,a[s++]=i&255),a}function Vr(t){return m[t>>18&63]+m[t>>12&63]+m[t>>6&63]+m[t&63]}function Xr(t,r,e){for(var n,i=[],o=r;o<e;o+=3)n=(t[o]<<16)+(t[o+1]<<8)+t[o+2],i.push(Vr(n));return i.join("")}function Z(t){Y||rr();for(var r,e=t.length,n=e%3,i="",o=[],a=16383,c=0,s=e-n;c<s;c+=a)o.push(Xr(t,c,c+a>s?s:c+a));return n===1?(r=t[e-1],i+=m[r>>2],i+=m[r<<4&63],i+="=="):n===2&&(r=(t[e-2]<<8)+t[e-1],i+=m[r>>10],i+=m[r>>4&63],i+=m[r<<2&63],i+="="),o.push(i),o.join("")}u.TYPED_ARRAY_SUPPORT=globalThis.TYPED_ARRAY_SUPPORT!==void 0?globalThis.TYPED_ARRAY_SUPPORT:!0;function L(){return u.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function R(t,r){if(L()<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 F(this,t)}return er(this,t,r,e)}u.poolSize=8192;u._augment=function(t){return t.__proto__=u.prototype,t};function er(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?$r(t,r,e,n):typeof r=="string"?qr(t,r,e):Jr(t,r)}u.from=function(t,r,e){return er(null,t,r,e)};u.kMaxLength=L();u.TYPED_ARRAY_SUPPORT&&(u.prototype.__proto__=Uint8Array.prototype,u.__proto__=Uint8Array,typeof Symbol<"u"&&Symbol.species&&u[Symbol.species]);function tr(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 Qr(t,r,e,n){return tr(r),r<=0?R(t,r):e!==void 0?typeof n=="string"?R(t,r).fill(e,n):R(t,r).fill(e):R(t,r)}u.alloc=function(t,r,e){return Qr(null,t,r,e)};function F(t,r){if(tr(r),t=R(t,r<0?0:G(r)|0),!u.TYPED_ARRAY_SUPPORT)for(var e=0;e<r;++e)t[e]=0;return t}u.allocUnsafe=function(t){return F(null,t)};u.allocUnsafeSlow=function(t){return F(null,t)};function qr(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=nr(r,e)|0;t=R(t,n);var i=t.write(r,e);return i!==n&&(t=t.slice(0,i)),t}function k(t,r){var e=r.length<0?0:G(r.length)|0;t=R(t,e);for(var n=0;n<e;n+=1)t[n]=r[n]&255;return t}function $r(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=k(t,r),t}function Jr(t,r){if(d(r)){var e=G(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"||he(r.length)?R(t,0):k(t,r);if(r.type==="Buffer"&&Array.isArray(r.data))return k(t,r.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function G(t){if(t>=L())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+L().toString(16)+" bytes");return t|0}u.isBuffer=Te;function d(t){return!!(t!=null&&t._isBuffer)}u.compare=function(r,e){if(!d(r)||!d(e))throw new TypeError("Arguments must be Buffers");if(r===e)return 0;for(var n=r.length,i=e.length,o=0,a=Math.min(n,i);o<a;++o)if(r[o]!==e[o]){n=r[o],i=e[o];break}return n<i?-1:i<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(!Array.isArray(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 i=u.allocUnsafe(e),o=0;for(n=0;n<r.length;++n){var a=r[n];if(!d(a))throw new TypeError('"list" argument must be an Array of Buffers');a.copy(i,o),o+=a.length}return i};function nr(t,r){if(d(t))return t.length;if(typeof ArrayBuffer<"u"&&typeof ArrayBuffer.isView=="function"&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;typeof t!="string"&&(t=""+t);var 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 C(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return e*2;case"hex":return e>>>1;case"base64":return lr(t).length;default:if(n)return C(t).length;r=(""+r).toLowerCase(),n=!0}}u.byteLength=nr;function Zr(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 ue(this,r,e);case"utf8":case"utf-8":return ar(this,r,e);case"ascii":return oe(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 ce(this,r,e);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}u.prototype._isBuffer=!0;function N(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)N(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)N(this,e,e+3),N(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)N(this,e,e+7),N(this,e+1,e+6),N(this,e+2,e+5),N(this,e+3,e+4);return this};u.prototype.toString=function(){var r=this.length|0;return r===0?"":arguments.length===0?ar(this,0,r):Zr.apply(this,arguments)};u.prototype.equals=function(r){if(!d(r))throw new TypeError("Argument must be a Buffer");return this===r?!0:u.compare(this,r)===0};u.prototype.compare=function(r,e,n,i,o){if(!d(r))throw new TypeError("Argument must be a Buffer");if(e===void 0&&(e=0),n===void 0&&(n=r?r.length:0),i===void 0&&(i=0),o===void 0&&(o=this.length),e<0||n>r.length||i<0||o>this.length)throw new RangeError("out of range index");if(i>=o&&e>=n)return 0;if(i>=o)return-1;if(e>=n)return 1;if(e>>>=0,n>>>=0,i>>>=0,o>>>=0,this===r)return 0;for(var a=o-i,c=n-e,s=Math.min(a,c),f=this.slice(i,o),p=r.slice(e,n),l=0;l<s;++l)if(f[l]!==p[l]){a=f[l],c=p[l];break}return a<c?-1:c<a?1:0};function ir(t,r,e,n,i){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=i?0:t.length-1),e<0&&(e=t.length+e),e>=t.length){if(i)return-1;e=t.length-1}else if(e<0)if(i)e=0;else return-1;if(typeof r=="string"&&(r=u.from(r,n)),d(r))return r.length===0?-1:z(t,r,e,n,i);if(typeof r=="number")return r=r&255,u.TYPED_ARRAY_SUPPORT&&typeof Uint8Array.prototype.indexOf=="function"?i?Uint8Array.prototype.indexOf.call(t,r,e):Uint8Array.prototype.lastIndexOf.call(t,r,e):z(t,[r],e,n,i);throw new TypeError("val must be string, number or Buffer")}function z(t,r,e,n,i){var o=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;o=2,a/=2,c/=2,e/=2}function s(T,O){return o===1?T[O]:T.readUInt16BE(O*o)}var f;if(i){var p=-1;for(f=e;f<a;f++)if(s(t,f)===s(r,p===-1?0:f-p)){if(p===-1&&(p=f),f-p+1===c)return p*o}else p!==-1&&(f-=f-p),p=-1}else for(e+c>a&&(e=a-c),f=e;f>=0;f--){for(var l=!0,b=0;b<c;b++)if(s(t,f+b)!==s(r,b)){l=!1;break}if(l)return f}return-1}u.prototype.includes=function(r,e,n){return this.indexOf(r,e,n)!==-1};u.prototype.indexOf=function(r,e,n){return ir(this,r,e,n,!0)};u.prototype.lastIndexOf=function(r,e,n){return ir(this,r,e,n,!1)};function zr(t,r,e,n){e=Number(e)||0;var i=t.length-e;n?(n=Number(n),n>i&&(n=i)):n=i;var o=r.length;if(o%2!==0)throw new TypeError("Invalid hex string");n>o/2&&(n=o/2);for(var a=0;a<n;++a){var c=parseInt(r.substr(a*2,2),16);if(isNaN(c))return a;t[e+a]=c}return a}function jr(t,r,e,n){return M(C(r,t.length-e),t,e,n)}function or(t,r,e,n){return M(pe(r),t,e,n)}function re(t,r,e,n){return or(t,r,e,n)}function ee(t,r,e,n){return M(lr(r),t,e,n)}function te(t,r,e,n){return M(_e(r,t.length-e),t,e,n)}u.prototype.write=function(r,e,n,i){if(e===void 0)i="utf8",n=this.length,e=0;else if(n===void 0&&typeof e=="string")i=e,n=this.length,e=0;else if(isFinite(e))e=e|0,isFinite(n)?(n=n|0,i===void 0&&(i="utf8")):(i=n,n=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var o=this.length-e;if((n===void 0||n>o)&&(n=o),r.length>0&&(n<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");i||(i="utf8");for(var a=!1;;)switch(i){case"hex":return zr(this,r,e,n);case"utf8":case"utf-8":return jr(this,r,e,n);case"ascii":return or(this,r,e,n);case"latin1":case"binary":return re(this,r,e,n);case"base64":return ee(this,r,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return te(this,r,e,n);default:if(a)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),a=!0}};u.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?Z(t):Z(t.slice(r,e))}function ar(t,r,e){e=Math.min(t.length,e);for(var n=[],i=r;i<e;){var o=t[i],a=null,c=o>239?4:o>223?3:o>191?2:1;if(i+c<=e){var s,f,p,l;switch(c){case 1:o<128&&(a=o);break;case 2:s=t[i+1],(s&192)===128&&(l=(o&31)<<6|s&63,l>127&&(a=l));break;case 3:s=t[i+1],f=t[i+2],(s&192)===128&&(f&192)===128&&(l=(o&15)<<12|(s&63)<<6|f&63,l>2047&&(l<55296||l>57343)&&(a=l));break;case 4:s=t[i+1],f=t[i+2],p=t[i+3],(s&192)===128&&(f&192)===128&&(p&192)===128&&(l=(o&15)<<18|(s&63)<<12|(f&63)<<6|p&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),i+=c}return ie(n)}var j=4096;function ie(t){var r=t.length;if(r<=j)return String.fromCharCode.apply(String,t);for(var e="",n=0;n<r;)e+=String.fromCharCode.apply(String,t.slice(n,n+=j));return e}function oe(t,r,e){var n="";e=Math.min(t.length,e);for(var i=r;i<e;++i)n+=String.fromCharCode(t[i]&127);return n}function ae(t,r,e){var n="";e=Math.min(t.length,e);for(var i=r;i<e;++i)n+=String.fromCharCode(t[i]);return n}function ue(t,r,e){var n=t.length;(!r||r<0)&&(r=0),(!e||e<0||e>n)&&(e=n);for(var i="",o=r;o<e;++o)i+=fe(t[o]);return i}function ce(t,r,e){for(var n=t.slice(r,e),i="",o=0;o<n.length;o+=2)i+=String.fromCharCode(n[o]+n[o+1]*256);return i}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 i;if(u.TYPED_ARRAY_SUPPORT)i=this.subarray(r,e),i.__proto__=u.prototype;else{var o=e-r;i=new u(o,void 0);for(var a=0;a<o;++a)i[a]=this[a+r]}return i};function _(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||_(r,e,this.length);for(var i=this[r],o=1,a=0;++a<e&&(o*=256);)i+=this[r+a]*o;return i};u.prototype.readUIntBE=function(r,e,n){r=r|0,e=e|0,n||_(r,e,this.length);for(var i=this[r+--e],o=1;e>0&&(o*=256);)i+=this[r+--e]*o;return i};u.prototype.readUInt8=function(r,e){return e||_(r,1,this.length),this[r]};u.prototype.readUInt16LE=function(r,e){return e||_(r,2,this.length),this[r]|this[r+1]<<8};u.prototype.readUInt16BE=function(r,e){return e||_(r,2,this.length),this[r]<<8|this[r+1]};u.prototype.readUInt32LE=function(r,e){return 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||_(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||_(r,e,this.length);for(var i=this[r],o=1,a=0;++a<e&&(o*=256);)i+=this[r+a]*o;return o*=128,i>=o&&(i-=Math.pow(2,8*e)),i};u.prototype.readIntBE=function(r,e,n){r=r|0,e=e|0,n||_(r,e,this.length);for(var i=e,o=1,a=this[r+--i];i>0&&(o*=256);)a+=this[r+--i]*o;return o*=128,a>=o&&(a-=Math.pow(2,8*e)),a};u.prototype.readInt8=function(r,e){return e||_(r,1,this.length),this[r]&128?(255-this[r]+1)*-1:this[r]};u.prototype.readInt16LE=function(r,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||_(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||_(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||_(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||_(r,4,this.length),B(this,r,!0,23,4)};u.prototype.readFloatBE=function(r,e){return e||_(r,4,this.length),B(this,r,!1,23,4)};u.prototype.readDoubleLE=function(r,e){return e||_(r,8,this.length),B(this,r,!0,52,8)};u.prototype.readDoubleBE=function(r,e){return e||_(r,8,this.length),B(this,r,!1,52,8)};function h(t,r,e,n,i,o){if(!d(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(r>i||r<o)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,i){if(r=+r,e=e|0,n=n|0,!i){var o=Math.pow(2,8*n)-1;h(this,r,e,n,o,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,i){if(r=+r,e=e|0,n=n|0,!i){var o=Math.pow(2,8*n)-1;h(this,r,e,n,o,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||h(this,r,e,1,255,0),u.TYPED_ARRAY_SUPPORT||(r=Math.floor(r)),this[e]=r&255,e+1};function v(t,r,e,n){r<0&&(r=65535+r+1);for(var i=0,o=Math.min(t.length-e,2);i<o;++i)t[e+i]=(r&255<<8*(n?i:1-i))>>>(n?i:1-i)*8}u.prototype.writeUInt16LE=function(r,e,n){return r=+r,e=e|0,n||h(this,r,e,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[e]=r&255,this[e+1]=r>>>8):v(this,r,e,!0),e+2};u.prototype.writeUInt16BE=function(r,e,n){return r=+r,e=e|0,n||h(this,r,e,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[e]=r>>>8,this[e+1]=r&255):v(this,r,e,!1),e+2};function U(t,r,e,n){r<0&&(r=4294967295+r+1);for(var i=0,o=Math.min(t.length-e,4);i<o;++i)t[e+i]=r>>>(n?i:3-i)*8&255}u.prototype.writeUInt32LE=function(r,e,n){return r=+r,e=e|0,n||h(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):U(this,r,e,!0),e+4};u.prototype.writeUInt32BE=function(r,e,n){return r=+r,e=e|0,n||h(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):U(this,r,e,!1),e+4};u.prototype.writeIntLE=function(r,e,n,i){if(r=+r,e=e|0,!i){var o=Math.pow(2,8*n-1);h(this,r,e,n,o-1,-o)}var a=0,c=1,s=0;for(this[e]=r&255;++a<n&&(c*=256);)r<0&&s===0&&this[e+a-1]!==0&&(s=1),this[e+a]=(r/c>>0)-s&255;return e+n};u.prototype.writeIntBE=function(r,e,n,i){if(r=+r,e=e|0,!i){var o=Math.pow(2,8*n-1);h(this,r,e,n,o-1,-o)}var a=n-1,c=1,s=0;for(this[e+a]=r&255;--a>=0&&(c*=256);)r<0&&s===0&&this[e+a+1]!==0&&(s=1),this[e+a]=(r/c>>0)-s&255;return e+n};u.prototype.writeInt8=function(r,e,n){return r=+r,e=e|0,n||h(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||h(this,r,e,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[e]=r&255,this[e+1]=r>>>8):v(this,r,e,!0),e+2};u.prototype.writeInt16BE=function(r,e,n){return r=+r,e=e|0,n||h(this,r,e,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[e]=r>>>8,this[e+1]=r&255):v(this,r,e,!1),e+2};u.prototype.writeInt32LE=function(r,e,n){return r=+r,e=e|0,n||h(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):U(this,r,e,!0),e+4};u.prototype.writeInt32BE=function(r,e,n){return r=+r,e=e|0,n||h(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):U(this,r,e,!1),e+4};function ur(t,r,e,n,i,o){if(e+n>t.length)throw new RangeError("Index out of range");if(e<0)throw new RangeError("Index out of range")}function cr(t,r,e,n,i){return i||ur(t,r,e,4,34028234663852886e22,-34028234663852886e22),fr(t,r,e,n,23,4),e+4}u.prototype.writeFloatLE=function(r,e,n){return cr(this,r,e,!0,n)};u.prototype.writeFloatBE=function(r,e,n){return cr(this,r,e,!1,n)};function sr(t,r,e,n,i){return i||ur(t,r,e,8,17976931348623157e292,-17976931348623157e292),fr(t,r,e,n,52,8),e+8}u.prototype.writeDoubleLE=function(r,e,n){return sr(this,r,e,!0,n)};u.prototype.writeDoubleBE=function(r,e,n){return sr(this,r,e,!1,n)};u.prototype.copy=function(r,e,n,i){if(n||(n=0),!i&&i!==0&&(i=this.length),e>=r.length&&(e=r.length),e||(e=0),i>0&&i<n&&(i=n),i===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(i<0)throw new RangeError("sourceEnd out of bounds");i>this.length&&(i=this.length),r.length-e<i-n&&(i=r.length-e+n);var o=i-n,a;if(this===r&&n<e&&e<i)for(a=o-1;a>=0;--a)r[a+e]=this[a+n];else if(o<1e3||!u.TYPED_ARRAY_SUPPORT)for(a=0;a<o;++a)r[a+e]=this[a+n];else Uint8Array.prototype.set.call(r,this.subarray(n,n+o),e);return o};u.prototype.fill=function(r,e,n,i){if(typeof r=="string"){if(typeof e=="string"?(i=e,e=0,n=this.length):typeof n=="string"&&(i=n,n=this.length),r.length===1){var o=r.charCodeAt(0);o<256&&(r=o)}if(i!==void 0&&typeof i!="string")throw new TypeError("encoding must be a string");if(typeof i=="string"&&!u.isEncoding(i))throw new TypeError("Unknown encoding: "+i)}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=d(r)?r:C(new u(r,i).toString()),s=c.length;for(a=0;a<n-e;++a)this[a+e]=c[a%s]}return this};var se=/[^+\/0-9A-Za-z-_]/g;function le(t){if(t=Ee(t).replace(se,""),t.length<2)return"";for(;t.length%4!==0;)t=t+"=";return t}function Ee(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 C(t,r){r=r||1/0;for(var e,n=t.length,i=null,o=[],a=0;a<n;++a){if(e=t.charCodeAt(a),e>55295&&e<57344){if(!i){if(e>56319){(r-=3)>-1&&o.push(239,191,189);continue}else if(a+1===n){(r-=3)>-1&&o.push(239,191,189);continue}i=e;continue}if(e<56320){(r-=3)>-1&&o.push(239,191,189),i=e;continue}e=(i-55296<<10|e-56320)+65536}else i&&(r-=3)>-1&&o.push(239,191,189);if(i=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 pe(t){for(var r=[],e=0;e<t.length;++e)r.push(t.charCodeAt(e)&255);return r}function _e(t,r){for(var e,n,i,o=[],a=0;a<t.length&&!((r-=2)<0);++a)e=t.charCodeAt(a),n=e>>8,i=e%256,o.push(i),o.push(n);return o}function lr(t){return Wr(le(t))}function M(t,r,e,n){for(var i=0;i<n&&!(i+e>=r.length||i>=t.length);++i)r[i+e]=t[i];return i}function he(t){return t!==t}function Te(t){return t!=null&&(!!t._isBuffer||Er(t)||ge(t))}function Er(t){return!!t.constructor&&typeof t.constructor.isBuffer=="function"&&t.constructor.isBuffer(t)}function ge(t){return typeof t.readFloatLE=="function"&&typeof t.slice=="function"&&Er(t.slice(0,0))}function B(t,r,e,n,i){var o,a,c=i*8-n-1,s=(1<<c)-1,f=s>>1,p=-7,l=e?i-1:0,b=e?-1:1,T=t[r+l];for(l+=b,o=T&(1<<-p)-1,T>>=-p,p+=c;p>0;o=o*256+t[r+l],l+=b,p-=8);for(a=o&(1<<-p)-1,o>>=-p,p+=n;p>0;a=a*256+t[r+l],l+=b,p-=8);if(o===0)o=1-f;else{if(o===s)return a?NaN:(T?-1:1)*(1/0);a=a+Math.pow(2,n),o=o-f}return(T?-1:1)*a*Math.pow(2,o-n)}function fr(t,r,e,n,i,o){var a,c,s,f=o*8-i-1,p=(1<<f)-1,l=p>>1,b=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,T=n?0:o-1,O=n?1:-1,hr=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=p):(a=Math.floor(Math.log(r)/Math.LN2),r*(s=Math.pow(2,-a))<1&&(a--,s*=2),a+l>=1?r+=b/s:r+=b*Math.pow(2,1-l),r*s>=2&&(a++,s/=2),a+l>=p?(c=0,a=p):a+l>=1?(c=(r*s-1)*Math.pow(2,i),a=a+l):(c=r*Math.pow(2,l-1)*Math.pow(2,i),a=0));i>=8;t[e+T]=c&255,T+=O,c/=256,i-=8);for(a=a<<i|c,f+=i;f>0;t[e+T]=a&255,T+=O,a/=256,f-=8);t[e+T-O]|=hr*128}import K from"bignumber.js";K.config({DECIMAL_PLACES:40,EXPONENTIAL_AT:45});function pr(t,r){return _r(t,r,"*")}function H(t,r){return _r(t,r,"/")}function _r(t,r,e){switch(t=new K(String(t)),r=new K(String(r)),e.toLowerCase()){case"-":return t.minus(r).toString();case"+":return t.plus(r).toString();case"*":case"x":return t.multipliedBy(r).toString();case"\xF7":case"/":return t.dividedBy(r).toString();case">=":return t.isGreaterThanOrEqualTo(r);case">":return t.isGreaterThan(r);case"<=":return t.isLessThanOrEqualTo(r);case"<":return t.isLessThan(r);case"==":return t.isEqualTo(r);case"mod":return t.modulo(r);default:break}}var Fe={SMALLESTUNIT:E.env.SMALLEST_UNIT},Ge={SMALLEST_UNITS:E.env.SMALLEST_UNIT};var Ve=`{"theme1":{"value":"${E.env.FRONTEND_URL}/Theme%3DDark.svg","active":true},"theme2":{"value":"${E.env.FRONTEND_URL}/Theme%3DLight.svg","active":true},"theme3":{"value":"${E.env.FRONTEND_URL}/Theme%3DLight.svg","active":true}}`;var Ze=["point-system.discordEnabled","point-system.telegramBotName","point-system.telegramBotId","point-system.telegramEnabled","point-system.telegramGroupId","point-system.telegramGroupName","point-system.twitterAccountId","point-system.twitterAccountName","point-system.twitterEnabled","point-system.twitterJobEnabled","point-system.guideLink"];var it=E.env.REACT_APP_API_URL,ot=E.env.REACT_APP_SOCKET_URL,at=E.env.REACT_APP_ALGO_SERVER,ut=E.env.REACT_APP_ALGO_SERVER_PORT||"",ct=E.env.REACT_APP_ALGOD_TOKEN||"",st=E.env.REACT_APP_DISPENSER_LINK,lt=E.env.REACT_APP_FRONTEND_LINK||"",Et=E.env.REACT_APP_ALGO_EXPLORER_LINK,ft=E.env.REACT_APP_ALGO_EXPLORER_ASSETS_URL,pt=(E.env.REACT_APP_REQUIRE_ACCESS_CODE||"").toLowerCase()==="true",_t=E.env.REACT_APP_USERBACK_ACCESS_TOKEN,ht=(E.env.REACT_APP_EXT_ORDER_TYPES||"").toLowerCase()==="true";var Tt=.001*10**6,gt=.002*10**6;var bt=E.env.REACT_APP_MASTER_APP_ID||"406",mt=E.env.REACT_APP_AGG_APP_ID||"408",be=Number(E.env.REACT_APP_CODEX_APP_ID||"467960617");console.log("CODEX_APP_ID",be);var me=E.env.REACT_APP_ALGO_NETWORK||"";var dt=me.toLowerCase()==="mainnet"?"mainnet":"testnet";var Mt=t=>pr(t,10**18),Bt=(t,r)=>H(t,10**(18-r)),de=(t,r)=>H(t,10**r),kt=t=>de(t,18);export{Bt as defactorPrice,Mt as factorPrice,de as toDecimal,kt as toDecimalPrice};
|
|
2
2
|
/*! Bundled license information:
|
|
3
3
|
|
|
4
4
|
@esbuild-plugins/node-globals-polyfill/Buffer.js:
|