mantur-components 0.1.9 → 0.1.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +37 -1
- package/dist/api.d.ts +118 -1
- package/dist/header/ManturHeader.d.ts +1 -1
- package/dist/header/components/RechargeModal.d.ts +6 -3
- package/dist/header/components/StripePaymentModal.d.ts +12 -0
- package/dist/header/mock.d.ts +11 -15
- package/dist/index.d.ts +3 -1
- package/dist/mantur-components.js +1725 -508
- package/dist/mantur-components.umd.cjs +4 -1
- package/dist/types.d.ts +15 -0
- package/package.json +7 -2
|
@@ -1,53 +1,67 @@
|
|
|
1
|
-
import { useCallback as
|
|
2
|
-
import { Avatar as
|
|
3
|
-
import { IconCheckCircleFill as
|
|
4
|
-
import { useTranslation as
|
|
5
|
-
import { jsx as
|
|
6
|
-
import { useTheme as
|
|
1
|
+
import e, { useCallback as t, useEffect as n, useMemo as r, useRef as i, useState as a } from "react";
|
|
2
|
+
import { Alert as o, Avatar as s, Button as c, Card as l, DatePicker as u, Divider as d, Dropdown as f, Form as p, Grid as m, Input as h, Menu as g, Message as _, Modal as v, Pagination as y, Select as b, Spin as x, Table as S, Tabs as C, Tag as w, Typography as T, Upload as E } from "@arco-design/web-react";
|
|
3
|
+
import { IconCheckCircleFill as D, IconDown as O, IconEdit as k, IconFile as A, IconLanguage as j, IconMoonFill as M, IconPlus as N, IconPoweroff as P, IconSunFill as F, IconUpload as I } from "@arco-design/web-react/icon";
|
|
4
|
+
import { useTranslation as ee } from "react-i18next";
|
|
5
|
+
import { jsx as L, jsxs as R } from "react/jsx-runtime";
|
|
6
|
+
import { useTheme as te } from "next-themes";
|
|
7
7
|
//#region \0rolldown/runtime.js
|
|
8
|
-
var
|
|
9
|
-
if (t && typeof t == "object" || typeof t == "function") for (var i = V(t), a = 0, o = i.length, s; a < o; a++) s = i[a], !H.call(e, s) && s !== n &&
|
|
8
|
+
var z = Object.create, B = Object.defineProperty, ne = Object.getOwnPropertyDescriptor, V = Object.getOwnPropertyNames, re = Object.getPrototypeOf, H = Object.prototype.hasOwnProperty, U = (e, t) => () => (t || (e((t = { exports: {} }).exports, t), e = null), t.exports), W = (e, t, n, r) => {
|
|
9
|
+
if (t && typeof t == "object" || typeof t == "function") for (var i = V(t), a = 0, o = i.length, s; a < o; a++) s = i[a], !H.call(e, s) && s !== n && B(e, s, {
|
|
10
10
|
get: ((e) => t[e]).bind(null, s),
|
|
11
|
-
enumerable: !(r =
|
|
11
|
+
enumerable: !(r = ne(t, s)) || r.enumerable
|
|
12
12
|
});
|
|
13
13
|
return e;
|
|
14
|
-
},
|
|
14
|
+
}, ie = (e, t, n) => (n = e == null ? {} : z(re(e)), W(t || !e || !e.__esModule ? B(n, "default", {
|
|
15
15
|
value: e,
|
|
16
16
|
enumerable: !0
|
|
17
|
-
}) : n, e)),
|
|
18
|
-
function
|
|
19
|
-
return typeof window < "u" && window.__MANTUR_COMPONENTS_API_BASE__ ? window.__MANTUR_COMPONENTS_API_BASE__ :
|
|
17
|
+
}) : n, e)), G = "/api", ae = "/billing/accounts/me", oe = "mantur-points-refresh", se = "mantur-recharge-order-created", ce = "mantur-tenant-context-change";
|
|
18
|
+
function le() {
|
|
19
|
+
return typeof window < "u" && window.__MANTUR_COMPONENTS_API_BASE__ ? window.__MANTUR_COMPONENTS_API_BASE__ : G;
|
|
20
20
|
}
|
|
21
|
-
function
|
|
21
|
+
function ue() {
|
|
22
22
|
return typeof window < "u" && window.__MANTUR_COMPONENTS_POINTS_ENDPOINT__ ? window.__MANTUR_COMPONENTS_POINTS_ENDPOINT__ : ae;
|
|
23
23
|
}
|
|
24
|
-
function
|
|
24
|
+
function de(e) {
|
|
25
|
+
let t = new URLSearchParams();
|
|
26
|
+
Object.entries(e).forEach(([e, n]) => {
|
|
27
|
+
if (n !== void 0) {
|
|
28
|
+
if (Array.isArray(n)) {
|
|
29
|
+
n.length > 0 && t.set(e, n.join(","));
|
|
30
|
+
return;
|
|
31
|
+
}
|
|
32
|
+
t.set(e, String(n));
|
|
33
|
+
}
|
|
34
|
+
});
|
|
35
|
+
let n = t.toString();
|
|
36
|
+
return n ? `?${n}` : "";
|
|
37
|
+
}
|
|
38
|
+
function fe(e) {
|
|
25
39
|
if (typeof document > "u") return;
|
|
26
40
|
let t = `${encodeURIComponent(e)}=`;
|
|
27
41
|
return document.cookie.split("; ").find((e) => e.startsWith(t))?.slice(t.length);
|
|
28
42
|
}
|
|
29
|
-
function
|
|
43
|
+
function pe(e) {
|
|
30
44
|
if (typeof document > "u") return;
|
|
31
45
|
let t = encodeURIComponent(e), n = window.location.hostname, r = [void 0, n], i = n.split(".");
|
|
32
46
|
i.length >= 2 && r.push(`.${i.slice(-2).join(".")}`), r.forEach((e) => {
|
|
33
47
|
document.cookie = `${t}=; path=/; max-age=0${e ? `; domain=${e}` : ""}`;
|
|
34
48
|
});
|
|
35
49
|
}
|
|
36
|
-
function
|
|
50
|
+
function me(e) {
|
|
37
51
|
let t = JSON.parse(e || "null");
|
|
38
52
|
if (!t) throw Error("Request failed");
|
|
39
53
|
if (t.code !== 0) throw Error(t.message || "Request failed");
|
|
40
54
|
return t;
|
|
41
55
|
}
|
|
42
56
|
async function K(e, t = {}) {
|
|
43
|
-
let n =
|
|
57
|
+
let n = fe("front-token"), r = fe("Accept-Language"), i = t.headers || {};
|
|
44
58
|
return n && (i.Authorization = decodeURIComponent(n)), r && (i["Accept-Language"] = decodeURIComponent(r)), new Promise((n, r) => {
|
|
45
59
|
let a = new XMLHttpRequest();
|
|
46
|
-
a.open(t.method || "GET", `${
|
|
60
|
+
a.open(t.method || "GET", `${le()}${e}`, !0), a.timeout = t.timeout || 1e4, Object.entries(i).forEach(([e, t]) => {
|
|
47
61
|
a.setRequestHeader(e, t);
|
|
48
62
|
}), a.onload = () => {
|
|
49
63
|
try {
|
|
50
|
-
let e =
|
|
64
|
+
let e = me(a.responseText);
|
|
51
65
|
if (a.status < 200 || a.status >= 300) {
|
|
52
66
|
r(Error(e.message || a.statusText));
|
|
53
67
|
return;
|
|
@@ -59,16 +73,16 @@ async function K(e, t = {}) {
|
|
|
59
73
|
}, a.onerror = () => r(/* @__PURE__ */ Error("Network request failed")), a.ontimeout = () => r(/* @__PURE__ */ Error("Network request timed out")), a.send(t.body ?? null);
|
|
60
74
|
});
|
|
61
75
|
}
|
|
62
|
-
async function
|
|
76
|
+
async function he() {
|
|
63
77
|
try {
|
|
64
78
|
await K("/auth/front-logout", { method: "DELETE" });
|
|
65
79
|
} catch (e) {
|
|
66
80
|
console.warn("Logout request failed, continuing local logout.", e);
|
|
67
81
|
} finally {
|
|
68
|
-
|
|
82
|
+
pe("front-token"), pe("refreshToken"), typeof window < "u" && window.location.reload();
|
|
69
83
|
}
|
|
70
84
|
}
|
|
71
|
-
async function
|
|
85
|
+
async function ge(e) {
|
|
72
86
|
let t;
|
|
73
87
|
if (e.avatarFile) {
|
|
74
88
|
let n = new FormData();
|
|
@@ -83,25 +97,57 @@ async function de(e) {
|
|
|
83
97
|
body: JSON.stringify({ nickname: e.nickname })
|
|
84
98
|
})).data || t;
|
|
85
99
|
}
|
|
86
|
-
function
|
|
100
|
+
function _e(e) {
|
|
87
101
|
let t = (...t) => {
|
|
88
102
|
let n = t.map((t) => e?.[t]).find((e) => e !== void 0);
|
|
89
103
|
return typeof n == "number" ? n : Number(n || 0);
|
|
90
104
|
};
|
|
91
105
|
return {
|
|
92
|
-
total: t("total", "totalPoints", "balance", "points"),
|
|
93
|
-
recharge: t("recharge", "rechargePoints", "paidPoints"),
|
|
94
|
-
gifted: t("gifted", "giftedPoints", "bonusPoints")
|
|
106
|
+
total: t("total", "totalPoints", "totalBalance", "balance", "points"),
|
|
107
|
+
recharge: t("recharge", "rechargePoints", "rechargeBalance", "paidPoints"),
|
|
108
|
+
gifted: t("gifted", "giftedPoints", "giftBalance", "bonusPoints")
|
|
95
109
|
};
|
|
96
110
|
}
|
|
97
|
-
async function
|
|
98
|
-
return
|
|
111
|
+
async function ve() {
|
|
112
|
+
return _e((await K(ue())).data);
|
|
113
|
+
}
|
|
114
|
+
async function ye() {
|
|
115
|
+
let e = await ve();
|
|
116
|
+
return typeof window < "u" && window.dispatchEvent(new CustomEvent(oe, { detail: e })), e;
|
|
117
|
+
}
|
|
118
|
+
async function be() {
|
|
119
|
+
return (await K("/billing/packages")).data || [];
|
|
99
120
|
}
|
|
100
|
-
async function
|
|
101
|
-
|
|
102
|
-
|
|
121
|
+
async function xe(e) {
|
|
122
|
+
return (await K("/billing/recharge/orders", {
|
|
123
|
+
method: "POST",
|
|
124
|
+
headers: { "Content-Type": "application/json;charset=utf-8" },
|
|
125
|
+
body: JSON.stringify(e)
|
|
126
|
+
})).data;
|
|
127
|
+
}
|
|
128
|
+
async function Se(e) {
|
|
129
|
+
return (await K(`/billing/recharge/orders/${encodeURIComponent(e)}`)).data;
|
|
130
|
+
}
|
|
131
|
+
async function Ce() {
|
|
132
|
+
return (await K("/billing/pricing/charge-points")).data || [];
|
|
133
|
+
}
|
|
134
|
+
async function we(e) {
|
|
135
|
+
return (await K(`/billing/pricing/charge-points/${encodeURIComponent(e)}`)).data;
|
|
103
136
|
}
|
|
104
|
-
function
|
|
137
|
+
async function Te() {
|
|
138
|
+
return (await K("/billing/accounts/me")).data;
|
|
139
|
+
}
|
|
140
|
+
async function Ee(e) {
|
|
141
|
+
return (await K(`/billing/accounts/me/ledger${de({
|
|
142
|
+
pageNum: e.pageNum,
|
|
143
|
+
pageSize: e.pageSize,
|
|
144
|
+
directions: e.directions,
|
|
145
|
+
bizTypes: e.bizTypes,
|
|
146
|
+
fromTime: e.fromTime,
|
|
147
|
+
toTime: e.toTime
|
|
148
|
+
})}`)).data || { records: [] };
|
|
149
|
+
}
|
|
150
|
+
function De(e, t) {
|
|
105
151
|
return t?.tenantId ? e.find((e) => e.tenantId === t.tenantId) || {
|
|
106
152
|
tenantId: t.tenantId,
|
|
107
153
|
tenantName: t.tenantName || t.tenantId,
|
|
@@ -111,37 +157,37 @@ function he(e, t) {
|
|
|
111
157
|
}))
|
|
112
158
|
} : e.find((e) => e.isOwner) || e[0];
|
|
113
159
|
}
|
|
114
|
-
function
|
|
115
|
-
typeof window < "u" && (window.__MANTUR_COMPONENTS_TENANT_CONTEXT__ = e, window.dispatchEvent(new CustomEvent(
|
|
160
|
+
function Oe(e) {
|
|
161
|
+
typeof window < "u" && (window.__MANTUR_COMPONENTS_TENANT_CONTEXT__ = e, window.dispatchEvent(new CustomEvent(ce, { detail: e })));
|
|
116
162
|
}
|
|
117
|
-
async function
|
|
163
|
+
async function ke() {
|
|
118
164
|
return (await K("/users/me/tenants")).data || [];
|
|
119
165
|
}
|
|
120
|
-
async function
|
|
166
|
+
async function Ae() {
|
|
121
167
|
return (await K("/auth/current-tenant")).data;
|
|
122
168
|
}
|
|
123
|
-
async function
|
|
169
|
+
async function je(e) {
|
|
124
170
|
return (await K(`/auth/current-tenant/${e}`, { method: "PUT" })).data;
|
|
125
171
|
}
|
|
126
|
-
async function
|
|
127
|
-
let [t, n] = await Promise.all([
|
|
172
|
+
async function Me(e = "refresh") {
|
|
173
|
+
let [t, n] = await Promise.all([ke(), Ae()]), r = {
|
|
128
174
|
tenants: t,
|
|
129
|
-
currentTenant:
|
|
175
|
+
currentTenant: De(t, n),
|
|
130
176
|
auth: n,
|
|
131
177
|
reason: e
|
|
132
178
|
};
|
|
133
|
-
return
|
|
179
|
+
return Oe(r), r;
|
|
134
180
|
}
|
|
135
|
-
async function
|
|
136
|
-
let t = await
|
|
181
|
+
async function Ne(e) {
|
|
182
|
+
let t = await je(e), n = await ke(), r = {
|
|
137
183
|
tenants: n,
|
|
138
|
-
currentTenant:
|
|
184
|
+
currentTenant: De(n, t),
|
|
139
185
|
auth: t,
|
|
140
186
|
reason: "switch"
|
|
141
187
|
};
|
|
142
|
-
return
|
|
188
|
+
return Oe(r), r;
|
|
143
189
|
}
|
|
144
|
-
var
|
|
190
|
+
var Pe = {
|
|
145
191
|
title: "Mantur",
|
|
146
192
|
switchTeam: "Switch Team",
|
|
147
193
|
personalSettings: "Personal Settings",
|
|
@@ -178,6 +224,17 @@ var xe = {
|
|
|
178
224
|
rechargeHint: "Recharge points are valid for 2 years after arrival.",
|
|
179
225
|
payNow: "Pay Now",
|
|
180
226
|
rechargeSuccess: "Recharge successful",
|
|
227
|
+
rechargeOrderCreated: "Recharge order created. Continue to complete payment.",
|
|
228
|
+
stripePaymentTitle: "Stripe Payment",
|
|
229
|
+
stripePaymentDescription: "Complete card payment. Points will be credited automatically after payment succeeds.",
|
|
230
|
+
stripePay: "Confirm Payment",
|
|
231
|
+
stripePaymentLoading: "Loading Stripe payment...",
|
|
232
|
+
stripePaymentConfigMissing: "Stripe publishable key is not configured",
|
|
233
|
+
stripePaymentClientSecretMissing: "Stripe payment credential is missing from the order",
|
|
234
|
+
stripeCheckoutClientSecretInvalid: "Invalid Stripe payment credential. The backend must return a Checkout Session client_secret that starts with cs_.",
|
|
235
|
+
stripePaymentProcessing: "Payment is processing. Please refresh points later.",
|
|
236
|
+
stripePaymentFailed: "Payment failed. Please try again.",
|
|
237
|
+
stripePaymentLoadFailed: "Failed to load Stripe payment. Please refresh and try again.",
|
|
181
238
|
customRechargeAmount: "Custom Amount",
|
|
182
239
|
customRechargeDescription: "Enter the recharge amount you need. Minimum $10 USD.",
|
|
183
240
|
customRechargeMinError: "Minimum recharge is $10 USD",
|
|
@@ -200,10 +257,10 @@ var xe = {
|
|
|
200
257
|
pointsDeductionTip: "Points expiring soon are deducted first.",
|
|
201
258
|
pointsNoteTitle: "Note",
|
|
202
259
|
pointsAccountNote: "Points are attached to your personal account. You recharge, consume, and manage them yourself. Others cannot recharge or use them for you. Recharge points are valid for 2 years; gifted points follow the validity set by operations."
|
|
203
|
-
},
|
|
260
|
+
}, Fe = {
|
|
204
261
|
languageZh: "中文",
|
|
205
262
|
languageEn: "English"
|
|
206
|
-
},
|
|
263
|
+
}, Ie = {
|
|
207
264
|
title: "漫途",
|
|
208
265
|
switchTeam: "切换团队",
|
|
209
266
|
personalSettings: "个人设置",
|
|
@@ -240,6 +297,17 @@ var xe = {
|
|
|
240
297
|
rechargeHint: "充值积分有效期 2 年(自到账日起算),支付后不可退换。",
|
|
241
298
|
payNow: "立即支付",
|
|
242
299
|
rechargeSuccess: "充值成功",
|
|
300
|
+
rechargeOrderCreated: "充值订单已创建,请继续完成支付",
|
|
301
|
+
stripePaymentTitle: "Stripe 支付",
|
|
302
|
+
stripePaymentDescription: "请完成银行卡支付,支付成功后积分将自动到账。",
|
|
303
|
+
stripePay: "确认支付",
|
|
304
|
+
stripePaymentLoading: "正在加载 Stripe 支付组件...",
|
|
305
|
+
stripePaymentConfigMissing: "Stripe publishable key 未配置",
|
|
306
|
+
stripePaymentClientSecretMissing: "订单缺少 Stripe 支付凭证",
|
|
307
|
+
stripeCheckoutClientSecretInvalid: "Stripe 支付凭证类型不正确,请后端返回 Checkout Session 的 client_secret(cs_ 开头)",
|
|
308
|
+
stripePaymentProcessing: "支付处理中,请稍后刷新积分",
|
|
309
|
+
stripePaymentFailed: "支付失败,请重试",
|
|
310
|
+
stripePaymentLoadFailed: "Stripe 支付组件加载失败,请刷新后重试",
|
|
243
311
|
customRechargeAmount: "自定义金额",
|
|
244
312
|
customRechargeDescription: "按需输入充值金额,最低 $10 USD 起充",
|
|
245
313
|
customRechargeMinError: "最低充值 $10 USD",
|
|
@@ -262,62 +330,62 @@ var xe = {
|
|
|
262
330
|
pointsDeductionTip: "优先扣减即将到期的积分",
|
|
263
331
|
pointsNoteTitle: "说明",
|
|
264
332
|
pointsAccountNote: "积分账户挂在你的个人账号上,自己充值、自己消耗、自己负责;他人不能代充、不能代用。充值积分有效期固定 2 年;赠送积分有效期由后台运营发放时设置。"
|
|
265
|
-
},
|
|
333
|
+
}, Le = {
|
|
266
334
|
languageZh: "中文",
|
|
267
335
|
languageEn: "English"
|
|
268
|
-
},
|
|
336
|
+
}, Re = "i18nextLng", ze = "manturLanguageSource", Be = "mantur-language-change", Ve = {
|
|
269
337
|
"zh-CN": {
|
|
270
|
-
...
|
|
271
|
-
...
|
|
338
|
+
...Ie,
|
|
339
|
+
...Le
|
|
272
340
|
},
|
|
273
341
|
"en-US": {
|
|
274
|
-
...
|
|
275
|
-
...
|
|
342
|
+
...Pe,
|
|
343
|
+
...Fe
|
|
276
344
|
}
|
|
277
345
|
};
|
|
278
|
-
function
|
|
346
|
+
function q(e) {
|
|
279
347
|
return e?.toLowerCase().startsWith("en") ? "en-US" : "zh-CN";
|
|
280
348
|
}
|
|
281
|
-
function
|
|
282
|
-
return typeof window > "u" ? "zh-CN" :
|
|
349
|
+
function He() {
|
|
350
|
+
return typeof window > "u" ? "zh-CN" : q(window.localStorage.getItem("i18nextLng") || document.documentElement.lang || navigator.language);
|
|
283
351
|
}
|
|
284
|
-
function
|
|
285
|
-
return
|
|
352
|
+
function Ue(e) {
|
|
353
|
+
return Ve[q(e)];
|
|
286
354
|
}
|
|
287
355
|
//#endregion
|
|
288
356
|
//#region src/lang-switch/LangSwitch.tsx
|
|
289
|
-
var
|
|
290
|
-
function
|
|
357
|
+
var We = Re, Ge = ze;
|
|
358
|
+
function Ke(e, t) {
|
|
291
359
|
document.cookie = `${encodeURIComponent(e)}=${encodeURIComponent(t)}; path=/`;
|
|
292
360
|
}
|
|
293
|
-
function
|
|
294
|
-
let { i18n: e } =
|
|
295
|
-
return
|
|
296
|
-
r(
|
|
297
|
-
}, [e.language]), /* @__PURE__ */
|
|
298
|
-
droplist: /* @__PURE__ */
|
|
299
|
-
selectedKeys: [
|
|
361
|
+
function qe() {
|
|
362
|
+
let { i18n: e } = ee(), [t, r] = a(() => He()), i = Ue(t);
|
|
363
|
+
return n(() => {
|
|
364
|
+
r(q(e.language));
|
|
365
|
+
}, [e.language]), /* @__PURE__ */ L(f, {
|
|
366
|
+
droplist: /* @__PURE__ */ R(g, {
|
|
367
|
+
selectedKeys: [t],
|
|
300
368
|
onClickMenuItem: (t) => {
|
|
301
|
-
let n =
|
|
302
|
-
localStorage.setItem(
|
|
369
|
+
let n = q(t);
|
|
370
|
+
localStorage.setItem(We, t), localStorage.setItem(Ge, "manual"), r(n), e.changeLanguage(t), Ke("Accept-Language", t), window.dispatchEvent(new CustomEvent(Be, { detail: n })), window.location.reload();
|
|
303
371
|
},
|
|
304
|
-
children: [/* @__PURE__ */
|
|
372
|
+
children: [/* @__PURE__ */ L(g.Item, { children: i.languageZh }, "zh-CN"), /* @__PURE__ */ L(g.Item, { children: i.languageEn }, "en-US")]
|
|
305
373
|
}),
|
|
306
374
|
trigger: "click",
|
|
307
375
|
position: "br",
|
|
308
|
-
children: /* @__PURE__ */
|
|
376
|
+
children: /* @__PURE__ */ L(c, {
|
|
309
377
|
shape: "circle",
|
|
310
|
-
icon: /* @__PURE__ */
|
|
378
|
+
icon: /* @__PURE__ */ L(j, {})
|
|
311
379
|
})
|
|
312
380
|
});
|
|
313
381
|
}
|
|
314
382
|
//#endregion
|
|
315
383
|
//#region src/theme-switch/ThemeSwitch.tsx
|
|
316
|
-
function
|
|
317
|
-
let { resolvedTheme: e, setTheme: t } =
|
|
318
|
-
return /* @__PURE__ */
|
|
384
|
+
function Je() {
|
|
385
|
+
let { resolvedTheme: e, setTheme: t } = te();
|
|
386
|
+
return /* @__PURE__ */ L(c, {
|
|
319
387
|
shape: "circle",
|
|
320
|
-
icon:
|
|
388
|
+
icon: L(e === "light" ? M : F, {}),
|
|
321
389
|
onClick: () => {
|
|
322
390
|
t(e === "light" ? "dark" : "light");
|
|
323
391
|
}
|
|
@@ -325,7 +393,7 @@ function Ne() {
|
|
|
325
393
|
}
|
|
326
394
|
//#endregion
|
|
327
395
|
//#region src/header/mock.ts
|
|
328
|
-
var
|
|
396
|
+
var Ye = [
|
|
329
397
|
{
|
|
330
398
|
id: "points-500",
|
|
331
399
|
points: 500,
|
|
@@ -342,7 +410,7 @@ var Z = [
|
|
|
342
410
|
price: 50,
|
|
343
411
|
recommended: !0
|
|
344
412
|
}
|
|
345
|
-
],
|
|
413
|
+
], Xe = [
|
|
346
414
|
{
|
|
347
415
|
id: "recharge-1",
|
|
348
416
|
type: "income",
|
|
@@ -415,31 +483,31 @@ var Z = [
|
|
|
415
483
|
badgeKind: "deducted",
|
|
416
484
|
badgeText: "已扣除"
|
|
417
485
|
}
|
|
418
|
-
], { RangePicker:
|
|
419
|
-
function
|
|
486
|
+
], { RangePicker: Ze } = u, Qe = 21, $e = 7;
|
|
487
|
+
function et(e) {
|
|
420
488
|
return e === "recharge" ? "arcoblue" : e === "gift" ? "cyan" : e === "expired" ? "gray" : "orange";
|
|
421
489
|
}
|
|
422
|
-
function
|
|
423
|
-
let [
|
|
424
|
-
let [e, t] =
|
|
425
|
-
return
|
|
426
|
-
let r =
|
|
490
|
+
function tt({ visible: e, points: t, text: n, onCancel: i, onRecharge: o }) {
|
|
491
|
+
let [s, u] = a("all"), [d, f] = a("all"), [p, h] = a(["2026-04-15", "2026-05-15"]), [g, x] = a(1), E = (e) => new Intl.NumberFormat().format(e), D = r(() => {
|
|
492
|
+
let [e, t] = p;
|
|
493
|
+
return Xe.filter((n) => {
|
|
494
|
+
let r = s === "all" || n.type === s, i = d === "all" || n.source === d, a = !e || n.date >= e, o = !t || n.date <= t;
|
|
427
495
|
return r && i && a && o;
|
|
428
496
|
});
|
|
429
497
|
}, [
|
|
430
|
-
|
|
498
|
+
p,
|
|
431
499
|
d,
|
|
432
|
-
|
|
500
|
+
s
|
|
433
501
|
]), O = [
|
|
434
502
|
{
|
|
435
|
-
title:
|
|
503
|
+
title: n.pointsDetail,
|
|
436
504
|
dataIndex: "name",
|
|
437
|
-
render: (e, t) => /* @__PURE__ */
|
|
505
|
+
render: (e, t) => /* @__PURE__ */ R("div", {
|
|
438
506
|
className: "min-w-0",
|
|
439
|
-
children: [/* @__PURE__ */
|
|
507
|
+
children: [/* @__PURE__ */ L(T.Text, {
|
|
440
508
|
className: "font-medium!",
|
|
441
509
|
children: t.name
|
|
442
|
-
}), /* @__PURE__ */
|
|
510
|
+
}), /* @__PURE__ */ L(T.Text, {
|
|
443
511
|
type: "secondary",
|
|
444
512
|
className: "mt-1 block! text-xs!",
|
|
445
513
|
children: t.meta
|
|
@@ -447,188 +515,188 @@ function ze({ visible: e, points: t, text: r, onCancel: a, onRecharge: c }) {
|
|
|
447
515
|
})
|
|
448
516
|
},
|
|
449
517
|
{
|
|
450
|
-
title:
|
|
518
|
+
title: n.pointsUnit,
|
|
451
519
|
dataIndex: "amount",
|
|
452
520
|
width: 120,
|
|
453
521
|
align: "right",
|
|
454
|
-
render: (e, t) => /* @__PURE__ */
|
|
522
|
+
render: (e, t) => /* @__PURE__ */ R(T.Text, {
|
|
455
523
|
className: `font-semibold! ${t.amount > 0 ? "text-arco-success-6!" : "text-arco-danger-6!"}`,
|
|
456
524
|
children: [t.amount > 0 ? "+" : "", E(t.amount)]
|
|
457
525
|
})
|
|
458
526
|
},
|
|
459
527
|
{
|
|
460
|
-
title:
|
|
528
|
+
title: n.source,
|
|
461
529
|
dataIndex: "badgeText",
|
|
462
530
|
width: 110,
|
|
463
531
|
align: "right",
|
|
464
|
-
render: (e, t) => /* @__PURE__ */
|
|
465
|
-
color:
|
|
532
|
+
render: (e, t) => /* @__PURE__ */ L(w, {
|
|
533
|
+
color: et(t.badgeKind),
|
|
466
534
|
children: t.badgeText
|
|
467
535
|
})
|
|
468
536
|
}
|
|
469
537
|
];
|
|
470
|
-
return /* @__PURE__ */
|
|
471
|
-
title:
|
|
538
|
+
return /* @__PURE__ */ L(v, {
|
|
539
|
+
title: n.pointsDetail,
|
|
472
540
|
visible: e,
|
|
473
|
-
footer: /* @__PURE__ */
|
|
541
|
+
footer: /* @__PURE__ */ R("div", {
|
|
474
542
|
className: "flex justify-end gap-2",
|
|
475
|
-
children: [/* @__PURE__ */
|
|
476
|
-
onClick:
|
|
477
|
-
children:
|
|
478
|
-
}), /* @__PURE__ */
|
|
543
|
+
children: [/* @__PURE__ */ L(c, {
|
|
544
|
+
onClick: i,
|
|
545
|
+
children: n.close
|
|
546
|
+
}), /* @__PURE__ */ L(c, {
|
|
479
547
|
type: "primary",
|
|
480
|
-
icon: /* @__PURE__ */
|
|
548
|
+
icon: /* @__PURE__ */ L(N, {}),
|
|
481
549
|
onClick: () => {
|
|
482
|
-
|
|
550
|
+
i(), o();
|
|
483
551
|
},
|
|
484
|
-
children:
|
|
552
|
+
children: n.recharge
|
|
485
553
|
})]
|
|
486
554
|
}),
|
|
487
|
-
onCancel:
|
|
555
|
+
onCancel: i,
|
|
488
556
|
style: {
|
|
489
557
|
width: 780,
|
|
490
558
|
maxWidth: "calc(100vw - 48px)"
|
|
491
559
|
},
|
|
492
|
-
children: /* @__PURE__ */
|
|
560
|
+
children: /* @__PURE__ */ R("div", {
|
|
493
561
|
className: "max-h-[70vh] overflow-y-auto",
|
|
494
562
|
children: [
|
|
495
|
-
/* @__PURE__ */
|
|
563
|
+
/* @__PURE__ */ R(l, {
|
|
496
564
|
bordered: !1,
|
|
497
565
|
className: "from-arco-primary-light-1/40 to-cyan-400/5 rounded-none! bg-linear-to-br!",
|
|
498
566
|
children: [
|
|
499
|
-
/* @__PURE__ */
|
|
567
|
+
/* @__PURE__ */ L(T.Text, {
|
|
500
568
|
type: "secondary",
|
|
501
569
|
className: "text-xs!",
|
|
502
|
-
children:
|
|
570
|
+
children: n.totalBalance
|
|
503
571
|
}),
|
|
504
|
-
/* @__PURE__ */
|
|
572
|
+
/* @__PURE__ */ R("div", {
|
|
505
573
|
className: "mt-1.5 mb-3.5 ",
|
|
506
|
-
children: [/* @__PURE__ */
|
|
574
|
+
children: [/* @__PURE__ */ L(T.Text, {
|
|
507
575
|
className: "text-3xl! font-bold!",
|
|
508
576
|
children: E(t.total)
|
|
509
|
-
}), /* @__PURE__ */
|
|
577
|
+
}), /* @__PURE__ */ R(T.Text, {
|
|
510
578
|
type: "secondary",
|
|
511
579
|
className: "ml-2 text-sm! ",
|
|
512
|
-
children: ["🪙 ",
|
|
580
|
+
children: ["🪙 ", n.pointsUnit]
|
|
513
581
|
})]
|
|
514
582
|
}),
|
|
515
|
-
/* @__PURE__ */
|
|
583
|
+
/* @__PURE__ */ R(m.Row, {
|
|
516
584
|
gutter: 12,
|
|
517
|
-
children: [/* @__PURE__ */
|
|
585
|
+
children: [/* @__PURE__ */ L(m.Col, {
|
|
518
586
|
span: 12,
|
|
519
|
-
children: /* @__PURE__ */
|
|
587
|
+
children: /* @__PURE__ */ R(l, {
|
|
520
588
|
size: "small",
|
|
521
|
-
children: [/* @__PURE__ */
|
|
589
|
+
children: [/* @__PURE__ */ R("div", {
|
|
522
590
|
className: "mb-1 flex items-center justify-between",
|
|
523
|
-
children: [/* @__PURE__ */
|
|
591
|
+
children: [/* @__PURE__ */ L(T.Text, {
|
|
524
592
|
type: "secondary",
|
|
525
593
|
className: "text-xs!",
|
|
526
|
-
children:
|
|
527
|
-
}), /* @__PURE__ */
|
|
594
|
+
children: n.rechargePoints
|
|
595
|
+
}), /* @__PURE__ */ L(w, {
|
|
528
596
|
color: "arcoblue",
|
|
529
|
-
children:
|
|
597
|
+
children: n.sourceRecharge
|
|
530
598
|
})]
|
|
531
|
-
}), /* @__PURE__ */
|
|
599
|
+
}), /* @__PURE__ */ L(T.Text, {
|
|
532
600
|
className: "text-lg! font-semibold!",
|
|
533
601
|
children: E(t.recharge)
|
|
534
602
|
})]
|
|
535
603
|
})
|
|
536
|
-
}), /* @__PURE__ */
|
|
604
|
+
}), /* @__PURE__ */ L(m.Col, {
|
|
537
605
|
span: 12,
|
|
538
|
-
children: /* @__PURE__ */
|
|
606
|
+
children: /* @__PURE__ */ R(l, {
|
|
539
607
|
size: "small",
|
|
540
|
-
children: [/* @__PURE__ */
|
|
608
|
+
children: [/* @__PURE__ */ R("div", {
|
|
541
609
|
className: "mb-1 flex items-center justify-between",
|
|
542
|
-
children: [/* @__PURE__ */
|
|
610
|
+
children: [/* @__PURE__ */ L(T.Text, {
|
|
543
611
|
type: "secondary",
|
|
544
612
|
className: "text-xs!",
|
|
545
|
-
children:
|
|
546
|
-
}), /* @__PURE__ */
|
|
613
|
+
children: n.giftedPoints
|
|
614
|
+
}), /* @__PURE__ */ L(w, {
|
|
547
615
|
color: "success",
|
|
548
|
-
children:
|
|
616
|
+
children: n.sourceGifted
|
|
549
617
|
})]
|
|
550
|
-
}), /* @__PURE__ */
|
|
618
|
+
}), /* @__PURE__ */ L(T.Text, {
|
|
551
619
|
className: "text-lg! font-semibold!",
|
|
552
620
|
children: E(t.gifted)
|
|
553
621
|
})]
|
|
554
622
|
})
|
|
555
623
|
})]
|
|
556
624
|
}),
|
|
557
|
-
/* @__PURE__ */
|
|
625
|
+
/* @__PURE__ */ L(T.Text, {
|
|
558
626
|
type: "secondary",
|
|
559
627
|
className: "mt-2.5 block! text-xs!",
|
|
560
|
-
children:
|
|
628
|
+
children: n.pointsDeductionTip
|
|
561
629
|
})
|
|
562
630
|
]
|
|
563
631
|
}),
|
|
564
|
-
/* @__PURE__ */
|
|
632
|
+
/* @__PURE__ */ R("div", {
|
|
565
633
|
className: "px-6 py-4",
|
|
566
634
|
children: [
|
|
567
|
-
/* @__PURE__ */
|
|
568
|
-
activeTab:
|
|
635
|
+
/* @__PURE__ */ R(C, {
|
|
636
|
+
activeTab: s,
|
|
569
637
|
onChange: (e) => u(e),
|
|
570
638
|
children: [
|
|
571
|
-
/* @__PURE__ */
|
|
572
|
-
/* @__PURE__ */
|
|
573
|
-
/* @__PURE__ */
|
|
639
|
+
/* @__PURE__ */ L(C.TabPane, { title: n.all }, "all"),
|
|
640
|
+
/* @__PURE__ */ L(C.TabPane, { title: n.income }, "income"),
|
|
641
|
+
/* @__PURE__ */ L(C.TabPane, { title: n.expense }, "expense")
|
|
574
642
|
]
|
|
575
643
|
}),
|
|
576
|
-
/* @__PURE__ */
|
|
644
|
+
/* @__PURE__ */ R("div", {
|
|
577
645
|
className: "mt-2 mb-3.5 flex flex-wrap items-center gap-2.5",
|
|
578
646
|
children: [
|
|
579
|
-
/* @__PURE__ */
|
|
647
|
+
/* @__PURE__ */ R(b, {
|
|
580
648
|
value: d,
|
|
581
649
|
style: { width: 140 },
|
|
582
|
-
onChange: (e) =>
|
|
650
|
+
onChange: (e) => f(e),
|
|
583
651
|
children: [
|
|
584
|
-
/* @__PURE__ */
|
|
652
|
+
/* @__PURE__ */ L(b.Option, {
|
|
585
653
|
value: "all",
|
|
586
|
-
children:
|
|
654
|
+
children: n.sourceAll
|
|
587
655
|
}),
|
|
588
|
-
/* @__PURE__ */
|
|
656
|
+
/* @__PURE__ */ L(b.Option, {
|
|
589
657
|
value: "recharge",
|
|
590
|
-
children:
|
|
658
|
+
children: n.sourceRecharge
|
|
591
659
|
}),
|
|
592
|
-
/* @__PURE__ */
|
|
660
|
+
/* @__PURE__ */ L(b.Option, {
|
|
593
661
|
value: "gift",
|
|
594
|
-
children:
|
|
662
|
+
children: n.sourceGifted
|
|
595
663
|
})
|
|
596
664
|
]
|
|
597
665
|
}),
|
|
598
|
-
/* @__PURE__ */
|
|
599
|
-
value:
|
|
600
|
-
onChange: (e) =>
|
|
666
|
+
/* @__PURE__ */ L(Ze, {
|
|
667
|
+
value: p,
|
|
668
|
+
onChange: (e) => h(e),
|
|
601
669
|
style: { width: 260 }
|
|
602
670
|
}),
|
|
603
|
-
/* @__PURE__ */
|
|
604
|
-
onClick: () =>
|
|
605
|
-
children:
|
|
671
|
+
/* @__PURE__ */ L(c, {
|
|
672
|
+
onClick: () => _.success(n.refreshed),
|
|
673
|
+
children: n.query
|
|
606
674
|
})
|
|
607
675
|
]
|
|
608
676
|
}),
|
|
609
|
-
/* @__PURE__ */
|
|
677
|
+
/* @__PURE__ */ L(S, {
|
|
610
678
|
rowKey: "id",
|
|
611
679
|
columns: O,
|
|
612
680
|
data: D,
|
|
613
681
|
pagination: !1,
|
|
614
682
|
border: !1
|
|
615
683
|
}),
|
|
616
|
-
/* @__PURE__ */
|
|
684
|
+
/* @__PURE__ */ L(y, {
|
|
617
685
|
className: "mt-3 flex justify-center!",
|
|
618
|
-
current:
|
|
619
|
-
pageSize:
|
|
620
|
-
total:
|
|
621
|
-
onChange:
|
|
686
|
+
current: g,
|
|
687
|
+
pageSize: $e,
|
|
688
|
+
total: Qe,
|
|
689
|
+
onChange: x
|
|
622
690
|
})
|
|
623
691
|
]
|
|
624
692
|
}),
|
|
625
|
-
/* @__PURE__ */
|
|
693
|
+
/* @__PURE__ */ L(l, {
|
|
626
694
|
bordered: !1,
|
|
627
695
|
className: "bg-arco-primary-light-1/30 rounded-none!",
|
|
628
|
-
children: /* @__PURE__ */
|
|
696
|
+
children: /* @__PURE__ */ R(T.Text, {
|
|
629
697
|
type: "secondary",
|
|
630
698
|
className: "text-xs! leading-6!",
|
|
631
|
-
children: [/* @__PURE__ */
|
|
699
|
+
children: [/* @__PURE__ */ R("strong", { children: [n.pointsNoteTitle, ":"] }), n.pointsAccountNote]
|
|
632
700
|
})
|
|
633
701
|
})
|
|
634
702
|
]
|
|
@@ -637,17 +705,17 @@ function ze({ visible: e, points: t, text: r, onCancel: a, onRecharge: c }) {
|
|
|
637
705
|
}
|
|
638
706
|
//#endregion
|
|
639
707
|
//#region src/labels.ts
|
|
640
|
-
var
|
|
641
|
-
function
|
|
708
|
+
var nt = Pe;
|
|
709
|
+
function rt(e) {
|
|
642
710
|
return {
|
|
643
|
-
...
|
|
711
|
+
...nt,
|
|
644
712
|
...e
|
|
645
713
|
};
|
|
646
714
|
}
|
|
647
715
|
//#endregion
|
|
648
716
|
//#region src/header/components/ProfileModal.tsx
|
|
649
|
-
var
|
|
650
|
-
function
|
|
717
|
+
var it = 2048, at = 2 * 1024 * 1024;
|
|
718
|
+
function ot(e) {
|
|
651
719
|
return new Promise((t, n) => {
|
|
652
720
|
let r = URL.createObjectURL(e), i = new Image();
|
|
653
721
|
i.onload = () => {
|
|
@@ -660,80 +728,80 @@ function We(e) {
|
|
|
660
728
|
}, i.src = r;
|
|
661
729
|
});
|
|
662
730
|
}
|
|
663
|
-
function
|
|
664
|
-
let u =
|
|
665
|
-
|
|
731
|
+
function st({ visible: e, user: t, labels: r, onCancel: o, onSubmit: l }) {
|
|
732
|
+
let u = rt(r), [d] = p.useForm(), [f, m] = a(!1), [g, y] = a(null), [b, x] = a(null), S = i(null);
|
|
733
|
+
n(() => () => {
|
|
666
734
|
S.current &&= (URL.revokeObjectURL(S.current), null);
|
|
667
|
-
}, []),
|
|
668
|
-
e && (
|
|
735
|
+
}, []), n(() => {
|
|
736
|
+
e && (d.setFieldsValue({ nickname: t?.nickname || t?.username || "" }), y(null), x((e) => (e && URL.revokeObjectURL(e), S.current = null, null)));
|
|
669
737
|
}, [
|
|
670
738
|
e,
|
|
671
|
-
|
|
672
|
-
|
|
739
|
+
t,
|
|
740
|
+
d
|
|
673
741
|
]);
|
|
674
|
-
let
|
|
675
|
-
console.error(t),
|
|
676
|
-
},
|
|
677
|
-
|
|
742
|
+
let C = (e, t) => {
|
|
743
|
+
console.error(t), _.error(e);
|
|
744
|
+
}, w = (e) => {
|
|
745
|
+
_.success(e);
|
|
678
746
|
};
|
|
679
|
-
return /* @__PURE__ */
|
|
747
|
+
return /* @__PURE__ */ L(v, {
|
|
680
748
|
title: u.profileTitle,
|
|
681
749
|
visible: e,
|
|
682
750
|
onOk: async () => {
|
|
683
751
|
try {
|
|
684
|
-
let e = await
|
|
685
|
-
|
|
752
|
+
let e = await d.validate();
|
|
753
|
+
m(!0), await l({
|
|
686
754
|
nickname: e.nickname,
|
|
687
|
-
avatarFile:
|
|
688
|
-
}),
|
|
755
|
+
avatarFile: g
|
|
756
|
+
}), w(u.profileUpdateSuccess), o();
|
|
689
757
|
} catch (e) {
|
|
690
|
-
e instanceof Error &&
|
|
758
|
+
e instanceof Error && C(e.message || u.error, e);
|
|
691
759
|
} finally {
|
|
692
|
-
|
|
760
|
+
m(!1);
|
|
693
761
|
}
|
|
694
762
|
},
|
|
695
|
-
onCancel:
|
|
696
|
-
confirmLoading:
|
|
763
|
+
onCancel: o,
|
|
764
|
+
confirmLoading: f,
|
|
697
765
|
okText: u.profileSave,
|
|
698
766
|
cancelText: u.profileCancel,
|
|
699
|
-
children: /* @__PURE__ */
|
|
700
|
-
form:
|
|
767
|
+
children: /* @__PURE__ */ R(p, {
|
|
768
|
+
form: d,
|
|
701
769
|
layout: "vertical",
|
|
702
|
-
children: [/* @__PURE__ */
|
|
770
|
+
children: [/* @__PURE__ */ L(p.Item, {
|
|
703
771
|
label: u.profileNickname,
|
|
704
772
|
field: "nickname",
|
|
705
773
|
rules: [{
|
|
706
774
|
required: !0,
|
|
707
775
|
message: u.profileNicknamePlaceholder
|
|
708
776
|
}],
|
|
709
|
-
children: /* @__PURE__ */
|
|
777
|
+
children: /* @__PURE__ */ L(h, {
|
|
710
778
|
placeholder: u.profileNicknamePlaceholder,
|
|
711
779
|
allowClear: !0
|
|
712
780
|
})
|
|
713
|
-
}), /* @__PURE__ */
|
|
781
|
+
}), /* @__PURE__ */ L(p.Item, {
|
|
714
782
|
label: u.profileAvatar,
|
|
715
|
-
children: /* @__PURE__ */
|
|
783
|
+
children: /* @__PURE__ */ R("div", {
|
|
716
784
|
className: "flex flex-col gap-2",
|
|
717
|
-
children: [/* @__PURE__ */
|
|
785
|
+
children: [/* @__PURE__ */ R("div", {
|
|
718
786
|
className: "flex items-center gap-3",
|
|
719
|
-
children: [/* @__PURE__ */
|
|
787
|
+
children: [/* @__PURE__ */ L(s, {
|
|
720
788
|
size: 64,
|
|
721
789
|
className: "shrink-0 bg-arco-primary-light-1!",
|
|
722
|
-
children: b ||
|
|
723
|
-
src: b ||
|
|
790
|
+
children: b || t?.avatar ? /* @__PURE__ */ L("img", {
|
|
791
|
+
src: b || t?.avatar,
|
|
724
792
|
alt: "",
|
|
725
793
|
className: "block h-full w-full object-cover"
|
|
726
|
-
}) :
|
|
727
|
-
}), /* @__PURE__ */
|
|
794
|
+
}) : t?.nickname?.[0] || t?.username?.[0] || "U"
|
|
795
|
+
}), /* @__PURE__ */ L(E, {
|
|
728
796
|
accept: "image/*",
|
|
729
797
|
showUploadList: !1,
|
|
730
798
|
beforeUpload: async (e) => {
|
|
731
|
-
if (e.size >
|
|
799
|
+
if (e.size > at) return C(u.profileAvatarTooLarge), !1;
|
|
732
800
|
try {
|
|
733
|
-
let { width: t, height: n } = await
|
|
734
|
-
if (t >
|
|
801
|
+
let { width: t, height: n } = await ot(e);
|
|
802
|
+
if (t > it || n > it) return C(u.profileAvatarDimensionExceeded), !1;
|
|
735
803
|
} catch (e) {
|
|
736
|
-
return
|
|
804
|
+
return C(u.profileAvatarInvalidImage, e), !1;
|
|
737
805
|
}
|
|
738
806
|
return x((t) => {
|
|
739
807
|
t && URL.revokeObjectURL(t);
|
|
@@ -741,14 +809,14 @@ function Ge({ visible: e, user: n, labels: s, onCancel: c, onSubmit: l }) {
|
|
|
741
809
|
return S.current = n, n;
|
|
742
810
|
}), y(e), !1;
|
|
743
811
|
},
|
|
744
|
-
children: /* @__PURE__ */
|
|
812
|
+
children: /* @__PURE__ */ L(c, {
|
|
745
813
|
type: "outline",
|
|
746
814
|
size: "small",
|
|
747
|
-
icon: /* @__PURE__ */
|
|
815
|
+
icon: /* @__PURE__ */ L(I, {}),
|
|
748
816
|
children: u.profileUploadAvatar
|
|
749
817
|
})
|
|
750
818
|
})]
|
|
751
|
-
}), /* @__PURE__ */
|
|
819
|
+
}), /* @__PURE__ */ L("span", {
|
|
752
820
|
className: "text-xs text-arco-text-3",
|
|
753
821
|
children: u.profileAvatarHint
|
|
754
822
|
})]
|
|
@@ -759,53 +827,70 @@ function Ge({ visible: e, user: n, labels: s, onCancel: c, onSubmit: l }) {
|
|
|
759
827
|
}
|
|
760
828
|
//#endregion
|
|
761
829
|
//#region src/header/components/UserAvatar.tsx
|
|
762
|
-
function
|
|
830
|
+
function ct(e) {
|
|
763
831
|
return e?.nickname?.[0] || e?.username?.[0] || "U";
|
|
764
832
|
}
|
|
765
|
-
function
|
|
766
|
-
return /* @__PURE__ */
|
|
833
|
+
function lt({ user: e, size: t, className: n = "" }) {
|
|
834
|
+
return /* @__PURE__ */ L(s, {
|
|
767
835
|
size: t,
|
|
768
836
|
className: `bg-arco-primary/20! text-arco-primary-6 border-2 font-bold ${n}`,
|
|
769
|
-
children: e?.avatar ? /* @__PURE__ */
|
|
837
|
+
children: e?.avatar ? /* @__PURE__ */ L("img", {
|
|
770
838
|
src: e.avatar,
|
|
771
839
|
alt: "avatar",
|
|
772
840
|
className: "h-full w-full object-cover"
|
|
773
|
-
}) :
|
|
841
|
+
}) : ct(e)
|
|
774
842
|
});
|
|
775
843
|
}
|
|
776
844
|
//#endregion
|
|
777
845
|
//#region src/header/components/RechargeModal.tsx
|
|
778
|
-
|
|
779
|
-
|
|
846
|
+
var ut = {
|
|
847
|
+
minHeight: 292,
|
|
848
|
+
height: "100%",
|
|
849
|
+
display: "flex",
|
|
850
|
+
flexDirection: "column",
|
|
851
|
+
justifyContent: "space-between"
|
|
852
|
+
}, dt = "relative h-full! min-h-[292px]! w-full! overflow-hidden rounded-lg! border shadow-sm! transition-all duration-200 before:absolute before:inset-x-0 before:top-0 before:h-1 before:bg-linear-to-r before:from-arco-primary before:to-transparent hover:shadow-md! [&_.arco-card-body]:flex! [&_.arco-card-body]:h-full! [&_.arco-card-body]:flex-col! [&_.arco-card-body]:justify-between!";
|
|
853
|
+
function ft({ visible: e, user: t, points: r, text: o, packages: s, packageLoading: u = !1, submitting: d = !1, onCancel: f, onPay: p }) {
|
|
854
|
+
let [g, _] = a(Ye[2].id), [y, b] = a(""), x = i(null), S = s?.length ? s : Ye, C = (e) => new Intl.NumberFormat().format(e), E = y.trim(), O = Number(E), k = E.length > 0, A = g === "custom", j = k && Number.isFinite(O) && Number.isInteger(O) && O >= 10, M = S.find((e) => e.id === g), N = A && j ? {
|
|
780
855
|
id: "custom",
|
|
781
|
-
price:
|
|
782
|
-
points:
|
|
856
|
+
price: O,
|
|
857
|
+
points: O * 100,
|
|
783
858
|
custom: !0
|
|
784
|
-
} :
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
859
|
+
} : M, P = N ? `${o.payNow} · $${N.price}` : k ? o.customRechargeMinError : o.selectRechargePackage;
|
|
860
|
+
n(() => {
|
|
861
|
+
!e || A || S.some((e) => e.id === g) || _((S.find((e) => e.recommended) || S[0])?.id || "custom");
|
|
862
|
+
}, [
|
|
863
|
+
S,
|
|
864
|
+
A,
|
|
865
|
+
g,
|
|
866
|
+
e
|
|
867
|
+
]);
|
|
868
|
+
let F = (e) => {
|
|
869
|
+
_(e), b("");
|
|
870
|
+
}, I = () => {
|
|
871
|
+
_("custom"), b((e) => e || "10"), x.current?.focus();
|
|
788
872
|
};
|
|
789
|
-
return /* @__PURE__ */
|
|
790
|
-
title:
|
|
873
|
+
return /* @__PURE__ */ L(v, {
|
|
874
|
+
title: o.rechargeTitle,
|
|
791
875
|
visible: e,
|
|
792
|
-
footer: /* @__PURE__ */
|
|
876
|
+
footer: /* @__PURE__ */ R("div", {
|
|
793
877
|
className: "mx-auto flex max-w-7xl items-center justify-between gap-5",
|
|
794
|
-
children: [/* @__PURE__ */
|
|
878
|
+
children: [/* @__PURE__ */ L("span", {
|
|
795
879
|
className: "text-arco-text-2 text-sm leading-6",
|
|
796
|
-
children:
|
|
797
|
-
}), /* @__PURE__ */
|
|
880
|
+
children: o.rechargeHint
|
|
881
|
+
}), /* @__PURE__ */ L(c, {
|
|
798
882
|
type: "primary",
|
|
799
883
|
size: "large",
|
|
800
884
|
className: "min-w-48! font-bold!",
|
|
801
|
-
disabled: !
|
|
885
|
+
disabled: !N || u || d,
|
|
886
|
+
loading: d,
|
|
802
887
|
onClick: () => {
|
|
803
|
-
|
|
888
|
+
N && p(N);
|
|
804
889
|
},
|
|
805
|
-
children:
|
|
890
|
+
children: P
|
|
806
891
|
})]
|
|
807
892
|
}),
|
|
808
|
-
onCancel:
|
|
893
|
+
onCancel: f,
|
|
809
894
|
alignCenter: !1,
|
|
810
895
|
wrapClassName: "overflow-hidden!",
|
|
811
896
|
style: {
|
|
@@ -815,165 +900,164 @@ function qe({ visible: e, user: t, points: n, text: a, onCancel: c, onPay: l })
|
|
|
815
900
|
paddingBottom: 0
|
|
816
901
|
},
|
|
817
902
|
className: "top-0! m-0! flex! h-screen! w-screen! max-w-none! flex-col! [&_.arco-modal-body]:min-h-0! [&_.arco-modal-body]:flex-1! [&_.arco-modal-body]:overflow-hidden! [&_.arco-modal-body]:p-0! [&_.arco-modal-close-icon]:top-1.5! [&_.arco-modal-close-icon]:right-4! [&_.arco-modal-close-icon]:inline-flex! [&_.arco-modal-close-icon]:h-9! [&_.arco-modal-close-icon]:w-9! [&_.arco-modal-close-icon]:items-center! [&_.arco-modal-close-icon]:justify-center! [&_.arco-modal-close-icon]:rounded-lg! [&_.arco-modal-close-icon]:text-lg! [&_.arco-modal-close-icon]:leading-9! [&_.arco-modal-close-icon]:transition-colors [&_.arco-modal-close-icon:hover]:bg-arco-fill-2 [&_.arco-modal-close-icon:hover]:text-arco-primary-6 [&_.arco-modal-close-icon_svg]:h-[18px]! [&_.arco-modal-close-icon_svg]:w-[18px]! [&_.arco-modal-content]:flex! [&_.arco-modal-content]:h-auto! [&_.arco-modal-content]:min-h-0! [&_.arco-modal-content]:flex-1! [&_.arco-modal-content]:flex-col! [&_.arco-modal-content]:overflow-hidden! [&_.arco-modal-content]:rounded-none! [&_.arco-modal-footer]:shrink-0! [&_.arco-modal-header]:shrink-0!",
|
|
818
|
-
children: /* @__PURE__ */
|
|
903
|
+
children: /* @__PURE__ */ R("div", {
|
|
819
904
|
className: "mx-auto flex h-full w-full max-w-7xl flex-col items-center ",
|
|
820
|
-
children: [/* @__PURE__ */
|
|
905
|
+
children: [/* @__PURE__ */ R("div", {
|
|
821
906
|
className: "w-full border-arco-border-1 bg-arco-fill-1 text-arco-text-2 flex items-center gap-2.5 rounded-lg border px-3.5 py-3 text-sm",
|
|
822
|
-
children: [/* @__PURE__ */
|
|
907
|
+
children: [/* @__PURE__ */ L(lt, {
|
|
823
908
|
user: t,
|
|
824
909
|
size: 32,
|
|
825
910
|
className: "shrink-0"
|
|
826
|
-
}), /* @__PURE__ */
|
|
911
|
+
}), /* @__PURE__ */ R("span", { children: [
|
|
827
912
|
t?.nickname || t?.username,
|
|
828
913
|
" · ",
|
|
829
|
-
|
|
914
|
+
o.currentBalance,
|
|
830
915
|
" ",
|
|
831
|
-
/* @__PURE__ */
|
|
916
|
+
/* @__PURE__ */ L("strong", {
|
|
832
917
|
className: "text-arco-text-1",
|
|
833
|
-
children:
|
|
918
|
+
children: C(r.total)
|
|
834
919
|
}),
|
|
835
920
|
" ",
|
|
836
|
-
|
|
921
|
+
o.pointsUnit
|
|
837
922
|
] })]
|
|
838
|
-
}), /* @__PURE__ */
|
|
923
|
+
}), /* @__PURE__ */ L("div", {
|
|
839
924
|
className: "mt-6 w-full",
|
|
840
|
-
children: /* @__PURE__ */
|
|
925
|
+
children: /* @__PURE__ */ R(m.Row, {
|
|
841
926
|
gutter: [16, 16],
|
|
842
|
-
|
|
927
|
+
style: { alignItems: "stretch" },
|
|
928
|
+
children: [S.map((e) => /* @__PURE__ */ L(m.Col, {
|
|
843
929
|
xs: 24,
|
|
844
930
|
sm: 12,
|
|
845
931
|
lg: 6,
|
|
846
|
-
|
|
932
|
+
style: { display: "flex" },
|
|
933
|
+
children: /* @__PURE__ */ R(l, {
|
|
847
934
|
hoverable: !0,
|
|
935
|
+
loading: u,
|
|
848
936
|
role: "button",
|
|
849
937
|
tabIndex: 0,
|
|
850
|
-
onClick: () =>
|
|
938
|
+
onClick: () => F(e.id),
|
|
851
939
|
onKeyDown: (t) => {
|
|
852
|
-
(t.key === "Enter" || t.key === " ") &&
|
|
853
|
-
},
|
|
854
|
-
bodyStyle: {
|
|
855
|
-
minHeight: 192,
|
|
856
|
-
display: "flex",
|
|
857
|
-
flexDirection: "column",
|
|
858
|
-
justifyContent: "space-between"
|
|
940
|
+
(t.key === "Enter" || t.key === " ") && F(e.id);
|
|
859
941
|
},
|
|
860
|
-
|
|
942
|
+
bodyStyle: ut,
|
|
943
|
+
className: `${dt} border-arco-border-2! bg-arco-bg-2! cursor-pointer ${g === e.id ? "border-arco-primary-6! bg-arco-primary-light-1/40! ring-arco-primary-6/20 ring-2! shadow-[0_18px_38px_rgb(var(--primary-6)/22%)]!" : "hover:border-arco-primary-6!"}`,
|
|
861
944
|
children: [
|
|
862
|
-
|
|
863
|
-
"recommended" in e && e.recommended ? /* @__PURE__ */
|
|
945
|
+
g === e.id ? /* @__PURE__ */ L(D, { className: "text-arco-primary-6! absolute bottom-4 left-4 text-xl" }) : null,
|
|
946
|
+
"recommended" in e && e.recommended ? /* @__PURE__ */ L(w, {
|
|
864
947
|
color: "arcoblue",
|
|
865
948
|
className: "absolute top-4 right-4 text-xs! font-bold!",
|
|
866
949
|
children: "HOT"
|
|
867
950
|
}) : null,
|
|
868
|
-
/* @__PURE__ */
|
|
951
|
+
/* @__PURE__ */ R("div", {
|
|
869
952
|
className: "min-w-0 pr-16",
|
|
870
|
-
children: [/* @__PURE__ */
|
|
953
|
+
children: [/* @__PURE__ */ R(T.Text, {
|
|
871
954
|
className: "flex items-center text-3xl! leading-tight! font-bold!",
|
|
872
|
-
children: [
|
|
955
|
+
children: [C(e.points), /* @__PURE__ */ L("span", {
|
|
873
956
|
className: "ml-1 text-2xl",
|
|
874
957
|
children: "🪙"
|
|
875
958
|
})]
|
|
876
|
-
}), /* @__PURE__ */
|
|
959
|
+
}), /* @__PURE__ */ L(T.Text, {
|
|
877
960
|
type: "secondary",
|
|
878
961
|
className: "mt-1 block! text-sm!",
|
|
879
|
-
children:
|
|
962
|
+
children: o.pointsUnit
|
|
880
963
|
})]
|
|
881
964
|
}),
|
|
882
|
-
/* @__PURE__ */
|
|
965
|
+
/* @__PURE__ */ L("div", {
|
|
883
966
|
className: "mt-7 flex w-full justify-end",
|
|
884
|
-
children: /* @__PURE__ */
|
|
967
|
+
children: /* @__PURE__ */ R(T.Text, {
|
|
885
968
|
className: "text-arco-primary-6! text-right text-2xl! leading-tight! font-bold!",
|
|
886
969
|
children: ["$", e.price]
|
|
887
970
|
})
|
|
888
971
|
})
|
|
889
972
|
]
|
|
890
973
|
})
|
|
891
|
-
}, e.id)), /* @__PURE__ */
|
|
974
|
+
}, e.id)), /* @__PURE__ */ L(m.Col, {
|
|
892
975
|
xs: 24,
|
|
893
976
|
sm: 12,
|
|
894
977
|
lg: 6,
|
|
895
|
-
|
|
978
|
+
style: { display: "flex" },
|
|
979
|
+
children: /* @__PURE__ */ R(l, {
|
|
896
980
|
role: "button",
|
|
897
981
|
tabIndex: 0,
|
|
898
|
-
onClick:
|
|
982
|
+
onClick: I,
|
|
899
983
|
onKeyDown: (e) => {
|
|
900
|
-
(e.key === "Enter" || e.key === " ") &&
|
|
984
|
+
(e.key === "Enter" || e.key === " ") && I();
|
|
901
985
|
},
|
|
902
|
-
bodyStyle:
|
|
903
|
-
|
|
904
|
-
display: "flex",
|
|
905
|
-
flexDirection: "column",
|
|
906
|
-
justifyContent: "space-between"
|
|
907
|
-
},
|
|
908
|
-
className: `border-arco-border-2! bg-arco-bg-2! relative cursor-text overflow-hidden rounded-lg! shadow-sm! transition-all duration-200 before:absolute before:inset-x-0 before:top-0 before:h-1 before:bg-linear-to-r before:from-arco-primary before:to-transparent hover:shadow-md! ${T ? "border-arco-primary-6! bg-arco-primary-light-1/40! ring-arco-primary-6/20 ring-2! shadow-[0_18px_38px_rgb(var(--primary-6)/22%)]!" : b && C ? "border-arco-danger-6! hover:border-arco-danger-6!" : "hover:border-arco-primary-6!"}`,
|
|
986
|
+
bodyStyle: ut,
|
|
987
|
+
className: `${dt} cursor-text ${j ? "border-arco-primary-6! bg-arco-primary-light-1/40! ring-arco-primary-6/20 ring-2! shadow-[0_18px_38px_rgb(var(--primary-6)/22%)]!" : k && A ? "border-arco-danger-6! bg-arco-bg-1! hover:border-arco-danger-6!" : "border-arco-primary-6/30! bg-arco-primary-light-1/20! hover:border-arco-primary-6!"}`,
|
|
909
988
|
children: [
|
|
910
|
-
|
|
911
|
-
/* @__PURE__ */
|
|
989
|
+
j ? /* @__PURE__ */ L(D, { className: "text-arco-primary-6! absolute top-4 right-4 text-xl" }) : null,
|
|
990
|
+
/* @__PURE__ */ R("div", {
|
|
912
991
|
className: "flex min-w-0 flex-col gap-2.5",
|
|
913
992
|
children: [
|
|
914
|
-
/* @__PURE__ */
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
993
|
+
/* @__PURE__ */ R("div", {
|
|
994
|
+
className: "flex min-w-0 flex-col gap-2.5 pr-8",
|
|
995
|
+
children: [/* @__PURE__ */ L(w, {
|
|
996
|
+
color: "arcoblue",
|
|
997
|
+
className: "w-fit text-xs! font-bold!",
|
|
998
|
+
children: o.customRechargeAmount
|
|
999
|
+
}), /* @__PURE__ */ L(T.Text, {
|
|
1000
|
+
type: "secondary",
|
|
1001
|
+
className: "block! text-sm! leading-5! ",
|
|
1002
|
+
children: o.customRechargeDescription
|
|
1003
|
+
})]
|
|
923
1004
|
}),
|
|
924
|
-
/* @__PURE__ */
|
|
925
|
-
className: "
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
1005
|
+
/* @__PURE__ */ L("div", {
|
|
1006
|
+
className: "mt-1",
|
|
1007
|
+
onClick: (e) => e.stopPropagation(),
|
|
1008
|
+
children: /* @__PURE__ */ L(h, {
|
|
1009
|
+
ref: x,
|
|
1010
|
+
type: "text",
|
|
1011
|
+
inputMode: "numeric",
|
|
1012
|
+
pattern: "[0-9]*",
|
|
1013
|
+
value: y,
|
|
1014
|
+
placeholder: "10",
|
|
1015
|
+
onFocus: I,
|
|
1016
|
+
onChange: (e) => {
|
|
1017
|
+
_("custom"), b(e.replace(/\D/g, ""));
|
|
1018
|
+
},
|
|
1019
|
+
prefix: /* @__PURE__ */ L("span", {
|
|
1020
|
+
className: "text-arco-primary-6 text-base font-semibold",
|
|
929
1021
|
children: "$"
|
|
930
1022
|
}),
|
|
931
|
-
/* @__PURE__ */
|
|
932
|
-
|
|
933
|
-
type: "number",
|
|
934
|
-
min: 10,
|
|
935
|
-
step: 1,
|
|
936
|
-
value: p,
|
|
937
|
-
placeholder: "10",
|
|
938
|
-
onFocus: () => d("custom"),
|
|
939
|
-
onChange: (e) => {
|
|
940
|
-
d("custom"), m(e.target.value);
|
|
941
|
-
},
|
|
942
|
-
onClick: (e) => e.stopPropagation(),
|
|
943
|
-
className: `bg-arco-bg-2 text-arco-text-1 w-full rounded-md border px-7 py-2.5 pr-14 text-lg font-bold outline-none transition-colors [font-family:var(--font-display)] focus:border-arco-primary-6 ${b && C && !T ? "border-arco-danger-6!" : "border-arco-border-2!"}`
|
|
944
|
-
}),
|
|
945
|
-
/* @__PURE__ */ F("span", {
|
|
946
|
-
className: "text-arco-text-3 pointer-events-none absolute top-1/2 right-3.5 -translate-y-1/2 text-xs font-medium",
|
|
1023
|
+
suffix: /* @__PURE__ */ L("span", {
|
|
1024
|
+
className: "text-arco-primary-6 text-xs font-semibold",
|
|
947
1025
|
children: "USD"
|
|
948
|
-
})
|
|
949
|
-
|
|
1026
|
+
}),
|
|
1027
|
+
height: 48,
|
|
1028
|
+
status: k && A && !j ? "error" : void 0,
|
|
1029
|
+
className: `w-full! rounded-md! shadow-[0_0_0_3px_rgb(var(--primary-6)/8%)] transition-all [&_.arco-input]:text-xl! [&_.arco-input]:font-bold! [&_.arco-input]:text-arco-text-1! [&_.arco-input]:[font-family:var(--font-display)] [&_.arco-input-inner-wrapper]:border-2! [&_.arco-input-inner-wrapper]:bg-arco-bg-1! [&_.arco-input-inner-wrapper]:px-3! [&_.arco-input-inner-wrapper]:shadow-none! [&_.arco-input-inner-wrapper-focus]:border-arco-primary-6! [&_.arco-input-inner-wrapper-focus]:shadow-[0_0_0_4px_rgb(var(--primary-6)/14%)]! ${k && A && !j ? "[&_.arco-input-inner-wrapper]:border-arco-danger-6! shadow-[0_0_0_3px_rgb(var(--danger-6)/12%)]" : "[&_.arco-input-inner-wrapper]:border-arco-primary-6/50!"}`
|
|
1030
|
+
})
|
|
950
1031
|
}),
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
1032
|
+
/* @__PURE__ */ L("div", {
|
|
1033
|
+
className: "h-4",
|
|
1034
|
+
children: /* @__PURE__ */ L(T.Text, {
|
|
1035
|
+
type: "error",
|
|
1036
|
+
className: `block! text-xs! leading-4! transition-opacity ${k && A && !j ? "opacity-100" : "opacity-0"}`,
|
|
1037
|
+
children: o.customRechargeMinError
|
|
1038
|
+
})
|
|
1039
|
+
})
|
|
956
1040
|
]
|
|
957
1041
|
}),
|
|
958
|
-
/* @__PURE__ */
|
|
959
|
-
className: "
|
|
1042
|
+
/* @__PURE__ */ R("div", {
|
|
1043
|
+
className: "border-arco-primary-6/20! bg-arco-bg-1!/80 mt-3 rounded-md border px-3.5 py-3 shadow-sm",
|
|
960
1044
|
children: [
|
|
961
|
-
/* @__PURE__ */
|
|
1045
|
+
/* @__PURE__ */ L(T.Text, {
|
|
962
1046
|
type: "secondary",
|
|
963
1047
|
className: "block! text-xs!",
|
|
964
|
-
children:
|
|
1048
|
+
children: o.customRechargeEstimate
|
|
965
1049
|
}),
|
|
966
|
-
/* @__PURE__ */
|
|
967
|
-
className: "text-arco-primary-6! mt-
|
|
968
|
-
children: [
|
|
1050
|
+
/* @__PURE__ */ R(T.Text, {
|
|
1051
|
+
className: "text-arco-primary-6! mt-1 block! text-xl! leading-tight! font-bold!",
|
|
1052
|
+
children: [j ? C(O * 100) : "-", /* @__PURE__ */ L("span", {
|
|
969
1053
|
className: "text-arco-text-3 ml-1 text-xs font-normal",
|
|
970
|
-
children:
|
|
1054
|
+
children: o.pointsUnit
|
|
971
1055
|
})]
|
|
972
1056
|
}),
|
|
973
|
-
/* @__PURE__ */
|
|
1057
|
+
/* @__PURE__ */ L(T.Text, {
|
|
974
1058
|
type: "secondary",
|
|
975
1059
|
className: "mt-0.5 block! text-[10px]!",
|
|
976
|
-
children:
|
|
1060
|
+
children: o.customRechargeRate
|
|
977
1061
|
})
|
|
978
1062
|
]
|
|
979
1063
|
})
|
|
@@ -986,93 +1070,1176 @@ function qe({ visible: e, user: t, points: n, text: a, onCancel: c, onPay: l })
|
|
|
986
1070
|
});
|
|
987
1071
|
}
|
|
988
1072
|
//#endregion
|
|
1073
|
+
//#region node_modules/prop-types/node_modules/react-is/cjs/react-is.production.min.js
|
|
1074
|
+
var pt = /* @__PURE__ */ U(((e) => {
|
|
1075
|
+
var t = typeof Symbol == "function" && Symbol.for, n = t ? Symbol.for("react.element") : 60103, r = t ? Symbol.for("react.portal") : 60106, i = t ? Symbol.for("react.fragment") : 60107, a = t ? Symbol.for("react.strict_mode") : 60108, o = t ? Symbol.for("react.profiler") : 60114, s = t ? Symbol.for("react.provider") : 60109, c = t ? Symbol.for("react.context") : 60110, l = t ? Symbol.for("react.async_mode") : 60111, u = t ? Symbol.for("react.concurrent_mode") : 60111, d = t ? Symbol.for("react.forward_ref") : 60112, f = t ? Symbol.for("react.suspense") : 60113, p = t ? Symbol.for("react.suspense_list") : 60120, m = t ? Symbol.for("react.memo") : 60115, h = t ? Symbol.for("react.lazy") : 60116, g = t ? Symbol.for("react.block") : 60121, _ = t ? Symbol.for("react.fundamental") : 60117, v = t ? Symbol.for("react.responder") : 60118, y = t ? Symbol.for("react.scope") : 60119;
|
|
1076
|
+
function b(e) {
|
|
1077
|
+
if (typeof e == "object" && e) {
|
|
1078
|
+
var t = e.$$typeof;
|
|
1079
|
+
switch (t) {
|
|
1080
|
+
case n: switch (e = e.type, e) {
|
|
1081
|
+
case l:
|
|
1082
|
+
case u:
|
|
1083
|
+
case i:
|
|
1084
|
+
case o:
|
|
1085
|
+
case a:
|
|
1086
|
+
case f: return e;
|
|
1087
|
+
default: switch (e &&= e.$$typeof, e) {
|
|
1088
|
+
case c:
|
|
1089
|
+
case d:
|
|
1090
|
+
case h:
|
|
1091
|
+
case m:
|
|
1092
|
+
case s: return e;
|
|
1093
|
+
default: return t;
|
|
1094
|
+
}
|
|
1095
|
+
}
|
|
1096
|
+
case r: return t;
|
|
1097
|
+
}
|
|
1098
|
+
}
|
|
1099
|
+
}
|
|
1100
|
+
function x(e) {
|
|
1101
|
+
return b(e) === u;
|
|
1102
|
+
}
|
|
1103
|
+
e.AsyncMode = l, e.ConcurrentMode = u, e.ContextConsumer = c, e.ContextProvider = s, e.Element = n, e.ForwardRef = d, e.Fragment = i, e.Lazy = h, e.Memo = m, e.Portal = r, e.Profiler = o, e.StrictMode = a, e.Suspense = f, e.isAsyncMode = function(e) {
|
|
1104
|
+
return x(e) || b(e) === l;
|
|
1105
|
+
}, e.isConcurrentMode = x, e.isContextConsumer = function(e) {
|
|
1106
|
+
return b(e) === c;
|
|
1107
|
+
}, e.isContextProvider = function(e) {
|
|
1108
|
+
return b(e) === s;
|
|
1109
|
+
}, e.isElement = function(e) {
|
|
1110
|
+
return typeof e == "object" && !!e && e.$$typeof === n;
|
|
1111
|
+
}, e.isForwardRef = function(e) {
|
|
1112
|
+
return b(e) === d;
|
|
1113
|
+
}, e.isFragment = function(e) {
|
|
1114
|
+
return b(e) === i;
|
|
1115
|
+
}, e.isLazy = function(e) {
|
|
1116
|
+
return b(e) === h;
|
|
1117
|
+
}, e.isMemo = function(e) {
|
|
1118
|
+
return b(e) === m;
|
|
1119
|
+
}, e.isPortal = function(e) {
|
|
1120
|
+
return b(e) === r;
|
|
1121
|
+
}, e.isProfiler = function(e) {
|
|
1122
|
+
return b(e) === o;
|
|
1123
|
+
}, e.isStrictMode = function(e) {
|
|
1124
|
+
return b(e) === a;
|
|
1125
|
+
}, e.isSuspense = function(e) {
|
|
1126
|
+
return b(e) === f;
|
|
1127
|
+
}, e.isValidElementType = function(e) {
|
|
1128
|
+
return typeof e == "string" || typeof e == "function" || e === i || e === u || e === o || e === a || e === f || e === p || typeof e == "object" && !!e && (e.$$typeof === h || e.$$typeof === m || e.$$typeof === s || e.$$typeof === c || e.$$typeof === d || e.$$typeof === _ || e.$$typeof === v || e.$$typeof === y || e.$$typeof === g);
|
|
1129
|
+
}, e.typeOf = b;
|
|
1130
|
+
})), mt = /* @__PURE__ */ U(((e) => {
|
|
1131
|
+
process.env.NODE_ENV !== "production" && (function() {
|
|
1132
|
+
var t = typeof Symbol == "function" && Symbol.for, n = t ? Symbol.for("react.element") : 60103, r = t ? Symbol.for("react.portal") : 60106, i = t ? Symbol.for("react.fragment") : 60107, a = t ? Symbol.for("react.strict_mode") : 60108, o = t ? Symbol.for("react.profiler") : 60114, s = t ? Symbol.for("react.provider") : 60109, c = t ? Symbol.for("react.context") : 60110, l = t ? Symbol.for("react.async_mode") : 60111, u = t ? Symbol.for("react.concurrent_mode") : 60111, d = t ? Symbol.for("react.forward_ref") : 60112, f = t ? Symbol.for("react.suspense") : 60113, p = t ? Symbol.for("react.suspense_list") : 60120, m = t ? Symbol.for("react.memo") : 60115, h = t ? Symbol.for("react.lazy") : 60116, g = t ? Symbol.for("react.block") : 60121, _ = t ? Symbol.for("react.fundamental") : 60117, v = t ? Symbol.for("react.responder") : 60118, y = t ? Symbol.for("react.scope") : 60119;
|
|
1133
|
+
function b(e) {
|
|
1134
|
+
return typeof e == "string" || typeof e == "function" || e === i || e === u || e === o || e === a || e === f || e === p || typeof e == "object" && !!e && (e.$$typeof === h || e.$$typeof === m || e.$$typeof === s || e.$$typeof === c || e.$$typeof === d || e.$$typeof === _ || e.$$typeof === v || e.$$typeof === y || e.$$typeof === g);
|
|
1135
|
+
}
|
|
1136
|
+
function x(e) {
|
|
1137
|
+
if (typeof e == "object" && e) {
|
|
1138
|
+
var t = e.$$typeof;
|
|
1139
|
+
switch (t) {
|
|
1140
|
+
case n:
|
|
1141
|
+
var p = e.type;
|
|
1142
|
+
switch (p) {
|
|
1143
|
+
case l:
|
|
1144
|
+
case u:
|
|
1145
|
+
case i:
|
|
1146
|
+
case o:
|
|
1147
|
+
case a:
|
|
1148
|
+
case f: return p;
|
|
1149
|
+
default:
|
|
1150
|
+
var g = p && p.$$typeof;
|
|
1151
|
+
switch (g) {
|
|
1152
|
+
case c:
|
|
1153
|
+
case d:
|
|
1154
|
+
case h:
|
|
1155
|
+
case m:
|
|
1156
|
+
case s: return g;
|
|
1157
|
+
default: return t;
|
|
1158
|
+
}
|
|
1159
|
+
}
|
|
1160
|
+
case r: return t;
|
|
1161
|
+
}
|
|
1162
|
+
}
|
|
1163
|
+
}
|
|
1164
|
+
var S = l, C = u, w = c, T = s, E = n, D = d, O = i, k = h, A = m, j = r, M = o, N = a, P = f, F = !1;
|
|
1165
|
+
function I(e) {
|
|
1166
|
+
return F || (F = !0, console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API.")), ee(e) || x(e) === l;
|
|
1167
|
+
}
|
|
1168
|
+
function ee(e) {
|
|
1169
|
+
return x(e) === u;
|
|
1170
|
+
}
|
|
1171
|
+
function L(e) {
|
|
1172
|
+
return x(e) === c;
|
|
1173
|
+
}
|
|
1174
|
+
function R(e) {
|
|
1175
|
+
return x(e) === s;
|
|
1176
|
+
}
|
|
1177
|
+
function te(e) {
|
|
1178
|
+
return typeof e == "object" && !!e && e.$$typeof === n;
|
|
1179
|
+
}
|
|
1180
|
+
function z(e) {
|
|
1181
|
+
return x(e) === d;
|
|
1182
|
+
}
|
|
1183
|
+
function B(e) {
|
|
1184
|
+
return x(e) === i;
|
|
1185
|
+
}
|
|
1186
|
+
function ne(e) {
|
|
1187
|
+
return x(e) === h;
|
|
1188
|
+
}
|
|
1189
|
+
function V(e) {
|
|
1190
|
+
return x(e) === m;
|
|
1191
|
+
}
|
|
1192
|
+
function re(e) {
|
|
1193
|
+
return x(e) === r;
|
|
1194
|
+
}
|
|
1195
|
+
function H(e) {
|
|
1196
|
+
return x(e) === o;
|
|
1197
|
+
}
|
|
1198
|
+
function U(e) {
|
|
1199
|
+
return x(e) === a;
|
|
1200
|
+
}
|
|
1201
|
+
function W(e) {
|
|
1202
|
+
return x(e) === f;
|
|
1203
|
+
}
|
|
1204
|
+
e.AsyncMode = S, e.ConcurrentMode = C, e.ContextConsumer = w, e.ContextProvider = T, e.Element = E, e.ForwardRef = D, e.Fragment = O, e.Lazy = k, e.Memo = A, e.Portal = j, e.Profiler = M, e.StrictMode = N, e.Suspense = P, e.isAsyncMode = I, e.isConcurrentMode = ee, e.isContextConsumer = L, e.isContextProvider = R, e.isElement = te, e.isForwardRef = z, e.isFragment = B, e.isLazy = ne, e.isMemo = V, e.isPortal = re, e.isProfiler = H, e.isStrictMode = U, e.isSuspense = W, e.isValidElementType = b, e.typeOf = x;
|
|
1205
|
+
})();
|
|
1206
|
+
})), ht = /* @__PURE__ */ U(((e, t) => {
|
|
1207
|
+
process.env.NODE_ENV === "production" ? t.exports = pt() : t.exports = mt();
|
|
1208
|
+
})), gt = /* @__PURE__ */ U(((e, t) => {
|
|
1209
|
+
var n = Object.getOwnPropertySymbols, r = Object.prototype.hasOwnProperty, i = Object.prototype.propertyIsEnumerable;
|
|
1210
|
+
function a(e) {
|
|
1211
|
+
if (e == null) throw TypeError("Object.assign cannot be called with null or undefined");
|
|
1212
|
+
return Object(e);
|
|
1213
|
+
}
|
|
1214
|
+
function o() {
|
|
1215
|
+
try {
|
|
1216
|
+
if (!Object.assign) return !1;
|
|
1217
|
+
var e = /* @__PURE__ */ new String("abc");
|
|
1218
|
+
if (e[5] = "de", Object.getOwnPropertyNames(e)[0] === "5") return !1;
|
|
1219
|
+
for (var t = {}, n = 0; n < 10; n++) t["_" + String.fromCharCode(n)] = n;
|
|
1220
|
+
if (Object.getOwnPropertyNames(t).map(function(e) {
|
|
1221
|
+
return t[e];
|
|
1222
|
+
}).join("") !== "0123456789") return !1;
|
|
1223
|
+
var r = {};
|
|
1224
|
+
return "abcdefghijklmnopqrst".split("").forEach(function(e) {
|
|
1225
|
+
r[e] = e;
|
|
1226
|
+
}), Object.keys(Object.assign({}, r)).join("") === "abcdefghijklmnopqrst";
|
|
1227
|
+
} catch {
|
|
1228
|
+
return !1;
|
|
1229
|
+
}
|
|
1230
|
+
}
|
|
1231
|
+
t.exports = o() ? Object.assign : function(e, t) {
|
|
1232
|
+
for (var o, s = a(e), c, l = 1; l < arguments.length; l++) {
|
|
1233
|
+
for (var u in o = Object(arguments[l]), o) r.call(o, u) && (s[u] = o[u]);
|
|
1234
|
+
if (n) {
|
|
1235
|
+
c = n(o);
|
|
1236
|
+
for (var d = 0; d < c.length; d++) i.call(o, c[d]) && (s[c[d]] = o[c[d]]);
|
|
1237
|
+
}
|
|
1238
|
+
}
|
|
1239
|
+
return s;
|
|
1240
|
+
};
|
|
1241
|
+
})), _t = /* @__PURE__ */ U(((e, t) => {
|
|
1242
|
+
t.exports = "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";
|
|
1243
|
+
})), vt = /* @__PURE__ */ U(((e, t) => {
|
|
1244
|
+
t.exports = Function.call.bind(Object.prototype.hasOwnProperty);
|
|
1245
|
+
})), yt = /* @__PURE__ */ U(((e, t) => {
|
|
1246
|
+
var n = function() {};
|
|
1247
|
+
if (process.env.NODE_ENV !== "production") {
|
|
1248
|
+
var r = _t(), i = {}, a = vt();
|
|
1249
|
+
n = function(e) {
|
|
1250
|
+
var t = "Warning: " + e;
|
|
1251
|
+
typeof console < "u" && console.error(t);
|
|
1252
|
+
try {
|
|
1253
|
+
throw Error(t);
|
|
1254
|
+
} catch {}
|
|
1255
|
+
};
|
|
1256
|
+
}
|
|
1257
|
+
function o(e, t, o, s, c) {
|
|
1258
|
+
if (process.env.NODE_ENV !== "production") {
|
|
1259
|
+
for (var l in e) if (a(e, l)) {
|
|
1260
|
+
var u;
|
|
1261
|
+
try {
|
|
1262
|
+
if (typeof e[l] != "function") {
|
|
1263
|
+
var d = Error((s || "React class") + ": " + o + " type `" + l + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof e[l] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
|
|
1264
|
+
throw d.name = "Invariant Violation", d;
|
|
1265
|
+
}
|
|
1266
|
+
u = e[l](t, l, s, o, null, r);
|
|
1267
|
+
} catch (e) {
|
|
1268
|
+
u = e;
|
|
1269
|
+
}
|
|
1270
|
+
if (u && !(u instanceof Error) && n((s || "React class") + ": type specification of " + o + " `" + l + "` is invalid; the type checker function must return `null` or an `Error` but returned a " + typeof u + ". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."), u instanceof Error && !(u.message in i)) {
|
|
1271
|
+
i[u.message] = !0;
|
|
1272
|
+
var f = c ? c() : "";
|
|
1273
|
+
n("Failed " + o + " type: " + u.message + (f ?? ""));
|
|
1274
|
+
}
|
|
1275
|
+
}
|
|
1276
|
+
}
|
|
1277
|
+
}
|
|
1278
|
+
o.resetWarningCache = function() {
|
|
1279
|
+
process.env.NODE_ENV !== "production" && (i = {});
|
|
1280
|
+
}, t.exports = o;
|
|
1281
|
+
})), bt = /* @__PURE__ */ U(((e, t) => {
|
|
1282
|
+
var n = ht(), r = gt(), i = _t(), a = vt(), o = yt(), s = function() {};
|
|
1283
|
+
process.env.NODE_ENV !== "production" && (s = function(e) {
|
|
1284
|
+
var t = "Warning: " + e;
|
|
1285
|
+
typeof console < "u" && console.error(t);
|
|
1286
|
+
try {
|
|
1287
|
+
throw Error(t);
|
|
1288
|
+
} catch {}
|
|
1289
|
+
});
|
|
1290
|
+
function c() {
|
|
1291
|
+
return null;
|
|
1292
|
+
}
|
|
1293
|
+
t.exports = function(e, t) {
|
|
1294
|
+
var l = typeof Symbol == "function" && Symbol.iterator, u = "@@iterator";
|
|
1295
|
+
function d(e) {
|
|
1296
|
+
var t = e && (l && e[l] || e[u]);
|
|
1297
|
+
if (typeof t == "function") return t;
|
|
1298
|
+
}
|
|
1299
|
+
var f = "<<anonymous>>", p = {
|
|
1300
|
+
array: _("array"),
|
|
1301
|
+
bigint: _("bigint"),
|
|
1302
|
+
bool: _("boolean"),
|
|
1303
|
+
func: _("function"),
|
|
1304
|
+
number: _("number"),
|
|
1305
|
+
object: _("object"),
|
|
1306
|
+
string: _("string"),
|
|
1307
|
+
symbol: _("symbol"),
|
|
1308
|
+
any: v(),
|
|
1309
|
+
arrayOf: y,
|
|
1310
|
+
element: b(),
|
|
1311
|
+
elementType: x(),
|
|
1312
|
+
instanceOf: S,
|
|
1313
|
+
node: E(),
|
|
1314
|
+
objectOf: w,
|
|
1315
|
+
oneOf: C,
|
|
1316
|
+
oneOfType: T,
|
|
1317
|
+
shape: O,
|
|
1318
|
+
exact: k
|
|
1319
|
+
};
|
|
1320
|
+
function m(e, t) {
|
|
1321
|
+
return e === t ? e !== 0 || 1 / e == 1 / t : e !== e && t !== t;
|
|
1322
|
+
}
|
|
1323
|
+
function h(e, t) {
|
|
1324
|
+
this.message = e, this.data = t && typeof t == "object" ? t : {}, this.stack = "";
|
|
1325
|
+
}
|
|
1326
|
+
h.prototype = Error.prototype;
|
|
1327
|
+
function g(e) {
|
|
1328
|
+
if (process.env.NODE_ENV !== "production") var n = {}, r = 0;
|
|
1329
|
+
function a(a, o, c, l, u, d, p) {
|
|
1330
|
+
if (l ||= f, d ||= c, p !== i) {
|
|
1331
|
+
if (t) {
|
|
1332
|
+
var m = /* @__PURE__ */ Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types");
|
|
1333
|
+
throw m.name = "Invariant Violation", m;
|
|
1334
|
+
} else if (process.env.NODE_ENV !== "production" && typeof console < "u") {
|
|
1335
|
+
var g = l + ":" + c;
|
|
1336
|
+
!n[g] && r < 3 && (s("You are manually calling a React.PropTypes validation function for the `" + d + "` prop on `" + l + "`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details."), n[g] = !0, r++);
|
|
1337
|
+
}
|
|
1338
|
+
}
|
|
1339
|
+
return o[c] == null ? a ? o[c] === null ? new h("The " + u + " `" + d + "` is marked as required " + ("in `" + l + "`, but its value is `null`.")) : new h("The " + u + " `" + d + "` is marked as required in " + ("`" + l + "`, but its value is `undefined`.")) : null : e(o, c, l, u, d);
|
|
1340
|
+
}
|
|
1341
|
+
var o = a.bind(null, !1);
|
|
1342
|
+
return o.isRequired = a.bind(null, !0), o;
|
|
1343
|
+
}
|
|
1344
|
+
function _(e) {
|
|
1345
|
+
function t(t, n, r, i, a, o) {
|
|
1346
|
+
var s = t[n];
|
|
1347
|
+
if (M(s) !== e) {
|
|
1348
|
+
var c = N(s);
|
|
1349
|
+
return new h("Invalid " + i + " `" + a + "` of type " + ("`" + c + "` supplied to `" + r + "`, expected ") + ("`" + e + "`."), { expectedType: e });
|
|
1350
|
+
}
|
|
1351
|
+
return null;
|
|
1352
|
+
}
|
|
1353
|
+
return g(t);
|
|
1354
|
+
}
|
|
1355
|
+
function v() {
|
|
1356
|
+
return g(c);
|
|
1357
|
+
}
|
|
1358
|
+
function y(e) {
|
|
1359
|
+
function t(t, n, r, a, o) {
|
|
1360
|
+
if (typeof e != "function") return new h("Property `" + o + "` of component `" + r + "` has invalid PropType notation inside arrayOf.");
|
|
1361
|
+
var s = t[n];
|
|
1362
|
+
if (!Array.isArray(s)) {
|
|
1363
|
+
var c = M(s);
|
|
1364
|
+
return new h("Invalid " + a + " `" + o + "` of type " + ("`" + c + "` supplied to `" + r + "`, expected an array."));
|
|
1365
|
+
}
|
|
1366
|
+
for (var l = 0; l < s.length; l++) {
|
|
1367
|
+
var u = e(s, l, r, a, o + "[" + l + "]", i);
|
|
1368
|
+
if (u instanceof Error) return u;
|
|
1369
|
+
}
|
|
1370
|
+
return null;
|
|
1371
|
+
}
|
|
1372
|
+
return g(t);
|
|
1373
|
+
}
|
|
1374
|
+
function b() {
|
|
1375
|
+
function t(t, n, r, i, a) {
|
|
1376
|
+
var o = t[n];
|
|
1377
|
+
if (!e(o)) {
|
|
1378
|
+
var s = M(o);
|
|
1379
|
+
return new h("Invalid " + i + " `" + a + "` of type " + ("`" + s + "` supplied to `" + r + "`, expected a single ReactElement."));
|
|
1380
|
+
}
|
|
1381
|
+
return null;
|
|
1382
|
+
}
|
|
1383
|
+
return g(t);
|
|
1384
|
+
}
|
|
1385
|
+
function x() {
|
|
1386
|
+
function e(e, t, r, i, a) {
|
|
1387
|
+
var o = e[t];
|
|
1388
|
+
if (!n.isValidElementType(o)) {
|
|
1389
|
+
var s = M(o);
|
|
1390
|
+
return new h("Invalid " + i + " `" + a + "` of type " + ("`" + s + "` supplied to `" + r + "`, expected a single ReactElement type."));
|
|
1391
|
+
}
|
|
1392
|
+
return null;
|
|
1393
|
+
}
|
|
1394
|
+
return g(e);
|
|
1395
|
+
}
|
|
1396
|
+
function S(e) {
|
|
1397
|
+
function t(t, n, r, i, a) {
|
|
1398
|
+
if (!(t[n] instanceof e)) {
|
|
1399
|
+
var o = e.name || f, s = F(t[n]);
|
|
1400
|
+
return new h("Invalid " + i + " `" + a + "` of type " + ("`" + s + "` supplied to `" + r + "`, expected ") + ("instance of `" + o + "`."));
|
|
1401
|
+
}
|
|
1402
|
+
return null;
|
|
1403
|
+
}
|
|
1404
|
+
return g(t);
|
|
1405
|
+
}
|
|
1406
|
+
function C(e) {
|
|
1407
|
+
if (!Array.isArray(e)) return process.env.NODE_ENV !== "production" && (arguments.length > 1 ? s("Invalid arguments supplied to oneOf, expected an array, got " + arguments.length + " arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z]).") : s("Invalid argument supplied to oneOf, expected an array.")), c;
|
|
1408
|
+
function t(t, n, r, i, a) {
|
|
1409
|
+
for (var o = t[n], s = 0; s < e.length; s++) if (m(o, e[s])) return null;
|
|
1410
|
+
var c = JSON.stringify(e, function(e, t) {
|
|
1411
|
+
return N(t) === "symbol" ? String(t) : t;
|
|
1412
|
+
});
|
|
1413
|
+
return new h("Invalid " + i + " `" + a + "` of value `" + String(o) + "` " + ("supplied to `" + r + "`, expected one of " + c + "."));
|
|
1414
|
+
}
|
|
1415
|
+
return g(t);
|
|
1416
|
+
}
|
|
1417
|
+
function w(e) {
|
|
1418
|
+
function t(t, n, r, o, s) {
|
|
1419
|
+
if (typeof e != "function") return new h("Property `" + s + "` of component `" + r + "` has invalid PropType notation inside objectOf.");
|
|
1420
|
+
var c = t[n], l = M(c);
|
|
1421
|
+
if (l !== "object") return new h("Invalid " + o + " `" + s + "` of type " + ("`" + l + "` supplied to `" + r + "`, expected an object."));
|
|
1422
|
+
for (var u in c) if (a(c, u)) {
|
|
1423
|
+
var d = e(c, u, r, o, s + "." + u, i);
|
|
1424
|
+
if (d instanceof Error) return d;
|
|
1425
|
+
}
|
|
1426
|
+
return null;
|
|
1427
|
+
}
|
|
1428
|
+
return g(t);
|
|
1429
|
+
}
|
|
1430
|
+
function T(e) {
|
|
1431
|
+
if (!Array.isArray(e)) return process.env.NODE_ENV !== "production" && s("Invalid argument supplied to oneOfType, expected an instance of array."), c;
|
|
1432
|
+
for (var t = 0; t < e.length; t++) {
|
|
1433
|
+
var n = e[t];
|
|
1434
|
+
if (typeof n != "function") return s("Invalid argument supplied to oneOfType. Expected an array of check functions, but received " + P(n) + " at index " + t + "."), c;
|
|
1435
|
+
}
|
|
1436
|
+
function r(t, n, r, o, s) {
|
|
1437
|
+
for (var c = [], l = 0; l < e.length; l++) {
|
|
1438
|
+
var u = e[l], d = u(t, n, r, o, s, i);
|
|
1439
|
+
if (d == null) return null;
|
|
1440
|
+
d.data && a(d.data, "expectedType") && c.push(d.data.expectedType);
|
|
1441
|
+
}
|
|
1442
|
+
var f = c.length > 0 ? ", expected one of type [" + c.join(", ") + "]" : "";
|
|
1443
|
+
return new h("Invalid " + o + " `" + s + "` supplied to " + ("`" + r + "`" + f + "."));
|
|
1444
|
+
}
|
|
1445
|
+
return g(r);
|
|
1446
|
+
}
|
|
1447
|
+
function E() {
|
|
1448
|
+
function e(e, t, n, r, i) {
|
|
1449
|
+
return A(e[t]) ? null : new h("Invalid " + r + " `" + i + "` supplied to " + ("`" + n + "`, expected a ReactNode."));
|
|
1450
|
+
}
|
|
1451
|
+
return g(e);
|
|
1452
|
+
}
|
|
1453
|
+
function D(e, t, n, r, i) {
|
|
1454
|
+
return new h((e || "React class") + ": " + t + " type `" + n + "." + r + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + i + "`.");
|
|
1455
|
+
}
|
|
1456
|
+
function O(e) {
|
|
1457
|
+
function t(t, n, r, a, o) {
|
|
1458
|
+
var s = t[n], c = M(s);
|
|
1459
|
+
if (c !== "object") return new h("Invalid " + a + " `" + o + "` of type `" + c + "` " + ("supplied to `" + r + "`, expected `object`."));
|
|
1460
|
+
for (var l in e) {
|
|
1461
|
+
var u = e[l];
|
|
1462
|
+
if (typeof u != "function") return D(r, a, o, l, N(u));
|
|
1463
|
+
var d = u(s, l, r, a, o + "." + l, i);
|
|
1464
|
+
if (d) return d;
|
|
1465
|
+
}
|
|
1466
|
+
return null;
|
|
1467
|
+
}
|
|
1468
|
+
return g(t);
|
|
1469
|
+
}
|
|
1470
|
+
function k(e) {
|
|
1471
|
+
function t(t, n, o, s, c) {
|
|
1472
|
+
var l = t[n], u = M(l);
|
|
1473
|
+
if (u !== "object") return new h("Invalid " + s + " `" + c + "` of type `" + u + "` " + ("supplied to `" + o + "`, expected `object`."));
|
|
1474
|
+
for (var d in r({}, t[n], e)) {
|
|
1475
|
+
var f = e[d];
|
|
1476
|
+
if (a(e, d) && typeof f != "function") return D(o, s, c, d, N(f));
|
|
1477
|
+
if (!f) return new h("Invalid " + s + " `" + c + "` key `" + d + "` supplied to `" + o + "`.\nBad object: " + JSON.stringify(t[n], null, " ") + "\nValid keys: " + JSON.stringify(Object.keys(e), null, " "));
|
|
1478
|
+
var p = f(l, d, o, s, c + "." + d, i);
|
|
1479
|
+
if (p) return p;
|
|
1480
|
+
}
|
|
1481
|
+
return null;
|
|
1482
|
+
}
|
|
1483
|
+
return g(t);
|
|
1484
|
+
}
|
|
1485
|
+
function A(t) {
|
|
1486
|
+
switch (typeof t) {
|
|
1487
|
+
case "number":
|
|
1488
|
+
case "string":
|
|
1489
|
+
case "undefined": return !0;
|
|
1490
|
+
case "boolean": return !t;
|
|
1491
|
+
case "object":
|
|
1492
|
+
if (Array.isArray(t)) return t.every(A);
|
|
1493
|
+
if (t === null || e(t)) return !0;
|
|
1494
|
+
var n = d(t);
|
|
1495
|
+
if (n) {
|
|
1496
|
+
var r = n.call(t), i;
|
|
1497
|
+
if (n !== t.entries) {
|
|
1498
|
+
for (; !(i = r.next()).done;) if (!A(i.value)) return !1;
|
|
1499
|
+
} else for (; !(i = r.next()).done;) {
|
|
1500
|
+
var a = i.value;
|
|
1501
|
+
if (a && !A(a[1])) return !1;
|
|
1502
|
+
}
|
|
1503
|
+
} else return !1;
|
|
1504
|
+
return !0;
|
|
1505
|
+
default: return !1;
|
|
1506
|
+
}
|
|
1507
|
+
}
|
|
1508
|
+
function j(e, t) {
|
|
1509
|
+
return e === "symbol" ? !0 : t ? t["@@toStringTag"] === "Symbol" || typeof Symbol == "function" && t instanceof Symbol : !1;
|
|
1510
|
+
}
|
|
1511
|
+
function M(e) {
|
|
1512
|
+
var t = typeof e;
|
|
1513
|
+
return Array.isArray(e) ? "array" : e instanceof RegExp ? "object" : j(t, e) ? "symbol" : t;
|
|
1514
|
+
}
|
|
1515
|
+
function N(e) {
|
|
1516
|
+
if (e == null) return "" + e;
|
|
1517
|
+
var t = M(e);
|
|
1518
|
+
if (t === "object") {
|
|
1519
|
+
if (e instanceof Date) return "date";
|
|
1520
|
+
if (e instanceof RegExp) return "regexp";
|
|
1521
|
+
}
|
|
1522
|
+
return t;
|
|
1523
|
+
}
|
|
1524
|
+
function P(e) {
|
|
1525
|
+
var t = N(e);
|
|
1526
|
+
switch (t) {
|
|
1527
|
+
case "array":
|
|
1528
|
+
case "object": return "an " + t;
|
|
1529
|
+
case "boolean":
|
|
1530
|
+
case "date":
|
|
1531
|
+
case "regexp": return "a " + t;
|
|
1532
|
+
default: return t;
|
|
1533
|
+
}
|
|
1534
|
+
}
|
|
1535
|
+
function F(e) {
|
|
1536
|
+
return !e.constructor || !e.constructor.name ? f : e.constructor.name;
|
|
1537
|
+
}
|
|
1538
|
+
return p.checkPropTypes = o, p.resetWarningCache = o.resetWarningCache, p.PropTypes = p, p;
|
|
1539
|
+
};
|
|
1540
|
+
})), xt = /* @__PURE__ */ U(((e, t) => {
|
|
1541
|
+
var n = _t();
|
|
1542
|
+
function r() {}
|
|
1543
|
+
function i() {}
|
|
1544
|
+
i.resetWarningCache = r, t.exports = function() {
|
|
1545
|
+
function e(e, t, r, i, a, o) {
|
|
1546
|
+
if (o !== n) {
|
|
1547
|
+
var s = /* @__PURE__ */ Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");
|
|
1548
|
+
throw s.name = "Invariant Violation", s;
|
|
1549
|
+
}
|
|
1550
|
+
}
|
|
1551
|
+
e.isRequired = e;
|
|
1552
|
+
function t() {
|
|
1553
|
+
return e;
|
|
1554
|
+
}
|
|
1555
|
+
var a = {
|
|
1556
|
+
array: e,
|
|
1557
|
+
bigint: e,
|
|
1558
|
+
bool: e,
|
|
1559
|
+
func: e,
|
|
1560
|
+
number: e,
|
|
1561
|
+
object: e,
|
|
1562
|
+
string: e,
|
|
1563
|
+
symbol: e,
|
|
1564
|
+
any: e,
|
|
1565
|
+
arrayOf: t,
|
|
1566
|
+
element: e,
|
|
1567
|
+
elementType: e,
|
|
1568
|
+
instanceOf: t,
|
|
1569
|
+
node: e,
|
|
1570
|
+
objectOf: t,
|
|
1571
|
+
oneOf: t,
|
|
1572
|
+
oneOfType: t,
|
|
1573
|
+
shape: t,
|
|
1574
|
+
exact: t,
|
|
1575
|
+
checkPropTypes: i,
|
|
1576
|
+
resetWarningCache: r
|
|
1577
|
+
};
|
|
1578
|
+
return a.PropTypes = a, a;
|
|
1579
|
+
};
|
|
1580
|
+
})), J = /* @__PURE__ */ ie((/* @__PURE__ */ U(((e, t) => {
|
|
1581
|
+
if (process.env.NODE_ENV !== "production") {
|
|
1582
|
+
var n = ht();
|
|
1583
|
+
t.exports = bt()(n.isElement, !0);
|
|
1584
|
+
} else t.exports = xt()();
|
|
1585
|
+
})))(), 1);
|
|
1586
|
+
function St(e, t) {
|
|
1587
|
+
var n = Object.keys(e);
|
|
1588
|
+
if (Object.getOwnPropertySymbols) {
|
|
1589
|
+
var r = Object.getOwnPropertySymbols(e);
|
|
1590
|
+
t && (r = r.filter(function(t) {
|
|
1591
|
+
return Object.getOwnPropertyDescriptor(e, t).enumerable;
|
|
1592
|
+
})), n.push.apply(n, r);
|
|
1593
|
+
}
|
|
1594
|
+
return n;
|
|
1595
|
+
}
|
|
1596
|
+
function Ct(e) {
|
|
1597
|
+
for (var t = 1; t < arguments.length; t++) {
|
|
1598
|
+
var n = arguments[t] == null ? {} : arguments[t];
|
|
1599
|
+
t % 2 ? St(Object(n), !0).forEach(function(t) {
|
|
1600
|
+
Tt(e, t, n[t]);
|
|
1601
|
+
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(n)) : St(Object(n)).forEach(function(t) {
|
|
1602
|
+
Object.defineProperty(e, t, Object.getOwnPropertyDescriptor(n, t));
|
|
1603
|
+
});
|
|
1604
|
+
}
|
|
1605
|
+
return e;
|
|
1606
|
+
}
|
|
1607
|
+
function wt(e) {
|
|
1608
|
+
"@babel/helpers - typeof";
|
|
1609
|
+
return wt = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(e) {
|
|
1610
|
+
return typeof e;
|
|
1611
|
+
} : function(e) {
|
|
1612
|
+
return e && typeof Symbol == "function" && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e;
|
|
1613
|
+
}, wt(e);
|
|
1614
|
+
}
|
|
1615
|
+
function Tt(e, t, n) {
|
|
1616
|
+
return t in e ? Object.defineProperty(e, t, {
|
|
1617
|
+
value: n,
|
|
1618
|
+
enumerable: !0,
|
|
1619
|
+
configurable: !0,
|
|
1620
|
+
writable: !0
|
|
1621
|
+
}) : e[t] = n, e;
|
|
1622
|
+
}
|
|
1623
|
+
function Et(e, t) {
|
|
1624
|
+
if (e == null) return {};
|
|
1625
|
+
var n = {}, r = Object.keys(e), i, a;
|
|
1626
|
+
for (a = 0; a < r.length; a++) i = r[a], !(t.indexOf(i) >= 0) && (n[i] = e[i]);
|
|
1627
|
+
return n;
|
|
1628
|
+
}
|
|
1629
|
+
function Dt(e, t) {
|
|
1630
|
+
if (e == null) return {};
|
|
1631
|
+
var n = Et(e, t), r, i;
|
|
1632
|
+
if (Object.getOwnPropertySymbols) {
|
|
1633
|
+
var a = Object.getOwnPropertySymbols(e);
|
|
1634
|
+
for (i = 0; i < a.length; i++) r = a[i], !(t.indexOf(r) >= 0) && Object.prototype.propertyIsEnumerable.call(e, r) && (n[r] = e[r]);
|
|
1635
|
+
}
|
|
1636
|
+
return n;
|
|
1637
|
+
}
|
|
1638
|
+
function Ot(e, t) {
|
|
1639
|
+
return kt(e) || At(e, t) || jt(e, t) || Nt();
|
|
1640
|
+
}
|
|
1641
|
+
function kt(e) {
|
|
1642
|
+
if (Array.isArray(e)) return e;
|
|
1643
|
+
}
|
|
1644
|
+
function At(e, t) {
|
|
1645
|
+
var n = e && (typeof Symbol < "u" && e[Symbol.iterator] || e["@@iterator"]);
|
|
1646
|
+
if (n != null) {
|
|
1647
|
+
var r = [], i = !0, a = !1, o, s;
|
|
1648
|
+
try {
|
|
1649
|
+
for (n = n.call(e); !(i = (o = n.next()).done) && (r.push(o.value), !(t && r.length === t)); i = !0);
|
|
1650
|
+
} catch (e) {
|
|
1651
|
+
a = !0, s = e;
|
|
1652
|
+
} finally {
|
|
1653
|
+
try {
|
|
1654
|
+
!i && n.return != null && n.return();
|
|
1655
|
+
} finally {
|
|
1656
|
+
if (a) throw s;
|
|
1657
|
+
}
|
|
1658
|
+
}
|
|
1659
|
+
return r;
|
|
1660
|
+
}
|
|
1661
|
+
}
|
|
1662
|
+
function jt(e, t) {
|
|
1663
|
+
if (e) {
|
|
1664
|
+
if (typeof e == "string") return Mt(e, t);
|
|
1665
|
+
var n = Object.prototype.toString.call(e).slice(8, -1);
|
|
1666
|
+
if (n === "Object" && e.constructor && (n = e.constructor.name), n === "Map" || n === "Set") return Array.from(e);
|
|
1667
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return Mt(e, t);
|
|
1668
|
+
}
|
|
1669
|
+
}
|
|
1670
|
+
function Mt(e, t) {
|
|
1671
|
+
(t == null || t > e.length) && (t = e.length);
|
|
1672
|
+
for (var n = 0, r = Array(t); n < t; n++) r[n] = e[n];
|
|
1673
|
+
return r;
|
|
1674
|
+
}
|
|
1675
|
+
function Nt() {
|
|
1676
|
+
throw TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
1677
|
+
}
|
|
1678
|
+
var Y = function(t, n, r) {
|
|
1679
|
+
var i = !!r, a = e.useRef(r);
|
|
1680
|
+
e.useEffect(function() {
|
|
1681
|
+
a.current = r;
|
|
1682
|
+
}, [r]), e.useEffect(function() {
|
|
1683
|
+
if (!i || !t) return function() {};
|
|
1684
|
+
var e = function() {
|
|
1685
|
+
a.current && a.current.apply(a, arguments);
|
|
1686
|
+
};
|
|
1687
|
+
return t.on(n, e), function() {
|
|
1688
|
+
t.off(n, e);
|
|
1689
|
+
};
|
|
1690
|
+
}, [
|
|
1691
|
+
i,
|
|
1692
|
+
n,
|
|
1693
|
+
t,
|
|
1694
|
+
a
|
|
1695
|
+
]);
|
|
1696
|
+
}, X = function(t) {
|
|
1697
|
+
var n = e.useRef(t);
|
|
1698
|
+
return e.useEffect(function() {
|
|
1699
|
+
n.current = t;
|
|
1700
|
+
}, [t]), n.current;
|
|
1701
|
+
}, Z = function(e) {
|
|
1702
|
+
return e !== null && wt(e) === "object";
|
|
1703
|
+
}, Pt = function(e) {
|
|
1704
|
+
return Z(e) && typeof e.then == "function";
|
|
1705
|
+
}, Ft = function(e) {
|
|
1706
|
+
return Z(e) && typeof e.elements == "function" && typeof e.createToken == "function" && typeof e.createPaymentMethod == "function" && typeof e.confirmCardPayment == "function";
|
|
1707
|
+
}, It = "[object Object]", Lt = function e(t, n) {
|
|
1708
|
+
if (!Z(t) || !Z(n)) return t === n;
|
|
1709
|
+
var r = Array.isArray(t);
|
|
1710
|
+
if (r !== Array.isArray(n)) return !1;
|
|
1711
|
+
var i = Object.prototype.toString.call(t) === It;
|
|
1712
|
+
if (i !== (Object.prototype.toString.call(n) === It)) return !1;
|
|
1713
|
+
if (!i && !r) return t === n;
|
|
1714
|
+
var a = Object.keys(t), o = Object.keys(n);
|
|
1715
|
+
if (a.length !== o.length) return !1;
|
|
1716
|
+
for (var s = {}, c = 0; c < a.length; c += 1) s[a[c]] = !0;
|
|
1717
|
+
for (var l = 0; l < o.length; l += 1) s[o[l]] = !0;
|
|
1718
|
+
var u = Object.keys(s);
|
|
1719
|
+
if (u.length !== a.length) return !1;
|
|
1720
|
+
var d = t, f = n;
|
|
1721
|
+
return u.every(function(t) {
|
|
1722
|
+
return e(d[t], f[t]);
|
|
1723
|
+
});
|
|
1724
|
+
}, Rt = function(e, t, n) {
|
|
1725
|
+
return Z(e) ? Object.keys(e).reduce(function(r, i) {
|
|
1726
|
+
var a = !Z(t) || !Lt(e[i], t[i]);
|
|
1727
|
+
return n.includes(i) ? (a && console.warn(`Unsupported prop change: options.${i} is not a mutable property.`), r) : a ? Ct(Ct({}, r || {}), {}, Tt({}, i, e[i])) : r;
|
|
1728
|
+
}, null) : null;
|
|
1729
|
+
}, zt = "Invalid prop `stripe` supplied to `Elements`. We recommend using the `loadStripe` utility from `@stripe/stripe-js`. See https://stripe.com/docs/stripe-js/react#elements-props-stripe for details.", Bt = function(e) {
|
|
1730
|
+
var t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : zt;
|
|
1731
|
+
if (e === null || Ft(e)) return e;
|
|
1732
|
+
throw Error(t);
|
|
1733
|
+
}, Vt = function(e) {
|
|
1734
|
+
var t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : zt;
|
|
1735
|
+
if (Pt(e)) return {
|
|
1736
|
+
tag: "async",
|
|
1737
|
+
stripePromise: Promise.resolve(e).then(function(e) {
|
|
1738
|
+
return Bt(e, t);
|
|
1739
|
+
})
|
|
1740
|
+
};
|
|
1741
|
+
var n = Bt(e, t);
|
|
1742
|
+
return n === null ? { tag: "empty" } : {
|
|
1743
|
+
tag: "sync",
|
|
1744
|
+
stripe: n
|
|
1745
|
+
};
|
|
1746
|
+
}, Ht = function(e) {
|
|
1747
|
+
!e || !e._registerWrapper || !e.registerAppInfo || (e._registerWrapper({
|
|
1748
|
+
name: "react-stripe-js",
|
|
1749
|
+
version: "6.4.0"
|
|
1750
|
+
}), e.registerAppInfo({
|
|
1751
|
+
name: "react-stripe-js",
|
|
1752
|
+
version: "6.4.0",
|
|
1753
|
+
url: "https://stripe.com/docs/stripe-js/react"
|
|
1754
|
+
}));
|
|
1755
|
+
}, Ut = /* @__PURE__ */ e.createContext(null);
|
|
1756
|
+
Ut.displayName = "ElementsContext";
|
|
1757
|
+
var Wt = function(e, t) {
|
|
1758
|
+
if (!e) throw Error(`Could not find Elements context; You need to wrap the part of your app that ${t} in an <Elements> provider.`);
|
|
1759
|
+
return e;
|
|
1760
|
+
}, Gt = function(t) {
|
|
1761
|
+
var n = t.stripe, r = t.options, i = t.children, a = e.useMemo(function() {
|
|
1762
|
+
return Vt(n);
|
|
1763
|
+
}, [n]), o = Ot(e.useState(function() {
|
|
1764
|
+
return {
|
|
1765
|
+
stripe: a.tag === "sync" ? a.stripe : null,
|
|
1766
|
+
elements: a.tag === "sync" ? a.stripe.elements(r) : null
|
|
1767
|
+
};
|
|
1768
|
+
}), 2), s = o[0], c = o[1];
|
|
1769
|
+
e.useEffect(function() {
|
|
1770
|
+
var e = !0, t = function(e) {
|
|
1771
|
+
c(function(t) {
|
|
1772
|
+
return t.stripe ? t : {
|
|
1773
|
+
stripe: e,
|
|
1774
|
+
elements: e.elements(r)
|
|
1775
|
+
};
|
|
1776
|
+
});
|
|
1777
|
+
};
|
|
1778
|
+
return a.tag === "async" && !s.stripe ? a.stripePromise.then(function(n) {
|
|
1779
|
+
n && e && t(n);
|
|
1780
|
+
}) : a.tag === "sync" && !s.stripe && t(a.stripe), function() {
|
|
1781
|
+
e = !1;
|
|
1782
|
+
};
|
|
1783
|
+
}, [
|
|
1784
|
+
a,
|
|
1785
|
+
s,
|
|
1786
|
+
r
|
|
1787
|
+
]);
|
|
1788
|
+
var l = X(n);
|
|
1789
|
+
e.useEffect(function() {
|
|
1790
|
+
l !== null && l !== n && console.warn("Unsupported prop change on Elements: You cannot change the `stripe` prop after setting it.");
|
|
1791
|
+
}, [l, n]);
|
|
1792
|
+
var u = X(r);
|
|
1793
|
+
return e.useEffect(function() {
|
|
1794
|
+
if (s.elements) {
|
|
1795
|
+
var e = Rt(r, u, ["clientSecret", "fonts"]);
|
|
1796
|
+
e && s.elements.update(e);
|
|
1797
|
+
}
|
|
1798
|
+
}, [
|
|
1799
|
+
r,
|
|
1800
|
+
u,
|
|
1801
|
+
s.elements
|
|
1802
|
+
]), e.useEffect(function() {
|
|
1803
|
+
Ht(s.stripe);
|
|
1804
|
+
}, [s.stripe]), /* @__PURE__ */ e.createElement(Ut.Provider, { value: s }, i);
|
|
1805
|
+
};
|
|
1806
|
+
Gt.propTypes = {
|
|
1807
|
+
stripe: J.default.any,
|
|
1808
|
+
options: J.default.object
|
|
1809
|
+
};
|
|
1810
|
+
var Kt = function(t) {
|
|
1811
|
+
return Wt(e.useContext(Ut), t);
|
|
1812
|
+
}, qt = function(e) {
|
|
1813
|
+
var t = e.children;
|
|
1814
|
+
return t(Kt("mounts <ElementsConsumer>"));
|
|
1815
|
+
};
|
|
1816
|
+
qt.propTypes = { children: J.default.func.isRequired };
|
|
1817
|
+
var Jt = /* @__PURE__ */ e.createContext(null);
|
|
1818
|
+
Jt.displayName = "CheckoutContext";
|
|
1819
|
+
var Yt = function(t) {
|
|
1820
|
+
var n = e.useContext(Jt), r = e.useContext(Ut);
|
|
1821
|
+
if (n) {
|
|
1822
|
+
if (r) throw Error(`You cannot wrap the part of your app that ${t} in both a checkout provider and <Elements> provider.`);
|
|
1823
|
+
return n;
|
|
1824
|
+
} else return Wt(r, t);
|
|
1825
|
+
}, Xt = ["mode"], Zt = function(e) {
|
|
1826
|
+
return e.charAt(0).toUpperCase() + e.slice(1);
|
|
1827
|
+
}, Q = function(t, n, r) {
|
|
1828
|
+
var i = `${Zt(t)}Element`, a = n ? function(t) {
|
|
1829
|
+
Yt(`mounts <${i}>`);
|
|
1830
|
+
var n = t.id, r = t.className;
|
|
1831
|
+
return /* @__PURE__ */ e.createElement("div", {
|
|
1832
|
+
id: n,
|
|
1833
|
+
className: r
|
|
1834
|
+
});
|
|
1835
|
+
} : function(n) {
|
|
1836
|
+
var r = n.id, a = n.className, o = n.options, s = o === void 0 ? {} : o, c = n.onBlur, l = n.onFocus, u = n.onReady, d = n.onChange, f = n.onEscape, p = n.onClick, m = n.onLoadError, h = n.onLoaderStart, g = n.onNetworksChange, _ = n.onConfirm, v = n.onCancel, y = n.onShippingAddressChange, b = n.onShippingRateChange, x = n.onSavedPaymentMethodRemove, S = n.onSavedPaymentMethodUpdate, C = n.onAvailablePaymentMethodsChange, w = Yt(`mounts <${i}>`), T = "elements" in w ? w.elements : null, E = "checkoutState" in w ? w.checkoutState : null, D = E?.type === "success" || E?.type === "loading" ? E.sdk : null, O = Ot(e.useState(null), 2), k = O[0], A = O[1], j = e.useRef(null), M = e.useRef(null);
|
|
1837
|
+
Y(k, "blur", c), Y(k, "focus", l), Y(k, "escape", f), Y(k, "click", p), Y(k, "loaderror", m), Y(k, "loaderstart", h), Y(k, "networkschange", g), Y(k, "confirm", _), Y(k, "cancel", v), Y(k, "shippingaddresschange", y), Y(k, "shippingratechange", b), Y(k, "savedpaymentmethodremove", x), Y(k, "savedpaymentmethodupdate", S), Y(k, "availablepaymentmethodschange", C), Y(k, "change", d);
|
|
1838
|
+
var N;
|
|
1839
|
+
u && (N = t === "expressCheckout" ? u : function() {
|
|
1840
|
+
u(k);
|
|
1841
|
+
}), Y(k, "ready", N), e.useLayoutEffect(function() {
|
|
1842
|
+
if (j.current === null && M.current !== null && (T || D)) {
|
|
1843
|
+
var e = null;
|
|
1844
|
+
if (D) {
|
|
1845
|
+
var n = D, r = D;
|
|
1846
|
+
switch (t) {
|
|
1847
|
+
case "paymentForm":
|
|
1848
|
+
e = r.createForm(s);
|
|
1849
|
+
break;
|
|
1850
|
+
case "payment":
|
|
1851
|
+
e = n.createPaymentElement(s);
|
|
1852
|
+
break;
|
|
1853
|
+
case "address":
|
|
1854
|
+
if ("mode" in s) {
|
|
1855
|
+
var a = s.mode, o = Dt(s, Xt);
|
|
1856
|
+
if (a === "shipping") e = n.createShippingAddressElement(o);
|
|
1857
|
+
else if (a === "billing") e = n.createBillingAddressElement(o);
|
|
1858
|
+
else throw Error("Invalid options.mode. mode must be 'billing' or 'shipping'.");
|
|
1859
|
+
} else throw Error("You must supply options.mode. mode must be 'billing' or 'shipping'.");
|
|
1860
|
+
break;
|
|
1861
|
+
case "expressCheckout":
|
|
1862
|
+
e = n.createExpressCheckoutElement(s);
|
|
1863
|
+
break;
|
|
1864
|
+
case "currencySelector":
|
|
1865
|
+
e = D.createCurrencySelectorElement();
|
|
1866
|
+
break;
|
|
1867
|
+
case "taxId":
|
|
1868
|
+
e = n.createTaxIdElement(s);
|
|
1869
|
+
break;
|
|
1870
|
+
case "contactDetails":
|
|
1871
|
+
e = n.createContactDetailsElement();
|
|
1872
|
+
break;
|
|
1873
|
+
default: throw Error(`<${i}> is not supported inside a checkout provider. Use an <Elements> provider instead.`);
|
|
1874
|
+
}
|
|
1875
|
+
} else T && (e = T.create(t, s));
|
|
1876
|
+
j.current = e, A(e), e && e.mount(M.current);
|
|
1877
|
+
}
|
|
1878
|
+
}, [
|
|
1879
|
+
T,
|
|
1880
|
+
D,
|
|
1881
|
+
s
|
|
1882
|
+
]);
|
|
1883
|
+
var P = X(s);
|
|
1884
|
+
return e.useEffect(function() {
|
|
1885
|
+
if (j.current) {
|
|
1886
|
+
var e = Rt(s, P, ["paymentRequest"]);
|
|
1887
|
+
e && "update" in j.current && j.current.update(e);
|
|
1888
|
+
}
|
|
1889
|
+
}, [s, P]), e.useLayoutEffect(function() {
|
|
1890
|
+
return function() {
|
|
1891
|
+
if (j.current && typeof j.current.destroy == "function") try {
|
|
1892
|
+
j.current.destroy(), j.current = null;
|
|
1893
|
+
} catch {}
|
|
1894
|
+
};
|
|
1895
|
+
}, []), /* @__PURE__ */ e.createElement("div", {
|
|
1896
|
+
id: r,
|
|
1897
|
+
className: a,
|
|
1898
|
+
ref: M
|
|
1899
|
+
});
|
|
1900
|
+
};
|
|
1901
|
+
return a.propTypes = {
|
|
1902
|
+
id: J.default.string,
|
|
1903
|
+
className: J.default.string,
|
|
1904
|
+
onChange: J.default.func,
|
|
1905
|
+
onBlur: J.default.func,
|
|
1906
|
+
onFocus: J.default.func,
|
|
1907
|
+
onReady: J.default.func,
|
|
1908
|
+
onEscape: J.default.func,
|
|
1909
|
+
onClick: J.default.func,
|
|
1910
|
+
onLoadError: J.default.func,
|
|
1911
|
+
onLoaderStart: J.default.func,
|
|
1912
|
+
onNetworksChange: J.default.func,
|
|
1913
|
+
onConfirm: J.default.func,
|
|
1914
|
+
onCancel: J.default.func,
|
|
1915
|
+
onShippingAddressChange: J.default.func,
|
|
1916
|
+
onShippingRateChange: J.default.func,
|
|
1917
|
+
onSavedPaymentMethodRemove: J.default.func,
|
|
1918
|
+
onSavedPaymentMethodUpdate: J.default.func,
|
|
1919
|
+
onAvailablePaymentMethodsChange: J.default.func,
|
|
1920
|
+
options: J.default.object
|
|
1921
|
+
}, a.displayName = i, a.__elementType = t, a;
|
|
1922
|
+
}, $ = typeof window > "u", Qt = /* @__PURE__ */ e.createContext(null);
|
|
1923
|
+
Qt.displayName = "EmbeddedCheckoutProviderContext";
|
|
1924
|
+
var $t = function() {
|
|
1925
|
+
var t = e.useContext(Qt);
|
|
1926
|
+
if (!t) throw Error("<EmbeddedCheckout> must be used within <EmbeddedCheckoutProvider>");
|
|
1927
|
+
return t;
|
|
1928
|
+
}, en = "Invalid prop `stripe` supplied to `EmbeddedCheckoutProvider`. We recommend using the `loadStripe` utility from `@stripe/stripe-js`. See https://stripe.com/docs/stripe-js/react#elements-props-stripe for details.", tn = function(t) {
|
|
1929
|
+
var n = t.stripe, r = t.options, i = t.children, a = e.useMemo(function() {
|
|
1930
|
+
return Vt(n, en);
|
|
1931
|
+
}, [n]), o = e.useRef(null), s = e.useRef(null), c = Ot(e.useState({ embeddedCheckout: null }), 2), l = c[0], u = c[1];
|
|
1932
|
+
e.useEffect(function() {
|
|
1933
|
+
if (!(s.current || o.current)) {
|
|
1934
|
+
var e = function(e) {
|
|
1935
|
+
s.current || o.current || (s.current = e, o.current = s.current.createEmbeddedCheckoutPage(r).then(function(e) {
|
|
1936
|
+
u({ embeddedCheckout: e });
|
|
1937
|
+
}));
|
|
1938
|
+
};
|
|
1939
|
+
a.tag === "async" && !s.current && (r.clientSecret || r.fetchClientSecret) ? a.stripePromise.then(function(t) {
|
|
1940
|
+
t && e(t);
|
|
1941
|
+
}) : a.tag === "sync" && !s.current && (r.clientSecret || r.fetchClientSecret) && e(a.stripe);
|
|
1942
|
+
}
|
|
1943
|
+
}, [
|
|
1944
|
+
a,
|
|
1945
|
+
r,
|
|
1946
|
+
l,
|
|
1947
|
+
s
|
|
1948
|
+
]), e.useEffect(function() {
|
|
1949
|
+
return function() {
|
|
1950
|
+
l.embeddedCheckout ? (o.current = null, l.embeddedCheckout.destroy()) : o.current && o.current.then(function() {
|
|
1951
|
+
o.current = null, l.embeddedCheckout && l.embeddedCheckout.destroy();
|
|
1952
|
+
});
|
|
1953
|
+
};
|
|
1954
|
+
}, [l.embeddedCheckout]), e.useEffect(function() {
|
|
1955
|
+
Ht(s);
|
|
1956
|
+
}, [s]);
|
|
1957
|
+
var d = X(n);
|
|
1958
|
+
e.useEffect(function() {
|
|
1959
|
+
d !== null && d !== n && console.warn("Unsupported prop change on EmbeddedCheckoutProvider: You cannot change the `stripe` prop after setting it.");
|
|
1960
|
+
}, [d, n]);
|
|
1961
|
+
var f = X(r);
|
|
1962
|
+
return e.useEffect(function() {
|
|
1963
|
+
if (f != null) {
|
|
1964
|
+
if (r == null) {
|
|
1965
|
+
console.warn("Unsupported prop change on EmbeddedCheckoutProvider: You cannot unset options after setting them.");
|
|
1966
|
+
return;
|
|
1967
|
+
}
|
|
1968
|
+
r.clientSecret === void 0 && r.fetchClientSecret === void 0 && console.warn("Invalid props passed to EmbeddedCheckoutProvider: You must provide one of either `options.fetchClientSecret` or `options.clientSecret`."), f.clientSecret != null && r.clientSecret !== f.clientSecret && console.warn("Unsupported prop change on EmbeddedCheckoutProvider: You cannot change the client secret after setting it. Unmount and create a new instance of EmbeddedCheckoutProvider instead."), f.fetchClientSecret != null && r.fetchClientSecret !== f.fetchClientSecret && console.warn("Unsupported prop change on EmbeddedCheckoutProvider: You cannot change fetchClientSecret after setting it. Unmount and create a new instance of EmbeddedCheckoutProvider instead."), f.onComplete != null && r.onComplete !== f.onComplete && console.warn("Unsupported prop change on EmbeddedCheckoutProvider: You cannot change the onComplete option after setting it."), f.onShippingDetailsChange != null && r.onShippingDetailsChange !== f.onShippingDetailsChange && console.warn("Unsupported prop change on EmbeddedCheckoutProvider: You cannot change the onShippingDetailsChange option after setting it."), f.onLineItemsChange != null && r.onLineItemsChange !== f.onLineItemsChange && console.warn("Unsupported prop change on EmbeddedCheckoutProvider: You cannot change the onLineItemsChange option after setting it.");
|
|
1969
|
+
}
|
|
1970
|
+
}, [f, r]), /* @__PURE__ */ e.createElement(Qt.Provider, { value: l }, i);
|
|
1971
|
+
}, nn = $ ? function(t) {
|
|
1972
|
+
var n = t.id, r = t.className;
|
|
1973
|
+
return $t(), /* @__PURE__ */ e.createElement("div", {
|
|
1974
|
+
id: n,
|
|
1975
|
+
className: r
|
|
1976
|
+
});
|
|
1977
|
+
} : function(t) {
|
|
1978
|
+
var n = t.id, r = t.className, i = $t().embeddedCheckout, a = e.useRef(!1), o = e.useRef(null);
|
|
1979
|
+
return e.useLayoutEffect(function() {
|
|
1980
|
+
return !a.current && i && o.current !== null && (i.mount(o.current), a.current = !0), function() {
|
|
1981
|
+
if (a.current && i) try {
|
|
1982
|
+
i.unmount(), a.current = !1;
|
|
1983
|
+
} catch {}
|
|
1984
|
+
};
|
|
1985
|
+
}, [i]), /* @__PURE__ */ e.createElement("div", {
|
|
1986
|
+
ref: o,
|
|
1987
|
+
id: n,
|
|
1988
|
+
className: r
|
|
1989
|
+
});
|
|
1990
|
+
};
|
|
1991
|
+
Q("auBankAccount", $), Q("card", $), Q("cardNumber", $), Q("cardExpiry", $), Q("cardCvc", $), Q("iban", $), Q("payment", $), Q("expressCheckout", $), Q("paymentRequestButton", $), Q("linkAuthentication", $), Q("contactDetails", $), Q("address", $), Q("shippingAddress", $), Q("paymentMethodMessaging", $), Q("taxId", $), Q("issuingCardNumberDisplay", $), Q("issuingCardCvcDisplay", $), Q("issuingCardExpiryDisplay", $), Q("issuingCardPinDisplay", $), Q("issuingCardCopyButton", $);
|
|
1992
|
+
//#endregion
|
|
1993
|
+
//#region node_modules/@stripe/stripe-js/dist/index.mjs
|
|
1994
|
+
function rn(e) {
|
|
1995
|
+
"@babel/helpers - typeof";
|
|
1996
|
+
return rn = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(e) {
|
|
1997
|
+
return typeof e;
|
|
1998
|
+
} : function(e) {
|
|
1999
|
+
return e && typeof Symbol == "function" && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e;
|
|
2000
|
+
}, rn(e);
|
|
2001
|
+
}
|
|
2002
|
+
var an = "dahlia", on = function(e) {
|
|
2003
|
+
return e === 3 ? "v3" : e;
|
|
2004
|
+
}, sn = "https://js.stripe.com", cn = `${sn}/${an}/stripe.js`, ln = /^https:\/\/js\.stripe\.com\/v3\/?(\?.*)?$/, un = /^https:\/\/js\.stripe\.com\/(v3|[a-z]+)\/stripe\.js(\?.*)?$/, dn = "loadStripe.setLoadParameters was called but an existing Stripe.js script already exists in the document; existing script parameters will be used", fn = function(e) {
|
|
2005
|
+
return ln.test(e) || un.test(e);
|
|
2006
|
+
}, pn = function() {
|
|
2007
|
+
for (var e = document.querySelectorAll(`script[src^="${sn}"]`), t = 0; t < e.length; t++) {
|
|
2008
|
+
var n = e[t];
|
|
2009
|
+
if (fn(n.src)) return n;
|
|
2010
|
+
}
|
|
2011
|
+
return null;
|
|
2012
|
+
}, mn = function(e) {
|
|
2013
|
+
var t = e && !e.advancedFraudSignals ? "?advancedFraudSignals=false" : "", n = document.createElement("script");
|
|
2014
|
+
n.src = `${cn}${t}`;
|
|
2015
|
+
var r = document.head || document.body;
|
|
2016
|
+
if (!r) throw Error("Expected document.body not to be null. Stripe.js requires a <body> element.");
|
|
2017
|
+
return r.appendChild(n), n;
|
|
2018
|
+
}, hn = function(e, t) {
|
|
2019
|
+
!e || !e._registerWrapper || e._registerWrapper({
|
|
2020
|
+
name: "stripe-js",
|
|
2021
|
+
version: "9.6.0",
|
|
2022
|
+
startTime: t
|
|
2023
|
+
});
|
|
2024
|
+
}, gn = null, _n = null, vn = null, yn = function(e) {
|
|
2025
|
+
return function(t) {
|
|
2026
|
+
e(Error("Failed to load Stripe.js", { cause: t }));
|
|
2027
|
+
};
|
|
2028
|
+
}, bn = function(e, t) {
|
|
2029
|
+
return function() {
|
|
2030
|
+
window.Stripe ? e(window.Stripe) : t(/* @__PURE__ */ Error("Stripe.js not available"));
|
|
2031
|
+
};
|
|
2032
|
+
}, xn = function(e) {
|
|
2033
|
+
return gn === null ? (gn = new Promise(function(t, n) {
|
|
2034
|
+
if (typeof window > "u" || typeof document > "u") {
|
|
2035
|
+
t(null);
|
|
2036
|
+
return;
|
|
2037
|
+
}
|
|
2038
|
+
if (window.Stripe && e && console.warn(dn), window.Stripe) {
|
|
2039
|
+
t(window.Stripe);
|
|
2040
|
+
return;
|
|
2041
|
+
}
|
|
2042
|
+
try {
|
|
2043
|
+
var r = pn();
|
|
2044
|
+
if (r && e) console.warn(dn);
|
|
2045
|
+
else if (!r) r = mn(e);
|
|
2046
|
+
else if (r && vn !== null && _n !== null) {
|
|
2047
|
+
var i;
|
|
2048
|
+
r.removeEventListener("load", vn), r.removeEventListener("error", _n), (i = r.parentNode) == null || i.removeChild(r), r = mn(e);
|
|
2049
|
+
}
|
|
2050
|
+
vn = bn(t, n), _n = yn(n), r.addEventListener("load", vn), r.addEventListener("error", _n);
|
|
2051
|
+
} catch (e) {
|
|
2052
|
+
n(e);
|
|
2053
|
+
return;
|
|
2054
|
+
}
|
|
2055
|
+
}), gn.catch(function(e) {
|
|
2056
|
+
return gn = null, Promise.reject(e);
|
|
2057
|
+
})) : gn;
|
|
2058
|
+
}, Sn = function(e, t, n) {
|
|
2059
|
+
if (e === null) return null;
|
|
2060
|
+
var r = t[0];
|
|
2061
|
+
if (typeof r != "string") throw Error(`Expected publishable key to be of type string, got type ${rn(r)} instead.`);
|
|
2062
|
+
var i = r.match(/^pk_test/), a = on(e.version), o = an;
|
|
2063
|
+
i && a !== o && console.warn(`Stripe.js@${a} was loaded on the page, but @stripe/stripe-js@9.6.0 expected Stripe.js@${o}. This may result in unexpected behavior. For more information, see https://docs.stripe.com/sdks/stripejs-versioning`);
|
|
2064
|
+
var s = e.apply(void 0, t);
|
|
2065
|
+
return hn(s, n), s;
|
|
2066
|
+
}, Cn, wn = !1, Tn = function() {
|
|
2067
|
+
return Cn || (Cn = xn(null).catch(function(e) {
|
|
2068
|
+
return Cn = null, Promise.reject(e);
|
|
2069
|
+
}), Cn);
|
|
2070
|
+
};
|
|
2071
|
+
Promise.resolve().then(function() {
|
|
2072
|
+
return Tn();
|
|
2073
|
+
}).catch(function(e) {
|
|
2074
|
+
wn || console.warn(e);
|
|
2075
|
+
});
|
|
2076
|
+
var En = function() {
|
|
2077
|
+
var e = [...arguments];
|
|
2078
|
+
wn = !0;
|
|
2079
|
+
var t = Date.now();
|
|
2080
|
+
return Tn().then(function(n) {
|
|
2081
|
+
return Sn(n, e, t);
|
|
2082
|
+
});
|
|
2083
|
+
};
|
|
2084
|
+
//#endregion
|
|
2085
|
+
//#region src/header/components/StripePaymentModal.tsx
|
|
2086
|
+
function Dn({ visible: e, publishableKey: s, order: c, text: l, onCancel: u, onSuccess: d }) {
|
|
2087
|
+
let f = r(() => s ? En(s) : null, [s]), [p, m] = a(""), h = i(d), g = c?.clientSecret || c?.stripeClientSecret, _ = t(() => {
|
|
2088
|
+
h.current();
|
|
2089
|
+
}, []), y = r(() => g ? {
|
|
2090
|
+
clientSecret: g,
|
|
2091
|
+
onComplete: _
|
|
2092
|
+
} : void 0, [g, _]);
|
|
2093
|
+
n(() => {
|
|
2094
|
+
h.current = d;
|
|
2095
|
+
}, [d]), n(() => {
|
|
2096
|
+
if (m(""), !f) return;
|
|
2097
|
+
let e = !0;
|
|
2098
|
+
return f.then((t) => {
|
|
2099
|
+
e && !t && m(l.stripePaymentLoadFailed);
|
|
2100
|
+
}).catch((t) => {
|
|
2101
|
+
e && m(t instanceof Error ? t.message : l.stripePaymentLoadFailed);
|
|
2102
|
+
}), () => {
|
|
2103
|
+
e = !1;
|
|
2104
|
+
};
|
|
2105
|
+
}, [f, l.stripePaymentLoadFailed]);
|
|
2106
|
+
let b = s ? g ? g.startsWith("cs_") ? p ? /* @__PURE__ */ L(o, {
|
|
2107
|
+
type: "error",
|
|
2108
|
+
content: p
|
|
2109
|
+
}) : !f || !y ? /* @__PURE__ */ L("div", {
|
|
2110
|
+
className: "flex min-h-30 items-center justify-center",
|
|
2111
|
+
children: /* @__PURE__ */ L(x, { tip: l.stripePaymentLoading })
|
|
2112
|
+
}) : /* @__PURE__ */ R("div", {
|
|
2113
|
+
className: "flex h-full w-full flex-col gap-4",
|
|
2114
|
+
children: [/* @__PURE__ */ L(T.Text, {
|
|
2115
|
+
type: "secondary",
|
|
2116
|
+
className: "text-sm! leading-6!",
|
|
2117
|
+
children: l.stripePaymentDescription
|
|
2118
|
+
}), /* @__PURE__ */ L(tn, {
|
|
2119
|
+
stripe: f,
|
|
2120
|
+
options: y,
|
|
2121
|
+
children: /* @__PURE__ */ L(nn, { className: "min-h-[620px] w-full flex-1" })
|
|
2122
|
+
}, g)]
|
|
2123
|
+
}) : /* @__PURE__ */ L(o, {
|
|
2124
|
+
type: "error",
|
|
2125
|
+
content: l.stripeCheckoutClientSecretInvalid
|
|
2126
|
+
}) : /* @__PURE__ */ L(o, {
|
|
2127
|
+
type: "error",
|
|
2128
|
+
content: l.stripePaymentClientSecretMissing
|
|
2129
|
+
}) : /* @__PURE__ */ L(o, {
|
|
2130
|
+
type: "error",
|
|
2131
|
+
content: l.stripePaymentConfigMissing
|
|
2132
|
+
});
|
|
2133
|
+
return /* @__PURE__ */ L(v, {
|
|
2134
|
+
title: l.stripePaymentTitle,
|
|
2135
|
+
visible: e,
|
|
2136
|
+
footer: null,
|
|
2137
|
+
onCancel: u,
|
|
2138
|
+
alignCenter: !1,
|
|
2139
|
+
wrapStyle: { padding: 0 },
|
|
2140
|
+
style: {
|
|
2141
|
+
width: "100vw",
|
|
2142
|
+
maxWidth: "100vw",
|
|
2143
|
+
height: "100vh",
|
|
2144
|
+
top: 0,
|
|
2145
|
+
margin: 0,
|
|
2146
|
+
padding: 0
|
|
2147
|
+
},
|
|
2148
|
+
className: "flex! flex-col rounded-none! [&_.arco-modal-content]:flex-1 [&_.arco-modal-content]:overflow-auto",
|
|
2149
|
+
focusLock: !1,
|
|
2150
|
+
children: b
|
|
2151
|
+
});
|
|
2152
|
+
}
|
|
2153
|
+
//#endregion
|
|
989
2154
|
//#region src/header/components/UserMenu.tsx
|
|
990
|
-
function
|
|
991
|
-
let
|
|
992
|
-
return /* @__PURE__ */
|
|
2155
|
+
function On({ user: e, points: t, text: n, onEditProfile: r, onRecharge: i, onPointsDetail: a, onLogout: o }) {
|
|
2156
|
+
let s = (e) => new Intl.NumberFormat().format(e);
|
|
2157
|
+
return /* @__PURE__ */ R("div", {
|
|
993
2158
|
className: "w-80 overflow-hidden rounded-xl border border-arco-border-2 bg-arco-bg-popup shadow-[0_10px_28px_rgb(0_0_0/12%)]",
|
|
994
2159
|
children: [
|
|
995
|
-
/* @__PURE__ */
|
|
2160
|
+
/* @__PURE__ */ R("div", {
|
|
996
2161
|
className: "flex items-center gap-3 px-6 pt-5 pb-4",
|
|
997
|
-
children: [/* @__PURE__ */
|
|
2162
|
+
children: [/* @__PURE__ */ L(lt, {
|
|
998
2163
|
user: e,
|
|
999
2164
|
size: 48,
|
|
1000
2165
|
className: "shrink-0"
|
|
1001
|
-
}), /* @__PURE__ */
|
|
2166
|
+
}), /* @__PURE__ */ R("div", {
|
|
1002
2167
|
className: "flex min-w-0 flex-1 flex-col gap-1",
|
|
1003
|
-
children: [/* @__PURE__ */
|
|
2168
|
+
children: [/* @__PURE__ */ R("div", {
|
|
1004
2169
|
className: "flex min-w-0 items-center gap-1.5",
|
|
1005
|
-
children: [/* @__PURE__ */
|
|
2170
|
+
children: [/* @__PURE__ */ L("span", {
|
|
1006
2171
|
className: "text-arco-text-1 truncate text-base leading-6 font-bold",
|
|
1007
2172
|
children: e?.nickname || e?.username
|
|
1008
|
-
}), /* @__PURE__ */
|
|
2173
|
+
}), /* @__PURE__ */ L(c, {
|
|
1009
2174
|
type: "text",
|
|
1010
2175
|
size: "mini",
|
|
1011
|
-
icon: /* @__PURE__ */
|
|
2176
|
+
icon: /* @__PURE__ */ L(k, {}),
|
|
1012
2177
|
className: "text-arco-text-3 h-6! min-w-6! px-0!",
|
|
1013
2178
|
onClick: r
|
|
1014
2179
|
})]
|
|
1015
|
-
}), e?.email ? /* @__PURE__ */
|
|
2180
|
+
}), e?.email ? /* @__PURE__ */ L("span", {
|
|
1016
2181
|
className: "text-arco-text-3 truncate text-xs leading-5",
|
|
1017
2182
|
children: e.email
|
|
1018
2183
|
}) : null]
|
|
1019
2184
|
})]
|
|
1020
2185
|
}),
|
|
1021
|
-
/* @__PURE__ */
|
|
1022
|
-
/* @__PURE__ */
|
|
2186
|
+
/* @__PURE__ */ L(d, { className: "m-0!" }),
|
|
2187
|
+
/* @__PURE__ */ R("ul", {
|
|
1023
2188
|
className: "flex flex-col gap-3.5 px-6 py-4",
|
|
1024
2189
|
children: [
|
|
1025
|
-
/* @__PURE__ */
|
|
2190
|
+
/* @__PURE__ */ R("li", {
|
|
1026
2191
|
className: "text-arco-text-2 flex items-center justify-between gap-4 text-sm",
|
|
1027
|
-
children: [/* @__PURE__ */
|
|
2192
|
+
children: [/* @__PURE__ */ L("span", { children: n.myPoints }), /* @__PURE__ */ L("strong", {
|
|
1028
2193
|
className: "text-arco-primary-6 text-base font-bold",
|
|
1029
|
-
children:
|
|
2194
|
+
children: s(t.total)
|
|
1030
2195
|
})]
|
|
1031
2196
|
}),
|
|
1032
|
-
/* @__PURE__ */
|
|
2197
|
+
/* @__PURE__ */ R("li", {
|
|
1033
2198
|
className: "text-arco-text-2 flex items-center justify-between gap-4 text-sm",
|
|
1034
|
-
children: [/* @__PURE__ */
|
|
2199
|
+
children: [/* @__PURE__ */ L("span", { children: n.rechargePoints }), /* @__PURE__ */ L("strong", {
|
|
1035
2200
|
className: "text-arco-text-1 text-base font-bold",
|
|
1036
|
-
children:
|
|
2201
|
+
children: s(t.recharge)
|
|
1037
2202
|
})]
|
|
1038
2203
|
}),
|
|
1039
|
-
/* @__PURE__ */
|
|
2204
|
+
/* @__PURE__ */ R("li", {
|
|
1040
2205
|
className: "text-arco-text-2 flex items-center justify-between gap-4 text-sm",
|
|
1041
|
-
children: [/* @__PURE__ */
|
|
2206
|
+
children: [/* @__PURE__ */ L("span", { children: n.giftedPoints }), /* @__PURE__ */ L("strong", {
|
|
1042
2207
|
className: "text-arco-text-1 text-base font-bold",
|
|
1043
|
-
children:
|
|
2208
|
+
children: s(t.gifted)
|
|
1044
2209
|
})]
|
|
1045
2210
|
})
|
|
1046
2211
|
]
|
|
1047
2212
|
}),
|
|
1048
|
-
/* @__PURE__ */
|
|
1049
|
-
/* @__PURE__ */
|
|
2213
|
+
/* @__PURE__ */ L(d, { className: "m-0!" }),
|
|
2214
|
+
/* @__PURE__ */ R("div", {
|
|
1050
2215
|
className: "flex flex-col gap-2 px-6 py-4",
|
|
1051
|
-
children: [/* @__PURE__ */
|
|
2216
|
+
children: [/* @__PURE__ */ L(c, {
|
|
1052
2217
|
type: "primary",
|
|
1053
2218
|
long: !0,
|
|
1054
|
-
icon: /* @__PURE__ */
|
|
1055
|
-
|
|
2219
|
+
icon: /* @__PURE__ */ L(N, {}),
|
|
2220
|
+
shape: "round",
|
|
2221
|
+
className: "h-10! font-medium!",
|
|
1056
2222
|
onClick: i,
|
|
1057
2223
|
children: n.recharge
|
|
1058
|
-
}), /* @__PURE__ */
|
|
2224
|
+
}), /* @__PURE__ */ L(c, {
|
|
1059
2225
|
long: !0,
|
|
1060
|
-
|
|
1061
|
-
|
|
2226
|
+
shape: "round",
|
|
2227
|
+
icon: /* @__PURE__ */ L(A, {}),
|
|
2228
|
+
className: "border-arco-border-2! bg-arco-fill-1! text-arco-text-1! h-10! font-medium!",
|
|
1062
2229
|
onClick: a,
|
|
1063
2230
|
children: n.pointsDetail
|
|
1064
2231
|
})]
|
|
1065
2232
|
}),
|
|
1066
|
-
/* @__PURE__ */
|
|
1067
|
-
/* @__PURE__ */
|
|
2233
|
+
/* @__PURE__ */ L(d, { className: "m-0!" }),
|
|
2234
|
+
/* @__PURE__ */ L("div", {
|
|
1068
2235
|
className: "px-6 py-4",
|
|
1069
|
-
children: /* @__PURE__ */
|
|
1070
|
-
icon: /* @__PURE__ */
|
|
2236
|
+
children: /* @__PURE__ */ L(c, {
|
|
2237
|
+
icon: /* @__PURE__ */ L(P, {}),
|
|
1071
2238
|
type: "text",
|
|
1072
2239
|
status: "danger",
|
|
1073
2240
|
long: !0,
|
|
1074
2241
|
className: "flex! items-center justify-start gap-2 text-sm text-arco-text-2",
|
|
1075
|
-
onClick: () => void
|
|
2242
|
+
onClick: () => void o?.(),
|
|
1076
2243
|
children: n.logout
|
|
1077
2244
|
})
|
|
1078
2245
|
})
|
|
@@ -1081,246 +2248,296 @@ function Je({ user: e, points: t, text: n, onEditProfile: r, onRecharge: i, onPo
|
|
|
1081
2248
|
}
|
|
1082
2249
|
//#endregion
|
|
1083
2250
|
//#region src/header/ManturHeader.tsx
|
|
1084
|
-
var
|
|
2251
|
+
var kn = "https://mantur.ai/images/logo.png", An = [
|
|
1085
2252
|
"from-arco-primary-light-1 to-arco-primary-light-2 text-arco-primary-6",
|
|
1086
2253
|
"from-arco-success-light-1 to-arco-success-light-2 text-arco-success-6",
|
|
1087
2254
|
"from-arco-warning-light-1 to-arco-warning-light-2 text-arco-warning-6",
|
|
1088
2255
|
"from-arco-danger-light-1 to-arco-danger-light-2 text-arco-danger-6"
|
|
1089
2256
|
];
|
|
1090
|
-
function
|
|
1091
|
-
return `flex h-8 min-h-8 w-8 min-w-8 flex-none items-center justify-center rounded-lg bg-linear-to-br font-bold leading-none ${
|
|
2257
|
+
function jn(e, t = !1) {
|
|
2258
|
+
return `flex h-8 min-h-8 w-8 min-w-8 flex-none items-center justify-center rounded-lg bg-linear-to-br font-bold leading-none ${An[e % An.length]} ${t ? "shadow-[inset_0_1px_3px_rgb(0_0_0/8%)]" : ""}`;
|
|
1092
2259
|
}
|
|
1093
|
-
function
|
|
2260
|
+
function Mn(e) {
|
|
1094
2261
|
return e?.tenantName?.[0]?.toUpperCase() || "T";
|
|
1095
2262
|
}
|
|
1096
|
-
function
|
|
2263
|
+
function Nn(e, t, n) {
|
|
1097
2264
|
let r = e?.roles?.map((e) => e.roleName).filter(Boolean);
|
|
1098
2265
|
return r?.length ? r.join(", ") : e?.isOwner ? t : n;
|
|
1099
2266
|
}
|
|
1100
|
-
function
|
|
1101
|
-
|
|
2267
|
+
function Pn(e) {
|
|
2268
|
+
return e?.paymentUrl || e?.checkoutUrl || e?.url || e?.returnUrl;
|
|
2269
|
+
}
|
|
2270
|
+
function Fn(e) {
|
|
2271
|
+
return e?.clientSecret || e?.stripeClientSecret;
|
|
2272
|
+
}
|
|
2273
|
+
function In({ user: e, disabled: o = !1, brandSlot: s, children: c, onTenantContextChange: l, stripePublishableKey: u }) {
|
|
2274
|
+
let [d, p] = a(() => He()), m = Ue(d), [h, v] = a(!1), [y, b] = a(!1), [x, S] = a(!1), [C, w] = a(e), [T, E] = a([]), [D, k] = a(), [A, j] = a(!1), [M, N] = a(!1), [P, F] = a(!1), [I, ee] = a([]), [te, z] = a(), B = i(l), ne = u || (typeof window < "u" ? window.__MANTUR_COMPONENTS_STRIPE_PUBLISHABLE_KEY__ : void 0) || "pk_test_51TJ8JiERSsQknDG7bJSIX81RFq3LcCfUXCV7mh0cQsZ2dwmYcJ5Ki6bPXynNvdyZEEBE83I6I719NIFyO9Qreey700yPAul8sv", [V, re] = a({
|
|
1102
2275
|
total: 0,
|
|
1103
2276
|
recharge: 0,
|
|
1104
2277
|
gifted: 0
|
|
1105
|
-
}),
|
|
1106
|
-
total:
|
|
1107
|
-
recharge:
|
|
1108
|
-
gifted:
|
|
1109
|
-
},
|
|
1110
|
-
let t = await
|
|
1111
|
-
return t &&
|
|
2278
|
+
}), H = D?.tenantId || "", U = o, W = {
|
|
2279
|
+
total: V.total ?? 0,
|
|
2280
|
+
recharge: V.recharge ?? 0,
|
|
2281
|
+
gifted: V.gifted ?? 0
|
|
2282
|
+
}, ie = async (e) => {
|
|
2283
|
+
let t = await ge(e);
|
|
2284
|
+
return t && w(t), t;
|
|
1112
2285
|
};
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
}, [
|
|
1116
|
-
|
|
2286
|
+
n(() => {
|
|
2287
|
+
w(e);
|
|
2288
|
+
}, [e]), n(() => {
|
|
2289
|
+
B.current = l;
|
|
1117
2290
|
}, [l]);
|
|
1118
|
-
let
|
|
1119
|
-
E(e.tenants),
|
|
2291
|
+
let G = t((e) => {
|
|
2292
|
+
E(e.tenants), k(e.currentTenant), B.current?.(e);
|
|
1120
2293
|
}, []);
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
console.warn("Failed to refresh Mantur tenant context.", e),
|
|
1124
|
-
}).finally(() =>
|
|
1125
|
-
}, [
|
|
2294
|
+
n(() => {
|
|
2295
|
+
j(!0), Me().then(G).catch((e) => {
|
|
2296
|
+
console.warn("Failed to refresh Mantur tenant context.", e), _.error(m.error);
|
|
2297
|
+
}).finally(() => j(!1));
|
|
2298
|
+
}, [G, m.error]), n(() => {
|
|
1126
2299
|
let e = (e) => {
|
|
1127
|
-
e instanceof CustomEvent &&
|
|
2300
|
+
e instanceof CustomEvent && re(e.detail);
|
|
1128
2301
|
};
|
|
1129
|
-
return window.addEventListener(
|
|
2302
|
+
return window.addEventListener(oe, e), ye().catch((e) => {
|
|
1130
2303
|
console.warn("Failed to refresh Mantur user points.", e);
|
|
1131
2304
|
}), () => {
|
|
1132
|
-
window.removeEventListener(
|
|
2305
|
+
window.removeEventListener(oe, e);
|
|
1133
2306
|
};
|
|
1134
|
-
}, []),
|
|
2307
|
+
}, []), n(() => {
|
|
1135
2308
|
let e = (e) => {
|
|
1136
|
-
|
|
2309
|
+
p(e instanceof CustomEvent ? q(e.detail) : He());
|
|
1137
2310
|
};
|
|
1138
|
-
return window.addEventListener(
|
|
1139
|
-
window.removeEventListener(
|
|
2311
|
+
return window.addEventListener(Be, e), window.addEventListener("storage", e), () => {
|
|
2312
|
+
window.removeEventListener(Be, e), window.removeEventListener("storage", e);
|
|
1140
2313
|
};
|
|
1141
|
-
}, [])
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
|
|
2314
|
+
}, []), n(() => {
|
|
2315
|
+
y && (N(!0), be().then((e) => {
|
|
2316
|
+
let t = e.filter((e) => e.id && e.amount !== void 0 && e.points !== void 0).sort((e, t) => (e.sortOrder ?? 0) - (t.sortOrder ?? 0)).map((e) => ({
|
|
2317
|
+
id: e.id,
|
|
2318
|
+
packageCode: e.packageCode,
|
|
2319
|
+
packageName: e.packageName,
|
|
2320
|
+
packageNameEn: e.packageNameEn,
|
|
2321
|
+
price: Number(e.amount || 0),
|
|
2322
|
+
points: Number(e.points || 0),
|
|
2323
|
+
recommended: e.isRecommended,
|
|
2324
|
+
sortOrder: e.sortOrder
|
|
2325
|
+
}));
|
|
2326
|
+
t.length > 0 && ee(t);
|
|
2327
|
+
}).catch((e) => {
|
|
2328
|
+
console.warn("Failed to load Mantur recharge packages.", e);
|
|
2329
|
+
}).finally(() => N(!1)));
|
|
2330
|
+
}, [y]);
|
|
2331
|
+
let ae = (e) => {
|
|
2332
|
+
_.success(e);
|
|
2333
|
+
}, ce = (e, t) => {
|
|
2334
|
+
console.error(t), _.error(e);
|
|
2335
|
+
}, le = t(async (e) => {
|
|
2336
|
+
if (!U && e !== H) try {
|
|
2337
|
+
j(!0), G(await Ne(e)), ae(m.switchedToTeam);
|
|
1149
2338
|
} catch (e) {
|
|
1150
|
-
|
|
2339
|
+
ce(m.error, e);
|
|
1151
2340
|
} finally {
|
|
1152
|
-
|
|
2341
|
+
j(!1);
|
|
1153
2342
|
}
|
|
1154
2343
|
}, [
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
]),
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
2344
|
+
G,
|
|
2345
|
+
H,
|
|
2346
|
+
U,
|
|
2347
|
+
m.error,
|
|
2348
|
+
m.switchedToTeam
|
|
2349
|
+
]), ue = async (e) => {
|
|
2350
|
+
try {
|
|
2351
|
+
F(!0);
|
|
2352
|
+
let t = await xe({ ..."custom" in e && e.custom ? { customAmount: e.price } : { packageId: e.id } });
|
|
2353
|
+
typeof window < "u" && window.dispatchEvent(new CustomEvent(se, { detail: t })), _.success(m.rechargeOrderCreated), b(!1);
|
|
2354
|
+
let n = Pn(t);
|
|
2355
|
+
if (Fn(t)) {
|
|
2356
|
+
z(t);
|
|
2357
|
+
return;
|
|
2358
|
+
}
|
|
2359
|
+
if (n) {
|
|
2360
|
+
window.location.href = n;
|
|
2361
|
+
return;
|
|
2362
|
+
}
|
|
2363
|
+
_.error(m.stripePaymentClientSecretMissing);
|
|
2364
|
+
} catch (e) {
|
|
2365
|
+
ce(m.error, e);
|
|
2366
|
+
} finally {
|
|
2367
|
+
F(!1);
|
|
2368
|
+
}
|
|
2369
|
+
}, de = r(() => /* @__PURE__ */ R(g, {
|
|
1168
2370
|
className: "w-56 rounded-xl bg-arco-bg-popup shadow-[0_10px_28px_rgb(0_0_0/12%)] [&_.arco-menu-inner]:px-2 [&_.arco-menu-inner]:py-1",
|
|
1169
|
-
selectedKeys:
|
|
1170
|
-
onClickMenuItem:
|
|
1171
|
-
children: [/* @__PURE__ */
|
|
2371
|
+
selectedKeys: H ? [H] : [],
|
|
2372
|
+
onClickMenuItem: le,
|
|
2373
|
+
children: [/* @__PURE__ */ L("div", {
|
|
1172
2374
|
className: "px-3 py-2 text-xs font-semibold tracking-[0.04em] text-arco-text-4 uppercase",
|
|
1173
|
-
children:
|
|
1174
|
-
}),
|
|
2375
|
+
children: m.switchTeam
|
|
2376
|
+
}), T.map((e, t) => /* @__PURE__ */ L(g.Item, {
|
|
1175
2377
|
className: "mb-1 h-auto! min-h-10! overflow-visible! rounded-lg! px-2! py-1! leading-normal!",
|
|
1176
|
-
children: /* @__PURE__ */
|
|
2378
|
+
children: /* @__PURE__ */ R("div", {
|
|
1177
2379
|
className: "flex w-full items-center gap-3 leading-normal",
|
|
1178
|
-
children: [/* @__PURE__ */
|
|
1179
|
-
className:
|
|
1180
|
-
children:
|
|
1181
|
-
}), /* @__PURE__ */
|
|
2380
|
+
children: [/* @__PURE__ */ L("div", {
|
|
2381
|
+
className: jn(t),
|
|
2382
|
+
children: Mn(e)
|
|
2383
|
+
}), /* @__PURE__ */ R("div", {
|
|
1182
2384
|
className: "flex min-w-0 flex-col justify-center gap-0.75",
|
|
1183
|
-
children: [/* @__PURE__ */
|
|
2385
|
+
children: [/* @__PURE__ */ L("span", {
|
|
1184
2386
|
className: "text-sm leading-5 font-medium text-arco-text-1",
|
|
1185
2387
|
children: e.tenantName
|
|
1186
|
-
}), /* @__PURE__ */
|
|
2388
|
+
}), /* @__PURE__ */ L("span", {
|
|
1187
2389
|
className: "text-xs leading-4 text-arco-text-3",
|
|
1188
|
-
children:
|
|
2390
|
+
children: Nn(e, m.owner, m.member)
|
|
1189
2391
|
})]
|
|
1190
2392
|
})]
|
|
1191
2393
|
})
|
|
1192
2394
|
}, e.tenantId))]
|
|
1193
2395
|
}), [
|
|
2396
|
+
le,
|
|
1194
2397
|
H,
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
return /* @__PURE__ */ I("div", {
|
|
2398
|
+
T,
|
|
2399
|
+
m
|
|
2400
|
+
]), fe = /* @__PURE__ */ L(On, {
|
|
2401
|
+
user: C,
|
|
2402
|
+
points: W,
|
|
2403
|
+
text: m,
|
|
2404
|
+
onEditProfile: () => v(!0),
|
|
2405
|
+
onRecharge: () => b(!0),
|
|
2406
|
+
onPointsDetail: () => S(!0),
|
|
2407
|
+
onLogout: he
|
|
2408
|
+
}), pe = Math.max(0, T.findIndex((e) => e.tenantId === D?.tenantId));
|
|
2409
|
+
return /* @__PURE__ */ R("div", {
|
|
1208
2410
|
className: "flex h-20 items-center justify-between bg-transparent pr-8 shadow-[0_2px_10px_rgb(0_0_0/2%)] backdrop-blur-md max-md:pr-4",
|
|
1209
2411
|
children: [
|
|
1210
|
-
/* @__PURE__ */
|
|
2412
|
+
/* @__PURE__ */ R("div", {
|
|
1211
2413
|
className: "flex items-center gap-6",
|
|
1212
|
-
children: [/* @__PURE__ */
|
|
2414
|
+
children: [/* @__PURE__ */ R("div", {
|
|
1213
2415
|
className: "flex w-65 items-center gap-3 px-8 max-md:w-auto max-md:px-4",
|
|
1214
|
-
children: [/* @__PURE__ */
|
|
2416
|
+
children: [/* @__PURE__ */ L("div", {
|
|
1215
2417
|
className: "relative flex w-12 items-center justify-center overflow-hidden ",
|
|
1216
|
-
children: /* @__PURE__ */
|
|
1217
|
-
src:
|
|
2418
|
+
children: /* @__PURE__ */ L("img", {
|
|
2419
|
+
src: kn,
|
|
1218
2420
|
alt: "logo",
|
|
1219
2421
|
className: "w-full object-contain",
|
|
1220
2422
|
onError: (e) => {
|
|
1221
2423
|
e.currentTarget.style.display = "none";
|
|
1222
2424
|
}
|
|
1223
2425
|
})
|
|
1224
|
-
}), s ?? /* @__PURE__ */
|
|
2426
|
+
}), s ?? /* @__PURE__ */ L("span", {
|
|
1225
2427
|
className: "text-lg font-bold tracking-normal text-arco-text-1",
|
|
1226
|
-
children:
|
|
2428
|
+
children: m.title
|
|
1227
2429
|
})]
|
|
1228
|
-
}), /* @__PURE__ */
|
|
1229
|
-
droplist:
|
|
2430
|
+
}), /* @__PURE__ */ L(f, {
|
|
2431
|
+
droplist: de,
|
|
1230
2432
|
trigger: "click",
|
|
1231
2433
|
position: "bl",
|
|
1232
|
-
disabled:
|
|
1233
|
-
children: /* @__PURE__ */
|
|
1234
|
-
"aria-disabled":
|
|
1235
|
-
className: `flex items-center gap-3 rounded-full border border-arco-border-1 bg-arco-bg-1 px-2 py-1.5 transition-all ${
|
|
2434
|
+
disabled: U,
|
|
2435
|
+
children: /* @__PURE__ */ R("div", {
|
|
2436
|
+
"aria-disabled": U,
|
|
2437
|
+
className: `flex items-center gap-3 rounded-full border border-arco-border-1 bg-arco-bg-1 px-2 py-1.5 transition-all ${U ? "cursor-not-allowed opacity-60" : "cursor-pointer hover:bg-arco-fill-2 hover:shadow-[0_4px_12px_rgb(0_0_0/8%)]"}`,
|
|
1236
2438
|
children: [
|
|
1237
|
-
/* @__PURE__ */
|
|
1238
|
-
className:
|
|
1239
|
-
children:
|
|
2439
|
+
/* @__PURE__ */ L("div", {
|
|
2440
|
+
className: jn(pe, !0),
|
|
2441
|
+
children: Mn(D)
|
|
1240
2442
|
}),
|
|
1241
|
-
/* @__PURE__ */
|
|
2443
|
+
/* @__PURE__ */ R("div", {
|
|
1242
2444
|
className: "flex min-w-0 flex-col",
|
|
1243
|
-
children: [/* @__PURE__ */
|
|
2445
|
+
children: [/* @__PURE__ */ L("span", {
|
|
1244
2446
|
className: "text-xs leading-none font-bold text-arco-text-1",
|
|
1245
|
-
children:
|
|
1246
|
-
}), /* @__PURE__ */
|
|
2447
|
+
children: A ? m.loading : D?.tenantName || m.loading
|
|
2448
|
+
}), /* @__PURE__ */ L("span", {
|
|
1247
2449
|
className: "mt-1 text-[10px] leading-none text-arco-text-3",
|
|
1248
|
-
children:
|
|
2450
|
+
children: Nn(D, m.owner, m.member)
|
|
1249
2451
|
})]
|
|
1250
2452
|
}),
|
|
1251
|
-
/* @__PURE__ */
|
|
2453
|
+
/* @__PURE__ */ L(O, { className: "ml-1 text-arco-text-3" })
|
|
1252
2454
|
]
|
|
1253
2455
|
})
|
|
1254
2456
|
})]
|
|
1255
2457
|
}),
|
|
1256
|
-
/* @__PURE__ */
|
|
2458
|
+
/* @__PURE__ */ L("div", {
|
|
1257
2459
|
className: "flex-1",
|
|
1258
2460
|
children: c
|
|
1259
2461
|
}),
|
|
1260
|
-
/* @__PURE__ */
|
|
2462
|
+
/* @__PURE__ */ R("div", {
|
|
1261
2463
|
className: "flex items-center gap-4",
|
|
1262
|
-
children: [/* @__PURE__ */
|
|
2464
|
+
children: [/* @__PURE__ */ R("div", {
|
|
1263
2465
|
className: "flex items-center gap-4",
|
|
1264
|
-
children: [/* @__PURE__ */
|
|
1265
|
-
}), /* @__PURE__ */
|
|
1266
|
-
droplist:
|
|
2466
|
+
children: [/* @__PURE__ */ L(Je, {}), /* @__PURE__ */ L(qe, {})]
|
|
2467
|
+
}), /* @__PURE__ */ L(f, {
|
|
2468
|
+
droplist: fe,
|
|
1267
2469
|
trigger: "click",
|
|
1268
2470
|
position: "br",
|
|
1269
2471
|
onVisibleChange: (e) => {
|
|
1270
|
-
e &&
|
|
2472
|
+
e && ye().catch((e) => {
|
|
1271
2473
|
console.warn("Failed to refresh Mantur user points.", e);
|
|
1272
2474
|
});
|
|
1273
2475
|
},
|
|
1274
|
-
children: /* @__PURE__ */
|
|
2476
|
+
children: /* @__PURE__ */ R("div", {
|
|
1275
2477
|
className: "hover:bg-arco-fill-2 flex cursor-pointer items-center gap-2.5 rounded-full border border-transparent p-1 pr-2 transition-all",
|
|
1276
2478
|
children: [
|
|
1277
|
-
/* @__PURE__ */
|
|
2479
|
+
/* @__PURE__ */ R("div", {
|
|
1278
2480
|
className: "from-arco-primary to-transparent relative rounded-full bg-linear-to-br p-0.5 shadow-sm",
|
|
1279
|
-
children: [/* @__PURE__ */
|
|
1280
|
-
user:
|
|
2481
|
+
children: [/* @__PURE__ */ L(lt, {
|
|
2482
|
+
user: C,
|
|
1281
2483
|
size: 36
|
|
1282
|
-
}), /* @__PURE__ */
|
|
2484
|
+
}), /* @__PURE__ */ L("div", { className: "bg-arco-success border-arco-bg-white absolute right-0 bottom-0 h-3 w-3 rounded-full border-2 shadow-sm" })]
|
|
1283
2485
|
}),
|
|
1284
|
-
/* @__PURE__ */
|
|
2486
|
+
/* @__PURE__ */ L("div", {
|
|
1285
2487
|
className: "hidden flex-col md:flex",
|
|
1286
|
-
children: /* @__PURE__ */
|
|
2488
|
+
children: /* @__PURE__ */ L("span", {
|
|
1287
2489
|
className: "text-arco-text-1 text-sm font-medium",
|
|
1288
|
-
children:
|
|
2490
|
+
children: C?.nickname || C?.username
|
|
1289
2491
|
})
|
|
1290
2492
|
}),
|
|
1291
|
-
/* @__PURE__ */
|
|
2493
|
+
/* @__PURE__ */ L(O, { className: "text-arco-text-3 ml-1" })
|
|
1292
2494
|
]
|
|
1293
2495
|
})
|
|
1294
2496
|
})]
|
|
1295
2497
|
}),
|
|
1296
|
-
/* @__PURE__ */
|
|
1297
|
-
visible:
|
|
1298
|
-
user:
|
|
1299
|
-
labels:
|
|
1300
|
-
onCancel: () =>
|
|
1301
|
-
onSubmit:
|
|
2498
|
+
/* @__PURE__ */ L(st, {
|
|
2499
|
+
visible: h,
|
|
2500
|
+
user: C,
|
|
2501
|
+
labels: m,
|
|
2502
|
+
onCancel: () => v(!1),
|
|
2503
|
+
onSubmit: ie
|
|
2504
|
+
}),
|
|
2505
|
+
/* @__PURE__ */ L(ft, {
|
|
2506
|
+
visible: y,
|
|
2507
|
+
user: C,
|
|
2508
|
+
points: W,
|
|
2509
|
+
text: m,
|
|
2510
|
+
packages: I,
|
|
2511
|
+
packageLoading: M,
|
|
2512
|
+
submitting: P,
|
|
2513
|
+
onCancel: () => b(!1),
|
|
2514
|
+
onPay: ue
|
|
1302
2515
|
}),
|
|
1303
|
-
/* @__PURE__ */
|
|
1304
|
-
visible:
|
|
1305
|
-
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
|
|
1309
|
-
onPay: te
|
|
2516
|
+
/* @__PURE__ */ L(tt, {
|
|
2517
|
+
visible: x,
|
|
2518
|
+
points: W,
|
|
2519
|
+
text: m,
|
|
2520
|
+
onCancel: () => S(!1),
|
|
2521
|
+
onRecharge: () => b(!0)
|
|
1310
2522
|
}),
|
|
1311
|
-
/* @__PURE__ */
|
|
1312
|
-
visible:
|
|
1313
|
-
|
|
1314
|
-
|
|
1315
|
-
|
|
1316
|
-
|
|
2523
|
+
/* @__PURE__ */ L(Dn, {
|
|
2524
|
+
visible: !!te,
|
|
2525
|
+
publishableKey: ne,
|
|
2526
|
+
order: te,
|
|
2527
|
+
text: m,
|
|
2528
|
+
onCancel: () => z(void 0),
|
|
2529
|
+
onSuccess: () => {
|
|
2530
|
+
_.success(m.rechargeSuccess), z(void 0), ye().catch((e) => {
|
|
2531
|
+
console.warn("Failed to refresh Mantur user points.", e);
|
|
2532
|
+
});
|
|
2533
|
+
}
|
|
1317
2534
|
})
|
|
1318
2535
|
]
|
|
1319
2536
|
});
|
|
1320
2537
|
}
|
|
1321
2538
|
//#endregion
|
|
1322
2539
|
//#region src/utils/date.ts
|
|
1323
|
-
var
|
|
2540
|
+
var Ln = /* @__PURE__ */ ie((/* @__PURE__ */ U(((e, t) => {
|
|
1324
2541
|
(function(n, r) {
|
|
1325
2542
|
typeof e == "object" && t !== void 0 ? t.exports = r() : typeof define == "function" && define.amd ? define(r) : (n = typeof globalThis < "u" ? globalThis : n || self).dayjs = r();
|
|
1326
2543
|
})(e, (function() {
|
|
@@ -1615,27 +2832,27 @@ var et = /* @__PURE__ */ re((/* @__PURE__ */ te(((e, t) => {
|
|
|
1615
2832
|
}, w.en = b[y], w.Ls = b, w.p = {}, w;
|
|
1616
2833
|
}));
|
|
1617
2834
|
})))(), 1);
|
|
1618
|
-
function
|
|
2835
|
+
function Rn(e, t = "datetime", n) {
|
|
1619
2836
|
if (!e) return "-";
|
|
1620
|
-
let r = (n ?
|
|
1621
|
-
return (0,
|
|
2837
|
+
let r = (n ? q(n) : He()).startsWith("en"), i = t === "date" ? r ? "MM/DD/YYYY" : "YYYY-MM-DD" : r ? "MM/DD/YYYY HH:mm:ss" : "YYYY-MM-DD HH:mm:ss";
|
|
2838
|
+
return (0, Ln.default)(e).format(i);
|
|
1622
2839
|
}
|
|
1623
2840
|
//#endregion
|
|
1624
2841
|
//#region src/utils/url.ts
|
|
1625
|
-
var
|
|
2842
|
+
var zn = () => {
|
|
1626
2843
|
if (typeof window > "u" || !window.location?.href) throw Error("redirectToManturMain requires currentUrl when window.location is unavailable.");
|
|
1627
2844
|
return window.location.href;
|
|
1628
|
-
},
|
|
2845
|
+
}, Bn = (e, t) => {
|
|
1629
2846
|
let n = e.split(".");
|
|
1630
2847
|
return n.length <= 1 ? t : [t, ...n.slice(1)].join(".");
|
|
1631
|
-
},
|
|
1632
|
-
function
|
|
1633
|
-
let r = new URL(n.currentUrl ||
|
|
1634
|
-
a ? i.hostname =
|
|
1635
|
-
let o =
|
|
2848
|
+
}, Vn = (e) => `${e.pathname}${e.search}${e.hash}`;
|
|
2849
|
+
function Hn(e, t, n = {}) {
|
|
2850
|
+
let r = new URL(n.currentUrl || zn()), i = new URL(r.toString()), a = e?.trim();
|
|
2851
|
+
a ? i.hostname = Bn(r.hostname, a) : i.port = "80";
|
|
2852
|
+
let o = Vn(r);
|
|
1636
2853
|
i.pathname = "/login", i.searchParams.set("app", t?.trim()), i.searchParams.set("redirect", o);
|
|
1637
2854
|
let s = i.toString();
|
|
1638
2855
|
return n.navigate !== !1 && typeof window < "u" && (window.location.href = s), s;
|
|
1639
2856
|
}
|
|
1640
2857
|
//#endregion
|
|
1641
|
-
export {
|
|
2858
|
+
export { oe as MANTUR_POINTS_REFRESH_EVENT, se as MANTUR_RECHARGE_ORDER_CREATED_EVENT, ce as MANTUR_TENANT_CONTEXT_CHANGE_EVENT, In as ManturHeader, xe as createManturRechargeOrder, Rn as formatDateByLang, Te as getManturBillingAccount, Ee as getManturBillingLedger, be as getManturBillingPackages, we as getManturPricingChargePoint, Ce as getManturPricingChargePoints, Se as getManturRechargeOrder, Hn as redirectToManturMain, Me as refreshManturTenantContext, ye as refreshManturUserPoints };
|