@hadoku/watchparty-ui 0.45.3 → 0.45.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,69 +1,69 @@
1
1
  import { jsx as e, jsxs as i } from "react/jsx-runtime";
2
- import P, { useState as y, useEffect as _ } from "react";
3
- import { h as v, s as O, j as L, O as T, aN as D, aO as I, aP as C, aL as A, d as R, aQ as V, am as B, aR as U, U as W, aS as F, aD as j, aB as K } from "./index-HIbKUgoo.js";
4
- import { d as $, S as M } from "./Room-DleCsQL0.js";
5
- const z = 3e3, G = {
2
+ import L, { useState as N, useEffect as T, useEffectEvent as D } from "react";
3
+ import { h as f, s as R, j as A, O as B, aN as U, aO as O, aP as V, aL as W, d as j, aQ as E, am as F, aR as K, U as z, aS as G, aD as $, aB as q } from "./index-lPWsskGR.js";
4
+ import { d as P, S as _ } from "./Room-DMSh2z9X.js";
5
+ const H = 3e3, Q = {
6
6
  super_upvote: 4,
7
7
  upvote: 3,
8
8
  mid: 2,
9
9
  downvote: 1
10
- }, q = {
10
+ }, Y = {
11
11
  // Bigger than the other marks on purpose: a super-upvote is the strongest
12
12
  // vote and was the hardest to see (a 10px star under the avatar).
13
- super_upvote: { icon: /* @__PURE__ */ e(M, { className: "w-4 h-4" }), color: "bg-warning-bg text-on-warning-bg rounded" },
13
+ super_upvote: { icon: /* @__PURE__ */ e(_, { className: "w-4 h-4" }), color: "bg-warning-bg text-on-warning-bg rounded" },
14
14
  upvote: { icon: "▲", color: "bg-success-bg text-on-success-bg rounded px-0.5" },
15
15
  mid: { icon: "─", color: "text-text-secondary" },
16
16
  downvote: { icon: "▼", color: "bg-danger-bg text-on-danger-bg rounded px-0.5" }
17
17
  };
18
- function H(o) {
19
- const { playlist: a, votes: u } = o;
20
- return a.videos.map((l) => {
18
+ function J(a) {
19
+ const { playlist: o, votes: m } = a;
20
+ return o.videos.map((l) => {
21
21
  let c = 0, r = 0;
22
- for (const d of Object.values(u)) {
23
- const f = d[l.mediaId];
24
- f && (c += G[f], r++);
22
+ for (const d of Object.values(m)) {
23
+ const b = d[l.mediaId];
24
+ b && (c += Q[b], r++);
25
25
  }
26
- const h = r > 0 ? c / r : 0;
27
- return { video: l, avgScore: h, voterCount: r };
26
+ const p = r > 0 ? c / r : 0;
27
+ return { video: l, avgScore: p, voterCount: r };
28
28
  }).sort((l, c) => c.avgScore - l.avgScore);
29
29
  }
30
- function Q({ results: o, onClose: a }) {
31
- const u = v((s) => s.roster), l = $(), c = H(o), [r, h] = y(null);
32
- _(() => {
30
+ function X({ results: a, onClose: o }) {
31
+ const m = f((s) => s.roster), l = P(), c = J(a), [r, p] = N(null);
32
+ T(() => {
33
33
  if (!r) return;
34
- const s = setTimeout(() => h(null), z);
34
+ const s = setTimeout(() => p(null), H);
35
35
  return () => clearTimeout(s);
36
36
  }, [r]);
37
- const d = Object.keys(o.votes).filter(
38
- (s) => Object.keys(o.votes[s]).length > 0
39
- ), f = (s) => {
40
- const x = u[s]?.sprite ?? o.sprites?.[s];
41
- return T(x) ? x : void 0;
37
+ const d = Object.keys(a.votes).filter(
38
+ (s) => Object.keys(a.votes[s]).length > 0
39
+ ), b = (s) => {
40
+ const h = m[s]?.sprite ?? a.sprites?.[s];
41
+ return B(h) ? h : void 0;
42
42
  };
43
- function k(s) {
43
+ function I(s) {
44
44
  if (r !== s) {
45
- h(s);
45
+ p(s);
46
46
  return;
47
47
  }
48
- h(null), D(s);
48
+ p(null), U(s);
49
49
  }
50
50
  return /* @__PURE__ */ e(
51
51
  "div",
52
52
  {
53
53
  className: "fixed inset-0 bg-black/70 flex items-center justify-center z-50",
54
54
  onClick: (s) => {
55
- s.target === s.currentTarget && a();
55
+ s.target === s.currentTarget && o();
56
56
  },
57
57
  children: /* @__PURE__ */ i("div", { "data-testid": "reveal-popup", className: "bg-bg-card border border-border rounded-lg shadow-xl w-full max-w-2xl max-h-[80vh] flex flex-col mx-4", children: [
58
58
  /* @__PURE__ */ i("div", { className: "flex items-center justify-between px-4 py-3 border-b border-border shrink-0", children: [
59
59
  /* @__PURE__ */ i("h2", { className: "text-sm font-semibold text-text", children: [
60
- o.playlist.name,
60
+ a.playlist.name,
61
61
  " — Results"
62
62
  ] }),
63
63
  /* @__PURE__ */ e(
64
64
  "button",
65
65
  {
66
- onClick: a,
66
+ onClick: o,
67
67
  "aria-label": "Close results",
68
68
  className: "p-1 text-text-muted hover:text-text transition-colors cursor-pointer",
69
69
  children: /* @__PURE__ */ e("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /* @__PURE__ */ e("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M6 18L18 6M6 6l12 12" }) })
@@ -71,62 +71,62 @@ function Q({ results: o, onClose: a }) {
71
71
  )
72
72
  ] }),
73
73
  d.length > 0 && /* @__PURE__ */ e("div", { className: "flex flex-wrap items-center gap-1.5 px-4 py-2 border-b border-border shrink-0", children: d.map((s) => {
74
- const x = f(s);
74
+ const h = b(s);
75
75
  return /* @__PURE__ */ i("span", { className: "reveal-voter", children: [
76
- x ? /* @__PURE__ */ e("img", { src: O(x), alt: "", crossOrigin: "anonymous", className: "w-4 h-4 rounded-full object-cover" }) : /* @__PURE__ */ e("span", { className: "w-4 h-4 rounded-full bg-bg-alt" }),
77
- /* @__PURE__ */ e("span", { className: "text-xs text-text truncate max-w-[8rem]", children: o.names[s] || s }),
76
+ h ? /* @__PURE__ */ e("img", { src: R(h), alt: "", crossOrigin: "anonymous", className: "w-4 h-4 rounded-full object-cover" }) : /* @__PURE__ */ e("span", { className: "w-4 h-4 rounded-full bg-bg-alt" }),
77
+ /* @__PURE__ */ e("span", { className: "text-xs text-text truncate max-w-[8rem]", children: a.names[s] || s }),
78
78
  l && /* @__PURE__ */ e(
79
79
  "button",
80
80
  {
81
81
  type: "button",
82
82
  className: "reveal-voter-remove",
83
83
  "data-armed": r === s ? "" : void 0,
84
- onClick: () => k(s),
85
- "aria-label": `Remove ${o.names[s] || s}'s votes`,
86
- title: r === s ? "Click again to remove" : `Remove ${o.names[s] || s}'s votes`,
84
+ onClick: () => I(s),
85
+ "aria-label": `Remove ${a.names[s] || s}'s votes`,
86
+ title: r === s ? "Click again to remove" : `Remove ${a.names[s] || s}'s votes`,
87
87
  children: r === s ? "remove?" : "✕"
88
88
  }
89
89
  )
90
90
  ] }, s);
91
91
  }) }),
92
- /* @__PURE__ */ e("div", { className: "overflow-y-auto flex-1 py-1", children: c.map(({ video: s, avgScore: x, voterCount: S }, w) => /* @__PURE__ */ i(
92
+ /* @__PURE__ */ e("div", { className: "overflow-y-auto flex-1 py-1", children: c.map(({ video: s, avgScore: h, voterCount: C }, y) => /* @__PURE__ */ i(
93
93
  "div",
94
94
  {
95
- className: `flex items-center gap-3 px-4 py-2 ${w % 2 === 0 ? "" : "bg-bg-alt/20"}`,
95
+ className: `flex items-center gap-3 px-4 py-2 ${y % 2 === 0 ? "" : "bg-bg-alt/20"}`,
96
96
  children: [
97
- /* @__PURE__ */ e("span", { className: "text-xs text-text-muted w-5 shrink-0 text-right", children: w + 1 }),
97
+ /* @__PURE__ */ e("span", { className: "text-xs text-text-muted w-5 shrink-0 text-right", children: y + 1 }),
98
98
  /* @__PURE__ */ e("span", { className: "text-xs text-text truncate flex-1 min-w-0", children: s.displayName }),
99
99
  /* @__PURE__ */ i("div", { className: "flex items-center gap-1.5 shrink-0", children: [
100
- d.map((t) => {
101
- const n = o.votes[t]?.[s.mediaId];
102
- if (!n) return null;
103
- const m = f(t), p = q[n], b = L(m ?? null);
100
+ d.map((x) => {
101
+ const w = a.votes[x]?.[s.mediaId];
102
+ if (!w) return null;
103
+ const t = b(x), n = Y[w], u = A(t ?? null);
104
104
  return /* @__PURE__ */ i("div", { className: "flex flex-col items-center gap-0.5", children: [
105
- /* @__PURE__ */ e("div", { className: "relative w-6 h-6 shrink-0", children: m ? /* @__PURE__ */ e(
105
+ /* @__PURE__ */ e("div", { className: "relative w-6 h-6 shrink-0", children: t ? /* @__PURE__ */ e(
106
106
  "img",
107
107
  {
108
- src: O(m),
109
- alt: o.names[t] || t,
108
+ src: R(t),
109
+ alt: a.names[x] || x,
110
110
  crossOrigin: "anonymous",
111
111
  className: "w-6 h-6 rounded-full object-cover",
112
- style: { border: `1.5px solid ${b}` }
112
+ style: { border: `1.5px solid ${u}` }
113
113
  }
114
114
  ) : /* @__PURE__ */ e(
115
115
  "div",
116
116
  {
117
117
  className: "w-6 h-6 rounded-full bg-bg-alt",
118
- style: { border: `1.5px solid ${b}` }
118
+ style: { border: `1.5px solid ${u}` }
119
119
  }
120
120
  ) }),
121
- /* @__PURE__ */ e("span", { className: `text-[9px] leading-none font-bold ${p.color}`, children: p.icon })
122
- ] }, t);
121
+ /* @__PURE__ */ e("span", { className: `text-[9px] leading-none font-bold ${n.color}`, children: n.icon })
122
+ ] }, x);
123
123
  }),
124
- d.map((t) => o.votes[t]?.[s.mediaId] ? null : /* @__PURE__ */ i("div", { className: "flex flex-col items-center gap-0.5 opacity-20", children: [
124
+ d.map((x) => a.votes[x]?.[s.mediaId] ? null : /* @__PURE__ */ i("div", { className: "flex flex-col items-center gap-0.5 opacity-20", children: [
125
125
  /* @__PURE__ */ e("div", { className: "w-6 h-6 rounded-full bg-bg-alt border border-border" }),
126
126
  /* @__PURE__ */ e("span", { className: "text-[9px] leading-none text-text-muted", children: "·" })
127
- ] }, `no-${t}`))
127
+ ] }, `no-${x}`))
128
128
  ] }),
129
- /* @__PURE__ */ e("span", { className: "text-xs text-text-secondary w-8 text-right shrink-0 font-medium", children: S > 0 ? x.toFixed(1) : "—" })
129
+ /* @__PURE__ */ e("span", { className: "text-xs text-text-secondary w-8 text-right shrink-0 font-medium", children: C > 0 ? h.toFixed(1) : "—" })
130
130
  ]
131
131
  },
132
132
  s.mediaId
@@ -135,29 +135,29 @@ function Q({ results: o, onClose: a }) {
135
135
  }
136
136
  );
137
137
  }
138
- function Y() {
138
+ function Z() {
139
139
  return /* @__PURE__ */ e("svg", { className: "w-3.5 h-3.5", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2.5, children: /* @__PURE__ */ e("polyline", { points: "18 15 12 9 6 15" }) });
140
140
  }
141
- function J() {
141
+ function ee() {
142
142
  return /* @__PURE__ */ e("svg", { className: "w-3.5 h-3.5", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2.5, children: /* @__PURE__ */ e("line", { x1: "5", y1: "12", x2: "19", y2: "12" }) });
143
143
  }
144
- function X() {
144
+ function te() {
145
145
  return /* @__PURE__ */ e("svg", { className: "w-3.5 h-3.5", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2.5, children: /* @__PURE__ */ e("polyline", { points: "6 9 12 15 18 9" }) });
146
146
  }
147
- const E = [
148
- { value: "super_upvote", icon: /* @__PURE__ */ e(M, { className: "w-4 h-4" }), label: "Super" },
149
- { value: "upvote", icon: /* @__PURE__ */ e(Y, {}), label: "Up" },
150
- { value: "mid", icon: /* @__PURE__ */ e(J, {}), label: "Mid" },
151
- { value: "downvote", icon: /* @__PURE__ */ e(X, {}), label: "Down" }
147
+ const M = [
148
+ { value: "super_upvote", icon: /* @__PURE__ */ e(_, { className: "w-4 h-4" }), label: "Super" },
149
+ { value: "upvote", icon: /* @__PURE__ */ e(Z, {}), label: "Up" },
150
+ { value: "mid", icon: /* @__PURE__ */ e(ee, {}), label: "Mid" },
151
+ { value: "downvote", icon: /* @__PURE__ */ e(te, {}), label: "Down" }
152
152
  ];
153
- function Z(o) {
154
- const a = Math.round(o / 1e3), u = Math.floor(a / 3600), l = Math.floor(a % 3600 / 60), c = a % 60;
155
- return u > 0 ? `${u}:${String(l).padStart(2, "0")}:${String(c).padStart(2, "0")}` : `${l}:${String(c).padStart(2, "0")}`;
153
+ function se(a) {
154
+ const o = Math.round(a / 1e3), m = Math.floor(o / 3600), l = Math.floor(o % 3600 / 60), c = o % 60;
155
+ return m > 0 ? `${m}:${String(l).padStart(2, "0")}:${String(c).padStart(2, "0")}` : `${l}:${String(c).padStart(2, "0")}`;
156
156
  }
157
- function ee() {
158
- const [o, a] = y(""), [u, l] = y(!1), [c, r] = y(null), h = () => {
159
- const d = o.trim();
160
- d && (l(!0), r(null), K(d), setTimeout(() => l(!1), 1500));
157
+ function oe() {
158
+ const [a, o] = N(""), [m, l] = N(!1), [c, r] = N(null), p = () => {
159
+ const d = a.trim();
160
+ d && (l(!0), r(null), q(d), setTimeout(() => l(!1), 1500));
161
161
  };
162
162
  return /* @__PURE__ */ i("div", { className: "p-4 flex flex-col gap-3", children: [
163
163
  /* @__PURE__ */ e("p", { className: "text-xs text-text-muted", children: "Enter a playlist ID to load it for the room." }),
@@ -166,19 +166,19 @@ function ee() {
166
166
  "input",
167
167
  {
168
168
  type: "text",
169
- value: o,
170
- onChange: (d) => a(d.target.value),
171
- onKeyDown: (d) => d.key === "Enter" && h(),
169
+ value: a,
170
+ onChange: (d) => o(d.target.value),
171
+ onKeyDown: (d) => d.key === "Enter" && p(),
172
172
  placeholder: "Playlist ID (e.g. april-4)",
173
173
  className: "modal-input flex-1 text-xs px-2 py-1.5",
174
- disabled: u
174
+ disabled: m
175
175
  }
176
176
  ),
177
177
  /* @__PURE__ */ e(
178
178
  "button",
179
179
  {
180
- onClick: h,
181
- disabled: u || !o.trim(),
180
+ onClick: p,
181
+ disabled: m || !a.trim(),
182
182
  className: "modal-btn-update text-xs px-3 py-1.5 rounded disabled:opacity-50 disabled:cursor-not-allowed",
183
183
  children: "Load"
184
184
  }
@@ -187,59 +187,63 @@ function ee() {
187
187
  c && /* @__PURE__ */ e("p", { className: "text-xs bg-danger-bg text-on-danger-bg px-2 py-1 rounded", children: c })
188
188
  ] });
189
189
  }
190
- function te() {
190
+ function ae() {
191
191
  return /* @__PURE__ */ e("div", { className: "flex-1 flex items-center justify-center p-4", children: /* @__PURE__ */ e("p", { className: "text-xs text-text-muted text-center", children: "No playlist loaded yet." }) });
192
192
  }
193
- function ne() {
194
- const o = $(), a = v((t) => t.playlist), u = v((t) => t.activePlaylistIndex), l = v((t) => t.myVotes), c = v((t) => t.voteProgress), r = v((t) => t.playlistResults), h = v((t) => t.snapshot.mediaId), [d, f] = y(() => !!r && !r.update), [k, s] = y(r);
195
- if (r !== k && (s(r), r && !r.update && f(!0)), P.useEffect(() => {
196
- if (!a || a.type !== "vote") return;
193
+ function ce() {
194
+ const a = P(), o = f((t) => t.playlist), m = f((t) => t.activePlaylistIndex), l = f((t) => t.myVotes), c = f((t) => t.voteProgress), r = f((t) => t.playlistResults), p = f((t) => t.snapshot.mediaId), [d, b] = N(() => !!r && !r.update), [I, s] = N(r);
195
+ r !== I && (s(r), r && !r.update && b(!0));
196
+ const h = D(() => {
197
+ if (!o || o.type !== "vote") return;
197
198
  const t = {};
198
- for (const n of a.videos) {
199
- const m = I.voteKey(C(), a.id, n.mediaId), p = A(m);
200
- p && E.some((b) => b.value === p) && (t[n.mediaId] = p);
199
+ for (const n of o.videos) {
200
+ const u = O.voteKey(V(), o.id, n.mediaId), v = W(u);
201
+ v && M.some((k) => k.value === v) && (t[n.mediaId] = v);
201
202
  }
202
- if (R("playlist", "Checked localStorage votes", { playlistId: a.id, found: Object.keys(t).length }), Object.keys(t).length !== 0) {
203
- v.getState().applyPlaylistState({ playlist: a, activeIndex: u, myVotes: { ...l, ...t } });
204
- for (const [n, m] of Object.entries(t))
205
- V(a.id, n, m);
203
+ if (j("playlist", "Checked localStorage votes", { playlistId: o.id, found: Object.keys(t).length }), Object.keys(t).length !== 0) {
204
+ f.getState().applyPlaylistState({ playlist: o, activeIndex: m, myVotes: { ...l, ...t } });
205
+ for (const [n, u] of Object.entries(t))
206
+ E(o.id, n, u);
206
207
  }
207
- }, [a?.id]), !a)
208
- return o ? /* @__PURE__ */ e(ee, {}) : /* @__PURE__ */ e(te, {});
209
- const x = a.type === "vote", S = c.length, w = (t, n) => {
210
- V(a.id, t, n), R("playlist", "Vote emitted", { playlistId: a.id, mediaId: t, vote: n }), j(I.voteKey(C(), a.id, t), n);
211
- const m = { ...l, [t]: n };
208
+ }), C = o?.id;
209
+ if (L.useEffect(() => {
210
+ h();
211
+ }, [C]), !o)
212
+ return a ? /* @__PURE__ */ e(oe, {}) : /* @__PURE__ */ e(ae, {});
213
+ const y = o.type === "vote", x = c.length, w = (t, n) => {
214
+ E(o.id, t, n), j("playlist", "Vote emitted", { playlistId: o.id, mediaId: t, vote: n }), $(O.voteKey(V(), o.id, t), n);
215
+ const u = { ...l, [t]: n };
212
216
  if (n === "super_upvote")
213
- for (const [p, b] of Object.entries(m))
214
- p !== t && b === "super_upvote" && (m[p] = "upvote", j(I.voteKey(C(), a.id, p), "upvote"));
215
- v.getState().applyPlaylistState({
216
- playlist: a,
217
- activeIndex: u,
218
- myVotes: m
217
+ for (const [v, k] of Object.entries(u))
218
+ v !== t && k === "super_upvote" && (u[v] = "upvote", $(O.voteKey(V(), o.id, v), "upvote"));
219
+ f.getState().applyPlaylistState({
220
+ playlist: o,
221
+ activeIndex: m,
222
+ myVotes: u
219
223
  });
220
224
  };
221
225
  return /* @__PURE__ */ i("div", { className: "flex flex-col flex-1 min-h-0", children: [
222
226
  /* @__PURE__ */ i("div", { className: "flex items-center gap-2 px-3 py-2 border-b border-border shrink-0", children: [
223
- a.cover && /* @__PURE__ */ e(
227
+ o.cover && /* @__PURE__ */ e(
224
228
  "img",
225
229
  {
226
- src: B(a.cover),
230
+ src: F(o.cover),
227
231
  alt: "",
228
232
  className: "w-8 h-8 object-cover rounded shrink-0 bg-bg-alt"
229
233
  }
230
234
  ),
231
- /* @__PURE__ */ e("span", { className: "text-xs font-medium text-text truncate flex-1", children: a.name }),
232
- o && x && /* @__PURE__ */ e(
235
+ /* @__PURE__ */ e("span", { className: "text-xs font-medium text-text truncate flex-1", children: o.name }),
236
+ a && y && /* @__PURE__ */ e(
233
237
  "button",
234
238
  {
235
- onClick: () => U(),
239
+ onClick: () => K(),
236
240
  className: "text-xs text-text-muted hover:text-text transition-colors cursor-pointer shrink-0",
237
241
  title: "Reveal votes to all",
238
242
  children: "Reveal"
239
243
  }
240
244
  )
241
245
  ] }),
242
- o && x && S > 0 && /* @__PURE__ */ e("div", { className: "px-3 py-1.5 border-b border-border shrink-0", children: /* @__PURE__ */ i("div", { className: "flex items-center gap-1.5", children: [
246
+ a && y && x > 0 && /* @__PURE__ */ e("div", { className: "px-3 py-1.5 border-b border-border shrink-0", children: /* @__PURE__ */ i("div", { className: "flex items-center gap-1.5", children: [
243
247
  /* @__PURE__ */ e("span", { className: "text-[10px] text-text-muted shrink-0", children: "Votes:" }),
244
248
  /* @__PURE__ */ e("div", { className: "flex gap-1 flex-wrap flex-1", children: c.map((t) => /* @__PURE__ */ i("span", { className: "text-[10px] text-text-secondary", children: [
245
249
  t.name,
@@ -249,42 +253,42 @@ function ne() {
249
253
  t.totalVideos
250
254
  ] }, t.clientId)) })
251
255
  ] }) }),
252
- /* @__PURE__ */ e("div", { className: "flex-1 overflow-y-auto", children: a.videos.map((t, n) => {
253
- const m = u === n, p = l[t.mediaId], b = h === t.mediaId;
256
+ /* @__PURE__ */ e("div", { className: "flex-1 overflow-y-auto", children: o.videos.map((t, n) => {
257
+ const u = m === n, v = l[t.mediaId], k = p === t.mediaId;
254
258
  return /* @__PURE__ */ i(
255
259
  "div",
256
260
  {
257
- className: `flex items-center gap-2 px-3 py-2 border-b border-border/50 group ${m ? "bg-primary/10" : "hover:bg-bg-alt/50"}`,
261
+ className: `flex items-center gap-2 px-3 py-2 border-b border-border/50 group ${u ? "bg-primary/10" : "hover:bg-bg-alt/50"}`,
258
262
  children: [
259
- /* @__PURE__ */ e("div", { className: "w-3.5 shrink-0 text-text-muted", children: b ? /* @__PURE__ */ e("svg", { className: "w-3.5 h-3.5 text-text", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ e("polygon", { points: "5 3 19 12 5 21 5 3" }) }) : /* @__PURE__ */ e("span", { className: "text-[10px] text-text-muted", children: n + 1 }) }),
263
+ /* @__PURE__ */ e("div", { className: "w-3.5 shrink-0 text-text-muted", children: k ? /* @__PURE__ */ e("svg", { className: "w-3.5 h-3.5 text-text", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ e("polygon", { points: "5 3 19 12 5 21 5 3" }) }) : /* @__PURE__ */ e("span", { className: "text-[10px] text-text-muted", children: n + 1 }) }),
260
264
  /* @__PURE__ */ i("div", { className: "relative shrink-0", children: [
261
265
  /* @__PURE__ */ e(
262
266
  "img",
263
267
  {
264
- src: W(t.mediaId, t.thumbnail),
268
+ src: z(t.mediaId, t.thumbnail),
265
269
  alt: "",
266
270
  loading: "lazy",
267
271
  onError: (g) => {
268
- const N = g.currentTarget;
269
- (N.parentElement ?? N).style.display = "none";
272
+ const S = g.currentTarget;
273
+ (S.parentElement ?? S).style.display = "none";
270
274
  },
271
275
  className: "w-14 h-10 object-cover rounded bg-bg-alt"
272
276
  }
273
277
  ),
274
- t.durationMs ? /* @__PURE__ */ e("span", { className: "absolute bottom-0 right-0 px-1 text-[9px] leading-tight rounded-tl rounded-br bg-bg-card/90 text-text-secondary", children: Z(t.durationMs) }) : null
278
+ t.durationMs ? /* @__PURE__ */ e("span", { className: "absolute bottom-0 right-0 px-1 text-[9px] leading-tight rounded-tl rounded-br bg-bg-card/90 text-text-secondary", children: se(t.durationMs) }) : null
275
279
  ] }),
276
280
  /* @__PURE__ */ e(
277
281
  "button",
278
282
  {
279
- className: `flex-1 text-left text-xs truncate cursor-pointer transition-colors min-w-0 ${o ? "hover:text-text text-text-secondary" : "text-text-secondary cursor-default"} ${m ? "text-text font-medium" : ""}`,
280
- onClick: o ? () => F(n) : void 0,
281
- title: o ? `Play: ${t.displayName}` : t.displayName,
282
- disabled: !o,
283
+ className: `flex-1 text-left text-xs truncate cursor-pointer transition-colors min-w-0 ${a ? "hover:text-text text-text-secondary" : "text-text-secondary cursor-default"} ${u ? "text-text font-medium" : ""}`,
284
+ onClick: a ? () => G(n) : void 0,
285
+ title: a ? `Play: ${t.displayName}` : t.displayName,
286
+ disabled: !a,
283
287
  children: t.displayName
284
288
  }
285
289
  ),
286
- x && /* @__PURE__ */ e("div", { className: "flex gap-0.5 shrink-0", children: E.map((g) => {
287
- const N = p === g.value;
290
+ y && /* @__PURE__ */ e("div", { className: "flex gap-0.5 shrink-0", children: M.map((g) => {
291
+ const S = v === g.value;
288
292
  return /* @__PURE__ */ e(
289
293
  "button",
290
294
  {
@@ -292,8 +296,8 @@ function ne() {
292
296
  title: g.label,
293
297
  className: "vote-btn",
294
298
  "data-vote": g.value,
295
- "data-selected": N ? "" : void 0,
296
- "aria-pressed": N,
299
+ "data-selected": S ? "" : void 0,
300
+ "aria-pressed": S,
297
301
  children: g.icon
298
302
  },
299
303
  g.value
@@ -304,16 +308,16 @@ function ne() {
304
308
  t.mediaId
305
309
  );
306
310
  }) }),
307
- x && d && r && /* @__PURE__ */ e(
308
- Q,
311
+ y && d && r && /* @__PURE__ */ e(
312
+ X,
309
313
  {
310
314
  results: r,
311
- onClose: () => f(!1)
315
+ onClose: () => b(!1)
312
316
  }
313
317
  )
314
318
  ] });
315
319
  }
316
320
  export {
317
- ne as default
321
+ ce as default
318
322
  };
319
- //# sourceMappingURL=PlaylistPanel-2V6H_3Gw.js.map
323
+ //# sourceMappingURL=PlaylistPanel-bXAhBcTK.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PlaylistPanel-bXAhBcTK.js","sources":["../../src/components/PlaylistRevealPopup.tsx","../../src/components/PlaylistPanel.tsx"],"sourcesContent":["import { useEffect, useState, type ReactNode } from 'react';\nimport type { TPlaylistResultsOut, TVoteValue } from '@watchparty/shared';\nimport { useAppStore } from '../lib/store';\nimport { spriteUrlFor, colorForSprite, isCharacterId } from '../lib/characters';\nimport { StarIcon } from './controls/Icons';\nimport { useIsLeader } from '../hooks/useStoreSelectors';\nimport { emitVoteRemove } from '../lib/socket';\n\n/** How long the ✕ stays armed after the first click before it disarms. */\nconst REMOVE_ARM_MS = 3000;\n\ninterface Props {\n results: TPlaylistResultsOut;\n onClose: () => void;\n}\n\nconst VOTE_WEIGHTS: Record<TVoteValue, number> = {\n super_upvote: 4,\n upvote: 3,\n mid: 2,\n downvote: 1,\n};\n\nconst VOTE_ICONS: Record<TVoteValue, { icon: ReactNode; color: string }> = {\n // Bigger than the other marks on purpose: a super-upvote is the strongest\n // vote and was the hardest to see (a 10px star under the avatar).\n super_upvote: { icon: <StarIcon className=\"w-4 h-4\" />, color: 'bg-warning-bg text-on-warning-bg rounded' },\n upvote: { icon: '▲', color: 'bg-success-bg text-on-success-bg rounded px-0.5' },\n mid: { icon: '─', color: 'text-text-secondary' },\n downvote: { icon: '▼', color: 'bg-danger-bg text-on-danger-bg rounded px-0.5' },\n};\n\nfunction computeScores(results: TPlaylistResultsOut) {\n const { playlist, votes } = results;\n return playlist.videos.map(video => {\n let totalScore = 0;\n let voterCount = 0;\n for (const clientVotes of Object.values(votes)) {\n const v = clientVotes[video.mediaId] as TVoteValue | undefined;\n if (v) { totalScore += VOTE_WEIGHTS[v]; voterCount++; }\n }\n const avgScore = voterCount > 0 ? totalScore / voterCount : 0;\n return { video, avgScore, voterCount };\n }).sort((a, b) => b.avgScore - a.avgScore);\n}\n\nexport default function PlaylistRevealPopup({ results, onClose }: Props) {\n const roster = useAppStore(s => s.roster);\n const isLeader = useIsLeader();\n const scored = computeScores(results);\n // Two clicks to remove: the first arms the ✕, the second sends. A stray\n // click mid-party must not silently drop someone's ballot.\n const [armed, setArmed] = useState<string | null>(null);\n useEffect(() => {\n if (!armed) return;\n const t = setTimeout(() => setArmed(null), REMOVE_ARM_MS);\n return () => clearTimeout(t);\n }, [armed]);\n\n // Ordered list of clients who voted\n const voters = Object.keys(results.votes).filter(\n id => Object.keys(results.votes[id]).length > 0\n );\n // Frozen at reveal by the server, so someone who has since LEFT (and is\n // gone from the live roster) still has an avatar.\n const spriteOf = (id: string) => {\n const sprite = roster[id]?.sprite ?? results.sprites?.[id];\n return isCharacterId(sprite) ? sprite : undefined;\n };\n\n function onRemove(voterKey: string) {\n if (armed !== voterKey) { setArmed(voterKey); return; }\n setArmed(null);\n emitVoteRemove(voterKey);\n }\n\n return (\n <div\n className=\"fixed inset-0 bg-black/70 flex items-center justify-center z-50\"\n onClick={e => { if (e.target === e.currentTarget) onClose(); }}\n >\n <div data-testid=\"reveal-popup\" className=\"bg-bg-card border border-border rounded-lg shadow-xl w-full max-w-2xl max-h-[80vh] flex flex-col mx-4\">\n {/* Header */}\n <div className=\"flex items-center justify-between px-4 py-3 border-b border-border shrink-0\">\n <h2 className=\"text-sm font-semibold text-text\">\n {results.playlist.name} — Results\n </h2>\n <button\n onClick={onClose}\n aria-label=\"Close results\"\n className=\"p-1 text-text-muted hover:text-text transition-colors cursor-pointer\"\n >\n <svg className=\"w-4 h-4\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" strokeWidth={2}>\n <path strokeLinecap=\"round\" strokeLinejoin=\"round\" d=\"M6 18L18 6M6 6l12 12\" />\n </svg>\n </button>\n </div>\n\n {/* Voters — the leader can drop one; the table regenerates for everyone */}\n {voters.length > 0 && (\n <div className=\"flex flex-wrap items-center gap-1.5 px-4 py-2 border-b border-border shrink-0\">\n {voters.map(id => {\n const spriteId = spriteOf(id);\n return (\n <span key={id} className=\"reveal-voter\">\n {spriteId\n ? <img src={spriteUrlFor(spriteId)} alt=\"\" crossOrigin=\"anonymous\" className=\"w-4 h-4 rounded-full object-cover\" />\n : <span className=\"w-4 h-4 rounded-full bg-bg-alt\" />}\n <span className=\"text-xs text-text truncate max-w-[8rem]\">{results.names[id] || id}</span>\n {isLeader && (\n <button\n type=\"button\"\n className=\"reveal-voter-remove\"\n data-armed={armed === id ? '' : undefined}\n onClick={() => onRemove(id)}\n aria-label={`Remove ${results.names[id] || id}'s votes`}\n title={armed === id ? 'Click again to remove' : `Remove ${results.names[id] || id}'s votes`}\n >\n {armed === id ? 'remove?' : '✕'}\n </button>\n )}\n </span>\n );\n })}\n </div>\n )}\n\n {/* Results list */}\n <div className=\"overflow-y-auto flex-1 py-1\">\n {scored.map(({ video, avgScore, voterCount }, rank) => (\n <div\n key={video.mediaId}\n className={`flex items-center gap-3 px-4 py-2 ${rank % 2 === 0 ? '' : 'bg-bg-alt/20'}`}\n >\n {/* Rank */}\n <span className=\"text-xs text-text-muted w-5 shrink-0 text-right\">{rank + 1}</span>\n\n {/* Video name */}\n <span className=\"text-xs text-text truncate flex-1 min-w-0\">\n {video.displayName}\n </span>\n\n {/* Per-voter avatars + vote icon */}\n <div className=\"flex items-center gap-1.5 shrink-0\">\n {voters.map(clientId => {\n const vote = results.votes[clientId]?.[video.mediaId] as TVoteValue | undefined;\n if (!vote) return null;\n const spriteId = spriteOf(clientId);\n const voteStyle = VOTE_ICONS[vote];\n const borderColor = colorForSprite(spriteId ?? null);\n\n return (\n <div key={clientId} className=\"flex flex-col items-center gap-0.5\">\n {/* Avatar */}\n <div className=\"relative w-6 h-6 shrink-0\">\n {spriteId ? (\n <img\n src={spriteUrlFor(spriteId)}\n alt={results.names[clientId] || clientId}\n crossOrigin=\"anonymous\"\n className=\"w-6 h-6 rounded-full object-cover\"\n style={{ border: `1.5px solid ${borderColor}` }}\n />\n ) : (\n <div\n className=\"w-6 h-6 rounded-full bg-bg-alt\"\n style={{ border: `1.5px solid ${borderColor}` }}\n />\n )}\n </div>\n {/* Vote icon */}\n <span className={`text-[9px] leading-none font-bold ${voteStyle.color}`}>\n {voteStyle.icon}\n </span>\n </div>\n );\n })}\n {/* Show dashes for non-voters */}\n {voters.map(clientId => {\n const voted = !!results.votes[clientId]?.[video.mediaId];\n if (voted) return null;\n return (\n <div key={`no-${clientId}`} className=\"flex flex-col items-center gap-0.5 opacity-20\">\n <div className=\"w-6 h-6 rounded-full bg-bg-alt border border-border\" />\n <span className=\"text-[9px] leading-none text-text-muted\">·</span>\n </div>\n );\n })}\n </div>\n\n {/* Avg score */}\n <span className=\"text-xs text-text-secondary w-8 text-right shrink-0 font-medium\">\n {voterCount > 0 ? avgScore.toFixed(1) : '—'}\n </span>\n </div>\n ))}\n </div>\n </div>\n </div>\n );\n}\n","import React, { useEffectEvent, useState } from 'react';\nimport { useAppStore } from '../lib/store';\nimport { useIsLeader } from '../hooks/useStoreSelectors';\nimport { emitPlaylistLoad, emitPlaylistSelect, emitVoteUpdate, emitRevealRequest } from '../lib/socket';\nimport { resolveMediaAsset, resolveCardImage } from '../lib/mediaUrls';\nimport { debug } from '../lib/debug';\nimport { STORAGE_KEYS } from '../lib/storageKeys';\nimport { voteOwnerScope } from '../lib/auth';\nimport type { TVoteValue } from '@watchparty/shared';\nimport PlaylistRevealPopup from './PlaylistRevealPopup';\nimport { StarIcon } from './controls/Icons';\nimport { readStored, writeStored } from '../lib/browserStorage';\n\n// ── Vote icons ────────────────────────────────────────────────────────────────\n\n\nfunction UpvoteIcon() {\n return (\n <svg className=\"w-3.5 h-3.5\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" strokeWidth={2.5}>\n <polyline points=\"18 15 12 9 6 15\" />\n </svg>\n );\n}\n\nfunction MidIcon() {\n return (\n <svg className=\"w-3.5 h-3.5\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" strokeWidth={2.5}>\n <line x1=\"5\" y1=\"12\" x2=\"19\" y2=\"12\" />\n </svg>\n );\n}\n\nfunction DownvoteIcon() {\n return (\n <svg className=\"w-3.5 h-3.5\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" strokeWidth={2.5}>\n <polyline points=\"6 9 12 15 18 9\" />\n </svg>\n );\n}\n\n// Colours live in `.vote-btn` (styles.css), keyed by `data-vote`: a <button>'s\n// colour/background utilities are discarded by the unlayered `button` reset, so\n// the per-vote `text-*` classes these carried never rendered — every vote icon\n// was the same white, selected or not.\nconst VOTE_OPTIONS: { value: TVoteValue; icon: React.ReactNode; label: string }[] = [\n { value: 'super_upvote', icon: <StarIcon className=\"w-4 h-4\" />, label: 'Super' },\n { value: 'upvote', icon: <UpvoteIcon />, label: 'Up' },\n { value: 'mid', icon: <MidIcon />, label: 'Mid' },\n { value: 'downvote', icon: <DownvoteIcon />, label: 'Down' },\n];\n\n// ── Helpers ───────────────────────────────────────────────────────────────────\n\nfunction formatDuration(ms: number): string {\n const total = Math.round(ms / 1000);\n const h = Math.floor(total / 3600);\n const m = Math.floor((total % 3600) / 60);\n const s = total % 60;\n return h > 0\n ? `${h}:${String(m).padStart(2, '0')}:${String(s).padStart(2, '0')}`\n : `${m}:${String(s).padStart(2, '0')}`;\n}\n\n// ── Load form (leader, no playlist loaded) ────────────────────────────────────\n\nfunction LoadForm() {\n const [input, setInput] = useState('');\n const [loading, setLoading] = useState(false);\n const [err, setErr] = useState<string | null>(null);\n\n const handleLoad = () => {\n const id = input.trim();\n if (!id) return;\n setLoading(true);\n setErr(null);\n emitPlaylistLoad(id);\n // Error will arrive via the 'error' socket event and show as a toast.\n // Reset loading state after a short delay.\n setTimeout(() => setLoading(false), 1500);\n };\n\n return (\n <div className=\"p-4 flex flex-col gap-3\">\n <p className=\"text-xs text-text-muted\">Enter a playlist ID to load it for the room.</p>\n <div className=\"flex gap-2\">\n <input\n type=\"text\"\n value={input}\n onChange={e => setInput(e.target.value)}\n onKeyDown={e => e.key === 'Enter' && handleLoad()}\n placeholder=\"Playlist ID (e.g. april-4)\"\n className=\"modal-input flex-1 text-xs px-2 py-1.5\"\n disabled={loading}\n />\n <button\n onClick={handleLoad}\n disabled={loading || !input.trim()}\n className=\"modal-btn-update text-xs px-3 py-1.5 rounded disabled:opacity-50 disabled:cursor-not-allowed\"\n >\n Load\n </button>\n </div>\n {err && <p className=\"text-xs bg-danger-bg text-on-danger-bg px-2 py-1 rounded\">{err}</p>}\n </div>\n );\n}\n\n// ── Empty state (viewer, no playlist) ─────────────────────────────────────────\n\nfunction EmptyState() {\n return (\n <div className=\"flex-1 flex items-center justify-center p-4\">\n <p className=\"text-xs text-text-muted text-center\">No playlist loaded yet.</p>\n </div>\n );\n}\n\n// ── Main panel ────────────────────────────────────────────────────────────────\n\nexport default function PlaylistPanel() {\n const isLeader = useIsLeader();\n const playlist = useAppStore(s => s.playlist);\n const activeIndex = useAppStore(s => s.activePlaylistIndex);\n const myVotes = useAppStore(s => s.myVotes);\n const voteProgress = useAppStore(s => s.voteProgress);\n const results = useAppStore(s => s.playlistResults);\n const currentMediaId = useAppStore(s => s.snapshot.mediaId);\n\n // Show results popup when a reveal arrives. NOT on an `update` (a voter was\n // removed): that re-sends the table to everyone, and reopening it would put\n // the popup back in front of people who had already closed it.\n const [showResults, setShowResults] = useState(() => !!results && !results.update);\n const [seenResults, setSeenResults] = useState(results);\n if (results !== seenResults) {\n setSeenResults(results);\n if (results && !results.update) setShowResults(true);\n }\n\n // Restore votes from localStorage when a playlist is first loaded. The body\n // reads the current playlist, index and votes; only a new playlist id runs it.\n const restoreVotes = useEffectEvent(() => {\n if (!playlist || playlist.type !== 'vote') return;\n const savedVotes: Record<string, TVoteValue> = {};\n for (const video of playlist.videos) {\n const key = STORAGE_KEYS.voteKey(voteOwnerScope(), playlist.id, video.mediaId);\n const saved = readStored(key) as TVoteValue | null;\n if (saved && VOTE_OPTIONS.some(o => o.value === saved)) {\n savedVotes[video.mediaId] = saved;\n }\n }\n debug('playlist', 'Checked localStorage votes', { playlistId: playlist.id, found: Object.keys(savedVotes).length });\n if (Object.keys(savedVotes).length === 0) return;\n useAppStore.getState().applyPlaylistState({ playlist, activeIndex, myVotes: { ...myVotes, ...savedVotes } });\n for (const [mediaId, vote] of Object.entries(savedVotes)) {\n emitVoteUpdate(playlist.id, mediaId, vote);\n }\n });\n const playlistId = playlist?.id;\n React.useEffect(() => { restoreVotes(); }, [playlistId]);\n\n if (!playlist) {\n return isLeader ? <LoadForm /> : <EmptyState />;\n }\n\n // `basic` playlists are a plain watch-through — no vote buttons, progress,\n // or reveal. Only `vote` playlists show the rating mechanic.\n const isVoting = playlist.type === 'vote';\n const totalUsers = voteProgress.length;\n\n const handleVote = (mediaId: string, vote: TVoteValue) => {\n emitVoteUpdate(playlist.id, mediaId, vote);\n debug('playlist', 'Vote emitted', { playlistId: playlist.id, mediaId, vote });\n writeStored(STORAGE_KEYS.voteKey(voteOwnerScope(), playlist.id, mediaId), vote);\n\n // Mirror the server's super_upvote exclusivity rule: if this vote is a star,\n // downgrade any other video's star to upvote so the visual ring updates immediately.\n const updatedVotes = { ...myVotes, [mediaId]: vote };\n if (vote === 'super_upvote') {\n for (const [otherId, otherVote] of Object.entries(updatedVotes)) {\n if (otherId !== mediaId && otherVote === 'super_upvote') {\n updatedVotes[otherId] = 'upvote';\n writeStored(STORAGE_KEYS.voteKey(voteOwnerScope(), playlist.id, otherId), 'upvote');\n }\n }\n }\n\n useAppStore.getState().applyPlaylistState({\n playlist,\n activeIndex,\n myVotes: updatedVotes,\n });\n };\n\n return (\n <div className=\"flex flex-col flex-1 min-h-0\">\n {/* Header */}\n <div className=\"flex items-center gap-2 px-3 py-2 border-b border-border shrink-0\">\n {playlist.cover && (\n <img\n src={resolveMediaAsset(playlist.cover)}\n alt=\"\"\n className=\"w-8 h-8 object-cover rounded shrink-0 bg-bg-alt\"\n />\n )}\n <span className=\"text-xs font-medium text-text truncate flex-1\">\n {playlist.name}\n </span>\n {isLeader && isVoting && (\n <button\n onClick={() => emitRevealRequest()}\n className=\"text-xs text-text-muted hover:text-text transition-colors cursor-pointer shrink-0\"\n title=\"Reveal votes to all\"\n >\n Reveal\n </button>\n )}\n </div>\n\n {/* Vote progress bar (leader only, vote playlists only) */}\n {isLeader && isVoting && totalUsers > 0 && (\n <div className=\"px-3 py-1.5 border-b border-border shrink-0\">\n <div className=\"flex items-center gap-1.5\">\n <span className=\"text-[10px] text-text-muted shrink-0\">Votes:</span>\n <div className=\"flex gap-1 flex-wrap flex-1\">\n {voteProgress.map(p => (\n <span key={p.clientId} className=\"text-[10px] text-text-secondary\">\n {p.name} {p.votedCount}/{p.totalVideos}\n </span>\n ))}\n </div>\n </div>\n </div>\n )}\n\n {/* Video list */}\n <div className=\"flex-1 overflow-y-auto\">\n {playlist.videos.map((video, i) => {\n const isActive = activeIndex === i;\n const myVote = myVotes[video.mediaId] as TVoteValue | undefined;\n const isCurrentMedia = currentMediaId === video.mediaId;\n\n return (\n <div\n key={video.mediaId}\n className={`flex items-center gap-2 px-3 py-2 border-b border-border/50 group ${\n isActive ? 'bg-primary/10' : 'hover:bg-bg-alt/50'\n }`}\n >\n {/* Play indicator */}\n <div className=\"w-3.5 shrink-0 text-text-muted\">\n {isCurrentMedia ? (\n <svg className=\"w-3.5 h-3.5 text-text\" viewBox=\"0 0 24 24\" fill=\"currentColor\">\n <polygon points=\"5 3 19 12 5 21 5 3\" />\n </svg>\n ) : (\n <span className=\"text-[10px] text-text-muted\">{i + 1}</span>\n )}\n </div>\n\n {/* Thumbnail. No longer flat-playlist-only: `poster.jpg` is\n derived by convention when a clip carries no explicit\n thumbnail (see resolveCardImage), and a 404 hides the image. */}\n <div className=\"relative shrink-0\">\n <img\n src={resolveCardImage(video.mediaId, video.thumbnail)}\n alt=\"\"\n loading=\"lazy\"\n onError={e => {\n const el = e.currentTarget as HTMLImageElement;\n // Hide the whole slot, not just the img — the duration\n // badge is positioned against it.\n (el.parentElement ?? el).style.display = 'none';\n }}\n className=\"w-14 h-10 object-cover rounded bg-bg-alt\"\n />\n {video.durationMs ? (\n <span className=\"absolute bottom-0 right-0 px-1 text-[9px] leading-tight rounded-tl rounded-br bg-bg-card/90 text-text-secondary\">\n {formatDuration(video.durationMs)}\n </span>\n ) : null}\n </div>\n\n {/* Video name — leader can click to select */}\n <button\n className={`flex-1 text-left text-xs truncate cursor-pointer transition-colors min-w-0 ${\n isLeader\n ? 'hover:text-text text-text-secondary'\n : 'text-text-secondary cursor-default'\n } ${isActive ? 'text-text font-medium' : ''}`}\n onClick={isLeader ? () => emitPlaylistSelect(i) : undefined}\n title={isLeader ? `Play: ${video.displayName}` : video.displayName}\n disabled={!isLeader}\n >\n {video.displayName}\n </button>\n\n {/* Vote buttons (vote playlists only) */}\n {isVoting && (\n <div className=\"flex gap-0.5 shrink-0\">\n {VOTE_OPTIONS.map(opt => {\n const isSelected = myVote === opt.value;\n return (\n <button\n key={opt.value}\n onClick={() => handleVote(video.mediaId, opt.value)}\n title={opt.label}\n className=\"vote-btn\"\n data-vote={opt.value}\n data-selected={isSelected ? '' : undefined}\n aria-pressed={isSelected}\n >\n {opt.icon}\n </button>\n );\n })}\n </div>\n )}\n </div>\n );\n })}\n </div>\n\n {/* Results popup (vote playlists only) */}\n {isVoting && showResults && results && (\n <PlaylistRevealPopup\n results={results}\n onClose={() => setShowResults(false)}\n />\n )}\n </div>\n );\n}\n"],"names":["REMOVE_ARM_MS","VOTE_WEIGHTS","VOTE_ICONS","jsx","StarIcon","computeScores","results","playlist","votes","video","totalScore","voterCount","clientVotes","v","avgScore","a","b","PlaylistRevealPopup","onClose","roster","useAppStore","isLeader","useIsLeader","scored","armed","setArmed","useState","useEffect","t","voters","id","spriteOf","sprite","isCharacterId","onRemove","voterKey","emitVoteRemove","e","jsxs","spriteId","spriteUrlFor","rank","clientId","vote","voteStyle","borderColor","colorForSprite","UpvoteIcon","MidIcon","DownvoteIcon","VOTE_OPTIONS","formatDuration","ms","total","h","m","s","LoadForm","input","setInput","loading","setLoading","err","setErr","handleLoad","emitPlaylistLoad","EmptyState","PlaylistPanel","activeIndex","myVotes","voteProgress","currentMediaId","showResults","setShowResults","seenResults","setSeenResults","restoreVotes","useEffectEvent","savedVotes","key","STORAGE_KEYS","voteOwnerScope","saved","readStored","o","debug","mediaId","emitVoteUpdate","playlistId","React","isVoting","totalUsers","handleVote","writeStored","updatedVotes","otherId","otherVote","resolveMediaAsset","emitRevealRequest","p","i","isActive","myVote","isCurrentMedia","resolveCardImage","el","emitPlaylistSelect","opt","isSelected"],"mappings":";;;;AASA,MAAMA,IAAgB,KAOhBC,IAA2C;AAAA,EAC/C,cAAc;AAAA,EACd,QAAQ;AAAA,EACR,KAAK;AAAA,EACL,UAAU;AACZ,GAEMC,IAAqE;AAAA;AAAA;AAAA,EAGzE,cAAc,EAAE,MAAM,gBAAAC,EAACC,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