@ultrade/shared 1.0.27 → 1.0.28

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 (210) hide show
  1. package/dist/browser/common/index.js +1 -7
  2. package/dist/browser/{common/utils/social.js → constants/env.js} +1 -1
  3. package/dist/browser/constants/index.js +1 -1
  4. package/dist/browser/enums/index.js +1 -1
  5. package/dist/browser/helpers/algo.helper.js +1 -1
  6. package/dist/browser/helpers/assert.helper.js +1 -1
  7. package/dist/browser/helpers/atomic.helper.js +1 -1
  8. package/dist/browser/helpers/balance.helper.js +1 -1
  9. package/dist/browser/helpers/codex/common.helper.js +2 -2
  10. package/dist/browser/helpers/codex/index.js +2 -2
  11. package/dist/browser/helpers/codex/mbr.helper.js +1 -1
  12. package/dist/browser/helpers/codex/mna.helper.js +1 -1
  13. package/dist/browser/helpers/codex/order.helper.js +1 -1
  14. package/dist/browser/helpers/codex/setGlobal.helper.js +1 -1
  15. package/dist/browser/{common/mappers/codexBalance.mapper.js → helpers/codex/tokens.js} +1 -1
  16. package/dist/browser/helpers/codex/transfer.helper.js +2 -2
  17. package/dist/browser/helpers/codex/txn.helper.js +1 -1
  18. package/dist/browser/helpers/codex.helper.js +6 -6
  19. package/dist/browser/helpers/eth.helper.js +2 -2
  20. package/dist/browser/helpers/order.helper.js +1 -1
  21. package/dist/browser/helpers/pair.helper.js +1 -1
  22. package/dist/browser/helpers/pointSystem.helper.js +1 -1
  23. package/dist/browser/helpers/withdraw.helper.js +2 -2
  24. package/dist/browser/interfaces/index.js +1 -1
  25. package/dist/browser/services/index.js +11 -0
  26. package/dist/browser/types/index.js +1 -1
  27. package/dist/{src/common → common}/index.d.ts +0 -1
  28. package/dist/{src/common → common}/utils/index.d.ts +3 -0
  29. package/dist/constants/env.d.ts +6 -0
  30. package/dist/{src/constants → constants}/index.d.ts +1 -0
  31. package/dist/constants/social.d.ts +4 -0
  32. package/dist/{src/enums → enums}/db/index.d.ts +1 -0
  33. package/dist/enums/db/pending-actions.enum.d.ts +6 -0
  34. package/dist/{src/enums → enums}/db/relayer.enum.d.ts +1 -0
  35. package/dist/{src/enums → enums}/index.d.ts +2 -0
  36. package/dist/enums/points.enum.d.ts +4 -0
  37. package/dist/enums/socket.enum.d.ts +18 -0
  38. package/dist/{src/helpers → helpers}/codex/common.helper.d.ts +2 -5
  39. package/dist/{src/helpers → helpers}/codex/index.d.ts +2 -0
  40. package/dist/helpers/codex/tokens.d.ts +5 -0
  41. package/dist/{src/helpers → helpers}/codex.helper.d.ts +1 -0
  42. package/dist/{src/common/utils → helpers}/decode.d.ts +1 -1
  43. package/dist/interfaces/algostreamer/index.d.ts +50 -0
  44. package/dist/{src/interfaces → interfaces}/index.d.ts +2 -0
  45. package/dist/{src/interfaces → interfaces}/order.interface.d.ts +1 -0
  46. package/dist/interfaces/socket.interface.d.ts +16 -0
  47. package/dist/node/common/index.js +1 -1
  48. package/dist/node/constants/env.js +1 -0
  49. package/dist/node/constants/index.js +1 -1
  50. package/dist/node/enums/index.js +1 -1
  51. package/dist/node/helpers/algo.helper.js +1 -1
  52. package/dist/node/helpers/assert.helper.js +1 -1
  53. package/dist/node/helpers/atomic.helper.js +1 -1
  54. package/dist/node/helpers/balance.helper.js +1 -1
  55. package/dist/node/helpers/codex/common.helper.js +2 -2
  56. package/dist/node/helpers/codex/index.js +2 -2
  57. package/dist/node/helpers/codex/mbr.helper.js +1 -1
  58. package/dist/node/helpers/codex/mna.helper.js +1 -1
  59. package/dist/node/helpers/codex/order.helper.js +1 -1
  60. package/dist/node/helpers/codex/setGlobal.helper.js +1 -1
  61. package/dist/node/helpers/codex/tokens.js +1 -0
  62. package/dist/node/helpers/codex/transfer.helper.js +2 -2
  63. package/dist/node/helpers/codex/txn.helper.js +1 -1
  64. package/dist/node/helpers/codex.helper.js +6 -6
  65. package/dist/node/helpers/eth.helper.js +2 -2
  66. package/dist/node/helpers/order.helper.js +1 -1
  67. package/dist/node/helpers/pair.helper.js +1 -1
  68. package/dist/node/helpers/pointSystem.helper.js +1 -1
  69. package/dist/node/helpers/withdraw.helper.js +2 -2
  70. package/dist/node/interfaces/index.js +1 -1
  71. package/dist/node/services/index.js +1 -0
  72. package/dist/node/types/index.js +1 -1
  73. package/dist/services/index.d.ts +2 -0
  74. package/dist/services/pairParam.service.d.ts +14 -0
  75. package/dist/services/tmc.service.d.ts +33 -0
  76. package/dist/{src/types → types}/api/request.types.d.ts +10 -10
  77. package/dist/{src/types → types}/settings.type.d.ts +3 -3
  78. package/package.json +39 -5
  79. package/dist/browser/common/big-number.helper.js +0 -11
  80. package/dist/browser/common/mappers/codexAsset.mapper.js +0 -11
  81. package/dist/browser/common/mappers/index.js +0 -11
  82. package/dist/browser/common/mappers/trade.mapper.js +0 -11
  83. package/dist/browser/common/utils/assert.js +0 -11
  84. package/dist/browser/common/utils/index.js +0 -11
  85. package/dist/browser/common/utils/stat.js +0 -11
  86. package/dist/browser/helpers/vaa.helper.js +0 -11
  87. package/dist/node/common/big-number.helper.js +0 -1
  88. package/dist/node/common/mappers/codexAsset.mapper.js +0 -1
  89. package/dist/node/common/mappers/codexBalance.mapper.js +0 -1
  90. package/dist/node/common/mappers/index.js +0 -1
  91. package/dist/node/common/mappers/trade.mapper.js +0 -1
  92. package/dist/node/common/utils/assert.js +0 -1
  93. package/dist/node/common/utils/index.js +0 -1
  94. package/dist/node/common/utils/social.js +0 -1
  95. package/dist/node/common/utils/stat.js +0 -1
  96. package/dist/node/helpers/vaa.helper.js +0 -0
  97. package/dist/src/helpers/vaa.helper.d.ts +0 -0
  98. /package/dist/browser/{common → helpers}/auth.helper.js +0 -0
  99. /package/dist/browser/{common/utils → helpers}/decode.js +0 -0
  100. /package/dist/{src/common → common}/big-number.helper.d.ts +0 -0
  101. /package/dist/{src/common → common}/mappers/codexAsset.mapper.d.ts +0 -0
  102. /package/dist/{src/common → common}/mappers/codexBalance.mapper.d.ts +0 -0
  103. /package/dist/{src/common → common}/mappers/index.d.ts +0 -0
  104. /package/dist/{src/common → common}/mappers/trade.mapper.d.ts +0 -0
  105. /package/dist/{src/common → common}/utils/assert.d.ts +0 -0
  106. /package/dist/{src/common → common}/utils/social.d.ts +0 -0
  107. /package/dist/{src/common → common}/utils/stat.d.ts +0 -0
  108. /package/dist/{src/constants → constants}/auth.d.ts +0 -0
  109. /package/dist/{src/constants → constants}/cctp.d.ts +0 -0
  110. /package/dist/{src/constants → constants}/codex.d.ts +0 -0
  111. /package/dist/{src/constants → constants}/frontend.d.ts +0 -0
  112. /package/dist/{src/constants → constants}/response.d.ts +0 -0
  113. /package/dist/{src/constants → constants}/settings.d.ts +0 -0
  114. /package/dist/{src/constants → constants}/withdrawalWalletsMessage.d.ts +0 -0
  115. /package/dist/{src/enums → enums}/chains.enum.d.ts +0 -0
  116. /package/dist/{src/enums → enums}/db/account/index.d.ts +0 -0
  117. /package/dist/{src/enums → enums}/db/affiliate.enum.d.ts +0 -0
  118. /package/dist/{src/enums → enums}/db/available-pair-settings.enum.d.ts +0 -0
  119. /package/dist/{src/enums → enums}/db/common.enum.d.ts +0 -0
  120. /package/dist/{src/enums → enums}/db/component/index.d.ts +0 -0
  121. /package/dist/{src/enums → enums}/db/market-maker.enum.d.ts +0 -0
  122. /package/dist/{src/enums → enums}/db/notification-center/userNotification.enum.d.ts +0 -0
  123. /package/dist/{src/enums → enums}/db/order-side.enum.d.ts +0 -0
  124. /package/dist/{src/enums → enums}/db/order-status.enum.d.ts +0 -0
  125. /package/dist/{src/enums → enums}/db/order-type.enum.d.ts +0 -0
  126. /package/dist/{src/enums → enums}/db/setting-type.enum.d.ts +0 -0
  127. /package/dist/{src/enums → enums}/db/social-action.enum.d.ts +0 -0
  128. /package/dist/{src/enums → enums}/db/social-prompt.enum.d.ts +0 -0
  129. /package/dist/{src/enums → enums}/db/social.enum.d.ts +0 -0
  130. /package/dist/{src/enums → enums}/db/state-type.enum.d.ts +0 -0
  131. /package/dist/{src/enums → enums}/db/trade.enums.d.ts +0 -0
  132. /package/dist/{src/enums → enums}/db/tradingKeyType.enum.d.ts +0 -0
  133. /package/dist/{src/enums → enums}/db/upgrade.enum.d.ts +0 -0
  134. /package/dist/{src/enums → enums}/db/withdrawal-wallet.enum.d.ts +0 -0
  135. /package/dist/{src/enums → enums}/maintenanceMode.enum.d.ts +0 -0
  136. /package/dist/{src/enums → enums}/notification.enum.d.ts +0 -0
  137. /package/dist/{src/enums → enums}/rabbitMq.d.ts +0 -0
  138. /package/dist/{src/enums → enums}/settings.enum.d.ts +0 -0
  139. /package/dist/{src/enums → enums}/social.enum.d.ts +0 -0
  140. /package/dist/{src/helpers → helpers}/Encoding.d.ts +0 -0
  141. /package/dist/{src/helpers → helpers}/algo.helper.d.ts +0 -0
  142. /package/dist/{src/helpers → helpers}/assert.helper.d.ts +0 -0
  143. /package/dist/{src/helpers → helpers}/atomic.helper.d.ts +0 -0
  144. /package/dist/{src/common → helpers}/auth.helper.d.ts +0 -0
  145. /package/dist/{src/helpers → helpers}/balance.helper.d.ts +0 -0
  146. /package/dist/{src/helpers → helpers}/codex/mbr.helper.d.ts +0 -0
  147. /package/dist/{src/helpers → helpers}/codex/mna.helper.d.ts +0 -0
  148. /package/dist/{src/helpers → helpers}/codex/order.helper.d.ts +0 -0
  149. /package/dist/{src/helpers → helpers}/codex/setGlobal.helper.d.ts +0 -0
  150. /package/dist/{src/helpers → helpers}/codex/transfer.helper.d.ts +0 -0
  151. /package/dist/{src/helpers → helpers}/codex/txn.helper.d.ts +0 -0
  152. /package/dist/{src/helpers → helpers}/eth.helper.d.ts +0 -0
  153. /package/dist/{src/helpers → helpers}/index.d.ts +0 -0
  154. /package/dist/{src/helpers → helpers}/interval.helpers.d.ts +0 -0
  155. /package/dist/{src/helpers → helpers}/liquidity.helper.d.ts +0 -0
  156. /package/dist/{src/helpers → helpers}/order.helper.d.ts +0 -0
  157. /package/dist/{src/helpers → helpers}/pair.helper.d.ts +0 -0
  158. /package/dist/{src/helpers → helpers}/pointSystem.helper.d.ts +0 -0
  159. /package/dist/{src/helpers → helpers}/ticker.helpers.d.ts +0 -0
  160. /package/dist/{src/helpers → helpers}/withdraw.helper.d.ts +0 -0
  161. /package/dist/{src/interfaces → interfaces}/accountInfo.interface.d.ts +0 -0
  162. /package/dist/{src/interfaces → interfaces}/api/affiliate.interface.d.ts +0 -0
  163. /package/dist/{src/interfaces → interfaces}/api/index.d.ts +0 -0
  164. /package/dist/{src/interfaces → interfaces}/cache.interface.d.ts +0 -0
  165. /package/dist/{src/interfaces → interfaces}/db/baseModel.interface.d.ts +0 -0
  166. /package/dist/{src/interfaces → interfaces}/db/hummingbot/index.d.ts +0 -0
  167. /package/dist/{src/interfaces → interfaces}/db/index.d.ts +0 -0
  168. /package/dist/{src/interfaces → interfaces}/db/market/index.d.ts +0 -0
  169. /package/dist/{src/interfaces → interfaces}/db/marketing/index.d.ts +0 -0
  170. /package/dist/{src/interfaces → interfaces}/db/notification_center/index.d.ts +0 -0
  171. /package/dist/{src/interfaces → interfaces}/db/relayer/index.d.ts +0 -0
  172. /package/dist/{src/interfaces → interfaces}/db/social/index.d.ts +0 -0
  173. /package/dist/{src/interfaces → interfaces}/db/softDeleteModel.interface.d.ts +0 -0
  174. /package/dist/{src/interfaces → interfaces}/db/white_label/index.d.ts +0 -0
  175. /package/dist/{src/interfaces → interfaces}/db/withdrawal_wallets/index.d.ts +0 -0
  176. /package/dist/{src/interfaces → interfaces}/dto/index.d.ts +0 -0
  177. /package/dist/{src/interfaces → interfaces}/emailService.interface.d.ts +0 -0
  178. /package/dist/{src/interfaces → interfaces}/kmsService.interface.d.ts +0 -0
  179. /package/dist/{src/interfaces → interfaces}/last-look-trade.interface.d.ts +0 -0
  180. /package/dist/{src/interfaces → interfaces}/market.interface.d.ts +0 -0
  181. /package/dist/{src/interfaces → interfaces}/pagination.interface.d.ts +0 -0
  182. /package/dist/{src/interfaces → interfaces}/pair.interface.d.ts +0 -0
  183. /package/dist/{src/interfaces → interfaces}/query.interface.d.ts +0 -0
  184. /package/dist/{src/interfaces → interfaces}/services/accountCache.interface.d.ts +0 -0
  185. /package/dist/{src/interfaces → interfaces}/services/algod.interface.d.ts +0 -0
  186. /package/dist/{src/interfaces → interfaces}/services/balances.interface.d.ts +0 -0
  187. /package/dist/{src/interfaces → interfaces}/services/coin-market-cap.interface.d.ts +0 -0
  188. /package/dist/{src/interfaces → interfaces}/services/index.d.ts +0 -0
  189. /package/dist/{src/interfaces → interfaces}/services/price-model.interface.d.ts +0 -0
  190. /package/dist/{src/interfaces → interfaces}/services/price-service.interface.d.ts +0 -0
  191. /package/dist/{src/interfaces → interfaces}/services/socialActivity.interface.d.ts +0 -0
  192. /package/dist/{src/interfaces → interfaces}/services/tmc.interface.d.ts +0 -0
  193. /package/dist/{src/interfaces → interfaces}/settings.interface.d.ts +0 -0
  194. /package/dist/{src/interfaces → interfaces}/streaming.interface.d.ts +0 -0
  195. /package/dist/{src/interfaces → interfaces}/timestream.interface.d.ts +0 -0
  196. /package/dist/{src/interfaces → interfaces}/trading.interface.d.ts +0 -0
  197. /package/dist/{src/interfaces → interfaces}/tradingKey.interface.d.ts +0 -0
  198. /package/dist/{src/interfaces → interfaces}/transfer.interface.d.ts +0 -0
  199. /package/dist/{src/interfaces → interfaces}/wallet.interface.d.ts +0 -0
  200. /package/dist/{src/interfaces → interfaces}/withdrawalWallets.interface.d.ts +0 -0
  201. /package/dist/node/{common → helpers}/auth.helper.js +0 -0
  202. /package/dist/node/{common/utils → helpers}/decode.js +0 -0
  203. /package/dist/{src/types → types}/algo-order.type.d.ts +0 -0
  204. /package/dist/{src/types → types}/amm/amm.d.ts +0 -0
  205. /package/dist/{src/types → types}/balance-result.types.d.ts +0 -0
  206. /package/dist/{src/types → types}/codex.types.d.ts +0 -0
  207. /package/dist/{src/types → types}/hummingbots.types.d.ts +0 -0
  208. /package/dist/{src/types → types}/index.d.ts +0 -0
  209. /package/dist/{src/types → types}/notification.type.d.ts +0 -0
  210. /package/dist/{src/types → types}/state.type.d.ts +0 -0
@@ -0,0 +1,14 @@
1
+ export declare class PairParamService {
2
+ validateMos(mos: number | string, baseValue: number, baseDecimal: number): boolean;
3
+ validateMsi(msi: number | string, baseValue: number, baseDecimal: number): boolean;
4
+ validateMpi(mpi: number | string, baseValue: number, priceValue: number, priceDecimal: number): boolean;
5
+ validateMpiFactored(mpi: number | string, baseValue: number, priceValue: number): boolean;
6
+ validateMarketParameters(params: {
7
+ baseDollarValue: number;
8
+ priceDollarValue: number;
9
+ baseDecimal: number;
10
+ mos: number | string;
11
+ msi: number | string;
12
+ mpi: number | string;
13
+ }): boolean;
14
+ }
@@ -0,0 +1,33 @@
1
+ export interface IEvmChainInfo {
2
+ providerUrl: string;
3
+ token: string;
4
+ tmc: string;
5
+ dispencer: string;
6
+ wss: string;
7
+ chainId: string;
8
+ whChainId: string;
9
+ }
10
+ type WHConfig = Partial<{
11
+ [key: number]: string;
12
+ }>;
13
+ export declare class TMCManager {
14
+ private tmcContracts;
15
+ private tmcContractsByWhId;
16
+ constructor(tmcStrOrArr: string | Array<IEvmChainInfo>);
17
+ private hexZeroPad;
18
+ isSupportedEvmTmcChain(chainId: number): Boolean;
19
+ isEVMTMC(chainId: number, emitter: string): Boolean;
20
+ getTMC(chainId: number): string | undefined;
21
+ getDispencer(chainId: number): string | undefined;
22
+ getProviderUrl(chainId: number): string | undefined;
23
+ getWssUrl(chainId: number): string | undefined;
24
+ getTmcContracts(): Map<number, IEvmChainInfo>;
25
+ getTmcAddresses(): Array<string>;
26
+ getAvailableChains(): Array<string>;
27
+ getAvailableWhChains(): Array<number>;
28
+ getTmcRelayerConfig(): WHConfig;
29
+ getAvaibleEvmChainIds(): Array<number>;
30
+ getTmcByEvmChainId(chainId: number): string;
31
+ getTmcEvmMap(): Map<number, IEvmChainInfo>;
32
+ }
33
+ export {};
@@ -9,16 +9,16 @@ export type TPutAdmins = {
9
9
  };
10
10
  export type TPutPair = {
11
11
  pairId: number;
12
- minOrderSize: string;
13
- minSizeIncrement: string;
14
- minPriceIncrement: string;
15
- baseCoinIconLink: string;
16
- baseCoinMarketLink: string;
17
- priceCoinIconLink: string;
18
- priceCoinMarketLink: string;
19
- tags: Array<number>;
20
- restrictedCountries: Array<string>;
21
- isPairPublic: boolean;
12
+ minOrderSize?: string;
13
+ minSizeIncrement?: string;
14
+ minPriceIncrement?: string;
15
+ baseCoinIconLink?: string;
16
+ baseCoinMarketLink?: string;
17
+ priceCoinIconLink?: string;
18
+ priceCoinMarketLink?: string;
19
+ tags?: Array<number>;
20
+ restrictedCountries?: Array<string>;
21
+ isPairPublic?: boolean;
22
22
  audioLink?: string;
23
23
  mftName?: string;
24
24
  };
@@ -138,11 +138,11 @@ export interface ICHART_VARS {
138
138
  "chart_text": string;
139
139
  }
140
140
  export interface ThemeObj {
141
- logo: string;
142
141
  name: string;
142
+ id: themeId;
143
143
  active: boolean;
144
- value: Theme;
145
- chartValue: ICHART_VARS;
144
+ colors: string;
145
+ chartColors: string;
146
146
  }
147
147
  export interface DbThemes {
148
148
  theme1: {
package/package.json CHANGED
@@ -1,19 +1,52 @@
1
1
  {
2
2
  "name": "@ultrade/shared",
3
- "version": "1.0.27",
3
+ "version": "1.0.28",
4
4
  "description": "This package contains shared code for the projects.",
5
5
  "typesVersions": {
6
6
  "*": {
7
7
  "node/*": [
8
- "dist/src/*",
9
- "dist/src/*/index.d.ts"
8
+ "dist/*",
9
+ "dist/*/index.d.ts"
10
10
  ],
11
11
  "browser/*": [
12
- "dist/src/*",
13
- "dist/src/*/index.d.ts"
12
+ "dist/*",
13
+ "dist/*/index.d.ts"
14
14
  ]
15
15
  }
16
16
  },
17
+ "exports": {
18
+ "./browser/constants/env": {
19
+ "import": "./dist/browser/constants/env.js"
20
+ },
21
+ "./node/constants/env": {
22
+ "import": "./dist/node/constants/env.js",
23
+ "require": "./dist/node/constants/env.js"
24
+ },
25
+ "./browser/helpers/*": {
26
+ "import": "./dist/browser/helpers/*.js"
27
+ },
28
+ "./node/helpers/*": {
29
+ "import": "./dist/node/helpers/*.js",
30
+ "require": "./dist/node/helpers/*.js"
31
+ },
32
+ "./node/helpers/codex": {
33
+ "import": "./dist/node/helpers/codex/index.js",
34
+ "require": "./dist/node/helpers/codex/index.js"
35
+ },
36
+ "./browser/helpers/codex": {
37
+ "import": "./dist/browser/helpers/codex/index.js"
38
+ },
39
+ "./browser/helpers/codex/*": {
40
+ "import": "./dist/browser/helpers/codex/*.js"
41
+ },
42
+ "./browser/*": {
43
+ "import": "./dist/browser/*/index.js"
44
+ },
45
+ "./node/*": {
46
+ "import": "./dist/node/*/index.js",
47
+ "require": "./dist/node/*/index.js"
48
+ }
49
+ },
17
50
  "scripts": {
18
51
  "build": "npx cross-env MODE=production ts-node esbuild.config.ts",
19
52
  "dev": "npx cross-env MODE=development ts-node esbuild.config.ts",
@@ -37,6 +70,7 @@
37
70
  "esbuild": "^0.27.0",
38
71
  "esbuild-node-externals": "^1.20.1",
39
72
  "esbuild-plugin-d.ts": "^1.3.1",
73
+ "glob": "^13.0.0",
40
74
  "ts-loader": "^9.2.3",
41
75
  "ts-node": "^10.0.0",
42
76
  "typescript": "^5.6.3"
@@ -1,11 +0,0 @@
1
- function W(){throw new Error("setTimeout has not been defined")}function q(){throw new Error("clearTimeout has not been defined")}var U=W,d=q;typeof globalThis.setTimeout=="function"&&(U=setTimeout);typeof globalThis.clearTimeout=="function"&&(d=clearTimeout);function X(i){if(U===setTimeout)return setTimeout(i,0);if((U===W||!U)&&setTimeout)return U=setTimeout,setTimeout(i,0);try{return U(i,0)}catch{try{return U.call(null,i,0)}catch{return U.call(this,i,0)}}}function mr(i){if(d===clearTimeout)return clearTimeout(i);if((d===q||!d)&&clearTimeout)return d=clearTimeout,clearTimeout(i);try{return d(i)}catch{try{return d.call(null,i)}catch{return d.call(this,i)}}}var R=[],P=!1,I,N=-1;function Er(){!P||!I||(P=!1,I.length?R=I.concat(R):N=-1,R.length&&Z())}function Z(){if(!P){var i=X(Er);P=!0;for(var r=R.length;r;){for(I=R,R=[];++N<r;)I&&I[N].run();N=-1,r=R.length}I=null,P=!1,mr(i)}}function Ar(i){var r=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)r[n-1]=arguments[n];R.push(new z(i,r)),R.length===1&&!P&&X(Z)}function z(i,r){this.fun=i,this.array=r}z.prototype.run=function(){this.fun.apply(null,this.array)};var Tr="browser",yr="browser",Rr=!0,_r={},Ur=[],dr="",Ir={},vr={},Sr={};function v(){}var Br=v,br=v,Pr=v,Nr=v,Mr=v,Dr=v,Yr=v;function Lr(i){throw new Error("process.binding is not supported")}function Cr(){return"/"}function kr(i){throw new Error("process.chdir is not supported")}function Fr(){return 0}var b=globalThis.performance||{},Or=b.now||b.mozNow||b.msNow||b.oNow||b.webkitNow||function(){return new Date().getTime()};function Hr(i){var r=Or.call(b)*.001,n=Math.floor(r),e=Math.floor(r%1*1e9);return i&&(n=n-i[0],e=e-i[1],e<0&&(n--,e+=1e9)),[n,e]}var Gr=new Date;function Qr(){var i=new Date,r=i-Gr;return r/1e3}var F={nextTick:Ar,title:Tr,browser:Rr,env:_r,argv:Ur,version:dr,versions:Ir,on:Br,addListener:br,once:Pr,off:Nr,removeListener:Mr,removeAllListeners:Dr,emit:Yr,binding:Lr,cwd:Cr,chdir:kr,umask:Fr,hrtime:Hr,platform:yr,release:vr,config:Sr,uptime:Qr},V={};Object.keys(V).forEach(i=>{let r=i.split("."),n=F;for(let e=0;e<r.length;e++){let t=r[e];e===r.length-1?n[t]=V[i]:n=n[t]||(n[t]={})}});var A=[],g=[],Vr=typeof Uint8Array<"u"?Uint8Array:Array,H=!1;function j(){H=!0;for(var i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",r=0,n=i.length;r<n;++r)A[r]=i[r],g[i.charCodeAt(r)]=r;g[45]=62,g[95]=63}function Wr(i){H||j();var r,n,e,t,o,u,a=i.length;if(a%4>0)throw new Error("Invalid string. Length must be a multiple of 4");o=i[a-2]==="="?2:i[a-1]==="="?1:0,u=new Vr(a*3/4-o),e=o>0?a-4:a;var c=0;for(r=0,n=0;r<e;r+=4,n+=3)t=g[i.charCodeAt(r)]<<18|g[i.charCodeAt(r+1)]<<12|g[i.charCodeAt(r+2)]<<6|g[i.charCodeAt(r+3)],u[c++]=t>>16&255,u[c++]=t>>8&255,u[c++]=t&255;return o===2?(t=g[i.charCodeAt(r)]<<2|g[i.charCodeAt(r+1)]>>4,u[c++]=t&255):o===1&&(t=g[i.charCodeAt(r)]<<10|g[i.charCodeAt(r+1)]<<4|g[i.charCodeAt(r+2)]>>2,u[c++]=t>>8&255,u[c++]=t&255),u}function qr(i){return A[i>>18&63]+A[i>>12&63]+A[i>>6&63]+A[i&63]}function Xr(i,r,n){for(var e,t=[],o=r;o<n;o+=3)e=(i[o]<<16)+(i[o+1]<<8)+i[o+2],t.push(qr(e));return t.join("")}function J(i){H||j();for(var r,n=i.length,e=n%3,t="",o=[],u=16383,a=0,c=n-e;a<c;a+=u)o.push(Xr(i,a,a+u>c?c:a+u));return e===1?(r=i[n-1],t+=A[r>>2],t+=A[r<<4&63],t+="=="):e===2&&(r=(i[n-2]<<8)+i[n-1],t+=A[r>>10],t+=A[r>>4&63],t+=A[r<<2&63],t+="="),o.push(t),o.join("")}f.TYPED_ARRAY_SUPPORT=globalThis.TYPED_ARRAY_SUPPORT!==void 0?globalThis.TYPED_ARRAY_SUPPORT:!0;function M(){return f.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function _(i,r){if(M()<r)throw new RangeError("Invalid typed array length");return f.TYPED_ARRAY_SUPPORT?(i=new Uint8Array(r),i.__proto__=f.prototype):(i===null&&(i=new f(r)),i.length=r),i}function f(i,r,n){if(!f.TYPED_ARRAY_SUPPORT&&!(this instanceof f))return new f(i,r,n);if(typeof i=="number"){if(typeof r=="string")throw new Error("If encoding is specified then the first argument must be a string");return G(this,i)}return rr(this,i,r,n)}f.poolSize=8192;f._augment=function(i){return i.__proto__=f.prototype,i};function rr(i,r,n,e){if(typeof r=="number")throw new TypeError('"value" argument must not be a number');return typeof ArrayBuffer<"u"&&r instanceof ArrayBuffer?Jr(i,r,n,e):typeof r=="string"?zr(i,r,n):$r(i,r)}f.from=function(i,r,n){return rr(null,i,r,n)};f.kMaxLength=M();f.TYPED_ARRAY_SUPPORT&&(f.prototype.__proto__=Uint8Array.prototype,f.__proto__=Uint8Array,typeof Symbol<"u"&&Symbol.species&&f[Symbol.species]);function nr(i){if(typeof i!="number")throw new TypeError('"size" argument must be a number');if(i<0)throw new RangeError('"size" argument must not be negative')}function Zr(i,r,n,e){return nr(r),r<=0?_(i,r):n!==void 0?typeof e=="string"?_(i,r).fill(n,e):_(i,r).fill(n):_(i,r)}f.alloc=function(i,r,n){return Zr(null,i,r,n)};function G(i,r){if(nr(r),i=_(i,r<0?0:Q(r)|0),!f.TYPED_ARRAY_SUPPORT)for(var n=0;n<r;++n)i[n]=0;return i}f.allocUnsafe=function(i){return G(null,i)};f.allocUnsafeSlow=function(i){return G(null,i)};function zr(i,r,n){if((typeof n!="string"||n==="")&&(n="utf8"),!f.isEncoding(n))throw new TypeError('"encoding" must be a valid string encoding');var e=ir(r,n)|0;i=_(i,e);var t=i.write(r,n);return t!==e&&(i=i.slice(0,t)),i}function O(i,r){var n=r.length<0?0:Q(r.length)|0;i=_(i,n);for(var e=0;e<n;e+=1)i[e]=r[e]&255;return i}function Jr(i,r,n,e){if(r.byteLength,n<0||r.byteLength<n)throw new RangeError("'offset' is out of bounds");if(r.byteLength<n+(e||0))throw new RangeError("'length' is out of bounds");return n===void 0&&e===void 0?r=new Uint8Array(r):e===void 0?r=new Uint8Array(r,n):r=new Uint8Array(r,n,e),f.TYPED_ARRAY_SUPPORT?(i=r,i.__proto__=f.prototype):i=O(i,r),i}function $r(i,r){if(T(r)){var n=Q(r.length)|0;return i=_(i,n),i.length===0||r.copy(i,0,0,n),i}if(r){if(typeof ArrayBuffer<"u"&&r.buffer instanceof ArrayBuffer||"length"in r)return typeof r.length!="number"||mn(r.length)?_(i,0):O(i,r);if(r.type==="Buffer"&&Array.isArray(r.data))return O(i,r.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function Q(i){if(i>=M())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+M().toString(16)+" bytes");return i|0}f.isBuffer=En;function T(i){return!!(i!=null&&i._isBuffer)}f.compare=function(r,n){if(!T(r)||!T(n))throw new TypeError("Arguments must be Buffers");if(r===n)return 0;for(var e=r.length,t=n.length,o=0,u=Math.min(e,t);o<u;++o)if(r[o]!==n[o]){e=r[o],t=n[o];break}return e<t?-1:t<e?1:0};f.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}};f.concat=function(r,n){if(!Array.isArray(r))throw new TypeError('"list" argument must be an Array of Buffers');if(r.length===0)return f.alloc(0);var e;if(n===void 0)for(n=0,e=0;e<r.length;++e)n+=r[e].length;var t=f.allocUnsafe(n),o=0;for(e=0;e<r.length;++e){var u=r[e];if(!T(u))throw new TypeError('"list" argument must be an Array of Buffers');u.copy(t,o),o+=u.length}return t};function ir(i,r){if(T(i))return i.length;if(typeof ArrayBuffer<"u"&&typeof ArrayBuffer.isView=="function"&&(ArrayBuffer.isView(i)||i instanceof ArrayBuffer))return i.byteLength;typeof i!="string"&&(i=""+i);var n=i.length;if(n===0)return 0;for(var e=!1;;)switch(r){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":case void 0:return D(i).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return n*2;case"hex":return n>>>1;case"base64":return cr(i).length;default:if(e)return D(i).length;r=(""+r).toLowerCase(),e=!0}}f.byteLength=ir;function Kr(i,r,n){var e=!1;if((r===void 0||r<0)&&(r=0),r>this.length||((n===void 0||n>this.length)&&(n=this.length),n<=0)||(n>>>=0,r>>>=0,n<=r))return"";for(i||(i="utf8");;)switch(i){case"hex":return cn(this,r,n);case"utf8":case"utf-8":return or(this,r,n);case"ascii":return fn(this,r,n);case"latin1":case"binary":return an(this,r,n);case"base64":return on(this,r,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return hn(this,r,n);default:if(e)throw new TypeError("Unknown encoding: "+i);i=(i+"").toLowerCase(),e=!0}}f.prototype._isBuffer=!0;function S(i,r,n){var e=i[r];i[r]=i[n],i[n]=e}f.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 n=0;n<r;n+=2)S(this,n,n+1);return this};f.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 n=0;n<r;n+=4)S(this,n,n+3),S(this,n+1,n+2);return this};f.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 n=0;n<r;n+=8)S(this,n,n+7),S(this,n+1,n+6),S(this,n+2,n+5),S(this,n+3,n+4);return this};f.prototype.toString=function(){var r=this.length|0;return r===0?"":arguments.length===0?or(this,0,r):Kr.apply(this,arguments)};f.prototype.equals=function(r){if(!T(r))throw new TypeError("Argument must be a Buffer");return this===r?!0:f.compare(this,r)===0};f.prototype.compare=function(r,n,e,t,o){if(!T(r))throw new TypeError("Argument must be a Buffer");if(n===void 0&&(n=0),e===void 0&&(e=r?r.length:0),t===void 0&&(t=0),o===void 0&&(o=this.length),n<0||e>r.length||t<0||o>this.length)throw new RangeError("out of range index");if(t>=o&&n>=e)return 0;if(t>=o)return-1;if(n>=e)return 1;if(n>>>=0,e>>>=0,t>>>=0,o>>>=0,this===r)return 0;for(var u=o-t,a=e-n,c=Math.min(u,a),l=this.slice(t,o),h=r.slice(n,e),s=0;s<c;++s)if(l[s]!==h[s]){u=l[s],a=h[s];break}return u<a?-1:a<u?1:0};function er(i,r,n,e,t){if(i.length===0)return-1;if(typeof n=="string"?(e=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),n=+n,isNaN(n)&&(n=t?0:i.length-1),n<0&&(n=i.length+n),n>=i.length){if(t)return-1;n=i.length-1}else if(n<0)if(t)n=0;else return-1;if(typeof r=="string"&&(r=f.from(r,e)),T(r))return r.length===0?-1:$(i,r,n,e,t);if(typeof r=="number")return r=r&255,f.TYPED_ARRAY_SUPPORT&&typeof Uint8Array.prototype.indexOf=="function"?t?Uint8Array.prototype.indexOf.call(i,r,n):Uint8Array.prototype.lastIndexOf.call(i,r,n):$(i,[r],n,e,t);throw new TypeError("val must be string, number or Buffer")}function $(i,r,n,e,t){var o=1,u=i.length,a=r.length;if(e!==void 0&&(e=String(e).toLowerCase(),e==="ucs2"||e==="ucs-2"||e==="utf16le"||e==="utf-16le")){if(i.length<2||r.length<2)return-1;o=2,u/=2,a/=2,n/=2}function c(w,B){return o===1?w[B]:w.readUInt16BE(B*o)}var l;if(t){var h=-1;for(l=n;l<u;l++)if(c(i,l)===c(r,h===-1?0:l-h)){if(h===-1&&(h=l),l-h+1===a)return h*o}else h!==-1&&(l-=l-h),h=-1}else for(n+a>u&&(n=u-a),l=n;l>=0;l--){for(var s=!0,E=0;E<a;E++)if(c(i,l+E)!==c(r,E)){s=!1;break}if(s)return l}return-1}f.prototype.includes=function(r,n,e){return this.indexOf(r,n,e)!==-1};f.prototype.indexOf=function(r,n,e){return er(this,r,n,e,!0)};f.prototype.lastIndexOf=function(r,n,e){return er(this,r,n,e,!1)};function jr(i,r,n,e){n=Number(n)||0;var t=i.length-n;e?(e=Number(e),e>t&&(e=t)):e=t;var o=r.length;if(o%2!==0)throw new TypeError("Invalid hex string");e>o/2&&(e=o/2);for(var u=0;u<e;++u){var a=parseInt(r.substr(u*2,2),16);if(isNaN(a))return u;i[n+u]=a}return u}function rn(i,r,n,e){return C(D(r,i.length-n),i,n,e)}function tr(i,r,n,e){return C(wn(r),i,n,e)}function nn(i,r,n,e){return tr(i,r,n,e)}function en(i,r,n,e){return C(cr(r),i,n,e)}function tn(i,r,n,e){return C(gn(r,i.length-n),i,n,e)}f.prototype.write=function(r,n,e,t){if(n===void 0)t="utf8",e=this.length,n=0;else if(e===void 0&&typeof n=="string")t=n,e=this.length,n=0;else if(isFinite(n))n=n|0,isFinite(e)?(e=e|0,t===void 0&&(t="utf8")):(t=e,e=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var o=this.length-n;if((e===void 0||e>o)&&(e=o),r.length>0&&(e<0||n<0)||n>this.length)throw new RangeError("Attempt to write outside buffer bounds");t||(t="utf8");for(var u=!1;;)switch(t){case"hex":return jr(this,r,n,e);case"utf8":case"utf-8":return rn(this,r,n,e);case"ascii":return tr(this,r,n,e);case"latin1":case"binary":return nn(this,r,n,e);case"base64":return en(this,r,n,e);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return tn(this,r,n,e);default:if(u)throw new TypeError("Unknown encoding: "+t);t=(""+t).toLowerCase(),u=!0}};f.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function on(i,r,n){return r===0&&n===i.length?J(i):J(i.slice(r,n))}function or(i,r,n){n=Math.min(i.length,n);for(var e=[],t=r;t<n;){var o=i[t],u=null,a=o>239?4:o>223?3:o>191?2:1;if(t+a<=n){var c,l,h,s;switch(a){case 1:o<128&&(u=o);break;case 2:c=i[t+1],(c&192)===128&&(s=(o&31)<<6|c&63,s>127&&(u=s));break;case 3:c=i[t+1],l=i[t+2],(c&192)===128&&(l&192)===128&&(s=(o&15)<<12|(c&63)<<6|l&63,s>2047&&(s<55296||s>57343)&&(u=s));break;case 4:c=i[t+1],l=i[t+2],h=i[t+3],(c&192)===128&&(l&192)===128&&(h&192)===128&&(s=(o&15)<<18|(c&63)<<12|(l&63)<<6|h&63,s>65535&&s<1114112&&(u=s))}}u===null?(u=65533,a=1):u>65535&&(u-=65536,e.push(u>>>10&1023|55296),u=56320|u&1023),e.push(u),t+=a}return un(e)}var K=4096;function un(i){var r=i.length;if(r<=K)return String.fromCharCode.apply(String,i);for(var n="",e=0;e<r;)n+=String.fromCharCode.apply(String,i.slice(e,e+=K));return n}function fn(i,r,n){var e="";n=Math.min(i.length,n);for(var t=r;t<n;++t)e+=String.fromCharCode(i[t]&127);return e}function an(i,r,n){var e="";n=Math.min(i.length,n);for(var t=r;t<n;++t)e+=String.fromCharCode(i[t]);return e}function cn(i,r,n){var e=i.length;(!r||r<0)&&(r=0),(!n||n<0||n>e)&&(n=e);for(var t="",o=r;o<n;++o)t+=xn(i[o]);return t}function hn(i,r,n){for(var e=i.slice(r,n),t="",o=0;o<e.length;o+=2)t+=String.fromCharCode(e[o]+e[o+1]*256);return t}f.prototype.slice=function(r,n){var e=this.length;r=~~r,n=n===void 0?e:~~n,r<0?(r+=e,r<0&&(r=0)):r>e&&(r=e),n<0?(n+=e,n<0&&(n=0)):n>e&&(n=e),n<r&&(n=r);var t;if(f.TYPED_ARRAY_SUPPORT)t=this.subarray(r,n),t.__proto__=f.prototype;else{var o=n-r;t=new f(o,void 0);for(var u=0;u<o;++u)t[u]=this[u+r]}return t};function p(i,r,n){if(i%1!==0||i<0)throw new RangeError("offset is not uint");if(i+r>n)throw new RangeError("Trying to access beyond buffer length")}f.prototype.readUIntLE=function(r,n,e){r=r|0,n=n|0,e||p(r,n,this.length);for(var t=this[r],o=1,u=0;++u<n&&(o*=256);)t+=this[r+u]*o;return t};f.prototype.readUIntBE=function(r,n,e){r=r|0,n=n|0,e||p(r,n,this.length);for(var t=this[r+--n],o=1;n>0&&(o*=256);)t+=this[r+--n]*o;return t};f.prototype.readUInt8=function(r,n){return n||p(r,1,this.length),this[r]};f.prototype.readUInt16LE=function(r,n){return n||p(r,2,this.length),this[r]|this[r+1]<<8};f.prototype.readUInt16BE=function(r,n){return n||p(r,2,this.length),this[r]<<8|this[r+1]};f.prototype.readUInt32LE=function(r,n){return n||p(r,4,this.length),(this[r]|this[r+1]<<8|this[r+2]<<16)+this[r+3]*16777216};f.prototype.readUInt32BE=function(r,n){return n||p(r,4,this.length),this[r]*16777216+(this[r+1]<<16|this[r+2]<<8|this[r+3])};f.prototype.readIntLE=function(r,n,e){r=r|0,n=n|0,e||p(r,n,this.length);for(var t=this[r],o=1,u=0;++u<n&&(o*=256);)t+=this[r+u]*o;return o*=128,t>=o&&(t-=Math.pow(2,8*n)),t};f.prototype.readIntBE=function(r,n,e){r=r|0,n=n|0,e||p(r,n,this.length);for(var t=n,o=1,u=this[r+--t];t>0&&(o*=256);)u+=this[r+--t]*o;return o*=128,u>=o&&(u-=Math.pow(2,8*n)),u};f.prototype.readInt8=function(r,n){return n||p(r,1,this.length),this[r]&128?(255-this[r]+1)*-1:this[r]};f.prototype.readInt16LE=function(r,n){n||p(r,2,this.length);var e=this[r]|this[r+1]<<8;return e&32768?e|4294901760:e};f.prototype.readInt16BE=function(r,n){n||p(r,2,this.length);var e=this[r+1]|this[r]<<8;return e&32768?e|4294901760:e};f.prototype.readInt32LE=function(r,n){return n||p(r,4,this.length),this[r]|this[r+1]<<8|this[r+2]<<16|this[r+3]<<24};f.prototype.readInt32BE=function(r,n){return n||p(r,4,this.length),this[r]<<24|this[r+1]<<16|this[r+2]<<8|this[r+3]};f.prototype.readFloatLE=function(r,n){return n||p(r,4,this.length),k(this,r,!0,23,4)};f.prototype.readFloatBE=function(r,n){return n||p(r,4,this.length),k(this,r,!1,23,4)};f.prototype.readDoubleLE=function(r,n){return n||p(r,8,this.length),k(this,r,!0,52,8)};f.prototype.readDoubleBE=function(r,n){return n||p(r,8,this.length),k(this,r,!1,52,8)};function x(i,r,n,e,t,o){if(!T(i))throw new TypeError('"buffer" argument must be a Buffer instance');if(r>t||r<o)throw new RangeError('"value" argument is out of bounds');if(n+e>i.length)throw new RangeError("Index out of range")}f.prototype.writeUIntLE=function(r,n,e,t){if(r=+r,n=n|0,e=e|0,!t){var o=Math.pow(2,8*e)-1;x(this,r,n,e,o,0)}var u=1,a=0;for(this[n]=r&255;++a<e&&(u*=256);)this[n+a]=r/u&255;return n+e};f.prototype.writeUIntBE=function(r,n,e,t){if(r=+r,n=n|0,e=e|0,!t){var o=Math.pow(2,8*e)-1;x(this,r,n,e,o,0)}var u=e-1,a=1;for(this[n+u]=r&255;--u>=0&&(a*=256);)this[n+u]=r/a&255;return n+e};f.prototype.writeUInt8=function(r,n,e){return r=+r,n=n|0,e||x(this,r,n,1,255,0),f.TYPED_ARRAY_SUPPORT||(r=Math.floor(r)),this[n]=r&255,n+1};function Y(i,r,n,e){r<0&&(r=65535+r+1);for(var t=0,o=Math.min(i.length-n,2);t<o;++t)i[n+t]=(r&255<<8*(e?t:1-t))>>>(e?t:1-t)*8}f.prototype.writeUInt16LE=function(r,n,e){return r=+r,n=n|0,e||x(this,r,n,2,65535,0),f.TYPED_ARRAY_SUPPORT?(this[n]=r&255,this[n+1]=r>>>8):Y(this,r,n,!0),n+2};f.prototype.writeUInt16BE=function(r,n,e){return r=+r,n=n|0,e||x(this,r,n,2,65535,0),f.TYPED_ARRAY_SUPPORT?(this[n]=r>>>8,this[n+1]=r&255):Y(this,r,n,!1),n+2};function L(i,r,n,e){r<0&&(r=4294967295+r+1);for(var t=0,o=Math.min(i.length-n,4);t<o;++t)i[n+t]=r>>>(e?t:3-t)*8&255}f.prototype.writeUInt32LE=function(r,n,e){return r=+r,n=n|0,e||x(this,r,n,4,4294967295,0),f.TYPED_ARRAY_SUPPORT?(this[n+3]=r>>>24,this[n+2]=r>>>16,this[n+1]=r>>>8,this[n]=r&255):L(this,r,n,!0),n+4};f.prototype.writeUInt32BE=function(r,n,e){return r=+r,n=n|0,e||x(this,r,n,4,4294967295,0),f.TYPED_ARRAY_SUPPORT?(this[n]=r>>>24,this[n+1]=r>>>16,this[n+2]=r>>>8,this[n+3]=r&255):L(this,r,n,!1),n+4};f.prototype.writeIntLE=function(r,n,e,t){if(r=+r,n=n|0,!t){var o=Math.pow(2,8*e-1);x(this,r,n,e,o-1,-o)}var u=0,a=1,c=0;for(this[n]=r&255;++u<e&&(a*=256);)r<0&&c===0&&this[n+u-1]!==0&&(c=1),this[n+u]=(r/a>>0)-c&255;return n+e};f.prototype.writeIntBE=function(r,n,e,t){if(r=+r,n=n|0,!t){var o=Math.pow(2,8*e-1);x(this,r,n,e,o-1,-o)}var u=e-1,a=1,c=0;for(this[n+u]=r&255;--u>=0&&(a*=256);)r<0&&c===0&&this[n+u+1]!==0&&(c=1),this[n+u]=(r/a>>0)-c&255;return n+e};f.prototype.writeInt8=function(r,n,e){return r=+r,n=n|0,e||x(this,r,n,1,127,-128),f.TYPED_ARRAY_SUPPORT||(r=Math.floor(r)),r<0&&(r=255+r+1),this[n]=r&255,n+1};f.prototype.writeInt16LE=function(r,n,e){return r=+r,n=n|0,e||x(this,r,n,2,32767,-32768),f.TYPED_ARRAY_SUPPORT?(this[n]=r&255,this[n+1]=r>>>8):Y(this,r,n,!0),n+2};f.prototype.writeInt16BE=function(r,n,e){return r=+r,n=n|0,e||x(this,r,n,2,32767,-32768),f.TYPED_ARRAY_SUPPORT?(this[n]=r>>>8,this[n+1]=r&255):Y(this,r,n,!1),n+2};f.prototype.writeInt32LE=function(r,n,e){return r=+r,n=n|0,e||x(this,r,n,4,2147483647,-2147483648),f.TYPED_ARRAY_SUPPORT?(this[n]=r&255,this[n+1]=r>>>8,this[n+2]=r>>>16,this[n+3]=r>>>24):L(this,r,n,!0),n+4};f.prototype.writeInt32BE=function(r,n,e){return r=+r,n=n|0,e||x(this,r,n,4,2147483647,-2147483648),r<0&&(r=4294967295+r+1),f.TYPED_ARRAY_SUPPORT?(this[n]=r>>>24,this[n+1]=r>>>16,this[n+2]=r>>>8,this[n+3]=r&255):L(this,r,n,!1),n+4};function ur(i,r,n,e,t,o){if(n+e>i.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function fr(i,r,n,e,t){return t||ur(i,r,n,4,34028234663852886e22,-34028234663852886e22),sr(i,r,n,e,23,4),n+4}f.prototype.writeFloatLE=function(r,n,e){return fr(this,r,n,!0,e)};f.prototype.writeFloatBE=function(r,n,e){return fr(this,r,n,!1,e)};function ar(i,r,n,e,t){return t||ur(i,r,n,8,17976931348623157e292,-17976931348623157e292),sr(i,r,n,e,52,8),n+8}f.prototype.writeDoubleLE=function(r,n,e){return ar(this,r,n,!0,e)};f.prototype.writeDoubleBE=function(r,n,e){return ar(this,r,n,!1,e)};f.prototype.copy=function(r,n,e,t){if(e||(e=0),!t&&t!==0&&(t=this.length),n>=r.length&&(n=r.length),n||(n=0),t>0&&t<e&&(t=e),t===e||r.length===0||this.length===0)return 0;if(n<0)throw new RangeError("targetStart out of bounds");if(e<0||e>=this.length)throw new RangeError("sourceStart out of bounds");if(t<0)throw new RangeError("sourceEnd out of bounds");t>this.length&&(t=this.length),r.length-n<t-e&&(t=r.length-n+e);var o=t-e,u;if(this===r&&e<n&&n<t)for(u=o-1;u>=0;--u)r[u+n]=this[u+e];else if(o<1e3||!f.TYPED_ARRAY_SUPPORT)for(u=0;u<o;++u)r[u+n]=this[u+e];else Uint8Array.prototype.set.call(r,this.subarray(e,e+o),n);return o};f.prototype.fill=function(r,n,e,t){if(typeof r=="string"){if(typeof n=="string"?(t=n,n=0,e=this.length):typeof e=="string"&&(t=e,e=this.length),r.length===1){var o=r.charCodeAt(0);o<256&&(r=o)}if(t!==void 0&&typeof t!="string")throw new TypeError("encoding must be a string");if(typeof t=="string"&&!f.isEncoding(t))throw new TypeError("Unknown encoding: "+t)}else typeof r=="number"&&(r=r&255);if(n<0||this.length<n||this.length<e)throw new RangeError("Out of range index");if(e<=n)return this;n=n>>>0,e=e===void 0?this.length:e>>>0,r||(r=0);var u;if(typeof r=="number")for(u=n;u<e;++u)this[u]=r;else{var a=T(r)?r:D(new f(r,t).toString()),c=a.length;for(u=0;u<e-n;++u)this[u+n]=a[u%c]}return this};var sn=/[^+\/0-9A-Za-z-_]/g;function ln(i){if(i=pn(i).replace(sn,""),i.length<2)return"";for(;i.length%4!==0;)i=i+"=";return i}function pn(i){return i.trim?i.trim():i.replace(/^\s+|\s+$/g,"")}function xn(i){return i<16?"0"+i.toString(16):i.toString(16)}function D(i,r){r=r||1/0;for(var n,e=i.length,t=null,o=[],u=0;u<e;++u){if(n=i.charCodeAt(u),n>55295&&n<57344){if(!t){if(n>56319){(r-=3)>-1&&o.push(239,191,189);continue}else if(u+1===e){(r-=3)>-1&&o.push(239,191,189);continue}t=n;continue}if(n<56320){(r-=3)>-1&&o.push(239,191,189),t=n;continue}n=(t-55296<<10|n-56320)+65536}else t&&(r-=3)>-1&&o.push(239,191,189);if(t=null,n<128){if((r-=1)<0)break;o.push(n)}else if(n<2048){if((r-=2)<0)break;o.push(n>>6|192,n&63|128)}else if(n<65536){if((r-=3)<0)break;o.push(n>>12|224,n>>6&63|128,n&63|128)}else if(n<1114112){if((r-=4)<0)break;o.push(n>>18|240,n>>12&63|128,n>>6&63|128,n&63|128)}else throw new Error("Invalid code point")}return o}function wn(i){for(var r=[],n=0;n<i.length;++n)r.push(i.charCodeAt(n)&255);return r}function gn(i,r){for(var n,e,t,o=[],u=0;u<i.length&&!((r-=2)<0);++u)n=i.charCodeAt(u),e=n>>8,t=n%256,o.push(t),o.push(e);return o}function cr(i){return Wr(ln(i))}function C(i,r,n,e){for(var t=0;t<e&&!(t+n>=r.length||t>=i.length);++t)r[t+n]=i[t];return t}function mn(i){return i!==i}function En(i){return i!=null&&(!!i._isBuffer||hr(i)||An(i))}function hr(i){return!!i.constructor&&typeof i.constructor.isBuffer=="function"&&i.constructor.isBuffer(i)}function An(i){return typeof i.readFloatLE=="function"&&typeof i.slice=="function"&&hr(i.slice(0,0))}function k(i,r,n,e,t){var o,u,a=t*8-e-1,c=(1<<a)-1,l=c>>1,h=-7,s=n?t-1:0,E=n?-1:1,w=i[r+s];for(s+=E,o=w&(1<<-h)-1,w>>=-h,h+=a;h>0;o=o*256+i[r+s],s+=E,h-=8);for(u=o&(1<<-h)-1,o>>=-h,h+=e;h>0;u=u*256+i[r+s],s+=E,h-=8);if(o===0)o=1-l;else{if(o===c)return u?NaN:(w?-1:1)*(1/0);u=u+Math.pow(2,e),o=o-l}return(w?-1:1)*u*Math.pow(2,o-e)}function sr(i,r,n,e,t,o){var u,a,c,l=o*8-t-1,h=(1<<l)-1,s=h>>1,E=t===23?Math.pow(2,-24)-Math.pow(2,-77):0,w=e?0:o-1,B=e?1:-1,gr=r<0||r===0&&1/r<0?1:0;for(r=Math.abs(r),isNaN(r)||r===1/0?(a=isNaN(r)?1:0,u=h):(u=Math.floor(Math.log(r)/Math.LN2),r*(c=Math.pow(2,-u))<1&&(u--,c*=2),u+s>=1?r+=E/c:r+=E*Math.pow(2,1-s),r*c>=2&&(u++,c/=2),u+s>=h?(a=0,u=h):u+s>=1?(a=(r*c-1)*Math.pow(2,t),u=u+s):(a=r*Math.pow(2,s-1)*Math.pow(2,t),u=0));t>=8;i[n+w]=a&255,w+=B,a/=256,t-=8);for(u=u<<t|a,l+=t;l>0;i[n+w]=u&255,w+=B,u/=256,l-=8);i[n+w-B]|=gr*128}import m from"bignumber.js";m.config({DECIMAL_PLACES:40,EXPONENTIAL_AT:45});var Tn=(h=>(h.MINUS="-",h.PLUS="+",h.MULTIPLY="*",h.DIVIDE="/",h.GREATER_THAN_OR_EQUAL=">=",h.GREATER_THAN=">",h.LESS_THAN_OR_EQUAL="<=",h.LESS_THAN="<",h.EQUAL="==",h.MOD="mod",h))(Tn||{});function bn(i){return new m(i).abs().toString()}function Pn(i){let n=new m(String(i)).integerValue(m.ROUND_CEIL).toString();return xr(i,n)||console.log("Ceil value",{value:i,res:n}),n}function Nn(i,r,n=!1){let e=new m(String(i)),t;if(n){let o=e.toFixed(),u=o.indexOf(".");if(u>=0){let a=o.slice(u+1),c=0;for(let h of a)if(h==="0")c++;else break;let l=c+1;t=e.toFixed(l,m.ROUND_UP)}else t=e.toFixed(0)}else t=e.toFixed(r);return console.log("Fixed value",{value:i,res:t}),t}function Mn(i){let n=new m(String(i)).integerValue(m.ROUND_FLOOR).toString();return console.log("Floor value",{value:i,res:n}),n}function Dn(i){let n=new m(String(i)).integerValue(m.ROUND_HALF_UP).toString();return console.log("Round value",{value:i,res:n}),n}function Yn(i,r){return y(i,r,"+")}function Ln(i,r){return y(i,r,"-")}function yn(i,r){return y(i,r,"*")}function Cn(i,r){return yn(i,r||0)}function kn(i,r){return y(i,r,"/")}function Fn(i,r){return!!y(i,r,">=")}function On(i,r){return!!y(i,r,">")}function Hn(i,r){return!!y(i,r,"<=")}function Gn(i,r){return!!y(i,r,"<")}function xr(i,r){return!!y(i,r,"==")}function Rn(i,r){return y(i,r,"mod")}function Qn(i,r){return xr(Rn(i,r),0)}function y(i,r,n){switch(i=new m(String(i)),r=new m(String(r)),n.toLowerCase()){case"-":return i.minus(r).toString();case"+":return i.plus(r).toString();case"*":case"x":return i.multipliedBy(r).toString();case"\xF7":case"/":return i.dividedBy(r).toString();case">=":return i.isGreaterThanOrEqualTo(r);case">":return i.isGreaterThan(r);case"<=":return i.isLessThanOrEqualTo(r);case"<":return i.isLessThan(r);case"==":return i.isEqualTo(r);case"mod":return i.modulo(r);default:break}}function lr(i){if(i.toString().includes("e")){let r=i.toString().split("e");return[parseFloat(r[0]),parseFloat(r[1])]}return[i,0]}function pr(i,r){return i+(r<0?`e${r}`:`e+${r}`)}function wr({decimalPlaces:i=0},r){if(i>0){let[n,e]=lr(r),[t,o]=lr(Math.round(Number(pr(n,e+i))));return Number(pr(t,o-i))}return Math.round(r)}function Vn(i,r){let n=Number(i);return wr({decimalPlaces:n},Math.pow(10,-n)*Number(r))}function Wn(i,r){let n=Math.pow(10,Number(i))*Number(r);return wr({decimalPlaces:0},n)}export{Tn as Operations,bn as absolute,y as bn_operation,Pn as ceil,Vn as convertFromBaseUnits,Wn as convertToBaseUnits,kn as divide,xr as equal,Mn as floor,On as greaterThan,Fn as greaterThanOrEqual,Gn as lessThan,Hn as lessThanOrEqual,Ln as minus,Rn as mod,Qn as modZero,yn as multiply,Yn as plus,Dn as round,wr as roundNumber,Nn as toFixed,Cn as toUsd};
2
- /*! Bundled license information:
3
-
4
- @esbuild-plugins/node-globals-polyfill/Buffer.js:
5
- (*!
6
- * The buffer module from node.js, for the browser.
7
- *
8
- * @author Feross Aboukhadijeh <feross@feross.org> <http://feross.org>
9
- * @license MIT
10
- *)
11
- */
@@ -1,11 +0,0 @@
1
- function z(){throw new Error("setTimeout has not been defined")}function J(){throw new Error("clearTimeout has not been defined")}var R=z,I=J;typeof globalThis.setTimeout=="function"&&(R=setTimeout);typeof globalThis.clearTimeout=="function"&&(I=clearTimeout);function O(n){if(R===setTimeout)return setTimeout(n,0);if((R===z||!R)&&setTimeout)return R=setTimeout,setTimeout(n,0);try{return R(n,0)}catch{try{return R.call(null,n,0)}catch{return R.call(this,n,0)}}}function sr(n){if(I===clearTimeout)return clearTimeout(n);if((I===J||!I)&&clearTimeout)return I=clearTimeout,clearTimeout(n);try{return I(n)}catch{try{return I.call(null,n)}catch{return I.call(this,n)}}}var y=[],Y=!1,_,S=-1;function lr(){!Y||!_||(Y=!1,_.length?y=_.concat(y):S=-1,y.length&&Q())}function Q(){if(!Y){var n=O(lr);Y=!0;for(var r=y.length;r;){for(_=y,y=[];++S<r;)_&&_[S].run();S=-1,r=y.length}_=null,Y=!1,sr(n)}}function pr(n){var r=new Array(arguments.length-1);if(arguments.length>1)for(var i=1;i<arguments.length;i++)r[i-1]=arguments[i];y.push(new X(n,r)),y.length===1&&!Y&&O(Q)}function X(n,r){this.fun=n,this.array=r}X.prototype.run=function(){this.fun.apply(null,this.array)};var wr="browser",xr="browser",Er=!0,mr={},Ar=[],gr="",yr={},Tr={},Rr={};function v(){}var Ir=v,_r=v,vr=v,Ur=v,dr=v,Br=v,Yr=v;function Sr(n){throw new Error("process.binding is not supported")}function Pr(){return"/"}function Cr(n){throw new Error("process.chdir is not supported")}function Dr(){return 0}var B=globalThis.performance||{},Mr=B.now||B.mozNow||B.msNow||B.oNow||B.webkitNow||function(){return new Date().getTime()};function kr(n){var r=Mr.call(B)*.001,i=Math.floor(r),e=Math.floor(r%1*1e9);return n&&(i=i-n[0],e=e-n[1],e<0&&(i--,e+=1e9)),[i,e]}var Nr=new Date;function Lr(){var n=new Date,r=n-Nr;return r/1e3}var L={nextTick:pr,title:wr,browser:Er,env:mr,argv:Ar,version:gr,versions:yr,on:Ir,addListener:_r,once:vr,off:Ur,removeListener:dr,removeAllListeners:Br,emit:Yr,binding:Sr,cwd:Pr,chdir:Cr,umask:Dr,hrtime:kr,platform:xr,release:Tr,config:Rr,uptime:Lr},V={};Object.keys(V).forEach(n=>{let r=n.split("."),i=L;for(let e=0;e<r.length;e++){let t=r[e];e===r.length-1?i[t]=V[n]:i=i[t]||(i[t]={})}});var A=[],E=[],Fr=typeof Uint8Array<"u"?Uint8Array:Array,W=!1;function $(){W=!0;for(var n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",r=0,i=n.length;r<i;++r)A[r]=n[r],E[n.charCodeAt(r)]=r;E[45]=62,E[95]=63}function Wr(n){W||$();var r,i,e,t,f,u,a=n.length;if(a%4>0)throw new Error("Invalid string. Length must be a multiple of 4");f=n[a-2]==="="?2:n[a-1]==="="?1:0,u=new Fr(a*3/4-f),e=f>0?a-4:a;var h=0;for(r=0,i=0;r<e;r+=4,i+=3)t=E[n.charCodeAt(r)]<<18|E[n.charCodeAt(r+1)]<<12|E[n.charCodeAt(r+2)]<<6|E[n.charCodeAt(r+3)],u[h++]=t>>16&255,u[h++]=t>>8&255,u[h++]=t&255;return f===2?(t=E[n.charCodeAt(r)]<<2|E[n.charCodeAt(r+1)]>>4,u[h++]=t&255):f===1&&(t=E[n.charCodeAt(r)]<<10|E[n.charCodeAt(r+1)]<<4|E[n.charCodeAt(r+2)]>>2,u[h++]=t>>8&255,u[h++]=t&255),u}function Gr(n){return A[n>>18&63]+A[n>>12&63]+A[n>>6&63]+A[n&63]}function Hr(n,r,i){for(var e,t=[],f=r;f<i;f+=3)e=(n[f]<<16)+(n[f+1]<<8)+n[f+2],t.push(Gr(e));return t.join("")}function q(n){W||$();for(var r,i=n.length,e=i%3,t="",f=[],u=16383,a=0,h=i-e;a<h;a+=u)f.push(Hr(n,a,a+u>h?h:a+u));return e===1?(r=n[i-1],t+=A[r>>2],t+=A[r<<4&63],t+="=="):e===2&&(r=(n[i-2]<<8)+n[i-1],t+=A[r>>10],t+=A[r>>4&63],t+=A[r<<2&63],t+="="),f.push(t),f.join("")}o.TYPED_ARRAY_SUPPORT=globalThis.TYPED_ARRAY_SUPPORT!==void 0?globalThis.TYPED_ARRAY_SUPPORT:!0;function P(){return o.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function T(n,r){if(P()<r)throw new RangeError("Invalid typed array length");return o.TYPED_ARRAY_SUPPORT?(n=new Uint8Array(r),n.__proto__=o.prototype):(n===null&&(n=new o(r)),n.length=r),n}function o(n,r,i){if(!o.TYPED_ARRAY_SUPPORT&&!(this instanceof o))return new o(n,r,i);if(typeof n=="number"){if(typeof r=="string")throw new Error("If encoding is specified then the first argument must be a string");return G(this,n)}return b(this,n,r,i)}o.poolSize=8192;o._augment=function(n){return n.__proto__=o.prototype,n};function b(n,r,i,e){if(typeof r=="number")throw new TypeError('"value" argument must not be a number');return typeof ArrayBuffer<"u"&&r instanceof ArrayBuffer?Jr(n,r,i,e):typeof r=="string"?zr(n,r,i):Or(n,r)}o.from=function(n,r,i){return b(null,n,r,i)};o.kMaxLength=P();o.TYPED_ARRAY_SUPPORT&&(o.prototype.__proto__=Uint8Array.prototype,o.__proto__=Uint8Array,typeof Symbol<"u"&&Symbol.species&&o[Symbol.species]);function j(n){if(typeof n!="number")throw new TypeError('"size" argument must be a number');if(n<0)throw new RangeError('"size" argument must not be negative')}function Vr(n,r,i,e){return j(r),r<=0?T(n,r):i!==void 0?typeof e=="string"?T(n,r).fill(i,e):T(n,r).fill(i):T(n,r)}o.alloc=function(n,r,i){return Vr(null,n,r,i)};function G(n,r){if(j(r),n=T(n,r<0?0:H(r)|0),!o.TYPED_ARRAY_SUPPORT)for(var i=0;i<r;++i)n[i]=0;return n}o.allocUnsafe=function(n){return G(null,n)};o.allocUnsafeSlow=function(n){return G(null,n)};function zr(n,r,i){if((typeof i!="string"||i==="")&&(i="utf8"),!o.isEncoding(i))throw new TypeError('"encoding" must be a valid string encoding');var e=rr(r,i)|0;n=T(n,e);var t=n.write(r,i);return t!==e&&(n=n.slice(0,t)),n}function F(n,r){var i=r.length<0?0:H(r.length)|0;n=T(n,i);for(var e=0;e<i;e+=1)n[e]=r[e]&255;return n}function Jr(n,r,i,e){if(r.byteLength,i<0||r.byteLength<i)throw new RangeError("'offset' is out of bounds");if(r.byteLength<i+(e||0))throw new RangeError("'length' is out of bounds");return i===void 0&&e===void 0?r=new Uint8Array(r):e===void 0?r=new Uint8Array(r,i):r=new Uint8Array(r,i,e),o.TYPED_ARRAY_SUPPORT?(n=r,n.__proto__=o.prototype):n=F(n,r),n}function Or(n,r){if(g(r)){var i=H(r.length)|0;return n=T(n,i),n.length===0||r.copy(n,0,0,i),n}if(r){if(typeof ArrayBuffer<"u"&&r.buffer instanceof ArrayBuffer||"length"in r)return typeof r.length!="number"||ci(r.length)?T(n,0):F(n,r);if(r.type==="Buffer"&&Array.isArray(r.data))return F(n,r.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function H(n){if(n>=P())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+P().toString(16)+" bytes");return n|0}o.isBuffer=si;function g(n){return!!(n!=null&&n._isBuffer)}o.compare=function(r,i){if(!g(r)||!g(i))throw new TypeError("Arguments must be Buffers");if(r===i)return 0;for(var e=r.length,t=i.length,f=0,u=Math.min(e,t);f<u;++f)if(r[f]!==i[f]){e=r[f],t=i[f];break}return e<t?-1:t<e?1:0};o.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}};o.concat=function(r,i){if(!Array.isArray(r))throw new TypeError('"list" argument must be an Array of Buffers');if(r.length===0)return o.alloc(0);var e;if(i===void 0)for(i=0,e=0;e<r.length;++e)i+=r[e].length;var t=o.allocUnsafe(i),f=0;for(e=0;e<r.length;++e){var u=r[e];if(!g(u))throw new TypeError('"list" argument must be an Array of Buffers');u.copy(t,f),f+=u.length}return t};function rr(n,r){if(g(n))return n.length;if(typeof ArrayBuffer<"u"&&typeof ArrayBuffer.isView=="function"&&(ArrayBuffer.isView(n)||n instanceof ArrayBuffer))return n.byteLength;typeof n!="string"&&(n=""+n);var i=n.length;if(i===0)return 0;for(var e=!1;;)switch(r){case"ascii":case"latin1":case"binary":return i;case"utf8":case"utf-8":case void 0:return C(n).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return i*2;case"hex":return i>>>1;case"base64":return or(n).length;default:if(e)return C(n).length;r=(""+r).toLowerCase(),e=!0}}o.byteLength=rr;function Qr(n,r,i){var e=!1;if((r===void 0||r<0)&&(r=0),r>this.length||((i===void 0||i>this.length)&&(i=this.length),i<=0)||(i>>>=0,r>>>=0,i<=r))return"";for(n||(n="utf8");;)switch(n){case"hex":return ni(this,r,i);case"utf8":case"utf-8":return er(this,r,i);case"ascii":return ri(this,r,i);case"latin1":case"binary":return ii(this,r,i);case"base64":return br(this,r,i);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ei(this,r,i);default:if(e)throw new TypeError("Unknown encoding: "+n);n=(n+"").toLowerCase(),e=!0}}o.prototype._isBuffer=!0;function U(n,r,i){var e=n[r];n[r]=n[i],n[i]=e}o.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 i=0;i<r;i+=2)U(this,i,i+1);return this};o.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 i=0;i<r;i+=4)U(this,i,i+3),U(this,i+1,i+2);return this};o.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 i=0;i<r;i+=8)U(this,i,i+7),U(this,i+1,i+6),U(this,i+2,i+5),U(this,i+3,i+4);return this};o.prototype.toString=function(){var r=this.length|0;return r===0?"":arguments.length===0?er(this,0,r):Qr.apply(this,arguments)};o.prototype.equals=function(r){if(!g(r))throw new TypeError("Argument must be a Buffer");return this===r?!0:o.compare(this,r)===0};o.prototype.compare=function(r,i,e,t,f){if(!g(r))throw new TypeError("Argument must be a Buffer");if(i===void 0&&(i=0),e===void 0&&(e=r?r.length:0),t===void 0&&(t=0),f===void 0&&(f=this.length),i<0||e>r.length||t<0||f>this.length)throw new RangeError("out of range index");if(t>=f&&i>=e)return 0;if(t>=f)return-1;if(i>=e)return 1;if(i>>>=0,e>>>=0,t>>>=0,f>>>=0,this===r)return 0;for(var u=f-t,a=e-i,h=Math.min(u,a),s=this.slice(t,f),l=r.slice(i,e),c=0;c<h;++c)if(s[c]!==l[c]){u=s[c],a=l[c];break}return u<a?-1:a<u?1:0};function ir(n,r,i,e,t){if(n.length===0)return-1;if(typeof i=="string"?(e=i,i=0):i>2147483647?i=2147483647:i<-2147483648&&(i=-2147483648),i=+i,isNaN(i)&&(i=t?0:n.length-1),i<0&&(i=n.length+i),i>=n.length){if(t)return-1;i=n.length-1}else if(i<0)if(t)i=0;else return-1;if(typeof r=="string"&&(r=o.from(r,e)),g(r))return r.length===0?-1:Z(n,r,i,e,t);if(typeof r=="number")return r=r&255,o.TYPED_ARRAY_SUPPORT&&typeof Uint8Array.prototype.indexOf=="function"?t?Uint8Array.prototype.indexOf.call(n,r,i):Uint8Array.prototype.lastIndexOf.call(n,r,i):Z(n,[r],i,e,t);throw new TypeError("val must be string, number or Buffer")}function Z(n,r,i,e,t){var f=1,u=n.length,a=r.length;if(e!==void 0&&(e=String(e).toLowerCase(),e==="ucs2"||e==="ucs-2"||e==="utf16le"||e==="utf-16le")){if(n.length<2||r.length<2)return-1;f=2,u/=2,a/=2,i/=2}function h(x,d){return f===1?x[d]:x.readUInt16BE(d*f)}var s;if(t){var l=-1;for(s=i;s<u;s++)if(h(n,s)===h(r,l===-1?0:s-l)){if(l===-1&&(l=s),s-l+1===a)return l*f}else l!==-1&&(s-=s-l),l=-1}else for(i+a>u&&(i=u-a),s=i;s>=0;s--){for(var c=!0,m=0;m<a;m++)if(h(n,s+m)!==h(r,m)){c=!1;break}if(c)return s}return-1}o.prototype.includes=function(r,i,e){return this.indexOf(r,i,e)!==-1};o.prototype.indexOf=function(r,i,e){return ir(this,r,i,e,!0)};o.prototype.lastIndexOf=function(r,i,e){return ir(this,r,i,e,!1)};function Xr(n,r,i,e){i=Number(i)||0;var t=n.length-i;e?(e=Number(e),e>t&&(e=t)):e=t;var f=r.length;if(f%2!==0)throw new TypeError("Invalid hex string");e>f/2&&(e=f/2);for(var u=0;u<e;++u){var a=parseInt(r.substr(u*2,2),16);if(isNaN(a))return u;n[i+u]=a}return u}function qr(n,r,i,e){return k(C(r,n.length-i),n,i,e)}function nr(n,r,i,e){return k(ai(r),n,i,e)}function Zr(n,r,i,e){return nr(n,r,i,e)}function Kr(n,r,i,e){return k(or(r),n,i,e)}function $r(n,r,i,e){return k(hi(r,n.length-i),n,i,e)}o.prototype.write=function(r,i,e,t){if(i===void 0)t="utf8",e=this.length,i=0;else if(e===void 0&&typeof i=="string")t=i,e=this.length,i=0;else if(isFinite(i))i=i|0,isFinite(e)?(e=e|0,t===void 0&&(t="utf8")):(t=e,e=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var f=this.length-i;if((e===void 0||e>f)&&(e=f),r.length>0&&(e<0||i<0)||i>this.length)throw new RangeError("Attempt to write outside buffer bounds");t||(t="utf8");for(var u=!1;;)switch(t){case"hex":return Xr(this,r,i,e);case"utf8":case"utf-8":return qr(this,r,i,e);case"ascii":return nr(this,r,i,e);case"latin1":case"binary":return Zr(this,r,i,e);case"base64":return Kr(this,r,i,e);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return $r(this,r,i,e);default:if(u)throw new TypeError("Unknown encoding: "+t);t=(""+t).toLowerCase(),u=!0}};o.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function br(n,r,i){return r===0&&i===n.length?q(n):q(n.slice(r,i))}function er(n,r,i){i=Math.min(n.length,i);for(var e=[],t=r;t<i;){var f=n[t],u=null,a=f>239?4:f>223?3:f>191?2:1;if(t+a<=i){var h,s,l,c;switch(a){case 1:f<128&&(u=f);break;case 2:h=n[t+1],(h&192)===128&&(c=(f&31)<<6|h&63,c>127&&(u=c));break;case 3:h=n[t+1],s=n[t+2],(h&192)===128&&(s&192)===128&&(c=(f&15)<<12|(h&63)<<6|s&63,c>2047&&(c<55296||c>57343)&&(u=c));break;case 4:h=n[t+1],s=n[t+2],l=n[t+3],(h&192)===128&&(s&192)===128&&(l&192)===128&&(c=(f&15)<<18|(h&63)<<12|(s&63)<<6|l&63,c>65535&&c<1114112&&(u=c))}}u===null?(u=65533,a=1):u>65535&&(u-=65536,e.push(u>>>10&1023|55296),u=56320|u&1023),e.push(u),t+=a}return jr(e)}var K=4096;function jr(n){var r=n.length;if(r<=K)return String.fromCharCode.apply(String,n);for(var i="",e=0;e<r;)i+=String.fromCharCode.apply(String,n.slice(e,e+=K));return i}function ri(n,r,i){var e="";i=Math.min(n.length,i);for(var t=r;t<i;++t)e+=String.fromCharCode(n[t]&127);return e}function ii(n,r,i){var e="";i=Math.min(n.length,i);for(var t=r;t<i;++t)e+=String.fromCharCode(n[t]);return e}function ni(n,r,i){var e=n.length;(!r||r<0)&&(r=0),(!i||i<0||i>e)&&(i=e);for(var t="",f=r;f<i;++f)t+=oi(n[f]);return t}function ei(n,r,i){for(var e=n.slice(r,i),t="",f=0;f<e.length;f+=2)t+=String.fromCharCode(e[f]+e[f+1]*256);return t}o.prototype.slice=function(r,i){var e=this.length;r=~~r,i=i===void 0?e:~~i,r<0?(r+=e,r<0&&(r=0)):r>e&&(r=e),i<0?(i+=e,i<0&&(i=0)):i>e&&(i=e),i<r&&(i=r);var t;if(o.TYPED_ARRAY_SUPPORT)t=this.subarray(r,i),t.__proto__=o.prototype;else{var f=i-r;t=new o(f,void 0);for(var u=0;u<f;++u)t[u]=this[u+r]}return t};function p(n,r,i){if(n%1!==0||n<0)throw new RangeError("offset is not uint");if(n+r>i)throw new RangeError("Trying to access beyond buffer length")}o.prototype.readUIntLE=function(r,i,e){r=r|0,i=i|0,e||p(r,i,this.length);for(var t=this[r],f=1,u=0;++u<i&&(f*=256);)t+=this[r+u]*f;return t};o.prototype.readUIntBE=function(r,i,e){r=r|0,i=i|0,e||p(r,i,this.length);for(var t=this[r+--i],f=1;i>0&&(f*=256);)t+=this[r+--i]*f;return t};o.prototype.readUInt8=function(r,i){return i||p(r,1,this.length),this[r]};o.prototype.readUInt16LE=function(r,i){return i||p(r,2,this.length),this[r]|this[r+1]<<8};o.prototype.readUInt16BE=function(r,i){return i||p(r,2,this.length),this[r]<<8|this[r+1]};o.prototype.readUInt32LE=function(r,i){return i||p(r,4,this.length),(this[r]|this[r+1]<<8|this[r+2]<<16)+this[r+3]*16777216};o.prototype.readUInt32BE=function(r,i){return i||p(r,4,this.length),this[r]*16777216+(this[r+1]<<16|this[r+2]<<8|this[r+3])};o.prototype.readIntLE=function(r,i,e){r=r|0,i=i|0,e||p(r,i,this.length);for(var t=this[r],f=1,u=0;++u<i&&(f*=256);)t+=this[r+u]*f;return f*=128,t>=f&&(t-=Math.pow(2,8*i)),t};o.prototype.readIntBE=function(r,i,e){r=r|0,i=i|0,e||p(r,i,this.length);for(var t=i,f=1,u=this[r+--t];t>0&&(f*=256);)u+=this[r+--t]*f;return f*=128,u>=f&&(u-=Math.pow(2,8*i)),u};o.prototype.readInt8=function(r,i){return i||p(r,1,this.length),this[r]&128?(255-this[r]+1)*-1:this[r]};o.prototype.readInt16LE=function(r,i){i||p(r,2,this.length);var e=this[r]|this[r+1]<<8;return e&32768?e|4294901760:e};o.prototype.readInt16BE=function(r,i){i||p(r,2,this.length);var e=this[r+1]|this[r]<<8;return e&32768?e|4294901760:e};o.prototype.readInt32LE=function(r,i){return i||p(r,4,this.length),this[r]|this[r+1]<<8|this[r+2]<<16|this[r+3]<<24};o.prototype.readInt32BE=function(r,i){return i||p(r,4,this.length),this[r]<<24|this[r+1]<<16|this[r+2]<<8|this[r+3]};o.prototype.readFloatLE=function(r,i){return i||p(r,4,this.length),N(this,r,!0,23,4)};o.prototype.readFloatBE=function(r,i){return i||p(r,4,this.length),N(this,r,!1,23,4)};o.prototype.readDoubleLE=function(r,i){return i||p(r,8,this.length),N(this,r,!0,52,8)};o.prototype.readDoubleBE=function(r,i){return i||p(r,8,this.length),N(this,r,!1,52,8)};function w(n,r,i,e,t,f){if(!g(n))throw new TypeError('"buffer" argument must be a Buffer instance');if(r>t||r<f)throw new RangeError('"value" argument is out of bounds');if(i+e>n.length)throw new RangeError("Index out of range")}o.prototype.writeUIntLE=function(r,i,e,t){if(r=+r,i=i|0,e=e|0,!t){var f=Math.pow(2,8*e)-1;w(this,r,i,e,f,0)}var u=1,a=0;for(this[i]=r&255;++a<e&&(u*=256);)this[i+a]=r/u&255;return i+e};o.prototype.writeUIntBE=function(r,i,e,t){if(r=+r,i=i|0,e=e|0,!t){var f=Math.pow(2,8*e)-1;w(this,r,i,e,f,0)}var u=e-1,a=1;for(this[i+u]=r&255;--u>=0&&(a*=256);)this[i+u]=r/a&255;return i+e};o.prototype.writeUInt8=function(r,i,e){return r=+r,i=i|0,e||w(this,r,i,1,255,0),o.TYPED_ARRAY_SUPPORT||(r=Math.floor(r)),this[i]=r&255,i+1};function D(n,r,i,e){r<0&&(r=65535+r+1);for(var t=0,f=Math.min(n.length-i,2);t<f;++t)n[i+t]=(r&255<<8*(e?t:1-t))>>>(e?t:1-t)*8}o.prototype.writeUInt16LE=function(r,i,e){return r=+r,i=i|0,e||w(this,r,i,2,65535,0),o.TYPED_ARRAY_SUPPORT?(this[i]=r&255,this[i+1]=r>>>8):D(this,r,i,!0),i+2};o.prototype.writeUInt16BE=function(r,i,e){return r=+r,i=i|0,e||w(this,r,i,2,65535,0),o.TYPED_ARRAY_SUPPORT?(this[i]=r>>>8,this[i+1]=r&255):D(this,r,i,!1),i+2};function M(n,r,i,e){r<0&&(r=4294967295+r+1);for(var t=0,f=Math.min(n.length-i,4);t<f;++t)n[i+t]=r>>>(e?t:3-t)*8&255}o.prototype.writeUInt32LE=function(r,i,e){return r=+r,i=i|0,e||w(this,r,i,4,4294967295,0),o.TYPED_ARRAY_SUPPORT?(this[i+3]=r>>>24,this[i+2]=r>>>16,this[i+1]=r>>>8,this[i]=r&255):M(this,r,i,!0),i+4};o.prototype.writeUInt32BE=function(r,i,e){return r=+r,i=i|0,e||w(this,r,i,4,4294967295,0),o.TYPED_ARRAY_SUPPORT?(this[i]=r>>>24,this[i+1]=r>>>16,this[i+2]=r>>>8,this[i+3]=r&255):M(this,r,i,!1),i+4};o.prototype.writeIntLE=function(r,i,e,t){if(r=+r,i=i|0,!t){var f=Math.pow(2,8*e-1);w(this,r,i,e,f-1,-f)}var u=0,a=1,h=0;for(this[i]=r&255;++u<e&&(a*=256);)r<0&&h===0&&this[i+u-1]!==0&&(h=1),this[i+u]=(r/a>>0)-h&255;return i+e};o.prototype.writeIntBE=function(r,i,e,t){if(r=+r,i=i|0,!t){var f=Math.pow(2,8*e-1);w(this,r,i,e,f-1,-f)}var u=e-1,a=1,h=0;for(this[i+u]=r&255;--u>=0&&(a*=256);)r<0&&h===0&&this[i+u+1]!==0&&(h=1),this[i+u]=(r/a>>0)-h&255;return i+e};o.prototype.writeInt8=function(r,i,e){return r=+r,i=i|0,e||w(this,r,i,1,127,-128),o.TYPED_ARRAY_SUPPORT||(r=Math.floor(r)),r<0&&(r=255+r+1),this[i]=r&255,i+1};o.prototype.writeInt16LE=function(r,i,e){return r=+r,i=i|0,e||w(this,r,i,2,32767,-32768),o.TYPED_ARRAY_SUPPORT?(this[i]=r&255,this[i+1]=r>>>8):D(this,r,i,!0),i+2};o.prototype.writeInt16BE=function(r,i,e){return r=+r,i=i|0,e||w(this,r,i,2,32767,-32768),o.TYPED_ARRAY_SUPPORT?(this[i]=r>>>8,this[i+1]=r&255):D(this,r,i,!1),i+2};o.prototype.writeInt32LE=function(r,i,e){return r=+r,i=i|0,e||w(this,r,i,4,2147483647,-2147483648),o.TYPED_ARRAY_SUPPORT?(this[i]=r&255,this[i+1]=r>>>8,this[i+2]=r>>>16,this[i+3]=r>>>24):M(this,r,i,!0),i+4};o.prototype.writeInt32BE=function(r,i,e){return r=+r,i=i|0,e||w(this,r,i,4,2147483647,-2147483648),r<0&&(r=4294967295+r+1),o.TYPED_ARRAY_SUPPORT?(this[i]=r>>>24,this[i+1]=r>>>16,this[i+2]=r>>>8,this[i+3]=r&255):M(this,r,i,!1),i+4};function tr(n,r,i,e,t,f){if(i+e>n.length)throw new RangeError("Index out of range");if(i<0)throw new RangeError("Index out of range")}function fr(n,r,i,e,t){return t||tr(n,r,i,4,34028234663852886e22,-34028234663852886e22),hr(n,r,i,e,23,4),i+4}o.prototype.writeFloatLE=function(r,i,e){return fr(this,r,i,!0,e)};o.prototype.writeFloatBE=function(r,i,e){return fr(this,r,i,!1,e)};function ur(n,r,i,e,t){return t||tr(n,r,i,8,17976931348623157e292,-17976931348623157e292),hr(n,r,i,e,52,8),i+8}o.prototype.writeDoubleLE=function(r,i,e){return ur(this,r,i,!0,e)};o.prototype.writeDoubleBE=function(r,i,e){return ur(this,r,i,!1,e)};o.prototype.copy=function(r,i,e,t){if(e||(e=0),!t&&t!==0&&(t=this.length),i>=r.length&&(i=r.length),i||(i=0),t>0&&t<e&&(t=e),t===e||r.length===0||this.length===0)return 0;if(i<0)throw new RangeError("targetStart out of bounds");if(e<0||e>=this.length)throw new RangeError("sourceStart out of bounds");if(t<0)throw new RangeError("sourceEnd out of bounds");t>this.length&&(t=this.length),r.length-i<t-e&&(t=r.length-i+e);var f=t-e,u;if(this===r&&e<i&&i<t)for(u=f-1;u>=0;--u)r[u+i]=this[u+e];else if(f<1e3||!o.TYPED_ARRAY_SUPPORT)for(u=0;u<f;++u)r[u+i]=this[u+e];else Uint8Array.prototype.set.call(r,this.subarray(e,e+f),i);return f};o.prototype.fill=function(r,i,e,t){if(typeof r=="string"){if(typeof i=="string"?(t=i,i=0,e=this.length):typeof e=="string"&&(t=e,e=this.length),r.length===1){var f=r.charCodeAt(0);f<256&&(r=f)}if(t!==void 0&&typeof t!="string")throw new TypeError("encoding must be a string");if(typeof t=="string"&&!o.isEncoding(t))throw new TypeError("Unknown encoding: "+t)}else typeof r=="number"&&(r=r&255);if(i<0||this.length<i||this.length<e)throw new RangeError("Out of range index");if(e<=i)return this;i=i>>>0,e=e===void 0?this.length:e>>>0,r||(r=0);var u;if(typeof r=="number")for(u=i;u<e;++u)this[u]=r;else{var a=g(r)?r:C(new o(r,t).toString()),h=a.length;for(u=0;u<e-i;++u)this[u+i]=a[u%h]}return this};var ti=/[^+\/0-9A-Za-z-_]/g;function fi(n){if(n=ui(n).replace(ti,""),n.length<2)return"";for(;n.length%4!==0;)n=n+"=";return n}function ui(n){return n.trim?n.trim():n.replace(/^\s+|\s+$/g,"")}function oi(n){return n<16?"0"+n.toString(16):n.toString(16)}function C(n,r){r=r||1/0;for(var i,e=n.length,t=null,f=[],u=0;u<e;++u){if(i=n.charCodeAt(u),i>55295&&i<57344){if(!t){if(i>56319){(r-=3)>-1&&f.push(239,191,189);continue}else if(u+1===e){(r-=3)>-1&&f.push(239,191,189);continue}t=i;continue}if(i<56320){(r-=3)>-1&&f.push(239,191,189),t=i;continue}i=(t-55296<<10|i-56320)+65536}else t&&(r-=3)>-1&&f.push(239,191,189);if(t=null,i<128){if((r-=1)<0)break;f.push(i)}else if(i<2048){if((r-=2)<0)break;f.push(i>>6|192,i&63|128)}else if(i<65536){if((r-=3)<0)break;f.push(i>>12|224,i>>6&63|128,i&63|128)}else if(i<1114112){if((r-=4)<0)break;f.push(i>>18|240,i>>12&63|128,i>>6&63|128,i&63|128)}else throw new Error("Invalid code point")}return f}function ai(n){for(var r=[],i=0;i<n.length;++i)r.push(n.charCodeAt(i)&255);return r}function hi(n,r){for(var i,e,t,f=[],u=0;u<n.length&&!((r-=2)<0);++u)i=n.charCodeAt(u),e=i>>8,t=i%256,f.push(t),f.push(e);return f}function or(n){return Wr(fi(n))}function k(n,r,i,e){for(var t=0;t<e&&!(t+i>=r.length||t>=n.length);++t)r[t+i]=n[t];return t}function ci(n){return n!==n}function si(n){return n!=null&&(!!n._isBuffer||ar(n)||li(n))}function ar(n){return!!n.constructor&&typeof n.constructor.isBuffer=="function"&&n.constructor.isBuffer(n)}function li(n){return typeof n.readFloatLE=="function"&&typeof n.slice=="function"&&ar(n.slice(0,0))}function N(n,r,i,e,t){var f,u,a=t*8-e-1,h=(1<<a)-1,s=h>>1,l=-7,c=i?t-1:0,m=i?-1:1,x=n[r+c];for(c+=m,f=x&(1<<-l)-1,x>>=-l,l+=a;l>0;f=f*256+n[r+c],c+=m,l-=8);for(u=f&(1<<-l)-1,f>>=-l,l+=e;l>0;u=u*256+n[r+c],c+=m,l-=8);if(f===0)f=1-s;else{if(f===h)return u?NaN:(x?-1:1)*(1/0);u=u+Math.pow(2,e),f=f-s}return(x?-1:1)*u*Math.pow(2,f-e)}function hr(n,r,i,e,t,f){var u,a,h,s=f*8-t-1,l=(1<<s)-1,c=l>>1,m=t===23?Math.pow(2,-24)-Math.pow(2,-77):0,x=e?0:f-1,d=e?1:-1,cr=r<0||r===0&&1/r<0?1:0;for(r=Math.abs(r),isNaN(r)||r===1/0?(a=isNaN(r)?1:0,u=l):(u=Math.floor(Math.log(r)/Math.LN2),r*(h=Math.pow(2,-u))<1&&(u--,h*=2),u+c>=1?r+=m/h:r+=m*Math.pow(2,1-c),r*h>=2&&(u++,h/=2),u+c>=l?(a=0,u=l):u+c>=1?(a=(r*h-1)*Math.pow(2,t),u=u+c):(a=r*Math.pow(2,c-1)*Math.pow(2,t),u=0));t>=8;n[i+x]=a&255,x+=d,a/=256,t-=8);for(u=u<<t|a,s+=t;s>0;n[i+x]=u&255,x+=d,u/=256,s-=8);n[i+x-d]|=cr*128}function gi(n,r){return{id:n.id,address:n.address,chainId:n.chainId,name:n.name,unitName:n.unitName,decimals:n.decimals,isGas:n.isGas,img:n.img,cmcLink:n.cmcLink,isArchived:r?r(n):!1}}export{gi as mapToCodexAssetDto};
2
- /*! Bundled license information:
3
-
4
- @esbuild-plugins/node-globals-polyfill/Buffer.js:
5
- (*!
6
- * The buffer module from node.js, for the browser.
7
- *
8
- * @author Feross Aboukhadijeh <feross@feross.org> <http://feross.org>
9
- * @license MIT
10
- *)
11
- */
@@ -1,11 +0,0 @@
1
- function K(){throw new Error("setTimeout has not been defined")}function X(){throw new Error("clearTimeout has not been defined")}var b=K,g=X;typeof globalThis.setTimeout=="function"&&(b=setTimeout);typeof globalThis.clearTimeout=="function"&&(g=clearTimeout);function q(t){if(b===setTimeout)return setTimeout(t,0);if((b===K||!b)&&setTimeout)return b=setTimeout,setTimeout(t,0);try{return b(t,0)}catch{try{return b.call(null,t,0)}catch{return b.call(this,t,0)}}}function _r(t){if(g===clearTimeout)return clearTimeout(t);if((g===X||!g)&&clearTimeout)return g=clearTimeout,clearTimeout(t);try{return g(t)}catch{try{return g.call(null,t)}catch{return g.call(this,t)}}}var w=[],L=!1,N,U=-1;function wr(){!L||!N||(L=!1,N.length?w=N.concat(w):U=-1,w.length&&z())}function z(){if(!L){var t=q(wr);L=!0;for(var r=w.length;r;){for(N=w,w=[];++U<r;)N&&N[U].run();U=-1,r=w.length}N=null,L=!1,_r(t)}}function Rr(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];w.push(new J(t,r)),w.length===1&&!L&&q(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",Nr=!0,Cr={},Or=[],Dr="",yr={},Lr={},Ur={};function C(){}var Sr=C,Pr=C,vr=C,Br=C,Mr=C,Fr=C,kr=C;function Gr(t){throw new Error("process.binding is not supported")}function Yr(){return"/"}function Hr(t){throw new Error("process.chdir is not supported")}function Wr(){return 0}var y=globalThis.performance||{},Vr=y.now||y.mozNow||y.msNow||y.oNow||y.webkitNow||function(){return new Date().getTime()};function Kr(t){var r=Vr.call(y)*.001,e=Math.floor(r),n=Math.floor(r%1*1e9);return t&&(e=e-t[0],n=n-t[1],n<0&&(e--,n+=1e9)),[e,n]}var Xr=new Date;function qr(){var t=new Date,r=t-Xr;return r/1e3}var c={nextTick:Rr,title:br,browser:Nr,env:Cr,argv:Or,version:Dr,versions:yr,on:Sr,addListener:Pr,once:vr,off:Br,removeListener:Mr,removeAllListeners:Fr,emit:kr,binding:Gr,cwd:Yr,chdir:Hr,umask:Wr,hrtime:Kr,platform:gr,release:Lr,config:Ur,uptime:qr},V={};Object.keys(V).forEach(t=>{let r=t.split("."),e=c;for(let n=0;n<r.length;n++){let i=r[n];n===r.length-1?e[i]=V[t]:e=e[i]||(e[i]={})}});var T=[],A=[],zr=typeof Uint8Array<"u"?Uint8Array:Array,G=!1;function j(){G=!0;for(var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",r=0,e=t.length;r<e;++r)T[r]=t[r],A[t.charCodeAt(r)]=r;A[45]=62,A[95]=63}function Jr(t){G||j();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 u=0;for(r=0,e=0;r<n;r+=4,e+=3)i=A[t.charCodeAt(r)]<<18|A[t.charCodeAt(r+1)]<<12|A[t.charCodeAt(r+2)]<<6|A[t.charCodeAt(r+3)],a[u++]=i>>16&255,a[u++]=i>>8&255,a[u++]=i&255;return o===2?(i=A[t.charCodeAt(r)]<<2|A[t.charCodeAt(r+1)]>>4,a[u++]=i&255):o===1&&(i=A[t.charCodeAt(r)]<<10|A[t.charCodeAt(r+1)]<<4|A[t.charCodeAt(r+2)]>>2,a[u++]=i>>8&255,a[u++]=i&255),a}function Qr(t){return T[t>>18&63]+T[t>>12&63]+T[t>>6&63]+T[t&63]}function Zr(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(Qr(n));return i.join("")}function Q(t){G||j();for(var r,e=t.length,n=e%3,i="",o=[],a=16383,s=0,u=e-n;s<u;s+=a)o.push(Zr(t,s,s+a>u?u:s+a));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+="="),o.push(i),o.join("")}p.TYPED_ARRAY_SUPPORT=globalThis.TYPED_ARRAY_SUPPORT!==void 0?globalThis.TYPED_ARRAY_SUPPORT:!0;function S(){return p.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function R(t,r){if(S()<r)throw new RangeError("Invalid typed array length");return p.TYPED_ARRAY_SUPPORT?(t=new Uint8Array(r),t.__proto__=p.prototype):(t===null&&(t=new p(r)),t.length=r),t}function p(t,r,e){if(!p.TYPED_ARRAY_SUPPORT&&!(this instanceof p))return new p(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 Y(this,t)}return rr(this,t,r,e)}p.poolSize=8192;p._augment=function(t){return t.__proto__=p.prototype,t};function rr(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?re(t,r,e,n):typeof r=="string"?jr(t,r,e):ee(t,r)}p.from=function(t,r,e){return rr(null,t,r,e)};p.kMaxLength=S();p.TYPED_ARRAY_SUPPORT&&(p.prototype.__proto__=Uint8Array.prototype,p.__proto__=Uint8Array,typeof Symbol<"u"&&Symbol.species&&p[Symbol.species]);function er(t){if(typeof t!="number")throw new TypeError('"size" argument must be a number');if(t<0)throw new RangeError('"size" argument must not be negative')}function $r(t,r,e,n){return er(r),r<=0?R(t,r):e!==void 0?typeof n=="string"?R(t,r).fill(e,n):R(t,r).fill(e):R(t,r)}p.alloc=function(t,r,e){return $r(null,t,r,e)};function Y(t,r){if(er(r),t=R(t,r<0?0:H(r)|0),!p.TYPED_ARRAY_SUPPORT)for(var e=0;e<r;++e)t[e]=0;return t}p.allocUnsafe=function(t){return Y(null,t)};p.allocUnsafeSlow=function(t){return Y(null,t)};function jr(t,r,e){if((typeof e!="string"||e==="")&&(e="utf8"),!p.isEncoding(e))throw new TypeError('"encoding" must be a valid string encoding');var n=tr(r,e)|0;t=R(t,n);var i=t.write(r,e);return i!==n&&(t=t.slice(0,i)),t}function k(t,r){var e=r.length<0?0:H(r.length)|0;t=R(t,e);for(var n=0;n<e;n+=1)t[n]=r[n]&255;return t}function re(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),p.TYPED_ARRAY_SUPPORT?(t=r,t.__proto__=p.prototype):t=k(t,r),t}function ee(t,r){if(I(r)){var e=H(r.length)|0;return t=R(t,e),t.length===0||r.copy(t,0,0,e),t}if(r){if(typeof ArrayBuffer<"u"&&r.buffer instanceof ArrayBuffer||"length"in r)return typeof r.length!="number"||Ie(r.length)?R(t,0):k(t,r);if(r.type==="Buffer"&&Array.isArray(r.data))return k(t,r.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function H(t){if(t>=S())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+S().toString(16)+" bytes");return t|0}p.isBuffer=_e;function I(t){return!!(t!=null&&t._isBuffer)}p.compare=function(r,e){if(!I(r)||!I(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};p.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}};p.concat=function(r,e){if(!Array.isArray(r))throw new TypeError('"list" argument must be an Array of Buffers');if(r.length===0)return p.alloc(0);var n;if(e===void 0)for(e=0,n=0;n<r.length;++n)e+=r[n].length;var i=p.allocUnsafe(e),o=0;for(n=0;n<r.length;++n){var a=r[n];if(!I(a))throw new TypeError('"list" argument must be an Array of Buffers');a.copy(i,o),o+=a.length}return i};function tr(t,r){if(I(t))return t.length;if(typeof ArrayBuffer<"u"&&typeof ArrayBuffer.isView=="function"&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;typeof t!="string"&&(t=""+t);var e=t.length;if(e===0)return 0;for(var n=!1;;)switch(r){case"ascii":case"latin1":case"binary":return e;case"utf8":case"utf-8":case void 0:return P(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return e*2;case"hex":return e>>>1;case"base64":return ur(t).length;default:if(n)return P(t).length;r=(""+r).toLowerCase(),n=!0}}p.byteLength=tr;function te(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 le(this,r,e);case"utf8":case"utf-8":return or(this,r,e);case"ascii":return ce(this,r,e);case"latin1":case"binary":return he(this,r,e);case"base64":return se(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}}p.prototype._isBuffer=!0;function O(t,r,e){var n=t[r];t[r]=t[e],t[e]=n}p.prototype.swap16=function(){var r=this.length;if(r%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var e=0;e<r;e+=2)O(this,e,e+1);return this};p.prototype.swap32=function(){var r=this.length;if(r%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var e=0;e<r;e+=4)O(this,e,e+3),O(this,e+1,e+2);return this};p.prototype.swap64=function(){var r=this.length;if(r%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var e=0;e<r;e+=8)O(this,e,e+7),O(this,e+1,e+6),O(this,e+2,e+5),O(this,e+3,e+4);return this};p.prototype.toString=function(){var r=this.length|0;return r===0?"":arguments.length===0?or(this,0,r):te.apply(this,arguments)};p.prototype.equals=function(r){if(!I(r))throw new TypeError("Argument must be a Buffer");return this===r?!0:p.compare(this,r)===0};p.prototype.compare=function(r,e,n,i,o){if(!I(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,u=Math.min(a,s),l=this.slice(i,o),f=r.slice(e,n),h=0;h<u;++h)if(l[h]!==f[h]){a=l[h],s=f[h];break}return a<s?-1:s<a?1:0};function nr(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=p.from(r,n)),I(r))return r.length===0?-1:Z(t,r,e,n,i);if(typeof r=="number")return r=r&255,p.TYPED_ARRAY_SUPPORT&&typeof Uint8Array.prototype.indexOf=="function"?i?Uint8Array.prototype.indexOf.call(t,r,e):Uint8Array.prototype.lastIndexOf.call(t,r,e):Z(t,[r],e,n,i);throw new TypeError("val must be string, number or Buffer")}function Z(t,r,e,n,i){var o=1,a=t.length,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 u(d,D){return o===1?d[D]:d.readUInt16BE(D*o)}var l;if(i){var f=-1;for(l=e;l<a;l++)if(u(t,l)===u(r,f===-1?0:l-f)){if(f===-1&&(f=l),l-f+1===s)return f*o}else f!==-1&&(l-=l-f),f=-1}else for(e+s>a&&(e=a-s),l=e;l>=0;l--){for(var h=!0,x=0;x<s;x++)if(u(t,l+x)!==u(r,x)){h=!1;break}if(h)return l}return-1}p.prototype.includes=function(r,e,n){return this.indexOf(r,e,n)!==-1};p.prototype.indexOf=function(r,e,n){return nr(this,r,e,n,!0)};p.prototype.lastIndexOf=function(r,e,n){return nr(this,r,e,n,!1)};function ne(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 ie(t,r,e,n){return M(P(r,t.length-e),t,e,n)}function ir(t,r,e,n){return M(xe(r),t,e,n)}function oe(t,r,e,n){return ir(t,r,e,n)}function ae(t,r,e,n){return M(ur(r),t,e,n)}function pe(t,r,e,n){return M(Te(r,t.length-e),t,e,n)}p.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 ne(this,r,e,n);case"utf8":case"utf-8":return ie(this,r,e,n);case"ascii":return ir(this,r,e,n);case"latin1":case"binary":return oe(this,r,e,n);case"base64":return ae(this,r,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return pe(this,r,e,n);default:if(a)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),a=!0}};p.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function se(t,r,e){return r===0&&e===t.length?Q(t):Q(t.slice(r,e))}function or(t,r,e){e=Math.min(t.length,e);for(var 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 u,l,f,h;switch(s){case 1:o<128&&(a=o);break;case 2:u=t[i+1],(u&192)===128&&(h=(o&31)<<6|u&63,h>127&&(a=h));break;case 3:u=t[i+1],l=t[i+2],(u&192)===128&&(l&192)===128&&(h=(o&15)<<12|(u&63)<<6|l&63,h>2047&&(h<55296||h>57343)&&(a=h));break;case 4:u=t[i+1],l=t[i+2],f=t[i+3],(u&192)===128&&(l&192)===128&&(f&192)===128&&(h=(o&15)<<18|(u&63)<<12|(l&63)<<6|f&63,h>65535&&h<1114112&&(a=h))}}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 ue(n)}var $=4096;function ue(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 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 he(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 le(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+=Ae(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}p.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(p.TYPED_ARRAY_SUPPORT)i=this.subarray(r,e),i.__proto__=p.prototype;else{var o=e-r;i=new p(o,void 0);for(var a=0;a<o;++a)i[a]=this[a+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")}p.prototype.readUIntLE=function(r,e,n){r=r|0,e=e|0,n||m(r,e,this.length);for(var i=this[r],o=1,a=0;++a<e&&(o*=256);)i+=this[r+a]*o;return i};p.prototype.readUIntBE=function(r,e,n){r=r|0,e=e|0,n||m(r,e,this.length);for(var i=this[r+--e],o=1;e>0&&(o*=256);)i+=this[r+--e]*o;return i};p.prototype.readUInt8=function(r,e){return e||m(r,1,this.length),this[r]};p.prototype.readUInt16LE=function(r,e){return e||m(r,2,this.length),this[r]|this[r+1]<<8};p.prototype.readUInt16BE=function(r,e){return e||m(r,2,this.length),this[r]<<8|this[r+1]};p.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};p.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])};p.prototype.readIntLE=function(r,e,n){r=r|0,e=e|0,n||m(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};p.prototype.readIntBE=function(r,e,n){r=r|0,e=e|0,n||m(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};p.prototype.readInt8=function(r,e){return e||m(r,1,this.length),this[r]&128?(255-this[r]+1)*-1:this[r]};p.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};p.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};p.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};p.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]};p.prototype.readFloatLE=function(r,e){return e||m(r,4,this.length),F(this,r,!0,23,4)};p.prototype.readFloatBE=function(r,e){return e||m(r,4,this.length),F(this,r,!1,23,4)};p.prototype.readDoubleLE=function(r,e){return e||m(r,8,this.length),F(this,r,!0,52,8)};p.prototype.readDoubleBE=function(r,e){return e||m(r,8,this.length),F(this,r,!1,52,8)};function E(t,r,e,n,i,o){if(!I(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")}p.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;E(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};p.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;E(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};p.prototype.writeUInt8=function(r,e,n){return r=+r,e=e|0,n||E(this,r,e,1,255,0),p.TYPED_ARRAY_SUPPORT||(r=Math.floor(r)),this[e]=r&255,e+1};function v(t,r,e,n){r<0&&(r=65535+r+1);for(var i=0,o=Math.min(t.length-e,2);i<o;++i)t[e+i]=(r&255<<8*(n?i:1-i))>>>(n?i:1-i)*8}p.prototype.writeUInt16LE=function(r,e,n){return r=+r,e=e|0,n||E(this,r,e,2,65535,0),p.TYPED_ARRAY_SUPPORT?(this[e]=r&255,this[e+1]=r>>>8):v(this,r,e,!0),e+2};p.prototype.writeUInt16BE=function(r,e,n){return r=+r,e=e|0,n||E(this,r,e,2,65535,0),p.TYPED_ARRAY_SUPPORT?(this[e]=r>>>8,this[e+1]=r&255):v(this,r,e,!1),e+2};function B(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}p.prototype.writeUInt32LE=function(r,e,n){return r=+r,e=e|0,n||E(this,r,e,4,4294967295,0),p.TYPED_ARRAY_SUPPORT?(this[e+3]=r>>>24,this[e+2]=r>>>16,this[e+1]=r>>>8,this[e]=r&255):B(this,r,e,!0),e+4};p.prototype.writeUInt32BE=function(r,e,n){return r=+r,e=e|0,n||E(this,r,e,4,4294967295,0),p.TYPED_ARRAY_SUPPORT?(this[e]=r>>>24,this[e+1]=r>>>16,this[e+2]=r>>>8,this[e+3]=r&255):B(this,r,e,!1),e+4};p.prototype.writeIntLE=function(r,e,n,i){if(r=+r,e=e|0,!i){var o=Math.pow(2,8*n-1);E(this,r,e,n,o-1,-o)}var a=0,s=1,u=0;for(this[e]=r&255;++a<n&&(s*=256);)r<0&&u===0&&this[e+a-1]!==0&&(u=1),this[e+a]=(r/s>>0)-u&255;return e+n};p.prototype.writeIntBE=function(r,e,n,i){if(r=+r,e=e|0,!i){var o=Math.pow(2,8*n-1);E(this,r,e,n,o-1,-o)}var a=n-1,s=1,u=0;for(this[e+a]=r&255;--a>=0&&(s*=256);)r<0&&u===0&&this[e+a+1]!==0&&(u=1),this[e+a]=(r/s>>0)-u&255;return e+n};p.prototype.writeInt8=function(r,e,n){return r=+r,e=e|0,n||E(this,r,e,1,127,-128),p.TYPED_ARRAY_SUPPORT||(r=Math.floor(r)),r<0&&(r=255+r+1),this[e]=r&255,e+1};p.prototype.writeInt16LE=function(r,e,n){return r=+r,e=e|0,n||E(this,r,e,2,32767,-32768),p.TYPED_ARRAY_SUPPORT?(this[e]=r&255,this[e+1]=r>>>8):v(this,r,e,!0),e+2};p.prototype.writeInt16BE=function(r,e,n){return r=+r,e=e|0,n||E(this,r,e,2,32767,-32768),p.TYPED_ARRAY_SUPPORT?(this[e]=r>>>8,this[e+1]=r&255):v(this,r,e,!1),e+2};p.prototype.writeInt32LE=function(r,e,n){return r=+r,e=e|0,n||E(this,r,e,4,2147483647,-2147483648),p.TYPED_ARRAY_SUPPORT?(this[e]=r&255,this[e+1]=r>>>8,this[e+2]=r>>>16,this[e+3]=r>>>24):B(this,r,e,!0),e+4};p.prototype.writeInt32BE=function(r,e,n){return r=+r,e=e|0,n||E(this,r,e,4,2147483647,-2147483648),r<0&&(r=4294967295+r+1),p.TYPED_ARRAY_SUPPORT?(this[e]=r>>>24,this[e+1]=r>>>16,this[e+2]=r>>>8,this[e+3]=r&255):B(this,r,e,!1),e+4};function ar(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 pr(t,r,e,n,i){return i||ar(t,r,e,4,34028234663852886e22,-34028234663852886e22),hr(t,r,e,n,23,4),e+4}p.prototype.writeFloatLE=function(r,e,n){return pr(this,r,e,!0,n)};p.prototype.writeFloatBE=function(r,e,n){return pr(this,r,e,!1,n)};function sr(t,r,e,n,i){return i||ar(t,r,e,8,17976931348623157e292,-17976931348623157e292),hr(t,r,e,n,52,8),e+8}p.prototype.writeDoubleLE=function(r,e,n){return sr(this,r,e,!0,n)};p.prototype.writeDoubleBE=function(r,e,n){return sr(this,r,e,!1,n)};p.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||!p.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};p.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"&&!p.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=I(r)?r:P(new p(r,i).toString()),u=s.length;for(a=0;a<n-e;++a)this[a+e]=s[a%u]}return this};var me=/[^+\/0-9A-Za-z-_]/g;function Ee(t){if(t=de(t).replace(me,""),t.length<2)return"";for(;t.length%4!==0;)t=t+"=";return t}function de(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}function Ae(t){return t<16?"0"+t.toString(16):t.toString(16)}function P(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 xe(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 ur(t){return Jr(Ee(t))}function M(t,r,e,n){for(var i=0;i<n&&!(i+e>=r.length||i>=t.length);++i)r[i+e]=t[i];return i}function Ie(t){return t!==t}function _e(t){return t!=null&&(!!t._isBuffer||cr(t)||we(t))}function cr(t){return!!t.constructor&&typeof t.constructor.isBuffer=="function"&&t.constructor.isBuffer(t)}function we(t){return typeof t.readFloatLE=="function"&&typeof t.slice=="function"&&cr(t.slice(0,0))}function F(t,r,e,n,i){var o,a,s=i*8-n-1,u=(1<<s)-1,l=u>>1,f=-7,h=e?i-1:0,x=e?-1:1,d=t[r+h];for(h+=x,o=d&(1<<-f)-1,d>>=-f,f+=s;f>0;o=o*256+t[r+h],h+=x,f-=8);for(a=o&(1<<-f)-1,o>>=-f,f+=n;f>0;a=a*256+t[r+h],h+=x,f-=8);if(o===0)o=1-l;else{if(o===u)return a?NaN:(d?-1:1)*(1/0);a=a+Math.pow(2,n),o=o-l}return(d?-1:1)*a*Math.pow(2,o-n)}function hr(t,r,e,n,i,o){var a,s,u,l=o*8-i-1,f=(1<<l)-1,h=f>>1,x=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,d=n?0:o-1,D=n?1:-1,Ir=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=f):(a=Math.floor(Math.log(r)/Math.LN2),r*(u=Math.pow(2,-a))<1&&(a--,u*=2),a+h>=1?r+=x/u:r+=x*Math.pow(2,1-h),r*u>=2&&(a++,u/=2),a+h>=f?(s=0,a=f):a+h>=1?(s=(r*u-1)*Math.pow(2,i),a=a+h):(s=r*Math.pow(2,h-1)*Math.pow(2,i),a=0));i>=8;t[e+d]=s&255,d+=D,s/=256,i-=8);for(a=a<<i|s,l+=i;l>0;t[e+d]=a&255,d+=D,a/=256,l-=8);t[e+d-D]|=Ir*128}function Ue(t,r){return{id:t.id,address:t.address,chainId:t.chainId,name:t.name,unitName:t.unitName,decimals:t.decimals,isGas:t.isGas,img:t.img,cmcLink:t.cmcLink,isArchived:r?r(t):!1}}function Be(t){return{hash:t.hash,loginAddress:t.loginAddress,loginChainId:t.loginChainId,tokenId:t.token?.id,tokenAddress:t.tokenId,tokenChainId:t.tokenChainId,amount:t.amount,lockedAmount:t.lockedAmount}}var lr=(e=>(e[e.Buy=0]="Buy",e[e.Sell=1]="Sell",e))(lr||{}),_=lr;var fr=(i=>(i.GLOBAL_PAIR_DELISTING="GLOBAL_PAIR_DELISTING",i.GLOBAL_NEW_PAIR_LISTING="GLOBAL_NEW_PAIR_LISTING",i.GLOBAL_SYSTEM_MAINTENANCE="GLOBAL_SYSTEM_MAINTENANCE",i.GLOBAL_SMART_CONTRACT_UPDATE="GLOBAL_SMART_CONTRACT_UPDATE",i))(fr||{}),mr=(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))(mr||{}),Wt={...fr,...mr};function Er(t){switch(t){case _.Buy:return"B";case _.Sell:return"S";default:throw new Error("Unknown order side type: "+t)}}var dr=(t,r)=>String(t).toLowerCase()===String(r).toLowerCase();import W from"bignumber.js";W.config({DECIMAL_PLACES:40,EXPONENTIAL_AT:45});function Ar(t,r){return be(t,r,"+")}function be(t,r,e){switch(t=new W(String(t)),r=new W(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 ui(t,r,e){let n=t.buyOrder&&t.sellOrder?t.buyOrderId>t.sellOrderId?t.buyOrder:t.sellOrder:t.buyOrder||t.sellOrder;return{pairId:t.pairId,orderId:n?.id,orderSide:n&&Er(n.side),...xr(r,e),...Tr(t,n)}}function ci(t,r,e,n,i){return{id:t.id,pairId:t.pairId,pair:e||t.pair?.pairKey,...xr(n,i),amount:t.amount,price:t.price,total:t.total,filledAmount:t.filledAmount,filledTotal:t.filledTotal,avgPrice:t.excutedPrice,status:t.status,side:t.side,type:t.type,userId:t.userId,createdAt:t.createdAt?.getTime(),completedAt:t.completedAt?.getTime()||null,updatedAt:t.updatedAt?.getTime(),trades:r&&r.map(o=>Tr(o,t))}}function xr(t,r){return{baseTokenId:t?.id,baseTokenDecimal:t?.decimals,quoteTokenId:r?.id,quoteTokenDecimal:r?.decimals}}function Tr(t,r){return{tradeId:t.tradeId,status:t.txStatus,amount:t.amount,total:t.total,price:t.price,fee:r&&t.tradeFees.filter(e=>dr(e.address,r.userId)).reduce((e,n)=>Ar(e,n.fee),"0"),createdAt:t.createdAt?.getTime(),updatedAt:t.updatedAt?.getTime(),isBuyer:r&&r.side===_.Buy,isMaker:r&&ge(r.side,t.tradeSide)}}function ge(t,r){return t===_.Buy&&r===_.Sell||t===_.Sell&&r===_.Buy}export{ge as isMaker,Ue as mapToCodexAssetDto,Be as mapToCodexBalanceDto,ci as mapToOrderTradeDto,ui as mapToUserTradeDto};
2
- /*! Bundled license information:
3
-
4
- @esbuild-plugins/node-globals-polyfill/Buffer.js:
5
- (*!
6
- * The buffer module from node.js, for the browser.
7
- *
8
- * @author Feross Aboukhadijeh <feross@feross.org> <http://feross.org>
9
- * @license MIT
10
- *)
11
- */
@@ -1,11 +0,0 @@
1
- function K(){throw new Error("setTimeout has not been defined")}function X(){throw new Error("clearTimeout has not been defined")}var b=K,g=X;typeof globalThis.setTimeout=="function"&&(b=setTimeout);typeof globalThis.clearTimeout=="function"&&(g=clearTimeout);function q(t){if(b===setTimeout)return setTimeout(t,0);if((b===K||!b)&&setTimeout)return b=setTimeout,setTimeout(t,0);try{return b(t,0)}catch{try{return b.call(null,t,0)}catch{return b.call(this,t,0)}}}function Ir(t){if(g===clearTimeout)return clearTimeout(t);if((g===X||!g)&&clearTimeout)return g=clearTimeout,clearTimeout(t);try{return g(t)}catch{try{return g.call(null,t)}catch{return g.call(this,t)}}}var w=[],L=!1,N,U=-1;function wr(){!L||!N||(L=!1,N.length?w=N.concat(w):U=-1,w.length&&z())}function z(){if(!L){var t=q(wr);L=!0;for(var r=w.length;r;){for(N=w,w=[];++U<r;)N&&N[U].run();U=-1,r=w.length}N=null,L=!1,Ir(t)}}function Rr(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];w.push(new J(t,r)),w.length===1&&!L&&q(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",Nr=!0,Or={},Cr=[],Dr="",yr={},Lr={},Ur={};function O(){}var Sr=O,Pr=O,vr=O,Br=O,Mr=O,Fr=O,kr=O;function Gr(t){throw new Error("process.binding is not supported")}function Yr(){return"/"}function Hr(t){throw new Error("process.chdir is not supported")}function Wr(){return 0}var y=globalThis.performance||{},Vr=y.now||y.mozNow||y.msNow||y.oNow||y.webkitNow||function(){return new Date().getTime()};function Kr(t){var r=Vr.call(y)*.001,e=Math.floor(r),n=Math.floor(r%1*1e9);return t&&(e=e-t[0],n=n-t[1],n<0&&(e--,n+=1e9)),[e,n]}var Xr=new Date;function qr(){var t=new Date,r=t-Xr;return r/1e3}var h={nextTick:Rr,title:br,browser:Nr,env:Or,argv:Cr,version:Dr,versions:yr,on:Sr,addListener:Pr,once:vr,off:Br,removeListener:Mr,removeAllListeners:Fr,emit:kr,binding:Gr,cwd:Yr,chdir:Hr,umask:Wr,hrtime:Kr,platform:gr,release:Lr,config:Ur,uptime:qr},V={};Object.keys(V).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]=V[t]:e=e[i]||(e[i]={})}});var T=[],d=[],zr=typeof Uint8Array<"u"?Uint8Array:Array,G=!1;function j(){G=!0;for(var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",r=0,e=t.length;r<e;++r)T[r]=t[r],d[t.charCodeAt(r)]=r;d[45]=62,d[95]=63}function Jr(t){G||j();var r,e,n,i,o,p,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,p=new zr(s*3/4-o),n=o>0?s-4:s;var u=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)],p[u++]=i>>16&255,p[u++]=i>>8&255,p[u++]=i&255;return o===2?(i=d[t.charCodeAt(r)]<<2|d[t.charCodeAt(r+1)]>>4,p[u++]=i&255):o===1&&(i=d[t.charCodeAt(r)]<<10|d[t.charCodeAt(r+1)]<<4|d[t.charCodeAt(r+2)]>>2,p[u++]=i>>8&255,p[u++]=i&255),p}function Qr(t){return T[t>>18&63]+T[t>>12&63]+T[t>>6&63]+T[t&63]}function Zr(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(Qr(n));return i.join("")}function Q(t){G||j();for(var r,e=t.length,n=e%3,i="",o=[],p=16383,s=0,u=e-n;s<u;s+=p)o.push(Zr(t,s,s+p>u?u:s+p));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+="="),o.push(i),o.join("")}a.TYPED_ARRAY_SUPPORT=globalThis.TYPED_ARRAY_SUPPORT!==void 0?globalThis.TYPED_ARRAY_SUPPORT:!0;function S(){return a.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function R(t,r){if(S()<r)throw new RangeError("Invalid typed array length");return a.TYPED_ARRAY_SUPPORT?(t=new Uint8Array(r),t.__proto__=a.prototype):(t===null&&(t=new a(r)),t.length=r),t}function a(t,r,e){if(!a.TYPED_ARRAY_SUPPORT&&!(this instanceof a))return new a(t,r,e);if(typeof t=="number"){if(typeof r=="string")throw new Error("If encoding is specified then the first argument must be a string");return Y(this,t)}return rr(this,t,r,e)}a.poolSize=8192;a._augment=function(t){return t.__proto__=a.prototype,t};function rr(t,r,e,n){if(typeof r=="number")throw new TypeError('"value" argument must not be a number');return typeof ArrayBuffer<"u"&&r instanceof ArrayBuffer?re(t,r,e,n):typeof r=="string"?jr(t,r,e):ee(t,r)}a.from=function(t,r,e){return rr(null,t,r,e)};a.kMaxLength=S();a.TYPED_ARRAY_SUPPORT&&(a.prototype.__proto__=Uint8Array.prototype,a.__proto__=Uint8Array,typeof Symbol<"u"&&Symbol.species&&a[Symbol.species]);function er(t){if(typeof t!="number")throw new TypeError('"size" argument must be a number');if(t<0)throw new RangeError('"size" argument must not be negative')}function $r(t,r,e,n){return er(r),r<=0?R(t,r):e!==void 0?typeof n=="string"?R(t,r).fill(e,n):R(t,r).fill(e):R(t,r)}a.alloc=function(t,r,e){return $r(null,t,r,e)};function Y(t,r){if(er(r),t=R(t,r<0?0:H(r)|0),!a.TYPED_ARRAY_SUPPORT)for(var e=0;e<r;++e)t[e]=0;return t}a.allocUnsafe=function(t){return Y(null,t)};a.allocUnsafeSlow=function(t){return Y(null,t)};function jr(t,r,e){if((typeof e!="string"||e==="")&&(e="utf8"),!a.isEncoding(e))throw new TypeError('"encoding" must be a valid string encoding');var n=tr(r,e)|0;t=R(t,n);var i=t.write(r,e);return i!==n&&(t=t.slice(0,i)),t}function k(t,r){var e=r.length<0?0:H(r.length)|0;t=R(t,e);for(var n=0;n<e;n+=1)t[n]=r[n]&255;return t}function re(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),a.TYPED_ARRAY_SUPPORT?(t=r,t.__proto__=a.prototype):t=k(t,r),t}function ee(t,r){if(_(r)){var e=H(r.length)|0;return t=R(t,e),t.length===0||r.copy(t,0,0,e),t}if(r){if(typeof ArrayBuffer<"u"&&r.buffer instanceof ArrayBuffer||"length"in r)return typeof r.length!="number"||_e(r.length)?R(t,0):k(t,r);if(r.type==="Buffer"&&Array.isArray(r.data))return k(t,r.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function H(t){if(t>=S())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+S().toString(16)+" bytes");return t|0}a.isBuffer=Ie;function _(t){return!!(t!=null&&t._isBuffer)}a.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,o=0,p=Math.min(n,i);o<p;++o)if(r[o]!==e[o]){n=r[o],i=e[o];break}return n<i?-1:i<n?1:0};a.isEncoding=function(r){switch(String(r).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}};a.concat=function(r,e){if(!Array.isArray(r))throw new TypeError('"list" argument must be an Array of Buffers');if(r.length===0)return a.alloc(0);var n;if(e===void 0)for(e=0,n=0;n<r.length;++n)e+=r[n].length;var i=a.allocUnsafe(e),o=0;for(n=0;n<r.length;++n){var p=r[n];if(!_(p))throw new TypeError('"list" argument must be an Array of Buffers');p.copy(i,o),o+=p.length}return i};function tr(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 P(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 P(t).length;r=(""+r).toLowerCase(),n=!0}}a.byteLength=tr;function te(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 le(this,r,e);case"utf8":case"utf-8":return or(this,r,e);case"ascii":return ce(this,r,e);case"latin1":case"binary":return he(this,r,e);case"base64":return se(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}}a.prototype._isBuffer=!0;function C(t,r,e){var n=t[r];t[r]=t[e],t[e]=n}a.prototype.swap16=function(){var r=this.length;if(r%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var e=0;e<r;e+=2)C(this,e,e+1);return this};a.prototype.swap32=function(){var r=this.length;if(r%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var e=0;e<r;e+=4)C(this,e,e+3),C(this,e+1,e+2);return this};a.prototype.swap64=function(){var r=this.length;if(r%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var e=0;e<r;e+=8)C(this,e,e+7),C(this,e+1,e+6),C(this,e+2,e+5),C(this,e+3,e+4);return this};a.prototype.toString=function(){var r=this.length|0;return r===0?"":arguments.length===0?or(this,0,r):te.apply(this,arguments)};a.prototype.equals=function(r){if(!_(r))throw new TypeError("Argument must be a Buffer");return this===r?!0:a.compare(this,r)===0};a.prototype.compare=function(r,e,n,i,o){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),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 p=o-i,s=n-e,u=Math.min(p,s),l=this.slice(i,o),f=r.slice(e,n),c=0;c<u;++c)if(l[c]!==f[c]){p=l[c],s=f[c];break}return p<s?-1:s<p?1:0};function nr(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=a.from(r,n)),_(r))return r.length===0?-1:Z(t,r,e,n,i);if(typeof r=="number")return r=r&255,a.TYPED_ARRAY_SUPPORT&&typeof Uint8Array.prototype.indexOf=="function"?i?Uint8Array.prototype.indexOf.call(t,r,e):Uint8Array.prototype.lastIndexOf.call(t,r,e):Z(t,[r],e,n,i);throw new TypeError("val must be string, number or Buffer")}function Z(t,r,e,n,i){var o=1,p=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,p/=2,s/=2,e/=2}function u(A,D){return o===1?A[D]:A.readUInt16BE(D*o)}var l;if(i){var f=-1;for(l=e;l<p;l++)if(u(t,l)===u(r,f===-1?0:l-f)){if(f===-1&&(f=l),l-f+1===s)return f*o}else f!==-1&&(l-=l-f),f=-1}else for(e+s>p&&(e=p-s),l=e;l>=0;l--){for(var c=!0,x=0;x<s;x++)if(u(t,l+x)!==u(r,x)){c=!1;break}if(c)return l}return-1}a.prototype.includes=function(r,e,n){return this.indexOf(r,e,n)!==-1};a.prototype.indexOf=function(r,e,n){return nr(this,r,e,n,!0)};a.prototype.lastIndexOf=function(r,e,n){return nr(this,r,e,n,!1)};function ne(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 p=0;p<n;++p){var s=parseInt(r.substr(p*2,2),16);if(isNaN(s))return p;t[e+p]=s}return p}function ie(t,r,e,n){return M(P(r,t.length-e),t,e,n)}function ir(t,r,e,n){return M(xe(r),t,e,n)}function oe(t,r,e,n){return ir(t,r,e,n)}function pe(t,r,e,n){return M(ur(r),t,e,n)}function ae(t,r,e,n){return M(Te(r,t.length-e),t,e,n)}a.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 p=!1;;)switch(i){case"hex":return ne(this,r,e,n);case"utf8":case"utf-8":return ie(this,r,e,n);case"ascii":return ir(this,r,e,n);case"latin1":case"binary":return oe(this,r,e,n);case"base64":return pe(this,r,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ae(this,r,e,n);default:if(p)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),p=!0}};a.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function se(t,r,e){return r===0&&e===t.length?Q(t):Q(t.slice(r,e))}function or(t,r,e){e=Math.min(t.length,e);for(var n=[],i=r;i<e;){var o=t[i],p=null,s=o>239?4:o>223?3:o>191?2:1;if(i+s<=e){var u,l,f,c;switch(s){case 1:o<128&&(p=o);break;case 2:u=t[i+1],(u&192)===128&&(c=(o&31)<<6|u&63,c>127&&(p=c));break;case 3:u=t[i+1],l=t[i+2],(u&192)===128&&(l&192)===128&&(c=(o&15)<<12|(u&63)<<6|l&63,c>2047&&(c<55296||c>57343)&&(p=c));break;case 4:u=t[i+1],l=t[i+2],f=t[i+3],(u&192)===128&&(l&192)===128&&(f&192)===128&&(c=(o&15)<<18|(u&63)<<12|(l&63)<<6|f&63,c>65535&&c<1114112&&(p=c))}}p===null?(p=65533,s=1):p>65535&&(p-=65536,n.push(p>>>10&1023|55296),p=56320|p&1023),n.push(p),i+=s}return ue(n)}var $=4096;function ue(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 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 he(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 le(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+=de(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}a.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(a.TYPED_ARRAY_SUPPORT)i=this.subarray(r,e),i.__proto__=a.prototype;else{var o=e-r;i=new a(o,void 0);for(var p=0;p<o;++p)i[p]=this[p+r]}return i};function E(t,r,e){if(t%1!==0||t<0)throw new RangeError("offset is not uint");if(t+r>e)throw new RangeError("Trying to access beyond buffer length")}a.prototype.readUIntLE=function(r,e,n){r=r|0,e=e|0,n||E(r,e,this.length);for(var i=this[r],o=1,p=0;++p<e&&(o*=256);)i+=this[r+p]*o;return i};a.prototype.readUIntBE=function(r,e,n){r=r|0,e=e|0,n||E(r,e,this.length);for(var i=this[r+--e],o=1;e>0&&(o*=256);)i+=this[r+--e]*o;return i};a.prototype.readUInt8=function(r,e){return e||E(r,1,this.length),this[r]};a.prototype.readUInt16LE=function(r,e){return e||E(r,2,this.length),this[r]|this[r+1]<<8};a.prototype.readUInt16BE=function(r,e){return e||E(r,2,this.length),this[r]<<8|this[r+1]};a.prototype.readUInt32LE=function(r,e){return e||E(r,4,this.length),(this[r]|this[r+1]<<8|this[r+2]<<16)+this[r+3]*16777216};a.prototype.readUInt32BE=function(r,e){return e||E(r,4,this.length),this[r]*16777216+(this[r+1]<<16|this[r+2]<<8|this[r+3])};a.prototype.readIntLE=function(r,e,n){r=r|0,e=e|0,n||E(r,e,this.length);for(var i=this[r],o=1,p=0;++p<e&&(o*=256);)i+=this[r+p]*o;return o*=128,i>=o&&(i-=Math.pow(2,8*e)),i};a.prototype.readIntBE=function(r,e,n){r=r|0,e=e|0,n||E(r,e,this.length);for(var i=e,o=1,p=this[r+--i];i>0&&(o*=256);)p+=this[r+--i]*o;return o*=128,p>=o&&(p-=Math.pow(2,8*e)),p};a.prototype.readInt8=function(r,e){return e||E(r,1,this.length),this[r]&128?(255-this[r]+1)*-1:this[r]};a.prototype.readInt16LE=function(r,e){e||E(r,2,this.length);var n=this[r]|this[r+1]<<8;return n&32768?n|4294901760:n};a.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};a.prototype.readInt32LE=function(r,e){return e||E(r,4,this.length),this[r]|this[r+1]<<8|this[r+2]<<16|this[r+3]<<24};a.prototype.readInt32BE=function(r,e){return e||E(r,4,this.length),this[r]<<24|this[r+1]<<16|this[r+2]<<8|this[r+3]};a.prototype.readFloatLE=function(r,e){return e||E(r,4,this.length),F(this,r,!0,23,4)};a.prototype.readFloatBE=function(r,e){return e||E(r,4,this.length),F(this,r,!1,23,4)};a.prototype.readDoubleLE=function(r,e){return e||E(r,8,this.length),F(this,r,!0,52,8)};a.prototype.readDoubleBE=function(r,e){return e||E(r,8,this.length),F(this,r,!1,52,8)};function m(t,r,e,n,i,o){if(!_(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")}a.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;m(this,r,e,n,o,0)}var p=1,s=0;for(this[e]=r&255;++s<n&&(p*=256);)this[e+s]=r/p&255;return e+n};a.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;m(this,r,e,n,o,0)}var p=n-1,s=1;for(this[e+p]=r&255;--p>=0&&(s*=256);)this[e+p]=r/s&255;return e+n};a.prototype.writeUInt8=function(r,e,n){return r=+r,e=e|0,n||m(this,r,e,1,255,0),a.TYPED_ARRAY_SUPPORT||(r=Math.floor(r)),this[e]=r&255,e+1};function v(t,r,e,n){r<0&&(r=65535+r+1);for(var i=0,o=Math.min(t.length-e,2);i<o;++i)t[e+i]=(r&255<<8*(n?i:1-i))>>>(n?i:1-i)*8}a.prototype.writeUInt16LE=function(r,e,n){return r=+r,e=e|0,n||m(this,r,e,2,65535,0),a.TYPED_ARRAY_SUPPORT?(this[e]=r&255,this[e+1]=r>>>8):v(this,r,e,!0),e+2};a.prototype.writeUInt16BE=function(r,e,n){return r=+r,e=e|0,n||m(this,r,e,2,65535,0),a.TYPED_ARRAY_SUPPORT?(this[e]=r>>>8,this[e+1]=r&255):v(this,r,e,!1),e+2};function B(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}a.prototype.writeUInt32LE=function(r,e,n){return r=+r,e=e|0,n||m(this,r,e,4,4294967295,0),a.TYPED_ARRAY_SUPPORT?(this[e+3]=r>>>24,this[e+2]=r>>>16,this[e+1]=r>>>8,this[e]=r&255):B(this,r,e,!0),e+4};a.prototype.writeUInt32BE=function(r,e,n){return r=+r,e=e|0,n||m(this,r,e,4,4294967295,0),a.TYPED_ARRAY_SUPPORT?(this[e]=r>>>24,this[e+1]=r>>>16,this[e+2]=r>>>8,this[e+3]=r&255):B(this,r,e,!1),e+4};a.prototype.writeIntLE=function(r,e,n,i){if(r=+r,e=e|0,!i){var o=Math.pow(2,8*n-1);m(this,r,e,n,o-1,-o)}var p=0,s=1,u=0;for(this[e]=r&255;++p<n&&(s*=256);)r<0&&u===0&&this[e+p-1]!==0&&(u=1),this[e+p]=(r/s>>0)-u&255;return e+n};a.prototype.writeIntBE=function(r,e,n,i){if(r=+r,e=e|0,!i){var o=Math.pow(2,8*n-1);m(this,r,e,n,o-1,-o)}var p=n-1,s=1,u=0;for(this[e+p]=r&255;--p>=0&&(s*=256);)r<0&&u===0&&this[e+p+1]!==0&&(u=1),this[e+p]=(r/s>>0)-u&255;return e+n};a.prototype.writeInt8=function(r,e,n){return r=+r,e=e|0,n||m(this,r,e,1,127,-128),a.TYPED_ARRAY_SUPPORT||(r=Math.floor(r)),r<0&&(r=255+r+1),this[e]=r&255,e+1};a.prototype.writeInt16LE=function(r,e,n){return r=+r,e=e|0,n||m(this,r,e,2,32767,-32768),a.TYPED_ARRAY_SUPPORT?(this[e]=r&255,this[e+1]=r>>>8):v(this,r,e,!0),e+2};a.prototype.writeInt16BE=function(r,e,n){return r=+r,e=e|0,n||m(this,r,e,2,32767,-32768),a.TYPED_ARRAY_SUPPORT?(this[e]=r>>>8,this[e+1]=r&255):v(this,r,e,!1),e+2};a.prototype.writeInt32LE=function(r,e,n){return r=+r,e=e|0,n||m(this,r,e,4,2147483647,-2147483648),a.TYPED_ARRAY_SUPPORT?(this[e]=r&255,this[e+1]=r>>>8,this[e+2]=r>>>16,this[e+3]=r>>>24):B(this,r,e,!0),e+4};a.prototype.writeInt32BE=function(r,e,n){return r=+r,e=e|0,n||m(this,r,e,4,2147483647,-2147483648),r<0&&(r=4294967295+r+1),a.TYPED_ARRAY_SUPPORT?(this[e]=r>>>24,this[e+1]=r>>>16,this[e+2]=r>>>8,this[e+3]=r&255):B(this,r,e,!1),e+4};function pr(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 ar(t,r,e,n,i){return i||pr(t,r,e,4,34028234663852886e22,-34028234663852886e22),hr(t,r,e,n,23,4),e+4}a.prototype.writeFloatLE=function(r,e,n){return ar(this,r,e,!0,n)};a.prototype.writeFloatBE=function(r,e,n){return ar(this,r,e,!1,n)};function sr(t,r,e,n,i){return i||pr(t,r,e,8,17976931348623157e292,-17976931348623157e292),hr(t,r,e,n,52,8),e+8}a.prototype.writeDoubleLE=function(r,e,n){return sr(this,r,e,!0,n)};a.prototype.writeDoubleBE=function(r,e,n){return sr(this,r,e,!1,n)};a.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,p;if(this===r&&n<e&&e<i)for(p=o-1;p>=0;--p)r[p+e]=this[p+n];else if(o<1e3||!a.TYPED_ARRAY_SUPPORT)for(p=0;p<o;++p)r[p+e]=this[p+n];else Uint8Array.prototype.set.call(r,this.subarray(n,n+o),e);return o};a.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"&&!a.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 p;if(typeof r=="number")for(p=e;p<n;++p)this[p]=r;else{var s=_(r)?r:P(new a(r,i).toString()),u=s.length;for(p=0;p<n-e;++p)this[p+e]=s[p%u]}return this};var Ee=/[^+\/0-9A-Za-z-_]/g;function me(t){if(t=Ae(t).replace(Ee,""),t.length<2)return"";for(;t.length%4!==0;)t=t+"=";return t}function Ae(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}function de(t){return t<16?"0"+t.toString(16):t.toString(16)}function P(t,r){r=r||1/0;for(var e,n=t.length,i=null,o=[],p=0;p<n;++p){if(e=t.charCodeAt(p),e>55295&&e<57344){if(!i){if(e>56319){(r-=3)>-1&&o.push(239,191,189);continue}else if(p+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 xe(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=[],p=0;p<t.length&&!((r-=2)<0);++p)e=t.charCodeAt(p),n=e>>8,i=e%256,o.push(i),o.push(n);return o}function ur(t){return Jr(me(t))}function M(t,r,e,n){for(var i=0;i<n&&!(i+e>=r.length||i>=t.length);++i)r[i+e]=t[i];return i}function _e(t){return t!==t}function Ie(t){return t!=null&&(!!t._isBuffer||cr(t)||we(t))}function cr(t){return!!t.constructor&&typeof t.constructor.isBuffer=="function"&&t.constructor.isBuffer(t)}function we(t){return typeof t.readFloatLE=="function"&&typeof t.slice=="function"&&cr(t.slice(0,0))}function F(t,r,e,n,i){var o,p,s=i*8-n-1,u=(1<<s)-1,l=u>>1,f=-7,c=e?i-1:0,x=e?-1:1,A=t[r+c];for(c+=x,o=A&(1<<-f)-1,A>>=-f,f+=s;f>0;o=o*256+t[r+c],c+=x,f-=8);for(p=o&(1<<-f)-1,o>>=-f,f+=n;f>0;p=p*256+t[r+c],c+=x,f-=8);if(o===0)o=1-l;else{if(o===u)return p?NaN:(A?-1:1)*(1/0);p=p+Math.pow(2,n),o=o-l}return(A?-1:1)*p*Math.pow(2,o-n)}function hr(t,r,e,n,i,o){var p,s,u,l=o*8-i-1,f=(1<<l)-1,c=f>>1,x=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,A=n?0:o-1,D=n?1:-1,_r=r<0||r===0&&1/r<0?1:0;for(r=Math.abs(r),isNaN(r)||r===1/0?(s=isNaN(r)?1:0,p=f):(p=Math.floor(Math.log(r)/Math.LN2),r*(u=Math.pow(2,-p))<1&&(p--,u*=2),p+c>=1?r+=x/u:r+=x*Math.pow(2,1-c),r*u>=2&&(p++,u/=2),p+c>=f?(s=0,p=f):p+c>=1?(s=(r*u-1)*Math.pow(2,i),p=p+c):(s=r*Math.pow(2,c-1)*Math.pow(2,i),p=0));i>=8;t[e+A]=s&255,A+=D,s/=256,i-=8);for(p=p<<i|s,l+=i;l>0;t[e+A]=p&255,A+=D,p/=256,l-=8);t[e+A-D]|=_r*128}var lr=(e=>(e[e.Buy=0]="Buy",e[e.Sell=1]="Sell",e))(lr||{}),I=lr;var fr=(i=>(i.GLOBAL_PAIR_DELISTING="GLOBAL_PAIR_DELISTING",i.GLOBAL_NEW_PAIR_LISTING="GLOBAL_NEW_PAIR_LISTING",i.GLOBAL_SYSTEM_MAINTENANCE="GLOBAL_SYSTEM_MAINTENANCE",i.GLOBAL_SMART_CONTRACT_UPDATE="GLOBAL_SMART_CONTRACT_UPDATE",i))(fr||{}),Er=(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))(Er||{}),vt={...fr,...Er};function mr(t){switch(t){case I.Buy:return"B";case I.Sell:return"S";default:throw new Error("Unknown order side type: "+t)}}var Ar=(t,r)=>String(t).toLowerCase()===String(r).toLowerCase();import W from"bignumber.js";W.config({DECIMAL_PLACES:40,EXPONENTIAL_AT:45});function dr(t,r){return be(t,r,"+")}function be(t,r,e){switch(t=new W(String(t)),r=new W(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 ei(t,r,e){let n=t.buyOrder&&t.sellOrder?t.buyOrderId>t.sellOrderId?t.buyOrder:t.sellOrder:t.buyOrder||t.sellOrder;return{pairId:t.pairId,orderId:n?.id,orderSide:n&&mr(n.side),...xr(r,e),...Tr(t,n)}}function ti(t,r,e,n,i){return{id:t.id,pairId:t.pairId,pair:e||t.pair?.pairKey,...xr(n,i),amount:t.amount,price:t.price,total:t.total,filledAmount:t.filledAmount,filledTotal:t.filledTotal,avgPrice:t.excutedPrice,status:t.status,side:t.side,type:t.type,userId:t.userId,createdAt:t.createdAt?.getTime(),completedAt:t.completedAt?.getTime()||null,updatedAt:t.updatedAt?.getTime(),trades:r&&r.map(o=>Tr(o,t))}}function xr(t,r){return{baseTokenId:t?.id,baseTokenDecimal:t?.decimals,quoteTokenId:r?.id,quoteTokenDecimal:r?.decimals}}function Tr(t,r){return{tradeId:t.tradeId,status:t.txStatus,amount:t.amount,total:t.total,price:t.price,fee:r&&t.tradeFees.filter(e=>Ar(e.address,r.userId)).reduce((e,n)=>dr(e,n.fee),"0"),createdAt:t.createdAt?.getTime(),updatedAt:t.updatedAt?.getTime(),isBuyer:r&&r.side===I.Buy,isMaker:r&&ge(r.side,t.tradeSide)}}function ge(t,r){return t===I.Buy&&r===I.Sell||t===I.Sell&&r===I.Buy}export{ge as isMaker,ti as mapToOrderTradeDto,ei as mapToUserTradeDto};
2
- /*! Bundled license information:
3
-
4
- @esbuild-plugins/node-globals-polyfill/Buffer.js:
5
- (*!
6
- * The buffer module from node.js, for the browser.
7
- *
8
- * @author Feross Aboukhadijeh <feross@feross.org> <http://feross.org>
9
- * @license MIT
10
- *)
11
- */
@@ -1,11 +0,0 @@
1
- function G(){throw new Error("setTimeout has not been defined")}function J(){throw new Error("clearTimeout has not been defined")}var R=G,_=J;typeof globalThis.setTimeout=="function"&&(R=setTimeout);typeof globalThis.clearTimeout=="function"&&(_=clearTimeout);function O(n){if(R===setTimeout)return setTimeout(n,0);if((R===G||!R)&&setTimeout)return R=setTimeout,setTimeout(n,0);try{return R(n,0)}catch{try{return R.call(null,n,0)}catch{return R.call(this,n,0)}}}function lr(n){if(_===clearTimeout)return clearTimeout(n);if((_===J||!_)&&clearTimeout)return _=clearTimeout,clearTimeout(n);try{return _(n)}catch{try{return _.call(null,n)}catch{return _.call(this,n)}}}var y=[],Y=!1,v,S=-1;function pr(){!Y||!v||(Y=!1,v.length?y=v.concat(y):S=-1,y.length&&Q())}function Q(){if(!Y){var n=O(pr);Y=!0;for(var r=y.length;r;){for(v=y,y=[];++S<r;)v&&v[S].run();S=-1,r=y.length}v=null,Y=!1,lr(n)}}function sr(n){var r=new Array(arguments.length-1);if(arguments.length>1)for(var i=1;i<arguments.length;i++)r[i-1]=arguments[i];y.push(new X(n,r)),y.length===1&&!Y&&O(Q)}function X(n,r){this.fun=n,this.array=r}X.prototype.run=function(){this.fun.apply(null,this.array)};var wr="browser",xr="browser",Er=!0,mr={},Ar=[],gr="",yr={},Tr={},Rr={};function I(){}var _r=I,vr=I,Ir=I,Ur=I,Br=I,dr=I,Yr=I;function Sr(n){throw new Error("process.binding is not supported")}function Pr(){return"/"}function Mr(n){throw new Error("process.chdir is not supported")}function Dr(){return 0}var d=globalThis.performance||{},Cr=d.now||d.mozNow||d.msNow||d.oNow||d.webkitNow||function(){return new Date().getTime()};function kr(n){var r=Cr.call(d)*.001,i=Math.floor(r),e=Math.floor(r%1*1e9);return n&&(i=i-n[0],e=e-n[1],e<0&&(i--,e+=1e9)),[i,e]}var Nr=new Date;function Lr(){var n=new Date,r=n-Nr;return r/1e3}var L={nextTick:sr,title:wr,browser:Er,env:mr,argv:Ar,version:gr,versions:yr,on:_r,addListener:vr,once:Ir,off:Ur,removeListener:Br,removeAllListeners:dr,emit:Yr,binding:Sr,cwd:Pr,chdir:Mr,umask:Dr,hrtime:kr,platform:xr,release:Tr,config:Rr,uptime:Lr},z={};Object.keys(z).forEach(n=>{let r=n.split("."),i=L;for(let e=0;e<r.length;e++){let t=r[e];e===r.length-1?i[t]=z[n]:i=i[t]||(i[t]={})}});var A=[],E=[],Fr=typeof Uint8Array<"u"?Uint8Array:Array,W=!1;function K(){W=!0;for(var n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",r=0,i=n.length;r<i;++r)A[r]=n[r],E[n.charCodeAt(r)]=r;E[45]=62,E[95]=63}function Wr(n){W||K();var r,i,e,t,f,u,h=n.length;if(h%4>0)throw new Error("Invalid string. Length must be a multiple of 4");f=n[h-2]==="="?2:n[h-1]==="="?1:0,u=new Fr(h*3/4-f),e=f>0?h-4:h;var a=0;for(r=0,i=0;r<e;r+=4,i+=3)t=E[n.charCodeAt(r)]<<18|E[n.charCodeAt(r+1)]<<12|E[n.charCodeAt(r+2)]<<6|E[n.charCodeAt(r+3)],u[a++]=t>>16&255,u[a++]=t>>8&255,u[a++]=t&255;return f===2?(t=E[n.charCodeAt(r)]<<2|E[n.charCodeAt(r+1)]>>4,u[a++]=t&255):f===1&&(t=E[n.charCodeAt(r)]<<10|E[n.charCodeAt(r+1)]<<4|E[n.charCodeAt(r+2)]>>2,u[a++]=t>>8&255,u[a++]=t&255),u}function Hr(n){return A[n>>18&63]+A[n>>12&63]+A[n>>6&63]+A[n&63]}function Vr(n,r,i){for(var e,t=[],f=r;f<i;f+=3)e=(n[f]<<16)+(n[f+1]<<8)+n[f+2],t.push(Hr(e));return t.join("")}function q(n){W||K();for(var r,i=n.length,e=i%3,t="",f=[],u=16383,h=0,a=i-e;h<a;h+=u)f.push(Vr(n,h,h+u>a?a:h+u));return e===1?(r=n[i-1],t+=A[r>>2],t+=A[r<<4&63],t+="=="):e===2&&(r=(n[i-2]<<8)+n[i-1],t+=A[r>>10],t+=A[r>>4&63],t+=A[r<<2&63],t+="="),f.push(t),f.join("")}o.TYPED_ARRAY_SUPPORT=globalThis.TYPED_ARRAY_SUPPORT!==void 0?globalThis.TYPED_ARRAY_SUPPORT:!0;function P(){return o.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function T(n,r){if(P()<r)throw new RangeError("Invalid typed array length");return o.TYPED_ARRAY_SUPPORT?(n=new Uint8Array(r),n.__proto__=o.prototype):(n===null&&(n=new o(r)),n.length=r),n}function o(n,r,i){if(!o.TYPED_ARRAY_SUPPORT&&!(this instanceof o))return new o(n,r,i);if(typeof n=="number"){if(typeof r=="string")throw new Error("If encoding is specified then the first argument must be a string");return H(this,n)}return b(this,n,r,i)}o.poolSize=8192;o._augment=function(n){return n.__proto__=o.prototype,n};function b(n,r,i,e){if(typeof r=="number")throw new TypeError('"value" argument must not be a number');return typeof ArrayBuffer<"u"&&r instanceof ArrayBuffer?Jr(n,r,i,e):typeof r=="string"?Gr(n,r,i):Or(n,r)}o.from=function(n,r,i){return b(null,n,r,i)};o.kMaxLength=P();o.TYPED_ARRAY_SUPPORT&&(o.prototype.__proto__=Uint8Array.prototype,o.__proto__=Uint8Array,typeof Symbol<"u"&&Symbol.species&&o[Symbol.species]);function j(n){if(typeof n!="number")throw new TypeError('"size" argument must be a number');if(n<0)throw new RangeError('"size" argument must not be negative')}function zr(n,r,i,e){return j(r),r<=0?T(n,r):i!==void 0?typeof e=="string"?T(n,r).fill(i,e):T(n,r).fill(i):T(n,r)}o.alloc=function(n,r,i){return zr(null,n,r,i)};function H(n,r){if(j(r),n=T(n,r<0?0:V(r)|0),!o.TYPED_ARRAY_SUPPORT)for(var i=0;i<r;++i)n[i]=0;return n}o.allocUnsafe=function(n){return H(null,n)};o.allocUnsafeSlow=function(n){return H(null,n)};function Gr(n,r,i){if((typeof i!="string"||i==="")&&(i="utf8"),!o.isEncoding(i))throw new TypeError('"encoding" must be a valid string encoding');var e=rr(r,i)|0;n=T(n,e);var t=n.write(r,i);return t!==e&&(n=n.slice(0,t)),n}function F(n,r){var i=r.length<0?0:V(r.length)|0;n=T(n,i);for(var e=0;e<i;e+=1)n[e]=r[e]&255;return n}function Jr(n,r,i,e){if(r.byteLength,i<0||r.byteLength<i)throw new RangeError("'offset' is out of bounds");if(r.byteLength<i+(e||0))throw new RangeError("'length' is out of bounds");return i===void 0&&e===void 0?r=new Uint8Array(r):e===void 0?r=new Uint8Array(r,i):r=new Uint8Array(r,i,e),o.TYPED_ARRAY_SUPPORT?(n=r,n.__proto__=o.prototype):n=F(n,r),n}function Or(n,r){if(g(r)){var i=V(r.length)|0;return n=T(n,i),n.length===0||r.copy(n,0,0,i),n}if(r){if(typeof ArrayBuffer<"u"&&r.buffer instanceof ArrayBuffer||"length"in r)return typeof r.length!="number"||ci(r.length)?T(n,0):F(n,r);if(r.type==="Buffer"&&Array.isArray(r.data))return F(n,r.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function V(n){if(n>=P())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+P().toString(16)+" bytes");return n|0}o.isBuffer=li;function g(n){return!!(n!=null&&n._isBuffer)}o.compare=function(r,i){if(!g(r)||!g(i))throw new TypeError("Arguments must be Buffers");if(r===i)return 0;for(var e=r.length,t=i.length,f=0,u=Math.min(e,t);f<u;++f)if(r[f]!==i[f]){e=r[f],t=i[f];break}return e<t?-1:t<e?1:0};o.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}};o.concat=function(r,i){if(!Array.isArray(r))throw new TypeError('"list" argument must be an Array of Buffers');if(r.length===0)return o.alloc(0);var e;if(i===void 0)for(i=0,e=0;e<r.length;++e)i+=r[e].length;var t=o.allocUnsafe(i),f=0;for(e=0;e<r.length;++e){var u=r[e];if(!g(u))throw new TypeError('"list" argument must be an Array of Buffers');u.copy(t,f),f+=u.length}return t};function rr(n,r){if(g(n))return n.length;if(typeof ArrayBuffer<"u"&&typeof ArrayBuffer.isView=="function"&&(ArrayBuffer.isView(n)||n instanceof ArrayBuffer))return n.byteLength;typeof n!="string"&&(n=""+n);var i=n.length;if(i===0)return 0;for(var e=!1;;)switch(r){case"ascii":case"latin1":case"binary":return i;case"utf8":case"utf-8":case void 0:return M(n).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return i*2;case"hex":return i>>>1;case"base64":return or(n).length;default:if(e)return M(n).length;r=(""+r).toLowerCase(),e=!0}}o.byteLength=rr;function Qr(n,r,i){var e=!1;if((r===void 0||r<0)&&(r=0),r>this.length||((i===void 0||i>this.length)&&(i=this.length),i<=0)||(i>>>=0,r>>>=0,i<=r))return"";for(n||(n="utf8");;)switch(n){case"hex":return ni(this,r,i);case"utf8":case"utf-8":return er(this,r,i);case"ascii":return ri(this,r,i);case"latin1":case"binary":return ii(this,r,i);case"base64":return br(this,r,i);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ei(this,r,i);default:if(e)throw new TypeError("Unknown encoding: "+n);n=(n+"").toLowerCase(),e=!0}}o.prototype._isBuffer=!0;function U(n,r,i){var e=n[r];n[r]=n[i],n[i]=e}o.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 i=0;i<r;i+=2)U(this,i,i+1);return this};o.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 i=0;i<r;i+=4)U(this,i,i+3),U(this,i+1,i+2);return this};o.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 i=0;i<r;i+=8)U(this,i,i+7),U(this,i+1,i+6),U(this,i+2,i+5),U(this,i+3,i+4);return this};o.prototype.toString=function(){var r=this.length|0;return r===0?"":arguments.length===0?er(this,0,r):Qr.apply(this,arguments)};o.prototype.equals=function(r){if(!g(r))throw new TypeError("Argument must be a Buffer");return this===r?!0:o.compare(this,r)===0};o.prototype.compare=function(r,i,e,t,f){if(!g(r))throw new TypeError("Argument must be a Buffer");if(i===void 0&&(i=0),e===void 0&&(e=r?r.length:0),t===void 0&&(t=0),f===void 0&&(f=this.length),i<0||e>r.length||t<0||f>this.length)throw new RangeError("out of range index");if(t>=f&&i>=e)return 0;if(t>=f)return-1;if(i>=e)return 1;if(i>>>=0,e>>>=0,t>>>=0,f>>>=0,this===r)return 0;for(var u=f-t,h=e-i,a=Math.min(u,h),l=this.slice(t,f),p=r.slice(i,e),c=0;c<a;++c)if(l[c]!==p[c]){u=l[c],h=p[c];break}return u<h?-1:h<u?1:0};function ir(n,r,i,e,t){if(n.length===0)return-1;if(typeof i=="string"?(e=i,i=0):i>2147483647?i=2147483647:i<-2147483648&&(i=-2147483648),i=+i,isNaN(i)&&(i=t?0:n.length-1),i<0&&(i=n.length+i),i>=n.length){if(t)return-1;i=n.length-1}else if(i<0)if(t)i=0;else return-1;if(typeof r=="string"&&(r=o.from(r,e)),g(r))return r.length===0?-1:Z(n,r,i,e,t);if(typeof r=="number")return r=r&255,o.TYPED_ARRAY_SUPPORT&&typeof Uint8Array.prototype.indexOf=="function"?t?Uint8Array.prototype.indexOf.call(n,r,i):Uint8Array.prototype.lastIndexOf.call(n,r,i):Z(n,[r],i,e,t);throw new TypeError("val must be string, number or Buffer")}function Z(n,r,i,e,t){var f=1,u=n.length,h=r.length;if(e!==void 0&&(e=String(e).toLowerCase(),e==="ucs2"||e==="ucs-2"||e==="utf16le"||e==="utf-16le")){if(n.length<2||r.length<2)return-1;f=2,u/=2,h/=2,i/=2}function a(x,B){return f===1?x[B]:x.readUInt16BE(B*f)}var l;if(t){var p=-1;for(l=i;l<u;l++)if(a(n,l)===a(r,p===-1?0:l-p)){if(p===-1&&(p=l),l-p+1===h)return p*f}else p!==-1&&(l-=l-p),p=-1}else for(i+h>u&&(i=u-h),l=i;l>=0;l--){for(var c=!0,m=0;m<h;m++)if(a(n,l+m)!==a(r,m)){c=!1;break}if(c)return l}return-1}o.prototype.includes=function(r,i,e){return this.indexOf(r,i,e)!==-1};o.prototype.indexOf=function(r,i,e){return ir(this,r,i,e,!0)};o.prototype.lastIndexOf=function(r,i,e){return ir(this,r,i,e,!1)};function Xr(n,r,i,e){i=Number(i)||0;var t=n.length-i;e?(e=Number(e),e>t&&(e=t)):e=t;var f=r.length;if(f%2!==0)throw new TypeError("Invalid hex string");e>f/2&&(e=f/2);for(var u=0;u<e;++u){var h=parseInt(r.substr(u*2,2),16);if(isNaN(h))return u;n[i+u]=h}return u}function qr(n,r,i,e){return k(M(r,n.length-i),n,i,e)}function nr(n,r,i,e){return k(hi(r),n,i,e)}function Zr(n,r,i,e){return nr(n,r,i,e)}function $r(n,r,i,e){return k(or(r),n,i,e)}function Kr(n,r,i,e){return k(ai(r,n.length-i),n,i,e)}o.prototype.write=function(r,i,e,t){if(i===void 0)t="utf8",e=this.length,i=0;else if(e===void 0&&typeof i=="string")t=i,e=this.length,i=0;else if(isFinite(i))i=i|0,isFinite(e)?(e=e|0,t===void 0&&(t="utf8")):(t=e,e=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var f=this.length-i;if((e===void 0||e>f)&&(e=f),r.length>0&&(e<0||i<0)||i>this.length)throw new RangeError("Attempt to write outside buffer bounds");t||(t="utf8");for(var u=!1;;)switch(t){case"hex":return Xr(this,r,i,e);case"utf8":case"utf-8":return qr(this,r,i,e);case"ascii":return nr(this,r,i,e);case"latin1":case"binary":return Zr(this,r,i,e);case"base64":return $r(this,r,i,e);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Kr(this,r,i,e);default:if(u)throw new TypeError("Unknown encoding: "+t);t=(""+t).toLowerCase(),u=!0}};o.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function br(n,r,i){return r===0&&i===n.length?q(n):q(n.slice(r,i))}function er(n,r,i){i=Math.min(n.length,i);for(var e=[],t=r;t<i;){var f=n[t],u=null,h=f>239?4:f>223?3:f>191?2:1;if(t+h<=i){var a,l,p,c;switch(h){case 1:f<128&&(u=f);break;case 2:a=n[t+1],(a&192)===128&&(c=(f&31)<<6|a&63,c>127&&(u=c));break;case 3:a=n[t+1],l=n[t+2],(a&192)===128&&(l&192)===128&&(c=(f&15)<<12|(a&63)<<6|l&63,c>2047&&(c<55296||c>57343)&&(u=c));break;case 4:a=n[t+1],l=n[t+2],p=n[t+3],(a&192)===128&&(l&192)===128&&(p&192)===128&&(c=(f&15)<<18|(a&63)<<12|(l&63)<<6|p&63,c>65535&&c<1114112&&(u=c))}}u===null?(u=65533,h=1):u>65535&&(u-=65536,e.push(u>>>10&1023|55296),u=56320|u&1023),e.push(u),t+=h}return jr(e)}var $=4096;function jr(n){var r=n.length;if(r<=$)return String.fromCharCode.apply(String,n);for(var i="",e=0;e<r;)i+=String.fromCharCode.apply(String,n.slice(e,e+=$));return i}function ri(n,r,i){var e="";i=Math.min(n.length,i);for(var t=r;t<i;++t)e+=String.fromCharCode(n[t]&127);return e}function ii(n,r,i){var e="";i=Math.min(n.length,i);for(var t=r;t<i;++t)e+=String.fromCharCode(n[t]);return e}function ni(n,r,i){var e=n.length;(!r||r<0)&&(r=0),(!i||i<0||i>e)&&(i=e);for(var t="",f=r;f<i;++f)t+=oi(n[f]);return t}function ei(n,r,i){for(var e=n.slice(r,i),t="",f=0;f<e.length;f+=2)t+=String.fromCharCode(e[f]+e[f+1]*256);return t}o.prototype.slice=function(r,i){var e=this.length;r=~~r,i=i===void 0?e:~~i,r<0?(r+=e,r<0&&(r=0)):r>e&&(r=e),i<0?(i+=e,i<0&&(i=0)):i>e&&(i=e),i<r&&(i=r);var t;if(o.TYPED_ARRAY_SUPPORT)t=this.subarray(r,i),t.__proto__=o.prototype;else{var f=i-r;t=new o(f,void 0);for(var u=0;u<f;++u)t[u]=this[u+r]}return t};function s(n,r,i){if(n%1!==0||n<0)throw new RangeError("offset is not uint");if(n+r>i)throw new RangeError("Trying to access beyond buffer length")}o.prototype.readUIntLE=function(r,i,e){r=r|0,i=i|0,e||s(r,i,this.length);for(var t=this[r],f=1,u=0;++u<i&&(f*=256);)t+=this[r+u]*f;return t};o.prototype.readUIntBE=function(r,i,e){r=r|0,i=i|0,e||s(r,i,this.length);for(var t=this[r+--i],f=1;i>0&&(f*=256);)t+=this[r+--i]*f;return t};o.prototype.readUInt8=function(r,i){return i||s(r,1,this.length),this[r]};o.prototype.readUInt16LE=function(r,i){return i||s(r,2,this.length),this[r]|this[r+1]<<8};o.prototype.readUInt16BE=function(r,i){return i||s(r,2,this.length),this[r]<<8|this[r+1]};o.prototype.readUInt32LE=function(r,i){return i||s(r,4,this.length),(this[r]|this[r+1]<<8|this[r+2]<<16)+this[r+3]*16777216};o.prototype.readUInt32BE=function(r,i){return i||s(r,4,this.length),this[r]*16777216+(this[r+1]<<16|this[r+2]<<8|this[r+3])};o.prototype.readIntLE=function(r,i,e){r=r|0,i=i|0,e||s(r,i,this.length);for(var t=this[r],f=1,u=0;++u<i&&(f*=256);)t+=this[r+u]*f;return f*=128,t>=f&&(t-=Math.pow(2,8*i)),t};o.prototype.readIntBE=function(r,i,e){r=r|0,i=i|0,e||s(r,i,this.length);for(var t=i,f=1,u=this[r+--t];t>0&&(f*=256);)u+=this[r+--t]*f;return f*=128,u>=f&&(u-=Math.pow(2,8*i)),u};o.prototype.readInt8=function(r,i){return i||s(r,1,this.length),this[r]&128?(255-this[r]+1)*-1:this[r]};o.prototype.readInt16LE=function(r,i){i||s(r,2,this.length);var e=this[r]|this[r+1]<<8;return e&32768?e|4294901760:e};o.prototype.readInt16BE=function(r,i){i||s(r,2,this.length);var e=this[r+1]|this[r]<<8;return e&32768?e|4294901760:e};o.prototype.readInt32LE=function(r,i){return i||s(r,4,this.length),this[r]|this[r+1]<<8|this[r+2]<<16|this[r+3]<<24};o.prototype.readInt32BE=function(r,i){return i||s(r,4,this.length),this[r]<<24|this[r+1]<<16|this[r+2]<<8|this[r+3]};o.prototype.readFloatLE=function(r,i){return i||s(r,4,this.length),N(this,r,!0,23,4)};o.prototype.readFloatBE=function(r,i){return i||s(r,4,this.length),N(this,r,!1,23,4)};o.prototype.readDoubleLE=function(r,i){return i||s(r,8,this.length),N(this,r,!0,52,8)};o.prototype.readDoubleBE=function(r,i){return i||s(r,8,this.length),N(this,r,!1,52,8)};function w(n,r,i,e,t,f){if(!g(n))throw new TypeError('"buffer" argument must be a Buffer instance');if(r>t||r<f)throw new RangeError('"value" argument is out of bounds');if(i+e>n.length)throw new RangeError("Index out of range")}o.prototype.writeUIntLE=function(r,i,e,t){if(r=+r,i=i|0,e=e|0,!t){var f=Math.pow(2,8*e)-1;w(this,r,i,e,f,0)}var u=1,h=0;for(this[i]=r&255;++h<e&&(u*=256);)this[i+h]=r/u&255;return i+e};o.prototype.writeUIntBE=function(r,i,e,t){if(r=+r,i=i|0,e=e|0,!t){var f=Math.pow(2,8*e)-1;w(this,r,i,e,f,0)}var u=e-1,h=1;for(this[i+u]=r&255;--u>=0&&(h*=256);)this[i+u]=r/h&255;return i+e};o.prototype.writeUInt8=function(r,i,e){return r=+r,i=i|0,e||w(this,r,i,1,255,0),o.TYPED_ARRAY_SUPPORT||(r=Math.floor(r)),this[i]=r&255,i+1};function D(n,r,i,e){r<0&&(r=65535+r+1);for(var t=0,f=Math.min(n.length-i,2);t<f;++t)n[i+t]=(r&255<<8*(e?t:1-t))>>>(e?t:1-t)*8}o.prototype.writeUInt16LE=function(r,i,e){return r=+r,i=i|0,e||w(this,r,i,2,65535,0),o.TYPED_ARRAY_SUPPORT?(this[i]=r&255,this[i+1]=r>>>8):D(this,r,i,!0),i+2};o.prototype.writeUInt16BE=function(r,i,e){return r=+r,i=i|0,e||w(this,r,i,2,65535,0),o.TYPED_ARRAY_SUPPORT?(this[i]=r>>>8,this[i+1]=r&255):D(this,r,i,!1),i+2};function C(n,r,i,e){r<0&&(r=4294967295+r+1);for(var t=0,f=Math.min(n.length-i,4);t<f;++t)n[i+t]=r>>>(e?t:3-t)*8&255}o.prototype.writeUInt32LE=function(r,i,e){return r=+r,i=i|0,e||w(this,r,i,4,4294967295,0),o.TYPED_ARRAY_SUPPORT?(this[i+3]=r>>>24,this[i+2]=r>>>16,this[i+1]=r>>>8,this[i]=r&255):C(this,r,i,!0),i+4};o.prototype.writeUInt32BE=function(r,i,e){return r=+r,i=i|0,e||w(this,r,i,4,4294967295,0),o.TYPED_ARRAY_SUPPORT?(this[i]=r>>>24,this[i+1]=r>>>16,this[i+2]=r>>>8,this[i+3]=r&255):C(this,r,i,!1),i+4};o.prototype.writeIntLE=function(r,i,e,t){if(r=+r,i=i|0,!t){var f=Math.pow(2,8*e-1);w(this,r,i,e,f-1,-f)}var u=0,h=1,a=0;for(this[i]=r&255;++u<e&&(h*=256);)r<0&&a===0&&this[i+u-1]!==0&&(a=1),this[i+u]=(r/h>>0)-a&255;return i+e};o.prototype.writeIntBE=function(r,i,e,t){if(r=+r,i=i|0,!t){var f=Math.pow(2,8*e-1);w(this,r,i,e,f-1,-f)}var u=e-1,h=1,a=0;for(this[i+u]=r&255;--u>=0&&(h*=256);)r<0&&a===0&&this[i+u+1]!==0&&(a=1),this[i+u]=(r/h>>0)-a&255;return i+e};o.prototype.writeInt8=function(r,i,e){return r=+r,i=i|0,e||w(this,r,i,1,127,-128),o.TYPED_ARRAY_SUPPORT||(r=Math.floor(r)),r<0&&(r=255+r+1),this[i]=r&255,i+1};o.prototype.writeInt16LE=function(r,i,e){return r=+r,i=i|0,e||w(this,r,i,2,32767,-32768),o.TYPED_ARRAY_SUPPORT?(this[i]=r&255,this[i+1]=r>>>8):D(this,r,i,!0),i+2};o.prototype.writeInt16BE=function(r,i,e){return r=+r,i=i|0,e||w(this,r,i,2,32767,-32768),o.TYPED_ARRAY_SUPPORT?(this[i]=r>>>8,this[i+1]=r&255):D(this,r,i,!1),i+2};o.prototype.writeInt32LE=function(r,i,e){return r=+r,i=i|0,e||w(this,r,i,4,2147483647,-2147483648),o.TYPED_ARRAY_SUPPORT?(this[i]=r&255,this[i+1]=r>>>8,this[i+2]=r>>>16,this[i+3]=r>>>24):C(this,r,i,!0),i+4};o.prototype.writeInt32BE=function(r,i,e){return r=+r,i=i|0,e||w(this,r,i,4,2147483647,-2147483648),r<0&&(r=4294967295+r+1),o.TYPED_ARRAY_SUPPORT?(this[i]=r>>>24,this[i+1]=r>>>16,this[i+2]=r>>>8,this[i+3]=r&255):C(this,r,i,!1),i+4};function tr(n,r,i,e,t,f){if(i+e>n.length)throw new RangeError("Index out of range");if(i<0)throw new RangeError("Index out of range")}function fr(n,r,i,e,t){return t||tr(n,r,i,4,34028234663852886e22,-34028234663852886e22),ar(n,r,i,e,23,4),i+4}o.prototype.writeFloatLE=function(r,i,e){return fr(this,r,i,!0,e)};o.prototype.writeFloatBE=function(r,i,e){return fr(this,r,i,!1,e)};function ur(n,r,i,e,t){return t||tr(n,r,i,8,17976931348623157e292,-17976931348623157e292),ar(n,r,i,e,52,8),i+8}o.prototype.writeDoubleLE=function(r,i,e){return ur(this,r,i,!0,e)};o.prototype.writeDoubleBE=function(r,i,e){return ur(this,r,i,!1,e)};o.prototype.copy=function(r,i,e,t){if(e||(e=0),!t&&t!==0&&(t=this.length),i>=r.length&&(i=r.length),i||(i=0),t>0&&t<e&&(t=e),t===e||r.length===0||this.length===0)return 0;if(i<0)throw new RangeError("targetStart out of bounds");if(e<0||e>=this.length)throw new RangeError("sourceStart out of bounds");if(t<0)throw new RangeError("sourceEnd out of bounds");t>this.length&&(t=this.length),r.length-i<t-e&&(t=r.length-i+e);var f=t-e,u;if(this===r&&e<i&&i<t)for(u=f-1;u>=0;--u)r[u+i]=this[u+e];else if(f<1e3||!o.TYPED_ARRAY_SUPPORT)for(u=0;u<f;++u)r[u+i]=this[u+e];else Uint8Array.prototype.set.call(r,this.subarray(e,e+f),i);return f};o.prototype.fill=function(r,i,e,t){if(typeof r=="string"){if(typeof i=="string"?(t=i,i=0,e=this.length):typeof e=="string"&&(t=e,e=this.length),r.length===1){var f=r.charCodeAt(0);f<256&&(r=f)}if(t!==void 0&&typeof t!="string")throw new TypeError("encoding must be a string");if(typeof t=="string"&&!o.isEncoding(t))throw new TypeError("Unknown encoding: "+t)}else typeof r=="number"&&(r=r&255);if(i<0||this.length<i||this.length<e)throw new RangeError("Out of range index");if(e<=i)return this;i=i>>>0,e=e===void 0?this.length:e>>>0,r||(r=0);var u;if(typeof r=="number")for(u=i;u<e;++u)this[u]=r;else{var h=g(r)?r:M(new o(r,t).toString()),a=h.length;for(u=0;u<e-i;++u)this[u+i]=h[u%a]}return this};var ti=/[^+\/0-9A-Za-z-_]/g;function fi(n){if(n=ui(n).replace(ti,""),n.length<2)return"";for(;n.length%4!==0;)n=n+"=";return n}function ui(n){return n.trim?n.trim():n.replace(/^\s+|\s+$/g,"")}function oi(n){return n<16?"0"+n.toString(16):n.toString(16)}function M(n,r){r=r||1/0;for(var i,e=n.length,t=null,f=[],u=0;u<e;++u){if(i=n.charCodeAt(u),i>55295&&i<57344){if(!t){if(i>56319){(r-=3)>-1&&f.push(239,191,189);continue}else if(u+1===e){(r-=3)>-1&&f.push(239,191,189);continue}t=i;continue}if(i<56320){(r-=3)>-1&&f.push(239,191,189),t=i;continue}i=(t-55296<<10|i-56320)+65536}else t&&(r-=3)>-1&&f.push(239,191,189);if(t=null,i<128){if((r-=1)<0)break;f.push(i)}else if(i<2048){if((r-=2)<0)break;f.push(i>>6|192,i&63|128)}else if(i<65536){if((r-=3)<0)break;f.push(i>>12|224,i>>6&63|128,i&63|128)}else if(i<1114112){if((r-=4)<0)break;f.push(i>>18|240,i>>12&63|128,i>>6&63|128,i&63|128)}else throw new Error("Invalid code point")}return f}function hi(n){for(var r=[],i=0;i<n.length;++i)r.push(n.charCodeAt(i)&255);return r}function ai(n,r){for(var i,e,t,f=[],u=0;u<n.length&&!((r-=2)<0);++u)i=n.charCodeAt(u),e=i>>8,t=i%256,f.push(t),f.push(e);return f}function or(n){return Wr(fi(n))}function k(n,r,i,e){for(var t=0;t<e&&!(t+i>=r.length||t>=n.length);++t)r[t+i]=n[t];return t}function ci(n){return n!==n}function li(n){return n!=null&&(!!n._isBuffer||hr(n)||pi(n))}function hr(n){return!!n.constructor&&typeof n.constructor.isBuffer=="function"&&n.constructor.isBuffer(n)}function pi(n){return typeof n.readFloatLE=="function"&&typeof n.slice=="function"&&hr(n.slice(0,0))}function N(n,r,i,e,t){var f,u,h=t*8-e-1,a=(1<<h)-1,l=a>>1,p=-7,c=i?t-1:0,m=i?-1:1,x=n[r+c];for(c+=m,f=x&(1<<-p)-1,x>>=-p,p+=h;p>0;f=f*256+n[r+c],c+=m,p-=8);for(u=f&(1<<-p)-1,f>>=-p,p+=e;p>0;u=u*256+n[r+c],c+=m,p-=8);if(f===0)f=1-l;else{if(f===a)return u?NaN:(x?-1:1)*(1/0);u=u+Math.pow(2,e),f=f-l}return(x?-1:1)*u*Math.pow(2,f-e)}function ar(n,r,i,e,t,f){var u,h,a,l=f*8-t-1,p=(1<<l)-1,c=p>>1,m=t===23?Math.pow(2,-24)-Math.pow(2,-77):0,x=e?0:f-1,B=e?1:-1,cr=r<0||r===0&&1/r<0?1:0;for(r=Math.abs(r),isNaN(r)||r===1/0?(h=isNaN(r)?1:0,u=p):(u=Math.floor(Math.log(r)/Math.LN2),r*(a=Math.pow(2,-u))<1&&(u--,a*=2),u+c>=1?r+=m/a:r+=m*Math.pow(2,1-c),r*a>=2&&(u++,a/=2),u+c>=p?(h=0,u=p):u+c>=1?(h=(r*a-1)*Math.pow(2,t),u=u+c):(h=r*Math.pow(2,c-1)*Math.pow(2,t),u=0));t>=8;n[i+x]=h&255,x+=B,h/=256,t-=8);for(u=u<<t|h,l+=t;l>0;n[i+x]=u&255,x+=B,u/=256,l-=8);n[i+x-B]|=cr*128}var gi=(n,r)=>{if(!n)throw new Error(`Assertion error: ${r}`)};export{gi as assert};
2
- /*! Bundled license information:
3
-
4
- @esbuild-plugins/node-globals-polyfill/Buffer.js:
5
- (*!
6
- * The buffer module from node.js, for the browser.
7
- *
8
- * @author Feross Aboukhadijeh <feross@feross.org> <http://feross.org>
9
- * @license MIT
10
- *)
11
- */