astrogators-shared-ui 0.16.1 → 0.16.2

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