mantur-components 0.1.5 → 0.1.7
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 +19 -1
- package/dist/index.d.ts +2 -0
- package/dist/mantur-components.js +267 -250
- package/dist/mantur-components.umd.cjs +1 -1
- package/dist/utils/url.d.ts +17 -0
- package/package.json +1 -1
|
@@ -1,53 +1,53 @@
|
|
|
1
1
|
import { useCallback as e, useEffect as t, useMemo as n, useRef as r, useState as i } from "react";
|
|
2
2
|
import { Avatar as a, Button as o, Card as s, DatePicker as c, Divider as l, Dropdown as u, Form as d, Grid as f, Input as p, Menu as m, Message as h, Modal as g, Pagination as _, Select as v, Table as y, Tabs as b, Tag as x, Typography as S, Upload as C } from "@arco-design/web-react";
|
|
3
|
-
import { IconCheckCircleFill as w, IconDown as T, IconEdit as E, IconFile as D, IconLanguage as O, IconMoonFill as
|
|
4
|
-
import { useTranslation as
|
|
5
|
-
import { jsx as
|
|
6
|
-
import { useTheme as
|
|
3
|
+
import { IconCheckCircleFill as w, IconDown as T, IconEdit as E, IconFile as D, IconLanguage as O, IconMoonFill as ee, IconPlus as k, IconPoweroff as A, IconSunFill as j, IconUpload as M } from "@arco-design/web-react/icon";
|
|
4
|
+
import { useTranslation as N } from "react-i18next";
|
|
5
|
+
import { jsx as P, jsxs as F } from "react/jsx-runtime";
|
|
6
|
+
import { useTheme as I } from "next-themes";
|
|
7
7
|
//#region \0rolldown/runtime.js
|
|
8
|
-
var
|
|
9
|
-
if (t && typeof t == "object" || typeof t == "function") for (var i =
|
|
8
|
+
var L = Object.create, R = Object.defineProperty, z = Object.getOwnPropertyDescriptor, B = Object.getOwnPropertyNames, V = Object.getPrototypeOf, H = Object.prototype.hasOwnProperty, te = (e, t) => () => (t || (e((t = { exports: {} }).exports, t), e = null), t.exports), ne = (e, t, n, r) => {
|
|
9
|
+
if (t && typeof t == "object" || typeof t == "function") for (var i = B(t), a = 0, o = i.length, s; a < o; a++) s = i[a], !H.call(e, s) && s !== n && R(e, s, {
|
|
10
10
|
get: ((e) => t[e]).bind(null, s),
|
|
11
|
-
enumerable: !(r =
|
|
11
|
+
enumerable: !(r = z(t, s)) || r.enumerable
|
|
12
12
|
});
|
|
13
13
|
return e;
|
|
14
|
-
},
|
|
14
|
+
}, re = (e, t, n) => (n = e == null ? {} : L(V(e)), ne(t || !e || !e.__esModule ? R(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)), ie = "/api", ae = "/users/me/points", U = "mantur-points-refresh", oe = "mantur-tenant-context-change";
|
|
18
|
+
function se() {
|
|
19
|
+
return typeof window < "u" && window.__MANTUR_COMPONENTS_API_BASE__ ? window.__MANTUR_COMPONENTS_API_BASE__ : ie;
|
|
20
20
|
}
|
|
21
|
-
function
|
|
22
|
-
return typeof window < "u" && window.__MANTUR_COMPONENTS_POINTS_ENDPOINT__ ? window.__MANTUR_COMPONENTS_POINTS_ENDPOINT__ :
|
|
21
|
+
function ce() {
|
|
22
|
+
return typeof window < "u" && window.__MANTUR_COMPONENTS_POINTS_ENDPOINT__ ? window.__MANTUR_COMPONENTS_POINTS_ENDPOINT__ : ae;
|
|
23
23
|
}
|
|
24
|
-
function
|
|
24
|
+
function W(e) {
|
|
25
25
|
if (typeof document > "u") return;
|
|
26
26
|
let t = `${encodeURIComponent(e)}=`;
|
|
27
27
|
return document.cookie.split("; ").find((e) => e.startsWith(t))?.slice(t.length);
|
|
28
28
|
}
|
|
29
|
-
function
|
|
29
|
+
function G(e) {
|
|
30
30
|
if (typeof document > "u") return;
|
|
31
31
|
let t = encodeURIComponent(e), n = window.location.hostname, r = [void 0, n], i = n.split(".");
|
|
32
32
|
i.length >= 2 && r.push(`.${i.slice(-2).join(".")}`), r.forEach((e) => {
|
|
33
33
|
document.cookie = `${t}=; path=/; max-age=0${e ? `; domain=${e}` : ""}`;
|
|
34
34
|
});
|
|
35
35
|
}
|
|
36
|
-
function
|
|
36
|
+
function le(e) {
|
|
37
37
|
let t = JSON.parse(e || "null");
|
|
38
38
|
if (!t) throw Error("Request failed");
|
|
39
39
|
if (t.code !== 0) throw Error(t.message || "Request failed");
|
|
40
40
|
return t;
|
|
41
41
|
}
|
|
42
|
-
async function
|
|
43
|
-
let n =
|
|
42
|
+
async function K(e, t = {}) {
|
|
43
|
+
let n = W("front-token"), r = W("Accept-Language"), i = t.headers || {};
|
|
44
44
|
return n && (i.Authorization = decodeURIComponent(n)), r && (i["Accept-Language"] = decodeURIComponent(r)), new Promise((n, r) => {
|
|
45
45
|
let a = new XMLHttpRequest();
|
|
46
|
-
a.open(t.method || "GET", `${
|
|
46
|
+
a.open(t.method || "GET", `${se()}${e}`, !0), a.timeout = t.timeout || 1e4, Object.entries(i).forEach(([e, t]) => {
|
|
47
47
|
a.setRequestHeader(e, t);
|
|
48
48
|
}), a.onload = () => {
|
|
49
49
|
try {
|
|
50
|
-
let e =
|
|
50
|
+
let e = le(a.responseText);
|
|
51
51
|
if (a.status < 200 || a.status >= 300) {
|
|
52
52
|
r(Error(e.message || a.statusText));
|
|
53
53
|
return;
|
|
@@ -59,31 +59,31 @@ async function J(e, t = {}) {
|
|
|
59
59
|
}, a.onerror = () => r(/* @__PURE__ */ Error("Network request failed")), a.ontimeout = () => r(/* @__PURE__ */ Error("Network request timed out")), a.send(t.body ?? null);
|
|
60
60
|
});
|
|
61
61
|
}
|
|
62
|
-
async function
|
|
62
|
+
async function ue() {
|
|
63
63
|
try {
|
|
64
|
-
await
|
|
64
|
+
await K("/auth/front-logout", { method: "DELETE" });
|
|
65
65
|
} catch (e) {
|
|
66
66
|
console.warn("Logout request failed, continuing local logout.", e);
|
|
67
67
|
} finally {
|
|
68
|
-
|
|
68
|
+
G("front-token"), G("refreshToken"), typeof window < "u" && window.location.reload();
|
|
69
69
|
}
|
|
70
70
|
}
|
|
71
|
-
async function
|
|
71
|
+
async function de(e) {
|
|
72
72
|
let t;
|
|
73
73
|
if (e.avatarFile) {
|
|
74
74
|
let n = new FormData();
|
|
75
|
-
n.append("file", e.avatarFile), t = (await
|
|
75
|
+
n.append("file", e.avatarFile), t = (await K("/users/me/avatar", {
|
|
76
76
|
method: "POST",
|
|
77
77
|
body: n
|
|
78
78
|
})).data;
|
|
79
79
|
}
|
|
80
|
-
return (await
|
|
80
|
+
return (await K("/users/me", {
|
|
81
81
|
method: "PUT",
|
|
82
82
|
headers: { "Content-Type": "application/json;charset=utf-8" },
|
|
83
83
|
body: JSON.stringify({ nickname: e.nickname })
|
|
84
84
|
})).data || t;
|
|
85
85
|
}
|
|
86
|
-
function
|
|
86
|
+
function fe(e) {
|
|
87
87
|
let t = (...t) => {
|
|
88
88
|
let n = t.map((t) => e?.[t]).find((e) => e !== void 0);
|
|
89
89
|
return typeof n == "number" ? n : Number(n || 0);
|
|
@@ -94,14 +94,14 @@ function ue(e) {
|
|
|
94
94
|
gifted: t("gifted", "giftedPoints", "bonusPoints")
|
|
95
95
|
};
|
|
96
96
|
}
|
|
97
|
-
async function
|
|
98
|
-
return
|
|
97
|
+
async function pe() {
|
|
98
|
+
return fe((await K(ce())).data);
|
|
99
99
|
}
|
|
100
|
-
async function
|
|
101
|
-
let e = await
|
|
102
|
-
return typeof window < "u" && window.dispatchEvent(new CustomEvent(
|
|
100
|
+
async function q() {
|
|
101
|
+
let e = await pe();
|
|
102
|
+
return typeof window < "u" && window.dispatchEvent(new CustomEvent(U, { detail: e })), e;
|
|
103
103
|
}
|
|
104
|
-
function
|
|
104
|
+
function me(e, t) {
|
|
105
105
|
return t?.tenantId ? e.find((e) => e.tenantId === t.tenantId) || {
|
|
106
106
|
tenantId: t.tenantId,
|
|
107
107
|
tenantName: t.tenantName || t.tenantId,
|
|
@@ -111,35 +111,35 @@ function pe(e, t) {
|
|
|
111
111
|
}))
|
|
112
112
|
} : e.find((e) => e.isOwner) || e[0];
|
|
113
113
|
}
|
|
114
|
-
function
|
|
115
|
-
typeof window < "u" && (window.__MANTUR_COMPONENTS_TENANT_CONTEXT__ = e, window.dispatchEvent(new CustomEvent(
|
|
114
|
+
function J(e) {
|
|
115
|
+
typeof window < "u" && (window.__MANTUR_COMPONENTS_TENANT_CONTEXT__ = e, window.dispatchEvent(new CustomEvent(oe, { detail: e })));
|
|
116
116
|
}
|
|
117
117
|
async function he() {
|
|
118
|
-
return (await
|
|
118
|
+
return (await K("/users/me/tenants")).data || [];
|
|
119
119
|
}
|
|
120
120
|
async function ge() {
|
|
121
|
-
return (await
|
|
121
|
+
return (await K("/auth/current-tenant")).data;
|
|
122
122
|
}
|
|
123
123
|
async function _e(e) {
|
|
124
|
-
return (await
|
|
124
|
+
return (await K(`/auth/current-tenant/${e}`, { method: "PUT" })).data;
|
|
125
125
|
}
|
|
126
126
|
async function ve(e = "refresh") {
|
|
127
127
|
let [t, n] = await Promise.all([he(), ge()]), r = {
|
|
128
128
|
tenants: t,
|
|
129
|
-
currentTenant:
|
|
129
|
+
currentTenant: me(t, n),
|
|
130
130
|
auth: n,
|
|
131
131
|
reason: e
|
|
132
132
|
};
|
|
133
|
-
return
|
|
133
|
+
return J(r), r;
|
|
134
134
|
}
|
|
135
135
|
async function ye(e) {
|
|
136
136
|
let t = await _e(e), n = await he(), r = {
|
|
137
137
|
tenants: n,
|
|
138
|
-
currentTenant:
|
|
138
|
+
currentTenant: me(n, t),
|
|
139
139
|
auth: t,
|
|
140
140
|
reason: "switch"
|
|
141
141
|
};
|
|
142
|
-
return
|
|
142
|
+
return J(r), r;
|
|
143
143
|
}
|
|
144
144
|
var be = {
|
|
145
145
|
title: "Mantur",
|
|
@@ -279,33 +279,33 @@ function Ae(e, t) {
|
|
|
279
279
|
document.cookie = `${encodeURIComponent(e)}=${encodeURIComponent(t)}; path=/`;
|
|
280
280
|
}
|
|
281
281
|
function je() {
|
|
282
|
-
let { i18n: e } =
|
|
282
|
+
let { i18n: e } = N(), [n, r] = i(() => Z()), a = De(n);
|
|
283
283
|
return t(() => {
|
|
284
284
|
r(X(e.language));
|
|
285
|
-
}, [e.language]), /* @__PURE__ */
|
|
286
|
-
droplist: /* @__PURE__ */
|
|
285
|
+
}, [e.language]), /* @__PURE__ */ P(u, {
|
|
286
|
+
droplist: /* @__PURE__ */ F(m, {
|
|
287
287
|
selectedKeys: [n],
|
|
288
288
|
onClickMenuItem: (t) => {
|
|
289
289
|
let n = X(t);
|
|
290
290
|
localStorage.setItem(Oe, t), localStorage.setItem(ke, "manual"), r(n), e.changeLanguage(t), Ae("Accept-Language", t), window.dispatchEvent(new CustomEvent(Y, { detail: n })), window.location.reload();
|
|
291
291
|
},
|
|
292
|
-
children: [/* @__PURE__ */
|
|
292
|
+
children: [/* @__PURE__ */ P(m.Item, { children: a.languageZh }, "zh-CN"), /* @__PURE__ */ P(m.Item, { children: a.languageEn }, "en-US")]
|
|
293
293
|
}),
|
|
294
294
|
trigger: "click",
|
|
295
295
|
position: "br",
|
|
296
|
-
children: /* @__PURE__ */
|
|
296
|
+
children: /* @__PURE__ */ P(o, {
|
|
297
297
|
shape: "circle",
|
|
298
|
-
icon: /* @__PURE__ */
|
|
298
|
+
icon: /* @__PURE__ */ P(O, {})
|
|
299
299
|
})
|
|
300
300
|
});
|
|
301
301
|
}
|
|
302
302
|
//#endregion
|
|
303
303
|
//#region src/theme-switch/ThemeSwitch.tsx
|
|
304
304
|
function Me() {
|
|
305
|
-
let { resolvedTheme: e, setTheme: t } =
|
|
306
|
-
return /* @__PURE__ */
|
|
305
|
+
let { resolvedTheme: e, setTheme: t } = I();
|
|
306
|
+
return /* @__PURE__ */ P(o, {
|
|
307
307
|
shape: "circle",
|
|
308
|
-
icon:
|
|
308
|
+
icon: P(e === "light" ? ee : j, {}),
|
|
309
309
|
onClick: () => {
|
|
310
310
|
t(e === "light" ? "dark" : "light");
|
|
311
311
|
}
|
|
@@ -427,12 +427,12 @@ function Re({ visible: e, points: t, text: r, onCancel: a, onRecharge: c }) {
|
|
|
427
427
|
{
|
|
428
428
|
title: r.pointsDetail,
|
|
429
429
|
dataIndex: "name",
|
|
430
|
-
render: (e, t) => /* @__PURE__ */
|
|
430
|
+
render: (e, t) => /* @__PURE__ */ F("div", {
|
|
431
431
|
className: "min-w-0",
|
|
432
|
-
children: [/* @__PURE__ */
|
|
432
|
+
children: [/* @__PURE__ */ P(S.Text, {
|
|
433
433
|
className: "font-medium!",
|
|
434
434
|
children: t.name
|
|
435
|
-
}), /* @__PURE__ */
|
|
435
|
+
}), /* @__PURE__ */ P(S.Text, {
|
|
436
436
|
type: "secondary",
|
|
437
437
|
className: "mt-1 block! text-xs!",
|
|
438
438
|
children: t.meta
|
|
@@ -444,7 +444,7 @@ function Re({ visible: e, points: t, text: r, onCancel: a, onRecharge: c }) {
|
|
|
444
444
|
dataIndex: "amount",
|
|
445
445
|
width: 120,
|
|
446
446
|
align: "right",
|
|
447
|
-
render: (e, t) => /* @__PURE__ */
|
|
447
|
+
render: (e, t) => /* @__PURE__ */ F(S.Text, {
|
|
448
448
|
className: `font-semibold! ${t.amount > 0 ? "text-arco-success-6!" : "text-arco-danger-6!"}`,
|
|
449
449
|
children: [t.amount > 0 ? "+" : "", E(t.amount)]
|
|
450
450
|
})
|
|
@@ -454,23 +454,23 @@ function Re({ visible: e, points: t, text: r, onCancel: a, onRecharge: c }) {
|
|
|
454
454
|
dataIndex: "badgeText",
|
|
455
455
|
width: 110,
|
|
456
456
|
align: "right",
|
|
457
|
-
render: (e, t) => /* @__PURE__ */
|
|
457
|
+
render: (e, t) => /* @__PURE__ */ P(x, {
|
|
458
458
|
color: Le(t.badgeKind),
|
|
459
459
|
children: t.badgeText
|
|
460
460
|
})
|
|
461
461
|
}
|
|
462
462
|
];
|
|
463
|
-
return /* @__PURE__ */
|
|
463
|
+
return /* @__PURE__ */ P(g, {
|
|
464
464
|
title: r.pointsDetail,
|
|
465
465
|
visible: e,
|
|
466
|
-
footer: /* @__PURE__ */
|
|
466
|
+
footer: /* @__PURE__ */ F("div", {
|
|
467
467
|
className: "flex justify-end gap-2",
|
|
468
|
-
children: [/* @__PURE__ */
|
|
468
|
+
children: [/* @__PURE__ */ P(o, {
|
|
469
469
|
onClick: a,
|
|
470
470
|
children: r.close
|
|
471
|
-
}), /* @__PURE__ */
|
|
471
|
+
}), /* @__PURE__ */ P(o, {
|
|
472
472
|
type: "primary",
|
|
473
|
-
icon: /* @__PURE__ */
|
|
473
|
+
icon: /* @__PURE__ */ P(k, {}),
|
|
474
474
|
onClick: () => {
|
|
475
475
|
a(), c();
|
|
476
476
|
},
|
|
@@ -482,131 +482,131 @@ function Re({ visible: e, points: t, text: r, onCancel: a, onRecharge: c }) {
|
|
|
482
482
|
width: 780,
|
|
483
483
|
maxWidth: "calc(100vw - 48px)"
|
|
484
484
|
},
|
|
485
|
-
children: /* @__PURE__ */
|
|
485
|
+
children: /* @__PURE__ */ F("div", {
|
|
486
486
|
className: "max-h-[70vh] overflow-y-auto",
|
|
487
487
|
children: [
|
|
488
|
-
/* @__PURE__ */
|
|
488
|
+
/* @__PURE__ */ F(s, {
|
|
489
489
|
bordered: !1,
|
|
490
490
|
className: "from-arco-primary-light-1/40 to-cyan-400/5 rounded-none! bg-linear-to-br!",
|
|
491
491
|
children: [
|
|
492
|
-
/* @__PURE__ */
|
|
492
|
+
/* @__PURE__ */ P(S.Text, {
|
|
493
493
|
type: "secondary",
|
|
494
494
|
className: "text-xs!",
|
|
495
495
|
children: r.totalBalance
|
|
496
496
|
}),
|
|
497
|
-
/* @__PURE__ */
|
|
497
|
+
/* @__PURE__ */ F("div", {
|
|
498
498
|
className: "mt-1.5 mb-3.5 ",
|
|
499
|
-
children: [/* @__PURE__ */
|
|
499
|
+
children: [/* @__PURE__ */ P(S.Text, {
|
|
500
500
|
className: "text-3xl! font-bold!",
|
|
501
501
|
children: E(t.total)
|
|
502
|
-
}), /* @__PURE__ */
|
|
502
|
+
}), /* @__PURE__ */ F(S.Text, {
|
|
503
503
|
type: "secondary",
|
|
504
504
|
className: "ml-2 text-sm! ",
|
|
505
505
|
children: ["🪙 ", r.pointsUnit]
|
|
506
506
|
})]
|
|
507
507
|
}),
|
|
508
|
-
/* @__PURE__ */
|
|
508
|
+
/* @__PURE__ */ F(f.Row, {
|
|
509
509
|
gutter: 12,
|
|
510
|
-
children: [/* @__PURE__ */
|
|
510
|
+
children: [/* @__PURE__ */ P(f.Col, {
|
|
511
511
|
span: 12,
|
|
512
|
-
children: /* @__PURE__ */
|
|
512
|
+
children: /* @__PURE__ */ F(s, {
|
|
513
513
|
size: "small",
|
|
514
|
-
children: [/* @__PURE__ */
|
|
514
|
+
children: [/* @__PURE__ */ F("div", {
|
|
515
515
|
className: "mb-1 flex items-center justify-between",
|
|
516
|
-
children: [/* @__PURE__ */
|
|
516
|
+
children: [/* @__PURE__ */ P(S.Text, {
|
|
517
517
|
type: "secondary",
|
|
518
518
|
className: "text-xs!",
|
|
519
519
|
children: r.rechargePoints
|
|
520
|
-
}), /* @__PURE__ */
|
|
520
|
+
}), /* @__PURE__ */ P(x, {
|
|
521
521
|
color: "arcoblue",
|
|
522
522
|
children: r.sourceRecharge
|
|
523
523
|
})]
|
|
524
|
-
}), /* @__PURE__ */
|
|
524
|
+
}), /* @__PURE__ */ P(S.Text, {
|
|
525
525
|
className: "text-lg! font-semibold!",
|
|
526
526
|
children: E(t.recharge)
|
|
527
527
|
})]
|
|
528
528
|
})
|
|
529
|
-
}), /* @__PURE__ */
|
|
529
|
+
}), /* @__PURE__ */ P(f.Col, {
|
|
530
530
|
span: 12,
|
|
531
|
-
children: /* @__PURE__ */
|
|
531
|
+
children: /* @__PURE__ */ F(s, {
|
|
532
532
|
size: "small",
|
|
533
|
-
children: [/* @__PURE__ */
|
|
533
|
+
children: [/* @__PURE__ */ F("div", {
|
|
534
534
|
className: "mb-1 flex items-center justify-between",
|
|
535
|
-
children: [/* @__PURE__ */
|
|
535
|
+
children: [/* @__PURE__ */ P(S.Text, {
|
|
536
536
|
type: "secondary",
|
|
537
537
|
className: "text-xs!",
|
|
538
538
|
children: r.giftedPoints
|
|
539
|
-
}), /* @__PURE__ */
|
|
539
|
+
}), /* @__PURE__ */ P(x, {
|
|
540
540
|
color: "success",
|
|
541
541
|
children: r.sourceGifted
|
|
542
542
|
})]
|
|
543
|
-
}), /* @__PURE__ */
|
|
543
|
+
}), /* @__PURE__ */ P(S.Text, {
|
|
544
544
|
className: "text-lg! font-semibold!",
|
|
545
545
|
children: E(t.gifted)
|
|
546
546
|
})]
|
|
547
547
|
})
|
|
548
548
|
})]
|
|
549
549
|
}),
|
|
550
|
-
/* @__PURE__ */
|
|
550
|
+
/* @__PURE__ */ P(S.Text, {
|
|
551
551
|
type: "secondary",
|
|
552
552
|
className: "mt-2.5 block! text-xs!",
|
|
553
553
|
children: r.pointsDeductionTip
|
|
554
554
|
})
|
|
555
555
|
]
|
|
556
556
|
}),
|
|
557
|
-
/* @__PURE__ */
|
|
557
|
+
/* @__PURE__ */ F("div", {
|
|
558
558
|
className: "px-6 py-4",
|
|
559
559
|
children: [
|
|
560
|
-
/* @__PURE__ */
|
|
560
|
+
/* @__PURE__ */ F(b, {
|
|
561
561
|
activeTab: l,
|
|
562
562
|
onChange: (e) => u(e),
|
|
563
563
|
children: [
|
|
564
|
-
/* @__PURE__ */
|
|
565
|
-
/* @__PURE__ */
|
|
566
|
-
/* @__PURE__ */
|
|
564
|
+
/* @__PURE__ */ P(b.TabPane, { title: r.all }, "all"),
|
|
565
|
+
/* @__PURE__ */ P(b.TabPane, { title: r.income }, "income"),
|
|
566
|
+
/* @__PURE__ */ P(b.TabPane, { title: r.expense }, "expense")
|
|
567
567
|
]
|
|
568
568
|
}),
|
|
569
|
-
/* @__PURE__ */
|
|
569
|
+
/* @__PURE__ */ F("div", {
|
|
570
570
|
className: "mt-2 mb-3.5 flex flex-wrap items-center gap-2.5",
|
|
571
571
|
children: [
|
|
572
|
-
/* @__PURE__ */
|
|
572
|
+
/* @__PURE__ */ F(v, {
|
|
573
573
|
value: d,
|
|
574
574
|
style: { width: 140 },
|
|
575
575
|
onChange: (e) => p(e),
|
|
576
576
|
children: [
|
|
577
|
-
/* @__PURE__ */
|
|
577
|
+
/* @__PURE__ */ P(v.Option, {
|
|
578
578
|
value: "all",
|
|
579
579
|
children: r.sourceAll
|
|
580
580
|
}),
|
|
581
|
-
/* @__PURE__ */
|
|
581
|
+
/* @__PURE__ */ P(v.Option, {
|
|
582
582
|
value: "recharge",
|
|
583
583
|
children: r.sourceRecharge
|
|
584
584
|
}),
|
|
585
|
-
/* @__PURE__ */
|
|
585
|
+
/* @__PURE__ */ P(v.Option, {
|
|
586
586
|
value: "gift",
|
|
587
587
|
children: r.sourceGifted
|
|
588
588
|
})
|
|
589
589
|
]
|
|
590
590
|
}),
|
|
591
|
-
/* @__PURE__ */
|
|
591
|
+
/* @__PURE__ */ P(Pe, {
|
|
592
592
|
value: m,
|
|
593
593
|
onChange: (e) => C(e),
|
|
594
594
|
style: { width: 260 }
|
|
595
595
|
}),
|
|
596
|
-
/* @__PURE__ */
|
|
596
|
+
/* @__PURE__ */ P(o, {
|
|
597
597
|
onClick: () => h.success(r.refreshed),
|
|
598
598
|
children: r.query
|
|
599
599
|
})
|
|
600
600
|
]
|
|
601
601
|
}),
|
|
602
|
-
/* @__PURE__ */
|
|
602
|
+
/* @__PURE__ */ P(y, {
|
|
603
603
|
rowKey: "id",
|
|
604
604
|
columns: O,
|
|
605
605
|
data: D,
|
|
606
606
|
pagination: !1,
|
|
607
607
|
border: !1
|
|
608
608
|
}),
|
|
609
|
-
/* @__PURE__ */
|
|
609
|
+
/* @__PURE__ */ P(_, {
|
|
610
610
|
className: "mt-3 flex justify-center!",
|
|
611
611
|
current: w,
|
|
612
612
|
pageSize: Ie,
|
|
@@ -615,13 +615,13 @@ function Re({ visible: e, points: t, text: r, onCancel: a, onRecharge: c }) {
|
|
|
615
615
|
})
|
|
616
616
|
]
|
|
617
617
|
}),
|
|
618
|
-
/* @__PURE__ */
|
|
618
|
+
/* @__PURE__ */ P(s, {
|
|
619
619
|
bordered: !1,
|
|
620
620
|
className: "bg-arco-primary-light-1/30 rounded-none!",
|
|
621
|
-
children: /* @__PURE__ */
|
|
621
|
+
children: /* @__PURE__ */ F(S.Text, {
|
|
622
622
|
type: "secondary",
|
|
623
623
|
className: "text-xs! leading-6!",
|
|
624
|
-
children: [/* @__PURE__ */
|
|
624
|
+
children: [/* @__PURE__ */ F("strong", { children: [r.pointsNoteTitle, ":"] }), r.pointsAccountNote]
|
|
625
625
|
})
|
|
626
626
|
})
|
|
627
627
|
]
|
|
@@ -669,7 +669,7 @@ function We({ visible: e, user: n, labels: s, onCancel: c, onSubmit: l }) {
|
|
|
669
669
|
}, T = (e) => {
|
|
670
670
|
h.success(e);
|
|
671
671
|
};
|
|
672
|
-
return /* @__PURE__ */
|
|
672
|
+
return /* @__PURE__ */ P(g, {
|
|
673
673
|
title: u.profileTitle,
|
|
674
674
|
visible: e,
|
|
675
675
|
onOk: async () => {
|
|
@@ -689,35 +689,35 @@ function We({ visible: e, user: n, labels: s, onCancel: c, onSubmit: l }) {
|
|
|
689
689
|
confirmLoading: m,
|
|
690
690
|
okText: u.profileSave,
|
|
691
691
|
cancelText: u.profileCancel,
|
|
692
|
-
children: /* @__PURE__ */
|
|
692
|
+
children: /* @__PURE__ */ F(d, {
|
|
693
693
|
form: f,
|
|
694
694
|
layout: "vertical",
|
|
695
|
-
children: [/* @__PURE__ */
|
|
695
|
+
children: [/* @__PURE__ */ P(d.Item, {
|
|
696
696
|
label: u.profileNickname,
|
|
697
697
|
field: "nickname",
|
|
698
698
|
rules: [{
|
|
699
699
|
required: !0,
|
|
700
700
|
message: u.profileNicknamePlaceholder
|
|
701
701
|
}],
|
|
702
|
-
children: /* @__PURE__ */
|
|
702
|
+
children: /* @__PURE__ */ P(p, {
|
|
703
703
|
placeholder: u.profileNicknamePlaceholder,
|
|
704
704
|
allowClear: !0
|
|
705
705
|
})
|
|
706
|
-
}), /* @__PURE__ */
|
|
706
|
+
}), /* @__PURE__ */ P(d.Item, {
|
|
707
707
|
label: u.profileAvatar,
|
|
708
|
-
children: /* @__PURE__ */
|
|
708
|
+
children: /* @__PURE__ */ F("div", {
|
|
709
709
|
className: "flex flex-col gap-2",
|
|
710
|
-
children: [/* @__PURE__ */
|
|
710
|
+
children: [/* @__PURE__ */ F("div", {
|
|
711
711
|
className: "flex items-center gap-3",
|
|
712
|
-
children: [/* @__PURE__ */
|
|
712
|
+
children: [/* @__PURE__ */ P(a, {
|
|
713
713
|
size: 64,
|
|
714
714
|
className: "shrink-0 bg-arco-primary-light-1!",
|
|
715
|
-
children: b || n?.avatar ? /* @__PURE__ */
|
|
715
|
+
children: b || n?.avatar ? /* @__PURE__ */ P("img", {
|
|
716
716
|
src: b || n?.avatar,
|
|
717
717
|
alt: "",
|
|
718
718
|
className: "block h-full w-full object-cover"
|
|
719
719
|
}) : n?.nickname?.[0] || n?.username?.[0] || "U"
|
|
720
|
-
}), /* @__PURE__ */
|
|
720
|
+
}), /* @__PURE__ */ P(C, {
|
|
721
721
|
accept: "image/*",
|
|
722
722
|
showUploadList: !1,
|
|
723
723
|
beforeUpload: async (e) => {
|
|
@@ -734,14 +734,14 @@ function We({ visible: e, user: n, labels: s, onCancel: c, onSubmit: l }) {
|
|
|
734
734
|
return S.current = n, n;
|
|
735
735
|
}), y(e), !1;
|
|
736
736
|
},
|
|
737
|
-
children: /* @__PURE__ */
|
|
737
|
+
children: /* @__PURE__ */ P(o, {
|
|
738
738
|
type: "outline",
|
|
739
739
|
size: "small",
|
|
740
|
-
icon: /* @__PURE__ */
|
|
740
|
+
icon: /* @__PURE__ */ P(M, {}),
|
|
741
741
|
children: u.profileUploadAvatar
|
|
742
742
|
})
|
|
743
743
|
})]
|
|
744
|
-
}), /* @__PURE__ */
|
|
744
|
+
}), /* @__PURE__ */ P("span", {
|
|
745
745
|
className: "text-xs text-arco-text-3",
|
|
746
746
|
children: u.profileAvatarHint
|
|
747
747
|
})]
|
|
@@ -756,10 +756,10 @@ function Ge(e) {
|
|
|
756
756
|
return e?.nickname?.[0] || e?.username?.[0] || "U";
|
|
757
757
|
}
|
|
758
758
|
function $({ user: e, size: t, className: n = "" }) {
|
|
759
|
-
return /* @__PURE__ */
|
|
759
|
+
return /* @__PURE__ */ P(a, {
|
|
760
760
|
size: t,
|
|
761
761
|
className: `bg-arco-primary/20! text-arco-primary-6 border-2 font-bold ${n}`,
|
|
762
|
-
children: e?.avatar ? /* @__PURE__ */
|
|
762
|
+
children: e?.avatar ? /* @__PURE__ */ P("img", {
|
|
763
763
|
src: e.avatar,
|
|
764
764
|
alt: "avatar",
|
|
765
765
|
className: "h-full w-full object-cover"
|
|
@@ -770,15 +770,15 @@ function $({ user: e, size: t, className: n = "" }) {
|
|
|
770
770
|
//#region src/header/components/RechargeModal.tsx
|
|
771
771
|
function Ke({ visible: e, user: t, points: n, text: r, onCancel: a, onPay: c }) {
|
|
772
772
|
let [l, u] = i(Q[2].id), d = (e) => new Intl.NumberFormat().format(e), p = Q.find((e) => e.id === l) || Q[0];
|
|
773
|
-
return /* @__PURE__ */
|
|
773
|
+
return /* @__PURE__ */ P(g, {
|
|
774
774
|
title: r.rechargeTitle,
|
|
775
775
|
visible: e,
|
|
776
|
-
footer: /* @__PURE__ */
|
|
776
|
+
footer: /* @__PURE__ */ F("div", {
|
|
777
777
|
className: "mx-auto flex max-w-7xl items-center justify-between gap-5",
|
|
778
|
-
children: [/* @__PURE__ */
|
|
778
|
+
children: [/* @__PURE__ */ P("span", {
|
|
779
779
|
className: "text-arco-text-2 text-sm leading-6",
|
|
780
780
|
children: r.rechargeHint
|
|
781
|
-
}), /* @__PURE__ */
|
|
781
|
+
}), /* @__PURE__ */ F(o, {
|
|
782
782
|
type: "primary",
|
|
783
783
|
size: "large",
|
|
784
784
|
className: "min-w-48! font-bold!",
|
|
@@ -800,35 +800,35 @@ function Ke({ visible: e, user: t, points: n, text: r, onCancel: a, onPay: c })
|
|
|
800
800
|
paddingBottom: 0
|
|
801
801
|
},
|
|
802
802
|
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!",
|
|
803
|
-
children: /* @__PURE__ */
|
|
803
|
+
children: /* @__PURE__ */ F("div", {
|
|
804
804
|
className: "mx-auto flex h-full w-full max-w-7xl flex-col items-center ",
|
|
805
|
-
children: [/* @__PURE__ */
|
|
805
|
+
children: [/* @__PURE__ */ F("div", {
|
|
806
806
|
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",
|
|
807
|
-
children: [/* @__PURE__ */
|
|
807
|
+
children: [/* @__PURE__ */ P($, {
|
|
808
808
|
user: t,
|
|
809
809
|
size: 32,
|
|
810
810
|
className: "shrink-0"
|
|
811
|
-
}), /* @__PURE__ */
|
|
811
|
+
}), /* @__PURE__ */ F("span", { children: [
|
|
812
812
|
t?.nickname || t?.username,
|
|
813
813
|
" · ",
|
|
814
814
|
r.currentBalance,
|
|
815
815
|
" ",
|
|
816
|
-
/* @__PURE__ */
|
|
816
|
+
/* @__PURE__ */ P("strong", {
|
|
817
817
|
className: "text-arco-text-1",
|
|
818
818
|
children: d(n.total)
|
|
819
819
|
}),
|
|
820
820
|
" ",
|
|
821
821
|
r.pointsUnit
|
|
822
822
|
] })]
|
|
823
|
-
}), /* @__PURE__ */
|
|
823
|
+
}), /* @__PURE__ */ P("div", {
|
|
824
824
|
className: "mt-6 w-full",
|
|
825
|
-
children: /* @__PURE__ */
|
|
825
|
+
children: /* @__PURE__ */ P(f.Row, {
|
|
826
826
|
gutter: [16, 16],
|
|
827
|
-
children: Q.map((e) => /* @__PURE__ */
|
|
827
|
+
children: Q.map((e) => /* @__PURE__ */ P(f.Col, {
|
|
828
828
|
xs: 24,
|
|
829
829
|
sm: 12,
|
|
830
830
|
lg: 6,
|
|
831
|
-
children: /* @__PURE__ */
|
|
831
|
+
children: /* @__PURE__ */ F(s, {
|
|
832
832
|
hoverable: !0,
|
|
833
833
|
role: "button",
|
|
834
834
|
tabIndex: 0,
|
|
@@ -844,29 +844,29 @@ function Ke({ visible: e, user: t, points: n, text: r, onCancel: a, onPay: c })
|
|
|
844
844
|
},
|
|
845
845
|
className: `border-arco-border-2! bg-arco-bg-2! relative cursor-pointer 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! ${l === 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!"}`,
|
|
846
846
|
children: [
|
|
847
|
-
l === e.id ? /* @__PURE__ */
|
|
848
|
-
"recommended" in e && e.recommended ? /* @__PURE__ */
|
|
847
|
+
l === e.id ? /* @__PURE__ */ P(w, { className: "text-arco-primary-6! absolute bottom-4 left-4 text-xl" }) : null,
|
|
848
|
+
"recommended" in e && e.recommended ? /* @__PURE__ */ P(x, {
|
|
849
849
|
color: "arcoblue",
|
|
850
850
|
className: "absolute top-4 right-4 text-xs! font-bold!",
|
|
851
851
|
children: "HOT"
|
|
852
852
|
}) : null,
|
|
853
|
-
/* @__PURE__ */
|
|
853
|
+
/* @__PURE__ */ F("div", {
|
|
854
854
|
className: "min-w-0 pr-16",
|
|
855
|
-
children: [/* @__PURE__ */
|
|
855
|
+
children: [/* @__PURE__ */ F(S.Text, {
|
|
856
856
|
className: "flex items-center text-3xl! leading-tight! font-bold!",
|
|
857
|
-
children: [d(e.points), /* @__PURE__ */
|
|
857
|
+
children: [d(e.points), /* @__PURE__ */ P("span", {
|
|
858
858
|
className: "ml-1 text-2xl",
|
|
859
859
|
children: "🪙"
|
|
860
860
|
})]
|
|
861
|
-
}), /* @__PURE__ */
|
|
861
|
+
}), /* @__PURE__ */ P(S.Text, {
|
|
862
862
|
type: "secondary",
|
|
863
863
|
className: "mt-1 block! text-sm!",
|
|
864
864
|
children: r.pointsUnit
|
|
865
865
|
})]
|
|
866
866
|
}),
|
|
867
|
-
/* @__PURE__ */
|
|
867
|
+
/* @__PURE__ */ P("div", {
|
|
868
868
|
className: "mt-7 flex w-full justify-end",
|
|
869
|
-
children: /* @__PURE__ */
|
|
869
|
+
children: /* @__PURE__ */ F(S.Text, {
|
|
870
870
|
className: "text-arco-primary-6! text-right text-2xl! leading-tight! font-bold!",
|
|
871
871
|
children: ["$", e.price]
|
|
872
872
|
})
|
|
@@ -883,85 +883,85 @@ function Ke({ visible: e, user: t, points: n, text: r, onCancel: a, onPay: c })
|
|
|
883
883
|
//#region src/header/components/UserMenu.tsx
|
|
884
884
|
function qe({ user: e, points: t, text: n, onEditProfile: r, onRecharge: i, onPointsDetail: a, onLogout: s }) {
|
|
885
885
|
let c = (e) => new Intl.NumberFormat().format(e);
|
|
886
|
-
return /* @__PURE__ */
|
|
886
|
+
return /* @__PURE__ */ F("div", {
|
|
887
887
|
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%)]",
|
|
888
888
|
children: [
|
|
889
|
-
/* @__PURE__ */
|
|
889
|
+
/* @__PURE__ */ F("div", {
|
|
890
890
|
className: "flex items-center gap-3 px-6 pt-5 pb-4",
|
|
891
|
-
children: [/* @__PURE__ */
|
|
891
|
+
children: [/* @__PURE__ */ P($, {
|
|
892
892
|
user: e,
|
|
893
893
|
size: 48,
|
|
894
894
|
className: "shrink-0"
|
|
895
|
-
}), /* @__PURE__ */
|
|
895
|
+
}), /* @__PURE__ */ F("div", {
|
|
896
896
|
className: "flex min-w-0 flex-1 flex-col gap-1",
|
|
897
|
-
children: [/* @__PURE__ */
|
|
897
|
+
children: [/* @__PURE__ */ F("div", {
|
|
898
898
|
className: "flex min-w-0 items-center gap-1.5",
|
|
899
|
-
children: [/* @__PURE__ */
|
|
899
|
+
children: [/* @__PURE__ */ P("span", {
|
|
900
900
|
className: "text-arco-text-1 truncate text-base leading-6 font-bold",
|
|
901
901
|
children: e?.nickname || e?.username
|
|
902
|
-
}), /* @__PURE__ */
|
|
902
|
+
}), /* @__PURE__ */ P(o, {
|
|
903
903
|
type: "text",
|
|
904
904
|
size: "mini",
|
|
905
|
-
icon: /* @__PURE__ */
|
|
905
|
+
icon: /* @__PURE__ */ P(E, {}),
|
|
906
906
|
className: "text-arco-text-3 h-6! min-w-6! px-0!",
|
|
907
907
|
onClick: r
|
|
908
908
|
})]
|
|
909
|
-
}), e?.email ? /* @__PURE__ */
|
|
909
|
+
}), e?.email ? /* @__PURE__ */ P("span", {
|
|
910
910
|
className: "text-arco-text-3 truncate text-xs leading-5",
|
|
911
911
|
children: e.email
|
|
912
912
|
}) : null]
|
|
913
913
|
})]
|
|
914
914
|
}),
|
|
915
|
-
/* @__PURE__ */
|
|
916
|
-
/* @__PURE__ */
|
|
915
|
+
/* @__PURE__ */ P(l, { className: "m-0!" }),
|
|
916
|
+
/* @__PURE__ */ F("ul", {
|
|
917
917
|
className: "flex flex-col gap-3.5 px-6 py-4",
|
|
918
918
|
children: [
|
|
919
|
-
/* @__PURE__ */
|
|
919
|
+
/* @__PURE__ */ F("li", {
|
|
920
920
|
className: "text-arco-text-2 flex items-center justify-between gap-4 text-sm",
|
|
921
|
-
children: [/* @__PURE__ */
|
|
921
|
+
children: [/* @__PURE__ */ P("span", { children: n.myPoints }), /* @__PURE__ */ P("strong", {
|
|
922
922
|
className: "text-arco-primary-6 text-base font-bold",
|
|
923
923
|
children: c(t.total)
|
|
924
924
|
})]
|
|
925
925
|
}),
|
|
926
|
-
/* @__PURE__ */
|
|
926
|
+
/* @__PURE__ */ F("li", {
|
|
927
927
|
className: "text-arco-text-2 flex items-center justify-between gap-4 text-sm",
|
|
928
|
-
children: [/* @__PURE__ */
|
|
928
|
+
children: [/* @__PURE__ */ P("span", { children: n.rechargePoints }), /* @__PURE__ */ P("strong", {
|
|
929
929
|
className: "text-arco-text-1 text-base font-bold",
|
|
930
930
|
children: c(t.recharge)
|
|
931
931
|
})]
|
|
932
932
|
}),
|
|
933
|
-
/* @__PURE__ */
|
|
933
|
+
/* @__PURE__ */ F("li", {
|
|
934
934
|
className: "text-arco-text-2 flex items-center justify-between gap-4 text-sm",
|
|
935
|
-
children: [/* @__PURE__ */
|
|
935
|
+
children: [/* @__PURE__ */ P("span", { children: n.giftedPoints }), /* @__PURE__ */ P("strong", {
|
|
936
936
|
className: "text-arco-text-1 text-base font-bold",
|
|
937
937
|
children: c(t.gifted)
|
|
938
938
|
})]
|
|
939
939
|
})
|
|
940
940
|
]
|
|
941
941
|
}),
|
|
942
|
-
/* @__PURE__ */
|
|
943
|
-
/* @__PURE__ */
|
|
942
|
+
/* @__PURE__ */ P(l, { className: "m-0!" }),
|
|
943
|
+
/* @__PURE__ */ F("div", {
|
|
944
944
|
className: "flex flex-col gap-2 px-6 py-4",
|
|
945
|
-
children: [/* @__PURE__ */
|
|
945
|
+
children: [/* @__PURE__ */ P(o, {
|
|
946
946
|
type: "primary",
|
|
947
947
|
long: !0,
|
|
948
|
-
icon: /* @__PURE__ */
|
|
948
|
+
icon: /* @__PURE__ */ P(k, {}),
|
|
949
949
|
className: "h-10! rounded-md! font-semibold!",
|
|
950
950
|
onClick: i,
|
|
951
951
|
children: n.recharge
|
|
952
|
-
}), /* @__PURE__ */
|
|
952
|
+
}), /* @__PURE__ */ P(o, {
|
|
953
953
|
long: !0,
|
|
954
|
-
icon: /* @__PURE__ */
|
|
954
|
+
icon: /* @__PURE__ */ P(D, {}),
|
|
955
955
|
className: "border-arco-border-2! bg-arco-fill-1! text-arco-text-1! h-10! rounded-md! font-semibold!",
|
|
956
956
|
onClick: a,
|
|
957
957
|
children: n.pointsDetail
|
|
958
958
|
})]
|
|
959
959
|
}),
|
|
960
|
-
/* @__PURE__ */
|
|
961
|
-
/* @__PURE__ */
|
|
960
|
+
/* @__PURE__ */ P(l, { className: "m-0!" }),
|
|
961
|
+
/* @__PURE__ */ P("div", {
|
|
962
962
|
className: "px-6 py-4",
|
|
963
|
-
children: /* @__PURE__ */
|
|
964
|
-
icon: /* @__PURE__ */
|
|
963
|
+
children: /* @__PURE__ */ P(o, {
|
|
964
|
+
icon: /* @__PURE__ */ P(A, {}),
|
|
965
965
|
type: "text",
|
|
966
966
|
status: "danger",
|
|
967
967
|
long: !0,
|
|
@@ -992,38 +992,38 @@ function Qe(e, t, n) {
|
|
|
992
992
|
return r?.length ? r.join(", ") : e?.isOwner ? t : n;
|
|
993
993
|
}
|
|
994
994
|
function $e({ user: a, disabled: o = !1, brandSlot: s, children: c, onTenantContextChange: l }) {
|
|
995
|
-
let [d, f] = i(() => Z()), p = De(d), [g, _] = i(!1), [v, y] = i(!1), [b, x] = i(!1), [S, C] = i(a), [w, E] = i([]), [D, O] = i(), [
|
|
995
|
+
let [d, f] = i(() => Z()), p = De(d), [g, _] = i(!1), [v, y] = i(!1), [b, x] = i(!1), [S, C] = i(a), [w, E] = i([]), [D, O] = i(), [ee, k] = i(!1), A = r(l), [j, M] = i({
|
|
996
996
|
total: 0,
|
|
997
997
|
recharge: 0,
|
|
998
998
|
gifted: 0
|
|
999
|
-
}),
|
|
1000
|
-
total:
|
|
1001
|
-
recharge:
|
|
1002
|
-
gifted:
|
|
1003
|
-
},
|
|
1004
|
-
let t = await
|
|
999
|
+
}), N = D?.tenantId || "", I = o, L = {
|
|
1000
|
+
total: j.total ?? 0,
|
|
1001
|
+
recharge: j.recharge ?? 0,
|
|
1002
|
+
gifted: j.gifted ?? 0
|
|
1003
|
+
}, R = async (e) => {
|
|
1004
|
+
let t = await de(e);
|
|
1005
1005
|
return t && C(t), t;
|
|
1006
1006
|
};
|
|
1007
1007
|
t(() => {
|
|
1008
1008
|
C(a);
|
|
1009
1009
|
}, [a]), t(() => {
|
|
1010
|
-
|
|
1010
|
+
A.current = l;
|
|
1011
1011
|
}, [l]);
|
|
1012
|
-
let
|
|
1013
|
-
E(e.tenants), O(e.currentTenant),
|
|
1012
|
+
let z = e((e) => {
|
|
1013
|
+
E(e.tenants), O(e.currentTenant), A.current?.(e);
|
|
1014
1014
|
}, []);
|
|
1015
1015
|
t(() => {
|
|
1016
|
-
|
|
1016
|
+
k(!0), ve().then(z).catch((e) => {
|
|
1017
1017
|
console.warn("Failed to refresh Mantur tenant context.", e), h.error(p.error);
|
|
1018
|
-
}).finally(() =>
|
|
1019
|
-
}, [
|
|
1018
|
+
}).finally(() => k(!1));
|
|
1019
|
+
}, [z, p.error]), t(() => {
|
|
1020
1020
|
let e = (e) => {
|
|
1021
|
-
e instanceof CustomEvent &&
|
|
1021
|
+
e instanceof CustomEvent && M(e.detail);
|
|
1022
1022
|
};
|
|
1023
|
-
return window.addEventListener(
|
|
1023
|
+
return window.addEventListener(U, e), q().catch((e) => {
|
|
1024
1024
|
console.warn("Failed to refresh Mantur user points.", e);
|
|
1025
1025
|
}), () => {
|
|
1026
|
-
window.removeEventListener(
|
|
1026
|
+
window.removeEventListener(U, e);
|
|
1027
1027
|
};
|
|
1028
1028
|
}, []), t(() => {
|
|
1029
1029
|
let e = (e) => {
|
|
@@ -1033,51 +1033,51 @@ function $e({ user: a, disabled: o = !1, brandSlot: s, children: c, onTenantCont
|
|
|
1033
1033
|
window.removeEventListener(Y, e), window.removeEventListener("storage", e);
|
|
1034
1034
|
};
|
|
1035
1035
|
}, []);
|
|
1036
|
-
let
|
|
1036
|
+
let B = (e) => {
|
|
1037
1037
|
h.success(e);
|
|
1038
|
-
},
|
|
1038
|
+
}, V = (e, t) => {
|
|
1039
1039
|
console.error(t), h.error(e);
|
|
1040
|
-
},
|
|
1041
|
-
if (!
|
|
1042
|
-
|
|
1040
|
+
}, H = e(async (e) => {
|
|
1041
|
+
if (!I && e !== N) try {
|
|
1042
|
+
k(!0), z(await ye(e)), B(p.switchedToTeam);
|
|
1043
1043
|
} catch (e) {
|
|
1044
|
-
|
|
1044
|
+
V(p.error, e);
|
|
1045
1045
|
} finally {
|
|
1046
|
-
|
|
1046
|
+
k(!1);
|
|
1047
1047
|
}
|
|
1048
1048
|
}, [
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1049
|
+
z,
|
|
1050
|
+
N,
|
|
1051
|
+
I,
|
|
1052
1052
|
p.error,
|
|
1053
1053
|
p.switchedToTeam
|
|
1054
|
-
]),
|
|
1054
|
+
]), te = (e) => {
|
|
1055
1055
|
let t = {
|
|
1056
|
-
total:
|
|
1057
|
-
recharge:
|
|
1058
|
-
gifted:
|
|
1056
|
+
total: L.total + e.points,
|
|
1057
|
+
recharge: L.recharge + e.points,
|
|
1058
|
+
gifted: L.gifted
|
|
1059
1059
|
};
|
|
1060
|
-
|
|
1061
|
-
},
|
|
1060
|
+
M(t), window.dispatchEvent(new CustomEvent(U, { detail: t })), h.success(p.rechargeSuccess), y(!1);
|
|
1061
|
+
}, ne = n(() => /* @__PURE__ */ F(m, {
|
|
1062
1062
|
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",
|
|
1063
|
-
selectedKeys:
|
|
1064
|
-
onClickMenuItem:
|
|
1065
|
-
children: [/* @__PURE__ */
|
|
1063
|
+
selectedKeys: N ? [N] : [],
|
|
1064
|
+
onClickMenuItem: H,
|
|
1065
|
+
children: [/* @__PURE__ */ P("div", {
|
|
1066
1066
|
className: "px-3 py-2 text-xs font-semibold tracking-[0.04em] text-arco-text-4 uppercase",
|
|
1067
1067
|
children: p.switchTeam
|
|
1068
|
-
}), w.map((e, t) => /* @__PURE__ */
|
|
1068
|
+
}), w.map((e, t) => /* @__PURE__ */ P(m.Item, {
|
|
1069
1069
|
className: "mb-1 h-auto! min-h-10! overflow-visible! rounded-lg! px-2! py-1! leading-normal!",
|
|
1070
|
-
children: /* @__PURE__ */
|
|
1070
|
+
children: /* @__PURE__ */ F("div", {
|
|
1071
1071
|
className: "flex w-full items-center gap-3 leading-normal",
|
|
1072
|
-
children: [/* @__PURE__ */
|
|
1072
|
+
children: [/* @__PURE__ */ P("div", {
|
|
1073
1073
|
className: Xe(t),
|
|
1074
1074
|
children: Ze(e)
|
|
1075
|
-
}), /* @__PURE__ */
|
|
1075
|
+
}), /* @__PURE__ */ F("div", {
|
|
1076
1076
|
className: "flex min-w-0 flex-col justify-center gap-0.75",
|
|
1077
|
-
children: [/* @__PURE__ */
|
|
1077
|
+
children: [/* @__PURE__ */ P("span", {
|
|
1078
1078
|
className: "text-sm leading-5 font-medium text-arco-text-1",
|
|
1079
1079
|
children: e.tenantName
|
|
1080
|
-
}), /* @__PURE__ */
|
|
1080
|
+
}), /* @__PURE__ */ P("span", {
|
|
1081
1081
|
className: "text-xs leading-4 text-arco-text-3",
|
|
1082
1082
|
children: Qe(e, p.owner, p.member)
|
|
1083
1083
|
})]
|
|
@@ -1085,29 +1085,29 @@ function $e({ user: a, disabled: o = !1, brandSlot: s, children: c, onTenantCont
|
|
|
1085
1085
|
})
|
|
1086
1086
|
}, e.tenantId))]
|
|
1087
1087
|
}), [
|
|
1088
|
-
|
|
1089
|
-
|
|
1088
|
+
H,
|
|
1089
|
+
N,
|
|
1090
1090
|
w,
|
|
1091
1091
|
p
|
|
1092
|
-
]),
|
|
1092
|
+
]), re = /* @__PURE__ */ P(qe, {
|
|
1093
1093
|
user: S,
|
|
1094
|
-
points:
|
|
1094
|
+
points: L,
|
|
1095
1095
|
text: p,
|
|
1096
1096
|
onEditProfile: () => _(!0),
|
|
1097
1097
|
onRecharge: () => y(!0),
|
|
1098
1098
|
onPointsDetail: () => x(!0),
|
|
1099
|
-
onLogout:
|
|
1100
|
-
}),
|
|
1101
|
-
return /* @__PURE__ */
|
|
1099
|
+
onLogout: ue
|
|
1100
|
+
}), ie = Math.max(0, w.findIndex((e) => e.tenantId === D?.tenantId));
|
|
1101
|
+
return /* @__PURE__ */ F("div", {
|
|
1102
1102
|
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",
|
|
1103
1103
|
children: [
|
|
1104
|
-
/* @__PURE__ */
|
|
1104
|
+
/* @__PURE__ */ F("div", {
|
|
1105
1105
|
className: "flex items-center gap-6",
|
|
1106
|
-
children: [/* @__PURE__ */
|
|
1106
|
+
children: [/* @__PURE__ */ F("div", {
|
|
1107
1107
|
className: "flex w-65 items-center gap-3 px-8 max-md:w-auto max-md:px-4",
|
|
1108
|
-
children: [/* @__PURE__ */
|
|
1108
|
+
children: [/* @__PURE__ */ P("div", {
|
|
1109
1109
|
className: "relative flex w-12 items-center justify-center overflow-hidden ",
|
|
1110
|
-
children: /* @__PURE__ */
|
|
1110
|
+
children: /* @__PURE__ */ P("img", {
|
|
1111
1111
|
src: Je,
|
|
1112
1112
|
alt: "logo",
|
|
1113
1113
|
className: "w-full object-contain",
|
|
@@ -1115,96 +1115,96 @@ function $e({ user: a, disabled: o = !1, brandSlot: s, children: c, onTenantCont
|
|
|
1115
1115
|
e.currentTarget.style.display = "none";
|
|
1116
1116
|
}
|
|
1117
1117
|
})
|
|
1118
|
-
}), s ?? /* @__PURE__ */
|
|
1118
|
+
}), s ?? /* @__PURE__ */ P("span", {
|
|
1119
1119
|
className: "text-lg font-bold tracking-normal text-arco-text-1",
|
|
1120
1120
|
children: p.title
|
|
1121
1121
|
})]
|
|
1122
|
-
}), /* @__PURE__ */
|
|
1123
|
-
droplist:
|
|
1122
|
+
}), /* @__PURE__ */ P(u, {
|
|
1123
|
+
droplist: ne,
|
|
1124
1124
|
trigger: "click",
|
|
1125
1125
|
position: "bl",
|
|
1126
|
-
disabled:
|
|
1127
|
-
children: /* @__PURE__ */
|
|
1128
|
-
"aria-disabled":
|
|
1129
|
-
className: `flex items-center gap-3 rounded-full border border-arco-border-1 bg-arco-bg-1 px-2 py-1.5 transition-all ${
|
|
1126
|
+
disabled: I,
|
|
1127
|
+
children: /* @__PURE__ */ F("div", {
|
|
1128
|
+
"aria-disabled": I,
|
|
1129
|
+
className: `flex items-center gap-3 rounded-full border border-arco-border-1 bg-arco-bg-1 px-2 py-1.5 transition-all ${I ? "cursor-not-allowed opacity-60" : "cursor-pointer hover:bg-arco-fill-2 hover:shadow-[0_4px_12px_rgb(0_0_0/8%)]"}`,
|
|
1130
1130
|
children: [
|
|
1131
|
-
/* @__PURE__ */
|
|
1132
|
-
className: Xe(
|
|
1131
|
+
/* @__PURE__ */ P("div", {
|
|
1132
|
+
className: Xe(ie, !0),
|
|
1133
1133
|
children: Ze(D)
|
|
1134
1134
|
}),
|
|
1135
|
-
/* @__PURE__ */
|
|
1135
|
+
/* @__PURE__ */ F("div", {
|
|
1136
1136
|
className: "flex min-w-0 flex-col",
|
|
1137
|
-
children: [/* @__PURE__ */
|
|
1137
|
+
children: [/* @__PURE__ */ P("span", {
|
|
1138
1138
|
className: "text-xs leading-none font-bold text-arco-text-1",
|
|
1139
|
-
children:
|
|
1140
|
-
}), /* @__PURE__ */
|
|
1139
|
+
children: ee ? p.loading : D?.tenantName || p.loading
|
|
1140
|
+
}), /* @__PURE__ */ P("span", {
|
|
1141
1141
|
className: "mt-1 text-[10px] leading-none text-arco-text-3",
|
|
1142
1142
|
children: Qe(D, p.owner, p.member)
|
|
1143
1143
|
})]
|
|
1144
1144
|
}),
|
|
1145
|
-
/* @__PURE__ */
|
|
1145
|
+
/* @__PURE__ */ P(T, { className: "ml-1 text-arco-text-3" })
|
|
1146
1146
|
]
|
|
1147
1147
|
})
|
|
1148
1148
|
})]
|
|
1149
1149
|
}),
|
|
1150
|
-
/* @__PURE__ */
|
|
1150
|
+
/* @__PURE__ */ P("div", {
|
|
1151
1151
|
className: "flex-1",
|
|
1152
1152
|
children: c
|
|
1153
1153
|
}),
|
|
1154
|
-
/* @__PURE__ */
|
|
1154
|
+
/* @__PURE__ */ F("div", {
|
|
1155
1155
|
className: "flex items-center gap-4",
|
|
1156
|
-
children: [/* @__PURE__ */
|
|
1156
|
+
children: [/* @__PURE__ */ F("div", {
|
|
1157
1157
|
className: "flex items-center gap-4",
|
|
1158
|
-
children: [/* @__PURE__ */
|
|
1159
|
-
}), /* @__PURE__ */
|
|
1160
|
-
droplist:
|
|
1158
|
+
children: [/* @__PURE__ */ P(Me, {}), /* @__PURE__ */ P(je, {})]
|
|
1159
|
+
}), /* @__PURE__ */ P(u, {
|
|
1160
|
+
droplist: re,
|
|
1161
1161
|
trigger: "click",
|
|
1162
1162
|
position: "br",
|
|
1163
1163
|
onVisibleChange: (e) => {
|
|
1164
|
-
e &&
|
|
1164
|
+
e && q().catch((e) => {
|
|
1165
1165
|
console.warn("Failed to refresh Mantur user points.", e);
|
|
1166
1166
|
});
|
|
1167
1167
|
},
|
|
1168
|
-
children: /* @__PURE__ */
|
|
1168
|
+
children: /* @__PURE__ */ F("div", {
|
|
1169
1169
|
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",
|
|
1170
1170
|
children: [
|
|
1171
|
-
/* @__PURE__ */
|
|
1171
|
+
/* @__PURE__ */ F("div", {
|
|
1172
1172
|
className: "from-arco-primary to-transparent relative rounded-full bg-linear-to-br p-0.5 shadow-sm",
|
|
1173
|
-
children: [/* @__PURE__ */
|
|
1173
|
+
children: [/* @__PURE__ */ P($, {
|
|
1174
1174
|
user: S,
|
|
1175
1175
|
size: 36
|
|
1176
|
-
}), /* @__PURE__ */
|
|
1176
|
+
}), /* @__PURE__ */ P("div", { className: "bg-arco-success border-arco-bg-white absolute right-0 bottom-0 h-3 w-3 rounded-full border-2 shadow-sm" })]
|
|
1177
1177
|
}),
|
|
1178
|
-
/* @__PURE__ */
|
|
1178
|
+
/* @__PURE__ */ P("div", {
|
|
1179
1179
|
className: "hidden flex-col md:flex",
|
|
1180
|
-
children: /* @__PURE__ */
|
|
1180
|
+
children: /* @__PURE__ */ P("span", {
|
|
1181
1181
|
className: "text-arco-text-1 text-sm font-medium",
|
|
1182
1182
|
children: S?.nickname || S?.username
|
|
1183
1183
|
})
|
|
1184
1184
|
}),
|
|
1185
|
-
/* @__PURE__ */
|
|
1185
|
+
/* @__PURE__ */ P(T, { className: "text-arco-text-3 ml-1" })
|
|
1186
1186
|
]
|
|
1187
1187
|
})
|
|
1188
1188
|
})]
|
|
1189
1189
|
}),
|
|
1190
|
-
/* @__PURE__ */
|
|
1190
|
+
/* @__PURE__ */ P(We, {
|
|
1191
1191
|
visible: g,
|
|
1192
1192
|
user: S,
|
|
1193
1193
|
labels: p,
|
|
1194
1194
|
onCancel: () => _(!1),
|
|
1195
|
-
onSubmit:
|
|
1195
|
+
onSubmit: R
|
|
1196
1196
|
}),
|
|
1197
|
-
/* @__PURE__ */
|
|
1197
|
+
/* @__PURE__ */ P(Ke, {
|
|
1198
1198
|
visible: v,
|
|
1199
1199
|
user: S,
|
|
1200
|
-
points:
|
|
1200
|
+
points: L,
|
|
1201
1201
|
text: p,
|
|
1202
1202
|
onCancel: () => y(!1),
|
|
1203
|
-
onPay:
|
|
1203
|
+
onPay: te
|
|
1204
1204
|
}),
|
|
1205
|
-
/* @__PURE__ */
|
|
1205
|
+
/* @__PURE__ */ P(Re, {
|
|
1206
1206
|
visible: b,
|
|
1207
|
-
points:
|
|
1207
|
+
points: L,
|
|
1208
1208
|
text: p,
|
|
1209
1209
|
onCancel: () => x(!1),
|
|
1210
1210
|
onRecharge: () => y(!0)
|
|
@@ -1214,7 +1214,7 @@ function $e({ user: a, disabled: o = !1, brandSlot: s, children: c, onTenantCont
|
|
|
1214
1214
|
}
|
|
1215
1215
|
//#endregion
|
|
1216
1216
|
//#region src/utils/date.ts
|
|
1217
|
-
var et = /* @__PURE__ */
|
|
1217
|
+
var et = /* @__PURE__ */ re((/* @__PURE__ */ te(((e, t) => {
|
|
1218
1218
|
(function(n, r) {
|
|
1219
1219
|
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();
|
|
1220
1220
|
})(e, (function() {
|
|
@@ -1515,4 +1515,21 @@ function tt(e, t = "datetime", n) {
|
|
|
1515
1515
|
return (0, et.default)(e).format(i);
|
|
1516
1516
|
}
|
|
1517
1517
|
//#endregion
|
|
1518
|
-
|
|
1518
|
+
//#region src/utils/url.ts
|
|
1519
|
+
var nt = () => {
|
|
1520
|
+
if (typeof window > "u" || !window.location?.href) throw Error("redirectToManturMain requires currentUrl when window.location is unavailable.");
|
|
1521
|
+
return window.location.href;
|
|
1522
|
+
}, rt = (e, t) => {
|
|
1523
|
+
let n = e.split(".");
|
|
1524
|
+
return n.length <= 1 ? t : [t, ...n.slice(1)].join(".");
|
|
1525
|
+
}, it = (e) => `${e.pathname}${e.search}${e.hash}`;
|
|
1526
|
+
function at(e, t, n = {}) {
|
|
1527
|
+
let r = new URL(n.currentUrl || nt()), i = new URL(r.toString()), a = e?.trim();
|
|
1528
|
+
a ? i.hostname = rt(r.hostname, a) : i.port = "80";
|
|
1529
|
+
let o = it(r);
|
|
1530
|
+
i.searchParams.set("app", t?.trim()), i.searchParams.set("redirect", o);
|
|
1531
|
+
let s = i.toString();
|
|
1532
|
+
return n.navigate !== !1 && typeof window < "u" && (window.location.href = s), s;
|
|
1533
|
+
}
|
|
1534
|
+
//#endregion
|
|
1535
|
+
export { $e as ManturHeader, tt as formatDateByLang, at as redirectToManturMain };
|