mantur-components 0.1.2 → 0.1.4
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 +44 -12
- package/dist/index.d.ts +2 -5
- package/dist/mantur-components.js +683 -371
- package/dist/mantur-components.umd.cjs +1 -1
- package/dist/utils/date.d.ts +6 -0
- package/package.json +4 -1
|
@@ -1,44 +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
|
|
7
|
-
//#region
|
|
8
|
-
var
|
|
9
|
-
function
|
|
10
|
-
|
|
11
|
-
|
|
3
|
+
import { IconCheckCircleFill as w, IconDown as T, IconEdit as E, IconFile as D, IconLanguage as O, IconMoonFill as k, IconPlus as A, IconPoweroff as j, IconSunFill as M, IconUpload as N } from "@arco-design/web-react/icon";
|
|
4
|
+
import { useTranslation as P } from "react-i18next";
|
|
5
|
+
import { jsx as F, jsxs as I } from "react/jsx-runtime";
|
|
6
|
+
import { useTheme as L } from "next-themes";
|
|
7
|
+
//#region \0rolldown/runtime.js
|
|
8
|
+
var R = Object.create, z = Object.defineProperty, B = Object.getOwnPropertyDescriptor, V = Object.getOwnPropertyNames, H = Object.getPrototypeOf, U = Object.prototype.hasOwnProperty, W = (e, t) => () => (t || (e((t = { exports: {} }).exports, t), e = null), t.exports), G = (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], !U.call(e, s) && s !== n && z(e, s, {
|
|
10
|
+
get: ((e) => t[e]).bind(null, s),
|
|
11
|
+
enumerable: !(r = B(t, s)) || r.enumerable
|
|
12
|
+
});
|
|
13
|
+
return e;
|
|
14
|
+
}, K = (e, t, n) => (n = e == null ? {} : R(H(e)), G(t || !e || !e.__esModule ? z(n, "default", {
|
|
15
|
+
value: e,
|
|
16
|
+
enumerable: !0
|
|
17
|
+
}) : n, e)), ee = "/api", te = "/users/me/points", q = "mantur-points-refresh", ne = "mantur-tenant-context-change";
|
|
12
18
|
function re() {
|
|
19
|
+
return typeof window < "u" && window.__MANTUR_COMPONENTS_API_BASE__ ? window.__MANTUR_COMPONENTS_API_BASE__ : ee;
|
|
20
|
+
}
|
|
21
|
+
function ie() {
|
|
13
22
|
return typeof window < "u" && window.__MANTUR_COMPONENTS_POINTS_ENDPOINT__ ? window.__MANTUR_COMPONENTS_POINTS_ENDPOINT__ : te;
|
|
14
23
|
}
|
|
15
|
-
function
|
|
24
|
+
function ae(e) {
|
|
16
25
|
if (typeof document > "u") return;
|
|
17
26
|
let t = `${encodeURIComponent(e)}=`;
|
|
18
27
|
return document.cookie.split("; ").find((e) => e.startsWith(t))?.slice(t.length);
|
|
19
28
|
}
|
|
20
|
-
function
|
|
29
|
+
function oe(e) {
|
|
21
30
|
if (typeof document > "u") return;
|
|
22
31
|
let t = encodeURIComponent(e), n = window.location.hostname, r = [void 0, n], i = n.split(".");
|
|
23
32
|
i.length >= 2 && r.push(`.${i.slice(-2).join(".")}`), r.forEach((e) => {
|
|
24
33
|
document.cookie = `${t}=; path=/; max-age=0${e ? `; domain=${e}` : ""}`;
|
|
25
34
|
});
|
|
26
35
|
}
|
|
27
|
-
function
|
|
36
|
+
function se(e) {
|
|
28
37
|
let t = JSON.parse(e || "null");
|
|
29
38
|
if (!t) throw Error("Request failed");
|
|
30
39
|
if (t.code !== 0) throw Error(t.message || "Request failed");
|
|
31
40
|
return t;
|
|
32
41
|
}
|
|
33
|
-
async function
|
|
34
|
-
let n =
|
|
42
|
+
async function J(e, t = {}) {
|
|
43
|
+
let n = ae("front-token"), r = ae("Accept-Language"), i = t.headers || {};
|
|
35
44
|
return n && (i.Authorization = decodeURIComponent(n)), r && (i["Accept-Language"] = decodeURIComponent(r)), new Promise((n, r) => {
|
|
36
45
|
let a = new XMLHttpRequest();
|
|
37
|
-
a.open(t.method || "GET", `${
|
|
46
|
+
a.open(t.method || "GET", `${re()}${e}`, !0), a.timeout = t.timeout || 1e4, Object.entries(i).forEach(([e, t]) => {
|
|
38
47
|
a.setRequestHeader(e, t);
|
|
39
48
|
}), a.onload = () => {
|
|
40
49
|
try {
|
|
41
|
-
let e =
|
|
50
|
+
let e = se(a.responseText);
|
|
42
51
|
if (a.status < 200 || a.status >= 300) {
|
|
43
52
|
r(Error(e.message || a.statusText));
|
|
44
53
|
return;
|
|
@@ -50,31 +59,31 @@ async function U(e, t = {}) {
|
|
|
50
59
|
}, a.onerror = () => r(/* @__PURE__ */ Error("Network request failed")), a.ontimeout = () => r(/* @__PURE__ */ Error("Network request timed out")), a.send(t.body ?? null);
|
|
51
60
|
});
|
|
52
61
|
}
|
|
53
|
-
async function
|
|
62
|
+
async function ce() {
|
|
54
63
|
try {
|
|
55
|
-
await
|
|
64
|
+
await J("/auth/front-logout", { method: "DELETE" });
|
|
56
65
|
} catch (e) {
|
|
57
66
|
console.warn("Logout request failed, continuing local logout.", e);
|
|
58
67
|
} finally {
|
|
59
|
-
|
|
68
|
+
oe("front-token"), oe("refreshToken"), typeof window < "u" && window.location.reload();
|
|
60
69
|
}
|
|
61
70
|
}
|
|
62
|
-
async function
|
|
71
|
+
async function le(e) {
|
|
63
72
|
let t;
|
|
64
73
|
if (e.avatarFile) {
|
|
65
74
|
let n = new FormData();
|
|
66
|
-
n.append("file", e.avatarFile), t = (await
|
|
75
|
+
n.append("file", e.avatarFile), t = (await J("/users/me/avatar", {
|
|
67
76
|
method: "POST",
|
|
68
77
|
body: n
|
|
69
78
|
})).data;
|
|
70
79
|
}
|
|
71
|
-
return (await
|
|
80
|
+
return (await J("/users/me", {
|
|
72
81
|
method: "PUT",
|
|
73
82
|
headers: { "Content-Type": "application/json;charset=utf-8" },
|
|
74
83
|
body: JSON.stringify({ nickname: e.nickname })
|
|
75
84
|
})).data || t;
|
|
76
85
|
}
|
|
77
|
-
function
|
|
86
|
+
function ue(e) {
|
|
78
87
|
let t = (...t) => {
|
|
79
88
|
let n = t.map((t) => e?.[t]).find((e) => e !== void 0);
|
|
80
89
|
return typeof n == "number" ? n : Number(n || 0);
|
|
@@ -85,14 +94,14 @@ function oe(e) {
|
|
|
85
94
|
gifted: t("gifted", "giftedPoints", "bonusPoints")
|
|
86
95
|
};
|
|
87
96
|
}
|
|
88
|
-
async function
|
|
89
|
-
return
|
|
97
|
+
async function de() {
|
|
98
|
+
return ue((await J(ie())).data);
|
|
90
99
|
}
|
|
91
|
-
async function
|
|
92
|
-
let e = await
|
|
93
|
-
return typeof window < "u" && window.dispatchEvent(new CustomEvent(
|
|
100
|
+
async function fe() {
|
|
101
|
+
let e = await de();
|
|
102
|
+
return typeof window < "u" && window.dispatchEvent(new CustomEvent(q, { detail: e })), e;
|
|
94
103
|
}
|
|
95
|
-
function
|
|
104
|
+
function pe(e, t) {
|
|
96
105
|
return t?.tenantId ? e.find((e) => e.tenantId === t.tenantId) || {
|
|
97
106
|
tenantId: t.tenantId,
|
|
98
107
|
tenantName: t.tenantName || t.tenantId,
|
|
@@ -102,42 +111,37 @@ function se(e, t) {
|
|
|
102
111
|
}))
|
|
103
112
|
} : e.find((e) => e.isOwner) || e[0];
|
|
104
113
|
}
|
|
105
|
-
function
|
|
106
|
-
typeof window < "u" && (window.__MANTUR_COMPONENTS_TENANT_CONTEXT__ = e, window.dispatchEvent(new CustomEvent(
|
|
107
|
-
}
|
|
108
|
-
function le() {
|
|
109
|
-
if (!(typeof window > "u")) return window.__MANTUR_COMPONENTS_TENANT_CONTEXT__;
|
|
114
|
+
function me(e) {
|
|
115
|
+
typeof window < "u" && (window.__MANTUR_COMPONENTS_TENANT_CONTEXT__ = e, window.dispatchEvent(new CustomEvent(ne, { detail: e })));
|
|
110
116
|
}
|
|
111
|
-
async function
|
|
112
|
-
return (await
|
|
117
|
+
async function he() {
|
|
118
|
+
return (await J("/users/me/tenants")).data || [];
|
|
113
119
|
}
|
|
114
|
-
async function
|
|
115
|
-
return (await
|
|
120
|
+
async function ge() {
|
|
121
|
+
return (await J("/auth/current-tenant")).data;
|
|
116
122
|
}
|
|
117
|
-
async function
|
|
118
|
-
return (await
|
|
123
|
+
async function _e(e) {
|
|
124
|
+
return (await J(`/auth/current-tenant/${e}`, { method: "PUT" })).data;
|
|
119
125
|
}
|
|
120
|
-
async function
|
|
121
|
-
let [t, n] = await Promise.all([
|
|
126
|
+
async function ve(e = "refresh") {
|
|
127
|
+
let [t, n] = await Promise.all([he(), ge()]), r = {
|
|
122
128
|
tenants: t,
|
|
123
|
-
currentTenant:
|
|
129
|
+
currentTenant: pe(t, n),
|
|
124
130
|
auth: n,
|
|
125
131
|
reason: e
|
|
126
132
|
};
|
|
127
|
-
return
|
|
133
|
+
return me(r), r;
|
|
128
134
|
}
|
|
129
|
-
async function
|
|
130
|
-
let t = await
|
|
135
|
+
async function ye(e) {
|
|
136
|
+
let t = await _e(e), n = await he(), r = {
|
|
131
137
|
tenants: n,
|
|
132
|
-
currentTenant:
|
|
138
|
+
currentTenant: pe(n, t),
|
|
133
139
|
auth: t,
|
|
134
140
|
reason: "switch"
|
|
135
141
|
};
|
|
136
|
-
return
|
|
142
|
+
return me(r), r;
|
|
137
143
|
}
|
|
138
|
-
|
|
139
|
-
//#region src/labels.ts
|
|
140
|
-
var pe = {
|
|
144
|
+
var be = {
|
|
141
145
|
title: "Mantur",
|
|
142
146
|
switchTeam: "Switch Team",
|
|
143
147
|
personalSettings: "Personal Settings",
|
|
@@ -190,121 +194,118 @@ var pe = {
|
|
|
190
194
|
pointsDeductionTip: "Points expiring soon are deducted first.",
|
|
191
195
|
pointsNoteTitle: "Note",
|
|
192
196
|
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."
|
|
193
|
-
}
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
197
|
+
}, xe = {
|
|
198
|
+
languageZh: "中文",
|
|
199
|
+
languageEn: "English"
|
|
200
|
+
}, Se = {
|
|
201
|
+
title: "漫途",
|
|
202
|
+
switchTeam: "切换团队",
|
|
203
|
+
personalSettings: "个人设置",
|
|
204
|
+
logout: "退出登录",
|
|
205
|
+
loading: "加载中...",
|
|
206
|
+
owner: "管理员",
|
|
207
|
+
member: "成员",
|
|
208
|
+
createTeam: "创建团队",
|
|
209
|
+
createTeamComingSoon: "创建团队功能即将上线",
|
|
210
|
+
switchedToTeam: "已切换团队",
|
|
211
|
+
error: "请求失败",
|
|
212
|
+
profileTitle: "个人资料",
|
|
213
|
+
profileNickname: "昵称",
|
|
214
|
+
profileNicknamePlaceholder: "请输入昵称",
|
|
215
|
+
profileAvatar: "头像",
|
|
216
|
+
profileUploadAvatar: "上传头像",
|
|
217
|
+
profileAvatarHint: "支持 JPG/PNG/WebP,最大 2MB,尺寸不超过 2048px。",
|
|
218
|
+
profileAvatarTooLarge: "头像不能超过 2MB",
|
|
219
|
+
profileAvatarDimensionExceeded: "头像尺寸不能超过 2048px",
|
|
220
|
+
profileAvatarInvalidImage: "图片无效",
|
|
221
|
+
profileUpdateSuccess: "个人资料已更新",
|
|
222
|
+
profileSave: "保存",
|
|
223
|
+
profileCancel: "取消",
|
|
224
|
+
myPoints: "我的积分",
|
|
225
|
+
totalBalance: "总余额",
|
|
226
|
+
rechargePoints: "充值积分",
|
|
227
|
+
giftedPoints: "赠送积分",
|
|
228
|
+
recharge: "去充值",
|
|
229
|
+
rechargeTitle: "充值积分",
|
|
230
|
+
pointsDetail: "积分明细",
|
|
231
|
+
close: "关闭",
|
|
232
|
+
currentBalance: "当前余额",
|
|
233
|
+
pointsUnit: "积分",
|
|
234
|
+
rechargeHint: "充值积分有效期 2 年(自到账日起算),支付后不可退换。",
|
|
235
|
+
payNow: "立即支付",
|
|
236
|
+
rechargeSuccess: "充值成功",
|
|
237
|
+
all: "全部",
|
|
238
|
+
income: "获得",
|
|
239
|
+
expense: "消耗",
|
|
240
|
+
source: "来源",
|
|
241
|
+
sourceAll: "全部来源",
|
|
242
|
+
sourceRecharge: "充值",
|
|
243
|
+
sourceGifted: "赠送",
|
|
244
|
+
dateRange: "日期查询",
|
|
245
|
+
startDate: "开始日期",
|
|
246
|
+
endDate: "结束日期",
|
|
247
|
+
dateTo: "至",
|
|
248
|
+
query: "查询",
|
|
249
|
+
refreshed: "已刷新",
|
|
250
|
+
pointsDeductionTip: "优先扣减即将到期的积分",
|
|
251
|
+
pointsNoteTitle: "说明",
|
|
252
|
+
pointsAccountNote: "积分账户挂在你的个人账号上,自己充值、自己消耗、自己负责;他人不能代充、不能代用。充值积分有效期固定 2 年;赠送积分有效期由后台运营发放时设置。"
|
|
253
|
+
}, Ce = {
|
|
254
|
+
languageZh: "中文",
|
|
255
|
+
languageEn: "English"
|
|
256
|
+
}, we = "i18nextLng", Te = "manturLanguageSource", Y = "mantur-language-change", Ee = {
|
|
203
257
|
"zh-CN": {
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
personalSettings: "个人设置",
|
|
207
|
-
logout: "退出登录",
|
|
208
|
-
loading: "加载中...",
|
|
209
|
-
owner: "管理员",
|
|
210
|
-
member: "成员",
|
|
211
|
-
createTeam: "创建团队",
|
|
212
|
-
createTeamComingSoon: "创建团队功能即将上线",
|
|
213
|
-
switchedToTeam: "已切换团队",
|
|
214
|
-
error: "请求失败",
|
|
215
|
-
profileTitle: "个人资料",
|
|
216
|
-
profileNickname: "昵称",
|
|
217
|
-
profileNicknamePlaceholder: "请输入昵称",
|
|
218
|
-
profileAvatar: "头像",
|
|
219
|
-
profileUploadAvatar: "上传头像",
|
|
220
|
-
profileAvatarHint: "支持 JPG/PNG/WebP,最大 2MB,尺寸不超过 2048px。",
|
|
221
|
-
profileAvatarTooLarge: "头像不能超过 2MB",
|
|
222
|
-
profileAvatarDimensionExceeded: "头像尺寸不能超过 2048px",
|
|
223
|
-
profileAvatarInvalidImage: "图片无效",
|
|
224
|
-
profileUpdateSuccess: "个人资料已更新",
|
|
225
|
-
profileSave: "保存",
|
|
226
|
-
profileCancel: "取消",
|
|
227
|
-
myPoints: "我的积分",
|
|
228
|
-
totalBalance: "总余额",
|
|
229
|
-
rechargePoints: "充值积分",
|
|
230
|
-
giftedPoints: "赠送积分",
|
|
231
|
-
recharge: "去充值",
|
|
232
|
-
rechargeTitle: "充值积分",
|
|
233
|
-
pointsDetail: "积分明细",
|
|
234
|
-
close: "关闭",
|
|
235
|
-
currentBalance: "当前余额",
|
|
236
|
-
pointsUnit: "积分",
|
|
237
|
-
rechargeHint: "充值积分有效期 2 年(自到账日起算),支付后不可退换。",
|
|
238
|
-
payNow: "立即支付",
|
|
239
|
-
rechargeSuccess: "充值成功",
|
|
240
|
-
all: "全部",
|
|
241
|
-
income: "获得",
|
|
242
|
-
expense: "消耗",
|
|
243
|
-
source: "来源",
|
|
244
|
-
sourceAll: "全部来源",
|
|
245
|
-
sourceRecharge: "充值",
|
|
246
|
-
sourceGifted: "赠送",
|
|
247
|
-
dateRange: "日期查询",
|
|
248
|
-
startDate: "开始日期",
|
|
249
|
-
endDate: "结束日期",
|
|
250
|
-
dateTo: "至",
|
|
251
|
-
query: "查询",
|
|
252
|
-
refreshed: "已刷新",
|
|
253
|
-
pointsDeductionTip: "优先扣减即将到期的积分",
|
|
254
|
-
pointsNoteTitle: "说明",
|
|
255
|
-
pointsAccountNote: "积分账户挂在你的个人账号上,自己充值、自己消耗、自己负责;他人不能代充、不能代用。充值积分有效期固定 2 年;赠送积分有效期由后台运营发放时设置。",
|
|
256
|
-
languageZh: "中文",
|
|
257
|
-
languageEn: "English"
|
|
258
|
+
...Se,
|
|
259
|
+
...Ce
|
|
258
260
|
},
|
|
259
261
|
"en-US": {
|
|
260
|
-
...
|
|
261
|
-
|
|
262
|
-
languageEn: "English"
|
|
262
|
+
...be,
|
|
263
|
+
...xe
|
|
263
264
|
}
|
|
264
265
|
};
|
|
265
|
-
function
|
|
266
|
+
function X(e) {
|
|
266
267
|
return e?.toLowerCase().startsWith("en") ? "en-US" : "zh-CN";
|
|
267
268
|
}
|
|
268
|
-
function
|
|
269
|
-
return typeof window > "u" ? "zh-CN" :
|
|
269
|
+
function Z() {
|
|
270
|
+
return typeof window > "u" ? "zh-CN" : X(window.localStorage.getItem("i18nextLng") || document.documentElement.lang || navigator.language);
|
|
270
271
|
}
|
|
271
|
-
function
|
|
272
|
-
return
|
|
272
|
+
function De(e) {
|
|
273
|
+
return Ee[X(e)];
|
|
273
274
|
}
|
|
274
275
|
//#endregion
|
|
275
276
|
//#region src/lang-switch/LangSwitch.tsx
|
|
276
|
-
var
|
|
277
|
-
function
|
|
277
|
+
var Oe = we, ke = Te;
|
|
278
|
+
function Ae(e, t) {
|
|
278
279
|
document.cookie = `${encodeURIComponent(e)}=${encodeURIComponent(t)}; path=/`;
|
|
279
280
|
}
|
|
280
|
-
function
|
|
281
|
-
let { i18n: e } =
|
|
281
|
+
function je() {
|
|
282
|
+
let { i18n: e } = P(), [n, r] = i(() => Z()), a = De(n);
|
|
282
283
|
return t(() => {
|
|
283
|
-
r(
|
|
284
|
-
}, [e.language]), /* @__PURE__ */
|
|
285
|
-
droplist: /* @__PURE__ */
|
|
284
|
+
r(X(e.language));
|
|
285
|
+
}, [e.language]), /* @__PURE__ */ F(u, {
|
|
286
|
+
droplist: /* @__PURE__ */ I(m, {
|
|
286
287
|
selectedKeys: [n],
|
|
287
288
|
onClickMenuItem: (t) => {
|
|
288
|
-
let n =
|
|
289
|
-
localStorage.setItem(
|
|
289
|
+
let n = X(t);
|
|
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();
|
|
290
291
|
},
|
|
291
|
-
children: [/* @__PURE__ */
|
|
292
|
+
children: [/* @__PURE__ */ F(m.Item, { children: a.languageZh }, "zh-CN"), /* @__PURE__ */ F(m.Item, { children: a.languageEn }, "en-US")]
|
|
292
293
|
}),
|
|
293
294
|
trigger: "click",
|
|
294
295
|
position: "br",
|
|
295
|
-
children: /* @__PURE__ */
|
|
296
|
+
children: /* @__PURE__ */ F(o, {
|
|
296
297
|
shape: "circle",
|
|
297
|
-
icon: /* @__PURE__ */
|
|
298
|
+
icon: /* @__PURE__ */ F(O, {})
|
|
298
299
|
})
|
|
299
300
|
});
|
|
300
301
|
}
|
|
301
302
|
//#endregion
|
|
302
303
|
//#region src/theme-switch/ThemeSwitch.tsx
|
|
303
|
-
function
|
|
304
|
-
let { resolvedTheme: e, setTheme: t } =
|
|
305
|
-
return /* @__PURE__ */
|
|
304
|
+
function Me() {
|
|
305
|
+
let { resolvedTheme: e, setTheme: t } = L();
|
|
306
|
+
return /* @__PURE__ */ F(o, {
|
|
306
307
|
shape: "circle",
|
|
307
|
-
icon:
|
|
308
|
+
icon: F(e === "light" ? k : M, {}),
|
|
308
309
|
onClick: () => {
|
|
309
310
|
t(e === "light" ? "dark" : "light");
|
|
310
311
|
}
|
|
@@ -334,7 +335,7 @@ var Q = [
|
|
|
334
335
|
points: 24e3,
|
|
335
336
|
price: 200
|
|
336
337
|
}
|
|
337
|
-
],
|
|
338
|
+
], Ne = [
|
|
338
339
|
{
|
|
339
340
|
id: "recharge-1",
|
|
340
341
|
type: "income",
|
|
@@ -407,14 +408,14 @@ var Q = [
|
|
|
407
408
|
badgeKind: "deducted",
|
|
408
409
|
badgeText: "已扣除"
|
|
409
410
|
}
|
|
410
|
-
], { RangePicker:
|
|
411
|
-
function
|
|
411
|
+
], { RangePicker: Pe } = c, Fe = 21, Ie = 7;
|
|
412
|
+
function Le(e) {
|
|
412
413
|
return e === "recharge" ? "arcoblue" : e === "gift" ? "cyan" : e === "expired" ? "gray" : "orange";
|
|
413
414
|
}
|
|
414
|
-
function
|
|
415
|
+
function Re({ visible: e, points: t, text: r, onCancel: a, onRecharge: c }) {
|
|
415
416
|
let [l, u] = i("all"), [d, p] = i("all"), [m, C] = i(["2026-04-15", "2026-05-15"]), [w, T] = i(1), E = (e) => new Intl.NumberFormat().format(e), D = n(() => {
|
|
416
417
|
let [e, t] = m;
|
|
417
|
-
return
|
|
418
|
+
return Ne.filter((n) => {
|
|
418
419
|
let r = l === "all" || n.type === l, i = d === "all" || n.source === d, a = !e || n.date >= e, o = !t || n.date <= t;
|
|
419
420
|
return r && i && a && o;
|
|
420
421
|
});
|
|
@@ -426,12 +427,12 @@ function Oe({ visible: e, points: t, text: r, onCancel: a, onRecharge: c }) {
|
|
|
426
427
|
{
|
|
427
428
|
title: r.pointsDetail,
|
|
428
429
|
dataIndex: "name",
|
|
429
|
-
render: (e, t) => /* @__PURE__ */
|
|
430
|
+
render: (e, t) => /* @__PURE__ */ I("div", {
|
|
430
431
|
className: "min-w-0",
|
|
431
|
-
children: [/* @__PURE__ */
|
|
432
|
+
children: [/* @__PURE__ */ F(S.Text, {
|
|
432
433
|
className: "font-medium!",
|
|
433
434
|
children: t.name
|
|
434
|
-
}), /* @__PURE__ */
|
|
435
|
+
}), /* @__PURE__ */ F(S.Text, {
|
|
435
436
|
type: "secondary",
|
|
436
437
|
className: "mt-1 block! text-xs!",
|
|
437
438
|
children: t.meta
|
|
@@ -443,7 +444,7 @@ function Oe({ visible: e, points: t, text: r, onCancel: a, onRecharge: c }) {
|
|
|
443
444
|
dataIndex: "amount",
|
|
444
445
|
width: 120,
|
|
445
446
|
align: "right",
|
|
446
|
-
render: (e, t) => /* @__PURE__ */
|
|
447
|
+
render: (e, t) => /* @__PURE__ */ I(S.Text, {
|
|
447
448
|
className: `font-semibold! ${t.amount > 0 ? "text-arco-success-6!" : "text-arco-danger-6!"}`,
|
|
448
449
|
children: [t.amount > 0 ? "+" : "", E(t.amount)]
|
|
449
450
|
})
|
|
@@ -453,23 +454,23 @@ function Oe({ visible: e, points: t, text: r, onCancel: a, onRecharge: c }) {
|
|
|
453
454
|
dataIndex: "badgeText",
|
|
454
455
|
width: 110,
|
|
455
456
|
align: "right",
|
|
456
|
-
render: (e, t) => /* @__PURE__ */
|
|
457
|
-
color:
|
|
457
|
+
render: (e, t) => /* @__PURE__ */ F(x, {
|
|
458
|
+
color: Le(t.badgeKind),
|
|
458
459
|
children: t.badgeText
|
|
459
460
|
})
|
|
460
461
|
}
|
|
461
462
|
];
|
|
462
|
-
return /* @__PURE__ */
|
|
463
|
+
return /* @__PURE__ */ F(g, {
|
|
463
464
|
title: r.pointsDetail,
|
|
464
465
|
visible: e,
|
|
465
|
-
footer: /* @__PURE__ */
|
|
466
|
+
footer: /* @__PURE__ */ I("div", {
|
|
466
467
|
className: "flex justify-end gap-2",
|
|
467
|
-
children: [/* @__PURE__ */
|
|
468
|
+
children: [/* @__PURE__ */ F(o, {
|
|
468
469
|
onClick: a,
|
|
469
470
|
children: r.close
|
|
470
|
-
}), /* @__PURE__ */
|
|
471
|
+
}), /* @__PURE__ */ F(o, {
|
|
471
472
|
type: "primary",
|
|
472
|
-
icon: /* @__PURE__ */
|
|
473
|
+
icon: /* @__PURE__ */ F(A, {}),
|
|
473
474
|
onClick: () => {
|
|
474
475
|
a(), c();
|
|
475
476
|
},
|
|
@@ -481,146 +482,146 @@ function Oe({ visible: e, points: t, text: r, onCancel: a, onRecharge: c }) {
|
|
|
481
482
|
width: 780,
|
|
482
483
|
maxWidth: "calc(100vw - 48px)"
|
|
483
484
|
},
|
|
484
|
-
children: /* @__PURE__ */
|
|
485
|
+
children: /* @__PURE__ */ I("div", {
|
|
485
486
|
className: "max-h-[70vh] overflow-y-auto",
|
|
486
487
|
children: [
|
|
487
|
-
/* @__PURE__ */
|
|
488
|
+
/* @__PURE__ */ I(s, {
|
|
488
489
|
bordered: !1,
|
|
489
490
|
className: "from-arco-primary-light-1/40 to-cyan-400/5 rounded-none! bg-linear-to-br!",
|
|
490
491
|
children: [
|
|
491
|
-
/* @__PURE__ */
|
|
492
|
+
/* @__PURE__ */ F(S.Text, {
|
|
492
493
|
type: "secondary",
|
|
493
494
|
className: "text-xs!",
|
|
494
495
|
children: r.totalBalance
|
|
495
496
|
}),
|
|
496
|
-
/* @__PURE__ */
|
|
497
|
+
/* @__PURE__ */ I("div", {
|
|
497
498
|
className: "mt-1.5 mb-3.5 ",
|
|
498
|
-
children: [/* @__PURE__ */
|
|
499
|
+
children: [/* @__PURE__ */ F(S.Text, {
|
|
499
500
|
className: "text-3xl! font-bold!",
|
|
500
501
|
children: E(t.total)
|
|
501
|
-
}), /* @__PURE__ */
|
|
502
|
+
}), /* @__PURE__ */ I(S.Text, {
|
|
502
503
|
type: "secondary",
|
|
503
504
|
className: "ml-2 text-sm! ",
|
|
504
505
|
children: ["🪙 ", r.pointsUnit]
|
|
505
506
|
})]
|
|
506
507
|
}),
|
|
507
|
-
/* @__PURE__ */
|
|
508
|
+
/* @__PURE__ */ I(f.Row, {
|
|
508
509
|
gutter: 12,
|
|
509
|
-
children: [/* @__PURE__ */
|
|
510
|
+
children: [/* @__PURE__ */ F(f.Col, {
|
|
510
511
|
span: 12,
|
|
511
|
-
children: /* @__PURE__ */
|
|
512
|
+
children: /* @__PURE__ */ I(s, {
|
|
512
513
|
size: "small",
|
|
513
|
-
children: [/* @__PURE__ */
|
|
514
|
+
children: [/* @__PURE__ */ I("div", {
|
|
514
515
|
className: "mb-1 flex items-center justify-between",
|
|
515
|
-
children: [/* @__PURE__ */
|
|
516
|
+
children: [/* @__PURE__ */ F(S.Text, {
|
|
516
517
|
type: "secondary",
|
|
517
518
|
className: "text-xs!",
|
|
518
519
|
children: r.rechargePoints
|
|
519
|
-
}), /* @__PURE__ */
|
|
520
|
+
}), /* @__PURE__ */ F(x, {
|
|
520
521
|
color: "arcoblue",
|
|
521
522
|
children: r.sourceRecharge
|
|
522
523
|
})]
|
|
523
|
-
}), /* @__PURE__ */
|
|
524
|
+
}), /* @__PURE__ */ F(S.Text, {
|
|
524
525
|
className: "text-lg! font-semibold!",
|
|
525
526
|
children: E(t.recharge)
|
|
526
527
|
})]
|
|
527
528
|
})
|
|
528
|
-
}), /* @__PURE__ */
|
|
529
|
+
}), /* @__PURE__ */ F(f.Col, {
|
|
529
530
|
span: 12,
|
|
530
|
-
children: /* @__PURE__ */
|
|
531
|
+
children: /* @__PURE__ */ I(s, {
|
|
531
532
|
size: "small",
|
|
532
|
-
children: [/* @__PURE__ */
|
|
533
|
+
children: [/* @__PURE__ */ I("div", {
|
|
533
534
|
className: "mb-1 flex items-center justify-between",
|
|
534
|
-
children: [/* @__PURE__ */
|
|
535
|
+
children: [/* @__PURE__ */ F(S.Text, {
|
|
535
536
|
type: "secondary",
|
|
536
537
|
className: "text-xs!",
|
|
537
538
|
children: r.giftedPoints
|
|
538
|
-
}), /* @__PURE__ */
|
|
539
|
+
}), /* @__PURE__ */ F(x, {
|
|
539
540
|
color: "success",
|
|
540
541
|
children: r.sourceGifted
|
|
541
542
|
})]
|
|
542
|
-
}), /* @__PURE__ */
|
|
543
|
+
}), /* @__PURE__ */ F(S.Text, {
|
|
543
544
|
className: "text-lg! font-semibold!",
|
|
544
545
|
children: E(t.gifted)
|
|
545
546
|
})]
|
|
546
547
|
})
|
|
547
548
|
})]
|
|
548
549
|
}),
|
|
549
|
-
/* @__PURE__ */
|
|
550
|
+
/* @__PURE__ */ F(S.Text, {
|
|
550
551
|
type: "secondary",
|
|
551
552
|
className: "mt-2.5 block! text-xs!",
|
|
552
553
|
children: r.pointsDeductionTip
|
|
553
554
|
})
|
|
554
555
|
]
|
|
555
556
|
}),
|
|
556
|
-
/* @__PURE__ */
|
|
557
|
+
/* @__PURE__ */ I("div", {
|
|
557
558
|
className: "px-6 py-4",
|
|
558
559
|
children: [
|
|
559
|
-
/* @__PURE__ */
|
|
560
|
+
/* @__PURE__ */ I(b, {
|
|
560
561
|
activeTab: l,
|
|
561
562
|
onChange: (e) => u(e),
|
|
562
563
|
children: [
|
|
563
|
-
/* @__PURE__ */
|
|
564
|
-
/* @__PURE__ */
|
|
565
|
-
/* @__PURE__ */
|
|
564
|
+
/* @__PURE__ */ F(b.TabPane, { title: r.all }, "all"),
|
|
565
|
+
/* @__PURE__ */ F(b.TabPane, { title: r.income }, "income"),
|
|
566
|
+
/* @__PURE__ */ F(b.TabPane, { title: r.expense }, "expense")
|
|
566
567
|
]
|
|
567
568
|
}),
|
|
568
|
-
/* @__PURE__ */
|
|
569
|
+
/* @__PURE__ */ I("div", {
|
|
569
570
|
className: "mt-2 mb-3.5 flex flex-wrap items-center gap-2.5",
|
|
570
571
|
children: [
|
|
571
|
-
/* @__PURE__ */
|
|
572
|
+
/* @__PURE__ */ I(v, {
|
|
572
573
|
value: d,
|
|
573
574
|
style: { width: 140 },
|
|
574
575
|
onChange: (e) => p(e),
|
|
575
576
|
children: [
|
|
576
|
-
/* @__PURE__ */
|
|
577
|
+
/* @__PURE__ */ F(v.Option, {
|
|
577
578
|
value: "all",
|
|
578
579
|
children: r.sourceAll
|
|
579
580
|
}),
|
|
580
|
-
/* @__PURE__ */
|
|
581
|
+
/* @__PURE__ */ F(v.Option, {
|
|
581
582
|
value: "recharge",
|
|
582
583
|
children: r.sourceRecharge
|
|
583
584
|
}),
|
|
584
|
-
/* @__PURE__ */
|
|
585
|
+
/* @__PURE__ */ F(v.Option, {
|
|
585
586
|
value: "gift",
|
|
586
587
|
children: r.sourceGifted
|
|
587
588
|
})
|
|
588
589
|
]
|
|
589
590
|
}),
|
|
590
|
-
/* @__PURE__ */
|
|
591
|
+
/* @__PURE__ */ F(Pe, {
|
|
591
592
|
value: m,
|
|
592
593
|
onChange: (e) => C(e),
|
|
593
594
|
style: { width: 260 }
|
|
594
595
|
}),
|
|
595
|
-
/* @__PURE__ */
|
|
596
|
+
/* @__PURE__ */ F(o, {
|
|
596
597
|
onClick: () => h.success(r.refreshed),
|
|
597
598
|
children: r.query
|
|
598
599
|
})
|
|
599
600
|
]
|
|
600
601
|
}),
|
|
601
|
-
/* @__PURE__ */
|
|
602
|
+
/* @__PURE__ */ F(y, {
|
|
602
603
|
rowKey: "id",
|
|
603
604
|
columns: O,
|
|
604
605
|
data: D,
|
|
605
606
|
pagination: !1,
|
|
606
607
|
border: !1
|
|
607
608
|
}),
|
|
608
|
-
/* @__PURE__ */
|
|
609
|
+
/* @__PURE__ */ F(_, {
|
|
609
610
|
className: "mt-3 flex justify-center!",
|
|
610
611
|
current: w,
|
|
611
|
-
pageSize:
|
|
612
|
-
total:
|
|
612
|
+
pageSize: Ie,
|
|
613
|
+
total: Fe,
|
|
613
614
|
onChange: T
|
|
614
615
|
})
|
|
615
616
|
]
|
|
616
617
|
}),
|
|
617
|
-
/* @__PURE__ */
|
|
618
|
+
/* @__PURE__ */ F(s, {
|
|
618
619
|
bordered: !1,
|
|
619
620
|
className: "bg-arco-primary-light-1/30 rounded-none!",
|
|
620
|
-
children: /* @__PURE__ */
|
|
621
|
+
children: /* @__PURE__ */ I(S.Text, {
|
|
621
622
|
type: "secondary",
|
|
622
623
|
className: "text-xs! leading-6!",
|
|
623
|
-
children: [/* @__PURE__ */
|
|
624
|
+
children: [/* @__PURE__ */ I("strong", { children: [r.pointsNoteTitle, ":"] }), r.pointsAccountNote]
|
|
624
625
|
})
|
|
625
626
|
})
|
|
626
627
|
]
|
|
@@ -628,9 +629,18 @@ function Oe({ visible: e, points: t, text: r, onCancel: a, onRecharge: c }) {
|
|
|
628
629
|
});
|
|
629
630
|
}
|
|
630
631
|
//#endregion
|
|
632
|
+
//#region src/labels.ts
|
|
633
|
+
var ze = be;
|
|
634
|
+
function Be(e) {
|
|
635
|
+
return {
|
|
636
|
+
...ze,
|
|
637
|
+
...e
|
|
638
|
+
};
|
|
639
|
+
}
|
|
640
|
+
//#endregion
|
|
631
641
|
//#region src/header/components/ProfileModal.tsx
|
|
632
|
-
var
|
|
633
|
-
function
|
|
642
|
+
var Ve = 2048, He = 2 * 1024 * 1024;
|
|
643
|
+
function Ue(e) {
|
|
634
644
|
return new Promise((t, n) => {
|
|
635
645
|
let r = URL.createObjectURL(e), i = new Image();
|
|
636
646
|
i.onload = () => {
|
|
@@ -643,8 +653,8 @@ function je(e) {
|
|
|
643
653
|
}, i.src = r;
|
|
644
654
|
});
|
|
645
655
|
}
|
|
646
|
-
function
|
|
647
|
-
let u =
|
|
656
|
+
function We({ visible: e, user: n, labels: s, onCancel: c, onSubmit: l }) {
|
|
657
|
+
let u = Be(s), [f] = d.useForm(), [m, _] = i(!1), [v, y] = i(null), [b, x] = i(null), S = r(null);
|
|
648
658
|
t(() => () => {
|
|
649
659
|
S.current &&= (URL.revokeObjectURL(S.current), null);
|
|
650
660
|
}, []), t(() => {
|
|
@@ -659,7 +669,7 @@ function Me({ visible: e, user: n, labels: s, onCancel: c, onSubmit: l }) {
|
|
|
659
669
|
}, T = (e) => {
|
|
660
670
|
h.success(e);
|
|
661
671
|
};
|
|
662
|
-
return /* @__PURE__ */
|
|
672
|
+
return /* @__PURE__ */ F(g, {
|
|
663
673
|
title: u.profileTitle,
|
|
664
674
|
visible: e,
|
|
665
675
|
onOk: async () => {
|
|
@@ -679,42 +689,42 @@ function Me({ visible: e, user: n, labels: s, onCancel: c, onSubmit: l }) {
|
|
|
679
689
|
confirmLoading: m,
|
|
680
690
|
okText: u.profileSave,
|
|
681
691
|
cancelText: u.profileCancel,
|
|
682
|
-
children: /* @__PURE__ */
|
|
692
|
+
children: /* @__PURE__ */ I(d, {
|
|
683
693
|
form: f,
|
|
684
694
|
layout: "vertical",
|
|
685
|
-
children: [/* @__PURE__ */
|
|
695
|
+
children: [/* @__PURE__ */ F(d.Item, {
|
|
686
696
|
label: u.profileNickname,
|
|
687
697
|
field: "nickname",
|
|
688
698
|
rules: [{
|
|
689
699
|
required: !0,
|
|
690
700
|
message: u.profileNicknamePlaceholder
|
|
691
701
|
}],
|
|
692
|
-
children: /* @__PURE__ */
|
|
702
|
+
children: /* @__PURE__ */ F(p, {
|
|
693
703
|
placeholder: u.profileNicknamePlaceholder,
|
|
694
704
|
allowClear: !0
|
|
695
705
|
})
|
|
696
|
-
}), /* @__PURE__ */
|
|
706
|
+
}), /* @__PURE__ */ F(d.Item, {
|
|
697
707
|
label: u.profileAvatar,
|
|
698
|
-
children: /* @__PURE__ */
|
|
708
|
+
children: /* @__PURE__ */ I("div", {
|
|
699
709
|
className: "flex flex-col gap-2",
|
|
700
|
-
children: [/* @__PURE__ */
|
|
710
|
+
children: [/* @__PURE__ */ I("div", {
|
|
701
711
|
className: "flex items-center gap-3",
|
|
702
|
-
children: [/* @__PURE__ */
|
|
712
|
+
children: [/* @__PURE__ */ F(a, {
|
|
703
713
|
size: 64,
|
|
704
714
|
className: "shrink-0 bg-arco-primary-light-1!",
|
|
705
|
-
children: b || n?.avatar ? /* @__PURE__ */
|
|
715
|
+
children: b || n?.avatar ? /* @__PURE__ */ F("img", {
|
|
706
716
|
src: b || n?.avatar,
|
|
707
717
|
alt: "",
|
|
708
718
|
className: "block h-full w-full object-cover"
|
|
709
719
|
}) : n?.nickname?.[0] || n?.username?.[0] || "U"
|
|
710
|
-
}), /* @__PURE__ */
|
|
720
|
+
}), /* @__PURE__ */ F(C, {
|
|
711
721
|
accept: "image/*",
|
|
712
722
|
showUploadList: !1,
|
|
713
723
|
beforeUpload: async (e) => {
|
|
714
|
-
if (e.size >
|
|
724
|
+
if (e.size > He) return w(u.profileAvatarTooLarge), !1;
|
|
715
725
|
try {
|
|
716
|
-
let { width: t, height: n } = await
|
|
717
|
-
if (t >
|
|
726
|
+
let { width: t, height: n } = await Ue(e);
|
|
727
|
+
if (t > Ve || n > Ve) return w(u.profileAvatarDimensionExceeded), !1;
|
|
718
728
|
} catch (e) {
|
|
719
729
|
return w(u.profileAvatarInvalidImage, e), !1;
|
|
720
730
|
}
|
|
@@ -724,14 +734,14 @@ function Me({ visible: e, user: n, labels: s, onCancel: c, onSubmit: l }) {
|
|
|
724
734
|
return S.current = n, n;
|
|
725
735
|
}), y(e), !1;
|
|
726
736
|
},
|
|
727
|
-
children: /* @__PURE__ */
|
|
737
|
+
children: /* @__PURE__ */ F(o, {
|
|
728
738
|
type: "outline",
|
|
729
739
|
size: "small",
|
|
730
|
-
icon: /* @__PURE__ */
|
|
740
|
+
icon: /* @__PURE__ */ F(N, {}),
|
|
731
741
|
children: u.profileUploadAvatar
|
|
732
742
|
})
|
|
733
743
|
})]
|
|
734
|
-
}), /* @__PURE__ */
|
|
744
|
+
}), /* @__PURE__ */ F("span", {
|
|
735
745
|
className: "text-xs text-arco-text-3",
|
|
736
746
|
children: u.profileAvatarHint
|
|
737
747
|
})]
|
|
@@ -742,33 +752,33 @@ function Me({ visible: e, user: n, labels: s, onCancel: c, onSubmit: l }) {
|
|
|
742
752
|
}
|
|
743
753
|
//#endregion
|
|
744
754
|
//#region src/header/components/UserAvatar.tsx
|
|
745
|
-
function
|
|
755
|
+
function Ge(e) {
|
|
746
756
|
return e?.nickname?.[0] || e?.username?.[0] || "U";
|
|
747
757
|
}
|
|
748
758
|
function $({ user: e, size: t, className: n = "" }) {
|
|
749
|
-
return /* @__PURE__ */
|
|
759
|
+
return /* @__PURE__ */ F(a, {
|
|
750
760
|
size: t,
|
|
751
761
|
className: `bg-arco-primary/20! text-arco-primary-6 border-2 font-bold ${n}`,
|
|
752
|
-
children: e?.avatar ? /* @__PURE__ */
|
|
762
|
+
children: e?.avatar ? /* @__PURE__ */ F("img", {
|
|
753
763
|
src: e.avatar,
|
|
754
764
|
alt: "avatar",
|
|
755
765
|
className: "h-full w-full object-cover"
|
|
756
|
-
}) :
|
|
766
|
+
}) : Ge(e)
|
|
757
767
|
});
|
|
758
768
|
}
|
|
759
769
|
//#endregion
|
|
760
770
|
//#region src/header/components/RechargeModal.tsx
|
|
761
|
-
function
|
|
771
|
+
function Ke({ visible: e, user: t, points: n, text: r, onCancel: a, onPay: c }) {
|
|
762
772
|
let [l, u] = i(Q[2].id), d = (e) => new Intl.NumberFormat().format(e), p = Q.find((e) => e.id === l) || Q[0];
|
|
763
|
-
return /* @__PURE__ */
|
|
773
|
+
return /* @__PURE__ */ F(g, {
|
|
764
774
|
title: r.rechargeTitle,
|
|
765
775
|
visible: e,
|
|
766
|
-
footer: /* @__PURE__ */
|
|
776
|
+
footer: /* @__PURE__ */ I("div", {
|
|
767
777
|
className: "mx-auto flex max-w-7xl items-center justify-between gap-5",
|
|
768
|
-
children: [/* @__PURE__ */
|
|
778
|
+
children: [/* @__PURE__ */ F("span", {
|
|
769
779
|
className: "text-arco-text-2 text-sm leading-6",
|
|
770
780
|
children: r.rechargeHint
|
|
771
|
-
}), /* @__PURE__ */
|
|
781
|
+
}), /* @__PURE__ */ I(o, {
|
|
772
782
|
type: "primary",
|
|
773
783
|
size: "large",
|
|
774
784
|
className: "min-w-48! font-bold!",
|
|
@@ -790,35 +800,35 @@ function Pe({ visible: e, user: t, points: n, text: r, onCancel: a, onPay: c })
|
|
|
790
800
|
paddingBottom: 0
|
|
791
801
|
},
|
|
792
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!",
|
|
793
|
-
children: /* @__PURE__ */
|
|
803
|
+
children: /* @__PURE__ */ I("div", {
|
|
794
804
|
className: "mx-auto flex h-full w-full max-w-7xl flex-col items-center ",
|
|
795
|
-
children: [/* @__PURE__ */
|
|
805
|
+
children: [/* @__PURE__ */ I("div", {
|
|
796
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",
|
|
797
|
-
children: [/* @__PURE__ */
|
|
807
|
+
children: [/* @__PURE__ */ F($, {
|
|
798
808
|
user: t,
|
|
799
809
|
size: 32,
|
|
800
810
|
className: "shrink-0"
|
|
801
|
-
}), /* @__PURE__ */
|
|
811
|
+
}), /* @__PURE__ */ I("span", { children: [
|
|
802
812
|
t?.nickname || t?.username,
|
|
803
813
|
" · ",
|
|
804
814
|
r.currentBalance,
|
|
805
815
|
" ",
|
|
806
|
-
/* @__PURE__ */
|
|
816
|
+
/* @__PURE__ */ F("strong", {
|
|
807
817
|
className: "text-arco-text-1",
|
|
808
818
|
children: d(n.total)
|
|
809
819
|
}),
|
|
810
820
|
" ",
|
|
811
821
|
r.pointsUnit
|
|
812
822
|
] })]
|
|
813
|
-
}), /* @__PURE__ */
|
|
823
|
+
}), /* @__PURE__ */ F("div", {
|
|
814
824
|
className: "mt-6 w-full",
|
|
815
|
-
children: /* @__PURE__ */
|
|
825
|
+
children: /* @__PURE__ */ F(f.Row, {
|
|
816
826
|
gutter: [16, 16],
|
|
817
|
-
children: Q.map((e) => /* @__PURE__ */
|
|
827
|
+
children: Q.map((e) => /* @__PURE__ */ F(f.Col, {
|
|
818
828
|
xs: 24,
|
|
819
829
|
sm: 12,
|
|
820
830
|
lg: 6,
|
|
821
|
-
children: /* @__PURE__ */
|
|
831
|
+
children: /* @__PURE__ */ I(s, {
|
|
822
832
|
hoverable: !0,
|
|
823
833
|
role: "button",
|
|
824
834
|
tabIndex: 0,
|
|
@@ -834,29 +844,29 @@ function Pe({ visible: e, user: t, points: n, text: r, onCancel: a, onPay: c })
|
|
|
834
844
|
},
|
|
835
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!"}`,
|
|
836
846
|
children: [
|
|
837
|
-
l === e.id ? /* @__PURE__ */
|
|
838
|
-
"recommended" in e && e.recommended ? /* @__PURE__ */
|
|
847
|
+
l === e.id ? /* @__PURE__ */ F(w, { className: "text-arco-primary-6! absolute bottom-4 left-4 text-xl" }) : null,
|
|
848
|
+
"recommended" in e && e.recommended ? /* @__PURE__ */ F(x, {
|
|
839
849
|
color: "arcoblue",
|
|
840
850
|
className: "absolute top-4 right-4 text-xs! font-bold!",
|
|
841
851
|
children: "HOT"
|
|
842
852
|
}) : null,
|
|
843
|
-
/* @__PURE__ */
|
|
853
|
+
/* @__PURE__ */ I("div", {
|
|
844
854
|
className: "min-w-0 pr-16",
|
|
845
|
-
children: [/* @__PURE__ */
|
|
855
|
+
children: [/* @__PURE__ */ I(S.Text, {
|
|
846
856
|
className: "flex items-center text-3xl! leading-tight! font-bold!",
|
|
847
|
-
children: [d(e.points), /* @__PURE__ */
|
|
857
|
+
children: [d(e.points), /* @__PURE__ */ F("span", {
|
|
848
858
|
className: "ml-1 text-2xl",
|
|
849
859
|
children: "🪙"
|
|
850
860
|
})]
|
|
851
|
-
}), /* @__PURE__ */
|
|
861
|
+
}), /* @__PURE__ */ F(S.Text, {
|
|
852
862
|
type: "secondary",
|
|
853
863
|
className: "mt-1 block! text-sm!",
|
|
854
864
|
children: r.pointsUnit
|
|
855
865
|
})]
|
|
856
866
|
}),
|
|
857
|
-
/* @__PURE__ */
|
|
867
|
+
/* @__PURE__ */ F("div", {
|
|
858
868
|
className: "mt-7 flex w-full justify-end",
|
|
859
|
-
children: /* @__PURE__ */
|
|
869
|
+
children: /* @__PURE__ */ I(S.Text, {
|
|
860
870
|
className: "text-arco-primary-6! text-right text-2xl! leading-tight! font-bold!",
|
|
861
871
|
children: ["$", e.price]
|
|
862
872
|
})
|
|
@@ -871,87 +881,87 @@ function Pe({ visible: e, user: t, points: n, text: r, onCancel: a, onPay: c })
|
|
|
871
881
|
}
|
|
872
882
|
//#endregion
|
|
873
883
|
//#region src/header/components/UserMenu.tsx
|
|
874
|
-
function
|
|
884
|
+
function qe({ user: e, points: t, text: n, onEditProfile: r, onRecharge: i, onPointsDetail: a, onLogout: s }) {
|
|
875
885
|
let c = (e) => new Intl.NumberFormat().format(e);
|
|
876
|
-
return /* @__PURE__ */
|
|
886
|
+
return /* @__PURE__ */ I("div", {
|
|
877
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%)]",
|
|
878
888
|
children: [
|
|
879
|
-
/* @__PURE__ */
|
|
889
|
+
/* @__PURE__ */ I("div", {
|
|
880
890
|
className: "flex items-center gap-3 px-6 pt-5 pb-4",
|
|
881
|
-
children: [/* @__PURE__ */
|
|
891
|
+
children: [/* @__PURE__ */ F($, {
|
|
882
892
|
user: e,
|
|
883
893
|
size: 48,
|
|
884
894
|
className: "shrink-0"
|
|
885
|
-
}), /* @__PURE__ */
|
|
895
|
+
}), /* @__PURE__ */ I("div", {
|
|
886
896
|
className: "flex min-w-0 flex-1 flex-col gap-1",
|
|
887
|
-
children: [/* @__PURE__ */
|
|
897
|
+
children: [/* @__PURE__ */ I("div", {
|
|
888
898
|
className: "flex min-w-0 items-center gap-1.5",
|
|
889
|
-
children: [/* @__PURE__ */
|
|
899
|
+
children: [/* @__PURE__ */ F("span", {
|
|
890
900
|
className: "text-arco-text-1 truncate text-base leading-6 font-bold",
|
|
891
901
|
children: e?.nickname || e?.username
|
|
892
|
-
}), /* @__PURE__ */
|
|
902
|
+
}), /* @__PURE__ */ F(o, {
|
|
893
903
|
type: "text",
|
|
894
904
|
size: "mini",
|
|
895
|
-
icon: /* @__PURE__ */
|
|
905
|
+
icon: /* @__PURE__ */ F(E, {}),
|
|
896
906
|
className: "text-arco-text-3 h-6! min-w-6! px-0!",
|
|
897
907
|
onClick: r
|
|
898
908
|
})]
|
|
899
|
-
}), e?.email ? /* @__PURE__ */
|
|
909
|
+
}), e?.email ? /* @__PURE__ */ F("span", {
|
|
900
910
|
className: "text-arco-text-3 truncate text-xs leading-5",
|
|
901
911
|
children: e.email
|
|
902
912
|
}) : null]
|
|
903
913
|
})]
|
|
904
914
|
}),
|
|
905
|
-
/* @__PURE__ */
|
|
906
|
-
/* @__PURE__ */
|
|
915
|
+
/* @__PURE__ */ F(l, { className: "m-0!" }),
|
|
916
|
+
/* @__PURE__ */ I("ul", {
|
|
907
917
|
className: "flex flex-col gap-3.5 px-6 py-4",
|
|
908
918
|
children: [
|
|
909
|
-
/* @__PURE__ */
|
|
919
|
+
/* @__PURE__ */ I("li", {
|
|
910
920
|
className: "text-arco-text-2 flex items-center justify-between gap-4 text-sm",
|
|
911
|
-
children: [/* @__PURE__ */
|
|
921
|
+
children: [/* @__PURE__ */ F("span", { children: n.myPoints }), /* @__PURE__ */ F("strong", {
|
|
912
922
|
className: "text-arco-primary-6 text-base font-bold",
|
|
913
923
|
children: c(t.total)
|
|
914
924
|
})]
|
|
915
925
|
}),
|
|
916
|
-
/* @__PURE__ */
|
|
926
|
+
/* @__PURE__ */ I("li", {
|
|
917
927
|
className: "text-arco-text-2 flex items-center justify-between gap-4 text-sm",
|
|
918
|
-
children: [/* @__PURE__ */
|
|
928
|
+
children: [/* @__PURE__ */ F("span", { children: n.rechargePoints }), /* @__PURE__ */ F("strong", {
|
|
919
929
|
className: "text-arco-text-1 text-base font-bold",
|
|
920
930
|
children: c(t.recharge)
|
|
921
931
|
})]
|
|
922
932
|
}),
|
|
923
|
-
/* @__PURE__ */
|
|
933
|
+
/* @__PURE__ */ I("li", {
|
|
924
934
|
className: "text-arco-text-2 flex items-center justify-between gap-4 text-sm",
|
|
925
|
-
children: [/* @__PURE__ */
|
|
935
|
+
children: [/* @__PURE__ */ F("span", { children: n.giftedPoints }), /* @__PURE__ */ F("strong", {
|
|
926
936
|
className: "text-arco-text-1 text-base font-bold",
|
|
927
937
|
children: c(t.gifted)
|
|
928
938
|
})]
|
|
929
939
|
})
|
|
930
940
|
]
|
|
931
941
|
}),
|
|
932
|
-
/* @__PURE__ */
|
|
933
|
-
/* @__PURE__ */
|
|
942
|
+
/* @__PURE__ */ F(l, { className: "m-0!" }),
|
|
943
|
+
/* @__PURE__ */ I("div", {
|
|
934
944
|
className: "flex flex-col gap-2 px-6 py-4",
|
|
935
|
-
children: [/* @__PURE__ */
|
|
945
|
+
children: [/* @__PURE__ */ F(o, {
|
|
936
946
|
type: "primary",
|
|
937
947
|
long: !0,
|
|
938
|
-
icon: /* @__PURE__ */
|
|
948
|
+
icon: /* @__PURE__ */ F(A, {}),
|
|
939
949
|
className: "h-10! rounded-md! font-semibold!",
|
|
940
950
|
onClick: i,
|
|
941
951
|
children: n.recharge
|
|
942
|
-
}), /* @__PURE__ */
|
|
952
|
+
}), /* @__PURE__ */ F(o, {
|
|
943
953
|
long: !0,
|
|
944
|
-
icon: /* @__PURE__ */
|
|
954
|
+
icon: /* @__PURE__ */ F(D, {}),
|
|
945
955
|
className: "border-arco-border-2! bg-arco-fill-1! text-arco-text-1! h-10! rounded-md! font-semibold!",
|
|
946
956
|
onClick: a,
|
|
947
957
|
children: n.pointsDetail
|
|
948
958
|
})]
|
|
949
959
|
}),
|
|
950
|
-
/* @__PURE__ */
|
|
951
|
-
/* @__PURE__ */
|
|
960
|
+
/* @__PURE__ */ F(l, { className: "m-0!" }),
|
|
961
|
+
/* @__PURE__ */ F("div", {
|
|
952
962
|
className: "px-6 py-4",
|
|
953
|
-
children: /* @__PURE__ */
|
|
954
|
-
icon: /* @__PURE__ */
|
|
963
|
+
children: /* @__PURE__ */ F(o, {
|
|
964
|
+
icon: /* @__PURE__ */ F(j, {}),
|
|
955
965
|
type: "text",
|
|
956
966
|
status: "danger",
|
|
957
967
|
long: !0,
|
|
@@ -965,236 +975,236 @@ function Fe({ user: e, points: t, text: n, onEditProfile: r, onRecharge: i, onPo
|
|
|
965
975
|
}
|
|
966
976
|
//#endregion
|
|
967
977
|
//#region src/header/ManturHeader.tsx
|
|
968
|
-
var
|
|
978
|
+
var Je = "https://mantur.ai/images/logo.png", Ye = [
|
|
969
979
|
"from-arco-primary-light-1 to-arco-primary-light-2 text-arco-primary-6",
|
|
970
980
|
"from-arco-success-light-1 to-arco-success-light-2 text-arco-success-6",
|
|
971
981
|
"from-arco-warning-light-1 to-arco-warning-light-2 text-arco-warning-6",
|
|
972
982
|
"from-arco-danger-light-1 to-arco-danger-light-2 text-arco-danger-6"
|
|
973
983
|
];
|
|
974
|
-
function
|
|
975
|
-
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 ${
|
|
984
|
+
function Xe(e, t = !1) {
|
|
985
|
+
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 ${Ye[e % Ye.length]} ${t ? "shadow-[inset_0_1px_3px_rgb(0_0_0/8%)]" : ""}`;
|
|
976
986
|
}
|
|
977
|
-
function
|
|
987
|
+
function Ze(e) {
|
|
978
988
|
return e?.tenantName?.[0]?.toUpperCase() || "T";
|
|
979
989
|
}
|
|
980
|
-
function
|
|
990
|
+
function Qe(e, t, n) {
|
|
981
991
|
let r = e?.roles?.map((e) => e.roleName).filter(Boolean);
|
|
982
992
|
return r?.length ? r.join(", ") : e?.isOwner ? t : n;
|
|
983
993
|
}
|
|
984
|
-
function
|
|
985
|
-
let [d, f] = i(() =>
|
|
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(), [k, A] = i(!1), j = r(l), [M, N] = i({
|
|
986
996
|
total: 0,
|
|
987
997
|
recharge: 0,
|
|
988
998
|
gifted: 0
|
|
989
|
-
}),
|
|
990
|
-
total:
|
|
991
|
-
recharge:
|
|
992
|
-
gifted:
|
|
993
|
-
},
|
|
994
|
-
let t = await
|
|
999
|
+
}), P = D?.tenantId || "", L = o, R = {
|
|
1000
|
+
total: M.total ?? 0,
|
|
1001
|
+
recharge: M.recharge ?? 0,
|
|
1002
|
+
gifted: M.gifted ?? 0
|
|
1003
|
+
}, z = async (e) => {
|
|
1004
|
+
let t = await le(e);
|
|
995
1005
|
return t && C(t), t;
|
|
996
1006
|
};
|
|
997
1007
|
t(() => {
|
|
998
1008
|
C(a);
|
|
999
1009
|
}, [a]), t(() => {
|
|
1000
|
-
|
|
1010
|
+
j.current = l;
|
|
1001
1011
|
}, [l]);
|
|
1002
|
-
let
|
|
1003
|
-
E(e.tenants), O(e.currentTenant),
|
|
1012
|
+
let B = e((e) => {
|
|
1013
|
+
E(e.tenants), O(e.currentTenant), j.current?.(e);
|
|
1004
1014
|
}, []);
|
|
1005
1015
|
t(() => {
|
|
1006
|
-
|
|
1016
|
+
A(!0), ve().then(B).catch((e) => {
|
|
1007
1017
|
console.warn("Failed to refresh Mantur tenant context.", e), h.error(p.error);
|
|
1008
|
-
}).finally(() =>
|
|
1009
|
-
}, [
|
|
1018
|
+
}).finally(() => A(!1));
|
|
1019
|
+
}, [B, p.error]), t(() => {
|
|
1010
1020
|
let e = (e) => {
|
|
1011
|
-
e instanceof CustomEvent &&
|
|
1021
|
+
e instanceof CustomEvent && N(e.detail);
|
|
1012
1022
|
};
|
|
1013
|
-
return window.addEventListener(
|
|
1023
|
+
return window.addEventListener(q, e), fe().catch((e) => {
|
|
1014
1024
|
console.warn("Failed to refresh Mantur user points.", e);
|
|
1015
1025
|
}), () => {
|
|
1016
|
-
window.removeEventListener(
|
|
1026
|
+
window.removeEventListener(q, e);
|
|
1017
1027
|
};
|
|
1018
1028
|
}, []), t(() => {
|
|
1019
1029
|
let e = (e) => {
|
|
1020
|
-
f(e instanceof CustomEvent ?
|
|
1030
|
+
f(e instanceof CustomEvent ? X(e.detail) : Z());
|
|
1021
1031
|
};
|
|
1022
|
-
return window.addEventListener(
|
|
1023
|
-
window.removeEventListener(
|
|
1032
|
+
return window.addEventListener(Y, e), window.addEventListener("storage", e), () => {
|
|
1033
|
+
window.removeEventListener(Y, e), window.removeEventListener("storage", e);
|
|
1024
1034
|
};
|
|
1025
1035
|
}, []);
|
|
1026
|
-
let
|
|
1036
|
+
let V = (e) => {
|
|
1027
1037
|
h.success(e);
|
|
1028
|
-
},
|
|
1038
|
+
}, H = (e, t) => {
|
|
1029
1039
|
console.error(t), h.error(e);
|
|
1030
|
-
},
|
|
1031
|
-
if (!
|
|
1032
|
-
|
|
1040
|
+
}, U = e(async (e) => {
|
|
1041
|
+
if (!L && e !== P) try {
|
|
1042
|
+
A(!0), B(await ye(e)), V(p.switchedToTeam);
|
|
1033
1043
|
} catch (e) {
|
|
1034
|
-
|
|
1044
|
+
H(p.error, e);
|
|
1035
1045
|
} finally {
|
|
1036
|
-
|
|
1046
|
+
A(!1);
|
|
1037
1047
|
}
|
|
1038
1048
|
}, [
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1049
|
+
B,
|
|
1050
|
+
P,
|
|
1051
|
+
L,
|
|
1042
1052
|
p.error,
|
|
1043
1053
|
p.switchedToTeam
|
|
1044
|
-
]),
|
|
1054
|
+
]), W = (e) => {
|
|
1045
1055
|
let t = {
|
|
1046
|
-
total:
|
|
1047
|
-
recharge:
|
|
1048
|
-
gifted:
|
|
1056
|
+
total: R.total + e.points,
|
|
1057
|
+
recharge: R.recharge + e.points,
|
|
1058
|
+
gifted: R.gifted
|
|
1049
1059
|
};
|
|
1050
|
-
|
|
1051
|
-
},
|
|
1060
|
+
N(t), window.dispatchEvent(new CustomEvent(q, { detail: t })), h.success(p.rechargeSuccess), y(!1);
|
|
1061
|
+
}, G = n(() => /* @__PURE__ */ I(m, {
|
|
1052
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",
|
|
1053
|
-
selectedKeys:
|
|
1054
|
-
onClickMenuItem:
|
|
1055
|
-
children: [/* @__PURE__ */
|
|
1063
|
+
selectedKeys: P ? [P] : [],
|
|
1064
|
+
onClickMenuItem: U,
|
|
1065
|
+
children: [/* @__PURE__ */ F("div", {
|
|
1056
1066
|
className: "px-3 py-2 text-xs font-semibold tracking-[0.04em] text-arco-text-4 uppercase",
|
|
1057
1067
|
children: p.switchTeam
|
|
1058
|
-
}), w.map((e, t) => /* @__PURE__ */
|
|
1068
|
+
}), w.map((e, t) => /* @__PURE__ */ F(m.Item, {
|
|
1059
1069
|
className: "mb-1 h-auto! min-h-10! overflow-visible! rounded-lg! px-2! py-1! leading-normal!",
|
|
1060
|
-
children: /* @__PURE__ */
|
|
1070
|
+
children: /* @__PURE__ */ I("div", {
|
|
1061
1071
|
className: "flex w-full items-center gap-3 leading-normal",
|
|
1062
|
-
children: [/* @__PURE__ */
|
|
1063
|
-
className:
|
|
1064
|
-
children:
|
|
1065
|
-
}), /* @__PURE__ */
|
|
1072
|
+
children: [/* @__PURE__ */ F("div", {
|
|
1073
|
+
className: Xe(t),
|
|
1074
|
+
children: Ze(e)
|
|
1075
|
+
}), /* @__PURE__ */ I("div", {
|
|
1066
1076
|
className: "flex min-w-0 flex-col justify-center gap-0.75",
|
|
1067
|
-
children: [/* @__PURE__ */
|
|
1077
|
+
children: [/* @__PURE__ */ F("span", {
|
|
1068
1078
|
className: "text-sm leading-5 font-medium text-arco-text-1",
|
|
1069
1079
|
children: e.tenantName
|
|
1070
|
-
}), /* @__PURE__ */
|
|
1080
|
+
}), /* @__PURE__ */ F("span", {
|
|
1071
1081
|
className: "text-xs leading-4 text-arco-text-3",
|
|
1072
|
-
children:
|
|
1082
|
+
children: Qe(e, p.owner, p.member)
|
|
1073
1083
|
})]
|
|
1074
1084
|
})]
|
|
1075
1085
|
})
|
|
1076
1086
|
}, e.tenantId))]
|
|
1077
1087
|
}), [
|
|
1078
|
-
|
|
1079
|
-
|
|
1088
|
+
U,
|
|
1089
|
+
P,
|
|
1080
1090
|
w,
|
|
1081
1091
|
p
|
|
1082
|
-
]),
|
|
1092
|
+
]), K = /* @__PURE__ */ F(qe, {
|
|
1083
1093
|
user: S,
|
|
1084
|
-
points:
|
|
1094
|
+
points: R,
|
|
1085
1095
|
text: p,
|
|
1086
1096
|
onEditProfile: () => _(!0),
|
|
1087
1097
|
onRecharge: () => y(!0),
|
|
1088
1098
|
onPointsDetail: () => x(!0),
|
|
1089
|
-
onLogout:
|
|
1090
|
-
}),
|
|
1091
|
-
return /* @__PURE__ */
|
|
1099
|
+
onLogout: ce
|
|
1100
|
+
}), ee = Math.max(0, w.findIndex((e) => e.tenantId === D?.tenantId));
|
|
1101
|
+
return /* @__PURE__ */ I("div", {
|
|
1092
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",
|
|
1093
1103
|
children: [
|
|
1094
|
-
/* @__PURE__ */
|
|
1104
|
+
/* @__PURE__ */ I("div", {
|
|
1095
1105
|
className: "flex items-center gap-6",
|
|
1096
|
-
children: [/* @__PURE__ */
|
|
1106
|
+
children: [/* @__PURE__ */ I("div", {
|
|
1097
1107
|
className: "flex w-65 items-center gap-3 px-8 max-md:w-auto max-md:px-4",
|
|
1098
|
-
children: [/* @__PURE__ */
|
|
1108
|
+
children: [/* @__PURE__ */ F("div", {
|
|
1099
1109
|
className: "relative flex w-12 items-center justify-center overflow-hidden ",
|
|
1100
|
-
children: /* @__PURE__ */
|
|
1101
|
-
src:
|
|
1110
|
+
children: /* @__PURE__ */ F("img", {
|
|
1111
|
+
src: Je,
|
|
1102
1112
|
alt: "logo",
|
|
1103
1113
|
className: "w-full object-contain",
|
|
1104
1114
|
onError: (e) => {
|
|
1105
1115
|
e.currentTarget.style.display = "none";
|
|
1106
1116
|
}
|
|
1107
1117
|
})
|
|
1108
|
-
}), s ?? /* @__PURE__ */
|
|
1118
|
+
}), s ?? /* @__PURE__ */ F("span", {
|
|
1109
1119
|
className: "text-lg font-bold tracking-normal text-arco-text-1",
|
|
1110
1120
|
children: p.title
|
|
1111
1121
|
})]
|
|
1112
|
-
}), /* @__PURE__ */
|
|
1113
|
-
droplist:
|
|
1122
|
+
}), /* @__PURE__ */ F(u, {
|
|
1123
|
+
droplist: G,
|
|
1114
1124
|
trigger: "click",
|
|
1115
1125
|
position: "bl",
|
|
1116
|
-
disabled:
|
|
1117
|
-
children: /* @__PURE__ */
|
|
1118
|
-
"aria-disabled":
|
|
1119
|
-
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: L,
|
|
1127
|
+
children: /* @__PURE__ */ I("div", {
|
|
1128
|
+
"aria-disabled": L,
|
|
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 ${L ? "cursor-not-allowed opacity-60" : "cursor-pointer hover:bg-arco-fill-2 hover:shadow-[0_4px_12px_rgb(0_0_0/8%)]"}`,
|
|
1120
1130
|
children: [
|
|
1121
|
-
/* @__PURE__ */ P("div", {
|
|
1122
|
-
className: Re(oe, !0),
|
|
1123
|
-
children: ze(D)
|
|
1124
|
-
}),
|
|
1125
1131
|
/* @__PURE__ */ F("div", {
|
|
1132
|
+
className: Xe(ee, !0),
|
|
1133
|
+
children: Ze(D)
|
|
1134
|
+
}),
|
|
1135
|
+
/* @__PURE__ */ I("div", {
|
|
1126
1136
|
className: "flex min-w-0 flex-col",
|
|
1127
|
-
children: [/* @__PURE__ */
|
|
1137
|
+
children: [/* @__PURE__ */ F("span", {
|
|
1128
1138
|
className: "text-xs leading-none font-bold text-arco-text-1",
|
|
1129
|
-
children:
|
|
1130
|
-
}), /* @__PURE__ */
|
|
1139
|
+
children: k ? p.loading : D?.tenantName || p.loading
|
|
1140
|
+
}), /* @__PURE__ */ F("span", {
|
|
1131
1141
|
className: "mt-1 text-[10px] leading-none text-arco-text-3",
|
|
1132
|
-
children:
|
|
1142
|
+
children: Qe(D, p.owner, p.member)
|
|
1133
1143
|
})]
|
|
1134
1144
|
}),
|
|
1135
|
-
/* @__PURE__ */
|
|
1145
|
+
/* @__PURE__ */ F(T, { className: "ml-1 text-arco-text-3" })
|
|
1136
1146
|
]
|
|
1137
1147
|
})
|
|
1138
1148
|
})]
|
|
1139
1149
|
}),
|
|
1140
|
-
/* @__PURE__ */
|
|
1150
|
+
/* @__PURE__ */ F("div", {
|
|
1141
1151
|
className: "flex-1",
|
|
1142
1152
|
children: c
|
|
1143
1153
|
}),
|
|
1144
|
-
/* @__PURE__ */
|
|
1154
|
+
/* @__PURE__ */ I("div", {
|
|
1145
1155
|
className: "flex items-center gap-4",
|
|
1146
|
-
children: [/* @__PURE__ */
|
|
1156
|
+
children: [/* @__PURE__ */ I("div", {
|
|
1147
1157
|
className: "flex items-center gap-4",
|
|
1148
|
-
children: [/* @__PURE__ */
|
|
1149
|
-
}), /* @__PURE__ */
|
|
1150
|
-
droplist:
|
|
1158
|
+
children: [/* @__PURE__ */ F(Me, {}), /* @__PURE__ */ F(je, {})]
|
|
1159
|
+
}), /* @__PURE__ */ F(u, {
|
|
1160
|
+
droplist: K,
|
|
1151
1161
|
trigger: "click",
|
|
1152
1162
|
position: "br",
|
|
1153
1163
|
onVisibleChange: (e) => {
|
|
1154
|
-
e &&
|
|
1164
|
+
e && fe().catch((e) => {
|
|
1155
1165
|
console.warn("Failed to refresh Mantur user points.", e);
|
|
1156
1166
|
});
|
|
1157
1167
|
},
|
|
1158
|
-
children: /* @__PURE__ */
|
|
1168
|
+
children: /* @__PURE__ */ I("div", {
|
|
1159
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",
|
|
1160
1170
|
children: [
|
|
1161
|
-
/* @__PURE__ */
|
|
1171
|
+
/* @__PURE__ */ I("div", {
|
|
1162
1172
|
className: "from-arco-primary to-transparent relative rounded-full bg-linear-to-br p-0.5 shadow-sm",
|
|
1163
|
-
children: [/* @__PURE__ */
|
|
1173
|
+
children: [/* @__PURE__ */ F($, {
|
|
1164
1174
|
user: S,
|
|
1165
1175
|
size: 36
|
|
1166
|
-
}), /* @__PURE__ */
|
|
1176
|
+
}), /* @__PURE__ */ F("div", { className: "bg-arco-success border-arco-bg-white absolute right-0 bottom-0 h-3 w-3 rounded-full border-2 shadow-sm" })]
|
|
1167
1177
|
}),
|
|
1168
|
-
/* @__PURE__ */
|
|
1178
|
+
/* @__PURE__ */ F("div", {
|
|
1169
1179
|
className: "hidden flex-col md:flex",
|
|
1170
|
-
children: /* @__PURE__ */
|
|
1180
|
+
children: /* @__PURE__ */ F("span", {
|
|
1171
1181
|
className: "text-arco-text-1 text-sm font-medium",
|
|
1172
1182
|
children: S?.nickname || S?.username
|
|
1173
1183
|
})
|
|
1174
1184
|
}),
|
|
1175
|
-
/* @__PURE__ */
|
|
1185
|
+
/* @__PURE__ */ F(T, { className: "text-arco-text-3 ml-1" })
|
|
1176
1186
|
]
|
|
1177
1187
|
})
|
|
1178
1188
|
})]
|
|
1179
1189
|
}),
|
|
1180
|
-
/* @__PURE__ */
|
|
1190
|
+
/* @__PURE__ */ F(We, {
|
|
1181
1191
|
visible: g,
|
|
1182
1192
|
user: S,
|
|
1183
1193
|
labels: p,
|
|
1184
1194
|
onCancel: () => _(!1),
|
|
1185
|
-
onSubmit:
|
|
1195
|
+
onSubmit: z
|
|
1186
1196
|
}),
|
|
1187
|
-
/* @__PURE__ */
|
|
1197
|
+
/* @__PURE__ */ F(Ke, {
|
|
1188
1198
|
visible: v,
|
|
1189
1199
|
user: S,
|
|
1190
|
-
points:
|
|
1200
|
+
points: R,
|
|
1191
1201
|
text: p,
|
|
1192
1202
|
onCancel: () => y(!1),
|
|
1193
|
-
onPay:
|
|
1203
|
+
onPay: W
|
|
1194
1204
|
}),
|
|
1195
|
-
/* @__PURE__ */
|
|
1205
|
+
/* @__PURE__ */ F(Re, {
|
|
1196
1206
|
visible: b,
|
|
1197
|
-
points:
|
|
1207
|
+
points: R,
|
|
1198
1208
|
text: p,
|
|
1199
1209
|
onCancel: () => x(!1),
|
|
1200
1210
|
onRecharge: () => y(!0)
|
|
@@ -1203,4 +1213,306 @@ function Ve({ user: a, disabled: o = !1, brandSlot: s, children: c, onTenantCont
|
|
|
1203
1213
|
});
|
|
1204
1214
|
}
|
|
1205
1215
|
//#endregion
|
|
1206
|
-
|
|
1216
|
+
//#region src/utils/date.ts
|
|
1217
|
+
var et = /* @__PURE__ */ K((/* @__PURE__ */ W(((e, t) => {
|
|
1218
|
+
(function(n, r) {
|
|
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
|
+
})(e, (function() {
|
|
1221
|
+
var e = 1e3, t = 6e4, n = 36e5, r = "millisecond", i = "second", a = "minute", o = "hour", s = "day", c = "week", l = "month", u = "quarter", d = "year", f = "date", p = "Invalid Date", m = /^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/, h = /\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g, g = {
|
|
1222
|
+
name: "en",
|
|
1223
|
+
weekdays: "Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),
|
|
1224
|
+
months: "January_February_March_April_May_June_July_August_September_October_November_December".split("_"),
|
|
1225
|
+
ordinal: function(e) {
|
|
1226
|
+
var t = [
|
|
1227
|
+
"th",
|
|
1228
|
+
"st",
|
|
1229
|
+
"nd",
|
|
1230
|
+
"rd"
|
|
1231
|
+
], n = e % 100;
|
|
1232
|
+
return "[" + e + (t[(n - 20) % 10] || t[n] || t[0]) + "]";
|
|
1233
|
+
}
|
|
1234
|
+
}, _ = function(e, t, n) {
|
|
1235
|
+
var r = String(e);
|
|
1236
|
+
return !r || r.length >= t ? e : "" + Array(t + 1 - r.length).join(n) + e;
|
|
1237
|
+
}, v = {
|
|
1238
|
+
s: _,
|
|
1239
|
+
z: function(e) {
|
|
1240
|
+
var t = -e.utcOffset(), n = Math.abs(t), r = Math.floor(n / 60), i = n % 60;
|
|
1241
|
+
return (t <= 0 ? "+" : "-") + _(r, 2, "0") + ":" + _(i, 2, "0");
|
|
1242
|
+
},
|
|
1243
|
+
m: function e(t, n) {
|
|
1244
|
+
if (t.date() < n.date()) return -e(n, t);
|
|
1245
|
+
var r = 12 * (n.year() - t.year()) + (n.month() - t.month()), i = t.clone().add(r, l), a = n - i < 0, o = t.clone().add(r + (a ? -1 : 1), l);
|
|
1246
|
+
return +(-(r + (n - i) / (a ? i - o : o - i)) || 0);
|
|
1247
|
+
},
|
|
1248
|
+
a: function(e) {
|
|
1249
|
+
return e < 0 ? Math.ceil(e) || 0 : Math.floor(e);
|
|
1250
|
+
},
|
|
1251
|
+
p: function(e) {
|
|
1252
|
+
return {
|
|
1253
|
+
M: l,
|
|
1254
|
+
y: d,
|
|
1255
|
+
w: c,
|
|
1256
|
+
d: s,
|
|
1257
|
+
D: f,
|
|
1258
|
+
h: o,
|
|
1259
|
+
m: a,
|
|
1260
|
+
s: i,
|
|
1261
|
+
ms: r,
|
|
1262
|
+
Q: u
|
|
1263
|
+
}[e] || String(e || "").toLowerCase().replace(/s$/, "");
|
|
1264
|
+
},
|
|
1265
|
+
u: function(e) {
|
|
1266
|
+
return e === void 0;
|
|
1267
|
+
}
|
|
1268
|
+
}, y = "en", b = {};
|
|
1269
|
+
b[y] = g;
|
|
1270
|
+
var x = "$isDayjsObject", S = function(e) {
|
|
1271
|
+
return e instanceof E || !(!e || !e[x]);
|
|
1272
|
+
}, C = function e(t, n, r) {
|
|
1273
|
+
var i;
|
|
1274
|
+
if (!t) return y;
|
|
1275
|
+
if (typeof t == "string") {
|
|
1276
|
+
var a = t.toLowerCase();
|
|
1277
|
+
b[a] && (i = a), n && (b[a] = n, i = a);
|
|
1278
|
+
var o = t.split("-");
|
|
1279
|
+
if (!i && o.length > 1) return e(o[0]);
|
|
1280
|
+
} else {
|
|
1281
|
+
var s = t.name;
|
|
1282
|
+
b[s] = t, i = s;
|
|
1283
|
+
}
|
|
1284
|
+
return !r && i && (y = i), i || !r && y;
|
|
1285
|
+
}, w = function(e, t) {
|
|
1286
|
+
if (S(e)) return e.clone();
|
|
1287
|
+
var n = typeof t == "object" ? t : {};
|
|
1288
|
+
return n.date = e, n.args = arguments, new E(n);
|
|
1289
|
+
}, T = v;
|
|
1290
|
+
T.l = C, T.i = S, T.w = function(e, t) {
|
|
1291
|
+
return w(e, {
|
|
1292
|
+
locale: t.$L,
|
|
1293
|
+
utc: t.$u,
|
|
1294
|
+
x: t.$x,
|
|
1295
|
+
$offset: t.$offset
|
|
1296
|
+
});
|
|
1297
|
+
};
|
|
1298
|
+
var E = function() {
|
|
1299
|
+
function g(e) {
|
|
1300
|
+
this.$L = C(e.locale, null, !0), this.parse(e), this.$x = this.$x || e.x || {}, this[x] = !0;
|
|
1301
|
+
}
|
|
1302
|
+
var _ = g.prototype;
|
|
1303
|
+
return _.parse = function(e) {
|
|
1304
|
+
this.$d = function(e) {
|
|
1305
|
+
var t = e.date, n = e.utc;
|
|
1306
|
+
if (t === null) return /* @__PURE__ */ new Date(NaN);
|
|
1307
|
+
if (T.u(t)) return /* @__PURE__ */ new Date();
|
|
1308
|
+
if (t instanceof Date) return new Date(t);
|
|
1309
|
+
if (typeof t == "string" && !/Z$/i.test(t)) {
|
|
1310
|
+
var r = t.match(m);
|
|
1311
|
+
if (r) {
|
|
1312
|
+
var i = r[2] - 1 || 0, a = (r[7] || "0").substring(0, 3);
|
|
1313
|
+
return n ? new Date(Date.UTC(r[1], i, r[3] || 1, r[4] || 0, r[5] || 0, r[6] || 0, a)) : new Date(r[1], i, r[3] || 1, r[4] || 0, r[5] || 0, r[6] || 0, a);
|
|
1314
|
+
}
|
|
1315
|
+
}
|
|
1316
|
+
return new Date(t);
|
|
1317
|
+
}(e), this.init();
|
|
1318
|
+
}, _.init = function() {
|
|
1319
|
+
var e = this.$d;
|
|
1320
|
+
this.$y = e.getFullYear(), this.$M = e.getMonth(), this.$D = e.getDate(), this.$W = e.getDay(), this.$H = e.getHours(), this.$m = e.getMinutes(), this.$s = e.getSeconds(), this.$ms = e.getMilliseconds();
|
|
1321
|
+
}, _.$utils = function() {
|
|
1322
|
+
return T;
|
|
1323
|
+
}, _.isValid = function() {
|
|
1324
|
+
return this.$d.toString() !== p;
|
|
1325
|
+
}, _.isSame = function(e, t) {
|
|
1326
|
+
var n = w(e);
|
|
1327
|
+
return this.startOf(t) <= n && n <= this.endOf(t);
|
|
1328
|
+
}, _.isAfter = function(e, t) {
|
|
1329
|
+
return w(e) < this.startOf(t);
|
|
1330
|
+
}, _.isBefore = function(e, t) {
|
|
1331
|
+
return this.endOf(t) < w(e);
|
|
1332
|
+
}, _.$g = function(e, t, n) {
|
|
1333
|
+
return T.u(e) ? this[t] : this.set(n, e);
|
|
1334
|
+
}, _.unix = function() {
|
|
1335
|
+
return Math.floor(this.valueOf() / 1e3);
|
|
1336
|
+
}, _.valueOf = function() {
|
|
1337
|
+
return this.$d.getTime();
|
|
1338
|
+
}, _.startOf = function(e, t) {
|
|
1339
|
+
var n = this, r = !!T.u(t) || t, u = T.p(e), p = function(e, t) {
|
|
1340
|
+
var i = T.w(n.$u ? Date.UTC(n.$y, t, e) : new Date(n.$y, t, e), n);
|
|
1341
|
+
return r ? i : i.endOf(s);
|
|
1342
|
+
}, m = function(e, t) {
|
|
1343
|
+
return T.w(n.toDate()[e].apply(n.toDate("s"), (r ? [
|
|
1344
|
+
0,
|
|
1345
|
+
0,
|
|
1346
|
+
0,
|
|
1347
|
+
0
|
|
1348
|
+
] : [
|
|
1349
|
+
23,
|
|
1350
|
+
59,
|
|
1351
|
+
59,
|
|
1352
|
+
999
|
|
1353
|
+
]).slice(t)), n);
|
|
1354
|
+
}, h = this.$W, g = this.$M, _ = this.$D, v = "set" + (this.$u ? "UTC" : "");
|
|
1355
|
+
switch (u) {
|
|
1356
|
+
case d: return r ? p(1, 0) : p(31, 11);
|
|
1357
|
+
case l: return r ? p(1, g) : p(0, g + 1);
|
|
1358
|
+
case c:
|
|
1359
|
+
var y = this.$locale().weekStart || 0, b = (h < y ? h + 7 : h) - y;
|
|
1360
|
+
return p(r ? _ - b : _ + (6 - b), g);
|
|
1361
|
+
case s:
|
|
1362
|
+
case f: return m(v + "Hours", 0);
|
|
1363
|
+
case o: return m(v + "Minutes", 1);
|
|
1364
|
+
case a: return m(v + "Seconds", 2);
|
|
1365
|
+
case i: return m(v + "Milliseconds", 3);
|
|
1366
|
+
default: return this.clone();
|
|
1367
|
+
}
|
|
1368
|
+
}, _.endOf = function(e) {
|
|
1369
|
+
return this.startOf(e, !1);
|
|
1370
|
+
}, _.$set = function(e, t) {
|
|
1371
|
+
var n, c = T.p(e), u = "set" + (this.$u ? "UTC" : ""), p = (n = {}, n[s] = u + "Date", n[f] = u + "Date", n[l] = u + "Month", n[d] = u + "FullYear", n[o] = u + "Hours", n[a] = u + "Minutes", n[i] = u + "Seconds", n[r] = u + "Milliseconds", n)[c], m = c === s ? this.$D + (t - this.$W) : t;
|
|
1372
|
+
if (c === l || c === d) {
|
|
1373
|
+
var h = this.clone().set(f, 1);
|
|
1374
|
+
h.$d[p](m), h.init(), this.$d = h.set(f, Math.min(this.$D, h.daysInMonth())).$d;
|
|
1375
|
+
} else p && this.$d[p](m);
|
|
1376
|
+
return this.init(), this;
|
|
1377
|
+
}, _.set = function(e, t) {
|
|
1378
|
+
return this.clone().$set(e, t);
|
|
1379
|
+
}, _.get = function(e) {
|
|
1380
|
+
return this[T.p(e)]();
|
|
1381
|
+
}, _.add = function(r, u) {
|
|
1382
|
+
var f, p = this;
|
|
1383
|
+
r = Number(r);
|
|
1384
|
+
var m = T.p(u), h = function(e) {
|
|
1385
|
+
var t = w(p);
|
|
1386
|
+
return T.w(t.date(t.date() + Math.round(e * r)), p);
|
|
1387
|
+
};
|
|
1388
|
+
if (m === l) return this.set(l, this.$M + r);
|
|
1389
|
+
if (m === d) return this.set(d, this.$y + r);
|
|
1390
|
+
if (m === s) return h(1);
|
|
1391
|
+
if (m === c) return h(7);
|
|
1392
|
+
var g = (f = {}, f[a] = t, f[o] = n, f[i] = e, f)[m] || 1, _ = this.$d.getTime() + r * g;
|
|
1393
|
+
return T.w(_, this);
|
|
1394
|
+
}, _.subtract = function(e, t) {
|
|
1395
|
+
return this.add(-1 * e, t);
|
|
1396
|
+
}, _.format = function(e) {
|
|
1397
|
+
var t = this, n = this.$locale();
|
|
1398
|
+
if (!this.isValid()) return n.invalidDate || p;
|
|
1399
|
+
var r = e || "YYYY-MM-DDTHH:mm:ssZ", i = T.z(this), a = this.$H, o = this.$m, s = this.$M, c = n.weekdays, l = n.months, u = n.meridiem, d = function(e, n, i, a) {
|
|
1400
|
+
return e && (e[n] || e(t, r)) || i[n].slice(0, a);
|
|
1401
|
+
}, f = function(e) {
|
|
1402
|
+
return T.s(a % 12 || 12, e, "0");
|
|
1403
|
+
}, m = u || function(e, t, n) {
|
|
1404
|
+
var r = e < 12 ? "AM" : "PM";
|
|
1405
|
+
return n ? r.toLowerCase() : r;
|
|
1406
|
+
};
|
|
1407
|
+
return r.replace(h, (function(e, r) {
|
|
1408
|
+
return r || function(e) {
|
|
1409
|
+
switch (e) {
|
|
1410
|
+
case "YY": return String(t.$y).slice(-2);
|
|
1411
|
+
case "YYYY": return T.s(t.$y, 4, "0");
|
|
1412
|
+
case "M": return s + 1;
|
|
1413
|
+
case "MM": return T.s(s + 1, 2, "0");
|
|
1414
|
+
case "MMM": return d(n.monthsShort, s, l, 3);
|
|
1415
|
+
case "MMMM": return d(l, s);
|
|
1416
|
+
case "D": return t.$D;
|
|
1417
|
+
case "DD": return T.s(t.$D, 2, "0");
|
|
1418
|
+
case "d": return String(t.$W);
|
|
1419
|
+
case "dd": return d(n.weekdaysMin, t.$W, c, 2);
|
|
1420
|
+
case "ddd": return d(n.weekdaysShort, t.$W, c, 3);
|
|
1421
|
+
case "dddd": return c[t.$W];
|
|
1422
|
+
case "H": return String(a);
|
|
1423
|
+
case "HH": return T.s(a, 2, "0");
|
|
1424
|
+
case "h": return f(1);
|
|
1425
|
+
case "hh": return f(2);
|
|
1426
|
+
case "a": return m(a, o, !0);
|
|
1427
|
+
case "A": return m(a, o, !1);
|
|
1428
|
+
case "m": return String(o);
|
|
1429
|
+
case "mm": return T.s(o, 2, "0");
|
|
1430
|
+
case "s": return String(t.$s);
|
|
1431
|
+
case "ss": return T.s(t.$s, 2, "0");
|
|
1432
|
+
case "SSS": return T.s(t.$ms, 3, "0");
|
|
1433
|
+
case "Z": return i;
|
|
1434
|
+
}
|
|
1435
|
+
return null;
|
|
1436
|
+
}(e) || i.replace(":", "");
|
|
1437
|
+
}));
|
|
1438
|
+
}, _.utcOffset = function() {
|
|
1439
|
+
return 15 * -Math.round(this.$d.getTimezoneOffset() / 15);
|
|
1440
|
+
}, _.diff = function(r, f, p) {
|
|
1441
|
+
var m, h = this, g = T.p(f), _ = w(r), v = (_.utcOffset() - this.utcOffset()) * t, y = this - _, b = function() {
|
|
1442
|
+
return T.m(h, _);
|
|
1443
|
+
};
|
|
1444
|
+
switch (g) {
|
|
1445
|
+
case d:
|
|
1446
|
+
m = b() / 12;
|
|
1447
|
+
break;
|
|
1448
|
+
case l:
|
|
1449
|
+
m = b();
|
|
1450
|
+
break;
|
|
1451
|
+
case u:
|
|
1452
|
+
m = b() / 3;
|
|
1453
|
+
break;
|
|
1454
|
+
case c:
|
|
1455
|
+
m = (y - v) / 6048e5;
|
|
1456
|
+
break;
|
|
1457
|
+
case s:
|
|
1458
|
+
m = (y - v) / 864e5;
|
|
1459
|
+
break;
|
|
1460
|
+
case o:
|
|
1461
|
+
m = y / n;
|
|
1462
|
+
break;
|
|
1463
|
+
case a:
|
|
1464
|
+
m = y / t;
|
|
1465
|
+
break;
|
|
1466
|
+
case i:
|
|
1467
|
+
m = y / e;
|
|
1468
|
+
break;
|
|
1469
|
+
default: m = y;
|
|
1470
|
+
}
|
|
1471
|
+
return p ? m : T.a(m);
|
|
1472
|
+
}, _.daysInMonth = function() {
|
|
1473
|
+
return this.endOf(l).$D;
|
|
1474
|
+
}, _.$locale = function() {
|
|
1475
|
+
return b[this.$L];
|
|
1476
|
+
}, _.locale = function(e, t) {
|
|
1477
|
+
if (!e) return this.$L;
|
|
1478
|
+
var n = this.clone(), r = C(e, t, !0);
|
|
1479
|
+
return r && (n.$L = r), n;
|
|
1480
|
+
}, _.clone = function() {
|
|
1481
|
+
return T.w(this.$d, this);
|
|
1482
|
+
}, _.toDate = function() {
|
|
1483
|
+
return new Date(this.valueOf());
|
|
1484
|
+
}, _.toJSON = function() {
|
|
1485
|
+
return this.isValid() ? this.toISOString() : null;
|
|
1486
|
+
}, _.toISOString = function() {
|
|
1487
|
+
return this.$d.toISOString();
|
|
1488
|
+
}, _.toString = function() {
|
|
1489
|
+
return this.$d.toUTCString();
|
|
1490
|
+
}, g;
|
|
1491
|
+
}(), D = E.prototype;
|
|
1492
|
+
return w.prototype = D, [
|
|
1493
|
+
["$ms", r],
|
|
1494
|
+
["$s", i],
|
|
1495
|
+
["$m", a],
|
|
1496
|
+
["$H", o],
|
|
1497
|
+
["$W", s],
|
|
1498
|
+
["$M", l],
|
|
1499
|
+
["$y", d],
|
|
1500
|
+
["$D", f]
|
|
1501
|
+
].forEach((function(e) {
|
|
1502
|
+
D[e[1]] = function(t) {
|
|
1503
|
+
return this.$g(t, e[0], e[1]);
|
|
1504
|
+
};
|
|
1505
|
+
})), w.extend = function(e, t) {
|
|
1506
|
+
return e.$i ||= (e(t, E, w), !0), w;
|
|
1507
|
+
}, w.locale = C, w.isDayjs = S, w.unix = function(e) {
|
|
1508
|
+
return w(1e3 * e);
|
|
1509
|
+
}, w.en = b[y], w.Ls = b, w.p = {}, w;
|
|
1510
|
+
}));
|
|
1511
|
+
})))(), 1);
|
|
1512
|
+
function tt(e, t = "datetime", n) {
|
|
1513
|
+
if (!e) return "-";
|
|
1514
|
+
let r = (n ? X(n) : Z()).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";
|
|
1515
|
+
return (0, et.default)(e).format(i);
|
|
1516
|
+
}
|
|
1517
|
+
//#endregion
|
|
1518
|
+
export { $e as ManturHeader, tt as formatDateByLang };
|