@hadoku/watchparty-ui 0.44.16 → 0.44.19

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 (23) hide show
  1. package/dist/chunks/{AdminPanel-CJtacvRu.js → AdminPanel-x_k_Hefb.js} +12 -12
  2. package/dist/chunks/{AdminPanel-CJtacvRu.js.map → AdminPanel-x_k_Hefb.js.map} +1 -1
  3. package/dist/chunks/{GameModule-BvqNQcVk.js → GameModule-D71uhFdW.js} +19 -19
  4. package/dist/chunks/{GameModule-BvqNQcVk.js.map → GameModule-D71uhFdW.js.map} +1 -1
  5. package/dist/chunks/{MapEditor-Bc0_hjZQ.js → MapEditor-gB0UYuFm.js} +2 -2
  6. package/dist/chunks/{MapEditor-Bc0_hjZQ.js.map → MapEditor-gB0UYuFm.js.map} +1 -1
  7. package/dist/chunks/{MediaDrawer-CgoGUHwV.js → MediaDrawer-DYNPH01V.js} +51 -51
  8. package/dist/chunks/{MediaDrawer-CgoGUHwV.js.map → MediaDrawer-DYNPH01V.js.map} +1 -1
  9. package/dist/chunks/{PlaylistPanel-BmKnGMqa.js → PlaylistPanel-CYNImBh_.js} +20 -20
  10. package/dist/chunks/{PlaylistPanel-BmKnGMqa.js.map → PlaylistPanel-CYNImBh_.js.map} +1 -1
  11. package/dist/chunks/{Room-CoE8L9aw.js → Room-C1DWAuT8.js} +464 -459
  12. package/dist/chunks/Room-C1DWAuT8.js.map +1 -0
  13. package/dist/chunks/{index-Buah62TP.js → index-DWgUNApo.js} +1295 -1319
  14. package/dist/chunks/index-DWgUNApo.js.map +1 -0
  15. package/dist/chunks/{submissionsApi-DXsG0ItW.js → submissionsApi-D9R81t17.js} +21 -21
  16. package/dist/chunks/{submissionsApi-DXsG0ItW.js.map → submissionsApi-D9R81t17.js.map} +1 -1
  17. package/dist/index.js +1 -1
  18. package/dist/room-chrome.css +1 -1
  19. package/dist/room-chrome.js +644 -658
  20. package/dist/room-chrome.js.map +1 -1
  21. package/package.json +4 -4
  22. package/dist/chunks/Room-CoE8L9aw.js.map +0 -1
  23. package/dist/chunks/index-Buah62TP.js.map +0 -1
@@ -1,8 +1,8 @@
1
1
  import { jsxs as u, jsx as a, Fragment as j } from "react/jsx-runtime";
2
2
  import { useState as x, useEffect as D, useRef as ce, useMemo as ke, useCallback as Se } from "react";
3
- import { g as K, aA as Y, d as A, ap as Fe, w as q, _ as Q, aB as Be, aC as De, h as se, v as Oe, I as Ce, aD as Pe } from "./index-Buah62TP.js";
4
- import { D as $e, a as ae, u as Ge, s as je, b as qe } from "./Room-CoE8L9aw.js";
5
- import { s as Ee, a as W, g as ue, f as He, b as pe, h as Ve, u as We, c as ze, e as Ye, d as Je, i as Ke, j as Qe, k as Xe } from "./submissionsApi-DXsG0ItW.js";
3
+ import { g as K, ay as Y, d as A, an as Fe, w as q, Y as Q, az as Be, aA as De, h as se, t as Oe, G as Ce, aB as Pe } from "./index-DWgUNApo.js";
4
+ import { D as $e, a as ae, u as Ge, s as je, b as qe } from "./Room-C1DWAuT8.js";
5
+ import { s as Ee, a as V, g as ue, f as He, b as pe, h as ze, u as Ve, c as We, e as Ye, d as Je, i as Ke, j as Qe, k as Xe } from "./submissionsApi-D9R81t17.js";
6
6
  import { Icon as re } from "@wolffm/themes";
7
7
  import { b as Ze } from "./cover-AUIrlUMF.js";
8
8
  const ne = /* @__PURE__ */ new Map(), Z = /* @__PURE__ */ new Map(), et = 6e4;
@@ -86,13 +86,13 @@ function he(e, r, t, l) {
86
86
  });
87
87
  }
88
88
  const lt = "Anime";
89
- function z(e) {
89
+ function W(e) {
90
90
  return e === lt;
91
91
  }
92
92
  function ot(e, r, t) {
93
93
  return e.map(
94
94
  (l) => t(
95
- { ...l, expanded: z(l.name) },
95
+ { ...l, expanded: W(l.name) },
96
96
  r(l).map((o) => ({ ...o, expanded: !1 }))
97
97
  )
98
98
  );
@@ -121,10 +121,10 @@ async function ye(e) {
121
121
  const v = [];
122
122
  for (const f of l[y])
123
123
  f && (c.key === "anime" && it(f.name) ? i.push(f) : v.push(f));
124
- v.length && o.push({ type: "category", name: c.label, series: v, expanded: z(c.label) });
124
+ v.length && o.push({ type: "category", name: c.label, series: v, expanded: W(c.label) });
125
125
  });
126
126
  const p = (t?.dirs ?? []).map((c) => ({ type: "playlist", name: c.name, playlistId: c.name }));
127
- return p.length && o.push({ type: "playlist_category", name: "Playlists", playlists: p, expanded: z("Playlists") }), i.length && o.push({ type: "category", name: "Ecchi", series: i, expanded: z("Ecchi") }), o;
127
+ return p.length && o.push({ type: "playlist_category", name: "Playlists", playlists: p, expanded: W("Playlists") }), i.length && o.push({ type: "category", name: "Ecchi", series: i, expanded: W("Ecchi") }), o;
128
128
  }
129
129
  const dt = /^(?:https?|magnet):/i;
130
130
  function Ae(e) {
@@ -192,15 +192,15 @@ function ft({ query: e, onSubmitted: r }) {
192
192
  const m = await mt(d.source, d.id);
193
193
  v((S) => ({ ...S, [N]: m.ok || m.code === "exists" ? "added" : `error ${m.status}` }));
194
194
  }
195
- async function L(d) {
195
+ async function R(d) {
196
196
  const N = `yt:${d.id}`;
197
197
  v((S) => ({ ...S, [N]: "adding" }));
198
198
  const m = await Ee(d.url, d.title);
199
- m.ok ? (v((S) => ({ ...S, [N]: "added" })), r(m.value)) : v((S) => ({ ...S, [N]: W(m.failure) }));
199
+ m.ok ? (v((S) => ({ ...S, [N]: "added" })), r(m.value)) : v((S) => ({ ...S, [N]: V(m.failure) }));
200
200
  }
201
- const T = f?.ok && $?.ok && f.value.length === 0 && $.value.length === 0;
201
+ const _ = f?.ok && $?.ok && f.value.length === 0 && $.value.length === 0;
202
202
  return /* @__PURE__ */ u("div", { className: "border-b border-border", "data-testid": "media-search", children: [
203
- T && /* @__PURE__ */ a("div", { className: "px-3 py-2 text-[11px] text-text-muted", children: "no results" }),
203
+ _ && /* @__PURE__ */ a("div", { className: "px-3 py-2 text-[11px] text-text-muted", children: "no results" }),
204
204
  /* @__PURE__ */ a(we, { label: "Shows", answer: f, testId: "search-shows", children: f?.ok && f.value.map((d) => {
205
205
  const N = `${d.source}:${d.id}`, m = d.onWatchlist ? "added" : y[N];
206
206
  return /* @__PURE__ */ a(
@@ -233,7 +233,7 @@ function ft({ query: e, onSubmitted: r }) {
233
233
  canAdd: !0,
234
234
  addLabel: `Request ${d.title}`,
235
235
  onAdd: () => {
236
- L(d);
236
+ R(d);
237
237
  }
238
238
  },
239
239
  d.id
@@ -301,7 +301,7 @@ function xt({ item: e }) {
301
301
  );
302
302
  }
303
303
  function yt({ open: e, onClose: r }) {
304
- const [t, l] = x(""), [o, i] = x(""), [p, c] = x(""), [y, v] = x(!1), [f, $] = x([]), [M, L] = x(!1), [T, d] = x(null), [N, m] = x(null), [S, H] = x(null), [_, V] = x(null), [R, O] = x(null), [U, n] = x(!1), [h, g] = x(null), [b, k] = x(null), E = ce(null), P = ce(!1), F = ke(() => ue(t), [t]) === "magnet" && t.trim().length > 0, ie = Ae(t), B = Se(async () => {
304
+ const [t, l] = x(""), [o, i] = x(""), [p, c] = x(""), [y, v] = x(!1), [f, $] = x([]), [M, R] = x(!1), [_, d] = x(null), [N, m] = x(null), [S, H] = x(null), [L, z] = x(null), [T, O] = x(null), [U, n] = x(!1), [h, g] = x(null), [b, k] = x(null), E = ce(null), P = ce(!1), F = ke(() => ue(t), [t]) === "magnet" && t.trim().length > 0, ie = Ae(t), B = Se(async () => {
305
305
  const s = await He();
306
306
  P.current && (s.ok ? (m(s.value), H(null)) : H(s.failure));
307
307
  }, []);
@@ -318,7 +318,7 @@ function yt({ open: e, onClose: r }) {
318
318
  if (!e) return;
319
319
  let s = !0;
320
320
  return pe().then((w) => {
321
- s && w.ok && V(w.value);
321
+ s && w.ok && z(w.value);
322
322
  }), () => {
323
323
  s = !1;
324
324
  };
@@ -332,66 +332,66 @@ function yt({ open: e, onClose: r }) {
332
332
  s = !1;
333
333
  };
334
334
  }, [e]);
335
- function _e(s) {
335
+ function Le(s) {
336
336
  if (l(s), ue(s) === "magnet" && s.trim().length > 0 && !y) {
337
337
  const C = Ye(s);
338
338
  C && c(C);
339
339
  }
340
340
  }
341
- function Le() {
341
+ function Re() {
342
342
  l(""), i(""), c(""), v(!1);
343
343
  }
344
- const le = !F || o.trim().length > 0 && Ve(p);
344
+ const le = !F || o.trim().length > 0 && ze(p);
345
345
  async function oe() {
346
346
  const s = t.trim();
347
347
  if (!s || M || ie || F && !le) return;
348
- L(!0), d(null);
348
+ R(!0), d(null);
349
349
  const w = F ? await Je(s, { title: p.trim() || void 0, series: o.trim() }) : await Ee(s);
350
- if (L(!1), !w.ok) {
350
+ if (R(!1), !w.ok) {
351
351
  d(w.failure);
352
352
  return;
353
353
  }
354
- A("submissions", "Submit accepted", { id: w.value.id, state: w.value.state }), Le(), m((C) => [w.value, ...(C ?? []).filter((I) => I.id !== w.value.id)]), B();
354
+ A("submissions", "Submit accepted", { id: w.value.id, state: w.value.state }), Re(), m((C) => [w.value, ...(C ?? []).filter((I) => I.id !== w.value.id)]), B();
355
355
  }
356
- function Re(s) {
356
+ function Te(s) {
357
357
  const w = s.target.files?.[0] ?? null;
358
- if (k(null), w && _ && w.size > _.maxBytes) {
359
- O(null), k({ code: "too_large", maxBytes: _.maxBytes }), E.current && (E.current.value = "");
358
+ if (k(null), w && L && w.size > L.maxBytes) {
359
+ O(null), k({ code: "too_large", maxBytes: L.maxBytes }), E.current && (E.current.value = "");
360
360
  return;
361
361
  }
362
362
  O(w);
363
363
  }
364
- async function Te() {
365
- if (!R || U) return;
364
+ async function _e() {
365
+ if (!T || U) return;
366
366
  n(!0), k(null);
367
- let s = _;
367
+ let s = L;
368
368
  if (!s) {
369
369
  const I = await pe();
370
370
  if (!I.ok) {
371
371
  n(!1), k(I.failure);
372
372
  return;
373
373
  }
374
- s = I.value, V(s);
374
+ s = I.value, z(s);
375
375
  }
376
- if (R.size > s.maxBytes) {
376
+ if (T.size > s.maxBytes) {
377
377
  n(!1), k({ code: "too_large", maxBytes: s.maxBytes });
378
378
  return;
379
379
  }
380
- const w = await Ke(R, s, (I, X, Ue) => {
380
+ const w = await Ke(T, s, (I, X, Ue) => {
381
381
  g({ sent: I, total: X, phase: Ue });
382
382
  });
383
383
  if (!w.ok) {
384
384
  n(!1), g(null), k(w.failure);
385
385
  return;
386
386
  }
387
- const C = await Qe(w.value.fileId, R.name);
387
+ const C = await Qe(w.value.fileId, T.name);
388
388
  if (n(!1), g(null), !C.ok) {
389
389
  k(C.failure);
390
390
  return;
391
391
  }
392
392
  A("submissions", "Upload accepted", { id: C.value.id }), O(null), E.current && (E.current.value = ""), m((I) => [C.value, ...(I ?? []).filter((X) => X.id !== C.value.id)]), B();
393
393
  }
394
- const de = b ? "maxBytes" in b || b.code === "target_unavailable" || b.code === "upload_failed" ? We(b) : W(b) : null;
394
+ const de = b ? "maxBytes" in b || b.code === "target_unavailable" || b.code === "upload_failed" ? Ve(b) : V(b) : null;
395
395
  return /* @__PURE__ */ u(
396
396
  $e,
397
397
  {
@@ -417,7 +417,7 @@ function yt({ open: e, onClose: r }) {
417
417
  "input",
418
418
  {
419
419
  value: t,
420
- onChange: (s) => _e(s.target.value),
420
+ onChange: (s) => Le(s.target.value),
421
421
  onKeyDown: (s) => {
422
422
  s.key === "Enter" && !F && oe();
423
423
  },
@@ -465,7 +465,7 @@ function yt({ open: e, onClose: r }) {
465
465
  children: M ? "Submitting…" : "Submit"
466
466
  }
467
467
  ),
468
- T && /* @__PURE__ */ a("span", { "data-testid": "submit-failure", className: "text-[11px] bg-danger-bg text-on-danger-bg px-1.5 py-0.5 rounded", children: W(T) })
468
+ _ && /* @__PURE__ */ a("span", { "data-testid": "submit-failure", className: "text-[11px] bg-danger-bg text-on-danger-bg px-1.5 py-0.5 rounded", children: V(_) })
469
469
  ] })
470
470
  ] }),
471
471
  /* @__PURE__ */ a(
@@ -482,7 +482,7 @@ function yt({ open: e, onClose: r }) {
482
482
  {
483
483
  ref: E,
484
484
  type: "file",
485
- onChange: Re,
485
+ onChange: Te,
486
486
  "aria-label": "Upload file",
487
487
  className: "text-[11px] flex-1 min-w-0"
488
488
  }
@@ -491,20 +491,20 @@ function yt({ open: e, onClose: r }) {
491
491
  "button",
492
492
  {
493
493
  onClick: () => {
494
- Te();
494
+ _e();
495
495
  },
496
- disabled: !R || U,
496
+ disabled: !T || U,
497
497
  "aria-label": "Upload",
498
498
  className: "drawer-btn drawer-btn-primary",
499
499
  children: U ? h?.phase === "assembling" ? "Assembling…" : "Uploading…" : "Upload"
500
500
  }
501
501
  )
502
502
  ] }),
503
- /* @__PURE__ */ a("span", { className: "text-[10px] text-text-muted", "data-testid": "upload-cap", children: _ ? `cap ${ze(_.maxBytes)}` : "" }),
503
+ /* @__PURE__ */ a("span", { className: "text-[10px] text-text-muted", "data-testid": "upload-cap", children: L ? `cap ${We(L.maxBytes)}` : "" }),
504
504
  de && /* @__PURE__ */ a("span", { "data-testid": "upload-failure", className: "text-[11px] bg-danger-bg text-on-danger-bg px-1.5 py-0.5 rounded", children: de })
505
505
  ] }),
506
506
  /* @__PURE__ */ u("div", { className: "flex-1 overflow-auto", "data-testid": "my-submissions", children: [
507
- S && /* @__PURE__ */ a("div", { className: "mx-3 my-2 px-3 py-2 text-[11px] bg-danger-bg text-on-danger-bg rounded", children: W(S) }),
507
+ S && /* @__PURE__ */ a("div", { className: "mx-3 my-2 px-3 py-2 text-[11px] bg-danger-bg text-on-danger-bg rounded", children: V(S) }),
508
508
  N?.map((s) => /* @__PURE__ */ a(xt, { item: s }, s.id))
509
509
  ] })
510
510
  ]
@@ -554,8 +554,8 @@ function Nt({ onDone: e }) {
554
554
  }, className: "drawer-btn drawer-btn-danger ml-auto", children: "Stop game" }) : null;
555
555
  }
556
556
  const G = (e) => e.type === "category" ? e.series : [], te = (e, r) => e.type === "category" ? { ...e, series: r } : e;
557
- function _t({ open: e, onClose: r }) {
558
- const [t, l] = x(!1), [o, i] = x(null), [p, c] = x([]), [y, v] = x(""), [f, $] = x(!1), [M, L] = x("watch"), T = se((n) => n.snapshot.mediaId), d = Xe(), N = Se(async () => {
557
+ function Lt({ open: e, onClose: r }) {
558
+ const [t, l] = x(!1), [o, i] = x(null), [p, c] = x([]), [y, v] = x(""), [f, $] = x(!1), [M, R] = x("watch"), _ = se((n) => n.snapshot.mediaId), d = Xe(), N = Se(async () => {
559
559
  l(!0), i(null);
560
560
  try {
561
561
  const n = await ye(J);
@@ -578,7 +578,7 @@ function _t({ open: e, onClose: r }) {
578
578
  n = !1;
579
579
  };
580
580
  }, [m]), D(() => {
581
- e && (L("watch"), c((n) => ot(n, G, te)), N());
581
+ e && (R("watch"), c((n) => ot(n, G, te)), N());
582
582
  }, [e, N]);
583
583
  function S(n) {
584
584
  je(n), A("catalog", "control_load", { mediaId: n }), r();
@@ -586,13 +586,13 @@ function _t({ open: e, onClose: r }) {
586
586
  function H(n) {
587
587
  Pe(n), A("catalog", "playlist_load", { playlistId: n }), r();
588
588
  }
589
- function _() {
589
+ function L() {
590
590
  qe(), A("controls", "Unload media clicked (media drawer)"), r();
591
591
  }
592
- function V(n, h) {
592
+ function z(n, h) {
593
593
  c((g) => g.map((b, k) => k !== n || !("series" in b) ? b : { ...b, series: b.series.map((E, P) => P !== h ? E : { ...E, expanded: !E.expanded }) }));
594
594
  }
595
- function R(n) {
595
+ function T(n) {
596
596
  c((h) => h.map((g, b) => b !== n ? g : { ...g, expanded: !g.expanded }));
597
597
  }
598
598
  function O() {
@@ -626,7 +626,7 @@ function _t({ open: e, onClose: r }) {
626
626
  {
627
627
  role: "tab",
628
628
  "aria-selected": M === n,
629
- onClick: () => L(n),
629
+ onClick: () => R(n),
630
630
  className: "tl-tab",
631
631
  children: n === "watch" ? "Watch" : "Play"
632
632
  },
@@ -643,10 +643,10 @@ function _t({ open: e, onClose: r }) {
643
643
  children: "Add"
644
644
  }
645
645
  ),
646
- T && /* @__PURE__ */ a(
646
+ _ && /* @__PURE__ */ a(
647
647
  "button",
648
648
  {
649
- onClick: _,
649
+ onClick: L,
650
650
  title: "Unload the current media for everyone in the room",
651
651
  className: "drawer-btn drawer-btn-primary",
652
652
  children: "Unload"
@@ -671,7 +671,7 @@ function _t({ open: e, onClose: r }) {
671
671
  className: "flex items-center gap-2 cursor-pointer select-none group",
672
672
  "data-category": n.name,
673
673
  "data-expanded": n.expanded ? "true" : "false",
674
- onClick: () => R(h),
674
+ onClick: () => T(h),
675
675
  children: [
676
676
  /* @__PURE__ */ a("span", { className: "text-xs uppercase tracking-wider text-text-muted group-hover:text-text-secondary", children: n.name }),
677
677
  /* @__PURE__ */ a("span", { className: "text-[10px] opacity-50", children: n.expanded ? "−" : "+" })
@@ -687,7 +687,7 @@ function _t({ open: e, onClose: r }) {
687
687
  ] }),
688
688
  n.expanded && n.type === "category" && /* @__PURE__ */ u("div", { className: "mt-2 space-y-2", children: [
689
689
  n.series.map((g, b) => /* @__PURE__ */ u("div", { children: [
690
- /* @__PURE__ */ u("div", { className: "flex items-center gap-2 cursor-pointer text-text-secondary hover:text-text", onClick: () => V(h, b), children: [
690
+ /* @__PURE__ */ u("div", { className: "flex items-center gap-2 cursor-pointer text-text-secondary hover:text-text", onClick: () => z(h, b), children: [
691
691
  /* @__PURE__ */ a("span", { className: "text-xs font-medium", children: g.name }),
692
692
  /* @__PURE__ */ a("span", { className: "text-[10px] opacity-40", children: g.expanded ? "−" : "+" })
693
693
  ] }),
@@ -710,6 +710,6 @@ function _t({ open: e, onClose: r }) {
710
710
  ] });
711
711
  }
712
712
  export {
713
- _t as default
713
+ Lt as default
714
714
  };
715
- //# sourceMappingURL=MediaDrawer-CgoGUHwV.js.map
715
+ //# sourceMappingURL=MediaDrawer-DYNPH01V.js.map