@hadoku/watchparty-ui 0.45.125 → 0.45.126

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,28 +1,28 @@
1
1
  import { jsx as c, jsxs as x, Fragment as pe } from "react/jsx-runtime";
2
- import at, { useState as L, useRef as D, useEffect as R, useCallback as j, useMemo as ye, Component as ts, useContext as Mr, createContext as Tr, useLayoutEffect as zt, useSyncExternalStore as ns, useId as Wt, useEffectEvent as ke } from "react";
3
- import { k as rs, M as as, m as ss, f as is, a as os, C as Ct, g as In, i as fs, S as ls, b as cs, r as Gt, d as T, e as re, u as S, c as Ar, h as ds, A as yt, j as us, l as Ge, n as Ir, o as Cr, p as hs, s as gs, D as St, w as N, q as ms, t as ps, v as bs, x as Nr, y as Rr, z as Lr, B as ys, E as ws, F as _s, G as vs, H as Cn, I as ks, J as Ss, K as xs, L as Fr, N as Nn, O as $r, P as Dr, Q as Es, R as Ms, T as Be, U as zn, V as rn, W as Ts, X as Pr, Y as As, Z as Is, _ as Cs, $ as Br, a0 as Ns, a1 as Z, a2 as Rs, a3 as Or, a4 as jr, a5 as pt, a6 as Ls, a7 as Fs, a8 as $s, a9 as Ds, aa as Ps, ab as Wn, ac as lt, ad as Bs, ae as Gn, af as Os, ag as js, ah as qn, ai as Hs, aj as Us, ak as zs, al as Ws, am as Gs, an as Kn, ao as Vn, ap as qs, aq as Hr, ar as Jn, as as Ks, at as Ot, au as Vs, av as Js, aw as Qs, ax as Ys, ay as Xs, az as Zs, aA as ei, aB as ti, aC as ni, aD as ri, aE as ai } from "./index-Dbn3OPTn.js";
2
+ import at, { useState as L, useRef as D, useEffect as R, useCallback as j, useMemo as ye, Component as rs, useContext as Mr, createContext as Tr, useLayoutEffect as Wt, useSyncExternalStore as as, useId as Gt, useEffectEvent as ke } from "react";
3
+ import { k as ss, M as is, m as os, f as fs, a as ls, C as Nt, g as In, i as cs, S as ds, b as us, r as qt, d as T, e as re, u as S, c as Ar, h as hs, A as yt, j as gs, l as Ge, n as Ir, o as Cr, p as ms, s as ps, D as St, w as N, q as bs, t as ys, v as ws, x as Nr, y as Rr, z as Lr, B as _s, E as vs, F as ks, G as Ss, H as Cn, I as xs, J as Es, K as Ms, L as Fr, N as Nn, O as $r, P as Dr, Q as Ts, R as As, T as Be, U as zn, V as an, W as Is, X as Pr, Y as Cs, Z as Ns, _ as Rs, $ as Br, a0 as Ls, a1 as Z, a2 as Fs, a3 as Or, a4 as jr, a5 as pt, a6 as $s, a7 as Ds, a8 as Ps, a9 as Bs, aa as Os, ab as Wn, ac as lt, ad as js, ae as Gn, af as Hs, ag as Us, ah as qn, ai as zs, aj as Ws, ak as Gs, al as qs, am as Ks, an as Kn, ao as Vn, ap as Vs, aq as Hr, ar as Jn, as as Js, at as jt, au as Qs, av as Ys, aw as Xs, ax as Zs, ay as ei, az as ti, aA as ni, aB as ri, aC as ai, aD as si, aE as ii } from "./index-BAFZNmHy.js";
4
4
  import { createPortal as wt } from "react-dom";
5
- import { Icon as Nt, useHadokuThemeOptional as Ur, THEMES as si } from "@wolffm/themes";
6
- import { HadokuThemePicker as ii, ConnectedSettings as oi } from "@wolffm/task-ui-components";
7
- import { createRoot as fi } from "react-dom/client";
8
- const li = "output/fmp4/youtube", ci = /^(.*) \[([A-Za-z0-9_-]{11})\]$/;
9
- function di(t) {
10
- const e = `${li}/`;
5
+ import { Icon as Rt, useHadokuThemeOptional as Ur, THEMES as oi } from "@wolffm/themes";
6
+ import { HadokuThemePicker as fi, ConnectedSettings as li } from "@wolffm/task-ui-components";
7
+ import { createRoot as ci } from "react-dom/client";
8
+ const di = "output/fmp4/youtube", ui = /^(.*) \[([A-Za-z0-9_-]{11})\]$/;
9
+ function hi(t) {
10
+ const e = `${di}/`;
11
11
  if (!t.startsWith(e))
12
12
  return null;
13
- const n = ci.exec(t.slice(e.length));
13
+ const n = ui.exec(t.slice(e.length));
14
14
  return n ? n[1] : null;
15
15
  }
16
- function ui(t) {
16
+ function gi(t) {
17
17
  return typeof t == "object" && t !== null && typeof t.mount == "function";
18
18
  }
19
- function hi(t) {
19
+ function mi(t) {
20
20
  if (typeof t != "object" || t === null)
21
21
  return !1;
22
22
  const e = t;
23
23
  return typeof e.unmount == "function" && typeof e.update == "function" && (e.mountSettings === void 0 || typeof e.mountSettings == "function");
24
24
  }
25
- function gi(t) {
25
+ function pi(t) {
26
26
  return t.kind === "file";
27
27
  }
28
28
  class zr extends Error {
@@ -30,7 +30,7 @@ class zr extends Error {
30
30
  super(e), this.name = "ChatImageUploadError";
31
31
  }
32
32
  }
33
- function Ut(t) {
33
+ function zt(t) {
34
34
  switch (t) {
35
35
  case "unauthenticated":
36
36
  return "Sign in to paste images";
@@ -50,57 +50,57 @@ function Ut(t) {
50
50
  return "Image upload failed";
51
51
  }
52
52
  }
53
- function mi(t) {
54
- return t instanceof Ct ? Ut(t.reason) : t instanceof zr ? t.message : "Image upload failed";
53
+ function bi(t) {
54
+ return t instanceof Nt ? zt(t.reason) : t instanceof zr ? t.message : "Image upload failed";
55
55
  }
56
- function pi(t) {
56
+ function yi(t) {
57
57
  const e = t.type.toLowerCase().split(";")[0].trim();
58
- return e && rs(e) !== "image" ? Ut("unsupported-type") : t.size > as.image ? Ut("too-large") : t.size === 0 ? Ut("invalid") : null;
58
+ return e && ss(e) !== "image" ? zt("unsupported-type") : t.size > is.image ? zt("too-large") : t.size === 0 ? zt("invalid") : null;
59
59
  }
60
- function bi(t) {
61
- return is(t);
60
+ function wi(t) {
61
+ return fs(t);
62
62
  }
63
- function yi(t) {
64
- return os(t);
63
+ function _i(t) {
64
+ return ls(t);
65
65
  }
66
- async function wi(t) {
67
- const e = await ss(t);
66
+ async function vi(t) {
67
+ const e = await os(t);
68
68
  return { w: e?.width ?? 0, h: e?.height ?? 0 };
69
69
  }
70
- async function _i(t, e = {}) {
70
+ async function ki(t, e = {}) {
71
71
  const n = await In().upload(t, { signal: e.signal });
72
- if (!fs(n.key))
72
+ if (!cs(n.key))
73
73
  throw new zr("Image upload returned an unusable key");
74
74
  return { key: n.key, deduplicated: n.deduplicated === !0 };
75
75
  }
76
- async function vi(t, e = {}) {
76
+ async function Si(t, e = {}) {
77
77
  const n = [];
78
78
  for (const r of t) {
79
79
  if (r.kind === "remote") {
80
80
  n.push({ key: r.key, w: r.w, h: r.h, ...r.title ? { title: r.title } : {} });
81
81
  continue;
82
82
  }
83
- const { key: s } = await _i(r.file, e);
83
+ const { key: s } = await ki(r.file, e);
84
84
  n.push({ key: s, w: r.w, h: r.h });
85
85
  }
86
86
  return n;
87
87
  }
88
- function ki(t) {
88
+ function xi(t) {
89
89
  return {
90
90
  error: t instanceof Error ? t.message : String(t),
91
91
  name: t instanceof Error ? t.name : typeof t,
92
- reason: t instanceof Ct ? t.reason : void 0,
93
- status: t instanceof Ct ? t.status : void 0
92
+ reason: t instanceof Nt ? t.reason : void 0,
93
+ status: t instanceof Nt ? t.status : void 0
94
94
  };
95
95
  }
96
- function Si(t) {
96
+ function Ei(t) {
97
97
  const e = D(t);
98
98
  return R(() => {
99
99
  e.current = t;
100
100
  }), [e, `${t.cdnBase}|${t.uploadPath}`];
101
101
  }
102
- function xi(t, e, n, r = {}) {
103
- const { limit: s, debounceMs: a = ls } = r, [i, f] = Si(t), [o, l] = L([]), [d, u] = L(null), [m, y] = L(!1), [b, g] = L(null), [h, p] = L(0), _ = D(null);
102
+ function Mi(t, e, n, r = {}) {
103
+ const { limit: s, debounceMs: a = ds } = r, [i, f] = Ei(t), [o, l] = L([]), [d, u] = L(null), [m, y] = L(!1), [b, g] = L(null), [h, p] = L(0), _ = D(null);
104
104
  R(() => {
105
105
  p(0), u(null);
106
106
  }, [n, e]), R(() => {
@@ -120,7 +120,7 @@ function xi(t, e, n, r = {}) {
120
120
  l((C) => w ? v.results : [...C, ...v.results]), u(v.next);
121
121
  } catch (v) {
122
122
  if (M || v instanceof Error && v.name === "AbortError") return;
123
- g(v instanceof Ct ? v : new Ct("unknown", String(v)));
123
+ g(v instanceof Nt ? v : new Nt("unknown", String(v)));
124
124
  } finally {
125
125
  M || y(!1);
126
126
  }
@@ -147,7 +147,7 @@ function xi(t, e, n, r = {}) {
147
147
  function qe(t) {
148
148
  return t.key === "Escape" || t.key === "GoBack" || t.key === "BrowserBack" || t.key === "XF86Back" || t.keyCode === 461 || t.keyCode === 10009;
149
149
  }
150
- const Ei = /* @__PURE__ */ new Set([
150
+ const Ti = /* @__PURE__ */ new Set([
151
151
  "Enter",
152
152
  " ",
153
153
  "ArrowLeft",
@@ -157,15 +157,15 @@ const Ei = /* @__PURE__ */ new Set([
157
157
  "MediaPlayPause",
158
158
  "Select"
159
159
  ]);
160
- function Mi(t) {
160
+ function Ai(t) {
161
161
  const { key: e, back: n, modifier: r, barVisible: s, focus: a } = t;
162
162
  if (r || a === "text") return "ignore";
163
163
  if (a === "elsewhere") return n ? "ignore" : "show";
164
164
  if (n) return a === "bar" && s ? "leave-bar" : "ignore";
165
- const i = Ei.has(e);
165
+ const i = Ti.has(e);
166
166
  return a === "bar" ? !s && i ? "wake" : "show" : i ? "enter-bar" : "show";
167
167
  }
168
- function Ti(t, e, n = !1, r = { atStart: !1, atEnd: !1 }, s = !1) {
168
+ function Ii(t, e, n = !1, r = { atStart: !1, atEnd: !1 }, s = !1) {
169
169
  const a = t === "ArrowLeft" ? -1 : t === "ArrowRight" ? 1 : null, i = t === "ArrowUp" ? -1 : t === "ArrowDown" ? 1 : null;
170
170
  switch (e) {
171
171
  case "range":
@@ -186,9 +186,9 @@ const mt = "data-remote-engaged";
186
186
  function Wr(t) {
187
187
  return t instanceof HTMLSelectElement ? "select" : t instanceof HTMLInputElement ? t.type === "range" ? "range" : "text" : t instanceof HTMLTextAreaElement ? "text" : "button";
188
188
  }
189
- const Ai = 'button:not([disabled]), input:not([disabled]), select:not([disabled]), a[href], [tabindex]:not([tabindex="-1"])';
189
+ const Ci = 'button:not([disabled]), input:not([disabled]), select:not([disabled]), a[href], [tabindex]:not([tabindex="-1"])';
190
190
  function Gr(t) {
191
- return Array.from(t.querySelectorAll(Ai)).filter((e) => e.tabIndex >= 0 && e.getClientRects().length > 0);
191
+ return Array.from(t.querySelectorAll(Ci)).filter((e) => e.tabIndex >= 0 && e.getClientRects().length > 0);
192
192
  }
193
193
  function qr(t) {
194
194
  const e = Gr(t);
@@ -197,17 +197,17 @@ function qr(t) {
197
197
  function Kr(t) {
198
198
  return t ? t instanceof HTMLTextAreaElement ? !0 : t instanceof HTMLInputElement ? !["range", "checkbox", "radio", "button", "submit"].includes(t.type) : t.isContentEditable === !0 : !1;
199
199
  }
200
- const _n = 240, et = 8, Ii = 28, Vr = 240;
201
- function Ci(t, e, n) {
200
+ const _n = 240, et = 8, Ni = 28, Vr = 240;
201
+ function Ri(t, e, n) {
202
202
  let r = e.left - _n - et;
203
203
  r < et && (r = e.right + et), r = Math.min(r, n.width - _n - et), r = Math.max(et, r);
204
- const s = Vr + Ii;
204
+ const s = Vr + Ni;
205
205
  let a = t.top + t.height / 2 - s / 2;
206
206
  return a = Math.min(a, n.height - s - et), a = Math.max(et, a), { left: r, top: a };
207
207
  }
208
- const Jr = "/dataplatform/api/memes", Ni = 120;
209
- function Ri({ onClose: t, onPick: e, onUnavailable: n, toggle: r }) {
210
- const [s, a] = L(""), i = D(null), f = D(null), o = In(), { items: l, loading: d, error: u, hasMore: m, loadMore: y } = xi(
208
+ const Jr = "/dataplatform/api/memes", Li = 120;
209
+ function Fi({ onClose: t, onPick: e, onUnavailable: n, toggle: r }) {
210
+ const [s, a] = L(""), i = D(null), f = D(null), o = In(), { items: l, loading: d, error: u, hasMore: m, loadMore: y } = Mi(
211
211
  o,
212
212
  Jr,
213
213
  s.trim()
@@ -224,12 +224,12 @@ function Ri({ onClose: t, onPick: e, onUnavailable: n, toggle: r }) {
224
224
  if (!B) return;
225
225
  const O = () => p({
226
226
  item: v,
227
- ...Ci(C.getBoundingClientRect(), B.getBoundingClientRect(), {
227
+ ...Ri(C.getBoundingClientRect(), B.getBoundingClientRect(), {
228
228
  width: window.innerWidth,
229
229
  height: window.innerHeight
230
230
  })
231
231
  });
232
- I(), $ ? O() : _.current = window.setTimeout(O, Ni);
232
+ I(), $ ? O() : _.current = window.setTimeout(O, Li);
233
233
  },
234
234
  [I]
235
235
  );
@@ -288,13 +288,13 @@ function Ri({ onClose: t, onPick: e, onUnavailable: n, toggle: r }) {
288
288
  "data-reason": b,
289
289
  children: b === "unauthenticated" ? /* @__PURE__ */ x(pe, { children: [
290
290
  "Sign in to browse memes · ",
291
- /* @__PURE__ */ c(cs, { className: "underline text-on-danger-bg" })
291
+ /* @__PURE__ */ c(us, { className: "underline text-on-danger-bg" })
292
292
  ] }) : b === "forbidden" ? "Your account can't browse the meme library" : "Meme library is unavailable"
293
293
  }
294
294
  ),
295
295
  E && /* @__PURE__ */ c("p", { className: "p-4 text-center text-sm text-text-secondary", children: s.trim() ? `No memes match "${s.trim()}"` : "The meme library is empty" }),
296
296
  g.length > 0 && /* @__PURE__ */ c("div", { className: "grid grid-cols-3 gap-1.5 sm:grid-cols-4", children: g.map((v) => {
297
- const C = Gt(v.key);
297
+ const C = qt(v.key);
298
298
  return C ? /* @__PURE__ */ c(
299
299
  "button",
300
300
  {
@@ -359,7 +359,7 @@ function Ri({ onClose: t, onPick: e, onUnavailable: n, toggle: r }) {
359
359
  /* @__PURE__ */ c(
360
360
  "img",
361
361
  {
362
- src: Gt(h.item.key) ?? void 0,
362
+ src: qt(h.item.key) ?? void 0,
363
363
  alt: "",
364
364
  className: "block w-full rounded bg-bg object-contain",
365
365
  style: { height: "auto", maxHeight: Vr }
@@ -376,9 +376,9 @@ function Ri({ onClose: t, onPick: e, onUnavailable: n, toggle: r }) {
376
376
  );
377
377
  }
378
378
  function Qr({ open: t, ...e }) {
379
- return t ? /* @__PURE__ */ c(Ri, { ...e }) : null;
379
+ return t ? /* @__PURE__ */ c(Fi, { ...e }) : null;
380
380
  }
381
- function Li(t) {
381
+ function $i(t) {
382
382
  if (!t.startsWith("/") || t.startsWith("//") || /[\\\s]/.test(t) || [...t].some((e) => e.charCodeAt(0) < 32 || e.charCodeAt(0) === 127))
383
383
  return !1;
384
384
  try {
@@ -387,21 +387,21 @@ function Li(t) {
387
387
  return !1;
388
388
  }
389
389
  }
390
- function Fi(t, e) {
391
- if (!Li(t))
390
+ function Di(t, e) {
391
+ if (!$i(t))
392
392
  return null;
393
393
  const n = new URL(t, e);
394
394
  return n.origin === e ? n.href : null;
395
395
  }
396
- function $i(t, e) {
397
- const n = Fi(t.url, e);
396
+ function Pi(t, e) {
397
+ const n = Di(t.url, e);
398
398
  return { id: t.id, name: t.name, load: n ? () => import(
399
399
  /* @vite-ignore */
400
400
  n
401
401
  ) : null };
402
402
  }
403
403
  const ct = (t) => t instanceof Error ? t.message : String(t);
404
- function Di(t) {
404
+ function Bi(t) {
405
405
  let e = t.ctx, n = null, r = !1, s = !1;
406
406
  const a = /* @__PURE__ */ new Set(), i = (m, y) => t.onSettingsError?.(m, y), f = (m) => {
407
407
  if (a.delete(m))
@@ -445,7 +445,7 @@ function Di(t) {
445
445
  }
446
446
  if (r)
447
447
  return;
448
- if (!ui(m)) {
448
+ if (!gi(m)) {
449
449
  d("the game module does not export mount()");
450
450
  return;
451
451
  }
@@ -457,7 +457,7 @@ function Di(t) {
457
457
  d(`the game failed to start: ${ct(g)}`, g);
458
458
  return;
459
459
  }
460
- if (!hi(b)) {
460
+ if (!mi(b)) {
461
461
  d("the game's mount() did not return { unmount, update }");
462
462
  return;
463
463
  }
@@ -488,7 +488,7 @@ function Di(t) {
488
488
  }
489
489
  };
490
490
  }
491
- function Pi(t) {
491
+ function Oi(t) {
492
492
  const e = D(null), n = D(null), r = D(t);
493
493
  r.current = t;
494
494
  const s = t.ctx !== null, { load: a, ctx: i, mountKey: f } = t;
@@ -496,7 +496,7 @@ function Pi(t) {
496
496
  const o = e.current, l = r.current.ctx;
497
497
  if (o === null || a === null || l === null)
498
498
  return;
499
- const d = Di({
499
+ const d = Bi({
500
500
  load: a,
501
501
  el: o,
502
502
  ctx: l,
@@ -515,7 +515,7 @@ const vn = "watchparty:open-media-drawer";
515
515
  function Yr(t) {
516
516
  T("navigation", `Select Media clicked (${t})`), window.dispatchEvent(new CustomEvent(vn));
517
517
  }
518
- class Xr extends ts {
518
+ class Xr extends rs {
519
519
  state = { hasError: !1 };
520
520
  static getDerivedStateFromError() {
521
521
  return { hasError: !0 };
@@ -537,7 +537,7 @@ class Xr extends ts {
537
537
  ] }) : this.props.children;
538
538
  }
539
539
  }
540
- function Ft() {
540
+ function $t() {
541
541
  const [t, e] = L(
542
542
  () => typeof document < "u" && !!document.fullscreenElement
543
543
  );
@@ -546,19 +546,19 @@ function Ft() {
546
546
  return n(), document.addEventListener("fullscreenchange", n), () => document.removeEventListener("fullscreenchange", n);
547
547
  }, []), t;
548
548
  }
549
- function Vt(t) {
549
+ function Jt(t) {
550
550
  return t.hasMedia && (t.chatCollapsed || t.isFullscreen);
551
551
  }
552
- function Bi(t, e) {
553
- return t && Vt(e);
552
+ function ji(t, e) {
553
+ return t && Jt(e);
554
554
  }
555
555
  function Rn(t) {
556
- return t.isLeader ? Vt(t) ? t.gameOverlay && !t.isFullscreen ? "room-corner" : "control-bar" : "chat-toolbar" : "none";
556
+ return t.isLeader ? Jt(t) ? t.gameOverlay && !t.isFullscreen ? "room-corner" : "control-bar" : "chat-toolbar" : "none";
557
557
  }
558
558
  function Zr(t) {
559
559
  return t.hasMedia ? t.gameOverlay && !t.isFullscreen ? "room-corner" : "control-bar" : "none";
560
560
  }
561
- function Oi(t, e) {
561
+ function Hi(t, e) {
562
562
  if (e.clientId) {
563
563
  const n = t[e.clientId];
564
564
  if (n && (!e.author || !n.author || n.author === e.author)) return n;
@@ -568,7 +568,7 @@ function Oi(t, e) {
568
568
  }
569
569
  }
570
570
  function ea(t, e, n) {
571
- const r = Oi(t, e);
571
+ const r = Hi(t, e);
572
572
  return r ? {
573
573
  name: r.name || n.name,
574
574
  // A connection briefly without a character (a reconnect waiting for one to
@@ -579,30 +579,30 @@ function ea(t, e, n) {
579
579
  here: !0
580
580
  } : { name: n.name, sprite: n.sprite, pictureUrl: n.pictureUrl, here: !1 };
581
581
  }
582
- function ji(t, e, n) {
582
+ function Ui(t, e, n) {
583
583
  return !e || !n.here ? t : e.split(Ar).join(n.name);
584
584
  }
585
- function Jt(t, e) {
585
+ function Qt(t, e) {
586
586
  const n = S((r) => JSON.stringify(ea(r.roster, t, e)));
587
587
  return ye(() => JSON.parse(n), [n]);
588
588
  }
589
- const Hi = Tr(!0);
589
+ const zi = Tr(!0);
590
590
  function ta() {
591
- const t = Mr(Hi);
591
+ const t = Mr(zi);
592
592
  R(() => {
593
- t && ds();
593
+ t && hs();
594
594
  }, [t]);
595
595
  }
596
596
  function na(t) {
597
597
  return t ? { "--hc-base": t } : {};
598
598
  }
599
- const Rt = at.memo(
599
+ const Lt = at.memo(
600
600
  function({ html: e, as: n = "span", className: r, style: s }) {
601
601
  return at.createElement(n, { className: r, style: s, dangerouslySetInnerHTML: { __html: e } });
602
602
  },
603
603
  (t, e) => t.html === e.html && t.as === e.as && t.className === e.className && JSON.stringify(t.style) === JSON.stringify(e.style)
604
604
  );
605
- function Ui(t, e) {
605
+ function Wi(t, e) {
606
606
  R(() => {
607
607
  const n = t.current;
608
608
  if (!n || !e || typeof IntersectionObserver > "u") return;
@@ -626,17 +626,17 @@ function ra({ sprite: t, url: e, alt: n, worn: r }) {
626
626
  fallback: /* @__PURE__ */ c("span", { className: "inline-block w-8 h-8 bg-bg-alt/50 rounded-full flex-shrink-0" })
627
627
  }
628
628
  ) }),
629
- r?.overlay && /* @__PURE__ */ c(Rt, { html: us(r), style: { display: "contents" } })
629
+ r?.overlay && /* @__PURE__ */ c(Lt, { html: gs(r), style: { display: "contents" } })
630
630
  ] });
631
631
  }
632
- function zi(t) {
632
+ function Gi(t) {
633
633
  return !(t.button !== 0 || t.ctrlKey || t.metaKey || t.shiftKey || t.altKey);
634
634
  }
635
- const Wi = Tr(null);
635
+ const qi = Tr(null);
636
636
  function aa() {
637
- return Mr(Wi);
637
+ return Mr(qi);
638
638
  }
639
- function Gi({ src: t, title: e, onClose: n }) {
639
+ function Ki({ src: t, title: e, onClose: n }) {
640
640
  R(() => {
641
641
  const a = (i) => {
642
642
  qe(i) && (i.stopPropagation(), n());
@@ -682,11 +682,11 @@ function Gi({ src: t, title: e, onClose: n }) {
682
682
  s
683
683
  ) : null;
684
684
  }
685
- const an = 240, qi = 320;
686
- function Ki({ image: t }) {
687
- const [e, n] = L(!1), r = Gt(t.key);
685
+ const sn = 240, Vi = 320;
686
+ function Ji({ image: t }) {
687
+ const [e, n] = L(!1), r = qt(t.key);
688
688
  if (!r) return null;
689
- const s = t.w > 0 && t.h > 0, a = s ? Math.min(1, qi / t.w, an / t.h) : 1;
689
+ const s = t.w > 0 && t.h > 0, a = s ? Math.min(1, Vi / t.w, sn / t.h) : 1;
690
690
  return /* @__PURE__ */ x(pe, { children: [
691
691
  /* @__PURE__ */ c(
692
692
  "a",
@@ -697,7 +697,7 @@ function Ki({ image: t }) {
697
697
  className: "block max-w-full cursor-zoom-in",
698
698
  "data-testid": "chat-image",
699
699
  onClick: (i) => {
700
- zi(i) && (i.preventDefault(), n(!0));
700
+ Gi(i) && (i.preventDefault(), n(!0));
701
701
  },
702
702
  children: /* @__PURE__ */ c(
703
703
  "img",
@@ -709,13 +709,13 @@ function Ki({ image: t }) {
709
709
  width: s ? Math.round(t.w * a) : void 0,
710
710
  height: s ? Math.round(t.h * a) : void 0,
711
711
  className: "rounded border border-border-light object-contain bg-bg-alt/30",
712
- style: s ? { aspectRatio: `${t.w} / ${t.h}`, maxWidth: "100%", maxHeight: an } : { maxWidth: "100%", maxHeight: an }
712
+ style: s ? { aspectRatio: `${t.w} / ${t.h}`, maxWidth: "100%", maxHeight: sn } : { maxWidth: "100%", maxHeight: sn }
713
713
  }
714
714
  )
715
715
  }
716
716
  ),
717
717
  e && /* @__PURE__ */ c(
718
- Gi,
718
+ Ki,
719
719
  {
720
720
  src: r,
721
721
  title: t.title,
@@ -725,12 +725,12 @@ function Ki({ image: t }) {
725
725
  ] });
726
726
  }
727
727
  function sa({ images: t }) {
728
- return t?.length ? /* @__PURE__ */ c("div", { className: "flex flex-wrap gap-1 mt-1", "data-testid": "chat-images", children: t.map((e, n) => /* @__PURE__ */ c(Ki, { image: e }, `${e.key}-${n}`)) }) : null;
728
+ return t?.length ? /* @__PURE__ */ c("div", { className: "flex flex-wrap gap-1 mt-1", "data-testid": "chat-images", children: t.map((e, n) => /* @__PURE__ */ c(Ji, { image: e }, `${e.key}-${n}`)) }) : null;
729
729
  }
730
- function Vi(t, e) {
730
+ function ia(t, e) {
731
731
  return t.author && e.author ? t.author === e.author : !!e.clientId && t.clientId === e.clientId;
732
732
  }
733
- const Ji = [
733
+ const Qi = [
734
734
  { id: "smileys", label: "Smileys & Emotion", data: "1f600:grinning face:grinning|1f603:grinning face with big eyes:smiley|1f604:grinning face with smiling eyes:smile|1f601:beaming face with smiling eyes:grin|1f606:grinning squinting face:laughing,satisfied|1f605:grinning face with sweat:sweat_smile|1f923:rolling on the floor laughing:rofl|1f602:face with tears of joy:joy|1f642:slightly smiling face:slight_smile|1f643:upside-down face:upside_down|1fae0:melting face|1f609:winking face:wink|1f60a:smiling face with smiling eyes:blush|1f607:smiling face with halo:innocent|1f970:smiling face with hearts:smiling_face_with_3_hearts|1f60d:smiling face with heart-eyes:heart_eyes|1f929:star-struck|1f618:face blowing a kiss:kissing_heart|1f617:kissing face:kissing|263a-fe0f:smiling face:relaxed|1f61a:kissing face with closed eyes:kissing_closed_eyes|1f619:kissing face with smiling eyes:kissing_smiling_eyes|1f972:smiling face with tear|1f60b:face savoring food:yum|1f61b:face with tongue:stuck_out_tongue|1f61c:winking face with tongue:stuck_out_tongue_winking_eye|1f92a:zany face|1f61d:squinting face with tongue:stuck_out_tongue_closed_eyes|1f911:money-mouth face:money_mouth|1f917:smiling face with open hands:hugging,hugging_face|1f92d:face with hand over mouth|1fae2:face with open eyes and hand over mouth|1fae3:face with peeking eye|1f92b:shushing face|1f914:thinking face:thinking|1fae1:saluting face|1f910:zipper-mouth face:zipper_mouth|1f928:face with raised eyebrow|1f610:neutral face|1f611:expressionless face:expressionless|1f636:face without mouth:no_mouth|1fae5:dotted line face|1f636-200d-1f32b-fe0f:face in clouds|1f60f:smirking face:smirk|1f612:unamused face:unamused|1f644:face with rolling eyes:rolling_eyes|1f62c:grimacing face:grimacing|1f62e-200d-1f4a8:face exhaling|1f925:lying face:liar|1fae8:shaking face|1f60c:relieved face:relieved|1f614:pensive face:pensive|1f62a:sleepy face:sleepy|1f924:drooling face:drool|1f634:sleeping face:sleeping|1f637:face with medical mask:mask|1f912:face with thermometer:thermometer_face|1f915:face with head-bandage:head_bandage|1f922:nauseated face:sick|1f92e:face vomiting|1f927:sneezing face:sneeze|1f975:hot face|1f976:cold face|1f974:woozy face|1f635:face with crossed-out eyes:dizzy_face|1f635-200d-1f4ab:face with spiral eyes|1f92f:exploding head|1f920:cowboy hat face:cowboy,face_with_cowboy_hat|1f973:partying face|1f978:disguised face|1f60e:smiling face with sunglasses:sunglasses|1f913:nerd face:nerd|1f9d0:face with monocle|1f615:confused face:confused|1fae4:face with diagonal mouth|1f61f:worried face:worried|1f641:slightly frowning face:slight_frown|2639-fe0f:frowning face:frowning2,white_frowning_face|1f62e:face with open mouth:open_mouth|1f62f:hushed face:hushed|1f632:astonished face:astonished|1f633:flushed face:flushed|1f97a:pleading face|1f979:face holding back tears|1f626:frowning face with open mouth:frowning|1f627:anguished face:anguished|1f628:fearful face:fearful|1f630:anxious face with sweat:cold_sweat|1f625:sad but relieved face:disappointed_relieved|1f622:crying face:cry|1f62d:loudly crying face:sob|1f631:face screaming in fear:scream|1f616:confounded face:confounded|1f623:persevering face:persevere|1f61e:disappointed face:disappointed|1f613:downcast face with sweat:sweat|1f629:weary face:weary|1f62b:tired face|1f971:yawning face|1f624:face with steam from nose:triumph|1f621:enraged face:rage,pouting_face|1f620:angry face:angry|1f92c:face with symbols on mouth:face_with_symbols_over_mouth|1f608:smiling face with horns:smiling_imp|1f47f:angry face with horns:imp|1f480:skull:skeleton|2620-fe0f:skull and crossbones:skull_crossbones|1f4a9:pile of poo:poop,shit,hankey,poo|1f921:clown face:clown|1f479:ogre:japanese_ogre|1f47a:goblin:japanese_goblin|1f47b:ghost|1f47d:alien|1f47e:alien monster:space_invader|1f916:robot:robot_face|1f63a:grinning cat:smiley_cat|1f638:grinning cat with smiling eyes:smile_cat|1f639:cat with tears of joy:joy_cat|1f63b:smiling cat with heart-eyes:heart_eyes_cat|1f63c:cat with wry smile:smirk_cat|1f63d:kissing cat|1f640:weary cat:scream_cat|1f63f:crying cat:crying_cat_face|1f63e:pouting cat|1f648:see-no-evil monkey:see_no_evil|1f649:hear-no-evil monkey:hear_no_evil|1f64a:speak-no-evil monkey:speak_no_evil|1f48c:love letter|1f498:heart with arrow:cupid|1f49d:heart with ribbon:gift_heart|1f496:sparkling heart|1f497:growing heart:heartpulse|1f493:beating heart:heartbeat|1f49e:revolving hearts|1f495:two hearts|1f49f:heart decoration|2763-fe0f:heart exclamation:heavy_heart_exclamation_mark_ornament|1f494:broken heart|2764-fe0f-200d-1f525:heart on fire|2764-fe0f-200d-1fa79:mending heart|2764-fe0f:red heart:heart|1fa77:pink heart|1f9e1:orange heart|1f49b:yellow heart|1f49a:green heart|1f499:blue heart|1fa75:light blue heart|1f49c:purple heart|1f90e:brown heart|1f5a4:black heart|1fa76:grey heart|1f90d:white heart|1f48b:kiss mark:kiss|1f4af:hundred points:100|1f4a2:anger symbol:anger|1f4a5:collision:boom|1f4ab:dizzy|1f4a6:sweat droplets:sweat_drops|1f4a8:dashing away:dash|1f573-fe0f:hole|1f4ac:speech balloon|1f441-fe0f-200d-1f5e8-fe0f:eye in speech bubble|1f5e8-fe0f:left speech bubble:speech_left|1f5ef-fe0f:right anger bubble:anger_right|1f4ad:thought balloon|1f4a4:zzz" },
735
735
  { id: "people", label: "People & Body", data: "1f44b:waving hand:wave|1f91a:raised back of hand:back_of_hand|1f590-fe0f:hand with fingers splayed:hand_splayed,raised_hand_with_fingers_splayed|270b:raised hand|1f596:vulcan salute:vulcan,raised_hand_with_part_between_middle_and_ring_fingers|1faf1:rightwards hand|1faf2:leftwards hand|1faf3:palm down hand|1faf4:palm up hand|1faf7:leftwards pushing hand|1faf8:rightwards pushing hand|1f44c:ok hand|1f90c:pinched fingers|1f90f:pinching hand|270c-fe0f:victory hand:v|1f91e:crossed fingers:fingers_crossed,hand_with_index_and_middle_finger_crossed|1faf0:hand with index finger and thumb crossed|1f91f:love-you gesture|1f918:sign of the horns:metal|1f919:call me hand:call_me|1f448:backhand index pointing left:point_left|1f449:backhand index pointing right:point_right|1f446:backhand index pointing up:point_up_2|1f595:middle finger:reversed_hand_with_middle_finger_extended|1f447:backhand index pointing down:point_down|261d-fe0f:index pointing up:point_up|1faf5:index pointing at the viewer|1f44d:thumbs up:thumbsup,+1,thumbup|1f44e:thumbs down:thumbsdown,-1,thumbdown|270a:raised fist:fist|1f44a:oncoming fist:punch|1f91b:left-facing fist:left_fist|1f91c:right-facing fist:right_fist|1f44f:clapping hands:clap|1f64c:raising hands:raised_hands|1faf6:heart hands|1f450:open hands|1f932:palms up together|1f91d:handshake:shaking_hands|1f64f:folded hands:pray|270d-fe0f:writing hand|1f485:nail polish:nail_care|1f933:selfie|1f4aa:flexed biceps:muscle|1f9be:mechanical arm|1f9bf:mechanical leg|1f9b5:leg|1f9b6:foot|1f442:ear|1f9bb:ear with hearing aid|1f443:nose|1f9e0:brain|1fac0:anatomical heart|1fac1:lungs|1f9b7:tooth|1f9b4:bone|1f440:eyes|1f441-fe0f:eye|1f445:tongue|1f444:mouth:lips|1fae6:biting lip|1f476:baby|1f9d2:child|1f466:boy|1f467:girl|1f9d1:person:adult|1f471:person blond hair:blond_haired_person,person_with_blond_hair|1f468:man|1f9d4:person beard:bearded_person|1f9d4-200d-2642-fe0f:man beard|1f9d4-200d-2640-fe0f:woman beard|1f468-200d-1f9b0:man red hair:man_red_haired|1f468-200d-1f9b1:man curly hair:man_curly_haired|1f468-200d-1f9b3:man white hair:man_white_haired|1f468-200d-1f9b2:man bald|1f469:woman|1f469-200d-1f9b0:woman red hair:woman_red_haired|1f9d1-200d-1f9b0:person red hair|1f469-200d-1f9b1:woman curly hair:woman_curly_haired|1f9d1-200d-1f9b1:person curly hair|1f469-200d-1f9b3:woman white hair:woman_white_haired|1f9d1-200d-1f9b3:person white hair|1f469-200d-1f9b2:woman bald|1f9d1-200d-1f9b2:person bald|1f471-200d-2640-fe0f:woman blond hair|1f471-200d-2642-fe0f:man blond hair|1f9d3:older person:older_adult|1f474:old man:older_man|1f475:old woman:older_woman,grandma|1f64d:person frowning|1f64d-200d-2642-fe0f:man frowning|1f64d-200d-2640-fe0f:woman frowning|1f64e:person pouting:person_with_pouting_face|1f64e-200d-2642-fe0f:man pouting|1f64e-200d-2640-fe0f:woman pouting|1f645:person gesturing no:no_good|1f645-200d-2642-fe0f:man gesturing no|1f645-200d-2640-fe0f:woman gesturing no|1f646:person gesturing ok:ok_woman|1f646-200d-2642-fe0f:man gesturing ok|1f646-200d-2640-fe0f:woman gesturing ok|1f481:person tipping hand:information_desk_person|1f481-200d-2642-fe0f:man tipping hand|1f481-200d-2640-fe0f:woman tipping hand|1f64b:person raising hand:raising_hand|1f64b-200d-2642-fe0f:man raising hand|1f64b-200d-2640-fe0f:woman raising hand|1f9cf:deaf person|1f9cf-200d-2642-fe0f:deaf man|1f9cf-200d-2640-fe0f:deaf woman|1f647:person bowing:bow|1f647-200d-2642-fe0f:man bowing|1f647-200d-2640-fe0f:woman bowing|1f926:person facepalming:face_palm,facepalm|1f926-200d-2642-fe0f:man facepalming|1f926-200d-2640-fe0f:woman facepalming|1f937:person shrugging:shrug|1f937-200d-2642-fe0f:man shrugging|1f937-200d-2640-fe0f:woman shrugging|1f9d1-200d-2695-fe0f:health worker|1f468-200d-2695-fe0f:man health worker|1f469-200d-2695-fe0f:woman health worker|1f9d1-200d-1f393:student|1f468-200d-1f393:man student|1f469-200d-1f393:woman student|1f9d1-200d-1f3eb:teacher|1f468-200d-1f3eb:man teacher|1f469-200d-1f3eb:woman teacher|1f9d1-200d-2696-fe0f:judge|1f468-200d-2696-fe0f:man judge|1f469-200d-2696-fe0f:woman judge|1f9d1-200d-1f33e:farmer|1f468-200d-1f33e:man farmer|1f469-200d-1f33e:woman farmer|1f9d1-200d-1f373:cook|1f468-200d-1f373:man cook|1f469-200d-1f373:woman cook|1f9d1-200d-1f527:mechanic|1f468-200d-1f527:man mechanic|1f469-200d-1f527:woman mechanic|1f9d1-200d-1f3ed:factory worker|1f468-200d-1f3ed:man factory worker|1f469-200d-1f3ed:woman factory worker|1f9d1-200d-1f4bc:office worker|1f468-200d-1f4bc:man office worker|1f469-200d-1f4bc:woman office worker|1f9d1-200d-1f52c:scientist|1f468-200d-1f52c:man scientist|1f469-200d-1f52c:woman scientist|1f9d1-200d-1f4bb:technologist|1f468-200d-1f4bb:man technologist|1f469-200d-1f4bb:woman technologist|1f9d1-200d-1f3a4:singer|1f468-200d-1f3a4:man singer|1f469-200d-1f3a4:woman singer|1f9d1-200d-1f3a8:artist|1f468-200d-1f3a8:man artist|1f469-200d-1f3a8:woman artist|1f9d1-200d-2708-fe0f:pilot|1f468-200d-2708-fe0f:man pilot|1f469-200d-2708-fe0f:woman pilot|1f9d1-200d-1f680:astronaut|1f468-200d-1f680:man astronaut|1f469-200d-1f680:woman astronaut|1f9d1-200d-1f692:firefighter|1f468-200d-1f692:man firefighter|1f469-200d-1f692:woman firefighter|1f46e:police officer:cop|1f46e-200d-2642-fe0f:man police officer|1f46e-200d-2640-fe0f:woman police officer|1f575-fe0f:detective:spy,sleuth_or_spy|1f575-fe0f-200d-2642-fe0f:man detective|1f575-fe0f-200d-2640-fe0f:woman detective|1f482:guard:guardsman|1f482-200d-2642-fe0f:man guard|1f482-200d-2640-fe0f:woman guard|1f977:ninja|1f477:construction worker|1f477-200d-2642-fe0f:man construction worker|1f477-200d-2640-fe0f:woman construction worker|1fac5:person with crown|1f934:prince|1f478:princess|1f473:person wearing turban:man_with_turban|1f473-200d-2642-fe0f:man wearing turban|1f473-200d-2640-fe0f:woman wearing turban|1f472:person with skullcap:man_with_chinese_cap,man_with_gua_pi_mao|1f9d5:woman with headscarf|1f935:person in tuxedo|1f935-200d-2642-fe0f:man in tuxedo|1f935-200d-2640-fe0f:woman in tuxedo|1f470:person with veil|1f470-200d-2642-fe0f:man with veil|1f470-200d-2640-fe0f:woman with veil|1f930:pregnant woman:expecting_woman|1fac3:pregnant man|1fac4:pregnant person|1f931:breast-feeding|1f469-200d-1f37c:woman feeding baby|1f468-200d-1f37c:man feeding baby|1f9d1-200d-1f37c:person feeding baby|1f47c:baby angel:angel|1f385:santa claus:santa|1f936:mrs. claus:mother_christmas|1f9d1-200d-1f384:mx claus|1f9b8:superhero|1f9b8-200d-2642-fe0f:man superhero|1f9b8-200d-2640-fe0f:woman superhero|1f9b9:supervillain|1f9b9-200d-2642-fe0f:man supervillain|1f9b9-200d-2640-fe0f:woman supervillain|1f9d9:mage|1f9d9-200d-2642-fe0f:man mage|1f9d9-200d-2640-fe0f:woman mage|1f9da:fairy|1f9da-200d-2642-fe0f:man fairy|1f9da-200d-2640-fe0f:woman fairy|1f9db:vampire|1f9db-200d-2642-fe0f:man vampire|1f9db-200d-2640-fe0f:woman vampire|1f9dc:merperson|1f9dc-200d-2642-fe0f:merman|1f9dc-200d-2640-fe0f:mermaid|1f9dd:elf|1f9dd-200d-2642-fe0f:man elf|1f9dd-200d-2640-fe0f:woman elf|1f9de:genie|1f9de-200d-2642-fe0f:man genie|1f9de-200d-2640-fe0f:woman genie|1f9df:zombie|1f9df-200d-2642-fe0f:man zombie|1f9df-200d-2640-fe0f:woman zombie|1f9cc:troll|1f486:person getting massage:massage|1f486-200d-2642-fe0f:man getting massage|1f486-200d-2640-fe0f:woman getting massage|1f487:person getting haircut:haircut|1f487-200d-2642-fe0f:man getting haircut|1f487-200d-2640-fe0f:woman getting haircut|1f6b6:person walking:walking|1f6b6-200d-2642-fe0f:man walking|1f6b6-200d-2640-fe0f:woman walking|1f9cd:person standing|1f9cd-200d-2642-fe0f:man standing|1f9cd-200d-2640-fe0f:woman standing|1f9ce:person kneeling|1f9ce-200d-2642-fe0f:man kneeling|1f9ce-200d-2640-fe0f:woman kneeling|1f9d1-200d-1f9af:person with white cane:person_with_probing_cane|1f468-200d-1f9af:man with white cane:man_with_probing_cane|1f469-200d-1f9af:woman with white cane:woman_with_probing_cane|1f9d1-200d-1f9bc:person in motorized wheelchair|1f468-200d-1f9bc:man in motorized wheelchair|1f469-200d-1f9bc:woman in motorized wheelchair|1f9d1-200d-1f9bd:person in manual wheelchair|1f468-200d-1f9bd:man in manual wheelchair|1f469-200d-1f9bd:woman in manual wheelchair|1f3c3:person running:runner|1f3c3-200d-2642-fe0f:man running|1f3c3-200d-2640-fe0f:woman running|1f483:woman dancing:dancer|1f57a:man dancing:male_dancer|1f574-fe0f:person in suit levitating:levitate,man_in_business_suit_levitating|1f46f:people with bunny ears:people_with_bunny_ears_partying,dancers|1f46f-200d-2642-fe0f:men with bunny ears|1f46f-200d-2640-fe0f:women with bunny ears|1f9d6:person in steamy room|1f9d6-200d-2642-fe0f:man in steamy room|1f9d6-200d-2640-fe0f:woman in steamy room|1f9d7:person climbing|1f9d7-200d-2642-fe0f:man climbing|1f9d7-200d-2640-fe0f:woman climbing|1f93a:person fencing:fencer,fencing|1f3c7:horse racing|26f7-fe0f:skier|1f3c2:snowboarder|1f3cc-fe0f:person golfing:golfer|1f3cc-fe0f-200d-2642-fe0f:man golfing|1f3cc-fe0f-200d-2640-fe0f:woman golfing|1f3c4:person surfing:surfer|1f3c4-200d-2642-fe0f:man surfing|1f3c4-200d-2640-fe0f:woman surfing|1f6a3:person rowing boat:rowboat|1f6a3-200d-2642-fe0f:man rowing boat|1f6a3-200d-2640-fe0f:woman rowing boat|1f3ca:person swimming:swimmer|1f3ca-200d-2642-fe0f:man swimming|1f3ca-200d-2640-fe0f:woman swimming|26f9-fe0f:person bouncing ball:basketball_player,person_with_ball|26f9-fe0f-200d-2642-fe0f:man bouncing ball|26f9-fe0f-200d-2640-fe0f:woman bouncing ball|1f3cb-fe0f:person lifting weights:lifter,weight_lifter|1f3cb-fe0f-200d-2642-fe0f:man lifting weights|1f3cb-fe0f-200d-2640-fe0f:woman lifting weights|1f6b4:person biking:bicyclist|1f6b4-200d-2642-fe0f:man biking|1f6b4-200d-2640-fe0f:woman biking|1f6b5:person mountain biking:mountain_bicyclist|1f6b5-200d-2642-fe0f:man mountain biking|1f6b5-200d-2640-fe0f:woman mountain biking|1f938:person cartwheeling:person_doing_cartwheel,cartwheel|1f938-200d-2642-fe0f:man cartwheeling|1f938-200d-2640-fe0f:woman cartwheeling|1f93c:people wrestling:wrestlers,wrestling|1f93c-200d-2642-fe0f:men wrestling|1f93c-200d-2640-fe0f:women wrestling|1f93d:person playing water polo:water_polo|1f93d-200d-2642-fe0f:man playing water polo|1f93d-200d-2640-fe0f:woman playing water polo|1f93e:person playing handball:handball|1f93e-200d-2642-fe0f:man playing handball|1f93e-200d-2640-fe0f:woman playing handball|1f939:person juggling:juggling,juggler|1f939-200d-2642-fe0f:man juggling|1f939-200d-2640-fe0f:woman juggling|1f9d8:person in lotus position|1f9d8-200d-2642-fe0f:man in lotus position|1f9d8-200d-2640-fe0f:woman in lotus position|1f6c0:person taking bath:bath|1f6cc:person in bed:sleeping_accommodation|1f9d1-200d-1f91d-200d-1f9d1:people holding hands|1f46d:women holding hands:two_women_holding_hands|1f46b:woman and man holding hands:couple|1f46c:men holding hands:two_men_holding_hands|1f48f:kiss:couplekiss|1f469-200d-2764-fe0f-200d-1f48b-200d-1f468:kiss woman, man|1f468-200d-2764-fe0f-200d-1f48b-200d-1f468:kiss man, man|1f469-200d-2764-fe0f-200d-1f48b-200d-1f469:kiss woman, woman|1f491:couple with heart|1f469-200d-2764-fe0f-200d-1f468:couple with heart woman, man|1f468-200d-2764-fe0f-200d-1f468:couple with heart man, man|1f469-200d-2764-fe0f-200d-1f469:couple with heart woman, woman|1f468-200d-1f469-200d-1f466:family man, woman, boy|1f468-200d-1f469-200d-1f467:family man, woman, girl:family_mwg|1f468-200d-1f469-200d-1f467-200d-1f466:family man, woman, girl, boy:family_mwgb|1f468-200d-1f469-200d-1f466-200d-1f466:family man, woman, boy, boy:family_mwbb|1f468-200d-1f469-200d-1f467-200d-1f467:family man, woman, girl, girl:family_mwgg|1f468-200d-1f468-200d-1f466:family man, man, boy:family_mmb|1f468-200d-1f468-200d-1f467:family man, man, girl:family_mmg|1f468-200d-1f468-200d-1f467-200d-1f466:family man, man, girl, boy:family_mmgb|1f468-200d-1f468-200d-1f466-200d-1f466:family man, man, boy, boy:family_mmbb|1f468-200d-1f468-200d-1f467-200d-1f467:family man, man, girl, girl:family_mmgg|1f469-200d-1f469-200d-1f466:family woman, woman, boy:family_wwb|1f469-200d-1f469-200d-1f467:family woman, woman, girl:family_wwg|1f469-200d-1f469-200d-1f467-200d-1f466:family woman, woman, girl, boy:family_wwgb|1f469-200d-1f469-200d-1f466-200d-1f466:family woman, woman, boy, boy:family_wwbb|1f469-200d-1f469-200d-1f467-200d-1f467:family woman, woman, girl, girl:family_wwgg|1f468-200d-1f466:family man, boy|1f468-200d-1f466-200d-1f466:family man, boy, boy|1f468-200d-1f467:family man, girl|1f468-200d-1f467-200d-1f466:family man, girl, boy|1f468-200d-1f467-200d-1f467:family man, girl, girl|1f469-200d-1f466:family woman, boy|1f469-200d-1f466-200d-1f466:family woman, boy, boy|1f469-200d-1f467:family woman, girl|1f469-200d-1f467-200d-1f466:family woman, girl, boy|1f469-200d-1f467-200d-1f467:family woman, girl, girl|1f5e3-fe0f:speaking head:speaking_head_in_silhouette|1f464:bust in silhouette|1f465:busts in silhouette|1fac2:people hugging|1f46a:family|1f463:footprints" },
736
736
  { id: "nature", label: "Animals & Nature", data: "1f435:monkey face|1f412:monkey|1f98d:gorilla|1f9a7:orangutan|1f436:dog face:dog|1f415:dog:dog2|1f9ae:guide dog|1f415-200d-1f9ba:service dog|1f429:poodle|1f43a:wolf|1f98a:fox:fox_face|1f99d:raccoon|1f431:cat face:cat|1f408:cat:cat2|1f408-200d-2b1b:black cat|1f981:lion:lion_face|1f42f:tiger face:tiger|1f405:tiger:tiger2|1f406:leopard|1f434:horse face:horse|1face:moose|1facf:donkey|1f40e:horse:racehorse|1f984:unicorn:unicorn_face|1f993:zebra|1f98c:deer|1f9ac:bison|1f42e:cow face:cow|1f402:ox|1f403:water buffalo|1f404:cow:cow2|1f437:pig face:pig|1f416:pig:pig2|1f417:boar|1f43d:pig nose|1f40f:ram|1f411:ewe:sheep|1f410:goat|1f42a:camel:dromedary_camel|1f42b:two-hump camel:camel|1f999:llama|1f992:giraffe|1f418:elephant|1f9a3:mammoth|1f98f:rhinoceros:rhino|1f99b:hippopotamus|1f42d:mouse face:mouse|1f401:mouse:mouse2|1f400:rat|1f439:hamster|1f430:rabbit face:rabbit|1f407:rabbit:rabbit2|1f43f-fe0f:chipmunk|1f9ab:beaver|1f994:hedgehog|1f987:bat|1f43b:bear|1f43b-200d-2744-fe0f:polar bear|1f428:koala|1f43c:panda:panda_face|1f9a5:sloth|1f9a6:otter|1f9a8:skunk|1f998:kangaroo|1f9a1:badger|1f43e:paw prints:feet|1f983:turkey|1f414:chicken|1f413:rooster|1f423:hatching chick|1f424:baby chick|1f425:front-facing baby chick:hatched_chick|1f426:bird|1f427:penguin|1f54a-fe0f:dove:dove_of_peace|1f985:eagle|1f986:duck|1f9a2:swan|1f989:owl|1f9a4:dodo|1fab6:feather|1f9a9:flamingo|1f99a:peacock|1f99c:parrot|1fabd:wing|1f426-200d-2b1b:black bird|1fabf:goose|1f438:frog|1f40a:crocodile|1f422:turtle|1f98e:lizard|1f40d:snake|1f432:dragon face|1f409:dragon|1f995:sauropod|1f996:t-rex|1f433:spouting whale:whale|1f40b:whale:whale2|1f42c:dolphin|1f9ad:seal|1f41f:fish|1f420:tropical fish|1f421:blowfish|1f988:shark|1f419:octopus|1f41a:spiral shell:shell|1fab8:coral|1fabc:jellyfish|1f980:crab|1f99e:lobster|1f990:shrimp|1f991:squid|1f9aa:oyster|1f40c:snail|1f98b:butterfly|1f41b:bug|1f41c:ant|1f41d:honeybee:bee|1fab2:beetle|1f41e:lady beetle|1f997:cricket|1fab3:cockroach|1f577-fe0f:spider|1f578-fe0f:spider web|1f982:scorpion|1f99f:mosquito|1fab0:fly|1fab1:worm|1f9a0:microbe|1f490:bouquet|1f338:cherry blossom|1f4ae:white flower|1fab7:lotus|1f3f5-fe0f:rosette|1f339:rose|1f940:wilted flower:wilted_rose|1f33a:hibiscus|1f33b:sunflower|1f33c:blossom|1f337:tulip|1fabb:hyacinth|1f331:seedling|1fab4:potted plant|1f332:evergreen tree|1f333:deciduous tree|1f334:palm tree|1f335:cactus|1f33e:sheaf of rice:ear_of_rice|1f33f:herb|2618-fe0f:shamrock|1f340:four leaf clover|1f341:maple leaf|1f342:fallen leaf|1f343:leaf fluttering in wind:leaves|1fab9:empty nest|1faba:nest with eggs|1f344:mushroom" },
@@ -741,22 +741,22 @@ const Ji = [
741
741
  { id: "symbols", label: "Symbols", data: "1f3e7:atm sign:atm|1f6ae:litter in bin sign:put_litter_in_its_place|1f6b0:potable water|267f:wheelchair symbol:wheelchair|1f6b9:men’s room:mens,mens_room|1f6ba:women’s room:womens,womens_room|1f6bb:restroom|1f6bc:baby symbol|1f6be:water closet:wc|1f6c2:passport control|1f6c3:customs|1f6c4:baggage claim|1f6c5:left luggage|26a0-fe0f:warning|1f6b8:children crossing|26d4:no entry|1f6ab:prohibited:no_entry_sign|1f6b3:no bicycles|1f6ad:no smoking|1f6af:no littering:do_not_litter|1f6b1:non-potable water:non-potable_water|1f6b7:no pedestrians|1f4f5:no mobile phones|1f51e:no one under eighteen:underage|2622-fe0f:radioactive:radioactive_sign|2623-fe0f:biohazard:biohazard_sign|2b06-fe0f:up arrow:arrow_up|2197-fe0f:up-right arrow:arrow_upper_right|27a1-fe0f:right arrow:arrow_right|2198-fe0f:down-right arrow:arrow_lower_right|2b07-fe0f:down arrow:arrow_down|2199-fe0f:down-left arrow:arrow_lower_left|2b05-fe0f:left arrow:arrow_left|2196-fe0f:up-left arrow:arrow_upper_left|2195-fe0f:up-down arrow:arrow_up_down|2194-fe0f:left-right arrow|21a9-fe0f:right arrow curving left:leftwards_arrow_with_hook|21aa-fe0f:left arrow curving right:arrow_right_hook|2934-fe0f:right arrow curving up:arrow_heading_up|2935-fe0f:right arrow curving down:arrow_heading_down|1f503:clockwise vertical arrows:arrows_clockwise|1f504:counterclockwise arrows button:arrows_counterclockwise|1f519:back arrow:back|1f51a:end arrow:end|1f51b:on! arrow:on|1f51c:soon arrow:soon|1f51d:top arrow:top|1f6d0:place of worship:worship_symbol|269b-fe0f:atom symbol:atom|1f549-fe0f:om:om_symbol|2721-fe0f:star of david|2638-fe0f:wheel of dharma|262f-fe0f:yin yang|271d-fe0f:latin cross:cross|2626-fe0f:orthodox cross|262a-fe0f:star and crescent|262e-fe0f:peace symbol:peace|1f54e:menorah|1f52f:dotted six-pointed star:six_pointed_star|1faaf:khanda|2648:aries|2649:taurus|264a:gemini|264b:cancer|264c:leo|264d:virgo|264e:libra|264f:scorpio:scorpius|2650:sagittarius|2651:capricorn|2652:aquarius|2653:pisces|26ce:ophiuchus|1f500:shuffle tracks button:twisted_rightwards_arrows|1f501:repeat button:repeat|1f502:repeat single button:repeat_one|25b6-fe0f:play button:arrow_forward|23e9:fast-forward button:fast_forward|23ed-fe0f:next track button:track_next,next_track|23ef-fe0f:play or pause button:play_pause|25c0-fe0f:reverse button:arrow_backward|23ea:fast reverse button:rewind|23ee-fe0f:last track button:track_previous,previous_track|1f53c:upwards button:arrow_up_small|23eb:fast up button:arrow_double_up|1f53d:downwards button:arrow_down_small|23ec:fast down button:arrow_double_down|23f8-fe0f:pause button:double_vertical_bar|23f9-fe0f:stop button|23fa-fe0f:record button|23cf-fe0f:eject button:eject,eject_symbol|1f3a6:cinema|1f505:dim button:low_brightness|1f506:bright button:high_brightness|1f4f6:antenna bars:signal_strength|1f6dc:wireless|1f4f3:vibration mode|1f4f4:mobile phone off|2640-fe0f:female sign|2642-fe0f:male sign|26a7-fe0f:transgender symbol|2716-fe0f:multiply:heavy_multiplication_x|2795:plus:heavy_plus_sign|2796:minus:heavy_minus_sign|2797:divide:heavy_division_sign|1f7f0:heavy equals sign|267e-fe0f:infinity|203c-fe0f:double exclamation mark:bangbang|2049-fe0f:exclamation question mark:interrobang|2753:red question mark:question,question_mark|2754:white question mark:grey_question|2755:white exclamation mark:grey_exclamation|2757:red exclamation mark:exclamation|3030-fe0f:wavy dash|1f4b1:currency exchange|1f4b2:heavy dollar sign|2695-fe0f:medical symbol|267b-fe0f:recycling symbol:recycle|269c-fe0f:fleur-de-lis:fleur-de-lis|1f531:trident emblem:trident|1f4db:name badge|1f530:japanese symbol for beginner:beginner|2b55:hollow red circle:o|2705:check mark button:white_check_mark|2611-fe0f:check box with check:ballot_box_with_check|2714-fe0f:check mark:heavy_check_mark|274c:cross mark:x|274e:cross mark button:negative_squared_cross_mark|27b0:curly loop|27bf:double curly loop:loop|303d-fe0f:part alternation mark|2733-fe0f:eight-spoked asterisk|2734-fe0f:eight-pointed star:eight_pointed_black_star|2747-fe0f:sparkle|00a9-fe0f:copyright|00ae-fe0f:registered|2122-fe0f:trade mark:tm|0023-fe0f-20e3:keycap #|002a-fe0f-20e3:keycap *|0030-fe0f-20e3:keycap 0|0031-fe0f-20e3:keycap 1|0032-fe0f-20e3:keycap 2|0033-fe0f-20e3:keycap 3|0034-fe0f-20e3:keycap 4|0035-fe0f-20e3:keycap 5|0036-fe0f-20e3:keycap 6|0037-fe0f-20e3:keycap 7|0038-fe0f-20e3:keycap 8|0039-fe0f-20e3:keycap 9|1f51f:keycap 10:keycap_ten|1f520:input latin uppercase:capital_abcd|1f521:input latin lowercase:abcd|1f522:input numbers:1234|1f523:input symbols:symbols|1f524:input latin letters:abc|1f170-fe0f:a button (blood type):a|1f18e:ab button (blood type):ab|1f171-fe0f:b button (blood type):b|1f191:cl button:cl|1f192:cool button:cool|1f193:free button:free|2139-fe0f:information:information_source|1f194:id button:id|24c2-fe0f:circled m:m|1f195:new button:new|1f196:ng button:ng|1f17e-fe0f:o button (blood type):o2|1f197:ok button:ok|1f17f-fe0f:p button:parking|1f198:sos button:sos|1f199:up! button:up|1f19a:vs button:vs|1f201:japanese “here” button:koko|1f202-fe0f:japanese “service charge” button:sa|1f237-fe0f:japanese “monthly amount” button:u6708|1f236:japanese “not free of charge” button:u6709|1f22f:japanese “reserved” button:u6307|1f250:japanese “bargain” button:ideograph_advantage|1f239:japanese “discount” button:u5272|1f21a:japanese “free of charge” button:u7121|1f232:japanese “prohibited” button:u7981|1f251:japanese “acceptable” button:accept|1f238:japanese “application” button:u7533|1f234:japanese “passing grade” button:u5408|1f233:japanese “vacancy” button:u7a7a|3297-fe0f:japanese “congratulations” button:congratulations|3299-fe0f:japanese “secret” button:secret|1f23a:japanese “open for business” button:u55b6|1f235:japanese “no vacancy” button:u6e80|1f534:red circle|1f7e0:orange circle|1f7e1:yellow circle|1f7e2:green circle|1f535:blue circle|1f7e3:purple circle|1f7e4:brown circle|26ab:black circle|26aa:white circle|1f7e5:red square|1f7e7:orange square|1f7e8:yellow square|1f7e9:green square|1f7e6:blue square|1f7ea:purple square|1f7eb:brown square|2b1b:black large square|2b1c:white large square|25fc-fe0f:black medium square|25fb-fe0f:white medium square|25fe:black medium-small square|25fd:white medium-small square|25aa-fe0f:black small square|25ab-fe0f:white small square|1f536:large orange diamond|1f537:large blue diamond|1f538:small orange diamond|1f539:small blue diamond|1f53a:red triangle pointed up:small_red_triangle|1f53b:red triangle pointed down:small_red_triangle_down|1f4a0:diamond with a dot:diamond_shape_with_a_dot_inside|1f518:radio button|1f533:white square button|1f532:black square button" },
742
742
  { id: "flags", label: "Flags", data: "1f3c1:chequered flag:checkered_flag|1f6a9:triangular flag:triangular_flag_on_post|1f38c:crossed flags|1f3f4:black flag:flag_black,waving_black_flag|1f3f3-fe0f:white flag:flag_white,waving_white_flag|1f3f3-fe0f-200d-1f308:rainbow flag|1f3f3-fe0f-200d-26a7-fe0f:transgender flag|1f3f4-200d-2620-fe0f:pirate flag|1f1e6-1f1e8:flag ascension island:flag_ac|1f1e6-1f1e9:flag andorra:flag_ad|1f1e6-1f1ea:flag united arab emirates:flag_ae|1f1e6-1f1eb:flag afghanistan:flag_af|1f1e6-1f1ec:flag antigua & barbuda:flag_ag|1f1e6-1f1ee:flag anguilla:flag_ai|1f1e6-1f1f1:flag albania:flag_al|1f1e6-1f1f2:flag armenia:flag_am|1f1e6-1f1f4:flag angola:flag_ao|1f1e6-1f1f6:flag antarctica:flag_aq|1f1e6-1f1f7:flag argentina:flag_ar|1f1e6-1f1f8:flag american samoa:flag_as|1f1e6-1f1f9:flag austria:flag_at|1f1e6-1f1fa:flag australia:flag_au|1f1e6-1f1fc:flag aruba:flag_aw|1f1e6-1f1fd:flag åland islands:flag_ax|1f1e6-1f1ff:flag azerbaijan:flag_az|1f1e7-1f1e6:flag bosnia & herzegovina:flag_ba|1f1e7-1f1e7:flag barbados:flag_bb|1f1e7-1f1e9:flag bangladesh:flag_bd|1f1e7-1f1ea:flag belgium:flag_be|1f1e7-1f1eb:flag burkina faso:flag_bf|1f1e7-1f1ec:flag bulgaria:flag_bg|1f1e7-1f1ed:flag bahrain:flag_bh|1f1e7-1f1ee:flag burundi:flag_bi|1f1e7-1f1ef:flag benin:flag_bj|1f1e7-1f1f1:flag st. barthélemy:flag_bl|1f1e7-1f1f2:flag bermuda:flag_bm|1f1e7-1f1f3:flag brunei:flag_bn|1f1e7-1f1f4:flag bolivia:flag_bo|1f1e7-1f1f6:flag caribbean netherlands:flag_bq|1f1e7-1f1f7:flag brazil:flag_br|1f1e7-1f1f8:flag bahamas:flag_bs|1f1e7-1f1f9:flag bhutan:flag_bt|1f1e7-1f1fb:flag bouvet island:flag_bv|1f1e7-1f1fc:flag botswana:flag_bw|1f1e7-1f1fe:flag belarus:flag_by|1f1e7-1f1ff:flag belize:flag_bz|1f1e8-1f1e6:flag canada:flag_ca|1f1e8-1f1e8:flag cocos (keeling) islands:flag_cc|1f1e8-1f1e9:flag congo - kinshasa:flag_cd,congo|1f1e8-1f1eb:flag central african republic:flag_cf|1f1e8-1f1ec:flag congo - brazzaville:flag_cg|1f1e8-1f1ed:flag switzerland:flag_ch|1f1e8-1f1ee:flag côte d’ivoire:flag_ci|1f1e8-1f1f0:flag cook islands:flag_ck|1f1e8-1f1f1:flag chile:flag_cl,chile|1f1e8-1f1f2:flag cameroon:flag_cm|1f1e8-1f1f3:flag china:flag_cn|1f1e8-1f1f4:flag colombia:flag_co|1f1e8-1f1f5:flag clipperton island:flag_cp|1f1e8-1f1f7:flag costa rica:flag_cr|1f1e8-1f1fa:flag cuba:flag_cu|1f1e8-1f1fb:flag cape verde:flag_cv|1f1e8-1f1fc:flag curaçao:flag_cw|1f1e8-1f1fd:flag christmas island:flag_cx|1f1e8-1f1fe:flag cyprus:flag_cy|1f1e8-1f1ff:flag czechia:flag_cz|1f1e9-1f1ea:flag germany:flag_de|1f1e9-1f1ec:flag diego garcia:flag_dg|1f1e9-1f1ef:flag djibouti:flag_dj|1f1e9-1f1f0:flag denmark:flag_dk|1f1e9-1f1f2:flag dominica:flag_dm|1f1e9-1f1f4:flag dominican republic:flag_do|1f1e9-1f1ff:flag algeria:flag_dz|1f1ea-1f1e6:flag ceuta & melilla:flag_ea|1f1ea-1f1e8:flag ecuador:flag_ec|1f1ea-1f1ea:flag estonia:flag_ee|1f1ea-1f1ec:flag egypt:flag_eg|1f1ea-1f1ed:flag western sahara:flag_eh|1f1ea-1f1f7:flag eritrea:flag_er|1f1ea-1f1f8:flag spain:flag_es|1f1ea-1f1f9:flag ethiopia:flag_et|1f1ea-1f1fa:flag european union:flag_eu|1f1eb-1f1ee:flag finland:flag_fi|1f1eb-1f1ef:flag fiji:flag_fj|1f1eb-1f1f0:flag falkland islands:flag_fk|1f1eb-1f1f2:flag micronesia:flag_fm|1f1eb-1f1f4:flag faroe islands:flag_fo|1f1eb-1f1f7:flag france:flag_fr|1f1ec-1f1e6:flag gabon:flag_ga|1f1ec-1f1e7:flag united kingdom:flag_gb|1f1ec-1f1e9:flag grenada:flag_gd|1f1ec-1f1ea:flag georgia:flag_ge|1f1ec-1f1eb:flag french guiana:flag_gf|1f1ec-1f1ec:flag guernsey:flag_gg|1f1ec-1f1ed:flag ghana:flag_gh|1f1ec-1f1ee:flag gibraltar:flag_gi|1f1ec-1f1f1:flag greenland:flag_gl|1f1ec-1f1f2:flag gambia:flag_gm|1f1ec-1f1f3:flag guinea:flag_gn|1f1ec-1f1f5:flag guadeloupe:flag_gp|1f1ec-1f1f6:flag equatorial guinea:flag_gq|1f1ec-1f1f7:flag greece:flag_gr|1f1ec-1f1f8:flag south georgia & south sandwich islands:flag_gs|1f1ec-1f1f9:flag guatemala:flag_gt|1f1ec-1f1fa:flag guam:flag_gu|1f1ec-1f1fc:flag guinea-bissau:flag_gw|1f1ec-1f1fe:flag guyana:flag_gy|1f1ed-1f1f0:flag hong kong sar china:flag_hk|1f1ed-1f1f2:flag heard island & mcdonald islands:flag_hm|1f1ed-1f1f3:flag honduras:flag_hn|1f1ed-1f1f7:flag croatia:flag_hr|1f1ed-1f1f9:flag haiti:flag_ht|1f1ed-1f1fa:flag hungary:flag_hu|1f1ee-1f1e8:flag canary islands:flag_ic|1f1ee-1f1e9:flag indonesia:flag_id,indonesia|1f1ee-1f1ea:flag ireland:flag_ie|1f1ee-1f1f1:flag israel:flag_il|1f1ee-1f1f2:flag isle of man:flag_im|1f1ee-1f1f3:flag india:flag_in|1f1ee-1f1f4:flag british indian ocean territory:flag_io|1f1ee-1f1f6:flag iraq:flag_iq|1f1ee-1f1f7:flag iran:flag_ir|1f1ee-1f1f8:flag iceland:flag_is|1f1ee-1f1f9:flag italy:flag_it|1f1ef-1f1ea:flag jersey:flag_je|1f1ef-1f1f2:flag jamaica:flag_jm|1f1ef-1f1f4:flag jordan:flag_jo|1f1ef-1f1f5:flag japan:flag_jp|1f1f0-1f1ea:flag kenya:flag_ke|1f1f0-1f1ec:flag kyrgyzstan:flag_kg|1f1f0-1f1ed:flag cambodia:flag_kh|1f1f0-1f1ee:flag kiribati:flag_ki|1f1f0-1f1f2:flag comoros:flag_km|1f1f0-1f1f3:flag st. kitts & nevis:flag_kn|1f1f0-1f1f5:flag north korea:flag_kp|1f1f0-1f1f7:flag south korea:flag_kr|1f1f0-1f1fc:flag kuwait:flag_kw|1f1f0-1f1fe:flag cayman islands:flag_ky|1f1f0-1f1ff:flag kazakhstan:flag_kz|1f1f1-1f1e6:flag laos:flag_la|1f1f1-1f1e7:flag lebanon:flag_lb|1f1f1-1f1e8:flag st. lucia:flag_lc|1f1f1-1f1ee:flag liechtenstein:flag_li|1f1f1-1f1f0:flag sri lanka:flag_lk|1f1f1-1f1f7:flag liberia:flag_lr|1f1f1-1f1f8:flag lesotho:flag_ls|1f1f1-1f1f9:flag lithuania:flag_lt|1f1f1-1f1fa:flag luxembourg:flag_lu|1f1f1-1f1fb:flag latvia:flag_lv|1f1f1-1f1fe:flag libya:flag_ly|1f1f2-1f1e6:flag morocco:flag_ma|1f1f2-1f1e8:flag monaco:flag_mc|1f1f2-1f1e9:flag moldova:flag_md|1f1f2-1f1ea:flag montenegro:flag_me|1f1f2-1f1eb:flag st. martin:flag_mf|1f1f2-1f1ec:flag madagascar:flag_mg|1f1f2-1f1ed:flag marshall islands:flag_mh|1f1f2-1f1f0:flag north macedonia:flag_mk|1f1f2-1f1f1:flag mali:flag_ml|1f1f2-1f1f2:flag myanmar (burma):flag_mm|1f1f2-1f1f3:flag mongolia:flag_mn|1f1f2-1f1f4:flag macao sar china:flag_mo|1f1f2-1f1f5:flag northern mariana islands:flag_mp|1f1f2-1f1f6:flag martinique:flag_mq|1f1f2-1f1f7:flag mauritania:flag_mr|1f1f2-1f1f8:flag montserrat:flag_ms|1f1f2-1f1f9:flag malta:flag_mt|1f1f2-1f1fa:flag mauritius:flag_mu|1f1f2-1f1fb:flag maldives:flag_mv|1f1f2-1f1fc:flag malawi:flag_mw|1f1f2-1f1fd:flag mexico:flag_mx|1f1f2-1f1fe:flag malaysia:flag_my|1f1f2-1f1ff:flag mozambique:flag_mz|1f1f3-1f1e6:flag namibia:flag_na|1f1f3-1f1e8:flag new caledonia:flag_nc|1f1f3-1f1ea:flag niger:flag_ne|1f1f3-1f1eb:flag norfolk island:flag_nf|1f1f3-1f1ec:flag nigeria:flag_ng,nigeria|1f1f3-1f1ee:flag nicaragua:flag_ni|1f1f3-1f1f1:flag netherlands:flag_nl|1f1f3-1f1f4:flag norway:flag_no|1f1f3-1f1f5:flag nepal:flag_np|1f1f3-1f1f7:flag nauru:flag_nr|1f1f3-1f1fa:flag niue:flag_nu|1f1f3-1f1ff:flag new zealand:flag_nz|1f1f4-1f1f2:flag oman:flag_om|1f1f5-1f1e6:flag panama:flag_pa|1f1f5-1f1ea:flag peru:flag_pe|1f1f5-1f1eb:flag french polynesia:flag_pf|1f1f5-1f1ec:flag papua new guinea:flag_pg|1f1f5-1f1ed:flag philippines:flag_ph|1f1f5-1f1f0:flag pakistan:flag_pk|1f1f5-1f1f1:flag poland:flag_pl|1f1f5-1f1f2:flag st. pierre & miquelon:flag_pm|1f1f5-1f1f3:flag pitcairn islands:flag_pn|1f1f5-1f1f7:flag puerto rico:flag_pr|1f1f5-1f1f8:flag palestinian territories:flag_ps|1f1f5-1f1f9:flag portugal:flag_pt|1f1f5-1f1fc:flag palau:flag_pw|1f1f5-1f1fe:flag paraguay:flag_py|1f1f6-1f1e6:flag qatar:flag_qa|1f1f7-1f1ea:flag réunion:flag_re|1f1f7-1f1f4:flag romania:flag_ro|1f1f7-1f1f8:flag serbia:flag_rs|1f1f7-1f1fa:flag russia:flag_ru|1f1f7-1f1fc:flag rwanda:flag_rw|1f1f8-1f1e6:flag saudi arabia:flag_sa,saudiarabia,saudi|1f1f8-1f1e7:flag solomon islands:flag_sb|1f1f8-1f1e8:flag seychelles:flag_sc|1f1f8-1f1e9:flag sudan:flag_sd|1f1f8-1f1ea:flag sweden:flag_se|1f1f8-1f1ec:flag singapore:flag_sg|1f1f8-1f1ed:flag st. helena, ascension & tristan da cunha:flag_sh|1f1f8-1f1ee:flag slovenia:flag_si|1f1f8-1f1ef:flag svalbard & jan mayen:flag_sj|1f1f8-1f1f0:flag slovakia:flag_sk|1f1f8-1f1f1:flag sierra leone:flag_sl|1f1f8-1f1f2:flag san marino:flag_sm|1f1f8-1f1f3:flag senegal:flag_sn|1f1f8-1f1f4:flag somalia:flag_so|1f1f8-1f1f7:flag suriname:flag_sr|1f1f8-1f1f8:flag south sudan:flag_ss|1f1f8-1f1f9:flag são tomé & príncipe:flag_st|1f1f8-1f1fb:flag el salvador:flag_sv|1f1f8-1f1fd:flag sint maarten:flag_sx|1f1f8-1f1fe:flag syria:flag_sy|1f1f8-1f1ff:flag eswatini:flag_sz|1f1f9-1f1e6:flag tristan da cunha:flag_ta|1f1f9-1f1e8:flag turks & caicos islands:flag_tc|1f1f9-1f1e9:flag chad:flag_td|1f1f9-1f1eb:flag french southern and antarctic lands:flag_tf|1f1f9-1f1ec:flag togo:flag_tg|1f1f9-1f1ed:flag thailand:flag_th|1f1f9-1f1ef:flag tajikistan:flag_tj|1f1f9-1f1f0:flag tokelau:flag_tk|1f1f9-1f1f1:flag timor-leste:flag_tl|1f1f9-1f1f2:flag turkmenistan:flag_tm,turkmenistan|1f1f9-1f1f3:flag tunisia:flag_tn|1f1f9-1f1f4:flag tonga:flag_to|1f1f9-1f1f7:flag türkiye:flag_tr|1f1f9-1f1f9:flag trinidad & tobago:flag_tt|1f1f9-1f1fb:flag tuvalu:flag_tv,tuvalu|1f1f9-1f1fc:flag taiwan:flag_tw|1f1f9-1f1ff:flag tanzania:flag_tz|1f1fa-1f1e6:flag ukraine:flag_ua|1f1fa-1f1ec:flag uganda:flag_ug|1f1fa-1f1f2:flag u.s. outlying islands:flag_um|1f1fa-1f1f3:flag united nations:united_nations|1f1fa-1f1f8:flag united states:flag_us|1f1fa-1f1fe:flag uruguay:flag_uy|1f1fa-1f1ff:flag uzbekistan:flag_uz|1f1fb-1f1e6:flag vatican city:flag_va|1f1fb-1f1e8:flag st. vincent & grenadines:flag_vc|1f1fb-1f1ea:flag venezuela:flag_ve|1f1fb-1f1ec:flag british virgin islands:flag_vg|1f1fb-1f1ee:flag u.s. virgin islands:flag_vi|1f1fb-1f1f3:flag vietnam:flag_vn|1f1fb-1f1fa:flag vanuatu:flag_vu|1f1fc-1f1eb:flag wallis & futuna:flag_wf|1f1fc-1f1f8:flag samoa:flag_ws|1f1fd-1f1f0:flag kosovo:flag_xk|1f1fe-1f1ea:flag yemen:flag_ye|1f1fe-1f1f9:flag mayotte:flag_yt|1f1ff-1f1e6:flag south africa:flag_za|1f1ff-1f1f2:flag zambia:flag_zm|1f1ff-1f1fc:flag zimbabwe:flag_zw|1f3f4-e0067-e0062-e0065-e006e-e0067-e007f:flag england:england|1f3f4-e0067-e0062-e0073-e0063-e0074-e007f:flag scotland:scotland|1f3f4-e0067-e0062-e0077-e006c-e0073-e007f:flag wales:wales" }
743
743
  ];
744
- function Qi(t) {
744
+ function Yi(t) {
745
745
  return t.replace(/[^a-z0-9+]+/g, "_").replace(/^_|_$/g, "");
746
746
  }
747
- function Yi(t) {
748
- const [e = "", n = "", r = ""] = t.split(":"), s = Qi(n), a = r ? r.split(",") : [];
747
+ function Xi(t) {
748
+ const [e = "", n = "", r = ""] = t.split(":"), s = Yi(n), a = r ? r.split(",") : [];
749
749
  return s && !a.includes(s) && a.push(s), { char: String.fromCodePoint(...e.split("-").map((i) => parseInt(i, 16))), name: n, shortcodes: a };
750
750
  }
751
751
  let Qn = null;
752
- function $t() {
753
- return Qn ??= Ji.map((t) => ({ id: t.id, label: t.label, emoji: t.data.split("|").map(Yi) })), Qn;
752
+ function Dt() {
753
+ return Qn ??= Qi.map((t) => ({ id: t.id, label: t.label, emoji: t.data.split("|").map(Xi) })), Qn;
754
754
  }
755
755
  let tt = null;
756
- function qt(t) {
756
+ function Kt(t) {
757
757
  if (!tt) {
758
758
  tt = /* @__PURE__ */ new Map();
759
- for (const e of $t().flatMap((n) => n.emoji)) {
759
+ for (const e of Dt().flatMap((n) => n.emoji)) {
760
760
  tt.set(e.char, e);
761
761
  const n = e.char.replace(/\ufe0f/g, "");
762
762
  tt.has(n) || tt.set(n, e);
@@ -764,7 +764,7 @@ function qt(t) {
764
764
  }
765
765
  return tt.get(t) ?? tt.get(t.replace(/\ufe0f/g, ""));
766
766
  }
767
- const Xi = [
767
+ const Zi = [
768
768
  "joy",
769
769
  "heart",
770
770
  "thumbsup",
@@ -802,26 +802,26 @@ const Xi = [
802
802
  "pensive"
803
803
  ];
804
804
  let Yn = null;
805
- function Zi() {
806
- return Yn ??= Xi.flatMap((t) => ia(t)?.char ?? []), Yn;
805
+ function eo() {
806
+ return Yn ??= Zi.flatMap((t) => oa(t)?.char ?? []), Yn;
807
807
  }
808
808
  let xt = null;
809
- function ia(t) {
809
+ function oa(t) {
810
810
  if (!xt) {
811
811
  xt = /* @__PURE__ */ new Map();
812
- for (const e of $t().flatMap((n) => n.emoji))
812
+ for (const e of Dt().flatMap((n) => n.emoji))
813
813
  for (const n of e.shortcodes) xt.has(n) || xt.set(n, e);
814
814
  }
815
815
  return xt.get(t.toLowerCase());
816
816
  }
817
- function eo(t, e = 8) {
817
+ function to(t, e = 8) {
818
818
  const n = t.toLowerCase();
819
819
  if (!n) return [];
820
820
  const r = /* @__PURE__ */ new Map();
821
- for (const f of [...Ln(), ...Zi()]) r.has(f) || r.set(f, r.size);
821
+ for (const f of [...Ln(), ...eo()]) r.has(f) || r.set(f, r.size);
822
822
  const s = (f) => r.get(f.char) ?? r.size, a = [];
823
823
  let i = 0;
824
- for (const f of $t().flatMap((o) => o.emoji)) {
824
+ for (const f of Dt().flatMap((o) => o.emoji)) {
825
825
  i += 1;
826
826
  let o = null;
827
827
  for (const l of f.shortcodes) {
@@ -832,10 +832,10 @@ function eo(t, e = 8) {
832
832
  }
833
833
  return a.sort((f, o) => f.rank - o.rank || f.order - o.order), a.slice(0, e).map(({ emoji: f, code: o }) => ({ emoji: f, code: o }));
834
834
  }
835
- function to(t, e = 120) {
835
+ function no(t, e = 120) {
836
836
  const n = t.toLowerCase().trim().split(/\s+/).filter(Boolean);
837
837
  if (!n.length) return [];
838
- const r = $t().flatMap((o) => o.emoji), s = n.join("_").replace(/^:|:$/g, ""), a = r.filter((o) => {
838
+ const r = Dt().flatMap((o) => o.emoji), s = n.join("_").replace(/^:|:$/g, ""), a = r.filter((o) => {
839
839
  const l = o.name.split(/[\s-]+/);
840
840
  return n.every((d) => l.some((u) => u.startsWith(d))) || o.shortcodes.some((d) => d.startsWith(s));
841
841
  }), i = n.join(" "), f = (o) => {
@@ -845,7 +845,7 @@ function to(t, e = 120) {
845
845
  };
846
846
  return a.sort((o, l) => f(o) - f(l)), a.slice(0, e);
847
847
  }
848
- const no = [
848
+ const ro = [
849
849
  [128077],
850
850
  [10084, 65039],
851
851
  [128514],
@@ -856,19 +856,19 @@ const no = [
856
856
  function Ln() {
857
857
  return S.getState().recentEmoji;
858
858
  }
859
- function oa(t) {
859
+ function fa(t) {
860
860
  S.getState().noteRecentEmoji(t);
861
861
  }
862
- function ro(t = 3, e = Ln()) {
862
+ function ao(t = 3, e = Ln()) {
863
863
  const n = [];
864
- for (const r of [...e, ...no])
864
+ for (const r of [...e, ...ro])
865
865
  if (n.includes(r) || n.push(r), n.length === t) break;
866
866
  return n;
867
867
  }
868
- function fa(t, e) {
868
+ function la(t, e) {
869
869
  return t.by.some((n) => n === e.author || !!e.clientId && n === e.clientId);
870
870
  }
871
- function ao(t, e, n) {
871
+ function so(t, e, n) {
872
872
  const r = /* @__PURE__ */ new Map();
873
873
  for (const f of Object.values(e))
874
874
  f.author && r.set(f.author, f.name), r.set(f.clientId, f.name);
@@ -884,18 +884,18 @@ function ao(t, e, n) {
884
884
  }
885
885
  return a && s.unshift("You"), i && s.push(i === 1 ? "1 other" : `${i} others`), s;
886
886
  }
887
- function so(t, e) {
887
+ function io(t, e) {
888
888
  return `${t.length <= 1 ? t[0] ?? "Someone" : `${t.slice(0, -1).join(", ")} and ${t[t.length - 1]}`} reacted with ${e ? `:${e.replace(/\s+/g, "_")}:` : "this"}`;
889
889
  }
890
890
  const Ne = 8;
891
- function io(t) {
891
+ function oo(t) {
892
892
  return document.addEventListener("fullscreenchange", t), () => document.removeEventListener("fullscreenchange", t);
893
893
  }
894
- function la() {
894
+ function ca() {
895
895
  const t = aa();
896
- return ns(io, () => document.fullscreenElement, () => null) ?? t ?? document.body;
896
+ return as(oo, () => document.fullscreenElement, () => null) ?? t ?? document.body;
897
897
  }
898
- function ca({
898
+ function da({
899
899
  anchor: t,
900
900
  onClose: e,
901
901
  width: n,
@@ -908,19 +908,19 @@ function ca({
908
908
  testId: l,
909
909
  children: d
910
910
  }) {
911
- const u = la(), m = D(null), [y, b] = L(null), g = j(() => {
911
+ const u = ca(), m = D(null), [y, b] = L(null), g = j(() => {
912
912
  const h = m.current;
913
913
  if (!t || !h) return;
914
914
  const p = t.getBoundingClientRect(), _ = window.innerWidth, I = window.innerHeight, M = Math.min(n, _ - Ne * 2), w = Math.min(Math.max(Ne, s ? p.right - M : p.left), _ - M - Ne), k = h.offsetHeight, F = p.top - a - Ne, E = I - p.bottom - a - Ne, v = r === "top" ? k <= F || F >= E : !(k <= E || E >= F), C = Math.max(120, v ? F : E), $ = Math.min(k, C), B = v ? p.top - a - $ : p.bottom + a;
915
915
  b((O) => O && O.left === w && O.top === B && O.maxHeight === C ? O : { left: w, top: B, maxHeight: C });
916
916
  }, [t, n, s, a, r]);
917
- return zt(() => {
917
+ return Wt(() => {
918
918
  g();
919
919
  const h = m.current, p = typeof ResizeObserver > "u" || !h ? null : new ResizeObserver(() => g());
920
920
  return p && h && p.observe(h), window.addEventListener("resize", g), window.addEventListener("scroll", g, !0), () => {
921
921
  p?.disconnect(), window.removeEventListener("resize", g), window.removeEventListener("scroll", g, !0);
922
922
  };
923
- }, [g]), zt(() => {
923
+ }, [g]), Wt(() => {
924
924
  const h = (_) => {
925
925
  qe(_) && (_.stopPropagation(), e(), t?.focus({ preventScroll: !0 }));
926
926
  }, p = (_) => {
@@ -959,8 +959,8 @@ function ca({
959
959
  );
960
960
  }
961
961
  function Xn({ anchor: t, width: e, children: n }) {
962
- const r = la(), [s, a] = L(null);
963
- return zt(() => {
962
+ const r = ca(), [s, a] = L(null);
963
+ return Wt(() => {
964
964
  if (!t) return;
965
965
  const i = () => {
966
966
  const f = t.getBoundingClientRect(), o = Math.min(e, window.innerWidth - Ne * 2), l = Math.min(Math.max(Ne, f.right - o), window.innerWidth - o - Ne);
@@ -974,12 +974,12 @@ function Xn({ anchor: t, width: e, children: n }) {
974
974
  r
975
975
  ) : null;
976
976
  }
977
- const oo = 340;
978
- function fo({ anchor: t, onPick: e, onClose: n }) {
979
- const [r, s] = L(""), [a, i] = L(null), f = D(null), o = D(null), l = ye(() => $t(), []), d = ye(
980
- () => Ln().map((h) => qt(h) ?? { char: h, name: "", shortcodes: [] }).slice(0, 16),
977
+ const fo = 340;
978
+ function lo({ anchor: t, onPick: e, onClose: n }) {
979
+ const [r, s] = L(""), [a, i] = L(null), f = D(null), o = D(null), l = ye(() => Dt(), []), d = ye(
980
+ () => Ln().map((h) => Kt(h) ?? { char: h, name: "", shortcodes: [] }).slice(0, 16),
981
981
  []
982
- ), u = ye(() => to(r), [r]), m = r.trim().length > 0;
982
+ ), u = ye(() => no(r), [r]), m = r.trim().length > 0;
983
983
  R(() => {
984
984
  f.current?.focus({ preventScroll: !0 });
985
985
  }, []);
@@ -1002,7 +1002,7 @@ function fo({ anchor: t, onPick: e, onClose: n }) {
1002
1002
  },
1003
1003
  p
1004
1004
  );
1005
- return /* @__PURE__ */ x(ca, { anchor: t, onClose: n, width: oo, className: "emoji-picker", ariaLabel: "Emoji picker", testId: "emoji-picker", children: [
1005
+ return /* @__PURE__ */ x(da, { anchor: t, onClose: n, width: fo, className: "emoji-picker", ariaLabel: "Emoji picker", testId: "emoji-picker", children: [
1006
1006
  /* @__PURE__ */ c("div", { className: "emoji-picker-search", children: /* @__PURE__ */ c(
1007
1007
  "input",
1008
1008
  {
@@ -1043,70 +1043,70 @@ function fo({ anchor: t, onPick: e, onClose: n }) {
1043
1043
  ] }) : null })
1044
1044
  ] });
1045
1045
  }
1046
- function Rc({ className: t = "w-5 h-5" }) {
1046
+ function Dc({ className: t = "w-5 h-5" }) {
1047
1047
  return /* @__PURE__ */ c("svg", { className: t, fill: "currentColor", viewBox: "0 0 24 24", "aria-hidden": "true", children: /* @__PURE__ */ c("path", { d: "M12 17.27L18.18 21l-1.64-7.03L22 9.24l-7.19-.61L12 2 9.19 8.63 2 9.24l5.46 4.73L5.82 21z" }) });
1048
1048
  }
1049
- function lo({ className: t = "w-5 h-5" }) {
1049
+ function co({ className: t = "w-5 h-5" }) {
1050
1050
  return /* @__PURE__ */ c("svg", { className: t, viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ c("path", { d: "M8 5v14l11-7z" }) });
1051
1051
  }
1052
- function co({ className: t = "w-5 h-5" }) {
1052
+ function uo({ className: t = "w-5 h-5" }) {
1053
1053
  return /* @__PURE__ */ c("svg", { className: t, viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ c("path", { d: "M6 19h4V5H6v14zm8-14v14h4V5h-4z" }) });
1054
1054
  }
1055
- function uo({ className: t = "w-5 h-5" }) {
1055
+ function ho({ className: t = "w-5 h-5" }) {
1056
1056
  return /* @__PURE__ */ x("svg", { className: t, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2, children: [
1057
1057
  /* @__PURE__ */ c("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M5.586 15H4a1 1 0 01-1-1v-4a1 1 0 011-1h1.586l4.707-4.707C10.923 3.663 12 4.109 12 5v14c0 .891-1.077 1.337-1.707.707L5.586 15z" }),
1058
1058
  /* @__PURE__ */ c("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M17 14l2-2m0 0l2-2m-2 2l-2-2m2 2l2 2" })
1059
1059
  ] });
1060
1060
  }
1061
- function ho({ className: t = "w-5 h-5" }) {
1061
+ function go({ className: t = "w-5 h-5" }) {
1062
1062
  return /* @__PURE__ */ x("svg", { className: t, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2, children: [
1063
1063
  /* @__PURE__ */ c("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M5.586 15H4a1 1 0 01-1-1v-4a1 1 0 011-1h1.586l4.707-4.707C10.923 3.663 12 4.109 12 5v14c0 .891-1.077 1.337-1.707.707L5.586 15z" }),
1064
1064
  /* @__PURE__ */ c("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M15.536 8.464a5 5 0 010 7.072" })
1065
1065
  ] });
1066
1066
  }
1067
- function go({ className: t = "w-5 h-5" }) {
1067
+ function mo({ className: t = "w-5 h-5" }) {
1068
1068
  return /* @__PURE__ */ x("svg", { className: t, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2, children: [
1069
1069
  /* @__PURE__ */ c("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M5.586 15H4a1 1 0 01-1-1v-4a1 1 0 011-1h1.586l4.707-4.707C10.923 3.663 12 4.109 12 5v14c0 .891-1.077 1.337-1.707.707L5.586 15z" }),
1070
1070
  /* @__PURE__ */ c("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M15.536 8.464a5 5 0 010 7.072M18.364 5.636a9 9 0 010 12.728" })
1071
1071
  ] });
1072
1072
  }
1073
- function mo({ className: t = "w-5 h-5" }) {
1073
+ function po({ className: t = "w-5 h-5" }) {
1074
1074
  return /* @__PURE__ */ c("svg", { className: t, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2, children: /* @__PURE__ */ c("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M4 8V4m0 0h4M4 4l5 5m11-1V4m0 0h-4m4 0l-5 5M4 16v4m0 0h4m-4 0l5-5m11 5l-5-5m5 5v-4m0 4h-4" }) });
1075
1075
  }
1076
- function po({ className: t = "w-5 h-5" }) {
1076
+ function bo({ className: t = "w-5 h-5" }) {
1077
1077
  return /* @__PURE__ */ c("svg", { className: t, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2, children: /* @__PURE__ */ c("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M4 4l5 5m0-4v4H5m15-5l-5 5m0-4v4h4M4 20l5-5m0 4v-4H5m15 5l-5-5m0 4v-4h4" }) });
1078
1078
  }
1079
- function da({ className: t = "w-5 h-5" }) {
1079
+ function ua({ className: t = "w-5 h-5" }) {
1080
1080
  return /* @__PURE__ */ c("svg", { className: t, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2.5, children: /* @__PURE__ */ c("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M15 19l-7-7 7-7" }) });
1081
1081
  }
1082
- function bo({ className: t = "w-5 h-5" }) {
1082
+ function yo({ className: t = "w-5 h-5" }) {
1083
1083
  return /* @__PURE__ */ c("svg", { className: t, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2.5, children: /* @__PURE__ */ c("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M9 5l7 7-7 7" }) });
1084
1084
  }
1085
- function ua({ className: t = "w-4 h-4" }) {
1085
+ function ha({ className: t = "w-4 h-4" }) {
1086
1086
  return /* @__PURE__ */ x("svg", { className: t, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2, children: [
1087
1087
  /* @__PURE__ */ c("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M4 4v16" }),
1088
1088
  /* @__PURE__ */ c("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M15 12l-5 4v-8l5 4z" })
1089
1089
  ] });
1090
1090
  }
1091
- function yo({ className: t = "w-4 h-4" }) {
1091
+ function wo({ className: t = "w-4 h-4" }) {
1092
1092
  return /* @__PURE__ */ x("svg", { className: t, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2, children: [
1093
1093
  /* @__PURE__ */ c("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M20 4v16" }),
1094
1094
  /* @__PURE__ */ c("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M9 12l5 4v-8l-5 4z" })
1095
1095
  ] });
1096
1096
  }
1097
- function ha({ className: t = "w-5 h-5" }) {
1097
+ function ga({ className: t = "w-5 h-5" }) {
1098
1098
  return /* @__PURE__ */ c("svg", { className: t, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2, children: /* @__PURE__ */ c("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M6 6l12 12M18 6L6 18" }) });
1099
1099
  }
1100
- function wo({ className: t = "w-5 h-5" }) {
1100
+ function _o({ className: t = "w-5 h-5" }) {
1101
1101
  return /* @__PURE__ */ x("svg", { className: t, viewBox: "0 0 24 24", fill: "currentColor", children: [
1102
1102
  /* @__PURE__ */ c("path", { d: "M12 5l8 11H4z" }),
1103
1103
  /* @__PURE__ */ c("rect", { x: "4", y: "17", width: "16", height: "3", rx: "0.5" })
1104
1104
  ] });
1105
1105
  }
1106
- function _o({ className: t = "w-5 h-5" }) {
1106
+ function vo({ className: t = "w-5 h-5" }) {
1107
1107
  return /* @__PURE__ */ c("svg", { className: t, fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /* @__PURE__ */ c("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M7 4v16M17 4v16M3 8h4m10 0h4M3 12h18M3 16h4m10 0h4M4 4h16a1 1 0 011 1v14a1 1 0 01-1 1H4a1 1 0 01-1-1V5a1 1 0 011-1z" }) });
1108
1108
  }
1109
- function ga({ className: t = "w-4 h-4" }) {
1109
+ function ma({ className: t = "w-4 h-4" }) {
1110
1110
  return /* @__PURE__ */ x("svg", { className: t, fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: [
1111
1111
  /* @__PURE__ */ c("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M20.5 12.5A8.5 8.5 0 1111.5 3.5" }),
1112
1112
  /* @__PURE__ */ c("path", { strokeLinecap: "round", d: "M8.5 14.5a4 4 0 007 0" }),
@@ -1114,21 +1114,21 @@ function ga({ className: t = "w-4 h-4" }) {
1114
1114
  /* @__PURE__ */ c("path", { strokeLinecap: "round", d: "M19 2v6M16 5h6" })
1115
1115
  ] });
1116
1116
  }
1117
- function vo({ className: t = "w-4 h-4" }) {
1117
+ function ko({ className: t = "w-4 h-4" }) {
1118
1118
  return /* @__PURE__ */ x("svg", { className: t, fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: [
1119
1119
  /* @__PURE__ */ c("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M10 7L4 12l6 5" }),
1120
1120
  /* @__PURE__ */ c("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M4 12h9a7 7 0 017 7" })
1121
1121
  ] });
1122
1122
  }
1123
- function sn(t) {
1123
+ function on(t) {
1124
1124
  return new Date(t).toLocaleTimeString([], { hour: "2-digit", minute: "2-digit" });
1125
1125
  }
1126
- const ko = at.memo(function({ message: e }) {
1127
- const n = S((_) => _.me.clientId), r = S((_) => _.me.clientId ? _.roster[_.me.clientId]?.author : void 0), s = Vi(e, { clientId: n, author: r }), a = Jt(
1126
+ const So = at.memo(function({ message: e }) {
1127
+ const n = S((_) => _.me.clientId), r = S((_) => _.me.clientId ? _.roster[_.me.clientId]?.author : void 0), s = ia(e, { clientId: n, author: r }), a = Qt(
1128
1128
  { clientId: e.clientId, author: e.author },
1129
1129
  { name: e.name, sprite: e.sprite }
1130
1130
  ), i = Ge(a.sprite, a.pictureUrl), f = e.isSystem ? void 0 : a.cosmetics, o = D(null);
1131
- Ui(o, !!f);
1131
+ Wi(o, !!f);
1132
1132
  const [l] = L(
1133
1133
  () => e.live && e.text ? Ir(e.text, f) : null
1134
1134
  ), [d, u] = L(!1), [m, y] = L(null), b = S((_) => _.setReplyingTo), g = S((_) => _.recentEmoji);
@@ -1136,20 +1136,20 @@ const ko = at.memo(function({ message: e }) {
1136
1136
  return /* @__PURE__ */ c("div", { className: "px-2 py-1.5", children: /* @__PURE__ */ x("div", { className: "border-l-2 border-border-light pl-2.5 py-0.5", children: [
1137
1137
  /* @__PURE__ */ x("div", { className: "text-[10px] uppercase tracking-wide text-text-muted mb-0.5", children: [
1138
1138
  "Recap",
1139
- /* @__PURE__ */ c("span", { className: "ml-1.5 normal-case tracking-normal opacity-60", children: sn(e.ts) })
1139
+ /* @__PURE__ */ c("span", { className: "ml-1.5 normal-case tracking-normal opacity-60", children: on(e.ts) })
1140
1140
  ] }),
1141
1141
  /* @__PURE__ */ c("p", { className: "text-[13px] text-text-secondary leading-relaxed whitespace-pre-wrap break-words", children: e.text })
1142
1142
  ] }) });
1143
1143
  if (e.isSystem)
1144
1144
  return /* @__PURE__ */ x("div", { className: "px-2 py-0.5 text-[11px] text-text-muted italic text-center leading-tight", children: [
1145
- ji(e.text, e.template, a),
1146
- /* @__PURE__ */ c("span", { className: "ml-1 text-[10px] opacity-50", children: sn(e.ts) })
1145
+ Ui(e.text, e.template, a),
1146
+ /* @__PURE__ */ c("span", { className: "ml-1 text-[10px] opacity-50", children: on(e.ts) })
1147
1147
  ] });
1148
1148
  const h = { clientId: n, author: r }, p = (_) => {
1149
- const I = e.reactions?.find((k) => k.emoji === _), M = !(I && fa(I, h));
1150
- M && oa(_);
1149
+ const I = e.reactions?.find((k) => k.emoji === _), M = !(I && la(I, h));
1150
+ M && fa(_);
1151
1151
  const w = r ?? n;
1152
- w && hs(e.id, _, M, w), gs(e.id, _, M);
1152
+ w && ms(e.id, _, M, w), ps(e.id, _, M);
1153
1153
  };
1154
1154
  return /* @__PURE__ */ x(
1155
1155
  "div",
@@ -1166,19 +1166,19 @@ const ko = at.memo(function({ message: e }) {
1166
1166
  },
1167
1167
  "data-active": d || m ? "true" : void 0,
1168
1168
  children: [
1169
- e.replyTo && /* @__PURE__ */ c(So, { replyTo: e.replyTo }),
1169
+ e.replyTo && /* @__PURE__ */ c(xo, { replyTo: e.replyTo }),
1170
1170
  /* @__PURE__ */ x("div", { className: "flex items-start gap-2", children: [
1171
1171
  /* @__PURE__ */ c(ra, { sprite: a.sprite, url: a.pictureUrl, alt: a.name, worn: f }),
1172
1172
  /* @__PURE__ */ x("div", { className: "flex-1 min-w-0 -mt-0.5", children: [
1173
- f ? /* @__PURE__ */ c(Rt, { html: Cr(a.name, f), className: "text-[13px]", style: { color: i } }) : /* @__PURE__ */ c("span", { className: "font-medium text-[13px]", style: { color: i }, children: a.name }),
1174
- /* @__PURE__ */ c("span", { className: "text-[10px] text-text-muted opacity-60 ml-1.5", children: sn(e.ts) }),
1175
- e.text && (l ? /* @__PURE__ */ c(Rt, { as: "p", html: l, className: "text-[13px] text-text break-words leading-snug m-0" }) : /* @__PURE__ */ c("p", { className: "text-[13px] text-text break-words leading-snug m-0", children: e.text })),
1173
+ f ? /* @__PURE__ */ c(Lt, { html: Cr(a.name, f), className: "text-[13px]", style: { color: i } }) : /* @__PURE__ */ c("span", { className: "font-medium text-[13px]", style: { color: i }, children: a.name }),
1174
+ /* @__PURE__ */ c("span", { className: "text-[10px] text-text-muted opacity-60 ml-1.5", children: on(e.ts) }),
1175
+ e.text && (l ? /* @__PURE__ */ c(Lt, { as: "p", html: l, className: "text-[13px] text-text break-words leading-snug m-0" }) : /* @__PURE__ */ c("p", { className: "text-[13px] text-text break-words leading-snug m-0", children: e.text })),
1176
1176
  /* @__PURE__ */ c(sa, { images: e.images }),
1177
- e.reactions && e.reactions.length > 0 && /* @__PURE__ */ c(xo, { reactions: e.reactions, me: h, onToggle: p, onAdd: y })
1177
+ e.reactions && e.reactions.length > 0 && /* @__PURE__ */ c(Eo, { reactions: e.reactions, me: h, onToggle: p, onAdd: y })
1178
1178
  ] })
1179
1179
  ] }),
1180
1180
  (d || m) && /* @__PURE__ */ x("div", { className: "chat-msg-actions", role: "toolbar", "aria-label": "Message actions", "data-testid": "chat-msg-actions", children: [
1181
- ro(3, g).map((_) => /* @__PURE__ */ c("button", { type: "button", className: "chat-action-btn chat-action-emoji", onClick: () => p(_), "aria-label": `React with ${qt(_)?.name ?? _}`, title: qt(_)?.name, children: _ }, _)),
1181
+ ao(3, g).map((_) => /* @__PURE__ */ c("button", { type: "button", className: "chat-action-btn chat-action-emoji", onClick: () => p(_), "aria-label": `React with ${Kt(_)?.name ?? _}`, title: Kt(_)?.name, children: _ }, _)),
1182
1182
  /* @__PURE__ */ c(
1183
1183
  "button",
1184
1184
  {
@@ -1188,20 +1188,20 @@ const ko = at.memo(function({ message: e }) {
1188
1188
  "aria-label": "Add reaction",
1189
1189
  title: "Add reaction",
1190
1190
  "aria-expanded": !!m,
1191
- children: /* @__PURE__ */ c(ga, {})
1191
+ children: /* @__PURE__ */ c(ma, {})
1192
1192
  }
1193
1193
  ),
1194
- /* @__PURE__ */ c("button", { type: "button", className: "chat-action-btn", onClick: () => b(e.id), "aria-label": "Reply", title: "Reply", children: /* @__PURE__ */ c(vo, {}) })
1194
+ /* @__PURE__ */ c("button", { type: "button", className: "chat-action-btn", onClick: () => b(e.id), "aria-label": "Reply", title: "Reply", children: /* @__PURE__ */ c(ko, {}) })
1195
1195
  ] }),
1196
- m && /* @__PURE__ */ c(fo, { anchor: m, onPick: p, onClose: () => {
1196
+ m && /* @__PURE__ */ c(lo, { anchor: m, onPick: p, onClose: () => {
1197
1197
  y(null), u(!1);
1198
1198
  } })
1199
1199
  ]
1200
1200
  }
1201
1201
  );
1202
1202
  });
1203
- function So({ replyTo: t }) {
1204
- const e = S((i) => i.chat.find((f) => f.id === t)), n = S((i) => i.jumpToMessage), r = Jt(
1203
+ function xo({ replyTo: t }) {
1204
+ const e = S((i) => i.chat.find((f) => f.id === t)), n = S((i) => i.jumpToMessage), r = Qt(
1205
1205
  { clientId: e?.clientId ?? "", author: e?.author },
1206
1206
  { name: e?.name ?? "", sprite: e?.sprite ?? null }
1207
1207
  ), s = Ge(r.sprite, r.pictureUrl);
@@ -1237,11 +1237,11 @@ function So({ replyTo: t }) {
1237
1237
  }
1238
1238
  );
1239
1239
  }
1240
- function xo({ reactions: t, me: e, onToggle: n, onAdd: r }) {
1240
+ function Eo({ reactions: t, me: e, onToggle: n, onAdd: r }) {
1241
1241
  const s = S((a) => a.roster);
1242
1242
  return /* @__PURE__ */ x("div", { className: "chat-reactions", "data-testid": "chat-reactions", children: [
1243
1243
  t.map((a) => {
1244
- const i = fa(a, e);
1244
+ const i = la(a, e);
1245
1245
  return /* @__PURE__ */ x(
1246
1246
  "button",
1247
1247
  {
@@ -1250,7 +1250,7 @@ function xo({ reactions: t, me: e, onToggle: n, onAdd: r }) {
1250
1250
  "data-mine": i ? "true" : void 0,
1251
1251
  "aria-pressed": i,
1252
1252
  onClick: () => n(a.emoji),
1253
- title: so(ao(a, s, e), qt(a.emoji)?.name),
1253
+ title: io(so(a, s, e), Kt(a.emoji)?.name),
1254
1254
  "data-emoji": a.emoji,
1255
1255
  children: [
1256
1256
  /* @__PURE__ */ c("span", { className: "chat-reaction-emoji", children: a.emoji }),
@@ -1260,10 +1260,10 @@ function xo({ reactions: t, me: e, onToggle: n, onAdd: r }) {
1260
1260
  a.emoji
1261
1261
  );
1262
1262
  }),
1263
- /* @__PURE__ */ c("button", { type: "button", className: "chat-reaction chat-reaction-add", onClick: (a) => r(a.currentTarget), "aria-label": "Add reaction", title: "Add reaction", children: /* @__PURE__ */ c(ga, {}) })
1263
+ /* @__PURE__ */ c("button", { type: "button", className: "chat-reaction chat-reaction-add", onClick: (a) => r(a.currentTarget), "aria-label": "Add reaction", title: "Add reaction", children: /* @__PURE__ */ c(ma, {}) })
1264
1264
  ] });
1265
1265
  }
1266
- function Eo() {
1266
+ function Mo() {
1267
1267
  ta();
1268
1268
  const t = S((a) => a.chat), e = D(null), n = D(!1), r = j(() => {
1269
1269
  const a = e.current;
@@ -1299,7 +1299,7 @@ function Eo() {
1299
1299
  /* @__PURE__ */ c("span", { className: "text-[10px] text-text-muted whitespace-nowrap", children: new Date(a.ts).toLocaleDateString([], { weekday: "short", month: "short", day: "numeric" }) }),
1300
1300
  /* @__PURE__ */ c("div", { className: "flex-1 h-px bg-border" })
1301
1301
  ] }),
1302
- /* @__PURE__ */ c(ko, { message: a })
1302
+ /* @__PURE__ */ c(So, { message: a })
1303
1303
  ] }, a.id);
1304
1304
  }) })
1305
1305
  }
@@ -1326,12 +1326,12 @@ const Fn = [
1326
1326
  scope: "local"
1327
1327
  }
1328
1328
  ], bt = "/";
1329
- function Mo(t) {
1329
+ function To(t) {
1330
1330
  if (!t.startsWith(bt)) return null;
1331
1331
  const e = t.slice(bt.length);
1332
1332
  return /\s/.test(e) ? null : e.toLowerCase();
1333
1333
  }
1334
- function To(t, e = Fn) {
1334
+ function Ao(t, e = Fn) {
1335
1335
  const n = t.toLowerCase();
1336
1336
  if (!n) return [...e].sort((s, a) => s.name.localeCompare(a.name));
1337
1337
  const r = [];
@@ -1341,23 +1341,23 @@ function To(t, e = Fn) {
1341
1341
  }
1342
1342
  return r.sort((s, a) => s.rank - a.rank || s.cmd.name.localeCompare(a.cmd.name)).map((s) => s.cmd);
1343
1343
  }
1344
- function Ao(t) {
1344
+ function Io(t) {
1345
1345
  return `${bt}${t.name} `;
1346
1346
  }
1347
1347
  function Tt(t, e) {
1348
1348
  return e <= 0 ? 0 : (t % e + e) % e;
1349
1349
  }
1350
- function Io(t, e = Fn) {
1350
+ function Co(t, e = Fn) {
1351
1351
  const n = t.trim();
1352
1352
  if (!n) return null;
1353
1353
  if (!n.startsWith(bt)) return { kind: "chat", text: n };
1354
1354
  const r = n.slice(bt.length), s = r.search(/\s/), a = (s === -1 ? r : r.slice(0, s)).toLowerCase(), i = s === -1 ? "" : r.slice(s).trim(), f = e.find((o) => o.name.toLowerCase() === a);
1355
1355
  return f ? { kind: "command", command: f, args: i } : { kind: "chat", text: n };
1356
1356
  }
1357
- function Co(t, e) {
1357
+ function No(t, e) {
1358
1358
  return t.requiresMedia && !e.hasMedia ? `${bt}${t.name} needs an episode loaded.` : null;
1359
1359
  }
1360
- function No({
1360
+ function Ro({
1361
1361
  commands: t,
1362
1362
  activeIndex: e,
1363
1363
  hasMedia: n,
@@ -1399,8 +1399,8 @@ function No({
1399
1399
  }
1400
1400
  );
1401
1401
  }
1402
- const ma = (t, e) => `${t}-emoji-${e.code}`;
1403
- function pa({ matches: t, activeIndex: e, onPick: n, onHover: r, listboxId: s }) {
1402
+ const pa = (t, e) => `${t}-emoji-${e.code}`;
1403
+ function ba({ matches: t, activeIndex: e, onPick: n, onHover: r, listboxId: s }) {
1404
1404
  return t.length === 0 ? null : /* @__PURE__ */ c(
1405
1405
  "ul",
1406
1406
  {
@@ -1414,7 +1414,7 @@ function pa({ matches: t, activeIndex: e, onPick: n, onHover: r, listboxId: s })
1414
1414
  children: t.map((a, i) => /* @__PURE__ */ x(
1415
1415
  "li",
1416
1416
  {
1417
- id: ma(s, a),
1417
+ id: pa(s, a),
1418
1418
  role: "option",
1419
1419
  "aria-selected": i === e,
1420
1420
  onMouseDown: (f) => {
@@ -1436,38 +1436,38 @@ function pa({ matches: t, activeIndex: e, onPick: n, onHover: r, listboxId: s })
1436
1436
  }
1437
1437
  );
1438
1438
  }
1439
- const Ro = 2, Lo = /^[a-z0-9_+-]*$/i;
1440
- function Fo(t, e) {
1439
+ const Lo = 2, Fo = /^[a-z0-9_+-]*$/i;
1440
+ function $o(t, e) {
1441
1441
  const n = t.slice(0, e), r = n.lastIndexOf(":");
1442
1442
  if (r < 0) return null;
1443
1443
  const s = r === 0 ? "" : n[r - 1];
1444
1444
  if (s && !/[\s([{]/.test(s)) return null;
1445
1445
  const a = n.slice(r + 1);
1446
- return a.length < Ro || !Lo.test(a) ? null : { query: a.toLowerCase(), start: r };
1446
+ return a.length < Lo || !Fo.test(a) ? null : { query: a.toLowerCase(), start: r };
1447
1447
  }
1448
- function $o(t, e, n, r) {
1448
+ function Do(t, e, n, r) {
1449
1449
  const s = t.slice(n), a = s.startsWith(" ") ? r : `${r} `;
1450
1450
  return { text: t.slice(0, e) + a + s, caret: e + a.length };
1451
1451
  }
1452
- function ba(t) {
1452
+ function ya(t) {
1453
1453
  let e = -1;
1454
1454
  return t.replace(/:([a-z0-9_+-]+):/gi, (n, r, s) => {
1455
1455
  const a = s === 0 ? "" : t[s - 1];
1456
1456
  if (a && !/[\s([{]/.test(a) && s !== e) return n;
1457
- const i = ia(r);
1457
+ const i = oa(r);
1458
1458
  return i ? (e = s + n.length, i.char) : n;
1459
1459
  });
1460
1460
  }
1461
- function ya(t, e, n) {
1462
- const [r, s] = L(0), [a, i] = L({ q: null, i: 0 }), [f, o] = L(null), l = Fo(t, Math.min(r, t.length)), d = l?.query ?? null, u = ye(() => d ? eo(d) : [], [d]), m = l ? `${l.start}:${d}` : null, y = u.length > 0 && f !== m, b = a.q === m ? Tt(a.i, u.length) : 0, g = j((M) => i({ q: m, i: M }), [m]), h = D(null);
1463
- zt(() => {
1461
+ function wa(t, e, n) {
1462
+ const [r, s] = L(0), [a, i] = L({ q: null, i: 0 }), [f, o] = L(null), l = $o(t, Math.min(r, t.length)), d = l?.query ?? null, u = ye(() => d ? to(d) : [], [d]), m = l ? `${l.start}:${d}` : null, y = u.length > 0 && f !== m, b = a.q === m ? Tt(a.i, u.length) : 0, g = j((M) => i({ q: m, i: M }), [m]), h = D(null);
1463
+ Wt(() => {
1464
1464
  const M = h.current, w = n.current;
1465
1465
  M === null || !w || (h.current = null, w.setSelectionRange(M, M));
1466
1466
  }, [t, n]);
1467
1467
  const p = j((M) => s(M.selectionStart ?? M.value.length), []), _ = j((M) => {
1468
1468
  if (!l) return;
1469
- const w = $o(t, l.start, Math.min(r, t.length), M.emoji.char);
1470
- e(w.text), s(w.caret), oa(M.emoji.char), h.current = w.caret, n.current?.focus();
1469
+ const w = Do(t, l.start, Math.min(r, t.length), M.emoji.char);
1470
+ e(w.text), s(w.caret), fa(M.emoji.char), h.current = w.caret, n.current?.focus();
1471
1471
  }, [l, t, r, e, n]), I = j((M) => {
1472
1472
  if (!y) return !1;
1473
1473
  if (M.key === "ArrowDown" || M.key === "ArrowUp")
@@ -1481,7 +1481,7 @@ function ya(t, e, n) {
1481
1481
  }, [y, u, b, _, g, m]);
1482
1482
  return { open: y, matches: u, activeIndex: b, setActiveIndex: g, pick: _, onKeyDown: I, trackCaret: p };
1483
1483
  }
1484
- function wa({
1484
+ function _a({
1485
1485
  pending: t,
1486
1486
  uploading: e,
1487
1487
  onRemove: n
@@ -1508,24 +1508,24 @@ function wa({
1508
1508
  )
1509
1509
  ] }, r.id)) }) : null;
1510
1510
  }
1511
- function _a() {
1511
+ function va() {
1512
1512
  const [t, e] = L([]), [n, r] = L(!1), s = S((g) => g.pushToast), a = D(/* @__PURE__ */ new Set());
1513
1513
  R(() => () => {
1514
1514
  for (const g of a.current) URL.revokeObjectURL(g);
1515
1515
  a.current.clear();
1516
1516
  }, []);
1517
1517
  const i = j((g) => {
1518
- gi(g) && (URL.revokeObjectURL(g.previewUrl), a.current.delete(g.previewUrl));
1518
+ pi(g) && (URL.revokeObjectURL(g.previewUrl), a.current.delete(g.previewUrl));
1519
1519
  }, []), f = j(async (g) => {
1520
1520
  if (!g.length) return;
1521
1521
  const h = [];
1522
1522
  for (const p of g) {
1523
- const _ = pi(p);
1523
+ const _ = yi(p);
1524
1524
  if (_) {
1525
1525
  s("error", _);
1526
1526
  continue;
1527
1527
  }
1528
- const { w: I, h: M } = await wi(p), w = URL.createObjectURL(p);
1528
+ const { w: I, h: M } = await vi(p), w = URL.createObjectURL(p);
1529
1529
  a.current.add(w), h.push({
1530
1530
  kind: "file",
1531
1531
  id: `${Date.now()}-${Math.random().toString(36).slice(2, 8)}`,
@@ -1549,7 +1549,7 @@ function _a() {
1549
1549
  return [...p, ...h.slice(0, _)];
1550
1550
  });
1551
1551
  }, [s, i]), o = j((g) => {
1552
- const h = Gt(g.key);
1552
+ const h = qt(g.key);
1553
1553
  h && (e((p) => p.length >= St ? (s("info", `Up to ${St} images per message`), p) : [...p, {
1554
1554
  kind: "remote",
1555
1555
  id: `${Date.now()}-${Math.random().toString(36).slice(2, 8)}`,
@@ -1572,10 +1572,10 @@ function _a() {
1572
1572
  return [];
1573
1573
  });
1574
1574
  }, [i]), u = j((g) => {
1575
- const h = bi(g.clipboardData);
1575
+ const h = wi(g.clipboardData);
1576
1576
  h.length && (g.preventDefault(), f(h));
1577
1577
  }, [f]), m = j((g) => {
1578
- const h = yi(g.dataTransfer);
1578
+ const h = _i(g.dataTransfer);
1579
1579
  h.length && (g.preventDefault(), f(h));
1580
1580
  }, [f]), y = j((g) => {
1581
1581
  g.dataTransfer?.types?.includes("Files") && g.preventDefault();
@@ -1583,9 +1583,9 @@ function _a() {
1583
1583
  if (!t.length) return [];
1584
1584
  r(!0);
1585
1585
  try {
1586
- return await vi(t);
1586
+ return await Si(t);
1587
1587
  } catch (g) {
1588
- return N("chat", "Image upload failed", ki(g)), s("error", mi(g)), null;
1588
+ return N("chat", "Image upload failed", xi(g)), s("error", bi(g)), null;
1589
1589
  } finally {
1590
1590
  r(!1);
1591
1591
  }
@@ -1603,8 +1603,8 @@ function _a() {
1603
1603
  onDragOver: y
1604
1604
  };
1605
1605
  }
1606
- const Do = 2500, Po = 5e3;
1607
- class Bo {
1606
+ const Po = 2500, Bo = 5e3;
1607
+ class Oo {
1608
1608
  constructor(e, n = Date.now) {
1609
1609
  this.send = e, this.now = n;
1610
1610
  }
@@ -1619,21 +1619,21 @@ class Bo {
1619
1619
  return;
1620
1620
  }
1621
1621
  const n = this.now();
1622
- (!this.typing || n - this.lastSent >= Do) && (this.typing = !0, this.lastSent = n, this.send(!0)), this.idle && clearTimeout(this.idle), this.idle = setTimeout(() => this.stop(), Po);
1622
+ (!this.typing || n - this.lastSent >= Po) && (this.typing = !0, this.lastSent = n, this.send(!0)), this.idle && clearTimeout(this.idle), this.idle = setTimeout(() => this.stop(), Bo);
1623
1623
  }
1624
1624
  stop() {
1625
1625
  this.idle && (clearTimeout(this.idle), this.idle = null), this.typing && (this.typing = !1, this.send(!1));
1626
1626
  }
1627
1627
  }
1628
- function va() {
1629
- const [t] = L(() => new Bo(ms));
1628
+ function ka() {
1629
+ const [t] = L(() => new Oo(bs));
1630
1630
  return R(() => () => t.stop(), [t]), t;
1631
1631
  }
1632
- function Oo(t) {
1632
+ function jo(t) {
1633
1633
  return t.length === 0 ? null : t.length === 1 ? `${t[0]} is typing…` : t.length === 2 ? `${t[0]} and ${t[1]} are typing…` : t.length === 3 ? `${t[0]}, ${t[1]} and ${t[2]} are typing…` : "Several people are typing…";
1634
1634
  }
1635
- function jo({ replyTo: t, onCancel: e }) {
1636
- const n = S((a) => a.chat.find((i) => i.id === t)), r = Jt(
1635
+ function Ho({ replyTo: t, onCancel: e }) {
1636
+ const n = S((a) => a.chat.find((i) => i.id === t)), r = Qt(
1637
1637
  { clientId: n?.clientId ?? "", author: n?.author },
1638
1638
  { name: n?.name ?? "a message", sprite: n?.sprite ?? null }
1639
1639
  ), s = Ge(r.sprite, r.pictureUrl);
@@ -1642,10 +1642,10 @@ function jo({ replyTo: t, onCancel: e }) {
1642
1642
  "Replying to ",
1643
1643
  /* @__PURE__ */ c("span", { className: "font-semibold", style: { color: s }, children: r.name })
1644
1644
  ] }),
1645
- /* @__PURE__ */ c("button", { type: "button", className: "chat-reply-cancel", onClick: e, "aria-label": "Cancel reply", title: "Cancel reply", children: /* @__PURE__ */ c(ha, { className: "w-3.5 h-3.5" }) })
1645
+ /* @__PURE__ */ c("button", { type: "button", className: "chat-reply-cancel", onClick: e, "aria-label": "Cancel reply", title: "Cancel reply", children: /* @__PURE__ */ c(ga, { className: "w-3.5 h-3.5" }) })
1646
1646
  ] });
1647
1647
  }
1648
- function ka(t, e) {
1648
+ function Sa(t, e) {
1649
1649
  const n = /* @__PURE__ */ new Map();
1650
1650
  for (const r of Object.values(t)) {
1651
1651
  const s = kn(r), a = n.get(s);
@@ -1661,7 +1661,7 @@ function ka(t, e) {
1661
1661
  function kn(t) {
1662
1662
  return t.author ? `author:${t.author}` : `client:${t.clientId}`;
1663
1663
  }
1664
- function Ho() {
1664
+ function Uo() {
1665
1665
  const t = S((o) => o.typing), e = S((o) => o.roster), n = S((o) => o.me.clientId), r = S((o) => o.setTyping);
1666
1666
  R(() => {
1667
1667
  const o = Object.keys(t);
@@ -1679,7 +1679,7 @@ function Ho() {
1679
1679
  const d = kn(l);
1680
1680
  d !== s && !a.has(d) && a.set(d, l.name || "Someone");
1681
1681
  }
1682
- const i = [...a.values()].sort((o, l) => o.localeCompare(l)), f = Oo(i);
1682
+ const i = [...a.values()].sort((o, l) => o.localeCompare(l)), f = jo(i);
1683
1683
  return /* @__PURE__ */ c("div", { className: "chat-typing", "aria-live": "polite", "data-testid": "chat-typing", children: f && /* @__PURE__ */ x(pe, { children: [
1684
1684
  /* @__PURE__ */ x("span", { className: "chat-typing-dots", "aria-hidden": "true", children: [
1685
1685
  /* @__PURE__ */ c("i", {}),
@@ -1689,20 +1689,20 @@ function Ho() {
1689
1689
  /* @__PURE__ */ c("span", { className: "truncate", children: f })
1690
1690
  ] }) });
1691
1691
  }
1692
- const Zn = Lr, Uo = Rr;
1693
- function zo({ commands: t = Fn }) {
1694
- const [e, n] = L(""), [r, s] = L(!1), [a, i] = L({ q: null, i: 0 }), [f, o] = L(!1), l = D(null), d = Wt(), u = Wt(), [m, y] = L(!1), [b, g] = L(!1), h = ya(e, n, l), p = _a(), _ = va(), I = S((P) => P.replyingTo), M = S((P) => P.setReplyingTo);
1692
+ const Zn = Lr, zo = Rr;
1693
+ function Wo({ commands: t = Fn }) {
1694
+ const [e, n] = L(""), [r, s] = L(!1), [a, i] = L({ q: null, i: 0 }), [f, o] = L(!1), l = D(null), d = Gt(), u = Gt(), [m, y] = L(!1), [b, g] = L(!1), h = wa(e, n, l), p = va(), _ = ka(), I = S((P) => P.replyingTo), M = S((P) => P.setReplyingTo);
1695
1695
  R(() => {
1696
1696
  I && !document.hidden && l.current?.focus({ preventScroll: !0 });
1697
1697
  }, [I]);
1698
- const w = S((P) => P.snapshot.mediaId), k = S((P) => P.pushToast), F = S((P) => P.setTierlistOpen), E = !!w, v = Mo(e), C = ye(
1699
- () => v === null ? [] : To(v, t),
1698
+ const w = S((P) => P.snapshot.mediaId), k = S((P) => P.pushToast), F = S((P) => P.setTierlistOpen), E = !!w, v = To(e), C = ye(
1699
+ () => v === null ? [] : Ao(v, t),
1700
1700
  [v, t]
1701
1701
  ), $ = v !== null && !f && C.length > 0, B = a.q === v ? Tt(a.i, C.length) : 0, O = j(
1702
1702
  (P) => i({ q: v, i: P }),
1703
1703
  [v]
1704
1704
  ), z = j((P, te) => {
1705
- const Ae = Co(P, { hasMedia: E });
1705
+ const Ae = No(P, { hasMedia: E });
1706
1706
  if (Ae) {
1707
1707
  k("info", Ae);
1708
1708
  return;
@@ -1712,19 +1712,19 @@ function zo({ commands: t = Fn }) {
1712
1712
  k("info", t.map((Ke) => Ke.usage).join(" "));
1713
1713
  break;
1714
1714
  case "recap":
1715
- bs();
1715
+ ws();
1716
1716
  break;
1717
1717
  case "tierlist":
1718
- ps(), F(!0);
1718
+ ys(), F(!0);
1719
1719
  break;
1720
1720
  default:
1721
1721
  k("info", `${P.usage} is not implemented yet.`);
1722
1722
  }
1723
1723
  }, [E, k, t, F]), K = j((P) => {
1724
- n(Ao(P)), o(!1), l.current?.focus();
1724
+ n(Io(P)), o(!1), l.current?.focus();
1725
1725
  }, []), le = j(async (P) => {
1726
1726
  if (P.preventDefault(), r || p.uploading) return;
1727
- const te = Io(e, t);
1727
+ const te = Co(e, t);
1728
1728
  if (!te && !p.pending.length) return;
1729
1729
  if (te?.kind === "command" && p.pending.length) {
1730
1730
  k("info", "Send images on their own, not with a command.");
@@ -1735,7 +1735,7 @@ function zo({ commands: t = Fn }) {
1735
1735
  return;
1736
1736
  }
1737
1737
  const Ae = await p.uploadPending();
1738
- Ae !== null && (Nr(ba(te?.text ?? ""), Ae, I), n(""), _.stop(), M(null), p.clear(), s(!0), setTimeout(() => s(!1), Uo), !document.hidden && document.hasFocus() && l.current?.focus());
1738
+ Ae !== null && (Nr(ya(te?.text ?? ""), Ae, I), n(""), _.stop(), M(null), p.clear(), s(!0), setTimeout(() => s(!1), zo), !document.hidden && document.hasFocus() && l.current?.focus());
1739
1739
  }, [e, r, z, p, k, t, I, M, _]), V = j((P) => {
1740
1740
  if (!(!$ && h.onKeyDown(P))) {
1741
1741
  if (P.key === "Escape" && $) {
@@ -1781,11 +1781,11 @@ function zo({ commands: t = Fn }) {
1781
1781
  onDragOver: p.onDragOver,
1782
1782
  className: "p-2 border-t border-border",
1783
1783
  children: [
1784
- I && /* @__PURE__ */ c(jo, { replyTo: I, onCancel: () => M(null) }),
1785
- /* @__PURE__ */ c(wa, { pending: p.pending, uploading: p.uploading, onRemove: p.remove }),
1784
+ I && /* @__PURE__ */ c(Ho, { replyTo: I, onCancel: () => M(null) }),
1785
+ /* @__PURE__ */ c(_a, { pending: p.pending, uploading: p.uploading, onRemove: p.remove }),
1786
1786
  /* @__PURE__ */ x("div", { className: "relative", children: [
1787
1787
  $ && /* @__PURE__ */ c(
1788
- No,
1788
+ Ro,
1789
1789
  {
1790
1790
  commands: C,
1791
1791
  activeIndex: B,
@@ -1796,7 +1796,7 @@ function zo({ commands: t = Fn }) {
1796
1796
  }
1797
1797
  ),
1798
1798
  ee && /* @__PURE__ */ c(
1799
- pa,
1799
+ ba,
1800
1800
  {
1801
1801
  matches: h.matches,
1802
1802
  activeIndex: h.activeIndex,
@@ -1834,7 +1834,7 @@ function zo({ commands: t = Fn }) {
1834
1834
  role: "combobox",
1835
1835
  "aria-expanded": $ || ee,
1836
1836
  "aria-controls": $ ? d : ee ? u : void 0,
1837
- "aria-activedescendant": he ? `${d}-opt-${he.name}` : Q ? ma(u, Q) : void 0,
1837
+ "aria-activedescendant": he ? `${d}-opt-${he.name}` : Q ? pa(u, Q) : void 0,
1838
1838
  "aria-autocomplete": "list",
1839
1839
  className: `w-full bg-bg-card border border-border-light rounded px-3 py-1.5 text-sm focus:outline-none focus:border-text-muted ${W ? "pr-12" : ""}`
1840
1840
  }
@@ -1851,21 +1851,21 @@ function zo({ commands: t = Fn }) {
1851
1851
  title: "Add a meme",
1852
1852
  "data-testid": "meme-button",
1853
1853
  className: `shrink-0 rounded border border-border-light px-2 py-1.5 text-sm hover:border-primary ${m ? "text-text border-primary" : "text-text-secondary"}`,
1854
- children: /* @__PURE__ */ c(Nt, { name: "image" })
1854
+ children: /* @__PURE__ */ c(Rt, { name: "image" })
1855
1855
  }
1856
1856
  )
1857
1857
  ] })
1858
1858
  ] }),
1859
- /* @__PURE__ */ c(Ho, {})
1859
+ /* @__PURE__ */ c(Uo, {})
1860
1860
  ]
1861
1861
  }
1862
1862
  );
1863
1863
  }
1864
- function Wo() {
1865
- const t = S((r) => r.roster), e = S((r) => r.me.clientId), n = ye(() => ka(t, e), [t, e]);
1866
- return n.length ? /* @__PURE__ */ c("div", { className: "flex flex-col gap-1", children: n.map((r) => /* @__PURE__ */ c(Go, { u: r }, r.clientId)) }) : /* @__PURE__ */ c("div", { className: "text-xs text-text-muted", children: "No users online" });
1864
+ function Go() {
1865
+ const t = S((r) => r.roster), e = S((r) => r.me.clientId), n = ye(() => Sa(t, e), [t, e]);
1866
+ return n.length ? /* @__PURE__ */ c("div", { className: "flex flex-col gap-1", children: n.map((r) => /* @__PURE__ */ c(qo, { u: r }, r.clientId)) }) : /* @__PURE__ */ c("div", { className: "text-xs text-text-muted", children: "No users online" });
1867
1867
  }
1868
- function Go({ u: t }) {
1868
+ function qo({ u: t }) {
1869
1869
  const e = Ge(t.sprite, t.avatarUrl);
1870
1870
  return /* @__PURE__ */ x("div", { className: "flex items-center gap-2 py-0.5", children: [
1871
1871
  /* @__PURE__ */ c(
@@ -1882,8 +1882,8 @@ function Go({ u: t }) {
1882
1882
  t.isLeader && /* @__PURE__ */ c("span", { className: "ml-auto px-1.5 py-0.5 rounded text-[9px] font-medium bg-success/20 text-success", children: "Leader" })
1883
1883
  ] });
1884
1884
  }
1885
- function qo() {
1886
- const t = S((a) => ka(a.roster).length), [e, n] = L(!1), r = D(null), s = D(null);
1885
+ function Ko() {
1886
+ const t = S((a) => Sa(a.roster).length), [e, n] = L(!1), r = D(null), s = D(null);
1887
1887
  return R(() => {
1888
1888
  if (!e) return;
1889
1889
  function a(f) {
@@ -1918,15 +1918,15 @@ function qo() {
1918
1918
  t,
1919
1919
  " online"
1920
1920
  ] }),
1921
- /* @__PURE__ */ c(Wo, {})
1921
+ /* @__PURE__ */ c(Go, {})
1922
1922
  ] })
1923
1923
  ] });
1924
1924
  }
1925
- const Ko = /* @__PURE__ */ c("svg", { fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /* @__PURE__ */ c("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M3 12l2-2m0 0l7-7 7 7M5 10v10a1 1 0 001 1h3m10-11l2 2m-2-2v10a1 1 0 01-1 1h-3m-6 0a1 1 0 001-1v-4a1 1 0 011-1h2a1 1 0 011 1v4a1 1 0 001 1m-6 0h6" }) });
1926
- function Vo(t) {
1925
+ const Vo = /* @__PURE__ */ c("svg", { fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /* @__PURE__ */ c("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M3 12l2-2m0 0l7-7 7 7M5 10v10a1 1 0 001 1h3m10-11l2 2m-2-2v10a1 1 0 01-1 1h-3m-6 0a1 1 0 001-1v-4a1 1 0 011-1h2a1 1 0 011 1v4a1 1 0 001 1m-6 0h6" }) });
1926
+ function Jo(t) {
1927
1927
  return t.button === 0 && !t.metaKey && !t.ctrlKey && !t.shiftKey && !t.altKey;
1928
1928
  }
1929
- function on({ label: t, icon: e, href: n, onPress: r, inPage: s = !1 }) {
1929
+ function fn({ label: t, icon: e, href: n, onPress: r, inPage: s = !1 }) {
1930
1930
  return n && s ? /* @__PURE__ */ c(
1931
1931
  "a",
1932
1932
  {
@@ -1935,34 +1935,34 @@ function on({ label: t, icon: e, href: n, onPress: r, inPage: s = !1 }) {
1935
1935
  title: t,
1936
1936
  "aria-label": t,
1937
1937
  onClick: (a) => {
1938
- !r || !Vo(a) || (a.preventDefault(), r());
1938
+ !r || !Jo(a) || (a.preventDefault(), r());
1939
1939
  },
1940
1940
  children: e
1941
1941
  }
1942
1942
  ) : n ? /* @__PURE__ */ c("a", { href: n, target: "_blank", rel: "noopener noreferrer", className: "chat-toolbar__btn", title: t, "aria-label": t, children: e }) : /* @__PURE__ */ c("button", { type: "button", onClick: r, className: "chat-toolbar__btn", title: t, "aria-label": t, children: e });
1943
1943
  }
1944
- function Jo({ home: t, lead: e, theme: n = !0, settings: r = !0, settingsSection: s, extra: a, children: i }) {
1944
+ function Qo({ home: t, lead: e, theme: n = !0, settings: r = !0, settingsSection: s, extra: a, children: i }) {
1945
1945
  const f = Ur() !== null;
1946
1946
  return /* @__PURE__ */ x("div", { className: "chat-toolbar", children: [
1947
- t && /* @__PURE__ */ c(on, { label: "Home", icon: Ko, href: t.href, onPress: t.onPress, inPage: !0 }),
1948
- e?.map((o) => /* @__PURE__ */ c(on, { ...o }, o.id)),
1949
- n && f && /* @__PURE__ */ c(ii, {}),
1950
- r && /* @__PURE__ */ c(oi, { children: s ?? null }),
1951
- a?.map((o) => /* @__PURE__ */ c(on, { ...o }, o.id)),
1952
- /* @__PURE__ */ c(qo, {}),
1947
+ t && /* @__PURE__ */ c(fn, { label: "Home", icon: Vo, href: t.href, onPress: t.onPress, inPage: !0 }),
1948
+ e?.map((o) => /* @__PURE__ */ c(fn, { ...o }, o.id)),
1949
+ n && f && /* @__PURE__ */ c(fi, {}),
1950
+ r && /* @__PURE__ */ c(li, { children: s ?? null }),
1951
+ a?.map((o) => /* @__PURE__ */ c(fn, { ...o }, o.id)),
1952
+ /* @__PURE__ */ c(Ko, {}),
1953
1953
  i
1954
1954
  ] });
1955
1955
  }
1956
- function Qo({ leaderId: t, clientId: e, keyType: n }) {
1956
+ function Yo({ leaderId: t, clientId: e, keyType: n }) {
1957
1957
  return t !== null ? t === e : n === "leader";
1958
1958
  }
1959
- const Yo = /-[0-9a-fA-F]{16}$/;
1960
- function Xo(t) {
1961
- return t && Yo.test(t) ? "leader" : null;
1959
+ const Xo = /-[0-9a-fA-F]{16}$/;
1960
+ function Zo(t) {
1961
+ return t && Xo.test(t) ? "leader" : null;
1962
1962
  }
1963
- const Zo = /\/room\/([^/]+)\/?$/;
1964
- function ef(t) {
1965
- const e = t ? Zo.exec(t) : null;
1963
+ const ef = /\/room\/([^/]+)\/?$/;
1964
+ function tf(t) {
1965
+ const e = t ? ef.exec(t) : null;
1966
1966
  if (!e) return null;
1967
1967
  try {
1968
1968
  return decodeURIComponent(e[1]);
@@ -1970,39 +1970,39 @@ function ef(t) {
1970
1970
  return e[1];
1971
1971
  }
1972
1972
  }
1973
- function tf(t, e) {
1974
- return t && e?.roomKey === t ? e.type : Xo(t);
1973
+ function nf(t, e) {
1974
+ return t && e?.roomKey === t ? e.type : Zo(t);
1975
1975
  }
1976
1976
  function st() {
1977
1977
  return S((t) => !!t.snapshot.leaderId && t.snapshot.leaderId === t.me.clientId);
1978
1978
  }
1979
- function Qt() {
1980
- const t = S((n) => n.activeGameId), e = ys();
1979
+ function Yt() {
1980
+ const t = S((n) => n.activeGameId), e = _s();
1981
1981
  return t ? e.find((n) => n.id === t) ?? null : null;
1982
1982
  }
1983
1983
  function $n() {
1984
- return S((t) => Qo({
1984
+ return S((t) => Yo({
1985
1985
  leaderId: t.snapshot.leaderId,
1986
1986
  clientId: t.me.clientId,
1987
- keyType: tf(ef(globalThis.location?.pathname), t.roomKeyType)
1987
+ keyType: nf(tf(globalThis.location?.pathname), t.roomKeyType)
1988
1988
  }));
1989
1989
  }
1990
- function Sa() {
1990
+ function xa() {
1991
1991
  return S((t) => t.readiness);
1992
1992
  }
1993
- function nf() {
1993
+ function rf() {
1994
1994
  return S((t) => t.snapshot);
1995
1995
  }
1996
- const rf = 3e4;
1997
- function xa() {
1998
- const t = Sa(), [e, n] = L(!1), [r, s] = L({ mediaId: t.mediaId, ready: t.ready });
1996
+ const af = 3e4;
1997
+ function Ea() {
1998
+ const t = xa(), [e, n] = L(!1), [r, s] = L({ mediaId: t.mediaId, ready: t.ready });
1999
1999
  return (r.mediaId !== t.mediaId || r.ready !== t.ready) && (s({ mediaId: t.mediaId, ready: t.ready }), n(!1)), R(() => {
2000
2000
  if (t.ready) return;
2001
- const a = setTimeout(() => n(!0), rf);
2001
+ const a = setTimeout(() => n(!0), af);
2002
2002
  return () => clearTimeout(a);
2003
2003
  }, [t.mediaId, t.ready]), e;
2004
2004
  }
2005
- function af({ draw: t }) {
2005
+ function sf({ draw: t }) {
2006
2006
  const e = D(null);
2007
2007
  return R(() => {
2008
2008
  const n = e.current;
@@ -2010,29 +2010,29 @@ function af({ draw: t }) {
2010
2010
  return t(n) ?? void 0;
2011
2011
  }, [t]), /* @__PURE__ */ c("div", { ref: e, "data-testid": "game-settings" });
2012
2012
  }
2013
- const sf = Cn(() => import("./AdminPanel-CXmS3s1v.js")), of = Cn(() => import("./PlaylistPanel-BCv74H3X.js")), ff = [{
2013
+ const of = Cn(() => import("./AdminPanel-iOXMIJ5W.js")), ff = Cn(() => import("./PlaylistPanel-BBbY3rI1.js")), lf = [{
2014
2014
  id: "select-media",
2015
2015
  label: "Select Media",
2016
2016
  icon: /* @__PURE__ */ c("svg", { fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /* @__PURE__ */ c("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M7 4v16M17 4v16M3 8h4m10 0h4M3 12h18M3 16h4m10 0h4M4 4h16a1 1 0 011 1v14a1 1 0 01-1 1H4a1 1 0 01-1-1V5a1 1 0 011-1z" }) }),
2017
2017
  onPress: () => Yr("chat toolbar")
2018
2018
  }];
2019
- function lf() {
2020
- const t = ws(), e = _s("/"), n = S((g) => g.chatCollapsed), r = Ft(), s = S((g) => g.sidebarTab), a = S((g) => g.setSidebarTab), i = S((g) => g.healthSnapshot?.clients.length ?? 0), f = S((g) => !!g.playlist), o = st(), l = $n(), d = S((g) => g.gameSettings), u = S((g) => g.snapshot.mediaId), m = Qt() !== null;
2021
- if (Vt({ hasMedia: !!u, chatCollapsed: n, isFullscreen: r }))
2019
+ function cf() {
2020
+ const t = vs(), e = ks("/"), n = S((g) => g.chatCollapsed), r = $t(), s = S((g) => g.sidebarTab), a = S((g) => g.setSidebarTab), i = S((g) => g.healthSnapshot?.clients.length ?? 0), f = S((g) => !!g.playlist), o = st(), l = $n(), d = S((g) => g.gameSettings), u = S((g) => g.snapshot.mediaId), m = Yt() !== null;
2021
+ if (Jt({ hasMedia: !!u, chatCollapsed: n, isFullscreen: r }))
2022
2022
  return null;
2023
2023
  const y = Rn({ isLeader: l, hasMedia: !!u, chatCollapsed: n, isFullscreen: r, gameOverlay: m }) === "chat-toolbar", b = s === "health" && !o || s === "playlist" && !f ? "chat" : s;
2024
2024
  return /* @__PURE__ */ x("aside", { className: "wp-chat-panel w-80 self-stretch border-l border-border flex flex-col bg-bg relative z-[35]", children: [
2025
2025
  /* @__PURE__ */ c(
2026
- Jo,
2026
+ Qo,
2027
2027
  {
2028
2028
  home: {
2029
2029
  href: e,
2030
2030
  onPress: () => {
2031
- T("navigation", "Home button clicked (chat toolbar)"), vs(), t("/");
2031
+ T("navigation", "Home button clicked (chat toolbar)"), Ss(), t("/");
2032
2032
  }
2033
2033
  },
2034
- lead: y ? ff : void 0,
2035
- settingsSection: d ? /* @__PURE__ */ c(af, { draw: d }) : void 0
2034
+ lead: y ? lf : void 0,
2035
+ settingsSection: d ? /* @__PURE__ */ c(sf, { draw: d }) : void 0
2036
2036
  }
2037
2037
  ),
2038
2038
  (o || f) && /* @__PURE__ */ x("div", { role: "tablist", "aria-label": "Sidebar", className: "flex border-b border-border shrink-0", children: [
@@ -2070,28 +2070,28 @@ function lf() {
2070
2070
  }
2071
2071
  )
2072
2072
  ] }),
2073
- b === "health" ? /* @__PURE__ */ c(at.Suspense, { fallback: /* @__PURE__ */ c("div", { className: "p-4 text-xs text-text-muted", children: "Loading..." }), children: /* @__PURE__ */ c(sf, {}) }) : b === "playlist" ? /* @__PURE__ */ c(at.Suspense, { fallback: /* @__PURE__ */ c("div", { className: "p-4 text-xs text-text-muted", children: "Loading..." }), children: /* @__PURE__ */ c(of, {}) }) : /* @__PURE__ */ x(pe, { children: [
2074
- /* @__PURE__ */ c(Eo, {}),
2075
- /* @__PURE__ */ c(zo, {})
2073
+ b === "health" ? /* @__PURE__ */ c(at.Suspense, { fallback: /* @__PURE__ */ c("div", { className: "p-4 text-xs text-text-muted", children: "Loading..." }), children: /* @__PURE__ */ c(of, {}) }) : b === "playlist" ? /* @__PURE__ */ c(at.Suspense, { fallback: /* @__PURE__ */ c("div", { className: "p-4 text-xs text-text-muted", children: "Loading..." }), children: /* @__PURE__ */ c(ff, {}) }) : /* @__PURE__ */ x(pe, { children: [
2074
+ /* @__PURE__ */ c(Mo, {}),
2075
+ /* @__PURE__ */ c(Wo, {})
2076
2076
  ] })
2077
2077
  ] });
2078
2078
  }
2079
- const er = (t) => typeof t == "string" && si.includes(t);
2080
- function cf(t, e, n) {
2079
+ const er = (t) => typeof t == "string" && oi.includes(t);
2080
+ function df(t, e, n) {
2081
2081
  return er(e) ? e : er(n) ? n : "dark";
2082
2082
  }
2083
2083
  const tr = /* @__PURE__ */ new WeakMap();
2084
- function df(t) {
2084
+ function uf(t) {
2085
2085
  let e = tr.get(t);
2086
2086
  return e === void 0 && (e = (n) => t.mountSettings(n), tr.set(t, e)), e;
2087
2087
  }
2088
2088
  function nr({ activity: t, roomKey: e, layer: n }) {
2089
- const [r, s] = L(null), [a, i] = L(!1), f = S((h) => h.snapshot.leaderId), o = S((h) => h.me.clientId), l = !!f && f === o, d = S((h) => h.name), u = Ur()?.theme, m = cf(void 0, u, ks().theme), y = ye(() => ({
2089
+ const [r, s] = L(null), [a, i] = L(!1), f = S((h) => h.snapshot.leaderId), o = S((h) => h.me.clientId), l = !!f && f === o, d = S((h) => h.name), u = Ur()?.theme, m = df(void 0, u, xs().theme), y = ye(() => ({
2090
2090
  roomKey: e,
2091
2091
  identity: {
2092
2092
  // The registry userId — what RoomChrome's `userId` prop is.
2093
- userId: xs(),
2094
- userType: Ss(),
2093
+ userId: Ms(),
2094
+ userType: Es(),
2095
2095
  name: d || null
2096
2096
  },
2097
2097
  theme: m,
@@ -2099,7 +2099,7 @@ function nr({ activity: t, roomKey: e, layer: n }) {
2099
2099
  close: () => {
2100
2100
  T("game", "bundle close", { gameId: t.id, isLeader: l, layer: n }), n !== "base" && (l ? Fr(null) : i(!0));
2101
2101
  }
2102
- }), [e, d, m, l, t.id, n]), b = Pi({
2102
+ }), [e, d, m, l, t.id, n]), b = Oi({
2103
2103
  load: a ? null : t.load,
2104
2104
  ctx: y,
2105
2105
  mountKey: `${n}:${t.id}`,
@@ -2109,7 +2109,7 @@ function nr({ activity: t, roomKey: e, layer: n }) {
2109
2109
  // Only the overlay's game gets the popout's section. The base layer is
2110
2110
  // the media player, which has no settings of its own.
2111
2111
  onSettingsAvailable: n === "overlay" ? (h, p) => {
2112
- const { gameSettings: _, setGameSettings: I } = S.getState(), M = df(p);
2112
+ const { gameSettings: _, setGameSettings: I } = S.getState(), M = uf(p);
2113
2113
  h ? I(M) : _ === M && I(null);
2114
2114
  } : void 0,
2115
2115
  onSettingsError: (h, p) => {
@@ -2138,8 +2138,8 @@ function nr({ activity: t, roomKey: e, layer: n }) {
2138
2138
  }
2139
2139
  );
2140
2140
  }
2141
- const Lc = "drawer-btn", uf = "drawer-icon-btn";
2142
- function hf({ open: t, onClose: e, back: n = !1, header: r, footer: s, children: a }) {
2141
+ const Pc = "drawer-btn", hf = "drawer-icon-btn";
2142
+ function gf({ open: t, onClose: e, back: n = !1, header: r, footer: s, children: a }) {
2143
2143
  const i = D(null);
2144
2144
  return R(() => {
2145
2145
  if (!t) return;
@@ -2162,7 +2162,7 @@ function hf({ open: t, onClose: e, back: n = !1, header: r, footer: s, children:
2162
2162
  onClick: (f) => f.stopPropagation(),
2163
2163
  children: [
2164
2164
  /* @__PURE__ */ x("div", { className: "px-3 py-2 border-b border-border flex items-center gap-2 text-sm min-w-0", children: [
2165
- /* @__PURE__ */ c("button", { ref: i, onClick: e, className: uf, "aria-label": n ? "Back" : "Close", title: n ? "Back" : "Close", children: n ? /* @__PURE__ */ c(da, { className: "w-4 h-4" }) : /* @__PURE__ */ c(ua, { className: "w-4 h-4" }) }),
2165
+ /* @__PURE__ */ c("button", { ref: i, onClick: e, className: hf, "aria-label": n ? "Back" : "Close", title: n ? "Back" : "Close", children: n ? /* @__PURE__ */ c(ua, { className: "w-4 h-4" }) : /* @__PURE__ */ c(ha, { className: "w-4 h-4" }) }),
2166
2166
  r
2167
2167
  ] }),
2168
2168
  a,
@@ -2171,10 +2171,10 @@ function hf({ open: t, onClose: e, back: n = !1, header: r, footer: s, children:
2171
2171
  }
2172
2172
  ) }) : null;
2173
2173
  }
2174
- function gf({ open: t, onClose: e }) {
2175
- return /* @__PURE__ */ c(hf, { open: t, onClose: e, children: /* @__PURE__ */ c("div", { className: "px-4 py-3 text-xs text-text-muted", children: "Loading…" }) });
2174
+ function mf({ open: t, onClose: e }) {
2175
+ return /* @__PURE__ */ c(gf, { open: t, onClose: e, children: /* @__PURE__ */ c("div", { className: "px-4 py-3 text-xs text-text-muted", children: "Loading…" }) });
2176
2176
  }
2177
- const Ea = 9e3, rr = 1500, mf = {
2177
+ const Ma = 9e3, rr = 1500, pf = {
2178
2178
  classic: "[text-shadow:_-1px_-1px_0_#000,_1px_-1px_0_#000,_-1px_1px_0_#000,_1px_1px_0_#000,_0_-1px_0_#000,_0_1px_0_#000,_-1px_0_0_#000,_1px_0_0_#000]",
2179
2179
  cinema: "drop-shadow-[0_2px_4px_rgba(0,0,0,0.9)]",
2180
2180
  minimal: "drop-shadow-[0_2px_4px_rgba(0,0,0,0.9)] drop-shadow-[0_0_8px_rgba(0,0,0,0.7)]",
@@ -2183,11 +2183,11 @@ const Ea = 9e3, rr = 1500, mf = {
2183
2183
  textShadow: "none",
2184
2184
  filter: "drop-shadow(0 0 1px black) drop-shadow(0 0 1px black)"
2185
2185
  };
2186
- function pf({ message: t, age: e, ccStyle: n }) {
2187
- const r = Ea - rr;
2186
+ function bf({ message: t, age: e, ccStyle: n }) {
2187
+ const r = Ma - rr;
2188
2188
  let s = 1;
2189
2189
  e > r && (s = Math.max(0, 1 - (e - r) / rr));
2190
- const a = mf[n], i = Jt(
2190
+ const a = pf[n], i = Qt(
2191
2191
  { clientId: t.clientId, author: t.author },
2192
2192
  { name: t.name, sprite: t.sprite }
2193
2193
  ), f = Ge(i.sprite, i.pictureUrl), o = i.cosmetics, [l] = L(
@@ -2201,15 +2201,15 @@ function pf({ message: t, age: e, ccStyle: n }) {
2201
2201
  children: [
2202
2202
  /* @__PURE__ */ c(ra, { sprite: i.sprite, url: i.pictureUrl, worn: o }),
2203
2203
  /* @__PURE__ */ x("div", { className: "min-w-0 flex-1", children: [
2204
- o ? /* @__PURE__ */ c(Rt, { html: Cr(i.name, o), className: "text-sm mr-2", style: { color: f, ...sr } }) : /* @__PURE__ */ c("span", { className: "font-medium text-sm mr-2", style: { color: f, ...ar }, children: i.name }),
2205
- l ? /* @__PURE__ */ c(Rt, { html: l, className: "text-sm text-white break-words", style: sr }) : /* @__PURE__ */ c("span", { className: "text-sm text-white break-words", style: ar, children: t.text }),
2204
+ o ? /* @__PURE__ */ c(Lt, { html: Cr(i.name, o), className: "text-sm mr-2", style: { color: f, ...sr } }) : /* @__PURE__ */ c("span", { className: "font-medium text-sm mr-2", style: { color: f, ...ar }, children: i.name }),
2205
+ l ? /* @__PURE__ */ c(Lt, { html: l, className: "text-sm text-white break-words", style: sr }) : /* @__PURE__ */ c("span", { className: "text-sm text-white break-words", style: ar, children: t.text }),
2206
2206
  /* @__PURE__ */ c(sa, { images: t.images })
2207
2207
  ] })
2208
2208
  ]
2209
2209
  }
2210
2210
  );
2211
2211
  }
2212
- function bf({ shown: t, className: e }) {
2212
+ function yf({ shown: t, className: e }) {
2213
2213
  ta();
2214
2214
  const n = S((o) => o.chat), r = S((o) => o.mediaPrefs.subtitleStyle), [s, a] = L(() => Date.now()), i = n.length > 0;
2215
2215
  R(() => {
@@ -2219,7 +2219,7 @@ function bf({ shown: t, className: e }) {
2219
2219
  return () => clearInterval(o);
2220
2220
  }, [i]);
2221
2221
  const f = ye(() => {
2222
- const o = s - Ea;
2222
+ const o = s - Ma;
2223
2223
  return n.filter((l) => !l.isSystem && l.ts > o).slice(-12);
2224
2224
  }, [n, s]);
2225
2225
  return !t || f.length === 0 ? null : /* @__PURE__ */ c(
@@ -2228,7 +2228,7 @@ function bf({ shown: t, className: e }) {
2228
2228
  className: `wp-floating-chat pointer-events-none flex flex-col ${e}`,
2229
2229
  "data-testid": "floating-chat",
2230
2230
  children: f.map((o) => /* @__PURE__ */ c(
2231
- pf,
2231
+ bf,
2232
2232
  {
2233
2233
  message: o,
2234
2234
  age: s - o.ts,
@@ -2239,75 +2239,79 @@ function bf({ shown: t, className: e }) {
2239
2239
  }
2240
2240
  );
2241
2241
  }
2242
- const yf = 2;
2243
- function Ma(t) {
2242
+ const wf = 2;
2243
+ function Ta(t) {
2244
2244
  return t.duration_ms > 0 && t.duration_ms - t.playhead_ms <= Nn;
2245
2245
  }
2246
- function Ta(t) {
2246
+ function Aa(t) {
2247
2247
  const e = t.video_ready_state ?? -1;
2248
- return e < 0 ? !0 : !(e <= yf && t.buffered_ahead_ms > Nn);
2248
+ return e < 0 ? !0 : !(e <= wf && t.buffered_ahead_ms > Nn);
2249
2249
  }
2250
- function Fc(t) {
2251
- return t.playhead_ms === 0 && !t.is_buffering && t.buffered_ahead_ms === 0 ? "idle" : t.is_buffering ? "buffering" : Ma(t) ? "healthy" : !Ta(t) || t.buffered_ahead_ms <= $r ? "critical" : t.buffered_ahead_ms <= Nn ? "warning" : "healthy";
2250
+ function Bc(t) {
2251
+ return t.playhead_ms === 0 && !t.is_buffering && t.buffered_ahead_ms === 0 ? "idle" : t.is_buffering ? "buffering" : Ta(t) ? "healthy" : !Aa(t) || t.buffered_ahead_ms <= $r ? "critical" : t.buffered_ahead_ms <= Nn ? "warning" : "healthy";
2252
2252
  }
2253
- const $c = {
2253
+ const Oc = {
2254
2254
  idle: "Idle",
2255
2255
  buffering: "Buffering",
2256
2256
  critical: "Critical",
2257
2257
  warning: "Low Buffer",
2258
2258
  healthy: "Healthy"
2259
2259
  };
2260
- let jt = null;
2261
- function Aa() {
2262
- if (jt) return jt;
2260
+ let Ht = null;
2261
+ function Ia() {
2262
+ if (Ht) return Ht;
2263
2263
  try {
2264
2264
  const t = window.AudioContext ?? window.webkitAudioContext;
2265
- t && (jt = new t());
2265
+ t && (Ht = new t());
2266
2266
  } catch {
2267
2267
  }
2268
- return jt;
2268
+ return Ht;
2269
2269
  }
2270
- function Ia(t) {
2270
+ function Ca(t) {
2271
2271
  t.state === "suspended" && t.resume().catch(() => {
2272
2272
  });
2273
2273
  }
2274
- function Ca(t, e, n, r) {
2274
+ function Na(t, e, n, r) {
2275
2275
  t.gain.setValueAtTime(0, e), t.gain.linearRampToValueAtTime(n, e + 5e-3), t.gain.exponentialRampToValueAtTime(1e-4, e + r);
2276
2276
  }
2277
2277
  function rt(t, e, n = 0.15, r = 0) {
2278
- const s = Aa();
2278
+ const s = Ia();
2279
2279
  if (!s) return;
2280
- Ia(s);
2280
+ Ca(s);
2281
2281
  const a = s.currentTime + r, i = s.createOscillator(), f = s.createGain();
2282
- i.type = "sine", i.frequency.value = t, Ca(f, a, n, e / 1e3), i.connect(f).connect(s.destination), i.start(a), i.stop(a + e / 1e3 + 0.05);
2282
+ i.type = "sine", i.frequency.value = t, Na(f, a, n, e / 1e3), i.connect(f).connect(s.destination), i.start(a), i.stop(a + e / 1e3 + 0.05);
2283
2283
  }
2284
- function fn(t, e, n, r, s = 0.15, a = 0) {
2285
- const i = Aa();
2284
+ function At(t, e, n, r, s = 0.15, a = 0) {
2285
+ const i = Ia();
2286
2286
  if (!i) return;
2287
- Ia(i);
2287
+ Ca(i);
2288
2288
  const f = i.currentTime + a, o = i.createOscillator(), l = i.createOscillator(), d = i.createGain(), u = i.createGain();
2289
- o.type = "sine", o.frequency.value = t, l.type = "sine", l.frequency.value = e, d.gain.value = n * e, l.connect(d).connect(o.frequency), Ca(u, f, s, r / 1e3), o.connect(u).connect(i.destination), o.start(f), o.stop(f + r / 1e3 + 0.05), l.start(f), l.stop(f + r / 1e3 + 0.05);
2289
+ o.type = "sine", o.frequency.value = t, l.type = "sine", l.frequency.value = e, d.gain.value = n * e, l.connect(d).connect(o.frequency), Na(u, f, s, r / 1e3), o.connect(u).connect(i.destination), o.start(f), o.stop(f + r / 1e3 + 0.05), l.start(f), l.stop(f + r / 1e3 + 0.05);
2290
2290
  }
2291
- function Na() {
2291
+ function Ra() {
2292
2292
  rt(700, 60, 0.14, 0), rt(700, 60, 0.14, 0.1), rt(932, 120, 0.17, 0.2);
2293
2293
  }
2294
- function Ra() {
2294
+ function La() {
2295
2295
  rt(784, 45, 0.07, 0), rt(1047, 60, 0.07, 0.045);
2296
2296
  }
2297
- function La() {
2297
+ function Fa() {
2298
2298
  rt(659, 45, 0.06, 0), rt(494, 70, 0.06, 0.045);
2299
2299
  }
2300
- function Fa() {
2301
- fn(587, 1174, 3, 320, 0.12, 0), fn(880, 1760, 3, 320, 0.12, 0.06), fn(884, 1768, 3, 320, 0.08, 0.06);
2300
+ function $a() {
2301
+ At(587, 1174, 3, 320, 0.12, 0), At(880, 1760, 3, 320, 0.12, 0.06), At(884, 1768, 3, 320, 0.08, 0.06);
2302
+ }
2303
+ function Da() {
2304
+ At(1319, 1319, 1, 380, 0.06, 0), At(1047, 1047, 1, 520, 0.05, 0.11);
2302
2305
  }
2303
2306
  Dr("__WP_SOUNDS__", {
2304
- start: Na,
2305
- finish: Fa,
2306
- on: Ra,
2307
- off: La
2307
+ start: Ra,
2308
+ finish: $a,
2309
+ on: La,
2310
+ off: Fa,
2311
+ chat: Da
2308
2312
  });
2309
2313
  const ir = { on: 0, off: 0 };
2310
- function wf(t, e, n, r) {
2314
+ function _f(t, e, n, r) {
2311
2315
  if (!n || !r) return ir;
2312
2316
  const s = new Set(t), a = new Set(e);
2313
2317
  let i = 0;
@@ -2316,15 +2320,15 @@ function wf(t, e, n, r) {
2316
2320
  for (const o of s) a.has(o) || f++;
2317
2321
  return i === 0 && f === 0 ? ir : { on: i, off: f };
2318
2322
  }
2319
- const _f = 1200, xe = 52, Kt = 4, Sn = (xe - Kt) / 2, or = 2 * Math.PI * Sn, ze = xe - Kt * 2 - 4;
2320
- function vf(t) {
2321
- return Ma(t) ? !0 : Ta(t) ? t.buffered_ahead_ms >= Be : !1;
2322
- }
2323
+ const vf = 1200, xe = 52, Vt = 4, Sn = (xe - Vt) / 2, or = 2 * Math.PI * Sn, ze = xe - Vt * 2 - 4;
2323
2324
  function kf(t) {
2325
+ return Ta(t) ? !0 : Aa(t) ? t.buffered_ahead_ms >= Be : !1;
2326
+ }
2327
+ function Sf(t) {
2324
2328
  return `hsl(${Math.round(t * 120)}, 90%, 55%)`;
2325
2329
  }
2326
- function Sf({ client: t, look: e, fading: n, onFadeEnd: r }) {
2327
- const s = Math.min(1, t.buffered_ahead_ms / Be), a = or * (1 - s), i = kf(s), f = Ge(e.sprite, e.pictureUrl);
2330
+ function xf({ client: t, look: e, fading: n, onFadeEnd: r }) {
2331
+ const s = Math.min(1, t.buffered_ahead_ms / Be), a = or * (1 - s), i = Sf(s), f = Ge(e.sprite, e.pictureUrl);
2328
2332
  return /* @__PURE__ */ x(
2329
2333
  "div",
2330
2334
  {
@@ -2332,7 +2336,7 @@ function Sf({ client: t, look: e, fading: n, onFadeEnd: r }) {
2332
2336
  "data-client-id": t.client_id,
2333
2337
  className: "flex flex-col items-center gap-1",
2334
2338
  style: n ? {
2335
- animation: `bufferFadeOut ${_f}ms ease forwards`
2339
+ animation: `bufferFadeOut ${vf}ms ease forwards`
2336
2340
  } : void 0,
2337
2341
  onAnimationEnd: n ? r : void 0,
2338
2342
  children: [
@@ -2353,7 +2357,7 @@ function Sf({ client: t, look: e, fading: n, onFadeEnd: r }) {
2353
2357
  r: Sn,
2354
2358
  fill: "none",
2355
2359
  stroke: "rgba(255,255,255,0.15)",
2356
- strokeWidth: Kt
2360
+ strokeWidth: Vt
2357
2361
  }
2358
2362
  ),
2359
2363
  /* @__PURE__ */ c(
@@ -2364,7 +2368,7 @@ function Sf({ client: t, look: e, fading: n, onFadeEnd: r }) {
2364
2368
  r: Sn,
2365
2369
  fill: "none",
2366
2370
  stroke: i,
2367
- strokeWidth: Kt,
2371
+ strokeWidth: Vt,
2368
2372
  strokeLinecap: "round",
2369
2373
  strokeDasharray: or,
2370
2374
  strokeDashoffset: a,
@@ -2411,8 +2415,8 @@ function Sf({ client: t, look: e, fading: n, onFadeEnd: r }) {
2411
2415
  }
2412
2416
  );
2413
2417
  }
2414
- function xf({ clientId: t, sprite: e, pictureUrl: n, name: r, isReady: s, isSelf: a, onToggle: i }) {
2415
- const f = Ge(e, n), o = s ? "success" : "neutral", l = s ? /* @__PURE__ */ c(Nt, { name: "tick" }) : /* @__PURE__ */ c(Nt, { name: "hourglass" });
2418
+ function Ef({ clientId: t, sprite: e, pictureUrl: n, name: r, isReady: s, isSelf: a, onToggle: i }) {
2419
+ const f = Ge(e, n), o = s ? "success" : "neutral", l = s ? /* @__PURE__ */ c(Rt, { name: "tick" }) : /* @__PURE__ */ c(Rt, { name: "hourglass" });
2416
2420
  return /* @__PURE__ */ x(
2417
2421
  "button",
2418
2422
  {
@@ -2483,18 +2487,18 @@ function xf({ clientId: t, sprite: e, pictureUrl: n, name: r, isReady: s, isSelf
2483
2487
  }
2484
2488
  );
2485
2489
  }
2486
- const Ef = { status: null, entries: [], completed: /* @__PURE__ */ new Set(), below: /* @__PURE__ */ new Set() };
2490
+ const Mf = { status: null, entries: [], completed: /* @__PURE__ */ new Set(), below: /* @__PURE__ */ new Set() };
2487
2491
  function fr(t, e) {
2488
2492
  if (!e || e.clients.length === 0) return { ...t, status: e, entries: [] };
2489
2493
  const n = new Set(t.completed), r = new Set(t.below), s = [];
2490
2494
  for (const a of e.clients) {
2491
2495
  const i = a.client_id;
2492
- vf(a) ? r.has(i) && !n.has(i) ? (n.add(i), s.push({ client: a, completed: !0 })) : n.has(i) && s.push({ client: a, completed: !0 }) : (n.delete(i), r.add(i), s.push({ client: a, completed: !1 }));
2496
+ kf(a) ? r.has(i) && !n.has(i) ? (n.add(i), s.push({ client: a, completed: !0 })) : n.has(i) && s.push({ client: a, completed: !0 }) : (n.delete(i), r.add(i), s.push({ client: a, completed: !1 }));
2493
2497
  }
2494
2498
  return { status: e, entries: s, completed: n, below: r };
2495
2499
  }
2496
- function Mf() {
2497
- const t = S((w) => w.bufferStatus), e = S((w) => w.readyCheck), n = S((w) => w.roster), r = S((w) => w.me.clientId), s = S((w) => w.snapshot.playing), a = st(), [i, f] = L(() => fr(Ef, t));
2500
+ function Tf() {
2501
+ const t = S((w) => w.bufferStatus), e = S((w) => w.readyCheck), n = S((w) => w.roster), r = S((w) => w.me.clientId), s = S((w) => w.snapshot.playing), a = st(), [i, f] = L(() => fr(Mf, t));
2498
2502
  i.status !== t && f(fr(i, t));
2499
2503
  const o = i.entries, l = (w) => {
2500
2504
  f((k) => {
@@ -2503,19 +2507,19 @@ function Mf() {
2503
2507
  });
2504
2508
  }, d = new Set(e.ready), u = Object.values(n), m = !!r && d.has(r), y = e.active && u.length > 0 && e.ready.length >= u.length, b = D(e.active), g = D(y);
2505
2509
  R(() => {
2506
- !b.current && e.active && Na(), b.current = e.active;
2510
+ !b.current && e.active && Ra(), b.current = e.active;
2507
2511
  }, [e.active]), R(() => {
2508
- !g.current && y && Fa(), g.current = y;
2512
+ !g.current && y && $a(), g.current = y;
2509
2513
  }, [y]);
2510
2514
  const h = D(e.ready), p = D(e.active);
2511
2515
  R(() => {
2512
- const { on: w, off: k } = wf(
2516
+ const { on: w, off: k } = _f(
2513
2517
  h.current,
2514
2518
  e.ready,
2515
2519
  p.current,
2516
2520
  e.active
2517
2521
  );
2518
- w > 0 && Ra(), k > 0 && La(), h.current = e.ready, p.current = e.active;
2522
+ w > 0 && La(), k > 0 && Fa(), h.current = e.ready, p.current = e.active;
2519
2523
  }, [e.ready, e.active]);
2520
2524
  const _ = e.active, I = !_ && o.length > 0, M = !_ && !I && a && u.length > 0 && !s;
2521
2525
  return !_ && !I && !M ? null : /* @__PURE__ */ x(pe, { children: [
@@ -2548,7 +2552,7 @@ function Mf() {
2548
2552
  }
2549
2553
  ),
2550
2554
  /* @__PURE__ */ c("div", { className: "flex flex-col gap-3", children: u.map((w) => /* @__PURE__ */ c(
2551
- xf,
2555
+ Ef,
2552
2556
  {
2553
2557
  clientId: w.clientId,
2554
2558
  sprite: w.sprite,
@@ -2556,13 +2560,13 @@ function Mf() {
2556
2560
  name: w.name || "Anon",
2557
2561
  isReady: d.has(w.clientId),
2558
2562
  isSelf: w.clientId === r,
2559
- onToggle: () => Es(!m)
2563
+ onToggle: () => Ts(!m)
2560
2564
  },
2561
2565
  w.clientId
2562
2566
  )) })
2563
2567
  ] }),
2564
2568
  I && o.map(({ client: w, completed: k }) => /* @__PURE__ */ c(
2565
- Sf,
2569
+ xf,
2566
2570
  {
2567
2571
  client: w,
2568
2572
  look: ea(n, { clientId: w.client_id }, { name: w.name, sprite: w.sprite_id ?? null }),
@@ -2576,7 +2580,7 @@ function Mf() {
2576
2580
  {
2577
2581
  type: "button",
2578
2582
  "data-testid": "start-ready-check",
2579
- onClick: () => Ms(),
2583
+ onClick: () => As(),
2580
2584
  className: "px-2.5 py-1 rounded bg-black/55 text-xs font-semibold tracking-wide hover:bg-black/75 transition-colors",
2581
2585
  style: { color: "#fff", pointerEvents: "auto" },
2582
2586
  title: "Ask everyone if they're ready",
@@ -2589,17 +2593,17 @@ function Mf() {
2589
2593
  ] });
2590
2594
  }
2591
2595
  const xn = /* @__PURE__ */ new Map();
2592
- function Tf(t, e) {
2596
+ function Af(t, e) {
2593
2597
  return xn.has(t) ? xn.get(t) : e;
2594
2598
  }
2595
- function Af(t, e) {
2599
+ function If(t, e) {
2596
2600
  xn.set(t, e);
2597
2601
  }
2598
- function If(t, e) {
2599
- const [n, r] = L(() => Tf(t, e)), s = j((a) => {
2602
+ function Cf(t, e) {
2603
+ const [n, r] = L(() => Af(t, e)), s = j((a) => {
2600
2604
  r((i) => {
2601
2605
  const f = typeof a == "function" ? a(i) : a;
2602
- return Af(t, f), f;
2606
+ return If(t, f), f;
2603
2607
  });
2604
2608
  }, [t]);
2605
2609
  return [n, s];
@@ -2612,7 +2616,7 @@ const En = {
2612
2616
  D: "var(--color-tier-d)",
2613
2617
  F: "var(--color-tier-f)"
2614
2618
  }, nt = "unranked";
2615
- function $a(t) {
2619
+ function Pa(t) {
2616
2620
  t?.complete && t.naturalWidth > 0 && (t.dataset.loaded = "true");
2617
2621
  }
2618
2622
  function lr({
@@ -2647,7 +2651,7 @@ function lr({
2647
2651
  loading: "eager",
2648
2652
  decoding: "async",
2649
2653
  draggable: !1,
2650
- ref: $a,
2654
+ ref: Pa,
2651
2655
  onLoad: (a) => {
2652
2656
  a.currentTarget.dataset.loaded = "true";
2653
2657
  },
@@ -2662,7 +2666,7 @@ function lr({
2662
2666
  }
2663
2667
  );
2664
2668
  }
2665
- function Cf({ sprite: t, url: e }) {
2669
+ function Nf({ sprite: t, url: e }) {
2666
2670
  const n = Ge(t, e);
2667
2671
  return /* @__PURE__ */ c(
2668
2672
  yt,
@@ -2675,7 +2679,7 @@ function Cf({ sprite: t, url: e }) {
2675
2679
  }
2676
2680
  );
2677
2681
  }
2678
- function Nf({
2682
+ function Rf({
2679
2683
  anchor: t,
2680
2684
  itemId: e,
2681
2685
  snap: n
@@ -2702,7 +2706,7 @@ function Nf({
2702
2706
  children: [
2703
2707
  /* @__PURE__ */ c("div", { className: "text-[11px] font-semibold text-text leading-snug pb-1.5 mb-1.5 border-b border-border", children: f }),
2704
2708
  Object.entries(i.votes).map(([o, l]) => /* @__PURE__ */ x("div", { className: "flex items-center gap-2 py-0.5", children: [
2705
- /* @__PURE__ */ c(Cf, { sprite: n.sprites[o], url: n.pictures?.[o] }),
2709
+ /* @__PURE__ */ c(Nf, { sprite: n.sprites[o], url: n.pictures?.[o] }),
2706
2710
  /* @__PURE__ */ c("span", { className: "flex-1 text-[11px] text-text-secondary truncate", children: n.names[o] ?? "viewer" }),
2707
2711
  /* @__PURE__ */ c(
2708
2712
  "span",
@@ -2719,8 +2723,8 @@ function Nf({
2719
2723
  document.body
2720
2724
  );
2721
2725
  }
2722
- function Rf() {
2723
- const t = S((E) => E.tierlistOpen), e = S((E) => E.setTierlistOpen), n = S((E) => E.tierlist), r = S((E) => E.tierlistDraft), s = S((E) => E.tierlistSaving), a = S((E) => E.moveTierlistItem), [i, f] = L(null), [o, l] = L(null), [d, u] = L(null), [m, y] = L(null), [b, g] = If("tierlist.tab", "mine");
2726
+ function Lf() {
2727
+ const t = S((E) => E.tierlistOpen), e = S((E) => E.setTierlistOpen), n = S((E) => E.tierlist), r = S((E) => E.tierlistDraft), s = S((E) => E.tierlistSaving), a = S((E) => E.moveTierlistItem), [i, f] = L(null), [o, l] = L(null), [d, u] = L(null), [m, y] = L(null), [b, g] = Cf("tierlist.tab", "mine");
2724
2728
  R(() => {
2725
2729
  zn(!0);
2726
2730
  }, []), R(() => {
@@ -2734,7 +2738,7 @@ function Rf() {
2734
2738
  }, [t, e]);
2735
2739
  const h = ye(() => new Map((n?.items ?? []).map((E) => [E.id, E])), [n]), p = ye(() => {
2736
2740
  const E = { S: [], A: [], B: [], C: [], D: [], F: [], [nt]: [] }, v = /* @__PURE__ */ new Set();
2737
- for (const C of rn)
2741
+ for (const C of an)
2738
2742
  for (const $ of r[C] ?? []) {
2739
2743
  const B = h.get($);
2740
2744
  B && (E[C].push(B), v.add($));
@@ -2763,7 +2767,7 @@ function Rf() {
2763
2767
  i && (a(i, E === nt ? null : E), f(null));
2764
2768
  }
2765
2769
  }), M = j(async () => {
2766
- await Ts(S.getState().tierlistDraft) && y(Date.now());
2770
+ await Is(S.getState().tierlistDraft) && y(Date.now());
2767
2771
  }, []);
2768
2772
  if (R(() => {
2769
2773
  if (m === null) return;
@@ -2810,7 +2814,7 @@ function Rf() {
2810
2814
  ] }),
2811
2815
  /* @__PURE__ */ x("div", { className: "flex-1 overflow-y-auto", children: [
2812
2816
  F === "mine" && /* @__PURE__ */ x(pe, { children: [
2813
- rn.map((E) => /* @__PURE__ */ x("div", { className: "grid grid-cols-[56px_1fr] border-b border-border/50 min-h-[86px]", children: [
2817
+ an.map((E) => /* @__PURE__ */ x("div", { className: "grid grid-cols-[56px_1fr] border-b border-border/50 min-h-[86px]", children: [
2814
2818
  /* @__PURE__ */ c(
2815
2819
  "div",
2816
2820
  {
@@ -2861,7 +2865,7 @@ function Rf() {
2861
2865
  }
2862
2866
  )
2863
2867
  ] }),
2864
- F === "everyone" && n && /* @__PURE__ */ c(pe, { children: rn.map((E) => {
2868
+ F === "everyone" && n && /* @__PURE__ */ c(pe, { children: an.map((E) => {
2865
2869
  const v = n.placed.filter((C) => C.tier === E);
2866
2870
  return /* @__PURE__ */ x("div", { className: "grid grid-cols-[56px_1fr] border-b border-border/50 min-h-[86px]", children: [
2867
2871
  /* @__PURE__ */ c(
@@ -2892,7 +2896,7 @@ function Rf() {
2892
2896
  alt: "",
2893
2897
  loading: "eager",
2894
2898
  decoding: "async",
2895
- ref: $a,
2899
+ ref: Pa,
2896
2900
  onLoad: (B) => {
2897
2901
  B.currentTarget.dataset.loaded = "true";
2898
2902
  },
@@ -2918,21 +2922,21 @@ function Rf() {
2918
2922
  ]
2919
2923
  }
2920
2924
  ),
2921
- d && n && /* @__PURE__ */ c(Nf, { anchor: d.anchor, itemId: d.itemId, snap: n })
2925
+ d && n && /* @__PURE__ */ c(Rf, { anchor: d.anchor, itemId: d.itemId, snap: n })
2922
2926
  ]
2923
2927
  }
2924
2928
  ),
2925
2929
  document.body
2926
2930
  );
2927
2931
  }
2928
- function Lf({ children: t }) {
2932
+ function Ff({ children: t }) {
2929
2933
  const [e, n] = L(null);
2930
2934
  return R(() => {
2931
2935
  const r = () => n(document.fullscreenElement);
2932
2936
  return r(), document.addEventListener("fullscreenchange", r), () => document.removeEventListener("fullscreenchange", r);
2933
2937
  }, []), e ? wt(t, e) : /* @__PURE__ */ c(pe, { children: t });
2934
2938
  }
2935
- function Da({ site: t = "control bar", className: e = "ctr-btn" }) {
2939
+ function Ba({ site: t = "control bar", className: e = "ctr-btn" }) {
2936
2940
  return /* @__PURE__ */ c(
2937
2941
  "button",
2938
2942
  {
@@ -2940,12 +2944,12 @@ function Da({ site: t = "control bar", className: e = "ctr-btn" }) {
2940
2944
  className: e,
2941
2945
  title: "Select Media",
2942
2946
  "aria-label": "Select Media",
2943
- children: /* @__PURE__ */ c(_o, {})
2947
+ children: /* @__PURE__ */ c(vo, {})
2944
2948
  }
2945
2949
  );
2946
2950
  }
2947
- function Ff() {
2948
- const t = S((i) => i.chatCollapsed), e = S((i) => i.toggleChatCollapsed), n = S((i) => !!i.snapshot.mediaId), r = Ft(), s = Vt({ hasMedia: n, chatCollapsed: t, isFullscreen: r });
2951
+ function $f() {
2952
+ const t = S((i) => i.chatCollapsed), e = S((i) => i.toggleChatCollapsed), n = S((i) => !!i.snapshot.mediaId), r = $t(), s = Jt({ hasMedia: n, chatCollapsed: t, isFullscreen: r });
2949
2953
  return { panelHidden: s, toggle: () => {
2950
2954
  if (T("chat", s ? "Show chat" : "Hide chat", { isFullscreen: r, chatCollapsed: t }), !s) {
2951
2955
  e();
@@ -2956,8 +2960,8 @@ function Ff() {
2956
2960
  });
2957
2961
  } };
2958
2962
  }
2959
- function Pa({ className: t }) {
2960
- const { panelHidden: e, toggle: n } = Ff(), r = e ? "Show chat" : "Hide chat";
2963
+ function Oa({ className: t }) {
2964
+ const { panelHidden: e, toggle: n } = $f(), r = e ? "Show chat" : "Hide chat";
2961
2965
  return /* @__PURE__ */ c(
2962
2966
  "button",
2963
2967
  {
@@ -2967,12 +2971,12 @@ function Pa({ className: t }) {
2967
2971
  title: r,
2968
2972
  "aria-label": r,
2969
2973
  "aria-expanded": !e,
2970
- children: e ? /* @__PURE__ */ c(yo, { className: "w-5 h-5" }) : /* @__PURE__ */ c(ua, { className: "w-5 h-5" })
2974
+ children: e ? /* @__PURE__ */ c(wo, { className: "w-5 h-5" }) : /* @__PURE__ */ c(ha, { className: "w-5 h-5" })
2971
2975
  }
2972
2976
  );
2973
2977
  }
2974
- function $f() {
2975
- const t = S((d) => d.chatCollapsed), e = S((d) => !!d.snapshot.mediaId), n = Ft(), r = Qt(), s = st(), a = $n(), i = Rn({
2978
+ function Df() {
2979
+ const t = S((d) => d.chatCollapsed), e = S((d) => !!d.snapshot.mediaId), n = $t(), r = Yt(), s = st(), a = $n(), i = Rn({
2976
2980
  isLeader: a,
2977
2981
  hasMedia: e,
2978
2982
  chatCollapsed: t,
@@ -2980,21 +2984,21 @@ function $f() {
2980
2984
  gameOverlay: r !== null
2981
2985
  }) === "room-corner", f = s && r !== null && !n, o = Zr({ hasMedia: e, isFullscreen: n, gameOverlay: r !== null }) === "room-corner";
2982
2986
  return !i && !f && !o ? null : /* @__PURE__ */ x("div", { className: "absolute top-2 right-2 z-40 flex items-center gap-2", "data-testid": "room-corner-controls", children: [
2983
- i && /* @__PURE__ */ c(Da, { site: "room corner", className: "corner-btn" }),
2987
+ i && /* @__PURE__ */ c(Ba, { site: "room corner", className: "corner-btn" }),
2984
2988
  f && /* @__PURE__ */ c("button", { type: "button", onClick: () => {
2985
2989
  T("game", "game_select", { gameId: null, source: "room corner" }), Fr(null);
2986
- }, className: "corner-btn", title: "Stop game", "aria-label": "Stop game", children: /* @__PURE__ */ c(ha, {}) }),
2987
- o && /* @__PURE__ */ c(Pa, { className: "corner-btn" })
2990
+ }, className: "corner-btn", title: "Stop game", "aria-label": "Stop game", children: /* @__PURE__ */ c(ga, {}) }),
2991
+ o && /* @__PURE__ */ c(Oa, { className: "corner-btn" })
2988
2992
  ] });
2989
2993
  }
2990
- const Mn = "hadoku:avatar", Tn = "hadoku:name", Df = "hadoku:identity", Ht = /* @__PURE__ */ Symbol.for("hadoku:identity-relay"), cr = /* @__PURE__ */ Symbol.for("hadoku:identity-relayed");
2991
- function Pf() {
2992
- return typeof globalThis.BroadcastChannel > "u" ? null : new globalThis.BroadcastChannel(Df);
2994
+ const Mn = "hadoku:avatar", Tn = "hadoku:name", Pf = "hadoku:identity", Ut = /* @__PURE__ */ Symbol.for("hadoku:identity-relay"), cr = /* @__PURE__ */ Symbol.for("hadoku:identity-relayed");
2995
+ function Bf() {
2996
+ return typeof globalThis.BroadcastChannel > "u" ? null : new globalThis.BroadcastChannel(Pf);
2993
2997
  }
2994
2998
  function dr(t) {
2995
2999
  return t === Tn || t === Mn;
2996
3000
  }
2997
- function Bf(t, e) {
3001
+ function Of(t, e) {
2998
3002
  const n = (r) => {
2999
3003
  if (r[cr]) return;
3000
3004
  const s = r.detail;
@@ -3009,43 +3013,61 @@ function Bf(t, e) {
3009
3013
  t.removeEventListener(Tn, n), t.removeEventListener(Mn, n), e.close();
3010
3014
  };
3011
3015
  }
3012
- function Of(t = typeof window > "u" ? void 0 : window, e = Pf) {
3016
+ function jf(t = typeof window > "u" ? void 0 : window, e = Bf) {
3013
3017
  if (!t) return () => {
3014
3018
  };
3015
3019
  const n = t;
3016
- let r = n[Ht];
3020
+ let r = n[Ut];
3017
3021
  if (!r) {
3018
3022
  const i = e();
3019
3023
  if (!i) return () => {
3020
3024
  };
3021
- r = { count: 0, stop: Bf(t, i) }, n[Ht] = r;
3025
+ r = { count: 0, stop: Of(t, i) }, n[Ut] = r;
3022
3026
  }
3023
3027
  r.count++;
3024
3028
  const s = r;
3025
3029
  let a = !1;
3026
3030
  return () => {
3027
- a || (a = !0, !(--s.count > 0) && (s.stop(), n[Ht] === s && delete n[Ht]));
3031
+ a || (a = !0, !(--s.count > 0) && (s.stop(), n[Ut] === s && delete n[Ut]));
3028
3032
  };
3029
3033
  }
3030
- function jf() {
3034
+ function Hf() {
3031
3035
  R(() => {
3032
- const t = Of(), e = As((r, s) => {
3033
- const a = Cs(s);
3036
+ const t = jf(), e = Cs((r, s) => {
3037
+ const a = Rs(s);
3034
3038
  T("avatar", "Avatar changed in the settings popout", { sprite: a, source: s.avatar?.source }), Br(a);
3035
- }), n = Is((r) => {
3036
- T("avatar", "Renamed in the settings popout", { name: r }), Ns(r);
3039
+ }), n = Ns((r) => {
3040
+ T("avatar", "Renamed in the settings popout", { name: r }), Ls(r);
3037
3041
  });
3038
3042
  return () => {
3039
3043
  e(), n(), t();
3040
3044
  };
3041
3045
  }, []);
3042
3046
  }
3043
- const Ba = [];
3047
+ const Uf = 5 * 6e4;
3048
+ function zf({ message: t, earlier: e, me: n, mediaPlaying: r }) {
3049
+ if (r || !t.live || t.isSystem || ia(t, n)) return !1;
3050
+ for (let s = e.length - 1; s >= 0; s--) {
3051
+ const a = e[s];
3052
+ if (!(a.isSystem || a.id === t.id))
3053
+ return t.ts - a.ts >= Uf;
3054
+ }
3055
+ return !0;
3056
+ }
3057
+ function Wf() {
3058
+ R(() => S.subscribe((t, e) => {
3059
+ const n = t.chat[t.chat.length - 1];
3060
+ if (!n || n === e.chat[e.chat.length - 1]) return;
3061
+ const r = { clientId: t.me.clientId, author: t.me.clientId ? t.roster[t.me.clientId]?.author : void 0 }, s = t.snapshot.playing && t.snapshot.mediaId !== null;
3062
+ zf({ message: n, earlier: e.chat, me: r, mediaPlaying: s }) && (T("chat", "Chat chime", { id: n.id }), Da());
3063
+ }), []);
3064
+ }
3065
+ const ja = [];
3044
3066
  function ur(t) {
3045
- Ba.push(t);
3067
+ ja.push(t);
3046
3068
  }
3047
3069
  function dt() {
3048
- const t = Ba.splice(0);
3070
+ const t = ja.splice(0);
3049
3071
  for (const e of t)
3050
3072
  try {
3051
3073
  e();
@@ -3054,19 +3076,19 @@ function dt() {
3054
3076
  }
3055
3077
  }
3056
3078
  let ln = !1;
3057
- function Hf() {
3079
+ function Gf() {
3058
3080
  return ln ? () => {
3059
3081
  } : (ln = !0, document.addEventListener("click", dt, { capture: !0, passive: !0 }), document.addEventListener("touchend", dt, { capture: !0, passive: !0 }), document.addEventListener("keydown", dt, { capture: !0, passive: !0 }), () => {
3060
3082
  document.removeEventListener("click", dt, { capture: !0 }), document.removeEventListener("touchend", dt, { capture: !0 }), document.removeEventListener("keydown", dt, { capture: !0 }), ln = !1;
3061
3083
  });
3062
3084
  }
3063
- const cn = "data-wp-input", Uf = /* @__PURE__ */ new Set(["ArrowLeft", "ArrowRight", "ArrowUp", "ArrowDown"]);
3064
- function zf(t, e) {
3065
- return Kr(e) ? !1 : Uf.has(t.key) || qe(t) && t.key !== "Escape";
3085
+ const cn = "data-wp-input", qf = /* @__PURE__ */ new Set(["ArrowLeft", "ArrowRight", "ArrowUp", "ArrowDown"]);
3086
+ function Kf(t, e) {
3087
+ return Kr(e) ? !1 : qf.has(t.key) || qe(t) && t.key !== "Escape";
3066
3088
  }
3067
- function Wf() {
3089
+ function Vf() {
3068
3090
  const t = document.documentElement, e = (r) => {
3069
- zf(r, document.activeElement) && t.setAttribute(cn, "remote");
3091
+ Kf(r, document.activeElement) && t.setAttribute(cn, "remote");
3070
3092
  }, n = (r) => {
3071
3093
  r.detail > 0 && t.setAttribute(cn, "pointer");
3072
3094
  };
@@ -3074,26 +3096,26 @@ function Wf() {
3074
3096
  window.removeEventListener("keydown", e, !0), window.removeEventListener("click", n, !0), t.removeAttribute(cn);
3075
3097
  };
3076
3098
  }
3077
- const Gf = 400;
3078
- function qf(t) {
3099
+ const Jf = 400;
3100
+ function Qf(t) {
3079
3101
  return t === "leader" || t === "viewer" ? t : null;
3080
3102
  }
3081
- async function Kf(t) {
3082
- const e = Rs(), n = await fetch(`${e}/api/rooms/validate/${encodeURIComponent(t)}`);
3103
+ async function Yf(t) {
3104
+ const e = Fs(), n = await fetch(`${e}/api/rooms/validate/${encodeURIComponent(t)}`);
3083
3105
  if (n.status === 404) return null;
3084
3106
  if (!n.ok) throw new Error(`validate returned ${n.status}`);
3085
3107
  const r = await n.json();
3086
- return qf(r?.type);
3108
+ return Qf(r?.type);
3087
3109
  }
3088
- async function Vf(t) {
3110
+ async function Xf(t) {
3089
3111
  for (let e = 0; e < 2; e++)
3090
3112
  try {
3091
- const n = await Kf(t);
3113
+ const n = await Yf(t);
3092
3114
  S.getState().setRoomKeyType({ roomKey: t, type: n }), T("room", "Room key type probed", { roomKey: t, type: n });
3093
3115
  return;
3094
3116
  } catch (n) {
3095
3117
  if (e === 0) {
3096
- await new Promise((r) => setTimeout(r, Gf));
3118
+ await new Promise((r) => setTimeout(r, Jf));
3097
3119
  continue;
3098
3120
  }
3099
3121
  N("room", "Room key type probe failed, falling back to socket truth", Z(n));
@@ -3103,14 +3125,14 @@ function Oe(t, e) {
3103
3125
  const r = S.getState().allocateClientSeq(), s = { kind: t, client_seq: r, ...e || {} };
3104
3126
  return Or().emit(jr.CONTROL, s), r;
3105
3127
  }
3106
- function Dc(t) {
3128
+ function jc(t) {
3107
3129
  return Oe("load", { media_id: t });
3108
3130
  }
3109
- function Jf() {
3131
+ function Zf() {
3110
3132
  return Oe("home");
3111
3133
  }
3112
- function Qf() {
3113
- const t = nf(), e = Sa(), n = st(), r = xa(), s = n && r && !e.ready, a = !e.ready && !s;
3134
+ function el() {
3135
+ const t = rf(), e = xa(), n = st(), r = Ea(), s = n && r && !e.ready, a = !e.ready && !s;
3114
3136
  return /* @__PURE__ */ c(
3115
3137
  "button",
3116
3138
  {
@@ -3131,13 +3153,13 @@ function Qf() {
3131
3153
  className: "ctr-btn",
3132
3154
  title: s ? "Some viewers still loading — play anyway" : a ? "Waiting for sync..." : n ? t.playing ? "Pause" : "Play" : "Only the leader can control playback",
3133
3155
  "data-active": !a && n && t.playing ? "1" : "0",
3134
- children: t.playing ? /* @__PURE__ */ c(co, {}) : /* @__PURE__ */ c(lo, {})
3156
+ children: t.playing ? /* @__PURE__ */ c(uo, {}) : /* @__PURE__ */ c(co, {})
3135
3157
  }
3136
3158
  );
3137
3159
  }
3138
- function Yf() {
3160
+ function tl() {
3139
3161
  function t() {
3140
- T("controls", "Unload episode clicked"), Jf();
3162
+ T("controls", "Unload episode clicked"), Zf();
3141
3163
  }
3142
3164
  return /* @__PURE__ */ c(
3143
3165
  "button",
@@ -3147,21 +3169,21 @@ function Yf() {
3147
3169
  title: "Unload episode (return to lobby)",
3148
3170
  "data-remote-destructive": "",
3149
3171
  "aria-label": "Unload episode",
3150
- children: /* @__PURE__ */ c(wo, {})
3172
+ children: /* @__PURE__ */ c(_o, {})
3151
3173
  }
3152
3174
  );
3153
3175
  }
3154
- function Xf(t) {
3176
+ function nl(t) {
3155
3177
  return !t.isLeader || t.durationMs === 0 ? !0 : !t.ready && !t.canOverride;
3156
3178
  }
3157
- function Zf(t) {
3179
+ function rl(t) {
3158
3180
  return t.localValue !== null ? t.localValue : t.displayPlayheadMs ?? t.snapshotPlayheadMs;
3159
3181
  }
3160
- function el(t, e) {
3182
+ function al(t, e) {
3161
3183
  return e <= 0 ? 0 : t / e;
3162
3184
  }
3163
3185
  const hr = 1e4, gr = 6e4;
3164
- function tl(t, e, n) {
3186
+ function sl(t, e, n) {
3165
3187
  if (n <= 0) return null;
3166
3188
  let r;
3167
3189
  switch (t) {
@@ -3188,17 +3210,17 @@ function tl(t, e, n) {
3188
3210
  }
3189
3211
  return Math.round(Math.min(n, Math.max(0, r)));
3190
3212
  }
3191
- const nl = 600;
3213
+ const il = 600;
3192
3214
  function dn(t) {
3193
3215
  const e = Math.floor(t / 1e3), n = Math.floor(e / 3600), r = Math.floor(e % 3600 / 60), s = e % 60;
3194
3216
  return n > 0 ? `${n}:${r.toString().padStart(2, "0")}:${s.toString().padStart(2, "0")}` : `${r}:${s.toString().padStart(2, "0")}`;
3195
3217
  }
3196
- function rl({ durationMs: t, displayPlayheadMs: e }) {
3197
- const n = S(($) => $.snapshot), r = S(($) => $.readiness), s = st(), a = xa(), i = s && a && !r.ready, f = D(null), [o, l] = L(null), [d, u] = L(0), [m, y] = L(!1), [b, g] = L(null), h = D(0), [p, _] = L(n.mediaId);
3218
+ function ol({ durationMs: t, displayPlayheadMs: e }) {
3219
+ const n = S(($) => $.snapshot), r = S(($) => $.readiness), s = st(), a = Ea(), i = s && a && !r.ready, f = D(null), [o, l] = L(null), [d, u] = L(0), [m, y] = L(!1), [b, g] = L(null), h = D(0), [p, _] = L(n.mediaId);
3198
3220
  p !== n.mediaId && (_(n.mediaId), g(null), y(!1));
3199
3221
  const I = e ?? n.playheadMs;
3200
3222
  !m && b !== null && Math.abs(I - b) < $r && g(null);
3201
- const M = t || 0, w = Zf({ localValue: b, displayPlayheadMs: e, snapshotPlayheadMs: n.playheadMs }), k = D(0);
3223
+ const M = t || 0, w = rl({ localValue: b, displayPlayheadMs: e, snapshotPlayheadMs: n.playheadMs }), k = D(0);
3202
3224
  R(() => {
3203
3225
  if (m || b === null) return;
3204
3226
  const $ = 1e4 - (Date.now() - k.current), B = setTimeout(() => {
@@ -3221,10 +3243,10 @@ function rl({ durationMs: t, displayPlayheadMs: e }) {
3221
3243
  }, []);
3222
3244
  const C = j(($) => {
3223
3245
  if ($.defaultPrevented) return;
3224
- const B = tl($.key, w, M);
3246
+ const B = sl($.key, w, M);
3225
3247
  B !== null && ($.preventDefault(), g(B), k.current = Date.now(), v.current && clearTimeout(v.current), v.current = setTimeout(() => {
3226
3248
  v.current = null, T("seek", "Keyboard seek", { to_ms: B }), Oe("seek", { to_ms: B }), h.current = B;
3227
- }, nl));
3249
+ }, il));
3228
3250
  }, [w, M]);
3229
3251
  return /* @__PURE__ */ x("div", { className: "flex items-center gap-2 flex-1", children: [
3230
3252
  /* @__PURE__ */ c("span", { className: "text-[11px] font-mono text-text-secondary w-[45px] text-right shrink-0", children: dn(w) }),
@@ -3236,8 +3258,8 @@ function rl({ durationMs: t, displayPlayheadMs: e }) {
3236
3258
  min: 0,
3237
3259
  max: M,
3238
3260
  value: w,
3239
- disabled: Xf({ isLeader: s, ready: r.ready, canOverride: i, durationMs: M }),
3240
- style: { "--progress": `${el(w, M) * 100}%` },
3261
+ disabled: nl({ isLeader: s, ready: r.ready, canOverride: i, durationMs: M }),
3262
+ style: { "--progress": `${al(w, M) * 100}%` },
3241
3263
  onChange: ($) => {
3242
3264
  const B = Number($.target.value);
3243
3265
  g(B), k.current = Date.now();
@@ -3270,7 +3292,7 @@ function rl({ durationMs: t, displayPlayheadMs: e }) {
3270
3292
  /* @__PURE__ */ c("span", { className: "text-[11px] font-mono text-text-muted w-[45px] text-left shrink-0", children: dn(M) })
3271
3293
  ] });
3272
3294
  }
3273
- function al({ videoRef: t }) {
3295
+ function fl({ videoRef: t }) {
3274
3296
  const e = S((d) => d.mediaPrefs.volume), n = S((d) => d.mediaPrefs.muted), r = S((d) => d.setVolume), s = S((d) => d.setMuted);
3275
3297
  R(() => {
3276
3298
  const d = t.current;
@@ -3281,7 +3303,7 @@ function al({ videoRef: t }) {
3281
3303
  r(u), u > 0 && n && s(!1);
3282
3304
  }, i = () => {
3283
3305
  s(!n);
3284
- }, f = () => n || e === 0 ? /* @__PURE__ */ c(uo, {}) : e < 0.5 ? /* @__PURE__ */ c(ho, {}) : /* @__PURE__ */ c(go, {}), o = n ? 0 : e, l = Math.round(o * 100);
3306
+ }, f = () => n || e === 0 ? /* @__PURE__ */ c(ho, {}) : e < 0.5 ? /* @__PURE__ */ c(go, {}) : /* @__PURE__ */ c(mo, {}), o = n ? 0 : e, l = Math.round(o * 100);
3285
3307
  return /* @__PURE__ */ x("div", { className: "flex items-center gap-2", children: [
3286
3308
  /* @__PURE__ */ c(
3287
3309
  "button",
@@ -3325,7 +3347,7 @@ function Dn({
3325
3347
  width: f = 200,
3326
3348
  testId: o
3327
3349
  }) {
3328
- const [l, d] = L(!1), [u, m] = L(0), [y, b] = L(null), g = D(null), h = Wt(), p = Math.max(0, n.findIndex((k) => k.value === r)), _ = (k) => {
3350
+ const [l, d] = L(!1), [u, m] = L(0), [y, b] = L(null), g = D(null), h = Gt(), p = Math.max(0, n.findIndex((k) => k.value === r)), _ = (k) => {
3329
3351
  d(k), i?.(k), k && m(p);
3330
3352
  };
3331
3353
  R(() => () => i?.(!1), [i]), R(() => {
@@ -3364,7 +3386,7 @@ function Dn({
3364
3386
  }
3365
3387
  ),
3366
3388
  l && /* @__PURE__ */ c(
3367
- ca,
3389
+ da,
3368
3390
  {
3369
3391
  anchor: y,
3370
3392
  onClose: () => _(!1),
@@ -3404,7 +3426,7 @@ function Dn({
3404
3426
  )
3405
3427
  ] });
3406
3428
  }
3407
- function sl({ tracks: t, selectedIndex: e, onSelect: n, onMenuOpen: r }) {
3429
+ function ll({ tracks: t, selectedIndex: e, onSelect: n, onMenuOpen: r }) {
3408
3430
  if (t.length === 0) return null;
3409
3431
  const s = t.length === 1;
3410
3432
  return /* @__PURE__ */ x("div", { className: "flex items-center gap-2", children: [
@@ -3424,7 +3446,7 @@ function sl({ tracks: t, selectedIndex: e, onSelect: n, onMenuOpen: r }) {
3424
3446
  )
3425
3447
  ] });
3426
3448
  }
3427
- function il({
3449
+ function cl({
3428
3450
  tracks: t,
3429
3451
  selectedIndex: e,
3430
3452
  onSelect: n,
@@ -3459,7 +3481,7 @@ function il({
3459
3481
  )
3460
3482
  ] });
3461
3483
  }
3462
- const ut = 3, ol = 1e3, fl = 15e3;
3484
+ const ut = 3, dl = 1e3, ul = 15e3;
3463
3485
  function Ce(t) {
3464
3486
  const e = t?.readyState;
3465
3487
  return e === "open" || e === "ended";
@@ -3470,11 +3492,11 @@ const ne = {
3470
3492
  RANGE: 0.1,
3471
3493
  FALLBACK: 1
3472
3494
  }, un = 0.5, hn = 3e3;
3473
- function At(t, e = {}) {
3474
- const { baseMs: n = ol, capMs: r = fl, jitter: s = 0.25 } = e, a = Math.min(n * Math.pow(2, t - 1), r), i = s > 0 ? Math.round(a * Math.random() * s) : 0;
3495
+ function It(t, e = {}) {
3496
+ const { baseMs: n = dl, capMs: r = ul, jitter: s = 0.25 } = e, a = Math.min(n * Math.pow(2, t - 1), r), i = s > 0 ? Math.round(a * Math.random() * s) : 0;
3475
3497
  return a + i;
3476
3498
  }
3477
- const mr = 15, ll = 35e3, cl = 2e3, gn = 10;
3499
+ const mr = 15, hl = 35e3, gl = 2e3, gn = 10;
3478
3500
  function Pe(t, e) {
3479
3501
  if (t.length === 0) return 0;
3480
3502
  if (e >= t[t.length - 1].end_ms) return t.length - 1;
@@ -3508,15 +3530,15 @@ function mn(t, e, n, r = ne.RANGE) {
3508
3530
  function Se(t) {
3509
3531
  return t ? Array.from({ length: t.length }, (e, n) => `${t.start(n).toFixed(2)}-${t.end(n).toFixed(2)}`) : [];
3510
3532
  }
3511
- function dl(t) {
3533
+ function ml(t) {
3512
3534
  if (t.length === 0) return 0;
3513
3535
  const e = t.reduce((r, s) => r + s.bytes, 0), n = t.reduce((r, s) => r + s.durationMs, 0);
3514
3536
  return n === 0 ? 0 : e / n * 1e3;
3515
3537
  }
3516
- const ul = 8e5, hl = 4;
3538
+ const pl = 8e5, bl = 4;
3517
3539
  function Et(t) {
3518
3540
  if (t === 0) return 6e4;
3519
- const e = ul / t * 1e3 * hl;
3541
+ const e = pl / t * 1e3 * bl;
3520
3542
  return Math.max(3e4, Math.min(12e4, Math.round(e)));
3521
3543
  }
3522
3544
  function pr(t, e) {
@@ -3524,7 +3546,7 @@ function pr(t, e) {
3524
3546
  if (t[n]?.keyframe) return n;
3525
3547
  return -1;
3526
3548
  }
3527
- function gl(t, e, n, r) {
3549
+ function yl(t, e, n, r) {
3528
3550
  const s = t * 1e3 - 100, a = e * 1e3 + 100;
3529
3551
  for (const i of r) {
3530
3552
  const f = n[i];
@@ -3533,7 +3555,7 @@ function gl(t, e, n, r) {
3533
3555
  }
3534
3556
  return !1;
3535
3557
  }
3536
- function ml(t) {
3558
+ function wl(t) {
3537
3559
  const e = [], n = t.replace(/\r\n/g, `
3538
3560
  `).split(`
3539
3561
  `);
@@ -3588,10 +3610,10 @@ function br(t) {
3588
3610
  let n = 0, r, s;
3589
3611
  return e.length === 3 ? (n = parseInt(e[0], 10), r = parseInt(e[1], 10), s = parseFloat(e[2])) : (r = parseInt(e[0], 10), s = parseFloat(e[1])), isNaN(n) || isNaN(r) || isNaN(s) ? null : n * 3600 + r * 60 + s;
3590
3612
  }
3591
- function pl(t) {
3613
+ function _l(t) {
3592
3614
  return t.replace(/<\/?[^>]+(>|$)/g, "").replace(/\{[^}]+\}/g, "").replace(/\\N/g, " ").replace(/\s*\n\s*/g, " ").replace(/\s{2,}/g, " ").trim();
3593
3615
  }
3594
- const Oa = {
3616
+ const Ha = {
3595
3617
  // Standard CC look: white text with thick black outline stroke
3596
3618
  classic: "text-white [text-shadow:_-2px_-2px_0_#000,_2px_-2px_0_#000,_-2px_2px_0_#000,_2px_2px_0_#000,_0_-2px_0_#000,_0_2px_0_#000,_-2px_0_0_#000,_2px_0_0_#000]",
3597
3619
  // DVD/theater style: yellow text on dark translucent box
@@ -3601,7 +3623,7 @@ const Oa = {
3601
3623
  // Accessibility-focused: bold white text on solid black box
3602
3624
  contrast: "text-white font-bold bg-black px-3 py-1"
3603
3625
  };
3604
- function bl({ subtitleUrl: t, videoRef: e, style: n, enabled: r }) {
3626
+ function vl({ subtitleUrl: t, videoRef: e, style: n, enabled: r }) {
3605
3627
  const [s, a] = L([]), [i, f] = L([]), o = D(null), [l, d] = L(40), [u, m] = L(18), [y, b] = L(t);
3606
3628
  y !== t && (b(t), t || a([])), R(() => {
3607
3629
  if (!t) return;
@@ -3615,13 +3637,13 @@ function bl({ subtitleUrl: t, videoRef: e, style: n, enabled: r }) {
3615
3637
  if (!E.ok) throw new Error(`Failed to fetch subtitles (status ${E.status})`);
3616
3638
  const v = await E.text();
3617
3639
  if (w) return;
3618
- const C = ml(v);
3640
+ const C = wl(v);
3619
3641
  a(C);
3620
3642
  return;
3621
3643
  } catch (E) {
3622
3644
  if (w) return;
3623
3645
  if (F < k) {
3624
- const v = At(F + 1, { baseMs: 1e3, capMs: 2e3, jitter: 0 });
3646
+ const v = It(F + 1, { baseMs: 1e3, capMs: 2e3, jitter: 0 });
3625
3647
  N("subtitles", `Fetch failed, retrying in ${v}ms (attempt ${F + 1}/${k + 1})`, { error: E?.message }), await new Promise((C) => setTimeout(C, v));
3626
3648
  } else
3627
3649
  N("subtitles", "All fetch attempts failed", { error: E?.message }), a([]);
@@ -3685,8 +3707,8 @@ function bl({ subtitleUrl: t, videoRef: e, style: n, enabled: r }) {
3685
3707
  children: /* @__PURE__ */ c(
3686
3708
  "div",
3687
3709
  {
3688
- className: `${F} font-medium max-w-[95%] inline-block antialiased ${Oa[n]}`,
3689
- children: pl(E.text)
3710
+ className: `${F} font-medium max-w-[95%] inline-block antialiased ${Ha[n]}`,
3711
+ children: _l(E.text)
3690
3712
  }
3691
3713
  )
3692
3714
  },
@@ -3723,13 +3745,13 @@ function bl({ subtitleUrl: t, videoRef: e, style: n, enabled: r }) {
3723
3745
  M(_.bl, _.bc, _.br, { bottom: `${l}px` }, o)
3724
3746
  ] });
3725
3747
  }
3726
- const yl = [
3748
+ const kl = [
3727
3749
  { value: "classic", label: "Classic" },
3728
3750
  { value: "cinema", label: "Cinema" },
3729
3751
  { value: "minimal", label: "Minimal" },
3730
3752
  { value: "contrast", label: "High Contrast" }
3731
3753
  ];
3732
- function wl({ style: t, onStyleChange: e, enabled: n, onMenuOpen: r }) {
3754
+ function Sl({ style: t, onStyleChange: e, enabled: n, onMenuOpen: r }) {
3733
3755
  return n ? /* @__PURE__ */ x("div", { className: "flex items-center gap-2", children: [
3734
3756
  /* @__PURE__ */ c("span", { className: "text-[10px] opacity-60 uppercase tracking-wide", children: "Style" }),
3735
3757
  /* @__PURE__ */ c(
@@ -3737,9 +3759,9 @@ function wl({ style: t, onStyleChange: e, enabled: n, onMenuOpen: r }) {
3737
3759
  {
3738
3760
  ariaLabel: "Subtitle style selection",
3739
3761
  title: "Select subtitle style",
3740
- options: yl.map((s) => ({
3762
+ options: kl.map((s) => ({
3741
3763
  ...s,
3742
- render: /* @__PURE__ */ c("span", { className: "subtitle-style-preview", "data-style": s.value, children: /* @__PURE__ */ c("span", { className: `font-medium text-[15px] leading-tight inline-block antialiased ${Oa[s.value]}`, children: s.label }) })
3764
+ render: /* @__PURE__ */ c("span", { className: "subtitle-style-preview", "data-style": s.value, children: /* @__PURE__ */ c("span", { className: `font-medium text-[15px] leading-tight inline-block antialiased ${Ha[s.value]}`, children: s.label }) })
3743
3765
  })),
3744
3766
  value: t,
3745
3767
  onSelect: e,
@@ -3749,7 +3771,7 @@ function wl({ style: t, onStyleChange: e, enabled: n, onMenuOpen: r }) {
3749
3771
  )
3750
3772
  ] }) : null;
3751
3773
  }
3752
- function _l({ videoRef: t }) {
3774
+ function xl({ videoRef: t }) {
3753
3775
  const [e, n] = L(!1);
3754
3776
  R(() => {
3755
3777
  const s = () => {
@@ -3779,11 +3801,11 @@ function _l({ videoRef: t }) {
3779
3801
  },
3780
3802
  className: "ctr-btn",
3781
3803
  title: e ? "Exit Fullscreen" : "Enter Fullscreen",
3782
- children: e ? /* @__PURE__ */ c(po, {}) : /* @__PURE__ */ c(mo, {})
3804
+ children: e ? /* @__PURE__ */ c(bo, {}) : /* @__PURE__ */ c(po, {})
3783
3805
  }
3784
3806
  );
3785
3807
  }
3786
- function vl({
3808
+ function El({
3787
3809
  videoRef: t,
3788
3810
  mediaId: e,
3789
3811
  durationMs: n,
@@ -3802,7 +3824,7 @@ function vl({
3802
3824
  onChatActivity: g,
3803
3825
  onMenuHeld: h
3804
3826
  }) {
3805
- const p = st(), _ = S((U) => U.chatCollapsed), I = Ft(), M = $n(), w = Qt() !== null, k = Rn({
3827
+ const p = st(), _ = S((U) => U.chatCollapsed), I = $t(), M = $n(), w = Yt() !== null, k = Rn({
3806
3828
  isLeader: M,
3807
3829
  hasMedia: !0,
3808
3830
  chatCollapsed: _,
@@ -3810,19 +3832,19 @@ function vl({
3810
3832
  gameOverlay: w
3811
3833
  }) === "control-bar", F = Zr({ hasMedia: !0, isFullscreen: I, gameOverlay: w }) === "control-bar", E = S((U) => U.floatingChatEnabled), v = D(null), C = D(null), [$, B] = L(null), O = j((U) => {
3812
3834
  C.current = U, B(U);
3813
- }, []), [z, K] = L(!1), [le, V] = L(!1), [X, W] = L(""), [he, ee] = L(!1), Q = _a(), [P, te] = L(!1), [Ae, Ke] = L(!1), [Dt, _t] = L(null), Re = va(), ge = ya(X, W, C), Ee = Wt(), it = S((U) => U.replyingTo), ot = S((U) => U.setReplyingTo), Ve = D(/* @__PURE__ */ new Set()), Me = j((U, se) => {
3835
+ }, []), [z, K] = L(!1), [le, V] = L(!1), [X, W] = L(""), [he, ee] = L(!1), Q = va(), [P, te] = L(!1), [Ae, Ke] = L(!1), [Pt, _t] = L(null), Re = ka(), ge = wa(X, W, C), Ee = Gt(), it = S((U) => U.replyingTo), ot = S((U) => U.setReplyingTo), Ve = D(/* @__PURE__ */ new Set()), Me = j((U, se) => {
3814
3836
  const we = Ve.current.size > 0;
3815
3837
  se ? Ve.current.add(U) : Ve.current.delete(U);
3816
3838
  const ft = Ve.current.size > 0;
3817
3839
  we !== ft && h?.(ft);
3818
- }, [h]), Yt = j((U) => Me("audio", U), [Me]), Xt = j((U) => Me("subtitle", U), [Me]), Pt = j((U) => Me("style", U), [Me]);
3840
+ }, [h]), Xt = j((U) => Me("audio", U), [Me]), Zt = j((U) => Me("subtitle", U), [Me]), Bt = j((U) => Me("style", U), [Me]);
3819
3841
  R(() => Me("meme", P), [Me, P]);
3820
- const Zt = j(async (U) => {
3842
+ const en = j(async (U) => {
3821
3843
  if (ge.onKeyDown(U) || U.key !== "Enter") return;
3822
3844
  const se = X.trim();
3823
3845
  if (!se && !Q.pending.length || he || Q.uploading) return;
3824
3846
  const we = await Q.uploadPending();
3825
- we !== null && (Nr(ba(se), we, it), W(""), Re.stop(), ot(null), Q.clear(), ee(!0), setTimeout(() => ee(!1), Rr), !document.hidden && document.hasFocus() && C.current?.focus());
3847
+ we !== null && (Nr(ya(se), we, it), W(""), Re.stop(), ot(null), Q.clear(), ee(!0), setTimeout(() => ee(!1), Rr), !document.hidden && document.hasFocus() && C.current?.focus());
3826
3848
  }, [X, he, Q, Re, it, ot, ge]);
3827
3849
  R(() => () => {
3828
3850
  Ve.current.clear(), h?.(!1);
@@ -3849,53 +3871,53 @@ function vl({
3849
3871
  se.scrollBy({ left: we, behavior: "smooth" });
3850
3872
  }, []);
3851
3873
  if (!e) return null;
3852
- const en = [
3874
+ const tn = [
3853
3875
  "ctr-bar",
3854
3876
  Je && "show"
3855
- ].filter(Boolean).join(" "), tn = z || le;
3877
+ ].filter(Boolean).join(" "), nn = z || le;
3856
3878
  return /* @__PURE__ */ x("div", { className: `ctr-bar-wrapper ${Je ? "show" : ""}`, children: [
3857
- /* @__PURE__ */ x("div", { ref: v, className: en, children: [
3879
+ /* @__PURE__ */ x("div", { ref: v, className: tn, children: [
3858
3880
  p && /* @__PURE__ */ x("div", { className: "cluster", children: [
3859
- /* @__PURE__ */ c(Qf, {}),
3860
- k && /* @__PURE__ */ c(Da, {}),
3861
- /* @__PURE__ */ c(Yf, {})
3881
+ /* @__PURE__ */ c(el, {}),
3882
+ k && /* @__PURE__ */ c(Ba, {}),
3883
+ /* @__PURE__ */ c(tl, {})
3862
3884
  ] }),
3863
- /* @__PURE__ */ c("div", { className: "cluster-seek", children: /* @__PURE__ */ c(rl, { durationMs: n, displayPlayheadMs: b }) }),
3885
+ /* @__PURE__ */ c("div", { className: "cluster-seek", children: /* @__PURE__ */ c(ol, { durationMs: n, displayPlayheadMs: b }) }),
3864
3886
  /* @__PURE__ */ x("div", { className: "cluster", children: [
3865
- /* @__PURE__ */ c(al, { videoRef: t }),
3887
+ /* @__PURE__ */ c(fl, { videoRef: t }),
3866
3888
  s.length > 1 && /* @__PURE__ */ x(pe, { children: [
3867
3889
  /* @__PURE__ */ c("div", { className: "w-px h-5 bg-white/20" }),
3868
3890
  " ",
3869
3891
  /* @__PURE__ */ c(
3870
- sl,
3892
+ ll,
3871
3893
  {
3872
3894
  tracks: s,
3873
3895
  selectedIndex: a,
3874
3896
  onSelect: i,
3875
- onMenuOpen: Yt
3897
+ onMenuOpen: Xt
3876
3898
  }
3877
3899
  )
3878
3900
  ] })
3879
3901
  ] }),
3880
3902
  f.length > 0 && /* @__PURE__ */ x("div", { className: "cluster", children: [
3881
3903
  /* @__PURE__ */ c(
3882
- il,
3904
+ cl,
3883
3905
  {
3884
3906
  tracks: f,
3885
3907
  selectedIndex: o,
3886
3908
  onSelect: l,
3887
3909
  enabled: d,
3888
3910
  onToggle: u,
3889
- onMenuOpen: Xt
3911
+ onMenuOpen: Zt
3890
3912
  }
3891
3913
  ),
3892
3914
  /* @__PURE__ */ c(
3893
- wl,
3915
+ Sl,
3894
3916
  {
3895
3917
  style: m,
3896
3918
  onStyleChange: y,
3897
3919
  enabled: d,
3898
- onMenuOpen: Pt
3920
+ onMenuOpen: Bt
3899
3921
  }
3900
3922
  )
3901
3923
  ] }),
@@ -3907,12 +3929,12 @@ function vl({
3907
3929
  onDrop: Q.onDrop,
3908
3930
  onDragOver: Q.onDragOver,
3909
3931
  children: [
3910
- /* @__PURE__ */ c(wa, { pending: Q.pending, uploading: Q.uploading, onRemove: Q.remove }),
3911
- P && /* @__PURE__ */ c(Xn, { anchor: Dt, width: 340, children: /* @__PURE__ */ c(
3932
+ /* @__PURE__ */ c(_a, { pending: Q.pending, uploading: Q.uploading, onRemove: Q.remove }),
3933
+ P && /* @__PURE__ */ c(Xn, { anchor: Pt, width: 340, children: /* @__PURE__ */ c(
3912
3934
  Qr,
3913
3935
  {
3914
3936
  open: !0,
3915
- toggle: Dt,
3937
+ toggle: Pt,
3916
3938
  onClose: () => te(!1),
3917
3939
  onPick: Q.addMeme,
3918
3940
  onUnavailable: () => {
@@ -3921,7 +3943,7 @@ function vl({
3921
3943
  }
3922
3944
  ) }),
3923
3945
  ge.open && /* @__PURE__ */ c(Xn, { anchor: $, width: 260, children: /* @__PURE__ */ c(
3924
- pa,
3946
+ ba,
3925
3947
  {
3926
3948
  matches: ge.matches,
3927
3949
  activeIndex: ge.activeIndex,
@@ -3941,7 +3963,7 @@ function vl({
3941
3963
  W(se), ge.trackCaret(U.target), Re.input(se), g?.();
3942
3964
  },
3943
3965
  onKeyDown: (U) => {
3944
- Zt(U);
3966
+ en(U);
3945
3967
  },
3946
3968
  onSelect: (U) => ge.trackCaret(U.currentTarget),
3947
3969
  role: "combobox",
@@ -3964,18 +3986,18 @@ function vl({
3964
3986
  title: "Add a meme",
3965
3987
  "data-testid": "meme-button-inline",
3966
3988
  className: `shrink-0 px-1 ${P ? "text-text" : "text-text-secondary"} hover:text-text`,
3967
- children: /* @__PURE__ */ c(Nt, { name: "image" })
3989
+ children: /* @__PURE__ */ c(Rt, { name: "image" })
3968
3990
  }
3969
3991
  )
3970
3992
  ]
3971
3993
  }
3972
3994
  ),
3973
3995
  /* @__PURE__ */ x("div", { className: "cluster cluster-tight", children: [
3974
- F && /* @__PURE__ */ c(Pa, { className: "ctr-btn" }),
3975
- /* @__PURE__ */ c(_l, { videoRef: t })
3996
+ F && /* @__PURE__ */ c(Oa, { className: "ctr-btn" }),
3997
+ /* @__PURE__ */ c(xl, { videoRef: t })
3976
3998
  ] })
3977
3999
  ] }),
3978
- tn && /* @__PURE__ */ x("div", { className: "ctr-scroll-group", children: [
4000
+ nn && /* @__PURE__ */ x("div", { className: "ctr-scroll-group", children: [
3979
4001
  /* @__PURE__ */ c(
3980
4002
  "button",
3981
4003
  {
@@ -3983,7 +4005,7 @@ function vl({
3983
4005
  onClick: () => vt("left"),
3984
4006
  tabIndex: -1,
3985
4007
  "aria-label": "Scroll left",
3986
- children: /* @__PURE__ */ c(da, {})
4008
+ children: /* @__PURE__ */ c(ua, {})
3987
4009
  }
3988
4010
  ),
3989
4011
  /* @__PURE__ */ c(
@@ -3993,42 +4015,42 @@ function vl({
3993
4015
  onClick: () => vt("right"),
3994
4016
  tabIndex: -1,
3995
4017
  "aria-label": "Scroll right",
3996
- children: /* @__PURE__ */ c(bo, {})
4018
+ children: /* @__PURE__ */ c(yo, {})
3997
4019
  }
3998
4020
  )
3999
4021
  ] })
4000
4022
  ] });
4001
4023
  }
4002
- const kl = 1e3;
4003
- function Sl(t) {
4004
- return t.hidden && t.roomPlaying && !t.seekInFlight && !t.ended && !t.localPause && t.sinceUserPauseMs >= kl;
4024
+ const Ml = 1e3;
4025
+ function Tl(t) {
4026
+ return t.hidden && t.roomPlaying && !t.seekInFlight && !t.ended && !t.localPause && t.sinceUserPauseMs >= Ml;
4005
4027
  }
4006
- function xl(t, e) {
4028
+ function Al(t, e) {
4007
4029
  return e.isLeader ? t === "play" && e.roomPlaying ? { kind: "resync" } : t === "pause" && !e.roomPlaying ? { kind: "none" } : { kind: "control", control: t } : t === "pause" ? { kind: "local-pause" } : e.roomPlaying ? { kind: "resync" } : { kind: "none" };
4008
4030
  }
4009
- const El = 1e3;
4010
- function Ml(t) {
4031
+ const Il = 1e3;
4032
+ function Cl(t) {
4011
4033
  if (!t.roomPlaying || t.seekInFlight) return { kind: "none" };
4012
4034
  const e = t.durationMs > 0 ? Math.min(t.roomMs, t.durationMs) : t.roomMs;
4013
4035
  return Math.abs(e - t.elementMs) > t.driftToleranceMs ? { kind: "seek", targetMs: Math.round(e) } : t.elementPaused ? { kind: "resume" } : { kind: "none" };
4014
4036
  }
4015
- function Tl(t, e, n) {
4037
+ function Nl(t, e, n) {
4016
4038
  return t.playheadMs + (t.playing ? Math.max(0, n - e) : 0);
4017
4039
  }
4018
- function ja(t) {
4019
- const e = di(t);
4040
+ function Ua(t) {
4041
+ const e = hi(t);
4020
4042
  if (e !== null) return e;
4021
4043
  const n = t.split("/").filter(Boolean);
4022
4044
  return n.length >= 2 ? n.slice(-2).join(" ") : n[n.length - 1] || t;
4023
4045
  }
4024
- function Al(t) {
4046
+ function Rl(t) {
4025
4047
  const e = t.split("/").filter(Boolean), n = [`${e.join("/")}/poster.jpg`];
4026
4048
  return e.length >= 2 && n.push(`${e.slice(0, -1).join("/")}/poster.jpg`), n;
4027
4049
  }
4028
- function Il({ mediaId: t, visible: e }) {
4029
- return t ? /* @__PURE__ */ c("div", { className: `media-title ${e ? "show" : ""}`, children: ja(t) }) : null;
4050
+ function Ll({ mediaId: t, visible: e }) {
4051
+ return t ? /* @__PURE__ */ c("div", { className: `media-title ${e ? "show" : ""}`, children: Ua(t) }) : null;
4030
4052
  }
4031
- const Cl = 300, Nl = 50, Rl = 100, Ll = 100, Fl = 100, $l = 100;
4053
+ const Fl = 300, $l = 50, Dl = 100, Pl = 100, Bl = 100, Ol = 100;
4032
4054
  function pn(t, e) {
4033
4055
  if (t.length === 0) return 0;
4034
4056
  const n = Math.min(Math.floor(e / 100 * t.length), t.length - 1);
@@ -4046,10 +4068,10 @@ function He(t) {
4046
4068
  max: Math.round(e[e.length - 1])
4047
4069
  };
4048
4070
  }
4049
- function Ue(t, e = Cl) {
4071
+ function Ue(t, e = Fl) {
4050
4072
  t.length > e && t.splice(0, t.length - e);
4051
4073
  }
4052
- class Dl {
4074
+ class jl {
4053
4075
  // Fetch
4054
4076
  _fetches = [];
4055
4077
  _fetchTimeoutCount = 0;
@@ -4107,11 +4129,11 @@ class Dl {
4107
4129
  }
4108
4130
  /** Called when waitForAppend times out. */
4109
4131
  recordAppendTimeout(e, n, r) {
4110
- this._appendTimeouts.push({ index: e, timeoutMs: n, queueDepth: r, ts: performance.now() }), Ue(this._appendTimeouts, Nl);
4132
+ this._appendTimeouts.push({ index: e, timeoutMs: n, queueDepth: r, ts: performance.now() }), Ue(this._appendTimeouts, $l);
4111
4133
  }
4112
4134
  /** Called when a seek completes (COMPLETED path in _execute). */
4113
4135
  recordSeekCompleted(e, n, r) {
4114
- this._seeks.push({ caller: e, targetMs: n, durationMs: r, ts: performance.now() }), Ue(this._seeks, Rl);
4136
+ this._seeks.push({ caller: e, targetMs: n, durationMs: r, ts: performance.now() }), Ue(this._seeks, Dl);
4115
4137
  }
4116
4138
  /** Called when waitForSeeked resolves via timeout rather than the 'seeked' event. */
4117
4139
  recordWaitForSeekedTimeout() {
@@ -4133,11 +4155,11 @@ class Dl {
4133
4155
  this._stallStart && (this._stalls.push({
4134
4156
  ...this._stallStart,
4135
4157
  durationMs: Math.round(performance.now() - this._stallStart.ts)
4136
- }), Ue(this._stalls, Ll), this._stallStart = null);
4158
+ }), Ue(this._stalls, Pl), this._stallStart = null);
4137
4159
  }
4138
4160
  /** Called from _doEvict with the reason tag passed by the caller. */
4139
4161
  recordEvict(e, n, r) {
4140
- this._evictCounts[e] = (this._evictCounts[e] ?? 0) + 1, this._evicts.push({ reason: e, start: n, end: r, ts: performance.now() }), Ue(this._evicts, Fl);
4162
+ this._evictCounts[e] = (this._evictCounts[e] ?? 0) + 1, this._evicts.push({ reason: e, start: n, end: r, ts: performance.now() }), Ue(this._evicts, Bl);
4141
4163
  }
4142
4164
  /** Called from FragmentManager.reconcileLoadedStates() when the browser's
4143
4165
  * own silent quota eviction is detected (fragments 'loaded' but gone from
@@ -4179,7 +4201,7 @@ class Dl {
4179
4201
  },
4180
4202
  audio: {
4181
4203
  driftMs: He(this._audioDrifts),
4182
- highDriftCount: this._audioDrifts.filter((l) => l > $l).length,
4204
+ highDriftCount: this._audioDrifts.filter((l) => l > Ol).length,
4183
4205
  samples: this._audioDrifts.slice(-20).map((l) => Math.round(l))
4184
4206
  },
4185
4207
  stalls: {
@@ -4228,9 +4250,9 @@ class Dl {
4228
4250
  this._fetches = [], this._fetchTimeoutCount = 0, this._fetchErrorCount = 0, this._appends = [], this._appendStarts.clear(), this._appendTimeouts = [], this._seeks = [], this._waitForSeekedTimeouts = 0, this._audioDrifts = [], this._stalls = [], this._stallStart = null, this._evictCounts = {}, this._evicts = [], this._browserEvictions = [];
4229
4251
  }
4230
4252
  }
4231
- const me = new Dl();
4253
+ const me = new jl();
4232
4254
  Dr("__WP_PERF__", me);
4233
- class Pl {
4255
+ class Hl {
4234
4256
  cache = /* @__PURE__ */ new Map();
4235
4257
  getOrCreate(e) {
4236
4258
  let n = this.cache.get(e);
@@ -4269,8 +4291,8 @@ class Pl {
4269
4291
  this.cache.clear();
4270
4292
  }
4271
4293
  }
4272
- const Te = new Pl(), yr = 60, Bl = 5e3;
4273
- class Ol {
4294
+ const Te = new Hl(), yr = 60, Ul = 5e3;
4295
+ class zl {
4274
4296
  constructor(e) {
4275
4297
  this.deps = e;
4276
4298
  }
@@ -4350,7 +4372,7 @@ class Ol {
4350
4372
  if (this.evictStartedAt === 0)
4351
4373
  return this.evictStartedAt = Date.now(), !0;
4352
4374
  const e = Date.now() - this.evictStartedAt;
4353
- return e < Bl ? !0 : (N("buffer", `EVICT-STUCK isEvicting held ${e}ms — clearing; a remove() updateend was lost, eviction was disabled`), me.recordEvict("stuck-recovered", 0, 0), this._isEvicting = !1, this.evictStartedAt = 0, !1);
4375
+ return e < Ul ? !0 : (N("buffer", `EVICT-STUCK isEvicting held ${e}ms — clearing; a remove() updateend was lost, eviction was disabled`), me.recordEvict("stuck-recovered", 0, 0), this._isEvicting = !1, this.evictStartedAt = 0, !1);
4354
4376
  }
4355
4377
  /** Called on dispose, on SourceBuffer error, and on media change
4356
4378
  * (FragmentManager.setIndex) — see the note at that call site. */
@@ -4516,13 +4538,13 @@ class We {
4516
4538
  * hold began. Lets processAppendQueue bound a hold that would otherwise
4517
4539
  * never end — see APPEND_HOLD_MAX_MS. */
4518
4540
  appendHold = null;
4519
- eviction = new Ol({
4541
+ eviction = new zl({
4520
4542
  getFragments: () => this.fragments,
4521
4543
  getSourceBuffer: () => this.sourceBuffer,
4522
4544
  getMediaSource: () => this.mediaSource,
4523
4545
  isDisposed: () => this.disposed,
4524
4546
  fragmentStates: this.fragmentStates,
4525
- getPendingSeekTargetMs: () => this.pendingSeekTargetMs !== null && Date.now() - this.pendingSeekSetAtMs > ll ? null : this.pendingSeekTargetMs
4547
+ getPendingSeekTargetMs: () => this.pendingSeekTargetMs !== null && Date.now() - this.pendingSeekSetAtMs > hl ? null : this.pendingSeekTargetMs
4526
4548
  });
4527
4549
  lastGapWarnMs = 0;
4528
4550
  stableGapSignature = null;
@@ -4548,7 +4570,7 @@ class We {
4548
4570
  // timing, and APPEND-HOLD reason counts. Read by emitInitDigest() which warns
4549
4571
  // once at gate-pass time so the load shape is visible in session logs without
4550
4572
  // wp:reportLogs=true.
4551
- static INIT_TRACK_FRAGS = Ls;
4573
+ static INIT_TRACK_FRAGS = $s;
4552
4574
  loadStartTs = 0;
4553
4575
  initFetchStart = 0;
4554
4576
  initFetchEnd = 0;
@@ -4626,8 +4648,8 @@ class We {
4626
4648
  * `fragment-route.realmedia.test.ts`; this is the client-side backstop.
4627
4649
  */
4628
4650
  async tryFragmentRoute(e, n, r) {
4629
- if (this.fragmentRouteDisabled || !this.delivery || !Fs()) return null;
4630
- const s = $s(this.delivery, e);
4651
+ if (this.fragmentRouteDisabled || !this.delivery || !Ds()) return null;
4652
+ const s = Ps(this.delivery, e);
4631
4653
  if (!s)
4632
4654
  return this.disableFragmentRoute(e, "could not build a URL for this config"), null;
4633
4655
  try {
@@ -4756,14 +4778,14 @@ class We {
4756
4778
  }
4757
4779
  this.initAppendDone = performance.now(), this.initState = "loaded", this.initRetryCount = 0, T("buffer", `INIT-LOADED sbRanges=[${Se(this.sourceBuffer?.buffered).join(", ")}]`), this.processAppendQueue();
4758
4780
  } catch (f) {
4759
- re("buffer", "Init segment fetch/append failed", { error: f.message }), i() || (this.initState = "pending", this.initRetryCount += 1, this.initRetryCount >= Ds ? (this.initFailed = !0, N("buffer", "INIT-GIVE-UP — init segment failed repeatedly; rejecting waiters for fast recovery", {
4781
+ re("buffer", "Init segment fetch/append failed", { error: f.message }), i() || (this.initState = "pending", this.initRetryCount += 1, this.initRetryCount >= Bs ? (this.initFailed = !0, N("buffer", "INIT-GIVE-UP — init segment failed repeatedly; rejecting waiters for fast recovery", {
4760
4782
  attempts: this.initRetryCount,
4761
4783
  error: f.message
4762
4784
  }), this.rejectAllWaiters(new Error("init segment failed after repeated retries"))) : this.disposed || setTimeout(() => {
4763
4785
  !this.disposed && this.initState === "pending" && this.fetchInit().catch((o) => {
4764
4786
  re("buffer", "INIT-RETRY failed", Z(o));
4765
4787
  });
4766
- }, Ps));
4788
+ }, Os));
4767
4789
  }
4768
4790
  }
4769
4791
  /** Runs inside updateend after an append completes. Decides whether MSE
@@ -4851,7 +4873,7 @@ class We {
4851
4873
  ]), r = [], s = this.currentPlayheadMs / 1e3;
4852
4874
  for (let f = 1; f < e.buffered.length; f++) {
4853
4875
  const o = e.buffered.end(f - 1), l = e.buffered.start(f);
4854
- l <= s || gl(o, l, this.fragments, n) || r.push(`${o.toFixed(2)}-${l.toFixed(2)}`);
4876
+ l <= s || yl(o, l, this.fragments, n) || r.push(`${o.toFixed(2)}-${l.toFixed(2)}`);
4855
4877
  }
4856
4878
  if (r.length === 0) {
4857
4879
  this.stableGapSignature = null, this.stableGapSince = 0;
@@ -5184,7 +5206,7 @@ class We {
5184
5206
  cfCacheStatus: h,
5185
5207
  expectedBytes: p
5186
5208
  }), this.fragmentStates.set(e, "pending"), o < ut) {
5187
- await new Promise((M) => setTimeout(M, At(o)));
5209
+ await new Promise((M) => setTimeout(M, It(o)));
5188
5210
  continue;
5189
5211
  }
5190
5212
  throw new Error(`fragment expected 206, got ${b.status}`);
@@ -5196,7 +5218,7 @@ class We {
5196
5218
  actualBytes: _.byteLength
5197
5219
  }), _.byteLength === 0 || _.byteLength !== p) {
5198
5220
  if (this.fragmentStates.set(e, "pending"), o < ut) {
5199
- await new Promise((M) => setTimeout(M, At(o)));
5221
+ await new Promise((M) => setTimeout(M, It(o)));
5200
5222
  continue;
5201
5223
  }
5202
5224
  re("buffer", `Fragment #${e} bad response after ${ut} retries`, { expected: p, actual: _.byteLength }), this.fragmentStates.set(e, "error"), this.errorTimestamps.set(e, Date.now()), this.fetchErrorCycles.set(e, (this.fetchErrorCycles.get(e) ?? 0) + 1), me.recordFetchError(e);
@@ -5220,7 +5242,7 @@ class We {
5220
5242
  } else
5221
5243
  N("buffer", `FETCH-ERR #${e} [${a}] attempt=${o} error=${l.message}`);
5222
5244
  if (this.isInInitPhase() && this.recordInitFragEvent(e, { err: (l.name === "TimeoutError" ? "timeout" : l.message?.slice(0, 40)) || "err" }), this.fragmentStates.set(e, "pending"), o < ut) {
5223
- await new Promise((u) => setTimeout(u, At(o)));
5245
+ await new Promise((u) => setTimeout(u, It(o)));
5224
5246
  continue;
5225
5247
  }
5226
5248
  throw re("buffer", `Fragment #${e} failed after ${ut} retries`, { error: l.message }), this.fragmentStates.set(e, "error"), this.errorTimestamps.set(e, Date.now()), this.fetchErrorCycles.set(e, (this.fetchErrorCycles.get(e) ?? 0) + 1), me.recordFetchError(e), l;
@@ -5290,7 +5312,7 @@ class We {
5290
5312
  if (this.appendHold?.index !== e)
5291
5313
  return this.appendHold = { index: e, since: r }, !1;
5292
5314
  const s = r - this.appendHold.since;
5293
- if (s < Bs) return !1;
5315
+ if (s < js) return !1;
5294
5316
  N("buffer", `APPEND-HOLD-BREAK #${e} held ${s}ms behind ${n.length} pending fetch(es) — declaring them dead so the queue can drain`, {
5295
5317
  headIndex: e,
5296
5318
  heldMs: s,
@@ -5354,7 +5376,7 @@ class We {
5354
5376
  if (this.disposed || !this.sourceBuffer || (this.currentPlayheadMs = e, this.currentJobs.size >= lt)) return;
5355
5377
  const n = Pe(this.fragments, e), r = Math.min(this.fragments.length - 1, Pe(this.fragments, e + pt)), s = Date.now();
5356
5378
  for (let i = n; i <= r; i++)
5357
- this.fragmentStates.get(i) === "error" && s - (this.errorTimestamps.get(i) ?? 0) >= Os && ((this.fetchErrorCycles.get(i) ?? 0) >= Gn ? T("buffer", `PREFETCH-DEAD #${i} cycles=${this.fetchErrorCycles.get(i)} not resetting`) : (this.fragmentStates.set(i, "pending"), this.errorTimestamps.delete(i)));
5379
+ this.fragmentStates.get(i) === "error" && s - (this.errorTimestamps.get(i) ?? 0) >= Hs && ((this.fetchErrorCycles.get(i) ?? 0) >= Gn ? T("buffer", `PREFETCH-DEAD #${i} cycles=${this.fetchErrorCycles.get(i)} not resetting`) : (this.fragmentStates.set(i, "pending"), this.errorTimestamps.delete(i)));
5358
5380
  let a = 0;
5359
5381
  for (let i = n; i <= r && a < lt - this.currentJobs.size; i++) {
5360
5382
  const f = this.fragmentStates.get(i);
@@ -5385,7 +5407,7 @@ class We {
5385
5407
  /** Public eviction entry point used by MediaPlayer / prefetch. Delegates
5386
5408
  * to the strategy which owns the isEvicting state + range choice logic. */
5387
5409
  evictBefore(e) {
5388
- this.pendingSeekTargetMs !== null && Math.abs(e - this.pendingSeekTargetMs) <= cl && (this.pendingSeekTargetMs = null), this.eviction.evictBefore(e);
5410
+ this.pendingSeekTargetMs !== null && Math.abs(e - this.pendingSeekTargetMs) <= gl && (this.pendingSeekTargetMs = null), this.eviction.evictBefore(e);
5389
5411
  }
5390
5412
  // Public entry point for socket reconnect scenarios. Clears stale in-flight
5391
5413
  // fetches and their pendingFetchIndices entries so the queue is unblocked on
@@ -5533,7 +5555,7 @@ class We {
5533
5555
  return { ranges: e, gaps: e.length > 1, fragmentStates: n };
5534
5556
  }
5535
5557
  getAverageDownloadRate() {
5536
- return dl(this.downloadSamples);
5558
+ return ml(this.downloadSamples);
5537
5559
  }
5538
5560
  /** Nominal media end time (ms) = last fragment's end. 0 if no index loaded.
5539
5561
  * Reported in health so the leader's status card can tell "near end-of-stream,
@@ -5607,7 +5629,7 @@ class We {
5607
5629
  if (this.eosRetryTimer) return;
5608
5630
  this.eosRetryTimer = setTimeout(() => {
5609
5631
  this.eosRetryTimer = null, this.tryEndOfStream();
5610
- }, js);
5632
+ }, Us);
5611
5633
  return;
5612
5634
  }
5613
5635
  try {
@@ -5651,28 +5673,28 @@ class We {
5651
5673
  this.disposed = !0, this.mediaSource && gt.get(this.mediaSource)?.delete(this), this.eosRetryTimer && (clearTimeout(this.eosRetryTimer), this.eosRetryTimer = null), this.pendingEndOfStream = !1, this.endOfStreamEligible = !1, this.abortAllJobs("dispose"), this.rejectAllWaiters(new Error("FragmentManager disposed")), this.appendQueue = [], this.isAppending = !1, this.eviction.reset(), this.appendingIndex = null, this.fragmentStates.clear(), this.errorTimestamps.clear(), this.discardCounts.clear(), this.fetchErrorCycles.clear(), this.downloadSamples = [], this.preAppendRanges = [], this.sourceBuffer = null, this.mediaSource = null, this.initState = "pending", this.initRange = null;
5652
5674
  }
5653
5675
  }
5654
- function jl(t, e) {
5676
+ function Wl(t, e) {
5655
5677
  return !!t && t !== "eng" && e;
5656
5678
  }
5657
- function Hl(t) {
5658
- return t.override !== null ? t.override : t.globalEnabled || jl(t.selectedAudioLang, t.hasEngSub);
5679
+ function Gl(t) {
5680
+ return t.override !== null ? t.override : t.globalEnabled || Wl(t.selectedAudioLang, t.hasEngSub);
5659
5681
  }
5660
- const Ha = "wp_reload_history", Bn = "wp_phantom_reload", Ua = 5 * 6e4, wr = 3;
5661
- function Ul() {
5682
+ const za = "wp_reload_history", Bn = "wp_phantom_reload", Wa = 5 * 6e4, wr = 3;
5683
+ function ql() {
5662
5684
  try {
5663
- const t = sessionStorage.getItem(Ha);
5664
- return (t ? JSON.parse(t) : []).filter((n) => Date.now() - n < Ua);
5685
+ const t = sessionStorage.getItem(za);
5686
+ return (t ? JSON.parse(t) : []).filter((n) => Date.now() - n < Wa);
5665
5687
  } catch {
5666
5688
  return [];
5667
5689
  }
5668
5690
  }
5669
5691
  function An(t, e) {
5670
- const n = Ul();
5692
+ const n = ql();
5671
5693
  if (n.length >= wr) {
5672
5694
  qn(
5673
5695
  "error",
5674
5696
  "buffer",
5675
- `AUTO-RELOAD SUPPRESSED reason=${t} — ${n.length} reloads in ${Ua / 6e4}m, giving up (connection looks unstable)`,
5697
+ `AUTO-RELOAD SUPPRESSED reason=${t} — ${n.length} reloads in ${Wa / 6e4}m, giving up (connection looks unstable)`,
5676
5698
  e
5677
5699
  );
5678
5700
  try {
@@ -5685,7 +5707,7 @@ function An(t, e) {
5685
5707
  return !1;
5686
5708
  }
5687
5709
  try {
5688
- n.push(Date.now()), sessionStorage.setItem(Ha, JSON.stringify(n)), sessionStorage.setItem(Bn, String(Date.now()));
5710
+ n.push(Date.now()), sessionStorage.setItem(za, JSON.stringify(n)), sessionStorage.setItem(Bn, String(Date.now()));
5689
5711
  } catch {
5690
5712
  }
5691
5713
  qn("error", "buffer", `AUTO-RELOAD reason=${t} attempt=${n.length}/${wr}`, e);
@@ -5703,13 +5725,13 @@ function _r() {
5703
5725
  return null;
5704
5726
  }
5705
5727
  }
5706
- function zl() {
5728
+ function Kl() {
5707
5729
  try {
5708
5730
  sessionStorage.removeItem(Bn);
5709
5731
  } catch {
5710
5732
  }
5711
5733
  }
5712
- function Wl() {
5734
+ function Vl() {
5713
5735
  const t = navigator;
5714
5736
  try {
5715
5737
  return typeof t.getAutoplayPolicy == "function" ? t.getAutoplayPolicy("mediaelement") : void 0;
@@ -5717,11 +5739,11 @@ function Wl() {
5717
5739
  return;
5718
5740
  }
5719
5741
  }
5720
- function Gl(t, e) {
5742
+ function Jl(t, e) {
5721
5743
  return t === "disallowed" ? "deferred" : e ? "user-muted" : t === "allowed-muted" ? "muted-bridge" : "audible";
5722
5744
  }
5723
- function za(t, e) {
5724
- const n = Wl(), r = Gl(n, e.userWantsMuted);
5745
+ function Ga(t, e) {
5746
+ const n = Vl(), r = Jl(n, e.userWantsMuted);
5725
5747
  T(e.label, "autoplay plan", { policy: n ?? "unknown", plan: r, userWantsMuted: e.userWantsMuted });
5726
5748
  const s = () => {
5727
5749
  t.muted = !0, t.play().then(() => {
@@ -5736,13 +5758,13 @@ function za(t, e) {
5736
5758
  a?.name === "NotAllowedError" && !e.userWantsMuted ? s() : a?.name !== "AbortError" && N(e.label, "video.play() failed", { error: a?.name, message: a?.message });
5737
5759
  }), r);
5738
5760
  }
5739
- const Lt = {
5761
+ const Ft = {
5740
5762
  /** Viewer join-time correction — can be preempted by any sync seek. */
5741
5763
  VIEWER_CORRECTION: 2,
5742
5764
  /** Room-level seeks from snapshot changes — highest priority. */
5743
5765
  SEEK_EFFECT: 3
5744
5766
  };
5745
- function Wa(t, e = 3e3) {
5767
+ function qa(t, e = 3e3) {
5746
5768
  return new Promise((n) => {
5747
5769
  if (!t.seeking) {
5748
5770
  n();
@@ -5761,7 +5783,7 @@ function Wa(t, e = 3e3) {
5761
5783
  t.addEventListener("seeked", s, { once: !0 });
5762
5784
  });
5763
5785
  }
5764
- class ql {
5786
+ class Ql {
5765
5787
  // ── State ──
5766
5788
  _seekInFlight = !1;
5767
5789
  /** Route taken by the in-flight seek (buffered/loading/nearby-pending/far) —
@@ -5840,7 +5862,7 @@ class ql {
5840
5862
  } else
5841
5863
  T("seek-coord", `ALREADY BUFFERED [${s}] target=${Math.round(r)}ms`);
5842
5864
  const m = r / 1e3;
5843
- i.currentTime = m, await Wa(i), this._checkAborted(n);
5865
+ i.currentTime = m, await qa(i), this._checkAborted(n);
5844
5866
  const y = i.currentTime * 1e3, b = Math.round(performance.now() - o);
5845
5867
  N("seek-coord", `SEEK-DIGEST [${s}] route=${this._lastSeekRoute} ${b}ms`, {
5846
5868
  targetMs: Math.round(r),
@@ -5944,7 +5966,7 @@ class ql {
5944
5966
  }
5945
5967
  _resume(e) {
5946
5968
  const n = S.getState();
5947
- za(e, {
5969
+ Ga(e, {
5948
5970
  userWantsMuted: n.mediaPrefs.muted,
5949
5971
  onMutedBridge: () => S.getState().setMutedForAutoplay(!0),
5950
5972
  onUnmuted: () => S.getState().setMutedForAutoplay(!1),
@@ -5952,12 +5974,12 @@ class ql {
5952
5974
  });
5953
5975
  }
5954
5976
  }
5955
- let It = null;
5956
- function Kl() {
5957
- It === null && (T("health", "Starting health reporting"), vr(), It = window.setInterval(vr, Hs));
5977
+ let Ct = null;
5978
+ function Yl() {
5979
+ Ct === null && (T("health", "Starting health reporting"), vr(), Ct = window.setInterval(vr, zs));
5958
5980
  }
5959
- function Vl() {
5960
- It !== null && (T("health", "Stopping health reporting"), window.clearInterval(It), It = null);
5981
+ function Xl() {
5982
+ Ct !== null && (T("health", "Stopping health reporting"), window.clearInterval(Ct), Ct = null);
5961
5983
  }
5962
5984
  function vr() {
5963
5985
  const t = Or();
@@ -5990,13 +6012,13 @@ function vr() {
5990
6012
  fragments_error: a.fragmentStates.error || 0,
5991
6013
  video_ready_state: r?.readyState ?? -1,
5992
6014
  duration_ms: n.getMediaEndMs(),
5993
- delivery_arm: zs(),
5994
- ...Jl(r),
5995
- pong_age_ms: Us(),
6015
+ delivery_arm: Gs(),
6016
+ ...Zl(r),
6017
+ pong_age_ms: Ws(),
5996
6018
  reported_at: Date.now()
5997
6019
  });
5998
6020
  }
5999
- function Jl(t) {
6021
+ function Zl(t) {
6000
6022
  const e = typeof navigator > "u" ? void 0 : navigator, n = e?.connection;
6001
6023
  return {
6002
6024
  page_visible: typeof document.visibilityState == "string" ? document.visibilityState === "visible" : void 0,
@@ -6008,8 +6030,8 @@ function Jl(t) {
6008
6030
  net_downlink_mbps: typeof n?.downlink == "number" && n.downlink >= 0 ? n.downlink : void 0
6009
6031
  };
6010
6032
  }
6011
- const Ql = 3e3;
6012
- function Yl() {
6033
+ const ec = 3e3;
6034
+ function tc() {
6013
6035
  const [t, e] = L(!1), n = D(null), r = D(!1), s = () => {
6014
6036
  n.current && (clearTimeout(n.current), n.current = null);
6015
6037
  }, a = j((o = 3e3) => {
@@ -6019,7 +6041,7 @@ function Yl() {
6019
6041
  }, []), i = j(() => {
6020
6042
  r.current || (s(), e(!1));
6021
6043
  }, []), f = j((o) => {
6022
- r.current !== o && (r.current = o, o ? (s(), e(!0)) : a(Ql));
6044
+ r.current !== o && (r.current = o, o ? (s(), e(!0)) : a(ec));
6023
6045
  }, [a]);
6024
6046
  return R(() => {
6025
6047
  const o = () => {
@@ -6030,23 +6052,23 @@ function Yl() {
6030
6052
  };
6031
6053
  }, [a]), { controlsVisible: t, showControls: a, hideControls: i, setControlsHeld: f };
6032
6054
  }
6033
- const Ga = [], qa = [], Xl = {
6034
- fragments: Ga,
6055
+ const Ka = [], Va = [], nc = {
6056
+ fragments: Ka,
6035
6057
  durationMs: null,
6036
6058
  mseCodec: null,
6037
6059
  initSegment: void 0,
6038
- audioTracks: qa,
6060
+ audioTracks: Va,
6039
6061
  contentToken: null
6040
6062
  };
6041
- function Zl(t, e) {
6042
- if (!t || t.url !== e) return Xl;
6063
+ function rc(t, e) {
6064
+ if (!t || t.url !== e) return nc;
6043
6065
  const n = t.data;
6044
6066
  return {
6045
- fragments: n.fragments || Ga,
6067
+ fragments: n.fragments || Ka,
6046
6068
  durationMs: n.duration_ms || null,
6047
6069
  mseCodec: n.mse_codec || null,
6048
6070
  initSegment: n.init_segment || void 0,
6049
- audioTracks: n.audio_tracks || qa,
6071
+ audioTracks: n.audio_tracks || Va,
6050
6072
  contentToken: n.content_token || null
6051
6073
  };
6052
6074
  }
@@ -6068,7 +6090,7 @@ function kr(t) {
6068
6090
  return null;
6069
6091
  }
6070
6092
  }
6071
- function ec(t) {
6093
+ function ac(t) {
6072
6094
  const [e, n] = L(null);
6073
6095
  return R(() => {
6074
6096
  const r = new AbortController();
@@ -6113,7 +6135,7 @@ function ec(t) {
6113
6135
  elapsedMs: l,
6114
6136
  ...d && { timing: d }
6115
6137
  });
6116
- const u = a <= 1 ? 0 : At(a - 1, { baseMs: 500, capMs: i, jitter: 0 });
6138
+ const u = a <= 1 ? 0 : It(a - 1, { baseMs: 500, capMs: i, jitter: 0 });
6117
6139
  u > 0 && await new Promise((m) => setTimeout(m, u));
6118
6140
  }
6119
6141
  }
@@ -6121,7 +6143,7 @@ function ec(t) {
6121
6143
  return s(), () => {
6122
6144
  r.abort();
6123
6145
  };
6124
- }, [t]), ye(() => Zl(e, t), [e, t]);
6146
+ }, [t]), ye(() => rc(e, t), [e, t]);
6125
6147
  }
6126
6148
  const bn = {
6127
6149
  audioTracks: [],
@@ -6129,10 +6151,10 @@ const bn = {
6129
6151
  selectedAudioIndex: 0,
6130
6152
  selectedSubtitleIndex: 0
6131
6153
  };
6132
- function tc(t) {
6133
- const [e, n] = L(bn), r = Ws(), s = S((d) => d.mediaPrefs.preferredAudioLang), [a, i] = L(t);
6154
+ function sc(t) {
6155
+ const [e, n] = L(bn), r = qs(), s = S((d) => d.mediaPrefs.preferredAudioLang), [a, i] = L(t);
6134
6156
  a !== t && (i(t), t && n(bn));
6135
- const f = ke(() => ({ origin: Gs(r), preferredAudioLang: s }));
6157
+ const f = ke(() => ({ origin: Ks(r), preferredAudioLang: s }));
6136
6158
  R(() => {
6137
6159
  if (!t) return;
6138
6160
  const d = new AbortController(), { origin: u, preferredAudioLang: m } = f();
@@ -6165,12 +6187,12 @@ function tc(t) {
6165
6187
  setSelectedSubtitleIndex: l
6166
6188
  };
6167
6189
  }
6168
- const nc = 100;
6169
- function rc(t) {
6170
- return !t.roomPlaying || t.videoPaused ? "not-playing" : t.seekInFlight ? "seeking" : t.advancedMs > nc ? "advancing" : "stalled";
6190
+ const ic = 100;
6191
+ function oc(t) {
6192
+ return !t.roomPlaying || t.videoPaused ? "not-playing" : t.seekInFlight ? "seeking" : t.advancedMs > ic ? "advancing" : "stalled";
6171
6193
  }
6172
- const yn = 4e4, ac = 3e3;
6173
- function sc(t, e, n, r, s, a) {
6194
+ const yn = 4e4, fc = 3e3;
6195
+ function lc(t, e, n, r, s, a) {
6174
6196
  const i = ke((p) => {
6175
6197
  const _ = {};
6176
6198
  return (a?.current ?? []).forEach((M, w) => {
@@ -6195,13 +6217,13 @@ function sc(t, e, n, r, s, a) {
6195
6217
  function I() {
6196
6218
  _();
6197
6219
  const v = t.current;
6198
- v && (g.current = v.currentTime, b.current = setTimeout(M, ac));
6220
+ v && (g.current = v.currentTime, b.current = setTimeout(M, fc));
6199
6221
  }
6200
6222
  function M() {
6201
6223
  b.current = null;
6202
6224
  const v = t.current;
6203
6225
  if (!v) return;
6204
- const C = S.getState(), $ = n.current, B = rc({
6226
+ const C = S.getState(), $ = n.current, B = oc({
6205
6227
  roomPlaying: C.snapshot.playing,
6206
6228
  videoPaused: v.paused,
6207
6229
  seekInFlight: !!$?.seekInFlight,
@@ -6234,7 +6256,7 @@ function sc(t, e, n, r, s, a) {
6234
6256
  gapSkipTarget: Math.round(V)
6235
6257
  }), $.submit({
6236
6258
  targetMs: V,
6237
- priority: Lt.VIEWER_CORRECTION,
6259
+ priority: Ft.VIEWER_CORRECTION,
6238
6260
  caller: "silent-stall-gap-skip",
6239
6261
  pauseSeekResume: !1
6240
6262
  }).catch((X) => re("sync", "SILENT-STALL gap-skip seek threw", Z(X)))) : z.fetchNearby(O).catch((X) => {
@@ -6288,7 +6310,7 @@ function sc(t, e, n, r, s, a) {
6288
6310
  gapSkipTarget: Math.round(X)
6289
6311
  }), K.submit({
6290
6312
  targetMs: X,
6291
- priority: Lt.VIEWER_CORRECTION,
6313
+ priority: Ft.VIEWER_CORRECTION,
6292
6314
  caller: "gap-skip",
6293
6315
  pauseSeekResume: !1
6294
6316
  }).catch((W) => re("sync", "GAP-SKIP seek threw", Z(W)));
@@ -6361,8 +6383,8 @@ function sc(t, e, n, r, s, a) {
6361
6383
  };
6362
6384
  }, [r, t, e, n]);
6363
6385
  }
6364
- const ic = 1.5;
6365
- function oc(t, e, n, r, s, a) {
6386
+ const cc = 1.5;
6387
+ function dc(t, e, n, r, s, a) {
6366
6388
  const i = D(null), f = D(null), o = j(() => {
6367
6389
  i.current && (clearInterval(i.current), i.current = null), f.current?.(), f.current = null;
6368
6390
  }, []);
@@ -6391,7 +6413,7 @@ function oc(t, e, n, r, s, a) {
6391
6413
  };
6392
6414
  i.current = setInterval(y, Vn);
6393
6415
  const b = () => {
6394
- performance.now() - m >= Vn * ic && y();
6416
+ performance.now() - m >= Vn * cc && y();
6395
6417
  };
6396
6418
  if (l && (l.addEventListener("timeupdate", b), f.current = () => l.removeEventListener("timeupdate", b)), l && !n.current?.seekInFlight) {
6397
6419
  m = performance.now();
@@ -6401,20 +6423,20 @@ function oc(t, e, n, r, s, a) {
6401
6423
  return o;
6402
6424
  }, [r, s, t, e, n, a, o]), { stopPrefetch: o };
6403
6425
  }
6404
- function fc(t, e, n, r, s, a) {
6426
+ function uc(t, e, n, r, s, a) {
6405
6427
  const i = S((u) => u.snapshot), f = S((u) => u.loadGeneration), o = D(f), l = ke((u) => s(u)), d = ke((u) => a(u));
6406
6428
  R(() => {
6407
6429
  const u = t.current;
6408
6430
  if (!u || !r) return;
6409
6431
  const m = i.playheadMs, y = n.current, b = f !== o.current;
6410
- o.current = f, !(!b && Math.abs(m - y) <= qs) && (T("buffer", "Seek triggered", {
6432
+ o.current = f, !(!b && Math.abs(m - y) <= Vs) && (T("buffer", "Seek triggered", {
6411
6433
  targetMs: m,
6412
6434
  lastApplied: y,
6413
6435
  delta: Math.round(m - y),
6414
6436
  genChanged: b
6415
6437
  }), n.current = m, u.submit({
6416
6438
  targetMs: m,
6417
- priority: Lt.SEEK_EFFECT,
6439
+ priority: Ft.SEEK_EFFECT,
6418
6440
  caller: "seek-effect",
6419
6441
  pauseSeekResume: !0
6420
6442
  }).catch((g) => re("buffer", "Seek effect submit threw", Z(g))));
@@ -6433,7 +6455,7 @@ function Sr(t, e) {
6433
6455
  }, { once: !0 });
6434
6456
  });
6435
6457
  }
6436
- function lc(t) {
6458
+ function hc(t) {
6437
6459
  const e = S((i) => i.playlist), n = S((i) => i.activePlaylistIndex), r = S((i) => i.snapshot.mediaId), s = e?.id, a = ke(() => e);
6438
6460
  R(() => {
6439
6461
  const i = a();
@@ -6532,11 +6554,11 @@ function lc(t) {
6532
6554
  }, [s, n, r, t]);
6533
6555
  }
6534
6556
  const De = "bg-play";
6535
- function cc() {
6557
+ function gc() {
6536
6558
  const t = S.getState();
6537
6559
  return !!t.snapshot.leaderId && t.snapshot.leaderId === t.me.clientId;
6538
6560
  }
6539
- function dc(t) {
6561
+ function mc(t) {
6540
6562
  return typeof Image > "u" ? Promise.resolve(null) : t.reduce(
6541
6563
  (e, n) => e.then((r) => r ?? new Promise((s) => {
6542
6564
  const a = new Image();
@@ -6545,31 +6567,31 @@ function dc(t) {
6545
6567
  Promise.resolve(null)
6546
6568
  );
6547
6569
  }
6548
- function uc(t, e, n, r, s, a) {
6570
+ function pc(t, e, n, r, s, a) {
6549
6571
  const i = D(!1), f = D(0), o = ke((d) => a(d)), l = ke((d) => {
6550
6572
  const u = t.current, m = e.current;
6551
6573
  if (!u || !s) return;
6552
- const y = S.getState(), b = u.currentTime * 1e3, g = Tl(y.snapshot, y.snapshotReceivedAt, Date.now()), h = Ml({
6574
+ const y = S.getState(), b = u.currentTime * 1e3, g = Nl(y.snapshot, y.snapshotReceivedAt, Date.now()), h = Cl({
6553
6575
  roomPlaying: y.snapshot.playing,
6554
6576
  seekInFlight: !!m?.seekInFlight,
6555
6577
  elementPaused: u.paused,
6556
6578
  elementMs: b,
6557
6579
  roomMs: g,
6558
6580
  durationMs: r,
6559
- driftToleranceMs: El
6581
+ driftToleranceMs: Il
6560
6582
  }), p = Math.round(g - b);
6561
6583
  if (h.kind === "none") {
6562
6584
  T(De, "resync not needed", { reason: d, driftMs: p });
6563
6585
  return;
6564
6586
  }
6565
- h.kind === "seek" ? N(De, "BG-RESYNC seek", { reason: d, driftMs: p, elementMs: Math.round(b) }) : T(De, "resync", { reason: d, plan: h.kind, driftMs: p }), h.kind === "resume" ? a(u) : m && m.submit({ targetMs: h.targetMs, priority: Lt.SEEK_EFFECT, caller: `bg-resync:${d}` });
6587
+ h.kind === "seek" ? N(De, "BG-RESYNC seek", { reason: d, driftMs: p, elementMs: Math.round(b) }) : T(De, "resync", { reason: d, plan: h.kind, driftMs: p }), h.kind === "resume" ? a(u) : m && m.submit({ targetMs: h.targetMs, priority: Ft.SEEK_EFFECT, caller: `bg-resync:${d}` });
6566
6588
  });
6567
6589
  R(() => {
6568
6590
  const d = t.current;
6569
6591
  if (!d || !s) return;
6570
6592
  const u = () => {
6571
6593
  const y = S.getState();
6572
- Sl({
6594
+ Tl({
6573
6595
  hidden: document.visibilityState === "hidden",
6574
6596
  roomPlaying: y.snapshot.playing,
6575
6597
  seekInFlight: !!e.current?.seekInFlight,
@@ -6588,16 +6610,16 @@ function uc(t, e, n, r, s, a) {
6588
6610
  if (!d || typeof navigator > "u" || !("mediaSession" in navigator)) return;
6589
6611
  const u = navigator.mediaSession;
6590
6612
  let m = !1;
6591
- const y = ja(n), b = (M) => {
6613
+ const y = Ua(n), b = (M) => {
6592
6614
  m || typeof MediaMetadata > "u" || (u.metadata = new MediaMetadata({
6593
6615
  title: y,
6594
6616
  artist: "Watch Party",
6595
6617
  artwork: M ? [{ src: M }] : []
6596
6618
  }));
6597
6619
  };
6598
- b(null), dc(Al(n).map(Ks)).then(b);
6620
+ b(null), mc(Rl(n).map(Js)).then(b);
6599
6621
  const g = (M) => () => {
6600
- const w = S.getState(), k = xl(M, { isLeader: cc(), roomPlaying: w.snapshot.playing });
6622
+ const w = S.getState(), k = Al(M, { isLeader: gc(), roomPlaying: w.snapshot.playing });
6601
6623
  switch (T(De, "media session press", { action: M, result: k.kind }), M === "pause" && (f.current = Date.now()), k.kind) {
6602
6624
  case "control":
6603
6625
  Oe(k.control), k.control === "pause" && d.pause();
@@ -6671,11 +6693,11 @@ function uc(t, e, n, r, s, a) {
6671
6693
  }, [t]);
6672
6694
  }
6673
6695
  const Mt = 5e3, xr = ".ctr-bar-wrapper";
6674
- function hc(t, e, n, r) {
6696
+ function bc(t, e, n, r) {
6675
6697
  const s = ke((i) => {
6676
6698
  const f = t.current;
6677
6699
  if (!f) return;
6678
- const o = f.querySelector(xr), l = document.activeElement, d = Kr(l) ? "text" : o && l && o.contains(l) ? "bar" : !l || l === document.body || l === f ? "idle" : "elsewhere", u = Mi({
6700
+ const o = f.querySelector(xr), l = document.activeElement, d = Kr(l) ? "text" : o && l && o.contains(l) ? "bar" : !l || l === document.body || l === f ? "idle" : "elsewhere", u = Ai({
6679
6701
  key: i.key,
6680
6702
  back: qe(i),
6681
6703
  modifier: i.ctrlKey || i.metaKey || i.altKey,
@@ -6726,19 +6748,19 @@ function hc(t, e, n, r) {
6726
6748
  }, [t]);
6727
6749
  }
6728
6750
  function Er(t, e, n) {
6729
- const r = n instanceof HTMLInputElement && n.type !== "range" ? n : null, s = r ? { atStart: (r.selectionEnd ?? 0) === 0, atEnd: (r.selectionStart ?? 0) === r.value.length } : void 0, a = r?.getAttribute("aria-expanded") === "true", i = Ti(t.key, Wr(n), n.hasAttribute(mt), s, a);
6751
+ const r = n instanceof HTMLInputElement && n.type !== "range" ? n : null, s = r ? { atStart: (r.selectionEnd ?? 0) === 0, atEnd: (r.selectionStart ?? 0) === r.value.length } : void 0, a = r?.getAttribute("aria-expanded") === "true", i = Ii(t.key, Wr(n), n.hasAttribute(mt), s, a);
6730
6752
  if (i === null) return;
6731
6753
  t.preventDefault();
6732
6754
  const f = Gr(e), o = f.indexOf(n);
6733
6755
  f[Math.min(f.length - 1, Math.max(0, o + i))]?.focus({ preventScroll: !1 });
6734
6756
  }
6735
- const gc = 3e5, mc = 1, pc = 1;
6757
+ const yc = 3e5, wc = 1, _c = 1;
6736
6758
  function wn(t) {
6737
6759
  re("buffer", "initializePlayback threw", Z(t));
6738
6760
  }
6739
- function bc({ mediaUrl: t, indexUrl: e, mediaId: n }) {
6740
- const r = D(null), s = D(null), [a, i] = L(!1), [f, o] = L(!1), { controlsVisible: l, showControls: d, hideControls: u, setControlsHeld: m } = Yl();
6741
- hc(s, l, d, u), R(() => {
6761
+ function vc({ mediaUrl: t, indexUrl: e, mediaId: n }) {
6762
+ const r = D(null), s = D(null), [a, i] = L(!1), [f, o] = L(!1), { controlsVisible: l, showControls: d, hideControls: u, setControlsHeld: m } = tc();
6763
+ bc(s, l, d, u), R(() => {
6742
6764
  const A = () => o(!!document.fullscreenElement);
6743
6765
  return document.addEventListener("fullscreenchange", A), () => document.removeEventListener("fullscreenchange", A);
6744
6766
  }, []);
@@ -6749,11 +6771,11 @@ function bc({ mediaUrl: t, indexUrl: e, mediaId: n }) {
6749
6771
  initSegment: h,
6750
6772
  audioTracks: p,
6751
6773
  contentToken: _
6752
- } = ec(e), I = j((A) => {
6774
+ } = ac(e), I = j((A) => {
6753
6775
  if (!_) return null;
6754
- const H = t.replace(new RegExp(`/${Ot.replace(/\./g, "\\.")}$`), "");
6776
+ const H = t.replace(new RegExp(`/${jt.replace(/\./g, "\\.")}$`), "");
6755
6777
  return H === t ? null : { baseUrl: H, token: _, trackId: A };
6756
- }, [_, t]), w = g !== null && p.length > 0, k = S((A) => A.readiness), F = Vs(), E = st();
6778
+ }, [_, t]), w = g !== null && p.length > 0, k = S((A) => A.readiness), F = Qs(), E = st();
6757
6779
  R(() => {
6758
6780
  const A = s.current;
6759
6781
  if (!A) return;
@@ -6762,24 +6784,24 @@ function bc({ mediaUrl: t, indexUrl: e, mediaId: n }) {
6762
6784
  const ce = A.querySelector(".ctr-bar-wrapper"), q = ce?.querySelector("[data-remote-primary]"), de = F && ce && !q?.disabled ? qr(ce) : null;
6763
6785
  de ? (d(Mt), de.focus({ preventScroll: !0 })) : H !== A && A.focus({ preventScroll: !0 });
6764
6786
  }, [F, k.ready, E, d]);
6765
- const v = D(!1), C = D(!1), $ = D(null), B = D(null), O = D(null), z = D(0), K = D(0), le = D(null), [V, X] = L(0), W = D([]), he = D([]), ee = D(-1), Q = D(!1), P = D(null), te = D(0), Ae = D(null), Ke = D(0), Dt = S((A) => A.bufferState), _t = S((A) => A.setBufferState), {
6787
+ const v = D(!1), C = D(!1), $ = D(null), B = D(null), O = D(null), z = D(0), K = D(0), le = D(null), [V, X] = L(0), W = D([]), he = D([]), ee = D(-1), Q = D(!1), P = D(null), te = D(0), Ae = D(null), Ke = D(0), Pt = S((A) => A.bufferState), _t = S((A) => A.setBufferState), {
6766
6788
  audioTracks: Re,
6767
6789
  subtitleTracks: ge,
6768
6790
  selectedAudioIndex: Ee,
6769
6791
  setSelectedAudioIndex: it,
6770
6792
  selectedSubtitleIndex: ot,
6771
6793
  setSelectedSubtitleIndex: Ve
6772
- } = tc(n), Me = S((A) => A.mediaPrefs), Yt = S((A) => A.mutedForAutoplay), Xt = S((A) => A.setMutedForAutoplay), Pt = S((A) => A.setSubtitlesEnabled), Zt = S((A) => A.setSubtitleStyle), Je = S((A) => A.setPreferredAudioLang), Qe = Me.subtitlesEnabled, vt = Me.subtitleStyle, en = Re[Ee]?.lang, tn = ge.some((A) => A.lang === "eng"), [U, se] = L(null), we = Hl({
6794
+ } = sc(n), Me = S((A) => A.mediaPrefs), Xt = S((A) => A.mutedForAutoplay), Zt = S((A) => A.setMutedForAutoplay), Bt = S((A) => A.setSubtitlesEnabled), en = S((A) => A.setSubtitleStyle), Je = S((A) => A.setPreferredAudioLang), Qe = Me.subtitlesEnabled, vt = Me.subtitleStyle, tn = Re[Ee]?.lang, nn = ge.some((A) => A.lang === "eng"), [U, se] = L(null), we = Gl({
6773
6795
  override: U,
6774
6796
  globalEnabled: Qe,
6775
- selectedAudioLang: en,
6776
- hasEngSub: tn
6797
+ selectedAudioLang: tn,
6798
+ hasEngSub: nn
6777
6799
  }), ft = j(() => {
6778
6800
  const A = !we;
6779
- se(A), Pt(A);
6780
- }, [we, Pt]), Bt = j((A) => {
6801
+ se(A), Bt(A);
6802
+ }, [we, Bt]), Ot = j((A) => {
6781
6803
  const H = S.getState();
6782
- za(A, {
6804
+ Ga(A, {
6783
6805
  userWantsMuted: H.mediaPrefs.muted,
6784
6806
  onMutedBridge: () => H.setMutedForAutoplay(!0),
6785
6807
  onUnmuted: () => H.setMutedForAutoplay(!1),
@@ -6787,8 +6809,8 @@ function bc({ mediaUrl: t, indexUrl: e, mediaId: n }) {
6787
6809
  });
6788
6810
  }, []), On = j((A) => {
6789
6811
  A.pause();
6790
- }, []), [Ka, jn] = L(0), [Va, Ja] = L(n);
6791
- Va !== n && (Ja(n), se(null), jn(0)), R(() => {
6812
+ }, []), [Ja, jn] = L(0), [Qa, Ya] = L(n);
6813
+ Qa !== n && (Ya(n), se(null), jn(0)), R(() => {
6792
6814
  const A = r.current;
6793
6815
  if (!A) return;
6794
6816
  const H = () => {
@@ -6799,7 +6821,7 @@ function bc({ mediaUrl: t, indexUrl: e, mediaId: n }) {
6799
6821
  const kt = j((A) => {
6800
6822
  _t({ isBuffering: A });
6801
6823
  }, [_t]), Hn = j((A) => {
6802
- if (K.current >= pc) {
6824
+ if (K.current >= _c) {
6803
6825
  An("phantom-recreate-exhausted", { reason: A, recreates: K.current, mediaId: n });
6804
6826
  return;
6805
6827
  }
@@ -6808,7 +6830,7 @@ function bc({ mediaUrl: t, indexUrl: e, mediaId: n }) {
6808
6830
  attempt: K.current
6809
6831
  }), X((H) => H + 1);
6810
6832
  }, [n]);
6811
- async function nn() {
6833
+ async function rn() {
6812
6834
  const A = O.current, H = r.current;
6813
6835
  if (!A || !y.length || C.current) return;
6814
6836
  const ce = S.getState().snapshot, q = ce.playheadMs || 0;
@@ -6823,7 +6845,7 @@ function bc({ mediaUrl: t, indexUrl: e, mediaId: n }) {
6823
6845
  })
6824
6846
  );
6825
6847
  if (await A.ensureBuffered(q, "initial"), A.isDisposed) return;
6826
- const ie = Js;
6848
+ const ie = Ys;
6827
6849
  await Promise.allSettled(ae);
6828
6850
  const J = ue.map(
6829
6851
  (G) => G.waitForBuffered(q + Be, ie)
@@ -6833,7 +6855,7 @@ function bc({ mediaUrl: t, indexUrl: e, mediaId: n }) {
6833
6855
  aheadMs: Math.round(A.getBufferedAheadMs(q)),
6834
6856
  targetMs: Be
6835
6857
  }), A.isDisposed) return;
6836
- if (A.getBufferedAheadMs(q) > gc && A.getLoadedCount() === 0) {
6858
+ if (A.getBufferedAheadMs(q) > yc && A.getLoadedCount() === 0) {
6837
6859
  A.dumpBufferDiagnostics(q, "phantom-detected"), N("buffer", "PHANTOM-BUFFER detected at gate — recreating MediaSource", {
6838
6860
  gateAheadMs: Math.round(A.getBufferedAheadMs(q)),
6839
6861
  loaded: A.getLoadedCount(),
@@ -6849,7 +6871,7 @@ function bc({ mediaUrl: t, indexUrl: e, mediaId: n }) {
6849
6871
  totalMs: Ye
6850
6872
  });
6851
6873
  const Le = Ie ? "gate-pass" : "gate-timeout";
6852
- A.emitInitDigest("video", Le), ue.forEach((G, oe) => G.emitInitDigest(`audio:${oe}`, Le)), v.current || (v.current = !0, Qs(n));
6874
+ A.emitInitDigest("video", Le), ue.forEach((G, oe) => G.emitInitDigest(`audio:${oe}`, Le)), v.current || (v.current = !0, Xs(n));
6853
6875
  let Y = q;
6854
6876
  if (H && Y > 0) {
6855
6877
  const G = H.buffered;
@@ -6857,16 +6879,16 @@ function bc({ mediaUrl: t, indexUrl: e, mediaId: n }) {
6857
6879
  const oe = Y / 1e3, fe = G.start(0);
6858
6880
  oe < fe && fe - oe < 1 && (Y = fe * 1e3);
6859
6881
  }
6860
- H.currentTime = Y / 1e3, await Wa(H, 3e3);
6882
+ H.currentTime = Y / 1e3, await qa(H, 3e3);
6861
6883
  }
6862
- te.current = Y, i(!0), C.current = !0, z.current = 0, _r() && N("buffer", "RECOVERY-SUCCESS — playback initialized after an auto-reload", { mediaId: n }), zl(), T("buffer", "initializePlayback complete", {
6884
+ te.current = Y, i(!0), C.current = !0, z.current = 0, _r() && N("buffer", "RECOVERY-SUCCESS — playback initialized after an auto-reload", { mediaId: n }), Kl(), T("buffer", "initializePlayback complete", {
6863
6885
  mediaId: n,
6864
6886
  startMs: q,
6865
6887
  seekMs: Y,
6866
6888
  initDurationMs: Math.round(performance.now() - de)
6867
6889
  });
6868
6890
  const Xe = S.getState().snapshot;
6869
- if (H && Xe.playing && H.paused && (T("buffer", "initializePlayback: calling play()", { playing: Xe.playing }), Bt(H)), A.isDisposed) return;
6891
+ if (H && Xe.playing && H.paused && (T("buffer", "initializePlayback: calling play()", { playing: Xe.playing }), Ot(H)), A.isDisposed) return;
6870
6892
  const be = S.getState();
6871
6893
  if (!(!!be.snapshot.leaderId && be.snapshot.leaderId === be.me.clientId) && be.snapshot.playing)
6872
6894
  try {
@@ -6884,7 +6906,7 @@ function bc({ mediaUrl: t, indexUrl: e, mediaId: n }) {
6884
6906
  const _e = S.getState(), ve = Date.now() - _e.snapshotReceivedAt, Ze = _e.snapshot.playheadMs + ve, $e = Ze > oe ? Ze : oe;
6885
6907
  await fe.submit({
6886
6908
  targetMs: $e,
6887
- priority: Lt.VIEWER_CORRECTION,
6909
+ priority: Ft.VIEWER_CORRECTION,
6888
6910
  caller: "viewer-correction",
6889
6911
  pauseSeekResume: !0,
6890
6912
  onComplete: (je) => {
@@ -6914,7 +6936,7 @@ function bc({ mediaUrl: t, indexUrl: e, mediaId: n }) {
6914
6936
  error: ue?.message
6915
6937
  }), i(!0), C.current = !0;
6916
6938
  const ae = S.getState().snapshot;
6917
- H && ae.playing && H.paused && Bt(H);
6939
+ H && ae.playing && H.paused && Ot(H);
6918
6940
  } else {
6919
6941
  const ae = ue?.message || "";
6920
6942
  if (A.isDisposed || ae.includes("FragmentManager disposed")) {
@@ -6924,7 +6946,7 @@ function bc({ mediaUrl: t, indexUrl: e, mediaId: n }) {
6924
6946
  return;
6925
6947
  }
6926
6948
  const ie = ae.includes("SourceBuffer is full"), J = ae.includes("init segment failed");
6927
- z.current += 1, ie || J || z.current > mc ? (re("buffer", "Initialize playback failed — recreating MediaSource", {
6949
+ z.current += 1, ie || J || z.current > wc ? (re("buffer", "Initialize playback failed — recreating MediaSource", {
6928
6950
  error: ae,
6929
6951
  mediaId: n,
6930
6952
  attempt: z.current,
@@ -6935,18 +6957,18 @@ function bc({ mediaUrl: t, indexUrl: e, mediaId: n }) {
6935
6957
  mediaId: n,
6936
6958
  attempt: z.current
6937
6959
  }), setTimeout(() => {
6938
- O.current && !A.isDisposed && !C.current && (T("buffer", "Retrying initializePlayback"), nn().catch(wn));
6960
+ O.current && !A.isDisposed && !C.current && (T("buffer", "Retrying initializePlayback"), rn().catch(wn));
6939
6961
  }, 3e3));
6940
6962
  }
6941
6963
  }
6942
6964
  }
6943
- const Qa = ke(() => ({
6965
+ const Xa = ke(() => ({
6944
6966
  useMseAudio: w,
6945
6967
  selectedAudioIndex: Ee,
6946
6968
  mseAudioTracks: p,
6947
6969
  fragments: y,
6948
6970
  deliveryFor: I,
6949
- initializePlayback: nn
6971
+ initializePlayback: rn
6950
6972
  }));
6951
6973
  R(() => {
6952
6974
  if (!g) return;
@@ -6957,7 +6979,7 @@ function bc({ mediaUrl: t, indexUrl: e, mediaId: n }) {
6957
6979
  fragments: q,
6958
6980
  deliveryFor: de,
6959
6981
  initializePlayback: ue
6960
- } = Qa();
6982
+ } = Xa();
6961
6983
  le.current !== n && (le.current = n, K.current = 0, z.current = 0);
6962
6984
  const ae = _r();
6963
6985
  ae && N("buffer", "POST-AUTO-RELOAD — this load follows an auto-reload recovery", {
@@ -6972,12 +6994,12 @@ function bc({ mediaUrl: t, indexUrl: e, mediaId: n }) {
6972
6994
  O.current = Ie;
6973
6995
  const Ye = ++Ke.current;
6974
6996
  window.__FRAGMENT_MANAGER__ = Ie, window.__AUDIO_FRAGMENT_MANAGERS__ = W.current;
6975
- const Le = new ql({
6997
+ const Le = new Ql({
6976
6998
  videoRef: r,
6977
6999
  fragmentManagerRef: O,
6978
7000
  audioFragmentManagersRef: W
6979
7001
  });
6980
- P.current = Le, window.__SEEK_COORDINATOR__ = Le, Kl();
7002
+ P.current = Le, window.__SEEK_COORDINATOR__ = Le, Yl();
6981
7003
  const Y = r.current, Xe = () => {
6982
7004
  const G = Y?.error;
6983
7005
  G && (re("video", `Media error code=${G.code}: ${G.message}`, {
@@ -6985,7 +7007,7 @@ function bc({ mediaUrl: t, indexUrl: e, mediaId: n }) {
6985
7007
  networkState: Y.networkState,
6986
7008
  readyState: Y.readyState
6987
7009
  }), S.getState().pushToast("error", "Video playback error. Try reloading."));
6988
- }, be = t.replace(new RegExp(`/${Ot.replace(/\./g, "\\.")}$`), ""), Fe = () => {
7010
+ }, be = t.replace(new RegExp(`/${jt.replace(/\./g, "\\.")}$`), ""), Fe = () => {
6989
7011
  try {
6990
7012
  const G = `video/mp4; codecs="${g}"`;
6991
7013
  MediaSource.isTypeSupported(G) || (N("mse", `Codec not supported by browser MSE: ${G}`), S.getState().pushToast("error", "Video codec not supported by your browser.")), T("mse", `addSourceBuffer: ${G}`);
@@ -7043,7 +7065,7 @@ function bc({ mediaUrl: t, indexUrl: e, mediaId: n }) {
7043
7065
  }
7044
7066
  };
7045
7067
  return Y && (J.addEventListener("sourceopen", Fe, { once: !0 }), ie = URL.createObjectURL(J), Y.src = ie, Y.addEventListener("error", Xe)), () => {
7046
- Y?.pause(), Y && Y.removeEventListener("error", Xe), J.removeEventListener("sourceopen", Fe), Vl(), Le.dispose(), P.current = null, Ie.dispose(), O.current = null, window.__FRAGMENT_MANAGER__ = null, window.__AUDIO_FRAGMENT_MANAGERS__ = null;
7068
+ Y?.pause(), Y && Y.removeEventListener("error", Xe), J.removeEventListener("sourceopen", Fe), Xl(), Le.dispose(), P.current = null, Ie.dispose(), O.current = null, window.__FRAGMENT_MANAGER__ = null, window.__AUDIO_FRAGMENT_MANAGERS__ = null;
7047
7069
  for (const G of W.current) G.dispose();
7048
7070
  if (W.current = [], J.readyState === "open") {
7049
7071
  for (const G of [$.current, ...he.current])
@@ -7061,12 +7083,12 @@ function bc({ mediaUrl: t, indexUrl: e, mediaId: n }) {
7061
7083
  Ae.current?.(), C.current = !1, v.current = !1, $.current = null, i(!1);
7062
7084
  };
7063
7085
  }, [t, n, g, h, kt, V]);
7064
- const Ya = ke(() => {
7086
+ const Za = ke(() => {
7065
7087
  const A = O.current, H = Ke.current;
7066
7088
  if (B.current?.readyState === "open" && $.current && y.length && A) {
7067
7089
  if (A.hasIndex && A.epoch === H) return;
7068
7090
  if (A.setIndex(y, t, h, n, I()), A.epoch = H, w) {
7069
- const ce = t.replace(new RegExp(`/${Ot.replace(/\./g, "\\.")}$`), ""), q = ee.current, de = W.current[0], ue = q >= 0 ? p[q] : void 0;
7091
+ const ce = t.replace(new RegExp(`/${jt.replace(/\./g, "\\.")}$`), ""), q = ee.current, de = W.current[0], ue = q >= 0 ? p[q] : void 0;
7070
7092
  if (de && ue && !(de.hasIndex && de.epoch === H)) {
7071
7093
  const ae = `${ce}/${ue.path}`.replace(/\\/g, "/");
7072
7094
  de.setIndex(
@@ -7078,11 +7100,11 @@ function bc({ mediaUrl: t, indexUrl: e, mediaId: n }) {
7078
7100
  ), de.epoch = H;
7079
7101
  }
7080
7102
  }
7081
- C.current || nn().catch(wn);
7103
+ C.current || rn().catch(wn);
7082
7104
  }
7083
7105
  });
7084
7106
  R(() => {
7085
- Ya();
7107
+ Za();
7086
7108
  }, [y, t, h, p]), R(() => {
7087
7109
  const A = () => {
7088
7110
  O.current?.abortStaleJobs("socket-reconnect");
@@ -7141,7 +7163,7 @@ function bc({ mediaUrl: t, indexUrl: e, mediaId: n }) {
7141
7163
  { suppressEndOfStream: !0, label: `audio:${q.track_id}` }
7142
7164
  );
7143
7165
  J.setSourceBuffer(ie, A);
7144
- const Ye = `${t.replace(new RegExp(`/${Ot.replace(/\./g, "\\.")}$`), "")}/${q.path}`.replace(/\\/g, "/");
7166
+ const Ye = `${t.replace(new RegExp(`/${jt.replace(/\./g, "\\.")}$`), "")}/${q.path}`.replace(/\\/g, "/");
7145
7167
  J.setIndex(
7146
7168
  q.fragments,
7147
7169
  Ye,
@@ -7160,17 +7182,17 @@ function bc({ mediaUrl: t, indexUrl: e, mediaId: n }) {
7160
7182
  Q.current = !1;
7161
7183
  }
7162
7184
  })().catch((ae) => re("audio", "MSE audio swap failed", Z(ae)));
7163
- }, [w, a, Ee, p, n, t, kt, I]), fc(P, r, te, a, Bt, On), sc(r, O, P, a, On, W), uc(r, P, n, b ?? 0, a, Bt);
7164
- const { stopPrefetch: Un } = oc(r, O, P, a, _t, W);
7165
- lc(O), R(() => {
7185
+ }, [w, a, Ee, p, n, t, kt, I]), uc(P, r, te, a, Ot, On), lc(r, O, P, a, On, W), pc(r, P, n, b ?? 0, a, Ot);
7186
+ const { stopPrefetch: Un } = dc(r, O, P, a, _t, W);
7187
+ hc(O), R(() => {
7166
7188
  Ae.current = Un;
7167
7189
  }, [Un]);
7168
- const Xa = j(() => {
7190
+ const es = j(() => {
7169
7191
  const A = r.current?.parentElement;
7170
7192
  A && (document.fullscreenElement ? document.exitFullscreen().catch((H) => N("ui", "exitFullscreen failed", Z(H))) : A.requestFullscreen().catch((H) => N("ui", "requestFullscreen failed", Z(H))));
7171
- }, []), Za = j((A) => {
7193
+ }, []), ts = j((A) => {
7172
7194
  A.preventDefault();
7173
- }, []), es = we && ge[ot] ? ge[ot].url : null;
7195
+ }, []), ns = we && ge[ot] ? ge[ot].url : null;
7174
7196
  return /* @__PURE__ */ x(
7175
7197
  "div",
7176
7198
  {
@@ -7188,28 +7210,28 @@ function bc({ mediaUrl: t, indexUrl: e, mediaId: n }) {
7188
7210
  ref: r,
7189
7211
  className: "w-full h-full",
7190
7212
  playsInline: !0,
7191
- onDoubleClick: Xa,
7192
- onContextMenu: Za
7213
+ onDoubleClick: es,
7214
+ onContextMenu: ts
7193
7215
  }
7194
7216
  ),
7195
7217
  /* @__PURE__ */ c(
7196
- bl,
7218
+ vl,
7197
7219
  {
7198
- subtitleUrl: es,
7220
+ subtitleUrl: ns,
7199
7221
  videoRef: r,
7200
7222
  style: vt,
7201
7223
  enabled: we
7202
7224
  }
7203
7225
  ),
7204
- /* @__PURE__ */ c(Il, { mediaId: n, visible: l }),
7226
+ /* @__PURE__ */ c(Ll, { mediaId: n, visible: l }),
7205
7227
  /* @__PURE__ */ c(
7206
- vl,
7228
+ El,
7207
7229
  {
7208
7230
  videoRef: r,
7209
7231
  mediaId: n,
7210
7232
  durationMs: b || void 0,
7211
7233
  visible: l,
7212
- displayPlayheadMs: Ka,
7234
+ displayPlayheadMs: Ja,
7213
7235
  audioTracks: Re,
7214
7236
  selectedAudioIndex: Ee,
7215
7237
  onAudioSelect: (A) => {
@@ -7223,27 +7245,27 @@ function bc({ mediaUrl: t, indexUrl: e, mediaId: n }) {
7223
7245
  subtitlesEnabled: we,
7224
7246
  onSubtitlesToggle: ft,
7225
7247
  subtitleStyle: vt,
7226
- onSubtitleStyleChange: Zt,
7248
+ onSubtitleStyleChange: en,
7227
7249
  onChatActivity: () => d(5e3),
7228
7250
  onMenuHeld: m
7229
7251
  }
7230
7252
  ),
7231
- Yt && /* @__PURE__ */ x(
7253
+ Xt && /* @__PURE__ */ x(
7232
7254
  "button",
7233
7255
  {
7234
7256
  type: "button",
7235
7257
  onClick: () => {
7236
7258
  const A = r.current;
7237
- A && (A.muted = !1), Xt(!1);
7259
+ A && (A.muted = !1), Zt(!1);
7238
7260
  },
7239
7261
  className: "autoplay-sound-badge",
7240
7262
  children: [
7241
- /* @__PURE__ */ c(Nt, { name: "volume-high" }),
7263
+ /* @__PURE__ */ c(Rt, { name: "volume-high" }),
7242
7264
  " Tap for sound"
7243
7265
  ]
7244
7266
  }
7245
7267
  ),
7246
- Dt.isBuffering && k.ready && /* @__PURE__ */ c("div", { className: "absolute inset-0 flex items-center justify-center pointer-events-none", children: /* @__PURE__ */ x("div", { className: "flex flex-col items-center gap-2", children: [
7268
+ Pt.isBuffering && k.ready && /* @__PURE__ */ c("div", { className: "absolute inset-0 flex items-center justify-center pointer-events-none", children: /* @__PURE__ */ x("div", { className: "flex flex-col items-center gap-2", children: [
7247
7269
  /* @__PURE__ */ c("div", { className: "w-8 h-8 border-2 border-text border-t-transparent rounded-full animate-spin" }),
7248
7270
  /* @__PURE__ */ c("div", { className: "px-4 py-2 rounded bg-wp-surface-2/80 text-xs font-medium", children: "Buffering…" })
7249
7271
  ] }) })
@@ -7251,14 +7273,14 @@ function bc({ mediaUrl: t, indexUrl: e, mediaId: n }) {
7251
7273
  }
7252
7274
  );
7253
7275
  }
7254
- function yc() {
7276
+ function kc() {
7255
7277
  const t = S((n) => n.snapshot.mediaId), e = ye(() => t ? { mediaId: t, ...Hr(t) } : null, [t]);
7256
- return e ? /* @__PURE__ */ c(Xr, { children: /* @__PURE__ */ c(bc, { mediaUrl: e.mediaUrl, indexUrl: e.indexUrl, mediaId: e.mediaId }) }) : /* @__PURE__ */ c(Zs, {});
7278
+ return e ? /* @__PURE__ */ c(Xr, { children: /* @__PURE__ */ c(vc, { mediaUrl: e.mediaUrl, indexUrl: e.indexUrl, mediaId: e.mediaId }) }) : /* @__PURE__ */ c(ti, {});
7257
7279
  }
7258
- const wc = (t) => {
7259
- const e = fi(t);
7280
+ const Sc = (t) => {
7281
+ const e = ci(t);
7260
7282
  return e.render(
7261
- /* @__PURE__ */ c(Ys.Provider, { value: Xs(), children: /* @__PURE__ */ c(yc, {}) })
7283
+ /* @__PURE__ */ c(Zs.Provider, { value: ei(), children: /* @__PURE__ */ c(kc, {}) })
7262
7284
  ), {
7263
7285
  update() {
7264
7286
  },
@@ -7269,21 +7291,21 @@ const wc = (t) => {
7269
7291
  queueMicrotask(() => e.unmount());
7270
7292
  }
7271
7293
  };
7272
- }, _c = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
7294
+ }, xc = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
7273
7295
  __proto__: null,
7274
- mount: wc
7275
- }, Symbol.toStringTag, { value: "Module" })), vc = {
7296
+ mount: Sc
7297
+ }, Symbol.toStringTag, { value: "Module" })), Ec = {
7276
7298
  id: "player",
7277
7299
  name: "Media player",
7278
- load: () => Promise.resolve(_c)
7279
- }, kc = Cn(() => import("./MediaDrawer-DKC67ywB.js"));
7280
- function Sc() {
7281
- const t = S((d) => d.snapshot), e = S((d) => d.ensureAutoIdentity), n = Qt(), r = ye(
7282
- () => n ? $i(n, window.location.origin) : null,
7300
+ load: () => Promise.resolve(xc)
7301
+ }, Mc = Cn(() => import("./MediaDrawer-BvK1KqMY.js"));
7302
+ function Tc() {
7303
+ const t = S((d) => d.snapshot), e = S((d) => d.ensureAutoIdentity), n = Yt(), r = ye(
7304
+ () => n ? Pi(n, window.location.origin) : null,
7283
7305
  [n]
7284
- ), s = ei(), a = D(!1), [i, f] = L(!1), o = s.roomKey || null;
7285
- jf(), R(() => Hf(), []), R(() => Wf(), []), R(() => {
7286
- o && Vf(o);
7306
+ ), s = ni(), a = D(!1), [i, f] = L(!1), o = s.roomKey || null;
7307
+ Hf(), Wf(), R(() => Gf(), []), R(() => Vf(), []), R(() => {
7308
+ o && Xf(o);
7287
7309
  }, [o]), R(() => {
7288
7310
  const d = () => f(!0);
7289
7311
  return window.addEventListener(vn, d), () => window.removeEventListener(vn, d);
@@ -7295,9 +7317,9 @@ function Sc() {
7295
7317
  try {
7296
7318
  await Promise.race([
7297
7319
  Promise.all([
7298
- ti(),
7299
- ni(),
7300
- ri().then(Br)
7320
+ ri(),
7321
+ ai(),
7322
+ si().then(Br)
7301
7323
  ]),
7302
7324
  new Promise((b) => setTimeout(b, u))
7303
7325
  ]);
@@ -7308,7 +7330,7 @@ function Sc() {
7308
7330
  const m = S.getState();
7309
7331
  T("room", "Joining room", { roomKey: o, name: m.name, sprite: m.sprite }), e();
7310
7332
  const y = S.getState();
7311
- ai({
7333
+ ii({
7312
7334
  room_key: o,
7313
7335
  name: y.name || void 0,
7314
7336
  sprite: y.sprite || void 0
@@ -7322,56 +7344,56 @@ function Sc() {
7322
7344
  }
7323
7345
  return o ? /* @__PURE__ */ x("div", { className: "relative flex-1 flex overflow-hidden min-h-0", children: [
7324
7346
  /* @__PURE__ */ x("div", { className: "flex-1 relative bg-black overflow-hidden min-w-0", children: [
7325
- /* @__PURE__ */ c(nr, { activity: vc, roomKey: t.roomId ?? "", layer: "base" }),
7347
+ /* @__PURE__ */ c(nr, { activity: Ec, roomKey: t.roomId ?? "", layer: "base" }),
7326
7348
  r && t.roomId && /* @__PURE__ */ c(Xr, { children: /* @__PURE__ */ c(nr, { activity: r, roomKey: t.roomId, layer: "overlay" }, r.id) }),
7327
- /* @__PURE__ */ x(Lf, { children: [
7328
- /* @__PURE__ */ c(xc, {}),
7329
- /* @__PURE__ */ c(Mf, {}),
7330
- /* @__PURE__ */ c($f, {}),
7331
- /* @__PURE__ */ c(Rf, {})
7349
+ /* @__PURE__ */ x(Ff, { children: [
7350
+ /* @__PURE__ */ c(Ac, {}),
7351
+ /* @__PURE__ */ c(Tf, {}),
7352
+ /* @__PURE__ */ c(Df, {}),
7353
+ /* @__PURE__ */ c(Lf, {})
7332
7354
  ] })
7333
7355
  ] }),
7334
- /* @__PURE__ */ c(lf, {}),
7335
- /* @__PURE__ */ c(at.Suspense, { fallback: /* @__PURE__ */ c(gf, { open: i, onClose: l }), children: /* @__PURE__ */ c(kc, { open: i, onClose: l }) })
7356
+ /* @__PURE__ */ c(cf, {}),
7357
+ /* @__PURE__ */ c(at.Suspense, { fallback: /* @__PURE__ */ c(mf, { open: i, onClose: l }), children: /* @__PURE__ */ c(Mc, { open: i, onClose: l }) })
7336
7358
  ] }) : (N("room", "No room key provided"), /* @__PURE__ */ c("div", { className: "flex-1 flex items-center justify-center p-6", children: /* @__PURE__ */ x("div", { className: "text-text-secondary", children: [
7337
7359
  "No room key provided. Go to the ",
7338
7360
  /* @__PURE__ */ c("a", { href: "/", className: "underline", children: "home page" }),
7339
7361
  " to select a room."
7340
7362
  ] }) }));
7341
7363
  }
7342
- function xc() {
7343
- const t = S((s) => s.floatingChatEnabled), e = S((s) => s.chatCollapsed), n = S((s) => !!s.snapshot.mediaId), r = Ft();
7364
+ function Ac() {
7365
+ const t = S((s) => s.floatingChatEnabled), e = S((s) => s.chatCollapsed), n = S((s) => !!s.snapshot.mediaId), r = $t();
7344
7366
  return /* @__PURE__ */ c(
7345
- bf,
7367
+ yf,
7346
7368
  {
7347
- shown: Bi(t, { hasMedia: n, chatCollapsed: e, isFullscreen: r }),
7369
+ shown: ji(t, { hasMedia: n, chatCollapsed: e, isFullscreen: r }),
7348
7370
  className: "absolute right-4 bottom-[35%] w-80 z-20"
7349
7371
  }
7350
7372
  );
7351
7373
  }
7352
- const Pc = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
7374
+ const Hc = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
7353
7375
  __proto__: null,
7354
- default: Sc
7376
+ default: Tc
7355
7377
  }, Symbol.toStringTag, { value: "Module" }));
7356
7378
  export {
7357
- $c as B,
7358
- bo as C,
7359
- hf as D,
7360
- wo as E,
7361
- lo as P,
7362
- Pc as R,
7363
- Rc as S,
7364
- uf as a,
7379
+ Oc as B,
7380
+ yo as C,
7381
+ gf as D,
7382
+ _o as E,
7383
+ co as P,
7384
+ Hc as R,
7385
+ Dc as S,
7386
+ hf as a,
7365
7387
  $n as b,
7366
- Af as c,
7367
- Lc as d,
7368
- Jf as e,
7369
- Fc as f,
7388
+ If as c,
7389
+ Pc as d,
7390
+ Zf as e,
7391
+ Bc as f,
7370
7392
  st as g,
7371
7393
  qe as i,
7372
7394
  ea as p,
7373
- Tf as r,
7374
- Dc as s,
7375
- If as u
7395
+ Af as r,
7396
+ jc as s,
7397
+ Cf as u
7376
7398
  };
7377
- //# sourceMappingURL=Room-Blh4Tyg_.js.map
7399
+ //# sourceMappingURL=Room-DNqp1uge.js.map