@24city/web-console 0.3.12 → 0.3.13

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,25 +1,25 @@
1
1
  import { sanitizeInternalReturnPath as A } from "@24city/web-runtime/core/internal-path";
2
2
  import { createContext as x, useSyncExternalStore as F, useContext as z } from "react";
3
3
  import { summarizeCustomerError as O } from "@24city/web-runtime/error-summary";
4
- const v = (t) => t.includes("\\") || [...t].some((e) => {
4
+ const T = (t) => t.includes("\\") || [...t].some((e) => {
5
5
  const s = e.charCodeAt(0);
6
6
  return s <= 31 || s === 127;
7
- }), it = (t) => !v(t) && t.startsWith("/") && !t.startsWith("//") && (() => {
7
+ }), ut = (t) => !T(t) && t.startsWith("/") && !t.startsWith("//") && (() => {
8
8
  try {
9
9
  const e = new URL(t, "https://product.invalid");
10
10
  return e.origin === "https://product.invalid" && A(t, e.pathname) === t;
11
11
  } catch {
12
12
  return !1;
13
13
  }
14
- })(), ct = (t, e) => !v(t) && A(t, e) === t, M = (t, e) => !t || v(t) ? e : A(t, e), U = (t) => typeof t == "object" && t !== null && !Array.isArray(t), l = (t, e) => {
14
+ })(), lt = (t, e) => !T(t) && A(t, e) === t, M = (t, e) => !t || T(t) ? e : A(t, e), U = (t) => typeof t == "object" && t !== null && !Array.isArray(t), p = (t, e) => {
15
15
  const s = e.data;
16
16
  if (!U(s) || s.code !== 0 || !("data" in s))
17
17
  throw new Error(`接口 ${t} 返回了无效响应`);
18
18
  return s.data;
19
- }, u = (t, e, s) => {
19
+ }, l = (t, e, s) => {
20
20
  if (!U(t)) throw new Error(`接口 ${e} 字段 ${s} 无效`);
21
21
  return t;
22
- }, o = (t, e, s) => {
22
+ }, n = (t, e, s) => {
23
23
  const r = t[e];
24
24
  if (typeof r != "string" || !r.trim())
25
25
  throw new Error(`接口 ${s} 字段 ${e} 无效`);
@@ -29,7 +29,7 @@ const v = (t) => t.includes("\\") || [...t].some((e) => {
29
29
  if (typeof r != "number" || !Number.isSafeInteger(r) || r < 0)
30
30
  throw new Error(`接口 ${s} 字段 ${e} 无效`);
31
31
  return r;
32
- }, d = "/account", c = `${d}/session`, E = `${d}/logout`, i = `${d}/spaces`, T = `${i}/switch`, $ = `${d}/profile`, h = `${d}/wallet`, P = `${d}/entitlements`, f = `${d}/subscription`, a = `${d}/plans`, y = `${d}/shown-prompts`, W = `${d}/events`, I = (t, e, s) => {
32
+ }, m = "/account", u = `${m}/session`, $ = `${m}/logout`, i = `${m}/spaces`, C = `${i}/switch`, E = `${m}/profile`, h = `${m}/wallet`, P = `${m}/entitlements`, f = `${m}/subscription`, a = `${m}/plans`, b = `${m}/shown-prompts`, W = `${m}/events`, k = `${m}/visits`, q = /^[a-z][a-z0-9_]{0,31}$/, I = (t, e, s) => {
33
33
  const r = t[e];
34
34
  if (r !== null && typeof r != "string")
35
35
  throw new Error(`接口 ${s} 字段 ${e} 无效`);
@@ -41,11 +41,11 @@ const v = (t) => t.includes("\\") || [...t].some((e) => {
41
41
  throw new Error(`接口 ${s} 字段 ${e} 无效`);
42
42
  return r;
43
43
  }
44
- }, k = (t, e, s) => {
44
+ }, V = (t, e, s) => {
45
45
  const r = t[e];
46
- return r === null ? {} : u(r, s, e);
47
- }, q = (t) => {
48
- const e = u(t, E, "data"), s = S(e, "endSessionUrl", E);
46
+ return r === null ? {} : l(r, s, e);
47
+ }, B = (t) => {
48
+ const e = l(t, $, "data"), s = S(e, "endSessionUrl", $);
49
49
  if (!s) return null;
50
50
  try {
51
51
  return new URL(s).protocol === "https:" ? s : null;
@@ -53,75 +53,75 @@ const v = (t) => t.includes("\\") || [...t].some((e) => {
53
53
  return null;
54
54
  }
55
55
  }, D = (t) => {
56
- const e = u(t, c, "data");
56
+ const e = l(t, u, "data");
57
57
  if (e.purpose !== "user") throw new Error("产品用户 Web 只接受 user Purpose 会话");
58
58
  return {
59
- globalUserId: o(e, "globalUserId", c),
60
- localUserId: g(e, "localUserId", c),
61
- activeSpaceId: o(e, "activeSpaceId", c),
62
- authorityId: g(e, "authorityId", c),
63
- orgId: g(e, "orgId", c),
59
+ globalUserId: n(e, "globalUserId", u),
60
+ localUserId: g(e, "localUserId", u),
61
+ activeSpaceId: n(e, "activeSpaceId", u),
62
+ authorityId: g(e, "authorityId", u),
63
+ orgId: g(e, "orgId", u),
64
64
  purpose: "user",
65
- csrfToken: o(e, "csrfToken", c),
66
- issuedAt: o(e, "issuedAt", c),
67
- lastSeenAt: o(e, "lastSeenAt", c),
68
- absoluteExpiresAt: o(e, "absoluteExpiresAt", c),
69
- lastCentralVerifiedAt: o(e, "lastCentralVerifiedAt", c),
70
- accountCenterUrl: o(e, "accountCenterUrl", c)
65
+ csrfToken: n(e, "csrfToken", u),
66
+ issuedAt: n(e, "issuedAt", u),
67
+ lastSeenAt: n(e, "lastSeenAt", u),
68
+ absoluteExpiresAt: n(e, "absoluteExpiresAt", u),
69
+ lastCentralVerifiedAt: n(e, "lastCentralVerifiedAt", u),
70
+ accountCenterUrl: n(e, "accountCenterUrl", u)
71
71
  };
72
- }, R = (t, e, s) => {
73
- const r = u(t, e, s);
72
+ }, _ = (t, e, s) => {
73
+ const r = l(t, e, s);
74
74
  return {
75
- id: o(r, "id", e),
76
- entitlementCode: o(r, "entitlementCode", e),
75
+ id: n(r, "id", e),
76
+ entitlementCode: n(r, "entitlementCode", e),
77
77
  status: S(r, "status", e),
78
- startsAt: o(r, "startsAt", e),
78
+ startsAt: n(r, "startsAt", e),
79
79
  expiresAt: I(r, "expiresAt", e),
80
- metadata: k(r, "metadata", e)
80
+ metadata: V(r, "metadata", e)
81
81
  };
82
- }, B = (t, e) => {
83
- const s = u(t, i, `spaces[${e}]`), r = u(s.entitlementSummary, i, "entitlementSummary"), n = r.codes, m = s.entitlements;
84
- if (!Array.isArray(n) || n.some((b) => typeof b != "string"))
82
+ }, G = (t, e) => {
83
+ const s = l(t, i, `spaces[${e}]`), r = l(s.entitlementSummary, i, "entitlementSummary"), o = r.codes, c = s.entitlements;
84
+ if (!Array.isArray(o) || o.some((y) => typeof y != "string"))
85
85
  throw new Error(`接口 ${i} 字段 entitlementSummary.codes 无效`);
86
- if (!Array.isArray(m))
86
+ if (!Array.isArray(c))
87
87
  throw new Error(`接口 ${i} 字段 entitlements 无效`);
88
88
  return {
89
- id: o(s, "id", i),
90
- name: o(s, "name", i),
91
- slug: o(s, "slug", i),
92
- type: o(s, "type", i),
93
- role: o(s, "role", i),
94
- status: o(s, "status", i),
95
- membershipStatus: o(s, "membershipStatus", i),
89
+ id: n(s, "id", i),
90
+ name: n(s, "name", i),
91
+ slug: n(s, "slug", i),
92
+ type: n(s, "type", i),
93
+ role: n(s, "role", i),
94
+ status: n(s, "status", i),
95
+ membershipStatus: n(s, "membershipStatus", i),
96
96
  entitlementSummary: {
97
97
  activeCount: g(r, "activeCount", i),
98
- codes: [...n]
98
+ codes: [...o]
99
99
  },
100
- entitlements: m.map(
101
- (b, p) => R(b, i, `entitlements[${p}]`)
100
+ entitlements: c.map(
101
+ (y, d) => _(y, i, `entitlements[${d}]`)
102
102
  )
103
103
  };
104
- }, V = (t) => {
105
- const e = u(t, i, "data"), s = o(e, "activeSpaceId", i);
104
+ }, H = (t) => {
105
+ const e = l(t, i, "data"), s = n(e, "activeSpaceId", i);
106
106
  if (!Array.isArray(e.spaces)) throw new Error(`接口 ${i} 字段 spaces 无效`);
107
- const r = e.spaces.map(B);
108
- if (!r.some((n) => n.id === s))
107
+ const r = e.spaces.map(G);
108
+ if (!r.some((o) => o.id === s))
109
109
  throw new Error(`接口 ${i} 的当前空间不在可用空间列表中`);
110
110
  return { activeSpaceId: s, spaces: r };
111
- }, H = (t) => {
112
- const e = u(t, $, "data");
113
- return { nickName: (S(e, "nickName", $) ?? "").trim() };
114
111
  }, j = (t) => {
115
- const e = u(t, h, "data"), s = (r) => {
116
- const n = e[r];
117
- if (typeof n != "number" || !Number.isSafeInteger(n))
112
+ const e = l(t, E, "data");
113
+ return { nickName: (S(e, "nickName", E) ?? "").trim() };
114
+ }, K = (t) => {
115
+ const e = l(t, h, "data"), s = (r) => {
116
+ const o = e[r];
117
+ if (typeof o != "number" || !Number.isSafeInteger(o))
118
118
  throw new Error(`接口 ${h} 字段 ${r} 无效`);
119
- return n;
119
+ return o;
120
120
  };
121
121
  return {
122
- spaceId: o(e, "spaceId", h),
123
- globalUserId: o(e, "globalUserId", h),
124
- productCode: o(e, "productCode", h),
122
+ spaceId: n(e, "spaceId", h),
123
+ globalUserId: n(e, "globalUserId", h),
124
+ productCode: n(e, "productCode", h),
125
125
  availablePoints: s("availablePoints"),
126
126
  reservedPoints: s("reservedPoints"),
127
127
  globalAvailablePoints: s("globalAvailablePoints"),
@@ -132,152 +132,155 @@ const v = (t) => t.includes("\\") || [...t].some((e) => {
132
132
  walletReservedPoints: s("walletReservedPoints"),
133
133
  walletVersion: g(e, "walletVersion", h)
134
134
  };
135
- }, G = (t) => {
135
+ }, Y = (t) => {
136
136
  if (t === null) return null;
137
- const e = u(t, f, "data"), s = e.tier;
137
+ const e = l(t, f, "data"), s = e.tier;
138
138
  if (typeof s != "number" || !Number.isSafeInteger(s))
139
139
  throw new Error(`接口 ${f} 字段 tier 无效`);
140
140
  if (typeof e.isDefault != "boolean")
141
141
  throw new Error(`接口 ${f} 字段 isDefault 无效`);
142
142
  return {
143
143
  subscriptionId: I(e, "subscriptionId", f),
144
- planCode: o(e, "planCode", f),
144
+ planCode: n(e, "planCode", f),
145
145
  planName: (S(e, "planName", f) ?? "").trim(),
146
146
  tier: s,
147
147
  isDefault: e.isDefault,
148
148
  spaceType: S(e, "spaceType", f) ?? "",
149
149
  currentPeriodEnd: I(e, "currentPeriodEnd", f)
150
150
  };
151
- }, K = /* @__PURE__ */ new Set(["month", "year", "one_time"]), X = (t, e) => {
152
- const s = u(t, a, e), r = o(s, "billingPeriod", a);
153
- if (!K.has(r)) throw new Error(`接口 ${a} 字段 ${e}.billingPeriod 无效`);
151
+ }, X = /* @__PURE__ */ new Set(["month", "year", "one_time"]), J = (t, e) => {
152
+ const s = l(t, a, e), r = n(s, "billingPeriod", a);
153
+ if (!X.has(r)) throw new Error(`接口 ${a} 字段 ${e}.billingPeriod 无效`);
154
154
  return {
155
- code: o(s, "code", a),
155
+ code: n(s, "code", a),
156
156
  amountCents: g(s, "amountCents", a),
157
- currency: o(s, "currency", a),
157
+ currency: n(s, "currency", a),
158
158
  billingPeriod: r,
159
159
  durationDays: g(s, "durationDays", a),
160
160
  pointCycles: g(s, "pointCycles", a)
161
161
  };
162
- }, Y = (t, e) => {
163
- const s = u(t, a, e), r = s.limit;
162
+ }, Q = (t, e) => {
163
+ const s = l(t, a, e), r = s.limit;
164
164
  if (r != null && (typeof r != "number" || !Number.isSafeInteger(r) || r < 0))
165
165
  throw new Error(`接口 ${a} 字段 ${e}.limit 无效`);
166
- const n = Array.isArray(s.discounts) ? s.discounts.filter((m) => typeof m == "string") : [];
166
+ const o = Array.isArray(s.discounts) ? s.discounts.filter((c) => typeof c == "string") : [];
167
167
  return {
168
168
  key: S(s, "key", a) ?? "",
169
- name: o(s, "name", a),
169
+ name: n(s, "name", a),
170
170
  description: S(s, "description", a) ?? "",
171
171
  limit: typeof r == "number" ? r : null,
172
- discounts: n
172
+ discounts: o
173
173
  };
174
- }, J = (t, e) => {
175
- const s = `data[${e}]`, r = u(t, a, s), n = o(r, "spaceType", a);
176
- if (n !== "personal" && n !== "team") throw new Error(`接口 ${a} 字段 ${s}.spaceType 无效`);
174
+ }, Z = (t, e) => {
175
+ const s = `data[${e}]`, r = l(t, a, s), o = n(r, "spaceType", a);
176
+ if (o !== "personal" && o !== "team") throw new Error(`接口 ${a} 字段 ${s}.spaceType 无效`);
177
177
  if (typeof r.tier != "number" || !Number.isSafeInteger(r.tier)) throw new Error(`接口 ${a} 字段 ${s}.tier 无效`);
178
178
  if (typeof r.isDefault != "boolean") throw new Error(`接口 ${a} 字段 ${s}.isDefault 无效`);
179
179
  if (!Array.isArray(r.prices)) throw new Error(`接口 ${a} 字段 ${s}.prices 无效`);
180
- const m = Array.isArray(r.benefits) ? r.benefits : [], b = Array.isArray(r.otherProducts) ? r.otherProducts.filter((p) => typeof p == "string" && p.trim() !== "").map((p) => p.trim()) : [];
180
+ const c = Array.isArray(r.benefits) ? r.benefits : [], y = Array.isArray(r.otherProducts) ? r.otherProducts.filter((d) => typeof d == "string" && d.trim() !== "").map((d) => d.trim()) : [];
181
181
  return {
182
- code: o(r, "code", a),
183
- name: o(r, "name", a).trim(),
184
- spaceType: n,
182
+ code: n(r, "code", a),
183
+ name: n(r, "name", a).trim(),
184
+ spaceType: o,
185
185
  tier: r.tier,
186
186
  isDefault: r.isDefault,
187
187
  includedSeats: g(r, "includedSeats", a),
188
188
  monthlyPoints: g(r, "monthlyPoints", a),
189
- prices: r.prices.map((p, N) => X(p, `${s}.prices[${N}]`)),
190
- benefits: m.map((p, N) => Y(p, `${s}.benefits[${N}]`)),
191
- otherProducts: b
189
+ prices: r.prices.map((d, N) => J(d, `${s}.prices[${N}]`)),
190
+ benefits: c.map((d, N) => Q(d, `${s}.benefits[${N}]`)),
191
+ otherProducts: y
192
192
  };
193
193
  }, L = (t, e) => {
194
- const s = u(t, y, "data")[e];
194
+ const s = l(t, b, "data")[e];
195
195
  if (!Array.isArray(s) || s.some((r) => typeof r != "string"))
196
- throw new Error(`接口 ${y} 字段 ${e} 无效`);
196
+ throw new Error(`接口 ${b} 字段 ${e} 无效`);
197
197
  return [...s];
198
- }, Q = (t) => {
198
+ }, tt = (t) => {
199
199
  if (!Array.isArray(t)) throw new Error(`接口 ${a} 字段 data 无效`);
200
- return t.map(J);
201
- }, ut = (t, e) => {
200
+ return t.map(Z);
201
+ }, dt = (t, e) => {
202
202
  const s = e === "/" ? "" : e;
203
203
  return {
204
204
  async reportBehaviorEvents(r) {
205
205
  r.length !== 0 && await t.post(W, { events: r });
206
206
  },
207
- startLogin(r, n) {
208
- const m = M(r, n);
209
- return `${s}${d}/startLogin?returnPath=${encodeURIComponent(m)}`;
207
+ async reportVisits(r) {
208
+ r.length !== 0 && await t.post(k, { pageViews: r });
209
+ },
210
+ startLogin(r, o, c) {
211
+ const y = M(r, o), d = c != null && c.entry && q.test(c.entry) ? `&entry=${c.entry}` : "";
212
+ return `${s}${m}/startLogin?returnPath=${encodeURIComponent(y)}${d}`;
210
213
  },
211
214
  async getSession() {
212
- return D(l(c, await t.get(c)));
215
+ return D(p(u, await t.get(u)));
213
216
  },
214
217
  async getSpaces() {
215
- return V(l(i, await t.get(i)));
218
+ return H(p(i, await t.get(i)));
216
219
  },
217
220
  async switchSpace(r) {
218
- const n = l(T, await t.post(T, { globalSpaceId: r }));
219
- return D(n);
221
+ const o = p(C, await t.post(C, { globalSpaceId: r }));
222
+ return D(o);
220
223
  },
221
224
  async getProfile() {
222
- return H(l($, await t.get($)));
225
+ return j(p(E, await t.get(E)));
223
226
  },
224
227
  async getWallet() {
225
- return j(l(h, await t.get(h)));
228
+ return K(p(h, await t.get(h)));
226
229
  },
227
230
  async getEntitlements() {
228
- const r = l(P, await t.get(P));
231
+ const r = p(P, await t.get(P));
229
232
  if (!Array.isArray(r)) throw new Error(`接口 ${P} 字段 data 无效`);
230
- return r.map((n, m) => R(n, P, `entitlements[${m}]`));
233
+ return r.map((o, c) => _(o, P, `entitlements[${c}]`));
231
234
  },
232
235
  async getSubscription() {
233
- return G(l(f, await t.get(f)));
236
+ return Y(p(f, await t.get(f)));
234
237
  },
235
238
  async getPlans() {
236
- return Q(l(a, await t.get(a)));
239
+ return tt(p(a, await t.get(a)));
237
240
  },
238
241
  async logout() {
239
- const r = l(E, await t.post(E));
240
- return { endSessionUrl: q(r) };
242
+ const r = p($, await t.post($));
243
+ return { endSessionUrl: B(r) };
241
244
  },
242
245
  async getShownPrompts(r) {
243
- const n = await t.get(y, { params: { keys: r.join(",") } });
244
- return L(l(y, n), "shown");
246
+ const o = await t.get(b, { params: { keys: r.join(",") } });
247
+ return L(p(b, o), "shown");
245
248
  },
246
249
  async claimShownPrompts(r) {
247
- const n = await t.post(y, { keys: [...r] });
248
- return L(l(y, n), "claimed");
250
+ const o = await t.post(b, { keys: [...r] });
251
+ return L(p(b, o), "claimed");
249
252
  }
250
253
  };
251
- }, lt = async (t) => {
254
+ }, mt = async (t) => {
252
255
  let e = await t.getSession();
253
256
  const s = await t.getSpaces();
254
257
  if (s.activeSpaceId !== e.activeSpaceId && (e = await t.getSession()), s.activeSpaceId !== e.activeSpaceId)
255
258
  throw new Error("产品会话与统一空间上下文不一致");
256
259
  return { session: e, spaces: s.spaces };
257
- }, dt = (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"), mt = (t) => t.toLocaleString("zh-CN", { maximumFractionDigits: 0 }), pt = (t) => t > 0 && t < 0.01 ? "<0.01" : t.toLocaleString("zh-CN", { maximumFractionDigits: 2 }), ft = (t) => t ? `¥${(t / 100).toLocaleString("zh-CN", { minimumFractionDigits: 2, maximumFractionDigits: 2 })}` : "暂无", gt = (t) => {
260
+ }, pt = (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"), ft = (t) => t.toLocaleString("zh-CN", { maximumFractionDigits: 0 }), gt = (t) => t > 0 && t < 0.01 ? "<0.01" : t.toLocaleString("zh-CN", { maximumFractionDigits: 2 }), wt = (t) => t ? `¥${(t / 100).toLocaleString("zh-CN", { minimumFractionDigits: 2, maximumFractionDigits: 2 })}` : "暂无", ht = (t) => {
258
261
  if (t === void 0 || t <= 0) return "";
259
262
  const e = Math.floor(t / 60), s = Math.floor(t % 60);
260
263
  return `${e}:${String(s).padStart(2, "0")}`;
261
- }, wt = (t) => {
264
+ }, yt = (t) => {
262
265
  if (t === void 0 || t <= 0) return "暂无";
263
266
  const e = Math.floor(t / 3600), s = Math.floor(t % 3600 / 60), r = t % 60;
264
267
  return e > 0 ? `${e}小时${s}分` : s > 0 ? `${s}分${r}秒` : `${r}秒`;
265
- }, ht = (t) => {
268
+ }, St = (t) => {
266
269
  const e = new Date(t);
267
270
  return Number.isNaN(e.getTime()) ? "暂无" : new Intl.DateTimeFormat("zh-CN", { dateStyle: "short", timeStyle: "short" }).format(e);
268
- }, St = (t) => {
271
+ }, bt = (t) => {
269
272
  if (!t) return "长期有效";
270
273
  const e = new Date(t);
271
274
  return Number.isNaN(e.getTime()) ? "暂无" : new Intl.DateTimeFormat("zh-CN", { dateStyle: "medium" }).format(e);
272
- }, Z = () => ({
275
+ }, et = () => ({
273
276
  session: null,
274
277
  spaces: [],
275
278
  bootstrapped: !1,
276
279
  serviceUnavailable: !1
277
- }), yt = () => {
278
- let t = Z();
280
+ }), Pt = () => {
281
+ let t = et();
279
282
  const e = /* @__PURE__ */ new Set(), s = (r) => {
280
- t = r, e.forEach((n) => n());
283
+ t = r, e.forEach((o) => o());
281
284
  };
282
285
  return {
283
286
  subscribe(r) {
@@ -298,88 +301,88 @@ const v = (t) => t.includes("\\") || [...t].some((e) => {
298
301
  s({ session: null, spaces: [], bootstrapped: !0, serviceUnavailable: r.unavailable ?? !1 });
299
302
  }
300
303
  };
301
- }, _ = x(null), bt = _.Provider, tt = () => {
302
- const t = z(_);
304
+ }, R = x(null), $t = R.Provider, rt = () => {
305
+ const t = z(R);
303
306
  if (!t) throw new Error("AuthStoreProvider 尚未初始化");
304
307
  return t;
305
- }, Pt = () => {
306
- const t = tt();
308
+ }, Et = () => {
309
+ const t = rt();
307
310
  return F(t.subscribe, t.getState, t.getState);
308
- }, Et = (t) => t instanceof Error && t.message.trim() ? t.message : "请稍后重试;如问题持续,请联系管理员。", $t = (t, e) => O(t).status === e, Nt = (t) => {
311
+ }, Nt = (t) => t instanceof Error && t.message.trim() ? t.message : "请稍后重试;如问题持续,请联系管理员。", It = (t, e) => O(t).status === e, At = (t) => {
309
312
  const { category: e, status: s } = O(t);
310
313
  return e === "network" || e === "timeout" || s === 502 || s === 503 || s === 504;
311
- }, C = "24city.console.logout-at", et = 15e3;
314
+ }, v = "24city.console.logout-at", st = 15e3;
312
315
  let w = null;
313
- const rt = () => {
316
+ const nt = () => {
314
317
  try {
315
- return Number(window.localStorage.getItem(C) ?? Number.NaN);
318
+ return Number(window.localStorage.getItem(v) ?? Number.NaN);
316
319
  } catch {
317
320
  return Number.NaN;
318
321
  }
319
322
  };
320
- function It(t = Date.now()) {
323
+ function Tt(t = Date.now()) {
321
324
  try {
322
- window.localStorage.setItem(C, String(t));
325
+ window.localStorage.setItem(v, String(t));
323
326
  } catch {
324
327
  }
325
328
  }
326
- function st() {
329
+ function ot() {
327
330
  try {
328
- window.localStorage.removeItem(C);
331
+ window.localStorage.removeItem(v);
329
332
  } catch {
330
333
  }
331
334
  }
332
- function At() {
335
+ function vt() {
333
336
  w = "leaving";
334
337
  }
335
- function vt() {
338
+ function Ct() {
336
339
  return w === "leaving";
337
340
  }
338
- function Ct(t = Date.now()) {
341
+ function Dt(t = Date.now()) {
339
342
  if (w === "leaving") return !1;
340
- const e = t - rt();
341
- return e >= 0 && e < et && (w = "logged-out"), w === "logged-out";
343
+ const e = t - nt();
344
+ return e >= 0 && e < st && (w = "logged-out"), w === "logged-out";
342
345
  }
343
- function Tt() {
346
+ function Lt() {
344
347
  return w === "logged-out";
345
348
  }
346
- function Dt() {
349
+ function Ot() {
347
350
  w === "logged-out" && (w = null);
348
351
  }
349
- function Lt() {
350
- w = null, st();
352
+ function Ut() {
353
+ w = null, ot();
351
354
  }
352
355
  export {
353
- bt as A,
354
- u as B,
355
- o as C,
356
+ $t as A,
357
+ l as B,
358
+ n as C,
356
359
  M as D,
357
- Et as E,
358
- l as F,
359
- It as a,
360
- yt as b,
361
- ut as c,
362
- Tt as d,
363
- Lt as e,
364
- lt as f,
365
- tt as g,
366
- pt as h,
367
- vt as i,
368
- gt as j,
369
- St as k,
370
- At as l,
371
- ht as m,
372
- Ct as n,
373
- wt as o,
374
- dt as p,
375
- mt as q,
376
- Dt as r,
377
- ft as s,
378
- $t as t,
379
- Pt as u,
380
- ct as v,
381
- st as w,
382
- it as x,
383
- Nt as y,
360
+ Nt as E,
361
+ p as F,
362
+ Tt as a,
363
+ Pt as b,
364
+ dt as c,
365
+ Lt as d,
366
+ Ut as e,
367
+ mt as f,
368
+ rt as g,
369
+ gt as h,
370
+ Ct as i,
371
+ ht as j,
372
+ bt as k,
373
+ vt as l,
374
+ St as m,
375
+ Dt as n,
376
+ yt as o,
377
+ pt as p,
378
+ ft as q,
379
+ Ot as r,
380
+ wt as s,
381
+ It as t,
382
+ Et as u,
383
+ lt as v,
384
+ ot as w,
385
+ ut as x,
386
+ At as y,
384
387
  g as z
385
388
  };
@@ -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-Cwib6lRM.js";
6
- import { b as m, A as p } from "./logout-signal-qvHorCCF.js";
5
+ import { A as d } from "./auth-provider-DAxku5aX.js";
6
+ import { b as m, A as p } from "./logout-signal-XyvlxcEc.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";