@ultrade/shared 1.0.19 → 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.
Files changed (161) hide show
  1. package/dist/browser/constants/index.js +1 -1
  2. package/dist/browser/helpers/assert.helper.js +1 -1
  3. package/dist/browser/helpers/atomic.helper.js +1 -1
  4. package/dist/browser/helpers/balance.helper.js +1 -1
  5. package/dist/browser/helpers/codex/common.helper.js +2 -2
  6. package/dist/browser/helpers/codex/index.js +2 -2
  7. package/dist/browser/helpers/codex/mbr.helper.js +1 -1
  8. package/dist/browser/helpers/codex/mna.helper.js +1 -1
  9. package/dist/browser/helpers/codex/order.helper.js +1 -1
  10. package/dist/browser/helpers/codex/setGlobal.helper.js +1 -1
  11. package/dist/browser/helpers/codex/transfer.helper.js +2 -2
  12. package/dist/browser/helpers/codex/txn.helper.js +1 -1
  13. package/dist/browser/helpers/codex.helper.js +6 -6
  14. package/dist/browser/helpers/eth.helper.js +2 -2
  15. package/dist/browser/helpers/index.js +1 -1
  16. package/dist/browser/helpers/pointSystem.helper.js +1 -1
  17. package/dist/browser/helpers/withdraw.helper.js +2 -2
  18. package/dist/browser/types/index.js +1 -1
  19. package/dist/node/constants/index.js +1 -1
  20. package/dist/node/helpers/algo.helper.js +1 -1
  21. package/dist/node/helpers/assert.helper.js +1 -1
  22. package/dist/node/helpers/atomic.helper.js +1 -1
  23. package/dist/node/helpers/balance.helper.js +1 -1
  24. package/dist/node/helpers/codex/common.helper.js +2 -2
  25. package/dist/node/helpers/codex/index.js +2 -2
  26. package/dist/node/helpers/codex/mbr.helper.js +1 -1
  27. package/dist/node/helpers/codex/mna.helper.js +1 -1
  28. package/dist/node/helpers/codex/order.helper.js +1 -1
  29. package/dist/node/helpers/codex/setGlobal.helper.js +1 -1
  30. package/dist/node/helpers/codex/transfer.helper.js +2 -2
  31. package/dist/node/helpers/codex/txn.helper.js +1 -1
  32. package/dist/node/helpers/codex.helper.js +6 -6
  33. package/dist/node/helpers/eth.helper.js +2 -2
  34. package/dist/node/helpers/index.js +1 -1
  35. package/dist/node/helpers/pointSystem.helper.js +1 -1
  36. package/dist/node/helpers/withdraw.helper.js +2 -2
  37. package/dist/node/types/index.js +1 -1
  38. package/dist/src/constants/frontend.d.ts +33 -0
  39. package/dist/{constants → src/constants}/index.d.ts +1 -0
  40. package/dist/{types → src/types}/settings.type.d.ts +39 -3
  41. package/package.json +1 -1
  42. /package/dist/{common → src/common}/auth.helper.d.ts +0 -0
  43. /package/dist/{common → src/common}/big-number.helper.d.ts +0 -0
  44. /package/dist/{common → src/common}/index.d.ts +0 -0
  45. /package/dist/{common → src/common}/mappers/codexAsset.mapper.d.ts +0 -0
  46. /package/dist/{common → src/common}/mappers/codexBalance.mapper.d.ts +0 -0
  47. /package/dist/{common → src/common}/mappers/index.d.ts +0 -0
  48. /package/dist/{common → src/common}/mappers/trade.mapper.d.ts +0 -0
  49. /package/dist/{common → src/common}/utils/assert.d.ts +0 -0
  50. /package/dist/{common → src/common}/utils/decode.d.ts +0 -0
  51. /package/dist/{common → src/common}/utils/index.d.ts +0 -0
  52. /package/dist/{common → src/common}/utils/social.d.ts +0 -0
  53. /package/dist/{common → src/common}/utils/stat.d.ts +0 -0
  54. /package/dist/{constants → src/constants}/auth.d.ts +0 -0
  55. /package/dist/{constants → src/constants}/cctp.d.ts +0 -0
  56. /package/dist/{constants → src/constants}/codex.d.ts +0 -0
  57. /package/dist/{constants → src/constants}/response.d.ts +0 -0
  58. /package/dist/{constants → src/constants}/settings.d.ts +0 -0
  59. /package/dist/{constants → src/constants}/withdrawalWalletsMessage.d.ts +0 -0
  60. /package/dist/{enums → src/enums}/chains.enum.d.ts +0 -0
  61. /package/dist/{enums → src/enums}/db/account/index.d.ts +0 -0
  62. /package/dist/{enums → src/enums}/db/affiliate.enum.d.ts +0 -0
  63. /package/dist/{enums → src/enums}/db/available-pair-settings.enum.d.ts +0 -0
  64. /package/dist/{enums → src/enums}/db/common.enum.d.ts +0 -0
  65. /package/dist/{enums → src/enums}/db/component/index.d.ts +0 -0
  66. /package/dist/{enums → src/enums}/db/index.d.ts +0 -0
  67. /package/dist/{enums → src/enums}/db/market-maker.enum.d.ts +0 -0
  68. /package/dist/{enums → src/enums}/db/notification-center/userNotification.enum.d.ts +0 -0
  69. /package/dist/{enums → src/enums}/db/order-side.enum.d.ts +0 -0
  70. /package/dist/{enums → src/enums}/db/order-status.enum.d.ts +0 -0
  71. /package/dist/{enums → src/enums}/db/order-type.enum.d.ts +0 -0
  72. /package/dist/{enums → src/enums}/db/relayer.enum.d.ts +0 -0
  73. /package/dist/{enums → src/enums}/db/setting-type.enum.d.ts +0 -0
  74. /package/dist/{enums → src/enums}/db/social-action.enum.d.ts +0 -0
  75. /package/dist/{enums → src/enums}/db/social-prompt.enum.d.ts +0 -0
  76. /package/dist/{enums → src/enums}/db/social.enum.d.ts +0 -0
  77. /package/dist/{enums → src/enums}/db/state-type.enum.d.ts +0 -0
  78. /package/dist/{enums → src/enums}/db/trade.enums.d.ts +0 -0
  79. /package/dist/{enums → src/enums}/db/tradingKeyType.enum.d.ts +0 -0
  80. /package/dist/{enums → src/enums}/db/upgrade.enum.d.ts +0 -0
  81. /package/dist/{enums → src/enums}/db/withdrawal-wallet.enum.d.ts +0 -0
  82. /package/dist/{enums → src/enums}/index.d.ts +0 -0
  83. /package/dist/{enums → src/enums}/maintenanceMode.enum.d.ts +0 -0
  84. /package/dist/{enums → src/enums}/notification.enum.d.ts +0 -0
  85. /package/dist/{enums → src/enums}/rabbitMq.d.ts +0 -0
  86. /package/dist/{enums → src/enums}/settings.enum.d.ts +0 -0
  87. /package/dist/{enums → src/enums}/social.enum.d.ts +0 -0
  88. /package/dist/{helpers → src/helpers}/Encoding.d.ts +0 -0
  89. /package/dist/{helpers → src/helpers}/algo.helper.d.ts +0 -0
  90. /package/dist/{helpers → src/helpers}/assert.helper.d.ts +0 -0
  91. /package/dist/{helpers → src/helpers}/atomic.helper.d.ts +0 -0
  92. /package/dist/{helpers → src/helpers}/balance.helper.d.ts +0 -0
  93. /package/dist/{helpers → src/helpers}/codex/common.helper.d.ts +0 -0
  94. /package/dist/{helpers → src/helpers}/codex/index.d.ts +0 -0
  95. /package/dist/{helpers → src/helpers}/codex/mbr.helper.d.ts +0 -0
  96. /package/dist/{helpers → src/helpers}/codex/mna.helper.d.ts +0 -0
  97. /package/dist/{helpers → src/helpers}/codex/order.helper.d.ts +0 -0
  98. /package/dist/{helpers → src/helpers}/codex/setGlobal.helper.d.ts +0 -0
  99. /package/dist/{helpers → src/helpers}/codex/transfer.helper.d.ts +0 -0
  100. /package/dist/{helpers → src/helpers}/codex/txn.helper.d.ts +0 -0
  101. /package/dist/{helpers → src/helpers}/codex.helper.d.ts +0 -0
  102. /package/dist/{helpers → src/helpers}/eth.helper.d.ts +0 -0
  103. /package/dist/{helpers → src/helpers}/index.d.ts +0 -0
  104. /package/dist/{helpers → src/helpers}/interval.helpers.d.ts +0 -0
  105. /package/dist/{helpers → src/helpers}/liquidity.helper.d.ts +0 -0
  106. /package/dist/{helpers → src/helpers}/order.helper.d.ts +0 -0
  107. /package/dist/{helpers → src/helpers}/pair.helper.d.ts +0 -0
  108. /package/dist/{helpers → src/helpers}/pointSystem.helper.d.ts +0 -0
  109. /package/dist/{helpers → src/helpers}/ticker.helpers.d.ts +0 -0
  110. /package/dist/{helpers → src/helpers}/vaa.helper.d.ts +0 -0
  111. /package/dist/{helpers → src/helpers}/withdraw.helper.d.ts +0 -0
  112. /package/dist/{interfaces → src/interfaces}/accountInfo.interface.d.ts +0 -0
  113. /package/dist/{interfaces → src/interfaces}/api/affiliate.interface.d.ts +0 -0
  114. /package/dist/{interfaces → src/interfaces}/api/index.d.ts +0 -0
  115. /package/dist/{interfaces → src/interfaces}/cache.interface.d.ts +0 -0
  116. /package/dist/{interfaces → src/interfaces}/db/baseModel.interface.d.ts +0 -0
  117. /package/dist/{interfaces → src/interfaces}/db/hummingbot/index.d.ts +0 -0
  118. /package/dist/{interfaces → src/interfaces}/db/index.d.ts +0 -0
  119. /package/dist/{interfaces → src/interfaces}/db/market/index.d.ts +0 -0
  120. /package/dist/{interfaces → src/interfaces}/db/marketing/index.d.ts +0 -0
  121. /package/dist/{interfaces → src/interfaces}/db/notification_center/index.d.ts +0 -0
  122. /package/dist/{interfaces → src/interfaces}/db/relayer/index.d.ts +0 -0
  123. /package/dist/{interfaces → src/interfaces}/db/social/index.d.ts +0 -0
  124. /package/dist/{interfaces → src/interfaces}/db/softDeleteModel.interface.d.ts +0 -0
  125. /package/dist/{interfaces → src/interfaces}/db/white_label/index.d.ts +0 -0
  126. /package/dist/{interfaces → src/interfaces}/db/withdrawal_wallets/index.d.ts +0 -0
  127. /package/dist/{interfaces → src/interfaces}/dto/index.d.ts +0 -0
  128. /package/dist/{interfaces → src/interfaces}/emailService.interface.d.ts +0 -0
  129. /package/dist/{interfaces → src/interfaces}/index.d.ts +0 -0
  130. /package/dist/{interfaces → src/interfaces}/kmsService.interface.d.ts +0 -0
  131. /package/dist/{interfaces → src/interfaces}/last-look-trade.interface.d.ts +0 -0
  132. /package/dist/{interfaces → src/interfaces}/market.interface.d.ts +0 -0
  133. /package/dist/{interfaces → src/interfaces}/order.interface.d.ts +0 -0
  134. /package/dist/{interfaces → src/interfaces}/pagination.interface.d.ts +0 -0
  135. /package/dist/{interfaces → src/interfaces}/pair.interface.d.ts +0 -0
  136. /package/dist/{interfaces → src/interfaces}/query.interface.d.ts +0 -0
  137. /package/dist/{interfaces → src/interfaces}/services/accountCache.interface.d.ts +0 -0
  138. /package/dist/{interfaces → src/interfaces}/services/algod.interface.d.ts +0 -0
  139. /package/dist/{interfaces → src/interfaces}/services/balances.interface.d.ts +0 -0
  140. /package/dist/{interfaces → src/interfaces}/services/coin-market-cap.interface.d.ts +0 -0
  141. /package/dist/{interfaces → src/interfaces}/services/index.d.ts +0 -0
  142. /package/dist/{interfaces → src/interfaces}/services/price-model.interface.d.ts +0 -0
  143. /package/dist/{interfaces → src/interfaces}/services/price-service.interface.d.ts +0 -0
  144. /package/dist/{interfaces → src/interfaces}/services/socialActivity.interface.d.ts +0 -0
  145. /package/dist/{interfaces → src/interfaces}/services/tmc.interface.d.ts +0 -0
  146. /package/dist/{interfaces → src/interfaces}/settings.interface.d.ts +0 -0
  147. /package/dist/{interfaces → src/interfaces}/streaming.interface.d.ts +0 -0
  148. /package/dist/{interfaces → src/interfaces}/timestream.interface.d.ts +0 -0
  149. /package/dist/{interfaces → src/interfaces}/trading.interface.d.ts +0 -0
  150. /package/dist/{interfaces → src/interfaces}/tradingKey.interface.d.ts +0 -0
  151. /package/dist/{interfaces → src/interfaces}/transfer.interface.d.ts +0 -0
  152. /package/dist/{interfaces → src/interfaces}/wallet.interface.d.ts +0 -0
  153. /package/dist/{interfaces → src/interfaces}/withdrawalWallets.interface.d.ts +0 -0
  154. /package/dist/{types → src/types}/algo-order.type.d.ts +0 -0
  155. /package/dist/{types → src/types}/amm/amm.d.ts +0 -0
  156. /package/dist/{types → src/types}/api/request.types.d.ts +0 -0
  157. /package/dist/{types → src/types}/codex.types.d.ts +0 -0
  158. /package/dist/{types → src/types}/hummingbots.types.d.ts +0 -0
  159. /package/dist/{types → src/types}/index.d.ts +0 -0
  160. /package/dist/{types → src/types}/notification.type.d.ts +0 -0
  161. /package/dist/{types → src/types}/state.type.d.ts +0 -0
@@ -1,5 +1,5 @@
1
- function fr(){throw new Error("setTimeout has not been defined")}function gr(){throw new Error("clearTimeout has not been defined")}var O=fr,k=gr;typeof globalThis.setTimeout=="function"&&(O=setTimeout);typeof globalThis.clearTimeout=="function"&&(k=clearTimeout);function hr(t){if(O===setTimeout)return setTimeout(t,0);if((O===fr||!O)&&setTimeout)return O=setTimeout,setTimeout(t,0);try{return O(t,0)}catch{try{return O.call(null,t,0)}catch{return O.call(this,t,0)}}}function ue(t){if(k===clearTimeout)return clearTimeout(t);if((k===gr||!k)&&clearTimeout)return k=clearTimeout,clearTimeout(t);try{return k(t)}catch{try{return k.call(null,t)}catch{return k.call(this,t)}}}var B=[],F=!1,P,G=-1;function pe(){!F||!P||(F=!1,P.length?B=P.concat(B):G=-1,B.length&&xr())}function xr(){if(!F){var t=hr(pe);F=!0;for(var r=B.length;r;){for(P=B,B=[];++G<r;)P&&P[G].run();G=-1,r=B.length}P=null,F=!1,ue(t)}}function le(t){var r=new Array(arguments.length-1);if(arguments.length>1)for(var e=1;e<arguments.length;e++)r[e-1]=arguments[e];B.push(new br(t,r)),B.length===1&&!F&&hr(xr)}function br(t,r){this.fun=t,this.array=r}br.prototype.run=function(){this.fun.apply(null,this.array)};var me="browser",de="browser",fe=!0,ge={},he=[],xe="",be={},Ee={},Ae={};function U(){}var Te=U,ye=U,_e=U,Ie=U,we=U,Ne=U,Re=U;function Se(t){throw new Error("process.binding is not supported")}function Be(){return"/"}function De(t){throw new Error("process.chdir is not supported")}function Ce(){return 0}var v=globalThis.performance||{},Oe=v.now||v.mozNow||v.msNow||v.oNow||v.webkitNow||function(){return new Date().getTime()};function ke(t){var r=Oe.call(v)*.001,e=Math.floor(r),n=Math.floor(r%1*1e9);return t&&(e=e-t[0],n=n-t[1],n<0&&(e--,n+=1e9)),[e,n]}var Pe=new Date;function Ue(){var t=new Date,r=t-Pe;return r/1e3}var m={nextTick:le,title:me,browser:fe,env:ge,argv:he,version:xe,versions:be,on:Te,addListener:ye,once:_e,off:Ie,removeListener:we,removeAllListeners:Ne,emit:Re,binding:Se,cwd:Be,chdir:De,umask:Ce,hrtime:ke,platform:de,release:Ee,config:Ae,uptime:Ue},dr={};Object.keys(dr).forEach(t=>{let r=t.split("."),e=m;for(let n=0;n<r.length;n++){let o=r[n];n===r.length-1?e[o]=dr[t]:e=e[o]||(e[o]={})}});var w=[],_=[],Le=typeof Uint8Array<"u"?Uint8Array:Array,or=!1;function yr(){or=!0;for(var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",r=0,e=t.length;r<e;++r)w[r]=t[r],_[t.charCodeAt(r)]=r;_[45]=62,_[95]=63}function Me(t){or||yr();var r,e,n,o,i,a,c=t.length;if(c%4>0)throw new Error("Invalid string. Length must be a multiple of 4");i=t[c-2]==="="?2:t[c-1]==="="?1:0,a=new Le(c*3/4-i),n=i>0?c-4:c;var p=0;for(r=0,e=0;r<n;r+=4,e+=3)o=_[t.charCodeAt(r)]<<18|_[t.charCodeAt(r+1)]<<12|_[t.charCodeAt(r+2)]<<6|_[t.charCodeAt(r+3)],a[p++]=o>>16&255,a[p++]=o>>8&255,a[p++]=o&255;return i===2?(o=_[t.charCodeAt(r)]<<2|_[t.charCodeAt(r+1)]>>4,a[p++]=o&255):i===1&&(o=_[t.charCodeAt(r)]<<10|_[t.charCodeAt(r+1)]<<4|_[t.charCodeAt(r+2)]>>2,a[p++]=o>>8&255,a[p++]=o&255),a}function ve(t){return w[t>>18&63]+w[t>>12&63]+w[t>>6&63]+w[t&63]}function Fe(t,r,e){for(var n,o=[],i=r;i<e;i+=3)n=(t[i]<<16)+(t[i+1]<<8)+t[i+2],o.push(ve(n));return o.join("")}function Er(t){or||yr();for(var r,e=t.length,n=e%3,o="",i=[],a=16383,c=0,p=e-n;c<p;c+=a)i.push(Fe(t,c,c+a>p?p:c+a));return n===1?(r=t[e-1],o+=w[r>>2],o+=w[r<<4&63],o+="=="):n===2&&(r=(t[e-2]<<8)+t[e-1],o+=w[r>>10],o+=w[r>>4&63],o+=w[r<<2&63],o+="="),i.push(o),i.join("")}s.TYPED_ARRAY_SUPPORT=globalThis.TYPED_ARRAY_SUPPORT!==void 0?globalThis.TYPED_ARRAY_SUPPORT:!0;function W(){return s.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function D(t,r){if(W()<r)throw new RangeError("Invalid typed array length");return s.TYPED_ARRAY_SUPPORT?(t=new Uint8Array(r),t.__proto__=s.prototype):(t===null&&(t=new s(r)),t.length=r),t}function s(t,r,e){if(!s.TYPED_ARRAY_SUPPORT&&!(this instanceof s))return new s(t,r,e);if(typeof t=="number"){if(typeof r=="string")throw new Error("If encoding is specified then the first argument must be a string");return ir(this,t)}return _r(this,t,r,e)}s.poolSize=8192;s._augment=function(t){return t.__proto__=s.prototype,t};function _r(t,r,e,n){if(typeof r=="number")throw new TypeError('"value" argument must not be a number');return typeof ArrayBuffer<"u"&&r instanceof ArrayBuffer?We(t,r,e,n):typeof r=="string"?Ge(t,r,e):Ke(t,r)}s.from=function(t,r,e){return _r(null,t,r,e)};s.kMaxLength=W();s.TYPED_ARRAY_SUPPORT&&(s.prototype.__proto__=Uint8Array.prototype,s.__proto__=Uint8Array,typeof Symbol<"u"&&Symbol.species&&s[Symbol.species]);function Ir(t){if(typeof t!="number")throw new TypeError('"size" argument must be a number');if(t<0)throw new RangeError('"size" argument must not be negative')}function Ye(t,r,e,n){return Ir(r),r<=0?D(t,r):e!==void 0?typeof n=="string"?D(t,r).fill(e,n):D(t,r).fill(e):D(t,r)}s.alloc=function(t,r,e){return Ye(null,t,r,e)};function ir(t,r){if(Ir(r),t=D(t,r<0?0:ar(r)|0),!s.TYPED_ARRAY_SUPPORT)for(var e=0;e<r;++e)t[e]=0;return t}s.allocUnsafe=function(t){return ir(null,t)};s.allocUnsafeSlow=function(t){return ir(null,t)};function Ge(t,r,e){if((typeof e!="string"||e==="")&&(e="utf8"),!s.isEncoding(e))throw new TypeError('"encoding" must be a valid string encoding');var n=wr(r,e)|0;t=D(t,n);var o=t.write(r,e);return o!==n&&(t=t.slice(0,o)),t}function nr(t,r){var e=r.length<0?0:ar(r.length)|0;t=D(t,e);for(var n=0;n<e;n+=1)t[n]=r[n]&255;return t}function We(t,r,e,n){if(r.byteLength,e<0||r.byteLength<e)throw new RangeError("'offset' is out of bounds");if(r.byteLength<e+(n||0))throw new RangeError("'length' is out of bounds");return e===void 0&&n===void 0?r=new Uint8Array(r):n===void 0?r=new Uint8Array(r,e):r=new Uint8Array(r,e,n),s.TYPED_ARRAY_SUPPORT?(t=r,t.__proto__=s.prototype):t=nr(t,r),t}function Ke(t,r){if(N(r)){var e=ar(r.length)|0;return t=D(t,e),t.length===0||r.copy(t,0,0,e),t}if(r){if(typeof ArrayBuffer<"u"&&r.buffer instanceof ArrayBuffer||"length"in r)return typeof r.length!="number"||ct(r.length)?D(t,0):nr(t,r);if(r.type==="Buffer"&&Array.isArray(r.data))return nr(t,r.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function ar(t){if(t>=W())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+W().toString(16)+" bytes");return t|0}s.isBuffer=ut;function N(t){return!!(t!=null&&t._isBuffer)}s.compare=function(r,e){if(!N(r)||!N(e))throw new TypeError("Arguments must be Buffers");if(r===e)return 0;for(var n=r.length,o=e.length,i=0,a=Math.min(n,o);i<a;++i)if(r[i]!==e[i]){n=r[i],o=e[i];break}return n<o?-1:o<n?1:0};s.isEncoding=function(r){switch(String(r).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}};s.concat=function(r,e){if(!Array.isArray(r))throw new TypeError('"list" argument must be an Array of Buffers');if(r.length===0)return s.alloc(0);var n;if(e===void 0)for(e=0,n=0;n<r.length;++n)e+=r[n].length;var o=s.allocUnsafe(e),i=0;for(n=0;n<r.length;++n){var a=r[n];if(!N(a))throw new TypeError('"list" argument must be an Array of Buffers');a.copy(o,i),i+=a.length}return o};function wr(t,r){if(N(t))return t.length;if(typeof ArrayBuffer<"u"&&typeof ArrayBuffer.isView=="function"&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;typeof t!="string"&&(t=""+t);var e=t.length;if(e===0)return 0;for(var n=!1;;)switch(r){case"ascii":case"latin1":case"binary":return e;case"utf8":case"utf-8":case void 0:return K(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return e*2;case"hex":return e>>>1;case"base64":return Or(t).length;default:if(n)return K(t).length;r=(""+r).toLowerCase(),n=!0}}s.byteLength=wr;function He(t,r,e){var n=!1;if((r===void 0||r<0)&&(r=0),r>this.length||((e===void 0||e>this.length)&&(e=this.length),e<=0)||(e>>>=0,r>>>=0,e<=r))return"";for(t||(t="utf8");;)switch(t){case"hex":return rt(this,r,e);case"utf8":case"utf-8":return Sr(this,r,e);case"ascii":return Qe(this,r,e);case"latin1":case"binary":return Ze(this,r,e);case"base64":return Je(this,r,e);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return et(this,r,e);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}s.prototype._isBuffer=!0;function L(t,r,e){var n=t[r];t[r]=t[e],t[e]=n}s.prototype.swap16=function(){var r=this.length;if(r%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var e=0;e<r;e+=2)L(this,e,e+1);return this};s.prototype.swap32=function(){var r=this.length;if(r%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var e=0;e<r;e+=4)L(this,e,e+3),L(this,e+1,e+2);return this};s.prototype.swap64=function(){var r=this.length;if(r%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var e=0;e<r;e+=8)L(this,e,e+7),L(this,e+1,e+6),L(this,e+2,e+5),L(this,e+3,e+4);return this};s.prototype.toString=function(){var r=this.length|0;return r===0?"":arguments.length===0?Sr(this,0,r):He.apply(this,arguments)};s.prototype.equals=function(r){if(!N(r))throw new TypeError("Argument must be a Buffer");return this===r?!0:s.compare(this,r)===0};s.prototype.compare=function(r,e,n,o,i){if(!N(r))throw new TypeError("Argument must be a Buffer");if(e===void 0&&(e=0),n===void 0&&(n=r?r.length:0),o===void 0&&(o=0),i===void 0&&(i=this.length),e<0||n>r.length||o<0||i>this.length)throw new RangeError("out of range index");if(o>=i&&e>=n)return 0;if(o>=i)return-1;if(e>=n)return 1;if(e>>>=0,n>>>=0,o>>>=0,i>>>=0,this===r)return 0;for(var a=i-o,c=n-e,p=Math.min(a,c),d=this.slice(o,i),f=r.slice(e,n),l=0;l<p;++l)if(d[l]!==f[l]){a=d[l],c=f[l];break}return a<c?-1:c<a?1:0};function Nr(t,r,e,n,o){if(t.length===0)return-1;if(typeof e=="string"?(n=e,e=0):e>2147483647?e=2147483647:e<-2147483648&&(e=-2147483648),e=+e,isNaN(e)&&(e=o?0:t.length-1),e<0&&(e=t.length+e),e>=t.length){if(o)return-1;e=t.length-1}else if(e<0)if(o)e=0;else return-1;if(typeof r=="string"&&(r=s.from(r,n)),N(r))return r.length===0?-1:Ar(t,r,e,n,o);if(typeof r=="number")return r=r&255,s.TYPED_ARRAY_SUPPORT&&typeof Uint8Array.prototype.indexOf=="function"?o?Uint8Array.prototype.indexOf.call(t,r,e):Uint8Array.prototype.lastIndexOf.call(t,r,e):Ar(t,[r],e,n,o);throw new TypeError("val must be string, number or Buffer")}function Ar(t,r,e,n,o){var i=1,a=t.length,c=r.length;if(n!==void 0&&(n=String(n).toLowerCase(),n==="ucs2"||n==="ucs-2"||n==="utf16le"||n==="utf-16le")){if(t.length<2||r.length<2)return-1;i=2,a/=2,c/=2,e/=2}function p(g,y){return i===1?g[y]:g.readUInt16BE(y*i)}var d;if(o){var f=-1;for(d=e;d<a;d++)if(p(t,d)===p(r,f===-1?0:d-f)){if(f===-1&&(f=d),d-f+1===c)return f*i}else f!==-1&&(d-=d-f),f=-1}else for(e+c>a&&(e=a-c),d=e;d>=0;d--){for(var l=!0,h=0;h<c;h++)if(p(t,d+h)!==p(r,h)){l=!1;break}if(l)return d}return-1}s.prototype.includes=function(r,e,n){return this.indexOf(r,e,n)!==-1};s.prototype.indexOf=function(r,e,n){return Nr(this,r,e,n,!0)};s.prototype.lastIndexOf=function(r,e,n){return Nr(this,r,e,n,!1)};function Ve(t,r,e,n){e=Number(e)||0;var o=t.length-e;n?(n=Number(n),n>o&&(n=o)):n=o;var i=r.length;if(i%2!==0)throw new TypeError("Invalid hex string");n>i/2&&(n=i/2);for(var a=0;a<n;++a){var c=parseInt(r.substr(a*2,2),16);if(isNaN(c))return a;t[e+a]=c}return a}function $e(t,r,e,n){return $(K(r,t.length-e),t,e,n)}function Rr(t,r,e,n){return $(at(r),t,e,n)}function ze(t,r,e,n){return Rr(t,r,e,n)}function Xe(t,r,e,n){return $(Or(r),t,e,n)}function qe(t,r,e,n){return $(st(r,t.length-e),t,e,n)}s.prototype.write=function(r,e,n,o){if(e===void 0)o="utf8",n=this.length,e=0;else if(n===void 0&&typeof e=="string")o=e,n=this.length,e=0;else if(isFinite(e))e=e|0,isFinite(n)?(n=n|0,o===void 0&&(o="utf8")):(o=n,n=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var i=this.length-e;if((n===void 0||n>i)&&(n=i),r.length>0&&(n<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");o||(o="utf8");for(var a=!1;;)switch(o){case"hex":return Ve(this,r,e,n);case"utf8":case"utf-8":return $e(this,r,e,n);case"ascii":return Rr(this,r,e,n);case"latin1":case"binary":return ze(this,r,e,n);case"base64":return Xe(this,r,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return qe(this,r,e,n);default:if(a)throw new TypeError("Unknown encoding: "+o);o=(""+o).toLowerCase(),a=!0}};s.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function Je(t,r,e){return r===0&&e===t.length?Er(t):Er(t.slice(r,e))}function Sr(t,r,e){e=Math.min(t.length,e);for(var n=[],o=r;o<e;){var i=t[o],a=null,c=i>239?4:i>223?3:i>191?2:1;if(o+c<=e){var p,d,f,l;switch(c){case 1:i<128&&(a=i);break;case 2:p=t[o+1],(p&192)===128&&(l=(i&31)<<6|p&63,l>127&&(a=l));break;case 3:p=t[o+1],d=t[o+2],(p&192)===128&&(d&192)===128&&(l=(i&15)<<12|(p&63)<<6|d&63,l>2047&&(l<55296||l>57343)&&(a=l));break;case 4:p=t[o+1],d=t[o+2],f=t[o+3],(p&192)===128&&(d&192)===128&&(f&192)===128&&(l=(i&15)<<18|(p&63)<<12|(d&63)<<6|f&63,l>65535&&l<1114112&&(a=l))}}a===null?(a=65533,c=1):a>65535&&(a-=65536,n.push(a>>>10&1023|55296),a=56320|a&1023),n.push(a),o+=c}return je(n)}var Tr=4096;function je(t){var r=t.length;if(r<=Tr)return String.fromCharCode.apply(String,t);for(var e="",n=0;n<r;)e+=String.fromCharCode.apply(String,t.slice(n,n+=Tr));return e}function Qe(t,r,e){var n="";e=Math.min(t.length,e);for(var o=r;o<e;++o)n+=String.fromCharCode(t[o]&127);return n}function Ze(t,r,e){var n="";e=Math.min(t.length,e);for(var o=r;o<e;++o)n+=String.fromCharCode(t[o]);return n}function rt(t,r,e){var n=t.length;(!r||r<0)&&(r=0),(!e||e<0||e>n)&&(e=n);for(var o="",i=r;i<e;++i)o+=it(t[i]);return o}function et(t,r,e){for(var n=t.slice(r,e),o="",i=0;i<n.length;i+=2)o+=String.fromCharCode(n[i]+n[i+1]*256);return o}s.prototype.slice=function(r,e){var n=this.length;r=~~r,e=e===void 0?n:~~e,r<0?(r+=n,r<0&&(r=0)):r>n&&(r=n),e<0?(e+=n,e<0&&(e=0)):e>n&&(e=n),e<r&&(e=r);var o;if(s.TYPED_ARRAY_SUPPORT)o=this.subarray(r,e),o.__proto__=s.prototype;else{var i=e-r;o=new s(i,void 0);for(var a=0;a<i;++a)o[a]=this[a+r]}return o};function b(t,r,e){if(t%1!==0||t<0)throw new RangeError("offset is not uint");if(t+r>e)throw new RangeError("Trying to access beyond buffer length")}s.prototype.readUIntLE=function(r,e,n){r=r|0,e=e|0,n||b(r,e,this.length);for(var o=this[r],i=1,a=0;++a<e&&(i*=256);)o+=this[r+a]*i;return o};s.prototype.readUIntBE=function(r,e,n){r=r|0,e=e|0,n||b(r,e,this.length);for(var o=this[r+--e],i=1;e>0&&(i*=256);)o+=this[r+--e]*i;return o};s.prototype.readUInt8=function(r,e){return e||b(r,1,this.length),this[r]};s.prototype.readUInt16LE=function(r,e){return e||b(r,2,this.length),this[r]|this[r+1]<<8};s.prototype.readUInt16BE=function(r,e){return e||b(r,2,this.length),this[r]<<8|this[r+1]};s.prototype.readUInt32LE=function(r,e){return e||b(r,4,this.length),(this[r]|this[r+1]<<8|this[r+2]<<16)+this[r+3]*16777216};s.prototype.readUInt32BE=function(r,e){return e||b(r,4,this.length),this[r]*16777216+(this[r+1]<<16|this[r+2]<<8|this[r+3])};s.prototype.readIntLE=function(r,e,n){r=r|0,e=e|0,n||b(r,e,this.length);for(var o=this[r],i=1,a=0;++a<e&&(i*=256);)o+=this[r+a]*i;return i*=128,o>=i&&(o-=Math.pow(2,8*e)),o};s.prototype.readIntBE=function(r,e,n){r=r|0,e=e|0,n||b(r,e,this.length);for(var o=e,i=1,a=this[r+--o];o>0&&(i*=256);)a+=this[r+--o]*i;return i*=128,a>=i&&(a-=Math.pow(2,8*e)),a};s.prototype.readInt8=function(r,e){return e||b(r,1,this.length),this[r]&128?(255-this[r]+1)*-1:this[r]};s.prototype.readInt16LE=function(r,e){e||b(r,2,this.length);var n=this[r]|this[r+1]<<8;return n&32768?n|4294901760:n};s.prototype.readInt16BE=function(r,e){e||b(r,2,this.length);var n=this[r+1]|this[r]<<8;return n&32768?n|4294901760:n};s.prototype.readInt32LE=function(r,e){return e||b(r,4,this.length),this[r]|this[r+1]<<8|this[r+2]<<16|this[r+3]<<24};s.prototype.readInt32BE=function(r,e){return e||b(r,4,this.length),this[r]<<24|this[r+1]<<16|this[r+2]<<8|this[r+3]};s.prototype.readFloatLE=function(r,e){return e||b(r,4,this.length),z(this,r,!0,23,4)};s.prototype.readFloatBE=function(r,e){return e||b(r,4,this.length),z(this,r,!1,23,4)};s.prototype.readDoubleLE=function(r,e){return e||b(r,8,this.length),z(this,r,!0,52,8)};s.prototype.readDoubleBE=function(r,e){return e||b(r,8,this.length),z(this,r,!1,52,8)};function A(t,r,e,n,o,i){if(!N(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(r>o||r<i)throw new RangeError('"value" argument is out of bounds');if(e+n>t.length)throw new RangeError("Index out of range")}s.prototype.writeUIntLE=function(r,e,n,o){if(r=+r,e=e|0,n=n|0,!o){var i=Math.pow(2,8*n)-1;A(this,r,e,n,i,0)}var a=1,c=0;for(this[e]=r&255;++c<n&&(a*=256);)this[e+c]=r/a&255;return e+n};s.prototype.writeUIntBE=function(r,e,n,o){if(r=+r,e=e|0,n=n|0,!o){var i=Math.pow(2,8*n)-1;A(this,r,e,n,i,0)}var a=n-1,c=1;for(this[e+a]=r&255;--a>=0&&(c*=256);)this[e+a]=r/c&255;return e+n};s.prototype.writeUInt8=function(r,e,n){return r=+r,e=e|0,n||A(this,r,e,1,255,0),s.TYPED_ARRAY_SUPPORT||(r=Math.floor(r)),this[e]=r&255,e+1};function H(t,r,e,n){r<0&&(r=65535+r+1);for(var o=0,i=Math.min(t.length-e,2);o<i;++o)t[e+o]=(r&255<<8*(n?o:1-o))>>>(n?o:1-o)*8}s.prototype.writeUInt16LE=function(r,e,n){return r=+r,e=e|0,n||A(this,r,e,2,65535,0),s.TYPED_ARRAY_SUPPORT?(this[e]=r&255,this[e+1]=r>>>8):H(this,r,e,!0),e+2};s.prototype.writeUInt16BE=function(r,e,n){return r=+r,e=e|0,n||A(this,r,e,2,65535,0),s.TYPED_ARRAY_SUPPORT?(this[e]=r>>>8,this[e+1]=r&255):H(this,r,e,!1),e+2};function V(t,r,e,n){r<0&&(r=4294967295+r+1);for(var o=0,i=Math.min(t.length-e,4);o<i;++o)t[e+o]=r>>>(n?o:3-o)*8&255}s.prototype.writeUInt32LE=function(r,e,n){return r=+r,e=e|0,n||A(this,r,e,4,4294967295,0),s.TYPED_ARRAY_SUPPORT?(this[e+3]=r>>>24,this[e+2]=r>>>16,this[e+1]=r>>>8,this[e]=r&255):V(this,r,e,!0),e+4};s.prototype.writeUInt32BE=function(r,e,n){return r=+r,e=e|0,n||A(this,r,e,4,4294967295,0),s.TYPED_ARRAY_SUPPORT?(this[e]=r>>>24,this[e+1]=r>>>16,this[e+2]=r>>>8,this[e+3]=r&255):V(this,r,e,!1),e+4};s.prototype.writeIntLE=function(r,e,n,o){if(r=+r,e=e|0,!o){var i=Math.pow(2,8*n-1);A(this,r,e,n,i-1,-i)}var a=0,c=1,p=0;for(this[e]=r&255;++a<n&&(c*=256);)r<0&&p===0&&this[e+a-1]!==0&&(p=1),this[e+a]=(r/c>>0)-p&255;return e+n};s.prototype.writeIntBE=function(r,e,n,o){if(r=+r,e=e|0,!o){var i=Math.pow(2,8*n-1);A(this,r,e,n,i-1,-i)}var a=n-1,c=1,p=0;for(this[e+a]=r&255;--a>=0&&(c*=256);)r<0&&p===0&&this[e+a+1]!==0&&(p=1),this[e+a]=(r/c>>0)-p&255;return e+n};s.prototype.writeInt8=function(r,e,n){return r=+r,e=e|0,n||A(this,r,e,1,127,-128),s.TYPED_ARRAY_SUPPORT||(r=Math.floor(r)),r<0&&(r=255+r+1),this[e]=r&255,e+1};s.prototype.writeInt16LE=function(r,e,n){return r=+r,e=e|0,n||A(this,r,e,2,32767,-32768),s.TYPED_ARRAY_SUPPORT?(this[e]=r&255,this[e+1]=r>>>8):H(this,r,e,!0),e+2};s.prototype.writeInt16BE=function(r,e,n){return r=+r,e=e|0,n||A(this,r,e,2,32767,-32768),s.TYPED_ARRAY_SUPPORT?(this[e]=r>>>8,this[e+1]=r&255):H(this,r,e,!1),e+2};s.prototype.writeInt32LE=function(r,e,n){return r=+r,e=e|0,n||A(this,r,e,4,2147483647,-2147483648),s.TYPED_ARRAY_SUPPORT?(this[e]=r&255,this[e+1]=r>>>8,this[e+2]=r>>>16,this[e+3]=r>>>24):V(this,r,e,!0),e+4};s.prototype.writeInt32BE=function(r,e,n){return r=+r,e=e|0,n||A(this,r,e,4,2147483647,-2147483648),r<0&&(r=4294967295+r+1),s.TYPED_ARRAY_SUPPORT?(this[e]=r>>>24,this[e+1]=r>>>16,this[e+2]=r>>>8,this[e+3]=r&255):V(this,r,e,!1),e+4};function Br(t,r,e,n,o,i){if(e+n>t.length)throw new RangeError("Index out of range");if(e<0)throw new RangeError("Index out of range")}function Dr(t,r,e,n,o){return o||Br(t,r,e,4,34028234663852886e22,-34028234663852886e22),Pr(t,r,e,n,23,4),e+4}s.prototype.writeFloatLE=function(r,e,n){return Dr(this,r,e,!0,n)};s.prototype.writeFloatBE=function(r,e,n){return Dr(this,r,e,!1,n)};function Cr(t,r,e,n,o){return o||Br(t,r,e,8,17976931348623157e292,-17976931348623157e292),Pr(t,r,e,n,52,8),e+8}s.prototype.writeDoubleLE=function(r,e,n){return Cr(this,r,e,!0,n)};s.prototype.writeDoubleBE=function(r,e,n){return Cr(this,r,e,!1,n)};s.prototype.copy=function(r,e,n,o){if(n||(n=0),!o&&o!==0&&(o=this.length),e>=r.length&&(e=r.length),e||(e=0),o>0&&o<n&&(o=n),o===n||r.length===0||this.length===0)return 0;if(e<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("sourceStart out of bounds");if(o<0)throw new RangeError("sourceEnd out of bounds");o>this.length&&(o=this.length),r.length-e<o-n&&(o=r.length-e+n);var i=o-n,a;if(this===r&&n<e&&e<o)for(a=i-1;a>=0;--a)r[a+e]=this[a+n];else if(i<1e3||!s.TYPED_ARRAY_SUPPORT)for(a=0;a<i;++a)r[a+e]=this[a+n];else Uint8Array.prototype.set.call(r,this.subarray(n,n+i),e);return i};s.prototype.fill=function(r,e,n,o){if(typeof r=="string"){if(typeof e=="string"?(o=e,e=0,n=this.length):typeof n=="string"&&(o=n,n=this.length),r.length===1){var i=r.charCodeAt(0);i<256&&(r=i)}if(o!==void 0&&typeof o!="string")throw new TypeError("encoding must be a string");if(typeof o=="string"&&!s.isEncoding(o))throw new TypeError("Unknown encoding: "+o)}else typeof r=="number"&&(r=r&255);if(e<0||this.length<e||this.length<n)throw new RangeError("Out of range index");if(n<=e)return this;e=e>>>0,n=n===void 0?this.length:n>>>0,r||(r=0);var a;if(typeof r=="number")for(a=e;a<n;++a)this[a]=r;else{var c=N(r)?r:K(new s(r,o).toString()),p=c.length;for(a=0;a<n-e;++a)this[a+e]=c[a%p]}return this};var tt=/[^+\/0-9A-Za-z-_]/g;function nt(t){if(t=ot(t).replace(tt,""),t.length<2)return"";for(;t.length%4!==0;)t=t+"=";return t}function ot(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}function it(t){return t<16?"0"+t.toString(16):t.toString(16)}function K(t,r){r=r||1/0;for(var e,n=t.length,o=null,i=[],a=0;a<n;++a){if(e=t.charCodeAt(a),e>55295&&e<57344){if(!o){if(e>56319){(r-=3)>-1&&i.push(239,191,189);continue}else if(a+1===n){(r-=3)>-1&&i.push(239,191,189);continue}o=e;continue}if(e<56320){(r-=3)>-1&&i.push(239,191,189),o=e;continue}e=(o-55296<<10|e-56320)+65536}else o&&(r-=3)>-1&&i.push(239,191,189);if(o=null,e<128){if((r-=1)<0)break;i.push(e)}else if(e<2048){if((r-=2)<0)break;i.push(e>>6|192,e&63|128)}else if(e<65536){if((r-=3)<0)break;i.push(e>>12|224,e>>6&63|128,e&63|128)}else if(e<1114112){if((r-=4)<0)break;i.push(e>>18|240,e>>12&63|128,e>>6&63|128,e&63|128)}else throw new Error("Invalid code point")}return i}function at(t){for(var r=[],e=0;e<t.length;++e)r.push(t.charCodeAt(e)&255);return r}function st(t,r){for(var e,n,o,i=[],a=0;a<t.length&&!((r-=2)<0);++a)e=t.charCodeAt(a),n=e>>8,o=e%256,i.push(o),i.push(n);return i}function Or(t){return Me(nt(t))}function $(t,r,e,n){for(var o=0;o<n&&!(o+e>=r.length||o>=t.length);++o)r[o+e]=t[o];return o}function ct(t){return t!==t}function ut(t){return t!=null&&(!!t._isBuffer||kr(t)||pt(t))}function kr(t){return!!t.constructor&&typeof t.constructor.isBuffer=="function"&&t.constructor.isBuffer(t)}function pt(t){return typeof t.readFloatLE=="function"&&typeof t.slice=="function"&&kr(t.slice(0,0))}function z(t,r,e,n,o){var i,a,c=o*8-n-1,p=(1<<c)-1,d=p>>1,f=-7,l=e?o-1:0,h=e?-1:1,g=t[r+l];for(l+=h,i=g&(1<<-f)-1,g>>=-f,f+=c;f>0;i=i*256+t[r+l],l+=h,f-=8);for(a=i&(1<<-f)-1,i>>=-f,f+=n;f>0;a=a*256+t[r+l],l+=h,f-=8);if(i===0)i=1-d;else{if(i===p)return a?NaN:(g?-1:1)*(1/0);a=a+Math.pow(2,n),i=i-d}return(g?-1:1)*a*Math.pow(2,i-n)}function Pr(t,r,e,n,o,i){var a,c,p,d=i*8-o-1,f=(1<<d)-1,l=f>>1,h=o===23?Math.pow(2,-24)-Math.pow(2,-77):0,g=n?0:i-1,y=n?1:-1,tr=r<0||r===0&&1/r<0?1:0;for(r=Math.abs(r),isNaN(r)||r===1/0?(c=isNaN(r)?1:0,a=f):(a=Math.floor(Math.log(r)/Math.LN2),r*(p=Math.pow(2,-a))<1&&(a--,p*=2),a+l>=1?r+=h/p:r+=h*Math.pow(2,1-l),r*p>=2&&(a++,p/=2),a+l>=f?(c=0,a=f):a+l>=1?(c=(r*p-1)*Math.pow(2,o),a=a+l):(c=r*Math.pow(2,l-1)*Math.pow(2,o),a=0));o>=8;t[e+g]=c&255,g+=y,c/=256,o-=8);for(a=a<<o|c,d+=o;d>0;t[e+g]=a&255,g+=y,a/=256,d-=8);t[e+g-y]|=tr*128}import*as x from"ethereumjs-util";import wu from"algosdk";import*as cn from"bs58";import Wo from"algosdk";import Nn,{decodeAddress as Rn,encodeAddress as Sn}from"algosdk";var R=[],I=[],lt=typeof Uint8Array<"u"?Uint8Array:Array,cr=!1;function vr(){cr=!0;for(var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",r=0,e=t.length;r<e;++r)R[r]=t[r],I[t.charCodeAt(r)]=r;I[45]=62,I[95]=63}function mt(t){cr||vr();var r,e,n,o,i,a,c=t.length;if(c%4>0)throw new Error("Invalid string. Length must be a multiple of 4");i=t[c-2]==="="?2:t[c-1]==="="?1:0,a=new lt(c*3/4-i),n=i>0?c-4:c;var p=0;for(r=0,e=0;r<n;r+=4,e+=3)o=I[t.charCodeAt(r)]<<18|I[t.charCodeAt(r+1)]<<12|I[t.charCodeAt(r+2)]<<6|I[t.charCodeAt(r+3)],a[p++]=o>>16&255,a[p++]=o>>8&255,a[p++]=o&255;return i===2?(o=I[t.charCodeAt(r)]<<2|I[t.charCodeAt(r+1)]>>4,a[p++]=o&255):i===1&&(o=I[t.charCodeAt(r)]<<10|I[t.charCodeAt(r+1)]<<4|I[t.charCodeAt(r+2)]>>2,a[p++]=o>>8&255,a[p++]=o&255),a}function dt(t){return R[t>>18&63]+R[t>>12&63]+R[t>>6&63]+R[t&63]}function ft(t,r,e){for(var n,o=[],i=r;i<e;i+=3)n=(t[i]<<16)+(t[i+1]<<8)+t[i+2],o.push(dt(n));return o.join("")}function Ur(t){cr||vr();for(var r,e=t.length,n=e%3,o="",i=[],a=16383,c=0,p=e-n;c<p;c+=a)i.push(ft(t,c,c+a>p?p:c+a));return n===1?(r=t[e-1],o+=R[r>>2],o+=R[r<<4&63],o+="=="):n===2&&(r=(t[e-2]<<8)+t[e-1],o+=R[r>>10],o+=R[r>>4&63],o+=R[r<<2&63],o+="="),i.push(o),i.join("")}function J(t,r,e,n,o){var i,a,c=o*8-n-1,p=(1<<c)-1,d=p>>1,f=-7,l=e?o-1:0,h=e?-1:1,g=t[r+l];for(l+=h,i=g&(1<<-f)-1,g>>=-f,f+=c;f>0;i=i*256+t[r+l],l+=h,f-=8);for(a=i&(1<<-f)-1,i>>=-f,f+=n;f>0;a=a*256+t[r+l],l+=h,f-=8);if(i===0)i=1-d;else{if(i===p)return a?NaN:(g?-1:1)*(1/0);a=a+Math.pow(2,n),i=i-d}return(g?-1:1)*a*Math.pow(2,i-n)}function Fr(t,r,e,n,o,i){var a,c,p,d=i*8-o-1,f=(1<<d)-1,l=f>>1,h=o===23?Math.pow(2,-24)-Math.pow(2,-77):0,g=n?0:i-1,y=n?1:-1,tr=r<0||r===0&&1/r<0?1:0;for(r=Math.abs(r),isNaN(r)||r===1/0?(c=isNaN(r)?1:0,a=f):(a=Math.floor(Math.log(r)/Math.LN2),r*(p=Math.pow(2,-a))<1&&(a--,p*=2),a+l>=1?r+=h/p:r+=h*Math.pow(2,1-l),r*p>=2&&(a++,p/=2),a+l>=f?(c=0,a=f):a+l>=1?(c=(r*p-1)*Math.pow(2,o),a=a+l):(c=r*Math.pow(2,l-1)*Math.pow(2,o),a=0));o>=8;t[e+g]=c&255,g+=y,c/=256,o-=8);for(a=a<<o|c,d+=o;d>0;t[e+g]=a&255,g+=y,a/=256,d-=8);t[e+g-y]|=tr*128}var gt={}.toString,Yr=Array.isArray||function(t){return gt.call(t)=="[object Array]"};var ht=50;u.TYPED_ARRAY_SUPPORT=globalThis.TYPED_ARRAY_SUPPORT!==void 0?globalThis.TYPED_ARRAY_SUPPORT:!0;var Tn=X();function X(){return u.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function C(t,r){if(X()<r)throw new RangeError("Invalid typed array length");return u.TYPED_ARRAY_SUPPORT?(t=new Uint8Array(r),t.__proto__=u.prototype):(t===null&&(t=new u(r)),t.length=r),t}function u(t,r,e){if(!u.TYPED_ARRAY_SUPPORT&&!(this instanceof u))return new u(t,r,e);if(typeof t=="number"){if(typeof r=="string")throw new Error("If encoding is specified then the first argument must be a string");return ur(this,t)}return Gr(this,t,r,e)}u.poolSize=8192;u._augment=function(t){return t.__proto__=u.prototype,t};function Gr(t,r,e,n){if(typeof r=="number")throw new TypeError('"value" argument must not be a number');return typeof ArrayBuffer<"u"&&r instanceof ArrayBuffer?Et(t,r,e,n):typeof r=="string"?bt(t,r,e):At(t,r)}u.from=function(t,r,e){return Gr(null,t,r,e)};u.TYPED_ARRAY_SUPPORT&&(u.prototype.__proto__=Uint8Array.prototype,u.__proto__=Uint8Array);function Wr(t){if(typeof t!="number")throw new TypeError('"size" argument must be a number');if(t<0)throw new RangeError('"size" argument must not be negative')}function xt(t,r,e,n){return Wr(r),r<=0?C(t,r):e!==void 0?typeof n=="string"?C(t,r).fill(e,n):C(t,r).fill(e):C(t,r)}u.alloc=function(t,r,e){return xt(null,t,r,e)};function ur(t,r){if(Wr(r),t=C(t,r<0?0:pr(r)|0),!u.TYPED_ARRAY_SUPPORT)for(var e=0;e<r;++e)t[e]=0;return t}u.allocUnsafe=function(t){return ur(null,t)};u.allocUnsafeSlow=function(t){return ur(null,t)};function bt(t,r,e){if((typeof e!="string"||e==="")&&(e="utf8"),!u.isEncoding(e))throw new TypeError('"encoding" must be a valid string encoding');var n=Kr(r,e)|0;t=C(t,n);var o=t.write(r,e);return o!==n&&(t=t.slice(0,o)),t}function sr(t,r){var e=r.length<0?0:pr(r.length)|0;t=C(t,e);for(var n=0;n<e;n+=1)t[n]=r[n]&255;return t}function Et(t,r,e,n){if(r.byteLength,e<0||r.byteLength<e)throw new RangeError("'offset' is out of bounds");if(r.byteLength<e+(n||0))throw new RangeError("'length' is out of bounds");return e===void 0&&n===void 0?r=new Uint8Array(r):n===void 0?r=new Uint8Array(r,e):r=new Uint8Array(r,e,n),u.TYPED_ARRAY_SUPPORT?(t=r,t.__proto__=u.prototype):t=sr(t,r),t}function At(t,r){if(S(r)){var e=pr(r.length)|0;return t=C(t,e),t.length===0||r.copy(t,0,0,e),t}if(r){if(typeof ArrayBuffer<"u"&&r.buffer instanceof ArrayBuffer||"length"in r)return typeof r.length!="number"||Ft(r.length)?C(t,0):sr(t,r);if(r.type==="Buffer"&&Yr(r.data))return sr(t,r.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function pr(t){if(t>=X())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+X().toString(16)+" bytes");return t|0}u.isBuffer=Yt;function S(t){return!!(t!=null&&t._isBuffer)}u.compare=function(r,e){if(!S(r)||!S(e))throw new TypeError("Arguments must be Buffers");if(r===e)return 0;for(var n=r.length,o=e.length,i=0,a=Math.min(n,o);i<a;++i)if(r[i]!==e[i]){n=r[i],o=e[i];break}return n<o?-1:o<n?1:0};u.isEncoding=function(r){switch(String(r).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}};u.concat=function(r,e){if(!Yr(r))throw new TypeError('"list" argument must be an Array of Buffers');if(r.length===0)return u.alloc(0);var n;if(e===void 0)for(e=0,n=0;n<r.length;++n)e+=r[n].length;var o=u.allocUnsafe(e),i=0;for(n=0;n<r.length;++n){var a=r[n];if(!S(a))throw new TypeError('"list" argument must be an Array of Buffers');a.copy(o,i),i+=a.length}return o};function Kr(t,r){if(S(t))return t.length;if(typeof ArrayBuffer<"u"&&typeof ArrayBuffer.isView=="function"&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;typeof t!="string"&&(t=""+t);var e=t.length;if(e===0)return 0;for(var n=!1;;)switch(r){case"ascii":case"latin1":case"binary":return e;case"utf8":case"utf-8":case void 0:return q(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return e*2;case"hex":return e>>>1;case"base64":return Jr(t).length;default:if(n)return q(t).length;r=(""+r).toLowerCase(),n=!0}}u.byteLength=Kr;function Tt(t,r,e){var n=!1;if((r===void 0||r<0)&&(r=0),r>this.length||((e===void 0||e>this.length)&&(e=this.length),e<=0)||(e>>>=0,r>>>=0,e<=r))return"";for(t||(t="utf8");;)switch(t){case"hex":return Ct(this,r,e);case"utf8":case"utf-8":return $r(this,r,e);case"ascii":return Bt(this,r,e);case"latin1":case"binary":return Dt(this,r,e);case"base64":return Rt(this,r,e);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Ot(this,r,e);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}u.prototype._isBuffer=!0;function M(t,r,e){var n=t[r];t[r]=t[e],t[e]=n}u.prototype.swap16=function(){var r=this.length;if(r%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var e=0;e<r;e+=2)M(this,e,e+1);return this};u.prototype.swap32=function(){var r=this.length;if(r%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var e=0;e<r;e+=4)M(this,e,e+3),M(this,e+1,e+2);return this};u.prototype.swap64=function(){var r=this.length;if(r%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var e=0;e<r;e+=8)M(this,e,e+7),M(this,e+1,e+6),M(this,e+2,e+5),M(this,e+3,e+4);return this};u.prototype.toString=function(){var r=this.length|0;return r===0?"":arguments.length===0?$r(this,0,r):Tt.apply(this,arguments)};u.prototype.equals=function(r){if(!S(r))throw new TypeError("Argument must be a Buffer");return this===r?!0:u.compare(this,r)===0};u.prototype.inspect=function(){var r="",e=ht;return this.length>0&&(r=this.toString("hex",0,e).match(/.{2}/g).join(" "),this.length>e&&(r+=" ... ")),"<Buffer "+r+">"};u.prototype.compare=function(r,e,n,o,i){if(!S(r))throw new TypeError("Argument must be a Buffer");if(e===void 0&&(e=0),n===void 0&&(n=r?r.length:0),o===void 0&&(o=0),i===void 0&&(i=this.length),e<0||n>r.length||o<0||i>this.length)throw new RangeError("out of range index");if(o>=i&&e>=n)return 0;if(o>=i)return-1;if(e>=n)return 1;if(e>>>=0,n>>>=0,o>>>=0,i>>>=0,this===r)return 0;for(var a=i-o,c=n-e,p=Math.min(a,c),d=this.slice(o,i),f=r.slice(e,n),l=0;l<p;++l)if(d[l]!==f[l]){a=d[l],c=f[l];break}return a<c?-1:c<a?1:0};function Hr(t,r,e,n,o){if(t.length===0)return-1;if(typeof e=="string"?(n=e,e=0):e>2147483647?e=2147483647:e<-2147483648&&(e=-2147483648),e=+e,isNaN(e)&&(e=o?0:t.length-1),e<0&&(e=t.length+e),e>=t.length){if(o)return-1;e=t.length-1}else if(e<0)if(o)e=0;else return-1;if(typeof r=="string"&&(r=u.from(r,n)),S(r))return r.length===0?-1:Lr(t,r,e,n,o);if(typeof r=="number")return r=r&255,u.TYPED_ARRAY_SUPPORT&&typeof Uint8Array.prototype.indexOf=="function"?o?Uint8Array.prototype.indexOf.call(t,r,e):Uint8Array.prototype.lastIndexOf.call(t,r,e):Lr(t,[r],e,n,o);throw new TypeError("val must be string, number or Buffer")}function Lr(t,r,e,n,o){var i=1,a=t.length,c=r.length;if(n!==void 0&&(n=String(n).toLowerCase(),n==="ucs2"||n==="ucs-2"||n==="utf16le"||n==="utf-16le")){if(t.length<2||r.length<2)return-1;i=2,a/=2,c/=2,e/=2}function p(g,y){return i===1?g[y]:g.readUInt16BE(y*i)}var d;if(o){var f=-1;for(d=e;d<a;d++)if(p(t,d)===p(r,f===-1?0:d-f)){if(f===-1&&(f=d),d-f+1===c)return f*i}else f!==-1&&(d-=d-f),f=-1}else for(e+c>a&&(e=a-c),d=e;d>=0;d--){for(var l=!0,h=0;h<c;h++)if(p(t,d+h)!==p(r,h)){l=!1;break}if(l)return d}return-1}u.prototype.includes=function(r,e,n){return this.indexOf(r,e,n)!==-1};u.prototype.indexOf=function(r,e,n){return Hr(this,r,e,n,!0)};u.prototype.lastIndexOf=function(r,e,n){return Hr(this,r,e,n,!1)};function yt(t,r,e,n){e=Number(e)||0;var o=t.length-e;n?(n=Number(n),n>o&&(n=o)):n=o;var i=r.length;if(i%2!==0)throw new TypeError("Invalid hex string");n>i/2&&(n=i/2);for(var a=0;a<n;++a){var c=parseInt(r.substr(a*2,2),16);if(isNaN(c))return a;t[e+a]=c}return a}function _t(t,r,e,n){return Z(q(r,t.length-e),t,e,n)}function Vr(t,r,e,n){return Z(Mt(r),t,e,n)}function It(t,r,e,n){return Vr(t,r,e,n)}function wt(t,r,e,n){return Z(Jr(r),t,e,n)}function Nt(t,r,e,n){return Z(vt(r,t.length-e),t,e,n)}u.prototype.write=function(r,e,n,o){if(e===void 0)o="utf8",n=this.length,e=0;else if(n===void 0&&typeof e=="string")o=e,n=this.length,e=0;else if(isFinite(e))e=e|0,isFinite(n)?(n=n|0,o===void 0&&(o="utf8")):(o=n,n=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var i=this.length-e;if((n===void 0||n>i)&&(n=i),r.length>0&&(n<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");o||(o="utf8");for(var a=!1;;)switch(o){case"hex":return yt(this,r,e,n);case"utf8":case"utf-8":return _t(this,r,e,n);case"ascii":return Vr(this,r,e,n);case"latin1":case"binary":return It(this,r,e,n);case"base64":return wt(this,r,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Nt(this,r,e,n);default:if(a)throw new TypeError("Unknown encoding: "+o);o=(""+o).toLowerCase(),a=!0}};u.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function Rt(t,r,e){return r===0&&e===t.length?Ur(t):Ur(t.slice(r,e))}function $r(t,r,e){e=Math.min(t.length,e);for(var n=[],o=r;o<e;){var i=t[o],a=null,c=i>239?4:i>223?3:i>191?2:1;if(o+c<=e){var p,d,f,l;switch(c){case 1:i<128&&(a=i);break;case 2:p=t[o+1],(p&192)===128&&(l=(i&31)<<6|p&63,l>127&&(a=l));break;case 3:p=t[o+1],d=t[o+2],(p&192)===128&&(d&192)===128&&(l=(i&15)<<12|(p&63)<<6|d&63,l>2047&&(l<55296||l>57343)&&(a=l));break;case 4:p=t[o+1],d=t[o+2],f=t[o+3],(p&192)===128&&(d&192)===128&&(f&192)===128&&(l=(i&15)<<18|(p&63)<<12|(d&63)<<6|f&63,l>65535&&l<1114112&&(a=l))}}a===null?(a=65533,c=1):a>65535&&(a-=65536,n.push(a>>>10&1023|55296),a=56320|a&1023),n.push(a),o+=c}return St(n)}var Mr=4096;function St(t){var r=t.length;if(r<=Mr)return String.fromCharCode.apply(String,t);for(var e="",n=0;n<r;)e+=String.fromCharCode.apply(String,t.slice(n,n+=Mr));return e}function Bt(t,r,e){var n="";e=Math.min(t.length,e);for(var o=r;o<e;++o)n+=String.fromCharCode(t[o]&127);return n}function Dt(t,r,e){var n="";e=Math.min(t.length,e);for(var o=r;o<e;++o)n+=String.fromCharCode(t[o]);return n}function Ct(t,r,e){var n=t.length;(!r||r<0)&&(r=0),(!e||e<0||e>n)&&(e=n);for(var o="",i=r;i<e;++i)o+=Lt(t[i]);return o}function Ot(t,r,e){for(var n=t.slice(r,e),o="",i=0;i<n.length;i+=2)o+=String.fromCharCode(n[i]+n[i+1]*256);return o}u.prototype.slice=function(r,e){var n=this.length;r=~~r,e=e===void 0?n:~~e,r<0?(r+=n,r<0&&(r=0)):r>n&&(r=n),e<0?(e+=n,e<0&&(e=0)):e>n&&(e=n),e<r&&(e=r);var o;if(u.TYPED_ARRAY_SUPPORT)o=this.subarray(r,e),o.__proto__=u.prototype;else{var i=e-r;o=new u(i,void 0);for(var a=0;a<i;++a)o[a]=this[a+r]}return o};function E(t,r,e){if(t%1!==0||t<0)throw new RangeError("offset is not uint");if(t+r>e)throw new RangeError("Trying to access beyond buffer length")}u.prototype.readUIntLE=function(r,e,n){r=r|0,e=e|0,n||E(r,e,this.length);for(var o=this[r],i=1,a=0;++a<e&&(i*=256);)o+=this[r+a]*i;return o};u.prototype.readUIntBE=function(r,e,n){r=r|0,e=e|0,n||E(r,e,this.length);for(var o=this[r+--e],i=1;e>0&&(i*=256);)o+=this[r+--e]*i;return o};u.prototype.readUInt8=function(r,e){return e||E(r,1,this.length),this[r]};u.prototype.readUInt16LE=function(r,e){return e||E(r,2,this.length),this[r]|this[r+1]<<8};u.prototype.readUInt16BE=function(r,e){return e||E(r,2,this.length),this[r]<<8|this[r+1]};u.prototype.readUInt32LE=function(r,e){return e||E(r,4,this.length),(this[r]|this[r+1]<<8|this[r+2]<<16)+this[r+3]*16777216};u.prototype.readUInt32BE=function(r,e){return e||E(r,4,this.length),this[r]*16777216+(this[r+1]<<16|this[r+2]<<8|this[r+3])};u.prototype.readIntLE=function(r,e,n){r=r|0,e=e|0,n||E(r,e,this.length);for(var o=this[r],i=1,a=0;++a<e&&(i*=256);)o+=this[r+a]*i;return i*=128,o>=i&&(o-=Math.pow(2,8*e)),o};u.prototype.readIntBE=function(r,e,n){r=r|0,e=e|0,n||E(r,e,this.length);for(var o=e,i=1,a=this[r+--o];o>0&&(i*=256);)a+=this[r+--o]*i;return i*=128,a>=i&&(a-=Math.pow(2,8*e)),a};u.prototype.readInt8=function(r,e){return e||E(r,1,this.length),this[r]&128?(255-this[r]+1)*-1:this[r]};u.prototype.readInt16LE=function(r,e){e||E(r,2,this.length);var n=this[r]|this[r+1]<<8;return n&32768?n|4294901760:n};u.prototype.readInt16BE=function(r,e){e||E(r,2,this.length);var n=this[r+1]|this[r]<<8;return n&32768?n|4294901760:n};u.prototype.readInt32LE=function(r,e){return e||E(r,4,this.length),this[r]|this[r+1]<<8|this[r+2]<<16|this[r+3]<<24};u.prototype.readInt32BE=function(r,e){return e||E(r,4,this.length),this[r]<<24|this[r+1]<<16|this[r+2]<<8|this[r+3]};u.prototype.readFloatLE=function(r,e){return e||E(r,4,this.length),J(this,r,!0,23,4)};u.prototype.readFloatBE=function(r,e){return e||E(r,4,this.length),J(this,r,!1,23,4)};u.prototype.readDoubleLE=function(r,e){return e||E(r,8,this.length),J(this,r,!0,52,8)};u.prototype.readDoubleBE=function(r,e){return e||E(r,8,this.length),J(this,r,!1,52,8)};function T(t,r,e,n,o,i){if(!S(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(r>o||r<i)throw new RangeError('"value" argument is out of bounds');if(e+n>t.length)throw new RangeError("Index out of range")}u.prototype.writeUIntLE=function(r,e,n,o){if(r=+r,e=e|0,n=n|0,!o){var i=Math.pow(2,8*n)-1;T(this,r,e,n,i,0)}var a=1,c=0;for(this[e]=r&255;++c<n&&(a*=256);)this[e+c]=r/a&255;return e+n};u.prototype.writeUIntBE=function(r,e,n,o){if(r=+r,e=e|0,n=n|0,!o){var i=Math.pow(2,8*n)-1;T(this,r,e,n,i,0)}var a=n-1,c=1;for(this[e+a]=r&255;--a>=0&&(c*=256);)this[e+a]=r/c&255;return e+n};u.prototype.writeUInt8=function(r,e,n){return r=+r,e=e|0,n||T(this,r,e,1,255,0),u.TYPED_ARRAY_SUPPORT||(r=Math.floor(r)),this[e]=r&255,e+1};function j(t,r,e,n){r<0&&(r=65535+r+1);for(var o=0,i=Math.min(t.length-e,2);o<i;++o)t[e+o]=(r&255<<8*(n?o:1-o))>>>(n?o:1-o)*8}u.prototype.writeUInt16LE=function(r,e,n){return r=+r,e=e|0,n||T(this,r,e,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[e]=r&255,this[e+1]=r>>>8):j(this,r,e,!0),e+2};u.prototype.writeUInt16BE=function(r,e,n){return r=+r,e=e|0,n||T(this,r,e,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[e]=r>>>8,this[e+1]=r&255):j(this,r,e,!1),e+2};function Q(t,r,e,n){r<0&&(r=4294967295+r+1);for(var o=0,i=Math.min(t.length-e,4);o<i;++o)t[e+o]=r>>>(n?o:3-o)*8&255}u.prototype.writeUInt32LE=function(r,e,n){return r=+r,e=e|0,n||T(this,r,e,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[e+3]=r>>>24,this[e+2]=r>>>16,this[e+1]=r>>>8,this[e]=r&255):Q(this,r,e,!0),e+4};u.prototype.writeUInt32BE=function(r,e,n){return r=+r,e=e|0,n||T(this,r,e,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[e]=r>>>24,this[e+1]=r>>>16,this[e+2]=r>>>8,this[e+3]=r&255):Q(this,r,e,!1),e+4};u.prototype.writeIntLE=function(r,e,n,o){if(r=+r,e=e|0,!o){var i=Math.pow(2,8*n-1);T(this,r,e,n,i-1,-i)}var a=0,c=1,p=0;for(this[e]=r&255;++a<n&&(c*=256);)r<0&&p===0&&this[e+a-1]!==0&&(p=1),this[e+a]=(r/c>>0)-p&255;return e+n};u.prototype.writeIntBE=function(r,e,n,o){if(r=+r,e=e|0,!o){var i=Math.pow(2,8*n-1);T(this,r,e,n,i-1,-i)}var a=n-1,c=1,p=0;for(this[e+a]=r&255;--a>=0&&(c*=256);)r<0&&p===0&&this[e+a+1]!==0&&(p=1),this[e+a]=(r/c>>0)-p&255;return e+n};u.prototype.writeInt8=function(r,e,n){return r=+r,e=e|0,n||T(this,r,e,1,127,-128),u.TYPED_ARRAY_SUPPORT||(r=Math.floor(r)),r<0&&(r=255+r+1),this[e]=r&255,e+1};u.prototype.writeInt16LE=function(r,e,n){return r=+r,e=e|0,n||T(this,r,e,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[e]=r&255,this[e+1]=r>>>8):j(this,r,e,!0),e+2};u.prototype.writeInt16BE=function(r,e,n){return r=+r,e=e|0,n||T(this,r,e,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[e]=r>>>8,this[e+1]=r&255):j(this,r,e,!1),e+2};u.prototype.writeInt32LE=function(r,e,n){return r=+r,e=e|0,n||T(this,r,e,4,2147483647,-2147483648),u.TYPED_ARRAY_SUPPORT?(this[e]=r&255,this[e+1]=r>>>8,this[e+2]=r>>>16,this[e+3]=r>>>24):Q(this,r,e,!0),e+4};u.prototype.writeInt32BE=function(r,e,n){return r=+r,e=e|0,n||T(this,r,e,4,2147483647,-2147483648),r<0&&(r=4294967295+r+1),u.TYPED_ARRAY_SUPPORT?(this[e]=r>>>24,this[e+1]=r>>>16,this[e+2]=r>>>8,this[e+3]=r&255):Q(this,r,e,!1),e+4};function zr(t,r,e,n,o,i){if(e+n>t.length)throw new RangeError("Index out of range");if(e<0)throw new RangeError("Index out of range")}function Xr(t,r,e,n,o){return o||zr(t,r,e,4),Fr(t,r,e,n,23,4),e+4}u.prototype.writeFloatLE=function(r,e,n){return Xr(this,r,e,!0,n)};u.prototype.writeFloatBE=function(r,e,n){return Xr(this,r,e,!1,n)};function qr(t,r,e,n,o){return o||zr(t,r,e,8),Fr(t,r,e,n,52,8),e+8}u.prototype.writeDoubleLE=function(r,e,n){return qr(this,r,e,!0,n)};u.prototype.writeDoubleBE=function(r,e,n){return qr(this,r,e,!1,n)};u.prototype.copy=function(r,e,n,o){if(n||(n=0),!o&&o!==0&&(o=this.length),e>=r.length&&(e=r.length),e||(e=0),o>0&&o<n&&(o=n),o===n||r.length===0||this.length===0)return 0;if(e<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("sourceStart out of bounds");if(o<0)throw new RangeError("sourceEnd out of bounds");o>this.length&&(o=this.length),r.length-e<o-n&&(o=r.length-e+n);var i=o-n,a;if(this===r&&n<e&&e<o)for(a=i-1;a>=0;--a)r[a+e]=this[a+n];else if(i<1e3||!u.TYPED_ARRAY_SUPPORT)for(a=0;a<i;++a)r[a+e]=this[a+n];else Uint8Array.prototype.set.call(r,this.subarray(n,n+i),e);return i};u.prototype.fill=function(r,e,n,o){if(typeof r=="string"){if(typeof e=="string"?(o=e,e=0,n=this.length):typeof n=="string"&&(o=n,n=this.length),r.length===1){var i=r.charCodeAt(0);i<256&&(r=i)}if(o!==void 0&&typeof o!="string")throw new TypeError("encoding must be a string");if(typeof o=="string"&&!u.isEncoding(o))throw new TypeError("Unknown encoding: "+o)}else typeof r=="number"&&(r=r&255);if(e<0||this.length<e||this.length<n)throw new RangeError("Out of range index");if(n<=e)return this;e=e>>>0,n=n===void 0?this.length:n>>>0,r||(r=0);var a;if(typeof r=="number")for(a=e;a<n;++a)this[a]=r;else{var c=S(r)?r:q(new u(r,o).toString()),p=c.length;for(a=0;a<n-e;++a)this[a+e]=c[a%p]}return this};var kt=/[^+\/0-9A-Za-z-_]/g;function Pt(t){if(t=Ut(t).replace(kt,""),t.length<2)return"";for(;t.length%4!==0;)t=t+"=";return t}function Ut(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}function Lt(t){return t<16?"0"+t.toString(16):t.toString(16)}function q(t,r){r=r||1/0;for(var e,n=t.length,o=null,i=[],a=0;a<n;++a){if(e=t.charCodeAt(a),e>55295&&e<57344){if(!o){if(e>56319){(r-=3)>-1&&i.push(239,191,189);continue}else if(a+1===n){(r-=3)>-1&&i.push(239,191,189);continue}o=e;continue}if(e<56320){(r-=3)>-1&&i.push(239,191,189),o=e;continue}e=(o-55296<<10|e-56320)+65536}else o&&(r-=3)>-1&&i.push(239,191,189);if(o=null,e<128){if((r-=1)<0)break;i.push(e)}else if(e<2048){if((r-=2)<0)break;i.push(e>>6|192,e&63|128)}else if(e<65536){if((r-=3)<0)break;i.push(e>>12|224,e>>6&63|128,e&63|128)}else if(e<1114112){if((r-=4)<0)break;i.push(e>>18|240,e>>12&63|128,e>>6&63|128,e&63|128)}else throw new Error("Invalid code point")}return i}function Mt(t){for(var r=[],e=0;e<t.length;++e)r.push(t.charCodeAt(e)&255);return r}function vt(t,r){for(var e,n,o,i=[],a=0;a<t.length&&!((r-=2)<0);++a)e=t.charCodeAt(a),n=e>>8,o=e%256,i.push(o),i.push(n);return i}function Jr(t){return mt(Pt(t))}function Z(t,r,e,n){for(var o=0;o<n&&!(o+e>=r.length||o>=t.length);++o)r[o+e]=t[o];return o}function Ft(t){return t!==t}function Yt(t){return t!=null&&(!!t._isBuffer||jr(t)||Gt(t))}function jr(t){return!!t.constructor&&typeof t.constructor.isBuffer=="function"&&t.constructor.isBuffer(t)}function Gt(t){return typeof t.readFloatLE=="function"&&typeof t.slice=="function"&&jr(t.slice(0,0))}import{encodeAddress as Wt,decodeAddress as Pn}from"algosdk";function lr(t){return new Uint8Array(u.from(t))}import Kt from"bignumber.js";Kt.config({DECIMAL_PLACES:40,EXPONENTIAL_AT:45});var Zn=`{"theme1":{"value":"${m.env.FRONTEND_URL}/Theme%3DDark.svg","active":true},"theme2":{"value":"${m.env.FRONTEND_URL}/Theme%3DLight.svg","active":true},"theme3":{"value":"${m.env.FRONTEND_URL}/Theme%3DLight.svg","active":true}}`;var Qr={V1_1:"v1_1",V2:"v2"},no={[Qr.V1_1]:{testnet:62368684,mainnet:552635992},[Qr.V2]:{testnet:148607e3,mainnet:1002541853}};import su from"algosdk";import*as nn from"bs58";import Qo from"algosdk";import si from"algosdk";import $i from"algosdk";var _i={SMALLESTUNIT:m.env.SMALLEST_UNIT},Ii={SMALLEST_UNITS:m.env.SMALLEST_UNIT};var Bi=["point-system.discordEnabled","point-system.telegramBotName","point-system.telegramBotId","point-system.telegramEnabled","point-system.telegramGroupId","point-system.telegramGroupName","point-system.twitterAccountId","point-system.twitterAccountName","point-system.twitterEnabled","point-system.twitterJobEnabled","point-system.guideLink"];import uc from"algosdk";var ee=(o=>(o.GLOBAL_PAIR_DELISTING="GLOBAL_PAIR_DELISTING",o.GLOBAL_NEW_PAIR_LISTING="GLOBAL_NEW_PAIR_LISTING",o.GLOBAL_SYSTEM_MAINTENANCE="GLOBAL_SYSTEM_MAINTENANCE",o.GLOBAL_SMART_CONTRACT_UPDATE="GLOBAL_SMART_CONTRACT_UPDATE",o))(ee||{}),te=(n=>(n.ACCOUNT_POINTS_UNLOCK_ACHIEVEMENT="ACCOUNT_POINTS_UNLOCK_ACHIEVEMENT",n.ACCOUNT_KYC_STATUS_CHANGED="ACCOUNT_KYC_STATUS_CHANGED",n.ACCOUNT_AFFILIATE_DASHBOARD_UNLOCKED="ACCOUNT_AFFILIATE_DASHBOARD_UNLOCKED",n))(te||{}),ns={...ee,...te};import Nc from"algosdk";var un=(t,r)=>r===8?"MX":r===1?"":`Ethereum Signed Message:
2
- ${t.length}`,ae=(t,r,e)=>{let n=s.from(t,r);return s.concat([lr(un(n,e)),n])},se=t=>{switch(t){case"ALGORAND":return 8;case"SOLANA":return 1;case"EVM":return 5;default:return 5}};function on(t){let r=x.fromSigned(s.from(t));return BigInt(r.toString())}function ln(t){return x.toUnsigned(new x.BN(String(t)))}function an(t){let r=ln(t);if(r.length>32)throw new Error("Invalid value. The buffer length of the value is more than 32");return new Uint8Array(x.setLengthLeft(r,32))}var sn=t=>{if(t.length!==32)throw new Error("Invalid address bytes. The address buffer length is not equel 32");let r=s.from(t).toString("hex");if(r.slice(0,24)!=="000000000000000000000000")throw console.log("normalizedAddress",r),new Error("Invalid normalized address");let e="0x"+r.slice(-40);if(!dn(e))throw new Error("Invalid hex address");return e},pn=t=>new Uint8Array(x.setLengthLeft(mr(t),32)),mr=t=>s.from(mn(t),"hex"),mn=t=>t.startsWith("0x")?t.slice(2):t,dn=t=>x.isValidAddress(t),ce=(t,r)=>{let e=x.keccak256(t),{r:n,s:o,v:i}=x.fromRpcSig(r);return x.ecrecover(e,i,n,o)},Pu=(t,r,e,n)=>fn(ae(e,n,se("EVM")),t,r),fn=(t,r,e)=>{let n=ce(t,r);return x.bufferToHex(x.publicToAddress(n)).toLowerCase()===e.toLowerCase()},oe=t=>new Uint8Array(x.keccak256(s.from(t)));export{on as decode32Bytes,pn as decodeAndNormalizeAddress,mr as decodeHexString,an as encode32Bytes,sn as encodeAddress,ln as encodeBigNumber,dn as isAddress,oe as keccak256,ce as recoverPublicKey,mn as unpadHexPrefix,fn as verifyMessage,Pu as verifySignature};
1
+ function fr(){throw new Error("setTimeout has not been defined")}function gr(){throw new Error("clearTimeout has not been defined")}var D=fr,P=gr;typeof globalThis.setTimeout=="function"&&(D=setTimeout);typeof globalThis.clearTimeout=="function"&&(P=clearTimeout);function hr(t){if(D===setTimeout)return setTimeout(t,0);if((D===fr||!D)&&setTimeout)return D=setTimeout,setTimeout(t,0);try{return D(t,0)}catch{try{return D.call(null,t,0)}catch{return D.call(this,t,0)}}}function ue(t){if(P===clearTimeout)return clearTimeout(t);if((P===gr||!P)&&clearTimeout)return P=clearTimeout,clearTimeout(t);try{return P(t)}catch{try{return P.call(null,t)}catch{return P.call(this,t)}}}var O=[],F=!1,k,G=-1;function pe(){!F||!k||(F=!1,k.length?O=k.concat(O):G=-1,O.length&&xr())}function xr(){if(!F){var t=hr(pe);F=!0;for(var r=O.length;r;){for(k=O,O=[];++G<r;)k&&k[G].run();G=-1,r=O.length}k=null,F=!1,ue(t)}}function le(t){var r=new Array(arguments.length-1);if(arguments.length>1)for(var e=1;e<arguments.length;e++)r[e-1]=arguments[e];O.push(new Er(t,r)),O.length===1&&!F&&hr(xr)}function Er(t,r){this.fun=t,this.array=r}Er.prototype.run=function(){this.fun.apply(null,this.array)};var me="browser",de="browser",fe=!0,ge={},he=[],xe="",Ee={},be={},Ae={};function U(){}var Te=U,_e=U,ye=U,Ie=U,Re=U,we=U,Ne=U;function Se(t){throw new Error("process.binding is not supported")}function Oe(){return"/"}function Be(t){throw new Error("process.chdir is not supported")}function Ce(){return 0}var v=globalThis.performance||{},De=v.now||v.mozNow||v.msNow||v.oNow||v.webkitNow||function(){return new Date().getTime()};function Pe(t){var r=De.call(v)*.001,e=Math.floor(r),n=Math.floor(r%1*1e9);return t&&(e=e-t[0],n=n-t[1],n<0&&(e--,n+=1e9)),[e,n]}var ke=new Date;function Ue(){var t=new Date,r=t-ke;return r/1e3}var l={nextTick:le,title:me,browser:fe,env:ge,argv:he,version:xe,versions:Ee,on:Te,addListener:_e,once:ye,off:Ie,removeListener:Re,removeAllListeners:we,emit:Ne,binding:Se,cwd:Oe,chdir:Be,umask:Ce,hrtime:Pe,platform:de,release:be,config:Ae,uptime:Ue},dr={};Object.keys(dr).forEach(t=>{let r=t.split("."),e=l;for(let n=0;n<r.length;n++){let o=r[n];n===r.length-1?e[o]=dr[t]:e=e[o]||(e[o]={})}});var R=[],y=[],Le=typeof Uint8Array<"u"?Uint8Array:Array,or=!1;function _r(){or=!0;for(var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",r=0,e=t.length;r<e;++r)R[r]=t[r],y[t.charCodeAt(r)]=r;y[45]=62,y[95]=63}function Me(t){or||_r();var r,e,n,o,i,a,c=t.length;if(c%4>0)throw new Error("Invalid string. Length must be a multiple of 4");i=t[c-2]==="="?2:t[c-1]==="="?1:0,a=new Le(c*3/4-i),n=i>0?c-4:c;var p=0;for(r=0,e=0;r<n;r+=4,e+=3)o=y[t.charCodeAt(r)]<<18|y[t.charCodeAt(r+1)]<<12|y[t.charCodeAt(r+2)]<<6|y[t.charCodeAt(r+3)],a[p++]=o>>16&255,a[p++]=o>>8&255,a[p++]=o&255;return i===2?(o=y[t.charCodeAt(r)]<<2|y[t.charCodeAt(r+1)]>>4,a[p++]=o&255):i===1&&(o=y[t.charCodeAt(r)]<<10|y[t.charCodeAt(r+1)]<<4|y[t.charCodeAt(r+2)]>>2,a[p++]=o>>8&255,a[p++]=o&255),a}function ve(t){return R[t>>18&63]+R[t>>12&63]+R[t>>6&63]+R[t&63]}function Fe(t,r,e){for(var n,o=[],i=r;i<e;i+=3)n=(t[i]<<16)+(t[i+1]<<8)+t[i+2],o.push(ve(n));return o.join("")}function br(t){or||_r();for(var r,e=t.length,n=e%3,o="",i=[],a=16383,c=0,p=e-n;c<p;c+=a)i.push(Fe(t,c,c+a>p?p:c+a));return n===1?(r=t[e-1],o+=R[r>>2],o+=R[r<<4&63],o+="=="):n===2&&(r=(t[e-2]<<8)+t[e-1],o+=R[r>>10],o+=R[r>>4&63],o+=R[r<<2&63],o+="="),i.push(o),i.join("")}s.TYPED_ARRAY_SUPPORT=globalThis.TYPED_ARRAY_SUPPORT!==void 0?globalThis.TYPED_ARRAY_SUPPORT:!0;function K(){return s.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function B(t,r){if(K()<r)throw new RangeError("Invalid typed array length");return s.TYPED_ARRAY_SUPPORT?(t=new Uint8Array(r),t.__proto__=s.prototype):(t===null&&(t=new s(r)),t.length=r),t}function s(t,r,e){if(!s.TYPED_ARRAY_SUPPORT&&!(this instanceof s))return new s(t,r,e);if(typeof t=="number"){if(typeof r=="string")throw new Error("If encoding is specified then the first argument must be a string");return ir(this,t)}return yr(this,t,r,e)}s.poolSize=8192;s._augment=function(t){return t.__proto__=s.prototype,t};function yr(t,r,e,n){if(typeof r=="number")throw new TypeError('"value" argument must not be a number');return typeof ArrayBuffer<"u"&&r instanceof ArrayBuffer?Ke(t,r,e,n):typeof r=="string"?Ge(t,r,e):We(t,r)}s.from=function(t,r,e){return yr(null,t,r,e)};s.kMaxLength=K();s.TYPED_ARRAY_SUPPORT&&(s.prototype.__proto__=Uint8Array.prototype,s.__proto__=Uint8Array,typeof Symbol<"u"&&Symbol.species&&s[Symbol.species]);function Ir(t){if(typeof t!="number")throw new TypeError('"size" argument must be a number');if(t<0)throw new RangeError('"size" argument must not be negative')}function Ye(t,r,e,n){return Ir(r),r<=0?B(t,r):e!==void 0?typeof n=="string"?B(t,r).fill(e,n):B(t,r).fill(e):B(t,r)}s.alloc=function(t,r,e){return Ye(null,t,r,e)};function ir(t,r){if(Ir(r),t=B(t,r<0?0:ar(r)|0),!s.TYPED_ARRAY_SUPPORT)for(var e=0;e<r;++e)t[e]=0;return t}s.allocUnsafe=function(t){return ir(null,t)};s.allocUnsafeSlow=function(t){return ir(null,t)};function Ge(t,r,e){if((typeof e!="string"||e==="")&&(e="utf8"),!s.isEncoding(e))throw new TypeError('"encoding" must be a valid string encoding');var n=Rr(r,e)|0;t=B(t,n);var o=t.write(r,e);return o!==n&&(t=t.slice(0,o)),t}function nr(t,r){var e=r.length<0?0:ar(r.length)|0;t=B(t,e);for(var n=0;n<e;n+=1)t[n]=r[n]&255;return t}function Ke(t,r,e,n){if(r.byteLength,e<0||r.byteLength<e)throw new RangeError("'offset' is out of bounds");if(r.byteLength<e+(n||0))throw new RangeError("'length' is out of bounds");return e===void 0&&n===void 0?r=new Uint8Array(r):n===void 0?r=new Uint8Array(r,e):r=new Uint8Array(r,e,n),s.TYPED_ARRAY_SUPPORT?(t=r,t.__proto__=s.prototype):t=nr(t,r),t}function We(t,r){if(w(r)){var e=ar(r.length)|0;return t=B(t,e),t.length===0||r.copy(t,0,0,e),t}if(r){if(typeof ArrayBuffer<"u"&&r.buffer instanceof ArrayBuffer||"length"in r)return typeof r.length!="number"||ct(r.length)?B(t,0):nr(t,r);if(r.type==="Buffer"&&Array.isArray(r.data))return nr(t,r.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function ar(t){if(t>=K())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+K().toString(16)+" bytes");return t|0}s.isBuffer=ut;function w(t){return!!(t!=null&&t._isBuffer)}s.compare=function(r,e){if(!w(r)||!w(e))throw new TypeError("Arguments must be Buffers");if(r===e)return 0;for(var n=r.length,o=e.length,i=0,a=Math.min(n,o);i<a;++i)if(r[i]!==e[i]){n=r[i],o=e[i];break}return n<o?-1:o<n?1:0};s.isEncoding=function(r){switch(String(r).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}};s.concat=function(r,e){if(!Array.isArray(r))throw new TypeError('"list" argument must be an Array of Buffers');if(r.length===0)return s.alloc(0);var n;if(e===void 0)for(e=0,n=0;n<r.length;++n)e+=r[n].length;var o=s.allocUnsafe(e),i=0;for(n=0;n<r.length;++n){var a=r[n];if(!w(a))throw new TypeError('"list" argument must be an Array of Buffers');a.copy(o,i),i+=a.length}return o};function Rr(t,r){if(w(t))return t.length;if(typeof ArrayBuffer<"u"&&typeof ArrayBuffer.isView=="function"&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;typeof t!="string"&&(t=""+t);var e=t.length;if(e===0)return 0;for(var n=!1;;)switch(r){case"ascii":case"latin1":case"binary":return e;case"utf8":case"utf-8":case void 0:return W(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return e*2;case"hex":return e>>>1;case"base64":return Dr(t).length;default:if(n)return W(t).length;r=(""+r).toLowerCase(),n=!0}}s.byteLength=Rr;function He(t,r,e){var n=!1;if((r===void 0||r<0)&&(r=0),r>this.length||((e===void 0||e>this.length)&&(e=this.length),e<=0)||(e>>>=0,r>>>=0,e<=r))return"";for(t||(t="utf8");;)switch(t){case"hex":return rt(this,r,e);case"utf8":case"utf-8":return Sr(this,r,e);case"ascii":return Qe(this,r,e);case"latin1":case"binary":return Ze(this,r,e);case"base64":return Je(this,r,e);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return et(this,r,e);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}s.prototype._isBuffer=!0;function L(t,r,e){var n=t[r];t[r]=t[e],t[e]=n}s.prototype.swap16=function(){var r=this.length;if(r%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var e=0;e<r;e+=2)L(this,e,e+1);return this};s.prototype.swap32=function(){var r=this.length;if(r%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var e=0;e<r;e+=4)L(this,e,e+3),L(this,e+1,e+2);return this};s.prototype.swap64=function(){var r=this.length;if(r%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var e=0;e<r;e+=8)L(this,e,e+7),L(this,e+1,e+6),L(this,e+2,e+5),L(this,e+3,e+4);return this};s.prototype.toString=function(){var r=this.length|0;return r===0?"":arguments.length===0?Sr(this,0,r):He.apply(this,arguments)};s.prototype.equals=function(r){if(!w(r))throw new TypeError("Argument must be a Buffer");return this===r?!0:s.compare(this,r)===0};s.prototype.compare=function(r,e,n,o,i){if(!w(r))throw new TypeError("Argument must be a Buffer");if(e===void 0&&(e=0),n===void 0&&(n=r?r.length:0),o===void 0&&(o=0),i===void 0&&(i=this.length),e<0||n>r.length||o<0||i>this.length)throw new RangeError("out of range index");if(o>=i&&e>=n)return 0;if(o>=i)return-1;if(e>=n)return 1;if(e>>>=0,n>>>=0,o>>>=0,i>>>=0,this===r)return 0;for(var a=i-o,c=n-e,p=Math.min(a,c),d=this.slice(o,i),f=r.slice(e,n),m=0;m<p;++m)if(d[m]!==f[m]){a=d[m],c=f[m];break}return a<c?-1:c<a?1:0};function wr(t,r,e,n,o){if(t.length===0)return-1;if(typeof e=="string"?(n=e,e=0):e>2147483647?e=2147483647:e<-2147483648&&(e=-2147483648),e=+e,isNaN(e)&&(e=o?0:t.length-1),e<0&&(e=t.length+e),e>=t.length){if(o)return-1;e=t.length-1}else if(e<0)if(o)e=0;else return-1;if(typeof r=="string"&&(r=s.from(r,n)),w(r))return r.length===0?-1:Ar(t,r,e,n,o);if(typeof r=="number")return r=r&255,s.TYPED_ARRAY_SUPPORT&&typeof Uint8Array.prototype.indexOf=="function"?o?Uint8Array.prototype.indexOf.call(t,r,e):Uint8Array.prototype.lastIndexOf.call(t,r,e):Ar(t,[r],e,n,o);throw new TypeError("val must be string, number or Buffer")}function Ar(t,r,e,n,o){var i=1,a=t.length,c=r.length;if(n!==void 0&&(n=String(n).toLowerCase(),n==="ucs2"||n==="ucs-2"||n==="utf16le"||n==="utf-16le")){if(t.length<2||r.length<2)return-1;i=2,a/=2,c/=2,e/=2}function p(g,_){return i===1?g[_]:g.readUInt16BE(_*i)}var d;if(o){var f=-1;for(d=e;d<a;d++)if(p(t,d)===p(r,f===-1?0:d-f)){if(f===-1&&(f=d),d-f+1===c)return f*i}else f!==-1&&(d-=d-f),f=-1}else for(e+c>a&&(e=a-c),d=e;d>=0;d--){for(var m=!0,h=0;h<c;h++)if(p(t,d+h)!==p(r,h)){m=!1;break}if(m)return d}return-1}s.prototype.includes=function(r,e,n){return this.indexOf(r,e,n)!==-1};s.prototype.indexOf=function(r,e,n){return wr(this,r,e,n,!0)};s.prototype.lastIndexOf=function(r,e,n){return wr(this,r,e,n,!1)};function Ve(t,r,e,n){e=Number(e)||0;var o=t.length-e;n?(n=Number(n),n>o&&(n=o)):n=o;var i=r.length;if(i%2!==0)throw new TypeError("Invalid hex string");n>i/2&&(n=i/2);for(var a=0;a<n;++a){var c=parseInt(r.substr(a*2,2),16);if(isNaN(c))return a;t[e+a]=c}return a}function $e(t,r,e,n){return $(W(r,t.length-e),t,e,n)}function Nr(t,r,e,n){return $(at(r),t,e,n)}function Xe(t,r,e,n){return Nr(t,r,e,n)}function ze(t,r,e,n){return $(Dr(r),t,e,n)}function qe(t,r,e,n){return $(st(r,t.length-e),t,e,n)}s.prototype.write=function(r,e,n,o){if(e===void 0)o="utf8",n=this.length,e=0;else if(n===void 0&&typeof e=="string")o=e,n=this.length,e=0;else if(isFinite(e))e=e|0,isFinite(n)?(n=n|0,o===void 0&&(o="utf8")):(o=n,n=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var i=this.length-e;if((n===void 0||n>i)&&(n=i),r.length>0&&(n<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");o||(o="utf8");for(var a=!1;;)switch(o){case"hex":return Ve(this,r,e,n);case"utf8":case"utf-8":return $e(this,r,e,n);case"ascii":return Nr(this,r,e,n);case"latin1":case"binary":return Xe(this,r,e,n);case"base64":return ze(this,r,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return qe(this,r,e,n);default:if(a)throw new TypeError("Unknown encoding: "+o);o=(""+o).toLowerCase(),a=!0}};s.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function Je(t,r,e){return r===0&&e===t.length?br(t):br(t.slice(r,e))}function Sr(t,r,e){e=Math.min(t.length,e);for(var n=[],o=r;o<e;){var i=t[o],a=null,c=i>239?4:i>223?3:i>191?2:1;if(o+c<=e){var p,d,f,m;switch(c){case 1:i<128&&(a=i);break;case 2:p=t[o+1],(p&192)===128&&(m=(i&31)<<6|p&63,m>127&&(a=m));break;case 3:p=t[o+1],d=t[o+2],(p&192)===128&&(d&192)===128&&(m=(i&15)<<12|(p&63)<<6|d&63,m>2047&&(m<55296||m>57343)&&(a=m));break;case 4:p=t[o+1],d=t[o+2],f=t[o+3],(p&192)===128&&(d&192)===128&&(f&192)===128&&(m=(i&15)<<18|(p&63)<<12|(d&63)<<6|f&63,m>65535&&m<1114112&&(a=m))}}a===null?(a=65533,c=1):a>65535&&(a-=65536,n.push(a>>>10&1023|55296),a=56320|a&1023),n.push(a),o+=c}return je(n)}var Tr=4096;function je(t){var r=t.length;if(r<=Tr)return String.fromCharCode.apply(String,t);for(var e="",n=0;n<r;)e+=String.fromCharCode.apply(String,t.slice(n,n+=Tr));return e}function Qe(t,r,e){var n="";e=Math.min(t.length,e);for(var o=r;o<e;++o)n+=String.fromCharCode(t[o]&127);return n}function Ze(t,r,e){var n="";e=Math.min(t.length,e);for(var o=r;o<e;++o)n+=String.fromCharCode(t[o]);return n}function rt(t,r,e){var n=t.length;(!r||r<0)&&(r=0),(!e||e<0||e>n)&&(e=n);for(var o="",i=r;i<e;++i)o+=it(t[i]);return o}function et(t,r,e){for(var n=t.slice(r,e),o="",i=0;i<n.length;i+=2)o+=String.fromCharCode(n[i]+n[i+1]*256);return o}s.prototype.slice=function(r,e){var n=this.length;r=~~r,e=e===void 0?n:~~e,r<0?(r+=n,r<0&&(r=0)):r>n&&(r=n),e<0?(e+=n,e<0&&(e=0)):e>n&&(e=n),e<r&&(e=r);var o;if(s.TYPED_ARRAY_SUPPORT)o=this.subarray(r,e),o.__proto__=s.prototype;else{var i=e-r;o=new s(i,void 0);for(var a=0;a<i;++a)o[a]=this[a+r]}return o};function E(t,r,e){if(t%1!==0||t<0)throw new RangeError("offset is not uint");if(t+r>e)throw new RangeError("Trying to access beyond buffer length")}s.prototype.readUIntLE=function(r,e,n){r=r|0,e=e|0,n||E(r,e,this.length);for(var o=this[r],i=1,a=0;++a<e&&(i*=256);)o+=this[r+a]*i;return o};s.prototype.readUIntBE=function(r,e,n){r=r|0,e=e|0,n||E(r,e,this.length);for(var o=this[r+--e],i=1;e>0&&(i*=256);)o+=this[r+--e]*i;return o};s.prototype.readUInt8=function(r,e){return e||E(r,1,this.length),this[r]};s.prototype.readUInt16LE=function(r,e){return e||E(r,2,this.length),this[r]|this[r+1]<<8};s.prototype.readUInt16BE=function(r,e){return e||E(r,2,this.length),this[r]<<8|this[r+1]};s.prototype.readUInt32LE=function(r,e){return e||E(r,4,this.length),(this[r]|this[r+1]<<8|this[r+2]<<16)+this[r+3]*16777216};s.prototype.readUInt32BE=function(r,e){return e||E(r,4,this.length),this[r]*16777216+(this[r+1]<<16|this[r+2]<<8|this[r+3])};s.prototype.readIntLE=function(r,e,n){r=r|0,e=e|0,n||E(r,e,this.length);for(var o=this[r],i=1,a=0;++a<e&&(i*=256);)o+=this[r+a]*i;return i*=128,o>=i&&(o-=Math.pow(2,8*e)),o};s.prototype.readIntBE=function(r,e,n){r=r|0,e=e|0,n||E(r,e,this.length);for(var o=e,i=1,a=this[r+--o];o>0&&(i*=256);)a+=this[r+--o]*i;return i*=128,a>=i&&(a-=Math.pow(2,8*e)),a};s.prototype.readInt8=function(r,e){return e||E(r,1,this.length),this[r]&128?(255-this[r]+1)*-1:this[r]};s.prototype.readInt16LE=function(r,e){e||E(r,2,this.length);var n=this[r]|this[r+1]<<8;return n&32768?n|4294901760:n};s.prototype.readInt16BE=function(r,e){e||E(r,2,this.length);var n=this[r+1]|this[r]<<8;return n&32768?n|4294901760:n};s.prototype.readInt32LE=function(r,e){return e||E(r,4,this.length),this[r]|this[r+1]<<8|this[r+2]<<16|this[r+3]<<24};s.prototype.readInt32BE=function(r,e){return e||E(r,4,this.length),this[r]<<24|this[r+1]<<16|this[r+2]<<8|this[r+3]};s.prototype.readFloatLE=function(r,e){return e||E(r,4,this.length),X(this,r,!0,23,4)};s.prototype.readFloatBE=function(r,e){return e||E(r,4,this.length),X(this,r,!1,23,4)};s.prototype.readDoubleLE=function(r,e){return e||E(r,8,this.length),X(this,r,!0,52,8)};s.prototype.readDoubleBE=function(r,e){return e||E(r,8,this.length),X(this,r,!1,52,8)};function A(t,r,e,n,o,i){if(!w(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(r>o||r<i)throw new RangeError('"value" argument is out of bounds');if(e+n>t.length)throw new RangeError("Index out of range")}s.prototype.writeUIntLE=function(r,e,n,o){if(r=+r,e=e|0,n=n|0,!o){var i=Math.pow(2,8*n)-1;A(this,r,e,n,i,0)}var a=1,c=0;for(this[e]=r&255;++c<n&&(a*=256);)this[e+c]=r/a&255;return e+n};s.prototype.writeUIntBE=function(r,e,n,o){if(r=+r,e=e|0,n=n|0,!o){var i=Math.pow(2,8*n)-1;A(this,r,e,n,i,0)}var a=n-1,c=1;for(this[e+a]=r&255;--a>=0&&(c*=256);)this[e+a]=r/c&255;return e+n};s.prototype.writeUInt8=function(r,e,n){return r=+r,e=e|0,n||A(this,r,e,1,255,0),s.TYPED_ARRAY_SUPPORT||(r=Math.floor(r)),this[e]=r&255,e+1};function H(t,r,e,n){r<0&&(r=65535+r+1);for(var o=0,i=Math.min(t.length-e,2);o<i;++o)t[e+o]=(r&255<<8*(n?o:1-o))>>>(n?o:1-o)*8}s.prototype.writeUInt16LE=function(r,e,n){return r=+r,e=e|0,n||A(this,r,e,2,65535,0),s.TYPED_ARRAY_SUPPORT?(this[e]=r&255,this[e+1]=r>>>8):H(this,r,e,!0),e+2};s.prototype.writeUInt16BE=function(r,e,n){return r=+r,e=e|0,n||A(this,r,e,2,65535,0),s.TYPED_ARRAY_SUPPORT?(this[e]=r>>>8,this[e+1]=r&255):H(this,r,e,!1),e+2};function V(t,r,e,n){r<0&&(r=4294967295+r+1);for(var o=0,i=Math.min(t.length-e,4);o<i;++o)t[e+o]=r>>>(n?o:3-o)*8&255}s.prototype.writeUInt32LE=function(r,e,n){return r=+r,e=e|0,n||A(this,r,e,4,4294967295,0),s.TYPED_ARRAY_SUPPORT?(this[e+3]=r>>>24,this[e+2]=r>>>16,this[e+1]=r>>>8,this[e]=r&255):V(this,r,e,!0),e+4};s.prototype.writeUInt32BE=function(r,e,n){return r=+r,e=e|0,n||A(this,r,e,4,4294967295,0),s.TYPED_ARRAY_SUPPORT?(this[e]=r>>>24,this[e+1]=r>>>16,this[e+2]=r>>>8,this[e+3]=r&255):V(this,r,e,!1),e+4};s.prototype.writeIntLE=function(r,e,n,o){if(r=+r,e=e|0,!o){var i=Math.pow(2,8*n-1);A(this,r,e,n,i-1,-i)}var a=0,c=1,p=0;for(this[e]=r&255;++a<n&&(c*=256);)r<0&&p===0&&this[e+a-1]!==0&&(p=1),this[e+a]=(r/c>>0)-p&255;return e+n};s.prototype.writeIntBE=function(r,e,n,o){if(r=+r,e=e|0,!o){var i=Math.pow(2,8*n-1);A(this,r,e,n,i-1,-i)}var a=n-1,c=1,p=0;for(this[e+a]=r&255;--a>=0&&(c*=256);)r<0&&p===0&&this[e+a+1]!==0&&(p=1),this[e+a]=(r/c>>0)-p&255;return e+n};s.prototype.writeInt8=function(r,e,n){return r=+r,e=e|0,n||A(this,r,e,1,127,-128),s.TYPED_ARRAY_SUPPORT||(r=Math.floor(r)),r<0&&(r=255+r+1),this[e]=r&255,e+1};s.prototype.writeInt16LE=function(r,e,n){return r=+r,e=e|0,n||A(this,r,e,2,32767,-32768),s.TYPED_ARRAY_SUPPORT?(this[e]=r&255,this[e+1]=r>>>8):H(this,r,e,!0),e+2};s.prototype.writeInt16BE=function(r,e,n){return r=+r,e=e|0,n||A(this,r,e,2,32767,-32768),s.TYPED_ARRAY_SUPPORT?(this[e]=r>>>8,this[e+1]=r&255):H(this,r,e,!1),e+2};s.prototype.writeInt32LE=function(r,e,n){return r=+r,e=e|0,n||A(this,r,e,4,2147483647,-2147483648),s.TYPED_ARRAY_SUPPORT?(this[e]=r&255,this[e+1]=r>>>8,this[e+2]=r>>>16,this[e+3]=r>>>24):V(this,r,e,!0),e+4};s.prototype.writeInt32BE=function(r,e,n){return r=+r,e=e|0,n||A(this,r,e,4,2147483647,-2147483648),r<0&&(r=4294967295+r+1),s.TYPED_ARRAY_SUPPORT?(this[e]=r>>>24,this[e+1]=r>>>16,this[e+2]=r>>>8,this[e+3]=r&255):V(this,r,e,!1),e+4};function Or(t,r,e,n,o,i){if(e+n>t.length)throw new RangeError("Index out of range");if(e<0)throw new RangeError("Index out of range")}function Br(t,r,e,n,o){return o||Or(t,r,e,4,34028234663852886e22,-34028234663852886e22),kr(t,r,e,n,23,4),e+4}s.prototype.writeFloatLE=function(r,e,n){return Br(this,r,e,!0,n)};s.prototype.writeFloatBE=function(r,e,n){return Br(this,r,e,!1,n)};function Cr(t,r,e,n,o){return o||Or(t,r,e,8,17976931348623157e292,-17976931348623157e292),kr(t,r,e,n,52,8),e+8}s.prototype.writeDoubleLE=function(r,e,n){return Cr(this,r,e,!0,n)};s.prototype.writeDoubleBE=function(r,e,n){return Cr(this,r,e,!1,n)};s.prototype.copy=function(r,e,n,o){if(n||(n=0),!o&&o!==0&&(o=this.length),e>=r.length&&(e=r.length),e||(e=0),o>0&&o<n&&(o=n),o===n||r.length===0||this.length===0)return 0;if(e<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("sourceStart out of bounds");if(o<0)throw new RangeError("sourceEnd out of bounds");o>this.length&&(o=this.length),r.length-e<o-n&&(o=r.length-e+n);var i=o-n,a;if(this===r&&n<e&&e<o)for(a=i-1;a>=0;--a)r[a+e]=this[a+n];else if(i<1e3||!s.TYPED_ARRAY_SUPPORT)for(a=0;a<i;++a)r[a+e]=this[a+n];else Uint8Array.prototype.set.call(r,this.subarray(n,n+i),e);return i};s.prototype.fill=function(r,e,n,o){if(typeof r=="string"){if(typeof e=="string"?(o=e,e=0,n=this.length):typeof n=="string"&&(o=n,n=this.length),r.length===1){var i=r.charCodeAt(0);i<256&&(r=i)}if(o!==void 0&&typeof o!="string")throw new TypeError("encoding must be a string");if(typeof o=="string"&&!s.isEncoding(o))throw new TypeError("Unknown encoding: "+o)}else typeof r=="number"&&(r=r&255);if(e<0||this.length<e||this.length<n)throw new RangeError("Out of range index");if(n<=e)return this;e=e>>>0,n=n===void 0?this.length:n>>>0,r||(r=0);var a;if(typeof r=="number")for(a=e;a<n;++a)this[a]=r;else{var c=w(r)?r:W(new s(r,o).toString()),p=c.length;for(a=0;a<n-e;++a)this[a+e]=c[a%p]}return this};var tt=/[^+\/0-9A-Za-z-_]/g;function nt(t){if(t=ot(t).replace(tt,""),t.length<2)return"";for(;t.length%4!==0;)t=t+"=";return t}function ot(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}function it(t){return t<16?"0"+t.toString(16):t.toString(16)}function W(t,r){r=r||1/0;for(var e,n=t.length,o=null,i=[],a=0;a<n;++a){if(e=t.charCodeAt(a),e>55295&&e<57344){if(!o){if(e>56319){(r-=3)>-1&&i.push(239,191,189);continue}else if(a+1===n){(r-=3)>-1&&i.push(239,191,189);continue}o=e;continue}if(e<56320){(r-=3)>-1&&i.push(239,191,189),o=e;continue}e=(o-55296<<10|e-56320)+65536}else o&&(r-=3)>-1&&i.push(239,191,189);if(o=null,e<128){if((r-=1)<0)break;i.push(e)}else if(e<2048){if((r-=2)<0)break;i.push(e>>6|192,e&63|128)}else if(e<65536){if((r-=3)<0)break;i.push(e>>12|224,e>>6&63|128,e&63|128)}else if(e<1114112){if((r-=4)<0)break;i.push(e>>18|240,e>>12&63|128,e>>6&63|128,e&63|128)}else throw new Error("Invalid code point")}return i}function at(t){for(var r=[],e=0;e<t.length;++e)r.push(t.charCodeAt(e)&255);return r}function st(t,r){for(var e,n,o,i=[],a=0;a<t.length&&!((r-=2)<0);++a)e=t.charCodeAt(a),n=e>>8,o=e%256,i.push(o),i.push(n);return i}function Dr(t){return Me(nt(t))}function $(t,r,e,n){for(var o=0;o<n&&!(o+e>=r.length||o>=t.length);++o)r[o+e]=t[o];return o}function ct(t){return t!==t}function ut(t){return t!=null&&(!!t._isBuffer||Pr(t)||pt(t))}function Pr(t){return!!t.constructor&&typeof t.constructor.isBuffer=="function"&&t.constructor.isBuffer(t)}function pt(t){return typeof t.readFloatLE=="function"&&typeof t.slice=="function"&&Pr(t.slice(0,0))}function X(t,r,e,n,o){var i,a,c=o*8-n-1,p=(1<<c)-1,d=p>>1,f=-7,m=e?o-1:0,h=e?-1:1,g=t[r+m];for(m+=h,i=g&(1<<-f)-1,g>>=-f,f+=c;f>0;i=i*256+t[r+m],m+=h,f-=8);for(a=i&(1<<-f)-1,i>>=-f,f+=n;f>0;a=a*256+t[r+m],m+=h,f-=8);if(i===0)i=1-d;else{if(i===p)return a?NaN:(g?-1:1)*(1/0);a=a+Math.pow(2,n),i=i-d}return(g?-1:1)*a*Math.pow(2,i-n)}function kr(t,r,e,n,o,i){var a,c,p,d=i*8-o-1,f=(1<<d)-1,m=f>>1,h=o===23?Math.pow(2,-24)-Math.pow(2,-77):0,g=n?0:i-1,_=n?1:-1,tr=r<0||r===0&&1/r<0?1:0;for(r=Math.abs(r),isNaN(r)||r===1/0?(c=isNaN(r)?1:0,a=f):(a=Math.floor(Math.log(r)/Math.LN2),r*(p=Math.pow(2,-a))<1&&(a--,p*=2),a+m>=1?r+=h/p:r+=h*Math.pow(2,1-m),r*p>=2&&(a++,p/=2),a+m>=f?(c=0,a=f):a+m>=1?(c=(r*p-1)*Math.pow(2,o),a=a+m):(c=r*Math.pow(2,m-1)*Math.pow(2,o),a=0));o>=8;t[e+g]=c&255,g+=_,c/=256,o-=8);for(a=a<<o|c,d+=o;d>0;t[e+g]=a&255,g+=_,a/=256,d-=8);t[e+g-_]|=tr*128}import*as x from"ethereumjs-util";import zu from"algosdk";import*as pn from"bs58";import Ho from"algosdk";import Sn,{decodeAddress as On,encodeAddress as Bn}from"algosdk";var N=[],I=[],lt=typeof Uint8Array<"u"?Uint8Array:Array,cr=!1;function vr(){cr=!0;for(var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",r=0,e=t.length;r<e;++r)N[r]=t[r],I[t.charCodeAt(r)]=r;I[45]=62,I[95]=63}function mt(t){cr||vr();var r,e,n,o,i,a,c=t.length;if(c%4>0)throw new Error("Invalid string. Length must be a multiple of 4");i=t[c-2]==="="?2:t[c-1]==="="?1:0,a=new lt(c*3/4-i),n=i>0?c-4:c;var p=0;for(r=0,e=0;r<n;r+=4,e+=3)o=I[t.charCodeAt(r)]<<18|I[t.charCodeAt(r+1)]<<12|I[t.charCodeAt(r+2)]<<6|I[t.charCodeAt(r+3)],a[p++]=o>>16&255,a[p++]=o>>8&255,a[p++]=o&255;return i===2?(o=I[t.charCodeAt(r)]<<2|I[t.charCodeAt(r+1)]>>4,a[p++]=o&255):i===1&&(o=I[t.charCodeAt(r)]<<10|I[t.charCodeAt(r+1)]<<4|I[t.charCodeAt(r+2)]>>2,a[p++]=o>>8&255,a[p++]=o&255),a}function dt(t){return N[t>>18&63]+N[t>>12&63]+N[t>>6&63]+N[t&63]}function ft(t,r,e){for(var n,o=[],i=r;i<e;i+=3)n=(t[i]<<16)+(t[i+1]<<8)+t[i+2],o.push(dt(n));return o.join("")}function Ur(t){cr||vr();for(var r,e=t.length,n=e%3,o="",i=[],a=16383,c=0,p=e-n;c<p;c+=a)i.push(ft(t,c,c+a>p?p:c+a));return n===1?(r=t[e-1],o+=N[r>>2],o+=N[r<<4&63],o+="=="):n===2&&(r=(t[e-2]<<8)+t[e-1],o+=N[r>>10],o+=N[r>>4&63],o+=N[r<<2&63],o+="="),i.push(o),i.join("")}function J(t,r,e,n,o){var i,a,c=o*8-n-1,p=(1<<c)-1,d=p>>1,f=-7,m=e?o-1:0,h=e?-1:1,g=t[r+m];for(m+=h,i=g&(1<<-f)-1,g>>=-f,f+=c;f>0;i=i*256+t[r+m],m+=h,f-=8);for(a=i&(1<<-f)-1,i>>=-f,f+=n;f>0;a=a*256+t[r+m],m+=h,f-=8);if(i===0)i=1-d;else{if(i===p)return a?NaN:(g?-1:1)*(1/0);a=a+Math.pow(2,n),i=i-d}return(g?-1:1)*a*Math.pow(2,i-n)}function Fr(t,r,e,n,o,i){var a,c,p,d=i*8-o-1,f=(1<<d)-1,m=f>>1,h=o===23?Math.pow(2,-24)-Math.pow(2,-77):0,g=n?0:i-1,_=n?1:-1,tr=r<0||r===0&&1/r<0?1:0;for(r=Math.abs(r),isNaN(r)||r===1/0?(c=isNaN(r)?1:0,a=f):(a=Math.floor(Math.log(r)/Math.LN2),r*(p=Math.pow(2,-a))<1&&(a--,p*=2),a+m>=1?r+=h/p:r+=h*Math.pow(2,1-m),r*p>=2&&(a++,p/=2),a+m>=f?(c=0,a=f):a+m>=1?(c=(r*p-1)*Math.pow(2,o),a=a+m):(c=r*Math.pow(2,m-1)*Math.pow(2,o),a=0));o>=8;t[e+g]=c&255,g+=_,c/=256,o-=8);for(a=a<<o|c,d+=o;d>0;t[e+g]=a&255,g+=_,a/=256,d-=8);t[e+g-_]|=tr*128}var gt={}.toString,Yr=Array.isArray||function(t){return gt.call(t)=="[object Array]"};var ht=50;u.TYPED_ARRAY_SUPPORT=globalThis.TYPED_ARRAY_SUPPORT!==void 0?globalThis.TYPED_ARRAY_SUPPORT:!0;var yn=z();function z(){return u.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function C(t,r){if(z()<r)throw new RangeError("Invalid typed array length");return u.TYPED_ARRAY_SUPPORT?(t=new Uint8Array(r),t.__proto__=u.prototype):(t===null&&(t=new u(r)),t.length=r),t}function u(t,r,e){if(!u.TYPED_ARRAY_SUPPORT&&!(this instanceof u))return new u(t,r,e);if(typeof t=="number"){if(typeof r=="string")throw new Error("If encoding is specified then the first argument must be a string");return ur(this,t)}return Gr(this,t,r,e)}u.poolSize=8192;u._augment=function(t){return t.__proto__=u.prototype,t};function Gr(t,r,e,n){if(typeof r=="number")throw new TypeError('"value" argument must not be a number');return typeof ArrayBuffer<"u"&&r instanceof ArrayBuffer?bt(t,r,e,n):typeof r=="string"?Et(t,r,e):At(t,r)}u.from=function(t,r,e){return Gr(null,t,r,e)};u.TYPED_ARRAY_SUPPORT&&(u.prototype.__proto__=Uint8Array.prototype,u.__proto__=Uint8Array);function Kr(t){if(typeof t!="number")throw new TypeError('"size" argument must be a number');if(t<0)throw new RangeError('"size" argument must not be negative')}function xt(t,r,e,n){return Kr(r),r<=0?C(t,r):e!==void 0?typeof n=="string"?C(t,r).fill(e,n):C(t,r).fill(e):C(t,r)}u.alloc=function(t,r,e){return xt(null,t,r,e)};function ur(t,r){if(Kr(r),t=C(t,r<0?0:pr(r)|0),!u.TYPED_ARRAY_SUPPORT)for(var e=0;e<r;++e)t[e]=0;return t}u.allocUnsafe=function(t){return ur(null,t)};u.allocUnsafeSlow=function(t){return ur(null,t)};function Et(t,r,e){if((typeof e!="string"||e==="")&&(e="utf8"),!u.isEncoding(e))throw new TypeError('"encoding" must be a valid string encoding');var n=Wr(r,e)|0;t=C(t,n);var o=t.write(r,e);return o!==n&&(t=t.slice(0,o)),t}function sr(t,r){var e=r.length<0?0:pr(r.length)|0;t=C(t,e);for(var n=0;n<e;n+=1)t[n]=r[n]&255;return t}function bt(t,r,e,n){if(r.byteLength,e<0||r.byteLength<e)throw new RangeError("'offset' is out of bounds");if(r.byteLength<e+(n||0))throw new RangeError("'length' is out of bounds");return e===void 0&&n===void 0?r=new Uint8Array(r):n===void 0?r=new Uint8Array(r,e):r=new Uint8Array(r,e,n),u.TYPED_ARRAY_SUPPORT?(t=r,t.__proto__=u.prototype):t=sr(t,r),t}function At(t,r){if(S(r)){var e=pr(r.length)|0;return t=C(t,e),t.length===0||r.copy(t,0,0,e),t}if(r){if(typeof ArrayBuffer<"u"&&r.buffer instanceof ArrayBuffer||"length"in r)return typeof r.length!="number"||Ft(r.length)?C(t,0):sr(t,r);if(r.type==="Buffer"&&Yr(r.data))return sr(t,r.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function pr(t){if(t>=z())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+z().toString(16)+" bytes");return t|0}u.isBuffer=Yt;function S(t){return!!(t!=null&&t._isBuffer)}u.compare=function(r,e){if(!S(r)||!S(e))throw new TypeError("Arguments must be Buffers");if(r===e)return 0;for(var n=r.length,o=e.length,i=0,a=Math.min(n,o);i<a;++i)if(r[i]!==e[i]){n=r[i],o=e[i];break}return n<o?-1:o<n?1:0};u.isEncoding=function(r){switch(String(r).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}};u.concat=function(r,e){if(!Yr(r))throw new TypeError('"list" argument must be an Array of Buffers');if(r.length===0)return u.alloc(0);var n;if(e===void 0)for(e=0,n=0;n<r.length;++n)e+=r[n].length;var o=u.allocUnsafe(e),i=0;for(n=0;n<r.length;++n){var a=r[n];if(!S(a))throw new TypeError('"list" argument must be an Array of Buffers');a.copy(o,i),i+=a.length}return o};function Wr(t,r){if(S(t))return t.length;if(typeof ArrayBuffer<"u"&&typeof ArrayBuffer.isView=="function"&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;typeof t!="string"&&(t=""+t);var e=t.length;if(e===0)return 0;for(var n=!1;;)switch(r){case"ascii":case"latin1":case"binary":return e;case"utf8":case"utf-8":case void 0:return q(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return e*2;case"hex":return e>>>1;case"base64":return Jr(t).length;default:if(n)return q(t).length;r=(""+r).toLowerCase(),n=!0}}u.byteLength=Wr;function Tt(t,r,e){var n=!1;if((r===void 0||r<0)&&(r=0),r>this.length||((e===void 0||e>this.length)&&(e=this.length),e<=0)||(e>>>=0,r>>>=0,e<=r))return"";for(t||(t="utf8");;)switch(t){case"hex":return Ct(this,r,e);case"utf8":case"utf-8":return $r(this,r,e);case"ascii":return Ot(this,r,e);case"latin1":case"binary":return Bt(this,r,e);case"base64":return Nt(this,r,e);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Dt(this,r,e);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}u.prototype._isBuffer=!0;function M(t,r,e){var n=t[r];t[r]=t[e],t[e]=n}u.prototype.swap16=function(){var r=this.length;if(r%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var e=0;e<r;e+=2)M(this,e,e+1);return this};u.prototype.swap32=function(){var r=this.length;if(r%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var e=0;e<r;e+=4)M(this,e,e+3),M(this,e+1,e+2);return this};u.prototype.swap64=function(){var r=this.length;if(r%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var e=0;e<r;e+=8)M(this,e,e+7),M(this,e+1,e+6),M(this,e+2,e+5),M(this,e+3,e+4);return this};u.prototype.toString=function(){var r=this.length|0;return r===0?"":arguments.length===0?$r(this,0,r):Tt.apply(this,arguments)};u.prototype.equals=function(r){if(!S(r))throw new TypeError("Argument must be a Buffer");return this===r?!0:u.compare(this,r)===0};u.prototype.inspect=function(){var r="",e=ht;return this.length>0&&(r=this.toString("hex",0,e).match(/.{2}/g).join(" "),this.length>e&&(r+=" ... ")),"<Buffer "+r+">"};u.prototype.compare=function(r,e,n,o,i){if(!S(r))throw new TypeError("Argument must be a Buffer");if(e===void 0&&(e=0),n===void 0&&(n=r?r.length:0),o===void 0&&(o=0),i===void 0&&(i=this.length),e<0||n>r.length||o<0||i>this.length)throw new RangeError("out of range index");if(o>=i&&e>=n)return 0;if(o>=i)return-1;if(e>=n)return 1;if(e>>>=0,n>>>=0,o>>>=0,i>>>=0,this===r)return 0;for(var a=i-o,c=n-e,p=Math.min(a,c),d=this.slice(o,i),f=r.slice(e,n),m=0;m<p;++m)if(d[m]!==f[m]){a=d[m],c=f[m];break}return a<c?-1:c<a?1:0};function Hr(t,r,e,n,o){if(t.length===0)return-1;if(typeof e=="string"?(n=e,e=0):e>2147483647?e=2147483647:e<-2147483648&&(e=-2147483648),e=+e,isNaN(e)&&(e=o?0:t.length-1),e<0&&(e=t.length+e),e>=t.length){if(o)return-1;e=t.length-1}else if(e<0)if(o)e=0;else return-1;if(typeof r=="string"&&(r=u.from(r,n)),S(r))return r.length===0?-1:Lr(t,r,e,n,o);if(typeof r=="number")return r=r&255,u.TYPED_ARRAY_SUPPORT&&typeof Uint8Array.prototype.indexOf=="function"?o?Uint8Array.prototype.indexOf.call(t,r,e):Uint8Array.prototype.lastIndexOf.call(t,r,e):Lr(t,[r],e,n,o);throw new TypeError("val must be string, number or Buffer")}function Lr(t,r,e,n,o){var i=1,a=t.length,c=r.length;if(n!==void 0&&(n=String(n).toLowerCase(),n==="ucs2"||n==="ucs-2"||n==="utf16le"||n==="utf-16le")){if(t.length<2||r.length<2)return-1;i=2,a/=2,c/=2,e/=2}function p(g,_){return i===1?g[_]:g.readUInt16BE(_*i)}var d;if(o){var f=-1;for(d=e;d<a;d++)if(p(t,d)===p(r,f===-1?0:d-f)){if(f===-1&&(f=d),d-f+1===c)return f*i}else f!==-1&&(d-=d-f),f=-1}else for(e+c>a&&(e=a-c),d=e;d>=0;d--){for(var m=!0,h=0;h<c;h++)if(p(t,d+h)!==p(r,h)){m=!1;break}if(m)return d}return-1}u.prototype.includes=function(r,e,n){return this.indexOf(r,e,n)!==-1};u.prototype.indexOf=function(r,e,n){return Hr(this,r,e,n,!0)};u.prototype.lastIndexOf=function(r,e,n){return Hr(this,r,e,n,!1)};function _t(t,r,e,n){e=Number(e)||0;var o=t.length-e;n?(n=Number(n),n>o&&(n=o)):n=o;var i=r.length;if(i%2!==0)throw new TypeError("Invalid hex string");n>i/2&&(n=i/2);for(var a=0;a<n;++a){var c=parseInt(r.substr(a*2,2),16);if(isNaN(c))return a;t[e+a]=c}return a}function yt(t,r,e,n){return Z(q(r,t.length-e),t,e,n)}function Vr(t,r,e,n){return Z(Mt(r),t,e,n)}function It(t,r,e,n){return Vr(t,r,e,n)}function Rt(t,r,e,n){return Z(Jr(r),t,e,n)}function wt(t,r,e,n){return Z(vt(r,t.length-e),t,e,n)}u.prototype.write=function(r,e,n,o){if(e===void 0)o="utf8",n=this.length,e=0;else if(n===void 0&&typeof e=="string")o=e,n=this.length,e=0;else if(isFinite(e))e=e|0,isFinite(n)?(n=n|0,o===void 0&&(o="utf8")):(o=n,n=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var i=this.length-e;if((n===void 0||n>i)&&(n=i),r.length>0&&(n<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");o||(o="utf8");for(var a=!1;;)switch(o){case"hex":return _t(this,r,e,n);case"utf8":case"utf-8":return yt(this,r,e,n);case"ascii":return Vr(this,r,e,n);case"latin1":case"binary":return It(this,r,e,n);case"base64":return Rt(this,r,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return wt(this,r,e,n);default:if(a)throw new TypeError("Unknown encoding: "+o);o=(""+o).toLowerCase(),a=!0}};u.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function Nt(t,r,e){return r===0&&e===t.length?Ur(t):Ur(t.slice(r,e))}function $r(t,r,e){e=Math.min(t.length,e);for(var n=[],o=r;o<e;){var i=t[o],a=null,c=i>239?4:i>223?3:i>191?2:1;if(o+c<=e){var p,d,f,m;switch(c){case 1:i<128&&(a=i);break;case 2:p=t[o+1],(p&192)===128&&(m=(i&31)<<6|p&63,m>127&&(a=m));break;case 3:p=t[o+1],d=t[o+2],(p&192)===128&&(d&192)===128&&(m=(i&15)<<12|(p&63)<<6|d&63,m>2047&&(m<55296||m>57343)&&(a=m));break;case 4:p=t[o+1],d=t[o+2],f=t[o+3],(p&192)===128&&(d&192)===128&&(f&192)===128&&(m=(i&15)<<18|(p&63)<<12|(d&63)<<6|f&63,m>65535&&m<1114112&&(a=m))}}a===null?(a=65533,c=1):a>65535&&(a-=65536,n.push(a>>>10&1023|55296),a=56320|a&1023),n.push(a),o+=c}return St(n)}var Mr=4096;function St(t){var r=t.length;if(r<=Mr)return String.fromCharCode.apply(String,t);for(var e="",n=0;n<r;)e+=String.fromCharCode.apply(String,t.slice(n,n+=Mr));return e}function Ot(t,r,e){var n="";e=Math.min(t.length,e);for(var o=r;o<e;++o)n+=String.fromCharCode(t[o]&127);return n}function Bt(t,r,e){var n="";e=Math.min(t.length,e);for(var o=r;o<e;++o)n+=String.fromCharCode(t[o]);return n}function Ct(t,r,e){var n=t.length;(!r||r<0)&&(r=0),(!e||e<0||e>n)&&(e=n);for(var o="",i=r;i<e;++i)o+=Lt(t[i]);return o}function Dt(t,r,e){for(var n=t.slice(r,e),o="",i=0;i<n.length;i+=2)o+=String.fromCharCode(n[i]+n[i+1]*256);return o}u.prototype.slice=function(r,e){var n=this.length;r=~~r,e=e===void 0?n:~~e,r<0?(r+=n,r<0&&(r=0)):r>n&&(r=n),e<0?(e+=n,e<0&&(e=0)):e>n&&(e=n),e<r&&(e=r);var o;if(u.TYPED_ARRAY_SUPPORT)o=this.subarray(r,e),o.__proto__=u.prototype;else{var i=e-r;o=new u(i,void 0);for(var a=0;a<i;++a)o[a]=this[a+r]}return o};function b(t,r,e){if(t%1!==0||t<0)throw new RangeError("offset is not uint");if(t+r>e)throw new RangeError("Trying to access beyond buffer length")}u.prototype.readUIntLE=function(r,e,n){r=r|0,e=e|0,n||b(r,e,this.length);for(var o=this[r],i=1,a=0;++a<e&&(i*=256);)o+=this[r+a]*i;return o};u.prototype.readUIntBE=function(r,e,n){r=r|0,e=e|0,n||b(r,e,this.length);for(var o=this[r+--e],i=1;e>0&&(i*=256);)o+=this[r+--e]*i;return o};u.prototype.readUInt8=function(r,e){return e||b(r,1,this.length),this[r]};u.prototype.readUInt16LE=function(r,e){return e||b(r,2,this.length),this[r]|this[r+1]<<8};u.prototype.readUInt16BE=function(r,e){return e||b(r,2,this.length),this[r]<<8|this[r+1]};u.prototype.readUInt32LE=function(r,e){return e||b(r,4,this.length),(this[r]|this[r+1]<<8|this[r+2]<<16)+this[r+3]*16777216};u.prototype.readUInt32BE=function(r,e){return e||b(r,4,this.length),this[r]*16777216+(this[r+1]<<16|this[r+2]<<8|this[r+3])};u.prototype.readIntLE=function(r,e,n){r=r|0,e=e|0,n||b(r,e,this.length);for(var o=this[r],i=1,a=0;++a<e&&(i*=256);)o+=this[r+a]*i;return i*=128,o>=i&&(o-=Math.pow(2,8*e)),o};u.prototype.readIntBE=function(r,e,n){r=r|0,e=e|0,n||b(r,e,this.length);for(var o=e,i=1,a=this[r+--o];o>0&&(i*=256);)a+=this[r+--o]*i;return i*=128,a>=i&&(a-=Math.pow(2,8*e)),a};u.prototype.readInt8=function(r,e){return e||b(r,1,this.length),this[r]&128?(255-this[r]+1)*-1:this[r]};u.prototype.readInt16LE=function(r,e){e||b(r,2,this.length);var n=this[r]|this[r+1]<<8;return n&32768?n|4294901760:n};u.prototype.readInt16BE=function(r,e){e||b(r,2,this.length);var n=this[r+1]|this[r]<<8;return n&32768?n|4294901760:n};u.prototype.readInt32LE=function(r,e){return e||b(r,4,this.length),this[r]|this[r+1]<<8|this[r+2]<<16|this[r+3]<<24};u.prototype.readInt32BE=function(r,e){return e||b(r,4,this.length),this[r]<<24|this[r+1]<<16|this[r+2]<<8|this[r+3]};u.prototype.readFloatLE=function(r,e){return e||b(r,4,this.length),J(this,r,!0,23,4)};u.prototype.readFloatBE=function(r,e){return e||b(r,4,this.length),J(this,r,!1,23,4)};u.prototype.readDoubleLE=function(r,e){return e||b(r,8,this.length),J(this,r,!0,52,8)};u.prototype.readDoubleBE=function(r,e){return e||b(r,8,this.length),J(this,r,!1,52,8)};function T(t,r,e,n,o,i){if(!S(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(r>o||r<i)throw new RangeError('"value" argument is out of bounds');if(e+n>t.length)throw new RangeError("Index out of range")}u.prototype.writeUIntLE=function(r,e,n,o){if(r=+r,e=e|0,n=n|0,!o){var i=Math.pow(2,8*n)-1;T(this,r,e,n,i,0)}var a=1,c=0;for(this[e]=r&255;++c<n&&(a*=256);)this[e+c]=r/a&255;return e+n};u.prototype.writeUIntBE=function(r,e,n,o){if(r=+r,e=e|0,n=n|0,!o){var i=Math.pow(2,8*n)-1;T(this,r,e,n,i,0)}var a=n-1,c=1;for(this[e+a]=r&255;--a>=0&&(c*=256);)this[e+a]=r/c&255;return e+n};u.prototype.writeUInt8=function(r,e,n){return r=+r,e=e|0,n||T(this,r,e,1,255,0),u.TYPED_ARRAY_SUPPORT||(r=Math.floor(r)),this[e]=r&255,e+1};function j(t,r,e,n){r<0&&(r=65535+r+1);for(var o=0,i=Math.min(t.length-e,2);o<i;++o)t[e+o]=(r&255<<8*(n?o:1-o))>>>(n?o:1-o)*8}u.prototype.writeUInt16LE=function(r,e,n){return r=+r,e=e|0,n||T(this,r,e,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[e]=r&255,this[e+1]=r>>>8):j(this,r,e,!0),e+2};u.prototype.writeUInt16BE=function(r,e,n){return r=+r,e=e|0,n||T(this,r,e,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[e]=r>>>8,this[e+1]=r&255):j(this,r,e,!1),e+2};function Q(t,r,e,n){r<0&&(r=4294967295+r+1);for(var o=0,i=Math.min(t.length-e,4);o<i;++o)t[e+o]=r>>>(n?o:3-o)*8&255}u.prototype.writeUInt32LE=function(r,e,n){return r=+r,e=e|0,n||T(this,r,e,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[e+3]=r>>>24,this[e+2]=r>>>16,this[e+1]=r>>>8,this[e]=r&255):Q(this,r,e,!0),e+4};u.prototype.writeUInt32BE=function(r,e,n){return r=+r,e=e|0,n||T(this,r,e,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[e]=r>>>24,this[e+1]=r>>>16,this[e+2]=r>>>8,this[e+3]=r&255):Q(this,r,e,!1),e+4};u.prototype.writeIntLE=function(r,e,n,o){if(r=+r,e=e|0,!o){var i=Math.pow(2,8*n-1);T(this,r,e,n,i-1,-i)}var a=0,c=1,p=0;for(this[e]=r&255;++a<n&&(c*=256);)r<0&&p===0&&this[e+a-1]!==0&&(p=1),this[e+a]=(r/c>>0)-p&255;return e+n};u.prototype.writeIntBE=function(r,e,n,o){if(r=+r,e=e|0,!o){var i=Math.pow(2,8*n-1);T(this,r,e,n,i-1,-i)}var a=n-1,c=1,p=0;for(this[e+a]=r&255;--a>=0&&(c*=256);)r<0&&p===0&&this[e+a+1]!==0&&(p=1),this[e+a]=(r/c>>0)-p&255;return e+n};u.prototype.writeInt8=function(r,e,n){return r=+r,e=e|0,n||T(this,r,e,1,127,-128),u.TYPED_ARRAY_SUPPORT||(r=Math.floor(r)),r<0&&(r=255+r+1),this[e]=r&255,e+1};u.prototype.writeInt16LE=function(r,e,n){return r=+r,e=e|0,n||T(this,r,e,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[e]=r&255,this[e+1]=r>>>8):j(this,r,e,!0),e+2};u.prototype.writeInt16BE=function(r,e,n){return r=+r,e=e|0,n||T(this,r,e,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[e]=r>>>8,this[e+1]=r&255):j(this,r,e,!1),e+2};u.prototype.writeInt32LE=function(r,e,n){return r=+r,e=e|0,n||T(this,r,e,4,2147483647,-2147483648),u.TYPED_ARRAY_SUPPORT?(this[e]=r&255,this[e+1]=r>>>8,this[e+2]=r>>>16,this[e+3]=r>>>24):Q(this,r,e,!0),e+4};u.prototype.writeInt32BE=function(r,e,n){return r=+r,e=e|0,n||T(this,r,e,4,2147483647,-2147483648),r<0&&(r=4294967295+r+1),u.TYPED_ARRAY_SUPPORT?(this[e]=r>>>24,this[e+1]=r>>>16,this[e+2]=r>>>8,this[e+3]=r&255):Q(this,r,e,!1),e+4};function Xr(t,r,e,n,o,i){if(e+n>t.length)throw new RangeError("Index out of range");if(e<0)throw new RangeError("Index out of range")}function zr(t,r,e,n,o){return o||Xr(t,r,e,4),Fr(t,r,e,n,23,4),e+4}u.prototype.writeFloatLE=function(r,e,n){return zr(this,r,e,!0,n)};u.prototype.writeFloatBE=function(r,e,n){return zr(this,r,e,!1,n)};function qr(t,r,e,n,o){return o||Xr(t,r,e,8),Fr(t,r,e,n,52,8),e+8}u.prototype.writeDoubleLE=function(r,e,n){return qr(this,r,e,!0,n)};u.prototype.writeDoubleBE=function(r,e,n){return qr(this,r,e,!1,n)};u.prototype.copy=function(r,e,n,o){if(n||(n=0),!o&&o!==0&&(o=this.length),e>=r.length&&(e=r.length),e||(e=0),o>0&&o<n&&(o=n),o===n||r.length===0||this.length===0)return 0;if(e<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("sourceStart out of bounds");if(o<0)throw new RangeError("sourceEnd out of bounds");o>this.length&&(o=this.length),r.length-e<o-n&&(o=r.length-e+n);var i=o-n,a;if(this===r&&n<e&&e<o)for(a=i-1;a>=0;--a)r[a+e]=this[a+n];else if(i<1e3||!u.TYPED_ARRAY_SUPPORT)for(a=0;a<i;++a)r[a+e]=this[a+n];else Uint8Array.prototype.set.call(r,this.subarray(n,n+i),e);return i};u.prototype.fill=function(r,e,n,o){if(typeof r=="string"){if(typeof e=="string"?(o=e,e=0,n=this.length):typeof n=="string"&&(o=n,n=this.length),r.length===1){var i=r.charCodeAt(0);i<256&&(r=i)}if(o!==void 0&&typeof o!="string")throw new TypeError("encoding must be a string");if(typeof o=="string"&&!u.isEncoding(o))throw new TypeError("Unknown encoding: "+o)}else typeof r=="number"&&(r=r&255);if(e<0||this.length<e||this.length<n)throw new RangeError("Out of range index");if(n<=e)return this;e=e>>>0,n=n===void 0?this.length:n>>>0,r||(r=0);var a;if(typeof r=="number")for(a=e;a<n;++a)this[a]=r;else{var c=S(r)?r:q(new u(r,o).toString()),p=c.length;for(a=0;a<n-e;++a)this[a+e]=c[a%p]}return this};var Pt=/[^+\/0-9A-Za-z-_]/g;function kt(t){if(t=Ut(t).replace(Pt,""),t.length<2)return"";for(;t.length%4!==0;)t=t+"=";return t}function Ut(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}function Lt(t){return t<16?"0"+t.toString(16):t.toString(16)}function q(t,r){r=r||1/0;for(var e,n=t.length,o=null,i=[],a=0;a<n;++a){if(e=t.charCodeAt(a),e>55295&&e<57344){if(!o){if(e>56319){(r-=3)>-1&&i.push(239,191,189);continue}else if(a+1===n){(r-=3)>-1&&i.push(239,191,189);continue}o=e;continue}if(e<56320){(r-=3)>-1&&i.push(239,191,189),o=e;continue}e=(o-55296<<10|e-56320)+65536}else o&&(r-=3)>-1&&i.push(239,191,189);if(o=null,e<128){if((r-=1)<0)break;i.push(e)}else if(e<2048){if((r-=2)<0)break;i.push(e>>6|192,e&63|128)}else if(e<65536){if((r-=3)<0)break;i.push(e>>12|224,e>>6&63|128,e&63|128)}else if(e<1114112){if((r-=4)<0)break;i.push(e>>18|240,e>>12&63|128,e>>6&63|128,e&63|128)}else throw new Error("Invalid code point")}return i}function Mt(t){for(var r=[],e=0;e<t.length;++e)r.push(t.charCodeAt(e)&255);return r}function vt(t,r){for(var e,n,o,i=[],a=0;a<t.length&&!((r-=2)<0);++a)e=t.charCodeAt(a),n=e>>8,o=e%256,i.push(o),i.push(n);return i}function Jr(t){return mt(kt(t))}function Z(t,r,e,n){for(var o=0;o<n&&!(o+e>=r.length||o>=t.length);++o)r[o+e]=t[o];return o}function Ft(t){return t!==t}function Yt(t){return t!=null&&(!!t._isBuffer||jr(t)||Gt(t))}function jr(t){return!!t.constructor&&typeof t.constructor.isBuffer=="function"&&t.constructor.isBuffer(t)}function Gt(t){return typeof t.readFloatLE=="function"&&typeof t.slice=="function"&&jr(t.slice(0,0))}import{encodeAddress as Kt,decodeAddress as Ln}from"algosdk";function lr(t){return new Uint8Array(u.from(t))}import Wt from"bignumber.js";Wt.config({DECIMAL_PLACES:40,EXPONENTIAL_AT:45});var eo=`{"theme1":{"value":"${l.env.FRONTEND_URL}/Theme%3DDark.svg","active":true},"theme2":{"value":"${l.env.FRONTEND_URL}/Theme%3DLight.svg","active":true},"theme3":{"value":"${l.env.FRONTEND_URL}/Theme%3DLight.svg","active":true}}`;var Qr={V1_1:"v1_1",V2:"v2"},io={[Qr.V1_1]:{testnet:62368684,mainnet:552635992},[Qr.V2]:{testnet:148607e3,mainnet:1002541853}};import Bu from"algosdk";import*as an from"bs58";import ri from"algosdk";import ui from"algosdk";import ga from"algosdk";var Ri={SMALLESTUNIT:l.env.SMALLEST_UNIT},wi={SMALLEST_UNITS:l.env.SMALLEST_UNIT};var Ci=["point-system.discordEnabled","point-system.telegramBotName","point-system.telegramBotId","point-system.telegramEnabled","point-system.telegramGroupId","point-system.telegramGroupName","point-system.twitterAccountId","point-system.twitterAccountName","point-system.twitterEnabled","point-system.twitterJobEnabled","point-system.guideLink"];var vi=l.env.REACT_APP_API_URL,Fi=l.env.REACT_APP_SOCKET_URL,Yi=l.env.REACT_APP_ALGO_SERVER,Gi=l.env.REACT_APP_ALGO_SERVER_PORT||"",Ki=l.env.REACT_APP_ALGOD_TOKEN||"",Wi=l.env.REACT_APP_DISPENSER_LINK,Hi=l.env.REACT_APP_FRONTEND_LINK||"",Vi=l.env.REACT_APP_ALGO_EXPLORER_LINK,$i=l.env.REACT_APP_ALGO_EXPLORER_ASSETS_URL,Xi=(l.env.REACT_APP_REQUIRE_ACCESS_CODE||"").toLowerCase()==="true",zi=l.env.REACT_APP_USERBACK_ACCESS_TOKEN,qi=(l.env.REACT_APP_EXT_ORDER_TYPES||"").toLowerCase()==="true";var Ji=.001*10**6,ji=.002*10**6;var Qi=l.env.REACT_APP_MASTER_APP_ID||"406",Zi=l.env.REACT_APP_AGG_APP_ID||"408",qt=Number(l.env.REACT_APP_CODEX_APP_ID||"467960617");console.log("CODEX_APP_ID",qt);var Jt=l.env.REACT_APP_ALGO_NETWORK||"";var ra=Jt.toLowerCase()==="mainnet"?"mainnet":"testnet";import Dc from"algosdk";var ee=(o=>(o.GLOBAL_PAIR_DELISTING="GLOBAL_PAIR_DELISTING",o.GLOBAL_NEW_PAIR_LISTING="GLOBAL_NEW_PAIR_LISTING",o.GLOBAL_SYSTEM_MAINTENANCE="GLOBAL_SYSTEM_MAINTENANCE",o.GLOBAL_SMART_CONTRACT_UPDATE="GLOBAL_SMART_CONTRACT_UPDATE",o))(ee||{}),te=(n=>(n.ACCOUNT_POINTS_UNLOCK_ACHIEVEMENT="ACCOUNT_POINTS_UNLOCK_ACHIEVEMENT",n.ACCOUNT_KYC_STATUS_CHANGED="ACCOUNT_KYC_STATUS_CHANGED",n.ACCOUNT_AFFILIATE_DASHBOARD_UNLOCKED="ACCOUNT_AFFILIATE_DASHBOARD_UNLOCKED",n))(te||{}),ws={...ee,...te};import qc from"algosdk";var ln=(t,r)=>r===8?"MX":r===1?"":`Ethereum Signed Message:
2
+ ${t.length}`,ae=(t,r,e)=>{let n=s.from(t,r);return s.concat([lr(ln(n,e)),n])},se=t=>{switch(t){case"ALGORAND":return 8;case"SOLANA":return 1;case"EVM":return 5;default:return 5}};function sn(t){let r=x.fromSigned(s.from(t));return BigInt(r.toString())}function dn(t){return x.toUnsigned(new x.BN(String(t)))}function cn(t){let r=dn(t);if(r.length>32)throw new Error("Invalid value. The buffer length of the value is more than 32");return new Uint8Array(x.setLengthLeft(r,32))}var un=t=>{if(t.length!==32)throw new Error("Invalid address bytes. The address buffer length is not equel 32");let r=s.from(t).toString("hex");if(r.slice(0,24)!=="000000000000000000000000")throw console.log("normalizedAddress",r),new Error("Invalid normalized address");let e="0x"+r.slice(-40);if(!gn(e))throw new Error("Invalid hex address");return e},mn=t=>new Uint8Array(x.setLengthLeft(mr(t),32)),mr=t=>s.from(fn(t),"hex"),fn=t=>t.startsWith("0x")?t.slice(2):t,gn=t=>x.isValidAddress(t),ce=(t,r)=>{let e=x.keccak256(t),{r:n,s:o,v:i}=x.fromRpcSig(r);return x.ecrecover(e,i,n,o)},np=(t,r,e,n)=>hn(ae(e,n,se("EVM")),t,r),hn=(t,r,e)=>{let n=ce(t,r);return x.bufferToHex(x.publicToAddress(n)).toLowerCase()===e.toLowerCase()},oe=t=>new Uint8Array(x.keccak256(s.from(t)));export{sn as decode32Bytes,mn as decodeAndNormalizeAddress,mr as decodeHexString,cn as encode32Bytes,un as encodeAddress,dn as encodeBigNumber,gn as isAddress,oe as keccak256,ce as recoverPublicKey,fn as unpadHexPrefix,hn as verifyMessage,np as verifySignature};
3
3
  /*!
4
4
  * The buffer module from node.js, for the browser.
5
5
  *
@@ -1,4 +1,4 @@
1
- function z(){throw new Error("setTimeout has not been defined")}function $(){throw new Error("clearTimeout has not been defined")}var A=z,I=$;typeof globalThis.setTimeout=="function"&&(A=setTimeout);typeof globalThis.clearTimeout=="function"&&(I=clearTimeout);function J(t){if(A===setTimeout)return setTimeout(t,0);if((A===z||!A)&&setTimeout)return A=setTimeout,setTimeout(t,0);try{return A(t,0)}catch{try{return A.call(null,t,0)}catch{return A.call(this,t,0)}}}function xr(t){if(I===clearTimeout)return clearTimeout(t);if((I===$||!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 _=[],v=!1,R,O=-1;function _r(){!v||!R||(v=!1,R.length?_=R.concat(_):O=-1,_.length&&X())}function X(){if(!v){var t=J(_r);v=!0;for(var r=_.length;r;){for(R=_,_=[];++O<r;)R&&R[O].run();O=-1,r=_.length}R=null,v=!1,xr(t)}}function yr(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];_.push(new Q(t,r)),_.length===1&&!v&&J(X)}function Q(t,r){this.fun=t,this.array=r}Q.prototype.run=function(){this.fun.apply(null,this.array)};var wr="browser",Ar="browser",Ir=!0,Rr={},Sr=[],Nr="",Pr={},kr={},vr={};function S(){}var Dr=S,Or=S,Cr=S,Mr=S,Br=S,Lr=S,Ur=S;function Yr(t){throw new Error("process.binding is not supported")}function Fr(){return"/"}function Wr(t){throw new Error("process.chdir is not supported")}function Gr(){return 0}var k=globalThis.performance||{},Hr=k.now||k.mozNow||k.msNow||k.oNow||k.webkitNow||function(){return new Date().getTime()};function Vr(t){var r=Hr.call(k)*.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 Kr=new Date;function qr(){var t=new Date,r=t-Kr;return r/1e3}var m={nextTick:yr,title:wr,browser:Ir,env:Rr,argv:Sr,version:Nr,versions:Pr,on:Dr,addListener:Or,once:Cr,off:Mr,removeListener:Br,removeAllListeners:Lr,emit:Ur,binding:Yr,cwd:Fr,chdir:Wr,umask:Gr,hrtime:Vr,platform:Ar,release:kr,config:vr,uptime:qr},q={};Object.keys(q).forEach(t=>{let r=t.split("."),e=m;for(let n=0;n<r.length;n++){let i=r[n];n===r.length-1?e[i]=q[t]:e=e[i]||(e[i]={})}});var E=[],d=[],zr=typeof Uint8Array<"u"?Uint8Array:Array,G=!1;function er(){G=!0;for(var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",r=0,e=t.length;r<e;++r)E[r]=t[r],d[t.charCodeAt(r)]=r;d[45]=62,d[95]=63}function $r(t){G||er();var r,e,n,i,o,a,s=t.length;if(s%4>0)throw new Error("Invalid string. Length must be a multiple of 4");o=t[s-2]==="="?2:t[s-1]==="="?1:0,a=new zr(s*3/4-o),n=o>0?s-4:s;var c=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[c++]=i>>16&255,a[c++]=i>>8&255,a[c++]=i&255;return o===2?(i=d[t.charCodeAt(r)]<<2|d[t.charCodeAt(r+1)]>>4,a[c++]=i&255):o===1&&(i=d[t.charCodeAt(r)]<<10|d[t.charCodeAt(r+1)]<<4|d[t.charCodeAt(r+2)]>>2,a[c++]=i>>8&255,a[c++]=i&255),a}function Jr(t){return E[t>>18&63]+E[t>>12&63]+E[t>>6&63]+E[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(Jr(n));return i.join("")}function Z(t){G||er();for(var r,e=t.length,n=e%3,i="",o=[],a=16383,s=0,c=e-n;s<c;s+=a)o.push(Xr(t,s,s+a>c?c:s+a));return n===1?(r=t[e-1],i+=E[r>>2],i+=E[r<<4&63],i+="=="):n===2&&(r=(t[e-2]<<8)+t[e-1],i+=E[r>>10],i+=E[r>>4&63],i+=E[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 y(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 H(this,t)}return tr(this,t,r,e)}u.poolSize=8192;u._augment=function(t){return t.__proto__=u.prototype,t};function tr(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?jr(t,r,e,n):typeof r=="string"?Zr(t,r,e):re(t,r)}u.from=function(t,r,e){return tr(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 nr(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 nr(r),r<=0?y(t,r):e!==void 0?typeof n=="string"?y(t,r).fill(e,n):y(t,r).fill(e):y(t,r)}u.alloc=function(t,r,e){return Qr(null,t,r,e)};function H(t,r){if(nr(r),t=y(t,r<0?0:V(r)|0),!u.TYPED_ARRAY_SUPPORT)for(var e=0;e<r;++e)t[e]=0;return t}u.allocUnsafe=function(t){return H(null,t)};u.allocUnsafeSlow=function(t){return H(null,t)};function Zr(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=ir(r,e)|0;t=y(t,n);var i=t.write(r,e);return i!==n&&(t=t.slice(0,i)),t}function W(t,r){var e=r.length<0?0:V(r.length)|0;t=y(t,e);for(var n=0;n<e;n+=1)t[n]=r[n]&255;return t}function jr(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=W(t,r),t}function re(t,r){if(x(r)){var e=V(r.length)|0;return t=y(t,e),t.length===0||r.copy(t,0,0,e),t}if(r){if(typeof ArrayBuffer<"u"&&r.buffer instanceof ArrayBuffer||"length"in r)return typeof r.length!="number"||Ee(r.length)?y(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 V(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=xe;function x(t){return!!(t!=null&&t._isBuffer)}u.compare=function(r,e){if(!x(r)||!x(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(!x(a))throw new TypeError('"list" argument must be an Array of Buffers');a.copy(i,o),o+=a.length}return i};function ir(t,r){if(x(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 M(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return e*2;case"hex":return e>>>1;case"base64":return pr(t).length;default:if(n)return M(t).length;r=(""+r).toLowerCase(),n=!0}}u.byteLength=ir;function ee(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 pe(this,r,e);case"utf8":case"utf-8":return ur(this,r,e);case"ascii":return ce(this,r,e);case"latin1":case"binary":return le(this,r,e);case"base64":return ue(this,r,e);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return fe(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?ur(this,0,r):ee.apply(this,arguments)};u.prototype.equals=function(r){if(!x(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(!x(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,s=n-e,c=Math.min(a,s),f=this.slice(i,o),l=r.slice(e,n),p=0;p<c;++p)if(f[p]!==l[p]){a=f[p],s=l[p];break}return a<s?-1:s<a?1:0};function or(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)),x(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,s=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,s/=2,e/=2}function c(h,P){return o===1?h[P]:h.readUInt16BE(P*o)}var f;if(i){var l=-1;for(f=e;f<a;f++)if(c(t,f)===c(r,l===-1?0:f-l)){if(l===-1&&(l=f),f-l+1===s)return l*o}else l!==-1&&(f-=f-l),l=-1}else for(e+s>a&&(e=a-s),f=e;f>=0;f--){for(var p=!0,T=0;T<s;T++)if(c(t,f+T)!==c(r,T)){p=!1;break}if(p)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 or(this,r,e,n,!0)};u.prototype.lastIndexOf=function(r,e,n){return or(this,r,e,n,!1)};function te(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 s=parseInt(r.substr(a*2,2),16);if(isNaN(s))return a;t[e+a]=s}return a}function ne(t,r,e,n){return U(M(r,t.length-e),t,e,n)}function ar(t,r,e,n){return U(de(r),t,e,n)}function ie(t,r,e,n){return ar(t,r,e,n)}function oe(t,r,e,n){return U(pr(r),t,e,n)}function ae(t,r,e,n){return U(Te(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 te(this,r,e,n);case"utf8":case"utf-8":return ne(this,r,e,n);case"ascii":return ar(this,r,e,n);case"latin1":case"binary":return ie(this,r,e,n);case"base64":return oe(this,r,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ae(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 ue(t,r,e){return r===0&&e===t.length?Z(t):Z(t.slice(r,e))}function ur(t,r,e){e=Math.min(t.length,e);for(var n=[],i=r;i<e;){var o=t[i],a=null,s=o>239?4:o>223?3:o>191?2:1;if(i+s<=e){var c,f,l,p;switch(s){case 1:o<128&&(a=o);break;case 2:c=t[i+1],(c&192)===128&&(p=(o&31)<<6|c&63,p>127&&(a=p));break;case 3:c=t[i+1],f=t[i+2],(c&192)===128&&(f&192)===128&&(p=(o&15)<<12|(c&63)<<6|f&63,p>2047&&(p<55296||p>57343)&&(a=p));break;case 4:c=t[i+1],f=t[i+2],l=t[i+3],(c&192)===128&&(f&192)===128&&(l&192)===128&&(p=(o&15)<<18|(c&63)<<12|(f&63)<<6|l&63,p>65535&&p<1114112&&(a=p))}}a===null?(a=65533,s=1):a>65535&&(a-=65536,n.push(a>>>10&1023|55296),a=56320|a&1023),n.push(a),i+=s}return se(n)}var rr=4096;function se(t){var r=t.length;if(r<=rr)return String.fromCharCode.apply(String,t);for(var e="",n=0;n<r;)e+=String.fromCharCode.apply(String,t.slice(n,n+=rr));return e}function ce(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 le(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 pe(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+=he(t[o]);return i}function fe(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 b(t,r,e){if(t%1!==0||t<0)throw new RangeError("offset is not uint");if(t+r>e)throw new RangeError("Trying to access beyond buffer length")}u.prototype.readUIntLE=function(r,e,n){r=r|0,e=e|0,n||b(r,e,this.length);for(var 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||b(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||b(r,1,this.length),this[r]};u.prototype.readUInt16LE=function(r,e){return e||b(r,2,this.length),this[r]|this[r+1]<<8};u.prototype.readUInt16BE=function(r,e){return e||b(r,2,this.length),this[r]<<8|this[r+1]};u.prototype.readUInt32LE=function(r,e){return e||b(r,4,this.length),(this[r]|this[r+1]<<8|this[r+2]<<16)+this[r+3]*16777216};u.prototype.readUInt32BE=function(r,e){return e||b(r,4,this.length),this[r]*16777216+(this[r+1]<<16|this[r+2]<<8|this[r+3])};u.prototype.readIntLE=function(r,e,n){r=r|0,e=e|0,n||b(r,e,this.length);for(var 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||b(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||b(r,1,this.length),this[r]&128?(255-this[r]+1)*-1:this[r]};u.prototype.readInt16LE=function(r,e){e||b(r,2,this.length);var n=this[r]|this[r+1]<<8;return n&32768?n|4294901760:n};u.prototype.readInt16BE=function(r,e){e||b(r,2,this.length);var n=this[r+1]|this[r]<<8;return n&32768?n|4294901760:n};u.prototype.readInt32LE=function(r,e){return e||b(r,4,this.length),this[r]|this[r+1]<<8|this[r+2]<<16|this[r+3]<<24};u.prototype.readInt32BE=function(r,e){return e||b(r,4,this.length),this[r]<<24|this[r+1]<<16|this[r+2]<<8|this[r+3]};u.prototype.readFloatLE=function(r,e){return e||b(r,4,this.length),Y(this,r,!0,23,4)};u.prototype.readFloatBE=function(r,e){return e||b(r,4,this.length),Y(this,r,!1,23,4)};u.prototype.readDoubleLE=function(r,e){return e||b(r,8,this.length),Y(this,r,!0,52,8)};u.prototype.readDoubleBE=function(r,e){return e||b(r,8,this.length),Y(this,r,!1,52,8)};function g(t,r,e,n,i,o){if(!x(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;g(this,r,e,n,o,0)}var a=1,s=0;for(this[e]=r&255;++s<n&&(a*=256);)this[e+s]=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;g(this,r,e,n,o,0)}var a=n-1,s=1;for(this[e+a]=r&255;--a>=0&&(s*=256);)this[e+a]=r/s&255;return e+n};u.prototype.writeUInt8=function(r,e,n){return r=+r,e=e|0,n||g(this,r,e,1,255,0),u.TYPED_ARRAY_SUPPORT||(r=Math.floor(r)),this[e]=r&255,e+1};function B(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||g(this,r,e,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[e]=r&255,this[e+1]=r>>>8):B(this,r,e,!0),e+2};u.prototype.writeUInt16BE=function(r,e,n){return r=+r,e=e|0,n||g(this,r,e,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[e]=r>>>8,this[e+1]=r&255):B(this,r,e,!1),e+2};function L(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||g(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):L(this,r,e,!0),e+4};u.prototype.writeUInt32BE=function(r,e,n){return r=+r,e=e|0,n||g(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):L(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);g(this,r,e,n,o-1,-o)}var a=0,s=1,c=0;for(this[e]=r&255;++a<n&&(s*=256);)r<0&&c===0&&this[e+a-1]!==0&&(c=1),this[e+a]=(r/s>>0)-c&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);g(this,r,e,n,o-1,-o)}var a=n-1,s=1,c=0;for(this[e+a]=r&255;--a>=0&&(s*=256);)r<0&&c===0&&this[e+a+1]!==0&&(c=1),this[e+a]=(r/s>>0)-c&255;return e+n};u.prototype.writeInt8=function(r,e,n){return r=+r,e=e|0,n||g(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||g(this,r,e,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[e]=r&255,this[e+1]=r>>>8):B(this,r,e,!0),e+2};u.prototype.writeInt16BE=function(r,e,n){return r=+r,e=e|0,n||g(this,r,e,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[e]=r>>>8,this[e+1]=r&255):B(this,r,e,!1),e+2};u.prototype.writeInt32LE=function(r,e,n){return r=+r,e=e|0,n||g(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):L(this,r,e,!0),e+4};u.prototype.writeInt32BE=function(r,e,n){return r=+r,e=e|0,n||g(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):L(this,r,e,!1),e+4};function sr(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||sr(t,r,e,4,34028234663852886e22,-34028234663852886e22),mr(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 lr(t,r,e,n,i){return i||sr(t,r,e,8,17976931348623157e292,-17976931348623157e292),mr(t,r,e,n,52,8),e+8}u.prototype.writeDoubleLE=function(r,e,n){return lr(this,r,e,!0,n)};u.prototype.writeDoubleBE=function(r,e,n){return lr(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 s=x(r)?r:M(new u(r,i).toString()),c=s.length;for(a=0;a<n-e;++a)this[a+e]=s[a%c]}return this};var me=/[^+\/0-9A-Za-z-_]/g;function be(t){if(t=ge(t).replace(me,""),t.length<2)return"";for(;t.length%4!==0;)t=t+"=";return t}function ge(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}function he(t){return t<16?"0"+t.toString(16):t.toString(16)}function M(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 de(t){for(var r=[],e=0;e<t.length;++e)r.push(t.charCodeAt(e)&255);return r}function Te(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 pr(t){return $r(be(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 Ee(t){return t!==t}function xe(t){return t!=null&&(!!t._isBuffer||fr(t)||_e(t))}function fr(t){return!!t.constructor&&typeof t.constructor.isBuffer=="function"&&t.constructor.isBuffer(t)}function _e(t){return typeof t.readFloatLE=="function"&&typeof t.slice=="function"&&fr(t.slice(0,0))}function Y(t,r,e,n,i){var o,a,s=i*8-n-1,c=(1<<s)-1,f=c>>1,l=-7,p=e?i-1:0,T=e?-1:1,h=t[r+p];for(p+=T,o=h&(1<<-l)-1,h>>=-l,l+=s;l>0;o=o*256+t[r+p],p+=T,l-=8);for(a=o&(1<<-l)-1,o>>=-l,l+=n;l>0;a=a*256+t[r+p],p+=T,l-=8);if(o===0)o=1-f;else{if(o===c)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 mr(t,r,e,n,i,o){var a,s,c,f=o*8-i-1,l=(1<<f)-1,p=l>>1,T=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,h=n?0:o-1,P=n?1:-1,Er=r<0||r===0&&1/r<0?1:0;for(r=Math.abs(r),isNaN(r)||r===1/0?(s=isNaN(r)?1:0,a=l):(a=Math.floor(Math.log(r)/Math.LN2),r*(c=Math.pow(2,-a))<1&&(a--,c*=2),a+p>=1?r+=T/c:r+=T*Math.pow(2,1-p),r*c>=2&&(a++,c/=2),a+p>=l?(s=0,a=l):a+p>=1?(s=(r*c-1)*Math.pow(2,i),a=a+p):(s=r*Math.pow(2,p-1)*Math.pow(2,i),a=0));i>=8;t[e+h]=s&255,h+=P,s/=256,i-=8);for(a=a<<i|s,f+=i;f>0;t[e+h]=a&255,h+=P,a/=256,f-=8);t[e+h-P]|=Er*128}var D={hour:/(\d+)[H]/i,day:/(\d+)[D]/i,week:/(\d+)[W]/i,month:/(\d+)[M]/i,year:/(\d+)[Y]/i};function De(t){let r=ye(t);if(r===null)throw new Error(`Cannot fetch datepart from interval: ${t}`);let e=Number(r==="minute"?t:t.slice(0,-1));return e?r==="minute"&&e%10080===0?w("week",e/10080):r==="minute"&&e%1440===0?w("day",e/1440):r==="minute"&&e%60===0?w("hour",e/60):r==="hour"&&e%168===0?w("week",e/168):r==="hour"&&e%24===0?w(e===24?"hour":"day",e===24?24:e/24):r==="day"&&e%7===0?w("week",e/7):r==="month"&&e%12===0?w("year",e/12):w(r,e):w(r,1)}function ye(t){if(!isNaN(Number(t)))return"minute";let e=`1${t.slice(-1)}`;switch(!0){case D.hour.test(e):return"hour";case D.day.test(e):return"day";case D.week.test(e):return"week";case D.month.test(e):return"month";case D.year.test(e):return"year";default:return null}}function w(t,r){return{datepart:t,value:r,timeframe:Ie(t,r)}}function we(t){return[1,3,5,15,30].includes(t)}function Ae(t){return[1,2,3,4,12].includes(t)}function Ie(t,r){switch(t){case"minute":return we(r)?`${r}m`:"1m";case"hour":return Ae(r)?`${r}h`:"1h";case"day":return"1d";case"week":return"1w";case"month":return"1M";case"year":return"1Y";default:throw new Error(`Unsupported datepart: ${t}`)}}import K from"bignumber.js";K.config({DECIMAL_PLACES:40,EXPONENTIAL_AT:45});function br(t,r){return F(t,r,"+")}function gr(t,r){return F(t,r,"/")}function hr(t,r){return!!F(t,r,">")}function dr(t,r){return!!F(t,r,"<")}function F(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}}function We(t,r,e){let n=[],i=e-r,o=null,a=t.sort((s,c)=>c.t-s.t);for(let s=0;s<a.length;s++){let c=a[s];c.t<i&&(o&&(n.push({...o}),o=null),i=i-r*Math.ceil((i-c.t)/r)),o?(dr(o.h,c.h)&&(o.h=c.h),hr(o.l,c.l)&&(o.l=c.l),o.o=c.o,o.v=Number(br(o.v,c.v))):o={...c,t:i},s+1===a.length&&n.push({...o})}return n}function Ge(t,r,e){let n=t.sort((a,s)=>s.t-a.t),i=[],o=new Map;for(let a of n){let c=new Date(a.t*1e3).getFullYear();o.has(c)||o.set(c,[]),o.get(c).push(a)}for(let[a,s]of o){if(s.length===0)continue;let c=s.sort((l,p)=>l.t-p.t),f={t:new Date(a,0,1).getTime()/1e3,o:c[0].o,h:Math.max(...c.map(l=>l.h)),l:Math.min(...c.map(l=>l.l)),c:c[c.length-1].c,v:c.reduce((l,p)=>l+p.v,0),q:c.reduce((l,p)=>l+p.q,0)};i.push(f)}return i.sort((a,s)=>s.t-a.t)}function He(t,r,e){throw new Error("groupTickersByYearInterval has not implemented yet")}function Ve(t){return{t:+gr(t.timestamp,1e3),o:t.open,h:t.high,l:t.low,c:t.close,v:t.volume,q:t.quote}}function Ke(t){return new Date(t*1e3).setSeconds(60,0)/1e3}function qe(t){return new Date(t*1e3).setMinutes(60,0,0)/1e3}function ze(t){return new Date(t*1e3).setHours(24,0,0,0)/1e3}var et=`{"theme1":{"value":"${m.env.FRONTEND_URL}/Theme%3DDark.svg","active":true},"theme2":{"value":"${m.env.FRONTEND_URL}/Theme%3DLight.svg","active":true},"theme3":{"value":"${m.env.FRONTEND_URL}/Theme%3DLight.svg","active":true}}`;var Tr={V1_1:"v1_1",V2:"v2"},ot={[Tr.V1_1]:{testnet:62368684,mainnet:552635992},[Tr.V2]:{testnet:148607e3,mainnet:1002541853}};var Dt=t=>{let r={};return t.forEach(({settingId:e,value:n,setting:i})=>{i.type==="boolean"?r[e]=n==="true":r[e]=n}),{discordEnabled:r["point-system.discordEnabled"],telegramBotName:r["point-system.telegramBotName"],telegramBotId:r["point-system.telegramBotId"],telegramEnabled:r["point-system.telegramEnabled"],telegramGroupId:r["point-system.telegramGroupId"],telegramGroupName:r["point-system.telegramGroupName"],twitterAccountId:r["point-system.twitterAccountId"],twitterAccountName:r["point-system.twitterAccountName"],twitterEnabled:r["point-system.twitterEnabled"],twitterJobEnabled:r["point-system.twitterJobEnabled"],guideLink:r["point-system.guideLink"]}};function Bt(t){return Object.keys(t).sort().reduce((r,e)=>({...r,[e]:t[e]}),{})}function Lt(t){return Math.round(t*100)/100}export{De as getDatepartValue,We as groupTickersByInterval,Ge as groupTickersByMonthInterval,He as groupTickersByYearInterval,ye as identityDatepart,Ae as inHourCandles,we as inMinCandles,Ve as mapCandleToTicker,Lt as round2,ze as roundUpHoursInTimestamp,qe as roundUpMinutesInTimestamp,Ke as roundUpSecondsInTimestamp,Bt as sortKeysInObject,Dt as transformPointSystemSettings};
1
+ function z(){throw new Error("setTimeout has not been defined")}function $(){throw new Error("clearTimeout has not been defined")}var A=z,I=$;typeof globalThis.setTimeout=="function"&&(A=setTimeout);typeof globalThis.clearTimeout=="function"&&(I=clearTimeout);function J(t){if(A===setTimeout)return setTimeout(t,0);if((A===z||!A)&&setTimeout)return A=setTimeout,setTimeout(t,0);try{return A(t,0)}catch{try{return A.call(null,t,0)}catch{return A.call(this,t,0)}}}function xr(t){if(I===clearTimeout)return clearTimeout(t);if((I===$||!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 _=[],P=!1,R,O=-1;function _r(){!P||!R||(P=!1,R.length?_=R.concat(_):O=-1,_.length&&X())}function X(){if(!P){var t=J(_r);P=!0;for(var r=_.length;r;){for(R=_,_=[];++O<r;)R&&R[O].run();O=-1,r=_.length}R=null,P=!1,xr(t)}}function yr(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];_.push(new Q(t,r)),_.length===1&&!P&&J(X)}function Q(t,r){this.fun=t,this.array=r}Q.prototype.run=function(){this.fun.apply(null,this.array)};var wr="browser",Ar="browser",Ir=!0,Rr={},Sr=[],Nr="",kr={},vr={},Pr={};function S(){}var Dr=S,Or=S,Cr=S,Mr=S,Br=S,Lr=S,Ur=S;function Yr(t){throw new Error("process.binding is not supported")}function Fr(){return"/"}function Wr(t){throw new Error("process.chdir is not supported")}function Gr(){return 0}var v=globalThis.performance||{},Hr=v.now||v.mozNow||v.msNow||v.oNow||v.webkitNow||function(){return new Date().getTime()};function Vr(t){var r=Hr.call(v)*.001,e=Math.floor(r),n=Math.floor(r%1*1e9);return t&&(e=e-t[0],n=n-t[1],n<0&&(e--,n+=1e9)),[e,n]}var Kr=new Date;function qr(){var t=new Date,r=t-Kr;return r/1e3}var m={nextTick:yr,title:wr,browser:Ir,env:Rr,argv:Sr,version:Nr,versions:kr,on:Dr,addListener:Or,once:Cr,off:Mr,removeListener:Br,removeAllListeners:Lr,emit:Ur,binding:Yr,cwd:Fr,chdir:Wr,umask:Gr,hrtime:Vr,platform:Ar,release:vr,config:Pr,uptime:qr},q={};Object.keys(q).forEach(t=>{let r=t.split("."),e=m;for(let n=0;n<r.length;n++){let i=r[n];n===r.length-1?e[i]=q[t]:e=e[i]||(e[i]={})}});var E=[],d=[],zr=typeof Uint8Array<"u"?Uint8Array:Array,G=!1;function er(){G=!0;for(var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",r=0,e=t.length;r<e;++r)E[r]=t[r],d[t.charCodeAt(r)]=r;d[45]=62,d[95]=63}function $r(t){G||er();var r,e,n,i,o,a,s=t.length;if(s%4>0)throw new Error("Invalid string. Length must be a multiple of 4");o=t[s-2]==="="?2:t[s-1]==="="?1:0,a=new zr(s*3/4-o),n=o>0?s-4:s;var c=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[c++]=i>>16&255,a[c++]=i>>8&255,a[c++]=i&255;return o===2?(i=d[t.charCodeAt(r)]<<2|d[t.charCodeAt(r+1)]>>4,a[c++]=i&255):o===1&&(i=d[t.charCodeAt(r)]<<10|d[t.charCodeAt(r+1)]<<4|d[t.charCodeAt(r+2)]>>2,a[c++]=i>>8&255,a[c++]=i&255),a}function Jr(t){return E[t>>18&63]+E[t>>12&63]+E[t>>6&63]+E[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(Jr(n));return i.join("")}function Z(t){G||er();for(var r,e=t.length,n=e%3,i="",o=[],a=16383,s=0,c=e-n;s<c;s+=a)o.push(Xr(t,s,s+a>c?c:s+a));return n===1?(r=t[e-1],i+=E[r>>2],i+=E[r<<4&63],i+="=="):n===2&&(r=(t[e-2]<<8)+t[e-1],i+=E[r>>10],i+=E[r>>4&63],i+=E[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 y(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 H(this,t)}return tr(this,t,r,e)}u.poolSize=8192;u._augment=function(t){return t.__proto__=u.prototype,t};function tr(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?jr(t,r,e,n):typeof r=="string"?Zr(t,r,e):re(t,r)}u.from=function(t,r,e){return tr(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 nr(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 nr(r),r<=0?y(t,r):e!==void 0?typeof n=="string"?y(t,r).fill(e,n):y(t,r).fill(e):y(t,r)}u.alloc=function(t,r,e){return Qr(null,t,r,e)};function H(t,r){if(nr(r),t=y(t,r<0?0:V(r)|0),!u.TYPED_ARRAY_SUPPORT)for(var e=0;e<r;++e)t[e]=0;return t}u.allocUnsafe=function(t){return H(null,t)};u.allocUnsafeSlow=function(t){return H(null,t)};function Zr(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=ir(r,e)|0;t=y(t,n);var i=t.write(r,e);return i!==n&&(t=t.slice(0,i)),t}function W(t,r){var e=r.length<0?0:V(r.length)|0;t=y(t,e);for(var n=0;n<e;n+=1)t[n]=r[n]&255;return t}function jr(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=W(t,r),t}function re(t,r){if(x(r)){var e=V(r.length)|0;return t=y(t,e),t.length===0||r.copy(t,0,0,e),t}if(r){if(typeof ArrayBuffer<"u"&&r.buffer instanceof ArrayBuffer||"length"in r)return typeof r.length!="number"||Ee(r.length)?y(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 V(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=xe;function x(t){return!!(t!=null&&t._isBuffer)}u.compare=function(r,e){if(!x(r)||!x(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(!x(a))throw new TypeError('"list" argument must be an Array of Buffers');a.copy(i,o),o+=a.length}return i};function ir(t,r){if(x(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 M(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return e*2;case"hex":return e>>>1;case"base64":return pr(t).length;default:if(n)return M(t).length;r=(""+r).toLowerCase(),n=!0}}u.byteLength=ir;function ee(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 pe(this,r,e);case"utf8":case"utf-8":return ur(this,r,e);case"ascii":return ce(this,r,e);case"latin1":case"binary":return le(this,r,e);case"base64":return ue(this,r,e);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return fe(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?ur(this,0,r):ee.apply(this,arguments)};u.prototype.equals=function(r){if(!x(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(!x(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,s=n-e,c=Math.min(a,s),f=this.slice(i,o),l=r.slice(e,n),p=0;p<c;++p)if(f[p]!==l[p]){a=f[p],s=l[p];break}return a<s?-1:s<a?1:0};function or(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)),x(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,s=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,s/=2,e/=2}function c(h,k){return o===1?h[k]:h.readUInt16BE(k*o)}var f;if(i){var l=-1;for(f=e;f<a;f++)if(c(t,f)===c(r,l===-1?0:f-l)){if(l===-1&&(l=f),f-l+1===s)return l*o}else l!==-1&&(f-=f-l),l=-1}else for(e+s>a&&(e=a-s),f=e;f>=0;f--){for(var p=!0,T=0;T<s;T++)if(c(t,f+T)!==c(r,T)){p=!1;break}if(p)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 or(this,r,e,n,!0)};u.prototype.lastIndexOf=function(r,e,n){return or(this,r,e,n,!1)};function te(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 s=parseInt(r.substr(a*2,2),16);if(isNaN(s))return a;t[e+a]=s}return a}function ne(t,r,e,n){return U(M(r,t.length-e),t,e,n)}function ar(t,r,e,n){return U(de(r),t,e,n)}function ie(t,r,e,n){return ar(t,r,e,n)}function oe(t,r,e,n){return U(pr(r),t,e,n)}function ae(t,r,e,n){return U(Te(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 te(this,r,e,n);case"utf8":case"utf-8":return ne(this,r,e,n);case"ascii":return ar(this,r,e,n);case"latin1":case"binary":return ie(this,r,e,n);case"base64":return oe(this,r,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ae(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 ue(t,r,e){return r===0&&e===t.length?Z(t):Z(t.slice(r,e))}function ur(t,r,e){e=Math.min(t.length,e);for(var n=[],i=r;i<e;){var o=t[i],a=null,s=o>239?4:o>223?3:o>191?2:1;if(i+s<=e){var c,f,l,p;switch(s){case 1:o<128&&(a=o);break;case 2:c=t[i+1],(c&192)===128&&(p=(o&31)<<6|c&63,p>127&&(a=p));break;case 3:c=t[i+1],f=t[i+2],(c&192)===128&&(f&192)===128&&(p=(o&15)<<12|(c&63)<<6|f&63,p>2047&&(p<55296||p>57343)&&(a=p));break;case 4:c=t[i+1],f=t[i+2],l=t[i+3],(c&192)===128&&(f&192)===128&&(l&192)===128&&(p=(o&15)<<18|(c&63)<<12|(f&63)<<6|l&63,p>65535&&p<1114112&&(a=p))}}a===null?(a=65533,s=1):a>65535&&(a-=65536,n.push(a>>>10&1023|55296),a=56320|a&1023),n.push(a),i+=s}return se(n)}var rr=4096;function se(t){var r=t.length;if(r<=rr)return String.fromCharCode.apply(String,t);for(var e="",n=0;n<r;)e+=String.fromCharCode.apply(String,t.slice(n,n+=rr));return e}function ce(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 le(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 pe(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+=he(t[o]);return i}function fe(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 g(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||g(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||g(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||g(r,1,this.length),this[r]};u.prototype.readUInt16LE=function(r,e){return e||g(r,2,this.length),this[r]|this[r+1]<<8};u.prototype.readUInt16BE=function(r,e){return e||g(r,2,this.length),this[r]<<8|this[r+1]};u.prototype.readUInt32LE=function(r,e){return e||g(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||g(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||g(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||g(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||g(r,1,this.length),this[r]&128?(255-this[r]+1)*-1:this[r]};u.prototype.readInt16LE=function(r,e){e||g(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||g(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||g(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||g(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||g(r,4,this.length),Y(this,r,!0,23,4)};u.prototype.readFloatBE=function(r,e){return e||g(r,4,this.length),Y(this,r,!1,23,4)};u.prototype.readDoubleLE=function(r,e){return e||g(r,8,this.length),Y(this,r,!0,52,8)};u.prototype.readDoubleBE=function(r,e){return e||g(r,8,this.length),Y(this,r,!1,52,8)};function b(t,r,e,n,i,o){if(!x(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;b(this,r,e,n,o,0)}var a=1,s=0;for(this[e]=r&255;++s<n&&(a*=256);)this[e+s]=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;b(this,r,e,n,o,0)}var a=n-1,s=1;for(this[e+a]=r&255;--a>=0&&(s*=256);)this[e+a]=r/s&255;return e+n};u.prototype.writeUInt8=function(r,e,n){return r=+r,e=e|0,n||b(this,r,e,1,255,0),u.TYPED_ARRAY_SUPPORT||(r=Math.floor(r)),this[e]=r&255,e+1};function B(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||b(this,r,e,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[e]=r&255,this[e+1]=r>>>8):B(this,r,e,!0),e+2};u.prototype.writeUInt16BE=function(r,e,n){return r=+r,e=e|0,n||b(this,r,e,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[e]=r>>>8,this[e+1]=r&255):B(this,r,e,!1),e+2};function L(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||b(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):L(this,r,e,!0),e+4};u.prototype.writeUInt32BE=function(r,e,n){return r=+r,e=e|0,n||b(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):L(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);b(this,r,e,n,o-1,-o)}var a=0,s=1,c=0;for(this[e]=r&255;++a<n&&(s*=256);)r<0&&c===0&&this[e+a-1]!==0&&(c=1),this[e+a]=(r/s>>0)-c&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);b(this,r,e,n,o-1,-o)}var a=n-1,s=1,c=0;for(this[e+a]=r&255;--a>=0&&(s*=256);)r<0&&c===0&&this[e+a+1]!==0&&(c=1),this[e+a]=(r/s>>0)-c&255;return e+n};u.prototype.writeInt8=function(r,e,n){return r=+r,e=e|0,n||b(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||b(this,r,e,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[e]=r&255,this[e+1]=r>>>8):B(this,r,e,!0),e+2};u.prototype.writeInt16BE=function(r,e,n){return r=+r,e=e|0,n||b(this,r,e,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[e]=r>>>8,this[e+1]=r&255):B(this,r,e,!1),e+2};u.prototype.writeInt32LE=function(r,e,n){return r=+r,e=e|0,n||b(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):L(this,r,e,!0),e+4};u.prototype.writeInt32BE=function(r,e,n){return r=+r,e=e|0,n||b(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):L(this,r,e,!1),e+4};function sr(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||sr(t,r,e,4,34028234663852886e22,-34028234663852886e22),mr(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 lr(t,r,e,n,i){return i||sr(t,r,e,8,17976931348623157e292,-17976931348623157e292),mr(t,r,e,n,52,8),e+8}u.prototype.writeDoubleLE=function(r,e,n){return lr(this,r,e,!0,n)};u.prototype.writeDoubleBE=function(r,e,n){return lr(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 s=x(r)?r:M(new u(r,i).toString()),c=s.length;for(a=0;a<n-e;++a)this[a+e]=s[a%c]}return this};var me=/[^+\/0-9A-Za-z-_]/g;function ge(t){if(t=be(t).replace(me,""),t.length<2)return"";for(;t.length%4!==0;)t=t+"=";return t}function be(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}function he(t){return t<16?"0"+t.toString(16):t.toString(16)}function M(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 de(t){for(var r=[],e=0;e<t.length;++e)r.push(t.charCodeAt(e)&255);return r}function Te(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 pr(t){return $r(ge(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 Ee(t){return t!==t}function xe(t){return t!=null&&(!!t._isBuffer||fr(t)||_e(t))}function fr(t){return!!t.constructor&&typeof t.constructor.isBuffer=="function"&&t.constructor.isBuffer(t)}function _e(t){return typeof t.readFloatLE=="function"&&typeof t.slice=="function"&&fr(t.slice(0,0))}function Y(t,r,e,n,i){var o,a,s=i*8-n-1,c=(1<<s)-1,f=c>>1,l=-7,p=e?i-1:0,T=e?-1:1,h=t[r+p];for(p+=T,o=h&(1<<-l)-1,h>>=-l,l+=s;l>0;o=o*256+t[r+p],p+=T,l-=8);for(a=o&(1<<-l)-1,o>>=-l,l+=n;l>0;a=a*256+t[r+p],p+=T,l-=8);if(o===0)o=1-f;else{if(o===c)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 mr(t,r,e,n,i,o){var a,s,c,f=o*8-i-1,l=(1<<f)-1,p=l>>1,T=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,h=n?0:o-1,k=n?1:-1,Er=r<0||r===0&&1/r<0?1:0;for(r=Math.abs(r),isNaN(r)||r===1/0?(s=isNaN(r)?1:0,a=l):(a=Math.floor(Math.log(r)/Math.LN2),r*(c=Math.pow(2,-a))<1&&(a--,c*=2),a+p>=1?r+=T/c:r+=T*Math.pow(2,1-p),r*c>=2&&(a++,c/=2),a+p>=l?(s=0,a=l):a+p>=1?(s=(r*c-1)*Math.pow(2,i),a=a+p):(s=r*Math.pow(2,p-1)*Math.pow(2,i),a=0));i>=8;t[e+h]=s&255,h+=k,s/=256,i-=8);for(a=a<<i|s,f+=i;f>0;t[e+h]=a&255,h+=k,a/=256,f-=8);t[e+h-k]|=Er*128}var D={hour:/(\d+)[H]/i,day:/(\d+)[D]/i,week:/(\d+)[W]/i,month:/(\d+)[M]/i,year:/(\d+)[Y]/i};function De(t){let r=ye(t);if(r===null)throw new Error(`Cannot fetch datepart from interval: ${t}`);let e=Number(r==="minute"?t:t.slice(0,-1));return e?r==="minute"&&e%10080===0?w("week",e/10080):r==="minute"&&e%1440===0?w("day",e/1440):r==="minute"&&e%60===0?w("hour",e/60):r==="hour"&&e%168===0?w("week",e/168):r==="hour"&&e%24===0?w(e===24?"hour":"day",e===24?24:e/24):r==="day"&&e%7===0?w("week",e/7):r==="month"&&e%12===0?w("year",e/12):w(r,e):w(r,1)}function ye(t){if(!isNaN(Number(t)))return"minute";let e=`1${t.slice(-1)}`;switch(!0){case D.hour.test(e):return"hour";case D.day.test(e):return"day";case D.week.test(e):return"week";case D.month.test(e):return"month";case D.year.test(e):return"year";default:return null}}function w(t,r){return{datepart:t,value:r,timeframe:Ie(t,r)}}function we(t){return[1,3,5,15,30].includes(t)}function Ae(t){return[1,2,3,4,12].includes(t)}function Ie(t,r){switch(t){case"minute":return we(r)?`${r}m`:"1m";case"hour":return Ae(r)?`${r}h`:"1h";case"day":return"1d";case"week":return"1w";case"month":return"1M";case"year":return"1Y";default:throw new Error(`Unsupported datepart: ${t}`)}}import K from"bignumber.js";K.config({DECIMAL_PLACES:40,EXPONENTIAL_AT:45});function gr(t,r){return F(t,r,"+")}function br(t,r){return F(t,r,"/")}function hr(t,r){return!!F(t,r,">")}function dr(t,r){return!!F(t,r,"<")}function F(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}}function We(t,r,e){let n=[],i=e-r,o=null,a=t.sort((s,c)=>c.t-s.t);for(let s=0;s<a.length;s++){let c=a[s];c.t<i&&(o&&(n.push({...o}),o=null),i=i-r*Math.ceil((i-c.t)/r)),o?(dr(o.h,c.h)&&(o.h=c.h),hr(o.l,c.l)&&(o.l=c.l),o.o=c.o,o.v=Number(gr(o.v,c.v))):o={...c,t:i},s+1===a.length&&n.push({...o})}return n}function Ge(t,r,e){let n=t.sort((a,s)=>s.t-a.t),i=[],o=new Map;for(let a of n){let c=new Date(a.t*1e3).getFullYear();o.has(c)||o.set(c,[]),o.get(c).push(a)}for(let[a,s]of o){if(s.length===0)continue;let c=s.sort((l,p)=>l.t-p.t),f={t:new Date(a,0,1).getTime()/1e3,o:c[0].o,h:Math.max(...c.map(l=>l.h)),l:Math.min(...c.map(l=>l.l)),c:c[c.length-1].c,v:c.reduce((l,p)=>l+p.v,0),q:c.reduce((l,p)=>l+p.q,0)};i.push(f)}return i.sort((a,s)=>s.t-a.t)}function He(t,r,e){throw new Error("groupTickersByYearInterval has not implemented yet")}function Ve(t){return{t:+br(t.timestamp,1e3),o:t.open,h:t.high,l:t.low,c:t.close,v:t.volume,q:t.quote}}function Ke(t){return new Date(t*1e3).setSeconds(60,0)/1e3}function qe(t){return new Date(t*1e3).setMinutes(60,0,0)/1e3}function ze(t){return new Date(t*1e3).setHours(24,0,0,0)/1e3}var et=`{"theme1":{"value":"${m.env.FRONTEND_URL}/Theme%3DDark.svg","active":true},"theme2":{"value":"${m.env.FRONTEND_URL}/Theme%3DLight.svg","active":true},"theme3":{"value":"${m.env.FRONTEND_URL}/Theme%3DLight.svg","active":true}}`;var Tr={V1_1:"v1_1",V2:"v2"},ot={[Tr.V1_1]:{testnet:62368684,mainnet:552635992},[Tr.V2]:{testnet:148607e3,mainnet:1002541853}};var Dt=t=>{let r={};return t.forEach(({settingId:e,value:n,setting:i})=>{i.type==="boolean"?r[e]=n==="true":r[e]=n}),{discordEnabled:r["point-system.discordEnabled"],telegramBotName:r["point-system.telegramBotName"],telegramBotId:r["point-system.telegramBotId"],telegramEnabled:r["point-system.telegramEnabled"],telegramGroupId:r["point-system.telegramGroupId"],telegramGroupName:r["point-system.telegramGroupName"],twitterAccountId:r["point-system.twitterAccountId"],twitterAccountName:r["point-system.twitterAccountName"],twitterEnabled:r["point-system.twitterEnabled"],twitterJobEnabled:r["point-system.twitterJobEnabled"],guideLink:r["point-system.guideLink"]}};function Bt(t){return Object.keys(t).sort().reduce((r,e)=>({...r,[e]:t[e]}),{})}function Lt(t){return Math.round(t*100)/100}export{De as getDatepartValue,We as groupTickersByInterval,Ge as groupTickersByMonthInterval,He as groupTickersByYearInterval,ye as identityDatepart,Ae as inHourCandles,we as inMinCandles,Ve as mapCandleToTicker,Lt as round2,ze as roundUpHoursInTimestamp,qe as roundUpMinutesInTimestamp,Ke as roundUpSecondsInTimestamp,Bt as sortKeysInObject,Dt as transformPointSystemSettings};
2
2
  /*! Bundled license information:
3
3
 
4
4
  @esbuild-plugins/node-globals-polyfill/Buffer.js:
@@ -1,4 +1,4 @@
1
- function K(){throw new Error("setTimeout has not been defined")}function V(){throw new Error("clearTimeout has not been defined")}var w=K,A=V;typeof globalThis.setTimeout=="function"&&(w=setTimeout);typeof globalThis.clearTimeout=="function"&&(A=clearTimeout);function H(t){if(w===setTimeout)return setTimeout(t,0);if((w===K||!w)&&setTimeout)return w=setTimeout,setTimeout(t,0);try{return w(t,0)}catch{try{return w.call(null,t,0)}catch{return w.call(this,t,0)}}}function fr(t){if(A===clearTimeout)return clearTimeout(t);if((A===V||!A)&&clearTimeout)return A=clearTimeout,clearTimeout(t);try{return A(t)}catch{try{return A.call(null,t)}catch{return A.call(this,t)}}}var x=[],v=!1,I,k=-1;function mr(){!v||!I||(v=!1,I.length?x=I.concat(x):k=-1,x.length&&z())}function z(){if(!v){var t=H(mr);v=!0;for(var r=x.length;r;){for(I=x,x=[];++k<r;)I&&I[k].run();k=-1,r=x.length}I=null,v=!1,fr(t)}}function hr(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];x.push(new J(t,r)),x.length===1&&!v&&H(z)}function J(t,r){this.fun=t,this.array=r}J.prototype.run=function(){this.fun.apply(null,this.array)};var br="browser",gr="browser",dr=!0,Er={},Tr=[],_r="",xr={},yr={},wr={};function R(){}var Ar=R,Ir=R,Rr=R,Sr=R,Nr=R,Pr=R,vr=R;function kr(t){throw new Error("process.binding is not supported")}function Cr(){return"/"}function Or(t){throw new Error("process.chdir is not supported")}function Dr(){return 0}var P=globalThis.performance||{},Mr=P.now||P.mozNow||P.msNow||P.oNow||P.webkitNow||function(){return new Date().getTime()};function Br(t){var r=Mr.call(P)*.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 Lr=new Date;function Ur(){var t=new Date,r=t-Lr;return r/1e3}var h={nextTick:hr,title:br,browser:dr,env:Er,argv:Tr,version:_r,versions:xr,on:Ar,addListener:Ir,once:Rr,off:Sr,removeListener:Nr,removeAllListeners:Pr,emit:vr,binding:kr,cwd:Cr,chdir:Or,umask:Dr,hrtime:Br,platform:gr,release:yr,config:wr,uptime:Ur},G={};Object.keys(G).forEach(t=>{let r=t.split("."),e=h;for(let n=0;n<r.length;n++){let i=r[n];n===r.length-1?e[i]=G[t]:e=e[i]||(e[i]={})}});var T=[],d=[],Yr=typeof Uint8Array<"u"?Uint8Array:Array,Y=!1;function Z(){Y=!0;for(var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",r=0,e=t.length;r<e;++r)T[r]=t[r],d[t.charCodeAt(r)]=r;d[45]=62,d[95]=63}function Fr(t){Y||Z();var r,e,n,i,a,o,s=t.length;if(s%4>0)throw new Error("Invalid string. Length must be a multiple of 4");a=t[s-2]==="="?2:t[s-1]==="="?1:0,o=new Yr(s*3/4-a),n=a>0?s-4:s;var c=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)],o[c++]=i>>16&255,o[c++]=i>>8&255,o[c++]=i&255;return a===2?(i=d[t.charCodeAt(r)]<<2|d[t.charCodeAt(r+1)]>>4,o[c++]=i&255):a===1&&(i=d[t.charCodeAt(r)]<<10|d[t.charCodeAt(r+1)]<<4|d[t.charCodeAt(r+2)]>>2,o[c++]=i>>8&255,o[c++]=i&255),o}function Wr(t){return T[t>>18&63]+T[t>>12&63]+T[t>>6&63]+T[t&63]}function Gr(t,r,e){for(var n,i=[],a=r;a<e;a+=3)n=(t[a]<<16)+(t[a+1]<<8)+t[a+2],i.push(Wr(n));return i.join("")}function X(t){Y||Z();for(var r,e=t.length,n=e%3,i="",a=[],o=16383,s=0,c=e-n;s<c;s+=o)a.push(Gr(t,s,s+o>c?c:s+o));return n===1?(r=t[e-1],i+=T[r>>2],i+=T[r<<4&63],i+="=="):n===2&&(r=(t[e-2]<<8)+t[e-1],i+=T[r>>10],i+=T[r>>4&63],i+=T[r<<2&63],i+="="),a.push(i),a.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 y(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 Q(this,t,r,e)}u.poolSize=8192;u._augment=function(t){return t.__proto__=u.prototype,t};function Q(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"?Vr(t,r,e):zr(t,r)}u.from=function(t,r,e){return Q(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?y(t,r):e!==void 0?typeof n=="string"?y(t,r).fill(e,n):y(t,r).fill(e):y(t,r)}u.alloc=function(t,r,e){return Kr(null,t,r,e)};function F(t,r){if(j(r),t=y(t,r<0?0:W(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 Vr(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=y(t,n);var i=t.write(r,e);return i!==n&&(t=t.slice(0,i)),t}function U(t,r){var e=r.length<0?0:W(r.length)|0;t=y(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=U(t,r),t}function zr(t,r){if(_(r)){var e=W(r.length)|0;return t=y(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"||pe(r.length)?y(t,0):U(t,r);if(r.type==="Buffer"&&Array.isArray(r.data))return U(t,r.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function W(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=fe;function _(t){return!!(t!=null&&t._isBuffer)}u.compare=function(r,e){if(!_(r)||!_(e))throw new TypeError("Arguments must be Buffers");if(r===e)return 0;for(var n=r.length,i=e.length,a=0,o=Math.min(n,i);a<o;++a)if(r[a]!==e[a]){n=r[a],i=e[a];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),a=0;for(n=0;n<r.length;++n){var o=r[n];if(!_(o))throw new TypeError('"list" argument must be an Array of Buffers');o.copy(i,a),a+=o.length}return i};function rr(t,r){if(_(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 O(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 O(t).length;r=(""+r).toLowerCase(),n=!0}}u.byteLength=rr;function Jr(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 ne(this,r,e);case"utf8":case"utf-8":return nr(this,r,e);case"ascii":return ee(this,r,e);case"latin1":case"binary":return te(this,r,e);case"base64":return jr(this,r,e);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ie(this,r,e);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}u.prototype._isBuffer=!0;function S(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)S(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)S(this,e,e+3),S(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)S(this,e,e+7),S(this,e+1,e+6),S(this,e+2,e+5),S(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):Jr.apply(this,arguments)};u.prototype.equals=function(r){if(!_(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,a){if(!_(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),a===void 0&&(a=this.length),e<0||n>r.length||i<0||a>this.length)throw new RangeError("out of range index");if(i>=a&&e>=n)return 0;if(i>=a)return-1;if(e>=n)return 1;if(e>>>=0,n>>>=0,i>>>=0,a>>>=0,this===r)return 0;for(var o=a-i,s=n-e,c=Math.min(o,s),p=this.slice(i,a),f=r.slice(e,n),l=0;l<c;++l)if(p[l]!==f[l]){o=p[l],s=f[l];break}return o<s?-1:s<o?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)),_(r))return r.length===0?-1:q(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):q(t,[r],e,n,i);throw new TypeError("val must be string, number or Buffer")}function q(t,r,e,n,i){var a=1,o=t.length,s=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,o/=2,s/=2,e/=2}function c(g,N){return a===1?g[N]:g.readUInt16BE(N*a)}var p;if(i){var f=-1;for(p=e;p<o;p++)if(c(t,p)===c(r,f===-1?0:p-f)){if(f===-1&&(f=p),p-f+1===s)return f*a}else f!==-1&&(p-=p-f),f=-1}else for(e+s>o&&(e=o-s),p=e;p>=0;p--){for(var l=!0,E=0;E<s;E++)if(c(t,p+E)!==c(r,E)){l=!1;break}if(l)return p}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 Xr(t,r,e,n){e=Number(e)||0;var i=t.length-e;n?(n=Number(n),n>i&&(n=i)):n=i;var a=r.length;if(a%2!==0)throw new TypeError("Invalid hex string");n>a/2&&(n=a/2);for(var o=0;o<n;++o){var s=parseInt(r.substr(o*2,2),16);if(isNaN(s))return o;t[e+o]=s}return o}function qr(t,r,e,n){return B(O(r,t.length-e),t,e,n)}function tr(t,r,e,n){return B(ce(r),t,e,n)}function $r(t,r,e,n){return tr(t,r,e,n)}function Zr(t,r,e,n){return B(ur(r),t,e,n)}function Qr(t,r,e,n){return B(le(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 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");i||(i="utf8");for(var o=!1;;)switch(i){case"hex":return Xr(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 $r(this,r,e,n);case"base64":return Zr(this,r,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Qr(this,r,e,n);default:if(o)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),o=!0}};u.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function jr(t,r,e){return r===0&&e===t.length?X(t):X(t.slice(r,e))}function nr(t,r,e){e=Math.min(t.length,e);for(var n=[],i=r;i<e;){var a=t[i],o=null,s=a>239?4:a>223?3:a>191?2:1;if(i+s<=e){var c,p,f,l;switch(s){case 1:a<128&&(o=a);break;case 2:c=t[i+1],(c&192)===128&&(l=(a&31)<<6|c&63,l>127&&(o=l));break;case 3:c=t[i+1],p=t[i+2],(c&192)===128&&(p&192)===128&&(l=(a&15)<<12|(c&63)<<6|p&63,l>2047&&(l<55296||l>57343)&&(o=l));break;case 4:c=t[i+1],p=t[i+2],f=t[i+3],(c&192)===128&&(p&192)===128&&(f&192)===128&&(l=(a&15)<<18|(c&63)<<12|(p&63)<<6|f&63,l>65535&&l<1114112&&(o=l))}}o===null?(o=65533,s=1):o>65535&&(o-=65536,n.push(o>>>10&1023|55296),o=56320|o&1023),n.push(o),i+=s}return re(n)}var $=4096;function re(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 ee(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 te(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 ne(t,r,e){var n=t.length;(!r||r<0)&&(r=0),(!e||e<0||e>n)&&(e=n);for(var i="",a=r;a<e;++a)i+=se(t[a]);return i}function ie(t,r,e){for(var n=t.slice(r,e),i="",a=0;a<n.length;a+=2)i+=String.fromCharCode(n[a]+n[a+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 a=e-r;i=new u(a,void 0);for(var o=0;o<a;++o)i[o]=this[o+r]}return i};function m(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||m(r,e,this.length);for(var i=this[r],a=1,o=0;++o<e&&(a*=256);)i+=this[r+o]*a;return i};u.prototype.readUIntBE=function(r,e,n){r=r|0,e=e|0,n||m(r,e,this.length);for(var i=this[r+--e],a=1;e>0&&(a*=256);)i+=this[r+--e]*a;return i};u.prototype.readUInt8=function(r,e){return e||m(r,1,this.length),this[r]};u.prototype.readUInt16LE=function(r,e){return e||m(r,2,this.length),this[r]|this[r+1]<<8};u.prototype.readUInt16BE=function(r,e){return e||m(r,2,this.length),this[r]<<8|this[r+1]};u.prototype.readUInt32LE=function(r,e){return e||m(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||m(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||m(r,e,this.length);for(var i=this[r],a=1,o=0;++o<e&&(a*=256);)i+=this[r+o]*a;return a*=128,i>=a&&(i-=Math.pow(2,8*e)),i};u.prototype.readIntBE=function(r,e,n){r=r|0,e=e|0,n||m(r,e,this.length);for(var i=e,a=1,o=this[r+--i];i>0&&(a*=256);)o+=this[r+--i]*a;return a*=128,o>=a&&(o-=Math.pow(2,8*e)),o};u.prototype.readInt8=function(r,e){return e||m(r,1,this.length),this[r]&128?(255-this[r]+1)*-1:this[r]};u.prototype.readInt16LE=function(r,e){e||m(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||m(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||m(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||m(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||m(r,4,this.length),L(this,r,!0,23,4)};u.prototype.readFloatBE=function(r,e){return e||m(r,4,this.length),L(this,r,!1,23,4)};u.prototype.readDoubleLE=function(r,e){return e||m(r,8,this.length),L(this,r,!0,52,8)};u.prototype.readDoubleBE=function(r,e){return e||m(r,8,this.length),L(this,r,!1,52,8)};function b(t,r,e,n,i,a){if(!_(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(r>i||r<a)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 a=Math.pow(2,8*n)-1;b(this,r,e,n,a,0)}var o=1,s=0;for(this[e]=r&255;++s<n&&(o*=256);)this[e+s]=r/o&255;return e+n};u.prototype.writeUIntBE=function(r,e,n,i){if(r=+r,e=e|0,n=n|0,!i){var a=Math.pow(2,8*n)-1;b(this,r,e,n,a,0)}var o=n-1,s=1;for(this[e+o]=r&255;--o>=0&&(s*=256);)this[e+o]=r/s&255;return e+n};u.prototype.writeUInt8=function(r,e,n){return r=+r,e=e|0,n||b(this,r,e,1,255,0),u.TYPED_ARRAY_SUPPORT||(r=Math.floor(r)),this[e]=r&255,e+1};function D(t,r,e,n){r<0&&(r=65535+r+1);for(var i=0,a=Math.min(t.length-e,2);i<a;++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||b(this,r,e,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[e]=r&255,this[e+1]=r>>>8):D(this,r,e,!0),e+2};u.prototype.writeUInt16BE=function(r,e,n){return r=+r,e=e|0,n||b(this,r,e,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[e]=r>>>8,this[e+1]=r&255):D(this,r,e,!1),e+2};function M(t,r,e,n){r<0&&(r=4294967295+r+1);for(var i=0,a=Math.min(t.length-e,4);i<a;++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||b(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||b(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 a=Math.pow(2,8*n-1);b(this,r,e,n,a-1,-a)}var o=0,s=1,c=0;for(this[e]=r&255;++o<n&&(s*=256);)r<0&&c===0&&this[e+o-1]!==0&&(c=1),this[e+o]=(r/s>>0)-c&255;return e+n};u.prototype.writeIntBE=function(r,e,n,i){if(r=+r,e=e|0,!i){var a=Math.pow(2,8*n-1);b(this,r,e,n,a-1,-a)}var o=n-1,s=1,c=0;for(this[e+o]=r&255;--o>=0&&(s*=256);)r<0&&c===0&&this[e+o+1]!==0&&(c=1),this[e+o]=(r/s>>0)-c&255;return e+n};u.prototype.writeInt8=function(r,e,n){return r=+r,e=e|0,n||b(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||b(this,r,e,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[e]=r&255,this[e+1]=r>>>8):D(this,r,e,!0),e+2};u.prototype.writeInt16BE=function(r,e,n){return r=+r,e=e|0,n||b(this,r,e,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[e]=r>>>8,this[e+1]=r&255):D(this,r,e,!1),e+2};u.prototype.writeInt32LE=function(r,e,n){return r=+r,e=e|0,n||b(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||b(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,a){if(e+n>t.length)throw new RangeError("Index out of range");if(e<0)throw new RangeError("Index out of range")}function ar(t,r,e,n,i){return i||ir(t,r,e,4,34028234663852886e22,-34028234663852886e22),cr(t,r,e,n,23,4),e+4}u.prototype.writeFloatLE=function(r,e,n){return ar(this,r,e,!0,n)};u.prototype.writeFloatBE=function(r,e,n){return ar(this,r,e,!1,n)};function or(t,r,e,n,i){return i||ir(t,r,e,8,17976931348623157e292,-17976931348623157e292),cr(t,r,e,n,52,8),e+8}u.prototype.writeDoubleLE=function(r,e,n){return or(this,r,e,!0,n)};u.prototype.writeDoubleBE=function(r,e,n){return or(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 a=i-n,o;if(this===r&&n<e&&e<i)for(o=a-1;o>=0;--o)r[o+e]=this[o+n];else if(a<1e3||!u.TYPED_ARRAY_SUPPORT)for(o=0;o<a;++o)r[o+e]=this[o+n];else Uint8Array.prototype.set.call(r,this.subarray(n,n+a),e);return a};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 a=r.charCodeAt(0);a<256&&(r=a)}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 o;if(typeof r=="number")for(o=e;o<n;++o)this[o]=r;else{var s=_(r)?r:O(new u(r,i).toString()),c=s.length;for(o=0;o<n-e;++o)this[o+e]=s[o%c]}return this};var ae=/[^+\/0-9A-Za-z-_]/g;function oe(t){if(t=ue(t).replace(ae,""),t.length<2)return"";for(;t.length%4!==0;)t=t+"=";return t}function ue(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}function se(t){return t<16?"0"+t.toString(16):t.toString(16)}function O(t,r){r=r||1/0;for(var e,n=t.length,i=null,a=[],o=0;o<n;++o){if(e=t.charCodeAt(o),e>55295&&e<57344){if(!i){if(e>56319){(r-=3)>-1&&a.push(239,191,189);continue}else if(o+1===n){(r-=3)>-1&&a.push(239,191,189);continue}i=e;continue}if(e<56320){(r-=3)>-1&&a.push(239,191,189),i=e;continue}e=(i-55296<<10|e-56320)+65536}else i&&(r-=3)>-1&&a.push(239,191,189);if(i=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 ce(t){for(var r=[],e=0;e<t.length;++e)r.push(t.charCodeAt(e)&255);return r}function le(t,r){for(var e,n,i,a=[],o=0;o<t.length&&!((r-=2)<0);++o)e=t.charCodeAt(o),n=e>>8,i=e%256,a.push(i),a.push(n);return a}function ur(t){return Fr(oe(t))}function B(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 pe(t){return t!==t}function fe(t){return t!=null&&(!!t._isBuffer||sr(t)||me(t))}function sr(t){return!!t.constructor&&typeof t.constructor.isBuffer=="function"&&t.constructor.isBuffer(t)}function me(t){return typeof t.readFloatLE=="function"&&typeof t.slice=="function"&&sr(t.slice(0,0))}function L(t,r,e,n,i){var a,o,s=i*8-n-1,c=(1<<s)-1,p=c>>1,f=-7,l=e?i-1:0,E=e?-1:1,g=t[r+l];for(l+=E,a=g&(1<<-f)-1,g>>=-f,f+=s;f>0;a=a*256+t[r+l],l+=E,f-=8);for(o=a&(1<<-f)-1,a>>=-f,f+=n;f>0;o=o*256+t[r+l],l+=E,f-=8);if(a===0)a=1-p;else{if(a===c)return o?NaN:(g?-1:1)*(1/0);o=o+Math.pow(2,n),a=a-p}return(g?-1:1)*o*Math.pow(2,a-n)}function cr(t,r,e,n,i,a){var o,s,c,p=a*8-i-1,f=(1<<p)-1,l=f>>1,E=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,g=n?0:a-1,N=n?1:-1,pr=r<0||r===0&&1/r<0?1:0;for(r=Math.abs(r),isNaN(r)||r===1/0?(s=isNaN(r)?1:0,o=f):(o=Math.floor(Math.log(r)/Math.LN2),r*(c=Math.pow(2,-o))<1&&(o--,c*=2),o+l>=1?r+=E/c:r+=E*Math.pow(2,1-l),r*c>=2&&(o++,c/=2),o+l>=f?(s=0,o=f):o+l>=1?(s=(r*c-1)*Math.pow(2,i),o=o+l):(s=r*Math.pow(2,l-1)*Math.pow(2,i),o=0));i>=8;t[e+g]=s&255,g+=N,s/=256,i-=8);for(o=o<<i|s,p+=i;p>0;t[e+g]=o&255,g+=N,o/=256,p-=8);t[e+g-N]|=pr*128}var Ae=`{"theme1":{"value":"${h.env.FRONTEND_URL}/Theme%3DDark.svg","active":true},"theme2":{"value":"${h.env.FRONTEND_URL}/Theme%3DLight.svg","active":true},"theme3":{"value":"${h.env.FRONTEND_URL}/Theme%3DLight.svg","active":true}}`;var lr={V1_1:"v1_1",V2:"v2"},Ne={[lr.V1_1]:{testnet:62368684,mainnet:552635992},[lr.V2]:{testnet:148607e3,mainnet:1002541853}};var et=t=>{let r={};return t.forEach(({settingId:e,value:n,setting:i})=>{i.type==="boolean"?r[e]=n==="true":r[e]=n}),{discordEnabled:r["point-system.discordEnabled"],telegramBotName:r["point-system.telegramBotName"],telegramBotId:r["point-system.telegramBotId"],telegramEnabled:r["point-system.telegramEnabled"],telegramGroupId:r["point-system.telegramGroupId"],telegramGroupName:r["point-system.telegramGroupName"],twitterAccountId:r["point-system.twitterAccountId"],twitterAccountName:r["point-system.twitterAccountName"],twitterEnabled:r["point-system.twitterEnabled"],twitterJobEnabled:r["point-system.twitterJobEnabled"],guideLink:r["point-system.guideLink"]}};export{et as transformPointSystemSettings};
1
+ function V(){throw new Error("setTimeout has not been defined")}function K(){throw new Error("clearTimeout has not been defined")}var w=V,A=K;typeof globalThis.setTimeout=="function"&&(w=setTimeout);typeof globalThis.clearTimeout=="function"&&(A=clearTimeout);function H(t){if(w===setTimeout)return setTimeout(t,0);if((w===V||!w)&&setTimeout)return w=setTimeout,setTimeout(t,0);try{return w(t,0)}catch{try{return w.call(null,t,0)}catch{return w.call(this,t,0)}}}function fr(t){if(A===clearTimeout)return clearTimeout(t);if((A===K||!A)&&clearTimeout)return A=clearTimeout,clearTimeout(t);try{return A(t)}catch{try{return A.call(null,t)}catch{return A.call(this,t)}}}var x=[],P=!1,I,k=-1;function mr(){!P||!I||(P=!1,I.length?x=I.concat(x):k=-1,x.length&&z())}function z(){if(!P){var t=H(mr);P=!0;for(var r=x.length;r;){for(I=x,x=[];++k<r;)I&&I[k].run();k=-1,r=x.length}I=null,P=!1,fr(t)}}function hr(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];x.push(new J(t,r)),x.length===1&&!P&&H(z)}function J(t,r){this.fun=t,this.array=r}J.prototype.run=function(){this.fun.apply(null,this.array)};var gr="browser",br="browser",dr=!0,Er={},_r=[],Tr="",xr={},yr={},wr={};function R(){}var Ar=R,Ir=R,Rr=R,Sr=R,Nr=R,vr=R,Pr=R;function kr(t){throw new Error("process.binding is not supported")}function Cr(){return"/"}function Or(t){throw new Error("process.chdir is not supported")}function Dr(){return 0}var v=globalThis.performance||{},Mr=v.now||v.mozNow||v.msNow||v.oNow||v.webkitNow||function(){return new Date().getTime()};function Br(t){var r=Mr.call(v)*.001,e=Math.floor(r),n=Math.floor(r%1*1e9);return t&&(e=e-t[0],n=n-t[1],n<0&&(e--,n+=1e9)),[e,n]}var Lr=new Date;function Ur(){var t=new Date,r=t-Lr;return r/1e3}var h={nextTick:hr,title:gr,browser:dr,env:Er,argv:_r,version:Tr,versions:xr,on:Ar,addListener:Ir,once:Rr,off:Sr,removeListener:Nr,removeAllListeners:vr,emit:Pr,binding:kr,cwd:Cr,chdir:Or,umask:Dr,hrtime:Br,platform:br,release:yr,config:wr,uptime:Ur},G={};Object.keys(G).forEach(t=>{let r=t.split("."),e=h;for(let n=0;n<r.length;n++){let i=r[n];n===r.length-1?e[i]=G[t]:e=e[i]||(e[i]={})}});var _=[],d=[],Yr=typeof Uint8Array<"u"?Uint8Array:Array,Y=!1;function Z(){Y=!0;for(var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",r=0,e=t.length;r<e;++r)_[r]=t[r],d[t.charCodeAt(r)]=r;d[45]=62,d[95]=63}function Fr(t){Y||Z();var r,e,n,i,a,o,s=t.length;if(s%4>0)throw new Error("Invalid string. Length must be a multiple of 4");a=t[s-2]==="="?2:t[s-1]==="="?1:0,o=new Yr(s*3/4-a),n=a>0?s-4:s;var c=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)],o[c++]=i>>16&255,o[c++]=i>>8&255,o[c++]=i&255;return a===2?(i=d[t.charCodeAt(r)]<<2|d[t.charCodeAt(r+1)]>>4,o[c++]=i&255):a===1&&(i=d[t.charCodeAt(r)]<<10|d[t.charCodeAt(r+1)]<<4|d[t.charCodeAt(r+2)]>>2,o[c++]=i>>8&255,o[c++]=i&255),o}function Wr(t){return _[t>>18&63]+_[t>>12&63]+_[t>>6&63]+_[t&63]}function Gr(t,r,e){for(var n,i=[],a=r;a<e;a+=3)n=(t[a]<<16)+(t[a+1]<<8)+t[a+2],i.push(Wr(n));return i.join("")}function X(t){Y||Z();for(var r,e=t.length,n=e%3,i="",a=[],o=16383,s=0,c=e-n;s<c;s+=o)a.push(Gr(t,s,s+o>c?c:s+o));return n===1?(r=t[e-1],i+=_[r>>2],i+=_[r<<4&63],i+="=="):n===2&&(r=(t[e-2]<<8)+t[e-1],i+=_[r>>10],i+=_[r>>4&63],i+=_[r<<2&63],i+="="),a.push(i),a.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 y(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 Q(this,t,r,e)}u.poolSize=8192;u._augment=function(t){return t.__proto__=u.prototype,t};function Q(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"?Kr(t,r,e):zr(t,r)}u.from=function(t,r,e){return Q(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 Vr(t,r,e,n){return j(r),r<=0?y(t,r):e!==void 0?typeof n=="string"?y(t,r).fill(e,n):y(t,r).fill(e):y(t,r)}u.alloc=function(t,r,e){return Vr(null,t,r,e)};function F(t,r){if(j(r),t=y(t,r<0?0:W(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 Kr(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=y(t,n);var i=t.write(r,e);return i!==n&&(t=t.slice(0,i)),t}function U(t,r){var e=r.length<0?0:W(r.length)|0;t=y(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=U(t,r),t}function zr(t,r){if(T(r)){var e=W(r.length)|0;return t=y(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"||pe(r.length)?y(t,0):U(t,r);if(r.type==="Buffer"&&Array.isArray(r.data))return U(t,r.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function W(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=fe;function T(t){return!!(t!=null&&t._isBuffer)}u.compare=function(r,e){if(!T(r)||!T(e))throw new TypeError("Arguments must be Buffers");if(r===e)return 0;for(var n=r.length,i=e.length,a=0,o=Math.min(n,i);a<o;++a)if(r[a]!==e[a]){n=r[a],i=e[a];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),a=0;for(n=0;n<r.length;++n){var o=r[n];if(!T(o))throw new TypeError('"list" argument must be an Array of Buffers');o.copy(i,a),a+=o.length}return i};function rr(t,r){if(T(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 O(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 O(t).length;r=(""+r).toLowerCase(),n=!0}}u.byteLength=rr;function Jr(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 ne(this,r,e);case"utf8":case"utf-8":return nr(this,r,e);case"ascii":return ee(this,r,e);case"latin1":case"binary":return te(this,r,e);case"base64":return jr(this,r,e);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ie(this,r,e);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}u.prototype._isBuffer=!0;function S(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)S(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)S(this,e,e+3),S(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)S(this,e,e+7),S(this,e+1,e+6),S(this,e+2,e+5),S(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):Jr.apply(this,arguments)};u.prototype.equals=function(r){if(!T(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,a){if(!T(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),a===void 0&&(a=this.length),e<0||n>r.length||i<0||a>this.length)throw new RangeError("out of range index");if(i>=a&&e>=n)return 0;if(i>=a)return-1;if(e>=n)return 1;if(e>>>=0,n>>>=0,i>>>=0,a>>>=0,this===r)return 0;for(var o=a-i,s=n-e,c=Math.min(o,s),p=this.slice(i,a),f=r.slice(e,n),l=0;l<c;++l)if(p[l]!==f[l]){o=p[l],s=f[l];break}return o<s?-1:s<o?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)),T(r))return r.length===0?-1:q(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):q(t,[r],e,n,i);throw new TypeError("val must be string, number or Buffer")}function q(t,r,e,n,i){var a=1,o=t.length,s=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,o/=2,s/=2,e/=2}function c(b,N){return a===1?b[N]:b.readUInt16BE(N*a)}var p;if(i){var f=-1;for(p=e;p<o;p++)if(c(t,p)===c(r,f===-1?0:p-f)){if(f===-1&&(f=p),p-f+1===s)return f*a}else f!==-1&&(p-=p-f),f=-1}else for(e+s>o&&(e=o-s),p=e;p>=0;p--){for(var l=!0,E=0;E<s;E++)if(c(t,p+E)!==c(r,E)){l=!1;break}if(l)return p}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 Xr(t,r,e,n){e=Number(e)||0;var i=t.length-e;n?(n=Number(n),n>i&&(n=i)):n=i;var a=r.length;if(a%2!==0)throw new TypeError("Invalid hex string");n>a/2&&(n=a/2);for(var o=0;o<n;++o){var s=parseInt(r.substr(o*2,2),16);if(isNaN(s))return o;t[e+o]=s}return o}function qr(t,r,e,n){return B(O(r,t.length-e),t,e,n)}function tr(t,r,e,n){return B(ce(r),t,e,n)}function $r(t,r,e,n){return tr(t,r,e,n)}function Zr(t,r,e,n){return B(ur(r),t,e,n)}function Qr(t,r,e,n){return B(le(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 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");i||(i="utf8");for(var o=!1;;)switch(i){case"hex":return Xr(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 $r(this,r,e,n);case"base64":return Zr(this,r,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Qr(this,r,e,n);default:if(o)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),o=!0}};u.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function jr(t,r,e){return r===0&&e===t.length?X(t):X(t.slice(r,e))}function nr(t,r,e){e=Math.min(t.length,e);for(var n=[],i=r;i<e;){var a=t[i],o=null,s=a>239?4:a>223?3:a>191?2:1;if(i+s<=e){var c,p,f,l;switch(s){case 1:a<128&&(o=a);break;case 2:c=t[i+1],(c&192)===128&&(l=(a&31)<<6|c&63,l>127&&(o=l));break;case 3:c=t[i+1],p=t[i+2],(c&192)===128&&(p&192)===128&&(l=(a&15)<<12|(c&63)<<6|p&63,l>2047&&(l<55296||l>57343)&&(o=l));break;case 4:c=t[i+1],p=t[i+2],f=t[i+3],(c&192)===128&&(p&192)===128&&(f&192)===128&&(l=(a&15)<<18|(c&63)<<12|(p&63)<<6|f&63,l>65535&&l<1114112&&(o=l))}}o===null?(o=65533,s=1):o>65535&&(o-=65536,n.push(o>>>10&1023|55296),o=56320|o&1023),n.push(o),i+=s}return re(n)}var $=4096;function re(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 ee(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 te(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 ne(t,r,e){var n=t.length;(!r||r<0)&&(r=0),(!e||e<0||e>n)&&(e=n);for(var i="",a=r;a<e;++a)i+=se(t[a]);return i}function ie(t,r,e){for(var n=t.slice(r,e),i="",a=0;a<n.length;a+=2)i+=String.fromCharCode(n[a]+n[a+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 a=e-r;i=new u(a,void 0);for(var o=0;o<a;++o)i[o]=this[o+r]}return i};function m(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||m(r,e,this.length);for(var i=this[r],a=1,o=0;++o<e&&(a*=256);)i+=this[r+o]*a;return i};u.prototype.readUIntBE=function(r,e,n){r=r|0,e=e|0,n||m(r,e,this.length);for(var i=this[r+--e],a=1;e>0&&(a*=256);)i+=this[r+--e]*a;return i};u.prototype.readUInt8=function(r,e){return e||m(r,1,this.length),this[r]};u.prototype.readUInt16LE=function(r,e){return e||m(r,2,this.length),this[r]|this[r+1]<<8};u.prototype.readUInt16BE=function(r,e){return e||m(r,2,this.length),this[r]<<8|this[r+1]};u.prototype.readUInt32LE=function(r,e){return e||m(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||m(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||m(r,e,this.length);for(var i=this[r],a=1,o=0;++o<e&&(a*=256);)i+=this[r+o]*a;return a*=128,i>=a&&(i-=Math.pow(2,8*e)),i};u.prototype.readIntBE=function(r,e,n){r=r|0,e=e|0,n||m(r,e,this.length);for(var i=e,a=1,o=this[r+--i];i>0&&(a*=256);)o+=this[r+--i]*a;return a*=128,o>=a&&(o-=Math.pow(2,8*e)),o};u.prototype.readInt8=function(r,e){return e||m(r,1,this.length),this[r]&128?(255-this[r]+1)*-1:this[r]};u.prototype.readInt16LE=function(r,e){e||m(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||m(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||m(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||m(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||m(r,4,this.length),L(this,r,!0,23,4)};u.prototype.readFloatBE=function(r,e){return e||m(r,4,this.length),L(this,r,!1,23,4)};u.prototype.readDoubleLE=function(r,e){return e||m(r,8,this.length),L(this,r,!0,52,8)};u.prototype.readDoubleBE=function(r,e){return e||m(r,8,this.length),L(this,r,!1,52,8)};function g(t,r,e,n,i,a){if(!T(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(r>i||r<a)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 a=Math.pow(2,8*n)-1;g(this,r,e,n,a,0)}var o=1,s=0;for(this[e]=r&255;++s<n&&(o*=256);)this[e+s]=r/o&255;return e+n};u.prototype.writeUIntBE=function(r,e,n,i){if(r=+r,e=e|0,n=n|0,!i){var a=Math.pow(2,8*n)-1;g(this,r,e,n,a,0)}var o=n-1,s=1;for(this[e+o]=r&255;--o>=0&&(s*=256);)this[e+o]=r/s&255;return e+n};u.prototype.writeUInt8=function(r,e,n){return r=+r,e=e|0,n||g(this,r,e,1,255,0),u.TYPED_ARRAY_SUPPORT||(r=Math.floor(r)),this[e]=r&255,e+1};function D(t,r,e,n){r<0&&(r=65535+r+1);for(var i=0,a=Math.min(t.length-e,2);i<a;++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||g(this,r,e,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[e]=r&255,this[e+1]=r>>>8):D(this,r,e,!0),e+2};u.prototype.writeUInt16BE=function(r,e,n){return r=+r,e=e|0,n||g(this,r,e,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[e]=r>>>8,this[e+1]=r&255):D(this,r,e,!1),e+2};function M(t,r,e,n){r<0&&(r=4294967295+r+1);for(var i=0,a=Math.min(t.length-e,4);i<a;++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||g(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||g(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 a=Math.pow(2,8*n-1);g(this,r,e,n,a-1,-a)}var o=0,s=1,c=0;for(this[e]=r&255;++o<n&&(s*=256);)r<0&&c===0&&this[e+o-1]!==0&&(c=1),this[e+o]=(r/s>>0)-c&255;return e+n};u.prototype.writeIntBE=function(r,e,n,i){if(r=+r,e=e|0,!i){var a=Math.pow(2,8*n-1);g(this,r,e,n,a-1,-a)}var o=n-1,s=1,c=0;for(this[e+o]=r&255;--o>=0&&(s*=256);)r<0&&c===0&&this[e+o+1]!==0&&(c=1),this[e+o]=(r/s>>0)-c&255;return e+n};u.prototype.writeInt8=function(r,e,n){return r=+r,e=e|0,n||g(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||g(this,r,e,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[e]=r&255,this[e+1]=r>>>8):D(this,r,e,!0),e+2};u.prototype.writeInt16BE=function(r,e,n){return r=+r,e=e|0,n||g(this,r,e,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[e]=r>>>8,this[e+1]=r&255):D(this,r,e,!1),e+2};u.prototype.writeInt32LE=function(r,e,n){return r=+r,e=e|0,n||g(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||g(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,a){if(e+n>t.length)throw new RangeError("Index out of range");if(e<0)throw new RangeError("Index out of range")}function ar(t,r,e,n,i){return i||ir(t,r,e,4,34028234663852886e22,-34028234663852886e22),cr(t,r,e,n,23,4),e+4}u.prototype.writeFloatLE=function(r,e,n){return ar(this,r,e,!0,n)};u.prototype.writeFloatBE=function(r,e,n){return ar(this,r,e,!1,n)};function or(t,r,e,n,i){return i||ir(t,r,e,8,17976931348623157e292,-17976931348623157e292),cr(t,r,e,n,52,8),e+8}u.prototype.writeDoubleLE=function(r,e,n){return or(this,r,e,!0,n)};u.prototype.writeDoubleBE=function(r,e,n){return or(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 a=i-n,o;if(this===r&&n<e&&e<i)for(o=a-1;o>=0;--o)r[o+e]=this[o+n];else if(a<1e3||!u.TYPED_ARRAY_SUPPORT)for(o=0;o<a;++o)r[o+e]=this[o+n];else Uint8Array.prototype.set.call(r,this.subarray(n,n+a),e);return a};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 a=r.charCodeAt(0);a<256&&(r=a)}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 o;if(typeof r=="number")for(o=e;o<n;++o)this[o]=r;else{var s=T(r)?r:O(new u(r,i).toString()),c=s.length;for(o=0;o<n-e;++o)this[o+e]=s[o%c]}return this};var ae=/[^+\/0-9A-Za-z-_]/g;function oe(t){if(t=ue(t).replace(ae,""),t.length<2)return"";for(;t.length%4!==0;)t=t+"=";return t}function ue(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}function se(t){return t<16?"0"+t.toString(16):t.toString(16)}function O(t,r){r=r||1/0;for(var e,n=t.length,i=null,a=[],o=0;o<n;++o){if(e=t.charCodeAt(o),e>55295&&e<57344){if(!i){if(e>56319){(r-=3)>-1&&a.push(239,191,189);continue}else if(o+1===n){(r-=3)>-1&&a.push(239,191,189);continue}i=e;continue}if(e<56320){(r-=3)>-1&&a.push(239,191,189),i=e;continue}e=(i-55296<<10|e-56320)+65536}else i&&(r-=3)>-1&&a.push(239,191,189);if(i=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 ce(t){for(var r=[],e=0;e<t.length;++e)r.push(t.charCodeAt(e)&255);return r}function le(t,r){for(var e,n,i,a=[],o=0;o<t.length&&!((r-=2)<0);++o)e=t.charCodeAt(o),n=e>>8,i=e%256,a.push(i),a.push(n);return a}function ur(t){return Fr(oe(t))}function B(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 pe(t){return t!==t}function fe(t){return t!=null&&(!!t._isBuffer||sr(t)||me(t))}function sr(t){return!!t.constructor&&typeof t.constructor.isBuffer=="function"&&t.constructor.isBuffer(t)}function me(t){return typeof t.readFloatLE=="function"&&typeof t.slice=="function"&&sr(t.slice(0,0))}function L(t,r,e,n,i){var a,o,s=i*8-n-1,c=(1<<s)-1,p=c>>1,f=-7,l=e?i-1:0,E=e?-1:1,b=t[r+l];for(l+=E,a=b&(1<<-f)-1,b>>=-f,f+=s;f>0;a=a*256+t[r+l],l+=E,f-=8);for(o=a&(1<<-f)-1,a>>=-f,f+=n;f>0;o=o*256+t[r+l],l+=E,f-=8);if(a===0)a=1-p;else{if(a===c)return o?NaN:(b?-1:1)*(1/0);o=o+Math.pow(2,n),a=a-p}return(b?-1:1)*o*Math.pow(2,a-n)}function cr(t,r,e,n,i,a){var o,s,c,p=a*8-i-1,f=(1<<p)-1,l=f>>1,E=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,b=n?0:a-1,N=n?1:-1,pr=r<0||r===0&&1/r<0?1:0;for(r=Math.abs(r),isNaN(r)||r===1/0?(s=isNaN(r)?1:0,o=f):(o=Math.floor(Math.log(r)/Math.LN2),r*(c=Math.pow(2,-o))<1&&(o--,c*=2),o+l>=1?r+=E/c:r+=E*Math.pow(2,1-l),r*c>=2&&(o++,c/=2),o+l>=f?(s=0,o=f):o+l>=1?(s=(r*c-1)*Math.pow(2,i),o=o+l):(s=r*Math.pow(2,l-1)*Math.pow(2,i),o=0));i>=8;t[e+b]=s&255,b+=N,s/=256,i-=8);for(o=o<<i|s,p+=i;p>0;t[e+b]=o&255,b+=N,o/=256,p-=8);t[e+b-N]|=pr*128}var Ae=`{"theme1":{"value":"${h.env.FRONTEND_URL}/Theme%3DDark.svg","active":true},"theme2":{"value":"${h.env.FRONTEND_URL}/Theme%3DLight.svg","active":true},"theme3":{"value":"${h.env.FRONTEND_URL}/Theme%3DLight.svg","active":true}}`;var lr={V1_1:"v1_1",V2:"v2"},Ne={[lr.V1_1]:{testnet:62368684,mainnet:552635992},[lr.V2]:{testnet:148607e3,mainnet:1002541853}};var et=t=>{let r={};return t.forEach(({settingId:e,value:n,setting:i})=>{i.type==="boolean"?r[e]=n==="true":r[e]=n}),{discordEnabled:r["point-system.discordEnabled"],telegramBotName:r["point-system.telegramBotName"],telegramBotId:r["point-system.telegramBotId"],telegramEnabled:r["point-system.telegramEnabled"],telegramGroupId:r["point-system.telegramGroupId"],telegramGroupName:r["point-system.telegramGroupName"],twitterAccountId:r["point-system.twitterAccountId"],twitterAccountName:r["point-system.twitterAccountName"],twitterEnabled:r["point-system.twitterEnabled"],twitterJobEnabled:r["point-system.twitterJobEnabled"],guideLink:r["point-system.guideLink"]}};export{et as transformPointSystemSettings};
2
2
  /*! Bundled license information:
3
3
 
4
4
  @esbuild-plugins/node-globals-polyfill/Buffer.js: