@eaera-com/client-sdk-v1 0.2.108

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 (216) hide show
  1. package/LICENSE +19 -0
  2. package/README.md +86 -0
  3. package/dist/channels/accounts.d.ts +11 -0
  4. package/dist/channels/metrics.d.ts +8 -0
  5. package/dist/channels/position.d.ts +13 -0
  6. package/dist/channels/users.d.ts +38 -0
  7. package/dist/common/constants/category.constant.d.ts +30 -0
  8. package/dist/common/constants/category.constant.js +31 -0
  9. package/dist/common/constants/communication.constant.d.ts +52 -0
  10. package/dist/common/constants/communication.constant.js +85 -0
  11. package/dist/common/constants/email.constant.d.ts +4 -0
  12. package/dist/common/constants/email.constant.js +7 -0
  13. package/dist/common/constants/filter.constants.d.ts +1 -0
  14. package/dist/common/constants/filter.constants.js +6 -0
  15. package/dist/common/constants/index.d.ts +15 -0
  16. package/dist/common/constants/index.js +79 -0
  17. package/dist/common/constants/kyc.constant.d.ts +42 -0
  18. package/dist/common/constants/kyc.constant.js +43 -0
  19. package/dist/common/constants/listStatus.constants.d.ts +2 -0
  20. package/dist/common/constants/listStatus.constants.js +19 -0
  21. package/dist/common/constants/methods.constant.d.ts +43 -0
  22. package/dist/common/constants/methods.constant.js +84 -0
  23. package/dist/common/constants/passwordRule.constants.d.ts +4 -0
  24. package/dist/common/constants/passwordRule.constants.js +7 -0
  25. package/dist/common/constants/program.constants.d.ts +2 -0
  26. package/dist/common/constants/program.constants.js +31 -0
  27. package/dist/common/constants/propAccount.constant.d.ts +8 -0
  28. package/dist/common/constants/propAccount.constant.js +11 -0
  29. package/dist/common/constants/site-settings.constants.d.ts +40 -0
  30. package/dist/common/constants/site-settings.constants.js +10 -0
  31. package/dist/common/constants/store.constants.d.ts +1 -0
  32. package/dist/common/constants/store.constants.js +7 -0
  33. package/dist/common/constants/supportTicket.constant.d.ts +11 -0
  34. package/dist/common/constants/supportTicket.constant.js +14 -0
  35. package/dist/common/constants/tradingPlatform.constants.d.ts +4 -0
  36. package/dist/common/constants/tradingPlatform.constants.js +7 -0
  37. package/dist/common/constants/transaction.constant.d.ts +16 -0
  38. package/dist/common/constants/transaction.constant.js +19 -0
  39. package/dist/common/constants/type.constants.d.ts +5 -0
  40. package/dist/common/constants/type.constants.js +28 -0
  41. package/dist/common/constants/withdraw.constant.d.ts +1 -0
  42. package/dist/common/constants/withdraw.constant.js +7 -0
  43. package/dist/common/types/addon.type.d.ts +30 -0
  44. package/dist/common/types/category.type.d.ts +8 -0
  45. package/dist/common/types/common.type.d.ts +3 -0
  46. package/dist/common/types/communication.type.d.ts +51 -0
  47. package/dist/common/types/coupon.type.d.ts +27 -0
  48. package/dist/common/types/email.type.d.ts +8 -0
  49. package/dist/common/types/fundingSource.type.d.ts +80 -0
  50. package/dist/common/types/ibs.type.d.ts +15 -0
  51. package/dist/common/types/index.d.ts +16 -0
  52. package/dist/common/types/kyc.type.d.ts +52 -0
  53. package/dist/common/types/liveNotification.type.d.ts +10 -0
  54. package/dist/common/types/news.type.d.ts +17 -0
  55. package/dist/common/types/notification.types.d.ts +30 -0
  56. package/dist/common/types/passwordRule.type.d.ts +16 -0
  57. package/dist/common/types/paymentMethod/blockbee.type.d.ts +27 -0
  58. package/dist/common/types/paymentMethod/index.d.ts +2 -0
  59. package/dist/common/types/paymentMethod/match2pay.type.d.ts +27 -0
  60. package/dist/common/types/product.type.d.ts +63 -0
  61. package/dist/common/types/siteSetting.type.d.ts +77 -0
  62. package/dist/common/types/wallet.type.d.ts +36 -0
  63. package/dist/common/use-utils/data/countriesWithCurrencies.d.ts +7 -0
  64. package/dist/common/use-utils/data/dragonpayBank.d.ts +6 -0
  65. package/dist/common/use-utils/data/help2pay_banks.d.ts +7 -0
  66. package/dist/common/use-utils/data/listCryptoCurrencies.d.ts +5 -0
  67. package/dist/common/use-utils/data/regions.d.ts +16 -0
  68. package/dist/common/use-utils/data/widgets.d.ts +4 -0
  69. package/dist/common/use-utils/error-handlers/index.d.ts +1 -0
  70. package/dist/common/use-utils/helpers/color.helpers.d.ts +2 -0
  71. package/dist/common/use-utils/helpers/color.helpers.js +19 -0
  72. package/dist/common/use-utils/helpers/currency.helpers.d.ts +25 -0
  73. package/dist/common/use-utils/helpers/currency.helpers.js +762 -0
  74. package/dist/common/use-utils/helpers/date.helpers.d.ts +8 -0
  75. package/dist/common/use-utils/helpers/date.helpers.js +64 -0
  76. package/dist/common/use-utils/helpers/kyc.helpers.d.ts +22 -0
  77. package/dist/common/use-utils/helpers/kyc.helpers.js +165 -0
  78. package/dist/common/use-utils/helpers/misc.helpers.d.ts +45 -0
  79. package/dist/common/use-utils/helpers/misc.helpers.js +141 -0
  80. package/dist/common/use-utils/helpers/number.helpers.d.ts +11 -0
  81. package/dist/common/use-utils/helpers/number.helpers.js +76 -0
  82. package/dist/common/use-utils/helpers/passwordRule.helpers.d.ts +5 -0
  83. package/dist/common/use-utils/helpers/passwordRule.helpers.js +31 -0
  84. package/dist/common/use-utils/helpers/schema.helpers.d.ts +2 -0
  85. package/dist/common/use-utils/helpers/schema.helpers.js +2036 -0
  86. package/dist/common/use-utils/helpers/string.helpers.d.ts +7 -0
  87. package/dist/common/use-utils/helpers/string.helpers.js +38 -0
  88. package/dist/common/use-utils/helpers/transaction.helpers.d.ts +8 -0
  89. package/dist/common/use-utils/helpers/transaction.helpers.js +44 -0
  90. package/dist/common/use-utils/schemas/fundingMethod.schema.d.ts +1313 -0
  91. package/dist/common/use-utils/validators/index.d.ts +4 -0
  92. package/dist/common/use-utils/validators/index.js +8 -0
  93. package/dist/index-6dV6pxDN.js +334 -0
  94. package/dist/index-BTVWGSPO.js +2897 -0
  95. package/dist/index.d.ts +1763 -0
  96. package/dist/index.js +10326 -0
  97. package/dist/regions-Dsypl2zG.js +18768 -0
  98. package/dist/services/ClientSDK/account/index.d.ts +57 -0
  99. package/dist/services/ClientSDK/activityLog/index.d.ts +6 -0
  100. package/dist/services/ClientSDK/auth/index.d.ts +21 -0
  101. package/dist/services/ClientSDK/auth/types.d.ts +11 -0
  102. package/dist/services/ClientSDK/captcha/index.d.ts +5 -0
  103. package/dist/services/ClientSDK/category/index.d.ts +9 -0
  104. package/dist/services/ClientSDK/client/index.d.ts +15 -0
  105. package/dist/services/ClientSDK/commissionProfile/index.d.ts +10 -0
  106. package/dist/services/ClientSDK/contact/index.d.ts +9 -0
  107. package/dist/services/ClientSDK/content/index.d.ts +18 -0
  108. package/dist/services/ClientSDK/contentType/index.d.ts +6 -0
  109. package/dist/services/ClientSDK/conversionRate/index.d.ts +7 -0
  110. package/dist/services/ClientSDK/coupon/index.d.ts +15 -0
  111. package/dist/services/ClientSDK/coupon/type.d.ts +35 -0
  112. package/dist/services/ClientSDK/department/index.d.ts +10 -0
  113. package/dist/services/ClientSDK/devices/index.d.ts +6 -0
  114. package/dist/services/ClientSDK/emailLayout/index.d.ts +10 -0
  115. package/dist/services/ClientSDK/emailTemplate/index.d.ts +15 -0
  116. package/dist/services/ClientSDK/employee/index.d.ts +15 -0
  117. package/dist/services/ClientSDK/folder/index.d.ts +12 -0
  118. package/dist/services/ClientSDK/fundingSource/index.d.ts +17 -0
  119. package/dist/services/ClientSDK/gamificationCampaign/index.d.ts +9 -0
  120. package/dist/services/ClientSDK/ib/index.d.ts +26 -0
  121. package/dist/services/ClientSDK/index.d.ts +60 -0
  122. package/dist/services/ClientSDK/kycs/index.d.ts +18 -0
  123. package/dist/services/ClientSDK/lead/index.d.ts +13 -0
  124. package/dist/services/ClientSDK/metric/index.d.ts +11 -0
  125. package/dist/services/ClientSDK/metric/type.d.ts +171 -0
  126. package/dist/services/ClientSDK/news/index.d.ts +14 -0
  127. package/dist/services/ClientSDK/note/index.d.ts +8 -0
  128. package/dist/services/ClientSDK/notificationCenter/NotificationCenter.types.d.ts +24 -0
  129. package/dist/services/ClientSDK/notificationCenter/index.d.ts +20 -0
  130. package/dist/services/ClientSDK/payment/index.d.ts +27 -0
  131. package/dist/services/ClientSDK/persona/index.d.ts +12 -0
  132. package/dist/services/ClientSDK/product/index.d.ts +12 -0
  133. package/dist/services/ClientSDK/productAttribute/index.d.ts +9 -0
  134. package/dist/services/ClientSDK/propAccount/index.d.ts +59 -0
  135. package/dist/services/ClientSDK/purchase/index.d.ts +13 -0
  136. package/dist/services/ClientSDK/purchase/type.d.ts +66 -0
  137. package/dist/services/ClientSDK/reportFilters/index.d.ts +9 -0
  138. package/dist/services/ClientSDK/request/index.d.ts +38 -0
  139. package/dist/services/ClientSDK/roleSet/index.d.ts +8 -0
  140. package/dist/services/ClientSDK/silt/index.d.ts +5 -0
  141. package/dist/services/ClientSDK/siteSetting/index.d.ts +16 -0
  142. package/dist/services/ClientSDK/sumsub/index.d.ts +6 -0
  143. package/dist/services/ClientSDK/support/index.d.ts +16 -0
  144. package/dist/services/ClientSDK/tradeBattle/index.d.ts +30 -0
  145. package/dist/services/ClientSDK/tradeBattle/tradeBattle.type.d.ts +119 -0
  146. package/dist/services/ClientSDK/tradeServer/index.d.ts +12 -0
  147. package/dist/services/ClientSDK/transaction/index.d.ts +9 -0
  148. package/dist/services/ClientSDK/user/index.d.ts +40 -0
  149. package/dist/services/ClientSDK/veriff/index.d.ts +7 -0
  150. package/dist/services/ClientSDK/voip/index.d.ts +5 -0
  151. package/dist/services/ClientSDK/wallet/index.d.ts +18 -0
  152. package/dist/services/EmailServiceTestSDK/index.d.ts +7 -0
  153. package/dist/services/EmailServiceTestSDK/message/index.d.ts +6 -0
  154. package/dist/services/PoolTradingSDK/index.d.ts +11 -0
  155. package/dist/services/PoolTradingSDK/investWallet/index.d.ts +16 -0
  156. package/dist/services/PoolTradingSDK/poolProfile/index.d.ts +46 -0
  157. package/dist/services/ReportSDK/index.d.ts +28 -0
  158. package/dist/services/base.d.ts +29 -0
  159. package/dist/stores/account.d.ts +191 -0
  160. package/dist/stores/activityLog.d.ts +7 -0
  161. package/dist/stores/addon.d.ts +11 -0
  162. package/dist/stores/advertising.d.ts +155 -0
  163. package/dist/stores/auth.d.ts +39 -0
  164. package/dist/stores/battleNotification.d.ts +6 -0
  165. package/dist/stores/captcha.d.ts +3 -0
  166. package/dist/stores/category.d.ts +15 -0
  167. package/dist/stores/client.d.ts +16 -0
  168. package/dist/stores/commissionProfile.d.ts +12 -0
  169. package/dist/stores/contact.d.ts +9 -0
  170. package/dist/stores/content.d.ts +222 -0
  171. package/dist/stores/contentType.d.ts +10 -0
  172. package/dist/stores/contentV2.d.ts +160 -0
  173. package/dist/stores/conversionRate.d.ts +9 -0
  174. package/dist/stores/coupon.d.ts +30 -0
  175. package/dist/stores/department.d.ts +7 -0
  176. package/dist/stores/devices.d.ts +8 -0
  177. package/dist/stores/employee.d.ts +12 -0
  178. package/dist/stores/folder.d.ts +15 -0
  179. package/dist/stores/fundingSource.d.ts +46 -0
  180. package/dist/stores/gamificationCampaign.d.ts +10 -0
  181. package/dist/stores/ib.d.ts +22 -0
  182. package/dist/stores/index.d.ts +1761 -0
  183. package/dist/stores/investWallet.d.ts +92 -0
  184. package/dist/stores/kycs.d.ts +16 -0
  185. package/dist/stores/lead.d.ts +13 -0
  186. package/dist/stores/liveNotification.d.ts +6 -0
  187. package/dist/stores/metric.d.ts +24 -0
  188. package/dist/stores/metricsV2.d.ts +28 -0
  189. package/dist/stores/news.d.ts +15 -0
  190. package/dist/stores/notes.d.ts +16 -0
  191. package/dist/stores/notification.d.ts +6 -0
  192. package/dist/stores/notificationCenter.d.ts +20 -0
  193. package/dist/stores/payment.d.ts +25 -0
  194. package/dist/stores/poolProfile.d.ts +117 -0
  195. package/dist/stores/poolTrading.d.ts +7 -0
  196. package/dist/stores/product.d.ts +31 -0
  197. package/dist/stores/productAttribute.d.ts +10 -0
  198. package/dist/stores/propAccount.d.ts +48 -0
  199. package/dist/stores/purchases.d.ts +23 -0
  200. package/dist/stores/report.d.ts +19 -0
  201. package/dist/stores/reportFilter.d.ts +9 -0
  202. package/dist/stores/request.d.ts +39 -0
  203. package/dist/stores/roleSet.d.ts +7 -0
  204. package/dist/stores/siteSetting.d.ts +103 -0
  205. package/dist/stores/support.d.ts +33 -0
  206. package/dist/stores/tradeBattle.d.ts +51 -0
  207. package/dist/stores/tradeServer.d.ts +12 -0
  208. package/dist/stores/transaction.d.ts +8 -0
  209. package/dist/stores/user.d.ts +30 -0
  210. package/dist/stores/wallet.d.ts +53 -0
  211. package/dist/utils/axiosTiming.d.ts +12 -0
  212. package/dist/utils/cookies.d.ts +1 -0
  213. package/dist/utils/index.d.ts +4 -0
  214. package/dist/utils/routeCompression.d.ts +19 -0
  215. package/dist/utils/store.d.ts +12 -0
  216. package/package.json +74 -0
@@ -0,0 +1,4 @@
1
+ export declare function validateInputAmount(rule: any, value: any, callback: any): void;
2
+ export declare function validateAmountRange(rule: any, value: any, callback: any, min: number, max: number, t: (key: string, params?: Record<string, any>) => string): void;
3
+ export declare function validateEmail(rule: any, value: any, callback: any): void;
4
+ export declare function validatePassBySettings(_rule: any, value: string, callback: (error?: Error) => void, t?: (key: string) => string): void;
@@ -0,0 +1,8 @@
1
+ import { b as i, a as s, c as d, d as l } from "../../../index-6dV6pxDN.js";
2
+ import "../helpers/passwordRule.helpers.js";
3
+ export {
4
+ i as validateAmountRange,
5
+ s as validateEmail,
6
+ d as validateInputAmount,
7
+ l as validatePassBySettings
8
+ };
@@ -0,0 +1,334 @@
1
+ import { defineStore as u } from "pinia";
2
+ import { CURRENCY_TYPE as l } from "./common/constants/type.constants.js";
3
+ import { r as c } from "./regions-Dsypl2zG.js";
4
+ import { getFallbackPasswordRules as g, validatePassword as d } from "./common/use-utils/helpers/passwordRule.helpers.js";
5
+ const h = u("site-setting", {
6
+ state: () => ({
7
+ site_settings: {
8
+ settings: {},
9
+ children: {
10
+ company: {},
11
+ email_settings: {},
12
+ trading_platforms: {},
13
+ account_setup: {},
14
+ transaction_settings: {},
15
+ country_settings: {},
16
+ translations: {},
17
+ registration_and_kyc: {},
18
+ partner_setting: {},
19
+ wallet_setup: {},
20
+ widget_iframe_settings: {},
21
+ reports: {},
22
+ pool_trading: {},
23
+ coupon_setting: {},
24
+ copy_trading_integration: {},
25
+ app_products: {},
26
+ prop_account_giveaway_settings: {},
27
+ referral_settings: {},
28
+ prop_account_setup: {}
29
+ }
30
+ },
31
+ time_offset: {},
32
+ machine_translation: {}
33
+ }),
34
+ getters: {
35
+ settingsByPath() {
36
+ return (t) => {
37
+ let n = this.site_settings;
38
+ for (const s of t)
39
+ if (!n.children || (n = n.children[s], n == null)) return null;
40
+ return n;
41
+ };
42
+ },
43
+ fieldFromSetting() {
44
+ return (t, n) => {
45
+ let s = this.settingsByPath(t), e = null;
46
+ s && (s.settings ? e = s.settings : e = s);
47
+ for (const i of n)
48
+ e == null && (e = {}), e = e[i];
49
+ return e;
50
+ };
51
+ },
52
+ countrySettings() {
53
+ return this.settingsByPath(["country_settings"])?.settings;
54
+ },
55
+ tradingPlatformsChildrenSettings() {
56
+ return Object.entries(this.settingsByPath(["trading_platforms"])?.children ?? {}).map(
57
+ ([t, n]) => ({ ...n.settings ?? n, short_name: t })
58
+ );
59
+ },
60
+ liveServers() {
61
+ return this.tradingPlatformsChildrenSettings.filter((t) => t.type.toUpperCase() == "LIVE").map((t) => ({
62
+ label: t.name,
63
+ value: t.short_name
64
+ }));
65
+ },
66
+ demoServers() {
67
+ return this.tradingPlatformsChildrenSettings.filter((t) => t.type.toUpperCase() == "DEMO").map((t) => ({
68
+ label: t.name,
69
+ value: t.short_name
70
+ }));
71
+ },
72
+ battleServers() {
73
+ return this.tradingPlatformsChildrenSettings.filter((t) => t.type.toUpperCase() == "BATTLE").map((t) => ({
74
+ label: t.name,
75
+ value: t.short_name
76
+ }));
77
+ },
78
+ allServers() {
79
+ return this.tradingPlatformsChildrenSettings.map((t) => ({
80
+ label: t.name,
81
+ value: t.short_name,
82
+ type: t.type.toUpperCase()
83
+ })).sort((t, n) => t.type == n.type ? t.label > n.label ? 1 : -1 : t.type.toUpperCase() == "DEMO" ? 1 : -1);
84
+ },
85
+ accountTypes() {
86
+ return (t) => this.fieldFromSetting(["account_setup"], [t, "account_types"]) ?? [];
87
+ },
88
+ accountRules() {
89
+ return (t) => this.fieldFromSetting(["account_setup"], [t, "account_rules"]) ?? [];
90
+ },
91
+ accountCurrencies() {
92
+ return (t) => this.fieldFromSetting(["account_setup"], [t, "currency_based"]) ?? [];
93
+ },
94
+ accountLeverageTypes() {
95
+ return (t) => this.fieldFromSetting(["account_setup"], [t, "leverage_types"]) ?? [];
96
+ },
97
+ accountPromotions() {
98
+ return (t) => this.fieldFromSetting(["account_setup"], [t, "promotions"]) ?? [];
99
+ },
100
+ storageSettings() {
101
+ return (t) => this.fieldFromSetting(["account_setup"], [t, "storage_settings"]) ?? [];
102
+ },
103
+ companySettings() {
104
+ return this.settingsByPath(["company"])?.settings;
105
+ },
106
+ walletSetupCurrency() {
107
+ return this.fieldFromSetting(["wallet_setup"], ["currencies"]) ?? [];
108
+ },
109
+ getCompanySites() {
110
+ const t = this.companySettings?.sites;
111
+ return t ? t.reduce(
112
+ (s, e) => (s[e.site_name] = e.site_domain, s),
113
+ {}
114
+ ) : void 0;
115
+ },
116
+ currencyDigitSettings() {
117
+ return (t) => this.settingsByPath(["trading_platforms", t])?.settings?.symbols?.reduce(
118
+ (s, e) => (s.digits[e.symbol] = e.digits, s.digits_profit[e.symbol] = e.currency_profit_digits, s),
119
+ { digits: {}, digits_profit: {} }
120
+ );
121
+ },
122
+ reportSettings() {
123
+ let t = this.settingsByPath(["reports"]);
124
+ if (t == null) return { children: {} };
125
+ let n = t.settings?.disabled_reports ?? [], s = t.settings?.enabled_report_groups, e = Object.entries(t.children ?? {}).filter(
126
+ ([i, r]) => !s || s.includes(i)
127
+ ).map(([i, r]) => {
128
+ let o = Object.entries(r.children ?? {}).filter(
129
+ (a) => !n.includes(a[0])
130
+ );
131
+ return r.children = Object.fromEntries(o), [i, r];
132
+ });
133
+ return t.children = Object.fromEntries(e), t;
134
+ },
135
+ getAvailabledFiatAndCryptoCurrencies() {
136
+ return (t = !1, n = !0) => {
137
+ const s = this.fieldFromSetting(["wallet_setup"], ["currencies"]) ?? [], e = this.fieldFromSetting(["wallet_setup", "crypto_wallet_setup"], ["currencies"]) ?? [], i = s.map((a) => ({ ...a, type: l.FIAT })), r = e.map((a) => ({
138
+ ...a,
139
+ type: l.CRYPTO
140
+ }));
141
+ if (t)
142
+ return {
143
+ fiat: n ? i.filter((a) => a.enabled) : i,
144
+ crypto: n ? r.filter((a) => a.enabled) : r
145
+ };
146
+ const o = [...i, ...r];
147
+ return n ? o.filter((a) => a.enabled) : o;
148
+ };
149
+ },
150
+ getCurrencyDigit() {
151
+ return (t) => {
152
+ const n = this.fieldFromSetting(["wallet_setup"], ["digits"]) ?? {}, s = this.fieldFromSetting(["wallet_setup", "crypto_wallet_setup"], ["digits"]) ?? {};
153
+ return { ...n, ...s }[t] ?? 0;
154
+ };
155
+ },
156
+ availableCountries() {
157
+ const t = this.site_settings.children.country_settings.settings;
158
+ let n = t.top_countries || [], s = t.black_list || [], e = c.filter((i) => n.includes(i.countryShortCode));
159
+ return e = e.concat(
160
+ c.filter(
161
+ (i) => !s.concat(n).includes(i.countryShortCode)
162
+ )
163
+ ), e;
164
+ },
165
+ traderReferral() {
166
+ return this.settingsByPath(["referral_settings", "trader_referral"]);
167
+ },
168
+ traderReferralSettings() {
169
+ return this.traderReferral()?.settings;
170
+ },
171
+ getEnabledPasswordRules() {
172
+ const n = (this.fieldFromSetting(["registration_and_kyc"], ["input_password_validation"]) ?? []).filter((s) => s.state);
173
+ return n.length > 0 ? n : g();
174
+ }
175
+ },
176
+ actions: {
177
+ set_settings({ path: t, data: n }) {
178
+ let s = this.site_settings, e = [...t], i = e.pop();
179
+ if (i === "site_settings") {
180
+ Object.assign(s, n);
181
+ return;
182
+ }
183
+ for (; e.length > 0; ) {
184
+ let r = e.shift();
185
+ r != "site_settings" && (s.children || (s.children = {}), s.children[r] || (s.children[r] = {}), s = s.children[r]);
186
+ }
187
+ s.children || (s.children = {}), s.children[i] = n;
188
+ },
189
+ fetchSiteSettings(t, n = !1) {
190
+ return new Promise((s, e) => {
191
+ this.$clientSDK.fetchSiteSettings(t, n).then((i) => {
192
+ this.set_settings({ path: t, data: i.data }), s(i);
193
+ }).catch((i) => {
194
+ console.error(i), e(i);
195
+ });
196
+ });
197
+ },
198
+ fetchPublicSiteSettings(t, n = !1) {
199
+ return new Promise((s, e) => {
200
+ this.$clientSDK.fetchPublicSiteSettings(t, n).then(async (i) => {
201
+ this.set_settings({ path: t, data: i.data }), s(i);
202
+ }).catch((i) => {
203
+ console.error(i), e(i);
204
+ });
205
+ });
206
+ },
207
+ updateSettings(t, n, s = !1) {
208
+ let e = this.settingsByPath(t)?.settings;
209
+ return n && (e = n), new Promise((i, r) => {
210
+ this.$clientSDK.updateSettings(t, e, s).then((o) => {
211
+ this.set_settings({ path: t, data: o.data }), i(o);
212
+ }).catch((o) => {
213
+ console.error(o), r(o);
214
+ });
215
+ });
216
+ },
217
+ createSetting(t, n, s) {
218
+ let e = this.settingsByPath(t)?.settings;
219
+ return n && (e = n), new Promise((i, r) => {
220
+ this.$clientSDK.createSetting(t, e, s).then((o) => {
221
+ this.set_settings({ path: t.concat(o.data.short_name), data: o.data }), i(o);
222
+ }).catch((o) => {
223
+ console.error(o), r(o);
224
+ });
225
+ });
226
+ },
227
+ deleteSetting(t) {
228
+ return new Promise((n, s) => {
229
+ this.$clientSDK.deleteSetting(t).then((e) => {
230
+ this.set_settings({ path: t, data: e.data }), n(e);
231
+ }).catch((e) => {
232
+ console.error(e), s(e);
233
+ });
234
+ });
235
+ },
236
+ uploadAttachment(t, n) {
237
+ return new Promise((s, e) => {
238
+ this.$clientSDK.uploadAttachment(t, n).then((i) => {
239
+ s(i);
240
+ }).catch((i) => {
241
+ console.error(i), e(i);
242
+ });
243
+ });
244
+ },
245
+ testEmail(t) {
246
+ return new Promise((n, s) => {
247
+ this.$clientSDK.testEmail(t).then((e) => {
248
+ n(e);
249
+ }).catch((e) => {
250
+ console.error(e), s(e);
251
+ });
252
+ });
253
+ },
254
+ syncAccountGroupConfigs(t) {
255
+ return new Promise((n, s) => {
256
+ this.$clientSDK.syncAccountGroupConfigs(t).then((e) => {
257
+ this.set_settings({ path: ["trading_platforms", t], data: e.data }), n(e);
258
+ }).catch((e) => {
259
+ console.error(e), s(e);
260
+ });
261
+ });
262
+ },
263
+ syncSymbolConfigs(t) {
264
+ return new Promise((n, s) => {
265
+ this.$clientSDK.syncSymbolConfigs(t).then((e) => {
266
+ e.data != "processing" && this.set_settings({ path: ["trading_platforms", t], data: e.data }), n(e);
267
+ }).catch((e) => {
268
+ console.error(e), s(e);
269
+ });
270
+ });
271
+ },
272
+ getServerTimeOffset(t) {
273
+ return new Promise((n, s) => {
274
+ this.$clientSDK.getServerTimeOffset(t).then((e) => {
275
+ this.time_offset[t] = e.data, n(e);
276
+ }).catch((e) => {
277
+ console.error(e), s(e);
278
+ });
279
+ });
280
+ },
281
+ getMachineTranslation(t) {
282
+ return new Promise((n, s) => {
283
+ this.$clientSDK.getMachineTranslation(t).then((e) => {
284
+ n(e);
285
+ }).catch((e) => {
286
+ console.error(e), s(e);
287
+ });
288
+ });
289
+ },
290
+ getWidgetIframeSettings() {
291
+ return new Promise((t, n) => {
292
+ this.$clientSDK.getWidgetIframeSettings().then((s) => {
293
+ this.set_settings({ path: ["widget_iframe_settings"], data: s.data }), t(s);
294
+ }).catch((s) => {
295
+ console.error(s), n(s);
296
+ });
297
+ });
298
+ }
299
+ }
300
+ });
301
+ function m(t, n, s) {
302
+ n ? n <= 0 ? s(new Error("common.validate.nonpositive-deposit-amount-error")) : s() : s(new Error("common.validate.required_field"));
303
+ }
304
+ function f(t, n, s, e, i, r) {
305
+ n ? n < e ? s(new Error(r("common.validate.withdrawal-amount-minimum", { amount: e }))) : n > i ? s(new Error(r("common.validate.withdrawal-amount-maximum", { amount: i }))) : s() : s(new Error(r("common.validate.required_field")));
306
+ }
307
+ function p(t, n, s) {
308
+ n ? /^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.(?:[a-zA-Z]{2,})$/.test(n) ? s() : s(new Error("common.validate.email-format")) : s(new Error("common.validate.required-field"));
309
+ }
310
+ function _(t, n, s, e = (i) => i) {
311
+ const r = h().getEnabledPasswordRules.filter(
312
+ (o) => !o.is_optional
313
+ );
314
+ if (!d(n || "", r)) {
315
+ s(new Error(e("common.validate.invalid-password-format")));
316
+ return;
317
+ }
318
+ s();
319
+ }
320
+ const C = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
321
+ __proto__: null,
322
+ validateAmountRange: f,
323
+ validateEmail: p,
324
+ validateInputAmount: m,
325
+ validatePassBySettings: _
326
+ }, Symbol.toStringTag, { value: "Module" }));
327
+ export {
328
+ p as a,
329
+ f as b,
330
+ m as c,
331
+ _ as d,
332
+ h as u,
333
+ C as v
334
+ };