astrogators-shared-ui 0.14.0 → 0.16.0

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/dist/index.js CHANGED
@@ -1,6 +1,7 @@
1
- import e, { createContext as t, useCallback as n, useContext as r, useEffect as i, useState as a } from "react";
2
- import { Fragment as o, jsx as s, jsxs as c } from "react/jsx-runtime";
3
- var l = {
1
+ import e, { createContext as t, forwardRef as n, useCallback as r, useContext as i, useEffect as a, useRef as o, useState as s } from "react";
2
+ import { Fragment as c, jsx as l, jsxs as u } from "react/jsx-runtime";
3
+ import { createPortal as d } from "react-dom";
4
+ var f = {
4
5
  container: "_container_u3o0e_1",
5
6
  padding: "_padding_u3o0e_7",
6
7
  "maxWidth-sm": "_maxWidth-sm_u3o0e_12",
@@ -8,221 +9,113 @@ var l = {
8
9
  "maxWidth-lg": "_maxWidth-lg_u3o0e_20",
9
10
  "maxWidth-xl": "_maxWidth-xl_u3o0e_24",
10
11
  "maxWidth-full": "_maxWidth-full_u3o0e_28"
11
- }, u = ({ children: e, maxWidth: t = "xl", padding: n = !0, className: r = "", style: i }) => /* @__PURE__ */ s("div", {
12
- className: `${l.container} ${l[`maxWidth-${t}`]} ${n ? l.padding : ""} ${r}`,
12
+ }, p = ({ children: e, maxWidth: t = "xl", padding: n = !0, className: r = "", style: i }) => /* @__PURE__ */ l("div", {
13
+ className: `${f.container} ${f[`maxWidth-${t}`]} ${n ? f.padding : ""} ${r}`,
13
14
  style: i,
14
15
  children: e
15
- }), d = {
16
- topBar: "_topBar_10g3c_1",
17
- content: "_content_10g3c_13",
18
- left: "_left_10g3c_23",
19
- right: "_right_10g3c_30",
20
- logo: "_logo_10g3c_36"
21
- }, f = ({ logo: e, leftContent: t, rightContent: n, className: r = "" }) => /* @__PURE__ */ s("header", {
22
- className: `${d.topBar} ${r}`,
23
- children: /* @__PURE__ */ c("div", {
24
- className: d.content,
25
- children: [/* @__PURE__ */ c("div", {
26
- className: d.left,
27
- children: [e && /* @__PURE__ */ s("div", {
28
- className: d.logo,
16
+ }), m = {
17
+ topBar: "_topBar_r058i_1",
18
+ content: "_content_r058i_17",
19
+ left: "_left_r058i_25",
20
+ right: "_right_r058i_32",
21
+ logo: "_logo_r058i_38"
22
+ }, h = ({ logo: e, leftContent: t, rightContent: n, className: r = "" }) => /* @__PURE__ */ l("header", {
23
+ className: `${m.topBar} ${r}`,
24
+ children: /* @__PURE__ */ u("div", {
25
+ className: m.content,
26
+ children: [/* @__PURE__ */ u("div", {
27
+ className: m.left,
28
+ children: [e && /* @__PURE__ */ l("div", {
29
+ className: m.logo,
29
30
  children: e
30
31
  }), t]
31
- }), /* @__PURE__ */ s("div", {
32
- className: d.right,
32
+ }), /* @__PURE__ */ l("div", {
33
+ className: m.right,
33
34
  children: n
34
35
  })]
35
36
  })
36
- }), p = {
37
- button: "_button_159ms_1",
38
- sm: "_sm_159ms_22",
39
- md: "_md_159ms_28",
40
- lg: "_lg_159ms_34",
41
- primary: "_primary_159ms_41",
42
- secondary: "_secondary_159ms_55",
43
- outline: "_outline_159ms_69",
44
- ghost: "_ghost_159ms_80",
45
- danger: "_danger_159ms_89",
46
- fullWidth: "_fullWidth_159ms_100",
47
- loading: "_loading_159ms_105",
48
- loadingSpinner: "_loadingSpinner_159ms_110",
49
- spinner: "_spinner_159ms_116",
50
- spin: "_spin_159ms_116",
51
- loadingText: "_loadingText_159ms_131"
52
- }, m = ({ children: e, variant: t = "primary", size: n = "md", fullWidth: r = !1, loading: i = !1, disabled: a = !1, className: o = "", ...l }) => /* @__PURE__ */ s("button", {
53
- className: `${p.button} ${p[t]} ${p[n]} ${r ? p.fullWidth : ""} ${i ? p.loading : ""} ${o}`,
54
- disabled: a || i,
55
- ...l,
56
- children: i ? /* @__PURE__ */ c("span", {
57
- className: p.loadingSpinner,
58
- children: [/* @__PURE__ */ s("span", { className: p.spinner }), /* @__PURE__ */ s("span", {
59
- className: p.loadingText,
60
- children: e
61
- })]
62
- }) : e
63
- }), h = {
64
- selectWrapper: "_selectWrapper_ir4bq_1",
65
- fullWidth: "_fullWidth_ir4bq_7",
66
- label: "_label_ir4bq_11",
67
- required: "_required_ir4bq_20",
68
- selectContainer: "_selectContainer_ir4bq_24",
69
- select: "_select_ir4bq_1",
70
- error: "_error_ir4bq_63",
71
- arrow: "_arrow_ir4bq_71",
72
- errorText: "_errorText_ir4bq_81",
73
- helperText: "_helperText_ir4bq_86"
74
- }, g = e.forwardRef(({ label: e, error: t, helperText: n, options: r, placeholder: i, fullWidth: a = !1, className: o = "", id: l, ...u }, d) => {
75
- let f = l || `select-${Math.random().toString(36).substr(2, 9)}`, p = !!t;
76
- return /* @__PURE__ */ c("div", {
77
- className: `${h.selectWrapper} ${a ? h.fullWidth : ""} ${o}`,
78
- children: [
79
- e && /* @__PURE__ */ c("label", {
80
- htmlFor: f,
81
- className: h.label,
82
- children: [e, u.required && /* @__PURE__ */ s("span", {
83
- className: h.required,
84
- children: "*"
85
- })]
86
- }),
87
- /* @__PURE__ */ c("div", {
88
- className: h.selectContainer,
89
- children: [/* @__PURE__ */ c("select", {
90
- ref: d,
91
- id: f,
92
- className: `${h.select} ${p ? h.error : ""}`,
93
- ...u,
94
- children: [
95
- i && /* @__PURE__ */ s("option", {
96
- value: "",
97
- disabled: !0,
98
- children: i
99
- }),
100
- r && r.map((e) => /* @__PURE__ */ s("option", {
101
- value: e.value,
102
- disabled: e.disabled,
103
- children: e.label
104
- }, e.value)),
105
- !r && u.children
106
- ]
107
- }), /* @__PURE__ */ s("span", {
108
- className: h.arrow,
109
- children: "▼"
110
- })]
111
- }),
112
- t && /* @__PURE__ */ s("span", {
113
- className: h.errorText,
114
- children: t
115
- }),
116
- n && !t && /* @__PURE__ */ s("span", {
117
- className: h.helperText,
118
- children: n
119
- })
120
- ]
121
- });
122
- });
123
- g.displayName = "Select";
124
- var _ = {
125
- inputWrapper: "_inputWrapper_15t4g_1",
126
- fullWidth: "_fullWidth_15t4g_7",
127
- label: "_label_15t4g_11",
128
- required: "_required_15t4g_20",
129
- input: "_input_15t4g_1",
130
- error: "_error_15t4g_55",
131
- errorText: "_errorText_15t4g_63",
132
- helperText: "_helperText_15t4g_68"
133
- }, v = e.forwardRef(({ label: e, error: t, helperText: n, fullWidth: r = !1, className: i = "", id: a, ...o }, l) => {
134
- let u = a || `input-${Math.random().toString(36).substr(2, 9)}`, d = !!t;
135
- return /* @__PURE__ */ c("div", {
136
- className: `${_.inputWrapper} ${r ? _.fullWidth : ""} ${i}`,
137
- children: [
138
- e && /* @__PURE__ */ c("label", {
139
- htmlFor: u,
140
- className: _.label,
141
- children: [e, o.required && /* @__PURE__ */ s("span", {
142
- className: _.required,
143
- children: "*"
144
- })]
145
- }),
146
- /* @__PURE__ */ s("input", {
147
- ref: l,
148
- id: u,
149
- className: `${_.input} ${d ? _.error : ""}`,
150
- ...o
151
- }),
152
- t && /* @__PURE__ */ s("span", {
153
- className: _.errorText,
154
- children: t
155
- }),
156
- n && !t && /* @__PURE__ */ s("span", {
157
- className: _.helperText,
158
- children: n
159
- })
160
- ]
161
- });
162
- });
163
- v.displayName = "Input";
164
- //#endregion
165
- //#region src/services/auth.ts
166
- var y = "astrogators_access_token", b = "astrogators_refresh_token", x = () => localStorage.getItem(y), S = (e) => {
167
- localStorage.setItem(y, e);
37
+ }), g = "astrogators_access_token", _ = "astrogators_refresh_token", v = () => localStorage.getItem(g), y = (e) => {
38
+ localStorage.setItem(g, e);
39
+ }, b = () => {
40
+ localStorage.removeItem(g);
41
+ }, x = () => localStorage.getItem(_), S = (e) => {
42
+ localStorage.setItem(_, e);
168
43
  }, C = () => {
169
- localStorage.removeItem(y);
170
- }, w = () => localStorage.getItem(b), T = (e) => {
171
- localStorage.setItem(b, e);
172
- }, E = () => {
173
- localStorage.removeItem(b);
174
- }, D = (e, t) => {
175
- S(e), T(t);
176
- }, O = () => {
177
- C(), E();
178
- }, ee = () => !!x(), k = "", A, j = null, M = (e) => {
179
- k = e.baseURL, A = e.onUnauthorized;
180
- }, N = () => j || (j = (async () => {
181
- let e = w();
44
+ localStorage.removeItem(_);
45
+ }, w = (e, t) => {
46
+ y(e), S(t);
47
+ }, T = () => {
48
+ b(), C();
49
+ }, E = () => !!v(), D = "", O, k = null, A = (e) => {
50
+ D = e.baseURL, O = e.onUnauthorized;
51
+ }, j = () => k || (k = (async () => {
52
+ let e = x();
182
53
  if (!e) throw Error("No refresh token available");
183
- let t = await fetch(`${k}/api/v1/auth/refresh`, {
54
+ let t = await fetch(`${D}/api/v1/auth/refresh`, {
184
55
  method: "POST",
185
56
  headers: { "Content-Type": "application/json" },
186
57
  body: JSON.stringify({ refresh_token: e })
187
58
  });
188
- if (!t.ok) throw O(), A?.(), Error("Token refresh failed");
59
+ if (!t.ok) throw T(), O?.(), Error("Token refresh failed");
189
60
  let n = await t.json();
190
- return D(n.access_token, n.refresh_token), n.access_token;
61
+ return w(n.access_token, n.refresh_token), n.access_token;
191
62
  })().finally(() => {
192
- j = null;
193
- }), j), P = 30, F = (e) => {
63
+ k = null;
64
+ }), k), ee = 30, M = [700, 1500], N = new Set([
65
+ 502,
66
+ 503,
67
+ 504
68
+ ]), P = (e) => {
69
+ let t = (e ?? "GET").toUpperCase();
70
+ return t === "GET" || t === "HEAD" || t === "OPTIONS";
71
+ }, F = (e) => e == null || typeof e == "string", te = (e) => new Promise((t) => setTimeout(t, e)), I = async (e, t) => {
72
+ let n = P(t.method) && F(t.body), r = F(t.body), i;
73
+ for (let a = 0; a <= M.length; a++) {
74
+ a > 0 && await te(M[a - 1]);
75
+ let o = a < M.length;
76
+ try {
77
+ let r = await fetch(e, t);
78
+ if (o && n && N.has(r.status)) continue;
79
+ return r;
80
+ } catch (e) {
81
+ if (i = e, o && r) continue;
82
+ throw e;
83
+ }
84
+ }
85
+ throw i ?? /* @__PURE__ */ Error("fetchWithRetry: retries exhausted");
86
+ }, ne = (e) => {
194
87
  try {
195
88
  let t = e.split(".")[1].replace(/-/g, "+").replace(/_/g, "/"), { exp: n } = JSON.parse(atob(t));
196
- return typeof n == "number" && Date.now() / 1e3 >= n - P;
89
+ return typeof n == "number" && Date.now() / 1e3 >= n - ee;
197
90
  } catch {
198
91
  return !1;
199
92
  }
200
- }, I = async (e, t = {}) => {
201
- let n = x();
202
- if (n && F(n)) try {
203
- n = await N();
93
+ }, re = async (e, t = {}) => {
94
+ let n = v();
95
+ if (n && ne(n)) try {
96
+ n = await j();
204
97
  } catch {
205
- n = x();
98
+ n = v();
206
99
  }
207
100
  let r = { ...t.headers };
208
101
  n && (r.Authorization = `Bearer ${n}`);
209
- let i = await fetch(e, {
102
+ let i = await I(e, {
210
103
  ...t,
211
104
  headers: r
212
105
  });
213
106
  if (i.status !== 401 || !n) return i;
214
107
  try {
215
- return r.Authorization = `Bearer ${await N()}`, await fetch(e, {
108
+ return r.Authorization = `Bearer ${await j()}`, await I(e, {
216
109
  ...t,
217
110
  headers: r
218
111
  });
219
112
  } catch {
220
113
  return i;
221
114
  }
222
- }, L = class {
115
+ }, ie = class {
223
116
  baseURL;
224
117
  constructor(e) {
225
- this.baseURL = e.baseURL, M({
118
+ this.baseURL = e.baseURL, A({
226
119
  baseURL: e.baseURL,
227
120
  onUnauthorized: e.onUnauthorized
228
121
  });
@@ -231,7 +124,7 @@ var y = "astrogators_access_token", b = "astrogators_refresh_token", x = () => l
231
124
  let n = {
232
125
  "Content-Type": "application/json",
233
126
  ...t.headers
234
- }, r = await I(`${this.baseURL}${e}`, {
127
+ }, r = await re(`${this.baseURL}${e}`, {
235
128
  ...t,
236
129
  headers: n
237
130
  });
@@ -281,53 +174,53 @@ var y = "astrogators_access_token", b = "astrogators_refresh_token", x = () => l
281
174
  method: "DELETE"
282
175
  });
283
176
  }
284
- }, R, te = (e) => {
285
- R = new L(e);
286
- }, z = "astrogators_ally_codes", B = "astrogators_selected_ally_code", V = () => {
177
+ }, L, ae = (e) => {
178
+ L = new ie(e);
179
+ }, R = "astrogators_ally_codes", oe = "astrogators_selected_ally_code", z = () => {
287
180
  try {
288
- let e = localStorage.getItem(z);
181
+ let e = localStorage.getItem(R);
289
182
  return e ? JSON.parse(e) : [];
290
183
  } catch (e) {
291
184
  return console.error("Failed to read ally codes from localStorage:", e), [];
292
185
  }
293
- }, ne = (e) => {
186
+ }, se = (e) => {
294
187
  try {
295
- let t = V();
188
+ let t = z();
296
189
  if (t.some((t) => t.ally_code === e.ally_code)) return;
297
- t.push(e), localStorage.setItem(z, JSON.stringify(t));
190
+ t.push(e), localStorage.setItem(R, JSON.stringify(t));
298
191
  } catch (e) {
299
192
  console.error("Failed to save ally code to localStorage:", e);
300
193
  }
301
- }, re = (e) => {
194
+ }, ce = (e) => {
302
195
  try {
303
- let t = V().filter((t) => t.ally_code !== e);
304
- localStorage.setItem(z, JSON.stringify(t));
196
+ let t = z().filter((t) => t.ally_code !== e);
197
+ localStorage.setItem(R, JSON.stringify(t));
305
198
  } catch (e) {
306
199
  console.error("Failed to remove ally code from localStorage:", e);
307
200
  }
308
- }, H = (e) => {
201
+ }, le = (e) => {
309
202
  try {
310
- let t = V().map((t) => t.ally_code === e ? {
203
+ let t = z().map((t) => t.ally_code === e ? {
311
204
  ...t,
312
205
  last_used_at: (/* @__PURE__ */ new Date()).toISOString()
313
206
  } : t);
314
- localStorage.setItem(z, JSON.stringify(t));
207
+ localStorage.setItem(R, JSON.stringify(t));
315
208
  } catch (e) {
316
209
  console.error("Failed to update ally code last used:", e);
317
210
  }
318
- }, ie = () => localStorage.getItem(B), U = (e) => {
319
- e ? localStorage.setItem(B, e) : localStorage.removeItem(B);
320
- }, ae = () => {
321
- localStorage.removeItem(z), localStorage.removeItem(B);
322
- }, oe = t(void 0), se = ({ children: e, apiBaseUrl: t }) => {
323
- let [r, o] = a(null), [c, l] = a(!0), [u, d] = a(!0), [f, p] = a(!0), [m, h] = a([]), [g, _] = a(null), [v, y] = a(!1), [b, x] = a({
211
+ }, ue = () => localStorage.getItem(oe), B = (e) => {
212
+ e ? localStorage.setItem(oe, e) : localStorage.removeItem(oe);
213
+ }, de = () => {
214
+ localStorage.removeItem(R), localStorage.removeItem(oe);
215
+ }, fe = t(void 0), pe = ({ children: e, apiBaseUrl: t }) => {
216
+ let [n, i] = s(null), [o, c] = s(!0), [u, d] = s(!0), [f, p] = s(!0), [m, h] = s([]), [g, _] = s(null), [v, y] = s(!1), [b, x] = s({
324
217
  show: !1,
325
218
  localStorageCodes: []
326
219
  });
327
- te({ baseURL: t }), i(() => {
220
+ ae({ baseURL: t }), a(() => {
328
221
  (async () => {
329
222
  try {
330
- d((await R.get("/api/v1/config/features")).auth_enabled);
223
+ d((await L.get("/api/v1/config/features")).auth_enabled);
331
224
  } catch (e) {
332
225
  console.error("Failed to fetch features:", e), d(!0);
333
226
  } finally {
@@ -335,151 +228,151 @@ var y = "astrogators_access_token", b = "astrogators_refresh_token", x = () => l
335
228
  }
336
229
  })();
337
230
  }, [t]);
338
- let S = n(async () => {
339
- if (!ee()) {
340
- o(null), l(!1);
231
+ let S = r(async () => {
232
+ if (!E()) {
233
+ i(null), c(!1);
341
234
  return;
342
235
  }
343
236
  try {
344
- o(await R.get("/api/v1/users/me"));
237
+ i(await L.get("/api/v1/users/me"));
345
238
  } catch (e) {
346
- console.error("Failed to fetch user:", e), o(null), O();
239
+ console.error("Failed to fetch user:", e), i(null), T();
347
240
  } finally {
348
- l(!1);
241
+ c(!1);
349
242
  }
350
243
  }, []);
351
- i(() => {
244
+ a(() => {
352
245
  S();
353
246
  }, [S]);
354
247
  let C = async (e) => {
355
248
  try {
356
- let t = await R.post("/api/v1/auth/login", e);
357
- D(t.access_token, t.refresh_token), o(await R.get("/api/v1/users/me"));
249
+ let t = await L.post("/api/v1/auth/login", e);
250
+ w(t.access_token, t.refresh_token), i(await L.get("/api/v1/users/me"));
358
251
  } catch (e) {
359
252
  throw console.error("Login failed:", e), e;
360
253
  }
361
- }, w = async (e) => {
254
+ }, D = async (e) => {
362
255
  try {
363
- await R.post("/api/v1/auth/register", e);
256
+ await L.post("/api/v1/auth/register", e);
364
257
  } catch (e) {
365
258
  throw console.error("Registration failed:", e), e;
366
259
  }
367
- }, T = () => {
368
- O(), o(null), h([]), _(null), U(null), x({
260
+ }, O = () => {
261
+ T(), i(null), h([]), _(null), B(null), x({
369
262
  show: !1,
370
263
  localStorageCodes: []
371
264
  });
372
- }, E = async () => {
265
+ }, k = async () => {
373
266
  await S();
374
- }, k = async (e) => {
267
+ }, A = async (e) => {
375
268
  try {
376
- return (await R.post("/api/v1/auth/forgot-password", e)).message;
269
+ return (await L.post("/api/v1/auth/forgot-password", e)).message;
377
270
  } catch (e) {
378
271
  throw console.error("Forgot password failed:", e), e;
379
272
  }
380
- }, A = async (e) => {
273
+ }, j = async (e) => {
381
274
  try {
382
- return (await R.post("/api/v1/auth/reset-password", e)).message;
275
+ return (await L.post("/api/v1/auth/reset-password", e)).message;
383
276
  } catch (e) {
384
277
  throw console.error("Reset password failed:", e), e;
385
278
  }
386
- }, j = async (e) => {
279
+ }, ee = async (e) => {
387
280
  try {
388
- return (await R.post("/api/v1/auth/resend-verification", e)).message;
281
+ return (await L.post("/api/v1/auth/resend-verification", e)).message;
389
282
  } catch (e) {
390
283
  throw console.error("Resend verification failed:", e), e;
391
284
  }
392
- }, M = n(async () => {
285
+ }, M = r(async () => {
393
286
  y(!0);
394
287
  try {
395
288
  let e = [];
396
- if (r) {
397
- let t = await R.get("/api/v1/users/me/ally-codes");
289
+ if (n) {
290
+ let t = await L.get("/api/v1/users/me/ally-codes");
398
291
  h(t.ally_codes), e = t.ally_codes.map((e) => e.ally_code);
399
- let n = V();
292
+ let n = z();
400
293
  n.length > 0 && x({
401
294
  show: !0,
402
295
  localStorageCodes: n.map((e) => e.ally_code)
403
296
  });
404
297
  } else {
405
- let t = V();
298
+ let t = z();
406
299
  h(t), e = t.map((e) => e.ally_code);
407
300
  }
408
- let t = ie(), n = t && e.includes(t) ? t : null;
409
- _(n), n !== t && U(n);
301
+ let t = ue(), r = t && e.includes(t) ? t : null;
302
+ _(r), r !== t && B(r);
410
303
  } catch (e) {
411
304
  console.error("Failed to fetch ally codes:", e), h([]);
412
305
  } finally {
413
306
  y(!1);
414
307
  }
415
- }, [r]), N = n(async (e) => {
416
- r && typeof e == "number" ? (await R.put(`/api/v1/users/me/ally-codes/${e}/use`, {}), await M()) : !r && typeof e == "string" && (H(e), h(V()));
417
- }, [r, M]), P = n((e) => {
418
- if (_(e), U(e), e && r) {
308
+ }, [n]), N = r(async (e) => {
309
+ n && typeof e == "number" ? (await L.put(`/api/v1/users/me/ally-codes/${e}/use`, {}), await M()) : !n && typeof e == "string" && (le(e), h(z()));
310
+ }, [n, M]), P = r((e) => {
311
+ if (_(e), B(e), e && n) {
419
312
  let t = m.find((t) => "ally_code" in t && t.ally_code === e);
420
313
  t && "id" in t && N(t.id);
421
- } else e && !r && H(e);
314
+ } else e && !n && le(e);
422
315
  }, [
423
- r,
316
+ n,
424
317
  m,
425
318
  N
426
- ]), F = n(async (e) => {
319
+ ]), F = r(async (e) => {
427
320
  if (!/^\d{9}$/.test(e)) throw Error("Ally code must be exactly 9 digits");
428
- if (r) {
429
- let t = await R.post("/api/v1/users/me/ally-codes", { ally_code: e });
321
+ if (n) {
322
+ let t = await L.post("/api/v1/users/me/ally-codes", { ally_code: e });
430
323
  h((e) => [t, ...e]), m.length === 0 && P(e);
431
324
  } else {
432
- let t = await R.get(`/api/v1/player-data/player/${e}`);
325
+ let t = await L.get(`/api/v1/player-data/player/${e}`);
433
326
  if (!t) throw Error("Invalid ally code - player not found");
434
- ne({
327
+ se({
435
328
  ally_code: e,
436
329
  player_name: t.data?.name ?? null,
437
330
  last_used_at: (/* @__PURE__ */ new Date()).toISOString()
438
- }), h(V()), m.length === 0 && P(e);
331
+ }), h(z()), m.length === 0 && P(e);
439
332
  }
440
333
  }, [
441
- r,
334
+ n,
442
335
  m.length,
443
336
  P
444
- ]), I = n(async (e) => {
445
- r && typeof e == "number" ? (await R.delete(`/api/v1/users/me/ally-codes/${e}`), h((t) => t.filter((t) => "id" in t && t.id !== e))) : !r && typeof e == "string" && (re(e), h(V()), g === e && P(null));
337
+ ]), te = r(async (e) => {
338
+ n && typeof e == "number" ? (await L.delete(`/api/v1/users/me/ally-codes/${e}`), h((t) => t.filter((t) => "id" in t && t.id !== e))) : !n && typeof e == "string" && (ce(e), h(z()), g === e && P(null));
446
339
  }, [
447
- r,
340
+ n,
448
341
  g,
449
342
  P
450
- ]), L = n(() => {
343
+ ]), I = r(() => {
451
344
  x({
452
345
  show: !1,
453
346
  localStorageCodes: []
454
347
  });
455
- }, []), z = n(async () => {
456
- if (!r) return;
457
- let e = V();
348
+ }, []), ne = r(async () => {
349
+ if (!n) return;
350
+ let e = z();
458
351
  for (let t of e) try {
459
352
  await F(t.ally_code);
460
353
  } catch (e) {
461
354
  console.error(`Failed to migrate ally code ${t.ally_code}:`, e);
462
355
  }
463
- ae(), L();
356
+ de(), I();
464
357
  }, [
465
- r,
358
+ n,
466
359
  F,
467
- L
360
+ I
468
361
  ]);
469
- i(() => {
362
+ a(() => {
470
363
  M();
471
364
  }, [M]);
472
- let B = {
473
- user: r,
474
- isAuthenticated: !!r,
475
- isLoading: c,
365
+ let re = {
366
+ user: n,
367
+ isAuthenticated: !!n,
368
+ isLoading: o,
476
369
  login: C,
477
- register: w,
478
- logout: T,
479
- refreshUser: E,
480
- forgotPassword: k,
481
- resetPassword: A,
482
- resendVerification: j,
370
+ register: D,
371
+ logout: O,
372
+ refreshUser: k,
373
+ forgotPassword: A,
374
+ resetPassword: j,
375
+ resendVerification: ee,
483
376
  authEnabled: u,
484
377
  isLoadingFeatures: f,
485
378
  allyCodes: m,
@@ -487,229 +380,690 @@ var y = "astrogators_access_token", b = "astrogators_refresh_token", x = () => l
487
380
  isLoadingAllyCodes: v,
488
381
  fetchAllyCodes: M,
489
382
  addAllyCode: F,
490
- removeAllyCode: I,
383
+ removeAllyCode: te,
491
384
  selectAllyCode: P,
492
385
  updateAllyCodeLastUsed: N,
493
386
  migrationPrompt: b,
494
- dismissMigrationPrompt: L,
495
- migrateLocalStorageCodes: z
387
+ dismissMigrationPrompt: I,
388
+ migrateLocalStorageCodes: ne
496
389
  };
497
- return /* @__PURE__ */ s(oe.Provider, {
498
- value: B,
390
+ return /* @__PURE__ */ l(fe.Provider, {
391
+ value: re,
499
392
  children: e
500
393
  });
501
- }, W = () => {
502
- let e = r(oe);
394
+ }, V = () => {
395
+ let e = i(fe);
503
396
  if (e === void 0) throw Error("useAuth must be used within an AuthProvider");
504
397
  return e;
505
- }, G = (e) => !e || e.length !== 9 ? e : `${e.slice(0, 3)}-${e.slice(3, 6)}-${e.slice(6, 9)}`, ce = (e) => e.replace(/-/g, ""), K = {
506
- allyCodeDropdown: "_allyCodeDropdown_1m0tw_1",
507
- select: "_select_1m0tw_8",
508
- manageButton: "_manageButton_1m0tw_12",
509
- managePanel: "_managePanel_1m0tw_16",
510
- addSection: "_addSection_1m0tw_37",
511
- addInputGroup: "_addInputGroup_1m0tw_43",
512
- error: "_error_1m0tw_55",
513
- success: "_success_1m0tw_61",
514
- codesList: "_codesList_1m0tw_67",
515
- codeItem: "_codeItem_1m0tw_71",
516
- doneButton: "_doneButton_1m0tw_88"
517
- }, le = ({ onAllyCodeSelected: e, className: t = "" }) => {
518
- let { allyCodes: n, selectedAllyCode: r, selectAllyCode: i, removeAllyCode: o, addAllyCode: l, isLoadingAllyCodes: u } = W(), [d, f] = a(!1), [p, h] = a(""), [_, y] = a(""), [b, x] = a(""), [S, C] = a(!1), w = n.map((e) => ({
398
+ };
399
+ //#endregion
400
+ //#region src/hooks/useDismissableMenu.ts
401
+ function me({ isOpen: e, onClose: t, triggerRef: n, panelRef: r }) {
402
+ a(() => {
403
+ if (!e) return;
404
+ let i = (e) => {
405
+ let i = e.target;
406
+ n.current?.contains(i) || r.current?.contains(i) || t();
407
+ }, a = (e) => {
408
+ e.key === "Escape" && (t(), n.current?.focus());
409
+ };
410
+ return document.addEventListener("mousedown", i), document.addEventListener("keydown", a), () => {
411
+ document.removeEventListener("mousedown", i), document.removeEventListener("keydown", a);
412
+ };
413
+ }, [
414
+ e,
415
+ t,
416
+ n,
417
+ r
418
+ ]);
419
+ }
420
+ var H = {
421
+ navMenu: "_navMenu_b9xlf_1",
422
+ trigger: "_trigger_b9xlf_8",
423
+ tabActive: "_tabActive_b9xlf_29",
424
+ chevron: "_chevron_b9xlf_34",
425
+ panel: "_panel_b9xlf_43",
426
+ sectionLink: "_sectionLink_b9xlf_57",
427
+ sectionActive: "_sectionActive_b9xlf_71",
428
+ comingSoon: "_comingSoon_b9xlf_76"
429
+ }, he = ({ app: e, isCurrentApp: t, activeSectionId: n, isOpen: r, onOpenChange: i, onSectionClick: a }) => {
430
+ let { isAuthenticated: s, user: c } = V(), d = o(null), f = o(null), p = `navmenu-panel-${e.id}`;
431
+ me({
432
+ isOpen: r,
433
+ onClose: () => i(!1),
434
+ triggerRef: d,
435
+ panelRef: f
436
+ });
437
+ let m = e.sections.filter((e) => !(e.requiresAuth && !s || e.roles && (!c || !e.roles.includes(c.role)))), h = (e) => (n) => {
438
+ t && a?.(e, n), i(!1);
439
+ };
440
+ return /* @__PURE__ */ u("div", {
441
+ className: H.navMenu,
442
+ children: [/* @__PURE__ */ u("button", {
443
+ type: "button",
444
+ ref: d,
445
+ className: `${H.trigger} ${t ? H.tabActive : ""}`,
446
+ "aria-expanded": r,
447
+ "aria-controls": p,
448
+ "aria-haspopup": "true",
449
+ onClick: () => i(!r),
450
+ children: [e.label, /* @__PURE__ */ l("svg", {
451
+ className: H.chevron,
452
+ width: "10",
453
+ height: "6",
454
+ viewBox: "0 0 10 6",
455
+ "aria-hidden": "true",
456
+ children: /* @__PURE__ */ l("path", {
457
+ d: "M1 1l4 4 4-4",
458
+ stroke: "currentColor",
459
+ strokeWidth: "1.5",
460
+ fill: "none",
461
+ strokeLinecap: "round",
462
+ strokeLinejoin: "round"
463
+ })
464
+ })]
465
+ }), r && /* @__PURE__ */ l("div", {
466
+ id: p,
467
+ ref: f,
468
+ className: H.panel,
469
+ children: e.status === "coming-soon" ? /* @__PURE__ */ l("div", {
470
+ className: H.comingSoon,
471
+ children: "Coming soon"
472
+ }) : /* @__PURE__ */ l("nav", {
473
+ "aria-label": `${e.label} sections`,
474
+ onKeyDown: (e) => {
475
+ if (e.key !== "ArrowDown" && e.key !== "ArrowUp") return;
476
+ let t = Array.from(e.currentTarget.querySelectorAll("a")), n = t.indexOf(document.activeElement);
477
+ n !== -1 && (e.preventDefault(), t[e.key === "ArrowDown" ? (n + 1) % t.length : (n - 1 + t.length) % t.length]?.focus());
478
+ },
479
+ children: m.map((e) => {
480
+ let r = t && n === e.id;
481
+ return /* @__PURE__ */ l("a", {
482
+ href: e.href,
483
+ className: `${H.sectionLink} ${r ? H.sectionActive : ""}`,
484
+ "aria-current": r ? "page" : void 0,
485
+ onClick: h(e),
486
+ children: e.label
487
+ }, e.id);
488
+ })
489
+ })
490
+ })]
491
+ });
492
+ }, ge = { burger: "_burger_javjr_1" }, _e = n(({ isOpen: e, onClick: t, controlsId: n }, r) => /* @__PURE__ */ l("button", {
493
+ ref: r,
494
+ type: "button",
495
+ className: ge.burger,
496
+ onClick: t,
497
+ "aria-expanded": e,
498
+ "aria-controls": n,
499
+ "aria-label": e ? "Close navigation menu" : "Open navigation menu",
500
+ children: e ? /* @__PURE__ */ l("svg", {
501
+ width: "20",
502
+ height: "20",
503
+ viewBox: "0 0 20 20",
504
+ "aria-hidden": "true",
505
+ children: /* @__PURE__ */ l("path", {
506
+ d: "M4 4l12 12M16 4L4 16",
507
+ stroke: "currentColor",
508
+ strokeWidth: "2",
509
+ strokeLinecap: "round"
510
+ })
511
+ }) : /* @__PURE__ */ l("svg", {
512
+ width: "20",
513
+ height: "20",
514
+ viewBox: "0 0 20 20",
515
+ "aria-hidden": "true",
516
+ children: /* @__PURE__ */ l("path", {
517
+ d: "M2 5h16M2 10h16M2 15h16",
518
+ stroke: "currentColor",
519
+ strokeWidth: "2",
520
+ strokeLinecap: "round"
521
+ })
522
+ })
523
+ }));
524
+ _e.displayName = "NavBurger";
525
+ //#endregion
526
+ //#region src/navigation/suiteNav.ts
527
+ var ve = [
528
+ {
529
+ id: "mod-ledger",
530
+ label: "Mod Ledger",
531
+ href: "/mod-ledger/",
532
+ status: "available",
533
+ sections: [
534
+ {
535
+ id: "grid",
536
+ label: "Grid",
537
+ href: "/mod-ledger/"
538
+ },
539
+ {
540
+ id: "evaluations",
541
+ label: "Evaluations",
542
+ href: "/mod-ledger/evaluations"
543
+ },
544
+ {
545
+ id: "moderation",
546
+ label: "Moderation",
547
+ href: "/mod-ledger/moderation",
548
+ roles: ["admin", "mod"]
549
+ }
550
+ ]
551
+ },
552
+ {
553
+ id: "navicharts",
554
+ label: "Navicharts",
555
+ href: "/navicharts/",
556
+ status: "available",
557
+ sections: [{
558
+ id: "library",
559
+ label: "My Star Charts",
560
+ href: "/navicharts/"
561
+ }]
562
+ },
563
+ {
564
+ id: "nightwatcher",
565
+ label: "Nightwatcher",
566
+ href: "/nightwatcher/",
567
+ status: "available",
568
+ sections: [{
569
+ id: "overview",
570
+ label: "Overview",
571
+ href: "/nightwatcher/"
572
+ }]
573
+ }
574
+ ], U = {
575
+ selectWrapper: "_selectWrapper_ir4bq_1",
576
+ fullWidth: "_fullWidth_ir4bq_7",
577
+ label: "_label_ir4bq_11",
578
+ required: "_required_ir4bq_20",
579
+ selectContainer: "_selectContainer_ir4bq_24",
580
+ select: "_select_ir4bq_1",
581
+ error: "_error_ir4bq_63",
582
+ arrow: "_arrow_ir4bq_71",
583
+ errorText: "_errorText_ir4bq_81",
584
+ helperText: "_helperText_ir4bq_86"
585
+ }, ye = e.forwardRef(({ label: e, error: t, helperText: n, options: r, placeholder: i, fullWidth: a = !1, className: o = "", id: s, ...c }, d) => {
586
+ let f = s || `select-${Math.random().toString(36).substr(2, 9)}`, p = !!t;
587
+ return /* @__PURE__ */ u("div", {
588
+ className: `${U.selectWrapper} ${a ? U.fullWidth : ""} ${o}`,
589
+ children: [
590
+ e && /* @__PURE__ */ u("label", {
591
+ htmlFor: f,
592
+ className: U.label,
593
+ children: [e, c.required && /* @__PURE__ */ l("span", {
594
+ className: U.required,
595
+ children: "*"
596
+ })]
597
+ }),
598
+ /* @__PURE__ */ u("div", {
599
+ className: U.selectContainer,
600
+ children: [/* @__PURE__ */ u("select", {
601
+ ref: d,
602
+ id: f,
603
+ className: `${U.select} ${p ? U.error : ""}`,
604
+ ...c,
605
+ children: [
606
+ i && /* @__PURE__ */ l("option", {
607
+ value: "",
608
+ disabled: !0,
609
+ children: i
610
+ }),
611
+ r && r.map((e) => /* @__PURE__ */ l("option", {
612
+ value: e.value,
613
+ disabled: e.disabled,
614
+ children: e.label
615
+ }, e.value)),
616
+ !r && c.children
617
+ ]
618
+ }), /* @__PURE__ */ l("span", {
619
+ className: U.arrow,
620
+ children: "▼"
621
+ })]
622
+ }),
623
+ t && /* @__PURE__ */ l("span", {
624
+ className: U.errorText,
625
+ children: t
626
+ }),
627
+ n && !t && /* @__PURE__ */ l("span", {
628
+ className: U.helperText,
629
+ children: n
630
+ })
631
+ ]
632
+ });
633
+ });
634
+ ye.displayName = "Select";
635
+ var W = {
636
+ button: "_button_159ms_1",
637
+ sm: "_sm_159ms_22",
638
+ md: "_md_159ms_28",
639
+ lg: "_lg_159ms_34",
640
+ primary: "_primary_159ms_41",
641
+ secondary: "_secondary_159ms_55",
642
+ outline: "_outline_159ms_69",
643
+ ghost: "_ghost_159ms_80",
644
+ danger: "_danger_159ms_89",
645
+ fullWidth: "_fullWidth_159ms_100",
646
+ loading: "_loading_159ms_105",
647
+ loadingSpinner: "_loadingSpinner_159ms_110",
648
+ spinner: "_spinner_159ms_116",
649
+ spin: "_spin_159ms_116",
650
+ loadingText: "_loadingText_159ms_131"
651
+ }, G = ({ children: e, variant: t = "primary", size: n = "md", fullWidth: r = !1, loading: i = !1, disabled: a = !1, className: o = "", ...s }) => /* @__PURE__ */ l("button", {
652
+ className: `${W.button} ${W[t]} ${W[n]} ${r ? W.fullWidth : ""} ${i ? W.loading : ""} ${o}`,
653
+ disabled: a || i,
654
+ ...s,
655
+ children: i ? /* @__PURE__ */ u("span", {
656
+ className: W.loadingSpinner,
657
+ children: [/* @__PURE__ */ l("span", { className: W.spinner }), /* @__PURE__ */ l("span", {
658
+ className: W.loadingText,
659
+ children: e
660
+ })]
661
+ }) : e
662
+ }), K = {
663
+ inputWrapper: "_inputWrapper_15t4g_1",
664
+ fullWidth: "_fullWidth_15t4g_7",
665
+ label: "_label_15t4g_11",
666
+ required: "_required_15t4g_20",
667
+ input: "_input_15t4g_1",
668
+ error: "_error_15t4g_55",
669
+ errorText: "_errorText_15t4g_63",
670
+ helperText: "_helperText_15t4g_68"
671
+ }, be = e.forwardRef(({ label: e, error: t, helperText: n, fullWidth: r = !1, className: i = "", id: a, ...o }, s) => {
672
+ let c = a || `input-${Math.random().toString(36).substr(2, 9)}`, d = !!t;
673
+ return /* @__PURE__ */ u("div", {
674
+ className: `${K.inputWrapper} ${r ? K.fullWidth : ""} ${i}`,
675
+ children: [
676
+ e && /* @__PURE__ */ u("label", {
677
+ htmlFor: c,
678
+ className: K.label,
679
+ children: [e, o.required && /* @__PURE__ */ l("span", {
680
+ className: K.required,
681
+ children: "*"
682
+ })]
683
+ }),
684
+ /* @__PURE__ */ l("input", {
685
+ ref: s,
686
+ id: c,
687
+ className: `${K.input} ${d ? K.error : ""}`,
688
+ ...o
689
+ }),
690
+ t && /* @__PURE__ */ l("span", {
691
+ className: K.errorText,
692
+ children: t
693
+ }),
694
+ n && !t && /* @__PURE__ */ l("span", {
695
+ className: K.helperText,
696
+ children: n
697
+ })
698
+ ]
699
+ });
700
+ });
701
+ be.displayName = "Input";
702
+ //#endregion
703
+ //#region src/utils/formatAllyCode.ts
704
+ var q = (e) => !e || e.length !== 9 ? e : `${e.slice(0, 3)}-${e.slice(3, 6)}-${e.slice(6, 9)}`, xe = (e) => e.replace(/-/g, ""), J = {
705
+ allyCodeDropdown: "_allyCodeDropdown_1pawi_1",
706
+ select: "_select_1pawi_8",
707
+ manageButton: "_manageButton_1pawi_12",
708
+ managePanel: "_managePanel_1pawi_16",
709
+ addSection: "_addSection_1pawi_37",
710
+ addInputGroup: "_addInputGroup_1pawi_43",
711
+ error: "_error_1pawi_55",
712
+ success: "_success_1pawi_61",
713
+ codesList: "_codesList_1pawi_67",
714
+ codeItem: "_codeItem_1pawi_71",
715
+ doneButton: "_doneButton_1pawi_88",
716
+ inline: "_inline_1pawi_107"
717
+ }, Se = ({ onAllyCodeSelected: e, className: t = "", isOpen: n, onOpenChange: r, variant: i = "floating" }) => {
718
+ let { allyCodes: a, selectedAllyCode: c, selectAllyCode: d, removeAllyCode: f, addAllyCode: p, isLoadingAllyCodes: m } = V(), [h, g] = s(!1), _ = n ?? h, v = (e) => {
719
+ g(e), r?.(e);
720
+ }, [y, b] = s(""), [x, S] = s(""), [C, w] = s(""), [T, E] = s(!1), D = o(null), O = o(null);
721
+ me({
722
+ isOpen: _ && i === "floating",
723
+ onClose: () => v(!1),
724
+ triggerRef: D,
725
+ panelRef: O
726
+ });
727
+ let k = a.map((e) => ({
519
728
  value: e.ally_code,
520
- label: e.player_name ? `${e.player_name} (${G(e.ally_code)})` : G(e.ally_code)
521
- })), T = (t) => {
729
+ label: e.player_name ? `${e.player_name} (${q(e.ally_code)})` : q(e.ally_code)
730
+ })), A = (t) => {
522
731
  let n = t.target.value || null;
523
- i(n), e?.(n);
524
- }, E = async (e) => {
525
- let t = n.find((t) => t.ally_code === e);
526
- t && await o("id" in t ? t.id : t.ally_code);
527
- }, D = async () => {
528
- if (y(""), x(""), !/^\d{9}$/.test(p)) {
529
- y("Ally code must be exactly 9 digits");
732
+ d(n), e?.(n);
733
+ }, j = async (e) => {
734
+ let t = a.find((t) => t.ally_code === e);
735
+ t && await f("id" in t ? t.id : t.ally_code);
736
+ }, ee = async () => {
737
+ if (S(""), w(""), !/^\d{9}$/.test(y)) {
738
+ S("Ally code must be exactly 9 digits");
530
739
  return;
531
740
  }
532
- C(!0);
741
+ E(!0);
533
742
  try {
534
- await l(p), x("Added successfully!"), h(""), setTimeout(() => x(""), 2e3);
743
+ await p(y), w("Added successfully!"), b(""), setTimeout(() => w(""), 2e3);
535
744
  } catch (e) {
536
- y(e.message || "Failed to add ally code");
745
+ S(e.message || "Failed to add ally code");
537
746
  } finally {
538
- C(!1);
747
+ E(!1);
539
748
  }
540
- }, O = n.length > 0;
541
- return /* @__PURE__ */ c("div", {
542
- className: `${K.allyCodeDropdown} ${t}`,
749
+ }, M = a.length > 0;
750
+ return /* @__PURE__ */ u("div", {
751
+ className: `${J.allyCodeDropdown} ${i === "inline" ? J.inline : ""} ${t}`,
543
752
  children: [
544
- O && /* @__PURE__ */ s(g, {
545
- options: w,
546
- value: r || "",
547
- onChange: T,
753
+ M && /* @__PURE__ */ l(ye, {
754
+ options: k,
755
+ value: c || "",
756
+ onChange: A,
548
757
  placeholder: "Select ally code",
549
- disabled: u,
550
- className: K.select
758
+ disabled: m,
759
+ className: J.select
551
760
  }),
552
- d && /* @__PURE__ */ c("div", {
553
- className: K.managePanel,
761
+ _ && /* @__PURE__ */ u("div", {
762
+ className: J.managePanel,
763
+ ref: O,
764
+ id: "ally-code-manage-panel",
554
765
  children: [
555
- /* @__PURE__ */ s("h4", { children: "Manage Ally Codes" }),
556
- /* @__PURE__ */ c("div", {
557
- className: K.addSection,
766
+ /* @__PURE__ */ l("h4", { children: "Manage Ally Codes" }),
767
+ /* @__PURE__ */ u("div", {
768
+ className: J.addSection,
558
769
  children: [
559
- /* @__PURE__ */ c("div", {
560
- className: K.addInputGroup,
561
- children: [/* @__PURE__ */ s(v, {
770
+ /* @__PURE__ */ u("div", {
771
+ className: J.addInputGroup,
772
+ children: [/* @__PURE__ */ l(be, {
562
773
  type: "text",
563
774
  placeholder: "9-digit ally code",
564
- value: p,
565
- onChange: (e) => h(e.target.value.replace(/\D/g, "").slice(0, 9)),
566
- disabled: S
567
- }), /* @__PURE__ */ s(m, {
775
+ value: y,
776
+ onChange: (e) => b(e.target.value.replace(/\D/g, "").slice(0, 9)),
777
+ disabled: T
778
+ }), /* @__PURE__ */ l(G, {
568
779
  variant: "primary",
569
780
  size: "sm",
570
- onClick: D,
571
- loading: S,
572
- disabled: p.length !== 9,
781
+ onClick: ee,
782
+ loading: T,
783
+ disabled: y.length !== 9,
573
784
  children: "Add"
574
785
  })]
575
786
  }),
576
- _ && /* @__PURE__ */ s("div", {
577
- className: K.error,
578
- children: _
787
+ x && /* @__PURE__ */ l("div", {
788
+ className: J.error,
789
+ children: x
579
790
  }),
580
- b && /* @__PURE__ */ s("div", {
581
- className: K.success,
582
- children: b
791
+ C && /* @__PURE__ */ l("div", {
792
+ className: J.success,
793
+ children: C
583
794
  })
584
795
  ]
585
796
  }),
586
- /* @__PURE__ */ s("div", {
587
- className: K.codesList,
588
- children: n.map((e) => /* @__PURE__ */ c("div", {
589
- className: K.codeItem,
590
- children: [/* @__PURE__ */ s("span", { children: e.player_name ? `${e.player_name} (${G(e.ally_code)})` : G(e.ally_code) }), /* @__PURE__ */ s(m, {
797
+ /* @__PURE__ */ l("div", {
798
+ className: J.codesList,
799
+ children: a.map((e) => /* @__PURE__ */ u("div", {
800
+ className: J.codeItem,
801
+ children: [/* @__PURE__ */ l("span", { children: e.player_name ? `${e.player_name} (${q(e.ally_code)})` : q(e.ally_code) }), /* @__PURE__ */ l(G, {
591
802
  variant: "ghost",
592
803
  size: "sm",
593
- onClick: () => E(e.ally_code),
804
+ onClick: () => j(e.ally_code),
594
805
  children: "Remove"
595
806
  })]
596
807
  }, e.ally_code))
597
808
  }),
598
- /* @__PURE__ */ s(m, {
809
+ /* @__PURE__ */ l(G, {
599
810
  variant: "secondary",
600
811
  size: "sm",
601
- onClick: () => f(!1),
602
- className: K.doneButton,
812
+ onClick: () => v(!1),
813
+ className: J.doneButton,
603
814
  children: "Done"
604
815
  })
605
816
  ]
606
817
  }),
607
- /* @__PURE__ */ s(m, {
818
+ /* @__PURE__ */ l("span", {
819
+ ref: D,
820
+ children: /* @__PURE__ */ l(G, {
821
+ variant: "ghost",
822
+ size: "sm",
823
+ onClick: () => v(!_),
824
+ className: J.manageButton,
825
+ "aria-expanded": _,
826
+ "aria-controls": "ally-code-manage-panel",
827
+ "aria-haspopup": "true",
828
+ children: M ? "Manage" : "+ Add ally code"
829
+ })
830
+ })
831
+ ]
832
+ });
833
+ }, Ce = {
834
+ authCluster: "_authCluster_17o10_1",
835
+ userLink: "_userLink_17o10_7",
836
+ adminLink: "_adminLink_17o10_16"
837
+ }, we = ({ showAuth: e = !0 }) => {
838
+ let { user: t, isAuthenticated: n, logout: r, authEnabled: i } = V();
839
+ return e ? n ? /* @__PURE__ */ u("div", {
840
+ className: Ce.authCluster,
841
+ children: [
842
+ t?.role === "admin" && /* @__PURE__ */ l("a", {
843
+ href: "/admin/users",
844
+ className: Ce.adminLink,
845
+ children: "Admin"
846
+ }),
847
+ /* @__PURE__ */ l("a", {
848
+ href: "/profile",
849
+ className: Ce.userLink,
850
+ children: t?.username
851
+ }),
852
+ /* @__PURE__ */ l(G, {
608
853
  variant: "ghost",
609
854
  size: "sm",
610
- onClick: () => f(!d),
611
- className: K.manageButton,
612
- children: O ? "Manage" : "+ Add ally code"
855
+ onClick: () => {
856
+ r(), window.location.href = "/";
857
+ },
858
+ children: "Logout"
613
859
  })
614
860
  ]
615
- });
616
- }, q = {
617
- logoLink: "_logoLink_84pn2_3",
618
- appNav: "_appNav_84pn2_9",
619
- appName: "_appName_84pn2_15",
620
- tabs: "_tabs_84pn2_29",
621
- tab: "_tab_84pn2_29",
622
- tabActive: "_tabActive_84pn2_56",
623
- extrasGroup: "_extrasGroup_84pn2_64",
624
- authCluster: "_authCluster_84pn2_70",
625
- userLink: "_userLink_84pn2_76"
626
- }, ue = ({ hubUrl: t = "/", appName: n, appHref: r = "/", navItems: i, showAllyCode: a = !1, showAuth: l = !0, rightExtras: u, className: d }) => {
627
- let { user: p, isAuthenticated: h, logout: g, authEnabled: _ } = W(), v = () => {
628
- g(), window.location.href = t;
629
- }, y = !!u || a, b = !!(i && i.length > 0), x = !!n || b, S = l ? h ? /* @__PURE__ */ c("div", {
630
- className: q.authCluster,
631
- children: [/* @__PURE__ */ s("a", {
632
- href: "/profile",
633
- className: q.userLink,
634
- children: p?.username
635
- }), /* @__PURE__ */ s(m, {
636
- variant: "ghost",
637
- size: "sm",
638
- onClick: v,
639
- children: "Logout"
640
- })]
641
- }) : _ ? /* @__PURE__ */ c("div", {
642
- className: q.authCluster,
643
- children: [/* @__PURE__ */ s("a", {
861
+ }) : i ? /* @__PURE__ */ u("div", {
862
+ className: Ce.authCluster,
863
+ children: [/* @__PURE__ */ l("a", {
644
864
  href: "/login",
645
- children: /* @__PURE__ */ s(m, {
865
+ children: /* @__PURE__ */ l(G, {
646
866
  variant: "ghost",
647
867
  size: "sm",
648
868
  children: "Login"
649
869
  })
650
- }), /* @__PURE__ */ s("a", {
870
+ }), /* @__PURE__ */ l("a", {
651
871
  href: "/register",
652
- children: /* @__PURE__ */ s(m, {
872
+ children: /* @__PURE__ */ l(G, {
653
873
  variant: "primary",
654
874
  size: "sm",
655
875
  children: "Sign Up"
656
876
  })
657
877
  })]
658
878
  }) : null : null;
659
- return /* @__PURE__ */ s(f, {
879
+ }, Y = {
880
+ backdrop: "_backdrop_1n4uh_1",
881
+ panel: "_panel_1n4uh_11",
882
+ accordion: "_accordion_1n4uh_24",
883
+ accordionItem: "_accordionItem_1n4uh_29",
884
+ accordionHeader: "_accordionHeader_1n4uh_33",
885
+ currentApp: "_currentApp_1n4uh_48",
886
+ chevron: "_chevron_1n4uh_53",
887
+ chevronOpen: "_chevronOpen_1n4uh_58",
888
+ accordionPanel: "_accordionPanel_1n4uh_62",
889
+ sectionLink: "_sectionLink_1n4uh_68",
890
+ sectionActive: "_sectionActive_1n4uh_79",
891
+ comingSoon: "_comingSoon_1n4uh_85",
892
+ allySection: "_allySection_1n4uh_91",
893
+ extrasSection: "_extrasSection_1n4uh_92",
894
+ accountSection: "_accountSection_1n4uh_93"
895
+ }, Te = ({ isOpen: e, onClose: t, currentApp: n, activeSectionId: r, onSectionClick: i, rightExtras: c, showAuth: f, panelId: p, returnFocusRef: m }) => {
896
+ let { isAuthenticated: h, user: g } = V(), [_, v] = s(n === "hub" ? null : n), y = o(null);
897
+ if (a(() => (e ? document.body.style.overflow = "hidden" : document.body.style.overflow = "unset", () => {
898
+ document.body.style.overflow = "unset";
899
+ }), [e]), a(() => {
900
+ if (!e) return;
901
+ let r = (e) => {
902
+ e.key === "Escape" && (t(), m.current?.focus());
903
+ };
904
+ return document.addEventListener("keydown", r), v(n === "hub" ? null : n), y.current?.focus(), () => document.removeEventListener("keydown", r);
905
+ }, [e]), !e) return null;
906
+ let b = (e, r) => (a) => {
907
+ e === n && i?.(r, a), t();
908
+ };
909
+ return d(/* @__PURE__ */ l("div", {
910
+ className: Y.backdrop,
911
+ onClick: t,
912
+ children: /* @__PURE__ */ u("div", {
913
+ ref: y,
914
+ id: p,
915
+ role: "dialog",
916
+ "aria-modal": "true",
917
+ "aria-label": "Navigation menu",
918
+ tabIndex: -1,
919
+ className: Y.panel,
920
+ onClick: (e) => e.stopPropagation(),
921
+ children: [
922
+ /* @__PURE__ */ l("div", {
923
+ className: Y.accordion,
924
+ children: ve.map((e) => {
925
+ let t = _ === e.id, i = n === e.id, a = e.sections.filter((e) => !(e.requiresAuth && !h || e.roles && (!g || !e.roles.includes(g.role)))), o = `mobile-accordion-${e.id}`;
926
+ return /* @__PURE__ */ u("div", {
927
+ className: Y.accordionItem,
928
+ children: [/* @__PURE__ */ u("button", {
929
+ type: "button",
930
+ className: `${Y.accordionHeader} ${i ? Y.currentApp : ""}`,
931
+ "aria-expanded": t,
932
+ "aria-controls": o,
933
+ onClick: () => v(t ? null : e.id),
934
+ children: [e.label, /* @__PURE__ */ l("svg", {
935
+ className: `${Y.chevron} ${t ? Y.chevronOpen : ""}`,
936
+ width: "10",
937
+ height: "6",
938
+ viewBox: "0 0 10 6",
939
+ "aria-hidden": "true",
940
+ children: /* @__PURE__ */ l("path", {
941
+ d: "M1 1l4 4 4-4",
942
+ stroke: "currentColor",
943
+ strokeWidth: "1.5",
944
+ fill: "none",
945
+ strokeLinecap: "round",
946
+ strokeLinejoin: "round"
947
+ })
948
+ })]
949
+ }), t && /* @__PURE__ */ l("div", {
950
+ id: o,
951
+ className: Y.accordionPanel,
952
+ children: e.status === "coming-soon" ? /* @__PURE__ */ l("div", {
953
+ className: Y.comingSoon,
954
+ children: "Coming soon"
955
+ }) : a.map((t) => {
956
+ let n = i && r === t.id;
957
+ return /* @__PURE__ */ l("a", {
958
+ href: t.href,
959
+ className: `${Y.sectionLink} ${n ? Y.sectionActive : ""}`,
960
+ "aria-current": n ? "page" : void 0,
961
+ onClick: b(e.id, t),
962
+ children: t.label
963
+ }, t.id);
964
+ })
965
+ })]
966
+ }, e.id);
967
+ })
968
+ }),
969
+ /* @__PURE__ */ l("div", {
970
+ className: Y.allySection,
971
+ children: /* @__PURE__ */ l(Se, { variant: "inline" })
972
+ }),
973
+ c && /* @__PURE__ */ l("div", {
974
+ className: Y.extrasSection,
975
+ children: c
976
+ }),
977
+ /* @__PURE__ */ l("div", {
978
+ className: Y.accountSection,
979
+ children: /* @__PURE__ */ l(we, { showAuth: f })
980
+ })
981
+ ]
982
+ })
983
+ }), document.body);
984
+ }, Ee = {
985
+ logoLink: "_logoLink_12f5f_3",
986
+ appMenus: "_appMenus_12f5f_10",
987
+ desktopRight: "_desktopRight_12f5f_19",
988
+ extrasGroup: "_extrasGroup_12f5f_25"
989
+ }, De = ({ currentApp: e, activeSectionId: t, onNavigate: n, rightExtras: r, showAuth: i = !0, className: d }) => {
990
+ let [f, p] = s(null), [m, g] = s(!1), _ = o(null), v = "suite-mobile-nav-panel";
991
+ return a(() => {
992
+ let e = window.matchMedia("(max-width: 768px)"), t = () => {
993
+ p(null), g(!1);
994
+ };
995
+ return e.addEventListener("change", t), () => e.removeEventListener("change", t);
996
+ }, []), /* @__PURE__ */ u(c, { children: [/* @__PURE__ */ l(h, {
660
997
  className: d,
661
- logo: /* @__PURE__ */ s("a", {
662
- href: t,
663
- className: q.logoLink,
998
+ logo: /* @__PURE__ */ l("a", {
999
+ href: "/",
1000
+ className: Ee.logoLink,
664
1001
  children: "The Astrogator's Table"
665
1002
  }),
666
- leftContent: x ? /* @__PURE__ */ c("div", {
667
- className: q.appNav,
668
- children: [n && /* @__PURE__ */ s("a", {
669
- href: r,
670
- className: q.appName,
671
- children: n
672
- }), b && /* @__PURE__ */ s("nav", {
673
- className: q.tabs,
674
- children: i.map((t) => {
675
- let n = `${q.tab} ${t.active ? q.tabActive : ""}`;
676
- return t.render ? /* @__PURE__ */ s(e.Fragment, { children: t.render({
677
- className: n,
678
- children: t.label
679
- }) }, t.href) : /* @__PURE__ */ s("a", {
680
- href: t.href,
681
- className: n,
682
- children: t.label
683
- }, t.href);
684
- })
685
- })]
686
- }) : void 0,
687
- rightContent: /* @__PURE__ */ c(o, { children: [y && /* @__PURE__ */ c("div", {
688
- className: q.extrasGroup,
689
- children: [u, a && /* @__PURE__ */ s(le, {})]
690
- }), S] })
691
- });
692
- }, J = {
1003
+ leftContent: /* @__PURE__ */ l("nav", {
1004
+ className: Ee.appMenus,
1005
+ children: ve.map((r) => /* @__PURE__ */ l(he, {
1006
+ app: r,
1007
+ isCurrentApp: e === r.id,
1008
+ activeSectionId: t,
1009
+ isOpen: f === r.id,
1010
+ onOpenChange: (e) => p(e ? r.id : null),
1011
+ onSectionClick: n
1012
+ }, r.id))
1013
+ }),
1014
+ rightContent: /* @__PURE__ */ u(c, { children: [/* @__PURE__ */ u("div", {
1015
+ className: Ee.desktopRight,
1016
+ children: [
1017
+ r && /* @__PURE__ */ l("div", {
1018
+ className: Ee.extrasGroup,
1019
+ children: r
1020
+ }),
1021
+ /* @__PURE__ */ l(Se, {
1022
+ isOpen: f === "ally",
1023
+ onOpenChange: (e) => p(e ? "ally" : null)
1024
+ }),
1025
+ /* @__PURE__ */ l(we, { showAuth: i })
1026
+ ]
1027
+ }), /* @__PURE__ */ l(_e, {
1028
+ ref: _,
1029
+ isOpen: m,
1030
+ onClick: () => {
1031
+ p(null), g((e) => !e);
1032
+ },
1033
+ controlsId: v
1034
+ })] })
1035
+ }), /* @__PURE__ */ l(Te, {
1036
+ isOpen: m,
1037
+ onClose: () => g(!1),
1038
+ currentApp: e,
1039
+ activeSectionId: t,
1040
+ onSectionClick: n,
1041
+ rightExtras: r,
1042
+ showAuth: i,
1043
+ panelId: v,
1044
+ returnFocusRef: _
1045
+ })] });
1046
+ }, X = {
693
1047
  footer: "_footer_zjuj8_1",
694
1048
  content: "_content_zjuj8_7",
695
1049
  defaultContent: "_defaultContent_zjuj8_13",
696
1050
  copyright: "_copyright_zjuj8_21",
697
1051
  disclaimer: "_disclaimer_zjuj8_26"
698
- }, de = ({ children: e, className: t = "" }) => /* @__PURE__ */ s("footer", {
699
- className: `${J.footer} ${t}`,
700
- children: /* @__PURE__ */ s("div", {
701
- className: J.content,
702
- children: e || /* @__PURE__ */ c("div", {
703
- className: J.defaultContent,
704
- children: [/* @__PURE__ */ c("p", {
705
- className: J.copyright,
1052
+ }, Oe = ({ children: e, className: t = "" }) => /* @__PURE__ */ l("footer", {
1053
+ className: `${X.footer} ${t}`,
1054
+ children: /* @__PURE__ */ l("div", {
1055
+ className: X.content,
1056
+ children: e || /* @__PURE__ */ u("div", {
1057
+ className: X.defaultContent,
1058
+ children: [/* @__PURE__ */ u("p", {
1059
+ className: X.copyright,
706
1060
  children: [
707
1061
  "© ",
708
1062
  (/* @__PURE__ */ new Date()).getFullYear(),
709
1063
  " The Astrogator's Table. All rights reserved."
710
1064
  ]
711
- }), /* @__PURE__ */ s("p", {
712
- className: J.disclaimer,
1065
+ }), /* @__PURE__ */ l("p", {
1066
+ className: X.disclaimer,
713
1067
  children: "Star Wars: Galaxy of Heroes is a trademark of Electronic Arts Inc."
714
1068
  })]
715
1069
  })
@@ -717,11 +1071,11 @@ var y = "astrogators_access_token", b = "astrogators_refresh_token", x = () => l
717
1071
  });
718
1072
  //#endregion
719
1073
  //#region src/utils/formatTime.ts
720
- function fe(e) {
1074
+ function ke(e) {
721
1075
  let t = /([zZ]|[+-]\d{2}:?\d{2})$/.test(e);
722
1076
  return new Date(t ? e : `${e}Z`);
723
1077
  }
724
- function pe(e, t) {
1078
+ function Ae(e, t) {
725
1079
  let n = Math.max(0, Math.floor((t - e.getTime()) / 1e3));
726
1080
  if (n < 60) return `${n}s ago`;
727
1081
  let r = Math.floor(n / 60);
@@ -729,38 +1083,38 @@ function pe(e, t) {
729
1083
  let i = Math.floor(r / 60);
730
1084
  return i < 24 ? `${i}h ago` : `${Math.floor(i / 24)}d ago`;
731
1085
  }
732
- function Y(e) {
1086
+ function je(e) {
733
1087
  return `${Math.floor(e / 60)}:${(e % 60).toString().padStart(2, "0")}`;
734
1088
  }
735
- var X = {
1089
+ var Me = {
736
1090
  rosterRefresh: "_rosterRefresh_1rbul_3",
737
1091
  updatedLabel: "_updatedLabel_1rbul_11",
738
1092
  refreshButton: "_refreshButton_1rbul_19",
739
1093
  spin: "_spin_1rbul_31"
740
- }, me = ({ onRefresh: e, isRefreshing: t, cachedAt: n = null, refreshAvailableAt: r = null, labelPrefix: o = "Updated", className: l = "" }) => {
741
- let [u, d] = a(() => Date.now()), f = !!n || r != null && r > u;
742
- i(() => {
1094
+ }, Ne = ({ onRefresh: e, isRefreshing: t, cachedAt: n = null, refreshAvailableAt: r = null, labelPrefix: i = "Updated", className: o = "" }) => {
1095
+ let [c, d] = s(() => Date.now()), f = !!n || r != null && r > c;
1096
+ a(() => {
743
1097
  if (!f) return;
744
1098
  let e = setInterval(() => d(Date.now()), 1e3);
745
1099
  return () => clearInterval(e);
746
1100
  }, [f]);
747
- let p = r ? Math.max(0, Math.ceil((r - u) / 1e3)) : 0, h = n ? pe(fe(n), u) : null, g = t || p > 0, _ = p > 0 ? `Fresh data available in ${Y(p)}` : "Refresh roster";
748
- return /* @__PURE__ */ c("div", {
749
- className: `${X.rosterRefresh} ${l}`,
750
- children: [h && /* @__PURE__ */ s("span", {
751
- className: X.updatedLabel,
752
- title: _,
753
- children: p > 0 ? `${o} ${h} · fresh in ${Y(p)}` : `${o} ${h}`
754
- }), /* @__PURE__ */ s(m, {
1101
+ let p = r ? Math.max(0, Math.ceil((r - c) / 1e3)) : 0, m = n ? Ae(ke(n), c) : null, h = t || p > 0, g = p > 0 ? `Fresh data available in ${je(p)}` : "Refresh roster";
1102
+ return /* @__PURE__ */ u("div", {
1103
+ className: `${Me.rosterRefresh} ${o}`,
1104
+ children: [m && /* @__PURE__ */ l("span", {
1105
+ className: Me.updatedLabel,
1106
+ title: g,
1107
+ children: p > 0 ? `${i} ${m} · fresh in ${je(p)}` : `${i} ${m}`
1108
+ }), /* @__PURE__ */ l(G, {
755
1109
  variant: "outline",
756
1110
  size: "sm",
757
1111
  onClick: e,
758
- disabled: g,
759
- title: _,
1112
+ disabled: h,
1113
+ title: g,
760
1114
  "aria-label": "Refresh roster",
761
- className: X.refreshButton,
762
- children: /* @__PURE__ */ s("span", {
763
- className: t ? X.spin : void 0,
1115
+ className: Me.refreshButton,
1116
+ children: /* @__PURE__ */ l("span", {
1117
+ className: t ? Me.spin : void 0,
764
1118
  children: "⟳"
765
1119
  })
766
1120
  })]
@@ -776,37 +1130,37 @@ var X = {
776
1130
  "padding-md": "_padding-md_1vw8g_43",
777
1131
  "padding-lg": "_padding-lg_1vw8g_47",
778
1132
  hoverable: "_hoverable_1vw8g_52"
779
- }, he = ({ children: e, variant: t = "default", chamfered: n = !1, chamferSize: r = "md", padding: i = "md", hoverable: a = !1, showDiagonalBorders: l = !0, edgeColor: u, className: d = "", onClick: f, style: p }) => {
780
- let m = n ? r === "asymmetric" ? "chamfered-box-asymmetric" : r === "sm" ? "chamfered-box-sm" : r === "lg" ? "chamfered-box-lg" : "chamfered-box" : "", h = u ?? (n ? "var(--color-border)" : void 0), g = h ? { color: h } : void 0, _ = h ? {
1133
+ }, Pe = ({ children: e, variant: t = "default", chamfered: n = !1, chamferSize: r = "md", padding: i = "md", hoverable: a = !1, showDiagonalBorders: o = !0, edgeColor: s, className: d = "", onClick: f, style: p }) => {
1134
+ let m = n ? r === "asymmetric" ? "chamfered-box-asymmetric" : r === "sm" ? "chamfered-box-sm" : r === "lg" ? "chamfered-box-lg" : "chamfered-box" : "", h = s ?? (n ? "var(--color-border)" : void 0), g = h ? { color: h } : void 0, _ = h ? {
781
1135
  ...p,
782
1136
  "--card-edge-color": h
783
1137
  } : p;
784
- return /* @__PURE__ */ c("div", {
1138
+ return /* @__PURE__ */ u("div", {
785
1139
  className: `${Z.card} ${n ? Z.chamfered : ""} ${Z[t]} ${Z[`padding-${i}`]} ${m} ${a ? Z.hoverable : ""} ${d}`,
786
1140
  onClick: f,
787
1141
  role: f ? "button" : void 0,
788
1142
  tabIndex: f ? 0 : void 0,
789
1143
  style: _,
790
- children: [n && l && /* @__PURE__ */ c(o, { children: [
791
- /* @__PURE__ */ s("div", {
1144
+ children: [n && o && /* @__PURE__ */ u(c, { children: [
1145
+ /* @__PURE__ */ l("div", {
792
1146
  className: "chamfered-diagonal-border chamfered-diagonal-tl",
793
1147
  style: g
794
1148
  }),
795
- /* @__PURE__ */ s("div", {
1149
+ /* @__PURE__ */ l("div", {
796
1150
  className: "chamfered-diagonal-border chamfered-diagonal-tr",
797
1151
  style: g
798
1152
  }),
799
- /* @__PURE__ */ s("div", {
1153
+ /* @__PURE__ */ l("div", {
800
1154
  className: "chamfered-diagonal-border chamfered-diagonal-bl",
801
1155
  style: g
802
1156
  }),
803
- /* @__PURE__ */ s("div", {
1157
+ /* @__PURE__ */ l("div", {
804
1158
  className: "chamfered-diagonal-border chamfered-diagonal-br",
805
1159
  style: g
806
1160
  })
807
1161
  ] }), e]
808
1162
  });
809
- }, ge = {
1163
+ }, Fe = {
810
1164
  badge: "_badge_rk7t5_1",
811
1165
  sm: "_sm_rk7t5_11",
812
1166
  md: "_md_rk7t5_16",
@@ -818,8 +1172,8 @@ var X = {
818
1172
  warning: "_warning_rk7t5_47",
819
1173
  error: "_error_rk7t5_52",
820
1174
  info: "_info_rk7t5_57"
821
- }, _e = ({ children: e, variant: t = "default", size: n = "md", className: r = "" }) => /* @__PURE__ */ s("span", {
822
- className: `${ge.badge} ${ge[t]} ${ge[n]} ${r}`,
1175
+ }, Ie = ({ children: e, variant: t = "default", size: n = "md", className: r = "" }) => /* @__PURE__ */ l("span", {
1176
+ className: `${Fe.badge} ${Fe[t]} ${Fe[n]} ${r}`,
823
1177
  children: e
824
1178
  }), Q = {
825
1179
  overlay: "_overlay_1b3yt_1",
@@ -834,34 +1188,34 @@ var X = {
834
1188
  title: "_title_1b3yt_53",
835
1189
  closeButton: "_closeButton_1b3yt_60",
836
1190
  content: "_content_1b3yt_78"
837
- }, ve = ({ isOpen: e, onClose: t, title: n, children: r, size: a = "md", closeOnOverlayClick: o = !0, className: l = "" }) => (i(() => (e ? document.body.style.overflow = "hidden" : document.body.style.overflow = "unset", () => {
1191
+ }, Le = ({ isOpen: e, onClose: t, title: n, children: r, size: i = "md", closeOnOverlayClick: o = !0, className: s = "" }) => (a(() => (e ? document.body.style.overflow = "hidden" : document.body.style.overflow = "unset", () => {
838
1192
  document.body.style.overflow = "unset";
839
- }), [e]), i(() => {
1193
+ }), [e]), a(() => {
840
1194
  let n = (n) => {
841
1195
  n.key === "Escape" && e && t();
842
1196
  };
843
1197
  return document.addEventListener("keydown", n), () => document.removeEventListener("keydown", n);
844
- }, [e, t]), e ? /* @__PURE__ */ s("div", {
1198
+ }, [e, t]), e ? /* @__PURE__ */ l("div", {
845
1199
  className: Q.overlay,
846
1200
  onClick: (e) => {
847
1201
  o && e.target === e.currentTarget && t();
848
1202
  },
849
- children: /* @__PURE__ */ c("div", {
850
- className: `${Q.modal} ${Q[a]} ${l}`,
1203
+ children: /* @__PURE__ */ u("div", {
1204
+ className: `${Q.modal} ${Q[i]} ${s}`,
851
1205
  role: "dialog",
852
1206
  "aria-modal": "true",
853
- children: [n && /* @__PURE__ */ c("div", {
1207
+ children: [n && /* @__PURE__ */ u("div", {
854
1208
  className: Q.header,
855
- children: [/* @__PURE__ */ s("h2", {
1209
+ children: [/* @__PURE__ */ l("h2", {
856
1210
  className: Q.title,
857
1211
  children: n
858
- }), /* @__PURE__ */ s("button", {
1212
+ }), /* @__PURE__ */ l("button", {
859
1213
  className: Q.closeButton,
860
1214
  onClick: t,
861
1215
  "aria-label": "Close modal",
862
1216
  children: "✕"
863
1217
  })]
864
- }), /* @__PURE__ */ s("div", {
1218
+ }), /* @__PURE__ */ l("div", {
865
1219
  className: Q.content,
866
1220
  children: r
867
1221
  })]
@@ -876,24 +1230,24 @@ var X = {
876
1230
  dot: "_dot_1uhnh_34",
877
1231
  bounce: "_bounce_1uhnh_1",
878
1232
  visuallyHidden: "_visuallyHidden_1uhnh_91"
879
- }, ye = ({ size: e = "md", variant: t = "spinner", className: n = "" }) => t === "dots" ? /* @__PURE__ */ c("div", {
1233
+ }, Re = ({ size: e = "md", variant: t = "spinner", className: n = "" }) => t === "dots" ? /* @__PURE__ */ u("div", {
880
1234
  className: `${$.dots} ${$[e]} ${n}`,
881
1235
  children: [
882
- /* @__PURE__ */ s("span", { className: $.dot }),
883
- /* @__PURE__ */ s("span", { className: $.dot }),
884
- /* @__PURE__ */ s("span", { className: $.dot })
1236
+ /* @__PURE__ */ l("span", { className: $.dot }),
1237
+ /* @__PURE__ */ l("span", { className: $.dot }),
1238
+ /* @__PURE__ */ l("span", { className: $.dot })
885
1239
  ]
886
- }) : /* @__PURE__ */ s("div", {
1240
+ }) : /* @__PURE__ */ l("div", {
887
1241
  className: `${$.spinner} ${$[e]} ${n}`,
888
1242
  role: "status",
889
- children: /* @__PURE__ */ s("span", {
1243
+ children: /* @__PURE__ */ l("span", {
890
1244
  className: $.visuallyHidden,
891
1245
  children: "Loading..."
892
1246
  })
893
- }), be = async (e) => {
1247
+ }), ze = async (e) => {
894
1248
  if (e.length === 0) return {};
895
- let t = [...new Set(e)], n = await R.get(`/api/v1/users/lookup?ids=${t.join(",")}`);
1249
+ let t = [...new Set(e)], n = await L.get(`/api/v1/users/lookup?ids=${t.join(",")}`);
896
1250
  return Object.fromEntries(n.users.map((e) => [e.id, e.username]));
897
1251
  };
898
1252
  //#endregion
899
- export { le as AllyCodeDropdown, L as ApiClient, se as AuthProvider, _e as Badge, m as Button, he as Card, u as Container, de as Footer, v as Input, ye as Loader, ve as Modal, ue as NavBar, me as RosterRefresh, g as Select, f as TopBar, R as apiClient, I as authedFetch, ae as clearAllyCodes, O as clearTokens, M as configureAuthRefresh, be as fetchUsernames, G as formatAllyCode, Y as formatCountdown, pe as formatRelativeTime, x as getAccessToken, V as getAllyCodesFromStorage, w as getRefreshToken, ie as getSelectedAllyCode, te as initializeApiClient, ee as isAuthenticated, fe as parseBackendTimestamp, N as refreshAccessToken, C as removeAccessToken, re as removeAllyCodeFromStorage, E as removeRefreshToken, ne as saveAllyCodeToStorage, S as setAccessToken, T as setRefreshToken, U as setSelectedAllyCode, D as setTokens, ce as unformatAllyCode, H as updateAllyCodeLastUsed, W as useAuth };
1253
+ export { Se as AllyCodeDropdown, ie as ApiClient, pe as AuthProvider, Ie as Badge, G as Button, Pe as Card, p as Container, Oe as Footer, be as Input, Re as Loader, Le as Modal, De as NavBar, Ne as RosterRefresh, ve as SUITE_NAV, ye as Select, h as TopBar, L as apiClient, re as authedFetch, de as clearAllyCodes, T as clearTokens, A as configureAuthRefresh, ze as fetchUsernames, q as formatAllyCode, je as formatCountdown, Ae as formatRelativeTime, v as getAccessToken, z as getAllyCodesFromStorage, x as getRefreshToken, ue as getSelectedAllyCode, ae as initializeApiClient, E as isAuthenticated, ke as parseBackendTimestamp, j as refreshAccessToken, b as removeAccessToken, ce as removeAllyCodeFromStorage, C as removeRefreshToken, se as saveAllyCodeToStorage, y as setAccessToken, S as setRefreshToken, B as setSelectedAllyCode, w as setTokens, xe as unformatAllyCode, le as updateAllyCodeLastUsed, V as useAuth };