@hadoku/watchparty-ui 0.44.7 → 0.44.9

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.
Files changed (25) hide show
  1. package/dist/chunks/{AdminPanel-qTuUmikH.js → AdminPanel-CfOBoGAb.js} +6 -6
  2. package/dist/chunks/{AdminPanel-qTuUmikH.js.map → AdminPanel-CfOBoGAb.js.map} +1 -1
  3. package/dist/chunks/{CharacterModal-CVRsPyBj.js → CharacterModal-B6cG2NmX.js} +4 -4
  4. package/dist/chunks/{CharacterModal-CVRsPyBj.js.map → CharacterModal-B6cG2NmX.js.map} +1 -1
  5. package/dist/chunks/{GameModule-DblyKpY-.js → GameModule-CrRHc04o.js} +4 -4
  6. package/dist/chunks/{GameModule-DblyKpY-.js.map → GameModule-CrRHc04o.js.map} +1 -1
  7. package/dist/chunks/{MapEditor-D7snRTNa.js → MapEditor-Bvr-tvKQ.js} +2 -2
  8. package/dist/chunks/{MapEditor-D7snRTNa.js.map → MapEditor-Bvr-tvKQ.js.map} +1 -1
  9. package/dist/chunks/{MediaDrawer-J06JYmWp.js → MediaDrawer-CY__KXu5.js} +24 -24
  10. package/dist/chunks/{MediaDrawer-J06JYmWp.js.map → MediaDrawer-CY__KXu5.js.map} +1 -1
  11. package/dist/chunks/{PlaylistPanel-BuynCwSB.js → PlaylistPanel-hV9B8oQl.js} +16 -16
  12. package/dist/chunks/{PlaylistPanel-BuynCwSB.js.map → PlaylistPanel-hV9B8oQl.js.map} +1 -1
  13. package/dist/chunks/{Room-CsUbXKFq.js → Room-B6ODdfkE.js} +1695 -1649
  14. package/dist/chunks/Room-B6ODdfkE.js.map +1 -0
  15. package/dist/chunks/{index-Cr81q-86.js → index-CFH_9amZ.js} +438 -434
  16. package/dist/chunks/index-CFH_9amZ.js.map +1 -0
  17. package/dist/chunks/{submissionsApi-DgAuxW7y.js → submissionsApi-BsiozhpM.js} +9 -9
  18. package/dist/chunks/{submissionsApi-DgAuxW7y.js.map → submissionsApi-BsiozhpM.js.map} +1 -1
  19. package/dist/index.js +1 -1
  20. package/dist/room-chrome.js +317 -313
  21. package/dist/room-chrome.js.map +1 -1
  22. package/dist/watchparty-ui.css +1 -1
  23. package/package.json +2 -2
  24. package/dist/chunks/Room-CsUbXKFq.js.map +0 -1
  25. package/dist/chunks/index-Cr81q-86.js.map +0 -1
@@ -4801,10 +4801,10 @@ const so = (e) => {
4801
4801
  function va(e) {
4802
4802
  return typeof e == "string" && ya.test(e);
4803
4803
  }
4804
- const Jr = 8080, ei = 5173, Zh = 80, hu = "/watchparty/ws", em = 10, mu = 500, tm = 1e3, ti = 4, rm = 3e3, ba = typeof process < "u" && process.env ? process.env : {};
4804
+ const Jr = 8080, ei = 5173, em = 80, hu = "/watchparty/ws", tm = 10, mu = 500, rm = 1e3, ti = 4, nm = 3e3, ba = typeof process < "u" && process.env ? process.env : {};
4805
4805
  ba.PRODUCTION_UI_URL;
4806
4806
  ba.PRODUCTION_SERVER_URL;
4807
- const Pr = l.enum(["S", "A", "B", "C", "D", "F"]), nm = ["S", "A", "B", "C", "D", "F"], lo = 2e4, pu = 300;
4807
+ const Pr = l.enum(["S", "A", "B", "C", "D", "F"]), im = ["S", "A", "B", "C", "D", "F"], lo = 2e4, pu = 300;
4808
4808
  l.object({
4809
4809
  name: l.string().min(1).max(32).optional(),
4810
4810
  sprite: l.string().min(1).max(32).optional()
@@ -5303,10 +5303,14 @@ const Ra = [
5303
5303
  ]
5304
5304
  }
5305
5305
  ], co = 8, ii = Ra.flatMap((e) => e.characters), Ae = ii.map((e) => e.id), ku = Object.fromEntries(ii.map((e) => [e.id, e.color])), Pu = Object.fromEntries(ii.map((e) => [e.id, "rev" in e ? e.rev : 1]));
5306
+ function Ou(e) {
5307
+ const t = Pu[e];
5308
+ return `/media/sprites/square_${e}.png${t > 1 ? `?v=${t}` : ""}`;
5309
+ }
5306
5310
  function Ta(e) {
5307
5311
  return !!e && Ae.includes(e);
5308
5312
  }
5309
- function im(e) {
5313
+ function om(e) {
5310
5314
  const t = new Set(e);
5311
5315
  let r = 0;
5312
5316
  return () => {
@@ -5321,29 +5325,29 @@ function im(e) {
5321
5325
  return n || (n = Ae[r], r = (r + 1) % Ae.length), t.add(n), n;
5322
5326
  };
5323
5327
  }
5324
- const om = 4, am = 3e4, sm = 5e3, lm = 2e3, cm = 5e3, um = 2e3, dm = 5e3, fm = 2e3, hm = 1e4, mm = 10, pm = 2e3, gm = 3, ym = 50, vm = 3, bm = 3e4, wm = 2e4, _m = 99999, Ou = 5e3, Iu = "output_frag.mp4", uo = "/healthz", Ca = { mode: "off", percent: 0 }, Lu = ["off", "on", "ab"];
5325
- function Mu(e) {
5326
- return typeof e == "string" && Lu.includes(e);
5328
+ const am = 4, sm = 3e4, lm = 5e3, cm = 2e3, um = 5e3, dm = 2e3, fm = 5e3, hm = 2e3, mm = 1e4, pm = 10, gm = 2e3, ym = 3, vm = 50, bm = 3, wm = 3e4, _m = 2e4, Em = 99999, Iu = 5e3, Lu = "output_frag.mp4", uo = "/healthz", Ca = { mode: "off", percent: 0 }, Mu = ["off", "on", "ab"];
5329
+ function Du(e) {
5330
+ return typeof e == "string" && Mu.includes(e);
5327
5331
  }
5328
5332
  function Aa(e) {
5329
- const t = e && typeof e == "object" ? e : {}, r = Mu(t.mode) ? t.mode : Ca.mode, n = Number(t.percent), i = Number.isFinite(n) ? Math.min(100, Math.max(0, Math.round(n))) : 0;
5333
+ const t = e && typeof e == "object" ? e : {}, r = Du(t.mode) ? t.mode : Ca.mode, n = Number(t.percent), i = Number.isFinite(n) ? Math.min(100, Math.max(0, Math.round(n))) : 0;
5330
5334
  return { mode: r, percent: i };
5331
5335
  }
5332
- function Du(e) {
5336
+ function Nu(e) {
5333
5337
  let t = 2166136261;
5334
5338
  for (let r = 0; r < e.length; r++)
5335
5339
  t ^= e.charCodeAt(r), t = Math.imul(t, 16777619) >>> 0;
5336
5340
  return t >>> 0;
5337
5341
  }
5338
- function Nu(e, t, r) {
5342
+ function Fu(e, t, r) {
5339
5343
  if (r === !0)
5340
5344
  return "fragment";
5341
5345
  if (r === !1)
5342
5346
  return "range";
5343
5347
  const n = Aa(e);
5344
- return n.mode === "on" ? "fragment" : n.mode === "off" || n.percent <= 0 ? "range" : n.percent >= 100 || t && Du(t) % 100 < n.percent ? "fragment" : "range";
5348
+ return n.mode === "on" ? "fragment" : n.mode === "off" || n.percent <= 0 ? "range" : n.percent >= 100 || t && Nu(t) % 100 < n.percent ? "fragment" : "range";
5345
5349
  }
5346
- const xa = l.enum(["url", "magnet", "upload"]), Fu = l.enum([
5350
+ const xa = l.enum(["url", "magnet", "upload"]), Uu = l.enum([
5347
5351
  "pending",
5348
5352
  "approved",
5349
5353
  "fetching",
@@ -5361,7 +5365,7 @@ const xa = l.enum(["url", "magnet", "upload"]), Fu = l.enum([
5361
5365
  failed: ["approved"]
5362
5366
  };
5363
5367
  Object.keys(fo).filter((e) => fo[e].length === 0);
5364
- const Uu = l.object({
5368
+ const Bu = l.object({
5365
5369
  id: l.string().min(1),
5366
5370
  /** Stable userId from whoami. Never the raw `X-User-Key`. */
5367
5371
  ownerUserId: l.string().min(1),
@@ -5380,7 +5384,7 @@ const Uu = l.object({
5380
5384
  * misroute the copy.
5381
5385
  */
5382
5386
  series: l.string().optional(),
5383
- state: Fu,
5387
+ state: Uu,
5384
5388
  createdAt: l.number().int().nonnegative(),
5385
5389
  updatedAt: l.number().int().nonnegative(),
5386
5390
  /** Why it failed, or why an operator rejected it. */
@@ -5388,19 +5392,19 @@ const Uu = l.object({
5388
5392
  /** Size once known. 0 means "known to be empty"; absent means "not yet known" —
5389
5393
  * the same distinction `chatImages` draws for image dimensions. */
5390
5394
  bytes: l.number().int().nonnegative().optional()
5391
- }), Bu = 4096, ka = 300, ju = 100;
5395
+ }), ju = 4096, ka = 300, $u = 100;
5392
5396
  l.object({
5393
5397
  kind: xa,
5394
- source: l.string().min(1).max(Bu),
5398
+ source: l.string().min(1).max(ju),
5395
5399
  title: l.string().min(1).max(ka).optional(),
5396
5400
  /** Required for `kind: 'magnet'` by `checkSource`; ignored for `url`/`upload`. */
5397
- series: l.string().min(1).max(ju).optional()
5401
+ series: l.string().min(1).max($u).optional()
5398
5402
  });
5399
5403
  l.object({
5400
5404
  reason: l.string().min(1).max(ka).optional()
5401
5405
  });
5402
5406
  l.object({
5403
- submissions: l.array(Uu)
5407
+ submissions: l.array(Bu)
5404
5408
  });
5405
5409
  l.object({
5406
5410
  error: l.literal("submissions/quota_exceeded"),
@@ -5409,8 +5413,8 @@ l.object({
5409
5413
  /** The cap that was applied, from the server's config. */
5410
5414
  capBytes: l.number().int().nonnegative()
5411
5415
  });
5412
- const $u = /^[a-z0-9][a-z0-9-]{0,31}$/, ho = "https://game-catalog.invalid";
5413
- function Hu(e) {
5416
+ const Hu = /^[a-z0-9][a-z0-9-]{0,31}$/, ho = "https://game-catalog.invalid";
5417
+ function zu(e) {
5414
5418
  if (!e.startsWith("/") || e.startsWith("//") || /[\\\s]/.test(e) || [...e].some((t) => t.charCodeAt(0) < 32 || t.charCodeAt(0) === 127))
5415
5419
  return !1;
5416
5420
  try {
@@ -5419,18 +5423,18 @@ function Hu(e) {
5419
5423
  return !1;
5420
5424
  }
5421
5425
  }
5422
- const Pa = l.string().min(2).max(512).refine(Hu, {
5426
+ const Pa = l.string().min(2).max(512).refine(zu, {
5423
5427
  message: "must be a root-relative path on the page origin (e.g. /cardtable/embed/x.js)"
5424
5428
  }), mo = {
5425
- id: l.string().regex($u),
5429
+ id: l.string().regex(Hu),
5426
5430
  name: l.string().min(1).max(64),
5427
5431
  cover: Pa.optional()
5428
- }, zu = l.discriminatedUnion("kind", [
5432
+ }, Vu = l.discriminatedUnion("kind", [
5429
5433
  l.object({ ...mo, kind: l.literal("iframe") }).strict(),
5430
5434
  l.object({ ...mo, kind: l.literal("module"), url: Pa }).strict()
5431
- ]), Vu = l.array(zu).max(32).refine((e) => new Set(e.map((t) => t.id)).size === e.length, { message: "game ids must be unique" }), qu = [
5435
+ ]), qu = l.array(Vu).max(32).refine((e) => new Set(e.map((t) => t.id)).size === e.length, { message: "game ids must be unique" }), Wu = [
5432
5436
  { id: "bomberman", name: "Bomberman", kind: "iframe" }
5433
- ], oi = l.enum(["anilist", "tmdb"]), Wu = l.object({
5437
+ ], oi = l.enum(["anilist", "tmdb"]), Ku = l.object({
5434
5438
  source: oi,
5435
5439
  /** The provider's own id, as a string (AniList and TMDB both use integers). */
5436
5440
  id: l.string(),
@@ -5452,11 +5456,11 @@ const Pa = l.string().min(2).max(512).refine(Hu, {
5452
5456
  addable: l.boolean()
5453
5457
  });
5454
5458
  l.object({
5455
- results: l.array(Wu),
5459
+ results: l.array(Ku),
5456
5460
  /** Providers that answered. TMDB is absent when no token is configured. */
5457
5461
  sources: l.array(oi)
5458
5462
  });
5459
- const Ku = l.object({
5463
+ const Gu = l.object({
5460
5464
  id: l.string(),
5461
5465
  url: l.string(),
5462
5466
  title: l.string(),
@@ -5464,29 +5468,29 @@ const Ku = l.object({
5464
5468
  durationS: l.number().nullable(),
5465
5469
  thumb: l.string().nullable()
5466
5470
  });
5467
- l.object({ results: l.array(Ku) });
5471
+ l.object({ results: l.array(Gu) });
5468
5472
  l.object({
5469
5473
  source: oi,
5470
5474
  id: l.string().regex(/^\d{1,12}$/)
5471
5475
  });
5472
5476
  l.object({ series: l.string(), title: l.string() });
5473
- const Em = 2, Sm = 100;
5477
+ const Sm = 2, Rm = 100;
5474
5478
  var vn = {
5475
5479
  image: 10 * 1024 * 1024,
5476
5480
  audio: 50 * 1024 * 1024
5477
- }, Gu = [
5481
+ }, Yu = [
5478
5482
  "image/png",
5479
5483
  "image/jpeg",
5480
5484
  "image/gif",
5481
5485
  "image/webp",
5482
5486
  "image/avif"
5483
- ], Yu = [
5487
+ ], Ju = [
5484
5488
  "audio/mpeg",
5485
5489
  "audio/flac",
5486
5490
  "audio/ogg",
5487
5491
  "audio/mp4",
5488
5492
  "audio/wav"
5489
- ], Ju = {
5493
+ ], Xu = {
5490
5494
  "audio/mp3": "audio/mpeg",
5491
5495
  "audio/x-mp3": "audio/mpeg",
5492
5496
  "audio/x-mpeg": "audio/mpeg",
@@ -5500,9 +5504,9 @@ var vn = {
5500
5504
  };
5501
5505
  function Oa(e) {
5502
5506
  const t = e.toLowerCase();
5503
- return Gu.includes(t) ? "image" : Yu.includes(t) || t in Ju ? "audio" : null;
5507
+ return Yu.includes(t) ? "image" : Ju.includes(t) || t in Xu ? "audio" : null;
5504
5508
  }
5505
- var Xu = 24, Rm = 250, Kt = class extends Error {
5509
+ var Qu = 24, Tm = 250, Kt = class extends Error {
5506
5510
  reason;
5507
5511
  /** HTTP status, when there was a response. */
5508
5512
  status;
@@ -5519,7 +5523,7 @@ var Xu = 24, Rm = 250, Kt = class extends Error {
5519
5523
  super(t), this.name = "CdnError", this.reason = e, this.status = r, this.retryAfterSeconds = n;
5520
5524
  }
5521
5525
  };
5522
- function Qu(e, t = Date.now()) {
5526
+ function Zu(e, t = Date.now()) {
5523
5527
  if (!e) return null;
5524
5528
  const r = e.trim();
5525
5529
  if (!r) return null;
@@ -5528,7 +5532,7 @@ function Qu(e, t = Date.now()) {
5528
5532
  const i = Date.parse(r);
5529
5533
  return Number.isNaN(i) ? null : Math.max(0, Math.ceil((i - t) / 1e3));
5530
5534
  }
5531
- function Zu(e) {
5535
+ function ed(e) {
5532
5536
  switch (e) {
5533
5537
  case 401:
5534
5538
  return "unauthenticated";
@@ -5551,8 +5555,8 @@ function Zu(e) {
5551
5555
  return "unknown";
5552
5556
  }
5553
5557
  }
5554
- async function ed(e) {
5555
- const t = Zu(e.status);
5558
+ async function td(e) {
5559
+ const t = ed(e.status);
5556
5560
  let r = `CDN request failed (${e.status})`;
5557
5561
  try {
5558
5562
  const n = await e.json();
@@ -5563,11 +5567,11 @@ async function ed(e) {
5563
5567
  t,
5564
5568
  r,
5565
5569
  e.status,
5566
- t === "rate-limited" ? Qu(e.headers.get("Retry-After")) : null
5570
+ t === "rate-limited" ? Zu(e.headers.get("Retry-After")) : null
5567
5571
  );
5568
5572
  }
5569
- var td = "/cdn/api/upload", rd = /^[0-9a-f]{64}\.[a-z0-9]{1,8}$/;
5570
- function nd(e) {
5573
+ var rd = "/cdn/api/upload", nd = /^[0-9a-f]{64}\.[a-z0-9]{1,8}$/;
5574
+ function id(e) {
5571
5575
  if (e.size === 0)
5572
5576
  throw new Kt("invalid", "File is empty");
5573
5577
  const t = e.type ? Oa(e.type) : null;
@@ -5577,7 +5581,7 @@ function nd(e) {
5577
5581
  if (e.size > r)
5578
5582
  throw new Kt("too-large", `File is ${e.size} bytes; the maximum is ${r}`);
5579
5583
  }
5580
- function id(e) {
5584
+ function od(e) {
5581
5585
  if (typeof e != "object" || e === null) return null;
5582
5586
  const t = e;
5583
5587
  return typeof t.key != "string" || !t.key ? null : {
@@ -5589,8 +5593,8 @@ function id(e) {
5589
5593
  contentType: typeof t.contentType == "string" ? t.contentType : "image/*"
5590
5594
  };
5591
5595
  }
5592
- function od(e) {
5593
- const t = e.cdnBase.replace(/\/+$/, ""), r = e.uploadPath ?? td, n = e.fetch ?? globalThis.fetch.bind(globalThis);
5596
+ function ad(e) {
5597
+ const t = e.cdnBase.replace(/\/+$/, ""), r = e.uploadPath ?? rd, n = e.fetch ?? globalThis.fetch.bind(globalThis);
5594
5598
  async function i(o, a) {
5595
5599
  let s;
5596
5600
  try {
@@ -5598,14 +5602,14 @@ function od(e) {
5598
5602
  } catch (c) {
5599
5603
  throw c instanceof Error && c.name === "AbortError" ? c : new Kt("network", c instanceof Error ? c.message : "Request failed");
5600
5604
  }
5601
- if (!s.ok) throw await ed(s);
5605
+ if (!s.ok) throw await td(s);
5602
5606
  return s;
5603
5607
  }
5604
5608
  return {
5605
5609
  cdnBase: t,
5606
5610
  uploadPath: r,
5607
5611
  async upload(o, a) {
5608
- return nd(o), await (await i(r, {
5612
+ return id(o), await (await i(r, {
5609
5613
  method: "POST",
5610
5614
  body: o,
5611
5615
  signal: a?.signal,
@@ -5618,21 +5622,21 @@ function od(e) {
5618
5622
  return `${t}/${o.replace(/^\/+/, "")}`;
5619
5623
  },
5620
5624
  isKey(o) {
5621
- return rd.test(o);
5625
+ return nd.test(o);
5622
5626
  },
5623
5627
  catalogue(o, a) {
5624
5628
  const s = o.replace(/\/+$/, ""), c = a?.surface;
5625
5629
  return {
5626
5630
  async search(u = {}) {
5627
5631
  const f = new URLSearchParams(), h = u.query?.trim();
5628
- h && f.set("q", h), f.set("limit", String(u.limit ?? Xu)), u.cursor && f.set("cursor", u.cursor);
5632
+ h && f.set("q", h), f.set("limit", String(u.limit ?? Qu)), u.cursor && f.set("cursor", u.cursor);
5629
5633
  const v = await (await i(`${s}?${f.toString()}`, {
5630
5634
  method: "GET",
5631
5635
  signal: u.signal,
5632
5636
  credentials: "same-origin"
5633
5637
  })).json();
5634
5638
  return {
5635
- results: (Array.isArray(v.results) ? v.results : []).map(id).filter((C) => C !== null),
5639
+ results: (Array.isArray(v.results) ? v.results : []).map(od).filter((C) => C !== null),
5636
5640
  next: typeof v.next == "string" && v.next ? v.next : null
5637
5641
  };
5638
5642
  },
@@ -5648,12 +5652,12 @@ function od(e) {
5648
5652
  }
5649
5653
  };
5650
5654
  }
5651
- function Tm(e, t = ["image"]) {
5655
+ function Cm(e, t = ["image"]) {
5652
5656
  if (!e) return [];
5653
5657
  const r = (o) => Ia(o, t), n = e.files ? Array.from(e.files) : [];
5654
5658
  return n.length > 0 ? n.filter(r) : (e.items ? Array.from(e.items) : []).filter((o) => o.kind === "file").map((o) => o.getAsFile()).filter((o) => o !== null).filter(r);
5655
5659
  }
5656
- function Cm(e, t = ["image"]) {
5660
+ function Am(e, t = ["image"]) {
5657
5661
  return e?.files ? Array.from(e.files).filter((r) => Ia(r, t)) : [];
5658
5662
  }
5659
5663
  function Ia(e, t) {
@@ -5661,7 +5665,7 @@ function Ia(e, t) {
5661
5665
  const r = Oa(e.type);
5662
5666
  return r !== null && t.includes(r);
5663
5667
  }
5664
- async function Am(e) {
5668
+ async function xm(e) {
5665
5669
  const t = globalThis.createImageBitmap;
5666
5670
  if (typeof t != "function") return null;
5667
5671
  try {
@@ -5672,18 +5676,18 @@ async function Am(e) {
5672
5676
  }
5673
5677
  }
5674
5678
  let wr = null, La = ga;
5675
- function ad(e) {
5679
+ function sd(e) {
5676
5680
  e.cdnBase && (La = e.cdnBase);
5677
5681
  }
5678
5682
  function Ma() {
5679
5683
  return La.replace(/\/+$/, "");
5680
5684
  }
5681
- function sd() {
5685
+ function ld() {
5682
5686
  const e = Ma();
5683
- return (!wr || wr.base !== e) && (wr = { base: e, client: od({ cdnBase: e }) }), wr.client;
5687
+ return (!wr || wr.base !== e) && (wr = { base: e, client: ad({ cdnBase: e }) }), wr.client;
5684
5688
  }
5685
- function xm(e) {
5686
- return !va(e) || !Ma() ? null : sd().urlFor(e);
5689
+ function km(e) {
5690
+ return !va(e) || !Ma() ? null : ld().urlFor(e);
5687
5691
  }
5688
5692
  const Gt = {
5689
5693
  serverOrigin: `http://localhost:${Jr}`,
@@ -5691,17 +5695,17 @@ const Gt = {
5691
5695
  cdnBase: ga
5692
5696
  };
5693
5697
  let Or = { ...Gt };
5694
- function ld(e) {
5698
+ function cd(e) {
5695
5699
  const t = Object.fromEntries(
5696
5700
  Object.entries(e).filter(([r, n]) => n !== void 0)
5697
5701
  );
5698
- Or = { ...Or, ...t }, ad({ cdnBase: Or.cdnBase });
5702
+ Or = { ...Or, ...t }, sd({ cdnBase: Or.cdnBase });
5699
5703
  }
5700
5704
  function kt() {
5701
5705
  return Or;
5702
5706
  }
5703
5707
  const Da = As(Gt);
5704
- function cd() {
5708
+ function ud() {
5705
5709
  return xs(Da);
5706
5710
  }
5707
5711
  function On(e) {
@@ -5738,7 +5742,7 @@ function ai(e, t) {
5738
5742
  return !1;
5739
5743
  }
5740
5744
  }
5741
- function ud() {
5745
+ function dd() {
5742
5746
  try {
5743
5747
  const e = Qr();
5744
5748
  if (!e) return [];
@@ -5758,7 +5762,7 @@ function zr(e) {
5758
5762
  } catch {
5759
5763
  }
5760
5764
  }
5761
- function dd(e) {
5765
+ function fd(e) {
5762
5766
  const t = Ne(e);
5763
5767
  return t === null ? null : t === "true" ? !0 : t === "false" ? !1 : null;
5764
5768
  }
@@ -5767,16 +5771,16 @@ let Fa = !1;
5767
5771
  function Zr(e, t) {
5768
5772
  Na.set(e, t), Fa && Ua(e, t);
5769
5773
  }
5770
- function fd() {
5774
+ function hd() {
5771
5775
  Fa = !0;
5772
5776
  for (const [e, t] of Na) Ua(e, t);
5773
5777
  }
5774
5778
  function Ua(e, t) {
5775
5779
  typeof window > "u" || (window[e] = t);
5776
5780
  }
5777
- const Yt = [], hd = 500;
5781
+ const Yt = [], md = 500;
5778
5782
  let Ir = [], In = null;
5779
- const md = 1e3, pd = 200;
5783
+ const pd = 1e3, gd = 200;
5780
5784
  let er = null;
5781
5785
  function Ba(e) {
5782
5786
  er = e;
@@ -5790,13 +5794,13 @@ function Ln() {
5790
5794
  const t = Ne(Pt.DEBUG_FLAG);
5791
5795
  return t !== null && t !== "false";
5792
5796
  }
5793
- function gd() {
5797
+ function yd() {
5794
5798
  const e = Ne(Pt.DEBUG_FLAG);
5795
5799
  if (!e || e === "true") return null;
5796
5800
  const t = e.split(",").map((r) => r.trim().toLowerCase()).filter(Boolean);
5797
5801
  return t.length > 0 ? new Set(t) : null;
5798
5802
  }
5799
- function yd() {
5803
+ function vd() {
5800
5804
  return (/* @__PURE__ */ new Date()).toLocaleTimeString("en-US", {
5801
5805
  hour12: !1,
5802
5806
  hour: "2-digit",
@@ -5805,8 +5809,8 @@ function yd() {
5805
5809
  fractionalSecondDigits: 3
5806
5810
  });
5807
5811
  }
5808
- function vd(e) {
5809
- Yt.push(e), Yt.length > hd && Yt.shift();
5812
+ function bd(e) {
5813
+ Yt.push(e), Yt.length > md && Yt.shift();
5810
5814
  }
5811
5815
  const bn = {
5812
5816
  debug: "color: #64748b; font-weight: normal;",
@@ -5815,7 +5819,7 @@ const bn = {
5815
5819
  category: "color: #3b82f6; font-weight: bold;",
5816
5820
  time: "color: #6b7280; font-weight: normal;"
5817
5821
  };
5818
- function bd(e) {
5822
+ function wd(e) {
5819
5823
  try {
5820
5824
  return JSON.stringify(e);
5821
5825
  } catch {
@@ -5830,12 +5834,12 @@ function si(e, t, r, n, i, o, a) {
5830
5834
  data: a,
5831
5835
  timestamp: Date.now()
5832
5836
  };
5833
- if (vd(s), (r || ja()) && po(s), !n) {
5837
+ if (bd(s), (r || ja()) && po(s), !n) {
5834
5838
  if (!Ln()) return;
5835
- const f = gd();
5839
+ const f = yd();
5836
5840
  if (f && !f.has(i.toLowerCase())) return;
5837
5841
  }
5838
- const c = yd(), u = a !== void 0 ? " " + bd(a) : "";
5842
+ const c = vd(), u = a !== void 0 ? " " + wd(a) : "";
5839
5843
  t(
5840
5844
  `%c[${c}]%c [${i}]%c ${o}${u}`,
5841
5845
  bn.time,
@@ -5852,25 +5856,25 @@ function ie(e, t, r) {
5852
5856
  function Ze(e, t, r) {
5853
5857
  si("error", console.error, !0, !0, e, t, r);
5854
5858
  }
5855
- function wd() {
5859
+ function _d() {
5856
5860
  return [...Yt];
5857
5861
  }
5858
- function _d() {
5862
+ function Ed() {
5859
5863
  Yt.length = 0;
5860
5864
  }
5861
- function Ed(e) {
5865
+ function Sd(e) {
5862
5866
  const t = e && e.length > 0 ? e.join(",") : "true";
5863
5867
  ai(Pt.DEBUG_FLAG, t), console.log("[wp] Debug mode enabled");
5864
5868
  }
5865
- function Sd() {
5869
+ function Rd() {
5866
5870
  zr(Pt.DEBUG_FLAG), console.log("[wp] Debug mode disabled");
5867
5871
  }
5868
- const Rd = 1024, Td = 5e4;
5872
+ const Td = 1024, Cd = 5e4;
5869
5873
  function $a(e) {
5870
5874
  if (e == null) return e;
5871
5875
  try {
5872
5876
  const t = JSON.stringify(e);
5873
- if (t.length <= Rd) return e;
5877
+ if (t.length <= Td) return e;
5874
5878
  if (typeof e == "object" && !Array.isArray(e)) {
5875
5879
  const r = {};
5876
5880
  for (const [n, i] of Object.entries(e)) {
@@ -5884,7 +5888,7 @@ function $a(e) {
5884
5888
  return "[unserializable]";
5885
5889
  }
5886
5890
  }
5887
- function km(e, t, r, n) {
5891
+ function Pm(e, t, r, n) {
5888
5892
  try {
5889
5893
  console.warn(`[${t}] ${r}`, n ?? "");
5890
5894
  } catch {
@@ -5911,7 +5915,7 @@ function km(e, t, r, n) {
5911
5915
  } catch {
5912
5916
  }
5913
5917
  }
5914
- async function Cd() {
5918
+ async function Ad() {
5915
5919
  if (Ir.length === 0) return;
5916
5920
  const e = Ir;
5917
5921
  Ir = [], In = null;
@@ -5935,7 +5939,7 @@ async function Cd() {
5935
5939
  let o = [], a = 0;
5936
5940
  for (const s of i) {
5937
5941
  const c = JSON.stringify(s).length + 1;
5938
- a + c > Td && o.length > 0 && (await fetch(n, {
5942
+ a + c > Cd && o.length > 0 && (await fetch(n, {
5939
5943
  method: "POST",
5940
5944
  headers: { "Content-Type": "application/json" },
5941
5945
  body: JSON.stringify({ logs: o })
@@ -5952,20 +5956,20 @@ async function Cd() {
5952
5956
  }
5953
5957
  function po(e) {
5954
5958
  if (Ir.push(e), !In) {
5955
- const t = ja() ? pd : md;
5956
- In = setTimeout(Cd, t);
5959
+ const t = ja() ? gd : pd;
5960
+ In = setTimeout(Ad, t);
5957
5961
  }
5958
5962
  }
5959
5963
  function vt(e) {
5960
5964
  return e instanceof Error ? { error: e.message, name: e.name } : { error: String(e), name: typeof e };
5961
5965
  }
5962
5966
  Zr("__wpDebug", {
5963
- enable: Ed,
5964
- disable: Sd,
5965
- history: wd,
5966
- clear: _d
5967
+ enable: Sd,
5968
+ disable: Rd,
5969
+ history: _d,
5970
+ clear: Ed
5967
5971
  });
5968
- function Pm() {
5972
+ function Om() {
5969
5973
  return Ra.flatMap((e) => {
5970
5974
  const t = e.characters.map((n) => n.id), r = [];
5971
5975
  for (let n = 0; n < t.length; n += co)
@@ -5973,20 +5977,18 @@ function Pm() {
5973
5977
  return r;
5974
5978
  });
5975
5979
  }
5976
- function Om(e, t) {
5980
+ function Im(e, t) {
5977
5981
  const r = e.findIndex((n) => n.some((i) => i === t));
5978
5982
  return r < 0 ? 0 : r;
5979
5983
  }
5980
- function Ad(e) {
5984
+ function xd(e) {
5981
5985
  return Ta(e) ? ku[e] : "var(--color-neutral-bg)";
5982
5986
  }
5983
5987
  function Ha(e) {
5984
- if (!Ta(e)) return;
5985
- const t = kt().serverOrigin.replace(/\/$/, ""), r = Pu[e];
5986
- return `${t}/media/sprites/square_${e}.png${r > 1 ? `?v=${r}` : ""}`;
5988
+ return Ta(e) ? `${kt().serverOrigin.replace(/\/$/, "")}${Ou(e)}` : void 0;
5987
5989
  }
5988
5990
  let tr = null, _r = null;
5989
- function xd() {
5991
+ function kd() {
5990
5992
  return tr ? Promise.resolve() : _r || (_r = (async () => {
5991
5993
  try {
5992
5994
  const e = kt().serverOrigin.replace(/\/$/, ""), t = await fetch(`${e}/media/sprites/names.json`, { cache: "no-cache" });
@@ -6014,7 +6016,7 @@ const _e = {
6014
6016
  function en() {
6015
6017
  return _e.accountId ? _e.accountId : _e.resolved && _e.userType === "public" ? "anon" : null;
6016
6018
  }
6017
- function kd(e) {
6019
+ function Pd(e) {
6018
6020
  _e.resolved = !0, e.userType && (_e.userType = e.userType), e.userId !== void 0 && (_e.accountId = e.userId && e.userId !== "public" ? e.userId : null);
6019
6021
  }
6020
6022
  function go() {
@@ -6027,19 +6029,19 @@ const yo = {
6027
6029
  wife: 3,
6028
6030
  admin: 4
6029
6031
  };
6030
- function Pd(e, t) {
6032
+ function Od(e, t) {
6031
6033
  return (yo[e] ?? -1) >= yo[t];
6032
6034
  }
6033
- function Im() {
6034
- return Pd(_e.userType, "service");
6035
+ function Lm() {
6036
+ return Od(_e.userType, "service");
6035
6037
  }
6036
6038
  function tn() {
6037
6039
  return _e.accountId ?? "public";
6038
6040
  }
6039
- function Od() {
6041
+ function Id() {
6040
6042
  return en() ?? "unscoped";
6041
6043
  }
6042
- async function Id() {
6044
+ async function Ld() {
6043
6045
  if (_e.userType === "public") return null;
6044
6046
  if (_e.name) return _e.name;
6045
6047
  try {
@@ -6056,7 +6058,7 @@ async function Id() {
6056
6058
  }
6057
6059
  return null;
6058
6060
  }
6059
- const Ld = l.object({
6061
+ const Md = l.object({
6060
6062
  // Identity. There is deliberately NO `name`: a person's name is their
6061
6063
  // hadoku key-registry name, resolved by the server from whoami and renamed
6062
6064
  // through hadoku_site's POST /session/name (operator decision 2026-10-08).
@@ -6077,13 +6079,13 @@ const Ld = l.object({
6077
6079
  subtitleStyle: l.string().optional()
6078
6080
  }), Jt = Ds({
6079
6081
  appId: "watchparty",
6080
- schema: Ld
6081
- }), Md = /* @__PURE__ */ new Set(["theme", "themeMode"]);
6082
+ schema: Md
6083
+ }), Dd = /* @__PURE__ */ new Set(["theme", "themeMode"]);
6082
6084
  function qr(e) {
6083
6085
  const t = en();
6084
6086
  return t ? `prefs-cache:${t}:${e}` : null;
6085
6087
  }
6086
- function Dd() {
6088
+ function Nd() {
6087
6089
  return en() === null;
6088
6090
  }
6089
6091
  function vo(e) {
@@ -6097,9 +6099,9 @@ function vo(e) {
6097
6099
  return {};
6098
6100
  }
6099
6101
  }
6100
- function Nd() {
6102
+ function Fd() {
6101
6103
  let e = 0;
6102
- for (const t of ud()) {
6104
+ for (const t of dd()) {
6103
6105
  const r = t.startsWith("prefs-cache:") && t.endsWith(":watchparty"), n = t === Wr || t.startsWith(`${Wr}:`) && !t.endsWith(":_serverSynced_v1");
6104
6106
  if (!r && !n) continue;
6105
6107
  const i = Ne(t);
@@ -6120,7 +6122,7 @@ function Nd() {
6120
6122
  let za = null, Va = null;
6121
6123
  const bo = /* @__PURE__ */ new Set();
6122
6124
  function li() {
6123
- if (Dd())
6125
+ if (Nd())
6124
6126
  return T("preferences", "Boot read deferred — session pending, identity unresolved"), {};
6125
6127
  const e = vo("portfolio"), t = vo("watchparty"), r = Object.keys(e).length > 0 ? e : za ?? {}, n = Object.keys(t).length > 0 ? t : Va ?? {}, i = tn() || "public";
6126
6128
  if (bo.has(i))
@@ -6145,15 +6147,15 @@ function li() {
6145
6147
  }), a;
6146
6148
  }
6147
6149
  let qa = !1;
6148
- function Fd() {
6150
+ function Ud() {
6149
6151
  const e = tn();
6150
6152
  return !e || e === "public";
6151
6153
  }
6152
6154
  function je(e, t) {
6153
- Fd() && (qa = !0), Md.has(e) ? qt.save({ [e]: t }, { scope: "device" }).catch((r) => ie("preferences", "themePrefs.save failed", { key: e, err: r?.message })) : Jt.save({ [e]: t }).catch((r) => ie("preferences", "watchpartyPrefs.save failed", { key: e, err: r?.message })), T("preferences", "Saved (via SDK)", { key: e, value: t });
6155
+ Ud() && (qa = !0), Dd.has(e) ? qt.save({ [e]: t }, { scope: "device" }).catch((r) => ie("preferences", "themePrefs.save failed", { key: e, err: r?.message })) : Jt.save({ [e]: t }).catch((r) => ie("preferences", "watchpartyPrefs.save failed", { key: e, err: r?.message })), T("preferences", "Saved (via SDK)", { key: e, value: t });
6154
6156
  }
6155
6157
  let Er = null, wo = !1;
6156
- function Ud() {
6158
+ function Bd() {
6157
6159
  return Er || (Er = (async () => {
6158
6160
  if (typeof window > "u") return !1;
6159
6161
  try {
@@ -6181,7 +6183,7 @@ function Ud() {
6181
6183
  // Post-fetch cache state: should be non-zero if SDK wrote it.
6182
6184
  sdkThemeBytesPost: i?.length ?? 0,
6183
6185
  sdkAppBytesPost: o?.length ?? 0
6184
- }), await Bd(e, t), qa ? (T("preferences", "Promoting this load's pre-auth picks to the signed-in user"), await Promise.all([
6186
+ }), await jd(e, t), qa ? (T("preferences", "Promoting this load's pre-auth picks to the signed-in user"), await Promise.all([
6185
6187
  qt.promoteAnonPrefsToUser().catch(() => {
6186
6188
  }),
6187
6189
  Jt.promoteAnonPrefsToUser().catch(() => {
@@ -6193,7 +6195,7 @@ function Ud() {
6193
6195
  })(), Er);
6194
6196
  }
6195
6197
  const Wr = "watchparty_preferences";
6196
- Nd();
6198
+ Fd();
6197
6199
  function Mn() {
6198
6200
  const e = tn();
6199
6201
  return !e || e === "public" ? Wr : `${Wr}:${e}`;
@@ -6211,7 +6213,7 @@ function Wa() {
6211
6213
  function _o() {
6212
6214
  zr(Mn()), zr(`${Mn()}:_serverSynced_v1`);
6213
6215
  }
6214
- async function Bd(e, t) {
6216
+ async function jd(e, t) {
6215
6217
  const r = Wa();
6216
6218
  if (!r || Object.keys(r).length === 0) return;
6217
6219
  const n = Object.keys(e ?? {}).length > 0, i = Object.keys(t ?? {}).length > 0, o = {}, a = {};
@@ -6268,10 +6270,10 @@ function Ro(e) {
6268
6270
  }
6269
6271
  }).catch((t) => ie("preferences", "store import failed", { reason: e, err: t?.message }));
6270
6272
  }
6271
- const Ka = 320, To = 240, jd = 640;
6273
+ const Ka = 320, To = 240, $d = 640;
6272
6274
  function wn(e, t) {
6273
6275
  if (!Number.isFinite(e)) return Ka;
6274
- let r = jd;
6276
+ let r = $d;
6275
6277
  return r = Math.max(r, To), Math.round(Math.min(r, Math.max(To, e)));
6276
6278
  }
6277
6279
  const $e = li(), B = fu((e, t) => ({
@@ -6318,6 +6320,7 @@ const $e = li(), B = fu((e, t) => ({
6318
6320
  tierlistSaving: !1,
6319
6321
  readyCheck: { active: !1, ready: [] },
6320
6322
  activeGameId: null,
6323
+ gameSettings: null,
6321
6324
  roomKeyType: null,
6322
6325
  gameSessionWins: {},
6323
6326
  gameBotCount: 0,
@@ -6497,6 +6500,7 @@ const $e = li(), B = fu((e, t) => ({
6497
6500
  }),
6498
6501
  setReadyCheckState: (r) => e({ readyCheck: r }),
6499
6502
  setActiveGameId: (r) => e({ activeGameId: r }),
6503
+ setGameSettings: (r) => e({ gameSettings: r }),
6500
6504
  setRoomKeyType: (r) => e({ roomKeyType: r }),
6501
6505
  setGameSessionWins: (r) => e({ gameSessionWins: { ...r } }),
6502
6506
  setGameBotCount: (r) => e({ gameBotCount: Math.max(0, Math.floor(r)) }),
@@ -6515,7 +6519,7 @@ const Ga = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
6515
6519
  __proto__: null,
6516
6520
  useAppStore: B
6517
6521
  }, Symbol.toStringTag, { value: "Module" }));
6518
- function $d({ className: e = "fixed bottom-4 left-1/2 -translate-x-1/2" }) {
6522
+ function Hd({ className: e = "fixed bottom-4 left-1/2 -translate-x-1/2" }) {
6519
6523
  const t = B((n) => n.toasts), r = B((n) => n.popToast);
6520
6524
  return St(() => {
6521
6525
  const n = t.map((i) => setTimeout(() => r(i.id), 4e3));
@@ -6524,7 +6528,7 @@ function $d({ className: e = "fixed bottom-4 left-1/2 -translate-x-1/2" }) {
6524
6528
  };
6525
6529
  }, [t, r]), /* @__PURE__ */ U("div", { className: `${e} flex flex-col gap-2 z-50`, children: t.map((n) => /* @__PURE__ */ U("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)) });
6526
6530
  }
6527
- const Hd = 400;
6531
+ const zd = 400;
6528
6532
  function Ya() {
6529
6533
  const e = Oi(null), t = Oi([]);
6530
6534
  return St(() => {
@@ -6607,7 +6611,7 @@ function Ya() {
6607
6611
  };
6608
6612
  }
6609
6613
  if (!t.current.length)
6610
- for (let w = 0; w < Hd; w++) t.current.push(c(void 0, void 0, !0, w));
6614
+ for (let w = 0; w < zd; w++) t.current.push(c(void 0, void 0, !0, w));
6611
6615
  let u, f = performance.now();
6612
6616
  const h = 50;
6613
6617
  function y(w, A, _, k) {
@@ -6725,21 +6729,21 @@ function Ya() {
6725
6729
  }
6726
6730
  );
6727
6731
  }
6728
- const zd = "hadoku://library";
6729
- function Vd(e = typeof navigator < "u" ? navigator.userAgent : void 0) {
6732
+ const Vd = "hadoku://library";
6733
+ function qd(e = typeof navigator < "u" ? navigator.userAgent : void 0) {
6730
6734
  return e !== void 0 && /(^|\s)HadokuApp\/\S/.test(e);
6731
6735
  }
6732
- const qd = 5e3;
6736
+ const Wd = 5e3;
6733
6737
  function Co(e) {
6734
6738
  return e.slice().sort(
6735
6739
  (t, r) => (r.users?.length ?? 0) - (t.users?.length ?? 0) || t.room_id.localeCompare(r.room_id)
6736
6740
  );
6737
6741
  }
6738
- function Wd(e) {
6742
+ function Kd(e) {
6739
6743
  return e.room_id.split("-").map((t) => t.charAt(0).toUpperCase() + t.slice(1)).join(" ");
6740
6744
  }
6741
- function Kd({ user: e }) {
6742
- const t = Ad(e.sprite_id), r = Ha(e.sprite_id);
6745
+ function Gd({ user: e }) {
6746
+ const t = xd(e.sprite_id), r = Ha(e.sprite_id);
6743
6747
  return /* @__PURE__ */ Le("span", { className: "relative -ml-2 first:ml-0 group/av", children: [
6744
6748
  /* @__PURE__ */ U(
6745
6749
  "span",
@@ -6767,7 +6771,7 @@ function Kd({ user: e }) {
6767
6771
  )
6768
6772
  ] });
6769
6773
  }
6770
- function Gd({ room: e }) {
6774
+ function Yd({ room: e }) {
6771
6775
  const t = e.users ?? [], r = t.length;
6772
6776
  return /* @__PURE__ */ Le("li", { className: "flex items-stretch gap-2", children: [
6773
6777
  /* @__PURE__ */ U(
@@ -6776,8 +6780,8 @@ function Gd({ room: e }) {
6776
6780
  to: `/room/${encodeURIComponent(e.viewer_key)}`,
6777
6781
  className: "flex-1 block no-underline rounded-lg border border-border bg-bg-card/40 backdrop-blur-sm px-5 py-4 transition-all duration-150 hover:border-border-light hover:-translate-y-px hover:bg-bg-card/55 focus:outline-none focus-visible:border-primary focus-visible:ring-2 focus-visible:ring-primary/40",
6778
6782
  children: /* @__PURE__ */ Le("div", { className: "flex items-center justify-between gap-4", children: [
6779
- /* @__PURE__ */ U("div", { className: "text-xl font-medium tracking-wide text-text no-underline", children: Wd(e) }),
6780
- r > 0 && /* @__PURE__ */ U("div", { className: "flex shrink-0", children: t.map((n, i) => /* @__PURE__ */ U(Kd, { user: n }, `${n.name}-${i}`)) })
6783
+ /* @__PURE__ */ U("div", { className: "text-xl font-medium tracking-wide text-text no-underline", children: Kd(e) }),
6784
+ r > 0 && /* @__PURE__ */ U("div", { className: "flex shrink-0", children: t.map((n, i) => /* @__PURE__ */ U(Gd, { user: n }, `${n.name}-${i}`)) })
6781
6785
  ] })
6782
6786
  }
6783
6787
  ),
@@ -6792,8 +6796,8 @@ function Gd({ room: e }) {
6792
6796
  )
6793
6797
  ] });
6794
6798
  }
6795
- function Yd() {
6796
- const e = cd(), [t, r] = jt([]), [n, i] = jt(!0), [o, a] = jt(null), [s, c] = jt(0);
6799
+ function Jd() {
6800
+ const e = ud(), [t, r] = jt([]), [n, i] = jt(!0), [o, a] = jt(null), [s, c] = jt(0);
6797
6801
  return St(() => {
6798
6802
  const u = Math.random().toString(36).slice(2, 8), f = new AbortController(), h = Xr();
6799
6803
  let y = !1, v = null, R = !1;
@@ -6853,7 +6857,7 @@ function Yd() {
6853
6857
  _ && r(Co(_.rooms || []));
6854
6858
  }).catch(() => {
6855
6859
  });
6856
- }, qd);
6860
+ }, Wd);
6857
6861
  return () => {
6858
6862
  T("home", "rooms-effect: cleanup", {
6859
6863
  effectId: u,
@@ -6880,14 +6884,14 @@ function Yd() {
6880
6884
  children: "Retry"
6881
6885
  }
6882
6886
  )
6883
- ] }) : t.length === 0 ? /* @__PURE__ */ U("div", { className: "text-text-secondary text-sm px-1 py-3", children: "No rooms available." }) : /* @__PURE__ */ U("ul", { className: "list-none p-0 m-0 space-y-2", children: t.map((u) => /* @__PURE__ */ U(Gd, { room: u }, u.viewer_key)) })
6887
+ ] }) : t.length === 0 ? /* @__PURE__ */ U("div", { className: "text-text-secondary text-sm px-1 py-3", children: "No rooms available." }) : /* @__PURE__ */ U("ul", { className: "list-none p-0 m-0 space-y-2", children: t.map((u) => /* @__PURE__ */ U(Yd, { room: u }, u.viewer_key)) })
6884
6888
  ] }),
6885
- Vd() && /* @__PURE__ */ Le("div", { className: "w-full max-w-md z-10", children: [
6889
+ qd() && /* @__PURE__ */ Le("div", { className: "w-full max-w-md z-10", children: [
6886
6890
  /* @__PURE__ */ U("h2", { className: "text-xs uppercase tracking-[0.2em] text-text-muted/70 mb-3 px-1", children: "On this phone" }),
6887
6891
  /* @__PURE__ */ Le(
6888
6892
  "a",
6889
6893
  {
6890
- href: zd,
6894
+ href: Vd,
6891
6895
  className: "block no-underline rounded-lg border border-border bg-bg-card/40 backdrop-blur-sm px-5 py-4 transition-all duration-150 hover:border-border-light hover:-translate-y-px hover:bg-bg-card/55 focus:outline-none focus-visible:border-primary focus-visible:ring-2 focus-visible:ring-primary/40",
6892
6896
  children: [
6893
6897
  /* @__PURE__ */ U("div", { className: "text-xl font-medium tracking-wide text-text", children: "Library" }),
@@ -6898,18 +6902,18 @@ function Yd() {
6898
6902
  ] })
6899
6903
  ] });
6900
6904
  }
6901
- function Jd() {
6905
+ function Xd() {
6902
6906
  return /* @__PURE__ */ Le("div", { className: "fixed inset-0 bg-black", children: [
6903
6907
  /* @__PURE__ */ U(Ya, {}),
6904
6908
  /* @__PURE__ */ U("div", { className: "absolute inset-0 flex items-center justify-center", children: /* @__PURE__ */ U("div", { className: "text-center", children: /* @__PURE__ */ U("h1", { className: "text-4xl font-bold text-white mb-4", children: "API is sleeping..." }) }) })
6905
6909
  ] });
6906
6910
  }
6907
- const Xd = "watchparty_fragment_delivery", Qd = /^[0-9a-f]{64}$/, Zd = /^[A-Za-z0-9_.-]+$/;
6908
- function ef(e) {
6909
- return !(!e || !e.baseUrl || e.baseUrl.endsWith("/") || !Qd.test(e.token) || e.trackId !== void 0 && !Zd.test(e.trackId));
6911
+ const Qd = "watchparty_fragment_delivery", Zd = /^[0-9a-f]{64}$/, ef = /^[A-Za-z0-9_.-]+$/;
6912
+ function tf(e) {
6913
+ return !(!e || !e.baseUrl || e.baseUrl.endsWith("/") || !Zd.test(e.token) || e.trackId !== void 0 && !ef.test(e.trackId));
6910
6914
  }
6911
- function Lm(e, t) {
6912
- if (!ef(e)) return null;
6915
+ function Mm(e, t) {
6916
+ if (!tf(e)) return null;
6913
6917
  let r;
6914
6918
  if (t === "init")
6915
6919
  r = "init";
@@ -6920,7 +6924,7 @@ function Lm(e, t) {
6920
6924
  const n = e.trackId ? `audio/${e.trackId}/` : "";
6921
6925
  return `${e.baseUrl}/v/${e.token}/${n}${r}`;
6922
6926
  }
6923
- function tf() {
6927
+ function rf() {
6924
6928
  if (typeof window > "u") return null;
6925
6929
  try {
6926
6930
  const e = new URLSearchParams(window.location.search).get("fragmentDelivery");
@@ -6928,27 +6932,27 @@ function tf() {
6928
6932
  if (e === "0" || e === "false") return !1;
6929
6933
  } catch {
6930
6934
  }
6931
- return dd(Xd);
6935
+ return fd(Qd);
6932
6936
  }
6933
6937
  let ci = { ...Ca }, Lr = null, Ja = !1;
6934
6938
  const Ao = "watchparty_delivery_client_id";
6935
- function rf() {
6939
+ function nf() {
6936
6940
  const e = Ne(Ao);
6937
6941
  if (e) return e;
6938
6942
  const t = globalThis.crypto?.randomUUID?.() ?? `d${Math.random().toString(36).slice(2)}`;
6939
6943
  return ai(Ao, t) ? t : "";
6940
6944
  }
6941
- function nf(e) {
6945
+ function of(e) {
6942
6946
  ci = Aa(e), Ja || (Lr = null);
6943
6947
  }
6944
- function of() {
6948
+ function af() {
6945
6949
  return { ...ci };
6946
6950
  }
6947
6951
  function Xa() {
6948
- return Lr === null && (Lr = Nu(ci, rf(), tf())), Lr;
6952
+ return Lr === null && (Lr = Fu(ci, nf(), rf())), Lr;
6949
6953
  }
6950
6954
  let xo = !1;
6951
- async function af(e) {
6955
+ async function sf(e) {
6952
6956
  if (!xo) {
6953
6957
  xo = !0;
6954
6958
  for (let t = 0; t < 2; t++) {
@@ -6956,7 +6960,7 @@ async function af(e) {
6956
6960
  const r = await fetch(`${e}/api/flags`, { cache: "no-store" });
6957
6961
  if (r.ok) {
6958
6962
  const n = await r.json();
6959
- nf(n?.fragment_delivery), T("app", "Delivery flag loaded", { ...of(), attempt: t });
6963
+ of(n?.fragment_delivery), T("app", "Delivery flag loaded", { ...af(), attempt: t });
6960
6964
  return;
6961
6965
  }
6962
6966
  } catch {
@@ -6966,28 +6970,28 @@ async function af(e) {
6966
6970
  ie("app", "Delivery flag fetch failed; staying on the default delivery path");
6967
6971
  }
6968
6972
  }
6969
- function sf() {
6973
+ function lf() {
6970
6974
  return Xa();
6971
6975
  }
6972
- function Mm() {
6976
+ function Dm() {
6973
6977
  const e = Xa();
6974
6978
  return Ja = !0, e === "fragment";
6975
6979
  }
6976
- let ui = qu;
6980
+ let ui = Wu;
6977
6981
  const Dn = /* @__PURE__ */ new Set();
6978
- function lf(e) {
6982
+ function cf(e) {
6979
6983
  ui = e;
6980
6984
  for (const t of Dn) t();
6981
6985
  }
6982
- function cf(e) {
6983
- const t = Vu.safeParse(e?.games);
6986
+ function uf(e) {
6987
+ const t = qu.safeParse(e?.games);
6984
6988
  if (!t.success)
6985
6989
  return ie("game", "Game catalog rejected; keeping the current list", { issues: t.error.issues.length }), !1;
6986
6990
  const r = t.data;
6987
- return lf(r), !0;
6991
+ return cf(r), !0;
6988
6992
  }
6989
6993
  let ko = !1;
6990
- async function uf(e) {
6994
+ async function df(e) {
6991
6995
  if (!ko) {
6992
6996
  ko = !0;
6993
6997
  try {
@@ -6996,22 +7000,22 @@ async function uf(e) {
6996
7000
  ie("game", "Game catalog fetch failed; using the default list", { status: t.status });
6997
7001
  return;
6998
7002
  }
6999
- cf(await t.json()) && T("game", "Game catalog loaded", { games: ui.map((r) => r.id) });
7003
+ uf(await t.json()) && T("game", "Game catalog loaded", { games: ui.map((r) => r.id) });
7000
7004
  } catch (t) {
7001
7005
  ie("game", "Game catalog fetch failed; using the default list", vt(t));
7002
7006
  }
7003
7007
  }
7004
7008
  }
7005
- function df() {
7009
+ function ff() {
7006
7010
  return ui;
7007
7011
  }
7008
- function ff(e) {
7012
+ function hf(e) {
7009
7013
  return Dn.add(e), () => {
7010
7014
  Dn.delete(e);
7011
7015
  };
7012
7016
  }
7013
- function Dm() {
7014
- return ks(ff, df);
7017
+ function Nm() {
7018
+ return ks(hf, ff);
7015
7019
  }
7016
7020
  function Qa(e) {
7017
7021
  return Xe.lazy(async () => {
@@ -7027,9 +7031,9 @@ function Qa(e) {
7027
7031
  }
7028
7032
  });
7029
7033
  }
7030
- const hf = ["demo-room"];
7031
- function mf(e) {
7032
- return e ? hf.some((t) => e === t || e.startsWith(t + "-")) : !1;
7034
+ const mf = ["demo-room"];
7035
+ function pf(e) {
7036
+ return e ? mf.some((t) => e === t || e.startsWith(t + "-")) : !1;
7033
7037
  }
7034
7038
  function Za(e) {
7035
7039
  if (!(e.hostname === "hadoku.me")) return null;
@@ -7038,22 +7042,22 @@ function Za(e) {
7038
7042
  const n = e.pathname + (e.search || "");
7039
7043
  return `/auth?return=${encodeURIComponent(n)}`;
7040
7044
  }
7041
- if (!e.roomKey || mf(e.roomKey) || go() !== "public") return null;
7045
+ if (!e.roomKey || pf(e.roomKey) || go() !== "public") return null;
7042
7046
  const r = e.pathname + (e.search || "");
7043
7047
  return `/auth?return=${encodeURIComponent(r)}`;
7044
7048
  }
7045
- const Po = Qa(() => import("./Room-CsUbXKFq.js").then((e) => e.R));
7049
+ const Po = Qa(() => import("./Room-B6ODdfkE.js").then((e) => e.R));
7046
7050
  function Oo() {
7047
7051
  return /* @__PURE__ */ U("div", { className: "flex-1 flex items-center justify-center bg-black", children: /* @__PURE__ */ U("div", { className: "text-text-secondary text-sm", children: "Loading room..." }) });
7048
7052
  }
7049
- function pf() {
7053
+ function gf() {
7050
7054
  const e = lt(), t = ic(), r = Za({
7051
7055
  roomKey: t.roomKey,
7052
7056
  hostname: window.location.hostname,
7053
7057
  pathname: window.location.pathname,
7054
7058
  search: window.location.search
7055
7059
  });
7056
- return r ? (window.location.replace(r), null) : t.roomKey ? /* @__PURE__ */ U(Xe.Suspense, { fallback: /* @__PURE__ */ U(Oo, {}), children: /* @__PURE__ */ U(Po, {}) }) : e.pathname === "/" || e.pathname === "" ? /* @__PURE__ */ U(Yd, {}) : e.pathname.startsWith("/room") ? /* @__PURE__ */ U(Xe.Suspense, { fallback: /* @__PURE__ */ U(Oo, {}), children: /* @__PURE__ */ U(Po, {}) }) : /* @__PURE__ */ U("div", { className: "p-6", children: "Not Found" });
7060
+ return r ? (window.location.replace(r), null) : t.roomKey ? /* @__PURE__ */ U(Xe.Suspense, { fallback: /* @__PURE__ */ U(Oo, {}), children: /* @__PURE__ */ U(Po, {}) }) : e.pathname === "/" || e.pathname === "" ? /* @__PURE__ */ U(Jd, {}) : e.pathname.startsWith("/room") ? /* @__PURE__ */ U(Xe.Suspense, { fallback: /* @__PURE__ */ U(Oo, {}), children: /* @__PURE__ */ U(Po, {}) }) : /* @__PURE__ */ U("div", { className: "p-6", children: "Not Found" });
7057
7061
  }
7058
7062
  function _n(e) {
7059
7063
  const [t, r] = jt(!1), n = {
@@ -7072,7 +7076,7 @@ function _n(e) {
7072
7076
  signal: i.signal
7073
7077
  });
7074
7078
  if (i.signal.aborted) return;
7075
- c.ok ? (T("app", "API health check passed"), af(a), uf(a)) : (Ze("app", "API health check failed", { status: c.status }), r(!0));
7079
+ c.ok ? (T("app", "API health check passed"), sf(a), df(a)) : (Ze("app", "API health check failed", { status: c.status }), r(!0));
7076
7080
  } catch (c) {
7077
7081
  if (c?.name === "AbortError") return;
7078
7082
  Ze("app", "API unreachable", { url: s, error: c }), r(!0);
@@ -7107,34 +7111,34 @@ function _n(e) {
7107
7111
  "requestIdleCallback" in window ? window.requestIdleCallback(i, { timeout: 2e3 }) : setTimeout(i, 600);
7108
7112
  }
7109
7113
  document.readyState === "complete" ? o() : window.addEventListener("load", o, { once: !0 });
7110
- }, []), t ? /* @__PURE__ */ U(Jd, {}) : (
7114
+ }, []), t ? /* @__PURE__ */ U(Xd, {}) : (
7111
7115
  // HadokuThemeRoot must sit above everything that reads the theme —
7112
7116
  // <HadokuThemePicker> in ChatPanel throws without it, by design, so a
7113
7117
  // missing provider is a mount-time error rather than a silently wrong
7114
7118
  // theme. It also applies data-theme, which this app previously did through
7115
7119
  // its own useTheme() call.
7116
7120
  /* @__PURE__ */ U(Is, { children: /* @__PURE__ */ U(Da.Provider, { value: n, children: /* @__PURE__ */ Le("div", { className: "h-screen flex flex-col bg-bg", children: [
7117
- /* @__PURE__ */ U("main", { className: "flex-1 w-full overflow-hidden min-h-0 flex flex-col", children: /* @__PURE__ */ U(pf, {}) }),
7118
- /* @__PURE__ */ U($d, {})
7121
+ /* @__PURE__ */ U("main", { className: "flex-1 w-full overflow-hidden min-h-0 flex flex-col", children: /* @__PURE__ */ U(gf, {}) }),
7122
+ /* @__PURE__ */ U(Hd, {})
7119
7123
  ] }) }) })
7120
7124
  );
7121
7125
  }
7122
- const gf = Qa(() => import("./MapEditor-D7snRTNa.js"));
7123
- function yf() {
7126
+ const yf = Qa(() => import("./MapEditor-Bvr-tvKQ.js"));
7127
+ function vf() {
7124
7128
  const e = Za({
7125
7129
  hostname: window.location.hostname,
7126
7130
  pathname: window.location.pathname,
7127
7131
  search: window.location.search,
7128
7132
  requireAuth: !0
7129
7133
  });
7130
- return e ? (window.location.replace(e), null) : /* @__PURE__ */ U(gf, {});
7134
+ return e ? (window.location.replace(e), null) : /* @__PURE__ */ U(yf, {});
7131
7135
  }
7132
- function vf({ basename: e = "/watchparty", appProps: t } = {}) {
7136
+ function bf({ basename: e = "/watchparty", appProps: t } = {}) {
7133
7137
  const r = t ?? {}, n = [
7134
7138
  { path: "/", element: /* @__PURE__ */ U(_n, { ...r }) },
7135
7139
  {
7136
7140
  path: "/editor",
7137
- element: /* @__PURE__ */ U(Xe.Suspense, { fallback: /* @__PURE__ */ U("div", { className: "w-screen h-screen flex items-center justify-center bg-bg text-text-secondary", children: "Loading editor…" }), children: /* @__PURE__ */ U(yf, {}) })
7141
+ element: /* @__PURE__ */ U(Xe.Suspense, { fallback: /* @__PURE__ */ U("div", { className: "w-screen h-screen flex items-center justify-center bg-bg text-text-secondary", children: "Loading editor…" }), children: /* @__PURE__ */ U(vf, {}) })
7138
7142
  },
7139
7143
  { path: "/room/:roomKey", element: /* @__PURE__ */ U(_n, { ...r }) },
7140
7144
  { path: "/:roomKey", element: /* @__PURE__ */ U(_n, { ...r }) }
@@ -7145,7 +7149,7 @@ let Mr;
7145
7149
  function es() {
7146
7150
  return Ne(Fs) || void 0;
7147
7151
  }
7148
- function bf() {
7152
+ function wf() {
7149
7153
  if (Mr) return;
7150
7154
  const e = es();
7151
7155
  if (e) {
@@ -7158,7 +7162,7 @@ function bf() {
7158
7162
  T("identity", "device id unavailable — joining without one");
7159
7163
  });
7160
7164
  }
7161
- function wf() {
7165
+ function _f() {
7162
7166
  return Mr ??= es();
7163
7167
  }
7164
7168
  const Ve = /* @__PURE__ */ Object.create(null);
@@ -7184,7 +7188,7 @@ function Lo(e) {
7184
7188
  return e instanceof Uint8Array ? e : e instanceof ArrayBuffer ? new Uint8Array(e) : new Uint8Array(e.buffer, e.byteOffset, e.byteLength);
7185
7189
  }
7186
7190
  let En;
7187
- function _f(e, t) {
7191
+ function Ef(e, t) {
7188
7192
  if (ts && e.data instanceof Blob)
7189
7193
  return e.data.arrayBuffer().then(Lo).then(t);
7190
7194
  if (rs && (e.data instanceof ArrayBuffer || ns(e.data)))
@@ -7196,14 +7200,14 @@ function _f(e, t) {
7196
7200
  const Mo = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", zt = typeof Uint8Array > "u" ? [] : new Uint8Array(256);
7197
7201
  for (let e = 0; e < Mo.length; e++)
7198
7202
  zt[Mo.charCodeAt(e)] = e;
7199
- const Ef = (e) => {
7203
+ const Sf = (e) => {
7200
7204
  let t = e.length * 0.75, r = e.length, n, i = 0, o, a, s, c;
7201
7205
  e[e.length - 1] === "=" && (t--, e[e.length - 2] === "=" && t--);
7202
7206
  const u = new ArrayBuffer(t), f = new Uint8Array(u);
7203
7207
  for (n = 0; n < r; n += 4)
7204
7208
  o = zt[e.charCodeAt(n)], a = zt[e.charCodeAt(n + 1)], s = zt[e.charCodeAt(n + 2)], c = zt[e.charCodeAt(n + 3)], f[i++] = o << 2 | a >> 4, f[i++] = (a & 15) << 4 | s >> 2, f[i++] = (s & 3) << 6 | c & 63;
7205
7209
  return u;
7206
- }, Sf = typeof ArrayBuffer == "function", fi = (e, t) => {
7210
+ }, Rf = typeof ArrayBuffer == "function", fi = (e, t) => {
7207
7211
  if (typeof e != "string")
7208
7212
  return {
7209
7213
  type: "message",
@@ -7212,20 +7216,20 @@ const Ef = (e) => {
7212
7216
  const r = e.charAt(0);
7213
7217
  return r === "b" ? {
7214
7218
  type: "message",
7215
- data: Rf(e.substring(1), t)
7219
+ data: Tf(e.substring(1), t)
7216
7220
  } : Dr[r] ? e.length > 1 ? {
7217
7221
  type: Dr[r],
7218
7222
  data: e.substring(1)
7219
7223
  } : {
7220
7224
  type: Dr[r]
7221
7225
  } : Nn;
7222
- }, Rf = (e, t) => {
7223
- if (Sf) {
7224
- const r = Ef(e);
7226
+ }, Tf = (e, t) => {
7227
+ if (Rf) {
7228
+ const r = Sf(e);
7225
7229
  return is(r, t);
7226
7230
  } else
7227
7231
  return { base64: !0, data: e };
7228
- }, is = (e, t) => t === "blob" ? e instanceof Blob ? e : new Blob([e]) : e instanceof ArrayBuffer ? e : e.buffer, os = "", Tf = (e, t) => {
7232
+ }, is = (e, t) => t === "blob" ? e instanceof Blob ? e : new Blob([e]) : e instanceof ArrayBuffer ? e : e.buffer, os = "", Cf = (e, t) => {
7229
7233
  const r = e.length, n = new Array(r);
7230
7234
  let i = 0;
7231
7235
  e.forEach((o, a) => {
@@ -7233,7 +7237,7 @@ const Ef = (e) => {
7233
7237
  n[a] = s, ++i === r && t(n.join(os));
7234
7238
  });
7235
7239
  });
7236
- }, Cf = (e, t) => {
7240
+ }, Af = (e, t) => {
7237
7241
  const r = e.split(os), n = [];
7238
7242
  for (let i = 0; i < r.length; i++) {
7239
7243
  const o = fi(r[i], t);
@@ -7242,10 +7246,10 @@ const Ef = (e) => {
7242
7246
  }
7243
7247
  return n;
7244
7248
  };
7245
- function Af() {
7249
+ function xf() {
7246
7250
  return new TransformStream({
7247
7251
  transform(e, t) {
7248
- _f(e, (r) => {
7252
+ Ef(e, (r) => {
7249
7253
  const n = r.length;
7250
7254
  let i;
7251
7255
  if (n < 126)
@@ -7277,7 +7281,7 @@ function Rr(e, t) {
7277
7281
  r[i] = e[0][n++], n === e[0].length && (e.shift(), n = 0);
7278
7282
  return e.length && n < e[0].length && (e[0] = e[0].slice(n)), r;
7279
7283
  }
7280
- function xf(e, t) {
7284
+ function kf(e, t) {
7281
7285
  Sn || (Sn = new TextDecoder());
7282
7286
  const r = [];
7283
7287
  let n = 0, i = -1, o = !1;
@@ -7319,9 +7323,9 @@ function xf(e, t) {
7319
7323
  }
7320
7324
  const as = 4;
7321
7325
  function ue(e) {
7322
- if (e) return kf(e);
7326
+ if (e) return Pf(e);
7323
7327
  }
7324
- function kf(e) {
7328
+ function Pf(e) {
7325
7329
  for (var t in ue.prototype)
7326
7330
  e[t] = ue.prototype[t];
7327
7331
  return e;
@@ -7367,19 +7371,19 @@ ue.prototype.listeners = function(e) {
7367
7371
  ue.prototype.hasListeners = function(e) {
7368
7372
  return !!this.listeners(e).length;
7369
7373
  };
7370
- const rn = typeof Promise == "function" && typeof Promise.resolve == "function" ? (t) => Promise.resolve().then(t) : (t, r) => r(t, 0), xe = typeof self < "u" ? self : typeof window < "u" ? window : Function("return this")(), Pf = "arraybuffer";
7374
+ const rn = typeof Promise == "function" && typeof Promise.resolve == "function" ? (t) => Promise.resolve().then(t) : (t, r) => r(t, 0), xe = typeof self < "u" ? self : typeof window < "u" ? window : Function("return this")(), Of = "arraybuffer";
7371
7375
  function ss(e, ...t) {
7372
7376
  return t.reduce((r, n) => (e.hasOwnProperty(n) && (r[n] = e[n]), r), {});
7373
7377
  }
7374
- const Of = xe.setTimeout, If = xe.clearTimeout;
7378
+ const If = xe.setTimeout, Lf = xe.clearTimeout;
7375
7379
  function nn(e, t) {
7376
- t.useNativeTimers ? (e.setTimeoutFn = Of.bind(xe), e.clearTimeoutFn = If.bind(xe)) : (e.setTimeoutFn = xe.setTimeout.bind(xe), e.clearTimeoutFn = xe.clearTimeout.bind(xe));
7377
- }
7378
- const Lf = 1.33;
7379
- function Mf(e) {
7380
- return typeof e == "string" ? Df(e) : Math.ceil((e.byteLength || e.size) * Lf);
7380
+ t.useNativeTimers ? (e.setTimeoutFn = If.bind(xe), e.clearTimeoutFn = Lf.bind(xe)) : (e.setTimeoutFn = xe.setTimeout.bind(xe), e.clearTimeoutFn = xe.clearTimeout.bind(xe));
7381
7381
  }
7382
+ const Mf = 1.33;
7382
7383
  function Df(e) {
7384
+ return typeof e == "string" ? Nf(e) : Math.ceil((e.byteLength || e.size) * Mf);
7385
+ }
7386
+ function Nf(e) {
7383
7387
  let t = 0, r = 0;
7384
7388
  for (let n = 0, i = e.length; n < i; n++)
7385
7389
  t = e.charCodeAt(n), t < 128 ? r += 1 : t < 2048 ? r += 2 : t < 55296 || t >= 57344 ? r += 3 : (n++, r += 4);
@@ -7388,13 +7392,13 @@ function Df(e) {
7388
7392
  function ls() {
7389
7393
  return Date.now().toString(36).substring(3) + Math.random().toString(36).substring(2, 5);
7390
7394
  }
7391
- function Nf(e) {
7395
+ function Ff(e) {
7392
7396
  let t = "";
7393
7397
  for (let r in e)
7394
7398
  e.hasOwnProperty(r) && (t.length && (t += "&"), t += encodeURIComponent(r) + "=" + encodeURIComponent(e[r]));
7395
7399
  return t;
7396
7400
  }
7397
- function Ff(e) {
7401
+ function Uf(e) {
7398
7402
  let t = {}, r = e.split("&");
7399
7403
  for (let n = 0, i = r.length; n < i; n++) {
7400
7404
  let o = r[n].split("=");
@@ -7402,7 +7406,7 @@ function Ff(e) {
7402
7406
  }
7403
7407
  return t;
7404
7408
  }
7405
- class Uf extends Error {
7409
+ class Bf extends Error {
7406
7410
  constructor(t, r, n) {
7407
7411
  super(t), this.description = r, this.context = n, this.type = "TransportError";
7408
7412
  }
@@ -7427,7 +7431,7 @@ class hi extends ue {
7427
7431
  * @protected
7428
7432
  */
7429
7433
  onError(t, r, n) {
7430
- return super.emitReserved("error", new Uf(t, r, n)), this;
7434
+ return super.emitReserved("error", new Bf(t, r, n)), this;
7431
7435
  }
7432
7436
  /**
7433
7437
  * Opens the transport.
@@ -7501,11 +7505,11 @@ class hi extends ue {
7501
7505
  return this.opts.port && (this.opts.secure && +(this.opts.port !== 443) || !this.opts.secure && Number(this.opts.port) !== 80) ? ":" + this.opts.port : "";
7502
7506
  }
7503
7507
  _query(t) {
7504
- const r = Nf(t);
7508
+ const r = Ff(t);
7505
7509
  return r.length ? "?" + r : "";
7506
7510
  }
7507
7511
  }
7508
- class Bf extends hi {
7512
+ class jf extends hi {
7509
7513
  constructor() {
7510
7514
  super(...arguments), this._polling = !1;
7511
7515
  }
@@ -7561,7 +7565,7 @@ class Bf extends hi {
7561
7565
  return this.onClose({ description: "transport closed by the server" }), !1;
7562
7566
  this.onPacket(n);
7563
7567
  };
7564
- Cf(t, this.socket.binaryType).forEach(r), this.readyState !== "closed" && (this._polling = !1, this.emitReserved("pollComplete"), this.readyState === "open" && this._poll());
7568
+ Af(t, this.socket.binaryType).forEach(r), this.readyState !== "closed" && (this._polling = !1, this.emitReserved("pollComplete"), this.readyState === "open" && this._poll());
7565
7569
  }
7566
7570
  /**
7567
7571
  * For polling, send a close packet.
@@ -7581,7 +7585,7 @@ class Bf extends hi {
7581
7585
  * @protected
7582
7586
  */
7583
7587
  write(t) {
7584
- this.writable = !1, Tf(t, (r) => {
7588
+ this.writable = !1, Cf(t, (r) => {
7585
7589
  this.doWrite(r, () => {
7586
7590
  this.writable = !0, this.emitReserved("drain");
7587
7591
  });
@@ -7602,10 +7606,10 @@ try {
7602
7606
  cs = typeof XMLHttpRequest < "u" && "withCredentials" in new XMLHttpRequest();
7603
7607
  } catch {
7604
7608
  }
7605
- const jf = cs;
7606
- function $f() {
7609
+ const $f = cs;
7610
+ function Hf() {
7607
7611
  }
7608
- class Hf extends Bf {
7612
+ class zf extends jf {
7609
7613
  /**
7610
7614
  * XHR Polling constructor.
7611
7615
  *
@@ -7718,7 +7722,7 @@ let Tt = class Nr extends ue {
7718
7722
  */
7719
7723
  _cleanup(t) {
7720
7724
  if (!(typeof this._xhr > "u" || this._xhr === null)) {
7721
- if (this._xhr.onreadystatechange = $f, t)
7725
+ if (this._xhr.onreadystatechange = Hf, t)
7722
7726
  try {
7723
7727
  this._xhr.abort();
7724
7728
  } catch {
@@ -7758,17 +7762,17 @@ function Do() {
7758
7762
  for (let e in Tt.requests)
7759
7763
  Tt.requests.hasOwnProperty(e) && Tt.requests[e].abort();
7760
7764
  }
7761
- const zf = (function() {
7765
+ const Vf = (function() {
7762
7766
  const e = us({
7763
7767
  xdomain: !1
7764
7768
  });
7765
7769
  return e && e.responseType !== null;
7766
7770
  })();
7767
- class Vf extends Hf {
7771
+ class qf extends zf {
7768
7772
  constructor(t) {
7769
7773
  super(t);
7770
7774
  const r = t && t.forceBase64;
7771
- this.supportsBinary = zf && !r;
7775
+ this.supportsBinary = Vf && !r;
7772
7776
  }
7773
7777
  request(t = {}) {
7774
7778
  return Object.assign(t, { xd: this.xd }, this.opts), new Tt(us, this.uri(), t);
@@ -7777,7 +7781,7 @@ class Vf extends Hf {
7777
7781
  function us(e) {
7778
7782
  const t = e.xdomain;
7779
7783
  try {
7780
- if (typeof XMLHttpRequest < "u" && (!t || jf))
7784
+ if (typeof XMLHttpRequest < "u" && (!t || $f))
7781
7785
  return new XMLHttpRequest();
7782
7786
  } catch {
7783
7787
  }
@@ -7788,7 +7792,7 @@ function us(e) {
7788
7792
  }
7789
7793
  }
7790
7794
  const ds = typeof navigator < "u" && typeof navigator.product == "string" && navigator.product.toLowerCase() === "reactnative";
7791
- class qf extends hi {
7795
+ class Wf extends hi {
7792
7796
  get name() {
7793
7797
  return "websocket";
7794
7798
  }
@@ -7845,7 +7849,7 @@ class qf extends hi {
7845
7849
  }
7846
7850
  }
7847
7851
  const Rn = xe.WebSocket || xe.MozWebSocket;
7848
- class Wf extends qf {
7852
+ class Kf extends Wf {
7849
7853
  createSocket(t, r, n) {
7850
7854
  return ds ? new Rn(t, r, n) : r ? new Rn(t, r) : new Rn(t);
7851
7855
  }
@@ -7853,7 +7857,7 @@ class Wf extends qf {
7853
7857
  this.ws.send(r);
7854
7858
  }
7855
7859
  }
7856
- class Kf extends hi {
7860
+ class Gf extends hi {
7857
7861
  get name() {
7858
7862
  return "webtransport";
7859
7863
  }
@@ -7869,7 +7873,7 @@ class Kf extends hi {
7869
7873
  this.onError("webtransport error", t);
7870
7874
  }), this._transport.ready.then(() => {
7871
7875
  this._transport.createBidirectionalStream().then((t) => {
7872
- const r = xf(Number.MAX_SAFE_INTEGER, this.socket.binaryType), n = t.readable.pipeThrough(r).getReader(), i = Af();
7876
+ const r = kf(Number.MAX_SAFE_INTEGER, this.socket.binaryType), n = t.readable.pipeThrough(r).getReader(), i = xf();
7873
7877
  i.readable.pipeTo(t.writable), this._writer = i.writable.getWriter();
7874
7878
  const o = () => {
7875
7879
  n.read().then(({ done: s, value: c }) => {
@@ -7899,11 +7903,11 @@ class Kf extends hi {
7899
7903
  (t = this._transport) === null || t === void 0 || t.close();
7900
7904
  }
7901
7905
  }
7902
- const Gf = {
7903
- websocket: Wf,
7904
- webtransport: Kf,
7905
- polling: Vf
7906
- }, Yf = /^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/, Jf = [
7906
+ const Yf = {
7907
+ websocket: Kf,
7908
+ webtransport: Gf,
7909
+ polling: qf
7910
+ }, Jf = /^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/, Xf = [
7907
7911
  "source",
7908
7912
  "protocol",
7909
7913
  "authority",
@@ -7924,16 +7928,16 @@ function Fn(e) {
7924
7928
  throw "URI too long";
7925
7929
  const t = e, r = e.indexOf("["), n = e.indexOf("]");
7926
7930
  r != -1 && n != -1 && (e = e.substring(0, r) + e.substring(r, n).replace(/:/g, ";") + e.substring(n, e.length));
7927
- let i = Yf.exec(e || ""), o = {}, a = 14;
7931
+ let i = Jf.exec(e || ""), o = {}, a = 14;
7928
7932
  for (; a--; )
7929
- o[Jf[a]] = i[a] || "";
7930
- return r != -1 && n != -1 && (o.source = t, o.host = o.host.substring(1, o.host.length - 1).replace(/;/g, ":"), o.authority = o.authority.replace("[", "").replace("]", "").replace(/;/g, ":"), o.ipv6uri = !0), o.pathNames = Xf(o, o.path), o.queryKey = Qf(o, o.query), o;
7933
+ o[Xf[a]] = i[a] || "";
7934
+ return r != -1 && n != -1 && (o.source = t, o.host = o.host.substring(1, o.host.length - 1).replace(/;/g, ":"), o.authority = o.authority.replace("[", "").replace("]", "").replace(/;/g, ":"), o.ipv6uri = !0), o.pathNames = Qf(o, o.path), o.queryKey = Zf(o, o.query), o;
7931
7935
  }
7932
- function Xf(e, t) {
7936
+ function Qf(e, t) {
7933
7937
  const r = /\/{2,9}/g, n = t.replace(r, "/").split("/");
7934
7938
  return (t.slice(0, 1) == "/" || t.length === 0) && n.splice(0, 1), t.slice(-1) == "/" && n.splice(n.length - 1, 1), n;
7935
7939
  }
7936
- function Qf(e, t) {
7940
+ function Zf(e, t) {
7937
7941
  const r = {};
7938
7942
  return t.replace(/(?:^|&)([^&=]*)=?([^&]*)/g, function(n, i, o) {
7939
7943
  i && (r[i] = o);
@@ -7951,7 +7955,7 @@ class at extends ue {
7951
7955
  * @param {Object} opts - options
7952
7956
  */
7953
7957
  constructor(t, r) {
7954
- if (super(), this.binaryType = Pf, this.writeBuffer = [], this._prevBufferLen = 0, this._pingInterval = -1, this._pingTimeout = -1, this._maxPayload = -1, this._pingTimeoutTime = 1 / 0, t && typeof t == "object" && (r = t, t = null), t) {
7958
+ if (super(), this.binaryType = Of, this.writeBuffer = [], this._prevBufferLen = 0, this._pingInterval = -1, this._pingTimeout = -1, this._maxPayload = -1, this._pingTimeoutTime = 1 / 0, t && typeof t == "object" && (r = t, t = null), t) {
7955
7959
  const n = Fn(t);
7956
7960
  r.hostname = n.host, r.secure = n.protocol === "https" || n.protocol === "wss", r.port = n.port, n.query && (r.query = n.query);
7957
7961
  } else r.host && (r.hostname = Fn(r.host).host);
@@ -7972,7 +7976,7 @@ class at extends ue {
7972
7976
  },
7973
7977
  transportOptions: {},
7974
7978
  closeOnBeforeunload: !1
7975
- }, r), this.opts.path = this.opts.path.replace(/\/$/, "") + (this.opts.addTrailingSlash ? "/" : ""), typeof this.opts.query == "string" && (this.opts.query = Ff(this.opts.query)), Un && (this.opts.closeOnBeforeunload && (this._beforeunloadEventListener = () => {
7979
+ }, r), this.opts.path = this.opts.path.replace(/\/$/, "") + (this.opts.addTrailingSlash ? "/" : ""), typeof this.opts.query == "string" && (this.opts.query = Uf(this.opts.query)), Un && (this.opts.closeOnBeforeunload && (this._beforeunloadEventListener = () => {
7976
7980
  this.transport && (this.transport.removeAllListeners(), this.transport.close());
7977
7981
  }, addEventListener("beforeunload", this._beforeunloadEventListener, !1)), this.hostname !== "localhost" && (this._offlineEventListener = () => {
7978
7982
  this._onClose("transport close", {
@@ -8107,7 +8111,7 @@ class at extends ue {
8107
8111
  let r = 1;
8108
8112
  for (let n = 0; n < this.writeBuffer.length; n++) {
8109
8113
  const i = this.writeBuffer[n].data;
8110
- if (i && (r += Mf(i)), n > 0 && r > this._maxPayload)
8114
+ if (i && (r += Df(i)), n > 0 && r > this._maxPayload)
8111
8115
  return this.writeBuffer.slice(0, n);
8112
8116
  r += 2;
8113
8117
  }
@@ -8214,7 +8218,7 @@ class at extends ue {
8214
8218
  }
8215
8219
  }
8216
8220
  at.protocol = as;
8217
- class Zf extends at {
8221
+ class eh extends at {
8218
8222
  constructor() {
8219
8223
  super(...arguments), this._upgrades = [];
8220
8224
  }
@@ -8286,21 +8290,21 @@ class Zf extends at {
8286
8290
  return r;
8287
8291
  }
8288
8292
  }
8289
- let eh = class extends Zf {
8293
+ let th = class extends eh {
8290
8294
  constructor(t, r = {}) {
8291
8295
  const n = typeof t == "object" ? t : r;
8292
- (!n.transports || n.transports && typeof n.transports[0] == "string") && (n.transports = (n.transports || ["polling", "websocket", "webtransport"]).map((i) => Gf[i]).filter((i) => !!i)), super(t, n);
8296
+ (!n.transports || n.transports && typeof n.transports[0] == "string") && (n.transports = (n.transports || ["polling", "websocket", "webtransport"]).map((i) => Yf[i]).filter((i) => !!i)), super(t, n);
8293
8297
  }
8294
8298
  };
8295
- function th(e, t = "", r) {
8299
+ function rh(e, t = "", r) {
8296
8300
  let n = e;
8297
8301
  r = r || typeof location < "u" && location, e == null && (e = r.protocol + "//" + r.host), typeof e == "string" && (e.charAt(0) === "/" && (e.charAt(1) === "/" ? e = r.protocol + e : e = r.host + e), /^(https?|wss?):\/\//.test(e) || (typeof r < "u" ? e = r.protocol + "//" + e : e = "https://" + e), n = Fn(e)), n.port || (/^(http|ws)$/.test(n.protocol) ? n.port = "80" : /^(http|ws)s$/.test(n.protocol) && (n.port = "443")), n.path = n.path || "/";
8298
8302
  const o = n.host.indexOf(":") !== -1 ? "[" + n.host + "]" : n.host;
8299
8303
  return n.id = n.protocol + "://" + o + ":" + n.port + t, n.href = n.protocol + "://" + o + (r && r.port === n.port ? "" : ":" + n.port), n;
8300
8304
  }
8301
- const rh = typeof ArrayBuffer == "function", nh = (e) => typeof ArrayBuffer.isView == "function" ? ArrayBuffer.isView(e) : e.buffer instanceof ArrayBuffer, fs = Object.prototype.toString, ih = typeof Blob == "function" || typeof Blob < "u" && fs.call(Blob) === "[object BlobConstructor]", oh = typeof File == "function" || typeof File < "u" && fs.call(File) === "[object FileConstructor]";
8305
+ const nh = typeof ArrayBuffer == "function", ih = (e) => typeof ArrayBuffer.isView == "function" ? ArrayBuffer.isView(e) : e.buffer instanceof ArrayBuffer, fs = Object.prototype.toString, oh = typeof Blob == "function" || typeof Blob < "u" && fs.call(Blob) === "[object BlobConstructor]", ah = typeof File == "function" || typeof File < "u" && fs.call(File) === "[object FileConstructor]";
8302
8306
  function mi(e) {
8303
- return rh && (e instanceof ArrayBuffer || nh(e)) || ih && e instanceof Blob || oh && e instanceof File;
8307
+ return nh && (e instanceof ArrayBuffer || ih(e)) || oh && e instanceof Blob || ah && e instanceof File;
8304
8308
  }
8305
8309
  function Ur(e, t) {
8306
8310
  if (!e || typeof e != "object")
@@ -8320,7 +8324,7 @@ function Ur(e, t) {
8320
8324
  return !0;
8321
8325
  return !1;
8322
8326
  }
8323
- function ah(e) {
8327
+ function sh(e) {
8324
8328
  const t = [], r = e.data, n = e;
8325
8329
  return n.data = Bn(r, t), n.attachments = t.length, { packet: n, buffers: t };
8326
8330
  }
@@ -8343,7 +8347,7 @@ function Bn(e, t) {
8343
8347
  }
8344
8348
  return e;
8345
8349
  }
8346
- function sh(e, t) {
8350
+ function lh(e, t) {
8347
8351
  return e.data = jn(e.data, t), delete e.attachments, e;
8348
8352
  }
8349
8353
  function jn(e, t) {
@@ -8361,7 +8365,7 @@ function jn(e, t) {
8361
8365
  Object.prototype.hasOwnProperty.call(e, r) && (e[r] = jn(e[r], t));
8362
8366
  return e;
8363
8367
  }
8364
- const lh = [
8368
+ const ch = [
8365
8369
  "connect",
8366
8370
  "connect_error",
8367
8371
  "disconnect",
@@ -8369,12 +8373,12 @@ const lh = [
8369
8373
  "newListener",
8370
8374
  "removeListener"
8371
8375
  // used by the Node.js EventEmitter
8372
- ], ch = 5;
8376
+ ], uh = 5;
8373
8377
  var J;
8374
8378
  (function(e) {
8375
8379
  e[e.CONNECT = 0] = "CONNECT", e[e.DISCONNECT = 1] = "DISCONNECT", e[e.EVENT = 2] = "EVENT", e[e.ACK = 3] = "ACK", e[e.CONNECT_ERROR = 4] = "CONNECT_ERROR", e[e.BINARY_EVENT = 5] = "BINARY_EVENT", e[e.BINARY_ACK = 6] = "BINARY_ACK";
8376
8380
  })(J || (J = {}));
8377
- class uh {
8381
+ class dh {
8378
8382
  /**
8379
8383
  * Encoder constructor
8380
8384
  *
@@ -8410,7 +8414,7 @@ class uh {
8410
8414
  * a list of buffers.
8411
8415
  */
8412
8416
  encodeAsBinary(t) {
8413
- const r = ah(t), n = this.encodeAsString(r.packet), i = r.buffers;
8417
+ const r = sh(t), n = this.encodeAsString(r.packet), i = r.buffers;
8414
8418
  return i.unshift(n), i;
8415
8419
  }
8416
8420
  }
@@ -8438,7 +8442,7 @@ class pi extends ue {
8438
8442
  throw new Error("got plaintext data when reconstructing a packet");
8439
8443
  r = this.decodeString(t);
8440
8444
  const n = r.type === J.BINARY_EVENT;
8441
- n || r.type === J.BINARY_ACK ? (r.type = n ? J.EVENT : J.ACK, this.reconstructor = new dh(r), r.attachments === 0 && super.emitReserved("decoded", r)) : super.emitReserved("decoded", r);
8445
+ n || r.type === J.BINARY_ACK ? (r.type = n ? J.EVENT : J.ACK, this.reconstructor = new fh(r), r.attachments === 0 && super.emitReserved("decoded", r)) : super.emitReserved("decoded", r);
8442
8446
  } else if (mi(t) || t.base64)
8443
8447
  if (this.reconstructor)
8444
8448
  r = this.reconstructor.takeBinaryData(t), r && (this.reconstructor = null, super.emitReserved("decoded", r));
@@ -8516,7 +8520,7 @@ class pi extends ue {
8516
8520
  return typeof r == "string" || No(r);
8517
8521
  case J.EVENT:
8518
8522
  case J.BINARY_EVENT:
8519
- return Array.isArray(r) && (typeof r[0] == "number" || typeof r[0] == "string" && lh.indexOf(r[0]) === -1);
8523
+ return Array.isArray(r) && (typeof r[0] == "number" || typeof r[0] == "string" && ch.indexOf(r[0]) === -1);
8520
8524
  case J.ACK:
8521
8525
  case J.BINARY_ACK:
8522
8526
  return Array.isArray(r);
@@ -8529,7 +8533,7 @@ class pi extends ue {
8529
8533
  this.reconstructor && (this.reconstructor.finishedReconstruction(), this.reconstructor = null);
8530
8534
  }
8531
8535
  }
8532
- class dh {
8536
+ class fh {
8533
8537
  constructor(t) {
8534
8538
  this.packet = t, this.buffers = [], this.reconPack = t;
8535
8539
  }
@@ -8543,7 +8547,7 @@ class dh {
8543
8547
  */
8544
8548
  takeBinaryData(t) {
8545
8549
  if (this.buffers.push(t), this.buffers.length === this.reconPack.attachments) {
8546
- const r = sh(this.reconPack, this.buffers);
8550
+ const r = lh(this.reconPack, this.buffers);
8547
8551
  return this.finishedReconstruction(), r;
8548
8552
  }
8549
8553
  return null;
@@ -8555,21 +8559,21 @@ class dh {
8555
8559
  this.reconPack = null, this.buffers = [];
8556
8560
  }
8557
8561
  }
8558
- const fh = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
8562
+ const hh = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
8559
8563
  __proto__: null,
8560
8564
  Decoder: pi,
8561
- Encoder: uh,
8565
+ Encoder: dh,
8562
8566
  get PacketType() {
8563
8567
  return J;
8564
8568
  },
8565
- protocol: ch
8569
+ protocol: uh
8566
8570
  }, Symbol.toStringTag, { value: "Module" }));
8567
8571
  function Ie(e, t, r) {
8568
8572
  return e.on(t, r), function() {
8569
8573
  e.off(t, r);
8570
8574
  };
8571
8575
  }
8572
- const hh = Object.freeze({
8576
+ const mh = Object.freeze({
8573
8577
  connect: 1,
8574
8578
  connect_error: 1,
8575
8579
  disconnect: 1,
@@ -8694,7 +8698,7 @@ class hs extends ue {
8694
8698
  */
8695
8699
  emit(t, ...r) {
8696
8700
  var n, i, o;
8697
- if (hh.hasOwnProperty(t))
8701
+ if (mh.hasOwnProperty(t))
8698
8702
  throw new Error('"' + t.toString() + '" is a reserved event name');
8699
8703
  if (r.unshift(t), this._opts.retries && !this.flags.fromQueue && !this.flags.volatile)
8700
8704
  return this._addToQueue(r), this;
@@ -9201,7 +9205,7 @@ class $n extends ue {
9201
9205
  max: this.reconnectionDelayMax(),
9202
9206
  jitter: this.randomizationFactor()
9203
9207
  }), this.timeout(r.timeout == null ? 2e4 : r.timeout), this._readyState = "closed", this.uri = t;
9204
- const i = r.parser || fh;
9208
+ const i = r.parser || hh;
9205
9209
  this.encoder = new i.Encoder(), this.decoder = new i.Decoder(), this._autoConnect = r.autoConnect !== !1, this._autoConnect && this.open();
9206
9210
  }
9207
9211
  reconnection(t) {
@@ -9244,7 +9248,7 @@ class $n extends ue {
9244
9248
  open(t) {
9245
9249
  if (~this._readyState.indexOf("open"))
9246
9250
  return this;
9247
- this.engine = new eh(this.uri, this.opts);
9251
+ this.engine = new th(this.uri, this.opts);
9248
9252
  const r = this.engine, n = this;
9249
9253
  this._readyState = "opening", this.skipReconnect = !1;
9250
9254
  const i = Ie(r, "open", function() {
@@ -9434,7 +9438,7 @@ class $n extends ue {
9434
9438
  const Bt = {};
9435
9439
  function Br(e, t) {
9436
9440
  typeof e == "object" && (t = e, e = void 0), t = t || {};
9437
- const r = th(e, t.path || "/socket.io"), n = r.source, i = r.id, o = r.path, a = Bt[i] && o in Bt[i].nsps, s = t.forceNew || t["force new connection"] || t.multiplex === !1 || a;
9441
+ const r = rh(e, t.path || "/socket.io"), n = r.source, i = r.id, o = r.path, a = Bt[i] && o in Bt[i].nsps, s = t.forceNew || t["force new connection"] || t.multiplex === !1 || a;
9438
9442
  let c;
9439
9443
  return s ? c = new $n(n, t) : (Bt[i] || (Bt[i] = new $n(n, t)), c = Bt[i]), r.query && !t.query && (t.query = r.queryKey), c.socket(r.path, t);
9440
9444
  }
@@ -9444,20 +9448,20 @@ Object.assign(Br, {
9444
9448
  io: Br,
9445
9449
  connect: Br
9446
9450
  });
9447
- function Fm(e) {
9451
+ function Um(e) {
9448
9452
  const r = `${Xr()}/media/${e}`.replace(/\\/g, "/");
9449
- return { mediaUrl: `${r}/${Iu}`, indexUrl: `${r}/index.json` };
9453
+ return { mediaUrl: `${r}/${Lu}`, indexUrl: `${r}/index.json` };
9450
9454
  }
9451
- function mh(e) {
9455
+ function ph(e) {
9452
9456
  return `${Xr()}/media/${e}`.replace(/\\/g, "/");
9453
9457
  }
9454
- function ph(e, t) {
9455
- return mh(t ?? `${e}/poster.jpg`);
9458
+ function gh(e, t) {
9459
+ return ph(t ?? `${e}/poster.jpg`);
9456
9460
  }
9457
9461
  function ms(e) {
9458
9462
  return `${Xr()}${e}`.replace(/\\/g, "/");
9459
9463
  }
9460
- async function gh(e) {
9464
+ async function yh(e) {
9461
9465
  try {
9462
9466
  const t = await fetch(ms("/api/tierlist"));
9463
9467
  if (!t.ok)
@@ -9473,19 +9477,19 @@ async function gh(e) {
9473
9477
  }
9474
9478
  }
9475
9479
  let Fo = !1;
9476
- function Um() {
9480
+ function Bm() {
9477
9481
  if (Fo || typeof Image > "u") return;
9478
9482
  const e = B.getState().tierlist;
9479
9483
  if (!(!e || e.items.length === 0)) {
9480
9484
  Fo = !0;
9481
9485
  for (const t of e.items) {
9482
9486
  const r = new Image();
9483
- r.decoding = "async", r.src = ph(t.id, t.thumbnail);
9487
+ r.decoding = "async", r.src = gh(t.id, t.thumbnail);
9484
9488
  }
9485
9489
  T("tierlist", "Warming posters", { count: e.items.length });
9486
9490
  }
9487
9491
  }
9488
- async function Bm(e) {
9492
+ async function jm(e) {
9489
9493
  const t = B.getState();
9490
9494
  t.setTierlistSaving(!0);
9491
9495
  try {
@@ -9504,37 +9508,37 @@ async function Bm(e) {
9504
9508
  B.getState().setTierlistSaving(!1);
9505
9509
  }
9506
9510
  }
9507
- function yh() {
9511
+ function vh() {
9508
9512
  const e = B.getState(), t = new Set(Object.values(e.roster).map((o) => o.sprite).filter(Boolean)), r = Ae.find((o) => !t.has(o));
9509
9513
  if (!r)
9510
9514
  return ie("socket", "sprite_taken: no available sprites to retry with"), null;
9511
9515
  const n = !!e.name && !xt(e.name), i = n ? e.name : Vr(r);
9512
9516
  return T("socket", "sprite_taken: retrying with next available", { from: e.sprite, to: r, name: i, keptCustomName: n }), e.setSessionIdentity(i, r), { name: i, sprite: r };
9513
9517
  }
9514
- function vh(e) {
9518
+ function bh(e) {
9515
9519
  const t = B.getState(), r = e ? t.roster[e] : void 0;
9516
9520
  return !r || !!r.sprite && r.sprite === t.sprite;
9517
9521
  }
9518
- const bh = 10;
9519
- function wh(e = typeof window < "u" ? window : void 0) {
9522
+ const wh = 10;
9523
+ function _h(e = typeof window < "u" ? window : void 0) {
9520
9524
  if (!e) return { framed: !1, depth: 0 };
9521
9525
  try {
9522
9526
  let t = 0, r = e;
9523
- for (; r !== r.parent && t < bh; )
9527
+ for (; r !== r.parent && t < wh; )
9524
9528
  t++, r = r.parent;
9525
9529
  return { framed: e.top ? e.top !== e.self : t > 0, depth: t };
9526
9530
  } catch {
9527
9531
  return { framed: !1, depth: 0 };
9528
9532
  }
9529
9533
  }
9530
- function _h(e, t, r) {
9534
+ function Eh(e, t, r) {
9531
9535
  const n = !!e.name && !r(e.name) && (!t || r(t.name || "")), i = !!e.avatarId && (!t || t.avatarId !== e.avatarId);
9532
9536
  if (!n && !i)
9533
9537
  return null;
9534
9538
  const o = {};
9535
9539
  return n && (o.name = e.name), i && (o.avatarId = e.avatarId), o;
9536
9540
  }
9537
- function Eh(e, t) {
9541
+ function Sh(e, t) {
9538
9542
  let r = 0;
9539
9543
  for (const n of e.videos) {
9540
9544
  const i = Pt.voteKey(t, e.id, n.mediaId);
@@ -9542,49 +9546,49 @@ function Eh(e, t) {
9542
9546
  }
9543
9547
  return r;
9544
9548
  }
9545
- const Sh = 2e4, Rh = 1e4;
9546
- function Th() {
9549
+ const Rh = 2e4, Th = 1e4;
9550
+ function Ch() {
9547
9551
  return { unansweredSince: null, lastPongAt: null, lastTickAt: null };
9548
9552
  }
9549
- function Ch(e, t) {
9553
+ function Ah(e, t) {
9550
9554
  e.lastPongAt = t, e.unansweredSince = null;
9551
9555
  }
9552
- function Ah(e, t, r) {
9553
- const n = e.lastTickAt !== null && t - e.lastTickAt > Rh;
9554
- return e.lastTickAt = t, r ? n || e.unansweredSince === null ? (e.unansweredSince = t, !1) : t - e.unansweredSince > Sh : (e.unansweredSince = null, !1);
9556
+ function xh(e, t, r) {
9557
+ const n = e.lastTickAt !== null && t - e.lastTickAt > Th;
9558
+ return e.lastTickAt = t, r ? n || e.unansweredSince === null ? (e.unansweredSince = t, !1) : t - e.unansweredSince > Rh : (e.unansweredSince = null, !1);
9555
9559
  }
9556
9560
  function ps(e, t) {
9557
9561
  return e.lastPongAt === null ? void 0 : Math.max(0, t - e.lastPongAt);
9558
9562
  }
9559
9563
  let Y = null, Me = null, jr = null, De = null, et = null;
9560
- const xh = Ph(), gt = Th();
9564
+ const kh = Oh(), gt = Ch();
9561
9565
  let Tr = null, Tn = null, Uo = 0, gi = null, Hn = !1, yi = !1, Vt = !1, vi = null;
9562
- function jm(e) {
9566
+ function $m(e) {
9563
9567
  const t = Oe(), r = B.getState();
9564
9568
  if (r.me.clientId && r.roster[r.me.clientId])
9565
9569
  return (e.name || e.sprite) && (T("socket", "Identity update (already joined)", { name: e.name, sprite: e.sprite }), t.emit(te.IDENTITY_UPDATE, { name: e.name, sprite: e.sprite })), t;
9566
- const n = kh(e);
9570
+ const n = Ph(e);
9567
9571
  return et = n, gi = { name: n.name, sprite: n.sprite }, t.connected ? (T("socket", "Emitting join", n), t.emit(te.JOIN, n)) : t.once("connect", () => {
9568
9572
  T("socket", "Emitting join", n), t.emit(te.JOIN, n);
9569
9573
  }), t;
9570
9574
  }
9571
- function kh(e) {
9575
+ function Ph(e) {
9572
9576
  return {
9573
9577
  room_key: e.room_key,
9574
9578
  name: e.name,
9575
9579
  sprite: e.sprite,
9576
9580
  // Entry-path telemetry — see lib/embedContext.ts. Sent on every join AND
9577
9581
  // rejoin (lastJoinPayload carries it), so a reconnect keeps the attribution.
9578
- embed: wh(),
9579
- delivery_arm: sf(),
9582
+ embed: _h(),
9583
+ delivery_arm: lf(),
9580
9584
  // Identity tier input — see lib/deviceId.ts. Sent on every join AND rejoin
9581
9585
  // (lastJoinPayload carries it) so a reconnect lands on the same
9582
9586
  // ParticipantId rather than minting a new person.
9583
- device_id: wf(),
9584
- tab_id: xh
9587
+ device_id: _f(),
9588
+ tab_id: kh
9585
9589
  };
9586
9590
  }
9587
- function Ph() {
9591
+ function Oh() {
9588
9592
  const e = globalThis.crypto;
9589
9593
  if (e && typeof e.randomUUID == "function") return e.randomUUID();
9590
9594
  const t = new Uint8Array(16);
@@ -9592,7 +9596,7 @@ function Ph() {
9592
9596
  else for (let r = 0; r < t.length; r++) t[r] = Math.floor(Math.random() * 256);
9593
9597
  return Array.from(t, (r) => r.toString(16).padStart(2, "0")).join("");
9594
9598
  }
9595
- function $m() {
9599
+ function Hm() {
9596
9600
  return ps(gt, Date.now());
9597
9601
  }
9598
9602
  function Oe() {
@@ -9604,15 +9608,15 @@ function Oe() {
9604
9608
  }
9605
9609
  const r = new URL(t.startsWith("http") ? t : `${window.location.origin}${t}`).origin;
9606
9610
  Y = Br(r, { path: hu, transports: ["websocket", "polling"] }), T("socket", "Socket initialized", { origin: t }), Zr("__SOCKET__", Y), De && (clearTimeout(De), De = null), Me = null, jr = setInterval(() => {
9607
- if (Ah(gt, Date.now(), !!Y?.connected)) {
9611
+ if (xh(gt, Date.now(), !!Y?.connected)) {
9608
9612
  ie("socket", "PONG-WATCHDOG no time_pong for 20s — replacing the connection", {
9609
9613
  sid: Y?.id,
9610
9614
  lastPongAgeMs: ps(gt, Date.now()) ?? null
9611
9615
  }), Tn = "pong-watchdog", gt.unansweredSince = null, Y?.io.engine?.close();
9612
9616
  return;
9613
9617
  }
9614
- jh();
9615
- }, Ou), Y.on("connect", () => {
9618
+ $h();
9619
+ }, Iu), Y.on("connect", () => {
9616
9620
  yi = !1;
9617
9621
  const n = Y?.id;
9618
9622
  if (T("socket", "Connected", { id: n, isReconnect: Vt }), n)
@@ -9648,7 +9652,7 @@ function Oe() {
9648
9652
  Vt = !0;
9649
9653
  }), Y.on("disconnect", (n) => {
9650
9654
  Ba(null), Tr = { reason: Tn ?? n, at: Date.now() }, Tn = null, T("socket", "Disconnected", { reason: n });
9651
- }), Y.on("connect_error", (n) => Ze("socket", "Connection error", { message: n?.message })), Y.on("reconnect_attempt", (n) => ie("socket", "Reconnect attempt", { attempt: n })), Y.on("reconnect_failed", () => Ze("socket", "Reconnect failed")), Bh(Y);
9655
+ }), Y.on("connect_error", (n) => Ze("socket", "Connection error", { message: n?.message })), Y.on("reconnect_attempt", (n) => ie("socket", "Reconnect attempt", { attempt: n })), Y.on("reconnect_failed", () => Ze("socket", "Reconnect failed")), jh(Y);
9652
9656
  }
9653
9657
  return Y;
9654
9658
  }
@@ -9672,7 +9676,7 @@ function Bo(e, t) {
9672
9676
  systemType: e.systemType
9673
9677
  };
9674
9678
  }
9675
- function Oh(e) {
9679
+ function Ih(e) {
9676
9680
  e.on(te.SNAPSHOT, (t) => {
9677
9681
  e.emit(ct.SYNC), B.getState().applySnapshot({
9678
9682
  roomId: t.room_id ?? null,
@@ -9682,7 +9686,7 @@ function Oh(e) {
9682
9686
  serverSeq: t.server_seq || 0,
9683
9687
  leaderId: t.leader_id || null
9684
9688
  }), B.getState().name || T("socket", "Deferring identity to presence event (snapshot carries no roster)");
9685
- const r = B.getState(), n = Y?.id, o = (n ? r.roster[n] : void 0) ?? gi, a = _h(
9689
+ const r = B.getState(), n = Y?.id, o = (n ? r.roster[n] : void 0) ?? gi, a = Eh(
9686
9690
  { name: r.name, avatarId: r.sprite },
9687
9691
  o ? { name: o.name, avatarId: o.sprite ?? null } : void 0,
9688
9692
  // A join that carried no name counts as a default one, so a name that
@@ -9725,7 +9729,7 @@ function Oh(e) {
9725
9729
  }), e.on(te.CONTROL_ACK, (t) => {
9726
9730
  typeof t?.client_seq == "number" && typeof t?.server_seq == "number" && T("socket", "Control ack received", t);
9727
9731
  }), e.on(te.TIME_PONG, (t) => {
9728
- if (Ch(gt, Date.now()), Me && Me.ts) {
9732
+ if (Ah(gt, Date.now()), Me && Me.ts) {
9729
9733
  const r = Date.now() - Me.ts;
9730
9734
  B.getState().addRttSample(r, t?.server_ts, Me.ts), Me = null, De && (clearTimeout(De), De = null), T("socket", "Time sync RTT", { rtt: r, offset: B.getState().drift.offsetMs });
9731
9735
  }
@@ -9735,7 +9739,7 @@ function Oh(e) {
9735
9739
  B.getState().setReadiness({ mediaId: r, ready: o, readyCount: n, total: i }), T("socket", "Ready state received", { mediaId: r, readyCount: n, total: i, ready: o });
9736
9740
  });
9737
9741
  }
9738
- function Ih(e) {
9742
+ function Lh(e) {
9739
9743
  e.on(te.PRESENCE, (t) => {
9740
9744
  if (!t) return;
9741
9745
  if (Array.isArray(t.users)) {
@@ -9769,7 +9773,7 @@ function Ih(e) {
9769
9773
  }
9770
9774
  });
9771
9775
  }
9772
- function Lh(e) {
9776
+ function Mh(e) {
9773
9777
  e.on(te.CHAT_BROADCAST, (t) => {
9774
9778
  const r = Bo(t, t.server_seq);
9775
9779
  B.getState().appendChat(r), T("chat", "Message received", r);
@@ -9779,7 +9783,7 @@ function Lh(e) {
9779
9783
  B.getState().setChat(r), T("chat", "History loaded", { count: r.length });
9780
9784
  });
9781
9785
  }
9782
- function Mh(e) {
9786
+ function Dh(e) {
9783
9787
  e.on(Qe.STATE, (t) => {
9784
9788
  B.getState().applyPlaylistState({
9785
9789
  playlist: t?.playlist ?? null,
@@ -9792,78 +9796,78 @@ function Mh(e) {
9792
9796
  B.getState().setPlaylistResults(t ?? null), T("playlist", "Results received", { playlistId: t?.playlist?.id, update: t?.update === !0 });
9793
9797
  }), e.on(Qe.VOTES_CLEARED, (t) => {
9794
9798
  if (!t?.playlistId || !Array.isArray(t.mediaIds)) return;
9795
- const r = Eh(
9799
+ const r = Sh(
9796
9800
  { id: t.playlistId, videos: t.mediaIds.map((i) => ({ mediaId: i })) },
9797
- Od()
9801
+ Id()
9798
9802
  ), n = B.getState();
9799
9803
  n.playlist?.id === t.playlistId && n.applyPlaylistState({ playlist: n.playlist, activeIndex: n.activePlaylistIndex, myVotes: {} }), T("playlist", "Votes cleared by leader", { playlistId: t.playlistId, removed: r });
9800
9804
  });
9801
9805
  }
9802
- function Dh(e) {
9806
+ function Nh(e) {
9803
9807
  e.on(Cu.UPDATED, () => {
9804
- T("tierlist", "Someone saved — refreshing the board"), gh(!1);
9808
+ T("tierlist", "Someone saved — refreshing the board"), yh(!1);
9805
9809
  });
9806
9810
  }
9807
- function Nh(e) {
9811
+ function Fh(e) {
9808
9812
  e.on(ni.STATE, (t) => {
9809
9813
  if (!t || typeof t.active != "boolean") return;
9810
9814
  const r = Array.isArray(t.ready) ? t.ready.filter((n) => typeof n == "string") : [];
9811
9815
  B.getState().setReadyCheckState({ active: t.active, ready: r }), T("ready-check", "State received", { active: t.active, readyCount: r.length });
9812
9816
  });
9813
9817
  }
9814
- function Hm() {
9818
+ function zm() {
9815
9819
  Y?.emit(ni.START, {});
9816
9820
  }
9817
- function zm(e) {
9821
+ function Vm(e) {
9818
9822
  Y?.emit(ni.TOGGLE, { ready: e });
9819
9823
  }
9820
- function Fh(e) {
9824
+ function Uh(e) {
9821
9825
  e.on(ct.ACTIVE, (t) => {
9822
9826
  const r = typeof t?.gameId == "string" ? t.gameId : null;
9823
9827
  B.getState().setActiveGameId(r), t?.sessionWins && typeof t.sessionWins == "object" ? B.getState().setGameSessionWins(t.sessionWins) : r === null && B.getState().setGameSessionWins({}), typeof t?.botCount == "number" ? B.getState().setGameBotCount(t.botCount) : r === null && B.getState().setGameBotCount(0), T("game", "game_active", { gameId: r, sessionWins: t?.sessionWins, botCount: t?.botCount });
9824
9828
  });
9825
9829
  }
9826
- function Vm(e) {
9830
+ function qm(e) {
9827
9831
  Y?.emit(ct.SELECT, { gameId: e });
9828
9832
  }
9829
- function qm(e) {
9833
+ function Wm(e) {
9830
9834
  Y?.emit(ct.START_REQUEST, { gameId: e });
9831
9835
  }
9832
- function Wm() {
9836
+ function Km() {
9833
9837
  Y?.emit(ct.COUNTDOWN_REQUEST);
9834
9838
  }
9835
- function Km() {
9839
+ function Gm() {
9836
9840
  Y?.emit(ct.SYNC);
9837
9841
  }
9838
- function Gm(e) {
9842
+ function Ym(e) {
9839
9843
  Y?.emit(ct.SET_BOTS, { count: e });
9840
9844
  }
9841
- function Ym() {
9845
+ function Jm() {
9842
9846
  Y?.emit(ct.SESSION_RESET);
9843
9847
  }
9844
- function Uh(e) {
9848
+ function Bh(e) {
9845
9849
  e.on(te.HEALTH_SNAPSHOT, (t) => {
9846
9850
  B.getState().setHealthSnapshot(t);
9847
9851
  }), e.on(te.BUFFER_STATUS, (t) => {
9848
9852
  B.getState().setBufferStatus(t);
9849
9853
  });
9850
9854
  }
9851
- function Bh(e) {
9852
- Oh(e), Ih(e), Lh(e), Uh(e), Mh(e), Dh(e), Nh(e), Fh(e), e.on(te.ERROR, (t) => {
9855
+ function jh(e) {
9856
+ Ih(e), Lh(e), Mh(e), Bh(e), Dh(e), Nh(e), Fh(e), Uh(e), e.on(te.ERROR, (t) => {
9853
9857
  const r = t?.code || "error/unknown";
9854
9858
  if (r === "conflict" && t?.message === "sprite_held_by_you") {
9855
9859
  yi = !0, T("socket", "sprite held by this account's other connection: keeping the server-assigned sprite");
9856
9860
  return;
9857
9861
  }
9858
9862
  if (r === "conflict" && t?.message === "sprite_taken") {
9859
- if (vh(Y?.id)) {
9863
+ if (bh(Y?.id)) {
9860
9864
  T("socket", "sprite_taken: stale, the server already has our sprite");
9861
9865
  return;
9862
9866
  }
9863
9867
  Hn = !0;
9864
9868
  let a;
9865
9869
  try {
9866
- a = yh();
9870
+ a = vh();
9867
9871
  } finally {
9868
9872
  Hn = !1;
9869
9873
  }
@@ -9894,15 +9898,15 @@ function Bh(e) {
9894
9898
  (r.startsWith("auth/") ? ie : Ze)("socket", `Server error: ${i}`, { code: r, raw: t }), B.getState().pushToast("error", i);
9895
9899
  });
9896
9900
  }
9897
- function Jm(e, t) {
9901
+ function Xm(e, t) {
9898
9902
  Oe().emit(te.CHAT_SEND, t?.length ? { text: e, images: t } : { text: e });
9899
9903
  }
9900
- function jh() {
9904
+ function $h() {
9901
9905
  Me || (Me = { ts: Date.now() }, Oe().emit(te.TIME_PING, {}), De = setTimeout(() => {
9902
9906
  Me && (T("socket", "Time ping timed out after 10s, clearing inflight"), Me = null), De = null;
9903
9907
  }, 1e4));
9904
9908
  }
9905
- function Xm(e, t) {
9909
+ function Qm(e, t) {
9906
9910
  const r = {};
9907
9911
  e && (r.name = e), t && (r.sprite = t), !(!r.name && !r.sprite) && (T("socket", "Sending identity update", r), Oe().emit(te.IDENTITY_UPDATE, r));
9908
9912
  }
@@ -9918,14 +9922,14 @@ B.subscribe((e, t) => {
9918
9922
  const a = {};
9919
9923
  i && (a.name = e.name, Cr.name = e.name), o && (a.sprite = e.sprite, Cr.sprite = e.sprite), T("socket", "Identity reassert (store change)", a), Y?.connected ? Y.emit(te.IDENTITY_UPDATE, a) : Oe().emit(te.IDENTITY_UPDATE, a);
9920
9924
  });
9921
- function $h() {
9925
+ function Hh() {
9922
9926
  jr && (clearInterval(jr), jr = null), De && (clearTimeout(De), De = null), Me = null, gt.unansweredSince = null, gt.lastTickAt = null;
9923
9927
  }
9924
- function Hh() {
9928
+ function zh() {
9925
9929
  T("socket", "clearJoinState called", { hadPayload: et !== null, room_key: et?.room_key }), et = null, Vt = !1, vi = null;
9926
9930
  }
9927
- function zh() {
9928
- T("socket", "leaveRoom called", { room_key: et?.room_key }), Hh(), $h(), Y && (Y.disconnect(), Y = null), B.setState({
9931
+ function Vh() {
9932
+ T("socket", "leaveRoom called", { room_key: et?.room_key }), zh(), Hh(), Y && (Y.disconnect(), Y = null), B.setState({
9929
9933
  me: { clientId: null, nextClientSeq: 1 },
9930
9934
  roster: {},
9931
9935
  snapshot: { roomId: null, mediaId: null, playheadMs: 0, playing: !1, serverSeq: 0, leaderId: null },
@@ -9941,48 +9945,48 @@ function zh() {
9941
9945
  gameSessionWins: {}
9942
9946
  });
9943
9947
  }
9944
- function Qm(e) {
9948
+ function Zm(e) {
9945
9949
  T("playlist", "Emitting playlist_load", { playlistId: e }), Oe().emit(Qe.LOAD, { playlistId: e });
9946
9950
  }
9947
- function Zm(e) {
9951
+ function ep(e) {
9948
9952
  T("playlist", "Emitting playlist_select", { index: e }), Oe().emit(Qe.SELECT, { index: e });
9949
9953
  }
9950
- function ep(e, t, r) {
9954
+ function tp(e, t, r) {
9951
9955
  T("playlist", "Emitting playlist_vote_update", { playlistId: e, mediaId: t, vote: r }), Oe().emit(Qe.VOTE_UPDATE, { playlistId: e, mediaId: t, vote: r });
9952
9956
  }
9953
- function tp() {
9957
+ function rp() {
9954
9958
  T("chat", "Emitting recap_request"), Oe().emit("recap_request");
9955
9959
  }
9956
- function rp() {
9960
+ function np() {
9957
9961
  T("playlist", "Emitting playlist_reveal_request"), Oe().emit(Qe.REVEAL_REQUEST, {});
9958
9962
  }
9959
- function np(e) {
9963
+ function ip(e) {
9960
9964
  T("playlist", "Emitting playlist_vote_remove", { voterKey: e }), Oe().emit(Qe.VOTE_REMOVE, { voterKey: e });
9961
9965
  }
9962
- function ip(e) {
9966
+ function op(e) {
9963
9967
  vi = e, Oe().emit(te.CLIENT_READY, { media_id: e }), T("socket", "client_ready emitted", { mediaId: e });
9964
9968
  }
9965
- function Vh(e) {
9969
+ function qh(e) {
9966
9970
  if (!e || e === "/" || document.querySelector(`link[rel="preconnect"][href="${e}"]`)) return;
9967
9971
  const t = document.createElement("link");
9968
9972
  t.rel = "preconnect", t.href = e, t.crossOrigin = "anonymous", document.head.appendChild(t);
9969
9973
  }
9970
- function qh(e, t, r) {
9974
+ function Wh(e, t, r) {
9971
9975
  const n = Ps(e), i = r ? /* @__PURE__ */ U(Xe.StrictMode, { children: t }) : t;
9972
9976
  return n.render(i), n;
9973
9977
  }
9974
9978
  let Ct = null, At = null;
9975
9979
  const gs = import.meta.url.replace(/[^/]*$/, "");
9976
- function Wh(e) {
9980
+ function Kh(e) {
9977
9981
  return !e.filename || !e.filename.startsWith(gs) ? !1 : !/^ResizeObserver loop/.test(e.message ?? "");
9978
9982
  }
9979
- function op(e, t = {}) {
9983
+ function ap(e, t = {}) {
9980
9984
  const { basename: r, strictMode: n = !1, ...i } = t;
9981
- fd(), ld({
9985
+ hd(), cd({
9982
9986
  serverOrigin: i.serverOrigin,
9983
9987
  defaultRoomKey: i.defaultRoomKey,
9984
9988
  cdnBase: i.cdnBase
9985
- }), bf(), kd({
9989
+ }), wf(), Pd({
9986
9990
  userType: i.userType,
9987
9991
  userId: i.userId
9988
9992
  }), B.getState().rehydrateFromPrefs();
@@ -10001,139 +10005,139 @@ function op(e, t = {}) {
10001
10005
  } catch (f) {
10002
10006
  ie("boot", "prefs.beacon.threw", { err: f?.message });
10003
10007
  }
10004
- Id(), Ud().then((f) => {
10008
+ Ld(), Bd().then((f) => {
10005
10009
  f && B.getState().rehydrateFromPrefs();
10006
10010
  }), Ct || (Ct = (f) => {
10007
10011
  Ze("app", "Unhandled promise rejection", { reason: String(f.reason) });
10008
10012
  }, window.addEventListener("unhandledrejection", Ct)), At || (At = (f) => {
10009
- Wh(f) && Ze("app", "Uncaught error", {
10013
+ Kh(f) && Ze("app", "Uncaught error", {
10010
10014
  message: f.message,
10011
10015
  source: `${f.filename.slice(gs.length)}:${f.lineno}:${f.colno}`,
10012
10016
  stack: f.error instanceof Error ? f.error.stack?.slice(0, 1500) : void 0
10013
10017
  });
10014
- }, window.addEventListener("error", At)), i.serverOrigin && Vh(i.serverOrigin);
10018
+ }, window.addEventListener("error", At)), i.serverOrigin && qh(i.serverOrigin);
10015
10019
  const o = li().theme;
10016
- o && Ls.includes(o) && Ms(o), xd(), e.__watchparty?.root.unmount();
10017
- const s = vf({
10020
+ o && Ls.includes(o) && Ms(o), kd(), e.__watchparty?.root.unmount();
10021
+ const s = bf({
10018
10022
  basename: r,
10019
10023
  appProps: i
10020
- }), u = { root: qh(e, /* @__PURE__ */ U(lu, { router: s }), n) };
10024
+ }), u = { root: Wh(e, /* @__PURE__ */ U(lu, { router: s }), n) };
10021
10025
  return e.__watchparty = u, s;
10022
10026
  }
10023
- function ap(e) {
10027
+ function sp(e) {
10024
10028
  const t = e.__watchparty;
10025
- t && (t.root.unmount(), delete e.__watchparty, zh(), Ct && (window.removeEventListener("unhandledrejection", Ct), Ct = null), At && (window.removeEventListener("error", At), At = null));
10029
+ t && (t.root.unmount(), delete e.__watchparty, Vh(), Ct && (window.removeEventListener("unhandledrejection", Ct), Ct = null), At && (window.removeEventListener("error", At), At = null));
10026
10030
  }
10027
10031
  export {
10028
- pm as $,
10029
- li as A,
10030
- go as B,
10032
+ ym as $,
10033
+ zu as A,
10034
+ li as B,
10031
10035
  Ae as C,
10032
10036
  ti as D,
10033
- tn as E,
10034
- Vm as F,
10035
- cm as G,
10036
- lm as H,
10037
- Zr as I,
10038
- zm as J,
10039
- Hm as K,
10037
+ go as E,
10038
+ tn as F,
10039
+ qm as G,
10040
+ um as H,
10041
+ cm as I,
10042
+ Zr as J,
10043
+ Vm as K,
10040
10044
  Hr as L,
10041
10045
  vn as M,
10042
- sm as N,
10043
- gh as O,
10044
- Bm as P,
10045
- ph as Q,
10046
- vt as R,
10047
- Rm as S,
10048
- nm as T,
10049
- Oe as U,
10050
- te as V,
10051
- am as W,
10052
- mm as X,
10053
- Mm as Y,
10054
- Lm as Z,
10055
- gm as _,
10056
- Cm as a,
10057
- dm as a0,
10058
- om as a1,
10059
- wm as a2,
10060
- vm as a3,
10046
+ zm as N,
10047
+ lm as O,
10048
+ yh as P,
10049
+ jm as Q,
10050
+ gh as R,
10051
+ Tm as S,
10052
+ im as T,
10053
+ vt as U,
10054
+ Oe as V,
10055
+ te as W,
10056
+ sm as X,
10057
+ pm as Y,
10058
+ Dm as Z,
10059
+ Mm as _,
10060
+ Am as a,
10061
+ gm as a0,
10062
+ fm as a1,
10063
+ am as a2,
10064
+ _m as a3,
10061
10065
  bm as a4,
10062
- ym as a5,
10063
- km as a6,
10064
- rm as a7,
10065
- $m as a8,
10066
- sf as a9,
10067
- im as aA,
10066
+ wm as a5,
10067
+ vm as a6,
10068
+ Pm as a7,
10069
+ nm as a8,
10070
+ Hm as a9,
10071
+ om as aA,
10068
10072
  ai as aB,
10069
10073
  ct as aC,
10070
- Gm as aD,
10071
- em as aE,
10072
- Wm as aF,
10073
- qm as aG,
10074
- Km as aH,
10075
- Ym as aI,
10074
+ Ym as aD,
10075
+ tm as aE,
10076
+ Km as aF,
10077
+ Wm as aG,
10078
+ Gm as aH,
10079
+ Jm as aI,
10076
10080
  Ne as aJ,
10077
- Im as aK,
10078
- np as aL,
10081
+ Lm as aK,
10082
+ ip as aL,
10079
10083
  Pt as aM,
10080
- Od as aN,
10081
- ep as aO,
10082
- rp as aP,
10083
- Zm as aQ,
10084
- op as aR,
10085
- ap as aS,
10086
- vf as aT,
10087
- cd as aa,
10088
- On as ab,
10089
- um as ac,
10090
- fm as ad,
10091
- Zh as ae,
10092
- Fm as af,
10093
- _m as ag,
10094
- mh as ah,
10095
- Iu as ai,
10096
- hm as aj,
10097
- ip as ak,
10098
- Da as al,
10099
- kt as am,
10100
- Ya as an,
10101
- ic as ao,
10102
- xd as ap,
10103
- Ud as aq,
10104
- jm as ar,
10105
- Ln as as,
10106
- Em as at,
10084
+ Id as aN,
10085
+ tp as aO,
10086
+ np as aP,
10087
+ ep as aQ,
10088
+ ap as aR,
10089
+ sp as aS,
10090
+ bf as aT,
10091
+ lf as aa,
10092
+ ud as ab,
10093
+ On as ac,
10094
+ dm as ad,
10095
+ hm as ae,
10096
+ em as af,
10097
+ Um as ag,
10098
+ Em as ah,
10099
+ ph as ai,
10100
+ Lu as aj,
10101
+ mm as ak,
10102
+ op as al,
10103
+ Da as am,
10104
+ kt as an,
10105
+ Ya as ao,
10106
+ ic as ap,
10107
+ kd as aq,
10108
+ Bd as ar,
10109
+ $m as as,
10110
+ Ln as at,
10107
10111
  Sm as au,
10108
- Qm as av,
10109
- Om as aw,
10110
- Pm as ax,
10111
- Vr as ay,
10112
- Xm as az,
10112
+ Rm as av,
10113
+ Zm as aw,
10114
+ Im as ax,
10115
+ Om as ay,
10116
+ Vr as az,
10113
10117
  Kt as b,
10114
- sd as c,
10118
+ ld as c,
10115
10119
  T as d,
10116
10120
  Ze as e,
10117
- Tm as f,
10121
+ Cm as f,
10118
10122
  Xr as g,
10119
10123
  B as h,
10120
10124
  va as i,
10121
- Ad as j,
10125
+ xd as j,
10122
10126
  Oa as k,
10123
10127
  Ta as l,
10124
- Am as m,
10125
- Um as n,
10126
- tp as o,
10127
- Jm as p,
10128
- tm as q,
10129
- xm as r,
10128
+ xm as m,
10129
+ Bm as n,
10130
+ rp as o,
10131
+ Xm as p,
10132
+ rm as q,
10133
+ km as r,
10130
10134
  Ha as s,
10131
10135
  mu as t,
10132
10136
  rc as u,
10133
- Dm as v,
10137
+ Nm as v,
10134
10138
  ie as w,
10135
- zh as x,
10136
- Qa as y,
10137
- Hu as z
10139
+ Vh as x,
10140
+ Qm as y,
10141
+ Qa as z
10138
10142
  };
10139
- //# sourceMappingURL=index-Cr81q-86.js.map
10143
+ //# sourceMappingURL=index-CFH_9amZ.js.map