mantur-components 0.1.13 → 0.1.14-beta.2
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.
|
@@ -1,31 +1,31 @@
|
|
|
1
1
|
import e, { useCallback as t, useEffect as n, useMemo as r, useRef as i, useState as a } from "react";
|
|
2
2
|
import { Alert as o, Avatar as s, Button as c, Card as l, DatePicker as u, Descriptions as d, Divider as f, Dropdown as p, Form as m, Grid as h, Input as g, Menu as _, Message as v, Modal as y, Pagination as b, Select as x, Spin as S, Table as C, Tabs as w, Tag as T, Tooltip as E, Typography as D, Upload as O } from "@arco-design/web-react";
|
|
3
|
-
import { IconCheckCircleFill as k, IconDown as A, IconEdit as j,
|
|
4
|
-
import { useTranslation as
|
|
5
|
-
import { jsx as
|
|
6
|
-
import { useTheme as
|
|
3
|
+
import { IconCheckCircleFill as k, IconDown as A, IconEdit as j, IconFile as M, IconLanguage as N, IconMoonFill as P, IconPlus as F, IconPoweroff as I, IconSunFill as L, IconUpload as R } from "@arco-design/web-react/icon";
|
|
4
|
+
import { useTranslation as z } from "react-i18next";
|
|
5
|
+
import { jsx as B, jsxs as V } from "react/jsx-runtime";
|
|
6
|
+
import { useTheme as ee } from "next-themes";
|
|
7
7
|
//#region \0rolldown/runtime.js
|
|
8
|
-
var
|
|
9
|
-
if (t && typeof t == "object" || typeof t == "function") for (var i = re(t), a = 0, o = i.length, s; a < o; a++) s = i[a], !ae.call(e, s) && s !== n &&
|
|
8
|
+
var te = Object.create, H = Object.defineProperty, ne = Object.getOwnPropertyDescriptor, re = Object.getOwnPropertyNames, ie = Object.getPrototypeOf, ae = Object.prototype.hasOwnProperty, U = (e, t) => () => (t || (e((t = { exports: {} }).exports, t), e = null), t.exports), W = (e, t, n, r) => {
|
|
9
|
+
if (t && typeof t == "object" || typeof t == "function") for (var i = re(t), a = 0, o = i.length, s; a < o; a++) s = i[a], !ae.call(e, s) && s !== n && H(e, s, {
|
|
10
10
|
get: ((e) => t[e]).bind(null, s),
|
|
11
11
|
enumerable: !(r = ne(t, s)) || r.enumerable
|
|
12
12
|
});
|
|
13
13
|
return e;
|
|
14
|
-
},
|
|
14
|
+
}, G = (e, t, n) => (n = e == null ? {} : te(ie(e)), W(t || !e || !e.__esModule ? H(n, "default", {
|
|
15
15
|
value: e,
|
|
16
16
|
enumerable: !0
|
|
17
|
-
}) : n, e)),
|
|
17
|
+
}) : n, e)), K = () => {
|
|
18
18
|
if (typeof window > "u" || !window.location?.href) throw Error("redirectToManturMain requires currentUrl when window.location is unavailable.");
|
|
19
19
|
return window.location.href;
|
|
20
|
-
},
|
|
20
|
+
}, oe = (e, t) => {
|
|
21
21
|
let n = e.split(".");
|
|
22
22
|
return n.length <= 1 ? t : [t, ...n.slice(1)].join(".");
|
|
23
|
-
},
|
|
23
|
+
}, q = (e) => `${e.pathname}${e.search}${e.hash}`, se = new Set([
|
|
24
24
|
"localhost",
|
|
25
25
|
"127.0.0.1",
|
|
26
26
|
"::1",
|
|
27
27
|
"[::1]"
|
|
28
|
-
]), ce = (e) =>
|
|
28
|
+
]), ce = (e) => se.has(e), le = (e) => e.startsWith("[") && e.endsWith("]") ? e : e.includes(":") ? `[${e}]` : e, ue = {
|
|
29
29
|
82: "creative-agent",
|
|
30
30
|
83: "production-agent",
|
|
31
31
|
81: "traffic-engine",
|
|
@@ -35,7 +35,7 @@ function de(e) {
|
|
|
35
35
|
let t = {
|
|
36
36
|
BASE_URL: "/",
|
|
37
37
|
DEV: !1,
|
|
38
|
-
MODE: "
|
|
38
|
+
MODE: "test",
|
|
39
39
|
PROD: !0,
|
|
40
40
|
SSR: !1,
|
|
41
41
|
VITE_MANTUR_STRIPE_PUBLISHABLE_KEY: "pk_test_51TJ8JiERSsQknDG7bJSIX81RFq3LcCfUXCV7mh0cQsZ2dwmYcJ5Ki6bPXynNvdyZEEBE83I6I719NIFyO9Qreey700yPAul8sv"
|
|
@@ -46,26 +46,26 @@ function fe(e) {
|
|
|
46
46
|
return (typeof window > "u" ? de("VITE_APP_NAME") : window.__MANTUR_APP_NAME__ || de("VITE_APP_NAME"))?.trim() || ue[e.port] || "mantur";
|
|
47
47
|
}
|
|
48
48
|
function pe(e = {}) {
|
|
49
|
-
let t = new URL(e.currentUrl || (typeof window > "u" ? "http://localhost/" :
|
|
49
|
+
let t = new URL(e.currentUrl || (typeof window > "u" ? "http://localhost/" : K()));
|
|
50
50
|
return {
|
|
51
51
|
app: fe(t),
|
|
52
|
-
redirect:
|
|
52
|
+
redirect: q(t)
|
|
53
53
|
};
|
|
54
54
|
}
|
|
55
55
|
function me(e, t = {}) {
|
|
56
|
-
let n = new URL(t.currentUrl ||
|
|
56
|
+
let n = new URL(t.currentUrl || K()), r = e?.trim();
|
|
57
57
|
if (ce(n.hostname)) return `${n.protocol}//${le(n.hostname)}:80/`;
|
|
58
58
|
let i = new URL(n.toString());
|
|
59
|
-
return r && (i.hostname =
|
|
59
|
+
return r && (i.hostname = oe(n.hostname, r)), i.port = "", i.pathname = "/", i.search = "", i.hash = "", i.toString();
|
|
60
60
|
}
|
|
61
61
|
function he(e, t = {}) {
|
|
62
62
|
let n = me(e, t);
|
|
63
63
|
return t.navigate !== !1 && typeof window < "u" && (window.location.href = n), n;
|
|
64
64
|
}
|
|
65
65
|
function ge(e, t, n = {}) {
|
|
66
|
-
let r = new URL(n.currentUrl ||
|
|
67
|
-
a && (i.hostname =
|
|
68
|
-
let o =
|
|
66
|
+
let r = new URL(n.currentUrl || K()), i = new URL(r.toString()), a = e?.trim();
|
|
67
|
+
a && (i.hostname = oe(r.hostname, a)), i.port = "";
|
|
68
|
+
let o = q(r);
|
|
69
69
|
i.pathname = "/login", i.searchParams.set("app", t?.trim()), i.searchParams.set("redirect", o);
|
|
70
70
|
let s = i.toString();
|
|
71
71
|
return n.navigate !== !1 && typeof window < "u" && (window.location.href = s), s;
|
|
@@ -111,7 +111,7 @@ function De(e) {
|
|
|
111
111
|
if (t.code !== 0) throw Error(t.message || "Request failed");
|
|
112
112
|
return t;
|
|
113
113
|
}
|
|
114
|
-
async function
|
|
114
|
+
async function J(e, t = {}) {
|
|
115
115
|
let n = Te("front-token"), r = Te("Accept-Language"), i = t.headers || {};
|
|
116
116
|
return n && (i.Authorization = decodeURIComponent(n)), r && (i["Accept-Language"] = decodeURIComponent(r)), new Promise((n, r) => {
|
|
117
117
|
let a = new XMLHttpRequest();
|
|
@@ -133,7 +133,7 @@ async function q(e, t = {}) {
|
|
|
133
133
|
}
|
|
134
134
|
async function Oe() {
|
|
135
135
|
try {
|
|
136
|
-
await
|
|
136
|
+
await J("/auth/front-logout", { method: "DELETE" });
|
|
137
137
|
} catch (e) {
|
|
138
138
|
console.warn("Logout request failed, continuing local logout.", e);
|
|
139
139
|
} finally {
|
|
@@ -144,12 +144,12 @@ async function ke(e) {
|
|
|
144
144
|
let t;
|
|
145
145
|
if (e.avatarFile) {
|
|
146
146
|
let n = new FormData();
|
|
147
|
-
n.append("file", e.avatarFile), t = (await
|
|
147
|
+
n.append("file", e.avatarFile), t = (await J("/users/me/avatar", {
|
|
148
148
|
method: "POST",
|
|
149
149
|
body: n
|
|
150
150
|
})).data;
|
|
151
151
|
}
|
|
152
|
-
return (await
|
|
152
|
+
return (await J("/users/me", {
|
|
153
153
|
method: "PUT",
|
|
154
154
|
headers: { "Content-Type": "application/json;charset=utf-8" },
|
|
155
155
|
body: JSON.stringify({ nickname: e.nickname })
|
|
@@ -167,18 +167,18 @@ function Ae(e) {
|
|
|
167
167
|
};
|
|
168
168
|
}
|
|
169
169
|
async function je() {
|
|
170
|
-
return Ae((await
|
|
170
|
+
return Ae((await J(Ce())).data);
|
|
171
171
|
}
|
|
172
172
|
async function Me() {
|
|
173
173
|
let e = await je();
|
|
174
174
|
return typeof window < "u" && window.dispatchEvent(new CustomEvent(ye, { detail: e })), e;
|
|
175
175
|
}
|
|
176
176
|
async function Ne() {
|
|
177
|
-
return (await
|
|
177
|
+
return (await J("/billing/packages")).data || [];
|
|
178
178
|
}
|
|
179
179
|
async function Pe(e) {
|
|
180
180
|
let t = pe();
|
|
181
|
-
return (await
|
|
181
|
+
return (await J("/billing/recharge/orders", {
|
|
182
182
|
method: "POST",
|
|
183
183
|
headers: { "Content-Type": "application/json;charset=utf-8" },
|
|
184
184
|
body: JSON.stringify({
|
|
@@ -189,22 +189,22 @@ async function Pe(e) {
|
|
|
189
189
|
})).data;
|
|
190
190
|
}
|
|
191
191
|
async function Fe(e) {
|
|
192
|
-
return (await
|
|
192
|
+
return (await J(`/billing/recharge/orders/${encodeURIComponent(e)}`)).data;
|
|
193
193
|
}
|
|
194
194
|
async function Ie(e) {
|
|
195
|
-
return (await
|
|
195
|
+
return (await J(`/billing/recharge/orders/${encodeURIComponent(e)}/cancel`, { method: "POST" })).data;
|
|
196
196
|
}
|
|
197
197
|
async function Le() {
|
|
198
|
-
return (await
|
|
198
|
+
return (await J("/billing/pricing/charge-points")).data || [];
|
|
199
199
|
}
|
|
200
200
|
async function Re(e) {
|
|
201
|
-
return (await
|
|
201
|
+
return (await J(`/billing/pricing/charge-points/${encodeURIComponent(e)}`)).data;
|
|
202
202
|
}
|
|
203
203
|
async function ze() {
|
|
204
|
-
return (await
|
|
204
|
+
return (await J("/billing/accounts/me")).data;
|
|
205
205
|
}
|
|
206
206
|
async function Be(e) {
|
|
207
|
-
return (await
|
|
207
|
+
return (await J(`/billing/accounts/me/ledger${we({
|
|
208
208
|
pageNum: e.pageNum,
|
|
209
209
|
pageSize: e.pageSize,
|
|
210
210
|
directions: e.directions,
|
|
@@ -227,13 +227,13 @@ function He(e) {
|
|
|
227
227
|
typeof window < "u" && (window.__MANTUR_COMPONENTS_TENANT_CONTEXT__ = e, window.dispatchEvent(new CustomEvent(xe, { detail: e })));
|
|
228
228
|
}
|
|
229
229
|
async function Ue() {
|
|
230
|
-
return (await
|
|
230
|
+
return (await J("/users/me/tenants")).data || [];
|
|
231
231
|
}
|
|
232
232
|
async function We() {
|
|
233
|
-
return (await
|
|
233
|
+
return (await J("/auth/current-tenant")).data;
|
|
234
234
|
}
|
|
235
235
|
async function Ge(e) {
|
|
236
|
-
return (await
|
|
236
|
+
return (await J(`/auth/current-tenant/${e}`, { method: "PUT" })).data;
|
|
237
237
|
}
|
|
238
238
|
async function Ke(e = "refresh") {
|
|
239
239
|
let [t, n] = await Promise.all([Ue(), We()]), r = {
|
|
@@ -421,14 +421,14 @@ var Je = {
|
|
|
421
421
|
...Ye
|
|
422
422
|
}
|
|
423
423
|
};
|
|
424
|
-
function
|
|
424
|
+
function Y(e) {
|
|
425
425
|
return e?.toLowerCase().startsWith("en") ? "en-US" : "zh-CN";
|
|
426
426
|
}
|
|
427
427
|
function nt() {
|
|
428
|
-
return typeof window > "u" ? "zh-CN" :
|
|
428
|
+
return typeof window > "u" ? "zh-CN" : Y(window.localStorage.getItem("i18nextLng") || document.documentElement.lang || navigator.language);
|
|
429
429
|
}
|
|
430
430
|
function rt(e) {
|
|
431
|
-
return tt[
|
|
431
|
+
return tt[Y(e)];
|
|
432
432
|
}
|
|
433
433
|
//#endregion
|
|
434
434
|
//#region src/lang-switch/LangSwitch.tsx
|
|
@@ -437,33 +437,33 @@ function ot(e, t) {
|
|
|
437
437
|
document.cookie = `${encodeURIComponent(e)}=${encodeURIComponent(t)}; path=/`;
|
|
438
438
|
}
|
|
439
439
|
function st() {
|
|
440
|
-
let { i18n: e } =
|
|
440
|
+
let { i18n: e } = z(), [t, r] = a(() => nt()), i = rt(t);
|
|
441
441
|
return n(() => {
|
|
442
|
-
r(
|
|
443
|
-
}, [e.language]), /* @__PURE__ */
|
|
444
|
-
droplist: /* @__PURE__ */
|
|
442
|
+
r(Y(e.language));
|
|
443
|
+
}, [e.language]), /* @__PURE__ */ B(p, {
|
|
444
|
+
droplist: /* @__PURE__ */ V(_, {
|
|
445
445
|
selectedKeys: [t],
|
|
446
446
|
onClickMenuItem: (t) => {
|
|
447
|
-
let n =
|
|
447
|
+
let n = Y(t);
|
|
448
448
|
localStorage.setItem(it, t), localStorage.setItem(at, "manual"), r(n), e.changeLanguage(t), ot("Accept-Language", t), window.dispatchEvent(new CustomEvent(et, { detail: n })), window.location.reload();
|
|
449
449
|
},
|
|
450
|
-
children: [/* @__PURE__ */
|
|
450
|
+
children: [/* @__PURE__ */ B(_.Item, { children: i.languageZh }, "zh-CN"), /* @__PURE__ */ B(_.Item, { children: i.languageEn }, "en-US")]
|
|
451
451
|
}),
|
|
452
452
|
trigger: "click",
|
|
453
453
|
position: "br",
|
|
454
|
-
children: /* @__PURE__ */
|
|
454
|
+
children: /* @__PURE__ */ B(c, {
|
|
455
455
|
shape: "circle",
|
|
456
|
-
icon: /* @__PURE__ */
|
|
456
|
+
icon: /* @__PURE__ */ B(N, {})
|
|
457
457
|
})
|
|
458
458
|
});
|
|
459
459
|
}
|
|
460
460
|
//#endregion
|
|
461
461
|
//#region src/theme-switch/ThemeSwitch.tsx
|
|
462
462
|
function ct() {
|
|
463
|
-
let { resolvedTheme: e, setTheme: t } =
|
|
464
|
-
return /* @__PURE__ */
|
|
463
|
+
let { resolvedTheme: e, setTheme: t } = ee();
|
|
464
|
+
return /* @__PURE__ */ B(c, {
|
|
465
465
|
shape: "circle",
|
|
466
|
-
icon:
|
|
466
|
+
icon: B(e === "light" ? P : L, {}),
|
|
467
467
|
onClick: () => {
|
|
468
468
|
t(e === "light" ? "dark" : "light");
|
|
469
469
|
}
|
|
@@ -471,7 +471,7 @@ function ct() {
|
|
|
471
471
|
}
|
|
472
472
|
//#endregion
|
|
473
473
|
//#region src/utils/date.ts
|
|
474
|
-
var lt = /* @__PURE__ */
|
|
474
|
+
var lt = /* @__PURE__ */ G((/* @__PURE__ */ U(((e, t) => {
|
|
475
475
|
(function(n, r) {
|
|
476
476
|
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();
|
|
477
477
|
})(e, (function() {
|
|
@@ -768,7 +768,7 @@ var lt = /* @__PURE__ */ U((/* @__PURE__ */ H(((e, t) => {
|
|
|
768
768
|
})))(), 1);
|
|
769
769
|
function ut(e, t = "datetime", n) {
|
|
770
770
|
if (!e) return "-";
|
|
771
|
-
let r = (n ?
|
|
771
|
+
let r = (n ? Y(n) : nt()).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";
|
|
772
772
|
return (0, lt.default)(e).format(i);
|
|
773
773
|
}
|
|
774
774
|
//#endregion
|
|
@@ -804,7 +804,7 @@ function Ct(e, t) {
|
|
|
804
804
|
return e.pointType === 1 ? t.sourceRecharge : e.pointType === 2 ? t.sourceGifted : e.actionName || (xt(e) < 0 ? t.expense : t.income);
|
|
805
805
|
}
|
|
806
806
|
function wt({ visible: e, points: r, text: o, onCancel: s, onRecharge: u }) {
|
|
807
|
-
let [d, f] = a("all"), [p, m] = a("all"), [g, _] = a([]), [S, E] = a(1), [O, k] = a([]), [A, j] = a(0), [M, N] = a(!1),
|
|
807
|
+
let [d, f] = a("all"), [p, m] = a("all"), [g, _] = a([]), [S, E] = a(1), [O, k] = a([]), [A, j] = a(0), [M, N] = a(!1), P = i(0), I = (e) => new Intl.NumberFormat().format(e), L = t((e) => {
|
|
808
808
|
let [t, n] = g;
|
|
809
809
|
return {
|
|
810
810
|
pageNum: e,
|
|
@@ -833,18 +833,18 @@ function wt({ visible: e, points: r, text: o, onCancel: s, onRecharge: u }) {
|
|
|
833
833
|
badgeKind: St(e),
|
|
834
834
|
badgeText: Ct(e, o)
|
|
835
835
|
};
|
|
836
|
-
}, [o]),
|
|
837
|
-
let n =
|
|
838
|
-
|
|
836
|
+
}, [o]), z = t(async (e = S, t = !1) => {
|
|
837
|
+
let n = P.current + 1;
|
|
838
|
+
P.current = n, N(!0);
|
|
839
839
|
try {
|
|
840
840
|
let r = await Be(L(e));
|
|
841
|
-
if (n !==
|
|
841
|
+
if (n !== P.current) return;
|
|
842
842
|
k((r.records || []).map((t, n) => R(t, n, e))), j(Number(r.total || 0)), E(Number(r.pageNum || e)), t && v.success(o.refreshed);
|
|
843
843
|
} catch (e) {
|
|
844
|
-
if (n !==
|
|
844
|
+
if (n !== P.current) return;
|
|
845
845
|
console.warn("Failed to load Mantur points ledger.", e), v.error(o.error);
|
|
846
846
|
} finally {
|
|
847
|
-
n ===
|
|
847
|
+
n === P.current && N(!1);
|
|
848
848
|
}
|
|
849
849
|
}, [
|
|
850
850
|
L,
|
|
@@ -854,18 +854,18 @@ function wt({ visible: e, points: r, text: o, onCancel: s, onRecharge: u }) {
|
|
|
854
854
|
o.refreshed
|
|
855
855
|
]);
|
|
856
856
|
n(() => {
|
|
857
|
-
e &&
|
|
858
|
-
}, [
|
|
857
|
+
e && z();
|
|
858
|
+
}, [z, e]);
|
|
859
859
|
let ee = [
|
|
860
860
|
{
|
|
861
861
|
title: o.pointsDetail,
|
|
862
862
|
dataIndex: "name",
|
|
863
|
-
render: (e, t) => /* @__PURE__ */
|
|
863
|
+
render: (e, t) => /* @__PURE__ */ V("div", {
|
|
864
864
|
className: "min-w-0",
|
|
865
|
-
children: [/* @__PURE__ */
|
|
865
|
+
children: [/* @__PURE__ */ B(D.Text, {
|
|
866
866
|
className: "font-medium!",
|
|
867
867
|
children: t.name
|
|
868
|
-
}), /* @__PURE__ */
|
|
868
|
+
}), /* @__PURE__ */ B(D.Text, {
|
|
869
869
|
type: "secondary",
|
|
870
870
|
className: "mt-1 block! text-xs!",
|
|
871
871
|
children: t.meta
|
|
@@ -877,7 +877,7 @@ function wt({ visible: e, points: r, text: o, onCancel: s, onRecharge: u }) {
|
|
|
877
877
|
dataIndex: "amount",
|
|
878
878
|
width: 120,
|
|
879
879
|
align: "right",
|
|
880
|
-
render: (e, t) => /* @__PURE__ */
|
|
880
|
+
render: (e, t) => /* @__PURE__ */ V(D.Text, {
|
|
881
881
|
className: `font-semibold! ${t.amount > 0 ? "text-arco-success-6!" : "text-arco-danger-6!"}`,
|
|
882
882
|
children: [t.amount > 0 ? "+" : "", I(t.amount)]
|
|
883
883
|
})
|
|
@@ -887,23 +887,23 @@ function wt({ visible: e, points: r, text: o, onCancel: s, onRecharge: u }) {
|
|
|
887
887
|
dataIndex: "badgeText",
|
|
888
888
|
width: 110,
|
|
889
889
|
align: "right",
|
|
890
|
-
render: (e, t) => /* @__PURE__ */
|
|
890
|
+
render: (e, t) => /* @__PURE__ */ B(T, {
|
|
891
891
|
color: _t(t.badgeKind),
|
|
892
892
|
children: t.badgeText
|
|
893
893
|
})
|
|
894
894
|
}
|
|
895
895
|
];
|
|
896
|
-
return /* @__PURE__ */
|
|
896
|
+
return /* @__PURE__ */ B(y, {
|
|
897
897
|
title: o.pointsDetail,
|
|
898
898
|
visible: e,
|
|
899
|
-
footer: /* @__PURE__ */
|
|
899
|
+
footer: /* @__PURE__ */ V("div", {
|
|
900
900
|
className: "flex justify-end gap-2",
|
|
901
|
-
children: [/* @__PURE__ */
|
|
901
|
+
children: [/* @__PURE__ */ B(c, {
|
|
902
902
|
onClick: s,
|
|
903
903
|
children: o.close
|
|
904
|
-
}), /* @__PURE__ */
|
|
904
|
+
}), /* @__PURE__ */ B(c, {
|
|
905
905
|
type: "primary",
|
|
906
|
-
icon: /* @__PURE__ */
|
|
906
|
+
icon: /* @__PURE__ */ B(F, {}),
|
|
907
907
|
onClick: () => {
|
|
908
908
|
s(), u();
|
|
909
909
|
},
|
|
@@ -915,131 +915,131 @@ function wt({ visible: e, points: r, text: o, onCancel: s, onRecharge: u }) {
|
|
|
915
915
|
width: 780,
|
|
916
916
|
maxWidth: "calc(100vw - 48px)"
|
|
917
917
|
},
|
|
918
|
-
children: /* @__PURE__ */
|
|
918
|
+
children: /* @__PURE__ */ V("div", {
|
|
919
919
|
className: "max-h-[70vh] overflow-y-auto",
|
|
920
920
|
children: [
|
|
921
|
-
/* @__PURE__ */
|
|
921
|
+
/* @__PURE__ */ V(l, {
|
|
922
922
|
bordered: !1,
|
|
923
923
|
className: "from-arco-primary-light-1/40 to-cyan-400/5 rounded-none! bg-linear-to-br!",
|
|
924
924
|
children: [
|
|
925
|
-
/* @__PURE__ */
|
|
925
|
+
/* @__PURE__ */ B(D.Text, {
|
|
926
926
|
type: "secondary",
|
|
927
927
|
className: "text-xs!",
|
|
928
928
|
children: o.totalBalance
|
|
929
929
|
}),
|
|
930
|
-
/* @__PURE__ */
|
|
930
|
+
/* @__PURE__ */ V("div", {
|
|
931
931
|
className: "mt-1.5 mb-3.5 ",
|
|
932
|
-
children: [/* @__PURE__ */
|
|
932
|
+
children: [/* @__PURE__ */ B(D.Text, {
|
|
933
933
|
className: "text-3xl! font-bold!",
|
|
934
934
|
children: I(r.total)
|
|
935
|
-
}), /* @__PURE__ */
|
|
935
|
+
}), /* @__PURE__ */ V(D.Text, {
|
|
936
936
|
type: "secondary",
|
|
937
937
|
className: "ml-2 text-sm! ",
|
|
938
938
|
children: ["🪙 ", o.pointsUnit]
|
|
939
939
|
})]
|
|
940
940
|
}),
|
|
941
|
-
/* @__PURE__ */
|
|
941
|
+
/* @__PURE__ */ V(h.Row, {
|
|
942
942
|
gutter: 12,
|
|
943
|
-
children: [/* @__PURE__ */
|
|
943
|
+
children: [/* @__PURE__ */ B(h.Col, {
|
|
944
944
|
span: 12,
|
|
945
|
-
children: /* @__PURE__ */
|
|
945
|
+
children: /* @__PURE__ */ V(l, {
|
|
946
946
|
size: "small",
|
|
947
|
-
children: [/* @__PURE__ */
|
|
947
|
+
children: [/* @__PURE__ */ V("div", {
|
|
948
948
|
className: "mb-1 flex items-center justify-between",
|
|
949
|
-
children: [/* @__PURE__ */
|
|
949
|
+
children: [/* @__PURE__ */ B(D.Text, {
|
|
950
950
|
type: "secondary",
|
|
951
951
|
className: "text-xs!",
|
|
952
952
|
children: o.rechargePoints
|
|
953
|
-
}), /* @__PURE__ */
|
|
953
|
+
}), /* @__PURE__ */ B(T, {
|
|
954
954
|
color: "arcoblue",
|
|
955
955
|
children: o.sourceRecharge
|
|
956
956
|
})]
|
|
957
|
-
}), /* @__PURE__ */
|
|
957
|
+
}), /* @__PURE__ */ B(D.Text, {
|
|
958
958
|
className: "text-lg! font-semibold!",
|
|
959
959
|
children: I(r.recharge)
|
|
960
960
|
})]
|
|
961
961
|
})
|
|
962
|
-
}), /* @__PURE__ */
|
|
962
|
+
}), /* @__PURE__ */ B(h.Col, {
|
|
963
963
|
span: 12,
|
|
964
|
-
children: /* @__PURE__ */
|
|
964
|
+
children: /* @__PURE__ */ V(l, {
|
|
965
965
|
size: "small",
|
|
966
|
-
children: [/* @__PURE__ */
|
|
966
|
+
children: [/* @__PURE__ */ V("div", {
|
|
967
967
|
className: "mb-1 flex items-center justify-between",
|
|
968
|
-
children: [/* @__PURE__ */
|
|
968
|
+
children: [/* @__PURE__ */ B(D.Text, {
|
|
969
969
|
type: "secondary",
|
|
970
970
|
className: "text-xs!",
|
|
971
971
|
children: o.giftedPoints
|
|
972
|
-
}), /* @__PURE__ */
|
|
972
|
+
}), /* @__PURE__ */ B(T, {
|
|
973
973
|
color: "success",
|
|
974
974
|
children: o.sourceGifted
|
|
975
975
|
})]
|
|
976
|
-
}), /* @__PURE__ */
|
|
976
|
+
}), /* @__PURE__ */ B(D.Text, {
|
|
977
977
|
className: "text-lg! font-semibold!",
|
|
978
978
|
children: I(r.gifted)
|
|
979
979
|
})]
|
|
980
980
|
})
|
|
981
981
|
})]
|
|
982
982
|
}),
|
|
983
|
-
/* @__PURE__ */
|
|
983
|
+
/* @__PURE__ */ B(D.Text, {
|
|
984
984
|
type: "secondary",
|
|
985
985
|
className: "mt-2.5 block! text-xs!",
|
|
986
986
|
children: o.pointsDeductionTip
|
|
987
987
|
})
|
|
988
988
|
]
|
|
989
989
|
}),
|
|
990
|
-
/* @__PURE__ */
|
|
990
|
+
/* @__PURE__ */ V("div", {
|
|
991
991
|
className: "px-6 py-4",
|
|
992
992
|
children: [
|
|
993
|
-
/* @__PURE__ */
|
|
993
|
+
/* @__PURE__ */ V(w, {
|
|
994
994
|
activeTab: d,
|
|
995
995
|
onChange: (e) => {
|
|
996
996
|
f(e), E(1);
|
|
997
997
|
},
|
|
998
998
|
children: [
|
|
999
|
-
/* @__PURE__ */
|
|
1000
|
-
/* @__PURE__ */
|
|
1001
|
-
/* @__PURE__ */
|
|
999
|
+
/* @__PURE__ */ B(w.TabPane, { title: o.all }, "all"),
|
|
1000
|
+
/* @__PURE__ */ B(w.TabPane, { title: o.income }, "income"),
|
|
1001
|
+
/* @__PURE__ */ B(w.TabPane, { title: o.expense }, "expense")
|
|
1002
1002
|
]
|
|
1003
1003
|
}),
|
|
1004
|
-
/* @__PURE__ */
|
|
1004
|
+
/* @__PURE__ */ V("div", {
|
|
1005
1005
|
className: "mt-2 mb-3.5 flex flex-wrap items-center gap-2.5",
|
|
1006
1006
|
children: [
|
|
1007
|
-
/* @__PURE__ */
|
|
1007
|
+
/* @__PURE__ */ V(x, {
|
|
1008
1008
|
value: p,
|
|
1009
1009
|
style: { width: 140 },
|
|
1010
1010
|
onChange: (e) => {
|
|
1011
1011
|
m(e), E(1);
|
|
1012
1012
|
},
|
|
1013
1013
|
children: [
|
|
1014
|
-
/* @__PURE__ */
|
|
1014
|
+
/* @__PURE__ */ B(x.Option, {
|
|
1015
1015
|
value: "all",
|
|
1016
1016
|
children: o.sourceAll
|
|
1017
1017
|
}),
|
|
1018
|
-
/* @__PURE__ */
|
|
1018
|
+
/* @__PURE__ */ B(x.Option, {
|
|
1019
1019
|
value: "recharge",
|
|
1020
1020
|
children: o.sourceRecharge
|
|
1021
1021
|
}),
|
|
1022
|
-
/* @__PURE__ */
|
|
1022
|
+
/* @__PURE__ */ B(x.Option, {
|
|
1023
1023
|
value: "gift",
|
|
1024
1024
|
children: o.sourceGifted
|
|
1025
1025
|
})
|
|
1026
1026
|
]
|
|
1027
1027
|
}),
|
|
1028
|
-
/* @__PURE__ */
|
|
1028
|
+
/* @__PURE__ */ B(dt, {
|
|
1029
1029
|
value: g,
|
|
1030
1030
|
onChange: (e) => {
|
|
1031
1031
|
_(e || []), E(1);
|
|
1032
1032
|
},
|
|
1033
1033
|
style: { width: 260 }
|
|
1034
1034
|
}),
|
|
1035
|
-
/* @__PURE__ */
|
|
1035
|
+
/* @__PURE__ */ B(c, {
|
|
1036
1036
|
loading: M,
|
|
1037
|
-
onClick: () => void
|
|
1037
|
+
onClick: () => void z(S, !0),
|
|
1038
1038
|
children: o.query
|
|
1039
1039
|
})
|
|
1040
1040
|
]
|
|
1041
1041
|
}),
|
|
1042
|
-
/* @__PURE__ */
|
|
1042
|
+
/* @__PURE__ */ B(C, {
|
|
1043
1043
|
rowKey: "id",
|
|
1044
1044
|
columns: ee,
|
|
1045
1045
|
data: O,
|
|
@@ -1047,7 +1047,7 @@ function wt({ visible: e, points: r, text: o, onCancel: s, onRecharge: u }) {
|
|
|
1047
1047
|
pagination: !1,
|
|
1048
1048
|
border: !1
|
|
1049
1049
|
}),
|
|
1050
|
-
/* @__PURE__ */
|
|
1050
|
+
/* @__PURE__ */ B(b, {
|
|
1051
1051
|
className: "mt-3 flex justify-center!",
|
|
1052
1052
|
current: S,
|
|
1053
1053
|
pageSize: ft,
|
|
@@ -1056,13 +1056,13 @@ function wt({ visible: e, points: r, text: o, onCancel: s, onRecharge: u }) {
|
|
|
1056
1056
|
})
|
|
1057
1057
|
]
|
|
1058
1058
|
}),
|
|
1059
|
-
/* @__PURE__ */
|
|
1059
|
+
/* @__PURE__ */ B(l, {
|
|
1060
1060
|
bordered: !1,
|
|
1061
1061
|
className: "bg-arco-primary-light-1/30 rounded-none!",
|
|
1062
|
-
children: /* @__PURE__ */
|
|
1062
|
+
children: /* @__PURE__ */ V(D.Text, {
|
|
1063
1063
|
type: "secondary",
|
|
1064
1064
|
className: "text-xs! leading-6!",
|
|
1065
|
-
children: [/* @__PURE__ */
|
|
1065
|
+
children: [/* @__PURE__ */ V("strong", { children: [o.pointsNoteTitle, ":"] }), o.pointsAccountNote]
|
|
1066
1066
|
})
|
|
1067
1067
|
})
|
|
1068
1068
|
]
|
|
@@ -1110,7 +1110,7 @@ function At({ visible: e, user: t, labels: r, onCancel: o, onSubmit: l }) {
|
|
|
1110
1110
|
}, w = (e) => {
|
|
1111
1111
|
v.success(e);
|
|
1112
1112
|
};
|
|
1113
|
-
return /* @__PURE__ */
|
|
1113
|
+
return /* @__PURE__ */ B(y, {
|
|
1114
1114
|
title: u.profileTitle,
|
|
1115
1115
|
visible: e,
|
|
1116
1116
|
onOk: async () => {
|
|
@@ -1130,35 +1130,35 @@ function At({ visible: e, user: t, labels: r, onCancel: o, onSubmit: l }) {
|
|
|
1130
1130
|
confirmLoading: f,
|
|
1131
1131
|
okText: u.profileSave,
|
|
1132
1132
|
cancelText: u.profileCancel,
|
|
1133
|
-
children: /* @__PURE__ */
|
|
1133
|
+
children: /* @__PURE__ */ V(m, {
|
|
1134
1134
|
form: d,
|
|
1135
1135
|
layout: "vertical",
|
|
1136
|
-
children: [/* @__PURE__ */
|
|
1136
|
+
children: [/* @__PURE__ */ B(m.Item, {
|
|
1137
1137
|
label: u.profileNickname,
|
|
1138
1138
|
field: "nickname",
|
|
1139
1139
|
rules: [{
|
|
1140
1140
|
required: !0,
|
|
1141
1141
|
message: u.profileNicknamePlaceholder
|
|
1142
1142
|
}],
|
|
1143
|
-
children: /* @__PURE__ */
|
|
1143
|
+
children: /* @__PURE__ */ B(g, {
|
|
1144
1144
|
placeholder: u.profileNicknamePlaceholder,
|
|
1145
1145
|
allowClear: !0
|
|
1146
1146
|
})
|
|
1147
|
-
}), /* @__PURE__ */
|
|
1147
|
+
}), /* @__PURE__ */ B(m.Item, {
|
|
1148
1148
|
label: u.profileAvatar,
|
|
1149
|
-
children: /* @__PURE__ */
|
|
1149
|
+
children: /* @__PURE__ */ V("div", {
|
|
1150
1150
|
className: "flex flex-col gap-2",
|
|
1151
|
-
children: [/* @__PURE__ */
|
|
1151
|
+
children: [/* @__PURE__ */ V("div", {
|
|
1152
1152
|
className: "flex items-center gap-3",
|
|
1153
|
-
children: [/* @__PURE__ */
|
|
1153
|
+
children: [/* @__PURE__ */ B(s, {
|
|
1154
1154
|
size: 64,
|
|
1155
1155
|
className: "shrink-0 bg-arco-primary-light-1!",
|
|
1156
|
-
children: b || t?.avatar ? /* @__PURE__ */
|
|
1156
|
+
children: b || t?.avatar ? /* @__PURE__ */ B("img", {
|
|
1157
1157
|
src: b || t?.avatar,
|
|
1158
1158
|
alt: "",
|
|
1159
1159
|
className: "block h-full w-full object-cover"
|
|
1160
1160
|
}) : t?.nickname?.[0] || t?.username?.[0] || "U"
|
|
1161
|
-
}), /* @__PURE__ */
|
|
1161
|
+
}), /* @__PURE__ */ B(O, {
|
|
1162
1162
|
accept: "image/*",
|
|
1163
1163
|
showUploadList: !1,
|
|
1164
1164
|
beforeUpload: async (e) => {
|
|
@@ -1175,14 +1175,14 @@ function At({ visible: e, user: t, labels: r, onCancel: o, onSubmit: l }) {
|
|
|
1175
1175
|
return S.current = n, n;
|
|
1176
1176
|
}), _(e), !1;
|
|
1177
1177
|
},
|
|
1178
|
-
children: /* @__PURE__ */
|
|
1178
|
+
children: /* @__PURE__ */ B(c, {
|
|
1179
1179
|
type: "outline",
|
|
1180
1180
|
size: "small",
|
|
1181
|
-
icon: /* @__PURE__ */
|
|
1181
|
+
icon: /* @__PURE__ */ B(R, {}),
|
|
1182
1182
|
children: u.profileUploadAvatar
|
|
1183
1183
|
})
|
|
1184
1184
|
})]
|
|
1185
|
-
}), /* @__PURE__ */
|
|
1185
|
+
}), /* @__PURE__ */ B("span", {
|
|
1186
1186
|
className: "text-xs text-arco-text-3",
|
|
1187
1187
|
children: u.profileAvatarHint
|
|
1188
1188
|
})]
|
|
@@ -1217,10 +1217,10 @@ function Mt(e) {
|
|
|
1217
1217
|
return e?.nickname?.[0] || e?.username?.[0] || "U";
|
|
1218
1218
|
}
|
|
1219
1219
|
function Nt({ user: e, size: t, className: n = "" }) {
|
|
1220
|
-
return /* @__PURE__ */
|
|
1220
|
+
return /* @__PURE__ */ B(s, {
|
|
1221
1221
|
size: t,
|
|
1222
1222
|
className: `bg-arco-primary/20! text-arco-primary-6 border-2 font-bold ${n}`,
|
|
1223
|
-
children: e?.avatar ? /* @__PURE__ */
|
|
1223
|
+
children: e?.avatar ? /* @__PURE__ */ B("img", {
|
|
1224
1224
|
src: e.avatar,
|
|
1225
1225
|
alt: "avatar",
|
|
1226
1226
|
className: "h-full w-full object-cover"
|
|
@@ -1256,15 +1256,15 @@ function It({ visible: e, user: t, points: r, text: o, packages: s, packageLoadi
|
|
|
1256
1256
|
}, I = () => {
|
|
1257
1257
|
_("custom"), b((e) => e || "10"), x.current?.focus();
|
|
1258
1258
|
};
|
|
1259
|
-
return /* @__PURE__ */
|
|
1259
|
+
return /* @__PURE__ */ B(y, {
|
|
1260
1260
|
title: o.rechargeTitle,
|
|
1261
1261
|
visible: e,
|
|
1262
|
-
footer: /* @__PURE__ */
|
|
1262
|
+
footer: /* @__PURE__ */ V("div", {
|
|
1263
1263
|
className: "mx-auto flex max-w-7xl items-center justify-between gap-5",
|
|
1264
|
-
children: [/* @__PURE__ */
|
|
1264
|
+
children: [/* @__PURE__ */ B("span", {
|
|
1265
1265
|
className: "text-arco-text-2 text-sm leading-6",
|
|
1266
1266
|
children: o.rechargeHint
|
|
1267
|
-
}), /* @__PURE__ */
|
|
1267
|
+
}), /* @__PURE__ */ B(c, {
|
|
1268
1268
|
type: "primary",
|
|
1269
1269
|
size: "large",
|
|
1270
1270
|
className: "min-w-48! font-bold!",
|
|
@@ -1291,37 +1291,37 @@ function It({ visible: e, user: t, points: r, text: o, packages: s, packageLoadi
|
|
|
1291
1291
|
paddingBottom: 0
|
|
1292
1292
|
},
|
|
1293
1293
|
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!",
|
|
1294
|
-
children: /* @__PURE__ */
|
|
1294
|
+
children: /* @__PURE__ */ V("div", {
|
|
1295
1295
|
className: "mx-auto flex h-full w-full max-w-7xl flex-col items-center ",
|
|
1296
|
-
children: [/* @__PURE__ */
|
|
1296
|
+
children: [/* @__PURE__ */ V("div", {
|
|
1297
1297
|
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",
|
|
1298
|
-
children: [/* @__PURE__ */
|
|
1298
|
+
children: [/* @__PURE__ */ B(Nt, {
|
|
1299
1299
|
user: t,
|
|
1300
1300
|
size: 32,
|
|
1301
1301
|
className: "shrink-0"
|
|
1302
|
-
}), /* @__PURE__ */
|
|
1302
|
+
}), /* @__PURE__ */ V("span", { children: [
|
|
1303
1303
|
t?.nickname || t?.username,
|
|
1304
1304
|
" · ",
|
|
1305
1305
|
o.currentBalance,
|
|
1306
1306
|
" ",
|
|
1307
|
-
/* @__PURE__ */
|
|
1307
|
+
/* @__PURE__ */ B("strong", {
|
|
1308
1308
|
className: "text-arco-text-1",
|
|
1309
1309
|
children: C(r.total)
|
|
1310
1310
|
}),
|
|
1311
1311
|
" ",
|
|
1312
1312
|
o.pointsUnit
|
|
1313
1313
|
] })]
|
|
1314
|
-
}), /* @__PURE__ */
|
|
1314
|
+
}), /* @__PURE__ */ B("div", {
|
|
1315
1315
|
className: "mt-6 w-full",
|
|
1316
|
-
children: /* @__PURE__ */
|
|
1316
|
+
children: /* @__PURE__ */ V(h.Row, {
|
|
1317
1317
|
gutter: [16, 16],
|
|
1318
1318
|
style: { alignItems: "stretch" },
|
|
1319
|
-
children: [S.map((e) => /* @__PURE__ */
|
|
1319
|
+
children: [S.map((e) => /* @__PURE__ */ B(h.Col, {
|
|
1320
1320
|
xs: 24,
|
|
1321
1321
|
sm: 12,
|
|
1322
1322
|
lg: 6,
|
|
1323
1323
|
style: { display: "flex" },
|
|
1324
|
-
children: /* @__PURE__ */
|
|
1324
|
+
children: /* @__PURE__ */ V(l, {
|
|
1325
1325
|
hoverable: !0,
|
|
1326
1326
|
loading: u,
|
|
1327
1327
|
role: "button",
|
|
@@ -1333,41 +1333,41 @@ function It({ visible: e, user: t, points: r, text: o, packages: s, packageLoadi
|
|
|
1333
1333
|
bodyStyle: Pt,
|
|
1334
1334
|
className: `${Ft} border-arco-border-2! bg-arco-bg-2! cursor-pointer ${m === 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!"}`,
|
|
1335
1335
|
children: [
|
|
1336
|
-
m === e.id ? /* @__PURE__ */
|
|
1337
|
-
"recommended" in e && e.recommended ? /* @__PURE__ */
|
|
1336
|
+
m === e.id ? /* @__PURE__ */ B(k, { className: "text-arco-primary-6! absolute bottom-4 left-4 text-xl" }) : null,
|
|
1337
|
+
"recommended" in e && e.recommended ? /* @__PURE__ */ B(T, {
|
|
1338
1338
|
color: "arcoblue",
|
|
1339
1339
|
className: "absolute top-4 right-4 text-xs! font-bold!",
|
|
1340
1340
|
children: "HOT"
|
|
1341
1341
|
}) : null,
|
|
1342
|
-
/* @__PURE__ */
|
|
1342
|
+
/* @__PURE__ */ V("div", {
|
|
1343
1343
|
className: "min-w-0 pr-16",
|
|
1344
|
-
children: [/* @__PURE__ */
|
|
1344
|
+
children: [/* @__PURE__ */ V(D.Text, {
|
|
1345
1345
|
className: "flex items-center text-3xl! leading-tight! font-bold!",
|
|
1346
|
-
children: [C(e.points), /* @__PURE__ */
|
|
1346
|
+
children: [C(e.points), /* @__PURE__ */ B("span", {
|
|
1347
1347
|
className: "ml-1 text-2xl",
|
|
1348
1348
|
children: "🪙"
|
|
1349
1349
|
})]
|
|
1350
|
-
}), /* @__PURE__ */
|
|
1350
|
+
}), /* @__PURE__ */ B(D.Text, {
|
|
1351
1351
|
type: "secondary",
|
|
1352
1352
|
className: "mt-1 block! text-sm!",
|
|
1353
1353
|
children: o.pointsUnit
|
|
1354
1354
|
})]
|
|
1355
1355
|
}),
|
|
1356
|
-
/* @__PURE__ */
|
|
1356
|
+
/* @__PURE__ */ B("div", {
|
|
1357
1357
|
className: "mt-7 flex w-full justify-end",
|
|
1358
|
-
children: /* @__PURE__ */
|
|
1358
|
+
children: /* @__PURE__ */ V(D.Text, {
|
|
1359
1359
|
className: "text-arco-primary-6! text-right text-2xl! leading-tight! font-bold!",
|
|
1360
1360
|
children: ["$", e.price]
|
|
1361
1361
|
})
|
|
1362
1362
|
})
|
|
1363
1363
|
]
|
|
1364
1364
|
})
|
|
1365
|
-
}, e.id)), /* @__PURE__ */
|
|
1365
|
+
}, e.id)), /* @__PURE__ */ B(h.Col, {
|
|
1366
1366
|
xs: 24,
|
|
1367
1367
|
sm: 12,
|
|
1368
1368
|
lg: 6,
|
|
1369
1369
|
style: { display: "flex" },
|
|
1370
|
-
children: /* @__PURE__ */
|
|
1370
|
+
children: /* @__PURE__ */ V(l, {
|
|
1371
1371
|
role: "button",
|
|
1372
1372
|
tabIndex: 0,
|
|
1373
1373
|
onClick: I,
|
|
@@ -1377,26 +1377,26 @@ function It({ visible: e, user: t, points: r, text: o, packages: s, packageLoadi
|
|
|
1377
1377
|
bodyStyle: Pt,
|
|
1378
1378
|
className: `${Ft} cursor-text ${j ? "border-arco-primary-6! bg-arco-primary-light-1/40! ring-arco-primary-6/20 ring-2! shadow-[0_18px_38px_rgb(var(--primary-6)/22%)]!" : O && A ? "border-arco-danger-6! bg-arco-bg-1! hover:border-arco-danger-6!" : "border-arco-primary-6/30! bg-arco-primary-light-1/20! hover:border-arco-primary-6!"}`,
|
|
1379
1379
|
children: [
|
|
1380
|
-
j ? /* @__PURE__ */
|
|
1381
|
-
/* @__PURE__ */
|
|
1380
|
+
j ? /* @__PURE__ */ B(k, { className: "text-arco-primary-6! absolute top-4 right-4 text-xl" }) : null,
|
|
1381
|
+
/* @__PURE__ */ V("div", {
|
|
1382
1382
|
className: "flex min-w-0 flex-col gap-2.5",
|
|
1383
1383
|
children: [
|
|
1384
|
-
/* @__PURE__ */
|
|
1384
|
+
/* @__PURE__ */ V("div", {
|
|
1385
1385
|
className: "flex min-w-0 flex-col gap-2.5 pr-8",
|
|
1386
|
-
children: [/* @__PURE__ */
|
|
1386
|
+
children: [/* @__PURE__ */ B(T, {
|
|
1387
1387
|
color: "arcoblue",
|
|
1388
1388
|
className: "w-fit text-xs! font-bold!",
|
|
1389
1389
|
children: o.customRechargeAmount
|
|
1390
|
-
}), /* @__PURE__ */
|
|
1390
|
+
}), /* @__PURE__ */ B(D.Text, {
|
|
1391
1391
|
type: "secondary",
|
|
1392
1392
|
className: "block! text-sm! leading-5! ",
|
|
1393
1393
|
children: o.customRechargeDescription
|
|
1394
1394
|
})]
|
|
1395
1395
|
}),
|
|
1396
|
-
/* @__PURE__ */
|
|
1396
|
+
/* @__PURE__ */ B("div", {
|
|
1397
1397
|
className: "mt-1",
|
|
1398
1398
|
onClick: (e) => e.stopPropagation(),
|
|
1399
|
-
children: /* @__PURE__ */
|
|
1399
|
+
children: /* @__PURE__ */ B(g, {
|
|
1400
1400
|
ref: x,
|
|
1401
1401
|
type: "text",
|
|
1402
1402
|
inputMode: "numeric",
|
|
@@ -1407,11 +1407,11 @@ function It({ visible: e, user: t, points: r, text: o, packages: s, packageLoadi
|
|
|
1407
1407
|
onChange: (e) => {
|
|
1408
1408
|
_("custom"), b(e.replace(/\D/g, ""));
|
|
1409
1409
|
},
|
|
1410
|
-
prefix: /* @__PURE__ */
|
|
1410
|
+
prefix: /* @__PURE__ */ B("span", {
|
|
1411
1411
|
className: "text-arco-primary-6 text-base font-semibold",
|
|
1412
1412
|
children: "$"
|
|
1413
1413
|
}),
|
|
1414
|
-
suffix: /* @__PURE__ */
|
|
1414
|
+
suffix: /* @__PURE__ */ B("span", {
|
|
1415
1415
|
className: "text-arco-primary-6 text-xs font-semibold",
|
|
1416
1416
|
children: "USD"
|
|
1417
1417
|
}),
|
|
@@ -1420,9 +1420,9 @@ function It({ visible: e, user: t, points: r, text: o, packages: s, packageLoadi
|
|
|
1420
1420
|
className: `w-full! rounded-md! shadow-[0_0_0_3px_rgb(var(--primary-6)/8%)] transition-all [&_.arco-input]:text-xl! [&_.arco-input]:font-bold! [&_.arco-input]:text-arco-text-1! [&_.arco-input]:[font-family:var(--font-display)] [&_.arco-input-inner-wrapper]:border-2! [&_.arco-input-inner-wrapper]:bg-arco-bg-1! [&_.arco-input-inner-wrapper]:px-3! [&_.arco-input-inner-wrapper]:shadow-none! [&_.arco-input-inner-wrapper-focus]:border-arco-primary-6! [&_.arco-input-inner-wrapper-focus]:shadow-[0_0_0_4px_rgb(var(--primary-6)/14%)]! ${O && A && !j ? "[&_.arco-input-inner-wrapper]:border-arco-danger-6! shadow-[0_0_0_3px_rgb(var(--danger-6)/12%)]" : "[&_.arco-input-inner-wrapper]:border-arco-primary-6/50!"}`
|
|
1421
1421
|
})
|
|
1422
1422
|
}),
|
|
1423
|
-
/* @__PURE__ */
|
|
1423
|
+
/* @__PURE__ */ B("div", {
|
|
1424
1424
|
className: "h-4",
|
|
1425
|
-
children: /* @__PURE__ */
|
|
1425
|
+
children: /* @__PURE__ */ B(D.Text, {
|
|
1426
1426
|
type: "error",
|
|
1427
1427
|
className: `block! text-xs! leading-4! transition-opacity ${O && A && !j ? "opacity-100" : "opacity-0"}`,
|
|
1428
1428
|
children: o.customRechargeMinError
|
|
@@ -1430,22 +1430,22 @@ function It({ visible: e, user: t, points: r, text: o, packages: s, packageLoadi
|
|
|
1430
1430
|
})
|
|
1431
1431
|
]
|
|
1432
1432
|
}),
|
|
1433
|
-
/* @__PURE__ */
|
|
1433
|
+
/* @__PURE__ */ V("div", {
|
|
1434
1434
|
className: "border-arco-primary-6/20! bg-arco-bg-1!/80 mt-3 rounded-md border px-3.5 py-3 shadow-sm",
|
|
1435
1435
|
children: [
|
|
1436
|
-
/* @__PURE__ */
|
|
1436
|
+
/* @__PURE__ */ B(D.Text, {
|
|
1437
1437
|
type: "secondary",
|
|
1438
1438
|
className: "block! text-xs!",
|
|
1439
1439
|
children: o.customRechargeEstimate
|
|
1440
1440
|
}),
|
|
1441
|
-
/* @__PURE__ */
|
|
1441
|
+
/* @__PURE__ */ V(D.Text, {
|
|
1442
1442
|
className: "text-arco-primary-6! mt-1 block! text-xl! leading-tight! font-bold!",
|
|
1443
|
-
children: [j ? C(E * 100) : "-", /* @__PURE__ */
|
|
1443
|
+
children: [j ? C(E * 100) : "-", /* @__PURE__ */ B("span", {
|
|
1444
1444
|
className: "text-arco-text-3 ml-1 text-xs font-normal",
|
|
1445
1445
|
children: o.pointsUnit
|
|
1446
1446
|
})]
|
|
1447
1447
|
}),
|
|
1448
|
-
/* @__PURE__ */
|
|
1448
|
+
/* @__PURE__ */ B(D.Text, {
|
|
1449
1449
|
type: "secondary",
|
|
1450
1450
|
className: "mt-0.5 block! text-[10px]!",
|
|
1451
1451
|
children: o.customRechargeRate
|
|
@@ -1462,7 +1462,7 @@ function It({ visible: e, user: t, points: r, text: o, packages: s, packageLoadi
|
|
|
1462
1462
|
}
|
|
1463
1463
|
//#endregion
|
|
1464
1464
|
//#region node_modules/prop-types/node_modules/react-is/cjs/react-is.production.min.js
|
|
1465
|
-
var Lt = /* @__PURE__ */
|
|
1465
|
+
var Lt = /* @__PURE__ */ U(((e) => {
|
|
1466
1466
|
var t = typeof Symbol == "function" && Symbol.for, n = t ? Symbol.for("react.element") : 60103, r = t ? Symbol.for("react.portal") : 60106, i = t ? Symbol.for("react.fragment") : 60107, a = t ? Symbol.for("react.strict_mode") : 60108, o = t ? Symbol.for("react.profiler") : 60114, s = t ? Symbol.for("react.provider") : 60109, c = t ? Symbol.for("react.context") : 60110, l = t ? Symbol.for("react.async_mode") : 60111, u = t ? Symbol.for("react.concurrent_mode") : 60111, d = t ? Symbol.for("react.forward_ref") : 60112, f = t ? Symbol.for("react.suspense") : 60113, p = t ? Symbol.for("react.suspense_list") : 60120, m = t ? Symbol.for("react.memo") : 60115, h = t ? Symbol.for("react.lazy") : 60116, g = t ? Symbol.for("react.block") : 60121, _ = t ? Symbol.for("react.fundamental") : 60117, v = t ? Symbol.for("react.responder") : 60118, y = t ? Symbol.for("react.scope") : 60119;
|
|
1467
1467
|
function b(e) {
|
|
1468
1468
|
if (typeof e == "object" && e) {
|
|
@@ -1518,7 +1518,7 @@ var Lt = /* @__PURE__ */ H(((e) => {
|
|
|
1518
1518
|
}, e.isValidElementType = function(e) {
|
|
1519
1519
|
return typeof e == "string" || typeof e == "function" || e === i || e === u || e === o || e === a || e === f || e === p || typeof e == "object" && !!e && (e.$$typeof === h || e.$$typeof === m || e.$$typeof === s || e.$$typeof === c || e.$$typeof === d || e.$$typeof === _ || e.$$typeof === v || e.$$typeof === y || e.$$typeof === g);
|
|
1520
1520
|
}, e.typeOf = b;
|
|
1521
|
-
})), Rt = /* @__PURE__ */
|
|
1521
|
+
})), Rt = /* @__PURE__ */ U(((e) => {
|
|
1522
1522
|
process.env.NODE_ENV !== "production" && (function() {
|
|
1523
1523
|
var t = typeof Symbol == "function" && Symbol.for, n = t ? Symbol.for("react.element") : 60103, r = t ? Symbol.for("react.portal") : 60106, i = t ? Symbol.for("react.fragment") : 60107, a = t ? Symbol.for("react.strict_mode") : 60108, o = t ? Symbol.for("react.profiler") : 60114, s = t ? Symbol.for("react.provider") : 60109, c = t ? Symbol.for("react.context") : 60110, l = t ? Symbol.for("react.async_mode") : 60111, u = t ? Symbol.for("react.concurrent_mode") : 60111, d = t ? Symbol.for("react.forward_ref") : 60112, f = t ? Symbol.for("react.suspense") : 60113, p = t ? Symbol.for("react.suspense_list") : 60120, m = t ? Symbol.for("react.memo") : 60115, h = t ? Symbol.for("react.lazy") : 60116, g = t ? Symbol.for("react.block") : 60121, _ = t ? Symbol.for("react.fundamental") : 60117, v = t ? Symbol.for("react.responder") : 60118, y = t ? Symbol.for("react.scope") : 60119;
|
|
1524
1524
|
function b(e) {
|
|
@@ -1577,26 +1577,26 @@ var Lt = /* @__PURE__ */ H(((e) => {
|
|
|
1577
1577
|
function te(e) {
|
|
1578
1578
|
return x(e) === h;
|
|
1579
1579
|
}
|
|
1580
|
-
function
|
|
1580
|
+
function H(e) {
|
|
1581
1581
|
return x(e) === m;
|
|
1582
1582
|
}
|
|
1583
|
-
function
|
|
1583
|
+
function ne(e) {
|
|
1584
1584
|
return x(e) === r;
|
|
1585
1585
|
}
|
|
1586
|
-
function
|
|
1586
|
+
function re(e) {
|
|
1587
1587
|
return x(e) === o;
|
|
1588
1588
|
}
|
|
1589
|
-
function
|
|
1589
|
+
function ie(e) {
|
|
1590
1590
|
return x(e) === a;
|
|
1591
1591
|
}
|
|
1592
|
-
function
|
|
1592
|
+
function ae(e) {
|
|
1593
1593
|
return x(e) === f;
|
|
1594
1594
|
}
|
|
1595
|
-
e.AsyncMode = S, e.ConcurrentMode = C, e.ContextConsumer = w, e.ContextProvider = T, e.Element = E, e.ForwardRef = D, e.Fragment = O, e.Lazy = k, e.Memo = A, e.Portal = j, e.Profiler = M, e.StrictMode = N, e.Suspense = P, e.isAsyncMode = I, e.isConcurrentMode = L, e.isContextConsumer = R, e.isContextProvider = z, e.isElement = B, e.isForwardRef = V, e.isFragment = ee, e.isLazy = te, e.isMemo =
|
|
1595
|
+
e.AsyncMode = S, e.ConcurrentMode = C, e.ContextConsumer = w, e.ContextProvider = T, e.Element = E, e.ForwardRef = D, e.Fragment = O, e.Lazy = k, e.Memo = A, e.Portal = j, e.Profiler = M, e.StrictMode = N, e.Suspense = P, e.isAsyncMode = I, e.isConcurrentMode = L, e.isContextConsumer = R, e.isContextProvider = z, e.isElement = B, e.isForwardRef = V, e.isFragment = ee, e.isLazy = te, e.isMemo = H, e.isPortal = ne, e.isProfiler = re, e.isStrictMode = ie, e.isSuspense = ae, e.isValidElementType = b, e.typeOf = x;
|
|
1596
1596
|
})();
|
|
1597
|
-
})), zt = /* @__PURE__ */
|
|
1597
|
+
})), zt = /* @__PURE__ */ U(((e, t) => {
|
|
1598
1598
|
process.env.NODE_ENV === "production" ? t.exports = Lt() : t.exports = Rt();
|
|
1599
|
-
})), Bt = /* @__PURE__ */
|
|
1599
|
+
})), Bt = /* @__PURE__ */ U(((e, t) => {
|
|
1600
1600
|
var n = Object.getOwnPropertySymbols, r = Object.prototype.hasOwnProperty, i = Object.prototype.propertyIsEnumerable;
|
|
1601
1601
|
function a(e) {
|
|
1602
1602
|
if (e == null) throw TypeError("Object.assign cannot be called with null or undefined");
|
|
@@ -1629,11 +1629,11 @@ var Lt = /* @__PURE__ */ H(((e) => {
|
|
|
1629
1629
|
}
|
|
1630
1630
|
return s;
|
|
1631
1631
|
};
|
|
1632
|
-
})), Vt = /* @__PURE__ */
|
|
1632
|
+
})), Vt = /* @__PURE__ */ U(((e, t) => {
|
|
1633
1633
|
t.exports = "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";
|
|
1634
|
-
})), Ht = /* @__PURE__ */
|
|
1634
|
+
})), Ht = /* @__PURE__ */ U(((e, t) => {
|
|
1635
1635
|
t.exports = Function.call.bind(Object.prototype.hasOwnProperty);
|
|
1636
|
-
})), Ut = /* @__PURE__ */
|
|
1636
|
+
})), Ut = /* @__PURE__ */ U(((e, t) => {
|
|
1637
1637
|
var n = function() {};
|
|
1638
1638
|
if (process.env.NODE_ENV !== "production") {
|
|
1639
1639
|
var r = Vt(), i = {}, a = Ht();
|
|
@@ -1669,7 +1669,7 @@ var Lt = /* @__PURE__ */ H(((e) => {
|
|
|
1669
1669
|
o.resetWarningCache = function() {
|
|
1670
1670
|
process.env.NODE_ENV !== "production" && (i = {});
|
|
1671
1671
|
}, t.exports = o;
|
|
1672
|
-
})), Wt = /* @__PURE__ */
|
|
1672
|
+
})), Wt = /* @__PURE__ */ U(((e, t) => {
|
|
1673
1673
|
var n = zt(), r = Bt(), i = Vt(), a = Ht(), o = Ut(), s = function() {};
|
|
1674
1674
|
process.env.NODE_ENV !== "production" && (s = function(e) {
|
|
1675
1675
|
var t = "Warning: " + e;
|
|
@@ -1928,7 +1928,7 @@ var Lt = /* @__PURE__ */ H(((e) => {
|
|
|
1928
1928
|
}
|
|
1929
1929
|
return p.checkPropTypes = o, p.resetWarningCache = o.resetWarningCache, p.PropTypes = p, p;
|
|
1930
1930
|
};
|
|
1931
|
-
})), Gt = /* @__PURE__ */
|
|
1931
|
+
})), Gt = /* @__PURE__ */ U(((e, t) => {
|
|
1932
1932
|
var n = Vt();
|
|
1933
1933
|
function r() {}
|
|
1934
1934
|
function i() {}
|
|
@@ -1968,7 +1968,7 @@ var Lt = /* @__PURE__ */ H(((e) => {
|
|
|
1968
1968
|
};
|
|
1969
1969
|
return a.PropTypes = a, a;
|
|
1970
1970
|
};
|
|
1971
|
-
})),
|
|
1971
|
+
})), X = /* @__PURE__ */ G((/* @__PURE__ */ U(((e, t) => {
|
|
1972
1972
|
if (process.env.NODE_ENV !== "production") {
|
|
1973
1973
|
var n = zt();
|
|
1974
1974
|
t.exports = Wt()(n.isElement, !0);
|
|
@@ -2066,40 +2066,40 @@ function nn(e, t) {
|
|
|
2066
2066
|
function rn() {
|
|
2067
2067
|
throw TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
2068
2068
|
}
|
|
2069
|
-
var
|
|
2069
|
+
var an = function(e) {
|
|
2070
2070
|
return e !== null && Jt(e) === "object";
|
|
2071
|
-
}, an = function(e) {
|
|
2072
|
-
return X(e) && typeof e.then == "function";
|
|
2073
2071
|
}, on = function(e) {
|
|
2074
|
-
return
|
|
2075
|
-
}, sn =
|
|
2076
|
-
|
|
2077
|
-
|
|
2072
|
+
return an(e) && typeof e.then == "function";
|
|
2073
|
+
}, sn = function(e) {
|
|
2074
|
+
return an(e) && typeof e.elements == "function" && typeof e.createToken == "function" && typeof e.createPaymentMethod == "function" && typeof e.confirmCardPayment == "function";
|
|
2075
|
+
}, cn = "Invalid prop `stripe` supplied to `Elements`. We recommend using the `loadStripe` utility from `@stripe/stripe-js`. See https://stripe.com/docs/stripe-js/react#elements-props-stripe for details.", ln = function(e) {
|
|
2076
|
+
var t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : cn;
|
|
2077
|
+
if (e === null || sn(e)) return e;
|
|
2078
2078
|
throw Error(t);
|
|
2079
|
-
},
|
|
2080
|
-
var t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] :
|
|
2081
|
-
if (
|
|
2079
|
+
}, un = function(e) {
|
|
2080
|
+
var t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : cn;
|
|
2081
|
+
if (on(e)) return {
|
|
2082
2082
|
tag: "async",
|
|
2083
2083
|
stripePromise: Promise.resolve(e).then(function(e) {
|
|
2084
|
-
return
|
|
2084
|
+
return ln(e, t);
|
|
2085
2085
|
})
|
|
2086
2086
|
};
|
|
2087
|
-
var n =
|
|
2087
|
+
var n = ln(e, t);
|
|
2088
2088
|
return n === null ? { tag: "empty" } : {
|
|
2089
2089
|
tag: "sync",
|
|
2090
2090
|
stripe: n
|
|
2091
2091
|
};
|
|
2092
|
-
},
|
|
2092
|
+
}, dn = function(t) {
|
|
2093
2093
|
var n = e.useRef(t);
|
|
2094
2094
|
return e.useEffect(function() {
|
|
2095
2095
|
n.current = t;
|
|
2096
2096
|
}, [t]), n.current;
|
|
2097
|
-
},
|
|
2098
|
-
if (!
|
|
2097
|
+
}, fn = "[object Object]", pn = function e(t, n) {
|
|
2098
|
+
if (!an(t) || !an(n)) return t === n;
|
|
2099
2099
|
var r = Array.isArray(t);
|
|
2100
2100
|
if (r !== Array.isArray(n)) return !1;
|
|
2101
|
-
var i = Object.prototype.toString.call(t) ===
|
|
2102
|
-
if (i !== (Object.prototype.toString.call(n) ===
|
|
2101
|
+
var i = Object.prototype.toString.call(t) === fn;
|
|
2102
|
+
if (i !== (Object.prototype.toString.call(n) === fn)) return !1;
|
|
2103
2103
|
if (!i && !r) return t === n;
|
|
2104
2104
|
var a = Object.keys(t), o = Object.keys(n);
|
|
2105
2105
|
if (a.length !== o.length) return !1;
|
|
@@ -2111,7 +2111,7 @@ var X = function(e) {
|
|
|
2111
2111
|
return u.every(function(t) {
|
|
2112
2112
|
return e(d[t], f[t]);
|
|
2113
2113
|
});
|
|
2114
|
-
},
|
|
2114
|
+
}, mn = function(e) {
|
|
2115
2115
|
!e || !e._registerWrapper || !e.registerAppInfo || (e._registerWrapper({
|
|
2116
2116
|
name: "react-stripe-js",
|
|
2117
2117
|
version: "6.4.0"
|
|
@@ -2120,36 +2120,36 @@ var X = function(e) {
|
|
|
2120
2120
|
version: "6.4.0",
|
|
2121
2121
|
url: "https://stripe.com/docs/stripe-js/react"
|
|
2122
2122
|
}));
|
|
2123
|
-
},
|
|
2124
|
-
return
|
|
2125
|
-
var a = !
|
|
2123
|
+
}, hn = function(e, t, n) {
|
|
2124
|
+
return an(e) ? Object.keys(e).reduce(function(r, i) {
|
|
2125
|
+
var a = !an(t) || !pn(e[i], t[i]);
|
|
2126
2126
|
return n.includes(i) ? (a && console.warn(`Unsupported prop change: options.${i} is not a mutable property.`), r) : a ? qt(qt({}, r || {}), {}, Yt({}, i, e[i])) : r;
|
|
2127
2127
|
}, null) : null;
|
|
2128
|
-
},
|
|
2129
|
-
|
|
2130
|
-
var
|
|
2128
|
+
}, gn = /* @__PURE__ */ e.createContext(null);
|
|
2129
|
+
gn.displayName = "ElementsContext";
|
|
2130
|
+
var _n = function(e, t) {
|
|
2131
2131
|
if (!e) throw Error(`Could not find Elements context; You need to wrap the part of your app that ${t} in an <Elements> provider.`);
|
|
2132
2132
|
return e;
|
|
2133
2133
|
};
|
|
2134
|
-
|
|
2135
|
-
var
|
|
2136
|
-
|
|
2137
|
-
var
|
|
2134
|
+
X.default.any, X.default.object, X.default.func.isRequired;
|
|
2135
|
+
var vn = ["on", "loadActions"], yn = ["getSession"], bn = /* @__PURE__ */ e.createContext(null);
|
|
2136
|
+
bn.displayName = "CheckoutContext";
|
|
2137
|
+
var xn = function(e, t) {
|
|
2138
2138
|
if (!e) throw Error(`Could not find checkout context; You need to wrap the part of your app that ${t} in a <CheckoutElementsProvider> or <CheckoutFormProvider> provider.`);
|
|
2139
2139
|
return e;
|
|
2140
|
-
},
|
|
2141
|
-
var n = e.useContext(
|
|
2140
|
+
}, Sn = function(t) {
|
|
2141
|
+
var n = e.useContext(bn), r = e.useContext(gn);
|
|
2142
2142
|
if (n) {
|
|
2143
2143
|
if (r) throw Error(`You cannot wrap the part of your app that ${t} in both a checkout provider and <Elements> provider.`);
|
|
2144
2144
|
return n;
|
|
2145
|
-
} else return
|
|
2146
|
-
},
|
|
2145
|
+
} else return _n(r, t);
|
|
2146
|
+
}, Cn = function(e) {
|
|
2147
2147
|
if (e.type === "success") {
|
|
2148
2148
|
var t = e.sdk, n = e.session, r = e.checkoutActions;
|
|
2149
2149
|
t.on, t.loadActions;
|
|
2150
|
-
var i = Zt(t,
|
|
2150
|
+
var i = Zt(t, vn);
|
|
2151
2151
|
r.getSession;
|
|
2152
|
-
var a = Zt(r,
|
|
2152
|
+
var a = Zt(r, yn);
|
|
2153
2153
|
return {
|
|
2154
2154
|
type: "success",
|
|
2155
2155
|
checkout: qt(qt(qt({}, n), i), a)
|
|
@@ -2159,15 +2159,15 @@ var bn = function(e, t) {
|
|
|
2159
2159
|
type: "error",
|
|
2160
2160
|
error: e.error
|
|
2161
2161
|
};
|
|
2162
|
-
},
|
|
2163
|
-
var t =
|
|
2162
|
+
}, wn = function() {
|
|
2163
|
+
var t = xn(e.useContext(bn), "calls useCheckoutElements()").checkoutState;
|
|
2164
2164
|
if (t.type === "success" && t.sdkKind !== "elements") throw Error("useCheckoutElements() must be used inside <CheckoutElementsProvider>. Inside <CheckoutFormProvider>, use useCheckoutForm() instead.");
|
|
2165
|
-
return
|
|
2166
|
-
},
|
|
2165
|
+
return Cn(t);
|
|
2166
|
+
}, Tn = "Invalid prop `stripe` supplied to `CheckoutElementsProvider`. We recommend using the `loadStripe` utility from `@stripe/stripe-js`. See https://stripe.com/docs/stripe-js/react#elements-props-stripe for details.", En = function(e) {
|
|
2167
2167
|
return e.type === "success" || e.type === "loading" ? e.sdk : null;
|
|
2168
|
-
},
|
|
2168
|
+
}, Dn = function(t) {
|
|
2169
2169
|
var n = t.stripe, r = t.options, i = t.children, a = e.useMemo(function() {
|
|
2170
|
-
return
|
|
2170
|
+
return un(n, Tn);
|
|
2171
2171
|
}, [n]), o = Qt(e.useState({
|
|
2172
2172
|
type: "loading",
|
|
2173
2173
|
sdk: null
|
|
@@ -2223,16 +2223,16 @@ var bn = function(e, t) {
|
|
|
2223
2223
|
r,
|
|
2224
2224
|
c
|
|
2225
2225
|
]);
|
|
2226
|
-
var p =
|
|
2226
|
+
var p = dn(n);
|
|
2227
2227
|
e.useEffect(function() {
|
|
2228
2228
|
p !== null && p !== n && console.warn("Unsupported prop change on CheckoutElementsProvider: You cannot change the `stripe` prop after setting it.");
|
|
2229
2229
|
}, [p, n]);
|
|
2230
|
-
var m =
|
|
2230
|
+
var m = En(s), h = dn(r);
|
|
2231
2231
|
e.useEffect(function() {
|
|
2232
2232
|
if (m) {
|
|
2233
|
-
var e = h?.elementsOptions?.appearance, t = r?.elementsOptions?.appearance, n = !
|
|
2233
|
+
var e = h?.elementsOptions?.appearance, t = r?.elementsOptions?.appearance, n = !pn(t, e);
|
|
2234
2234
|
t && n && m.changeAppearance(t);
|
|
2235
|
-
var i = h?.elementsOptions?.fonts, a = r?.elementsOptions?.fonts, o = !
|
|
2235
|
+
var i = h?.elementsOptions?.fonts, a = r?.elementsOptions?.fonts, o = !pn(i, a);
|
|
2236
2236
|
a && o && m.loadFonts(a);
|
|
2237
2237
|
}
|
|
2238
2238
|
}, [
|
|
@@ -2240,7 +2240,7 @@ var bn = function(e, t) {
|
|
|
2240
2240
|
h,
|
|
2241
2241
|
m
|
|
2242
2242
|
]), e.useEffect(function() {
|
|
2243
|
-
|
|
2243
|
+
mn(u);
|
|
2244
2244
|
}, [u]);
|
|
2245
2245
|
var g = e.useMemo(function() {
|
|
2246
2246
|
return {
|
|
@@ -2248,18 +2248,18 @@ var bn = function(e, t) {
|
|
|
2248
2248
|
checkoutState: s
|
|
2249
2249
|
};
|
|
2250
2250
|
}, [u, s]);
|
|
2251
|
-
return /* @__PURE__ */ e.createElement(
|
|
2251
|
+
return /* @__PURE__ */ e.createElement(bn.Provider, { value: g }, i);
|
|
2252
2252
|
};
|
|
2253
|
-
|
|
2254
|
-
stripe:
|
|
2255
|
-
options:
|
|
2256
|
-
clientSecret:
|
|
2257
|
-
elementsOptions:
|
|
2253
|
+
Dn.propTypes = {
|
|
2254
|
+
stripe: X.default.any,
|
|
2255
|
+
options: X.default.shape({
|
|
2256
|
+
clientSecret: X.default.oneOfType([X.default.string, X.default.instanceOf(Promise)]).isRequired,
|
|
2257
|
+
elementsOptions: X.default.object
|
|
2258
2258
|
}).isRequired
|
|
2259
2259
|
};
|
|
2260
|
-
var
|
|
2260
|
+
var On = "Invalid prop `stripe` supplied to `CheckoutFormProvider`. We recommend using the `loadStripe` utility from `@stripe/stripe-js`. See https://stripe.com/docs/stripe-js/react#elements-props-stripe for details.", kn = function(t) {
|
|
2261
2261
|
var n = t.stripe, r = t.options, i = t.children, a = e.useMemo(function() {
|
|
2262
|
-
return
|
|
2262
|
+
return un(n, On);
|
|
2263
2263
|
}, [n]), o = Qt(e.useState({
|
|
2264
2264
|
type: "loading",
|
|
2265
2265
|
sdk: null
|
|
@@ -2315,16 +2315,16 @@ var Dn = "Invalid prop `stripe` supplied to `CheckoutFormProvider`. We recommend
|
|
|
2315
2315
|
r,
|
|
2316
2316
|
c
|
|
2317
2317
|
]);
|
|
2318
|
-
var p =
|
|
2318
|
+
var p = dn(n);
|
|
2319
2319
|
e.useEffect(function() {
|
|
2320
2320
|
p !== null && p !== n && console.warn("Unsupported prop change on CheckoutFormProvider: You cannot change the `stripe` prop after setting it.");
|
|
2321
2321
|
}, [p, n]);
|
|
2322
|
-
var m = s.type === "success" || s.type === "loading" ? s.sdk : null, h =
|
|
2322
|
+
var m = s.type === "success" || s.type === "loading" ? s.sdk : null, h = dn(r);
|
|
2323
2323
|
e.useEffect(function() {
|
|
2324
2324
|
if (m) {
|
|
2325
|
-
var e = h?.appearance, t = r?.appearance, n = !
|
|
2325
|
+
var e = h?.appearance, t = r?.appearance, n = !pn(t, e);
|
|
2326
2326
|
t && n && m.changeAppearance(t);
|
|
2327
|
-
var i = h?.fonts, a = r?.fonts, o = !
|
|
2327
|
+
var i = h?.fonts, a = r?.fonts, o = !pn(i, a);
|
|
2328
2328
|
a && o && m.loadFonts(a);
|
|
2329
2329
|
}
|
|
2330
2330
|
}, [
|
|
@@ -2332,7 +2332,7 @@ var Dn = "Invalid prop `stripe` supplied to `CheckoutFormProvider`. We recommend
|
|
|
2332
2332
|
h,
|
|
2333
2333
|
m
|
|
2334
2334
|
]), e.useEffect(function() {
|
|
2335
|
-
|
|
2335
|
+
mn(u);
|
|
2336
2336
|
}, [u]);
|
|
2337
2337
|
var g = e.useMemo(function() {
|
|
2338
2338
|
return {
|
|
@@ -2340,17 +2340,17 @@ var Dn = "Invalid prop `stripe` supplied to `CheckoutFormProvider`. We recommend
|
|
|
2340
2340
|
checkoutState: s
|
|
2341
2341
|
};
|
|
2342
2342
|
}, [u, s]);
|
|
2343
|
-
return /* @__PURE__ */ e.createElement(
|
|
2343
|
+
return /* @__PURE__ */ e.createElement(bn.Provider, { value: g }, i);
|
|
2344
2344
|
};
|
|
2345
|
-
|
|
2346
|
-
stripe:
|
|
2347
|
-
options:
|
|
2348
|
-
clientSecret:
|
|
2349
|
-
appearance:
|
|
2350
|
-
loader:
|
|
2351
|
-
fonts:
|
|
2352
|
-
savedPaymentMethod:
|
|
2353
|
-
defaultValues:
|
|
2345
|
+
kn.propTypes = {
|
|
2346
|
+
stripe: X.default.any,
|
|
2347
|
+
options: X.default.shape({
|
|
2348
|
+
clientSecret: X.default.oneOfType([X.default.string, X.default.instanceOf(Promise)]).isRequired,
|
|
2349
|
+
appearance: X.default.object,
|
|
2350
|
+
loader: X.default.string,
|
|
2351
|
+
fonts: X.default.array,
|
|
2352
|
+
savedPaymentMethod: X.default.object,
|
|
2353
|
+
defaultValues: X.default.object
|
|
2354
2354
|
}).isRequired
|
|
2355
2355
|
};
|
|
2356
2356
|
var Z = function(t, n, r) {
|
|
@@ -2371,18 +2371,18 @@ var Z = function(t, n, r) {
|
|
|
2371
2371
|
t,
|
|
2372
2372
|
a
|
|
2373
2373
|
]);
|
|
2374
|
-
},
|
|
2374
|
+
}, An = ["mode"], jn = function(e) {
|
|
2375
2375
|
return e.charAt(0).toUpperCase() + e.slice(1);
|
|
2376
2376
|
}, Q = function(t, n, r) {
|
|
2377
|
-
var i = r || `${
|
|
2378
|
-
|
|
2377
|
+
var i = r || `${jn(t)}Element`, a = n ? function(t) {
|
|
2378
|
+
Sn(`mounts <${i}>`);
|
|
2379
2379
|
var n = t.id, r = t.className;
|
|
2380
2380
|
return /* @__PURE__ */ e.createElement("div", {
|
|
2381
2381
|
id: n,
|
|
2382
2382
|
className: r
|
|
2383
2383
|
});
|
|
2384
2384
|
} : function(n) {
|
|
2385
|
-
var r = n.id, a = n.className, o = n.options, s = o === void 0 ? {} : o, c = n.onBlur, l = n.onFocus, u = n.onReady, d = n.onChange, f = n.onEscape, p = n.onClick, m = n.onLoadError, h = n.onLoaderStart, g = n.onNetworksChange, _ = n.onConfirm, v = n.onCancel, y = n.onShippingAddressChange, b = n.onShippingRateChange, x = n.onSavedPaymentMethodRemove, S = n.onSavedPaymentMethodUpdate, C = n.onAvailablePaymentMethodsChange, w =
|
|
2385
|
+
var r = n.id, a = n.className, o = n.options, s = o === void 0 ? {} : o, c = n.onBlur, l = n.onFocus, u = n.onReady, d = n.onChange, f = n.onEscape, p = n.onClick, m = n.onLoadError, h = n.onLoaderStart, g = n.onNetworksChange, _ = n.onConfirm, v = n.onCancel, y = n.onShippingAddressChange, b = n.onShippingRateChange, x = n.onSavedPaymentMethodRemove, S = n.onSavedPaymentMethodUpdate, C = n.onAvailablePaymentMethodsChange, w = Sn(`mounts <${i}>`), T = "elements" in w ? w.elements : null, E = "checkoutState" in w ? w.checkoutState : null, D = E?.type === "success" || E?.type === "loading" ? E.sdk : null, O = Qt(e.useState(null), 2), k = O[0], A = O[1], j = e.useRef(null), M = e.useRef(null);
|
|
2386
2386
|
Z(k, "blur", c), Z(k, "focus", l), Z(k, "escape", f), Z(k, "click", p), Z(k, "loaderror", m), Z(k, "loaderstart", h), Z(k, "networkschange", g), Z(k, "confirm", _), Z(k, "cancel", v), Z(k, "shippingaddresschange", y), Z(k, "shippingratechange", b), Z(k, "savedpaymentmethodremove", x), Z(k, "savedpaymentmethodupdate", S), Z(k, "availablepaymentmethodschange", C), Z(k, "change", d);
|
|
2387
2387
|
var N;
|
|
2388
2388
|
u && (N = t === "expressCheckout" ? u : function() {
|
|
@@ -2401,7 +2401,7 @@ var Z = function(t, n, r) {
|
|
|
2401
2401
|
break;
|
|
2402
2402
|
case "address":
|
|
2403
2403
|
if ("mode" in s) {
|
|
2404
|
-
var a = s.mode, o = Zt(s,
|
|
2404
|
+
var a = s.mode, o = Zt(s, An);
|
|
2405
2405
|
if (a === "shipping") e = n.createShippingAddressElement(o);
|
|
2406
2406
|
else if (a === "billing") e = n.createBillingAddressElement(o);
|
|
2407
2407
|
else throw Error("Invalid options.mode. mode must be 'billing' or 'shipping'.");
|
|
@@ -2429,10 +2429,10 @@ var Z = function(t, n, r) {
|
|
|
2429
2429
|
D,
|
|
2430
2430
|
s
|
|
2431
2431
|
]);
|
|
2432
|
-
var P =
|
|
2432
|
+
var P = dn(s);
|
|
2433
2433
|
return e.useEffect(function() {
|
|
2434
2434
|
if (j.current) {
|
|
2435
|
-
var e =
|
|
2435
|
+
var e = hn(s, P, ["paymentRequest"]);
|
|
2436
2436
|
e && "update" in j.current && j.current.update(e);
|
|
2437
2437
|
}
|
|
2438
2438
|
}, [s, P]), e.useLayoutEffect(function() {
|
|
@@ -2448,145 +2448,145 @@ var Z = function(t, n, r) {
|
|
|
2448
2448
|
});
|
|
2449
2449
|
};
|
|
2450
2450
|
return a.propTypes = {
|
|
2451
|
-
id:
|
|
2452
|
-
className:
|
|
2453
|
-
onChange:
|
|
2454
|
-
onBlur:
|
|
2455
|
-
onFocus:
|
|
2456
|
-
onReady:
|
|
2457
|
-
onEscape:
|
|
2458
|
-
onClick:
|
|
2459
|
-
onLoadError:
|
|
2460
|
-
onLoaderStart:
|
|
2461
|
-
onNetworksChange:
|
|
2462
|
-
onConfirm:
|
|
2463
|
-
onCancel:
|
|
2464
|
-
onShippingAddressChange:
|
|
2465
|
-
onShippingRateChange:
|
|
2466
|
-
onSavedPaymentMethodRemove:
|
|
2467
|
-
onSavedPaymentMethodUpdate:
|
|
2468
|
-
onAvailablePaymentMethodsChange:
|
|
2469
|
-
options:
|
|
2451
|
+
id: X.default.string,
|
|
2452
|
+
className: X.default.string,
|
|
2453
|
+
onChange: X.default.func,
|
|
2454
|
+
onBlur: X.default.func,
|
|
2455
|
+
onFocus: X.default.func,
|
|
2456
|
+
onReady: X.default.func,
|
|
2457
|
+
onEscape: X.default.func,
|
|
2458
|
+
onClick: X.default.func,
|
|
2459
|
+
onLoadError: X.default.func,
|
|
2460
|
+
onLoaderStart: X.default.func,
|
|
2461
|
+
onNetworksChange: X.default.func,
|
|
2462
|
+
onConfirm: X.default.func,
|
|
2463
|
+
onCancel: X.default.func,
|
|
2464
|
+
onShippingAddressChange: X.default.func,
|
|
2465
|
+
onShippingRateChange: X.default.func,
|
|
2466
|
+
onSavedPaymentMethodRemove: X.default.func,
|
|
2467
|
+
onSavedPaymentMethodUpdate: X.default.func,
|
|
2468
|
+
onAvailablePaymentMethodsChange: X.default.func,
|
|
2469
|
+
options: X.default.object
|
|
2470
2470
|
}, a.displayName = i, a.__elementType = t, a;
|
|
2471
2471
|
}, $ = typeof window > "u";
|
|
2472
2472
|
Q("currencySelector", $);
|
|
2473
|
-
var
|
|
2473
|
+
var Mn = Q("payment", $);
|
|
2474
2474
|
Q("paymentForm", $, "CheckoutForm"), Q("expressCheckout", $), Q("taxId", $);
|
|
2475
|
-
var
|
|
2475
|
+
var Nn = Q("contactDetails", $);
|
|
2476
2476
|
Q("address", $);
|
|
2477
2477
|
//#endregion
|
|
2478
2478
|
//#region node_modules/@stripe/stripe-js/dist/index.mjs
|
|
2479
|
-
function
|
|
2479
|
+
function Pn(e) {
|
|
2480
2480
|
"@babel/helpers - typeof";
|
|
2481
|
-
return
|
|
2481
|
+
return Pn = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(e) {
|
|
2482
2482
|
return typeof e;
|
|
2483
2483
|
} : function(e) {
|
|
2484
2484
|
return e && typeof Symbol == "function" && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e;
|
|
2485
|
-
},
|
|
2485
|
+
}, Pn(e);
|
|
2486
2486
|
}
|
|
2487
|
-
var
|
|
2487
|
+
var Fn = "dahlia", In = function(e) {
|
|
2488
2488
|
return e === 3 ? "v3" : e;
|
|
2489
|
-
},
|
|
2490
|
-
return
|
|
2491
|
-
},
|
|
2492
|
-
for (var e = document.querySelectorAll(`script[src^="${
|
|
2489
|
+
}, Ln = "https://js.stripe.com", Rn = `${Ln}/${Fn}/stripe.js`, zn = /^https:\/\/js\.stripe\.com\/v3\/?(\?.*)?$/, Bn = /^https:\/\/js\.stripe\.com\/(v3|[a-z]+)\/stripe\.js(\?.*)?$/, Vn = "loadStripe.setLoadParameters was called but an existing Stripe.js script already exists in the document; existing script parameters will be used", Hn = function(e) {
|
|
2490
|
+
return zn.test(e) || Bn.test(e);
|
|
2491
|
+
}, Un = function() {
|
|
2492
|
+
for (var e = document.querySelectorAll(`script[src^="${Ln}"]`), t = 0; t < e.length; t++) {
|
|
2493
2493
|
var n = e[t];
|
|
2494
|
-
if (
|
|
2494
|
+
if (Hn(n.src)) return n;
|
|
2495
2495
|
}
|
|
2496
2496
|
return null;
|
|
2497
|
-
},
|
|
2497
|
+
}, Wn = function(e) {
|
|
2498
2498
|
var t = e && !e.advancedFraudSignals ? "?advancedFraudSignals=false" : "", n = document.createElement("script");
|
|
2499
|
-
n.src = `${
|
|
2499
|
+
n.src = `${Rn}${t}`;
|
|
2500
2500
|
var r = document.head || document.body;
|
|
2501
2501
|
if (!r) throw Error("Expected document.body not to be null. Stripe.js requires a <body> element.");
|
|
2502
2502
|
return r.appendChild(n), n;
|
|
2503
|
-
},
|
|
2503
|
+
}, Gn = function(e, t) {
|
|
2504
2504
|
!e || !e._registerWrapper || e._registerWrapper({
|
|
2505
2505
|
name: "stripe-js",
|
|
2506
2506
|
version: "9.6.0",
|
|
2507
2507
|
startTime: t
|
|
2508
2508
|
});
|
|
2509
|
-
},
|
|
2509
|
+
}, Kn = null, qn = null, Jn = null, Yn = function(e) {
|
|
2510
2510
|
return function(t) {
|
|
2511
2511
|
e(Error("Failed to load Stripe.js", { cause: t }));
|
|
2512
2512
|
};
|
|
2513
|
-
},
|
|
2513
|
+
}, Xn = function(e, t) {
|
|
2514
2514
|
return function() {
|
|
2515
2515
|
window.Stripe ? e(window.Stripe) : t(/* @__PURE__ */ Error("Stripe.js not available"));
|
|
2516
2516
|
};
|
|
2517
|
-
},
|
|
2518
|
-
return
|
|
2517
|
+
}, Zn = function(e) {
|
|
2518
|
+
return Kn === null ? (Kn = new Promise(function(t, n) {
|
|
2519
2519
|
if (typeof window > "u" || typeof document > "u") {
|
|
2520
2520
|
t(null);
|
|
2521
2521
|
return;
|
|
2522
2522
|
}
|
|
2523
|
-
if (window.Stripe && e && console.warn(
|
|
2523
|
+
if (window.Stripe && e && console.warn(Vn), window.Stripe) {
|
|
2524
2524
|
t(window.Stripe);
|
|
2525
2525
|
return;
|
|
2526
2526
|
}
|
|
2527
2527
|
try {
|
|
2528
|
-
var r =
|
|
2529
|
-
if (r && e) console.warn(
|
|
2530
|
-
else if (!r) r =
|
|
2531
|
-
else if (r &&
|
|
2528
|
+
var r = Un();
|
|
2529
|
+
if (r && e) console.warn(Vn);
|
|
2530
|
+
else if (!r) r = Wn(e);
|
|
2531
|
+
else if (r && Jn !== null && qn !== null) {
|
|
2532
2532
|
var i;
|
|
2533
|
-
r.removeEventListener("load",
|
|
2533
|
+
r.removeEventListener("load", Jn), r.removeEventListener("error", qn), (i = r.parentNode) == null || i.removeChild(r), r = Wn(e);
|
|
2534
2534
|
}
|
|
2535
|
-
|
|
2535
|
+
Jn = Xn(t, n), qn = Yn(n), r.addEventListener("load", Jn), r.addEventListener("error", qn);
|
|
2536
2536
|
} catch (e) {
|
|
2537
2537
|
n(e);
|
|
2538
2538
|
return;
|
|
2539
2539
|
}
|
|
2540
|
-
}),
|
|
2541
|
-
return
|
|
2542
|
-
})) :
|
|
2543
|
-
},
|
|
2540
|
+
}), Kn.catch(function(e) {
|
|
2541
|
+
return Kn = null, Promise.reject(e);
|
|
2542
|
+
})) : Kn;
|
|
2543
|
+
}, Qn = function(e, t, n) {
|
|
2544
2544
|
if (e === null) return null;
|
|
2545
2545
|
var r = t[0];
|
|
2546
|
-
if (typeof r != "string") throw Error(`Expected publishable key to be of type string, got type ${
|
|
2547
|
-
var i = r.match(/^pk_test/), a =
|
|
2546
|
+
if (typeof r != "string") throw Error(`Expected publishable key to be of type string, got type ${Pn(r)} instead.`);
|
|
2547
|
+
var i = r.match(/^pk_test/), a = In(e.version), o = Fn;
|
|
2548
2548
|
i && a !== o && console.warn(`Stripe.js@${a} was loaded on the page, but @stripe/stripe-js@9.6.0 expected Stripe.js@${o}. This may result in unexpected behavior. For more information, see https://docs.stripe.com/sdks/stripejs-versioning`);
|
|
2549
2549
|
var s = e.apply(void 0, t);
|
|
2550
|
-
return
|
|
2551
|
-
},
|
|
2552
|
-
return
|
|
2553
|
-
return
|
|
2554
|
-
}),
|
|
2550
|
+
return Gn(s, n), s;
|
|
2551
|
+
}, $n, er = !1, tr = function() {
|
|
2552
|
+
return $n || ($n = Zn(null).catch(function(e) {
|
|
2553
|
+
return $n = null, Promise.reject(e);
|
|
2554
|
+
}), $n);
|
|
2555
2555
|
};
|
|
2556
2556
|
Promise.resolve().then(function() {
|
|
2557
|
-
return
|
|
2557
|
+
return tr();
|
|
2558
2558
|
}).catch(function(e) {
|
|
2559
|
-
|
|
2559
|
+
er || console.warn(e);
|
|
2560
2560
|
});
|
|
2561
|
-
var
|
|
2561
|
+
var nr = function() {
|
|
2562
2562
|
var e = [...arguments];
|
|
2563
|
-
|
|
2563
|
+
er = !0;
|
|
2564
2564
|
var t = Date.now();
|
|
2565
|
-
return
|
|
2566
|
-
return
|
|
2565
|
+
return tr().then(function(n) {
|
|
2566
|
+
return Qn(n, e, t);
|
|
2567
2567
|
});
|
|
2568
|
-
},
|
|
2569
|
-
function rr(e) {
|
|
2570
|
-
return e === void 0 ? nr : `$${new Intl.NumberFormat("en-US").format(Number(e || 0))}`;
|
|
2571
|
-
}
|
|
2568
|
+
}, rr = "-";
|
|
2572
2569
|
function ir(e) {
|
|
2573
|
-
return
|
|
2570
|
+
return e === void 0 ? rr : `$${new Intl.NumberFormat("en-US").format(Number(e || 0))}`;
|
|
2571
|
+
}
|
|
2572
|
+
function ar(e) {
|
|
2573
|
+
return /* @__PURE__ */ B(D.Text, {
|
|
2574
2574
|
className: "text-arco-text-1! text-3xl! leading-tight! font-bold!",
|
|
2575
|
-
children:
|
|
2575
|
+
children: ir(e)
|
|
2576
2576
|
});
|
|
2577
2577
|
}
|
|
2578
|
-
function
|
|
2579
|
-
let n =
|
|
2580
|
-
if (n.type === "loading") return /* @__PURE__ */
|
|
2578
|
+
function or({ text: e, onSuccess: t }) {
|
|
2579
|
+
let n = wn(), [r, i] = a(""), [s, l] = a(!1);
|
|
2580
|
+
if (n.type === "loading") return /* @__PURE__ */ B("div", {
|
|
2581
2581
|
className: "flex min-h-80 items-center justify-center",
|
|
2582
|
-
children: /* @__PURE__ */
|
|
2582
|
+
children: /* @__PURE__ */ B(S, { tip: e.stripePaymentLoading })
|
|
2583
2583
|
});
|
|
2584
|
-
if (n.type === "error") return /* @__PURE__ */
|
|
2584
|
+
if (n.type === "error") return /* @__PURE__ */ B(o, {
|
|
2585
2585
|
type: "error",
|
|
2586
2586
|
content: n.error.message
|
|
2587
2587
|
});
|
|
2588
2588
|
let { checkout: u } = n, d = u.total.total.amount;
|
|
2589
|
-
return /* @__PURE__ */
|
|
2589
|
+
return /* @__PURE__ */ V("form", {
|
|
2590
2590
|
className: "flex flex-col gap-6",
|
|
2591
2591
|
onSubmit: async (n) => {
|
|
2592
2592
|
if (n.preventDefault(), !(!u.canConfirm || s)) {
|
|
@@ -2606,23 +2606,23 @@ function ar({ text: e, onSuccess: t }) {
|
|
|
2606
2606
|
}
|
|
2607
2607
|
},
|
|
2608
2608
|
children: [
|
|
2609
|
-
/* @__PURE__ */
|
|
2609
|
+
/* @__PURE__ */ V("div", {
|
|
2610
2610
|
className: "flex flex-col gap-3",
|
|
2611
|
-
children: [/* @__PURE__ */
|
|
2611
|
+
children: [/* @__PURE__ */ B(D.Title, {
|
|
2612
2612
|
heading: 6,
|
|
2613
2613
|
className: "text-arco-text-1! mb-0!",
|
|
2614
2614
|
children: e.stripeContactDetails
|
|
2615
|
-
}), /* @__PURE__ */
|
|
2615
|
+
}), /* @__PURE__ */ B(Nn, {})]
|
|
2616
2616
|
}),
|
|
2617
|
-
/* @__PURE__ */
|
|
2617
|
+
/* @__PURE__ */ V("div", {
|
|
2618
2618
|
className: "flex flex-col gap-3",
|
|
2619
|
-
children: [/* @__PURE__ */
|
|
2619
|
+
children: [/* @__PURE__ */ B(D.Title, {
|
|
2620
2620
|
heading: 6,
|
|
2621
2621
|
className: "text-arco-text-1! mb-0!",
|
|
2622
2622
|
children: e.stripePaymentSection
|
|
2623
|
-
}), /* @__PURE__ */
|
|
2623
|
+
}), /* @__PURE__ */ B(Mn, { id: "mantur-stripe-payment-element" })]
|
|
2624
2624
|
}),
|
|
2625
|
-
/* @__PURE__ */
|
|
2625
|
+
/* @__PURE__ */ V(c, {
|
|
2626
2626
|
htmlType: "submit",
|
|
2627
2627
|
type: "primary",
|
|
2628
2628
|
size: "large",
|
|
@@ -2635,15 +2635,15 @@ function ar({ text: e, onSuccess: t }) {
|
|
|
2635
2635
|
d
|
|
2636
2636
|
]
|
|
2637
2637
|
}),
|
|
2638
|
-
r ? /* @__PURE__ */
|
|
2638
|
+
r ? /* @__PURE__ */ B(o, {
|
|
2639
2639
|
type: "error",
|
|
2640
2640
|
content: r
|
|
2641
2641
|
}) : null
|
|
2642
2642
|
]
|
|
2643
2643
|
});
|
|
2644
2644
|
}
|
|
2645
|
-
function
|
|
2646
|
-
let { resolvedTheme: p } =
|
|
2645
|
+
function sr({ visible: e, publishableKey: n, order: s, text: l, onCancel: u, onSuccess: f }) {
|
|
2646
|
+
let { resolvedTheme: p } = ee(), [m, h] = a(!1), g = i(!1), _ = s?.clientSecret || s?.stripeClientSecret, v = r(() => n ? nr(n) : null, [n]), b = p === "dark" ? "night" : "flat", x = r(() => _ ? {
|
|
2647
2647
|
clientSecret: _,
|
|
2648
2648
|
elementsOptions: { appearance: {
|
|
2649
2649
|
theme: b,
|
|
@@ -2651,10 +2651,10 @@ function or({ visible: e, publishableKey: n, order: s, text: l, onCancel: u, onS
|
|
|
2651
2651
|
} }
|
|
2652
2652
|
} : void 0, [_, b]), S = r(() => [{
|
|
2653
2653
|
label: l.stripePaymentTotalAmount,
|
|
2654
|
-
value:
|
|
2654
|
+
value: ar(s?.amount)
|
|
2655
2655
|
}, {
|
|
2656
2656
|
label: l.stripePaymentOrderNo,
|
|
2657
|
-
value: s?.orderNo ||
|
|
2657
|
+
value: s?.orderNo || rr
|
|
2658
2658
|
}], [
|
|
2659
2659
|
s?.amount,
|
|
2660
2660
|
s?.orderNo,
|
|
@@ -2675,33 +2675,33 @@ function or({ visible: e, publishableKey: n, order: s, text: l, onCancel: u, onS
|
|
|
2675
2675
|
} finally {
|
|
2676
2676
|
g.current = !1, h(!1), u();
|
|
2677
2677
|
}
|
|
2678
|
-
}, [u, s?.orderNo]), w = !n || !v ? /* @__PURE__ */
|
|
2678
|
+
}, [u, s?.orderNo]), w = !n || !v ? /* @__PURE__ */ B(o, {
|
|
2679
2679
|
type: "error",
|
|
2680
2680
|
content: l.stripePaymentConfigMissing
|
|
2681
|
-
}) : _ ? _.startsWith("cs_") ? x ? /* @__PURE__ */
|
|
2681
|
+
}) : _ ? _.startsWith("cs_") ? x ? /* @__PURE__ */ B(Dn, {
|
|
2682
2682
|
stripe: v,
|
|
2683
2683
|
options: x,
|
|
2684
|
-
children: /* @__PURE__ */
|
|
2684
|
+
children: /* @__PURE__ */ B(or, {
|
|
2685
2685
|
text: l,
|
|
2686
2686
|
onSuccess: f
|
|
2687
2687
|
})
|
|
2688
|
-
}, `${_}-${b}`) : /* @__PURE__ */
|
|
2688
|
+
}, `${_}-${b}`) : /* @__PURE__ */ B(o, {
|
|
2689
2689
|
type: "error",
|
|
2690
2690
|
content: l.stripePaymentClientSecretMissing
|
|
2691
|
-
}) : /* @__PURE__ */
|
|
2691
|
+
}) : /* @__PURE__ */ B(o, {
|
|
2692
2692
|
type: "error",
|
|
2693
2693
|
content: l.stripeCheckoutClientSecretInvalid
|
|
2694
|
-
}) : /* @__PURE__ */
|
|
2694
|
+
}) : /* @__PURE__ */ B(o, {
|
|
2695
2695
|
type: "error",
|
|
2696
2696
|
content: l.stripePaymentClientSecretMissing
|
|
2697
2697
|
});
|
|
2698
|
-
return /* @__PURE__ */
|
|
2698
|
+
return /* @__PURE__ */ B(y, {
|
|
2699
2699
|
title: l.stripePaymentTitle,
|
|
2700
2700
|
visible: e,
|
|
2701
2701
|
closeIcon: null,
|
|
2702
|
-
footer: /* @__PURE__ */
|
|
2702
|
+
footer: /* @__PURE__ */ B("div", {
|
|
2703
2703
|
className: "flex justify-end gap-2 mx-auto max-w-7xl ",
|
|
2704
|
-
children: /* @__PURE__ */
|
|
2704
|
+
children: /* @__PURE__ */ B(c, {
|
|
2705
2705
|
size: "large",
|
|
2706
2706
|
type: "primary",
|
|
2707
2707
|
status: "danger",
|
|
@@ -2724,22 +2724,22 @@ function or({ visible: e, publishableKey: n, order: s, text: l, onCancel: u, onS
|
|
|
2724
2724
|
},
|
|
2725
2725
|
className: "top-0! m-0! flex! h-screen! w-screen! max-w-none! flex-col! rounded-none! [&_.arco-modal-body]:min-h-0! [&_.arco-modal-body]:flex-1! [&_.arco-modal-body]:overflow-auto! [&_.arco-modal-content]:flex! [&_.arco-modal-content]:h-full! [&_.arco-modal-content]:flex-col! [&_.arco-modal-content]:rounded-none! [&_.arco-modal-header]:shrink-0!",
|
|
2726
2726
|
focusLock: !1,
|
|
2727
|
-
children: /* @__PURE__ */
|
|
2727
|
+
children: /* @__PURE__ */ V("div", {
|
|
2728
2728
|
className: "mx-auto flex min-h-full w-full max-w-7xl gap-8 px-6 py-6 lg:px-8",
|
|
2729
|
-
children: [/* @__PURE__ */
|
|
2729
|
+
children: [/* @__PURE__ */ B("div", {
|
|
2730
2730
|
className: "w-80",
|
|
2731
|
-
children: /* @__PURE__ */
|
|
2731
|
+
children: /* @__PURE__ */ B("div", {
|
|
2732
2732
|
className: "bg-arco-bg-1 mx-auto w-full rounded-xl p-6",
|
|
2733
|
-
children: /* @__PURE__ */
|
|
2733
|
+
children: /* @__PURE__ */ B(d, {
|
|
2734
2734
|
border: !1,
|
|
2735
2735
|
column: 1,
|
|
2736
2736
|
data: S,
|
|
2737
2737
|
labelStyle: { width: 96 }
|
|
2738
2738
|
})
|
|
2739
2739
|
})
|
|
2740
|
-
}), /* @__PURE__ */
|
|
2740
|
+
}), /* @__PURE__ */ B("div", {
|
|
2741
2741
|
className: "min-w-0 flex-1",
|
|
2742
|
-
children: /* @__PURE__ */
|
|
2742
|
+
children: /* @__PURE__ */ B("div", {
|
|
2743
2743
|
className: "bg-arco-bg-1 mx-auto w-full max-w-2xl rounded-xl p-6",
|
|
2744
2744
|
children: w
|
|
2745
2745
|
})
|
|
@@ -2749,47 +2749,95 @@ function or({ visible: e, publishableKey: n, order: s, text: l, onCancel: u, onS
|
|
|
2749
2749
|
}
|
|
2750
2750
|
//#endregion
|
|
2751
2751
|
//#region src/header/components/UserMenu.tsx
|
|
2752
|
-
function
|
|
2753
|
-
|
|
2752
|
+
function cr({ user: e, points: t, text: n, onEditProfile: r, onRecharge: i, onPointsDetail: a, onLogout: o }) {
|
|
2753
|
+
let s = (e) => new Intl.NumberFormat().format(e);
|
|
2754
|
+
return /* @__PURE__ */ V("div", {
|
|
2754
2755
|
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%)]",
|
|
2755
2756
|
children: [
|
|
2756
|
-
/* @__PURE__ */
|
|
2757
|
+
/* @__PURE__ */ V("div", {
|
|
2757
2758
|
className: "flex items-center gap-3 px-6 pt-5 pb-4",
|
|
2758
|
-
children: [/* @__PURE__ */
|
|
2759
|
+
children: [/* @__PURE__ */ B(Nt, {
|
|
2759
2760
|
user: e,
|
|
2760
2761
|
size: 48,
|
|
2761
2762
|
className: "shrink-0"
|
|
2762
|
-
}), /* @__PURE__ */
|
|
2763
|
+
}), /* @__PURE__ */ V("div", {
|
|
2763
2764
|
className: "flex min-w-0 flex-1 flex-col gap-1",
|
|
2764
|
-
children: [/* @__PURE__ */
|
|
2765
|
+
children: [/* @__PURE__ */ V("div", {
|
|
2765
2766
|
className: "flex min-w-0 items-center gap-1.5",
|
|
2766
|
-
children: [/* @__PURE__ */
|
|
2767
|
+
children: [/* @__PURE__ */ B("span", {
|
|
2767
2768
|
className: "text-arco-text-1 truncate text-base leading-6 font-bold",
|
|
2768
2769
|
children: e?.nickname || e?.username
|
|
2769
|
-
}), /* @__PURE__ */
|
|
2770
|
+
}), /* @__PURE__ */ B(c, {
|
|
2770
2771
|
type: "text",
|
|
2771
2772
|
size: "mini",
|
|
2772
|
-
icon: /* @__PURE__ */
|
|
2773
|
+
icon: /* @__PURE__ */ B(j, {}),
|
|
2773
2774
|
className: "text-arco-text-3 h-6! min-w-6! px-0!",
|
|
2774
|
-
onClick:
|
|
2775
|
+
onClick: r
|
|
2775
2776
|
})]
|
|
2776
|
-
}), e?.email ? /* @__PURE__ */
|
|
2777
|
+
}), e?.email ? /* @__PURE__ */ B("span", {
|
|
2777
2778
|
className: "text-arco-text-3 truncate text-xs leading-5",
|
|
2778
2779
|
children: e.email
|
|
2779
2780
|
}) : null]
|
|
2780
2781
|
})]
|
|
2781
2782
|
}),
|
|
2782
|
-
/* @__PURE__ */
|
|
2783
|
-
/* @__PURE__ */
|
|
2783
|
+
/* @__PURE__ */ B(f, { className: "m-0!" }),
|
|
2784
|
+
/* @__PURE__ */ V("ul", {
|
|
2785
|
+
className: "flex flex-col gap-3.5 px-6 py-4",
|
|
2786
|
+
children: [
|
|
2787
|
+
/* @__PURE__ */ V("li", {
|
|
2788
|
+
className: "text-arco-text-2 flex items-center justify-between gap-4 text-sm",
|
|
2789
|
+
children: [/* @__PURE__ */ B("span", { children: n.myPoints }), /* @__PURE__ */ B("strong", {
|
|
2790
|
+
className: "text-arco-primary-6 text-base font-bold",
|
|
2791
|
+
children: s(t.total)
|
|
2792
|
+
})]
|
|
2793
|
+
}),
|
|
2794
|
+
/* @__PURE__ */ V("li", {
|
|
2795
|
+
className: "text-arco-text-2 flex items-center justify-between gap-4 text-sm",
|
|
2796
|
+
children: [/* @__PURE__ */ B("span", { children: n.rechargePoints }), /* @__PURE__ */ B("strong", {
|
|
2797
|
+
className: "text-arco-text-1 text-base font-bold",
|
|
2798
|
+
children: s(t.recharge)
|
|
2799
|
+
})]
|
|
2800
|
+
}),
|
|
2801
|
+
/* @__PURE__ */ V("li", {
|
|
2802
|
+
className: "text-arco-text-2 flex items-center justify-between gap-4 text-sm",
|
|
2803
|
+
children: [/* @__PURE__ */ B("span", { children: n.giftedPoints }), /* @__PURE__ */ B("strong", {
|
|
2804
|
+
className: "text-arco-text-1 text-base font-bold",
|
|
2805
|
+
children: s(t.gifted)
|
|
2806
|
+
})]
|
|
2807
|
+
})
|
|
2808
|
+
]
|
|
2809
|
+
}),
|
|
2810
|
+
/* @__PURE__ */ B(f, { className: "m-0!" }),
|
|
2811
|
+
/* @__PURE__ */ V("div", {
|
|
2812
|
+
className: "flex flex-col gap-2 px-6 py-4",
|
|
2813
|
+
children: [/* @__PURE__ */ B(c, {
|
|
2814
|
+
type: "primary",
|
|
2815
|
+
long: !0,
|
|
2816
|
+
icon: /* @__PURE__ */ B(F, {}),
|
|
2817
|
+
shape: "round",
|
|
2818
|
+
className: "h-10! font-medium!",
|
|
2819
|
+
onClick: i,
|
|
2820
|
+
children: n.recharge
|
|
2821
|
+
}), /* @__PURE__ */ B(c, {
|
|
2822
|
+
long: !0,
|
|
2823
|
+
shape: "round",
|
|
2824
|
+
icon: /* @__PURE__ */ B(M, {}),
|
|
2825
|
+
className: "border-arco-border-2! bg-arco-fill-1! text-arco-text-1! h-10! font-medium!",
|
|
2826
|
+
onClick: a,
|
|
2827
|
+
children: n.pointsDetail
|
|
2828
|
+
})]
|
|
2829
|
+
}),
|
|
2830
|
+
/* @__PURE__ */ B(f, { className: "m-0!" }),
|
|
2831
|
+
/* @__PURE__ */ B("div", {
|
|
2784
2832
|
className: "px-6 py-4",
|
|
2785
|
-
children: /* @__PURE__ */
|
|
2786
|
-
icon: /* @__PURE__ */
|
|
2833
|
+
children: /* @__PURE__ */ B(c, {
|
|
2834
|
+
icon: /* @__PURE__ */ B(I, {}),
|
|
2787
2835
|
type: "text",
|
|
2788
2836
|
status: "danger",
|
|
2789
2837
|
long: !0,
|
|
2790
2838
|
className: "flex! items-center justify-start gap-2 text-sm text-arco-text-2",
|
|
2791
|
-
onClick: () => void
|
|
2792
|
-
children:
|
|
2839
|
+
onClick: () => void o?.(),
|
|
2840
|
+
children: n.logout
|
|
2793
2841
|
})
|
|
2794
2842
|
})
|
|
2795
2843
|
]
|
|
@@ -2797,50 +2845,50 @@ function sr({ user: e, text: t, onEditProfile: n, onLogout: r }) {
|
|
|
2797
2845
|
}
|
|
2798
2846
|
//#endregion
|
|
2799
2847
|
//#region src/header/ManturHeader.tsx
|
|
2800
|
-
var
|
|
2848
|
+
var lr = "https://mantur.ai/images/logo.png", ur = [
|
|
2801
2849
|
"from-arco-primary-light-1 to-arco-primary-light-2 text-arco-primary-6",
|
|
2802
2850
|
"from-arco-success-light-1 to-arco-success-light-2 text-arco-success-6",
|
|
2803
2851
|
"from-arco-warning-light-1 to-arco-warning-light-2 text-arco-warning-6",
|
|
2804
2852
|
"from-arco-danger-light-1 to-arco-danger-light-2 text-arco-danger-6"
|
|
2805
2853
|
];
|
|
2806
|
-
function
|
|
2807
|
-
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 ${
|
|
2854
|
+
function dr(e, t = !1) {
|
|
2855
|
+
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 ${ur[e % ur.length]} ${t ? "shadow-[inset_0_1px_3px_rgb(0_0_0/8%)]" : ""}`;
|
|
2808
2856
|
}
|
|
2809
|
-
function
|
|
2857
|
+
function fr(e) {
|
|
2810
2858
|
return e?.tenantName?.[0]?.toUpperCase() || "T";
|
|
2811
2859
|
}
|
|
2812
|
-
function
|
|
2860
|
+
function pr(e, t, n) {
|
|
2813
2861
|
let r = e?.roles?.map((e) => e.roleName).filter(Boolean);
|
|
2814
2862
|
return r?.length ? r.join(", ") : e?.isOwner ? t : n;
|
|
2815
2863
|
}
|
|
2816
|
-
function
|
|
2817
|
-
let [m, h] = a(() => nt()), g = rt(m), [y, b] = a(!1), [x, S] = a(!1), [C, w] = a(!1), [T, D] = a(e), [O, k] = a([]), [j, M] = a(), [N, P] = a(!1), [F, I] = a(!1), [L, R] = a(!1), [
|
|
2864
|
+
function mr({ user: e, disabled: o = !1, brandSlot: s, children: c, onTenantContextChange: l, appName: u, mainPrefix: d, stripePublishableKey: f }) {
|
|
2865
|
+
let [m, h] = a(() => nt()), g = rt(m), [y, b] = a(!1), [x, S] = a(!1), [C, w] = a(!1), [T, D] = a(e), [O, k] = a([]), [j, M] = a(), [N, P] = a(!1), [F, I] = a(!1), [L, R] = a(!1), [z, ee] = a([]), [te, H] = a(), ne = i(l), re = f || (typeof window < "u" ? window.__MANTUR_COMPONENTS_STRIPE_PUBLISHABLE_KEY__ : void 0) || "pk_test_51TJ8JiERSsQknDG7bJSIX81RFq3LcCfUXCV7mh0cQsZ2dwmYcJ5Ki6bPXynNvdyZEEBE83I6I719NIFyO9Qreey700yPAul8sv", ie = d ?? (typeof window < "u" ? window.__MANTUR_MAIN_PREFIX__ : void 0) ?? void 0, [ae, U] = a({
|
|
2818
2866
|
total: 0,
|
|
2819
2867
|
recharge: 0,
|
|
2820
2868
|
gifted: 0
|
|
2821
|
-
}),
|
|
2822
|
-
total:
|
|
2823
|
-
recharge:
|
|
2824
|
-
gifted:
|
|
2825
|
-
},
|
|
2869
|
+
}), W = j?.tenantId || "", G = o, K = {
|
|
2870
|
+
total: ae.total ?? 0,
|
|
2871
|
+
recharge: ae.recharge ?? 0,
|
|
2872
|
+
gifted: ae.gifted ?? 0
|
|
2873
|
+
}, oe = async (e) => {
|
|
2826
2874
|
let t = await ke(e);
|
|
2827
2875
|
return t && D(t), t;
|
|
2828
2876
|
};
|
|
2829
2877
|
n(() => {
|
|
2830
2878
|
D(e);
|
|
2831
2879
|
}, [e]), n(() => {
|
|
2832
|
-
|
|
2880
|
+
ne.current = l;
|
|
2833
2881
|
}, [l]);
|
|
2834
|
-
let
|
|
2835
|
-
k(e.tenants), M(e.currentTenant),
|
|
2882
|
+
let q = t((e) => {
|
|
2883
|
+
k(e.tenants), M(e.currentTenant), ne.current?.(e);
|
|
2836
2884
|
}, []);
|
|
2837
2885
|
n(() => {
|
|
2838
|
-
P(!0), Ke().then(
|
|
2886
|
+
P(!0), Ke().then(q).catch((e) => {
|
|
2839
2887
|
console.warn("Failed to refresh Mantur tenant context.", e), v.error(g.error);
|
|
2840
2888
|
}).finally(() => P(!1));
|
|
2841
|
-
}, [
|
|
2889
|
+
}, [q, g.error]), n(() => {
|
|
2842
2890
|
let e = (e) => {
|
|
2843
|
-
e instanceof CustomEvent &&
|
|
2891
|
+
e instanceof CustomEvent && U(e.detail);
|
|
2844
2892
|
};
|
|
2845
2893
|
return window.addEventListener(ye, e), Me().catch((e) => {
|
|
2846
2894
|
console.warn("Failed to refresh Mantur user points.", e);
|
|
@@ -2849,7 +2897,7 @@ function pr({ user: e, disabled: o = !1, brandSlot: s, children: c, onTenantCont
|
|
|
2849
2897
|
};
|
|
2850
2898
|
}, []), n(() => {
|
|
2851
2899
|
let e = (e) => {
|
|
2852
|
-
h(e instanceof CustomEvent ?
|
|
2900
|
+
h(e instanceof CustomEvent ? Y(e.detail) : nt());
|
|
2853
2901
|
};
|
|
2854
2902
|
return window.addEventListener(et, e), window.addEventListener("storage", e), () => {
|
|
2855
2903
|
window.removeEventListener(et, e), window.removeEventListener("storage", e);
|
|
@@ -2871,25 +2919,25 @@ function pr({ user: e, disabled: o = !1, brandSlot: s, children: c, onTenantCont
|
|
|
2871
2919
|
console.warn("Failed to load Mantur recharge packages.", e);
|
|
2872
2920
|
}).finally(() => I(!1)));
|
|
2873
2921
|
}, [x]);
|
|
2874
|
-
let
|
|
2922
|
+
let se = (e) => {
|
|
2875
2923
|
v.success(e);
|
|
2876
|
-
},
|
|
2924
|
+
}, ce = (e, t) => {
|
|
2877
2925
|
console.error(t), v.error(e);
|
|
2878
|
-
},
|
|
2879
|
-
if (!
|
|
2880
|
-
P(!0),
|
|
2926
|
+
}, le = t(async (e) => {
|
|
2927
|
+
if (!G && e !== W) try {
|
|
2928
|
+
P(!0), q(await qe(e)), se(g.switchedToTeam);
|
|
2881
2929
|
} catch (e) {
|
|
2882
|
-
|
|
2930
|
+
ce(g.error, e);
|
|
2883
2931
|
} finally {
|
|
2884
2932
|
P(!1);
|
|
2885
2933
|
}
|
|
2886
2934
|
}, [
|
|
2887
|
-
|
|
2888
|
-
U,
|
|
2935
|
+
q,
|
|
2889
2936
|
W,
|
|
2937
|
+
G,
|
|
2890
2938
|
g.error,
|
|
2891
2939
|
g.switchedToTeam
|
|
2892
|
-
]),
|
|
2940
|
+
]), ue = async (e) => {
|
|
2893
2941
|
let t = u?.trim();
|
|
2894
2942
|
try {
|
|
2895
2943
|
R(!0);
|
|
@@ -2902,71 +2950,71 @@ function pr({ user: e, disabled: o = !1, brandSlot: s, children: c, onTenantCont
|
|
|
2902
2950
|
v.error(g.stripePaymentClientSecretMissing);
|
|
2903
2951
|
return;
|
|
2904
2952
|
}
|
|
2905
|
-
typeof window < "u" && window.dispatchEvent(new CustomEvent(be, { detail: n })), v.success(g.rechargeOrderCreated), S(!1),
|
|
2953
|
+
typeof window < "u" && window.dispatchEvent(new CustomEvent(be, { detail: n })), v.success(g.rechargeOrderCreated), S(!1), H(n);
|
|
2906
2954
|
} catch (e) {
|
|
2907
|
-
|
|
2955
|
+
ce(g.error, e);
|
|
2908
2956
|
} finally {
|
|
2909
2957
|
R(!1);
|
|
2910
2958
|
}
|
|
2911
|
-
},
|
|
2912
|
-
he(
|
|
2913
|
-
}, [
|
|
2959
|
+
}, de = t(() => {
|
|
2960
|
+
he(ie);
|
|
2961
|
+
}, [ie]), fe = r(() => /* @__PURE__ */ V(_, {
|
|
2914
2962
|
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",
|
|
2915
|
-
selectedKeys:
|
|
2916
|
-
onClickMenuItem:
|
|
2917
|
-
children: [/* @__PURE__ */
|
|
2963
|
+
selectedKeys: W ? [W] : [],
|
|
2964
|
+
onClickMenuItem: le,
|
|
2965
|
+
children: [/* @__PURE__ */ B("div", {
|
|
2918
2966
|
className: "px-3 py-2 text-xs font-semibold tracking-[0.04em] text-arco-text-4 uppercase",
|
|
2919
2967
|
children: g.switchTeam
|
|
2920
|
-
}), O.map((e, t) => /* @__PURE__ */
|
|
2968
|
+
}), O.map((e, t) => /* @__PURE__ */ B(_.Item, {
|
|
2921
2969
|
className: "mb-1 h-auto! min-h-10! overflow-visible! rounded-lg! px-2! py-1! leading-normal!",
|
|
2922
|
-
children: /* @__PURE__ */
|
|
2970
|
+
children: /* @__PURE__ */ V("div", {
|
|
2923
2971
|
className: "flex w-full items-center gap-3 leading-normal",
|
|
2924
|
-
children: [/* @__PURE__ */
|
|
2925
|
-
className:
|
|
2926
|
-
children:
|
|
2927
|
-
}), /* @__PURE__ */
|
|
2972
|
+
children: [/* @__PURE__ */ B("div", {
|
|
2973
|
+
className: dr(t),
|
|
2974
|
+
children: fr(e)
|
|
2975
|
+
}), /* @__PURE__ */ V("div", {
|
|
2928
2976
|
className: "flex min-w-0 flex-col justify-center gap-0.75",
|
|
2929
|
-
children: [/* @__PURE__ */
|
|
2977
|
+
children: [/* @__PURE__ */ B("span", {
|
|
2930
2978
|
className: "text-sm leading-5 font-medium text-arco-text-1",
|
|
2931
2979
|
children: e.tenantName
|
|
2932
|
-
}), /* @__PURE__ */
|
|
2980
|
+
}), /* @__PURE__ */ B("span", {
|
|
2933
2981
|
className: "text-xs leading-4 text-arco-text-3",
|
|
2934
|
-
children:
|
|
2982
|
+
children: pr(e, g.owner, g.member)
|
|
2935
2983
|
})]
|
|
2936
2984
|
})]
|
|
2937
2985
|
})
|
|
2938
2986
|
}, e.tenantId))]
|
|
2939
2987
|
}), [
|
|
2940
|
-
|
|
2941
|
-
|
|
2988
|
+
le,
|
|
2989
|
+
W,
|
|
2942
2990
|
O,
|
|
2943
2991
|
g
|
|
2944
|
-
]),
|
|
2992
|
+
]), pe = /* @__PURE__ */ B(cr, {
|
|
2945
2993
|
user: T,
|
|
2946
|
-
points:
|
|
2994
|
+
points: K,
|
|
2947
2995
|
text: g,
|
|
2948
2996
|
onEditProfile: () => b(!0),
|
|
2949
2997
|
onRecharge: () => S(!0),
|
|
2950
2998
|
onPointsDetail: () => w(!0),
|
|
2951
2999
|
onLogout: Oe
|
|
2952
|
-
}),
|
|
2953
|
-
return /* @__PURE__ */
|
|
3000
|
+
}), me = Math.max(0, O.findIndex((e) => e.tenantId === j?.tenantId));
|
|
3001
|
+
return /* @__PURE__ */ V("div", {
|
|
2954
3002
|
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",
|
|
2955
3003
|
children: [
|
|
2956
|
-
/* @__PURE__ */
|
|
3004
|
+
/* @__PURE__ */ V("div", {
|
|
2957
3005
|
className: "flex items-center gap-6",
|
|
2958
|
-
children: [/* @__PURE__ */
|
|
3006
|
+
children: [/* @__PURE__ */ V("div", {
|
|
2959
3007
|
className: "flex w-65 items-center gap-3 px-8 max-md:w-auto max-md:px-4",
|
|
2960
|
-
children: [/* @__PURE__ */
|
|
3008
|
+
children: [/* @__PURE__ */ B(E, {
|
|
2961
3009
|
content: g.home,
|
|
2962
3010
|
position: "bottom",
|
|
2963
|
-
children: /* @__PURE__ */
|
|
3011
|
+
children: /* @__PURE__ */ B("button", {
|
|
2964
3012
|
type: "button",
|
|
2965
3013
|
"aria-label": g.home,
|
|
2966
3014
|
className: "relative flex w-12 cursor-pointer items-center justify-center overflow-hidden rounded-md border-0 bg-transparent p-0 transition-opacity hover:opacity-80 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-arco-primary-6",
|
|
2967
|
-
onClick:
|
|
2968
|
-
children: /* @__PURE__ */
|
|
2969
|
-
src:
|
|
3015
|
+
onClick: de,
|
|
3016
|
+
children: /* @__PURE__ */ B("img", {
|
|
3017
|
+
src: lr,
|
|
2970
3018
|
alt: "logo",
|
|
2971
3019
|
className: "w-full object-contain",
|
|
2972
3020
|
onError: (e) => {
|
|
@@ -2974,49 +3022,49 @@ function pr({ user: e, disabled: o = !1, brandSlot: s, children: c, onTenantCont
|
|
|
2974
3022
|
}
|
|
2975
3023
|
})
|
|
2976
3024
|
})
|
|
2977
|
-
}), s ?? /* @__PURE__ */
|
|
3025
|
+
}), s ?? /* @__PURE__ */ B("span", {
|
|
2978
3026
|
className: "text-lg font-bold tracking-normal text-arco-text-1",
|
|
2979
3027
|
children: g.title
|
|
2980
3028
|
})]
|
|
2981
|
-
}), /* @__PURE__ */
|
|
2982
|
-
droplist:
|
|
3029
|
+
}), /* @__PURE__ */ B(p, {
|
|
3030
|
+
droplist: fe,
|
|
2983
3031
|
trigger: "click",
|
|
2984
3032
|
position: "bl",
|
|
2985
|
-
disabled:
|
|
2986
|
-
children: /* @__PURE__ */
|
|
2987
|
-
"aria-disabled":
|
|
2988
|
-
className: `flex items-center gap-3 rounded-full border border-arco-border-1 bg-arco-bg-1 px-2 py-1.5 transition-all ${
|
|
3033
|
+
disabled: G,
|
|
3034
|
+
children: /* @__PURE__ */ V("div", {
|
|
3035
|
+
"aria-disabled": G,
|
|
3036
|
+
className: `flex items-center gap-3 rounded-full border border-arco-border-1 bg-arco-bg-1 px-2 py-1.5 transition-all ${G ? "cursor-not-allowed opacity-60" : "cursor-pointer hover:bg-arco-fill-2 hover:shadow-[0_4px_12px_rgb(0_0_0/8%)]"}`,
|
|
2989
3037
|
children: [
|
|
2990
|
-
/* @__PURE__ */ z("div", {
|
|
2991
|
-
className: ur(ge, !0),
|
|
2992
|
-
children: dr(j)
|
|
2993
|
-
}),
|
|
2994
3038
|
/* @__PURE__ */ B("div", {
|
|
3039
|
+
className: dr(me, !0),
|
|
3040
|
+
children: fr(j)
|
|
3041
|
+
}),
|
|
3042
|
+
/* @__PURE__ */ V("div", {
|
|
2995
3043
|
className: "flex min-w-0 flex-col",
|
|
2996
|
-
children: [/* @__PURE__ */
|
|
3044
|
+
children: [/* @__PURE__ */ B("span", {
|
|
2997
3045
|
className: "text-xs leading-none font-bold text-arco-text-1",
|
|
2998
3046
|
children: N ? g.loading : j?.tenantName || g.loading
|
|
2999
|
-
}), /* @__PURE__ */
|
|
3047
|
+
}), /* @__PURE__ */ B("span", {
|
|
3000
3048
|
className: "mt-1 text-[10px] leading-none text-arco-text-3",
|
|
3001
|
-
children:
|
|
3049
|
+
children: pr(j, g.owner, g.member)
|
|
3002
3050
|
})]
|
|
3003
3051
|
}),
|
|
3004
|
-
/* @__PURE__ */
|
|
3052
|
+
/* @__PURE__ */ B(A, { className: "ml-1 text-arco-text-3" })
|
|
3005
3053
|
]
|
|
3006
3054
|
})
|
|
3007
3055
|
})]
|
|
3008
3056
|
}),
|
|
3009
|
-
/* @__PURE__ */
|
|
3057
|
+
/* @__PURE__ */ B("div", {
|
|
3010
3058
|
className: "flex-1",
|
|
3011
3059
|
children: c
|
|
3012
3060
|
}),
|
|
3013
|
-
/* @__PURE__ */
|
|
3061
|
+
/* @__PURE__ */ V("div", {
|
|
3014
3062
|
className: "flex items-center gap-4",
|
|
3015
|
-
children: [/* @__PURE__ */
|
|
3063
|
+
children: [/* @__PURE__ */ V("div", {
|
|
3016
3064
|
className: "flex items-center gap-4",
|
|
3017
|
-
children: [/* @__PURE__ */
|
|
3018
|
-
}), /* @__PURE__ */
|
|
3019
|
-
droplist:
|
|
3065
|
+
children: [/* @__PURE__ */ B(ct, {}), /* @__PURE__ */ B(st, {})]
|
|
3066
|
+
}), /* @__PURE__ */ B(p, {
|
|
3067
|
+
droplist: pe,
|
|
3020
3068
|
trigger: "click",
|
|
3021
3069
|
position: "br",
|
|
3022
3070
|
onVisibleChange: (e) => {
|
|
@@ -3024,61 +3072,61 @@ function pr({ user: e, disabled: o = !1, brandSlot: s, children: c, onTenantCont
|
|
|
3024
3072
|
console.warn("Failed to refresh Mantur user points.", e);
|
|
3025
3073
|
});
|
|
3026
3074
|
},
|
|
3027
|
-
children: /* @__PURE__ */
|
|
3075
|
+
children: /* @__PURE__ */ V("div", {
|
|
3028
3076
|
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",
|
|
3029
3077
|
children: [
|
|
3030
|
-
/* @__PURE__ */
|
|
3078
|
+
/* @__PURE__ */ V("div", {
|
|
3031
3079
|
className: "from-arco-primary to-transparent relative rounded-full bg-linear-to-br p-0.5 shadow-sm",
|
|
3032
|
-
children: [/* @__PURE__ */
|
|
3080
|
+
children: [/* @__PURE__ */ B(Nt, {
|
|
3033
3081
|
user: T,
|
|
3034
3082
|
size: 36
|
|
3035
|
-
}), /* @__PURE__ */
|
|
3083
|
+
}), /* @__PURE__ */ B("div", { className: "bg-arco-success border-arco-bg-white absolute right-0 bottom-0 h-3 w-3 rounded-full border-2 shadow-sm" })]
|
|
3036
3084
|
}),
|
|
3037
|
-
/* @__PURE__ */
|
|
3085
|
+
/* @__PURE__ */ B("div", {
|
|
3038
3086
|
className: "hidden flex-col md:flex",
|
|
3039
|
-
children: /* @__PURE__ */
|
|
3087
|
+
children: /* @__PURE__ */ B("span", {
|
|
3040
3088
|
className: "text-arco-text-1 text-sm font-medium",
|
|
3041
3089
|
children: T?.nickname || T?.username
|
|
3042
3090
|
})
|
|
3043
3091
|
}),
|
|
3044
|
-
/* @__PURE__ */
|
|
3092
|
+
/* @__PURE__ */ B(A, { className: "text-arco-text-3 ml-1" })
|
|
3045
3093
|
]
|
|
3046
3094
|
})
|
|
3047
3095
|
})]
|
|
3048
3096
|
}),
|
|
3049
|
-
/* @__PURE__ */
|
|
3097
|
+
/* @__PURE__ */ B(At, {
|
|
3050
3098
|
visible: y,
|
|
3051
3099
|
user: T,
|
|
3052
3100
|
labels: g,
|
|
3053
3101
|
onCancel: () => b(!1),
|
|
3054
|
-
onSubmit:
|
|
3102
|
+
onSubmit: oe
|
|
3055
3103
|
}),
|
|
3056
|
-
/* @__PURE__ */
|
|
3104
|
+
/* @__PURE__ */ B(It, {
|
|
3057
3105
|
visible: x,
|
|
3058
3106
|
user: T,
|
|
3059
|
-
points:
|
|
3107
|
+
points: K,
|
|
3060
3108
|
text: g,
|
|
3061
|
-
packages:
|
|
3109
|
+
packages: z,
|
|
3062
3110
|
packageLoading: F,
|
|
3063
3111
|
submitting: L,
|
|
3064
3112
|
onCancel: () => S(!1),
|
|
3065
|
-
onPay:
|
|
3113
|
+
onPay: ue
|
|
3066
3114
|
}),
|
|
3067
|
-
/* @__PURE__ */
|
|
3115
|
+
/* @__PURE__ */ B(wt, {
|
|
3068
3116
|
visible: C,
|
|
3069
|
-
points:
|
|
3117
|
+
points: K,
|
|
3070
3118
|
text: g,
|
|
3071
3119
|
onCancel: () => w(!1),
|
|
3072
3120
|
onRecharge: () => S(!0)
|
|
3073
3121
|
}),
|
|
3074
|
-
/* @__PURE__ */
|
|
3122
|
+
/* @__PURE__ */ B(sr, {
|
|
3075
3123
|
visible: !!te,
|
|
3076
|
-
publishableKey:
|
|
3124
|
+
publishableKey: re,
|
|
3077
3125
|
order: te,
|
|
3078
3126
|
text: g,
|
|
3079
|
-
onCancel: () =>
|
|
3127
|
+
onCancel: () => H(void 0),
|
|
3080
3128
|
onSuccess: () => {
|
|
3081
|
-
v.success(g.rechargeSuccess),
|
|
3129
|
+
v.success(g.rechargeSuccess), H(void 0), Me().catch((e) => {
|
|
3082
3130
|
console.warn("Failed to refresh Mantur user points.", e);
|
|
3083
3131
|
});
|
|
3084
3132
|
}
|
|
@@ -3088,44 +3136,44 @@ function pr({ user: e, disabled: o = !1, brandSlot: s, children: c, onTenantCont
|
|
|
3088
3136
|
}
|
|
3089
3137
|
//#endregion
|
|
3090
3138
|
//#region src/utils/stripe-payment-window.ts
|
|
3091
|
-
var
|
|
3092
|
-
function
|
|
3139
|
+
var hr = "mantur-stripe-payment-window", gr = "/stripe-payment";
|
|
3140
|
+
function _r(e) {
|
|
3093
3141
|
if (!e || typeof e != "object") return !1;
|
|
3094
3142
|
let t = e;
|
|
3095
3143
|
return t.source === "mantur-components" && t.type === "mantur-stripe-payment-window" && (t.action === "close" || t.action === "success" || t.action === "failed");
|
|
3096
3144
|
}
|
|
3097
|
-
function
|
|
3145
|
+
function vr(e = "close", t, n = typeof window > "u" ? void 0 : window.location.origin) {
|
|
3098
3146
|
if (typeof window > "u" || !n) return;
|
|
3099
3147
|
let r = {
|
|
3100
3148
|
source: "mantur-components",
|
|
3101
|
-
type:
|
|
3149
|
+
type: hr,
|
|
3102
3150
|
action: e,
|
|
3103
3151
|
orderNo: t
|
|
3104
3152
|
};
|
|
3105
3153
|
window.opener?.postMessage(r, n), window.parent && window.parent !== window && window.parent.postMessage(r, n);
|
|
3106
3154
|
}
|
|
3107
|
-
function
|
|
3155
|
+
function yr() {
|
|
3108
3156
|
return typeof window > "u" ? void 0 : window.__MANTUR_MAIN_PREFIX__ || void 0;
|
|
3109
3157
|
}
|
|
3110
|
-
function
|
|
3158
|
+
function br() {
|
|
3111
3159
|
return typeof window > "u" ? "mantur" : window.__MANTUR_APP_NAME__ || "mantur";
|
|
3112
3160
|
}
|
|
3113
|
-
function
|
|
3161
|
+
function xr(e, t) {
|
|
3114
3162
|
let n = e.split(".");
|
|
3115
3163
|
return n.length <= 1 ? t : [t, ...n.slice(1)].join(".");
|
|
3116
3164
|
}
|
|
3117
|
-
function
|
|
3118
|
-
let t = new URL(e.toString()), n =
|
|
3119
|
-
return n &&
|
|
3165
|
+
function Sr(e) {
|
|
3166
|
+
let t = new URL(e.toString()), n = yr()?.trim();
|
|
3167
|
+
return n && br() !== "mantur" && (t.hostname = xr(e.hostname, n)), t.port = "", t.toString();
|
|
3120
3168
|
}
|
|
3121
|
-
function
|
|
3169
|
+
function Cr(e, t = {}) {
|
|
3122
3170
|
let n = e.clientSecret || e.stripeClientSecret;
|
|
3123
3171
|
if (typeof window > "u" || !e.orderNo || !n) return;
|
|
3124
|
-
let r = new URL(
|
|
3125
|
-
return r.searchParams.set("orderNo", e.orderNo), r.searchParams.set("clientSecret", n), r.searchParams.set("openerOrigin", window.location.origin), r.searchParams.set("app", a), r.searchParams.set("redirect", o), e.amount !== void 0 && r.searchParams.set("amount", String(e.amount)), e.points !== void 0 && r.searchParams.set("points", String(e.points)), t.stripePublishableKey && r.searchParams.set("publishableKey", t.stripePublishableKey),
|
|
3172
|
+
let r = new URL(gr, window.location.href), i = pe(), a = t.app || i.app, o = t.redirect || i.redirect;
|
|
3173
|
+
return r.searchParams.set("orderNo", e.orderNo), r.searchParams.set("clientSecret", n), r.searchParams.set("openerOrigin", window.location.origin), r.searchParams.set("app", a), r.searchParams.set("redirect", o), e.amount !== void 0 && r.searchParams.set("amount", String(e.amount)), e.points !== void 0 && r.searchParams.set("points", String(e.points)), t.stripePublishableKey && r.searchParams.set("publishableKey", t.stripePublishableKey), Sr(r);
|
|
3126
3174
|
}
|
|
3127
|
-
function
|
|
3128
|
-
return
|
|
3175
|
+
function wr(e, t = {}) {
|
|
3176
|
+
return Cr(e, t) || e.paymentUrl || e.checkoutUrl || e.url || e.returnUrl;
|
|
3129
3177
|
}
|
|
3130
3178
|
//#endregion
|
|
3131
|
-
export { ye as MANTUR_POINTS_REFRESH_EVENT, be as MANTUR_RECHARGE_ORDER_CREATED_EVENT,
|
|
3179
|
+
export { ye as MANTUR_POINTS_REFRESH_EVENT, be as MANTUR_RECHARGE_ORDER_CREATED_EVENT, gr as MANTUR_STRIPE_PAYMENT_ROUTE, hr as MANTUR_STRIPE_PAYMENT_WINDOW_MESSAGE_TYPE, xe as MANTUR_TENANT_CONTEXT_CHANGE_EVENT, mr as ManturHeader, Ie as cancelManturRechargeOrder, Pe as createManturRechargeOrder, ut as formatDateByLang, ze as getManturBillingAccount, Be as getManturBillingLedger, Ne as getManturBillingPackages, Re as getManturPricingChargePoint, Le as getManturPricingChargePoints, Fe as getManturRechargeOrder, pe as getManturRechargeRedirectContext, _r as isManturStripePaymentWindowMessage, vr as postManturStripePaymentWindowMessage, ge as redirectToManturMain, he as redirectToManturMainHome, Ke as refreshManturTenantContext, Me as refreshManturUserPoints, me as resolveManturMainHomeUrl, wr as resolveManturRechargePaymentPageUrl, Cr as resolveManturStripePaymentPageUrl };
|