@24city/web-console 0.3.7 → 0.3.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +27 -0
- package/GUIDELINES.md +15 -0
- package/README.md +3 -3
- package/dist/account/account-api.d.ts +7 -0
- package/dist/account/index.d.ts +1 -0
- package/dist/account/index.js +60 -59
- package/dist/account/use-show-once.d.ts +26 -0
- package/dist/chunks/{auth-provider-CqiyTeOt.js → auth-provider-7FOj7Y84.js} +1 -1
- package/dist/chunks/{console-layout-Os4sQzMP.js → console-layout-B4OlW1IZ.js} +1 -1
- package/dist/chunks/logout-signal-CLdquzzn.js +378 -0
- package/dist/chunks/{stale-build-DG-Tb2RA.js → stale-build-DwUlkKYm.js} +2 -2
- package/dist/chunks/text-link-WWzQqJ14.js +196 -0
- package/dist/chunks/use-show-once-Bz1ojVqb.js +768 -0
- package/dist/chunks/{wallet-badge-Dt8fv-Du.js → wallet-badge-COpdEDYI.js} +1 -1
- package/dist/index.js +190 -188
- package/dist/layout/index.js +1 -1
- package/dist/page/guide-modal.d.ts +37 -0
- package/dist/page/index.d.ts +1 -0
- package/dist/page/index.js +22 -21
- package/dist/runtime/index.js +2 -2
- package/dist/styles.css +167 -0
- package/dist/testing/fixtures.js +33 -27
- package/package.json +1 -1
- package/dist/chunks/logout-signal-CiD_zY5M.js +0 -365
- package/dist/chunks/text-link-Bb5f1eLW.js +0 -106
- package/dist/chunks/upgrade-modal-DyPkV9OB.js +0 -713
|
@@ -0,0 +1,378 @@
|
|
|
1
|
+
import { sanitizeInternalReturnPath as I } from "@24city/web-runtime/core/internal-path";
|
|
2
|
+
import { createContext as _, useSyncExternalStore as x, useContext as F } from "react";
|
|
3
|
+
import { summarizeCustomerError as z } from "@24city/web-runtime/error-summary";
|
|
4
|
+
const C = (t) => t.includes("\\") || [...t].some((e) => {
|
|
5
|
+
const o = e.charCodeAt(0);
|
|
6
|
+
return o <= 31 || o === 127;
|
|
7
|
+
}), at = (t) => !C(t) && t.startsWith("/") && !t.startsWith("//") && (() => {
|
|
8
|
+
try {
|
|
9
|
+
const e = new URL(t, "https://product.invalid");
|
|
10
|
+
return e.origin === "https://product.invalid" && I(t, e.pathname) === t;
|
|
11
|
+
} catch {
|
|
12
|
+
return !1;
|
|
13
|
+
}
|
|
14
|
+
})(), it = (t, e) => !C(t) && I(t, e) === t, M = (t, e) => !t || C(t) ? e : I(t, e), O = (t) => typeof t == "object" && t !== null && !Array.isArray(t), l = (t, e) => {
|
|
15
|
+
const o = e.data;
|
|
16
|
+
if (!O(o) || o.code !== 0 || !("data" in o))
|
|
17
|
+
throw new Error(`接口 ${t} 返回了无效响应`);
|
|
18
|
+
return o.data;
|
|
19
|
+
}, u = (t, e, o) => {
|
|
20
|
+
if (!O(t)) throw new Error(`接口 ${e} 字段 ${o} 无效`);
|
|
21
|
+
return t;
|
|
22
|
+
}, s = (t, e, o) => {
|
|
23
|
+
const r = t[e];
|
|
24
|
+
if (typeof r != "string" || !r.trim())
|
|
25
|
+
throw new Error(`接口 ${o} 字段 ${e} 无效`);
|
|
26
|
+
return r;
|
|
27
|
+
}, f = (t, e, o) => {
|
|
28
|
+
const r = t[e];
|
|
29
|
+
if (typeof r != "number" || !Number.isSafeInteger(r) || r < 0)
|
|
30
|
+
throw new Error(`接口 ${o} 字段 ${e} 无效`);
|
|
31
|
+
return r;
|
|
32
|
+
}, g = "/account", c = `${g}/session`, $ = `${g}/logout`, i = `${g}/spaces`, T = `${i}/switch`, E = `${g}/profile`, h = `${g}/wallet`, P = `${g}/entitlements`, p = `${g}/subscription`, a = `${g}/plans`, y = `${g}/shown-prompts`, A = (t, e, o) => {
|
|
33
|
+
const r = t[e];
|
|
34
|
+
if (r !== null && typeof r != "string")
|
|
35
|
+
throw new Error(`接口 ${o} 字段 ${e} 无效`);
|
|
36
|
+
return r;
|
|
37
|
+
}, S = (t, e, o) => {
|
|
38
|
+
const r = t[e];
|
|
39
|
+
if (r != null) {
|
|
40
|
+
if (typeof r != "string")
|
|
41
|
+
throw new Error(`接口 ${o} 字段 ${e} 无效`);
|
|
42
|
+
return r;
|
|
43
|
+
}
|
|
44
|
+
}, W = (t, e, o) => {
|
|
45
|
+
const r = t[e];
|
|
46
|
+
return r === null ? {} : u(r, o, e);
|
|
47
|
+
}, q = (t) => {
|
|
48
|
+
const e = u(t, $, "data"), o = S(e, "endSessionUrl", $);
|
|
49
|
+
if (!o) return null;
|
|
50
|
+
try {
|
|
51
|
+
return new URL(o).protocol === "https:" ? o : null;
|
|
52
|
+
} catch {
|
|
53
|
+
return null;
|
|
54
|
+
}
|
|
55
|
+
}, D = (t) => {
|
|
56
|
+
const e = u(t, c, "data");
|
|
57
|
+
if (e.purpose !== "user") throw new Error("产品用户 Web 只接受 user Purpose 会话");
|
|
58
|
+
return {
|
|
59
|
+
globalUserId: s(e, "globalUserId", c),
|
|
60
|
+
localUserId: f(e, "localUserId", c),
|
|
61
|
+
activeSpaceId: s(e, "activeSpaceId", c),
|
|
62
|
+
authorityId: f(e, "authorityId", c),
|
|
63
|
+
orgId: f(e, "orgId", c),
|
|
64
|
+
purpose: "user",
|
|
65
|
+
csrfToken: s(e, "csrfToken", c),
|
|
66
|
+
issuedAt: s(e, "issuedAt", c),
|
|
67
|
+
lastSeenAt: s(e, "lastSeenAt", c),
|
|
68
|
+
absoluteExpiresAt: s(e, "absoluteExpiresAt", c),
|
|
69
|
+
lastCentralVerifiedAt: s(e, "lastCentralVerifiedAt", c),
|
|
70
|
+
accountCenterUrl: s(e, "accountCenterUrl", c)
|
|
71
|
+
};
|
|
72
|
+
}, U = (t, e, o) => {
|
|
73
|
+
const r = u(t, e, o);
|
|
74
|
+
return {
|
|
75
|
+
id: s(r, "id", e),
|
|
76
|
+
entitlementCode: s(r, "entitlementCode", e),
|
|
77
|
+
status: S(r, "status", e),
|
|
78
|
+
startsAt: s(r, "startsAt", e),
|
|
79
|
+
expiresAt: A(r, "expiresAt", e),
|
|
80
|
+
metadata: W(r, "metadata", e)
|
|
81
|
+
};
|
|
82
|
+
}, k = (t, e) => {
|
|
83
|
+
const o = u(t, i, `spaces[${e}]`), r = u(o.entitlementSummary, i, "entitlementSummary"), n = r.codes, d = o.entitlements;
|
|
84
|
+
if (!Array.isArray(n) || n.some((b) => typeof b != "string"))
|
|
85
|
+
throw new Error(`接口 ${i} 字段 entitlementSummary.codes 无效`);
|
|
86
|
+
if (!Array.isArray(d))
|
|
87
|
+
throw new Error(`接口 ${i} 字段 entitlements 无效`);
|
|
88
|
+
return {
|
|
89
|
+
id: s(o, "id", i),
|
|
90
|
+
name: s(o, "name", i),
|
|
91
|
+
slug: s(o, "slug", i),
|
|
92
|
+
type: s(o, "type", i),
|
|
93
|
+
role: s(o, "role", i),
|
|
94
|
+
status: s(o, "status", i),
|
|
95
|
+
membershipStatus: s(o, "membershipStatus", i),
|
|
96
|
+
entitlementSummary: {
|
|
97
|
+
activeCount: f(r, "activeCount", i),
|
|
98
|
+
codes: [...n]
|
|
99
|
+
},
|
|
100
|
+
entitlements: d.map(
|
|
101
|
+
(b, m) => U(b, i, `entitlements[${m}]`)
|
|
102
|
+
)
|
|
103
|
+
};
|
|
104
|
+
}, B = (t) => {
|
|
105
|
+
const e = u(t, i, "data"), o = s(e, "activeSpaceId", i);
|
|
106
|
+
if (!Array.isArray(e.spaces)) throw new Error(`接口 ${i} 字段 spaces 无效`);
|
|
107
|
+
const r = e.spaces.map(k);
|
|
108
|
+
if (!r.some((n) => n.id === o))
|
|
109
|
+
throw new Error(`接口 ${i} 的当前空间不在可用空间列表中`);
|
|
110
|
+
return { activeSpaceId: o, spaces: r };
|
|
111
|
+
}, H = (t) => {
|
|
112
|
+
const e = u(t, E, "data");
|
|
113
|
+
return { nickName: (S(e, "nickName", E) ?? "").trim() };
|
|
114
|
+
}, V = (t) => {
|
|
115
|
+
const e = u(t, h, "data"), o = (r) => {
|
|
116
|
+
const n = e[r];
|
|
117
|
+
if (typeof n != "number" || !Number.isSafeInteger(n))
|
|
118
|
+
throw new Error(`接口 ${h} 字段 ${r} 无效`);
|
|
119
|
+
return n;
|
|
120
|
+
};
|
|
121
|
+
return {
|
|
122
|
+
spaceId: s(e, "spaceId", h),
|
|
123
|
+
globalUserId: s(e, "globalUserId", h),
|
|
124
|
+
productCode: s(e, "productCode", h),
|
|
125
|
+
availablePoints: o("availablePoints"),
|
|
126
|
+
reservedPoints: o("reservedPoints"),
|
|
127
|
+
globalAvailablePoints: o("globalAvailablePoints"),
|
|
128
|
+
globalReservedPoints: o("globalReservedPoints"),
|
|
129
|
+
productAvailablePoints: o("productAvailablePoints"),
|
|
130
|
+
productReservedPoints: o("productReservedPoints"),
|
|
131
|
+
walletAvailablePoints: o("walletAvailablePoints"),
|
|
132
|
+
walletReservedPoints: o("walletReservedPoints"),
|
|
133
|
+
walletVersion: f(e, "walletVersion", h)
|
|
134
|
+
};
|
|
135
|
+
}, j = (t) => {
|
|
136
|
+
if (t === null) return null;
|
|
137
|
+
const e = u(t, p, "data"), o = e.tier;
|
|
138
|
+
if (typeof o != "number" || !Number.isSafeInteger(o))
|
|
139
|
+
throw new Error(`接口 ${p} 字段 tier 无效`);
|
|
140
|
+
if (typeof e.isDefault != "boolean")
|
|
141
|
+
throw new Error(`接口 ${p} 字段 isDefault 无效`);
|
|
142
|
+
return {
|
|
143
|
+
subscriptionId: A(e, "subscriptionId", p),
|
|
144
|
+
planCode: s(e, "planCode", p),
|
|
145
|
+
planName: (S(e, "planName", p) ?? "").trim(),
|
|
146
|
+
tier: o,
|
|
147
|
+
isDefault: e.isDefault,
|
|
148
|
+
spaceType: S(e, "spaceType", p) ?? "",
|
|
149
|
+
currentPeriodEnd: A(e, "currentPeriodEnd", p)
|
|
150
|
+
};
|
|
151
|
+
}, G = /* @__PURE__ */ new Set(["month", "year", "one_time"]), K = (t, e) => {
|
|
152
|
+
const o = u(t, a, e), r = s(o, "billingPeriod", a);
|
|
153
|
+
if (!G.has(r)) throw new Error(`接口 ${a} 字段 ${e}.billingPeriod 无效`);
|
|
154
|
+
return {
|
|
155
|
+
code: s(o, "code", a),
|
|
156
|
+
amountCents: f(o, "amountCents", a),
|
|
157
|
+
currency: s(o, "currency", a),
|
|
158
|
+
billingPeriod: r,
|
|
159
|
+
durationDays: f(o, "durationDays", a),
|
|
160
|
+
pointCycles: f(o, "pointCycles", a)
|
|
161
|
+
};
|
|
162
|
+
}, X = (t, e) => {
|
|
163
|
+
const o = u(t, a, e), r = o.limit;
|
|
164
|
+
if (r != null && (typeof r != "number" || !Number.isSafeInteger(r) || r < 0))
|
|
165
|
+
throw new Error(`接口 ${a} 字段 ${e}.limit 无效`);
|
|
166
|
+
const n = Array.isArray(o.discounts) ? o.discounts.filter((d) => typeof d == "string") : [];
|
|
167
|
+
return {
|
|
168
|
+
key: S(o, "key", a) ?? "",
|
|
169
|
+
name: s(o, "name", a),
|
|
170
|
+
description: S(o, "description", a) ?? "",
|
|
171
|
+
limit: typeof r == "number" ? r : null,
|
|
172
|
+
discounts: n
|
|
173
|
+
};
|
|
174
|
+
}, Y = (t, e) => {
|
|
175
|
+
const o = `data[${e}]`, r = u(t, a, o), n = s(r, "spaceType", a);
|
|
176
|
+
if (n !== "personal" && n !== "team") throw new Error(`接口 ${a} 字段 ${o}.spaceType 无效`);
|
|
177
|
+
if (typeof r.tier != "number" || !Number.isSafeInteger(r.tier)) throw new Error(`接口 ${a} 字段 ${o}.tier 无效`);
|
|
178
|
+
if (typeof r.isDefault != "boolean") throw new Error(`接口 ${a} 字段 ${o}.isDefault 无效`);
|
|
179
|
+
if (!Array.isArray(r.prices)) throw new Error(`接口 ${a} 字段 ${o}.prices 无效`);
|
|
180
|
+
const d = Array.isArray(r.benefits) ? r.benefits : [], b = Array.isArray(r.otherProducts) ? r.otherProducts.filter((m) => typeof m == "string" && m.trim() !== "").map((m) => m.trim()) : [];
|
|
181
|
+
return {
|
|
182
|
+
code: s(r, "code", a),
|
|
183
|
+
name: s(r, "name", a).trim(),
|
|
184
|
+
spaceType: n,
|
|
185
|
+
tier: r.tier,
|
|
186
|
+
isDefault: r.isDefault,
|
|
187
|
+
includedSeats: f(r, "includedSeats", a),
|
|
188
|
+
monthlyPoints: f(r, "monthlyPoints", a),
|
|
189
|
+
prices: r.prices.map((m, N) => K(m, `${o}.prices[${N}]`)),
|
|
190
|
+
benefits: d.map((m, N) => X(m, `${o}.benefits[${N}]`)),
|
|
191
|
+
otherProducts: b
|
|
192
|
+
};
|
|
193
|
+
}, L = (t, e) => {
|
|
194
|
+
const o = u(t, y, "data")[e];
|
|
195
|
+
if (!Array.isArray(o) || o.some((r) => typeof r != "string"))
|
|
196
|
+
throw new Error(`接口 ${y} 字段 ${e} 无效`);
|
|
197
|
+
return [...o];
|
|
198
|
+
}, J = (t) => {
|
|
199
|
+
if (!Array.isArray(t)) throw new Error(`接口 ${a} 字段 data 无效`);
|
|
200
|
+
return t.map(Y);
|
|
201
|
+
}, ct = (t, e) => {
|
|
202
|
+
const o = e === "/" ? "" : e;
|
|
203
|
+
return {
|
|
204
|
+
startLogin(r, n) {
|
|
205
|
+
const d = M(r, n);
|
|
206
|
+
return `${o}${g}/startLogin?returnPath=${encodeURIComponent(d)}`;
|
|
207
|
+
},
|
|
208
|
+
async getSession() {
|
|
209
|
+
return D(l(c, await t.get(c)));
|
|
210
|
+
},
|
|
211
|
+
async getSpaces() {
|
|
212
|
+
return B(l(i, await t.get(i)));
|
|
213
|
+
},
|
|
214
|
+
async switchSpace(r) {
|
|
215
|
+
const n = l(T, await t.post(T, { globalSpaceId: r }));
|
|
216
|
+
return D(n);
|
|
217
|
+
},
|
|
218
|
+
async getProfile() {
|
|
219
|
+
return H(l(E, await t.get(E)));
|
|
220
|
+
},
|
|
221
|
+
async getWallet() {
|
|
222
|
+
return V(l(h, await t.get(h)));
|
|
223
|
+
},
|
|
224
|
+
async getEntitlements() {
|
|
225
|
+
const r = l(P, await t.get(P));
|
|
226
|
+
if (!Array.isArray(r)) throw new Error(`接口 ${P} 字段 data 无效`);
|
|
227
|
+
return r.map((n, d) => U(n, P, `entitlements[${d}]`));
|
|
228
|
+
},
|
|
229
|
+
async getSubscription() {
|
|
230
|
+
return j(l(p, await t.get(p)));
|
|
231
|
+
},
|
|
232
|
+
async getPlans() {
|
|
233
|
+
return J(l(a, await t.get(a)));
|
|
234
|
+
},
|
|
235
|
+
async logout() {
|
|
236
|
+
const r = l($, await t.post($));
|
|
237
|
+
return { endSessionUrl: q(r) };
|
|
238
|
+
},
|
|
239
|
+
async getShownPrompts(r) {
|
|
240
|
+
const n = await t.get(y, { params: { keys: r.join(",") } });
|
|
241
|
+
return L(l(y, n), "shown");
|
|
242
|
+
},
|
|
243
|
+
async claimShownPrompts(r) {
|
|
244
|
+
const n = await t.post(y, { keys: [...r] });
|
|
245
|
+
return L(l(y, n), "claimed");
|
|
246
|
+
}
|
|
247
|
+
};
|
|
248
|
+
}, ut = async (t) => {
|
|
249
|
+
let e = await t.getSession();
|
|
250
|
+
const o = await t.getSpaces();
|
|
251
|
+
if (o.activeSpaceId !== e.activeSpaceId && (e = await t.getSession()), o.activeSpaceId !== e.activeSpaceId)
|
|
252
|
+
throw new Error("产品会话与统一空间上下文不一致");
|
|
253
|
+
return { session: e, spaces: o.spaces };
|
|
254
|
+
}, lt = (t) => t == null || !Number.isFinite(t) ? "暂无" : t >= 1e8 ? `${(Math.floor(t / 1e7) / 10).toFixed(1)}亿` : t >= 1e4 ? `${(Math.floor(t / 1e3) / 10).toFixed(1)}万` : t.toLocaleString("zh-CN"), dt = (t) => t.toLocaleString("zh-CN", { maximumFractionDigits: 0 }), mt = (t) => t > 0 && t < 0.01 ? "<0.01" : t.toLocaleString("zh-CN", { maximumFractionDigits: 2 }), pt = (t) => t ? `¥${(t / 100).toLocaleString("zh-CN", { minimumFractionDigits: 2, maximumFractionDigits: 2 })}` : "暂无", ft = (t) => {
|
|
255
|
+
if (t === void 0 || t <= 0) return "";
|
|
256
|
+
const e = Math.floor(t / 60), o = Math.floor(t % 60);
|
|
257
|
+
return `${e}:${String(o).padStart(2, "0")}`;
|
|
258
|
+
}, gt = (t) => {
|
|
259
|
+
if (t === void 0 || t <= 0) return "暂无";
|
|
260
|
+
const e = Math.floor(t / 3600), o = Math.floor(t % 3600 / 60), r = t % 60;
|
|
261
|
+
return e > 0 ? `${e}小时${o}分` : o > 0 ? `${o}分${r}秒` : `${r}秒`;
|
|
262
|
+
}, wt = (t) => {
|
|
263
|
+
const e = new Date(t);
|
|
264
|
+
return Number.isNaN(e.getTime()) ? "暂无" : new Intl.DateTimeFormat("zh-CN", { dateStyle: "short", timeStyle: "short" }).format(e);
|
|
265
|
+
}, ht = (t) => {
|
|
266
|
+
if (!t) return "长期有效";
|
|
267
|
+
const e = new Date(t);
|
|
268
|
+
return Number.isNaN(e.getTime()) ? "暂无" : new Intl.DateTimeFormat("zh-CN", { dateStyle: "medium" }).format(e);
|
|
269
|
+
}, Q = () => ({
|
|
270
|
+
session: null,
|
|
271
|
+
spaces: [],
|
|
272
|
+
bootstrapped: !1,
|
|
273
|
+
serviceUnavailable: !1
|
|
274
|
+
}), St = () => {
|
|
275
|
+
let t = Q();
|
|
276
|
+
const e = /* @__PURE__ */ new Set(), o = (r) => {
|
|
277
|
+
t = r, e.forEach((n) => n());
|
|
278
|
+
};
|
|
279
|
+
return {
|
|
280
|
+
subscribe(r) {
|
|
281
|
+
return e.add(r), () => e.delete(r);
|
|
282
|
+
},
|
|
283
|
+
getState: () => t,
|
|
284
|
+
getCsrfToken: () => {
|
|
285
|
+
var r;
|
|
286
|
+
return ((r = t.session) == null ? void 0 : r.csrfToken) ?? null;
|
|
287
|
+
},
|
|
288
|
+
setContext(r) {
|
|
289
|
+
o({ session: r.session, spaces: [...r.spaces], bootstrapped: !0, serviceUnavailable: !1 });
|
|
290
|
+
},
|
|
291
|
+
setBootstrapping() {
|
|
292
|
+
o({ ...t, bootstrapped: !1, serviceUnavailable: !1 });
|
|
293
|
+
},
|
|
294
|
+
clear(r = {}) {
|
|
295
|
+
o({ session: null, spaces: [], bootstrapped: !0, serviceUnavailable: r.unavailable ?? !1 });
|
|
296
|
+
}
|
|
297
|
+
};
|
|
298
|
+
}, R = _(null), yt = R.Provider, Z = () => {
|
|
299
|
+
const t = F(R);
|
|
300
|
+
if (!t) throw new Error("AuthStoreProvider 尚未初始化");
|
|
301
|
+
return t;
|
|
302
|
+
}, bt = () => {
|
|
303
|
+
const t = Z();
|
|
304
|
+
return x(t.subscribe, t.getState, t.getState);
|
|
305
|
+
}, Pt = (t) => t instanceof Error && t.message.trim() ? t.message : "请稍后重试;如问题持续,请联系管理员。", $t = (t, e) => z(t).status === e, v = "24city.console.logout-at", tt = 15e3;
|
|
306
|
+
let w = null;
|
|
307
|
+
const et = () => {
|
|
308
|
+
try {
|
|
309
|
+
return Number(window.localStorage.getItem(v) ?? Number.NaN);
|
|
310
|
+
} catch {
|
|
311
|
+
return Number.NaN;
|
|
312
|
+
}
|
|
313
|
+
};
|
|
314
|
+
function Et(t = Date.now()) {
|
|
315
|
+
try {
|
|
316
|
+
window.localStorage.setItem(v, String(t));
|
|
317
|
+
} catch {
|
|
318
|
+
}
|
|
319
|
+
}
|
|
320
|
+
function rt() {
|
|
321
|
+
try {
|
|
322
|
+
window.localStorage.removeItem(v);
|
|
323
|
+
} catch {
|
|
324
|
+
}
|
|
325
|
+
}
|
|
326
|
+
function Nt() {
|
|
327
|
+
w = "leaving";
|
|
328
|
+
}
|
|
329
|
+
function At() {
|
|
330
|
+
return w === "leaving";
|
|
331
|
+
}
|
|
332
|
+
function It(t = Date.now()) {
|
|
333
|
+
if (w === "leaving") return !1;
|
|
334
|
+
const e = t - et();
|
|
335
|
+
return e >= 0 && e < tt && (w = "logged-out"), w === "logged-out";
|
|
336
|
+
}
|
|
337
|
+
function Ct() {
|
|
338
|
+
return w === "logged-out";
|
|
339
|
+
}
|
|
340
|
+
function vt() {
|
|
341
|
+
w === "logged-out" && (w = null);
|
|
342
|
+
}
|
|
343
|
+
function Tt() {
|
|
344
|
+
w = null, rt();
|
|
345
|
+
}
|
|
346
|
+
export {
|
|
347
|
+
yt as A,
|
|
348
|
+
s as B,
|
|
349
|
+
M as C,
|
|
350
|
+
Pt as D,
|
|
351
|
+
l as E,
|
|
352
|
+
Et as a,
|
|
353
|
+
St as b,
|
|
354
|
+
ct as c,
|
|
355
|
+
Ct as d,
|
|
356
|
+
Tt as e,
|
|
357
|
+
ut as f,
|
|
358
|
+
Z as g,
|
|
359
|
+
mt as h,
|
|
360
|
+
At as i,
|
|
361
|
+
ft as j,
|
|
362
|
+
ht as k,
|
|
363
|
+
Nt as l,
|
|
364
|
+
wt as m,
|
|
365
|
+
It as n,
|
|
366
|
+
gt as o,
|
|
367
|
+
lt as p,
|
|
368
|
+
dt as q,
|
|
369
|
+
vt as r,
|
|
370
|
+
pt as s,
|
|
371
|
+
$t as t,
|
|
372
|
+
bt as u,
|
|
373
|
+
it as v,
|
|
374
|
+
rt as w,
|
|
375
|
+
at as x,
|
|
376
|
+
f as y,
|
|
377
|
+
u as z
|
|
378
|
+
};
|
|
@@ -2,8 +2,8 @@ import { jsx as t } from "react/jsx-runtime";
|
|
|
2
2
|
import { QueryClient as c, QueryClientProvider as l } from "@tanstack/react-query";
|
|
3
3
|
import { useMemo as i } from "react";
|
|
4
4
|
import { CustomerRuntimeConfigProvider as f } from "@24city/web-runtime/runtime-config-provider";
|
|
5
|
-
import { A as d } from "./auth-provider-
|
|
6
|
-
import { b as m, A as p } from "./logout-signal-
|
|
5
|
+
import { A as d } from "./auth-provider-7FOj7Y84.js";
|
|
6
|
+
import { b as m, A as p } from "./logout-signal-CLdquzzn.js";
|
|
7
7
|
import { U as C, E as y } from "./unsupported-browser-Dwq1mNRy.js";
|
|
8
8
|
import { C as h } from "./context-CaVim6ZO.js";
|
|
9
9
|
import { parseCustomerRuntimeConfig as R, loadCustomerRuntimeConfig as v } from "@24city/web-runtime/core/runtime-config";
|
|
@@ -0,0 +1,196 @@
|
|
|
1
|
+
import { jsxs as h, jsx as e, Fragment as E } from "react/jsx-runtime";
|
|
2
|
+
import { Button as f, Typography as y, Modal as O } from "@douyinfe/semi-ui";
|
|
3
|
+
import { IconClose as R } from "@douyinfe/semi-icons";
|
|
4
|
+
import { useState as F, useId as j, useEffect as B, isValidElement as L, cloneElement as P, forwardRef as G } from "react";
|
|
5
|
+
import { u as H } from "./use-media-query-DvyinWNg.js";
|
|
6
|
+
import { useNavigate as Q } from "react-router";
|
|
7
|
+
import { b as V } from "./context-CaVim6ZO.js";
|
|
8
|
+
import { F as M, e as z } from "./page-YBG0dEN1.js";
|
|
9
|
+
const q = "_title_euw1b_10", A = "_medium_euw1b_21", D = "_small_euw1b_26", J = "_index_euw1b_31", U = "_hero_euw1b_43", W = "_head_euw1b_49", X = "_withSheet_euw1b_60", Y = "_bar_euw1b_64", Z = "_toolbar_euw1b_75", K = "_close_euw1b_82", ee = "_heroTitle_euw1b_87", te = "_description_euw1b_96", ne = "_subject_euw1b_103", oe = "_sheet_euw1b_110", ae = "_modalContent_euw1b_118", r = {
|
|
10
|
+
title: q,
|
|
11
|
+
medium: A,
|
|
12
|
+
small: D,
|
|
13
|
+
index: J,
|
|
14
|
+
hero: U,
|
|
15
|
+
head: W,
|
|
16
|
+
withSheet: X,
|
|
17
|
+
bar: Y,
|
|
18
|
+
toolbar: Z,
|
|
19
|
+
close: K,
|
|
20
|
+
heroTitle: ee,
|
|
21
|
+
description: te,
|
|
22
|
+
subject: ne,
|
|
23
|
+
sheet: oe,
|
|
24
|
+
modalContent: ae
|
|
25
|
+
}, I = (...n) => n.filter(Boolean).join(" "), se = ({ children: n, size: t = "large", level: s = 2, className: d }) => /* @__PURE__ */ e(y.Title, { heading: s, className: I(r.title, t === "large" ? void 0 : r[t], d), children: n }), Ee = ({ value: n, className: t }) => /* @__PURE__ */ e("span", { className: I(r.index, t), "aria-hidden": "true", children: String(n).padStart(2, "0") }), Oe = ({ title: n, description: t, toolbar: s, onClose: d, closeLabel: w = "关闭", subject: _, level: u = 2, className: p, children: m }) => {
|
|
26
|
+
const i = m != null && m !== !1;
|
|
27
|
+
return /* @__PURE__ */ h("div", { className: I(r.hero, i ? r.withSheet : void 0, p), children: [
|
|
28
|
+
/* @__PURE__ */ h("div", { className: r.head, children: [
|
|
29
|
+
s || d ? /* @__PURE__ */ h("div", { className: r.bar, children: [
|
|
30
|
+
/* @__PURE__ */ e("div", { className: r.toolbar, children: s }),
|
|
31
|
+
d ? /* @__PURE__ */ e(f, { theme: "borderless", type: "tertiary", className: r.close, icon: /* @__PURE__ */ e(R, {}), "aria-label": w, onClick: d }) : null
|
|
32
|
+
] }) : null,
|
|
33
|
+
/* @__PURE__ */ e(se, { level: u, className: r.heroTitle, children: n }),
|
|
34
|
+
t ? /* @__PURE__ */ e(y.Paragraph, { className: r.description, children: t }) : null,
|
|
35
|
+
_ ? /* @__PURE__ */ e("div", { className: r.subject, children: _ }) : null
|
|
36
|
+
] }),
|
|
37
|
+
i ? /* @__PURE__ */ e("div", { className: r.sheet, children: m }) : null
|
|
38
|
+
] });
|
|
39
|
+
}, Re = {
|
|
40
|
+
header: null,
|
|
41
|
+
footer: null,
|
|
42
|
+
closable: !1,
|
|
43
|
+
bodyStyle: { padding: 0 },
|
|
44
|
+
modalContentClass: r.modalContent
|
|
45
|
+
}, re = "_content_3mwwt_7", le = "_stage_3mwwt_12", ie = "_frame_3mwwt_22", ce = "_media_3mwwt_32", de = "_dots_3mwwt_42", me = "_dot_3mwwt_42", _e = "_active_3mwwt_56", ue = "_copy_3mwwt_61", he = "_copyInner_3mwwt_67", pe = "_progress_3mwwt_74", we = "_title_3mwwt_84", ge = "_description_3mwwt_92", be = "_footer_3mwwt_99", fe = "_button_3mwwt_106", ye = "_enter_3mwwt_111", a = {
|
|
46
|
+
content: re,
|
|
47
|
+
stage: le,
|
|
48
|
+
frame: ie,
|
|
49
|
+
media: ce,
|
|
50
|
+
dots: de,
|
|
51
|
+
dot: me,
|
|
52
|
+
active: _e,
|
|
53
|
+
copy: ue,
|
|
54
|
+
copyInner: he,
|
|
55
|
+
progress: pe,
|
|
56
|
+
title: we,
|
|
57
|
+
description: ge,
|
|
58
|
+
footer: be,
|
|
59
|
+
button: fe,
|
|
60
|
+
enter: ye
|
|
61
|
+
}, Be = ({ visible: n, steps: t, onClose: s, finishText: d = "知道了", width: w = 720 }) => {
|
|
62
|
+
var C, $;
|
|
63
|
+
const [_, u] = F(0), [p, m] = F(n);
|
|
64
|
+
n !== p && (m(n), n && u(0));
|
|
65
|
+
const i = H("(prefers-reduced-motion: reduce)"), N = j(), c = Math.min(_, t.length - 1), o = t[c], g = c === t.length - 1, b = (C = t[c + 1]) != null && C.video || ($ = t[c + 1]) == null ? void 0 : $.image;
|
|
66
|
+
if (B(() => {
|
|
67
|
+
if (!n || !b) return;
|
|
68
|
+
const l = new Image();
|
|
69
|
+
l.src = b;
|
|
70
|
+
}, [n, b]), !o) return null;
|
|
71
|
+
const v = `${N}-title`, k = `${N}-description`, x = o.video ? /* @__PURE__ */ e(
|
|
72
|
+
"video",
|
|
73
|
+
{
|
|
74
|
+
className: a.media,
|
|
75
|
+
src: o.video,
|
|
76
|
+
poster: o.poster,
|
|
77
|
+
muted: !0,
|
|
78
|
+
loop: !0,
|
|
79
|
+
playsInline: !0,
|
|
80
|
+
autoPlay: !i,
|
|
81
|
+
controls: i,
|
|
82
|
+
preload: "auto",
|
|
83
|
+
"aria-label": o.alt || void 0,
|
|
84
|
+
"aria-hidden": !o.alt && !i ? !0 : void 0
|
|
85
|
+
},
|
|
86
|
+
o.video
|
|
87
|
+
) : o.image ? /* @__PURE__ */ e("img", { className: a.media, src: o.image, alt: o.alt ?? "", draggable: !1 }, o.image) : null;
|
|
88
|
+
return /* @__PURE__ */ h(
|
|
89
|
+
O,
|
|
90
|
+
{
|
|
91
|
+
visible: n,
|
|
92
|
+
header: null,
|
|
93
|
+
footer: null,
|
|
94
|
+
closable: !1,
|
|
95
|
+
maskClosable: !1,
|
|
96
|
+
centered: !0,
|
|
97
|
+
width: w,
|
|
98
|
+
bodyStyle: { padding: 0 },
|
|
99
|
+
modalContentClass: a.content,
|
|
100
|
+
onCancel: () => s("skip"),
|
|
101
|
+
modalRender: (l) => L(l) ? P(l, {
|
|
102
|
+
"aria-labelledby": o.title ? v : void 0,
|
|
103
|
+
"aria-label": o.title ? void 0 : "功能引导",
|
|
104
|
+
"aria-describedby": o.description ? k : void 0
|
|
105
|
+
}) : l,
|
|
106
|
+
children: [
|
|
107
|
+
x ? /* @__PURE__ */ e("div", { className: a.stage, children: /* @__PURE__ */ e("div", { className: `${a.frame} ${a.enter}`, children: x }, c) }) : null,
|
|
108
|
+
t.length > 1 ? /* @__PURE__ */ e("div", { className: a.dots, "aria-hidden": "true", children: t.map((l, T) => /* @__PURE__ */ e("span", { className: T === c ? `${a.dot} ${a.active}` : a.dot }, T)) }) : null,
|
|
109
|
+
/* @__PURE__ */ e("div", { className: a.copy, "aria-live": "polite", children: /* @__PURE__ */ h("div", { className: `${a.copyInner} ${a.enter}`, children: [
|
|
110
|
+
t.length > 1 ? /* @__PURE__ */ e("span", { className: a.progress, children: `第 ${c + 1} 步,共 ${t.length} 步` }) : null,
|
|
111
|
+
o.title ? /* @__PURE__ */ e(y.Title, { heading: 5, id: v, className: a.title, children: o.title }) : null,
|
|
112
|
+
o.description ? /* @__PURE__ */ e(y.Paragraph, { id: k, className: a.description, children: o.description }) : null
|
|
113
|
+
] }, c) }),
|
|
114
|
+
/* @__PURE__ */ h("div", { className: a.footer, children: [
|
|
115
|
+
g ? null : /* @__PURE__ */ e(f, { size: "large", theme: "outline", type: "tertiary", className: a.button, onClick: () => s("skip"), children: "跳过" }, "skip"),
|
|
116
|
+
/* @__PURE__ */ e(
|
|
117
|
+
f,
|
|
118
|
+
{
|
|
119
|
+
size: "large",
|
|
120
|
+
theme: "solid",
|
|
121
|
+
type: "primary",
|
|
122
|
+
className: a.button,
|
|
123
|
+
autoFocus: !0,
|
|
124
|
+
onClick: () => g ? s("finish") : u(c + 1),
|
|
125
|
+
children: g ? d : "下一步"
|
|
126
|
+
},
|
|
127
|
+
"next"
|
|
128
|
+
)
|
|
129
|
+
] })
|
|
130
|
+
]
|
|
131
|
+
}
|
|
132
|
+
);
|
|
133
|
+
}, Le = () => {
|
|
134
|
+
const { config: n } = V(), t = Q();
|
|
135
|
+
return /* @__PURE__ */ e(M, { children: /* @__PURE__ */ e(
|
|
136
|
+
z,
|
|
137
|
+
{
|
|
138
|
+
status: "not-found",
|
|
139
|
+
title: "页面不存在",
|
|
140
|
+
description: "请检查地址,或返回产品首页继续。",
|
|
141
|
+
extra: /* @__PURE__ */ e(f, { theme: "solid", type: "primary", onClick: () => t(n.routes.publicHome), children: "返回首页" })
|
|
142
|
+
}
|
|
143
|
+
) });
|
|
144
|
+
}, Ne = "_srOnly_1mfs8_2", ve = {
|
|
145
|
+
srOnly: Ne
|
|
146
|
+
}, Ge = ({ label: n, children: t }) => {
|
|
147
|
+
const s = j();
|
|
148
|
+
return /* @__PURE__ */ h(E, { children: [
|
|
149
|
+
/* @__PURE__ */ e("span", { id: s, className: ve.srOnly, children: n }),
|
|
150
|
+
P(t, { "aria-labelledby": s })
|
|
151
|
+
] });
|
|
152
|
+
}, He = () => /* @__PURE__ */ e(M, { children: /* @__PURE__ */ e("div", { role: "alert", children: /* @__PURE__ */ e(
|
|
153
|
+
z,
|
|
154
|
+
{
|
|
155
|
+
status: "error",
|
|
156
|
+
title: "应用配置暂时无法加载",
|
|
157
|
+
description: "启动检查未通过。请检查运行时配置和网络连接后重新加载。",
|
|
158
|
+
extra: /* @__PURE__ */ e(f, { theme: "solid", type: "primary", onClick: () => window.location.reload(), children: "重新加载" })
|
|
159
|
+
}
|
|
160
|
+
) }) }), ke = "_link_1mzr6_2", xe = "_danger_1mzr6_28", $e = "_warning_1mzr6_33", Se = "_icon_1mzr6_38", S = {
|
|
161
|
+
link: ke,
|
|
162
|
+
danger: xe,
|
|
163
|
+
warning: $e,
|
|
164
|
+
icon: Se
|
|
165
|
+
}, Qe = G(function({ href: t, target: s, rel: d, download: w, onClick: _, onKeyDown: u, icon: p, status: m, disabled: i = !1, className: N, style: c, role: o, tabIndex: g, children: b, ...v }, k) {
|
|
166
|
+
const x = [S.link, m === "danger" ? S.danger : m === "warning" ? S.warning : "", N ?? ""].filter(Boolean).join(" "), $ = {
|
|
167
|
+
...v,
|
|
168
|
+
ref: k,
|
|
169
|
+
href: t,
|
|
170
|
+
target: s,
|
|
171
|
+
rel: s === "_blank" ? d ?? "noreferrer" : d,
|
|
172
|
+
download: w,
|
|
173
|
+
onClick: i ? void 0 : _,
|
|
174
|
+
onKeyDown: (l) => {
|
|
175
|
+
u == null || u(l), !(l.defaultPrevented || t || i || !_) && (l.key === "Enter" || l.key === " ") && (l.preventDefault(), _(l));
|
|
176
|
+
},
|
|
177
|
+
role: o ?? (t ? void 0 : "button"),
|
|
178
|
+
tabIndex: g ?? (t || i ? void 0 : 0),
|
|
179
|
+
"aria-disabled": i || void 0
|
|
180
|
+
};
|
|
181
|
+
return /* @__PURE__ */ h(y.Text, { link: $, disabled: i, className: x, style: c, children: [
|
|
182
|
+
p ? /* @__PURE__ */ e("span", { className: S.icon, children: p }) : null,
|
|
183
|
+
b
|
|
184
|
+
] });
|
|
185
|
+
});
|
|
186
|
+
export {
|
|
187
|
+
Oe as F,
|
|
188
|
+
Be as G,
|
|
189
|
+
Le as N,
|
|
190
|
+
Ge as S,
|
|
191
|
+
Qe as T,
|
|
192
|
+
Ee as a,
|
|
193
|
+
se as b,
|
|
194
|
+
He as c,
|
|
195
|
+
Re as f
|
|
196
|
+
};
|