@hadoku/watchparty-ui 0.45.119 → 0.45.121

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,25 +1,25 @@
1
1
  import { jsx as l, jsxs as w, Fragment as te } from "react/jsx-runtime";
2
- import Ke, { useState as N, useRef as U, useMemo as F, useCallback as D, useEffect as M, createContext as kt, useContext as ba, useSyncExternalStore as ya, useLayoutEffect as ut, useId as Ft, useEffectEvent as _a } from "react";
3
- import { themePrefs as pe, Icon as jn, THEMES as Rn, useHadokuThemeOptional as Pn } from "@wolffm/themes";
4
- import { createCdnClient as Mn, kindOfType as Dn, MAX_BYTES as Ln, measureImage as On, filesFromClipboard as qn, filesFromDrop as Hn, CdnError as mt } from "@wolffm/cdn-client";
5
- import { ensureCosmeticsStyles as Un, cleanWorn as $n, readPictureColour as Fn, onPictureColour as zn, pictureColour as Wn, decorHtml as Bn, messageHtml as wa, nameHtml as ka, finishReveal as Gn } from "@wolffm/prefs-client/cosmetics";
6
- import { create as Kn } from "zustand";
7
- import { avatarPortraitPath as Vn, pickAvatar as va, applyReaction as Yn, mintTabId as Jn, resolveIdentityReassert as Xn } from "@wolffm/rooms-protocol";
2
+ import Ke, { useState as N, useRef as U, useMemo as F, useCallback as D, useEffect as M, createContext as xt, useContext as ya, useSyncExternalStore as _a, useLayoutEffect as ut, useId as zt, useEffectEvent as wa } from "react";
3
+ import { themePrefs as pe, Icon as Pn, THEMES as Mn, useHadokuThemeOptional as Dn } from "@wolffm/themes";
4
+ import { createCdnClient as Ln, kindOfType as On, MAX_BYTES as qn, measureImage as Hn, filesFromClipboard as Un, filesFromDrop as $n, CdnError as mt } from "@wolffm/cdn-client";
5
+ import { ensureCosmeticsStyles as Fn, cleanWorn as zn, readPictureColour as Wn, onPictureColour as Bn, pictureColour as Gn, decorHtml as Kn, messageHtml as va, nameHtml as ka, finishReveal as Vn } from "@wolffm/prefs-client/cosmetics";
6
+ import { createPrefsClient as Yn, getDeviceId as Jn, DEVICE_ID_KEY as Xn } from "@wolffm/prefs-client";
7
+ import { create as Qn } from "zustand";
8
+ import { avatarPortraitPath as Zn, AVATAR_COLORS as eo, pickAvatar as xa, applyReaction as to, createTabIdentity as ao, resolveIdentityReassert as no } from "@wolffm/rooms-protocol";
8
9
  import { z as i } from "zod";
9
- import { createPrefsClient as Qn, getDeviceId as Zn, DEVICE_ID_KEY as eo } from "@wolffm/prefs-client";
10
10
  import { io as gt } from "socket.io-client";
11
- import { fetchCharacter as to, characterOf as ao, onAvatarChange as no } from "@wolffm/prefs-client/avatar";
12
- import { relayIdentityChanges as oo } from "@wolffm/task-ui-components/identity-relay";
13
- import { createPortal as xa } from "react-dom";
14
- import { useCatalogueSearch as ro } from "@wolffm/cdn-client/react";
15
- const Sa = "https://cdn.hadoku.me", Ta = /^[0-9a-f]{64}\.(?:png|jpe?g|gif|webp|avif)$/;
16
- function vt(e) {
17
- return typeof e == "string" && Ta.test(e);
18
- }
19
- const xt = 8080, Ca = 5173, io = "/watchparty/ws", Ea = 500, fo = 1e3, ae = 4, Ia = typeof process < "u" && process.env ? process.env : {};
20
- Ia.PRODUCTION_UI_URL;
21
- Ia.PRODUCTION_SERVER_URL;
22
- const He = i.enum(["S", "A", "B", "C", "D", "F"]), zt = 2e4, so = 300;
11
+ import { fetchCharacter as oo, characterOf as ro, onAvatarChange as io } from "@wolffm/prefs-client/avatar";
12
+ import { relayIdentityChanges as fo } from "@wolffm/task-ui-components/identity-relay";
13
+ import { createPortal as Sa } from "react-dom";
14
+ import { useCatalogueSearch as so } from "@wolffm/cdn-client/react";
15
+ const Ta = "https://cdn.hadoku.me", Ca = /^[0-9a-f]{64}\.(?:png|jpe?g|gif|webp|avif)$/;
16
+ function St(e) {
17
+ return typeof e == "string" && Ca.test(e);
18
+ }
19
+ const Ea = 8080, lo = 5173, co = "/watchparty/ws", Ia = 500, uo = 1e3, ae = 4, Aa = typeof process < "u" && process.env ? process.env : {};
20
+ Aa.PRODUCTION_UI_URL;
21
+ Aa.PRODUCTION_SERVER_URL;
22
+ const He = i.enum(["S", "A", "B", "C", "D", "F"]), Wt = 2e4, mo = 300;
23
23
  i.object({
24
24
  name: i.string().min(1).max(32).optional(),
25
25
  sprite: i.string().min(1).max(32).optional(),
@@ -52,7 +52,7 @@ const T = {
52
52
  // 'ready_state' here = playback-readiness gate (distinct from READY_EVENTS.STATE = "ready check" UX feature)
53
53
  READY_STATE: "ready_state",
54
54
  ERROR: "error"
55
- }, lo = i.enum(["play", "pause", "seek", "load", "home"]), co = i.object({
55
+ }, go = i.enum(["play", "pause", "seek", "load", "home"]), ho = i.object({
56
56
  framed: i.boolean(),
57
57
  depth: i.number().int().nonnegative().max(10)
58
58
  });
@@ -60,7 +60,7 @@ i.object({
60
60
  room_key: i.string(),
61
61
  name: i.string().min(1).max(32).optional(),
62
62
  sprite: i.string().min(1).max(32).optional(),
63
- embed: co.optional(),
63
+ embed: ho.optional(),
64
64
  /** Which media-delivery path this client resolved to ('range' | 'fragment').
65
65
  * Optional so older clients still validate. Reported so a party's logs can be split by
66
66
  * arm — without it an A/B rollout is unmeasurable, exactly as entry path was before
@@ -108,13 +108,13 @@ i.object({
108
108
  });
109
109
  i.object({
110
110
  client_seq: i.number().int().positive(),
111
- kind: lo,
111
+ kind: go,
112
112
  to_ms: i.number().int().nonnegative().optional(),
113
113
  media_id: i.string().optional()
114
114
  // leader_id removed - not needed since set_leader control was removed
115
115
  });
116
- const Aa = i.object({
117
- key: i.string().regex(Ta, "not a CDN image key"),
116
+ const Na = i.object({
117
+ key: i.string().regex(Ca, "not a CDN image key"),
118
118
  /**
119
119
  * Intrinsic pixels, or **0 meaning "unknown"**.
120
120
  *
@@ -127,8 +127,8 @@ const Aa = i.object({
127
127
  * text went with it, with nothing said. Widening is backward compatible —
128
128
  * every message already in history carries positive dimensions.
129
129
  */
130
- w: i.number().int().nonnegative().max(zt),
131
- h: i.number().int().nonnegative().max(zt),
130
+ w: i.number().int().nonnegative().max(Wt),
131
+ h: i.number().int().nonnegative().max(Wt),
132
132
  /**
133
133
  * Human-readable description, rendered as the `alt` text.
134
134
  *
@@ -142,16 +142,16 @@ const Aa = i.object({
142
142
  * value only, never as markup. Bounded so one message cannot carry a
143
143
  * paragraph; the library's own titles run well under this.
144
144
  */
145
- title: i.string().max(so).optional()
146
- }), Na = /^[A-Za-z0-9_.:-]{1,64}$/;
145
+ title: i.string().max(mo).optional()
146
+ }), ja = /^[A-Za-z0-9_.:-]{1,64}$/;
147
147
  i.object({
148
- text: i.string().max(Ea),
148
+ text: i.string().max(Ia),
149
149
  style: i.string().max(64).optional(),
150
- images: i.array(Aa).max(ae).optional(),
150
+ images: i.array(Na).max(ae).optional(),
151
151
  /** The message this one replies to. Optional: older clients never send it. */
152
- reply_to: i.string().regex(Na).optional()
152
+ reply_to: i.string().regex(ja).optional()
153
153
  }).refine((e) => e.text.length > 0 || (e.images?.length ?? 0) > 0, { message: "message must carry text or at least one image" });
154
- const uo = i.enum(["join", "leave", "media_change", "identity_change", "recap"]);
154
+ const po = i.enum(["join", "leave", "media_change", "identity_change", "recap"]);
155
155
  i.object({
156
156
  id: i.string(),
157
157
  client_id: i.string(),
@@ -164,7 +164,7 @@ i.object({
164
164
  ts: i.number(),
165
165
  // Optional so a client on an older bundle still validates a message that
166
166
  // has none, and so system messages (which never carry images) stay unchanged.
167
- images: i.array(Aa).max(ae).optional(),
167
+ images: i.array(Na).max(ae).optional(),
168
168
  /** The id of the message this one answers (resolved by the client from
169
169
  * what it holds; the original may have rolled out of history). */
170
170
  reply_to: i.string().optional(),
@@ -172,14 +172,14 @@ i.object({
172
172
  * ids `author` carries). Absent when there are none. */
173
173
  reactions: i.array(i.object({ emoji: i.string(), by: i.array(i.string()) })).optional(),
174
174
  isSystem: i.boolean().optional(),
175
- systemType: uo.optional(),
175
+ systemType: po.optional(),
176
176
  /** A system line about a person: its text with `CHAT_NAME_TOKEN` where their
177
177
  * name goes. `text` is that template filled when sent; a client fills it
178
178
  * again with the person's CURRENT name (found by `author`) while they are
179
179
  * here, so a rename reaches lines already on screen. */
180
180
  template: i.string().optional()
181
181
  });
182
- const St = "{name}", mo = i.object({
182
+ const Tt = "{name}", bo = i.object({
183
183
  avg_download_rate_bps: i.number().nonnegative(),
184
184
  buffered_ahead_ms: i.number().nonnegative(),
185
185
  rtt_ms: i.number().nonnegative(),
@@ -221,7 +221,7 @@ const St = "{name}", mo = i.object({
221
221
  * socket shows here as a growing number while everything else looks fine. */
222
222
  pong_age_ms: i.number().int().nonnegative().optional(),
223
223
  reported_at: i.number().int().nonnegative()
224
- }), go = mo.extend({
224
+ }), yo = bo.extend({
225
225
  client_id: i.string(),
226
226
  name: i.string(),
227
227
  sprite_id: i.string().nullable(),
@@ -232,10 +232,10 @@ const St = "{name}", mo = i.object({
232
232
  stale_ms: i.number().int().nonnegative().optional()
233
233
  });
234
234
  i.object({
235
- clients: i.array(go),
235
+ clients: i.array(yo),
236
236
  server_ts: i.number().int().nonnegative()
237
237
  });
238
- const ho = i.object({
238
+ const _o = i.object({
239
239
  client_id: i.string(),
240
240
  sprite_id: i.string().nullable(),
241
241
  name: i.string(),
@@ -253,13 +253,13 @@ const ho = i.object({
253
253
  video_ready_state: i.number().int().default(-1)
254
254
  });
255
255
  i.object({
256
- clients: i.array(ho),
256
+ clients: i.array(_o),
257
257
  server_ts: i.number().int().nonnegative()
258
258
  });
259
259
  i.object({
260
260
  media_id: i.string()
261
261
  });
262
- const Tt = i.enum(["super_upvote", "upvote", "mid", "downvote"]), po = i.object({
262
+ const Ct = i.enum(["super_upvote", "upvote", "mid", "downvote"]), wo = i.object({
263
263
  mediaId: i.string(),
264
264
  displayName: i.string(),
265
265
  // Enrichment fields — present for flat-playlist ingest output, absent for
@@ -270,11 +270,11 @@ const Tt = i.enum(["super_upvote", "upvote", "mid", "downvote"]), po = i.object(
270
270
  durationMs: i.number().optional(),
271
271
  uploadDate: i.string().optional()
272
272
  // YouTube upload date 'YYYY-MM-DD'; drives playlist order
273
- }), bo = i.enum(["basic", "vote"]), ja = i.object({
273
+ }), vo = i.enum(["basic", "vote"]), Ra = i.object({
274
274
  id: i.string(),
275
275
  name: i.string(),
276
- type: bo.default("vote"),
277
- videos: i.array(po),
276
+ type: vo.default("vote"),
277
+ videos: i.array(wo),
278
278
  cover: i.string().optional()
279
279
  // media-relative path to the playlist cover image
280
280
  });
@@ -283,28 +283,28 @@ i.object({ index: i.number().int().min(0) });
283
283
  i.object({
284
284
  playlistId: i.string(),
285
285
  mediaId: i.string(),
286
- vote: Tt
286
+ vote: Ct
287
287
  });
288
288
  i.object({ voterKey: i.string().min(1).max(128) });
289
289
  i.object({ playlistId: i.string(), mediaIds: i.array(i.string()) });
290
290
  i.object({
291
- playlist: ja.nullable(),
291
+ playlist: Ra.nullable(),
292
292
  activeIndex: i.number().int().nullable(),
293
- myVotes: i.record(i.string(), Tt)
293
+ myVotes: i.record(i.string(), Ct)
294
294
  // mediaId -> VoteValue
295
295
  });
296
- const yo = i.object({
296
+ const ko = i.object({
297
297
  clientId: i.string(),
298
298
  name: i.string(),
299
299
  votedCount: i.number().int().nonnegative(),
300
300
  totalVideos: i.number().int().nonnegative()
301
301
  });
302
302
  i.object({
303
- progress: i.array(yo)
303
+ progress: i.array(ko)
304
304
  });
305
305
  i.object({
306
- playlist: ja,
307
- votes: i.record(i.string(), i.record(i.string(), Tt)),
306
+ playlist: Ra,
307
+ votes: i.record(i.string(), i.record(i.string(), Ct)),
308
308
  // votes[clientId][mediaId]
309
309
  names: i.record(i.string(), i.string()),
310
310
  // clientId -> display name
@@ -329,17 +329,17 @@ const Pe = {
329
329
  RESULTS: "playlist_results",
330
330
  /** Server -> the removed voter: forget the ballot you hold in localStorage. */
331
331
  VOTES_CLEARED: "playlist_votes_cleared"
332
- }, Ra = i.object({
332
+ }, Pa = i.object({
333
333
  id: i.string(),
334
334
  displayName: i.string(),
335
335
  thumbnail: i.string().optional()
336
336
  });
337
337
  i.object({
338
- items: i.array(Ra)
338
+ items: i.array(Pa)
339
339
  });
340
- const Pa = i.partialRecord(He, i.array(i.string()));
341
- i.object({ board: Pa });
342
- const _o = i.object({
340
+ const Ma = i.partialRecord(He, i.array(i.string()));
341
+ i.object({ board: Ma });
342
+ const xo = i.object({
343
343
  mediaId: i.string(),
344
344
  tier: He,
345
345
  absoluteTier: He,
@@ -352,8 +352,8 @@ const _o = i.object({
352
352
  // opaque voterId -> the letter they gave
353
353
  });
354
354
  i.object({
355
- items: i.array(Ra),
356
- placed: i.array(_o),
355
+ items: i.array(Pa),
356
+ placed: i.array(xo),
357
357
  unrated: i.array(i.string()),
358
358
  spread: i.number(),
359
359
  nudged: i.boolean(),
@@ -363,9 +363,9 @@ i.object({
363
363
  * browser on a newer bundle still reads an older server's board. */
364
364
  pictures: i.record(i.string(), i.string()).optional(),
365
365
  voterCount: i.number().int().nonnegative(),
366
- myBoard: Pa
366
+ myBoard: Ma
367
367
  });
368
- const wo = {
368
+ const So = {
369
369
  /** Broadcast to EVERY connected socket when anyone saves. Carries no board —
370
370
  * it is a "re-fetch" ping, because the shared result is identical for all
371
371
  * viewers but `myBoard` is not, and one payload cannot serve both. */
@@ -378,10 +378,10 @@ i.object({
378
378
  ready: i.array(i.string())
379
379
  // clientIds who have flagged ready
380
380
  });
381
- const ko = {
381
+ const To = {
382
382
  STATE: "ready_check_state"
383
383
  // distinct from buffer-readiness 'ready_state'
384
- }, Ma = {
384
+ }, Da = {
385
385
  ACTIVE: "game_active",
386
386
  // server -> room (the open game id; null = none)
387
387
  SYNC: "game_sync"
@@ -393,78 +393,78 @@ i.object({
393
393
  i.object({
394
394
  gameId: i.string().nullable()
395
395
  });
396
- const vo = [
396
+ const Co = [
397
397
  {
398
398
  id: "fantasy",
399
399
  characters: [
400
- { id: "sage", color: "#7f7c84" },
401
- { id: "herald", color: "#bddaf9" },
402
- { id: "cleric", color: "#78855e" },
403
- { id: "knight", color: "#cfccc0" },
404
- { id: "mage", color: "#794983" },
405
- { id: "brawler", color: "#af4a33" },
406
- { id: "wanderer", color: "#936f42" },
407
- { id: "rogue", color: "#667240" }
400
+ { id: "sage" },
401
+ { id: "herald" },
402
+ { id: "cleric" },
403
+ { id: "knight" },
404
+ { id: "mage" },
405
+ { id: "brawler" },
406
+ { id: "wanderer" },
407
+ { id: "rogue" }
408
408
  ]
409
409
  },
410
410
  {
411
411
  id: "cyber",
412
412
  characters: [
413
- { id: "gunner", color: "#b6a472" },
414
- { id: "chief", color: "#a47e4d" },
415
- { id: "walker", color: "#e0443a" },
416
- { id: "operative", color: "#347cae" }
413
+ { id: "gunner" },
414
+ { id: "chief" },
415
+ { id: "walker" },
416
+ { id: "operative" }
417
417
  ]
418
418
  },
419
419
  {
420
420
  id: "stream",
421
421
  characters: [
422
- { id: "idol", color: "#eb82bf" },
423
- { id: "recluse", color: "#6d6880" },
424
- { id: "phantom", color: "#a4a3ae" },
425
- { id: "harlequin", color: "#e5d5c5" },
426
- { id: "doll", color: "#a02633" },
427
- { id: "imp", color: "#b398cb" }
422
+ { id: "idol" },
423
+ { id: "recluse" },
424
+ { id: "phantom" },
425
+ { id: "harlequin" },
426
+ { id: "doll" },
427
+ { id: "imp" }
428
428
  ]
429
429
  },
430
430
  {
431
431
  id: "arcane",
432
432
  characters: [
433
- { id: "apprentice", color: "#c6c15b" },
434
- { id: "prodigy", color: "#5b4a6a" },
435
- { id: "dreamer", color: "#97d0e4" },
436
- { id: "sunny", color: "#ee989b" },
437
- { id: "mentor", color: "#e1e0dc" }
433
+ { id: "apprentice" },
434
+ { id: "prodigy" },
435
+ { id: "dreamer" },
436
+ { id: "sunny" },
437
+ { id: "mentor" }
438
438
  ]
439
439
  }
440
- ], Da = vo.flatMap((e) => e.characters), Ze = Da.map((e) => e.id), xo = Object.fromEntries(Da.map((e) => [e.id, e.color]));
440
+ ], Eo = Co.flatMap((e) => e.characters), Ze = Eo.map((e) => e.id);
441
441
  function et(e) {
442
442
  return !!e && Ze.includes(e);
443
443
  }
444
- const So = 5e3, La = { mode: "off", percent: 0 }, To = ["off", "on", "ab"];
445
- function Co(e) {
446
- return typeof e == "string" && To.includes(e);
444
+ const Io = 5e3, La = { mode: "off", percent: 0 }, Ao = ["off", "on", "ab"];
445
+ function No(e) {
446
+ return typeof e == "string" && Ao.includes(e);
447
447
  }
448
- function Eo(e) {
449
- const t = e && typeof e == "object" ? e : {}, a = Co(t.mode) ? t.mode : La.mode, n = Number(t.percent), o = Number.isFinite(n) ? Math.min(100, Math.max(0, Math.round(n))) : 0;
448
+ function jo(e) {
449
+ const t = e && typeof e == "object" ? e : {}, a = No(t.mode) ? t.mode : La.mode, n = Number(t.percent), o = Number.isFinite(n) ? Math.min(100, Math.max(0, Math.round(n))) : 0;
450
450
  return { mode: a, percent: o };
451
451
  }
452
- function Io(e) {
452
+ function Ro(e) {
453
453
  let t = 2166136261;
454
454
  for (let a = 0; a < e.length; a++)
455
455
  t ^= e.charCodeAt(a), t = Math.imul(t, 16777619) >>> 0;
456
456
  return t >>> 0;
457
457
  }
458
- function Ao(e, t, a) {
458
+ function Po(e, t, a) {
459
459
  if (a === !0)
460
460
  return "fragment";
461
461
  if (a === !1)
462
462
  return "range";
463
- const n = Eo(e);
464
- return n.mode === "on" ? "fragment" : n.mode === "off" || n.percent <= 0 ? "range" : n.percent >= 100 || t && Io(t) % 100 < n.percent ? "fragment" : "range";
463
+ const n = jo(e);
464
+ return n.mode === "on" ? "fragment" : n.mode === "off" || n.percent <= 0 ? "range" : n.percent >= 100 || t && Ro(t) % 100 < n.percent ? "fragment" : "range";
465
465
  }
466
- let Me = null, Oa = Sa;
467
- function No(e) {
466
+ let Me = null, Oa = Ta;
467
+ function Mo(e) {
468
468
  e.cdnBase && (Oa = e.cdnBase);
469
469
  }
470
470
  function qa() {
@@ -472,12 +472,12 @@ function qa() {
472
472
  }
473
473
  function tt() {
474
474
  const e = qa();
475
- return (!Me || Me.base !== e) && (Me = { base: e, client: Mn({ cdnBase: e }) }), Me.client;
475
+ return (!Me || Me.base !== e) && (Me = { base: e, client: Ln({ cdnBase: e }) }), Me.client;
476
476
  }
477
477
  function Ve(e) {
478
- return !vt(e) || !qa() ? null : tt().urlFor(e);
478
+ return !St(e) || !qa() ? null : tt().urlFor(e);
479
479
  }
480
- function jo(e) {
480
+ function Do(e) {
481
481
  return e.kind === "file";
482
482
  }
483
483
  class Ha extends Error {
@@ -505,42 +505,42 @@ function Ue(e) {
505
505
  return "Image upload failed";
506
506
  }
507
507
  }
508
- function Ro(e) {
508
+ function Lo(e) {
509
509
  return e instanceof mt ? Ue(e.reason) : e instanceof Ha ? e.message : "Image upload failed";
510
510
  }
511
- function Po(e) {
511
+ function Oo(e) {
512
512
  const t = e.type.toLowerCase().split(";")[0].trim();
513
- return t && Dn(t) !== "image" ? Ue("unsupported-type") : e.size > Ln.image ? Ue("too-large") : e.size === 0 ? Ue("invalid") : null;
513
+ return t && On(t) !== "image" ? Ue("unsupported-type") : e.size > qn.image ? Ue("too-large") : e.size === 0 ? Ue("invalid") : null;
514
514
  }
515
- function Mo(e) {
516
- return qn(e);
515
+ function qo(e) {
516
+ return Un(e);
517
517
  }
518
- function Do(e) {
519
- return Hn(e);
518
+ function Ho(e) {
519
+ return $n(e);
520
520
  }
521
- async function Lo(e) {
522
- const t = await On(e);
521
+ async function Uo(e) {
522
+ const t = await Hn(e);
523
523
  return { w: t?.width ?? 0, h: t?.height ?? 0 };
524
524
  }
525
- async function Oo(e, t = {}) {
525
+ async function $o(e, t = {}) {
526
526
  const a = await tt().upload(e, { signal: t.signal });
527
- if (!vt(a.key))
527
+ if (!St(a.key))
528
528
  throw new Ha("Image upload returned an unusable key");
529
529
  return { key: a.key, deduplicated: a.deduplicated === !0 };
530
530
  }
531
- async function qo(e, t = {}) {
531
+ async function Fo(e, t = {}) {
532
532
  const a = [];
533
533
  for (const n of e) {
534
534
  if (n.kind === "remote") {
535
535
  a.push({ key: n.key, w: n.w, h: n.h, ...n.title ? { title: n.title } : {} });
536
536
  continue;
537
537
  }
538
- const { key: o } = await Oo(n.file, t);
538
+ const { key: o } = await $o(n.file, t);
539
539
  a.push({ key: o, w: n.w, h: n.h });
540
540
  }
541
541
  return a;
542
542
  }
543
- function Ho(e) {
543
+ function zo(e) {
544
544
  return {
545
545
  error: e instanceof Error ? e.message : String(e),
546
546
  name: e instanceof Error ? e.name : typeof e,
@@ -551,40 +551,40 @@ function Ho(e) {
551
551
  function at(e) {
552
552
  return e.key === "Escape" || e.key === "GoBack" || e.key === "BrowserBack" || e.key === "XF86Back" || e.keyCode === 461 || e.keyCode === 10009;
553
553
  }
554
- function Uo(e) {
554
+ function Wo(e) {
555
555
  return `/tv?return=${encodeURIComponent(e.pathname + e.search)}`;
556
556
  }
557
- function $o({ className: e }) {
557
+ function Bo({ className: e }) {
558
558
  return /* @__PURE__ */ l(
559
559
  "a",
560
560
  {
561
- href: Uo(window.location),
561
+ href: Wo(window.location),
562
562
  className: e,
563
563
  "data-testid": "sign-in-with-code",
564
564
  children: "Sign in with a code"
565
565
  }
566
566
  );
567
567
  }
568
- const ht = 240, fe = 8, Fo = 28, Ua = 240;
569
- function zo(e, t, a) {
568
+ const ht = 240, fe = 8, Go = 28, Ua = 240;
569
+ function Ko(e, t, a) {
570
570
  let n = t.left - ht - fe;
571
571
  n < fe && (n = t.right + fe), n = Math.min(n, a.width - ht - fe), n = Math.max(fe, n);
572
- const o = Ua + Fo;
572
+ const o = Ua + Go;
573
573
  let r = e.top + e.height / 2 - o / 2;
574
574
  return r = Math.min(r, a.height - o - fe), r = Math.max(fe, r), { left: n, top: r };
575
575
  }
576
- const $a = "/dataplatform/api/memes", Wo = 120;
577
- function Bo({ onClose: e, onPick: t, onUnavailable: a, toggle: n }) {
578
- const [o, r] = N(""), f = U(null), s = U(null), c = tt(), { items: g, loading: u, error: x, hasMore: S, loadMore: I } = ro(
576
+ const $a = "/dataplatform/api/memes", Vo = 120;
577
+ function Yo({ onClose: e, onPick: t, onUnavailable: a, toggle: n }) {
578
+ const [o, r] = N(""), f = U(null), s = U(null), c = tt(), { items: u, loading: m, error: x, hasMore: S, loadMore: I } = so(
579
579
  c,
580
580
  $a,
581
581
  o.trim()
582
582
  ), R = x?.reason ?? null, y = F(() => {
583
583
  const E = /* @__PURE__ */ new Set();
584
- return g.filter((j) => E.has(j.key) ? !1 : (E.add(j.key), !0));
585
- }, [g]), [d, b] = N(null), h = U(null), _ = D(() => {
584
+ return u.filter((j) => E.has(j.key) ? !1 : (E.add(j.key), !0));
585
+ }, [u]), [d, b] = N(null), h = U(null), _ = D(() => {
586
586
  h.current !== null && (window.clearTimeout(h.current), h.current = null);
587
- }, []), k = D(() => {
587
+ }, []), v = D(() => {
588
588
  _(), b(null);
589
589
  }, [_]), P = typeof window < "u" && typeof window.matchMedia == "function" && window.matchMedia("(hover: hover)").matches, O = D(
590
590
  (E, j, A = !1) => {
@@ -592,12 +592,12 @@ function Bo({ onClose: e, onPick: t, onUnavailable: a, toggle: n }) {
592
592
  if (!q) return;
593
593
  const H = () => b({
594
594
  item: E,
595
- ...zo(j.getBoundingClientRect(), q.getBoundingClientRect(), {
595
+ ...Ko(j.getBoundingClientRect(), q.getBoundingClientRect(), {
596
596
  width: window.innerWidth,
597
597
  height: window.innerHeight
598
598
  })
599
599
  });
600
- _(), A ? H() : h.current = window.setTimeout(H, Wo);
600
+ _(), A ? H() : h.current = window.setTimeout(H, Vo);
601
601
  },
602
602
  [_]
603
603
  );
@@ -618,7 +618,7 @@ function Bo({ onClose: e, onPick: t, onUnavailable: a, toggle: n }) {
618
618
  }, [e, n]);
619
619
  const z = D((E) => {
620
620
  t(E), e();
621
- }, [t, e]), W = !u && !x && y.length === 0;
621
+ }, [t, e]), W = !m && !x && y.length === 0;
622
622
  return /* @__PURE__ */ w(
623
623
  "div",
624
624
  {
@@ -645,8 +645,8 @@ function Bo({ onClose: e, onPick: t, onUnavailable: a, toggle: n }) {
645
645
  "div",
646
646
  {
647
647
  className: "flex-1 overflow-y-auto p-2",
648
- onScroll: k,
649
- onMouseLeave: k,
648
+ onScroll: v,
649
+ onMouseLeave: v,
650
650
  children: [
651
651
  x && /* @__PURE__ */ l(
652
652
  "p",
@@ -656,7 +656,7 @@ function Bo({ onClose: e, onPick: t, onUnavailable: a, toggle: n }) {
656
656
  "data-reason": R,
657
657
  children: R === "unauthenticated" ? /* @__PURE__ */ w(te, { children: [
658
658
  "Sign in to browse memes · ",
659
- /* @__PURE__ */ l($o, { className: "underline text-on-danger-bg" })
659
+ /* @__PURE__ */ l(Bo, { className: "underline text-on-danger-bg" })
660
660
  ] }) : R === "forbidden" ? "Your account can't browse the meme library" : "Meme library is unavailable"
661
661
  }
662
662
  ),
@@ -673,9 +673,9 @@ function Bo({ onClose: e, onPick: t, onUnavailable: a, toggle: n }) {
673
673
  onMouseEnter: (A) => {
674
674
  P && O(E, A.currentTarget);
675
675
  },
676
- onMouseLeave: k,
676
+ onMouseLeave: v,
677
677
  onFocus: (A) => O(E, A.currentTarget, !0),
678
- onBlur: k,
678
+ onBlur: v,
679
679
  className: "group relative aspect-square overflow-hidden rounded border border-border-light bg-bg-alt focus:outline-none focus:border-primary hover:border-primary",
680
680
  children: /* @__PURE__ */ l(
681
681
  "img",
@@ -691,8 +691,8 @@ function Bo({ onClose: e, onPick: t, onUnavailable: a, toggle: n }) {
691
691
  E.key
692
692
  ) : null;
693
693
  }) }),
694
- u && /* @__PURE__ */ l("p", { className: "p-2 text-center text-xs text-text-secondary", children: "Loading…" }),
695
- S && !u && /* @__PURE__ */ l(
694
+ m && /* @__PURE__ */ l("p", { className: "p-2 text-center text-xs text-text-secondary", children: "Loading…" }),
695
+ S && !m && /* @__PURE__ */ l(
696
696
  "button",
697
697
  {
698
698
  type: "button",
@@ -743,40 +743,40 @@ function Bo({ onClose: e, onPick: t, onUnavailable: a, toggle: n }) {
743
743
  }
744
744
  );
745
745
  }
746
- function Go({ open: e, ...t }) {
747
- return e ? /* @__PURE__ */ l(Bo, { ...t }) : null;
746
+ function Jo({ open: e, ...t }) {
747
+ return e ? /* @__PURE__ */ l(Yo, { ...t }) : null;
748
748
  }
749
- const Ct = {
750
- serverOrigin: `http://localhost:${xt}`,
749
+ const Et = {
750
+ serverOrigin: `http://localhost:${Ea}`,
751
751
  defaultRoomKey: "dev-room",
752
- cdnBase: Sa
752
+ cdnBase: Ta
753
753
  };
754
- let $e = { ...Ct };
755
- function Ko(e) {
754
+ let $e = { ...Et };
755
+ function Xo(e) {
756
756
  const t = Object.fromEntries(
757
757
  Object.entries(e).filter(([a, n]) => n !== void 0)
758
758
  );
759
- $e = { ...$e, ...t }, No({ cdnBase: $e.cdnBase });
759
+ $e = { ...$e, ...t }, Mo({ cdnBase: $e.cdnBase });
760
760
  }
761
761
  function Ce() {
762
762
  return $e;
763
763
  }
764
- const Vo = kt(Ct);
765
- function Yo(e) {
764
+ const Qo = xt(Et);
765
+ function Zo(e) {
766
766
  return e.serverOrigin?.replace(/\/$/, "") || "";
767
767
  }
768
768
  function Fa() {
769
- return Yo(Ce());
769
+ return Zo(Ce());
770
770
  }
771
- const za = kt(null);
771
+ const za = xt(null);
772
772
  function Wa() {
773
- return ba(za);
773
+ return ya(za);
774
774
  }
775
- const Ba = kt(!0);
775
+ const Ba = xt(!0);
776
776
  function Ga() {
777
- const e = ba(Ba);
777
+ const e = ya(Ba);
778
778
  M(() => {
779
- e && Un();
779
+ e && Fn();
780
780
  }, [e]);
781
781
  }
782
782
  function Ka(e) {
@@ -788,7 +788,7 @@ const we = Ke.memo(
788
788
  },
789
789
  (e, t) => e.html === t.html && e.as === t.as && e.className === t.className && JSON.stringify(e.style) === JSON.stringify(t.style)
790
790
  );
791
- function Jo(e, t) {
791
+ function er(e, t) {
792
792
  M(() => {
793
793
  const a = e.current;
794
794
  if (!a || !t || typeof IntersectionObserver > "u") return;
@@ -800,6 +800,11 @@ function Jo(e, t) {
800
800
  };
801
801
  }, [e, t]);
802
802
  }
803
+ function Va() {
804
+ if (typeof window > "u") return null;
805
+ const e = window.location;
806
+ return (e.hostname === "localhost" || e.hostname === "127.0.0.1") && e.port === String(lo) ? `${e.protocol}//${e.hostname}:${Ea}` : null;
807
+ }
803
808
  const oe = {
804
809
  ANON_KEY: "watchparty_preferences",
805
810
  DEBUG_FLAG: "wp:debug",
@@ -822,7 +827,7 @@ function B(e) {
822
827
  return null;
823
828
  }
824
829
  }
825
- function Et(e, t) {
830
+ function It(e, t) {
826
831
  try {
827
832
  const a = nt();
828
833
  return a ? (a.setItem(e, t), !0) : !1;
@@ -830,7 +835,7 @@ function Et(e, t) {
830
835
  return !1;
831
836
  }
832
837
  }
833
- function Xo() {
838
+ function tr() {
834
839
  try {
835
840
  const e = nt();
836
841
  if (!e) return [];
@@ -844,51 +849,51 @@ function Xo() {
844
849
  return [];
845
850
  }
846
851
  }
847
- function ke(e) {
852
+ function ve(e) {
848
853
  try {
849
854
  nt()?.removeItem(e);
850
855
  } catch {
851
856
  }
852
857
  }
853
- function Qo(e) {
858
+ function ar(e) {
854
859
  const t = B(e);
855
860
  return t === null ? null : t === "true" ? !0 : t === "false" ? !1 : null;
856
861
  }
857
- const Va = /* @__PURE__ */ new Map();
858
- let Ya = !1;
862
+ const Ya = /* @__PURE__ */ new Map();
863
+ let Ja = !1;
859
864
  function ot(e, t) {
860
- Va.set(e, t), Ya && Ja(e, t);
865
+ Ya.set(e, t), Ja && Xa(e, t);
861
866
  }
862
- function Zo() {
863
- Ya = !0;
864
- for (const [e, t] of Va) Ja(e, t);
867
+ function nr() {
868
+ Ja = !0;
869
+ for (const [e, t] of Ya) Xa(e, t);
865
870
  }
866
- function Ja(e, t) {
871
+ function Xa(e, t) {
867
872
  typeof window > "u" || (window[e] = t);
868
873
  }
869
- const be = [], er = 500;
874
+ const be = [], or = 500;
870
875
  let Fe = [], pt = null;
871
- const tr = 1e3, ar = 200;
876
+ const rr = 1e3, ir = 200;
872
877
  let bt = null;
873
- function Xa(e) {
878
+ function Qa(e) {
874
879
  bt = e;
875
880
  }
876
- function Qa() {
881
+ function Za() {
877
882
  return B(oe.REPORT_LOGS_FLAG) === "true";
878
883
  }
879
- function nr() {
884
+ function fr() {
880
885
  if (typeof window > "u") return !1;
881
886
  if (window.__WP_DEBUG__ || new URLSearchParams(window.location.search).get("debug") === "true") return !0;
882
887
  const t = B(oe.DEBUG_FLAG);
883
888
  return t !== null && t !== "false";
884
889
  }
885
- function or() {
890
+ function sr() {
886
891
  const e = B(oe.DEBUG_FLAG);
887
892
  if (!e || e === "true") return null;
888
893
  const t = e.split(",").map((a) => a.trim().toLowerCase()).filter(Boolean);
889
894
  return t.length > 0 ? new Set(t) : null;
890
895
  }
891
- function rr() {
896
+ function lr() {
892
897
  return (/* @__PURE__ */ new Date()).toLocaleTimeString("en-US", {
893
898
  hour12: !1,
894
899
  hour: "2-digit",
@@ -897,8 +902,8 @@ function rr() {
897
902
  fractionalSecondDigits: 3
898
903
  });
899
904
  }
900
- function ir(e) {
901
- be.push(e), be.length > er && be.shift();
905
+ function cr(e) {
906
+ be.push(e), be.length > or && be.shift();
902
907
  }
903
908
  const it = {
904
909
  debug: "color: #64748b; font-weight: normal;",
@@ -907,14 +912,14 @@ const it = {
907
912
  category: "color: #3b82f6; font-weight: bold;",
908
913
  time: "color: #6b7280; font-weight: normal;"
909
914
  };
910
- function fr(e) {
915
+ function dr(e) {
911
916
  try {
912
917
  return JSON.stringify(e);
913
918
  } catch {
914
919
  return "[unserializable]";
915
920
  }
916
921
  }
917
- function It(e, t, a, n, o, r, f) {
922
+ function At(e, t, a, n, o, r, f) {
918
923
  const s = {
919
924
  level: e,
920
925
  category: o,
@@ -922,47 +927,47 @@ function It(e, t, a, n, o, r, f) {
922
927
  data: f,
923
928
  timestamp: Date.now()
924
929
  };
925
- if (ir(s), (a || Qa()) && Wt(s), !n) {
926
- if (!nr()) return;
927
- const u = or();
928
- if (u && !u.has(o.toLowerCase())) return;
930
+ if (cr(s), (a || Za()) && Bt(s), !n) {
931
+ if (!fr()) return;
932
+ const m = sr();
933
+ if (m && !m.has(o.toLowerCase())) return;
929
934
  }
930
- const c = rr(), g = f !== void 0 ? " " + fr(f) : "";
935
+ const c = lr(), u = f !== void 0 ? " " + dr(f) : "";
931
936
  t(
932
- `%c[${c}]%c [${o}]%c ${r}${g}`,
937
+ `%c[${c}]%c [${o}]%c ${r}${u}`,
933
938
  it.time,
934
939
  it.category,
935
940
  it[e]
936
941
  );
937
942
  }
938
943
  function p(e, t, a) {
939
- It("debug", console.log, !1, !1, e, t, a);
944
+ At("debug", console.log, !1, !1, e, t, a);
940
945
  }
941
946
  function L(e, t, a) {
942
- It("warn", console.warn, !0, !1, e, t, a);
947
+ At("warn", console.warn, !0, !1, e, t, a);
943
948
  }
944
949
  function ze(e, t, a) {
945
- It("error", console.error, !0, !0, e, t, a);
950
+ At("error", console.error, !0, !0, e, t, a);
946
951
  }
947
- function sr() {
952
+ function ur() {
948
953
  return [...be];
949
954
  }
950
- function lr() {
955
+ function mr() {
951
956
  be.length = 0;
952
957
  }
953
- function cr(e) {
958
+ function gr(e) {
954
959
  const t = e && e.length > 0 ? e.join(",") : "true";
955
- Et(oe.DEBUG_FLAG, t), console.log("[wp] Debug mode enabled");
960
+ It(oe.DEBUG_FLAG, t), console.log("[wp] Debug mode enabled");
956
961
  }
957
- function dr() {
958
- ke(oe.DEBUG_FLAG), console.log("[wp] Debug mode disabled");
962
+ function hr() {
963
+ ve(oe.DEBUG_FLAG), console.log("[wp] Debug mode disabled");
959
964
  }
960
- const ur = 1024, mr = 5e4;
961
- function gr(e) {
965
+ const pr = 1024, br = 5e4;
966
+ function yr(e) {
962
967
  if (e == null) return e;
963
968
  try {
964
969
  const t = JSON.stringify(e);
965
- if (t.length <= ur) return e;
970
+ if (t.length <= pr) return e;
966
971
  if (typeof e == "object" && !Array.isArray(e)) {
967
972
  const a = {};
968
973
  for (const [n, o] of Object.entries(e)) {
@@ -976,21 +981,18 @@ function gr(e) {
976
981
  return "[unserializable]";
977
982
  }
978
983
  }
979
- async function hr() {
984
+ async function _r() {
980
985
  if (Fe.length === 0) return;
981
986
  const e = Fe;
982
987
  Fe = [], pt = null;
983
988
  try {
984
989
  let a = Ce().serverOrigin || "";
985
- if ((a === "/" || !a) && typeof window < "u") {
986
- const s = window.location;
987
- (s.hostname === "localhost" || s.hostname === "127.0.0.1") && s.port === String(Ca) ? a = `${s.protocol}//${s.hostname}:${xt}` : a = s.origin;
988
- }
990
+ (a === "/" || !a) && typeof window < "u" && (a = Va() ?? window.location.origin);
989
991
  const n = `${a.replace(/\/$/, "")}/api/client-log`, o = e.map((s) => ({
990
992
  level: s.level,
991
993
  category: s.category,
992
994
  message: s.message,
993
- data: gr(s.data),
995
+ data: yr(s.data),
994
996
  timestamp: s.timestamp,
995
997
  url: typeof window < "u" ? window.location.href : void 0,
996
998
  userAgent: typeof navigator < "u" ? navigator.userAgent : void 0,
@@ -1000,7 +1002,7 @@ async function hr() {
1000
1002
  let r = [], f = 0;
1001
1003
  for (const s of o) {
1002
1004
  const c = JSON.stringify(s).length + 1;
1003
- f + c > mr && r.length > 0 && (await fetch(n, {
1005
+ f + c > br && r.length > 0 && (await fetch(n, {
1004
1006
  method: "POST",
1005
1007
  headers: { "Content-Type": "application/json" },
1006
1008
  body: JSON.stringify({ logs: r })
@@ -1015,11 +1017,11 @@ async function hr() {
1015
1017
  console.warn("[wp] log flush failed (client logs may be lost):", Ee(t).error);
1016
1018
  }
1017
1019
  }
1018
- function Wt(e) {
1020
+ function Bt(e) {
1019
1021
  if (Fe.push(e), !pt) {
1020
- const t = Qa() ? ar : tr;
1022
+ const t = Za() ? ir : rr;
1021
1023
  pt = setTimeout(() => {
1022
- hr();
1024
+ _r();
1023
1025
  }, t);
1024
1026
  }
1025
1027
  }
@@ -1027,16 +1029,16 @@ function Ee(e) {
1027
1029
  return e instanceof Error ? { error: e.message, name: e.name } : { error: String(e), name: typeof e };
1028
1030
  }
1029
1031
  ot("__wpDebug", {
1030
- enable: cr,
1031
- disable: dr,
1032
- history: sr,
1033
- clear: lr
1032
+ enable: gr,
1033
+ disable: hr,
1034
+ history: ur,
1035
+ clear: mr
1034
1036
  });
1035
- const pr = 1280;
1036
- function br(e) {
1037
- return e.screenWidth < pr ? !1 : e.noHoverNoPointer || e.anyHoverNone && e.maxTouchPoints === 0;
1037
+ const wr = 1280;
1038
+ function vr(e) {
1039
+ return e.screenWidth < wr ? !1 : e.noHoverNoPointer || e.anyHoverNone && e.maxTouchPoints === 0;
1038
1040
  }
1039
- function yr() {
1041
+ function kr() {
1040
1042
  const e = (t) => typeof window < "u" && typeof window.matchMedia == "function" && window.matchMedia(t).matches;
1041
1043
  return {
1042
1044
  noHoverNoPointer: e("(hover: none) and (pointer: none)"),
@@ -1045,57 +1047,57 @@ function yr() {
1045
1047
  screenWidth: typeof screen < "u" ? screen.width : 0
1046
1048
  };
1047
1049
  }
1048
- let Bt = null;
1049
- function _r() {
1050
- return Bt ??= br(yr()), Bt;
1050
+ let Gt = null;
1051
+ function xr() {
1052
+ return Gt ??= vr(kr()), Gt;
1051
1053
  }
1052
- function Gt() {
1053
- return _r();
1054
+ function Kt() {
1055
+ return xr();
1054
1056
  }
1055
1057
  const ne = {
1056
1058
  resolved: !1,
1057
1059
  userType: "public",
1058
1060
  accountId: null
1059
1061
  };
1060
- function At() {
1062
+ function Nt() {
1061
1063
  return ne.accountId ? ne.accountId : ne.resolved && ne.userType === "public" ? "anon" : null;
1062
1064
  }
1063
- function wr(e) {
1065
+ function Sr(e) {
1064
1066
  ne.resolved = !0, e.userType && (ne.userType = e.userType), e.userId !== void 0 && (ne.accountId = e.userId && e.userId !== "public" ? e.userId : null);
1065
1067
  }
1066
- function Nt() {
1068
+ function jt() {
1067
1069
  return ne.accountId ?? "public";
1068
1070
  }
1069
- function kr() {
1070
- return At() ?? "unscoped";
1071
+ function Tr() {
1072
+ return Nt() ?? "unscoped";
1071
1073
  }
1072
- function Za(e) {
1073
- return et(e) ? xo[e] : "var(--color-neutral-bg)";
1074
+ function en(e) {
1075
+ return et(e) ? eo[e] : "var(--color-neutral-bg)";
1074
1076
  }
1075
- function vr(e) {
1076
- return et(e) ? `${Ce().serverOrigin.replace(/\/$/, "")}${Vn(e)}` : void 0;
1077
+ function Cr(e) {
1078
+ return et(e) ? `${Ce().serverOrigin.replace(/\/$/, "")}${Zn(e)}` : void 0;
1077
1079
  }
1078
- let ve = null, De = null;
1079
- function xr() {
1080
- return ve ? Promise.resolve() : De || (De = (async () => {
1080
+ let ke = null, De = null;
1081
+ function Er() {
1082
+ return ke ? Promise.resolve() : De || (De = (async () => {
1081
1083
  try {
1082
1084
  const e = Ce().serverOrigin.replace(/\/$/, ""), t = await fetch(`${e}/media/sprites/names.json`, { cache: "no-cache" });
1083
1085
  if (!t.ok) return;
1084
1086
  const a = await t.json();
1085
- ve = a, ot("__DISPLAY_NAMES__", a), p("characters", "Loaded display names", a);
1087
+ ke = a, ot("__DISPLAY_NAMES__", a), p("characters", "Loaded display names", a);
1086
1088
  } catch (e) {
1087
1089
  p("characters", "display names fetch failed (degrading to sprite IDs)", Ee(e));
1088
1090
  }
1089
1091
  })(), De);
1090
1092
  }
1091
1093
  function xe(e) {
1092
- return ve?.[e] || e.charAt(0).toUpperCase() + e.slice(1);
1094
+ return ke?.[e] || e.charAt(0).toUpperCase() + e.slice(1);
1093
1095
  }
1094
1096
  function le(e) {
1095
1097
  const t = e.toLowerCase();
1096
- return Ze.some((a) => a === t) ? !0 : ve ? Object.values(ve).some((a) => a.toLowerCase() === t) : !1;
1098
+ return Ze.some((a) => a === t) ? !0 : ke ? Object.values(ke).some((a) => a.toLowerCase() === t) : !1;
1097
1099
  }
1098
- const Sr = i.object({
1100
+ const Ir = i.object({
1099
1101
  // Identity. There is deliberately NO `name`: a person's name is their
1100
1102
  // hadoku key-registry name, resolved by the server from whoami and renamed
1101
1103
  // through hadoku_site's POST /session/name (operator decision 2026-10-08).
@@ -1124,18 +1126,18 @@ const Sr = i.object({
1124
1126
  preferredAudioLang: i.string().optional(),
1125
1127
  subtitlesEnabled: i.boolean().optional(),
1126
1128
  subtitleStyle: i.string().optional()
1127
- }), ye = Qn({
1129
+ }), ye = Yn({
1128
1130
  appId: "watchparty",
1129
- schema: Sr
1130
- }), Tr = /* @__PURE__ */ new Set(["theme", "themeMode"]);
1131
+ schema: Ir
1132
+ }), Ar = /* @__PURE__ */ new Set(["theme", "themeMode"]);
1131
1133
  function Ye(e) {
1132
- const t = At();
1134
+ const t = Nt();
1133
1135
  return t ? `prefs-cache:${t}:${e}` : null;
1134
1136
  }
1135
- function Cr() {
1136
- return At() === null;
1137
+ function Nr() {
1138
+ return Nt() === null;
1137
1139
  }
1138
- function Kt(e) {
1140
+ function Vt(e) {
1139
1141
  const t = Ye(e);
1140
1142
  if (!t) return {};
1141
1143
  const a = B(t);
@@ -1146,9 +1148,9 @@ function Kt(e) {
1146
1148
  return {};
1147
1149
  }
1148
1150
  }
1149
- function Er() {
1151
+ function jr() {
1150
1152
  let e = 0;
1151
- for (const t of Xo()) {
1153
+ for (const t of tr()) {
1152
1154
  const a = t.startsWith("prefs-cache:") && t.endsWith(":watchparty"), n = t === Je || t.startsWith(`${Je}:`) && !t.endsWith(":_serverSynced_v1");
1153
1155
  if (!a && !n) continue;
1154
1156
  const o = B(t);
@@ -1161,18 +1163,18 @@ function Er() {
1161
1163
  }
1162
1164
  const f = a ? r?.blob : r;
1163
1165
  if (!f || typeof f != "object" || !("name" in f)) continue;
1164
- const { name: s, ...c } = f, g = a ? { ...r, blob: c } : c;
1165
- Et(t, JSON.stringify(g)) && e++;
1166
+ const { name: s, ...c } = f, u = a ? { ...r, blob: c } : c;
1167
+ It(t, JSON.stringify(u)) && e++;
1166
1168
  }
1167
1169
  return e > 0 && p("preferences", "Stripped retired name from cached prefs rows", { rewritten: e }), e;
1168
1170
  }
1169
- let en = null, tn = null;
1170
- const Vt = /* @__PURE__ */ new Set();
1171
- function jt() {
1172
- if (Cr())
1171
+ let tn = null, an = null;
1172
+ const Yt = /* @__PURE__ */ new Set();
1173
+ function Rt() {
1174
+ if (Nr())
1173
1175
  return p("preferences", "Boot read deferred — session pending, identity unresolved"), {};
1174
- const e = Kt("portfolio"), t = Kt("watchparty"), a = Object.keys(e).length > 0 ? e : en ?? {}, n = Object.keys(t).length > 0 ? t : tn ?? {}, o = Nt() || "public";
1175
- if (Vt.has(o))
1176
+ const e = Vt("portfolio"), t = Vt("watchparty"), a = Object.keys(e).length > 0 ? e : tn ?? {}, n = Object.keys(t).length > 0 ? t : an ?? {}, o = jt() || "public";
1177
+ if (Yt.has(o))
1176
1178
  return p("preferences", "Loaded (sync, SDK-only after first read)", {
1177
1179
  uid: o,
1178
1180
  sdkThemeKeys: Object.keys(a).length,
@@ -1182,8 +1184,8 @@ function jt() {
1182
1184
  themeSource: Object.keys(e).length > 0 ? "cache" : "mem",
1183
1185
  appSource: Object.keys(t).length > 0 ? "cache" : "mem"
1184
1186
  }), { ...n, ...a };
1185
- Vt.add(o);
1186
- const r = nn() ?? {}, f = { ...r, ...n, ...a };
1187
+ Yt.add(o);
1188
+ const r = on() ?? {}, f = { ...r, ...n, ...a };
1187
1189
  return p("preferences", "Loaded (sync, first read — legacy + SDK)", {
1188
1190
  uid: o,
1189
1191
  sdkThemeKeys: Object.keys(a).length,
@@ -1193,30 +1195,30 @@ function jt() {
1193
1195
  appSource: Object.keys(t).length > 0 ? "cache" : "mem"
1194
1196
  }), f;
1195
1197
  }
1196
- let an = !1;
1197
- function Ir() {
1198
- const e = Nt();
1198
+ let nn = !1;
1199
+ function Rr() {
1200
+ const e = jt();
1199
1201
  return !e || e === "public";
1200
1202
  }
1201
1203
  function J(e, t) {
1202
- Ir() && (an = !0), Tr.has(e) ? pe.save({ [e]: t }, { scope: "device" }).catch((a) => L("preferences", "themePrefs.save failed", { key: e, err: a?.message })) : ye.save({ [e]: t }).catch((a) => L("preferences", "watchpartyPrefs.save failed", { key: e, err: a?.message })), p("preferences", "Saved (via SDK)", { key: e, value: t });
1204
+ Rr() && (nn = !0), Ar.has(e) ? pe.save({ [e]: t }, { scope: "device" }).catch((a) => L("preferences", "themePrefs.save failed", { key: e, err: a?.message })) : ye.save({ [e]: t }).catch((a) => L("preferences", "watchpartyPrefs.save failed", { key: e, err: a?.message })), p("preferences", "Saved (via SDK)", { key: e, value: t });
1203
1205
  }
1204
- let Le = null, Yt = !1;
1205
- function Ar() {
1206
+ let Le = null, Jt = !1;
1207
+ function Pr() {
1206
1208
  return Le || (Le = (async () => {
1207
1209
  if (typeof window > "u") return !1;
1208
1210
  try {
1209
- Yt || (Yt = !0, pe.subscribe((f) => {
1210
- en = f, Qt("portfolio", f), Zt("theme");
1211
+ Jt || (Jt = !0, pe.subscribe((f) => {
1212
+ tn = f, Zt("portfolio", f), ea("theme");
1211
1213
  }), ye.subscribe((f) => {
1212
- tn = f, Qt("watchparty", f), Zt("watchparty");
1214
+ an = f, Zt("watchparty", f), ea("watchparty");
1213
1215
  }));
1214
1216
  const [e, t] = await Promise.all([
1215
1217
  pe.read(),
1216
1218
  ye.read()
1217
1219
  ]);
1218
1220
  try {
1219
- const { useAppStore: f } = await Promise.resolve().then(() => ln);
1221
+ const { useAppStore: f } = await Promise.resolve().then(() => cn);
1220
1222
  f.getState().rehydrateFromPrefs();
1221
1223
  } catch (f) {
1222
1224
  L("preferences", "inline rehydrate after SDK read failed", { err: f?.message });
@@ -1228,7 +1230,7 @@ function Ar() {
1228
1230
  // Post-fetch cache state: should be non-zero if SDK wrote it.
1229
1231
  sdkThemeBytesPost: o?.length ?? 0,
1230
1232
  sdkAppBytesPost: r?.length ?? 0
1231
- }), await Nr(e, t), an ? (p("preferences", "Promoting this load's pre-auth picks to the signed-in user"), await Promise.all([
1233
+ }), await Mr(e, t), nn ? (p("preferences", "Promoting this load's pre-auth picks to the signed-in user"), await Promise.all([
1232
1234
  pe.promoteAnonPrefsToUser().catch(() => {
1233
1235
  }),
1234
1236
  ye.promoteAnonPrefsToUser().catch(() => {
@@ -1240,12 +1242,12 @@ function Ar() {
1240
1242
  })(), Le);
1241
1243
  }
1242
1244
  const Je = "watchparty_preferences";
1243
- Er();
1245
+ jr();
1244
1246
  function yt() {
1245
- const e = Nt();
1247
+ const e = jt();
1246
1248
  return !e || e === "public" ? Je : `${Je}:${e}`;
1247
1249
  }
1248
- function nn() {
1250
+ function on() {
1249
1251
  const e = B(yt());
1250
1252
  if (!e) return null;
1251
1253
  try {
@@ -1255,18 +1257,18 @@ function nn() {
1255
1257
  return null;
1256
1258
  }
1257
1259
  }
1258
- function Jt() {
1259
- ke(yt()), ke(`${yt()}:_serverSynced_v1`);
1260
+ function Xt() {
1261
+ ve(yt()), ve(`${yt()}:_serverSynced_v1`);
1260
1262
  }
1261
- async function Nr(e, t) {
1262
- const a = nn();
1263
+ async function Mr(e, t) {
1264
+ const a = on();
1263
1265
  if (!a || Object.keys(a).length === 0) return;
1264
1266
  const n = Object.keys(e ?? {}).length > 0, o = Object.keys(t ?? {}).length > 0, r = {}, f = {};
1265
- for (const [g, u] of Object.entries(a))
1266
- n || (g === "theme" && typeof u == "string" ? r.theme = u : g === "themeMode" && (u === "simple" || u === "advanced") && (r.themeMode = u)), o || (g === "chatCollapsed" && typeof u == "boolean" ? f.chatCollapsed = u : g === "floatingChatEnabled" && typeof u == "boolean" ? f.floatingChatEnabled = u : g === "volume" && typeof u == "number" && u >= 0 && u <= 1 ? f.volume = u : g === "muted" && typeof u == "boolean" ? f.muted = u : g === "preferredAudioLang" && typeof u == "string" ? f.preferredAudioLang = u : g === "subtitlesEnabled" && typeof u == "boolean" ? f.subtitlesEnabled = u : g === "subtitleStyle" && typeof u == "string" && (f.subtitleStyle = u));
1267
+ for (const [u, m] of Object.entries(a))
1268
+ n || (u === "theme" && typeof m == "string" ? r.theme = m : u === "themeMode" && (m === "simple" || m === "advanced") && (r.themeMode = m)), o || (u === "chatCollapsed" && typeof m == "boolean" ? f.chatCollapsed = m : u === "floatingChatEnabled" && typeof m == "boolean" ? f.floatingChatEnabled = m : u === "volume" && typeof m == "number" && m >= 0 && m <= 1 ? f.volume = m : u === "muted" && typeof m == "boolean" ? f.muted = m : u === "preferredAudioLang" && typeof m == "string" ? f.preferredAudioLang = m : u === "subtitlesEnabled" && typeof m == "boolean" ? f.subtitlesEnabled = m : u === "subtitleStyle" && typeof m == "string" && (f.subtitleStyle = m));
1267
1269
  const s = Object.keys(r), c = Object.keys(f);
1268
1270
  if (s.length === 0 && c.length === 0) {
1269
- Jt();
1271
+ Xt();
1270
1272
  return;
1271
1273
  }
1272
1274
  p("preferences", "Migrating legacy localStorage prefs to SDK", {
@@ -1279,15 +1281,15 @@ async function Nr(e, t) {
1279
1281
  await Promise.all([
1280
1282
  s.length > 0 ? pe.save(r, { scope: "device" }) : Promise.resolve(),
1281
1283
  c.length > 0 ? ye.save(f) : Promise.resolve()
1282
- ]), Jt(), p("preferences", "Legacy migration complete");
1283
- } catch (g) {
1284
+ ]), Xt(), p("preferences", "Legacy migration complete");
1285
+ } catch (u) {
1284
1286
  L("preferences", "Legacy migration save failed — will retry next load", {
1285
- err: g?.message
1287
+ err: u?.message
1286
1288
  });
1287
1289
  }
1288
1290
  }
1289
- let Xt = !1;
1290
- function Qt(e, t) {
1291
+ let Qt = !1;
1292
+ function Zt(e, t) {
1291
1293
  const a = Ye(e);
1292
1294
  if (a)
1293
1295
  try {
@@ -1299,15 +1301,15 @@ function Qt(e, t) {
1299
1301
  };
1300
1302
  localStorage.setItem(a, JSON.stringify(n));
1301
1303
  } catch (n) {
1302
- Xt || (Xt = !0, L("preferences", "writeThrough localStorage failed (in-memory backstop only)", {
1304
+ Qt || (Qt = !0, L("preferences", "writeThrough localStorage failed (in-memory backstop only)", {
1303
1305
  appId: e,
1304
1306
  err: n?.message,
1305
1307
  name: n?.name
1306
1308
  }));
1307
1309
  }
1308
1310
  }
1309
- function Zt(e) {
1310
- Promise.resolve().then(() => ln).then(({ useAppStore: t }) => {
1311
+ function ea(e) {
1312
+ Promise.resolve().then(() => cn).then(({ useAppStore: t }) => {
1311
1313
  try {
1312
1314
  t.getState().rehydrateFromPrefs();
1313
1315
  } catch (a) {
@@ -1315,18 +1317,18 @@ function Zt(e) {
1315
1317
  }
1316
1318
  }).catch((t) => L("preferences", "store import failed", { reason: e, err: t?.message }));
1317
1319
  }
1318
- const on = 24;
1320
+ const rn = 24;
1319
1321
  function _t(e) {
1320
1322
  if (!Array.isArray(e)) return [];
1321
1323
  const t = [];
1322
1324
  for (const a of e)
1323
- if (typeof a == "string" && a && a.length <= 32 && !t.includes(a) && t.push(a), t.length === on) break;
1325
+ if (typeof a == "string" && a && a.length <= 32 && !t.includes(a) && t.push(a), t.length === rn) break;
1324
1326
  return t;
1325
1327
  }
1326
- function jr(e, t) {
1327
- return [t, ...e.filter((a) => a !== t)].slice(0, on);
1328
+ function Dr(e, t) {
1329
+ return [t, ...e.filter((a) => a !== t)].slice(0, rn);
1328
1330
  }
1329
- function Rr() {
1331
+ function Lr() {
1330
1332
  const e = B(oe.RECENT_EMOJI);
1331
1333
  if (!e) return [];
1332
1334
  try {
@@ -1335,40 +1337,40 @@ function Rr() {
1335
1337
  return [];
1336
1338
  }
1337
1339
  }
1338
- function Pr() {
1339
- ke(oe.RECENT_EMOJI);
1340
+ function Or() {
1341
+ ve(oe.RECENT_EMOJI);
1340
1342
  }
1341
- const rn = 320, Xe = 240, Rt = 640, Mr = 320, Dr = 36, ea = 16;
1343
+ const fn = 320, Xe = 240, Pt = 640, qr = 320, Hr = 36, ta = 16;
1342
1344
  function Z(e, t) {
1343
- if (!Number.isFinite(e)) return rn;
1344
- let a = Rt;
1345
- return t !== void 0 && Number.isFinite(t) && t > 0 && (a = Math.min(a, t - Mr)), a = Math.max(a, Xe), Math.round(Math.min(a, Math.max(Xe, e)));
1345
+ if (!Number.isFinite(e)) return fn;
1346
+ let a = Pt;
1347
+ return t !== void 0 && Number.isFinite(t) && t > 0 && (a = Math.min(a, t - qr)), a = Math.max(a, Xe), Math.round(Math.min(a, Math.max(Xe, e)));
1346
1348
  }
1347
- function ta(e, t, a, n) {
1349
+ function aa(e, t, a, n) {
1348
1350
  return Z(e + (t - a), n);
1349
1351
  }
1350
- function Lr(e, t, a) {
1352
+ function Ur(e, t, a) {
1351
1353
  switch (t) {
1352
1354
  case "ArrowLeft":
1353
- return Z(e + ea, a);
1355
+ return Z(e + ta, a);
1354
1356
  case "ArrowRight":
1355
- return Z(e - ea, a);
1357
+ return Z(e - ta, a);
1356
1358
  case "Home":
1357
1359
  return Z(Xe, a);
1358
1360
  case "End":
1359
- return Z(Rt, a);
1361
+ return Z(Pt, a);
1360
1362
  default:
1361
1363
  return null;
1362
1364
  }
1363
1365
  }
1364
- function Or(e, t) {
1365
- return { collapsed: e, width: e ? Dr : t };
1366
+ function $r(e, t) {
1367
+ return { collapsed: e, width: e ? Hr : t };
1366
1368
  }
1367
- function fn(e, t) {
1369
+ function sn(e, t) {
1368
1370
  const a = new Set(t.map((r) => r.id)), n = t.reduce((r, f) => Math.max(r, f.ts), -1 / 0), o = e.filter((r) => !a.has(r.id) && r.ts > n);
1369
1371
  return o.length ? [...t, ...o] : t;
1370
1372
  }
1371
- const sn = 6e3, G = jt(), m = Kn((e, t) => ({
1373
+ const ln = 6e3, G = Rt(), g = Qn((e, t) => ({
1372
1374
  ready: !1,
1373
1375
  name: "",
1374
1376
  sprite: null,
@@ -1381,9 +1383,9 @@ const sn = 6e3, G = jt(), m = Kn((e, t) => ({
1381
1383
  chatJump: null,
1382
1384
  chatCollapsed: G.chatCollapsed ?? !1,
1383
1385
  chromeChatCollapsed: G.chromeChatCollapsed ?? !1,
1384
- chromeChatWidth: Z(G.chromeChatWidth ?? rn),
1386
+ chromeChatWidth: Z(G.chromeChatWidth ?? fn),
1385
1387
  // The account's list, else what this browser kept before it moved to prefs.
1386
- recentEmoji: G.recentEmoji !== void 0 ? _t(G.recentEmoji) : Rr(),
1388
+ recentEmoji: G.recentEmoji !== void 0 ? _t(G.recentEmoji) : Lr(),
1387
1389
  // Hardcoded on for everyone — the per-user toggle was removed from the
1388
1390
  // control bar; FloatingChat + toggleFloatingChat code is kept for future
1389
1391
  // re-enablement but the value is no longer user-controllable.
@@ -1430,7 +1432,7 @@ const sn = 6e3, G = jt(), m = Kn((e, t) => ({
1430
1432
  const r = xe(a.sprite);
1431
1433
  return p("store", "Auto-identity: deriving name from the requested sprite", { name: r, sprite: a.sprite }), { name: r };
1432
1434
  }
1433
- const n = Object.values(a.roster).map((r) => r.sprite), o = va(n, void 0, Ze);
1435
+ const n = Object.values(a.roster).map((r) => r.sprite), o = xa(n, void 0, Ze);
1434
1436
  if (o) {
1435
1437
  const r = xe(o);
1436
1438
  return p("store", "Auto-identity assigned", { name: r, sprite: o }), { name: r, sprite: o };
@@ -1485,7 +1487,7 @@ const sn = 6e3, G = jt(), m = Kn((e, t) => ({
1485
1487
  return delete o[a.clientId], { chat: [...n.chat, a].slice(-500), typing: o };
1486
1488
  });
1487
1489
  },
1488
- setChat: (a) => e((n) => ({ chat: fn(n.chat, a).slice(-500) })),
1490
+ setChat: (a) => e((n) => ({ chat: sn(n.chat, a).slice(-500) })),
1489
1491
  setReplyingTo: (a) => e(() => ({ replyingTo: a })),
1490
1492
  setReactions: (a, n) => e((o) => {
1491
1493
  const r = o.chat.findIndex((s) => s.id === a);
@@ -1496,12 +1498,12 @@ const sn = 6e3, G = jt(), m = Kn((e, t) => ({
1496
1498
  setTyping: (a, n) => e((o) => {
1497
1499
  if (!n && !(a in o.typing)) return {};
1498
1500
  const r = { ...o.typing };
1499
- return n ? r[a] = Date.now() + sn : delete r[a], { typing: r };
1501
+ return n ? r[a] = Date.now() + ln : delete r[a], { typing: r };
1500
1502
  }),
1501
1503
  jumpToMessage: (a) => e(() => ({ chatJump: { id: a, at: Date.now() } })),
1502
1504
  toggleChatCollapsed: () => e((a) => {
1503
1505
  const n = !a.chatCollapsed;
1504
- return Gt() || J("chatCollapsed", n), { chatCollapsed: n };
1506
+ return Kt() || J("chatCollapsed", n), { chatCollapsed: n };
1505
1507
  }),
1506
1508
  applyTvDefaults: () => e(() => ({ chatCollapsed: !0 })),
1507
1509
  toggleChromeChatCollapsed: () => e((a) => {
@@ -1513,8 +1515,8 @@ const sn = 6e3, G = jt(), m = Kn((e, t) => ({
1513
1515
  return J("chromeChatWidth", n), { chromeChatWidth: n };
1514
1516
  }),
1515
1517
  noteRecentEmoji: (a) => e((n) => {
1516
- const o = jr(n.recentEmoji, a);
1517
- return J("recentEmoji", o), Pr(), { recentEmoji: o };
1518
+ const o = Dr(n.recentEmoji, a);
1519
+ return J("recentEmoji", o), Or(), { recentEmoji: o };
1518
1520
  }),
1519
1521
  toggleFloatingChat: () => e((a) => {
1520
1522
  const n = !a.floatingChatEnabled;
@@ -1596,8 +1598,8 @@ const sn = 6e3, G = jt(), m = Kn((e, t) => ({
1596
1598
  moveTierlistItem: (a, n, o) => e((r) => {
1597
1599
  const f = {};
1598
1600
  for (const [s, c] of Object.entries(r.tierlistDraft)) {
1599
- const g = (c ?? []).filter((u) => u !== a);
1600
- g.length > 0 && (f[s] = g);
1601
+ const u = (c ?? []).filter((m) => m !== a);
1602
+ u.length > 0 && (f[s] = u);
1601
1603
  }
1602
1604
  if (n !== null) {
1603
1605
  const s = f[n] ?? [], c = Math.max(0, Math.min(o ?? s.length, s.length));
@@ -1610,8 +1612,8 @@ const sn = 6e3, G = jt(), m = Kn((e, t) => ({
1610
1612
  setGameSettings: (a) => e({ gameSettings: a }),
1611
1613
  setRoomKeyType: (a) => e({ roomKeyType: a }),
1612
1614
  rehydrateFromPrefs: () => e((a) => {
1613
- const n = jt(), o = {};
1614
- if (n.chatCollapsed !== void 0 && !Gt() && (o.chatCollapsed = n.chatCollapsed), n.chromeChatCollapsed !== void 0 && (o.chromeChatCollapsed = n.chromeChatCollapsed), n.chromeChatWidth !== void 0 && (o.chromeChatWidth = Z(n.chromeChatWidth)), n.recentEmoji !== void 0 && (o.recentEmoji = _t(n.recentEmoji)), ["volume", "muted", "preferredAudioLang", "subtitlesEnabled", "subtitleStyle"].some((s) => n[s] !== void 0)) {
1615
+ const n = Rt(), o = {};
1616
+ if (n.chatCollapsed !== void 0 && !Kt() && (o.chatCollapsed = n.chatCollapsed), n.chromeChatCollapsed !== void 0 && (o.chromeChatCollapsed = n.chromeChatCollapsed), n.chromeChatWidth !== void 0 && (o.chromeChatWidth = Z(n.chromeChatWidth)), n.recentEmoji !== void 0 && (o.recentEmoji = _t(n.recentEmoji)), ["volume", "muted", "preferredAudioLang", "subtitlesEnabled", "subtitleStyle"].some((s) => n[s] !== void 0)) {
1615
1617
  const s = { ...a.mediaPrefs };
1616
1618
  n.volume !== void 0 && (s.volume = n.volume), n.muted !== void 0 && (s.muted = n.muted), n.preferredAudioLang !== void 0 && (s.preferredAudioLang = n.preferredAudioLang), n.subtitlesEnabled !== void 0 && (s.subtitlesEnabled = n.subtitlesEnabled), n.subtitleStyle !== void 0 && ["classic", "cinema", "minimal", "contrast"].includes(n.subtitleStyle) && (s.subtitleStyle = n.subtitleStyle), o.mediaPrefs = s;
1617
1619
  }
@@ -1619,92 +1621,102 @@ const sn = 6e3, G = jt(), m = Kn((e, t) => ({
1619
1621
  }),
1620
1622
  setSidebarTab: (a) => e((n) => n.sidebarTab === a && a !== "chat" ? { sidebarTab: "chat" } : { sidebarTab: a, chatCollapsed: !1 })
1621
1623
  }));
1622
- ot("__ZUSTAND_STORE__", m);
1623
- const ln = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1624
+ ot("__ZUSTAND_STORE__", g);
1625
+ const cn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1624
1626
  __proto__: null,
1625
- TYPING_EXPIRE_MS: sn,
1626
- mergeHistory: fn,
1627
- useAppStore: m
1628
- }, Symbol.toStringTag, { value: "Module" })), qr = 5e3;
1629
- function Hr(e, t, a) {
1627
+ TYPING_EXPIRE_MS: ln,
1628
+ mergeHistory: sn,
1629
+ useAppStore: g
1630
+ }, Symbol.toStringTag, { value: "Module" })), Fr = 250, zr = 1e3;
1631
+ function wt(e) {
1632
+ return {
1633
+ path: e,
1634
+ transports: ["websocket", "polling"],
1635
+ tryAllTransports: !0,
1636
+ reconnectionDelay: Fr,
1637
+ reconnectionDelayMax: zr
1638
+ };
1639
+ }
1640
+ const Wr = 5e3;
1641
+ function Br(e, t, a) {
1630
1642
  return !!e?.some((n) => n.emoji === t && n.by.includes(a));
1631
1643
  }
1632
- function Ur(e, t, a) {
1644
+ function Gr(e, t, a) {
1633
1645
  let n = e ?? [];
1634
- for (const [o, r] of t) n = Yn(n, o, a, r.on) ?? n;
1646
+ for (const [o, r] of t) n = to(n, o, a, r.on) ?? n;
1635
1647
  return n;
1636
1648
  }
1637
- function $r(e, t, a, n) {
1649
+ function Kr(e, t, a, n) {
1638
1650
  const o = /* @__PURE__ */ new Map();
1639
1651
  for (const [r, f] of t)
1640
- f.expires <= n || Hr(e, r, a) !== f.on && o.set(r, f);
1652
+ f.expires <= n || Br(e, r, a) !== f.on && o.set(r, f);
1641
1653
  return o;
1642
1654
  }
1643
1655
  const Se = /* @__PURE__ */ new Map();
1644
- function Pt(e, t) {
1645
- if (t.intents = $r(t.confirmed, t.intents, t.handle, Date.now()), m.getState().setReactions(e, Ur(t.confirmed, t.intents, t.handle)), t.timer && clearTimeout(t.timer), t.timer = null, t.intents.size === 0) {
1656
+ function Mt(e, t) {
1657
+ if (t.intents = Kr(t.confirmed, t.intents, t.handle, Date.now()), g.getState().setReactions(e, Gr(t.confirmed, t.intents, t.handle)), t.timer && clearTimeout(t.timer), t.timer = null, t.intents.size === 0) {
1646
1658
  Se.delete(e);
1647
1659
  return;
1648
1660
  }
1649
1661
  const a = Math.min(...[...t.intents.values()].map((n) => n.expires));
1650
1662
  t.timer = setTimeout(() => {
1651
- Se.get(e) === t && Pt(e, t);
1663
+ Se.get(e) === t && Mt(e, t);
1652
1664
  }, Math.max(0, a - Date.now()));
1653
1665
  }
1654
- function Fr(e, t, a, n) {
1666
+ function Vr(e, t, a, n) {
1655
1667
  let o = Se.get(e);
1656
- o || (o = { confirmed: m.getState().chat.find((f) => f.id === e)?.reactions, intents: /* @__PURE__ */ new Map(), handle: n, timer: null }, Se.set(e, o)), o.handle = n, o.intents.delete(t), o.intents.set(t, { on: a, expires: Date.now() + qr }), Pt(e, o);
1668
+ o || (o = { confirmed: g.getState().chat.find((f) => f.id === e)?.reactions, intents: /* @__PURE__ */ new Map(), handle: n, timer: null }, Se.set(e, o)), o.handle = n, o.intents.delete(t), o.intents.set(t, { on: a, expires: Date.now() + Wr }), Mt(e, o);
1657
1669
  }
1658
- function zr(e, t) {
1670
+ function Yr(e, t) {
1659
1671
  const a = Se.get(e);
1660
1672
  if (!a) {
1661
- m.getState().setReactions(e, t);
1673
+ g.getState().setReactions(e, t);
1662
1674
  return;
1663
1675
  }
1664
- a.confirmed = t, Pt(e, a);
1676
+ a.confirmed = t, Mt(e, a);
1665
1677
  }
1666
- function cn(e) {
1678
+ function dn(e) {
1667
1679
  const t = typeof window < "u" ? window.location.href : "http://localhost/", a = new URL(e, t).pathname;
1668
1680
  return `${a.endsWith("/") ? a : `${a}/`}socket.io/`;
1669
1681
  }
1670
- function Wr(e) {
1682
+ function Jr(e) {
1671
1683
  const t = typeof window < "u" ? window.location.href : "http://localhost/", a = e.namespace ?? "/chat";
1672
1684
  return {
1673
1685
  url: `${new URL(e.origin, t).origin}${a.startsWith("/") ? a : `/${a}`}`,
1674
- path: e.path ?? cn(e.origin)
1686
+ path: e.path ?? dn(e.origin)
1675
1687
  };
1676
1688
  }
1677
1689
  let Q = null, X = null, We = null;
1678
- function aa(e) {
1679
- e && Q && e.origin === Q.origin && e.path === Q.path && e.namespace === Q.namespace || !e && !Q || (un(), Q = e);
1690
+ function na(e) {
1691
+ e && Q && e.origin === Q.origin && e.path === Q.path && e.namespace === Q.namespace || !e && !Q || (mn(), Q = e);
1680
1692
  }
1681
1693
  function Ie() {
1682
1694
  return Q !== null;
1683
1695
  }
1684
- function Br(e) {
1696
+ function Xr(e) {
1685
1697
  if (Q)
1686
1698
  if (We = e, X)
1687
1699
  X.connected && X.emit(T.JOIN, e);
1688
1700
  else {
1689
- const { url: t, path: a } = Wr(Q), n = gt(t, { path: a, transports: ["websocket", "polling"] });
1690
- X = n, p("chat", "External chat socket", { url: t, path: a }), gn(n), n.on(T.ERROR, (o) => {
1701
+ const { url: t, path: a } = Jr(Q), n = gt(t, wt(a));
1702
+ X = n, p("chat", "External chat socket", { url: t, path: a }), hn(n), n.on(T.ERROR, (o) => {
1691
1703
  const r = o?.message || o?.code || "chat error";
1692
- L("chat", `Chat server error: ${r}`, { code: o?.code }), m.getState().pushToast("error", r);
1704
+ L("chat", `Chat server error: ${r}`, { code: o?.code }), g.getState().pushToast("error", r);
1693
1705
  }), n.on("connect", () => {
1694
1706
  We && n.emit(T.JOIN, We);
1695
1707
  }), n.on("connect_error", (o) => L("chat", "Chat connection error", { message: o?.message }));
1696
1708
  }
1697
1709
  }
1698
- function Gr(e) {
1710
+ function Qr(e) {
1699
1711
  X?.emit(T.CHAT_SEND, e);
1700
1712
  }
1701
- function dn(e, t) {
1713
+ function un(e, t) {
1702
1714
  X?.connected && X.emit(e, t);
1703
1715
  }
1704
- function un() {
1716
+ function mn() {
1705
1717
  We = null, X && (X.disconnect(), X = null);
1706
1718
  }
1707
- function na(e, t) {
1719
+ function oa(e, t) {
1708
1720
  return {
1709
1721
  id: String(e.id ?? e.server_seq ?? t ?? `${Date.now()}-${Math.random().toString(36).slice(2, 8)}`),
1710
1722
  clientId: e.client_id,
@@ -1716,15 +1728,15 @@ function na(e, t) {
1716
1728
  // Attachments arrive from other clients, so the key shape is re-checked
1717
1729
  // here at the boundary rather than trusted at render time. A malformed
1718
1730
  // entry is dropped, not rendered and not allowed near an <img src>.
1719
- images: Array.isArray(e.images) ? e.images.filter((a) => !!a && vt(a.key)).slice(0, ae) : void 0,
1731
+ images: Array.isArray(e.images) ? e.images.filter((a) => !!a && St(a.key)).slice(0, ae) : void 0,
1720
1732
  isSystem: e.isSystem || !1,
1721
1733
  systemType: e.systemType,
1722
- template: e.isSystem && typeof e.template == "string" && e.template.includes(St) ? e.template : void 0,
1723
- replyTo: typeof e.reply_to == "string" && Na.test(e.reply_to) ? e.reply_to : void 0,
1724
- reactions: mn(e.reactions)
1734
+ template: e.isSystem && typeof e.template == "string" && e.template.includes(Tt) ? e.template : void 0,
1735
+ replyTo: typeof e.reply_to == "string" && ja.test(e.reply_to) ? e.reply_to : void 0,
1736
+ reactions: gn(e.reactions)
1725
1737
  };
1726
1738
  }
1727
- function mn(e) {
1739
+ function gn(e) {
1728
1740
  if (!Array.isArray(e)) return;
1729
1741
  const t = e.filter((a) => {
1730
1742
  const n = a;
@@ -1732,49 +1744,49 @@ function mn(e) {
1732
1744
  });
1733
1745
  return t.length ? t : void 0;
1734
1746
  }
1735
- function gn(e, t = () => !0) {
1747
+ function hn(e, t = () => !0) {
1736
1748
  e.on(T.CHAT_BROADCAST, (a) => {
1737
1749
  if (!t()) return;
1738
- const n = { ...na(a, a.server_seq), live: !0 };
1739
- m.getState().appendChat(n), p("chat", "Message received", n);
1750
+ const n = { ...oa(a, a.server_seq), live: !0 };
1751
+ g.getState().appendChat(n), p("chat", "Message received", n);
1740
1752
  }), e.on(T.CHAT_HISTORY, (a) => {
1741
1753
  if (!t() || !a?.messages || !Array.isArray(a.messages)) return;
1742
- const n = a.messages.map((o) => na(o));
1743
- m.getState().setChat(n), p("chat", "History loaded", { count: n.length });
1754
+ const n = a.messages.map((o) => oa(o));
1755
+ g.getState().setChat(n), p("chat", "History loaded", { count: n.length });
1744
1756
  }), e.on(T.CHAT_REACTION, (a) => {
1745
- t() && (!a || typeof a.id != "string" || zr(a.id, mn(a.reactions) ?? []));
1757
+ t() && (!a || typeof a.id != "string" || Yr(a.id, gn(a.reactions) ?? []));
1746
1758
  }), e.on(T.CHAT_TYPING, (a) => {
1747
- t() && (!a || typeof a.client_id != "string" || typeof a.typing != "boolean" || m.getState().setTyping(a.client_id, a.typing));
1759
+ t() && (!a || typeof a.client_id != "string" || typeof a.typing != "boolean" || g.getState().setTyping(a.client_id, a.typing));
1748
1760
  });
1749
1761
  }
1750
- let hn = null;
1751
- function Kr(e) {
1752
- hn = e;
1762
+ let pn = null;
1763
+ function Zr(e) {
1764
+ pn = e;
1753
1765
  }
1754
- function Vr(e = hn) {
1766
+ function ei(e = pn) {
1755
1767
  if (!e) return null;
1756
1768
  const t = typeof window < "u" ? window.location.href : "http://localhost/", a = e.namespace ?? "/room";
1757
1769
  return {
1758
1770
  url: `${new URL(e.origin, t).origin}${a.startsWith("/") ? a : `/${a}`}`,
1759
- path: e.path ?? cn(e.origin)
1771
+ path: e.path ?? dn(e.origin)
1760
1772
  };
1761
1773
  }
1762
- function Yr(e) {
1774
+ function ti(e) {
1763
1775
  return `${Fa()}/media/${e}`.replace(/\\/g, "/");
1764
1776
  }
1765
- function Jr(e, t) {
1766
- return Yr(t ?? `${e}/poster.jpg`);
1777
+ function ai(e, t) {
1778
+ return ti(t ?? `${e}/poster.jpg`);
1767
1779
  }
1768
- function Xr(e) {
1780
+ function ni(e) {
1769
1781
  return `${Fa()}${e}`.replace(/\\/g, "/");
1770
1782
  }
1771
- async function Qr(e) {
1783
+ async function oi(e) {
1772
1784
  try {
1773
- const t = await fetch(Xr("/api/tierlist"));
1785
+ const t = await fetch(ni("/api/tierlist"));
1774
1786
  if (!t.ok)
1775
1787
  return L("tierlist", "Board fetch failed", { status: t.status }), null;
1776
1788
  const a = await t.json();
1777
- return m.getState().setTierlistSnapshot(a, e), p("tierlist", "Board loaded", {
1789
+ return g.getState().setTierlistSnapshot(a, e), p("tierlist", "Board loaded", {
1778
1790
  items: a.items.length,
1779
1791
  voters: a.voterCount,
1780
1792
  placed: a.placed.length
@@ -1783,50 +1795,50 @@ async function Qr(e) {
1783
1795
  return L("tierlist", "Board fetch threw", Ee(t)), null;
1784
1796
  }
1785
1797
  }
1786
- let oa = !1;
1787
- function Zr() {
1788
- if (oa || typeof Image > "u") return;
1789
- const e = m.getState().tierlist;
1798
+ let ra = !1;
1799
+ function ri() {
1800
+ if (ra || typeof Image > "u") return;
1801
+ const e = g.getState().tierlist;
1790
1802
  if (!(!e || e.items.length === 0)) {
1791
- oa = !0;
1803
+ ra = !0;
1792
1804
  for (const t of e.items) {
1793
1805
  const a = new Image();
1794
- a.decoding = "async", a.src = Jr(t.id, t.thumbnail);
1806
+ a.decoding = "async", a.src = ai(t.id, t.thumbnail);
1795
1807
  }
1796
1808
  p("tierlist", "Warming posters", { count: e.items.length });
1797
1809
  }
1798
1810
  }
1799
- function ei() {
1800
- const e = m.getState(), t = va(Object.values(e.roster).map((o) => o.sprite), void 0, Ze);
1811
+ function ii() {
1812
+ const e = g.getState(), t = xa(Object.values(e.roster).map((o) => o.sprite), void 0, Ze);
1801
1813
  if (!t)
1802
1814
  return L("socket", "sprite_taken: no available sprites to retry with"), null;
1803
1815
  const a = !!e.name && !le(e.name), n = a ? e.name : xe(t);
1804
1816
  return p("socket", "sprite_taken: retrying with a free character", { from: e.sprite, to: t, name: n, keptCustomName: a }), e.setSessionIdentity(n, t), { name: n, sprite: t };
1805
1817
  }
1806
- function ti(e) {
1807
- const t = m.getState(), a = e ? t.roster[e] : void 0;
1818
+ function fi(e) {
1819
+ const t = g.getState(), a = e ? t.roster[e] : void 0;
1808
1820
  return !a || !!a.sprite && a.sprite === t.sprite;
1809
1821
  }
1810
- const ai = "hadoku:name";
1811
- function ni(e) {
1812
- const t = ao(e);
1822
+ const si = "hadoku:name";
1823
+ function li(e) {
1824
+ const t = ro(e);
1813
1825
  return et(t) ? t : null;
1814
1826
  }
1815
- async function oi(e = {}) {
1816
- const t = await to({
1827
+ async function ci(e = {}) {
1828
+ const t = await oo({
1817
1829
  ...e,
1818
1830
  onError: (n) => L("avatar", "Avatar settings read failed — keeping the auto-assigned character", Ee(n))
1819
1831
  }), a = et(t) ? t : null;
1820
1832
  return p("avatar", "Requested character from prefs-api", { sprite: a }), a;
1821
1833
  }
1822
- function ra(e) {
1834
+ function ia(e) {
1823
1835
  if (!e) return !1;
1824
- const t = m.getState();
1836
+ const t = g.getState();
1825
1837
  if (t.sprite === e) return !1;
1826
1838
  const n = !!(t.me.clientId && t.roster[t.me.clientId]?.registryName) || !t.name || !le(t.name) ? t.name : xe(e);
1827
1839
  return t.setSessionIdentity(n, e), !0;
1828
1840
  }
1829
- function ri(e, t, a) {
1841
+ function di(e, t, a) {
1830
1842
  if (!a) return () => {
1831
1843
  };
1832
1844
  const n = (o) => {
@@ -1835,26 +1847,26 @@ function ri(e, t, a) {
1835
1847
  };
1836
1848
  return a.addEventListener(e, n), () => a.removeEventListener(e, n);
1837
1849
  }
1838
- const ii = () => typeof window > "u" ? void 0 : window;
1839
- function fi(e, t = ii()) {
1840
- return ri(ai, (a) => {
1850
+ const ui = () => typeof window > "u" ? void 0 : window;
1851
+ function mi(e, t = ui()) {
1852
+ return di(si, (a) => {
1841
1853
  typeof a.name == "string" && a.name.trim() && e(a.name);
1842
1854
  }, t);
1843
1855
  }
1844
- const si = 10;
1845
- function li(e = typeof window < "u" ? window : void 0) {
1856
+ const gi = 10;
1857
+ function hi(e = typeof window < "u" ? window : void 0) {
1846
1858
  if (!e) return { framed: !1, depth: 0 };
1847
1859
  try {
1848
1860
  let t = 0, a = e;
1849
- for (; a !== a.parent && t < si; )
1861
+ for (; a !== a.parent && t < gi; )
1850
1862
  t++, a = a.parent;
1851
1863
  return { framed: e.top ? e.top !== e.self : t > 0, depth: t };
1852
1864
  } catch {
1853
1865
  return { framed: !1, depth: 0 };
1854
1866
  }
1855
1867
  }
1856
- const ci = "watchparty_fragment_delivery";
1857
- function di() {
1868
+ const pi = "watchparty_fragment_delivery";
1869
+ function bi() {
1858
1870
  if (typeof window > "u") return null;
1859
1871
  try {
1860
1872
  const e = new URLSearchParams(window.location.search).get("fragmentDelivery");
@@ -1862,169 +1874,174 @@ function di() {
1862
1874
  if (e === "0" || e === "false") return !1;
1863
1875
  } catch {
1864
1876
  }
1865
- return Qo(ci);
1877
+ return ar(pi);
1866
1878
  }
1867
- let ui = { ...La }, ft = null;
1868
- const ia = "watchparty_delivery_client_id";
1869
- function mi() {
1870
- const e = B(ia);
1879
+ let yi = { ...La }, ft = null;
1880
+ const fa = "watchparty_delivery_client_id";
1881
+ function _i() {
1882
+ const e = B(fa);
1871
1883
  if (e) return e;
1872
1884
  const t = globalThis.crypto?.randomUUID?.() ?? `d${Math.random().toString(36).slice(2)}`;
1873
- return Et(ia, t) ? t : "";
1885
+ return It(fa, t) ? t : "";
1874
1886
  }
1875
- function gi() {
1876
- return ft === null && (ft = Ao(ui, mi(), di())), ft;
1887
+ function wi() {
1888
+ return ft === null && (ft = Po(yi, _i(), bi())), ft;
1877
1889
  }
1878
- function hi() {
1879
- return gi();
1890
+ function vi() {
1891
+ return wi();
1880
1892
  }
1881
1893
  let Be;
1882
- function pn() {
1883
- return B(eo) || void 0;
1894
+ function bn() {
1895
+ return B(Xn) || void 0;
1884
1896
  }
1885
- function pi() {
1897
+ function ki() {
1886
1898
  if (Be) return;
1887
- const e = pn();
1899
+ const e = bn();
1888
1900
  if (e) {
1889
1901
  Be = e;
1890
1902
  return;
1891
1903
  }
1892
- Zn().then((t) => {
1904
+ Jn().then((t) => {
1893
1905
  t && (Be = t);
1894
1906
  }).catch(() => {
1895
1907
  p("identity", "device id unavailable — joining without one");
1896
1908
  });
1897
1909
  }
1898
- function bi() {
1899
- return Be ??= pn();
1910
+ function xi() {
1911
+ return Be ??= bn();
1900
1912
  }
1901
- function yi(e, t) {
1913
+ function Si(e, t) {
1902
1914
  let a = 0;
1903
1915
  for (const n of e.videos) {
1904
1916
  const o = oe.voteKey(t, e.id, n.mediaId);
1905
- globalThis.localStorage?.getItem(o) != null && a++, ke(o);
1917
+ globalThis.localStorage?.getItem(o) != null && a++, ve(o);
1906
1918
  }
1907
1919
  return a;
1908
1920
  }
1909
- const _i = 2e4, wi = 1e4;
1910
- function ki() {
1921
+ const Ti = 2e4, Ci = 1e4;
1922
+ function Ei() {
1911
1923
  return { unansweredSince: null, lastPongAt: null, lastTickAt: null };
1912
1924
  }
1913
- function vi(e, t) {
1925
+ function Ii(e, t) {
1914
1926
  e.lastPongAt = t, e.unansweredSince = null;
1915
1927
  }
1916
- function xi(e, t, a) {
1917
- const n = e.lastTickAt !== null && t - e.lastTickAt > wi;
1918
- return e.lastTickAt = t, a ? n || e.unansweredSince === null ? (e.unansweredSince = t, !1) : t - e.unansweredSince > _i : (e.unansweredSince = null, !1);
1928
+ function Ai(e, t, a) {
1929
+ const n = e.lastTickAt !== null && t - e.lastTickAt > Ci;
1930
+ return e.lastTickAt = t, a ? n || e.unansweredSince === null ? (e.unansweredSince = t, !1) : t - e.unansweredSince > Ti : (e.unansweredSince = null, !1);
1919
1931
  }
1920
- function Si(e, t) {
1932
+ function Ni(e, t) {
1921
1933
  return e.lastPongAt === null ? void 0 : Math.max(0, t - e.lastPongAt);
1922
1934
  }
1923
1935
  let C = null, K = null, Ge = null, V = null, ee = null;
1924
- const Ti = Jn(), de = ki();
1925
- let Oe = null, st = null, fa = 0, Mt = null, Te = !1, Dt = !1, he = !1, bn = null;
1926
- function Ci(e) {
1927
- const t = re(), a = m.getState();
1936
+ const yn = ao({ storageKey: "watchparty:tab-id" });
1937
+ yn.settledTabId();
1938
+ let vt = 0;
1939
+ const de = Ei();
1940
+ let Oe = null, st = null, sa = 0, Dt = null, Te = !1, Lt = !1, he = !1, _n = null;
1941
+ function ji(e) {
1942
+ const t = re(), a = g.getState();
1928
1943
  if (a.me.clientId && a.roster[a.me.clientId])
1929
1944
  return (e.name || e.sprite) && (p("socket", "Identity update (already joined)", { name: e.name, sprite: e.sprite }), t.emit(T.IDENTITY_UPDATE, { name: e.name, sprite: e.sprite })), t;
1930
- const n = Ei(e);
1931
- return ee = n, Mt = { name: n.name, sprite: n.sprite }, Ie() && Br(n), t.connected ? (p("socket", "Emitting join", n), t.emit(T.JOIN, n)) : t.once("connect", () => {
1932
- p("socket", "Emitting join", n), t.emit(T.JOIN, n);
1945
+ const n = ++vt;
1946
+ return yn.withSettledTabId((o) => {
1947
+ if (n !== vt) return;
1948
+ const r = Ri(e, o);
1949
+ ee = r, Dt = { name: r.name, sprite: r.sprite }, Ie() && Xr(r), t.connected ? (p("socket", "Emitting join", r), t.emit(T.JOIN, r)) : t.once("connect", () => {
1950
+ p("socket", "Emitting join", r), t.emit(T.JOIN, r);
1951
+ });
1933
1952
  }), t;
1934
1953
  }
1935
- function Ei(e) {
1954
+ function Ri(e, t) {
1936
1955
  return {
1937
1956
  room_key: e.room_key,
1938
1957
  name: e.name,
1939
1958
  sprite: e.sprite,
1940
1959
  // Entry-path telemetry — see lib/embedContext.ts. Sent on every join AND
1941
1960
  // rejoin (lastJoinPayload carries it), so a reconnect keeps the attribution.
1942
- embed: li(),
1943
- delivery_arm: hi(),
1961
+ embed: hi(),
1962
+ delivery_arm: vi(),
1944
1963
  // Identity tier input — see lib/deviceId.ts. Sent on every join AND rejoin
1945
1964
  // (lastJoinPayload carries it) so a reconnect lands on the same
1946
1965
  // ParticipantId rather than minting a new person.
1947
- device_id: bi(),
1948
- tab_id: Ti
1966
+ device_id: xi(),
1967
+ tab_id: t
1949
1968
  };
1950
1969
  }
1951
1970
  function re() {
1952
1971
  if (!C) {
1953
1972
  let t = Ce().serverOrigin || "/";
1954
- if (t === "/" && typeof window < "u") {
1955
- const n = window.location;
1956
- (n.hostname === "localhost" || n.hostname === "127.0.0.1") && n.port === String(Ca) && (t = `${n.protocol}//${n.hostname}:${xt}`, p("socket", "Using dev fallback origin", { origin: t }));
1957
- }
1958
- const a = Vr();
1959
- if (a)
1960
- C = gt(a.url, { path: a.path, transports: ["websocket", "polling"] }), p("socket", "Socket initialized on the room origin", a);
1973
+ const a = t === "/" ? Va() : null;
1974
+ a !== null && (t = a, p("socket", "Using dev fallback origin", { origin: t }));
1975
+ const n = ei();
1976
+ if (n)
1977
+ C = gt(n.url, wt(n.path)), p("socket", "Socket initialized on the room origin", n);
1961
1978
  else {
1962
- const n = new URL(t.startsWith("http") ? t : `${window.location.origin}${t}`).origin;
1963
- C = gt(n, { path: io, transports: ["websocket", "polling"] }), p("socket", "Socket initialized", { origin: t });
1979
+ const o = new URL(t.startsWith("http") ? t : `${window.location.origin}${t}`).origin;
1980
+ C = gt(o, wt(co)), p("socket", "Socket initialized", { origin: t });
1964
1981
  }
1965
1982
  ot("__SOCKET__", C), V && (clearTimeout(V), V = null), K = null, Ge = setInterval(() => {
1966
- if (xi(de, Date.now(), !!C?.connected)) {
1983
+ if (Ai(de, Date.now(), !!C?.connected)) {
1967
1984
  L("socket", "PONG-WATCHDOG no time_pong for 20s — replacing the connection", {
1968
1985
  sid: C?.id,
1969
- lastPongAgeMs: Si(de, Date.now()) ?? null
1986
+ lastPongAgeMs: Ni(de, Date.now()) ?? null
1970
1987
  }), st = "pong-watchdog", de.unansweredSince = null, C?.io.engine?.close();
1971
1988
  return;
1972
1989
  }
1973
- Ui();
1974
- }, So), C.on("connect", () => {
1975
- Dt = !1;
1976
- const n = C?.id;
1977
- if (p("socket", "Connected", { id: n, isReconnect: he }), n)
1990
+ Bi();
1991
+ }, Io), C.on("connect", () => {
1992
+ Lt = !1;
1993
+ const o = C?.id;
1994
+ if (p("socket", "Connected", { id: o, isReconnect: he }), o)
1978
1995
  try {
1979
- m.getState().ensureMe(n), m.setState((o) => ({ me: { ...o.me, nextClientSeq: 1 } })), p("socket", "Reset client sequence for new connection");
1980
- } catch (o) {
1981
- ze("socket", "Failed to initialize store on connect", { error: o.message, sid: n });
1996
+ g.getState().ensureMe(o), g.setState((r) => ({ me: { ...r.me, nextClientSeq: 1 } })), p("socket", "Reset client sequence for new connection");
1997
+ } catch (r) {
1998
+ ze("socket", "Failed to initialize store on connect", { error: r.message, sid: o });
1982
1999
  }
1983
2000
  if (he && ee) {
1984
- const o = m.getState();
1985
- fa += 1;
1986
- const r = {
2001
+ const r = g.getState();
2002
+ sa += 1;
2003
+ const f = {
1987
2004
  ...ee,
1988
- name: o.name,
1989
- sprite: o.sprite,
2005
+ name: r.name,
2006
+ sprite: r.sprite,
1990
2007
  reconnect: {
1991
- count: fa,
2008
+ count: sa,
1992
2009
  reason: (Oe?.reason ?? "unknown").slice(0, 64),
1993
2010
  offline_ms: Oe ? Math.max(0, Date.now() - Oe.at) : 0
1994
2011
  }
1995
- }, f = bn;
1996
- if (p("socket", "Re-emitting join after reconnect", { room_key: r.room_key, name: r.name, sprite: r.sprite }), f) {
1997
- let s = !1;
1998
- const c = () => {
1999
- s || (s = !0, C.off(T.SNAPSHOT, c), C.emit(T.CLIENT_READY, { media_id: f }), p("socket", "Re-emitted client_ready after reconnect snapshot", { mediaId: f }));
2012
+ }, s = _n;
2013
+ if (p("socket", "Re-emitting join after reconnect", { room_key: f.room_key, name: f.name, sprite: f.sprite }), s) {
2014
+ let c = !1;
2015
+ const u = () => {
2016
+ c || (c = !0, C.off(T.SNAPSHOT, u), C.emit(T.CLIENT_READY, { media_id: s }), p("socket", "Re-emitted client_ready after reconnect snapshot", { mediaId: s }));
2000
2017
  };
2001
- C.on(T.SNAPSHOT, c), setTimeout(() => {
2002
- s || (s = !0, C.off(T.SNAPSHOT, c), L("socket", "client_ready re-emit timed out waiting for snapshot", { mediaId: f }));
2018
+ C.on(T.SNAPSHOT, u), setTimeout(() => {
2019
+ c || (c = !0, C.off(T.SNAPSHOT, u), L("socket", "client_ready re-emit timed out waiting for snapshot", { mediaId: s }));
2003
2020
  }, 1e4);
2004
2021
  }
2005
- Mt = { name: r.name, sprite: r.sprite }, C.emit(T.JOIN, r), window.dispatchEvent(new CustomEvent("watchparty:socket-reconnect"));
2022
+ Dt = { name: f.name, sprite: f.sprite }, C.emit(T.JOIN, f), window.dispatchEvent(new CustomEvent("watchparty:socket-reconnect"));
2006
2023
  } else he && L("socket", "Reconnected — no join payload, not re-joining any room");
2007
2024
  he = !0;
2008
- }), C.on("disconnect", (n) => {
2009
- Xa(null), Oe = { reason: st ?? n, at: Date.now() }, st = null, p("socket", "Disconnected", { reason: n });
2010
- }), C.on("connect_error", (n) => ze("socket", "Connection error", { message: n?.message })), C.on("reconnect_attempt", (n) => L("socket", "Reconnect attempt", { attempt: n })), C.on("reconnect_failed", () => ze("socket", "Reconnect failed")), Li(C);
2025
+ }), C.on("disconnect", (o) => {
2026
+ Qa(null), Oe = { reason: st ?? o, at: Date.now() }, st = null, p("socket", "Disconnected", { reason: o });
2027
+ }), C.on("connect_error", (o) => ze("socket", "Connection error", { message: o?.message })), C.on("reconnect_attempt", (o) => L("socket", "Reconnect attempt", { attempt: o })), C.on("reconnect_failed", () => ze("socket", "Reconnect failed")), $i(C);
2011
2028
  }
2012
2029
  return C;
2013
2030
  }
2014
2031
  function lt(e) {
2015
2032
  return e.play_state === "playing" || e.playing === !0;
2016
2033
  }
2017
- function Ii(e) {
2034
+ function Pi(e) {
2018
2035
  e.on(T.SNAPSHOT, (t) => {
2019
- e.emit(Ma.SYNC), m.getState().applySnapshot({
2036
+ e.emit(Da.SYNC), g.getState().applySnapshot({
2020
2037
  roomId: t.room_id ?? null,
2021
2038
  mediaId: t.media_id ?? null,
2022
2039
  playheadMs: t.playhead_ms || 0,
2023
2040
  playing: lt(t),
2024
2041
  serverSeq: t.server_seq || 0,
2025
2042
  leaderId: t.leader_id || null
2026
- }), m.getState().name || p("socket", "Deferring identity to presence event (snapshot carries no roster)");
2027
- const a = m.getState(), n = C?.id, r = (n ? a.roster[n] : void 0) ?? Mt, f = Xn(
2043
+ }), g.getState().name || p("socket", "Deferring identity to presence event (snapshot carries no roster)");
2044
+ const a = g.getState(), n = C?.id, r = (n ? a.roster[n] : void 0) ?? Dt, f = no(
2028
2045
  { name: a.name, avatarId: a.sprite },
2029
2046
  r ? { name: r.name, avatarId: r.sprite ?? null } : void 0,
2030
2047
  // A join that carried no name counts as a default one, so a name that
@@ -2034,7 +2051,7 @@ function Ii(e) {
2034
2051
  if (f) {
2035
2052
  const s = {
2036
2053
  ...f.name !== void 0 ? { name: f.name } : {},
2037
- ...f.avatarId !== void 0 && !Dt ? { sprite: f.avatarId } : {}
2054
+ ...f.avatarId !== void 0 && !Lt ? { sprite: f.avatarId } : {}
2038
2055
  };
2039
2056
  Object.keys(s).length > 0 && (p("socket", "Identity update on snapshot", s), e.emit(T.IDENTITY_UPDATE, s));
2040
2057
  }
@@ -2045,9 +2062,9 @@ function Ii(e) {
2045
2062
  leaderId: t.leader_id || null,
2046
2063
  serverSeq: t.server_seq || 0,
2047
2064
  rosterSize: Object.keys(a.roster).length
2048
- }), ee?.room_key && C?.id && Xa({ room_key: ee.room_key, client_id: C.id });
2065
+ }), ee?.room_key && C?.id && Qa({ room_key: ee.room_key, client_id: C.id });
2049
2066
  }), e.on(T.CONTROL_BROADCAST, (t) => {
2050
- const a = m.getState();
2067
+ const a = g.getState();
2051
2068
  if (Object.prototype.hasOwnProperty.call(t, "media_id")) {
2052
2069
  const n = t.media_id ?? null;
2053
2070
  a.snapshot.mediaId !== n && (a.applySnapshot({ mediaId: n }), n && a.setReadiness({ mediaId: n, ready: !1, readyCount: 0, total: 0 }), a.bumpLoadGeneration());
@@ -2067,21 +2084,21 @@ function Ii(e) {
2067
2084
  }), e.on(T.CONTROL_ACK, (t) => {
2068
2085
  typeof t?.client_seq == "number" && typeof t?.server_seq == "number" && p("socket", "Control ack received", t);
2069
2086
  }), e.on(T.TIME_PONG, (t) => {
2070
- if (vi(de, Date.now()), K && K.ts) {
2087
+ if (Ii(de, Date.now()), K && K.ts) {
2071
2088
  const a = Date.now() - K.ts;
2072
- m.getState().addRttSample(a, t?.server_ts, K.ts), K = null, V && (clearTimeout(V), V = null), p("socket", "Time sync RTT", { rtt: a, offset: m.getState().drift.offsetMs });
2089
+ g.getState().addRttSample(a, t?.server_ts, K.ts), K = null, V && (clearTimeout(V), V = null), p("socket", "Time sync RTT", { rtt: a, offset: g.getState().drift.offsetMs });
2073
2090
  }
2074
2091
  }), e.on(T.READY_STATE, (t) => {
2075
2092
  if (!t) return;
2076
2093
  const a = t.media_id ?? null, n = typeof t.ready_count == "number" ? t.ready_count : 0, o = typeof t.total == "number" ? t.total : 0, r = t.ready === !0;
2077
- m.getState().setReadiness({ mediaId: a, ready: r, readyCount: n, total: o }), p("socket", "Ready state received", { mediaId: a, readyCount: n, total: o, ready: r });
2094
+ g.getState().setReadiness({ mediaId: a, ready: r, readyCount: n, total: o }), p("socket", "Ready state received", { mediaId: a, readyCount: n, total: o, ready: r });
2078
2095
  });
2079
2096
  }
2080
- function Ai(e) {
2081
- const t = $n(e);
2097
+ function Mi(e) {
2098
+ const t = zn(e);
2082
2099
  return t ? { cosmetics: t } : {};
2083
2100
  }
2084
- function Ni(e) {
2101
+ function Di(e) {
2085
2102
  e.on(T.PRESENCE, (t) => {
2086
2103
  if (!t) return;
2087
2104
  if (Array.isArray(t.users)) {
@@ -2095,89 +2112,89 @@ function Ni(e) {
2095
2112
  isLeader: s.is_leader,
2096
2113
  ...s.registry_name ? { registryName: !0 } : {},
2097
2114
  ...s.avatar_url ? { avatarUrl: s.avatar_url } : {},
2098
- ...Ai(s.cosmetics)
2115
+ ...Mi(s.cosmetics)
2099
2116
  };
2100
- const o = m.getState(), r = C?.id, f = r ? n[r] : void 0;
2117
+ const o = g.getState(), r = C?.id, f = r ? n[r] : void 0;
2101
2118
  if (f?.registryName)
2102
- m.setState({ roster: n }), (f.name !== o.name || f.sprite && f.sprite !== o.sprite) && (p("socket", "Adopting registry name", { from: o.name, to: f.name }), m.getState().setSessionIdentity(f.name, f.sprite ?? o.sprite));
2119
+ g.setState({ roster: n }), (f.name !== o.name || f.sprite && f.sprite !== o.sprite) && (p("socket", "Adopting registry name", { from: o.name, to: f.name }), g.getState().setSessionIdentity(f.name, f.sprite ?? o.sprite));
2103
2120
  else if (r && n[r]) {
2104
2121
  const s = n[r].name, c = n[r].sprite;
2105
- if (o.name && !le(o.name) && (n[r].name = o.name), m.setState({ roster: n }), c && c !== o.sprite) {
2106
- const g = o.name && !le(o.name), u = g ? o.name : xe(c);
2107
- p("socket", "Server reassigned sprite", { from: o.sprite, to: c, newName: u, preservingCustomName: g }), m.getState().setSessionIdentity(u, c), u !== s && e.emit(T.IDENTITY_UPDATE, { name: u });
2122
+ if (o.name && !le(o.name) && (n[r].name = o.name), g.setState({ roster: n }), c && c !== o.sprite) {
2123
+ const u = o.name && !le(o.name), m = u ? o.name : xe(c);
2124
+ p("socket", "Server reassigned sprite", { from: o.sprite, to: c, newName: m, preservingCustomName: u }), g.getState().setSessionIdentity(m, c), m !== s && e.emit(T.IDENTITY_UPDATE, { name: m });
2108
2125
  }
2109
2126
  }
2110
2127
  }
2111
2128
  p("socket", "Received presence update", t);
2112
- const a = m.getState();
2129
+ const a = g.getState();
2113
2130
  if (!a.name) {
2114
2131
  a.ensureAutoIdentity?.();
2115
- const n = m.getState();
2132
+ const n = g.getState();
2116
2133
  n.name && (p("socket", "Auto-assigned identity on presence", { name: n.name, sprite: n.sprite }), e.emit(T.IDENTITY_UPDATE, { name: n.name, sprite: n.sprite || void 0 }));
2117
2134
  }
2118
2135
  });
2119
2136
  }
2120
- function ji(e) {
2137
+ function Li(e) {
2121
2138
  e.on(Pe.STATE, (t) => {
2122
- m.getState().applyPlaylistState({
2139
+ g.getState().applyPlaylistState({
2123
2140
  playlist: t?.playlist ?? null,
2124
2141
  activeIndex: t?.activeIndex ?? null,
2125
2142
  myVotes: t?.myVotes ?? {}
2126
2143
  }), p("playlist", "Playlist state received", { playlistId: t?.playlist?.id ?? null, activeIndex: t?.activeIndex, myVoteCount: Object.keys(t?.myVotes || {}).length });
2127
2144
  }), e.on(Pe.VOTE_PROGRESS, (t) => {
2128
- m.getState().setVoteProgress(t?.progress ?? []), p("playlist", "Vote progress", { progressCount: t?.progress?.length });
2145
+ g.getState().setVoteProgress(t?.progress ?? []), p("playlist", "Vote progress", { progressCount: t?.progress?.length });
2129
2146
  }), e.on(Pe.RESULTS, (t) => {
2130
- m.getState().setPlaylistResults(t ?? null), p("playlist", "Results received", { playlistId: t?.playlist?.id, update: t?.update === !0 });
2147
+ g.getState().setPlaylistResults(t ?? null), p("playlist", "Results received", { playlistId: t?.playlist?.id, update: t?.update === !0 });
2131
2148
  }), e.on(Pe.VOTES_CLEARED, (t) => {
2132
2149
  if (!t?.playlistId || !Array.isArray(t.mediaIds)) return;
2133
- const a = yi(
2150
+ const a = Si(
2134
2151
  { id: t.playlistId, videos: t.mediaIds.map((o) => ({ mediaId: o })) },
2135
- kr()
2136
- ), n = m.getState();
2152
+ Tr()
2153
+ ), n = g.getState();
2137
2154
  n.playlist?.id === t.playlistId && n.applyPlaylistState({ playlist: n.playlist, activeIndex: n.activePlaylistIndex, myVotes: {} }), p("playlist", "Votes cleared by leader", { playlistId: t.playlistId, removed: a });
2138
2155
  });
2139
2156
  }
2140
- function Ri(e) {
2141
- e.on(wo.UPDATED, () => {
2142
- p("tierlist", "Someone saved — refreshing the board"), Qr(!1);
2157
+ function Oi(e) {
2158
+ e.on(So.UPDATED, () => {
2159
+ p("tierlist", "Someone saved — refreshing the board"), oi(!1);
2143
2160
  });
2144
2161
  }
2145
- function Pi(e) {
2146
- e.on(ko.STATE, (t) => {
2162
+ function qi(e) {
2163
+ e.on(To.STATE, (t) => {
2147
2164
  if (!t || typeof t.active != "boolean") return;
2148
2165
  const a = Array.isArray(t.ready) ? t.ready.filter((n) => typeof n == "string") : [];
2149
- m.getState().setReadyCheckState({ active: t.active, ready: a }), p("ready-check", "State received", { active: t.active, readyCount: a.length });
2166
+ g.getState().setReadyCheckState({ active: t.active, ready: a }), p("ready-check", "State received", { active: t.active, readyCount: a.length });
2150
2167
  });
2151
2168
  }
2152
- function Mi(e) {
2153
- e.on(Ma.ACTIVE, (t) => {
2169
+ function Hi(e) {
2170
+ e.on(Da.ACTIVE, (t) => {
2154
2171
  const a = typeof t?.gameId == "string" ? t.gameId : null;
2155
- m.getState().setActiveGameId(a), p("game", "game_active", { gameId: a });
2172
+ g.getState().setActiveGameId(a), p("game", "game_active", { gameId: a });
2156
2173
  });
2157
2174
  }
2158
- function Di(e) {
2175
+ function Ui(e) {
2159
2176
  e.on(T.HEALTH_SNAPSHOT, (t) => {
2160
- m.getState().setHealthSnapshot(t);
2177
+ g.getState().setHealthSnapshot(t);
2161
2178
  }), e.on(T.BUFFER_STATUS, (t) => {
2162
- m.getState().setBufferStatus(t);
2179
+ g.getState().setBufferStatus(t);
2163
2180
  });
2164
2181
  }
2165
- function Li(e) {
2166
- Ii(e), Ni(e), gn(e, () => !Ie()), Di(e), ji(e), Ri(e), Pi(e), Mi(e), e.on(T.ERROR, (t) => {
2182
+ function $i(e) {
2183
+ Pi(e), Di(e), hn(e, () => !Ie()), Ui(e), Li(e), Oi(e), qi(e), Hi(e), e.on(T.ERROR, (t) => {
2167
2184
  const a = t?.code || "error/unknown";
2168
2185
  if (a === "conflict" && t?.message === "sprite_held_by_you") {
2169
- Dt = !0, p("socket", "sprite held by this account's other connection: keeping the server-assigned sprite");
2186
+ Lt = !0, p("socket", "sprite held by this account's other connection: keeping the server-assigned sprite");
2170
2187
  return;
2171
2188
  }
2172
2189
  if (a === "conflict" && t?.message === "sprite_taken") {
2173
- if (ti(C?.id)) {
2190
+ if (fi(C?.id)) {
2174
2191
  p("socket", "sprite_taken: stale, the server already has our sprite");
2175
2192
  return;
2176
2193
  }
2177
2194
  Te = !0;
2178
2195
  let f;
2179
2196
  try {
2180
- f = ei();
2197
+ f = ii();
2181
2198
  } finally {
2182
2199
  Te = !1;
2183
2200
  }
@@ -2202,57 +2219,57 @@ function Li(e) {
2202
2219
  "recap/not_found": "No recap available for the previous episode."
2203
2220
  }[a] || a;
2204
2221
  if (a.startsWith("recap/")) {
2205
- p("socket", `recap unavailable: ${o}`, { code: a }), m.getState().pushToast("info", o);
2222
+ p("socket", `recap unavailable: ${o}`, { code: a }), g.getState().pushToast("info", o);
2206
2223
  return;
2207
2224
  }
2208
- (a.startsWith("auth/") ? L : ze)("socket", `Server error: ${o}`, { code: a, raw: t }), m.getState().pushToast("error", o);
2225
+ (a.startsWith("auth/") ? L : ze)("socket", `Server error: ${o}`, { code: a, raw: t }), g.getState().pushToast("error", o);
2209
2226
  });
2210
2227
  }
2211
- function Oi(e, t, a) {
2228
+ function Fi(e, t, a) {
2212
2229
  const n = {
2213
2230
  text: e,
2214
2231
  ...t?.length ? { images: t } : {},
2215
2232
  ...a ? { reply_to: a } : {}
2216
2233
  };
2217
- Ie() ? Gr(n) : re().emit(T.CHAT_SEND, n);
2234
+ Ie() ? Qr(n) : re().emit(T.CHAT_SEND, n);
2218
2235
  }
2219
- function qi(e, t, a) {
2236
+ function zi(e, t, a) {
2220
2237
  const n = { id: e, emoji: t, on: a };
2221
- Ie() ? dn(T.CHAT_REACT, n) : re().emit(T.CHAT_REACT, n);
2238
+ Ie() ? un(T.CHAT_REACT, n) : re().emit(T.CHAT_REACT, n);
2222
2239
  }
2223
- function Hi(e) {
2240
+ function Wi(e) {
2224
2241
  const t = { typing: e };
2225
- Ie() ? dn(T.CHAT_TYPING, t) : C?.connected && C.emit(T.CHAT_TYPING, t);
2242
+ Ie() ? un(T.CHAT_TYPING, t) : C?.connected && C.emit(T.CHAT_TYPING, t);
2226
2243
  }
2227
- function Ui() {
2244
+ function Bi() {
2228
2245
  K || (K = { ts: Date.now() }, re().emit(T.TIME_PING, {}), V = setTimeout(() => {
2229
2246
  K && (p("socket", "Time ping timed out after 10s, clearing inflight"), K = null), V = null;
2230
2247
  }, 1e4));
2231
2248
  }
2232
- function yn(e) {
2233
- const t = m.getState(), a = t.me.clientId;
2249
+ function wn(e) {
2250
+ const t = g.getState(), a = t.me.clientId;
2234
2251
  if (!a || !t.roster[a]) {
2235
- ra(e), p("socket", "Avatar change before join: the join will carry it", { sprite: e });
2252
+ ia(e), p("socket", "Avatar change before join: the join will carry it", { sprite: e });
2236
2253
  return;
2237
2254
  }
2238
2255
  Te = !0;
2239
2256
  try {
2240
- ra(e);
2257
+ ia(e);
2241
2258
  } finally {
2242
2259
  Te = !1;
2243
2260
  }
2244
- const n = m.getState(), o = { avatar: !0 };
2261
+ const n = g.getState(), o = { avatar: !0 };
2245
2262
  n.sprite && n.sprite !== t.sprite && (o.sprite = n.sprite), n.name && n.name !== t.name && (o.name = n.name), p("socket", "Sending avatar change", o), re().emit(T.IDENTITY_UPDATE, o);
2246
2263
  }
2247
- function $i(e) {
2248
- m.getState().me.clientId && Fi(e);
2264
+ function Gi(e) {
2265
+ g.getState().me.clientId && Ki(e);
2249
2266
  }
2250
- function Fi(e, t) {
2267
+ function Ki(e, t) {
2251
2268
  const a = {};
2252
2269
  e && (a.name = e), !(!a.name && !a.sprite) && (p("socket", "Sending identity update", a), re().emit(T.IDENTITY_UPDATE, a));
2253
2270
  }
2254
2271
  let qe = { name: "", sprite: "" };
2255
- m.subscribe((e, t) => {
2272
+ g.subscribe((e, t) => {
2256
2273
  if (e.name === t.name && e.sprite === t.sprite || Te) return;
2257
2274
  const a = e.me.clientId;
2258
2275
  if (!a) return;
@@ -2263,14 +2280,14 @@ m.subscribe((e, t) => {
2263
2280
  const f = {};
2264
2281
  o && (f.name = e.name, qe.name = e.name), r && (f.sprite = e.sprite, qe.sprite = e.sprite), p("socket", "Identity reassert (store change)", f), C?.connected ? C.emit(T.IDENTITY_UPDATE, f) : re().emit(T.IDENTITY_UPDATE, f);
2265
2282
  });
2266
- function zi() {
2283
+ function Vi() {
2267
2284
  Ge && (clearInterval(Ge), Ge = null), V && (clearTimeout(V), V = null), K = null, de.unansweredSince = null, de.lastTickAt = null;
2268
2285
  }
2269
- function Wi() {
2270
- p("socket", "clearJoinState called", { hadPayload: ee !== null, room_key: ee?.room_key }), ee = null, he = !1, bn = null;
2286
+ function Yi() {
2287
+ p("socket", "clearJoinState called", { hadPayload: ee !== null, room_key: ee?.room_key }), ee = null, vt += 1, he = !1, _n = null;
2271
2288
  }
2272
- function sa() {
2273
- p("socket", "leaveRoom called", { room_key: ee?.room_key }), Wi(), zi(), un(), C && (C.disconnect(), C = null), m.setState({
2289
+ function la() {
2290
+ p("socket", "leaveRoom called", { room_key: ee?.room_key }), Yi(), Vi(), mn(), C && (C.disconnect(), C = null), g.setState({
2274
2291
  me: { clientId: null, nextClientSeq: 1 },
2275
2292
  roster: {},
2276
2293
  snapshot: { roomId: null, mediaId: null, playheadMs: 0, playing: !1, serverSeq: 0, leaderId: null },
@@ -2288,31 +2305,31 @@ function sa() {
2288
2305
  activeGameId: null
2289
2306
  });
2290
2307
  }
2291
- function Bi() {
2308
+ function Ji() {
2292
2309
  p("chat", "Emitting recap_request"), re().emit("recap_request");
2293
2310
  }
2294
- function Gi() {
2311
+ function Xi() {
2295
2312
  M(() => {
2296
- const e = oo(), t = no((n, o) => {
2297
- const r = ni(o);
2298
- p("avatar", "Avatar changed in the settings popout", { sprite: r, source: o.avatar?.source }), yn(r);
2299
- }), a = fi((n) => {
2300
- p("avatar", "Renamed in the settings popout", { name: n }), $i(n);
2313
+ const e = fo(), t = io((n, o) => {
2314
+ const r = li(o);
2315
+ p("avatar", "Avatar changed in the settings popout", { sprite: r, source: o.avatar?.source }), wn(r);
2316
+ }), a = mi((n) => {
2317
+ p("avatar", "Renamed in the settings popout", { name: n }), Gi(n);
2301
2318
  });
2302
2319
  return () => {
2303
2320
  t(), a(), e();
2304
2321
  };
2305
2322
  }, []);
2306
2323
  }
2307
- function Ki(e, t) {
2308
- return (t ? Wn(t) : null) ?? Za(e);
2324
+ function Qi(e, t) {
2325
+ return (t ? Gn(t) : null) ?? en(e);
2309
2326
  }
2310
2327
  function Ae(e, t) {
2311
2328
  return M(() => {
2312
- t && Fn(t);
2313
- }, [t]), ya(zn, () => Ki(e, t), () => Za(e));
2329
+ t && Wn(t);
2330
+ }, [t]), _a(Bn, () => Qi(e, t), () => en(e));
2314
2331
  }
2315
- function Vi(e, t) {
2332
+ function Zi(e, t) {
2316
2333
  if (t.clientId) {
2317
2334
  const a = e[t.clientId];
2318
2335
  if (a && (!t.author || !a.author || a.author === t.author)) return a;
@@ -2321,8 +2338,8 @@ function Vi(e, t) {
2321
2338
  for (const a of Object.values(e)) if (a.author === t.author) return a;
2322
2339
  }
2323
2340
  }
2324
- function Yi(e, t, a) {
2325
- const n = Vi(e, t);
2341
+ function ef(e, t, a) {
2342
+ const n = Zi(e, t);
2326
2343
  return n ? {
2327
2344
  name: n.name || a.name,
2328
2345
  // A connection briefly without a character (a reconnect waiting for one to
@@ -2333,14 +2350,14 @@ function Yi(e, t, a) {
2333
2350
  here: !0
2334
2351
  } : { name: a.name, sprite: a.sprite, pictureUrl: a.pictureUrl, here: !1 };
2335
2352
  }
2336
- function Ji(e, t, a) {
2337
- return !t || !a.here ? e : t.split(St).join(a.name);
2353
+ function tf(e, t, a) {
2354
+ return !t || !a.here ? e : t.split(Tt).join(a.name);
2338
2355
  }
2339
2356
  function rt(e, t) {
2340
- const a = m((n) => JSON.stringify(Yi(n.roster, e, t)));
2357
+ const a = g((n) => JSON.stringify(ef(n.roster, e, t)));
2341
2358
  return F(() => JSON.parse(a), [a]);
2342
2359
  }
2343
- function Lt({ sprite: e, url: t, alt: a = "", className: n, style: o, fallback: r }) {
2360
+ function Ot({ sprite: e, url: t, alt: a = "", className: n, style: o, fallback: r }) {
2344
2361
  const [f, s] = N(null);
2345
2362
  if (t && t !== f)
2346
2363
  return /* @__PURE__ */ l(
@@ -2355,13 +2372,13 @@ function Lt({ sprite: e, url: t, alt: a = "", className: n, style: o, fallback:
2355
2372
  onError: () => s(t)
2356
2373
  }
2357
2374
  );
2358
- const c = vr(e);
2375
+ const c = Cr(e);
2359
2376
  return c ? /* @__PURE__ */ l("img", { src: c, alt: a, crossOrigin: "anonymous", className: n, style: o, draggable: !1 }) : /* @__PURE__ */ l(te, { children: r });
2360
2377
  }
2361
- function _n({ sprite: e, url: t, alt: a, worn: n }) {
2378
+ function vn({ sprite: e, url: t, alt: a, worn: n }) {
2362
2379
  return /* @__PURE__ */ w("span", { className: "hc-av", style: { "--hc-sz": "32px" }, children: [
2363
2380
  /* @__PURE__ */ l("span", { className: "hc-pic", children: /* @__PURE__ */ l(
2364
- Lt,
2381
+ Ot,
2365
2382
  {
2366
2383
  sprite: e,
2367
2384
  url: t,
@@ -2370,13 +2387,13 @@ function _n({ sprite: e, url: t, alt: a, worn: n }) {
2370
2387
  fallback: /* @__PURE__ */ l("span", { className: "inline-block w-8 h-8 bg-bg-alt/50 rounded-full flex-shrink-0" })
2371
2388
  }
2372
2389
  ) }),
2373
- n?.overlay && /* @__PURE__ */ l(we, { html: Bn(n), style: { display: "contents" } })
2390
+ n?.overlay && /* @__PURE__ */ l(we, { html: Kn(n), style: { display: "contents" } })
2374
2391
  ] });
2375
2392
  }
2376
- function Xi(e) {
2393
+ function af(e) {
2377
2394
  return !(e.button !== 0 || e.ctrlKey || e.metaKey || e.shiftKey || e.altKey);
2378
2395
  }
2379
- function Qi({ src: e, title: t, onClose: a }) {
2396
+ function nf({ src: e, title: t, onClose: a }) {
2380
2397
  M(() => {
2381
2398
  const r = (f) => {
2382
2399
  at(f) && (f.stopPropagation(), a());
@@ -2384,7 +2401,7 @@ function Qi({ src: e, title: t, onClose: a }) {
2384
2401
  return document.addEventListener("keydown", r, !0), () => document.removeEventListener("keydown", r, !0);
2385
2402
  }, [a]);
2386
2403
  const n = Wa(), o = typeof document > "u" ? null : document.fullscreenElement ?? n ?? document.body;
2387
- return o ? xa(
2404
+ return o ? Sa(
2388
2405
  /* @__PURE__ */ w(
2389
2406
  "div",
2390
2407
  {
@@ -2422,11 +2439,11 @@ function Qi({ src: e, title: t, onClose: a }) {
2422
2439
  o
2423
2440
  ) : null;
2424
2441
  }
2425
- const ct = 240, Zi = 320;
2426
- function ef({ image: e }) {
2442
+ const ct = 240, of = 320;
2443
+ function rf({ image: e }) {
2427
2444
  const [t, a] = N(!1), n = Ve(e.key);
2428
2445
  if (!n) return null;
2429
- const o = e.w > 0 && e.h > 0, r = o ? Math.min(1, Zi / e.w, ct / e.h) : 1;
2446
+ const o = e.w > 0 && e.h > 0, r = o ? Math.min(1, of / e.w, ct / e.h) : 1;
2430
2447
  return /* @__PURE__ */ w(te, { children: [
2431
2448
  /* @__PURE__ */ l(
2432
2449
  "a",
@@ -2437,7 +2454,7 @@ function ef({ image: e }) {
2437
2454
  className: "block max-w-full cursor-zoom-in",
2438
2455
  "data-testid": "chat-image",
2439
2456
  onClick: (f) => {
2440
- Xi(f) && (f.preventDefault(), a(!0));
2457
+ af(f) && (f.preventDefault(), a(!0));
2441
2458
  },
2442
2459
  children: /* @__PURE__ */ l(
2443
2460
  "img",
@@ -2455,7 +2472,7 @@ function ef({ image: e }) {
2455
2472
  }
2456
2473
  ),
2457
2474
  t && /* @__PURE__ */ l(
2458
- Qi,
2475
+ nf,
2459
2476
  {
2460
2477
  src: n,
2461
2478
  title: e.title,
@@ -2464,13 +2481,13 @@ function ef({ image: e }) {
2464
2481
  )
2465
2482
  ] });
2466
2483
  }
2467
- function wn({ images: e }) {
2468
- return e?.length ? /* @__PURE__ */ l("div", { className: "flex flex-wrap gap-1 mt-1", "data-testid": "chat-images", children: e.map((t, a) => /* @__PURE__ */ l(ef, { image: t }, `${t.key}-${a}`)) }) : null;
2484
+ function kn({ images: e }) {
2485
+ return e?.length ? /* @__PURE__ */ l("div", { className: "flex flex-wrap gap-1 mt-1", "data-testid": "chat-images", children: e.map((t, a) => /* @__PURE__ */ l(rf, { image: t }, `${t.key}-${a}`)) }) : null;
2469
2486
  }
2470
- function tf(e, t) {
2487
+ function ff(e, t) {
2471
2488
  return e.author && t.author ? e.author === t.author : !!t.clientId && e.clientId === t.clientId;
2472
2489
  }
2473
- const af = [
2490
+ const sf = [
2474
2491
  { 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" },
2475
2492
  { 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" },
2476
2493
  { 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" },
@@ -2481,16 +2498,16 @@ const af = [
2481
2498
  { 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" },
2482
2499
  { 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" }
2483
2500
  ];
2484
- function nf(e) {
2501
+ function lf(e) {
2485
2502
  return e.replace(/[^a-z0-9+]+/g, "_").replace(/^_|_$/g, "");
2486
2503
  }
2487
- function of(e) {
2488
- const [t = "", a = "", n = ""] = e.split(":"), o = nf(a), r = n ? n.split(",") : [];
2504
+ function cf(e) {
2505
+ const [t = "", a = "", n = ""] = e.split(":"), o = lf(a), r = n ? n.split(",") : [];
2489
2506
  return o && !r.includes(o) && r.push(o), { char: String.fromCodePoint(...t.split("-").map((f) => parseInt(f, 16))), name: a, shortcodes: r };
2490
2507
  }
2491
- let la = null;
2508
+ let ca = null;
2492
2509
  function Ne() {
2493
- return la ??= af.map((e) => ({ id: e.id, label: e.label, emoji: e.data.split("|").map(of) })), la;
2510
+ return ca ??= sf.map((e) => ({ id: e.id, label: e.label, emoji: e.data.split("|").map(cf) })), ca;
2494
2511
  }
2495
2512
  let se = null;
2496
2513
  function Qe(e) {
@@ -2504,7 +2521,7 @@ function Qe(e) {
2504
2521
  }
2505
2522
  return se.get(e) ?? se.get(e.replace(/\ufe0f/g, ""));
2506
2523
  }
2507
- const rf = [
2524
+ const df = [
2508
2525
  "joy",
2509
2526
  "heart",
2510
2527
  "thumbsup",
@@ -2541,12 +2558,12 @@ const rf = [
2541
2558
  "x",
2542
2559
  "pensive"
2543
2560
  ];
2544
- let ca = null;
2545
- function ff() {
2546
- return ca ??= rf.flatMap((e) => kn(e)?.char ?? []), ca;
2561
+ let da = null;
2562
+ function uf() {
2563
+ return da ??= df.flatMap((e) => xn(e)?.char ?? []), da;
2547
2564
  }
2548
2565
  let ge = null;
2549
- function kn(e) {
2566
+ function xn(e) {
2550
2567
  if (!ge) {
2551
2568
  ge = /* @__PURE__ */ new Map();
2552
2569
  for (const t of Ne().flatMap((a) => a.emoji))
@@ -2554,38 +2571,38 @@ function kn(e) {
2554
2571
  }
2555
2572
  return ge.get(e.toLowerCase());
2556
2573
  }
2557
- function sf(e, t = 8) {
2574
+ function mf(e, t = 8) {
2558
2575
  const a = e.toLowerCase();
2559
2576
  if (!a) return [];
2560
2577
  const n = /* @__PURE__ */ new Map();
2561
- for (const s of [...Ot(), ...ff()]) n.has(s) || n.set(s, n.size);
2578
+ for (const s of [...qt(), ...uf()]) n.has(s) || n.set(s, n.size);
2562
2579
  const o = (s) => n.get(s.char) ?? n.size, r = [];
2563
2580
  let f = 0;
2564
2581
  for (const s of Ne().flatMap((c) => c.emoji)) {
2565
2582
  f += 1;
2566
2583
  let c = null;
2567
- for (const g of s.shortcodes) {
2568
- const u = g === a ? 0 : g.startsWith(a) ? 1 : g.split("_").some((x) => x.startsWith(a)) ? 2 : g.includes(a) ? 3 : -1;
2569
- u < 0 || (!c || u < c.rank) && (c = { code: g, rank: u });
2584
+ for (const u of s.shortcodes) {
2585
+ const m = u === a ? 0 : u.startsWith(a) ? 1 : u.split("_").some((x) => x.startsWith(a)) ? 2 : u.includes(a) ? 3 : -1;
2586
+ m < 0 || (!c || m < c.rank) && (c = { code: u, rank: m });
2570
2587
  }
2571
2588
  c && r.push({ emoji: s, code: c.code, rank: c.rank, order: o(s) * 1e4 + f });
2572
2589
  }
2573
2590
  return r.sort((s, c) => s.rank - c.rank || s.order - c.order), r.slice(0, t).map(({ emoji: s, code: c }) => ({ emoji: s, code: c }));
2574
2591
  }
2575
- function lf(e, t = 120) {
2592
+ function gf(e, t = 120) {
2576
2593
  const a = e.toLowerCase().trim().split(/\s+/).filter(Boolean);
2577
2594
  if (!a.length) return [];
2578
2595
  const n = Ne().flatMap((c) => c.emoji), o = a.join("_").replace(/^:|:$/g, ""), r = n.filter((c) => {
2579
- const g = c.name.split(/[\s-]+/);
2580
- return a.every((u) => g.some((x) => x.startsWith(u))) || c.shortcodes.some((u) => u.startsWith(o));
2596
+ const u = c.name.split(/[\s-]+/);
2597
+ return a.every((m) => u.some((x) => x.startsWith(m))) || c.shortcodes.some((m) => m.startsWith(o));
2581
2598
  }), f = a.join(" "), s = (c) => {
2582
2599
  if (c.name === f || c.shortcodes.includes(o)) return 0;
2583
- const g = c.name.split(/[\s-]+/);
2584
- return a.every((u) => g.includes(u)) ? 1 : 2;
2600
+ const u = c.name.split(/[\s-]+/);
2601
+ return a.every((m) => u.includes(m)) ? 1 : 2;
2585
2602
  };
2586
- return r.sort((c, g) => s(c) - s(g)), r.slice(0, t);
2603
+ return r.sort((c, u) => s(c) - s(u)), r.slice(0, t);
2587
2604
  }
2588
- const cf = [
2605
+ const hf = [
2589
2606
  [128077],
2590
2607
  [10084, 65039],
2591
2608
  [128514],
@@ -2593,22 +2610,22 @@ const cf = [
2593
2610
  [128546],
2594
2611
  [128293]
2595
2612
  ].map((e) => String.fromCodePoint(...e));
2596
- function Ot() {
2597
- return m.getState().recentEmoji;
2613
+ function qt() {
2614
+ return g.getState().recentEmoji;
2598
2615
  }
2599
- function vn(e) {
2600
- m.getState().noteRecentEmoji(e);
2616
+ function Sn(e) {
2617
+ g.getState().noteRecentEmoji(e);
2601
2618
  }
2602
- function df(e = 3, t = Ot()) {
2619
+ function pf(e = 3, t = qt()) {
2603
2620
  const a = [];
2604
- for (const n of [...t, ...cf])
2621
+ for (const n of [...t, ...hf])
2605
2622
  if (a.includes(n) || a.push(n), a.length === e) break;
2606
2623
  return a;
2607
2624
  }
2608
- function xn(e, t) {
2625
+ function Tn(e, t) {
2609
2626
  return e.by.some((a) => a === t.author || !!t.clientId && a === t.clientId);
2610
2627
  }
2611
- function uf(e, t, a) {
2628
+ function bf(e, t, a) {
2612
2629
  const n = /* @__PURE__ */ new Map();
2613
2630
  for (const s of Object.values(t))
2614
2631
  s.author && n.set(s.author, s.name), n.set(s.clientId, s.name);
@@ -2624,18 +2641,18 @@ function uf(e, t, a) {
2624
2641
  }
2625
2642
  return r && o.unshift("You"), f && o.push(f === 1 ? "1 other" : `${f} others`), o;
2626
2643
  }
2627
- function mf(e, t) {
2644
+ function yf(e, t) {
2628
2645
  return `${e.length <= 1 ? e[0] ?? "Someone" : `${e.slice(0, -1).join(", ")} and ${e[e.length - 1]}`} reacted with ${t ? `:${t.replace(/\s+/g, "_")}:` : "this"}`;
2629
2646
  }
2630
2647
  const ce = 8;
2631
- function gf(e) {
2648
+ function _f(e) {
2632
2649
  return document.addEventListener("fullscreenchange", e), () => document.removeEventListener("fullscreenchange", e);
2633
2650
  }
2634
- function hf() {
2651
+ function wf() {
2635
2652
  const e = Wa();
2636
- return ya(gf, () => document.fullscreenElement, () => null) ?? e ?? document.body;
2653
+ return _a(_f, () => document.fullscreenElement, () => null) ?? e ?? document.body;
2637
2654
  }
2638
- function pf({
2655
+ function vf({
2639
2656
  anchor: e,
2640
2657
  onClose: t,
2641
2658
  width: a,
@@ -2645,13 +2662,13 @@ function pf({
2645
2662
  className: f = "",
2646
2663
  role: s = "dialog",
2647
2664
  ariaLabel: c,
2648
- testId: g,
2649
- children: u
2665
+ testId: u,
2666
+ children: m
2650
2667
  }) {
2651
- const x = hf(), S = U(null), [I, R] = N(null), y = D(() => {
2668
+ const x = wf(), S = U(null), [I, R] = N(null), y = D(() => {
2652
2669
  const d = S.current;
2653
2670
  if (!e || !d) return;
2654
- const b = e.getBoundingClientRect(), h = window.innerWidth, _ = window.innerHeight, k = Math.min(a, h - ce * 2), P = Math.min(Math.max(ce, o ? b.right - k : b.left), h - k - ce), O = d.offsetHeight, z = b.top - r - ce, W = _ - b.bottom - r - ce, E = n === "top" ? O <= z || z >= W : !(O <= W || W >= z), j = Math.max(120, E ? z : W), A = Math.min(O, j), q = E ? b.top - r - A : b.bottom + r;
2671
+ const b = e.getBoundingClientRect(), h = window.innerWidth, _ = window.innerHeight, v = Math.min(a, h - ce * 2), P = Math.min(Math.max(ce, o ? b.right - v : b.left), h - v - ce), O = d.offsetHeight, z = b.top - r - ce, W = _ - b.bottom - r - ce, E = n === "top" ? O <= z || z >= W : !(O <= W || W >= z), j = Math.max(120, E ? z : W), A = Math.min(O, j), q = E ? b.top - r - A : b.bottom + r;
2655
2672
  R((H) => H && H.left === P && H.top === q && H.maxHeight === j ? H : { left: P, top: q, maxHeight: j });
2656
2673
  }, [e, a, o, r, n]);
2657
2674
  return ut(() => {
@@ -2670,14 +2687,14 @@ function pf({
2670
2687
  return document.addEventListener("keydown", d), document.addEventListener("pointerdown", b, !0), () => {
2671
2688
  document.removeEventListener("keydown", d), document.removeEventListener("pointerdown", b, !0);
2672
2689
  };
2673
- }, [t, e]), xa(
2690
+ }, [t, e]), Sa(
2674
2691
  /* @__PURE__ */ l(
2675
2692
  "div",
2676
2693
  {
2677
2694
  ref: S,
2678
2695
  role: s,
2679
2696
  "aria-label": c,
2680
- "data-testid": g,
2697
+ "data-testid": u,
2681
2698
  className: `floating-panel ${f}`,
2682
2699
  style: {
2683
2700
  position: "fixed",
@@ -2692,18 +2709,18 @@ function pf({
2692
2709
  opacity: I ? 1 : 0,
2693
2710
  pointerEvents: I ? void 0 : "none"
2694
2711
  },
2695
- children: u
2712
+ children: m
2696
2713
  }
2697
2714
  ),
2698
2715
  x
2699
2716
  );
2700
2717
  }
2701
- const bf = 340;
2702
- function yf({ anchor: e, onPick: t, onClose: a }) {
2703
- const [n, o] = N(""), [r, f] = N(null), s = U(null), c = U(null), g = F(() => Ne(), []), u = F(
2704
- () => Ot().map((d) => Qe(d) ?? { char: d, name: "", shortcodes: [] }).slice(0, 16),
2718
+ const kf = 340;
2719
+ function xf({ anchor: e, onPick: t, onClose: a }) {
2720
+ const [n, o] = N(""), [r, f] = N(null), s = U(null), c = U(null), u = F(() => Ne(), []), m = F(
2721
+ () => qt().map((d) => Qe(d) ?? { char: d, name: "", shortcodes: [] }).slice(0, 16),
2705
2722
  []
2706
- ), x = F(() => lf(n), [n]), S = n.trim().length > 0;
2723
+ ), x = F(() => gf(n), [n]), S = n.trim().length > 0;
2707
2724
  M(() => {
2708
2725
  s.current?.focus({ preventScroll: !0 });
2709
2726
  }, []);
@@ -2726,7 +2743,7 @@ function yf({ anchor: e, onPick: t, onClose: a }) {
2726
2743
  },
2727
2744
  b
2728
2745
  );
2729
- return /* @__PURE__ */ w(pf, { anchor: e, onClose: a, width: bf, className: "emoji-picker", ariaLabel: "Emoji picker", testId: "emoji-picker", children: [
2746
+ return /* @__PURE__ */ w(vf, { anchor: e, onClose: a, width: kf, className: "emoji-picker", ariaLabel: "Emoji picker", testId: "emoji-picker", children: [
2730
2747
  /* @__PURE__ */ l("div", { className: "emoji-picker-search", children: /* @__PURE__ */ l(
2731
2748
  "input",
2732
2749
  {
@@ -2740,19 +2757,19 @@ function yf({ anchor: e, onPick: t, onClose: a }) {
2740
2757
  }
2741
2758
  ) }),
2742
2759
  !S && /* @__PURE__ */ w("div", { className: "emoji-picker-tabs", role: "tablist", "aria-label": "Emoji categories", children: [
2743
- u.length > 0 && /* @__PURE__ */ l("button", { type: "button", className: "emoji-tab", onClick: () => R("recent"), title: "Frequently used", "aria-label": "Frequently used", children: u[0].char }),
2744
- g.map((d) => /* @__PURE__ */ l("button", { type: "button", className: "emoji-tab", onClick: () => R(d.id), title: d.label, "aria-label": d.label, children: d.emoji[0].char }, d.id))
2760
+ m.length > 0 && /* @__PURE__ */ l("button", { type: "button", className: "emoji-tab", onClick: () => R("recent"), title: "Frequently used", "aria-label": "Frequently used", children: m[0].char }),
2761
+ u.map((d) => /* @__PURE__ */ l("button", { type: "button", className: "emoji-tab", onClick: () => R(d.id), title: d.label, "aria-label": d.label, children: d.emoji[0].char }, d.id))
2745
2762
  ] }),
2746
2763
  /* @__PURE__ */ l("div", { ref: c, className: "emoji-picker-body", onMouseLeave: () => f(null), children: S ? x.length ? /* @__PURE__ */ l("div", { className: "emoji-grid", children: x.map((d) => y(d, d.char)) }) : /* @__PURE__ */ w("p", { className: "emoji-picker-empty", children: [
2747
2764
  "No emoji match “",
2748
2765
  n.trim(),
2749
2766
  "”"
2750
2767
  ] }) : /* @__PURE__ */ w(te, { children: [
2751
- u.length > 0 && /* @__PURE__ */ w("section", { "data-emoji-group": "recent", children: [
2768
+ m.length > 0 && /* @__PURE__ */ w("section", { "data-emoji-group": "recent", children: [
2752
2769
  /* @__PURE__ */ l("h4", { className: "emoji-section-label", children: "Frequently used" }),
2753
- /* @__PURE__ */ l("div", { className: "emoji-grid", children: u.map((d) => y(d, `r-${d.char}`)) })
2770
+ /* @__PURE__ */ l("div", { className: "emoji-grid", children: m.map((d) => y(d, `r-${d.char}`)) })
2754
2771
  ] }),
2755
- g.map((d) => /* @__PURE__ */ w("section", { "data-emoji-group": d.id, className: "emoji-section", children: [
2772
+ u.map((d) => /* @__PURE__ */ w("section", { "data-emoji-group": d.id, className: "emoji-section", children: [
2756
2773
  /* @__PURE__ */ l("h4", { className: "emoji-section-label", children: d.label }),
2757
2774
  /* @__PURE__ */ l("div", { className: "emoji-grid", children: d.emoji.map((b) => y(b, b.char)) })
2758
2775
  ] }, d.id))
@@ -2767,22 +2784,22 @@ function yf({ anchor: e, onPick: t, onClose: a }) {
2767
2784
  ] }) : null })
2768
2785
  ] });
2769
2786
  }
2770
- function _f({ className: e = "w-4 h-4" }) {
2787
+ function Sf({ className: e = "w-4 h-4" }) {
2771
2788
  return /* @__PURE__ */ w("svg", { className: e, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2, children: [
2772
2789
  /* @__PURE__ */ l("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M4 4v16" }),
2773
2790
  /* @__PURE__ */ l("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M15 12l-5 4v-8l5 4z" })
2774
2791
  ] });
2775
2792
  }
2776
- function wf({ className: e = "w-4 h-4" }) {
2793
+ function Tf({ className: e = "w-4 h-4" }) {
2777
2794
  return /* @__PURE__ */ w("svg", { className: e, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2, children: [
2778
2795
  /* @__PURE__ */ l("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M20 4v16" }),
2779
2796
  /* @__PURE__ */ l("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M9 12l5 4v-8l-5 4z" })
2780
2797
  ] });
2781
2798
  }
2782
- function kf({ className: e = "w-5 h-5" }) {
2799
+ function Cf({ className: e = "w-5 h-5" }) {
2783
2800
  return /* @__PURE__ */ l("svg", { className: e, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2, children: /* @__PURE__ */ l("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M6 6l12 12M18 6L6 18" }) });
2784
2801
  }
2785
- function Sn({ className: e = "w-4 h-4" }) {
2802
+ function Cn({ className: e = "w-4 h-4" }) {
2786
2803
  return /* @__PURE__ */ w("svg", { className: e, fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: [
2787
2804
  /* @__PURE__ */ l("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M20.5 12.5A8.5 8.5 0 1111.5 3.5" }),
2788
2805
  /* @__PURE__ */ l("path", { strokeLinecap: "round", d: "M8.5 14.5a4 4 0 007 0" }),
@@ -2790,7 +2807,7 @@ function Sn({ className: e = "w-4 h-4" }) {
2790
2807
  /* @__PURE__ */ l("path", { strokeLinecap: "round", d: "M19 2v6M16 5h6" })
2791
2808
  ] });
2792
2809
  }
2793
- function vf({ className: e = "w-4 h-4" }) {
2810
+ function Ef({ className: e = "w-4 h-4" }) {
2794
2811
  return /* @__PURE__ */ w("svg", { className: e, fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: [
2795
2812
  /* @__PURE__ */ l("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M10 7L4 12l6 5" }),
2796
2813
  /* @__PURE__ */ l("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M4 12h9a7 7 0 017 7" })
@@ -2799,15 +2816,15 @@ function vf({ className: e = "w-4 h-4" }) {
2799
2816
  function dt(e) {
2800
2817
  return new Date(e).toLocaleTimeString([], { hour: "2-digit", minute: "2-digit" });
2801
2818
  }
2802
- const xf = Ke.memo(function({ message: t }) {
2803
- const a = m((h) => h.me.clientId), n = m((h) => h.me.clientId ? h.roster[h.me.clientId]?.author : void 0), o = tf(t, { clientId: a, author: n }), r = rt(
2819
+ const If = Ke.memo(function({ message: t }) {
2820
+ const a = g((h) => h.me.clientId), n = g((h) => h.me.clientId ? h.roster[h.me.clientId]?.author : void 0), o = ff(t, { clientId: a, author: n }), r = rt(
2804
2821
  { clientId: t.clientId, author: t.author },
2805
2822
  { name: t.name, sprite: t.sprite }
2806
2823
  ), f = Ae(r.sprite, r.pictureUrl), s = t.isSystem ? void 0 : r.cosmetics, c = U(null);
2807
- Jo(c, !!s);
2808
- const [g] = N(
2809
- () => t.live && t.text ? wa(t.text, s) : null
2810
- ), [u, x] = N(!1), [S, I] = N(null), R = m((h) => h.setReplyingTo), y = m((h) => h.recentEmoji);
2824
+ er(c, !!s);
2825
+ const [u] = N(
2826
+ () => t.live && t.text ? va(t.text, s) : null
2827
+ ), [m, x] = N(!1), [S, I] = N(null), R = g((h) => h.setReplyingTo), y = g((h) => h.recentEmoji);
2811
2828
  if (t.isSystem && t.systemType === "recap")
2812
2829
  return /* @__PURE__ */ l("div", { className: "px-2 py-1.5", children: /* @__PURE__ */ w("div", { className: "border-l-2 border-border-light pl-2.5 py-0.5", children: [
2813
2830
  /* @__PURE__ */ w("div", { className: "text-[10px] uppercase tracking-wide text-text-muted mb-0.5", children: [
@@ -2818,14 +2835,14 @@ const xf = Ke.memo(function({ message: t }) {
2818
2835
  ] }) });
2819
2836
  if (t.isSystem)
2820
2837
  return /* @__PURE__ */ w("div", { className: "px-2 py-0.5 text-[11px] text-text-muted italic text-center leading-tight", children: [
2821
- Ji(t.text, t.template, r),
2838
+ tf(t.text, t.template, r),
2822
2839
  /* @__PURE__ */ l("span", { className: "ml-1 text-[10px] opacity-50", children: dt(t.ts) })
2823
2840
  ] });
2824
2841
  const d = { clientId: a, author: n }, b = (h) => {
2825
- const _ = t.reactions?.find((O) => O.emoji === h), k = !(_ && xn(_, d));
2826
- k && vn(h);
2842
+ const _ = t.reactions?.find((O) => O.emoji === h), v = !(_ && Tn(_, d));
2843
+ v && Sn(h);
2827
2844
  const P = n ?? a;
2828
- P && Fr(t.id, h, k, P), qi(t.id, h, k);
2845
+ P && Vr(t.id, h, v, P), zi(t.id, h, v);
2829
2846
  };
2830
2847
  return /* @__PURE__ */ w(
2831
2848
  "div",
@@ -2840,21 +2857,21 @@ const xf = Ke.memo(function({ message: t }) {
2840
2857
  onBlur: (h) => {
2841
2858
  h.currentTarget.contains(h.relatedTarget) || x(!1);
2842
2859
  },
2843
- "data-active": u || S ? "true" : void 0,
2860
+ "data-active": m || S ? "true" : void 0,
2844
2861
  children: [
2845
- t.replyTo && /* @__PURE__ */ l(Sf, { replyTo: t.replyTo }),
2862
+ t.replyTo && /* @__PURE__ */ l(Af, { replyTo: t.replyTo }),
2846
2863
  /* @__PURE__ */ w("div", { className: "flex items-start gap-2", children: [
2847
- /* @__PURE__ */ l(_n, { sprite: r.sprite, url: r.pictureUrl, alt: r.name, worn: s }),
2864
+ /* @__PURE__ */ l(vn, { sprite: r.sprite, url: r.pictureUrl, alt: r.name, worn: s }),
2848
2865
  /* @__PURE__ */ w("div", { className: "flex-1 min-w-0 -mt-0.5", children: [
2849
2866
  s ? /* @__PURE__ */ l(we, { html: ka(r.name, s), className: "text-[13px]", style: { color: f } }) : /* @__PURE__ */ l("span", { className: "font-medium text-[13px]", style: { color: f }, children: r.name }),
2850
2867
  /* @__PURE__ */ l("span", { className: "text-[10px] text-text-muted opacity-60 ml-1.5", children: dt(t.ts) }),
2851
- t.text && (g ? /* @__PURE__ */ l(we, { as: "p", html: g, className: "text-[13px] text-text break-words leading-snug m-0" }) : /* @__PURE__ */ l("p", { className: "text-[13px] text-text break-words leading-snug m-0", children: t.text })),
2852
- /* @__PURE__ */ l(wn, { images: t.images }),
2853
- t.reactions && t.reactions.length > 0 && /* @__PURE__ */ l(Tf, { reactions: t.reactions, me: d, onToggle: b, onAdd: I })
2868
+ t.text && (u ? /* @__PURE__ */ l(we, { as: "p", html: u, className: "text-[13px] text-text break-words leading-snug m-0" }) : /* @__PURE__ */ l("p", { className: "text-[13px] text-text break-words leading-snug m-0", children: t.text })),
2869
+ /* @__PURE__ */ l(kn, { images: t.images }),
2870
+ t.reactions && t.reactions.length > 0 && /* @__PURE__ */ l(Nf, { reactions: t.reactions, me: d, onToggle: b, onAdd: I })
2854
2871
  ] })
2855
2872
  ] }),
2856
- (u || S) && /* @__PURE__ */ w("div", { className: "chat-msg-actions", role: "toolbar", "aria-label": "Message actions", "data-testid": "chat-msg-actions", children: [
2857
- df(3, y).map((h) => /* @__PURE__ */ l("button", { type: "button", className: "chat-action-btn chat-action-emoji", onClick: () => b(h), "aria-label": `React with ${Qe(h)?.name ?? h}`, title: Qe(h)?.name, children: h }, h)),
2873
+ (m || S) && /* @__PURE__ */ w("div", { className: "chat-msg-actions", role: "toolbar", "aria-label": "Message actions", "data-testid": "chat-msg-actions", children: [
2874
+ pf(3, y).map((h) => /* @__PURE__ */ l("button", { type: "button", className: "chat-action-btn chat-action-emoji", onClick: () => b(h), "aria-label": `React with ${Qe(h)?.name ?? h}`, title: Qe(h)?.name, children: h }, h)),
2858
2875
  /* @__PURE__ */ l(
2859
2876
  "button",
2860
2877
  {
@@ -2864,20 +2881,20 @@ const xf = Ke.memo(function({ message: t }) {
2864
2881
  "aria-label": "Add reaction",
2865
2882
  title: "Add reaction",
2866
2883
  "aria-expanded": !!S,
2867
- children: /* @__PURE__ */ l(Sn, {})
2884
+ children: /* @__PURE__ */ l(Cn, {})
2868
2885
  }
2869
2886
  ),
2870
- /* @__PURE__ */ l("button", { type: "button", className: "chat-action-btn", onClick: () => R(t.id), "aria-label": "Reply", title: "Reply", children: /* @__PURE__ */ l(vf, {}) })
2887
+ /* @__PURE__ */ l("button", { type: "button", className: "chat-action-btn", onClick: () => R(t.id), "aria-label": "Reply", title: "Reply", children: /* @__PURE__ */ l(Ef, {}) })
2871
2888
  ] }),
2872
- S && /* @__PURE__ */ l(yf, { anchor: S, onPick: b, onClose: () => {
2889
+ S && /* @__PURE__ */ l(xf, { anchor: S, onPick: b, onClose: () => {
2873
2890
  I(null), x(!1);
2874
2891
  } })
2875
2892
  ]
2876
2893
  }
2877
2894
  );
2878
2895
  });
2879
- function Sf({ replyTo: e }) {
2880
- const t = m((f) => f.chat.find((s) => s.id === e)), a = m((f) => f.jumpToMessage), n = rt(
2896
+ function Af({ replyTo: e }) {
2897
+ const t = g((f) => f.chat.find((s) => s.id === e)), a = g((f) => f.jumpToMessage), n = rt(
2881
2898
  { clientId: t?.clientId ?? "", author: t?.author },
2882
2899
  { name: t?.name ?? "", sprite: t?.sprite ?? null }
2883
2900
  ), o = Ae(n.sprite, n.pictureUrl);
@@ -2886,7 +2903,7 @@ function Sf({ replyTo: e }) {
2886
2903
  /* @__PURE__ */ l("span", { className: "chat-reply-spine", "aria-hidden": "true" }),
2887
2904
  /* @__PURE__ */ l("span", { className: "chat-reply-text italic", children: "Original message unavailable" })
2888
2905
  ] });
2889
- const r = t.isSystem ? (t.template ?? t.text).split(St).join(n.name) : t.text || (t.images?.length ? "Image" : "");
2906
+ const r = t.isSystem ? (t.template ?? t.text).split(Tt).join(n.name) : t.text || (t.images?.length ? "Image" : "");
2890
2907
  return /* @__PURE__ */ w(
2891
2908
  "button",
2892
2909
  {
@@ -2898,7 +2915,7 @@ function Sf({ replyTo: e }) {
2898
2915
  children: [
2899
2916
  /* @__PURE__ */ l("span", { className: "chat-reply-spine", "aria-hidden": "true" }),
2900
2917
  /* @__PURE__ */ l(
2901
- Lt,
2918
+ Ot,
2902
2919
  {
2903
2920
  sprite: n.sprite,
2904
2921
  url: n.pictureUrl,
@@ -2913,11 +2930,11 @@ function Sf({ replyTo: e }) {
2913
2930
  }
2914
2931
  );
2915
2932
  }
2916
- function Tf({ reactions: e, me: t, onToggle: a, onAdd: n }) {
2917
- const o = m((r) => r.roster);
2933
+ function Nf({ reactions: e, me: t, onToggle: a, onAdd: n }) {
2934
+ const o = g((r) => r.roster);
2918
2935
  return /* @__PURE__ */ w("div", { className: "chat-reactions", "data-testid": "chat-reactions", children: [
2919
2936
  e.map((r) => {
2920
- const f = xn(r, t);
2937
+ const f = Tn(r, t);
2921
2938
  return /* @__PURE__ */ w(
2922
2939
  "button",
2923
2940
  {
@@ -2926,7 +2943,7 @@ function Tf({ reactions: e, me: t, onToggle: a, onAdd: n }) {
2926
2943
  "data-mine": f ? "true" : void 0,
2927
2944
  "aria-pressed": f,
2928
2945
  onClick: () => a(r.emoji),
2929
- title: mf(uf(r, o, t), Qe(r.emoji)?.name),
2946
+ title: yf(bf(r, o, t), Qe(r.emoji)?.name),
2930
2947
  "data-emoji": r.emoji,
2931
2948
  children: [
2932
2949
  /* @__PURE__ */ l("span", { className: "chat-reaction-emoji", children: r.emoji }),
@@ -2936,22 +2953,22 @@ function Tf({ reactions: e, me: t, onToggle: a, onAdd: n }) {
2936
2953
  r.emoji
2937
2954
  );
2938
2955
  }),
2939
- /* @__PURE__ */ l("button", { type: "button", className: "chat-reaction chat-reaction-add", onClick: (r) => n(r.currentTarget), "aria-label": "Add reaction", title: "Add reaction", children: /* @__PURE__ */ l(Sn, {}) })
2956
+ /* @__PURE__ */ l("button", { type: "button", className: "chat-reaction chat-reaction-add", onClick: (r) => n(r.currentTarget), "aria-label": "Add reaction", title: "Add reaction", children: /* @__PURE__ */ l(Cn, {}) })
2940
2957
  ] });
2941
2958
  }
2942
- function Cf() {
2959
+ function jf() {
2943
2960
  Ga();
2944
- const e = m((r) => r.chat), t = U(null), a = U(!1), n = D(() => {
2961
+ const e = g((r) => r.chat), t = U(null), a = U(!1), n = D(() => {
2945
2962
  const r = t.current;
2946
2963
  if (!r) return;
2947
- const { scrollHeight: f, scrollTop: s, clientHeight: c } = r, g = f - s - c;
2948
- a.current = g > 40;
2964
+ const { scrollHeight: f, scrollTop: s, clientHeight: c } = r, u = f - s - c;
2965
+ a.current = u > 40;
2949
2966
  }, []);
2950
2967
  M(() => {
2951
2968
  const r = t.current;
2952
2969
  !r || a.current || (typeof r.scrollTo == "function" ? r.scrollTo({ top: r.scrollHeight, behavior: "smooth" }) : r.scrollTop = r.scrollHeight);
2953
2970
  }, [e.length]);
2954
- const o = m((r) => r.chatJump);
2971
+ const o = g((r) => r.chatJump);
2955
2972
  return M(() => {
2956
2973
  const r = t.current;
2957
2974
  if (!o || !r) return;
@@ -2975,13 +2992,13 @@ function Cf() {
2975
2992
  /* @__PURE__ */ l("span", { className: "text-[10px] text-text-muted whitespace-nowrap", children: new Date(r.ts).toLocaleDateString([], { weekday: "short", month: "short", day: "numeric" }) }),
2976
2993
  /* @__PURE__ */ l("div", { className: "flex-1 h-px bg-border" })
2977
2994
  ] }),
2978
- /* @__PURE__ */ l(xf, { message: r })
2995
+ /* @__PURE__ */ l(If, { message: r })
2979
2996
  ] }, r.id);
2980
2997
  }) })
2981
2998
  }
2982
2999
  );
2983
3000
  }
2984
- const qt = [
3001
+ const Ht = [
2985
3002
  {
2986
3003
  name: "recap",
2987
3004
  description: "Summarise the previous episode of what is loaded",
@@ -3002,12 +3019,12 @@ const qt = [
3002
3019
  scope: "local"
3003
3020
  }
3004
3021
  ], ue = "/";
3005
- function Ef(e) {
3022
+ function Rf(e) {
3006
3023
  if (!e.startsWith(ue)) return null;
3007
3024
  const t = e.slice(ue.length);
3008
3025
  return /\s/.test(t) ? null : t.toLowerCase();
3009
3026
  }
3010
- function If(e, t = qt) {
3027
+ function Pf(e, t = Ht) {
3011
3028
  const a = e.toLowerCase();
3012
3029
  if (!a) return [...t].sort((o, r) => o.name.localeCompare(r.name));
3013
3030
  const n = [];
@@ -3017,23 +3034,23 @@ function If(e, t = qt) {
3017
3034
  }
3018
3035
  return n.sort((o, r) => o.rank - r.rank || o.cmd.name.localeCompare(r.cmd.name)).map((o) => o.cmd);
3019
3036
  }
3020
- function Af(e) {
3037
+ function Mf(e) {
3021
3038
  return `${ue}${e.name} `;
3022
3039
  }
3023
3040
  function _e(e, t) {
3024
3041
  return t <= 0 ? 0 : (e % t + t) % t;
3025
3042
  }
3026
- function Nf(e, t = qt) {
3043
+ function Df(e, t = Ht) {
3027
3044
  const a = e.trim();
3028
3045
  if (!a) return null;
3029
3046
  if (!a.startsWith(ue)) return { kind: "chat", text: a };
3030
3047
  const n = a.slice(ue.length), o = n.search(/\s/), r = (o === -1 ? n : n.slice(0, o)).toLowerCase(), f = o === -1 ? "" : n.slice(o).trim(), s = t.find((c) => c.name.toLowerCase() === r);
3031
3048
  return s ? { kind: "command", command: s, args: f } : { kind: "chat", text: a };
3032
3049
  }
3033
- function jf(e, t) {
3050
+ function Lf(e, t) {
3034
3051
  return e.requiresMedia && !t.hasMedia ? `${ue}${e.name} needs an episode loaded.` : null;
3035
3052
  }
3036
- function Rf({
3053
+ function Of({
3037
3054
  commands: e,
3038
3055
  activeIndex: t,
3039
3056
  hasMedia: a,
@@ -3051,19 +3068,19 @@ function Rf({
3051
3068
  bg-bg-card border border-border-light rounded shadow-lg
3052
3069
  list-none m-0 p-0 py-1 mb-1`,
3053
3070
  children: e.map((f, s) => {
3054
- const c = !!f.requiresMedia && !a, g = s === t;
3071
+ const c = !!f.requiresMedia && !a, u = s === t;
3055
3072
  return /* @__PURE__ */ w(
3056
3073
  "li",
3057
3074
  {
3058
3075
  id: `${r}-opt-${f.name}`,
3059
3076
  role: "option",
3060
- "aria-selected": g,
3077
+ "aria-selected": u,
3061
3078
  "aria-disabled": c,
3062
- onMouseDown: (u) => {
3063
- u.preventDefault(), n(f);
3079
+ onMouseDown: (m) => {
3080
+ m.preventDefault(), n(f);
3064
3081
  },
3065
3082
  onMouseEnter: () => o(s),
3066
- className: `px-3 py-1.5 cursor-pointer flex items-baseline gap-2 ${g ? "bg-bg-alt" : ""} ${c ? "opacity-50" : ""}`,
3083
+ className: `px-3 py-1.5 cursor-pointer flex items-baseline gap-2 ${u ? "bg-bg-alt" : ""} ${c ? "opacity-50" : ""}`,
3067
3084
  children: [
3068
3085
  /* @__PURE__ */ l("span", { className: "text-sm font-semibold text-text shrink-0", children: f.usage }),
3069
3086
  /* @__PURE__ */ l("span", { className: "text-xs text-text-secondary truncate", children: c ? "needs an episode loaded" : f.description })
@@ -3075,8 +3092,8 @@ function Rf({
3075
3092
  }
3076
3093
  );
3077
3094
  }
3078
- const Tn = (e, t) => `${e}-emoji-${t.code}`;
3079
- function Pf({ matches: e, activeIndex: t, onPick: a, onHover: n, listboxId: o }) {
3095
+ const En = (e, t) => `${e}-emoji-${t.code}`;
3096
+ function qf({ matches: e, activeIndex: t, onPick: a, onHover: n, listboxId: o }) {
3080
3097
  return e.length === 0 ? null : /* @__PURE__ */ l(
3081
3098
  "ul",
3082
3099
  {
@@ -3090,7 +3107,7 @@ function Pf({ matches: e, activeIndex: t, onPick: a, onHover: n, listboxId: o })
3090
3107
  children: e.map((r, f) => /* @__PURE__ */ w(
3091
3108
  "li",
3092
3109
  {
3093
- id: Tn(o, r),
3110
+ id: En(o, r),
3094
3111
  role: "option",
3095
3112
  "aria-selected": f === t,
3096
3113
  onMouseDown: (s) => {
@@ -3112,52 +3129,52 @@ function Pf({ matches: e, activeIndex: t, onPick: a, onHover: n, listboxId: o })
3112
3129
  }
3113
3130
  );
3114
3131
  }
3115
- const Mf = 2, Df = /^[a-z0-9_+-]*$/i;
3116
- function Lf(e, t) {
3132
+ const Hf = 2, Uf = /^[a-z0-9_+-]*$/i;
3133
+ function $f(e, t) {
3117
3134
  const a = e.slice(0, t), n = a.lastIndexOf(":");
3118
3135
  if (n < 0) return null;
3119
3136
  const o = n === 0 ? "" : a[n - 1];
3120
3137
  if (o && !/[\s([{]/.test(o)) return null;
3121
3138
  const r = a.slice(n + 1);
3122
- return r.length < Mf || !Df.test(r) ? null : { query: r.toLowerCase(), start: n };
3139
+ return r.length < Hf || !Uf.test(r) ? null : { query: r.toLowerCase(), start: n };
3123
3140
  }
3124
- function Of(e, t, a, n) {
3141
+ function Ff(e, t, a, n) {
3125
3142
  const o = e.slice(a), r = o.startsWith(" ") ? n : `${n} `;
3126
3143
  return { text: e.slice(0, t) + r + o, caret: t + r.length };
3127
3144
  }
3128
- function qf(e) {
3145
+ function zf(e) {
3129
3146
  let t = -1;
3130
3147
  return e.replace(/:([a-z0-9_+-]+):/gi, (a, n, o) => {
3131
3148
  const r = o === 0 ? "" : e[o - 1];
3132
3149
  if (r && !/[\s([{]/.test(r) && o !== t) return a;
3133
- const f = kn(n);
3150
+ const f = xn(n);
3134
3151
  return f ? (t = o + a.length, f.char) : a;
3135
3152
  });
3136
3153
  }
3137
- function Hf(e, t, a) {
3138
- const [n, o] = N(0), [r, f] = N({ q: null, i: 0 }), [s, c] = N(null), g = Lf(e, Math.min(n, e.length)), u = g?.query ?? null, x = F(() => u ? sf(u) : [], [u]), S = g ? `${g.start}:${u}` : null, I = x.length > 0 && s !== S, R = r.q === S ? _e(r.i, x.length) : 0, y = D((k) => f({ q: S, i: k }), [S]), d = U(null);
3154
+ function Wf(e, t, a) {
3155
+ const [n, o] = N(0), [r, f] = N({ q: null, i: 0 }), [s, c] = N(null), u = $f(e, Math.min(n, e.length)), m = u?.query ?? null, x = F(() => m ? mf(m) : [], [m]), S = u ? `${u.start}:${m}` : null, I = x.length > 0 && s !== S, R = r.q === S ? _e(r.i, x.length) : 0, y = D((v) => f({ q: S, i: v }), [S]), d = U(null);
3139
3156
  ut(() => {
3140
- const k = d.current, P = a.current;
3141
- k === null || !P || (d.current = null, P.setSelectionRange(k, k));
3157
+ const v = d.current, P = a.current;
3158
+ v === null || !P || (d.current = null, P.setSelectionRange(v, v));
3142
3159
  }, [e, a]);
3143
- const b = D((k) => o(k.selectionStart ?? k.value.length), []), h = D((k) => {
3144
- if (!g) return;
3145
- const P = Of(e, g.start, Math.min(n, e.length), k.emoji.char);
3146
- t(P.text), o(P.caret), vn(k.emoji.char), d.current = P.caret, a.current?.focus();
3147
- }, [g, e, n, t, a]), _ = D((k) => {
3160
+ const b = D((v) => o(v.selectionStart ?? v.value.length), []), h = D((v) => {
3161
+ if (!u) return;
3162
+ const P = Ff(e, u.start, Math.min(n, e.length), v.emoji.char);
3163
+ t(P.text), o(P.caret), Sn(v.emoji.char), d.current = P.caret, a.current?.focus();
3164
+ }, [u, e, n, t, a]), _ = D((v) => {
3148
3165
  if (!I) return !1;
3149
- if (k.key === "ArrowDown" || k.key === "ArrowUp")
3150
- return k.preventDefault(), y(_e(R + (k.key === "ArrowDown" ? 1 : -1), x.length)), !0;
3151
- if (k.key === "Tab" || k.key === "Enter") {
3152
- k.preventDefault();
3166
+ if (v.key === "ArrowDown" || v.key === "ArrowUp")
3167
+ return v.preventDefault(), y(_e(R + (v.key === "ArrowDown" ? 1 : -1), x.length)), !0;
3168
+ if (v.key === "Tab" || v.key === "Enter") {
3169
+ v.preventDefault();
3153
3170
  const P = x[R];
3154
3171
  return P && h(P), !0;
3155
3172
  }
3156
- return k.key === "Escape" ? (k.preventDefault(), c(S), !0) : !1;
3173
+ return v.key === "Escape" ? (v.preventDefault(), c(S), !0) : !1;
3157
3174
  }, [I, x, R, h, y, S]);
3158
3175
  return { open: I, matches: x, activeIndex: R, setActiveIndex: y, pick: h, onKeyDown: _, trackCaret: b };
3159
3176
  }
3160
- function Uf({
3177
+ function Bf({
3161
3178
  pending: e,
3162
3179
  uploading: t,
3163
3180
  onRemove: a
@@ -3184,31 +3201,31 @@ function Uf({
3184
3201
  )
3185
3202
  ] }, n.id)) }) : null;
3186
3203
  }
3187
- function $f() {
3188
- const [e, t] = N([]), [a, n] = N(!1), o = m((y) => y.pushToast), r = U(/* @__PURE__ */ new Set());
3204
+ function Gf() {
3205
+ const [e, t] = N([]), [a, n] = N(!1), o = g((y) => y.pushToast), r = U(/* @__PURE__ */ new Set());
3189
3206
  M(() => () => {
3190
3207
  for (const y of r.current) URL.revokeObjectURL(y);
3191
3208
  r.current.clear();
3192
3209
  }, []);
3193
3210
  const f = D((y) => {
3194
- jo(y) && (URL.revokeObjectURL(y.previewUrl), r.current.delete(y.previewUrl));
3211
+ Do(y) && (URL.revokeObjectURL(y.previewUrl), r.current.delete(y.previewUrl));
3195
3212
  }, []), s = D(async (y) => {
3196
3213
  if (!y.length) return;
3197
3214
  const d = [];
3198
3215
  for (const b of y) {
3199
- const h = Po(b);
3216
+ const h = Oo(b);
3200
3217
  if (h) {
3201
3218
  o("error", h);
3202
3219
  continue;
3203
3220
  }
3204
- const { w: _, h: k } = await Lo(b), P = URL.createObjectURL(b);
3221
+ const { w: _, h: v } = await Uo(b), P = URL.createObjectURL(b);
3205
3222
  r.current.add(P), d.push({
3206
3223
  kind: "file",
3207
3224
  id: `${Date.now()}-${Math.random().toString(36).slice(2, 8)}`,
3208
3225
  file: b,
3209
3226
  previewUrl: P,
3210
3227
  w: _,
3211
- h: k
3228
+ h: v
3212
3229
  });
3213
3230
  }
3214
3231
  d.length && t((b) => {
@@ -3237,21 +3254,21 @@ function $f() {
3237
3254
  h: y.height ?? 0,
3238
3255
  title: y.title || void 0
3239
3256
  }]), tt().catalogue($a).recordUse(y.key));
3240
- }, [o]), g = D((y) => {
3257
+ }, [o]), u = D((y) => {
3241
3258
  t((d) => {
3242
3259
  const b = d.find((h) => h.id === y);
3243
3260
  return b && f(b), d.filter((h) => h.id !== y);
3244
3261
  });
3245
- }, [f]), u = D(() => {
3262
+ }, [f]), m = D(() => {
3246
3263
  t((y) => {
3247
3264
  for (const d of y) f(d);
3248
3265
  return [];
3249
3266
  });
3250
3267
  }, [f]), x = D((y) => {
3251
- const d = Mo(y.clipboardData);
3268
+ const d = qo(y.clipboardData);
3252
3269
  d.length && (y.preventDefault(), s(d));
3253
3270
  }, [s]), S = D((y) => {
3254
- const d = Do(y.dataTransfer);
3271
+ const d = Ho(y.dataTransfer);
3255
3272
  d.length && (y.preventDefault(), s(d));
3256
3273
  }, [s]), I = D((y) => {
3257
3274
  y.dataTransfer?.types?.includes("Files") && y.preventDefault();
@@ -3259,9 +3276,9 @@ function $f() {
3259
3276
  if (!e.length) return [];
3260
3277
  n(!0);
3261
3278
  try {
3262
- return await qo(e);
3279
+ return await Fo(e);
3263
3280
  } catch (y) {
3264
- return L("chat", "Image upload failed", Ho(y)), o("error", Ro(y)), null;
3281
+ return L("chat", "Image upload failed", zo(y)), o("error", Lo(y)), null;
3265
3282
  } finally {
3266
3283
  n(!1);
3267
3284
  }
@@ -3271,16 +3288,16 @@ function $f() {
3271
3288
  uploading: a,
3272
3289
  addFiles: s,
3273
3290
  addMeme: c,
3274
- remove: g,
3275
- clear: u,
3291
+ remove: u,
3292
+ clear: m,
3276
3293
  uploadPending: R,
3277
3294
  onPaste: x,
3278
3295
  onDrop: S,
3279
3296
  onDragOver: I
3280
3297
  };
3281
3298
  }
3282
- const Ff = 2500, zf = 5e3;
3283
- class Wf {
3299
+ const Kf = 2500, Vf = 5e3;
3300
+ class Yf {
3284
3301
  constructor(t, a = Date.now) {
3285
3302
  this.send = t, this.now = a;
3286
3303
  }
@@ -3295,21 +3312,21 @@ class Wf {
3295
3312
  return;
3296
3313
  }
3297
3314
  const a = this.now();
3298
- (!this.typing || a - this.lastSent >= Ff) && (this.typing = !0, this.lastSent = a, this.send(!0)), this.idle && clearTimeout(this.idle), this.idle = setTimeout(() => this.stop(), zf);
3315
+ (!this.typing || a - this.lastSent >= Kf) && (this.typing = !0, this.lastSent = a, this.send(!0)), this.idle && clearTimeout(this.idle), this.idle = setTimeout(() => this.stop(), Vf);
3299
3316
  }
3300
3317
  stop() {
3301
3318
  this.idle && (clearTimeout(this.idle), this.idle = null), this.typing && (this.typing = !1, this.send(!1));
3302
3319
  }
3303
3320
  }
3304
- function Bf() {
3305
- const [e] = N(() => new Wf(Hi));
3321
+ function Jf() {
3322
+ const [e] = N(() => new Yf(Wi));
3306
3323
  return M(() => () => e.stop(), [e]), e;
3307
3324
  }
3308
- function Gf(e) {
3325
+ function Xf(e) {
3309
3326
  return e.length === 0 ? null : e.length === 1 ? `${e[0]} is typing…` : e.length === 2 ? `${e[0]} and ${e[1]} are typing…` : e.length === 3 ? `${e[0]}, ${e[1]} and ${e[2]} are typing…` : "Several people are typing…";
3310
3327
  }
3311
- function Kf({ replyTo: e, onCancel: t }) {
3312
- const a = m((r) => r.chat.find((f) => f.id === e)), n = rt(
3328
+ function Qf({ replyTo: e, onCancel: t }) {
3329
+ const a = g((r) => r.chat.find((f) => f.id === e)), n = rt(
3313
3330
  { clientId: a?.clientId ?? "", author: a?.author },
3314
3331
  { name: a?.name ?? "a message", sprite: a?.sprite ?? null }
3315
3332
  ), o = Ae(n.sprite, n.pictureUrl);
@@ -3318,13 +3335,13 @@ function Kf({ replyTo: e, onCancel: t }) {
3318
3335
  "Replying to ",
3319
3336
  /* @__PURE__ */ l("span", { className: "font-semibold", style: { color: o }, children: n.name })
3320
3337
  ] }),
3321
- /* @__PURE__ */ l("button", { type: "button", className: "chat-reply-cancel", onClick: t, "aria-label": "Cancel reply", title: "Cancel reply", children: /* @__PURE__ */ l(kf, { className: "w-3.5 h-3.5" }) })
3338
+ /* @__PURE__ */ l("button", { type: "button", className: "chat-reply-cancel", onClick: t, "aria-label": "Cancel reply", title: "Cancel reply", children: /* @__PURE__ */ l(Cf, { className: "w-3.5 h-3.5" }) })
3322
3339
  ] });
3323
3340
  }
3324
- function Cn(e, t) {
3341
+ function In(e, t) {
3325
3342
  const a = /* @__PURE__ */ new Map();
3326
3343
  for (const n of Object.values(e)) {
3327
- const o = wt(n), r = a.get(o);
3344
+ const o = kt(n), r = a.get(o);
3328
3345
  if (!r) {
3329
3346
  a.set(o, n);
3330
3347
  continue;
@@ -3334,28 +3351,28 @@ function Cn(e, t) {
3334
3351
  }
3335
3352
  return [...a.values()];
3336
3353
  }
3337
- function wt(e) {
3354
+ function kt(e) {
3338
3355
  return e.author ? `author:${e.author}` : `client:${e.clientId}`;
3339
3356
  }
3340
- function Vf() {
3341
- const e = m((c) => c.typing), t = m((c) => c.roster), a = m((c) => c.me.clientId), n = m((c) => c.setTyping);
3357
+ function Zf() {
3358
+ const e = g((c) => c.typing), t = g((c) => c.roster), a = g((c) => c.me.clientId), n = g((c) => c.setTyping);
3342
3359
  M(() => {
3343
3360
  const c = Object.keys(e);
3344
3361
  if (c.length === 0) return;
3345
- const g = Math.min(...c.map((x) => e[x])), u = setTimeout(() => {
3362
+ const u = Math.min(...c.map((x) => e[x])), m = setTimeout(() => {
3346
3363
  const x = Date.now();
3347
3364
  for (const S of c) e[S] <= x && n(S, !1);
3348
- }, Math.max(0, g - Date.now()) + 50);
3349
- return () => clearTimeout(u);
3365
+ }, Math.max(0, u - Date.now()) + 50);
3366
+ return () => clearTimeout(m);
3350
3367
  }, [e, n]);
3351
- const o = a && t[a] ? wt(t[a]) : null, r = /* @__PURE__ */ new Map();
3368
+ const o = a && t[a] ? kt(t[a]) : null, r = /* @__PURE__ */ new Map();
3352
3369
  for (const c of Object.keys(e)) {
3353
- const g = t[c];
3354
- if (!g || c === a) continue;
3355
- const u = wt(g);
3356
- u !== o && !r.has(u) && r.set(u, g.name || "Someone");
3370
+ const u = t[c];
3371
+ if (!u || c === a) continue;
3372
+ const m = kt(u);
3373
+ m !== o && !r.has(m) && r.set(m, u.name || "Someone");
3357
3374
  }
3358
- const f = [...r.values()].sort((c, g) => c.localeCompare(g)), s = Gf(f);
3375
+ const f = [...r.values()].sort((c, u) => c.localeCompare(u)), s = Xf(f);
3359
3376
  return /* @__PURE__ */ l("div", { className: "chat-typing", "aria-live": "polite", "data-testid": "chat-typing", children: s && /* @__PURE__ */ w(te, { children: [
3360
3377
  /* @__PURE__ */ w("span", { className: "chat-typing-dots", "aria-hidden": "true", children: [
3361
3378
  /* @__PURE__ */ l("i", {}),
@@ -3365,114 +3382,114 @@ function Vf() {
3365
3382
  /* @__PURE__ */ l("span", { className: "truncate", children: s })
3366
3383
  ] }) });
3367
3384
  }
3368
- const da = Ea, Yf = fo;
3369
- function Jf({ commands: e = qt }) {
3370
- const [t, a] = N(""), [n, o] = N(!1), [r, f] = N({ q: null, i: 0 }), [s, c] = N(!1), g = U(null), u = Ft(), x = Ft(), [S, I] = N(!1), [R, y] = N(!1), d = Hf(t, a, g), b = $f(), h = Bf(), _ = m((v) => v.replyingTo), k = m((v) => v.setReplyingTo);
3385
+ const ua = Ia, es = uo;
3386
+ function ts({ commands: e = Ht }) {
3387
+ const [t, a] = N(""), [n, o] = N(!1), [r, f] = N({ q: null, i: 0 }), [s, c] = N(!1), u = U(null), m = zt(), x = zt(), [S, I] = N(!1), [R, y] = N(!1), d = Wf(t, a, u), b = Gf(), h = Jf(), _ = g((k) => k.replyingTo), v = g((k) => k.setReplyingTo);
3371
3388
  M(() => {
3372
- _ && !document.hidden && g.current?.focus({ preventScroll: !0 });
3389
+ _ && !document.hidden && u.current?.focus({ preventScroll: !0 });
3373
3390
  }, [_]);
3374
- const P = m((v) => v.snapshot.mediaId), O = m((v) => v.pushToast), z = m((v) => v.setTierlistOpen), W = !!P, E = Ef(t), j = F(
3375
- () => E === null ? [] : If(E, e),
3391
+ const P = g((k) => k.snapshot.mediaId), O = g((k) => k.pushToast), z = g((k) => k.setTierlistOpen), W = !!P, E = Rf(t), j = F(
3392
+ () => E === null ? [] : Pf(E, e),
3376
3393
  [E, e]
3377
3394
  ), A = E !== null && !s && j.length > 0, q = r.q === E ? _e(r.i, j.length) : 0, H = D(
3378
- (v) => f({ q: E, i: v }),
3395
+ (k) => f({ q: E, i: k }),
3379
3396
  [E]
3380
- ), ie = D((v, $) => {
3381
- const me = jf(v, { hasMedia: W });
3397
+ ), ie = D((k, $) => {
3398
+ const me = Lf(k, { hasMedia: W });
3382
3399
  if (me) {
3383
3400
  O("info", me);
3384
3401
  return;
3385
3402
  }
3386
- switch (v.name) {
3403
+ switch (k.name) {
3387
3404
  case "help":
3388
- O("info", e.map((Nn) => Nn.usage).join(" "));
3405
+ O("info", e.map((Rn) => Rn.usage).join(" "));
3389
3406
  break;
3390
3407
  case "recap":
3391
- Bi();
3408
+ Ji();
3392
3409
  break;
3393
3410
  case "tierlist":
3394
- Zr(), z(!0);
3411
+ ri(), z(!0);
3395
3412
  break;
3396
3413
  default:
3397
- O("info", `${v.usage} is not implemented yet.`);
3414
+ O("info", `${k.usage} is not implemented yet.`);
3398
3415
  }
3399
- }, [W, O, e, z]), Y = D((v) => {
3400
- a(Af(v)), c(!1), g.current?.focus();
3401
- }, []), In = D(async (v) => {
3402
- if (v.preventDefault(), n || b.uploading) return;
3403
- const $ = Nf(t, e);
3416
+ }, [W, O, e, z]), Y = D((k) => {
3417
+ a(Mf(k)), c(!1), u.current?.focus();
3418
+ }, []), Nn = D(async (k) => {
3419
+ if (k.preventDefault(), n || b.uploading) return;
3420
+ const $ = Df(t, e);
3404
3421
  if (!$ && !b.pending.length) return;
3405
3422
  if ($?.kind === "command" && b.pending.length) {
3406
3423
  O("info", "Send images on their own, not with a command.");
3407
3424
  return;
3408
3425
  }
3409
3426
  if ($?.kind === "command") {
3410
- ie($.command, $.args), a(""), h.stop(), !document.hidden && document.hasFocus() && g.current?.focus();
3427
+ ie($.command, $.args), a(""), h.stop(), !document.hidden && document.hasFocus() && u.current?.focus();
3411
3428
  return;
3412
3429
  }
3413
3430
  const me = await b.uploadPending();
3414
- me !== null && (Oi(qf($?.text ?? ""), me, _), a(""), h.stop(), k(null), b.clear(), o(!0), setTimeout(() => o(!1), Yf), !document.hidden && document.hasFocus() && g.current?.focus());
3415
- }, [t, n, ie, b, O, e, _, k, h]), An = D((v) => {
3416
- if (!(!A && d.onKeyDown(v))) {
3417
- if (v.key === "Escape" && A) {
3418
- v.preventDefault(), c(!0);
3431
+ me !== null && (Fi(zf($?.text ?? ""), me, _), a(""), h.stop(), v(null), b.clear(), o(!0), setTimeout(() => o(!1), es), !document.hidden && document.hasFocus() && u.current?.focus());
3432
+ }, [t, n, ie, b, O, e, _, v, h]), jn = D((k) => {
3433
+ if (!(!A && d.onKeyDown(k))) {
3434
+ if (k.key === "Escape" && A) {
3435
+ k.preventDefault(), c(!0);
3419
3436
  return;
3420
3437
  }
3421
- if (v.key === "Escape" && _) {
3422
- v.preventDefault(), k(null);
3438
+ if (k.key === "Escape" && _) {
3439
+ k.preventDefault(), v(null);
3423
3440
  return;
3424
3441
  }
3425
3442
  if (A) {
3426
- if (v.key === "ArrowDown")
3427
- v.preventDefault(), H(_e(q + 1, j.length));
3428
- else if (v.key === "ArrowUp")
3429
- v.preventDefault(), H(_e(q - 1, j.length));
3430
- else if (v.key === "Tab") {
3431
- v.preventDefault();
3443
+ if (k.key === "ArrowDown")
3444
+ k.preventDefault(), H(_e(q + 1, j.length));
3445
+ else if (k.key === "ArrowUp")
3446
+ k.preventDefault(), H(_e(q - 1, j.length));
3447
+ else if (k.key === "Tab") {
3448
+ k.preventDefault();
3432
3449
  const $ = j[q];
3433
3450
  $ && Y($);
3434
- } else if (v.key === "Enter") {
3435
- v.preventDefault();
3451
+ } else if (k.key === "Enter") {
3452
+ k.preventDefault();
3436
3453
  const $ = j[q];
3437
3454
  $ && Y($);
3438
3455
  }
3439
3456
  }
3440
3457
  }
3441
- }, [A, j, q, Y, H, _, k, d]);
3458
+ }, [A, j, q, Y, H, _, v, d]);
3442
3459
  M(() => {
3443
- const v = () => {
3444
- document.hidden || !document.hasFocus() || (g.current?.focus(), g.current?.scrollIntoView({ block: "nearest" }));
3460
+ const k = () => {
3461
+ document.hidden || !document.hasFocus() || (u.current?.focus(), u.current?.scrollIntoView({ block: "nearest" }));
3445
3462
  };
3446
- return window.addEventListener("watchparty:focus-chat-input", v), () => window.removeEventListener("watchparty:focus-chat-input", v);
3463
+ return window.addEventListener("watchparty:focus-chat-input", k), () => window.removeEventListener("watchparty:focus-chat-input", k);
3447
3464
  }, []);
3448
- const je = da - t.length, Ht = je <= 100, Ut = A ? j[q] : void 0, Re = !A && d.open, $t = Re ? d.matches[d.activeIndex] : void 0;
3465
+ const je = ua - t.length, Ut = je <= 100, $t = A ? j[q] : void 0, Re = !A && d.open, Ft = Re ? d.matches[d.activeIndex] : void 0;
3449
3466
  return /* @__PURE__ */ w(
3450
3467
  "form",
3451
3468
  {
3452
- onSubmit: (v) => {
3453
- In(v);
3469
+ onSubmit: (k) => {
3470
+ Nn(k);
3454
3471
  },
3455
3472
  onPaste: b.onPaste,
3456
3473
  onDrop: b.onDrop,
3457
3474
  onDragOver: b.onDragOver,
3458
3475
  className: "p-2 border-t border-border",
3459
3476
  children: [
3460
- _ && /* @__PURE__ */ l(Kf, { replyTo: _, onCancel: () => k(null) }),
3461
- /* @__PURE__ */ l(Uf, { pending: b.pending, uploading: b.uploading, onRemove: b.remove }),
3477
+ _ && /* @__PURE__ */ l(Qf, { replyTo: _, onCancel: () => v(null) }),
3478
+ /* @__PURE__ */ l(Bf, { pending: b.pending, uploading: b.uploading, onRemove: b.remove }),
3462
3479
  /* @__PURE__ */ w("div", { className: "relative", children: [
3463
3480
  A && /* @__PURE__ */ l(
3464
- Rf,
3481
+ Of,
3465
3482
  {
3466
3483
  commands: j,
3467
3484
  activeIndex: q,
3468
3485
  hasMedia: W,
3469
3486
  onPick: Y,
3470
3487
  onHover: H,
3471
- listboxId: u
3488
+ listboxId: m
3472
3489
  }
3473
3490
  ),
3474
3491
  Re && /* @__PURE__ */ l(
3475
- Pf,
3492
+ qf,
3476
3493
  {
3477
3494
  matches: d.matches,
3478
3495
  activeIndex: d.activeIndex,
@@ -3482,7 +3499,7 @@ function Jf({ commands: e = qt }) {
3482
3499
  }
3483
3500
  ),
3484
3501
  /* @__PURE__ */ l(
3485
- Go,
3502
+ Jo,
3486
3503
  {
3487
3504
  open: S,
3488
3505
  onClose: () => I(!1),
@@ -3497,55 +3514,55 @@ function Jf({ commands: e = qt }) {
3497
3514
  /* @__PURE__ */ l(
3498
3515
  "input",
3499
3516
  {
3500
- ref: g,
3517
+ ref: u,
3501
3518
  type: "text",
3502
3519
  value: t,
3503
- onChange: (v) => {
3504
- a(v.target.value), d.trackCaret(v.target), c(!1), v.target.value.startsWith("/") ? h.stop() : h.input(v.target.value);
3520
+ onChange: (k) => {
3521
+ a(k.target.value), d.trackCaret(k.target), c(!1), k.target.value.startsWith("/") ? h.stop() : h.input(k.target.value);
3505
3522
  },
3506
- onKeyDown: An,
3507
- onSelect: (v) => d.trackCaret(v.currentTarget),
3508
- maxLength: da,
3523
+ onKeyDown: jn,
3524
+ onSelect: (k) => d.trackCaret(k.currentTarget),
3525
+ maxLength: ua,
3509
3526
  placeholder: "Send a message",
3510
3527
  role: "combobox",
3511
3528
  "aria-expanded": A || Re,
3512
- "aria-controls": A ? u : Re ? x : void 0,
3513
- "aria-activedescendant": Ut ? `${u}-opt-${Ut.name}` : $t ? Tn(x, $t) : void 0,
3529
+ "aria-controls": A ? m : Re ? x : void 0,
3530
+ "aria-activedescendant": $t ? `${m}-opt-${$t.name}` : Ft ? En(x, Ft) : void 0,
3514
3531
  "aria-autocomplete": "list",
3515
- 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 ${Ht ? "pr-12" : ""}`
3532
+ 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 ${Ut ? "pr-12" : ""}`
3516
3533
  }
3517
3534
  ),
3518
- /* @__PURE__ */ l("span", { className: `absolute right-2 top-1/2 -translate-y-1/2 text-[10px] ${je <= 50 ? je <= 0 ? "bg-danger-bg text-on-danger-bg px-1 rounded" : "bg-primary-bg text-on-primary-bg px-1 rounded" : "text-text-muted"}`, children: Ht && je })
3535
+ /* @__PURE__ */ l("span", { className: `absolute right-2 top-1/2 -translate-y-1/2 text-[10px] ${je <= 50 ? je <= 0 ? "bg-danger-bg text-on-danger-bg px-1 rounded" : "bg-primary-bg text-on-primary-bg px-1 rounded" : "text-text-muted"}`, children: Ut && je })
3519
3536
  ] }),
3520
3537
  !R && /* @__PURE__ */ l(
3521
3538
  "button",
3522
3539
  {
3523
3540
  type: "button",
3524
- onClick: () => I((v) => !v),
3541
+ onClick: () => I((k) => !k),
3525
3542
  "aria-label": "Add a meme",
3526
3543
  "aria-expanded": S,
3527
3544
  title: "Add a meme",
3528
3545
  "data-testid": "meme-button",
3529
3546
  className: `shrink-0 rounded border border-border-light px-2 py-1.5 text-sm hover:border-primary ${S ? "text-text border-primary" : "text-text-secondary"}`,
3530
- children: /* @__PURE__ */ l(jn, { name: "image" })
3547
+ children: /* @__PURE__ */ l(Pn, { name: "image" })
3531
3548
  }
3532
3549
  )
3533
3550
  ] })
3534
3551
  ] }),
3535
- /* @__PURE__ */ l(Vf, {})
3552
+ /* @__PURE__ */ l(Zf, {})
3536
3553
  ]
3537
3554
  }
3538
3555
  );
3539
3556
  }
3540
- function Xf() {
3541
- const e = m((n) => n.roster), t = m((n) => n.me.clientId), a = F(() => Cn(e, t), [e, t]);
3542
- return a.length ? /* @__PURE__ */ l("div", { className: "flex flex-col gap-1", children: a.map((n) => /* @__PURE__ */ l(Qf, { u: n }, n.clientId)) }) : /* @__PURE__ */ l("div", { className: "text-xs text-text-muted", children: "No users online" });
3557
+ function as() {
3558
+ const e = g((n) => n.roster), t = g((n) => n.me.clientId), a = F(() => In(e, t), [e, t]);
3559
+ return a.length ? /* @__PURE__ */ l("div", { className: "flex flex-col gap-1", children: a.map((n) => /* @__PURE__ */ l(ns, { u: n }, n.clientId)) }) : /* @__PURE__ */ l("div", { className: "text-xs text-text-muted", children: "No users online" });
3543
3560
  }
3544
- function Qf({ u: e }) {
3561
+ function ns({ u: e }) {
3545
3562
  const t = Ae(e.sprite, e.avatarUrl);
3546
3563
  return /* @__PURE__ */ w("div", { className: "flex items-center gap-2 py-0.5", children: [
3547
3564
  /* @__PURE__ */ l(
3548
- Lt,
3565
+ Ot,
3549
3566
  {
3550
3567
  sprite: e.sprite,
3551
3568
  url: e.avatarUrl,
@@ -3558,8 +3575,8 @@ function Qf({ u: e }) {
3558
3575
  e.isLeader && /* @__PURE__ */ l("span", { className: "ml-auto px-1.5 py-0.5 rounded text-[9px] font-medium bg-success/20 text-success", children: "Leader" })
3559
3576
  ] });
3560
3577
  }
3561
- function Zf() {
3562
- const e = m((r) => Cn(r.roster).length), [t, a] = N(!1), n = U(null), o = U(null);
3578
+ function os() {
3579
+ const e = g((r) => In(r.roster).length), [t, a] = N(!1), n = U(null), o = U(null);
3563
3580
  return M(() => {
3564
3581
  if (!t) return;
3565
3582
  function r(s) {
@@ -3594,12 +3611,12 @@ function Zf() {
3594
3611
  e,
3595
3612
  " online"
3596
3613
  ] }),
3597
- /* @__PURE__ */ l(Xf, {})
3614
+ /* @__PURE__ */ l(as, {})
3598
3615
  ] })
3599
3616
  ] });
3600
3617
  }
3601
- function ua({ className: e = "fixed bottom-4 left-1/2 -translate-x-1/2" }) {
3602
- const t = m((n) => n.toasts), a = m((n) => n.popToast);
3618
+ function ma({ className: e = "fixed bottom-4 left-1/2 -translate-x-1/2" }) {
3619
+ const t = g((n) => n.toasts), a = g((n) => n.popToast);
3603
3620
  return M(() => {
3604
3621
  const n = t.map((o) => setTimeout(() => a(o.id), 4e3));
3605
3622
  return () => {
@@ -3607,24 +3624,24 @@ function ua({ className: e = "fixed bottom-4 left-1/2 -translate-x-1/2" }) {
3607
3624
  };
3608
3625
  }, [t, a]), /* @__PURE__ */ l("div", { className: `${e} flex flex-col gap-2 z-50`, children: t.map((n) => /* @__PURE__ */ l("div", { className: `px-3 py-2 rounded text-sm shadow font-medium border ${n.kind === "error" ? "bg-danger-bg text-on-danger-bg border-danger" : "bg-bg-card border-border-light text-text"}`, children: n.msg }, n.id)) });
3609
3626
  }
3610
- const En = 9e3, ma = 1500, es = {
3627
+ const An = 9e3, ga = 1500, rs = {
3611
3628
  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]",
3612
3629
  cinema: "drop-shadow-[0_2px_4px_rgba(0,0,0,0.9)]",
3613
3630
  minimal: "drop-shadow-[0_2px_4px_rgba(0,0,0,0.9)] drop-shadow-[0_0_8px_rgba(0,0,0,0.7)]",
3614
3631
  contrast: "bg-black/70 px-2 py-0.5 rounded"
3615
- }, ga = { WebkitTextStroke: "0.5px black", paintOrder: "stroke fill" }, ha = {
3632
+ }, ha = { WebkitTextStroke: "0.5px black", paintOrder: "stroke fill" }, pa = {
3616
3633
  textShadow: "none",
3617
3634
  filter: "drop-shadow(0 0 1px black) drop-shadow(0 0 1px black)"
3618
3635
  };
3619
- function ts({ message: e, age: t, ccStyle: a }) {
3620
- const n = En - ma;
3636
+ function is({ message: e, age: t, ccStyle: a }) {
3637
+ const n = An - ga;
3621
3638
  let o = 1;
3622
- t > n && (o = Math.max(0, 1 - (t - n) / ma));
3623
- const r = es[a], f = rt(
3639
+ t > n && (o = Math.max(0, 1 - (t - n) / ga));
3640
+ const r = rs[a], f = rt(
3624
3641
  { clientId: e.clientId, author: e.author },
3625
3642
  { name: e.name, sprite: e.sprite }
3626
- ), s = Ae(f.sprite, f.pictureUrl), c = f.cosmetics, [g] = N(
3627
- () => e.live && e.text ? wa(e.text, c) : null
3643
+ ), s = Ae(f.sprite, f.pictureUrl), c = f.cosmetics, [u] = N(
3644
+ () => e.live && e.text ? va(e.text, c) : null
3628
3645
  );
3629
3646
  return /* @__PURE__ */ w(
3630
3647
  "div",
@@ -3632,19 +3649,19 @@ function ts({ message: e, age: t, ccStyle: a }) {
3632
3649
  className: `flex items-start gap-2 py-1 ${r}`,
3633
3650
  style: { opacity: o, transition: "opacity 0.15s ease-out", ...Ka(s) },
3634
3651
  children: [
3635
- /* @__PURE__ */ l(_n, { sprite: f.sprite, url: f.pictureUrl, worn: c }),
3652
+ /* @__PURE__ */ l(vn, { sprite: f.sprite, url: f.pictureUrl, worn: c }),
3636
3653
  /* @__PURE__ */ w("div", { className: "min-w-0 flex-1", children: [
3637
- c ? /* @__PURE__ */ l(we, { html: ka(f.name, c), className: "text-sm mr-2", style: { color: s, ...ha } }) : /* @__PURE__ */ l("span", { className: "font-medium text-sm mr-2", style: { color: s, ...ga }, children: f.name }),
3638
- g ? /* @__PURE__ */ l(we, { html: g, className: "text-sm text-white break-words", style: ha }) : /* @__PURE__ */ l("span", { className: "text-sm text-white break-words", style: ga, children: e.text }),
3639
- /* @__PURE__ */ l(wn, { images: e.images })
3654
+ c ? /* @__PURE__ */ l(we, { html: ka(f.name, c), className: "text-sm mr-2", style: { color: s, ...pa } }) : /* @__PURE__ */ l("span", { className: "font-medium text-sm mr-2", style: { color: s, ...ha }, children: f.name }),
3655
+ u ? /* @__PURE__ */ l(we, { html: u, className: "text-sm text-white break-words", style: pa }) : /* @__PURE__ */ l("span", { className: "text-sm text-white break-words", style: ha, children: e.text }),
3656
+ /* @__PURE__ */ l(kn, { images: e.images })
3640
3657
  ] })
3641
3658
  ]
3642
3659
  }
3643
3660
  );
3644
3661
  }
3645
- function as({ shown: e, className: t }) {
3662
+ function fs({ shown: e, className: t }) {
3646
3663
  Ga();
3647
- const a = m((c) => c.chat), n = m((c) => c.mediaPrefs.subtitleStyle), [o, r] = N(() => Date.now()), f = a.length > 0;
3664
+ const a = g((c) => c.chat), n = g((c) => c.mediaPrefs.subtitleStyle), [o, r] = N(() => Date.now()), f = a.length > 0;
3648
3665
  M(() => {
3649
3666
  const c = setInterval(() => {
3650
3667
  f && r(Date.now());
@@ -3652,8 +3669,8 @@ function as({ shown: e, className: t }) {
3652
3669
  return () => clearInterval(c);
3653
3670
  }, [f]);
3654
3671
  const s = F(() => {
3655
- const c = o - En;
3656
- return a.filter((g) => !g.isSystem && g.ts > c).slice(-12);
3672
+ const c = o - An;
3673
+ return a.filter((u) => !u.isSystem && u.ts > c).slice(-12);
3657
3674
  }, [a, o]);
3658
3675
  return !e || s.length === 0 ? null : /* @__PURE__ */ l(
3659
3676
  "div",
@@ -3661,7 +3678,7 @@ function as({ shown: e, className: t }) {
3661
3678
  className: `wp-floating-chat pointer-events-none flex flex-col ${t}`,
3662
3679
  "data-testid": "floating-chat",
3663
3680
  children: s.map((c) => /* @__PURE__ */ l(
3664
- ts,
3681
+ is,
3665
3682
  {
3666
3683
  message: c,
3667
3684
  age: o - c.ts,
@@ -3672,27 +3689,27 @@ function as({ shown: e, className: t }) {
3672
3689
  }
3673
3690
  );
3674
3691
  }
3675
- const pa = (e) => typeof e == "string" && Rn.includes(e);
3676
- function ns(e, t, a) {
3677
- return e || (pa(t) ? t : pa(a) ? a : "dark");
3692
+ const ba = (e) => typeof e == "string" && Mn.includes(e);
3693
+ function ss(e, t, a) {
3694
+ return e || (ba(t) ? t : ba(a) ? a : "dark");
3678
3695
  }
3679
- function os(e, t) {
3696
+ function ls(e, t) {
3680
3697
  if (t(e.clientWidth), typeof ResizeObserver > "u") return () => {
3681
3698
  };
3682
3699
  const a = new ResizeObserver(() => t(e.clientWidth));
3683
3700
  return a.observe(e), () => a.disconnect();
3684
3701
  }
3685
- function rs(e) {
3702
+ function cs(e) {
3686
3703
  const t = e?.trim() ?? "";
3687
3704
  return t ? { source: "host", name: t } : { source: "auto" };
3688
3705
  }
3689
- function is(e) {
3706
+ function ds(e) {
3690
3707
  if (e.source !== "host") return;
3691
- const { setSessionIdentity: t, sprite: a } = m.getState();
3708
+ const { setSessionIdentity: t, sprite: a } = g.getState();
3692
3709
  t(e.name, a);
3693
3710
  }
3694
- const fs = 1500;
3695
- function xs({
3711
+ const us = 1500;
3712
+ function Is({
3696
3713
  roomKey: e,
3697
3714
  serverOrigin: t,
3698
3715
  roomOrigin: a,
@@ -3702,54 +3719,54 @@ function xs({
3702
3719
  userType: f,
3703
3720
  userId: s,
3704
3721
  theme: c,
3705
- name: g,
3706
- onLeave: u,
3722
+ name: u,
3723
+ onLeave: m,
3707
3724
  onLayoutChange: x,
3708
3725
  collapsible: S = !0,
3709
3726
  debug: I,
3710
3727
  children: R
3711
3728
  }) {
3712
- const [y, d] = N(null), { setFrame: b, ...h } = ss(x, S), _ = m((A) => A.floatingChatEnabled), k = _a(() => g), P = F(() => (wr({ userType: f, userId: s ?? null }), jt().theme), [f, s]), O = Pn(), z = O?.theme, W = F(
3713
- () => ns(c, z, P),
3729
+ const [y, d] = N(null), { setFrame: b, ...h } = ms(x, S), _ = g((A) => A.floatingChatEnabled), v = wa(() => u), P = F(() => (Sr({ userType: f, userId: s ?? null }), Rt().theme), [f, s]), O = Dn(), z = O?.theme, W = F(
3730
+ () => ss(c, z, P),
3714
3731
  [c, z, P]
3715
3732
  );
3716
3733
  M(() => {
3717
3734
  }, [c, O !== null]);
3718
3735
  const j = F(
3719
- () => ({ ...Ct, serverOrigin: t, defaultRoomKey: e }),
3736
+ () => ({ ...Et, serverOrigin: t, defaultRoomKey: e }),
3720
3737
  [t, e]
3721
3738
  );
3722
3739
  return M(() => {
3723
- I && Zo();
3724
- }, [I]), Gi(), M(() => {
3725
- Ko({ serverOrigin: t, defaultRoomKey: e }), Kr(a ? { origin: a, path: n } : null), aa(o && !a ? { origin: o, path: r } : null), m.getState().rehydrateFromPrefs(), pi();
3740
+ I && nr();
3741
+ }, [I]), Xi(), M(() => {
3742
+ Xo({ serverOrigin: t, defaultRoomKey: e }), Zr(a ? { origin: a, path: n } : null), na(o && !a ? { origin: o, path: r } : null), g.getState().rehydrateFromPrefs(), ki();
3726
3743
  let A = !1;
3727
- const q = xr();
3744
+ const q = Er();
3728
3745
  return (async () => {
3729
3746
  try {
3730
3747
  await Promise.race([
3731
3748
  Promise.all([
3732
3749
  q,
3733
- Ar().then((Y) => {
3734
- Y && m.getState().rehydrateFromPrefs();
3750
+ Pr().then((Y) => {
3751
+ Y && g.getState().rehydrateFromPrefs();
3735
3752
  }),
3736
3753
  // The character chosen in the settings popout (lib/avatar.ts).
3737
- oi().then(yn)
3754
+ ci().then(wn)
3738
3755
  ]),
3739
- new Promise((Y) => setTimeout(Y, fs))
3756
+ new Promise((Y) => setTimeout(Y, us))
3740
3757
  ]);
3741
3758
  } catch (Y) {
3742
3759
  L("room-chrome", "pre-join wait threw, proceeding anyway", Ee(Y));
3743
3760
  }
3744
3761
  if (A) return;
3745
- const H = rs(k());
3746
- m.getState().ensureAutoIdentity(), is(H);
3747
- const ie = m.getState();
3748
- p("room-chrome", "Joining room", { roomKey: e, name: ie.name, sprite: ie.sprite }), Ci({ room_key: e, name: ie.name || void 0, sprite: ie.sprite || void 0 });
3762
+ const H = cs(v());
3763
+ g.getState().ensureAutoIdentity(), ds(H);
3764
+ const ie = g.getState();
3765
+ p("room-chrome", "Joining room", { roomKey: e, name: ie.name, sprite: ie.sprite }), ji({ room_key: e, name: ie.name || void 0, sprite: ie.sprite || void 0 });
3749
3766
  })(), () => {
3750
- A = !0, sa(), aa(null);
3767
+ A = !0, la(), na(null);
3751
3768
  };
3752
- }, [e, t, a, n, o, r, f, s]), /* @__PURE__ */ l(Vo.Provider, { value: j, children: /* @__PURE__ */ l(Ba.Provider, { value: !1, children: /* @__PURE__ */ l(za.Provider, { value: y, children: /* @__PURE__ */ w("div", { ref: b, className: "wp-room-chrome-frame", children: [
3769
+ }, [e, t, a, n, o, r, f, s]), /* @__PURE__ */ l(Qo.Provider, { value: j, children: /* @__PURE__ */ l(Ba.Provider, { value: !1, children: /* @__PURE__ */ l(za.Provider, { value: y, children: /* @__PURE__ */ w("div", { ref: b, className: "wp-room-chrome-frame", children: [
3753
3770
  /* @__PURE__ */ l("div", { className: "wp-room-chrome-frame__content", children: R }),
3754
3771
  /* @__PURE__ */ l(
3755
3772
  "aside",
@@ -3759,7 +3776,7 @@ function xs({
3759
3776
  "data-theme": W,
3760
3777
  "data-collapsed": h.collapsed ? "1" : "0",
3761
3778
  style: { "--wp-room-chrome-width": `${h.state.width}px` },
3762
- onAnimationEnd: (A) => Gn(A.nativeEvent),
3779
+ onAnimationEnd: (A) => Vn(A.nativeEvent),
3763
3780
  children: h.collapsed ? /* @__PURE__ */ w(te, { children: [
3764
3781
  /* @__PURE__ */ l(
3765
3782
  "button",
@@ -3769,11 +3786,11 @@ function xs({
3769
3786
  title: "Show chat",
3770
3787
  "aria-label": "Show chat",
3771
3788
  "aria-expanded": !1,
3772
- children: /* @__PURE__ */ l(wf, {})
3789
+ children: /* @__PURE__ */ l(Tf, {})
3773
3790
  }
3774
3791
  ),
3775
- /* @__PURE__ */ l(ua, { className: "absolute bottom-2 right-full mr-2 w-72" }),
3776
- /* @__PURE__ */ l(as, { shown: _, className: "wp-room-chrome__floating" })
3792
+ /* @__PURE__ */ l(ma, { className: "absolute bottom-2 right-full mr-2 w-72" }),
3793
+ /* @__PURE__ */ l(fs, { shown: _, className: "wp-room-chrome__floating" })
3777
3794
  ] }) : /* @__PURE__ */ w(te, { children: [
3778
3795
  /* @__PURE__ */ l(
3779
3796
  "div",
@@ -3782,7 +3799,7 @@ function xs({
3782
3799
  "aria-orientation": "vertical",
3783
3800
  "aria-label": "Resize chat",
3784
3801
  "aria-valuemin": Xe,
3785
- "aria-valuemax": Rt,
3802
+ "aria-valuemax": Pt,
3786
3803
  "aria-valuenow": h.state.width,
3787
3804
  tabIndex: 0,
3788
3805
  className: "wp-room-chrome__resize",
@@ -3795,13 +3812,13 @@ function xs({
3795
3812
  }
3796
3813
  ),
3797
3814
  /* @__PURE__ */ w("div", { className: "flex items-center gap-1 px-2 py-1.5 border-b border-border", children: [
3798
- /* @__PURE__ */ l(Zf, {}),
3815
+ /* @__PURE__ */ l(os, {}),
3799
3816
  /* @__PURE__ */ l("div", { className: "flex-1" }),
3800
- u && /* @__PURE__ */ l(
3817
+ m && /* @__PURE__ */ l(
3801
3818
  "button",
3802
3819
  {
3803
3820
  onClick: () => {
3804
- sa(), u();
3821
+ la(), m();
3805
3822
  },
3806
3823
  className: "wp-room-chrome__leave",
3807
3824
  title: "Leave room",
@@ -3817,51 +3834,51 @@ function xs({
3817
3834
  title: "Hide chat",
3818
3835
  "aria-label": "Hide chat",
3819
3836
  "aria-expanded": !0,
3820
- children: /* @__PURE__ */ l(_f, {})
3837
+ children: /* @__PURE__ */ l(Sf, {})
3821
3838
  }
3822
3839
  )
3823
3840
  ] }),
3824
- /* @__PURE__ */ l(Cf, {}),
3825
- /* @__PURE__ */ l(Jf, { commands: [] }),
3826
- /* @__PURE__ */ l(ua, { className: "absolute bottom-14 left-2 right-2" })
3841
+ /* @__PURE__ */ l(jf, {}),
3842
+ /* @__PURE__ */ l(ts, { commands: [] }),
3843
+ /* @__PURE__ */ l(ma, { className: "absolute bottom-14 left-2 right-2" })
3827
3844
  ] })
3828
3845
  }
3829
3846
  )
3830
3847
  ] }) }) }) });
3831
3848
  }
3832
- function ss(e, t) {
3833
- const a = m((_) => _.chromeChatCollapsed) && t, n = m((_) => _.chromeChatWidth), o = m((_) => _.toggleChromeChatCollapsed), r = m((_) => _.setChromeChatWidth), [f, s] = N(null), [c, g] = N(void 0), [u, x] = N(null);
3849
+ function ms(e, t) {
3850
+ const a = g((_) => _.chromeChatCollapsed) && t, n = g((_) => _.chromeChatWidth), o = g((_) => _.toggleChromeChatCollapsed), r = g((_) => _.setChromeChatWidth), [f, s] = N(null), [c, u] = N(void 0), [m, x] = N(null);
3834
3851
  M(() => {
3835
3852
  if (f)
3836
- return os(f, g);
3853
+ return ls(f, u);
3837
3854
  }, [f]);
3838
- const S = Z(u?.current ?? n, c), I = F(() => Or(a, S), [a, S]), R = _a((_) => e?.(_));
3855
+ const S = Z(m?.current ?? n, c), I = F(() => $r(a, S), [a, S]), R = wa((_) => e?.(_));
3839
3856
  return M(() => {
3840
3857
  R(I);
3841
3858
  }, [I]), {
3842
3859
  setFrame: s,
3843
3860
  collapsed: a,
3844
3861
  state: I,
3845
- dragging: u !== null,
3862
+ dragging: m !== null,
3846
3863
  toggleCollapsed: o,
3847
3864
  onPointerDown: (_) => {
3848
3865
  _.button === 0 && (_.preventDefault(), _.currentTarget.setPointerCapture(_.pointerId), x({ pointerId: _.pointerId, startX: _.clientX, startWidth: S, current: S }));
3849
3866
  },
3850
3867
  onPointerMove: (_) => {
3851
- !u || u.pointerId !== _.pointerId || x({ ...u, current: ta(u.startWidth, u.startX, _.clientX, c) });
3868
+ !m || m.pointerId !== _.pointerId || x({ ...m, current: aa(m.startWidth, m.startX, _.clientX, c) });
3852
3869
  },
3853
3870
  onPointerEnd: (_) => {
3854
- if (!u || u.pointerId !== _.pointerId) return;
3855
- const k = ta(u.startWidth, u.startX, _.clientX, c);
3856
- x(null), k !== n && r(k);
3871
+ if (!m || m.pointerId !== _.pointerId) return;
3872
+ const v = aa(m.startWidth, m.startX, _.clientX, c);
3873
+ x(null), v !== n && r(v);
3857
3874
  },
3858
3875
  onKeyDown: (_) => {
3859
- const k = Lr(S, _.key, c);
3860
- k !== null && (_.preventDefault(), k !== n && r(k));
3876
+ const v = Ur(S, _.key, c);
3877
+ v !== null && (_.preventDefault(), v !== n && r(v));
3861
3878
  }
3862
3879
  };
3863
3880
  }
3864
3881
  export {
3865
- xs as RoomChrome
3882
+ Is as RoomChrome
3866
3883
  };
3867
3884
  //# sourceMappingURL=room-chrome.js.map