@vocalstack/player 0.1.0-alpha.31 → 0.1.0-alpha.32

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.
package/dist/index.js CHANGED
@@ -221,7 +221,7 @@ function fr({ children: t, style: e, className: n }) {
221
221
  return /* @__PURE__ */ i("div", { className: n ? `eyebrow ${n}` : "eyebrow", style: e, children: t });
222
222
  }
223
223
  let kn = null;
224
- function iu(t) {
224
+ function au(t) {
225
225
  kn = t;
226
226
  }
227
227
  function hi(t) {
@@ -884,12 +884,12 @@ function Ha(t, e, n, r = {}, s) {
884
884
  var M, N;
885
885
  const d = (M = t.clipRev) == null ? void 0 : M[String(u)], h = Math.max(1, ((N = t.clipParts) == null ? void 0 : N[String(u)]) ?? 1);
886
886
  return Array.from({ length: h }, (p, y) => {
887
- var L;
887
+ var v;
888
888
  return {
889
889
  sentenceId: u,
890
890
  lang: t.lang,
891
891
  src: `${n}/v1/recordings/${e}/voice/${u}?lang=${encodeURIComponent(t.lang)}${c}&format=${An()}${y > 0 ? `&part=${y}` : ""}${d ? `&v=${encodeURIComponent(d)}` : ""}${l}`,
892
- durationS: h === 1 ? ((L = t.clipDur) == null ? void 0 : L[String(u)]) ?? 0 : 0,
892
+ durationS: h === 1 ? ((v = t.clipDur) == null ? void 0 : v[String(u)]) ?? 0 : 0,
893
893
  voice: t.voice ?? null,
894
894
  cloned: !1,
895
895
  part: y,
@@ -968,15 +968,15 @@ function Za(t) {
968
968
  return [typeof e == "number" && e > 0 ? e : t === "ga" ? 560 : Ga, n];
969
969
  }
970
970
  function Cr({ open: t, onClose: e, value: n, onSelect: r, languages: s, searchPlaceholder: a = "Search languages", none: o, pinned: l = [], recent: c = [], requireVoice: u, keepOpen: d, busy: h }) {
971
- const [M, N] = j(""), [p, y] = j(!1), [L, m] = j(null);
971
+ const [M, N] = j(""), [p, y] = j(!1), [v, m] = j(null);
972
972
  Y(() => {
973
973
  t && (N(""), y(!1), m(null));
974
974
  }, [t]);
975
975
  const f = Ie(() => {
976
976
  const S = M.trim().toLowerCase();
977
977
  return [...S ? s.filter((O) => O.label.toLowerCase().includes(S) || O.native.toLowerCase().includes(S) || O.code.toLowerCase().includes(S)) : s].sort((O, te) => {
978
- const K = l.indexOf(O.code), v = l.indexOf(te.code);
979
- return K !== -1 || v !== -1 ? (K === -1 ? 999 : K) - (v === -1 ? 999 : v) : O.label.localeCompare(te.label);
978
+ const K = l.indexOf(O.code), L = l.indexOf(te.code);
979
+ return K !== -1 || L !== -1 ? (K === -1 ? 999 : K) - (L === -1 ? 999 : L) : O.label.localeCompare(te.label);
980
980
  });
981
981
  }, [s, M, l]), I = Ie(
982
982
  () => M ? [] : c.map((S) => f.find((T) => T.code === S)).filter((S) => !!S).sort((S, T) => S.label.localeCompare(T.label)),
@@ -1007,7 +1007,7 @@ function Cr({ open: t, onClose: e, value: n, onSelect: r, languages: s, searchPl
1007
1007
  }, onKeyDown: (te) => {
1008
1008
  (te.key === "Enter" || te.key === " ") && (te.preventDefault(), te.stopPropagation(), $s(S.code));
1009
1009
  }, children: /* @__PURE__ */ i(oe, { d: ee.close, size: 16 }) }) }),
1010
- /* @__PURE__ */ i("span", { className: `vs-picker__slot${O ? " vs-picker__slot--wide" : ""}`, title: S.voice ? "Voice available" : O ? "No voice speaks this language yet" : void 0, children: O ? L === S.code && /* @__PURE__ */ i("span", { className: "vs-picker__off", children: "UNAVAILABLE" }) : S.voice && /* @__PURE__ */ i(oe, { d: ee.headphones, size: 16 }) }),
1010
+ /* @__PURE__ */ i("span", { className: `vs-picker__slot${O ? " vs-picker__slot--wide" : ""}`, title: S.voice ? "Voice available" : O ? "No voice speaks this language yet" : void 0, children: O ? v === S.code && /* @__PURE__ */ i("span", { className: "vs-picker__off", children: "UNAVAILABLE" }) : S.voice && /* @__PURE__ */ i(oe, { d: ee.headphones, size: 16 }) }),
1011
1011
  /* @__PURE__ */ i("span", { className: "vs-picker__check", children: n === S.code && (h === S.code ? /* @__PURE__ */ i(it, { size: 15, color: "var(--vs-link-hover)", track: "var(--vs-border)" }) : /* @__PURE__ */ i(oe, { d: ee.check, size: 16, sw: 2.2 })) })
1012
1012
  ]
1013
1013
  },
@@ -1116,11 +1116,11 @@ function Ja(t) {
1116
1116
  };
1117
1117
  }, [t]), e;
1118
1118
  }
1119
- const Bs = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
1120
- function Xa(t) {
1119
+ const Xa = /^[0-9a-f]{16,}$/i, Bs = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
1120
+ function eo(t) {
1121
1121
  const e = (r) => {
1122
1122
  const s = r == null ? void 0 : r.trim();
1123
- return s && s !== t.id && !Bs.test(s) ? s : null;
1123
+ return s && s !== t.id && !Bs.test(s) && !Xa.test(s) ? s : null;
1124
1124
  }, n = (() => {
1125
1125
  if (!t.url) return null;
1126
1126
  try {
@@ -1131,37 +1131,37 @@ function Xa(t) {
1131
1131
  })();
1132
1132
  return e(t.name) ?? e(t.sourceName) ?? e(t.ytTitle) ?? n ?? (Bs.test(t.id) ? "VocalStack" : t.id);
1133
1133
  }
1134
- const eo = 0.3;
1134
+ const to = 0.3;
1135
1135
  function Vs(t, e) {
1136
- t.muted = e.muted, Math.abs(t.currentTime - e.t) > eo && (t.currentTime = Math.max(0, e.t)), e.playing ? t.paused && Promise.resolve(t.play()).catch(() => {
1136
+ t.muted = e.muted, Math.abs(t.currentTime - e.t) > to && (t.currentTime = Math.max(0, e.t)), e.playing ? t.paused && Promise.resolve(t.play()).catch(() => {
1137
1137
  }) : t.paused || t.pause();
1138
1138
  }
1139
- const bn = "Remove background sound", to = "Takes out everything that isn't speech: music, ambience and noise.";
1140
- function no(t) {
1139
+ const bn = "Remove background sound", no = "Takes out everything that isn't speech: music, ambience and noise.";
1140
+ function ro(t) {
1141
1141
  const e = Math.max(0, Math.floor(t)), n = Math.floor(e / 3600), r = Math.floor(e % 3600 / 60), s = String(e % 60).padStart(2, "0");
1142
1142
  return n ? `${n}:${String(r).padStart(2, "0")}:${s}` : `${r}:${s}`;
1143
1143
  }
1144
- function ro(t, e, n = "transcription", r = 0) {
1145
- return e === "unavailable" ? `Not available for this ${n}` : e === "making" ? r > 0 ? `Separating the speech from the background… ready up to ${no(r)}` : "Separating the speech from the background…" : to;
1144
+ function so(t, e, n = "transcription", r = 0) {
1145
+ return e === "unavailable" ? `Not available for this ${n}` : e === "making" ? r > 0 ? `Separating the speech from the background… ready up to ${ro(r)}` : "Separating the speech from the background…" : no;
1146
1146
  }
1147
- function so(t, e) {
1147
+ function io(t, e) {
1148
1148
  return { bed: e && !t, speech: !e && t };
1149
1149
  }
1150
- function io(t) {
1150
+ function ao(t) {
1151
1151
  const e = t.get("bg");
1152
1152
  return e === "off" || e === "remove";
1153
1153
  }
1154
- function ao(t, e) {
1154
+ function oo(t, e) {
1155
1155
  e ? t.searchParams.set("bg", "remove") : t.searchParams.delete("bg");
1156
1156
  }
1157
- function oo(t, e) {
1157
+ function lo(t, e) {
1158
1158
  var r, s;
1159
1159
  if (t !== 503) return null;
1160
1160
  const n = (s = (r = e == null ? void 0 : e.data) == null ? void 0 : r.details) == null ? void 0 : s.retryAfterS;
1161
1161
  return typeof n == "number" && n > 0 ? Math.max(2, n) : 3;
1162
1162
  }
1163
- const lo = 0.05;
1164
- function co(t) {
1163
+ const co = 0.05;
1164
+ function uo(t) {
1165
1165
  var r, s;
1166
1166
  const e = (s = (r = t == null ? void 0 : t.data) == null ? void 0 : r.details) == null ? void 0 : s.parts, n = [];
1167
1167
  if (Array.isArray(e))
@@ -1173,8 +1173,8 @@ function co(t) {
1173
1173
  }
1174
1174
  return { untilS: n.length ? n[n.length - 1].endS : 0, parts: n };
1175
1175
  }
1176
- function uo(t, e) {
1177
- if (!t.length || e < 0 || e >= t[t.length - 1].endS - lo) return -1;
1176
+ function ho(t, e) {
1177
+ if (!t.length || e < 0 || e >= t[t.length - 1].endS - co) return -1;
1178
1178
  let n = 0, r = t.length - 1;
1179
1179
  for (; n < r; ) {
1180
1180
  const s = n + r + 1 >> 1;
@@ -1182,17 +1182,17 @@ function uo(t, e) {
1182
1182
  }
1183
1183
  return n;
1184
1184
  }
1185
- function ho(t, e, n, r) {
1185
+ function Mo(t, e, n, r) {
1186
1186
  const s = t[e].startS, a = n[r] === s ? r : n[1 - r] === s ? 1 - r : r, o = [];
1187
1187
  n[a] !== s && o.push([a, e]);
1188
1188
  const l = 1 - a;
1189
1189
  return e + 1 < t.length && n[l] !== t[e + 1].startS && o.push([l, e + 1]), { play: a, load: o };
1190
1190
  }
1191
- async function Mo(t) {
1191
+ async function go(t) {
1192
1192
  const e = await fetch(t, { redirect: "manual", credentials: "omit" });
1193
1193
  if (e.type === "opaqueredirect" || e.status >= 300 && e.status < 400 || e.ok) return { ready: !0 };
1194
1194
  const n = await e.json().catch(() => null);
1195
- return { ready: !1, retryS: oo(e.status, n), ...co(n) };
1195
+ return { ready: !1, retryS: lo(e.status, n), ...uo(n) };
1196
1196
  }
1197
1197
  function ir(t) {
1198
1198
  t && (t.pause(), t.removeAttribute("src"), t.load());
@@ -1207,22 +1207,22 @@ function Li(t, e) {
1207
1207
  let M = !1, N;
1208
1208
  r("making");
1209
1209
  const p = () => {
1210
- Mo(t).then((y) => {
1210
+ go(t).then((y) => {
1211
1211
  if (!M) {
1212
1212
  if (y.ready) {
1213
- const L = new Audio();
1214
- L.preload = "auto";
1213
+ const v = new Audio();
1214
+ v.preload = "auto";
1215
1215
  const m = () => {
1216
- !M && c.current === L && r("ready");
1216
+ !M && c.current === v && r("ready");
1217
1217
  };
1218
- L.addEventListener("canplay", m, { once: !0 }), L.addEventListener("error", m, { once: !0 }), L.src = t, c.current = L;
1218
+ v.addEventListener("canplay", m, { once: !0 }), v.addEventListener("error", m, { once: !0 }), v.src = t, c.current = v;
1219
1219
  return;
1220
1220
  }
1221
1221
  if (y.retryS == null) {
1222
1222
  r("unavailable"), a([]);
1223
1223
  return;
1224
1224
  }
1225
- a((L) => L.length === y.parts.length && L.every((m, f) => m.startS === y.parts[f].startS) ? L : y.parts), N = setTimeout(p, y.retryS * 1e3);
1225
+ a((v) => v.length === y.parts.length && v.every((m, f) => m.startS === y.parts[f].startS) ? v : y.parts), N = setTimeout(p, y.retryS * 1e3);
1226
1226
  }
1227
1227
  }).catch(() => {
1228
1228
  M || (N = setTimeout(p, 5e3));
@@ -1239,31 +1239,31 @@ function Li(t, e) {
1239
1239
  M(), Vs(c.current, e), l(!0);
1240
1240
  return;
1241
1241
  }
1242
- const N = n === "making" ? uo(s, e.t) : -1;
1242
+ const N = n === "making" ? ho(s, e.t) : -1;
1243
1243
  if (N < 0) {
1244
1244
  M(), l(!1);
1245
1245
  return;
1246
1246
  }
1247
- const p = ho(s, N, d.current, h.current);
1247
+ const p = Mo(s, N, d.current, h.current);
1248
1248
  for (const [m, f] of p.load) {
1249
1249
  let I = u.current[m];
1250
1250
  I || (I = new Audio(), I.preload = "auto", u.current[m] = I), I.pause(), I.src = s[f].url, d.current[m] = s[f].startS;
1251
1251
  }
1252
1252
  h.current = p.play;
1253
- const y = u.current[p.play], L = u.current[1 - p.play];
1254
- L && !L.paused && L.pause(), Vs(y, { ...e, t: e.t - s[N].startS }), l(!e.playing || y.readyState >= 3);
1253
+ const y = u.current[p.play], v = u.current[1 - p.play];
1254
+ v && !v.paused && v.pause(), Vs(y, { ...e, t: e.t - s[N].startS }), l(!e.playing || y.readyState >= 3);
1255
1255
  }, [n, s, e.t, e.playing, e.muted]), { state: n, on: o, untilS: n === "ready" ? 1 / 0 : s.length ? s[s.length - 1].endS : 0 };
1256
1256
  }
1257
- function go(t, e) {
1257
+ function fo(t, e) {
1258
1258
  return Li(t, e).state;
1259
1259
  }
1260
- const fo = 0.5, po = 3;
1260
+ const po = 0.5, No = 3;
1261
1261
  function br(t, e) {
1262
1262
  let n = -1;
1263
1263
  for (let r = 0; r < t.length && t[r].start <= e + 0.02; r++) n = r;
1264
1264
  return n;
1265
1265
  }
1266
- function No(t, e, n) {
1266
+ function mo(t, e, n) {
1267
1267
  const r = br(t, n);
1268
1268
  if (r < 0) return { kind: "none" };
1269
1269
  const s = t[r];
@@ -1281,14 +1281,14 @@ function No(t, e, n) {
1281
1281
  }
1282
1282
  return { kind: "done", sid: s.sid };
1283
1283
  }
1284
- function mo(t, e, n) {
1284
+ function yo(t, e, n) {
1285
1285
  if (n == null) return !1;
1286
1286
  const r = br(t, e);
1287
1287
  if (r < 0) return !1;
1288
1288
  const s = t[r];
1289
1289
  return e >= s.end ? s.sid === n : r > 0 && t[r - 1].sid === n && e - s.start < 1.5;
1290
1290
  }
1291
- function yo(t, e, n, r = po) {
1291
+ function To(t, e, n, r = No) {
1292
1292
  const s = Math.max(0, br(t, n)), a = [];
1293
1293
  for (let o = s; o < t.length && o <= s + r; o++) {
1294
1294
  const l = (e.get(t[o].sid) ?? []).find((c) => c.part === 0);
@@ -1296,7 +1296,7 @@ function yo(t, e, n, r = po) {
1296
1296
  }
1297
1297
  return a;
1298
1298
  }
1299
- function To(t) {
1299
+ function wo(t) {
1300
1300
  const e = Ie(() => {
1301
1301
  const c = /* @__PURE__ */ new Map();
1302
1302
  for (const u of t.clips) c.set(u.sentenceId, [...c.get(u.sentenceId) ?? [], u]);
@@ -1317,9 +1317,9 @@ function To(t) {
1317
1317
  l(), a((p) => p.missing == null && p.sid == null ? p : { missing: null, sid: null });
1318
1318
  return;
1319
1319
  }
1320
- const c = No(t.lines, e, t.t), u = c.kind === "missing" ? c.sid : null, d = c.kind === "none" ? null : c.sid;
1320
+ const c = mo(t.lines, e, t.t), u = c.kind === "missing" ? c.sid : null, d = c.kind === "none" ? null : c.sid;
1321
1321
  a((p) => p.missing === u && p.sid === d ? p : { missing: u, sid: d });
1322
- const h = new Set(yo(t.lines, e, t.t));
1322
+ const h = new Set(To(t.lines, e, t.t));
1323
1323
  for (const p of h) o(p);
1324
1324
  const M = r.current;
1325
1325
  M && h.add(M.src);
@@ -1329,12 +1329,12 @@ function To(t) {
1329
1329
  return;
1330
1330
  }
1331
1331
  if (c.kind !== "play") {
1332
- if (M && !M.el.paused && !M.el.ended && mo(t.lines, t.t, M.sid)) return;
1332
+ if (M && !M.el.paused && !M.el.ended && yo(t.lines, t.t, M.sid)) return;
1333
1333
  M && M.el.pause(), r.current = null;
1334
1334
  return;
1335
1335
  }
1336
1336
  if (M && M.src === c.src) {
1337
- if (M.el.muted = t.muted, !M.el.ended && Math.abs(M.el.currentTime - c.offset) > fo)
1337
+ if (M.el.muted = t.muted, !M.el.ended && Math.abs(M.el.currentTime - c.offset) > po)
1338
1338
  try {
1339
1339
  M.el.currentTime = c.offset;
1340
1340
  } catch {
@@ -1355,7 +1355,7 @@ function To(t) {
1355
1355
  }, [t.on, t.t, t.playing, t.muted, t.lines, e]), s;
1356
1356
  }
1357
1357
  const Hs = ["play", "pause", "stop", "nexttrack", "previoustrack"];
1358
- function wo(t, e) {
1358
+ function Lo(t, e) {
1359
1359
  var n, r;
1360
1360
  if (t === "play") {
1361
1361
  e.playing || e.toggle();
@@ -1371,12 +1371,12 @@ function wo(t, e) {
1371
1371
  }
1372
1372
  (r = e.prev) == null || r.call(e);
1373
1373
  }
1374
- function Lo(t, e) {
1374
+ function vo(t, e) {
1375
1375
  for (const n of Hs)
1376
1376
  try {
1377
1377
  t.setActionHandler(n, () => {
1378
1378
  const r = e();
1379
- r && wo(n, r);
1379
+ r && Lo(n, r);
1380
1380
  });
1381
1381
  } catch {
1382
1382
  }
@@ -1388,14 +1388,14 @@ function Lo(t, e) {
1388
1388
  }
1389
1389
  };
1390
1390
  }
1391
- function vo(t, e) {
1391
+ function ko(t, e) {
1392
1392
  const n = k(t);
1393
1393
  n.current = t;
1394
1394
  const r = !!t;
1395
1395
  Y(() => {
1396
1396
  const a = typeof navigator < "u" ? navigator.mediaSession : void 0;
1397
1397
  if (!(!a || !r))
1398
- return Lo(a, () => n.current);
1398
+ return vo(a, () => n.current);
1399
1399
  }, [r]);
1400
1400
  const s = !!(t != null && t.playing);
1401
1401
  Y(() => {
@@ -1427,7 +1427,7 @@ function $t() {
1427
1427
  spans: []
1428
1428
  };
1429
1429
  }
1430
- function ko(t, e) {
1430
+ function jo(t, e) {
1431
1431
  for (const r of t.spans) {
1432
1432
  const s = r.mediaEnd ?? 1 / 0;
1433
1433
  if (e < s || r.mediaEnd == null) return r.wallStart + Math.max(0, e - r.mediaStart);
@@ -1504,7 +1504,7 @@ function Ws(t, e) {
1504
1504
  const n = e ?? {};
1505
1505
  return !t || !Object.keys(t).length ? n : Object.keys(n).length ? { ...t, ...n } : t;
1506
1506
  }
1507
- function jo(t, e) {
1507
+ function zo(t, e) {
1508
1508
  const n = e.tail;
1509
1509
  if (!n || !Array.isArray(n.words) || n.replaced !== t.length || n.words.length !== t.length) return !1;
1510
1510
  let r = !1;
@@ -1521,7 +1521,7 @@ function jo(t, e) {
1521
1521
  }
1522
1522
  return r;
1523
1523
  }
1524
- function zo(t, e) {
1524
+ function Io(t, e) {
1525
1525
  var n;
1526
1526
  switch (delete t.numbers, e.type) {
1527
1527
  case "transcript.committed": {
@@ -1562,7 +1562,7 @@ function zo(t, e) {
1562
1562
  }
1563
1563
  case "transcript.amended": {
1564
1564
  const r = t.segments.get(e.seq);
1565
- if (r && r.corrected && jo(r.words, e)) {
1565
+ if (r && r.corrected && zo(r.words, e)) {
1566
1566
  r.text = e.text, r.words = rn(e.seq, e.tail.words);
1567
1567
  break;
1568
1568
  }
@@ -1610,7 +1610,7 @@ function zo(t, e) {
1610
1610
  seqs: r.seqs,
1611
1611
  speaker: r.speaker,
1612
1612
  start: r.start,
1613
- wallStart: ko(t, r.start),
1613
+ wallStart: jo(t, r.start),
1614
1614
  text: a ? s.text : r.text,
1615
1615
  status: r.status === "open" ? "open" : "closed",
1616
1616
  settled: !!r.settled,
@@ -1662,7 +1662,7 @@ function zo(t, e) {
1662
1662
  }
1663
1663
  return typeof e.seq == "number" && (t.lastSeq = Math.max(t.lastSeq, e.seq)), t;
1664
1664
  }
1665
- function Io(t) {
1665
+ function Oo(t) {
1666
1666
  const e = [], n = [...t.sentences.values()].sort((r, s) => r.start - s.start || (r.sentenceId ?? 0) - (s.sentenceId ?? 0));
1667
1667
  for (const r of n) {
1668
1668
  const s = r.seqs.map((l) => t.segments.get(l)).filter(Boolean), a = s.length === r.seqs.length || !r.text ? s.flatMap((l) => l.words) : [], o = s[s.length - 1];
@@ -1675,16 +1675,16 @@ function Io(t) {
1675
1675
  catchup: s.some((l) => l.catchup),
1676
1676
  suppressed: r.suppressed || s.length > 0 && s.every((l) => l.suppressed),
1677
1677
  unclear: r.unclear || s.length > 0 && s.every((l) => l.unclear),
1678
- confidence: Oo(s),
1678
+ confidence: Co(s),
1679
1679
  latencyS: o == null ? void 0 : o.latencyS,
1680
1680
  settled: r.settled || s.length > 0 && s.every((l) => l.settled),
1681
- translations: Object.keys(r.translations).length ? r.translations : Co(s),
1681
+ translations: Object.keys(r.translations).length ? r.translations : bo(s),
1682
1682
  speaker: r.speaker >= 0 ? r.speaker : (o == null ? void 0 : o.speaker) ?? -1
1683
1683
  });
1684
1684
  }
1685
1685
  return e.sort((r, s) => r.start - s.start), e;
1686
1686
  }
1687
- function Oo(t) {
1687
+ function Co(t) {
1688
1688
  let e = 0, n = 0;
1689
1689
  for (const r of t) {
1690
1690
  if (r.confidence == null) continue;
@@ -1693,20 +1693,20 @@ function Oo(t) {
1693
1693
  }
1694
1694
  return n ? e / n : void 0;
1695
1695
  }
1696
- function Co(t) {
1696
+ function bo(t) {
1697
1697
  const e = {};
1698
1698
  for (const n of t) for (const [r, s] of Object.entries(n.translations)) e[r] = e[r] ? `${e[r]} ${s}` : s;
1699
1699
  return e;
1700
1700
  }
1701
- const bo = 0.85, xo = 0.75;
1702
- function Do(t) {
1703
- return t == null ? "" : t < xo ? "low" : t < bo ? "mid" : "";
1701
+ const xo = 0.85, Do = 0.75;
1702
+ function So(t) {
1703
+ return t == null ? "" : t < Do ? "low" : t < xo ? "mid" : "";
1704
1704
  }
1705
1705
  const Ln = ["a", "b", "c", "d", "e", "f", "g", "h"];
1706
- function So(t) {
1706
+ function Ao(t) {
1707
1707
  return Ln[(t % Ln.length + Ln.length) % Ln.length];
1708
1708
  }
1709
- function Ao(t) {
1709
+ function Eo(t) {
1710
1710
  if (t.numbers) return t.numbers;
1711
1711
  const e = /* @__PURE__ */ new Map(), n = (a, o) => {
1712
1712
  if (a < 0) return;
@@ -1722,12 +1722,12 @@ function Ao(t) {
1722
1722
  }
1723
1723
  function xn(t, e) {
1724
1724
  if (e < 0) return 0;
1725
- const n = Ao(t);
1725
+ const n = Eo(t);
1726
1726
  return n.get(e) ?? n.size + 1 + e;
1727
1727
  }
1728
- const Eo = /^\s*speaker\s+\d+\s*$/i;
1728
+ const _o = /^\s*speaker\s+\d+\s*$/i;
1729
1729
  function Fs(t) {
1730
- return t && t.trim() && !Eo.test(t) ? t : void 0;
1730
+ return t && t.trim() && !_o.test(t) ? t : void 0;
1731
1731
  }
1732
1732
  function vi(t, e) {
1733
1733
  var n;
@@ -1741,7 +1741,7 @@ function ki(t, e) {
1741
1741
  const n = vi(t, e);
1742
1742
  return n ? (n.split(" ").filter(Boolean).slice(0, 2).map((s) => s[0]).join("") || `S${xn(t, e)}`).toUpperCase() : `S${xn(t, e)}`;
1743
1743
  }
1744
- function _o(t) {
1744
+ function Yo(t) {
1745
1745
  if (t) {
1746
1746
  if (t.startsWith("#"))
1747
1747
  return { fg: t, soft: `color-mix(in srgb, ${t} 16%, transparent)` };
@@ -1750,10 +1750,10 @@ function _o(t) {
1750
1750
  }
1751
1751
  }
1752
1752
  function Dr(t, e) {
1753
- const n = t.speakerIds[e], r = _o(n == null ? void 0 : n.color);
1754
- return { fg: r == null ? void 0 : r.fg, soft: r == null ? void 0 : r.soft, lane: So(xn(t, e) - 1), hasVoice: !!n };
1753
+ const n = t.speakerIds[e], r = Yo(n == null ? void 0 : n.color);
1754
+ return { fg: r == null ? void 0 : r.fg, soft: r == null ? void 0 : r.soft, lane: Ao(xn(t, e) - 1), hasVoice: !!n };
1755
1755
  }
1756
- function Yo(t, e, n, r = !1) {
1756
+ function Uo(t, e, n, r = !1) {
1757
1757
  const s = n ? n.speakerLabels ?? "auto" : null, a = (r ? s : null) ?? t.labels ?? s ?? "on";
1758
1758
  if (a !== "auto") return a === "on";
1759
1759
  const o = /* @__PURE__ */ new Set();
@@ -1761,7 +1761,7 @@ function Yo(t, e, n, r = !1) {
1761
1761
  return !0;
1762
1762
  return !1;
1763
1763
  }
1764
- const Uo = /* @__PURE__ */ new Set([
1764
+ const Ro = /* @__PURE__ */ new Set([
1765
1765
  "invalid_audio",
1766
1766
  "invalid_options",
1767
1767
  "invalid_token",
@@ -1801,7 +1801,7 @@ const Uo = /* @__PURE__ */ new Set([
1801
1801
  function kt(t) {
1802
1802
  const e = t, n = typeof (e == null ? void 0 : e.code) == "string" ? e.code : void 0, r = typeof (e == null ? void 0 : e.status) == "number" ? e.status : void 0, s = e == null ? void 0 : e.details;
1803
1803
  if (n || r && r >= 400)
1804
- return n && Uo.has(n) && typeof (e == null ? void 0 : e.message) == "string" ? { message: e.message, code: n, status: r, details: s } : n === "unavailable" && r === void 0 ? { message: or, code: n, details: s } : r === 0 ? { message: typeof (e == null ? void 0 : e.message) == "string" ? e.message : or, code: n, status: r, details: s } : { message: n && ji[n] || Tr, code: n, status: r, details: s };
1804
+ return n && Ro.has(n) && typeof (e == null ? void 0 : e.message) == "string" ? { message: e.message, code: n, status: r, details: s } : n === "unavailable" && r === void 0 ? { message: or, code: n, details: s } : r === 0 ? { message: typeof (e == null ? void 0 : e.message) == "string" ? e.message : or, code: n, status: r, details: s } : { message: n && ji[n] || Tr, code: n, status: r, details: s };
1805
1805
  const a = (e == null ? void 0 : e.name) ?? "";
1806
1806
  return a === "TypeError" && /fetch|network|load failed/i.test(String((e == null ? void 0 : e.message) ?? "")) ? (typeof navigator < "u" && navigator.onLine !== !1 && hi(t instanceof Error ? t : new Error(String(t))), { message: or }) : Gs[a] ? { message: Gs[a] } : t instanceof Error && a === "Error" && !(t instanceof ci) ? { message: t.message } : { message: Tr };
1807
1807
  }
@@ -1811,19 +1811,19 @@ function _t() {
1811
1811
  if (!t) throw new Error("VocalStack player hooks must be used inside <VocalStackPlayer> or <PlayerApiProvider>");
1812
1812
  return t;
1813
1813
  }
1814
- function Ro(t) {
1815
- return t.value ? /* @__PURE__ */ i(Sr.Provider, { value: t.value, children: t.children }) : /* @__PURE__ */ i(Po, { ...t });
1814
+ function Po(t) {
1815
+ return t.value ? /* @__PURE__ */ i(Sr.Provider, { value: t.value, children: t.children }) : /* @__PURE__ */ i(Qo, { ...t });
1816
1816
  }
1817
- function Po({ children: t, ...e }) {
1817
+ function Qo({ children: t, ...e }) {
1818
1818
  const n = Ii(e);
1819
1819
  return /* @__PURE__ */ i(Sr.Provider, { value: n, children: t });
1820
1820
  }
1821
- const Qo = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
1822
- function $o(t) {
1823
- return Qo.test(t);
1821
+ const $o = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
1822
+ function Bo(t) {
1823
+ return $o.test(t);
1824
1824
  }
1825
1825
  function Ii(t) {
1826
- const e = t.listen ?? null, n = e ? null : t.listenerToken ?? null, r = !e && !n && !!t.token && (!t.id || $o(t.id)), s = (t.baseUrl ?? zi).replace(/\/$/, ""), a = k(t.token);
1826
+ const e = t.listen ?? null, n = e ? null : t.listenerToken ?? null, r = !e && !n && !!t.token && (!t.id || Bo(t.id)), s = (t.baseUrl ?? zi).replace(/\/$/, ""), a = k(t.token);
1827
1827
  a.current = t.token;
1828
1828
  const o = !!t.token, l = Ie(() => async () => {
1829
1829
  const d = a.current;
@@ -1836,10 +1836,10 @@ function Ii(t) {
1836
1836
  return { client: u, origin: s, owner: r, shareCode: d, listen: null, bearer: l, cred: { shareCode: d }, readAs: d ? { shareCode: d } : {} };
1837
1837
  }, [u, s, r, t.id, l, e, n]);
1838
1838
  }
1839
- function Bo(t, e) {
1839
+ function Vo(t, e) {
1840
1840
  return e ? { ...t, cred: { media: e } } : t;
1841
1841
  }
1842
- async function Vo(t, e) {
1842
+ async function Ho(t, e) {
1843
1843
  if (t.listen) {
1844
1844
  const r = await t.client.recordings.get(t.listen.recordingId, t.readAs), s = r;
1845
1845
  return { key: e, code: null, transcriptionId: t.listen.transcriptionId, name: s.name ?? s.title ?? "", recording: r, job: s.job ?? (s.source ? { source: s.source } : null), allowDownload: !0, allowExport: !0, allowTranslate: !0, sharedBy: null };
@@ -1864,11 +1864,11 @@ async function Vo(t, e) {
1864
1864
  sharedBy: n.sharedBy ?? null
1865
1865
  };
1866
1866
  }
1867
- function Ho(t, e) {
1867
+ function Wo(t, e) {
1868
1868
  const [n, r] = j(null), [s, a] = j(!1), [o, l] = j(null), [c, u] = j(0);
1869
1869
  return Y(() => {
1870
1870
  let d = !0;
1871
- return Vo(t, e).then((h) => {
1871
+ return Ho(t, e).then((h) => {
1872
1872
  d && (r(h), a(!1), l(null));
1873
1873
  }).catch((h) => {
1874
1874
  if (!d) return;
@@ -1879,7 +1879,7 @@ function Ho(t, e) {
1879
1879
  };
1880
1880
  }, [t, e, c]), { source: n, gone: s, error: o, reload: () => u((d) => d + 1) };
1881
1881
  }
1882
- function Wo(t, e) {
1882
+ function Fo(t, e) {
1883
1883
  const [n, r] = j(null);
1884
1884
  return Y(() => {
1885
1885
  if (!t.owner || !e) {
@@ -1931,27 +1931,27 @@ function Ci(t, e) {
1931
1931
  };
1932
1932
  }, [...e, o]), { data: n, error: s, reload: () => l((c) => c + 1) };
1933
1933
  }
1934
- const Fo = (t) => new Promise((e) => setTimeout(e, t)), Go = 2500, Zo = 72;
1935
- function qo(t, e) {
1934
+ const Go = (t) => new Promise((e) => setTimeout(e, t)), Zo = 2500, qo = 72;
1935
+ function Ko(t, e) {
1936
1936
  const n = _t(), r = k(n);
1937
1937
  r.current = n;
1938
1938
  const [s, a] = j($t), o = k($t()), l = k(null), c = k(e.lang ?? null), [u, d] = j(!1), [h, M] = j(null), [N, p] = j(!1), y = Je(() => {
1939
1939
  const S = o.current;
1940
1940
  a({ ...S });
1941
- }, []), L = k(e);
1942
- L.current = e, Y(() => {
1941
+ }, []), v = k(e);
1942
+ v.current = e, Y(() => {
1943
1943
  if (!t) return;
1944
1944
  let S = !0, T = 0;
1945
1945
  o.current = $t(), a($t()), p(!1);
1946
1946
  const E = n.client;
1947
1947
  let O = o.current.state;
1948
1948
  const te = () => {
1949
- var v, ie;
1949
+ var L, ie;
1950
1950
  const K = o.current.state;
1951
- K !== O && (O = K, (ie = (v = L.current).onState) == null || ie.call(v, K));
1951
+ K !== O && (O = K, (ie = (L = v.current).onState) == null || ie.call(L, K));
1952
1952
  };
1953
1953
  return (async () => {
1954
- var K, v, ie, ne;
1954
+ var K, L, ie, ne;
1955
1955
  for (; S; ) {
1956
1956
  let G = null;
1957
1957
  try {
@@ -1966,9 +1966,9 @@ function qo(t, e) {
1966
1966
  if (le.type === "snapshot")
1967
1967
  o.current = ar(le.snapshot, le.reason === "gap" ? o.current : $t()), y(), te();
1968
1968
  else if (le.type === "frame") {
1969
- zo(o.current, le.frame);
1969
+ Io(o.current, le.frame);
1970
1970
  const Te = le.frame;
1971
- Te.type === "recording.state" && (O = o.current.state, (v = (K = L.current).onState) == null || v.call(K, Te.state, Te.reason)), (ne = (ie = L.current).onFrame) == null || ne.call(ie, Te), y();
1971
+ Te.type === "recording.state" && (O = o.current.state, (L = (K = v.current).onState) == null || L.call(K, Te.state, Te.reason)), (ne = (ie = v.current).onFrame) == null || ne.call(ie, Te), y();
1972
1972
  } else le.type === "closed" && d(!1);
1973
1973
  }
1974
1974
  } catch (pe) {
@@ -2001,7 +2001,7 @@ function qo(t, e) {
2001
2001
  }
2002
2002
  const J = o.current.state;
2003
2003
  if (!S || J === "ended" || J === "finalized" || J === "processing") return;
2004
- T += 1, await Fo(Math.min(15e3, 1e3 * 2 ** Math.min(T, 4)));
2004
+ T += 1, await Go(Math.min(15e3, 1e3 * 2 ** Math.min(T, 4)));
2005
2005
  }
2006
2006
  })(), () => {
2007
2007
  var K;
@@ -2013,13 +2013,13 @@ function qo(t, e) {
2013
2013
  if (c.current = S, (te = l.current) == null || te.setLanguage(S), !t) return;
2014
2014
  const T = r.current.client, E = ++D.current;
2015
2015
  f(!0), b(null);
2016
- const O = (K) => T.recordings.transcript(t, { lang: S ?? void 0, ...r.current.readAs, asListener: !r.current.owner }).then((v) => {
2017
- E === D.current && (o.current = ar(v, o.current), _(S), y(), v.translationPending && K > 0 && window.setTimeout(() => {
2016
+ const O = (K) => T.recordings.transcript(t, { lang: S ?? void 0, ...r.current.readAs, asListener: !r.current.owner }).then((L) => {
2017
+ E === D.current && (o.current = ar(L, o.current), _(S), y(), L.translationPending && K > 0 && window.setTimeout(() => {
2018
2018
  E === D.current && O(K - 1).catch(() => {
2019
2019
  });
2020
- }, Go));
2020
+ }, Zo));
2021
2021
  });
2022
- O(Zo).catch(() => {
2022
+ O(qo).catch(() => {
2023
2023
  E === D.current && S && b(S);
2024
2024
  }).finally(() => {
2025
2025
  E === D.current && f(!1);
@@ -2028,8 +2028,8 @@ function qo(t, e) {
2028
2028
  const E = o.current;
2029
2029
  let O = !1;
2030
2030
  for (const [te, K] of Object.entries(T)) {
2031
- const v = E.sentences.get(Number(te));
2032
- v && (v.translations = { ...v.translations, [S]: K }, O = !0);
2031
+ const L = E.sentences.get(Number(te));
2032
+ L && (L.translations = { ...L.translations, [S]: K }, O = !0);
2033
2033
  }
2034
2034
  O && y();
2035
2035
  }, [y]), F = Je(() => M(null), []);
@@ -2067,14 +2067,14 @@ function cr(t) {
2067
2067
  return "queued";
2068
2068
  }
2069
2069
  }
2070
- function Ko(t) {
2070
+ function Jo(t) {
2071
2071
  return t ? t.progress ? { state: t.state, processedS: t.progress.processedS, totalS: t.progress.totalS ?? null, segmentsDone: t.progress.segmentsDone, segmentsTotal: t.progress.segmentsTotal ?? null, pct: t.progress.pct, error: t.error ?? null } : t.state ? { state: t.state, processedS: 0, totalS: null, segmentsDone: 0, segmentsTotal: null, pct: 0, error: t.error ?? null } : null : null;
2072
2072
  }
2073
- const Jo = (t, e) => {
2073
+ const Xo = (t, e) => {
2074
2074
  const n = (t == null ? void 0 : t.segmentsDone) ?? e, r = Math.max(n, (t == null ? void 0 : t.segmentsTotal) ?? n);
2075
2075
  return `${n} / ${r} SEGMENTS`;
2076
2076
  };
2077
- function Xo(t, e) {
2077
+ function el(t, e) {
2078
2078
  var s;
2079
2079
  const n = ((s = t == null ? void 0 : t.source) == null ? void 0 : s.durationS) ?? (e == null ? void 0 : e.totalS) ?? null, r = t == null ? void 0 : t.crop;
2080
2080
  if (r && (r.startS != null || r.endS != null)) {
@@ -2093,19 +2093,19 @@ function Ar(t) {
2093
2093
  const e = document.createElement("a");
2094
2094
  e.href = t, e.style.display = "none", document.body.appendChild(e), e.click(), e.remove();
2095
2095
  }
2096
- async function el(t) {
2096
+ async function tl(t) {
2097
2097
  const e = await fetch(t, { redirect: "manual" });
2098
2098
  if (e.type !== "opaqueredirect" && !e.ok) throw await xi(e);
2099
2099
  Ar(t);
2100
2100
  }
2101
- async function tl(t, e, n, r = {}) {
2101
+ async function nl(t, e, n, r = {}) {
2102
2102
  var M, N;
2103
2103
  const s = await t.client.recordings.export(e, n, { lang: r.lang ?? void 0, ...t.readAs });
2104
2104
  if (!s.ok) throw await xi(s);
2105
2105
  const a = await s.blob(), o = s.headers.get("content-disposition") ?? "", l = (M = /filename\*=UTF-8''([^;]+)/i.exec(o)) == null ? void 0 : M[1], c = (N = /filename="([^"]+)"/i.exec(o)) == null ? void 0 : N[1], u = l ? decodeURIComponent(l) : c ?? `transcript.${n}`, d = URL.createObjectURL(a), h = document.createElement("a");
2106
2106
  h.href = d, h.download = u, h.style.display = "none", document.body.appendChild(h), h.click(), h.remove(), window.setTimeout(() => URL.revokeObjectURL(d), 6e4);
2107
2107
  }
2108
- async function nl(t, e) {
2108
+ async function rl(t, e) {
2109
2109
  const { recordingId: n, lang: r, voiceKey: s, cred: a } = e, o = async () => (await t.client.recordings.voice(n, r, t.readAs)).filter((h) => h.lang === r), l = (d) => Ni(d, s);
2110
2110
  let c = l(await o());
2111
2111
  (!c || c.state === "clips" || c.state === "failed") && await e.request();
@@ -2120,20 +2120,20 @@ async function nl(t, e) {
2120
2120
  const Di = (t) => {
2121
2121
  var e;
2122
2122
  return ((e = t == null ? void 0 : t.match(/(?:youtu\.be\/|[?&]v=|\/shorts\/|\/embed\/|\/live\/)([\w-]{11})/)) == null ? void 0 : e[1]) ?? null;
2123
- }, rl = (t) => `https://www.youtube-nocookie.com/embed/${t}?autoplay=1&mute=1&controls=0&rel=0&modestbranding=1&playsinline=1&iv_load_policy=3`, Ks = 0.3, sl = 1.5;
2123
+ }, sl = (t) => `https://www.youtube-nocookie.com/embed/${t}?autoplay=1&mute=1&controls=0&rel=0&modestbranding=1&playsinline=1&iv_load_policy=3`, Ks = 0.3, il = 1.5;
2124
2124
  function Si(t, e, n) {
2125
2125
  var s;
2126
2126
  const r = (s = t.words[t.words.length - 1]) == null ? void 0 : s.end;
2127
2127
  return r != null && r > t.start ? r : t.end != null && t.end > t.start ? t.end : (e == null ? void 0 : e.start) ?? n;
2128
2128
  }
2129
- function il(t, e, n) {
2129
+ function al(t, e, n) {
2130
2130
  var c, u;
2131
2131
  const r = t[e];
2132
2132
  if (!r) return !1;
2133
- const s = (((c = r.words[0]) == null ? void 0 : c.start) ?? r.start) - Ks, a = t[e + 1], o = Si(r, a, r.start + 4) + sl, l = a ? Math.min(o, (((u = a.words[0]) == null ? void 0 : u.start) ?? a.start) - Ks) : o;
2133
+ const s = (((c = r.words[0]) == null ? void 0 : c.start) ?? r.start) - Ks, a = t[e + 1], o = Si(r, a, r.start + 4) + il, l = a ? Math.min(o, (((u = a.words[0]) == null ? void 0 : u.start) ?? a.start) - Ks) : o;
2134
2134
  return n >= s && n < Math.max(l, s + 0.5);
2135
2135
  }
2136
- function al(t, e, n) {
2136
+ function ol(t, e, n) {
2137
2137
  const r = Math.max(0, n - e), s = t.map((l) => Math.max(1, [...l.replace(/[^\p{L}\p{N}]/gu, "")].length)), a = s.reduce((l, c) => l + c, 0) || 1;
2138
2138
  let o = e;
2139
2139
  return t.map((l, c) => {
@@ -2148,7 +2148,7 @@ function ur(t) {
2148
2148
  bottom: Math.min(parseFloat(e.paddingBottom) || 0, n)
2149
2149
  };
2150
2150
  }
2151
- function ol(t, e, n = 0) {
2151
+ function ll(t, e, n = 0) {
2152
2152
  const r = k(() => {
2153
2153
  });
2154
2154
  Y(() => {
@@ -2182,11 +2182,11 @@ function ol(t, e, n = 0) {
2182
2182
  d || (a.style.opacity = "0");
2183
2183
  }, 900);
2184
2184
  };
2185
- let y = null, L = null;
2185
+ let y = null, v = null;
2186
2186
  const m = (_) => {
2187
2187
  N();
2188
2188
  const X = o();
2189
- X && X !== L && y && (L = X, y.observe(X));
2189
+ X && X !== v && y && (v = X, y.observe(X));
2190
2190
  const z = l();
2191
2191
  if (z.vis < 60 || z.max < 6) {
2192
2192
  a.style.opacity = "0", a.style.pointerEvents = "none";
@@ -2211,10 +2211,10 @@ function ol(t, e, n = 0) {
2211
2211
  };
2212
2212
  }, []);
2213
2213
  }
2214
- function ll({ thumbRef: t }) {
2214
+ function cl({ thumbRef: t }) {
2215
2215
  return /* @__PURE__ */ i("div", { className: "feedbar", "aria-hidden": "true", children: /* @__PURE__ */ i("div", { ref: t, className: "feedbar__thumb" }) });
2216
2216
  }
2217
- function cl({ error: t, onClose: e }) {
2217
+ function ul({ error: t, onClose: e }) {
2218
2218
  const n = k(e);
2219
2219
  if (n.current = e, Y(() => {
2220
2220
  if (!t) return;
@@ -2237,7 +2237,7 @@ function cl({ error: t, onClose: e }) {
2237
2237
  function Ai({ color: t }) {
2238
2238
  return /* @__PURE__ */ i("span", { title: "Cloned voice", style: { flex: "none", display: "inline-flex" }, children: /* @__PURE__ */ i(oe, { d: ee.voiceClone, size: 13, sw: 1.7, stroke: t }) });
2239
2239
  }
2240
- function au({ chip: t, note: e, scrub: n, mute: r, voice: s, prev: a, play: o, next: l }) {
2240
+ function ou({ chip: t, note: e, scrub: n, mute: r, voice: s, prev: a, play: o, next: l }) {
2241
2241
  return /* @__PURE__ */ g("div", { className: "vs-tt", children: [
2242
2242
  /* @__PURE__ */ g("div", { className: "vs-tt__r1", children: [
2243
2243
  /* @__PURE__ */ i("div", { className: "vs-tt__chip", children: t }),
@@ -2254,8 +2254,8 @@ function au({ chip: t, note: e, scrub: n, mute: r, voice: s, prev: a, play: o, n
2254
2254
  ] })
2255
2255
  ] });
2256
2256
  }
2257
- function ul({ index: t, total: e, atLabel: n, durLabel: r, stepLabel: s, onSeek: a, onSeekFrac: o, onScrubStart: l, onScrubEnd: c, frac: u, glideMs: d = 260 }) {
2258
- const h = k(null), M = k(!1), [N, p] = j(null), y = Math.max(1, e), L = N ?? u, m = L != null ? Math.min(100, Math.max(0, L * 100)) : t / Math.max(1, y - 1) * 100, f = u != null && d > 0 && N == null ? `width ${d}ms linear, left ${d}ms linear` : "none", I = (D) => {
2257
+ function dl({ index: t, total: e, atLabel: n, durLabel: r, stepLabel: s, onSeek: a, onSeekFrac: o, onScrubStart: l, onScrubEnd: c, frac: u, glideMs: d = 260 }) {
2258
+ const h = k(null), M = k(!1), [N, p] = j(null), y = Math.max(1, e), v = N ?? u, m = v != null ? Math.min(100, Math.max(0, v * 100)) : t / Math.max(1, y - 1) * 100, f = u != null && d > 0 && N == null ? `width ${d}ms linear, left ${d}ms linear` : "none", I = (D) => {
2259
2259
  var z;
2260
2260
  const B = (z = h.current) == null ? void 0 : z.getBoundingClientRect();
2261
2261
  if (!B) return;
@@ -2298,7 +2298,7 @@ function ul({ index: t, total: e, atLabel: n, durLabel: r, stepLabel: s, onSeek:
2298
2298
  ] })
2299
2299
  ] });
2300
2300
  }
2301
- function dl(t, e, n) {
2301
+ function hl(t, e, n) {
2302
2302
  const r = new Set(t.seqs ?? t.words.map((l) => l.seq)), s = (e ?? []).filter((l) => !l.revertedAt && l.seq != null && r.has(l.seq) && (l.kind === "word" || l.kind === "line")), a = s.some((l) => l.kind === "line"), o = (l) => !!(n != null && n.has(`${l.seq}:${l.idx}`));
2303
2303
  return {
2304
2304
  script: a ? 0 : t.words.filter((l) => l.script && !o(l)).length,
@@ -2306,7 +2306,7 @@ function dl(t, e, n) {
2306
2306
  manualCount: a ? 0 : s.filter((l) => l.kind === "word").length
2307
2307
  };
2308
2308
  }
2309
- function hl({ f: t, desk: e, onOpen: n }) {
2309
+ function Ml({ f: t, desk: e, onOpen: n }) {
2310
2310
  const r = (s, a, o) => /* @__PURE__ */ g("span", { role: "button", title: "Open this line in Fix", className: "badge badge--fix", style: { marginLeft: o ? "auto" : 0 }, onClick: (l) => {
2311
2311
  l.stopPropagation(), n == null || n();
2312
2312
  }, children: [
@@ -2319,7 +2319,7 @@ function hl({ f: t, desk: e, onOpen: n }) {
2319
2319
  t.manual && r(e ? "MANUAL FIX" : "MANUAL", t.manualCount, t.script === 0)
2320
2320
  ] });
2321
2321
  }
2322
- function Ml({ onOpen: t, alone: e }) {
2322
+ function gl({ onOpen: t, alone: e }) {
2323
2323
  const [n, r] = j(!1);
2324
2324
  return /* @__PURE__ */ g("span", { role: "button", title: "Fix this line", className: `badge badge--pen${n ? " is-over" : ""}`, style: { marginLeft: e ? "auto" : 0 }, onMouseEnter: () => r(!0), onMouseLeave: () => r(!1), onClick: (s) => {
2325
2325
  s.stopPropagation(), t();
@@ -2328,7 +2328,7 @@ function Ml({ onOpen: t, alone: e }) {
2328
2328
  n && "FIX"
2329
2329
  ] });
2330
2330
  }
2331
- function gl(t, e, n, r) {
2331
+ function fl(t, e, n, r) {
2332
2332
  const s = _t(), [a, o] = j([]), [l, c] = j(0), u = k(/* @__PURE__ */ new Set()), d = k(!1), h = Ie(() => new Map(n.filter((N) => N.sentenceId != null).map((N) => [N.sentenceId, N])), [n]);
2333
2333
  Y(() => {
2334
2334
  u.current = /* @__PURE__ */ new Set();
@@ -2348,20 +2348,20 @@ function gl(t, e, n, r) {
2348
2348
  }).catch((p) => {
2349
2349
  const y = p == null ? void 0 : p.status;
2350
2350
  if (!(y && y >= 400 && y < 500))
2351
- for (const L of N) u.current.delete(`${e}:${L}`);
2351
+ for (const v of N) u.current.delete(`${e}:${v}`);
2352
2352
  }).finally(() => {
2353
2353
  d.current = !1, c((p) => p + 1);
2354
2354
  });
2355
2355
  }
2356
2356
  }, [t, e, a, l, h, r]), M;
2357
2357
  }
2358
- function fl(t) {
2358
+ function pl(t) {
2359
2359
  return t.live || t.auto ? "From this session" : t.cloned ? t.library === !1 ? "This transcription only" : "Saved in Voices" : "";
2360
2360
  }
2361
2361
  function tn(t, e) {
2362
2362
  return t.cloned ? { rank: 0, head: e.vcSheet } : t.gender === "male" ? { rank: 1, head: e.vcMale.toUpperCase() } : t.gender === "female" ? { rank: 2, head: e.vcFemale.toUpperCase() } : { rank: 3, head: e.vcSynth };
2363
2363
  }
2364
- function pl(t, e) {
2364
+ function Nl(t, e) {
2365
2365
  const n = t.slice().sort((s, a) => tn(s, e).rank - tn(a, e).rank || s.name.localeCompare(a.name, void 0, { numeric: !0 })), r = {};
2366
2366
  for (const s of n) {
2367
2367
  const a = tn(s, e).head;
@@ -2372,7 +2372,7 @@ function pl(t, e) {
2372
2372
  return { v: s, headOn: l, head: o, headCount: r[o], rule: l ? "0" : "1px solid var(--hair)" };
2373
2373
  });
2374
2374
  }
2375
- function Nl(t, e, n) {
2375
+ function ml(t, e, n) {
2376
2376
  const r = /* @__PURE__ */ new Set();
2377
2377
  let s = !1;
2378
2378
  for (const o of t)
@@ -2422,7 +2422,7 @@ function ei(t, e, n = !0) {
2422
2422
  }
2423
2423
  return a;
2424
2424
  }
2425
- function ml({ roster: t, selected: e, onSelect: n, noClone: r, building: s, short: a, warn: o, sexOf: l, t: c }) {
2425
+ function yl({ roster: t, selected: e, onSelect: n, noClone: r, building: s, short: a, warn: o, sexOf: l, t: c }) {
2426
2426
  const u = t.find((d) => d.key === e) ?? t[0] ?? null;
2427
2427
  return u ? /* @__PURE__ */ i("div", { style: { display: "flex", flexWrap: "wrap", gap: 6, padding: "0 2px 9px", margin: "0 -2px" }, children: t.map((d) => {
2428
2428
  const h = d.key === u.key, M = d.key >= 0 ? (o == null ? void 0 : o(d)) ?? null : null, N = d.key >= 0 && !M && !!(s != null && s(d)), p = d.key >= 0 && !M && !N && r(d), y = d.key >= 0 && !M && !N && !p && !d.hasVoice && !!(a != null && a(d));
@@ -2454,14 +2454,14 @@ function ml({ roster: t, selected: e, onSelect: n, noClone: r, building: s, shor
2454
2454
  );
2455
2455
  }) }) : null;
2456
2456
  }
2457
- function yl({ cast: t, voices: e, currentId: n, armedId: r = null, sampleId: s = null, dlId: a = null, onPick: o, onAdd: l, onUse: c, usedBy: u, foldKey: d, foldFor: h = null, problem: M, noClone: N = null, t: p }) {
2458
- const y = Ie(() => pl(e, p), [e, p]), [L, m] = j({});
2457
+ function Tl({ cast: t, voices: e, currentId: n, armedId: r = null, sampleId: s = null, dlId: a = null, onPick: o, onAdd: l, onUse: c, usedBy: u, foldKey: d, foldFor: h = null, problem: M, noClone: N = null, t: p }) {
2458
+ const y = Ie(() => Nl(e, p), [e, p]), [v, m] = j({});
2459
2459
  Y(() => {
2460
2460
  m({});
2461
2461
  }, [d, h]);
2462
2462
  const f = (D) => D === p.vcMale.toUpperCase() || D === p.vcFemale.toUpperCase(), I = (D) => {
2463
2463
  if (D === p.vcSheet) return !0;
2464
- const B = L[D];
2464
+ const B = v[D];
2465
2465
  return B != null ? !B : !h || !f(D) ? !0 : D === (h === "female" ? p.vcFemale : p.vcMale).toUpperCase();
2466
2466
  }, b = !!r && r !== n;
2467
2467
  return /* @__PURE__ */ g("div", { style: { display: "flex", flexDirection: "column" }, children: [
@@ -2484,7 +2484,7 @@ function yl({ cast: t, voices: e, currentId: n, armedId: r = null, sampleId: s =
2484
2484
  ] })
2485
2485
  ] }),
2486
2486
  y.map(({ v: D, headOn: B, head: _, headCount: X, rule: z }, F) => {
2487
- const S = fl(D), T = a === D.id, E = I(_), O = (u == null ? void 0 : u(D)) ?? null;
2487
+ const S = pl(D), T = a === D.id, E = I(_), O = (u == null ? void 0 : u(D)) ?? null;
2488
2488
  return /* @__PURE__ */ g(La, { children: [
2489
2489
  B && _ === p.vcSheet && /* @__PURE__ */ i("div", { style: { display: "flex", alignItems: "center", padding: "14px 2px 6px", borderTop: F === 0 && !N ? "0" : "1px solid var(--hair)", userSelect: "none" }, children: /* @__PURE__ */ i("span", { style: { font: "600 9px var(--vs-font-mono)", letterSpacing: ".13em", color: "var(--ink-62)" }, children: _ }) }),
2490
2490
  B && _ !== p.vcSheet && /* @__PURE__ */ g(
@@ -2515,7 +2515,7 @@ function yl({ cast: t, voices: e, currentId: n, armedId: r = null, sampleId: s =
2515
2515
  style: { width: "100%", textAlign: "left", font: "inherit", border: 0, borderTop: E ? z : "0", display: "flex", alignItems: "center", gap: 11, padding: E ? "11px 8px" : "0px 8px", margin: "0 -6px", borderRadius: 10, background: r === D.id ? "var(--brand-tint)" : "transparent", cursor: "pointer", opacity: E ? 1 : 0, maxHeight: E ? 120 : 0, overflow: "hidden", transition: "max-height 280ms cubic-bezier(.32,.72,0,1),padding 280ms cubic-bezier(.32,.72,0,1),opacity 200ms ease" },
2516
2516
  children: [
2517
2517
  /* @__PURE__ */ i("span", { title: T ? "Downloading this voice" : void 0, style: { flex: "none", width: 32, height: 32, borderRadius: "50%", background: T ? "transparent" : D.cloned ? "var(--brand-soft)" : "var(--fill-06)", display: "flex", alignItems: "center", justifyContent: "center" }, children: T ? /* @__PURE__ */ i("span", { style: { width: 16, height: 16, borderRadius: "50%", border: "2px solid var(--fill-10)", borderTopColor: "var(--brand)", animation: "vs-spin .7s linear infinite" } }) : s === D.id ? /* @__PURE__ */ g("span", { className: "vcplay", children: [
2518
- /* @__PURE__ */ i("span", { className: "vcplay__eq", children: /* @__PURE__ */ i(Tl, { height: 13, width: 2.5 }) }),
2518
+ /* @__PURE__ */ i("span", { className: "vcplay__eq", children: /* @__PURE__ */ i(wl, { height: 13, width: 2.5 }) }),
2519
2519
  /* @__PURE__ */ i("span", { className: "vcplay__stop", children: /* @__PURE__ */ i(xa, { size: 11 }) })
2520
2520
  ] }) : /* @__PURE__ */ i(oe, { d: D.cloned ? ee.voiceClone : D.gender === "female" ? ee.venus : D.gender === "male" ? ee.mars : ee.mic, size: 15, sw: 1.6, style: { color: D.cloned ? "var(--brand)" : "var(--ink-55)" } }) }),
2521
2521
  /* @__PURE__ */ g("div", { style: { flex: 1, minWidth: 0 }, children: [
@@ -2544,7 +2544,7 @@ function yl({ cast: t, voices: e, currentId: n, armedId: r = null, sampleId: s =
2544
2544
  b && /* @__PURE__ */ i("div", { style: { position: "sticky", bottom: 0, zIndex: 3, marginTop: 6, padding: "11px 0 3px", animation: "vs-slide-up .18s ease-out" }, children: /* @__PURE__ */ i("button", { type: "button", className: "vcuse", title: "Apply this voice", onClick: () => r && c(r), children: /* @__PURE__ */ i("span", { children: p.vcUse }) }) })
2545
2545
  ] });
2546
2546
  }
2547
- function Tl({ height: t, width: e = 2 }) {
2547
+ function wl({ height: t, width: e = 2 }) {
2548
2548
  const n = { width: e, height: "100%", borderRadius: 1, background: "var(--brand)" };
2549
2549
  return /* @__PURE__ */ g("span", { style: { flex: "none", display: "flex", alignItems: "flex-end", gap: 2, height: t }, children: [
2550
2550
  /* @__PURE__ */ i("span", { style: { ...n, animation: "vs-eq .62s ease-in-out infinite" } }),
@@ -2552,15 +2552,15 @@ function Tl({ height: t, width: e = 2 }) {
2552
2552
  /* @__PURE__ */ i("span", { style: { ...n, animation: "vs-eq .62s ease-in-out .38s infinite" } })
2553
2553
  ] });
2554
2554
  }
2555
- const wl = /* @__PURE__ */ g("span", { style: { display: "inline-flex", alignItems: "center", gap: 3 }, children: [
2555
+ const Ll = /* @__PURE__ */ g("span", { style: { display: "inline-flex", alignItems: "center", gap: 3 }, children: [
2556
2556
  /* @__PURE__ */ i(oe, { d: ee.langAuto, size: 19, sw: 1.7, style: { color: "var(--ink-62)", display: "block" } }),
2557
2557
  /* @__PURE__ */ i(oe, { d: ee.globe, size: 18, sw: 1.6, style: { color: "var(--ink-62)", display: "block" } })
2558
2558
  ] });
2559
2559
  function Lr(t, e) {
2560
2560
  const n = e ? t == null ? void 0 : t.languages.find((r) => r.code === e) : null;
2561
- return { flag: e ? (n == null ? void 0 : n.flag) ?? "🌐" : wl, code: e ? e.toUpperCase() : "", label: (n == null ? void 0 : n.native) ?? "As spoken", name: (n == null ? void 0 : n.name) ?? "Original" };
2561
+ return { flag: e ? (n == null ? void 0 : n.flag) ?? "🌐" : Ll, code: e ? e.toUpperCase() : "", label: (n == null ? void 0 : n.native) ?? "As spoken", name: (n == null ? void 0 : n.name) ?? "Original" };
2562
2562
  }
2563
- function Ll(t, e, n = 0, r) {
2563
+ function vl(t, e, n = 0, r) {
2564
2564
  const s = (r == null ? void 0 : r.id) ?? null, a = (r == null ? void 0 : r.token) ?? null, o = (r == null ? void 0 : r.shareCode) ?? null, l = _t(), { data: c } = Ci(async () => {
2565
2565
  if (!t || !e) return null;
2566
2566
  try {
@@ -2571,27 +2571,27 @@ function Ll(t, e, n = 0, r) {
2571
2571
  }, [t, e, n, s, a, o]);
2572
2572
  return c;
2573
2573
  }
2574
- function vl(t) {
2574
+ function kl(t) {
2575
2575
  return (/* @__PURE__ */ new Set([...Object.keys(t.speakers), ...Object.keys(t.speakerIds)])).size;
2576
2576
  }
2577
- function kl({ recordingId: t, lang: e, ended: n, cred: r, pickedVoice: s, sentenceIds: a }) {
2577
+ function jl({ recordingId: t, lang: e, ended: n, cred: r, pickedVoice: s, sentenceIds: a }) {
2578
2578
  const o = _t(), { data: l, reload: c } = Ci(async () => {
2579
2579
  if (!t || !e) return null;
2580
2580
  const K = await o.client.recordings.voice(t, e, o.readAs).catch(() => []);
2581
- return { recordingId: t, lang: e, rows: K.filter((v) => v.lang === e) };
2581
+ return { recordingId: t, lang: e, rows: K.filter((L) => L.lang === e) };
2582
2582
  }, [t, e, o, n]), u = Ie(
2583
2583
  () => l && l.lang === e && l.recordingId === t ? l.rows : [],
2584
2584
  [l, e, t]
2585
- ), d = Ie(() => Ni(u, s), [u, s]), h = d ? d.voiceKey || null : s, [M, N] = j(null), [p, y] = j(null), L = k(/* @__PURE__ */ new Set()), m = `${t ?? ""}|${e ?? ""}|${h ?? ""}`, f = Je(async (K, v) => {
2585
+ ), d = Ie(() => Ni(u, s), [u, s]), h = d ? d.voiceKey || null : s, [M, N] = j(null), [p, y] = j(null), v = k(/* @__PURE__ */ new Set()), m = `${t ?? ""}|${e ?? ""}|${h ?? ""}`, f = Je(async (K, L) => {
2586
2586
  if (!t || !e || !n) return;
2587
- const ie = v != null && v.size ? null : Xs(K), ne = v != null && v.size ? v : ie, G = ne && ne.size ? Object.fromEntries([...ne].map(([Te, je]) => [String(Te), je])) : null, J = `${t}|${e}|${G ? JSON.stringify(G) : K ?? ""}`;
2588
- if (L.current.has(J)) return;
2589
- L.current.add(J), N(J), y(null);
2587
+ const ie = L != null && L.size ? null : Xs(K), ne = L != null && L.size ? L : ie, G = ne && ne.size ? Object.fromEntries([...ne].map(([Te, je]) => [String(Te), je])) : null, J = `${t}|${e}|${G ? JSON.stringify(G) : K ?? ""}`;
2588
+ if (v.current.has(J)) return;
2589
+ v.current.add(J), N(J), y(null);
2590
2590
  const pe = { langs: [e] };
2591
2591
  G ? pe.voiceBySpeaker = G : K && (pe.voice = K);
2592
2592
  const le = await Zs(o, `/v1/recordings/${t}/voice`, { method: "POST", body: pe }).catch(() => null);
2593
2593
  if (N((Te) => Te === J ? null : Te), !(le != null && le.ok)) {
2594
- L.current.delete(J);
2594
+ v.current.delete(J);
2595
2595
  const Te = le ? await le.json().catch(() => null) : null;
2596
2596
  y((Te == null ? void 0 : Te.message) || "This voice could not be prepared.");
2597
2597
  return;
@@ -2599,15 +2599,15 @@ function kl({ recordingId: t, lang: e, ended: n, cred: r, pickedVoice: s, senten
2599
2599
  c();
2600
2600
  }, [t, e, n, o, c]), I = Je(() => {
2601
2601
  const K = `${t ?? ""}|${e ?? ""}|`;
2602
- for (const v of [...L.current]) v.startsWith(K) && L.current.delete(v);
2602
+ for (const L of [...v.current]) L.startsWith(K) && v.current.delete(L);
2603
2603
  y(null);
2604
2604
  }, [t, e]), b = !!d && (d.state === "queued" || d.state === "running") || M === m, D = (d == null ? void 0 : d.state) === "failed" ? d.error || "the render failed" : p, B = (a == null ? void 0 : a.join(",")) ?? "", [_, X] = j(null), z = Ie(() => new Set((d == null ? void 0 : d.clips) ?? []), [d]), F = Ie(() => n && B ? B.split(",").map(Number).filter((K) => !z.has(K)) : [], [n, B, z]), S = k(null);
2605
2605
  Y(() => {
2606
2606
  if (!n || !t || !e || !F.length) return;
2607
- const K = _ ?? F[0], v = F.find((pe) => pe >= K) ?? F[0], ie = `${t}|${e}|${h ?? ""}`, ne = S.current;
2608
- if (ne && ne.key === ie && Math.abs(ne.near - v) < 12 && Date.now() - ne.at < 6e4) return;
2609
- S.current = { key: ie, near: v, at: Date.now() };
2610
- const G = Xs(h), J = { langs: [e], near: v };
2607
+ const K = _ ?? F[0], L = F.find((pe) => pe >= K) ?? F[0], ie = `${t}|${e}|${h ?? ""}`, ne = S.current;
2608
+ if (ne && ne.key === ie && Math.abs(ne.near - L) < 12 && Date.now() - ne.at < 6e4) return;
2609
+ S.current = { key: ie, near: L, at: Date.now() };
2610
+ const G = Xs(h), J = { langs: [e], near: L };
2611
2611
  G && G.size ? J.voiceBySpeaker = Object.fromEntries([...G].map(([pe, le]) => [String(pe), le])) : h && (J.voice = h), Zs(o, `/v1/recordings/${t}/voice`, { method: "POST", body: J }).then((pe) => {
2612
2612
  pe.ok || (S.current = null);
2613
2613
  }).catch(() => {
@@ -2618,37 +2618,37 @@ function kl({ recordingId: t, lang: e, ended: n, cred: r, pickedVoice: s, senten
2618
2618
  Y(() => {
2619
2619
  if (!T) return;
2620
2620
  const K = setInterval(() => {
2621
- const v = z.size;
2622
- v !== E.current.n && (E.current = { n: v, at: Date.now() }), !(Date.now() - E.current.at > 10 * 6e4) && c();
2621
+ const L = z.size;
2622
+ L !== E.current.n && (E.current = { n: L, at: Date.now() }), !(Date.now() - E.current.at > 10 * 6e4) && c();
2623
2623
  }, 3e3);
2624
2624
  return () => clearInterval(K);
2625
2625
  }, [T, c, z]);
2626
2626
  const O = Ie(() => {
2627
2627
  if (!t) return [];
2628
- const K = B ? B.split(",").map(Number).filter((ie) => !n || z.has(ie)) : void 0, v = d ?? (K != null && K.length && e ? { lang: e, voiceKey: s ?? "", clips: [], voice: null } : null);
2629
- return Ha(v, t, o.origin, r, K);
2628
+ const K = B ? B.split(",").map(Number).filter((ie) => !n || z.has(ie)) : void 0, L = d ?? (K != null && K.length && e ? { lang: e, voiceKey: s ?? "", clips: [], voice: null } : null);
2629
+ return Ha(L, t, o.origin, r, K);
2630
2630
  }, [d, t, o, r, B, e, s, n, z]), te = Ie(() => new Set(F), [F]);
2631
2631
  return { listed: l, rows: u, track: d, renderVoiceId: h, rendering: b, failed: D, clips: O, requestRender: f, forget: I, reload: c, setNear: X, missing: F.length, coming: te };
2632
2632
  }
2633
- const jl = { share: ee.share, delay: ee.tabGauge, video: ee.video, source: ee.tabSources, script: ee.tabScript, fix: ee.tabFix, ending: ee.tabEnding, summary: ee.tabSummary, export: ee.tabExport, settings: ee.tabSettings, sources: ee.tabSources, recs: ee.mic };
2633
+ const zl = { share: ee.share, delay: ee.tabGauge, video: ee.video, source: ee.tabSources, script: ee.tabScript, fix: ee.tabFix, ending: ee.tabEnding, summary: ee.tabSummary, export: ee.tabExport, settings: ee.tabSettings, sources: ee.tabSources, recs: ee.mic };
2634
2634
  function Ei({ tabs: t, current: e, onPick: n, gap: r, fold: s = !0, side: a = !s }) {
2635
- const o = s && t.length <= 3, l = t.some((L) => L.key === e), [c, u] = j(null), d = k(null), [h, M] = j(0);
2635
+ const o = s && t.length <= 3, l = t.some((v) => v.key === e), [c, u] = j(null), d = k(null), [h, M] = j(0);
2636
2636
  Y(() => {
2637
2637
  d.current && M(d.current.offsetWidth);
2638
2638
  }, [c == null ? void 0 : c.k]);
2639
- const N = (L, m) => {
2640
- const f = L.currentTarget.querySelector(".tabbar__label");
2639
+ const N = (v, m) => {
2640
+ const f = v.currentTarget.querySelector(".tabbar__label");
2641
2641
  if (o || s || m.key === e || f && getComputedStyle(f).opacity === "1") {
2642
2642
  c && u(null);
2643
2643
  return;
2644
2644
  }
2645
2645
  if ((c == null ? void 0 : c.k) === m.key) return;
2646
- const I = L.currentTarget.getBoundingClientRect(), b = L.currentTarget.parentElement.getBoundingClientRect();
2646
+ const I = v.currentTarget.getBoundingClientRect(), b = v.currentTarget.parentElement.getBoundingClientRect();
2647
2647
  u({ k: m.key, label: m.label, x: I.left + I.width / 2, y: b.top });
2648
2648
  }, p = () => u(null);
2649
2649
  let y = null;
2650
2650
  if (c) {
2651
- const L = { l: 0, r: typeof window < "u" ? window.innerWidth : 0 }, m = h || 80, f = Math.max(L.l + 8, Math.min(L.r - m - 8, c.x - m / 2));
2651
+ const v = { l: 0, r: typeof window < "u" ? window.innerWidth : 0 }, m = h || 80, f = Math.max(v.l + 8, Math.min(v.r - m - 8, c.x - m / 2));
2652
2652
  y = ja(
2653
2653
  /* @__PURE__ */ i("div", { className: "vsp vsp-portal", "data-theme": "dark", children: /* @__PURE__ */ g("div", { ref: d, "data-theme": "dark", className: "vs-tip__bubble vs-tip__bubble--top tabtip", style: { position: "fixed", left: f, top: c.y - 8, bottom: "auto", width: "auto", whiteSpace: "nowrap", transform: "translateY(-100%)", zIndex: 2147483e3, pointerEvents: "none" }, children: [
2654
2654
  /* @__PURE__ */ i("span", { className: "vs-tip__row", children: /* @__PURE__ */ i("span", { className: "vs-tip__copy", children: c.label }) }),
@@ -2658,23 +2658,23 @@ function Ei({ tabs: t, current: e, onPick: n, gap: r, fold: s = !0, side: a = !s
2658
2658
  );
2659
2659
  }
2660
2660
  return /* @__PURE__ */ g("div", { role: "tablist", className: `tabbar tabbar--icons${s ? "" : " tabbar--desk"}`, "data-desk-tabs": a ? "" : void 0, "data-tab-n": a ? t.length : void 0, style: { marginBottom: r ? 12 : 0 }, onMouseLeave: p, children: [
2661
- t.map((L) => {
2662
- const m = e === L.key, f = o || m, I = o ? "1 1 0" : m ? "1 1 auto" : s && !l ? "1 1 0" : "0 0 auto", b = L.icon ?? jl[L.key], D = () => {
2663
- p(), n(s && m ? "none" : L.key);
2661
+ t.map((v) => {
2662
+ const m = e === v.key, f = o || m, I = o ? "1 1 0" : m ? "1 1 auto" : s && !l ? "1 1 0" : "0 0 auto", b = v.icon ?? zl[v.key], D = () => {
2663
+ p(), n(s && m ? "none" : v.key);
2664
2664
  };
2665
- return s ? /* @__PURE__ */ g("button", { type: "button", role: "tab", "aria-selected": m, title: L.label, className: `tabbar__tab${m ? " is-on" : ""}`, style: { flex: I }, onClick: D, children: [
2666
- b && /* @__PURE__ */ i(oe, { d: b, size: 15, sw: L.sw ?? 2, style: { flex: "none" } }),
2667
- f && /* @__PURE__ */ i("span", { className: "tabbar__label", children: L.label })
2668
- ] }, L.key) : /* @__PURE__ */ i("div", { className: "tabbar__slot", "data-tab-cell": "", style: { flex: I }, onMouseEnter: (B) => N(B, L), onMouseMove: (B) => N(B, L), onClick: D, children: /* @__PURE__ */ g("button", { type: "button", role: "tab", "aria-selected": m, "aria-label": L.label, className: `tabbar__tab${m ? " is-on" : ""}${(c == null ? void 0 : c.k) === L.key ? " is-tip" : ""}`, children: [
2669
- b && /* @__PURE__ */ i(oe, { d: b, size: 15, sw: L.sw ?? 2, className: "tabbar__icon", style: { flex: "none", transform: m && !o ? "scale(1.12)" : "none" } }),
2670
- /* @__PURE__ */ i("span", { className: "tabbar__grow", "data-tab-lw": "", style: { gridTemplateColumns: f ? "1fr" : "0fr", marginLeft: f && b ? 6 : 0 }, children: /* @__PURE__ */ i("span", { className: "tabbar__label", "data-tab-l": "", style: { opacity: f ? 1 : 0, transform: f ? "none" : "translateX(-6px)" }, children: L.label }) })
2671
- ] }) }, L.key);
2665
+ return s ? /* @__PURE__ */ g("button", { type: "button", role: "tab", "aria-selected": m, title: v.label, className: `tabbar__tab${m ? " is-on" : ""}`, style: { flex: I }, onClick: D, children: [
2666
+ b && /* @__PURE__ */ i(oe, { d: b, size: 15, sw: v.sw ?? 2, style: { flex: "none" } }),
2667
+ f && /* @__PURE__ */ i("span", { className: "tabbar__label", children: v.label })
2668
+ ] }, v.key) : /* @__PURE__ */ i("div", { className: "tabbar__slot", "data-tab-cell": "", style: { flex: I }, onMouseEnter: (B) => N(B, v), onMouseMove: (B) => N(B, v), onClick: D, children: /* @__PURE__ */ g("button", { type: "button", role: "tab", "aria-selected": m, "aria-label": v.label, className: `tabbar__tab${m ? " is-on" : ""}${(c == null ? void 0 : c.k) === v.key ? " is-tip" : ""}`, children: [
2669
+ b && /* @__PURE__ */ i(oe, { d: b, size: 15, sw: v.sw ?? 2, className: "tabbar__icon", style: { flex: "none", transform: m && !o ? "scale(1.12)" : "none" } }),
2670
+ /* @__PURE__ */ i("span", { className: "tabbar__grow", "data-tab-lw": "", style: { gridTemplateColumns: f ? "1fr" : "0fr", marginLeft: f && b ? 6 : 0 }, children: /* @__PURE__ */ i("span", { className: "tabbar__label", "data-tab-l": "", style: { opacity: f ? 1 : 0, transform: f ? "none" : "translateX(-6px)" }, children: v.label }) })
2671
+ ] }) }, v.key);
2672
2672
  }),
2673
2673
  y
2674
2674
  ] });
2675
2675
  }
2676
- const zl = "M3 16.5v2.25A2.25 2.25 0 0 0 5.25 21h13.5A2.25 2.25 0 0 0 21 18.75V16.5M16.5 12 12 16.5m0 0L7.5 12m4.5 4.5V3", Il = "m9 9 10.5-3m0 6.553v3.75a2.25 2.25 0 0 1-1.632 2.163l-1.32.377a1.803 1.803 0 1 1-.99-3.467l2.31-.66a2.25 2.25 0 0 0 1.632-2.163Zm0 0V2.25L9 5.25v10.303m0 0v3.75a2.25 2.25 0 0 1-1.632 2.163l-1.32.377a1.803 1.803 0 0 1-.99-3.467l2.31-.66A2.25 2.25 0 0 0 9 15.553Z";
2677
- function Ol({ audio: t, video: e, formats: n, onExport: r }) {
2676
+ const Il = "M3 16.5v2.25A2.25 2.25 0 0 0 5.25 21h13.5A2.25 2.25 0 0 0 21 18.75V16.5M16.5 12 12 16.5m0 0L7.5 12m4.5 4.5V3", Ol = "m9 9 10.5-3m0 6.553v3.75a2.25 2.25 0 0 1-1.632 2.163l-1.32.377a1.803 1.803 0 1 1-.99-3.467l2.31-.66a2.25 2.25 0 0 0 1.632-2.163Zm0 0V2.25L9 5.25v10.303m0 0v3.75a2.25 2.25 0 0 1-1.632 2.163l-1.32.377a1.803 1.803 0 0 1-.99-3.467l2.31-.66A2.25 2.25 0 0 0 9 15.553Z";
2677
+ function Cl({ audio: t, video: e, formats: n, onExport: r }) {
2678
2678
  const [s, a] = j(null), [o, l] = j(null), c = k(void 0), u = k(!0);
2679
2679
  Y(() => (u.current = !0, () => {
2680
2680
  u.current = !1, window.clearTimeout(c.current);
@@ -2695,19 +2695,19 @@ function Ol({ audio: t, video: e, formats: n, onExport: r }) {
2695
2695
  }).finally(() => {
2696
2696
  u.current && l(null);
2697
2697
  }));
2698
- }, N = (p, y, L, m) => /* @__PURE__ */ g(De, { children: [
2698
+ }, N = (p, y, v, m) => /* @__PURE__ */ g(De, { children: [
2699
2699
  /* @__PURE__ */ i(fr, { style: { letterSpacing: ".12em", color: "var(--ink-35)" }, children: m }),
2700
2700
  /* @__PURE__ */ g("button", { type: "button", className: "dlrow", disabled: o != null, "aria-busy": o === p || void 0, onClick: () => M(p, y), style: o && o !== p ? { opacity: 0.45 } : void 0, children: [
2701
- o === p ? /* @__PURE__ */ i(it, { size: 17, color: "var(--brand)", track: "var(--fill-12)" }) : /* @__PURE__ */ i(oe, { d: L, size: 17, sw: 1.5, style: { flex: "none", color: "var(--ink-70)" } }),
2701
+ o === p ? /* @__PURE__ */ i(it, { size: 17, color: "var(--brand)", track: "var(--fill-12)" }) : /* @__PURE__ */ i(oe, { d: v, size: 17, sw: 1.5, style: { flex: "none", color: "var(--ink-70)" } }),
2702
2702
  /* @__PURE__ */ g("span", { style: { flex: 1, minWidth: 0, display: "flex", flexDirection: "column", gap: 1, textAlign: "left" }, children: [
2703
2703
  /* @__PURE__ */ i("span", { style: { fontSize: 13, fontWeight: 500, color: "var(--ink-96)", whiteSpace: "nowrap", overflow: "hidden", textOverflow: "ellipsis" }, children: y.name }),
2704
2704
  /* @__PURE__ */ i("span", { style: { font: "500 9.5px var(--vs-font-mono)", color: "var(--ink-40)", letterSpacing: ".04em" }, children: y.meta })
2705
2705
  ] }),
2706
- /* @__PURE__ */ i(oe, { d: s === p ? ee.check : zl, size: 17, sw: 1.6, style: { flex: "none", color: s === p ? "var(--brand)" : "var(--ink-62)" } })
2706
+ /* @__PURE__ */ i(oe, { d: s === p ? ee.check : Il, size: 17, sw: 1.6, style: { flex: "none", color: s === p ? "var(--brand)" : "var(--ink-62)" } })
2707
2707
  ] })
2708
2708
  ] });
2709
2709
  return /* @__PURE__ */ g("div", { style: { display: "flex", flexDirection: "column", gap: 10 }, children: [
2710
- t && N("audio", t, Il, "DOWNLOAD AUDIO"),
2710
+ t && N("audio", t, Ol, "DOWNLOAD AUDIO"),
2711
2711
  e && N("video", e, ee.video, "DOWNLOAD VIDEO"),
2712
2712
  n !== !1 && /* @__PURE__ */ g(De, { children: [
2713
2713
  /* @__PURE__ */ i(fr, { style: { letterSpacing: ".12em", color: "var(--ink-35)" }, children: "EXPORT AS" }),
@@ -2732,7 +2732,7 @@ function Er(t, e, n) {
2732
2732
  }
2733
2733
  r();
2734
2734
  }
2735
- function Cl(t, e, n) {
2735
+ function bl(t, e, n) {
2736
2736
  const [r, s] = j(null), a = t.state === "ready", o = `${e ?? ""}|${n ?? ""}|${a ? `${t.title}
2737
2737
  ${t.summary}` : ""}`, l = _t();
2738
2738
  return Y(() => {
@@ -2749,12 +2749,12 @@ ${t.summary}` : ""}`, l = _t();
2749
2749
  };
2750
2750
  }, [o, l]), !n || !a ? t : (r == null ? void 0 : r.key) === o ? r.s : { state: "pending", retry: t.retry };
2751
2751
  }
2752
- function bl(t) {
2752
+ function xl(t) {
2753
2753
  return t != null && t.title && (t != null && t.summary) ? { state: "ready", title: t.title, summary: t.summary, retry: () => {
2754
2754
  } } : { state: "unavailable", retry: () => {
2755
2755
  } };
2756
2756
  }
2757
- function xl({ s: t }) {
2757
+ function Dl({ s: t }) {
2758
2758
  const [e, n] = j(!1), r = k(void 0);
2759
2759
  Y(() => () => window.clearTimeout(r.current), []);
2760
2760
  const s = t.title ?? "", a = t.summary ?? "", o = () => {
@@ -2771,7 +2771,7 @@ ${a}`).catch(() => {
2771
2771
  /* @__PURE__ */ g("div", { style: { display: "flex", alignItems: "center", justifyContent: "space-between", gap: 8, minHeight: 24 }, children: [
2772
2772
  /* @__PURE__ */ i(fr, { style: { letterSpacing: ".12em", color: "var(--ink-35)" }, children: "SUMMARY" }),
2773
2773
  t.state === "ready" && /* @__PURE__ */ g("button", { type: "button", className: "sumcopy", title: "Copy title and summary", style: { color: e ? "var(--brand)" : "var(--ink-70)" }, onClick: o, children: [
2774
- /* @__PURE__ */ i(oe, { d: e ? ee.check : Al, size: 13, sw: 1.6 }),
2774
+ /* @__PURE__ */ i(oe, { d: e ? ee.check : El, size: 13, sw: 1.6 }),
2775
2775
  e ? "Copied" : "Copy"
2776
2776
  ] })
2777
2777
  ] }),
@@ -2784,15 +2784,15 @@ ${a}`).catch(() => {
2784
2784
  ] })
2785
2785
  ] });
2786
2786
  }
2787
- function Dl({ ytId: t, title: e, timeLabel: n, radius: r, style: s, large: a, children: o, picture: l }) {
2787
+ function Sl({ ytId: t, title: e, timeLabel: n, radius: r, style: s, large: a, children: o, picture: l }) {
2788
2788
  return /* @__PURE__ */ g("div", { className: "livevid", style: { ...r != null ? { borderRadius: r } : null, ...s }, children: [
2789
2789
  /* @__PURE__ */ i(oe, { d: "m15.75 10.5 4.72-4.72a.75.75 0 0 1 1.28.53v11.38a.75.75 0 0 1-1.28.53l-4.72-4.72M4.5 18.75h9a2.25 2.25 0 0 0 2.25-2.25v-9a2.25 2.25 0 0 0-2.25-2.25h-9A2.25 2.25 0 0 0 2.25 7.5v9a2.25 2.25 0 0 0 2.25 2.25Z", size: a ? 34 : 30, sw: 1.2 }),
2790
- l ?? /* @__PURE__ */ i("iframe", { src: rl(t), title: e, referrerPolicy: "strict-origin-when-cross-origin", allow: "autoplay; encrypted-media; picture-in-picture" }),
2790
+ l ?? /* @__PURE__ */ i("iframe", { src: sl(t), title: e, referrerPolicy: "strict-origin-when-cross-origin", allow: "autoplay; encrypted-media; picture-in-picture" }),
2791
2791
  n && /* @__PURE__ */ i("span", { className: "livevid__t", style: a ? { bottom: 10, right: 10 } : void 0, children: n }),
2792
2792
  o
2793
2793
  ] });
2794
2794
  }
2795
- function Sl(t = !0, e) {
2795
+ function Al(t = !0, e) {
2796
2796
  const n = k(null), r = e ?? n;
2797
2797
  return Y(() => {
2798
2798
  const s = r.current;
@@ -2813,8 +2813,8 @@ function Sl(t = !0, e) {
2813
2813
  };
2814
2814
  }, [t]), r;
2815
2815
  }
2816
- const Al = "M15.75 17.25v3.375c0 .621-.504 1.125-1.125 1.125h-9.75a1.125 1.125 0 0 1-1.125-1.125V7.875c0-.621.504-1.125 1.125-1.125H6.75a9.06 9.06 0 0 1 1.5.124m7.5 10.376h3.375c.621 0 1.125-.504 1.125-1.125V11.25c0-4.46-3.243-8.161-7.5-8.876a9.06 9.06 0 0 0-1.5-.124H9.375c-.621 0-1.125.504-1.125 1.125v3.5m7.5 10.375H9.375a1.125 1.125 0 0 1-1.125-1.125v-9.25m12 6.625v-1.875a3.375 3.375 0 0 0-3.375-3.375h-1.5a1.125 1.125 0 0 1-1.125-1.125v-1.5a3.375 3.375 0 0 0-3.375-3.375H9.75";
2817
- function El(t, e) {
2816
+ const El = "M15.75 17.25v3.375c0 .621-.504 1.125-1.125 1.125h-9.75a1.125 1.125 0 0 1-1.125-1.125V7.875c0-.621.504-1.125 1.125-1.125H6.75a9.06 9.06 0 0 1 1.5.124m7.5 10.376h3.375c.621 0 1.125-.504 1.125-1.125V11.25c0-4.46-3.243-8.161-7.5-8.876a9.06 9.06 0 0 0-1.5-.124H9.375c-.621 0-1.125.504-1.125 1.125v3.5m7.5 10.375H9.375a1.125 1.125 0 0 1-1.125-1.125v-9.25m12 6.625v-1.875a3.375 3.375 0 0 0-3.375-3.375h-1.5a1.125 1.125 0 0 1-1.125-1.125v-1.5a3.375 3.375 0 0 0-3.375-3.375H9.75";
2817
+ function _l(t, e) {
2818
2818
  const [n, r] = Fa(t), s = e.tabs.map((f) => f.key), a = e.tabbed !== !1, o = e.pinnable ?? s;
2819
2819
  let l = n;
2820
2820
  [...e.autoPin ?? []].reverse().forEach((f) => {
@@ -2837,7 +2837,7 @@ function El(t, e) {
2837
2837
  r([...b.filter((D) => !u(D) || D === f), ...c.filter((D) => !b.includes(D) && D !== `!${f}`)]);
2838
2838
  }, y = (f) => {
2839
2839
  r([...c.filter((I) => I !== f && I !== `!${f}`), ...(e.autoPin ?? []).includes(f) ? [`!${f}`] : []]), e.onPick(f);
2840
- }, L = (f) => {
2840
+ }, v = (f) => {
2841
2841
  var I;
2842
2842
  return ((I = e.tabs.find((b) => b.key === f)) == null ? void 0 : I.label) ?? f;
2843
2843
  }, m = (f) => {
@@ -2847,14 +2847,14 @@ function El(t, e) {
2847
2847
  pinned: I,
2848
2848
  order: I ? d.indexOf(f) + 1 : 1e3,
2849
2849
  pill: a && b && o.includes(f) && h.length > 0 && (I || h.length > 1),
2850
- title: I ? `Unpin — return ${L(f)} to the tabs` : `Pin ${L(f)} open above the tabs`,
2850
+ title: I ? `Unpin — return ${v(f)} to the tabs` : `Pin ${v(f)} open above the tabs`,
2851
2851
  toggle: () => I ? y(f) : p(f)
2852
2852
  };
2853
2853
  };
2854
2854
  return { id: t, tabbed: a && h.length > 1, cur: M, seq: d, pinnable: o, tabKeys: h, stripTabs: e.tabs.filter((f) => h.includes(f.key)), panel: m, pin: p, unpin: y };
2855
2855
  }
2856
- function _l({ col: t, order: e, render: n, grip: r, onPick: s, wrapClass: a }) {
2857
- return Yl(t), /* @__PURE__ */ g(De, { children: [
2856
+ function Yl({ col: t, order: e, render: n, grip: r, onPick: s, wrapClass: a }) {
2857
+ return Ul(t), /* @__PURE__ */ g(De, { children: [
2858
2858
  e.map((o) => {
2859
2859
  const l = t.panel(o);
2860
2860
  if (!l.show) return null;
@@ -2870,7 +2870,7 @@ function _l({ col: t, order: e, render: n, grip: r, onPick: s, wrapClass: a }) {
2870
2870
  }, fold: !1 }) })
2871
2871
  ] });
2872
2872
  }
2873
- function Yl(t) {
2873
+ function Ul(t) {
2874
2874
  const e = k(t);
2875
2875
  e.current = t;
2876
2876
  const n = t.id;
@@ -2963,24 +2963,24 @@ function Yl(t) {
2963
2963
  f && (m.preventDefault(), m.stopImmediatePropagation(), s = { el: r, col: f, key: r.getAttribute("data-panel-key"), x0: m.clientX, y0: m.clientY, on: !1 });
2964
2964
  }, N = () => u(!0), p = () => u(!1), y = (m) => {
2965
2965
  m.key === "Escape" && s && (m.preventDefault(), m.stopImmediatePropagation(), u(!1));
2966
- }, L = () => {
2966
+ }, v = () => {
2967
2967
  s || a(null);
2968
2968
  };
2969
- return document.addEventListener("pointermove", h, !0), document.addEventListener("pointerdown", M, !0), window.addEventListener("pointerup", N), window.addEventListener("pointercancel", p), window.addEventListener("keydown", y, !0), document.addEventListener("pointerleave", L), () => {
2970
- u(!1), a(null), document.removeEventListener("pointermove", h, !0), document.removeEventListener("pointerdown", M, !0), window.removeEventListener("pointerup", N), window.removeEventListener("pointercancel", p), window.removeEventListener("keydown", y, !0), document.removeEventListener("pointerleave", L);
2969
+ return document.addEventListener("pointermove", h, !0), document.addEventListener("pointerdown", M, !0), window.addEventListener("pointerup", N), window.addEventListener("pointercancel", p), window.addEventListener("keydown", y, !0), document.addEventListener("pointerleave", v), () => {
2970
+ u(!1), a(null), document.removeEventListener("pointermove", h, !0), document.removeEventListener("pointerdown", M, !0), window.removeEventListener("pointerup", N), window.removeEventListener("pointercancel", p), window.removeEventListener("keydown", y, !0), document.removeEventListener("pointerleave", v);
2971
2971
  };
2972
2972
  }, [n]);
2973
2973
  }
2974
- function Ul({ id: t, className: e, gap: n, hidden: r, plain: s, children: a }) {
2974
+ function Rl({ id: t, className: e, gap: n, hidden: r, plain: s, children: a }) {
2975
2975
  const [o, l] = Za(t), c = k(null), u = k(null);
2976
- Rl(u), Y(() => {
2976
+ Pl(u), Y(() => {
2977
2977
  document.documentElement.style.setProperty("--colw", `${o}px`);
2978
2978
  }, [o]);
2979
2979
  const d = (M) => {
2980
2980
  const N = c.current, p = N == null ? void 0 : N.parentElement;
2981
2981
  if (M.button !== 0 || !N || !p) return;
2982
2982
  M.preventDefault();
2983
- const y = M.currentTarget, L = getComputedStyle(p), m = p.clientWidth - parseFloat(L.paddingLeft) - parseFloat(L.paddingRight) - (parseFloat(L.columnGap) || 0), f = 320, I = 320, b = Math.max(f, m - I), D = M.clientX, B = N.getBoundingClientRect().width;
2983
+ const y = M.currentTarget, v = getComputedStyle(p), m = p.clientWidth - parseFloat(v.paddingLeft) - parseFloat(v.paddingRight) - (parseFloat(v.columnGap) || 0), f = 320, I = 320, b = Math.max(f, m - I), D = M.clientX, B = N.getBoundingClientRect().width;
2984
2984
  let _ = B;
2985
2985
  y.classList.add("is-on");
2986
2986
  const X = { cur: document.body.style.cursor, sel: document.body.style.userSelect };
@@ -2997,7 +2997,7 @@ function Ul({ id: t, className: e, gap: n, hidden: r, plain: s, children: a }) {
2997
2997
  /* @__PURE__ */ i("div", { ref: c, "data-tab-col": t, className: `${e} sidecol`, style: { flex: `0 0 ${o}px`, ...h }, children: s ? a : /* @__PURE__ */ i("div", { ref: u, "data-panel-grid": "", className: "panelgrid", children: a }) })
2998
2998
  ] });
2999
2999
  }
3000
- function Rl(t) {
3000
+ function Pl(t) {
3001
3001
  Y(() => {
3002
3002
  const e = t.current;
3003
3003
  if (!e) return;
@@ -3025,16 +3025,16 @@ function Rl(t) {
3025
3025
  };
3026
3026
  }, [t]);
3027
3027
  }
3028
- function Pl(t) {
3028
+ function Ql(t) {
3029
3029
  return /\bwas not captured\b/i.test(t ?? "");
3030
3030
  }
3031
- const Ql = 1500, $l = 3e5;
3032
- function Bl(t) {
3031
+ const $l = 1500, Bl = 3e5;
3032
+ function Vl(t) {
3033
3033
  const e = _t(), [n, r] = j(null), [s, a] = j(null), [o, l] = j(null), [c, u] = j(null), d = k(null), h = k(null), M = k(null), N = k(0), p = Je(() => {
3034
3034
  M.current && (clearTimeout(M.current), M.current = null), d.current && (d.current.pause(), d.current.removeAttribute("src"), d.current.load(), d.current = null), h.current && (URL.revokeObjectURL(h.current), h.current = null);
3035
3035
  }, []), y = Je(() => {
3036
3036
  N.current += 1, p(), a(null), l(null);
3037
- }, [p]), L = Je(() => {
3037
+ }, [p]), v = Je(() => {
3038
3038
  y(), r(null);
3039
3039
  }, [y]);
3040
3040
  Y(() => () => {
@@ -3061,13 +3061,13 @@ function Bl(t) {
3061
3061
  }
3062
3062
  if (N.current !== I) return;
3063
3063
  if (_.status === 202 || _.status === 503) {
3064
- if (Date.now() - D > $l) {
3064
+ if (Date.now() - D > Bl) {
3065
3065
  l(null), u({ message: "This voice is still being fetched. Try it again in a moment." });
3066
3066
  return;
3067
3067
  }
3068
3068
  l(f.id), M.current = setTimeout(() => {
3069
3069
  B();
3070
- }, Ql);
3070
+ }, $l);
3071
3071
  return;
3072
3072
  }
3073
3073
  if (!_.ok) {
@@ -3090,14 +3090,14 @@ function Bl(t) {
3090
3090
  };
3091
3091
  B();
3092
3092
  }, [t, p, e]);
3093
- return { armId: n, sampleId: s, dlId: o, error: c, clearError: () => u(null), arm: m, stop: y, reset: L };
3093
+ return { armId: n, sampleId: s, dlId: o, error: c, clearError: () => u(null), arm: m, stop: y, reset: v };
3094
3094
  }
3095
3095
  const vr = 0.05, _i = (t, e) => {
3096
3096
  let n = 0;
3097
3097
  for (let r = 0; r < t.length; r++) t[r].start <= e + 1e-6 && (n = r);
3098
3098
  return n;
3099
3099
  };
3100
- function Vl(t, e, n, r) {
3100
+ function Hl(t, e, n, r) {
3101
3101
  const s = Math.max(0, e), a = r > 0 && s >= r - vr, o = t.length && t[0].start <= s + 1e-6 ? _i(t, s) : -1;
3102
3102
  return o < 0 ? { t: s, playing: n && !a, sentenceId: null, offset: 0, ended: a } : { t: s, playing: n && !a, sentenceId: t[o].sentenceId ?? null, offset: Math.max(0, s - t[o].start), ended: a };
3103
3103
  }
@@ -3120,7 +3120,7 @@ function Yi(t, e, n) {
3120
3120
  const r = t[e], s = n && r.translations[n] && r.language !== n ? r.translations[n] : null;
3121
3121
  if (!s && r.words.length) return r.words;
3122
3122
  const a = (s ?? r.text).split(/\s+/).filter(Boolean), o = ((c = r.words[0]) == null ? void 0 : c.start) ?? r.start, l = Si(r, t[e + 1], r.start + Math.max(2, a.length * 0.4));
3123
- return al(a, o, l).map((u, d) => ({ ...u, seq: r.seqs[0] ?? 0, idx: d }));
3123
+ return ol(a, o, l).map((u, d) => ({ ...u, seq: r.seqs[0] ?? 0, idx: d }));
3124
3124
  }
3125
3125
  function ti(t, e, n) {
3126
3126
  if (!t.engaged || e !== t.idx || !n.length) return null;
@@ -3142,7 +3142,7 @@ function Et(t, e, n) {
3142
3142
  const r = (s = t == null ? void 0 : t.words[t.words.length - 1]) == null ? void 0 : s.end;
3143
3143
  return r != null && r > e ? r : (t == null ? void 0 : t.end) != null && t.end > e ? t.end : n > e ? n : e + 4;
3144
3144
  }
3145
- function Hl({ ytId: t, title: e, t: n, playing: r, seekN: s, onToggle: a, onAd: o, endT: l, onGone: c, onKnown: u, lead: d, onTime: h, waiting: M = !1 }) {
3145
+ function Wl({ ytId: t, title: e, t: n, playing: r, seekN: s, onToggle: a, onAd: o, endT: l, onGone: c, onKnown: u, lead: d, onTime: h, waiting: M = !1 }) {
3146
3146
  const N = k(null), [p, y] = j(!1);
3147
3147
  Y(() => {
3148
3148
  if (!M) {
@@ -3152,7 +3152,7 @@ function Hl({ ytId: t, title: e, t: n, playing: r, seekN: s, onToggle: a, onAd:
3152
3152
  const W = setTimeout(() => y(!0), 300);
3153
3153
  return () => clearTimeout(W);
3154
3154
  }, [M]);
3155
- const L = r && !p, m = k(!1), [f, I] = j(!1), b = (W, me = []) => {
3155
+ const v = r && !p, m = k(!1), [f, I] = j(!1), b = (W, me = []) => {
3156
3156
  var Z, ve;
3157
3157
  if (!(m.current && (W === "pauseVideo" || W === "seekTo" || W === "setPlaybackRate")))
3158
3158
  try {
@@ -3177,7 +3177,7 @@ function Hl({ ytId: t, title: e, t: n, playing: r, seekN: s, onToggle: a, onAd:
3177
3177
  O.current = n;
3178
3178
  const te = k(h);
3179
3179
  te.current = h;
3180
- const K = k(null), v = k(null), [ie, ne] = j(!0), [G, J] = j(!1), pe = () => {
3180
+ const K = k(null), L = k(null), [ie, ne] = j(!0), [G, J] = j(!1), pe = () => {
3181
3181
  b("unloadModule", ["captions"]), b("unloadModule", ["cc"]);
3182
3182
  }, le = k([]), Te = () => {
3183
3183
  pe(), le.current.forEach(clearTimeout), le.current = [400, 1200, 2500, 5e3].map((W) => window.setTimeout(pe, W));
@@ -3196,8 +3196,8 @@ function Hl({ ytId: t, title: e, t: n, playing: r, seekN: s, onToggle: a, onAd:
3196
3196
  }, [!!d]);
3197
3197
  const Ee = k(null), Le = k(l);
3198
3198
  Le.current = l;
3199
- const we = k(L);
3200
- we.current = L;
3199
+ const we = k(v);
3200
+ we.current = v;
3201
3201
  const _e = k(!1), Pe = k(c);
3202
3202
  Pe.current = c;
3203
3203
  const Se = k(u);
@@ -3220,7 +3220,7 @@ function Hl({ ytId: t, title: e, t: n, playing: r, seekN: s, onToggle: a, onAd:
3220
3220
  }
3221
3221
  (ge = (Ae = Z == null ? void 0 : Z.info) == null ? void 0 : Ae.videoData) != null && ge.isLive && (B.current = !0);
3222
3222
  const ve = (Ye = Z == null ? void 0 : Z.info) == null ? void 0 : Ye.duration;
3223
- typeof ve == "number" && ve > 0 && !B.current && (D.current == null ? D.current = ve : (_.current = Math.abs(ve - D.current) > 1.5, E())), (Z == null ? void 0 : Z.event) === "onReady" && ((!F.current || F.current.muted) && b("mute"), Te(), (Be = F.current) == null || Be.onInfo({ ready: !0 })), typeof ((Q = Z == null ? void 0 : Z.info) == null ? void 0 : Q.playerState) == "number" && (Z.info.playerState !== v.current && (Z.info.playerState === 1 || Z.info.playerState === 2) && Te(), v.current = Z.info.playerState, ne(Z.info.playerState !== 1 && Z.info.playerState !== 3), (he = F.current) == null || he.onInfo({ state: Z.info.playerState }));
3223
+ typeof ve == "number" && ve > 0 && !B.current && (D.current == null ? D.current = ve : (_.current = Math.abs(ve - D.current) > 1.5, E())), (Z == null ? void 0 : Z.event) === "onReady" && ((!F.current || F.current.muted) && b("mute"), Te(), (Be = F.current) == null || Be.onInfo({ ready: !0 })), typeof ((Q = Z == null ? void 0 : Z.info) == null ? void 0 : Q.playerState) == "number" && (Z.info.playerState !== L.current && (Z.info.playerState === 1 || Z.info.playerState === 2) && Te(), L.current = Z.info.playerState, ne(Z.info.playerState !== 1 && Z.info.playerState !== 3), (he = F.current) == null || he.onInfo({ state: Z.info.playerState }));
3224
3224
  const ze = (ue = Z == null ? void 0 : Z.info) == null ? void 0 : ue.progressState;
3225
3225
  if (ze && typeof ze.seekableStart == "number" && typeof ze.seekableEnd == "number" && ze.seekableEnd > ze.seekableStart) {
3226
3226
  const Ce = Ee.current == null;
@@ -3230,31 +3230,31 @@ function Hl({ ytId: t, title: e, t: n, playing: r, seekN: s, onToggle: a, onAd:
3230
3230
  (ae = Se.current) == null || ae.call(Se, ye), ye && ((fe = Pe.current) == null || fe.call(Pe));
3231
3231
  }
3232
3232
  }
3233
- typeof ((Ue = Z == null ? void 0 : Z.info) == null ? void 0 : Ue.currentTime) == "number" && (K.current = Z.info.currentTime, (U = F.current) == null || U.onInfo({ t: Z.info.currentTime }), !m.current && v.current === 1 && ((R = te.current) == null || R.call(te, Z.info.currentTime))), ((q = Z == null ? void 0 : Z.info) == null ? void 0 : q.muted) === !1 && !F.current && b("mute"), typeof ((re = Z == null ? void 0 : Z.info) == null ? void 0 : re.muted) == "boolean" && ((de = F.current) == null || de.onInfo({ muted: Z.info.muted }));
3233
+ typeof ((Ue = Z == null ? void 0 : Z.info) == null ? void 0 : Ue.currentTime) == "number" && (K.current = Z.info.currentTime, (U = F.current) == null || U.onInfo({ t: Z.info.currentTime }), !m.current && L.current === 1 && ((R = te.current) == null || R.call(te, Z.info.currentTime))), ((q = Z == null ? void 0 : Z.info) == null ? void 0 : q.muted) === !1 && !F.current && b("mute"), typeof ((re = Z == null ? void 0 : Z.info) == null ? void 0 : re.muted) == "boolean" && ((de = F.current) == null || de.onInfo({ muted: Z.info.muted }));
3234
3234
  };
3235
3235
  return window.addEventListener("message", W), () => window.removeEventListener("message", W);
3236
3236
  }, []), Y(() => {
3237
3237
  if (d) return;
3238
3238
  const W = x(n);
3239
- W !== H && (A(W), W ? b("pauseVideo") : G && (b("seekTo", [n, !0]), L && b("playVideo")));
3239
+ W !== H && (A(W), W ? b("pauseVideo") : G && (b("seekTo", [n, !0]), v && b("playVideo")));
3240
3240
  }), Y(() => {
3241
3241
  if (!G || H || d) return;
3242
- if (!L && Ee.current == null && !_e.current) {
3242
+ if (!v && Ee.current == null && !_e.current) {
3243
3243
  _e.current = !0, b("seekTo", [O.current, !0]), b("playVideo");
3244
3244
  return;
3245
3245
  }
3246
3246
  const W = ce();
3247
- L && (W == null || Math.abs(W - O.current) > 1.5) && V(), b(L ? "playVideo" : "pauseVideo");
3248
- }, [L, G, H]), Y(() => {
3247
+ v && (W == null || Math.abs(W - O.current) > 1.5) && V(), b(v ? "playVideo" : "pauseVideo");
3248
+ }, [v, G, H]), Y(() => {
3249
3249
  if (!G || s === 0 || H || d) return;
3250
3250
  const W = ce();
3251
- (W == null || Math.abs(W - O.current) > 0.5) && V(), L || b("pauseVideo");
3251
+ (W == null || Math.abs(W - O.current) > 0.5) && V(), v || b("pauseVideo");
3252
3252
  }, [s, G]), Y(() => {
3253
3253
  if (!G) return;
3254
3254
  let W = null, me = 0;
3255
3255
  const Z = setInterval(() => {
3256
3256
  const ve = K.current;
3257
- me = v.current === 1 && ve != null && W != null && Math.abs(ve - W) < 0.05 ? me + 1 : 0, W = ve;
3257
+ me = L.current === 1 && ve != null && W != null && Math.abs(ve - W) < 0.05 ? me + 1 : 0, W = ve;
3258
3258
  const ze = me >= 3;
3259
3259
  ze !== X.current && (X.current = ze, E());
3260
3260
  }, 1e3);
@@ -3270,22 +3270,22 @@ function Hl({ ytId: t, title: e, t: n, playing: r, seekN: s, onToggle: a, onAd:
3270
3270
  ] })
3271
3271
  ] });
3272
3272
  }
3273
- const Wl = /* @__PURE__ */ g(De, { children: [
3273
+ const Fl = /* @__PURE__ */ g(De, { children: [
3274
3274
  /* @__PURE__ */ i("rect", { x: "6.5", y: "5", width: "3.75", height: "14", rx: "1.2" }),
3275
3275
  /* @__PURE__ */ i("rect", { x: "13.75", y: "5", width: "3.75", height: "14", rx: "1.2" })
3276
- ] }), Fl = /* @__PURE__ */ i("path", { d: "M7.5 5.6a1 1 0 0 1 1.52-.85l9.1 5.55a1 1 0 0 1 0 1.7l-9.1 5.55a1 1 0 0 1-1.52-.85V5.6Z" });
3277
- function Gl({ player: t, size: e }) {
3276
+ ] }), Gl = /* @__PURE__ */ i("path", { d: "M7.5 5.6a1 1 0 0 1 1.52-.85l9.1 5.55a1 1 0 0 1 0 1.7l-9.1 5.55a1 1 0 0 1-1.52-.85V5.6Z" });
3277
+ function Zl({ player: t, size: e }) {
3278
3278
  const n = t.muted ? "Unmute" : "Mute";
3279
3279
  return /* @__PURE__ */ i("button", { type: "button", className: `mutebtn${e < 36 ? " mutebtn--sm" : e > 36 ? " mutebtn--lg" : ""}`, "aria-label": n, title: n, "aria-pressed": t.muted, onClick: t.toggleMute, children: /* @__PURE__ */ i(oe, { d: t.muted ? ee.volumeOff : ee.volume, size: 17, sw: 1.6, style: { color: t.muted ? "var(--ink-38)" : "var(--ink-70)" } }) });
3280
3280
  }
3281
- function Zl() {
3281
+ function ql() {
3282
3282
  const [t, e] = j(""), n = k(null), r = Je((s) => {
3283
3283
  clearTimeout(n.current), e(s), n.current = setTimeout(() => e(""), 3e3);
3284
3284
  }, []);
3285
3285
  return Y(() => () => clearTimeout(n.current), []), [t, r];
3286
3286
  }
3287
- const ql = 0.2, Kl = 140, Jl = 320;
3288
- function Xl(t, e) {
3287
+ const Kl = 0.2, Jl = 140, Xl = 320;
3288
+ function ec(t, e) {
3289
3289
  const n = k(t);
3290
3290
  n.current = t;
3291
3291
  const r = k(0), s = k(1), a = Je((o, l) => {
@@ -3299,17 +3299,17 @@ function Xl(t, e) {
3299
3299
  d();
3300
3300
  }, []);
3301
3301
  Y(() => {
3302
- a(e ? ql : 1, e ? Kl : Jl);
3302
+ a(e ? Kl : 1, e ? Jl : Xl);
3303
3303
  }, [e, a]), Y(() => () => {
3304
3304
  cancelAnimationFrame(r.current), s.current = 1;
3305
3305
  for (const o of n.current) o.setVolume(1);
3306
3306
  }, []);
3307
3307
  }
3308
- function ec(t, e, n, r) {
3308
+ function tc(t, e, n, r) {
3309
3309
  var Se;
3310
3310
  const s = k(null), a = k(!1), o = k(!1), [l, c] = j(null), [u, d] = j(!0), h = k(!0), M = k(!1), [N, p] = j(0), y = k(0);
3311
3311
  y.current = N;
3312
- const L = k({ t: 0, at: 0 }), m = k(n);
3312
+ const v = k({ t: 0, at: 0 }), m = k(n);
3313
3313
  m.current = n;
3314
3314
  const f = k(r);
3315
3315
  f.current = r;
@@ -3326,7 +3326,7 @@ function ec(t, e, n, r) {
3326
3326
  onInfo: ($) => {
3327
3327
  if ($.ready && !a.current && (a.current = !0, o.current && (o.current = !1, _("playVideo"))), typeof $.state == "number" && (z.current = $.state, c($.state)), typeof $.muted == "boolean" && (F.current = $.muted), typeof $.t == "number") {
3328
3328
  const H = $.t - m.current;
3329
- L.current = { t: H, at: performance.now() }, H < y.current && y.current - H < 0.35 || p(Math.max(0, H));
3329
+ v.current = { t: H, at: performance.now() }, H < y.current && y.current - H < 0.35 || p(Math.max(0, H));
3330
3330
  }
3331
3331
  }
3332
3332
  }), []);
@@ -3334,7 +3334,7 @@ function ec(t, e, n, r) {
3334
3334
  if (l !== 1) return;
3335
3335
  let $ = 0;
3336
3336
  const H = () => {
3337
- const A = L.current, x = A.t + Math.min(1.2, (performance.now() - A.at) / 1e3);
3337
+ const A = v.current, x = A.t + Math.min(1.2, (performance.now() - A.at) / 1e3);
3338
3338
  if (f.current != null && x >= f.current) {
3339
3339
  B(!0), _("pauseVideo"), p(x);
3340
3340
  return;
@@ -3352,9 +3352,9 @@ function ec(t, e, n, r) {
3352
3352
  let $ = 0;
3353
3353
  for (let H = 0; H < t.length; H++) t[H].start <= N + 0.05 && ($ = H);
3354
3354
  return $;
3355
- }, [t, N]), [te, K] = j(0), v = ($) => {
3355
+ }, [t, N]), [te, K] = j(0), L = ($) => {
3356
3356
  const H = Math.max(0, f.current != null ? Math.min($, Math.max(0, f.current - 0.5)) : $);
3357
- _("seekTo", [H + m.current, !0]), L.current = { t: H, at: performance.now() }, p(H), K((A) => A + 1);
3357
+ _("seekTo", [H + m.current, !0]), v.current = { t: H, at: performance.now() }, p(H), K((A) => A + 1);
3358
3358
  }, ie = k(!1), ne = k(void 0), G = ($) => {
3359
3359
  window.clearTimeout(ne.current), ne.current = window.setTimeout(() => {
3360
3360
  !ie.current || $ <= 0 || z.current === 1 || z.current === 3 || (_("playVideo"), G($ - 1));
@@ -3382,10 +3382,10 @@ function ec(t, e, n, r) {
3382
3382
  B(!1);
3383
3383
  return;
3384
3384
  }
3385
- N >= E - 0.25 && v(0), J();
3385
+ N >= E - 0.25 && L(0), J();
3386
3386
  }, Te = ($) => {
3387
3387
  const H = t[Math.max(0, Math.min(t.length - 1, $))];
3388
- H && v(H.start);
3388
+ H && L(H.start);
3389
3389
  }, je = k(!1), Ee = () => {
3390
3390
  const $ = h.current || M.current;
3391
3391
  S.muted = $, _($ ? "mute" : "unMute");
@@ -3421,13 +3421,13 @@ function ec(t, e, n, r) {
3421
3421
  z.current === 2 && !h.current && (Le(!0), _("playVideo"));
3422
3422
  }, 900);
3423
3423
  },
3424
- seekFrac: ($) => v(Math.max(0, Math.min(1, $)) * E),
3425
- seekWord: ($) => v($.start),
3424
+ seekFrac: ($) => L(Math.max(0, Math.min(1, $)) * E),
3425
+ seekWord: ($) => L($.start),
3426
3426
  playRow: ($) => {
3427
3427
  Te($), X || J();
3428
3428
  },
3429
3429
  stop: () => {
3430
- pe(), v(0);
3430
+ pe(), L(0);
3431
3431
  },
3432
3432
  engaged: X || N > 0,
3433
3433
  prev: () => Te(O - 1),
@@ -3448,11 +3448,11 @@ function ec(t, e, n, r) {
3448
3448
  setVolume: ($) => _("setVolume", [Math.round($ * 100)])
3449
3449
  }, lead: S, setVideoSound: we };
3450
3450
  }
3451
- function tc(t, e, n, r, s = 0, a = null) {
3451
+ function nc(t, e, n, r, s = 0, a = null) {
3452
3452
  var A;
3453
3453
  const o = k(null), [l, c] = j(!1), [u, d] = j(0), [h, M] = j(!1), N = k(h);
3454
3454
  N.current = h;
3455
- const p = k(!1), [y, L] = j(null), [m, f] = j(!1), I = k(s);
3455
+ const p = k(!1), [y, v] = j(null), [m, f] = j(!1), I = k(s);
3456
3456
  I.current = s;
3457
3457
  const b = k(null), [D, B] = j(0);
3458
3458
  Y(() => {
@@ -3465,13 +3465,13 @@ function tc(t, e, n, r, s = 0, a = null) {
3465
3465
  const V = fi(t), ce = I.current;
3466
3466
  return V.preload = "metadata", V.muted = N.current || p.current, V.onplay = () => c(!0), V.onpause = () => c(!1), V.onended = () => c(!1), V.onloadedmetadata = () => {
3467
3467
  f(!0), V.currentTime = ((x == null ? void 0 : x.t) ?? 0) + ce, x != null && x.playing && V.play().catch((W) => {
3468
- x.asked && (W == null ? void 0 : W.name) === "NotAllowedError" || L(kt(W));
3468
+ x.asked && (W == null ? void 0 : W.name) === "NotAllowedError" || v(kt(W));
3469
3469
  });
3470
3470
  }, V.onerror = () => {
3471
3471
  c(!1);
3472
3472
  const W = V.error, me = Qa(W, !1);
3473
3473
  Ya(t).then((Z) => {
3474
- Pl(Z == null ? void 0 : Z.message) || Mi(W), o.current === V && (L({ message: (Z == null ? void 0 : Z.message) ?? me }), Z != null && Z.permanent || (o.current = null));
3474
+ Ql(Z == null ? void 0 : Z.message) || Mi(W), o.current === V && (v({ message: (Z == null ? void 0 : Z.message) ?? me }), Z != null && Z.permanent || (o.current = null));
3475
3475
  });
3476
3476
  }, o.current = V, () => {
3477
3477
  b.current = { t: Math.max(0, V.currentTime - ce), playing: !V.paused && !V.ended }, V.pause(), V.onplay = V.onpause = V.onended = V.onloadedmetadata = V.onerror = null, o.current = null;
@@ -3517,7 +3517,7 @@ function tc(t, e, n, r, s = 0, a = null) {
3517
3517
  };
3518
3518
  return x = requestAnimationFrame(V), () => cancelAnimationFrame(x);
3519
3519
  }, [l]);
3520
- const v = Ie(() => {
3520
+ const L = Ie(() => {
3521
3521
  if (!n.length) return 0;
3522
3522
  let x = 0;
3523
3523
  for (let V = 0; V < n.length; V++) n[V].start <= u + 0.05 && (x = V);
@@ -3526,7 +3526,7 @@ function tc(t, e, n, r, s = 0, a = null) {
3526
3526
  const V = T.current != null ? Math.min(x, Math.max(0, T.current - 0.5)) : x, ce = o.current;
3527
3527
  d(V), ce && (ce.currentTime = V + I.current), ne((W) => W + 1);
3528
3528
  }, J = (x) => {
3529
- (x == null ? void 0 : x.name) !== "AbortError" && L(kt(x));
3529
+ (x == null ? void 0 : x.name) !== "AbortError" && v(kt(x));
3530
3530
  }, pe = () => {
3531
3531
  var V;
3532
3532
  const x = o.current;
@@ -3535,7 +3535,7 @@ function tc(t, e, n, r, s = 0, a = null) {
3535
3535
  b.current = (V = b.current) != null && V.asked ? null : { t: u, playing: !0, asked: !0 };
3536
3536
  return;
3537
3537
  }
3538
- t && B((ce) => ce + 1), L({ message: e ? "The audio player is not ready yet — try again in a moment." : "There is no audio for this transcription." });
3538
+ t && B((ce) => ce + 1), v({ message: e ? "The audio player is not ready yet — try again in a moment." : "There is no audio for this transcription." });
3539
3539
  return;
3540
3540
  }
3541
3541
  if (l) {
@@ -3594,7 +3594,7 @@ function tc(t, e, n, r, s = 0, a = null) {
3594
3594
  },
3595
3595
  playing: l,
3596
3596
  t: u,
3597
- idx: v,
3597
+ idx: L,
3598
3598
  dur: z,
3599
3599
  muted: h,
3600
3600
  toggleMute: () => {
@@ -3619,12 +3619,12 @@ function tc(t, e, n, r, s = 0, a = null) {
3619
3619
  Math.abs(V.currentTime - ce) <= 0.2 || (_e.current = Date.now(), V.currentTime = ce);
3620
3620
  },
3621
3621
  engaged: l || u > 0,
3622
- prev: () => le(v - 1),
3623
- next: () => le(v + 1),
3622
+ prev: () => le(L - 1),
3623
+ next: () => le(L + 1),
3624
3624
  hold: Pe,
3625
3625
  release: Se,
3626
3626
  error: y,
3627
- clearError: () => L(null),
3627
+ clearError: () => v(null),
3628
3628
  has: e,
3629
3629
  edgeWait: E,
3630
3630
  wordSync: !0,
@@ -3640,14 +3640,14 @@ function tc(t, e, n, r, s = 0, a = null) {
3640
3640
  }
3641
3641
  };
3642
3642
  }
3643
- function nc(t, e, n, r, s, a, o = !1, l) {
3643
+ function rc(t, e, n, r, s, a, o = !1, l) {
3644
3644
  const c = k(/* @__PURE__ */ new Set());
3645
3645
  c.current = l ?? c.current;
3646
- const u = k(null), [d, h] = j(!1), [M, N] = j(0), [p, y] = j(0), [L, m] = j(!1), f = k(L);
3647
- f.current = L;
3646
+ const u = k(null), [d, h] = j(!1), [M, N] = j(0), [p, y] = j(0), [v, m] = j(!1), f = k(v);
3647
+ f.current = v;
3648
3648
  const [I, b] = j(null), [D, B] = j(null), [_, X] = j(null), [z, F] = j(null), S = k(z);
3649
3649
  S.current = z;
3650
- const [T, E] = j(null), [O, te] = j(null), [K, v] = j(null), [ie, ne] = j(!1), G = k(e);
3650
+ const [T, E] = j(null), [O, te] = j(null), [K, L] = j(null), [ie, ne] = j(!1), G = k(e);
3651
3651
  G.current = e;
3652
3652
  const J = k(o), pe = k([]);
3653
3653
  J.current = o, u.current && (u.current.flow = o);
@@ -3721,7 +3721,7 @@ function nc(t, e, n, r, s, a, o = !1, l) {
3721
3721
  const q = ((ye = u.current) == null ? void 0 : ye.resting()) ?? null;
3722
3722
  ne(!!(q != null && q.silent)), q != null && q.silent && S.current && (S.current = null, F(null)), te((be) => q == null ? null : be != null && Math.abs(be - q.s) < 0.05 ? be : q.s);
3723
3723
  const re = S.current;
3724
- q == null ? v(null) : re && re.sid === q.sentenceId && (v(re.t), S.current = null, F(null));
3724
+ q == null ? L(null) : re && re.sid === q.sentenceId && (L(re.t), S.current = null, F(null));
3725
3725
  const de = ((ke = u.current) == null ? void 0 : ke.position()) ?? null, Ce = de && je.current ? je.current[String(de.sentenceId)] ?? null : null;
3726
3726
  re && de && de.sentenceId === re.sid && de.t > 0.1 && F(null), E((be) => de ? be && Math.abs(be.t - de.t) < 0.05 && be.dur === de.dur && be.words === Ce ? be : { t: de.t, dur: de.dur, words: Ce } : be == null ? be : null);
3727
3727
  };
@@ -3754,14 +3754,14 @@ function nc(t, e, n, r, s, a, o = !1, l) {
3754
3754
  return { from: q, span: Math.max(0, re - q) };
3755
3755
  }, he = Q(Z), ue = Math.max(0, Math.min(he.span, Et(e[Z], he.from, he.from + 4) - he.from)), ae = z ? z.t : o ? O != null && ie ? he.from + Math.min(he.span, O) : O != null ? K != null ? Math.min(he.from, K + O) : he.from + Math.min(he.span, ue + O) : T && T.dur > 0 ? he.from + Math.min(ue, T.t / T.dur * ue) : he.from : T && T.dur > 0 ? he.from + Math.min(he.span, T.t / T.dur * he.span) : he.from;
3756
3756
  Y(() => {
3757
- we.current = _e.current ?? Vl(e, ae, d, ze);
3757
+ we.current = _e.current ?? Hl(e, ae, d, ze);
3758
3758
  });
3759
3759
  const fe = {
3760
3760
  playing: d || Pe,
3761
3761
  t: ae,
3762
3762
  idx: Z,
3763
3763
  dur: ze,
3764
- muted: L,
3764
+ muted: v,
3765
3765
  wordSync: !1,
3766
3766
  timed: o,
3767
3767
  clipPos: z ? null : T,
@@ -3889,22 +3889,22 @@ function nc(t, e, n, r, s, a, o = !1, l) {
3889
3889
  (q = fe.seekFrac) == null || q.call(fe, R.t / ze), R.playing && ge(Ae.current);
3890
3890
  }, fe;
3891
3891
  }
3892
- const rc = () => {
3893
- }, sc = "The language this recording is read aloud in.", ic = { title: "READ IN", note: "The transcript and its voice switch to this language." };
3894
- function ac({ recordingId: t, model: e, rows: n, lenS: r, ended: s, cred: a, langs: o, srcLang: l, canTranslate: c, pickedLang: u, setPickedLang: d, side: h, hearOriginal: M = !1, timed: N = !1, stockVoices: p = !1, stickyPicker: y = !1, pickerBusy: L = null, voiceSheet: m, forcedVoice: f = null }) {
3892
+ const sc = () => {
3893
+ }, ic = "The language this recording is read aloud in.", ac = { title: "READ IN", note: "The transcript and its voice switch to this language." };
3894
+ function oc({ recordingId: t, model: e, rows: n, lenS: r, ended: s, cred: a, langs: o, srcLang: l, canTranslate: c, pickedLang: u, setPickedLang: d, side: h, hearOriginal: M = !1, timed: N = !1, stockVoices: p = !1, stickyPicker: y = !1, pickerBusy: v = null, voiceSheet: m, forcedVoice: f = null }) {
3895
3895
  var Zt, cn, qt, Kt;
3896
- const { onAddVoice: I, onPickVoice: b, onSelectSpeaker: D, noCloneFor: B, castNoClone: _, castShort: X, castBuilding: z, castWarn: F, badge: S, titleNode: T } = m ?? {}, E = !!m, O = !!(m != null && m.pendingClones), [te, K] = Ti(), [v, ie] = j(null), [ne, G] = j(!1), [J, pe] = j(!1), [le, Te] = j(!1), [je, Ee] = j(!1), Le = u ?? l, we = u === null, _e = u != null || v != null, Se = ((P) => !!P && !!(o != null && o.voice.includes(P)))(we ? l : Le) ? we ? l : Le : "en", $ = Bl(Se), H = (m == null ? void 0 : m.cloneOn) ?? !0, [A, x] = j(0), V = k(H);
3896
+ const { onAddVoice: I, onPickVoice: b, onSelectSpeaker: D, noCloneFor: B, castNoClone: _, castShort: X, castBuilding: z, castWarn: F, badge: S, titleNode: T } = m ?? {}, E = !!m, O = !!(m != null && m.pendingClones), [te, K] = Ti(), [L, ie] = j(null), [ne, G] = j(!1), [J, pe] = j(!1), [le, Te] = j(!1), [je, Ee] = j(!1), Le = u ?? l, we = u === null, _e = u != null || L != null, Se = ((P) => !!P && !!(o != null && o.voice.includes(P)))(we ? l : Le) ? we ? l : Le : "en", $ = Vl(Se), H = (m == null ? void 0 : m.cloneOn) ?? !0, [A, x] = j(0), V = k(H);
3897
3897
  Y(() => {
3898
3898
  V.current !== H && (V.current = H, x((P) => P + 1));
3899
3899
  }, [H]);
3900
- const ce = Ll(Se, _e || s || J, vl(e) * 1e3 + A, { id: t ?? null, shareCode: a.shareCode ?? null }), W = Ie(() => ((ce == null ? void 0 : ce.voices) ?? []).filter((P) => E || !P.cloned || P.speaker != null), [ce, E]), me = W.length > 1, Z = Lr(o, Le), ve = bi(), ze = Ie(() => wi(o, "translation"), [o]), [Fe, Ae] = j(null), [ge] = j(() => /* @__PURE__ */ new Set()), [Ye, Be] = j({}), Q = Ie(() => Nl(n, e, ve.vcUnknownSpk), [n, e, ve]), he = me && Q.filter((P) => P.key >= 0).length > 1, ue = Fe != null && Q.some((P) => P.key === Fe) ? Fe : ((Zt = Q[0]) == null ? void 0 : Zt.key) ?? null, ae = Ie(() => {
3900
+ const ce = vl(Se, _e || s || J, kl(e) * 1e3 + A, { id: t ?? null, shareCode: a.shareCode ?? null }), W = Ie(() => ((ce == null ? void 0 : ce.voices) ?? []).filter((P) => E || !P.cloned || P.speaker != null), [ce, E]), me = W.length > 1, Z = Lr(o, Le), ve = bi(), ze = Ie(() => wi(o, "translation"), [o]), [Fe, Ae] = j(null), [ge] = j(() => /* @__PURE__ */ new Set()), [Ye, Be] = j({}), Q = Ie(() => ml(n, e, ve.vcUnknownSpk), [n, e, ve]), he = me && Q.filter((P) => P.key >= 0).length > 1, ue = Fe != null && Q.some((P) => P.key === Fe) ? Fe : ((Zt = Q[0]) == null ? void 0 : Zt.key) ?? null, ae = Ie(() => {
3901
3901
  const P = ei(Q, W, H);
3902
3902
  for (const [xe, He] of Object.entries(Ye[Se ?? ""] ?? {})) P.set(Number(xe), He);
3903
3903
  return P;
3904
3904
  }, [Q, W, Ye, Se, H]), fe = he && Object.keys(Ye[Se ?? ""] ?? {}).length > 0, Ue = Ie(() => p && !fe ? ei(Q, W, !1) : null, [p, fe, Q, W]), U = Ie(() => fe ? Js(ae) || null : Ue && Js(Ue) || null, [fe, ae, Ue]), R = fe ? ae : Ue, q = W.some((P) => P.cloned && P.consent !== "pending"), re = !!Le && !!(o != null && o.voice.includes(Le)), de = re && !M, Ce = Ie(
3905
3905
  () => n.filter((P) => !P.suppressed && !P.unclear).map((P) => P.sentenceId).filter((P) => P != null),
3906
3906
  [n]
3907
- ), ye = kl({ recordingId: t, lang: Le, ended: s, cred: a, pickedVoice: f || (U ?? v), sentenceIds: s && de ? Ce : void 0 }), ke = W.find((P) => P.id === v) ?? W.find((P) => {
3907
+ ), ye = jl({ recordingId: t, lang: Le, ended: s, cred: a, pickedVoice: f || (U ?? L), sentenceIds: s && de ? Ce : void 0 }), ke = W.find((P) => P.id === L) ?? W.find((P) => {
3908
3908
  var xe;
3909
3909
  return P.id === ((xe = ye.track) == null ? void 0 : xe.voice);
3910
3910
  }) ?? W.find((P) => P.default) ?? W[0] ?? null, be = (ke == null ? void 0 : ke.id) ?? null;
@@ -3913,7 +3913,7 @@ function ac({ recordingId: t, model: e, rows: n, lenS: r, ended: s, cred: a, lan
3913
3913
  const P = setInterval(ye.reload, 4e3);
3914
3914
  return () => clearInterval(P);
3915
3915
  }, [ye.rendering, ye.reload]);
3916
- const Ge = `${t ?? ""}|${Le ?? ""}|${f || (U ?? v ?? ((cn = ye.track) == null ? void 0 : cn.voiceKey) ?? "default")}`, $e = nc(ye.clips, n, r, Ge, ge, (qt = ye.track) == null ? void 0 : qt.wordTimes, N, ye.coming);
3916
+ const Ge = `${t ?? ""}|${Le ?? ""}|${f || (U ?? L ?? ((cn = ye.track) == null ? void 0 : cn.voiceKey) ?? "default")}`, $e = rc(ye.clips, n, r, Ge, ge, (qt = ye.track) == null ? void 0 : qt.wordTimes, N, ye.coming);
3917
3917
  Y(() => {
3918
3918
  var xe;
3919
3919
  const P = (xe = n[$e.idx]) == null ? void 0 : xe.sentenceId;
@@ -3964,7 +3964,7 @@ function ac({ recordingId: t, model: e, rows: n, lenS: r, ended: s, cred: a, lan
3964
3964
  return;
3965
3965
  }
3966
3966
  ie(P);
3967
- }, nt = we ? { ...Lr(o, null), flag: /* @__PURE__ */ i(oe, { d: ee.langAuto, size: 21, sw: 1.7, style: { color: "currentColor", display: "block" } }) } : Z, En = c ? h ? /* @__PURE__ */ i("span", { className: "barchip", style: Ct ? { background: "var(--brand-tint)", boxShadow: "0 0 0 1.5px var(--brand)" } : void 0, children: /* @__PURE__ */ i(Cn, { flag: nt.flag, code: nt.code, bordered: !1, onClick: an, flagOnly: !0, label: nt.label }) }) : /* @__PURE__ */ i(Cn, { flag: nt.flag, code: nt.code, bordered: !1, onClick: Ve, flagOnly: !0, label: nt.label }) : null, on = ee.voiceClone, qe = _e && (!!ye.track || at), Mt = rt ? "var(--conf-low)" : qe || h && C ? "var(--brand)" : "var(--ink-55)", bt = at || !!$e.preparing && _e, Tt = $e.preparing ? `Speaking this line in ${(ke == null ? void 0 : ke.name) ?? "this voice"}…` : at ? `Preparing this recording in ${(ke == null ? void 0 : ke.name) ?? "this voice"} — it will play as soon as it is ready` : rt ? `This voice could not be prepared: ${rt}` : re ? me ? "Choose a voice" : ke ? ke.name : ve.vcNoVoice + Z.label : `${ve.vcNoVoice}${Z.label}`, wt = /* @__PURE__ */ i(qa, { open: ne, onClose: yt, keepOpen: (!!h || y) && !le, value: we ? null : Le, onSelect: ht, languages: ze, title: (h == null ? void 0 : h.title) ?? "SPOKEN LANGUAGE", note: (h == null ? void 0 : h.note) ?? sc, searchPlaceholder: ve.search, none: "Original", pinned: (we ? l : Le) ? [we ? l : Le] : [], recent: te, requireVoice: le, sticky: y, busy: L }), Ut = Ie(() => W.filter((P) => P.cloned && !P.auto), [W]), xt = (P) => P.voiceId ? Ut.find((xe) => xe.id === `clone:${P.voiceId}`) ?? null : null, ct = Ie(() => Q.filter((P) => P.key >= 0), [Q]), Wt = Ie(() => {
3967
+ }, nt = we ? { ...Lr(o, null), flag: /* @__PURE__ */ i(oe, { d: ee.langAuto, size: 21, sw: 1.7, style: { color: "currentColor", display: "block" } }) } : Z, En = c ? h ? /* @__PURE__ */ i("span", { className: "barchip", style: Ct ? { background: "var(--brand-tint)", boxShadow: "0 0 0 1.5px var(--brand)" } : void 0, children: /* @__PURE__ */ i(Cn, { flag: nt.flag, code: nt.code, bordered: !1, onClick: an, flagOnly: !0, label: nt.label }) }) : /* @__PURE__ */ i(Cn, { flag: nt.flag, code: nt.code, bordered: !1, onClick: Ve, flagOnly: !0, label: nt.label }) : null, on = ee.voiceClone, qe = _e && (!!ye.track || at), Mt = rt ? "var(--conf-low)" : qe || h && C ? "var(--brand)" : "var(--ink-55)", bt = at || !!$e.preparing && _e, Tt = $e.preparing ? `Speaking this line in ${(ke == null ? void 0 : ke.name) ?? "this voice"}…` : at ? `Preparing this recording in ${(ke == null ? void 0 : ke.name) ?? "this voice"} — it will play as soon as it is ready` : rt ? `This voice could not be prepared: ${rt}` : re ? me ? "Choose a voice" : ke ? ke.name : ve.vcNoVoice + Z.label : `${ve.vcNoVoice}${Z.label}`, wt = /* @__PURE__ */ i(qa, { open: ne, onClose: yt, keepOpen: (!!h || y) && !le, value: we ? null : Le, onSelect: ht, languages: ze, title: (h == null ? void 0 : h.title) ?? "SPOKEN LANGUAGE", note: (h == null ? void 0 : h.note) ?? ic, searchPlaceholder: ve.search, none: "Original", pinned: (we ? l : Le) ? [we ? l : Le] : [], recent: te, requireVoice: le, sticky: y, busy: v }), Ut = Ie(() => W.filter((P) => P.cloned && !P.auto), [W]), xt = (P) => P.voiceId ? Ut.find((xe) => xe.id === `clone:${P.voiceId}`) ?? null : null, ct = Ie(() => Q.filter((P) => P.key >= 0), [Q]), Wt = Ie(() => {
3968
3968
  const P = W.filter((He) => !He.cloned);
3969
3969
  if (!he) return [...P, ...s && ct.length === 1 ? Ut.filter((He) => He.id === `clone:${ct[0].voiceId}`) : []];
3970
3970
  const xe = [];
@@ -3981,11 +3981,11 @@ function ac({ recordingId: t, model: e, rows: n, lenS: r, ended: s, cred: a, lan
3981
3981
  bt ? /* @__PURE__ */ i("span", { style: { width: 16, height: 16, borderRadius: "50%", border: "2px solid var(--fill-10)", borderTopColor: "var(--brand)", animation: "vs-spin .7s linear infinite" } }) : /* @__PURE__ */ i(oe, { d: on, size: 17, sw: 1.6, style: { color: Mt } }),
3982
3982
  Gt.length > 0 ? /* @__PURE__ */ i("span", { className: "txvoice__warn", title: Gt.join(" · "), children: "!" }) : !!Ke && /* @__PURE__ */ i("span", { className: "txvoice__n", title: `${Ke} speaker${Ke === 1 ? "" : "s"} can get a cloned voice`, children: Ke })
3983
3983
  ] }), ln = /* @__PURE__ */ i(Vt, { open: J, onClose: se, title: ve.vcSheet, titleNode: T, doneLabel: ve.done, children: /* @__PURE__ */ i(
3984
- yl,
3984
+ Tl,
3985
3985
  {
3986
3986
  t: ve,
3987
3987
  cast: he && /* @__PURE__ */ i(
3988
- ml,
3988
+ yl,
3989
3989
  {
3990
3990
  t: ve,
3991
3991
  roster: Q,
@@ -4068,11 +4068,11 @@ function ac({ recordingId: t, model: e, rows: n, lenS: r, ended: s, cred: a, lan
4068
4068
  armedId: $.armId,
4069
4069
  resetCast: () => Be((P) => ({ ...P, [Se ?? ""]: {} })),
4070
4070
  readLang: typeof u == "string" && u !== l ? u : null,
4071
- readVoiceKey: f || (U ?? v ?? ((Kt = ye.track) == null ? void 0 : Kt.voiceKey) ?? ""),
4072
- pickedVoiceKey: U ?? v ?? null,
4071
+ readVoiceKey: f || (U ?? L ?? ((Kt = ye.track) == null ? void 0 : Kt.voiceKey) ?? ""),
4072
+ pickedVoiceKey: U ?? L ?? null,
4073
4073
  readVoiceName: (ke == null ? void 0 : ke.name) ?? null,
4074
4074
  canSpeak: re,
4075
- requestTrack: () => ye.requestRender(U ?? v, U ? R : null),
4075
+ requestTrack: () => ye.requestRender(U ?? L, U ? R : null),
4076
4076
  hasClone: q,
4077
4077
  clips: ye.clips,
4078
4078
  setNear: ye.setNear,
@@ -4082,17 +4082,17 @@ function ac({ recordingId: t, model: e, rows: n, lenS: r, ended: s, cred: a, lan
4082
4082
  langList: { value: we ? null : Le, onSelect: ht, languages: ze, searchPlaceholder: ve.search, none: "Original", pinned: (we ? l : Le) ? [we ? l : Le] : [], recent: te }
4083
4083
  };
4084
4084
  }
4085
- function oc({ model: t, rows: e, player: n, fixed: r, applied: s, onFixOpen: a, onWord: o, onFix: l, fixMode: c, fixingId: u, marks: d = !0, fixBadges: h = !0, tail: M, tailFg: N, running: p, desk: y, feedRef: L, listener: m, showLabels: f, find: I, findOpen: b, lang: D, warm: B, onVisible: _, wordHl: X = !0 }) {
4085
+ function lc({ model: t, rows: e, player: n, fixed: r, applied: s, onFixOpen: a, onWord: o, onFix: l, fixMode: c, fixingId: u, marks: d = !0, fixBadges: h = !0, tail: M, tailFg: N, running: p, desk: y, feedRef: v, listener: m, showLabels: f, find: I, findOpen: b, lang: D, warm: B, onVisible: _, wordHl: X = !0 }) {
4086
4086
  const { playing: z, engaged: F, t: S, idx: T, seekN: E, wordSync: O, clipPos: te } = n;
4087
- Sl(!0, L);
4087
+ Al(!0, v);
4088
4088
  const K = k(null);
4089
- ol(L, K);
4090
- const [v, ie] = j(null), ne = (I ?? "").trim().toLowerCase(), [G, J] = j(0), pe = k(0), le = k(null), Te = k(T), je = (H) => {
4089
+ ll(v, K);
4090
+ const [L, ie] = j(null), ne = (I ?? "").trim().toLowerCase(), [G, J] = j(0), pe = k(0), le = k(null), Te = k(T), je = (H) => {
4091
4091
  var A;
4092
- return ((A = L.current) == null ? void 0 : A.querySelector(`[data-tx-row="${H}"]`)) ?? null;
4092
+ return ((A = v.current) == null ? void 0 : A.querySelector(`[data-tx-row="${H}"]`)) ?? null;
4093
4093
  }, Ee = k("");
4094
4094
  Y(() => {
4095
- const H = L.current;
4095
+ const H = v.current;
4096
4096
  if (!H || !_) return;
4097
4097
  const A = () => {
4098
4098
  const W = H.getBoundingClientRect(), me = [];
@@ -4110,20 +4110,20 @@ function oc({ model: t, rows: e, player: n, fixed: r, applied: s, onFixOpen: a,
4110
4110
  return H.addEventListener("scroll", ce, { passive: !0 }), () => {
4111
4111
  window.clearTimeout(x), window.clearTimeout(V), H.removeEventListener("scroll", ce);
4112
4112
  };
4113
- }, [e, _, L]);
4113
+ }, [e, _, v]);
4114
4114
  const Le = (H) => {
4115
- const A = L.current, x = je(H);
4115
+ const A = v.current, x = je(H);
4116
4116
  if (!A || !x) return;
4117
4117
  const V = x.getBoundingClientRect().top - A.getBoundingClientRect().top + A.scrollTop, ce = A.scrollHeight - A.clientHeight, W = ur(A), me = Math.max(80, A.clientHeight - W.top - W.bottom), Z = x.offsetHeight > me ? 8 : (me - x.offsetHeight) / 2;
4118
4118
  A.scrollTop = Math.max(0, Math.min(ce, V - W.top - Z));
4119
4119
  }, we = (H) => {
4120
- const A = L.current, x = je(H);
4120
+ const A = v.current, x = je(H);
4121
4121
  if (!A || !A.clientHeight || !A.offsetParent || !x) return 0;
4122
4122
  const V = x.getBoundingClientRect(), ce = A.getBoundingClientRect(), W = ur(A), me = ce.top + W.top, Z = ce.bottom - W.bottom;
4123
4123
  return V.height > Z - me ? V.top < me - 4 ? -1 : V.top > Z - 60 ? 1 : 0 : V.bottom < me + 10 ? -1 : V.bottom > Z - 4 ? 1 : 0;
4124
4124
  }, _e = (H) => {
4125
4125
  pe.current = performance.now() + 420;
4126
- const A = L.current, x = je(H);
4126
+ const A = v.current, x = je(H);
4127
4127
  if (!A || !A.clientHeight || !x) return;
4128
4128
  const V = x.getBoundingClientRect(), ce = A.getBoundingClientRect(), W = A.scrollHeight - A.clientHeight, me = A.scrollTop, Z = ur(A), ve = Math.max(80, A.clientHeight - Z.top - Z.bottom), ze = V.height > ve ? 8 : (ve - V.height) / 2, Fe = Math.max(0, Math.min(W, me + (V.top - ce.top) - Z.top - ze));
4129
4129
  if (le.current && cancelAnimationFrame(le.current), Math.abs(Fe - me) < 2) {
@@ -4163,14 +4163,14 @@ function oc({ model: t, rows: e, player: n, fixed: r, applied: s, onFixOpen: a,
4163
4163
  /* @__PURE__ */ i(oe, { d: H === "up" ? "m4.5 15.75 7.5-7.5 7.5 7.5" : "m19.5 8.25-7.5 7.5-7.5-7.5", size: 15, sw: 2 }),
4164
4164
  "Now playing"
4165
4165
  ] }) });
4166
- return /* @__PURE__ */ g("div", { ref: L, "data-tx-feed": "1", className: `txfeed${y ? " txfeed--desk" : ""}${b && !p ? " is-find" : ""}`, children: [
4167
- /* @__PURE__ */ i(ll, { thumbRef: K }),
4166
+ return /* @__PURE__ */ g("div", { ref: v, "data-tx-feed": "1", className: `txfeed${y ? " txfeed--desk" : ""}${b && !p ? " is-find" : ""}`, children: [
4167
+ /* @__PURE__ */ i(cl, { thumbRef: K }),
4168
4168
  z && G === -1 && $("up"),
4169
4169
  e.map((H, A) => {
4170
4170
  var he;
4171
4171
  const x = z && A === T, V = F && A === T, ce = !!u && u === H.id, W = ne && !H.text.toLowerCase().includes(ne) && !(D && ((he = H.translations[D]) != null && he.toLowerCase().includes(ne))) ? 0.22 : !F || A <= T || ce ? 1 : 0.38, me = m ? () => n.playRow(A) : c && l ? () => {
4172
4172
  z && !x && n.seekRow(A), l(H);
4173
- } : z && x ? void 0 : () => n.playRow(A), Z = m ? null : dl(H, s, r), ve = !!Z && (Z.script > 0 || Z.manual), ze = y && !!a && v === H.id && !!Z && !ve, Fe = xr(t, H.speaker), Ae = Dr(t, H.speaker), ge = Ae.lane, Ye = D && H.translations[D] && H.language !== D ? H.translations[D] : null, Be = Yi(e, A, D), Q = V && !O && te ? mi(Be.map((ue) => ({ t: ue.text, sp: " " })), te) : null;
4173
+ } : z && x ? void 0 : () => n.playRow(A), Z = m ? null : hl(H, s, r), ve = !!Z && (Z.script > 0 || Z.manual), ze = y && !!a && L === H.id && !!Z && !ve, Fe = xr(t, H.speaker), Ae = Dr(t, H.speaker), ge = Ae.lane, Ye = D && H.translations[D] && H.language !== D ? H.translations[D] : null, Be = Yi(e, A, D), Q = V && !O && te ? mi(Be.map((ue) => ({ t: ue.text, sp: " " })), te) : null;
4174
4174
  return /* @__PURE__ */ g("div", { "data-tx-row": A, "data-sentence": H.sentenceId, className: `txline${B ? " txline--warm" : ""}${ce ? " txline--fixing" : ""}`, "aria-current": ce || void 0, style: { opacity: W }, onClick: me, onMouseEnter: y && a ? () => ie(H.id) : void 0, onMouseLeave: y && a ? () => ie(null) : void 0, children: [
4175
4175
  /* @__PURE__ */ g("div", { className: "txline__meta", children: [
4176
4176
  /* @__PURE__ */ i("span", { className: "txline__at", children: vt(H.start) }),
@@ -4180,11 +4180,11 @@ function oc({ model: t, rows: e, player: n, fixed: r, applied: s, onFixOpen: a,
4180
4180
  Ae.hasVoice && /* @__PURE__ */ i(Ai, { color: Ae.fg ?? `var(--lane-${ge})` })
4181
4181
  ] }),
4182
4182
  x && /* @__PURE__ */ i("span", { title: "Playing", style: { flex: "none", display: "inline-flex", alignItems: "center" }, children: /* @__PURE__ */ i(oe, { d: ee.headphones, size: y ? 15 : 14, sw: 1.6, stroke: f && H.speaker >= 0 ? Ae.fg ?? `var(--lane-${ge})` : "var(--ink-45)" }) }),
4183
- Z && h && /* @__PURE__ */ i(hl, { f: Z, desk: y, onOpen: a ? () => a(H, !0) : void 0 }),
4184
- ze && /* @__PURE__ */ i(Ml, { alone: !0, onOpen: () => a == null ? void 0 : a(H, !1) })
4183
+ Z && h && /* @__PURE__ */ i(Ml, { f: Z, desk: y, onOpen: a ? () => a(H, !0) : void 0 }),
4184
+ ze && /* @__PURE__ */ i(gl, { alone: !0, onOpen: () => a == null ? void 0 : a(H, !1) })
4185
4185
  ] }),
4186
4186
  /* @__PURE__ */ i("div", { className: "txline__text", children: Be.map((ue, ae) => {
4187
- const fe = `${ue.seq}:${ue.idx}`, Ue = Do(ue.prob), U = V && X, R = U && (O ? S >= ue.start && (S < ue.end || ae === Be.length - 1 || S < Be[ae + 1].start) : ae === Q), q = U && !R && (O ? ue.start > S : Q != null && ae > Q), re = !Ye && !m && (!!(r != null && r.has(fe)) || !!ue.script), de = !Ye && !m && d && !!Ue && !re, Ce = de ? Ue === "low" ? "var(--conf-low-half)" : "var(--conf-mid-half)" : null, ye = re ? "var(--brand)" : q ? "var(--ink-40)" : Ce ?? "var(--ink-96)";
4187
+ const fe = `${ue.seq}:${ue.idx}`, Ue = So(ue.prob), U = V && X, R = U && (O ? S >= ue.start && (S < ue.end || ae === Be.length - 1 || S < Be[ae + 1].start) : ae === Q), q = U && !R && (O ? ue.start > S : Q != null && ae > Q), re = !Ye && !m && (!!(r != null && r.has(fe)) || !!ue.script), de = !Ye && !m && d && !!Ue && !re, Ce = de ? Ue === "low" ? "var(--conf-low-half)" : "var(--conf-mid-half)" : null, ye = re ? "var(--brand)" : q ? "var(--ink-40)" : Ce ?? "var(--ink-96)";
4188
4188
  return /* @__PURE__ */ g("span", { children: [
4189
4189
  /* @__PURE__ */ i(
4190
4190
  "span",
@@ -4220,7 +4220,7 @@ function oc({ model: t, rows: e, player: n, fixed: r, applied: s, onFixOpen: a,
4220
4220
  z && G === 1 && $("down")
4221
4221
  ] });
4222
4222
  }
4223
- function lc({ open: t, q: e, onQ: n, onClose: r, hits: s, desk: a, inline: o, flash: l }) {
4223
+ function cc({ open: t, q: e, onQ: n, onClose: r, hits: s, desk: a, inline: o, flash: l }) {
4224
4224
  return /* @__PURE__ */ i("div", { className: o ? "searchbar searchbar--inline" : `searchbar searchbar--float${a ? " searchbar--desk" : ""}${t ? "" : " is-hidden"}`, children: /* @__PURE__ */ g("div", { children: [
4225
4225
  /* @__PURE__ */ i(oe, { d: ee.search, size: 16, sw: 1.7, style: { color: "var(--ink-45)", flex: "none" } }),
4226
4226
  /* @__PURE__ */ i("input", { value: e, onChange: (c) => n(c.target.value), onKeyDown: (c) => {
@@ -4234,7 +4234,7 @@ function lc({ open: t, q: e, onQ: n, onClose: r, hits: s, desk: a, inline: o, fl
4234
4234
  e.trim() && /* @__PURE__ */ i("button", { type: "button", className: "searchbar__x", onClick: () => n(""), "aria-label": "Clear", title: "Clear", children: /* @__PURE__ */ i(oe, { d: ee.close, size: 15, sw: 1.7 }) })
4235
4235
  ] }) });
4236
4236
  }
4237
- function cc(t, e, n, r, s) {
4237
+ function uc(t, e, n, r, s) {
4238
4238
  const a = k(n);
4239
4239
  a.current = n;
4240
4240
  const o = k(r);
@@ -4250,7 +4250,7 @@ function cc(t, e, n, r, s) {
4250
4250
  N = Date.now() + 1500;
4251
4251
  }, y = (m) => {
4252
4252
  m.buttons && p();
4253
- }, L = () => {
4253
+ }, v = () => {
4254
4254
  const m = d.scrollTop, f = m - h;
4255
4255
  if (h = m, Date.now() > N) {
4256
4256
  M = 0;
@@ -4258,8 +4258,8 @@ function cc(t, e, n, r, s) {
4258
4258
  }
4259
4259
  M = f < 0 == M < 0 ? M + f : f, M < -14 && !a.current ? (M = 0, s(!0)) : M > 56 && a.current && !o.current.trim() && (M = 0, s(!1));
4260
4260
  };
4261
- return d.addEventListener("wheel", p, { passive: !0 }), d.addEventListener("touchmove", p, { passive: !0 }), d.addEventListener("pointermove", y), d.addEventListener("scroll", L, { passive: !0 }), () => {
4262
- d.removeEventListener("wheel", p), d.removeEventListener("touchmove", p), d.removeEventListener("pointermove", y), d.removeEventListener("scroll", L);
4261
+ return d.addEventListener("wheel", p, { passive: !0 }), d.addEventListener("touchmove", p, { passive: !0 }), d.addEventListener("pointermove", y), d.addEventListener("scroll", v, { passive: !0 }), () => {
4262
+ d.removeEventListener("wheel", p), d.removeEventListener("touchmove", p), d.removeEventListener("pointermove", y), d.removeEventListener("scroll", v);
4263
4263
  };
4264
4264
  }, []), l;
4265
4265
  }
@@ -4279,7 +4279,7 @@ function kr(t, e) {
4279
4279
  n = n << 1 ^ (n >>> 7) * 285, n ^= (e >>> r & 1) * t;
4280
4280
  return n;
4281
4281
  }
4282
- function uc(t) {
4282
+ function dc(t) {
4283
4283
  const e = new Array(t).fill(0);
4284
4284
  e[t - 1] = 1;
4285
4285
  let n = 1;
@@ -4289,7 +4289,7 @@ function uc(t) {
4289
4289
  }
4290
4290
  return e;
4291
4291
  }
4292
- function dc(t, e) {
4292
+ function hc(t, e) {
4293
4293
  const n = new Array(e.length).fill(0);
4294
4294
  for (const r of t) {
4295
4295
  const s = r ^ n.shift();
@@ -4299,13 +4299,13 @@ function dc(t, e) {
4299
4299
  }
4300
4300
  return n;
4301
4301
  }
4302
- function hc(t) {
4302
+ function Mc(t) {
4303
4303
  if (t === 1) return [];
4304
4304
  const e = Math.floor(t / 7) + 2, n = t * 4 + 17, r = t === 32 ? 26 : Math.ceil((t * 4 + 4) / (e * 2 - 2)) * 2, s = [6];
4305
4305
  for (let a = n - 7; s.length < e; a -= r) s.splice(1, 0, a);
4306
4306
  return s;
4307
4307
  }
4308
- function Mc(t) {
4308
+ function gc(t) {
4309
4309
  const e = Array.from(new TextEncoder().encode(t));
4310
4310
  let n = 1;
4311
4311
  for (; n <= 40 && !(4 + (n <= 9 ? 8 : 16) + e.length * 8 <= ni(n) * 8); n++)
@@ -4320,43 +4320,43 @@ function Mc(t) {
4320
4320
  for (let T = 236; a.length < s; T ^= 253) o(T, 8);
4321
4321
  const l = [];
4322
4322
  for (let T = 0; T < a.length; T += 8) l.push(a.slice(T, T + 8).reduce((E, O) => E << 1 | O, 0));
4323
- const c = sn.blocks[n], u = sn.perBlock[n], d = Math.floor(Ui(n) / 8), h = c - d % c, M = Math.floor(d / c), N = [], p = uc(u);
4323
+ const c = sn.blocks[n], u = sn.perBlock[n], d = Math.floor(Ui(n) / 8), h = c - d % c, M = Math.floor(d / c), N = [], p = dc(u);
4324
4324
  for (let T = 0, E = 0; T < c; T++) {
4325
4325
  const O = l.slice(E, E + M - u + (T < h ? 0 : 1));
4326
4326
  E += O.length;
4327
- const te = dc(O, p);
4327
+ const te = hc(O, p);
4328
4328
  T < h && O.push(0), N.push(O.concat(te));
4329
4329
  }
4330
4330
  const y = [];
4331
4331
  for (let T = 0; T < N[0].length; T++) N.forEach((E, O) => {
4332
4332
  (T !== M - u || O >= h) && y.push(E[T]);
4333
4333
  });
4334
- const L = Array.from({ length: r }, () => new Array(r).fill(!1)), m = Array.from({ length: r }, () => new Array(r).fill(!1)), f = (T, E, O) => {
4335
- L[E][T] = O, m[E][T] = !0;
4334
+ const v = Array.from({ length: r }, () => new Array(r).fill(!1)), m = Array.from({ length: r }, () => new Array(r).fill(!1)), f = (T, E, O) => {
4335
+ v[E][T] = O, m[E][T] = !0;
4336
4336
  };
4337
4337
  for (let T = 0; T < r; T++)
4338
4338
  f(6, T, T % 2 === 0), f(T, 6, T % 2 === 0);
4339
4339
  const I = (T, E) => {
4340
4340
  for (let O = -4; O <= 4; O++) for (let te = -4; te <= 4; te++) {
4341
- const K = Math.max(Math.abs(te), Math.abs(O)), v = T + te, ie = E + O;
4342
- v >= 0 && v < r && ie >= 0 && ie < r && f(v, ie, K !== 2 && K !== 4);
4341
+ const K = Math.max(Math.abs(te), Math.abs(O)), L = T + te, ie = E + O;
4342
+ L >= 0 && L < r && ie >= 0 && ie < r && f(L, ie, K !== 2 && K !== 4);
4343
4343
  }
4344
4344
  };
4345
4345
  I(3, 3), I(r - 4, 3), I(3, r - 4);
4346
- const b = hc(n);
4346
+ const b = Mc(n);
4347
4347
  for (let T = 0; T < b.length; T++) for (let E = 0; E < b.length; E++)
4348
4348
  if (!(T === 0 && E === 0 || T === 0 && E === b.length - 1 || T === b.length - 1 && E === 0))
4349
4349
  for (let O = -2; O <= 2; O++) for (let te = -2; te <= 2; te++) f(b[T] + te, b[E] + O, Math.max(Math.abs(te), Math.abs(O)) !== 1);
4350
4350
  const D = (T) => {
4351
4351
  const E = sn.formatBits << 3 | T;
4352
4352
  let O = E;
4353
- for (let v = 0; v < 10; v++) O = O << 1 ^ (O >>> 9) * 1335;
4354
- const te = (E << 10 | O) ^ 21522, K = (v) => (te >>> v & 1) !== 0;
4355
- for (let v = 0; v <= 5; v++) f(8, v, K(v));
4353
+ for (let L = 0; L < 10; L++) O = O << 1 ^ (O >>> 9) * 1335;
4354
+ const te = (E << 10 | O) ^ 21522, K = (L) => (te >>> L & 1) !== 0;
4355
+ for (let L = 0; L <= 5; L++) f(8, L, K(L));
4356
4356
  f(8, 7, K(6)), f(8, 8, K(7)), f(7, 8, K(8));
4357
- for (let v = 9; v < 15; v++) f(14 - v, 8, K(v));
4358
- for (let v = 0; v < 8; v++) f(r - 1 - v, 8, K(v));
4359
- for (let v = 8; v < 15; v++) f(8, r - 15 + v, K(v));
4357
+ for (let L = 9; L < 15; L++) f(14 - L, 8, K(L));
4358
+ for (let L = 0; L < 8; L++) f(r - 1 - L, 8, K(L));
4359
+ for (let L = 8; L < 15; L++) f(8, r - 15 + L, K(L));
4360
4360
  f(8, r - 8, !0);
4361
4361
  };
4362
4362
  if (D(0), n >= 7) {
@@ -4364,8 +4364,8 @@ function Mc(t) {
4364
4364
  for (let O = 0; O < 12; O++) T = T << 1 ^ (T >>> 11) * 7973;
4365
4365
  const E = n << 12 | T;
4366
4366
  for (let O = 0; O < 18; O++) {
4367
- const te = (E >>> O & 1) !== 0, K = r - 11 + O % 3, v = Math.floor(O / 3);
4368
- f(K, v, te), f(v, K, te);
4367
+ const te = (E >>> O & 1) !== 0, K = r - 11 + O % 3, L = Math.floor(O / 3);
4368
+ f(K, L, te), f(L, K, te);
4369
4369
  }
4370
4370
  }
4371
4371
  let B = 0;
@@ -4373,7 +4373,7 @@ function Mc(t) {
4373
4373
  T === 6 && (T = 5);
4374
4374
  for (let E = 0; E < r; E++) for (let O = 0; O < 2; O++) {
4375
4375
  const te = T - O, K = T + 1 & 2 ? E : r - 1 - E;
4376
- !m[K][te] && B < y.length * 8 && (L[K][te] = (y[B >>> 3] >>> 7 - (B & 7) & 1) !== 0, B++);
4376
+ !m[K][te] && B < y.length * 8 && (v[K][te] = (y[B >>> 3] >>> 7 - (B & 7) & 1) !== 0, B++);
4377
4377
  }
4378
4378
  }
4379
4379
  const _ = (T, E, O) => {
@@ -4396,7 +4396,7 @@ function Mc(t) {
4396
4396
  return ((E + O) % 2 + E * O % 3) % 2 === 0;
4397
4397
  }
4398
4398
  }, X = (T) => {
4399
- for (let E = 0; E < r; E++) for (let O = 0; O < r; O++) !m[E][O] && _(T, O, E) && (L[E][O] = !L[E][O]);
4399
+ for (let E = 0; E < r; E++) for (let O = 0; O < r; O++) !m[E][O] && _(T, O, E) && (v[E][O] = !v[E][O]);
4400
4400
  }, z = () => {
4401
4401
  let T = 0;
4402
4402
  const E = (ne) => {
@@ -4411,16 +4411,16 @@ function Mc(t) {
4411
4411
  ne(le) === G ? (J++, J === 5 ? T += 3 : J > 5 && T++) : (O(pe, J), G || (T += E(pe) * 40), G = ne(le), J = 1);
4412
4412
  T += te(pe, G, J) * 40;
4413
4413
  };
4414
- for (let ne = 0; ne < r; ne++) K((G) => L[ne][G]);
4415
- for (let ne = 0; ne < r; ne++) K((G) => L[G][ne]);
4414
+ for (let ne = 0; ne < r; ne++) K((G) => v[ne][G]);
4415
+ for (let ne = 0; ne < r; ne++) K((G) => v[G][ne]);
4416
4416
  for (let ne = 0; ne < r - 1; ne++) for (let G = 0; G < r - 1; G++) {
4417
- const J = L[ne][G];
4418
- J === L[ne][G + 1] && J === L[ne + 1][G] && J === L[ne + 1][G + 1] && (T += 3);
4417
+ const J = v[ne][G];
4418
+ J === v[ne][G + 1] && J === v[ne + 1][G] && J === v[ne + 1][G + 1] && (T += 3);
4419
4419
  }
4420
- let v = 0;
4421
- for (const ne of L) for (const G of ne) G && v++;
4420
+ let L = 0;
4421
+ for (const ne of v) for (const G of ne) G && L++;
4422
4422
  const ie = r * r;
4423
- return T += (Math.ceil(Math.abs(v * 20 - ie * 10) / ie) - 1) * 10, T;
4423
+ return T += (Math.ceil(Math.abs(L * 20 - ie * 10) / ie) - 1) * 10, T;
4424
4424
  };
4425
4425
  let F = 0, S = 1 / 0;
4426
4426
  for (let T = 0; T < 8; T++) {
@@ -4428,16 +4428,16 @@ function Mc(t) {
4428
4428
  const E = z();
4429
4429
  E < S && (S = E, F = T), X(T);
4430
4430
  }
4431
- return X(F), D(F), L;
4431
+ return X(F), D(F), v;
4432
4432
  }
4433
- function gc(t) {
4434
- const e = Mc(t), n = e.length, r = 2;
4433
+ function fc(t) {
4434
+ const e = gc(t), n = e.length, r = 2;
4435
4435
  let s = "";
4436
4436
  for (let o = 0; o < n; o++) for (let l = 0; l < n; l++) e[o][l] && (s += `M${l} ${o}h1v1h-1z`);
4437
4437
  const a = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="${-r} ${-r} ${n + r * 2} ${n + r * 2}" shape-rendering="crispEdges"><rect x="${-r}" y="${-r}" width="${n + r * 2}" height="${n + r * 2}" fill="#fff"/><path fill="#111" d="${s}"/></svg>`;
4438
4438
  return `data:image/svg+xml,${encodeURIComponent(a)}`;
4439
4439
  }
4440
- const Ri = "M3.75 3.75v4.5m0-4.5h4.5m-4.5 0L9 9M3.75 20.25v-4.5m0 4.5h4.5m-4.5 0L9 15M20.25 3.75h-4.5m4.5 0v4.5m0-4.5L15 9m5.25 11.25h-4.5m4.5 0v-4.5m0 4.5L15 15", fc = "M9 9V4.5M9 9H4.5M9 9 3.75 3.75M9 15v4.5M9 15H4.5M9 15l-5.25 5.25M15 9h4.5M15 9V4.5M15 9l5.25-5.25M15 15h4.5M15 15v4.5m0-4.5 5.25 5.25";
4440
+ const Ri = "M3.75 3.75v4.5m0-4.5h4.5m-4.5 0L9 9M3.75 20.25v-4.5m0 4.5h4.5m-4.5 0L9 15M20.25 3.75h-4.5m4.5 0v4.5m0-4.5L15 9m5.25 11.25h-4.5m4.5 0v-4.5m0 4.5L15 15", pc = "M9 9V4.5M9 9H4.5M9 9 3.75 3.75M9 15v4.5M9 15H4.5M9 15l-5.25 5.25M15 9h4.5M15 9V4.5M15 9l5.25-5.25M15 15h4.5M15 15v4.5m0-4.5 5.25 5.25";
4441
4441
  function dr() {
4442
4442
  const t = document;
4443
4443
  return t.fullscreenElement ?? t.webkitFullscreenElement ?? null;
@@ -4450,7 +4450,7 @@ function si() {
4450
4450
  const t = document;
4451
4451
  return !!(t.fullscreenEnabled || t.webkitFullscreenEnabled);
4452
4452
  }
4453
- function pc() {
4453
+ function Nc() {
4454
4454
  var e;
4455
4455
  if (typeof document > "u" || !((e = window.matchMedia) != null && e.call(window, "(pointer: coarse)").matches)) return !1;
4456
4456
  const t = _r ?? document.documentElement;
@@ -4471,7 +4471,7 @@ function zn(t) {
4471
4471
  } catch {
4472
4472
  }
4473
4473
  }
4474
- function Nc(t) {
4474
+ function mc(t) {
4475
4475
  const [e, n] = j(() => {
4476
4476
  var r;
4477
4477
  return typeof window < "u" && !!((r = window.matchMedia) != null && r.call(window, t).matches);
@@ -4523,7 +4523,7 @@ function In({ pos: t, interactive: e, axis: n = "x" }) {
4523
4523
  /* @__PURE__ */ i("span", { className: "gfull__t gfull__end", style: { color: t.live ? "#ec634d" : "rgba(234,236,250,.6)" }, children: t.endLabel })
4524
4524
  ] });
4525
4525
  }
4526
- function ou({ pos: t }) {
4526
+ function lu({ pos: t }) {
4527
4527
  const [e, n] = j(null), r = (l) => {
4528
4528
  const c = l.currentTarget.getBoundingClientRect();
4529
4529
  return Math.min(1, Math.max(0, (l.clientX - c.left) / Math.max(1, c.width)));
@@ -4596,7 +4596,7 @@ function jr({ live: t, mini: e, desk: n, pct: r, mark: s }) {
4596
4596
  function Pi({ v: t, size: e }) {
4597
4597
  return /* @__PURE__ */ i("button", { type: "button", className: "gfull__btn", "aria-label": "Voices", title: t.title, disabled: !t.on, style: { opacity: t.on ? 1 : 0.45, cursor: t.on ? "pointer" : "default" }, onClick: t.on ? t.onClick : void 0, children: /* @__PURE__ */ i(oe, { d: ee.headphones, size: e, sw: 1.6 }) });
4598
4598
  }
4599
- function mc({ pos: t, transport: e, chip: n, voices: r, onShare: s, onFull: a, copied: o }) {
4599
+ function yc({ pos: t, transport: e, chip: n, voices: r, onShare: s, onFull: a, copied: o }) {
4600
4600
  return /* @__PURE__ */ g("div", { className: "gmini", "data-theme": "dark", children: [
4601
4601
  /* @__PURE__ */ i("div", { className: "gmini__shade", "aria-hidden": "true" }),
4602
4602
  /* @__PURE__ */ i("div", { className: "gmini__top", children: /* @__PURE__ */ i(jr, { live: t.live, mini: !0 }) }),
@@ -4616,8 +4616,8 @@ function mc({ pos: t, transport: e, chip: n, voices: r, onShare: s, onFull: a, c
4616
4616
  o
4617
4617
  ] });
4618
4618
  }
4619
- const yc = { color: "rgba(255,255,255,.4)" };
4620
- function Qi({ compact: t = !1, noFull: e = !1, page: n = !0, picture: r, title: s, desk: a, pos: o, sub: l, wait: c, pct: u, mute: d, cc: h, ad: M, chip: N, transport: p, picker: y, sheet: L, voices: m, voicesBtn: f, sheetOpen: I, onShare: b, onSettings: D, paused: B, copied: _, onTouch: X, onClose: z }) {
4619
+ const Tc = { color: "rgba(255,255,255,.4)" };
4620
+ function Qi({ compact: t = !1, noFull: e = !1, page: n = !0, picture: r, title: s, desk: a, pos: o, sub: l, wait: c, pct: u, mute: d, cc: h, ad: M, chip: N, transport: p, picker: y, sheet: v, voices: m, voicesBtn: f, sheetOpen: I, onShare: b, onSettings: D, paused: B, copied: _, onTouch: X, onClose: z }) {
4621
4621
  const [F, S] = j(() => !!dr());
4622
4622
  Y(() => {
4623
4623
  const Q = () => S(!!dr());
@@ -4629,7 +4629,7 @@ function Qi({ compact: t = !1, noFull: e = !1, page: n = !0, picture: r, title:
4629
4629
  T.current = z;
4630
4630
  const E = k(p.playable ? p.onPlay : void 0);
4631
4631
  E.current = p.playable ? p.onPlay : void 0;
4632
- const [O, te] = j(!1), [K, v] = j(0), ie = k(!1);
4632
+ const [O, te] = j(!1), [K, L] = j(0), ie = k(!1);
4633
4633
  Y(() => () => zn(!1), []), Y(() => {
4634
4634
  if (!n) return;
4635
4635
  const Q = [document.documentElement, document.body], he = Q.map((fe) => fe.style.background);
@@ -4643,7 +4643,7 @@ function Qi({ compact: t = !1, noFull: e = !1, page: n = !0, picture: r, title:
4643
4643
  }), ue && ae && (ue.content = ae);
4644
4644
  };
4645
4645
  }, []);
4646
- const ne = Ie(() => n && pc(), [n]), [G, J] = j(ne);
4646
+ const ne = Ie(() => n && Nc(), [n]), [G, J] = j(ne);
4647
4647
  Y(() => {
4648
4648
  if (!n) return;
4649
4649
  const Q = [document.documentElement, document.body], he = Q.map((fe) => [fe.style.overflow, fe.style.overscrollBehavior]);
@@ -4674,7 +4674,7 @@ function Qi({ compact: t = !1, noFull: e = !1, page: n = !0, picture: r, title:
4674
4674
  window.removeEventListener("keydown", he, !0), window.removeEventListener("keyup", ue, !0);
4675
4675
  };
4676
4676
  }, []);
4677
- const le = Nc("(orientation: landscape) and (max-height: 540px)"), Te = k(null), [je, Ee] = j(null);
4677
+ const le = mc("(orientation: landscape) and (max-height: 540px)"), Te = k(null), [je, Ee] = j(null);
4678
4678
  Bt(() => {
4679
4679
  const Q = Te.current;
4680
4680
  if (!Q || (Ee(Q.getBoundingClientRect().width), typeof ResizeObserver > "u")) return;
@@ -4692,7 +4692,7 @@ function Qi({ compact: t = !1, noFull: e = !1, page: n = !0, picture: r, title:
4692
4692
  const Se = k(0), $ = (Q) => {
4693
4693
  if (Q.pointerType !== "mouse") return;
4694
4694
  const he = Date.now();
4695
- !Pe.current && he - Se.current < 1e3 || (Se.current = he, v((ue) => ue + 1));
4695
+ !Pe.current && he - Se.current < 1e3 || (Se.current = he, L((ue) => ue + 1));
4696
4696
  }, H = !we && le, A = k(null), x = l ? l.words.map((Q) => Q.dim ? 0 : 1).join("") + l.words.length + ":" + (l.cursor ?? "") : "";
4697
4697
  Bt(() => {
4698
4698
  const Q = A.current;
@@ -4707,7 +4707,7 @@ function Qi({ compact: t = !1, noFull: e = !1, page: n = !0, picture: r, title:
4707
4707
  }, [x, H]);
4708
4708
  const [V, ce] = j(!0), [W, me] = j(!1), Z = k(void 0);
4709
4709
  Y(() => () => window.clearTimeout(Z.current), []);
4710
- const ve = B != null && B.share ? B.share.url(V && B.share.at >= 1 ? Math.floor(B.share.at) : null) : "", ze = Ie(() => we && ve && !p.playing ? gc(ve) : "", [we, ve, p.playing]), Fe = () => {
4710
+ const ve = B != null && B.share ? B.share.url(V && B.share.at >= 1 ? Math.floor(B.share.at) : null) : "", ze = Ie(() => we && ve && !p.playing ? fc(ve) : "", [we, ve, p.playing]), Fe = () => {
4711
4711
  var Q;
4712
4712
  (Q = navigator.clipboard) == null || Q.writeText(ve).then(() => {
4713
4713
  me(!0), window.clearTimeout(Z.current), Z.current = window.setTimeout(() => me(!1), 1800);
@@ -4737,7 +4737,7 @@ function Qi({ compact: t = !1, noFull: e = !1, page: n = !0, picture: r, title:
4737
4737
  ] }), ge = (Q, he, ue, ae, fe, Ue = 0) => /* @__PURE__ */ i("button", { type: "button", className: "gfull__btn", title: Q, "aria-label": Q, onClick: ae, children: /* @__PURE__ */ i(oe, { d: he, size: (we ? 20 : _e ? 15 : 18) + Ue, sw: ue, style: fe }) }), Ye = /* @__PURE__ */ g("div", { className: "gfull__acts", children: [
4738
4738
  f && /* @__PURE__ */ i(Pi, { v: f, size: we ? 20 : _e ? 15 : 18 }),
4739
4739
  b && ge("Share", ee.share, 1.6, b),
4740
- si() && !e && ge(F ? "Exit full screen" : "Full screen", F ? fc : Ri, 1.7, () => zn(!F)),
4740
+ si() && !e && ge(F ? "Exit full screen" : "Full screen", F ? pc : Ri, 1.7, () => zn(!F)),
4741
4741
  z && ge("Close player", ee.close, 1.7, z)
4742
4742
  ] }), Be = (d || h || D) && /* @__PURE__ */ g("div", { className: "gfull__top", children: [
4743
4743
  d && ge(d.muted ? "Unmute" : "Mute", d.muted ? ee.volumeOff : ee.volume, 1.6, d.onToggle),
@@ -4755,7 +4755,7 @@ function Qi({ compact: t = !1, noFull: e = !1, page: n = !0, picture: r, title:
4755
4755
  onPointerMove: $,
4756
4756
  onPointerDownCapture: (Q) => {
4757
4757
  var he, ue;
4758
- O && (ie.current = !0), v((ae) => ae + 1), (ue = (he = Q.target).closest) != null && ue.call(he, '[aria-label="Exit full screen"], [aria-label="Full screen"], [aria-label="Close player"]') || X();
4758
+ O && (ie.current = !0), L((ae) => ae + 1), (ue = (he = Q.target).closest) != null && ue.call(he, '[aria-label="Exit full screen"], [aria-label="Full screen"], [aria-label="Close player"]') || X();
4759
4759
  },
4760
4760
  onClickCapture: (Q) => {
4761
4761
  ie.current && (ie.current = !1, Q.stopPropagation(), Q.preventDefault());
@@ -4802,7 +4802,7 @@ function Qi({ compact: t = !1, noFull: e = !1, page: n = !0, picture: r, title:
4802
4802
  ] }),
4803
4803
  " "
4804
4804
  ] }),
4805
- l.words.map((Q, he) => /* @__PURE__ */ g("span", { "data-said": Q.dim ? void 0 : "", "data-at": l.cursor != null && he <= l.cursor ? "" : void 0, style: Q.dim ? yc : void 0, children: [
4805
+ l.words.map((Q, he) => /* @__PURE__ */ g("span", { "data-said": Q.dim ? void 0 : "", "data-at": l.cursor != null && he <= l.cursor ? "" : void 0, style: Q.dim ? Tc : void 0, children: [
4806
4806
  Q.t,
4807
4807
  Q.sp
4808
4808
  ] }, he))
@@ -4832,14 +4832,14 @@ function Qi({ compact: t = !1, noFull: e = !1, page: n = !0, picture: r, title:
4832
4832
  ] })
4833
4833
  ] }) }),
4834
4834
  y,
4835
- L,
4835
+ v,
4836
4836
  m
4837
4837
  ] })
4838
4838
  ]
4839
4839
  }
4840
4840
  );
4841
4841
  }
4842
- function Tc({ dark: t, back: e, home: n, live: r, title: s, badge: a, subline: o, onOptions: l, optionsActive: c }) {
4842
+ function wc({ dark: t, back: e, home: n, live: r, title: s, badge: a, subline: o, onOptions: l, optionsActive: c }) {
4843
4843
  return /* @__PURE__ */ g("div", { className: "ghead", children: [
4844
4844
  e && /* @__PURE__ */ i("button", { type: "button", className: "ghead__back", "aria-label": "Back", title: "Back", onClick: e, children: /* @__PURE__ */ i(oe, { d: ee.chevronLeft, size: 19, sw: 1.7 }) }),
4845
4845
  r && /* @__PURE__ */ i("span", { className: "mark", children: /* @__PURE__ */ i(Ir, { dark: t, size: 30 }) }),
@@ -4857,13 +4857,13 @@ function Tc({ dark: t, back: e, home: n, live: r, title: s, badge: a, subline: o
4857
4857
  ] }) })
4858
4858
  ] });
4859
4859
  }
4860
- const wc = "m15.75 10.5 4.72-4.72a.75.75 0 0 1 1.28.53v11.38a.75.75 0 0 1-1.28.53l-4.72-4.72M4.5 18.75h9a2.25 2.25 0 0 0 2.25-2.25v-9a2.25 2.25 0 0 0-2.25-2.25h-9A2.25 2.25 0 0 0 2.25 7.5v9a2.25 2.25 0 0 0 2.25 2.25Z", Lc = (t, e = !1) => [{ value: "read", label: t.read, icon: /* @__PURE__ */ i(oe, { d: ee.book, size: 17 }) }, { value: "listen", label: /* @__PURE__ */ i("span", { style: { display: "inline-block", minWidth: 52, textAlign: "center" }, children: e ? t.watch : t.listen }), icon: /* @__PURE__ */ i(oe, { d: e ? wc : ee.headphones, size: 19, sw: 1.5 }) }];
4861
- function vc(t) {
4860
+ const Lc = "m15.75 10.5 4.72-4.72a.75.75 0 0 1 1.28.53v11.38a.75.75 0 0 1-1.28.53l-4.72-4.72M4.5 18.75h9a2.25 2.25 0 0 0 2.25-2.25v-9a2.25 2.25 0 0 0-2.25-2.25h-9A2.25 2.25 0 0 0 2.25 7.5v9a2.25 2.25 0 0 0 2.25 2.25Z", vc = (t, e = !1) => [{ value: "read", label: t.read, icon: /* @__PURE__ */ i(oe, { d: ee.book, size: 17 }) }, { value: "listen", label: /* @__PURE__ */ i("span", { style: { display: "inline-block", minWidth: 52, textAlign: "center" }, children: e ? t.watch : t.listen }), icon: /* @__PURE__ */ i(oe, { d: e ? Lc : ee.headphones, size: 19, sw: 1.5 }) }];
4861
+ function kc(t) {
4862
4862
  if (!t.lang) return null;
4863
4863
  const e = t.langName;
4864
4864
  return t.translateFailed === t.lang ? { kind: "translateFailed", lang: e } : t.voiceFailed ? { kind: "voiceFailed", lang: e } : t.translating ? { kind: "translating", lang: e } : t.starting != null ? { kind: "starting", lang: e, since: t.starting } : t.relang || t.slowLine ? { kind: "voice", lang: e, since: t.lineSince } : null;
4865
4865
  }
4866
- function kc(t, e) {
4866
+ function jc(t, e) {
4867
4867
  const [n, r] = j(null), [s, a] = j(!1);
4868
4868
  return Y(() => {
4869
4869
  if (!t) {
@@ -4876,8 +4876,8 @@ function kc(t, e) {
4876
4876
  return () => clearTimeout(l);
4877
4877
  }, [t, e]), [s, n];
4878
4878
  }
4879
- const jc = (t) => `${Math.floor(t / 60)}:${String(t % 60).padStart(2, "0")}`;
4880
- function zc({ state: t, line: e, onRetry: n, onOriginal: r }) {
4879
+ const zc = (t) => `${Math.floor(t / 60)}:${String(t % 60).padStart(2, "0")}`;
4880
+ function Ic({ state: t, line: e, onRetry: n, onOriginal: r }) {
4881
4881
  const [s, a] = j(() => Date.now());
4882
4882
  Y(() => {
4883
4883
  if (t.since == null) return;
@@ -4910,7 +4910,7 @@ function zc({ state: t, line: e, onRetry: n, onOriginal: r }) {
4910
4910
  /* @__PURE__ */ g("div", { className: "pwait__head", children: [
4911
4911
  l ? /* @__PURE__ */ i("div", { className: "pwait__mark", "aria-hidden": "true", children: /* @__PURE__ */ i(oe, { d: ee.warnCircle, size: 18, sw: 1.8 }) }) : /* @__PURE__ */ i("div", { className: "pwait__spin", "aria-hidden": "true" }),
4912
4912
  /* @__PURE__ */ i("div", { className: "pwait__t", children: c }),
4913
- !l && o != null && o >= 3 && /* @__PURE__ */ i("div", { className: "pwait__clock", "aria-label": `${o} seconds`, children: jc(o) })
4913
+ !l && o != null && o >= 3 && /* @__PURE__ */ i("div", { className: "pwait__clock", "aria-label": `${o} seconds`, children: zc(o) })
4914
4914
  ] }),
4915
4915
  /* @__PURE__ */ i("div", { className: "pwait__note", children: u }),
4916
4916
  !l && /* @__PURE__ */ i("div", { className: "pwait__bar", "aria-hidden": "true", children: /* @__PURE__ */ i("div", {}) }),
@@ -4923,19 +4923,19 @@ function zc({ state: t, line: e, onRetry: n, onOriginal: r }) {
4923
4923
  }
4924
4924
  );
4925
4925
  }
4926
- const Yr = "https://app.vocalstack.com", Ic = "/connect/transcribe";
4927
- function Oc() {
4926
+ const Yr = "https://app.vocalstack.com", Oc = "/connect/transcribe";
4927
+ function Cc() {
4928
4928
  const t = new Uint8Array(24);
4929
4929
  return crypto.getRandomValues(t), btoa(String.fromCharCode(...t)).replace(/\+/g, "-").replace(/\//g, "_").replace(/=+$/, "");
4930
4930
  }
4931
4931
  function $i(t, e, n) {
4932
- const r = new URL(t ?? Yr), s = Oc(), a = new URL(Ic, r);
4932
+ const r = new URL(t ?? Yr), s = Cc(), a = new URL(Oc, r);
4933
4933
  e.url && a.searchParams.set("url", e.url), e.transcription && a.searchParams.set("transcription", e.transcription), e.ask && a.searchParams.set("ask", "1"), e.connect && a.searchParams.set("connect", "1"), a.searchParams.set("origin", window.location.origin), a.searchParams.set("nonce", s);
4934
4934
  const o = 480, l = 640, c = Math.max(0, (window.screenX ?? 0) + ((window.outerWidth ?? o) - o) / 2), u = Math.max(0, (window.screenY ?? 0) + ((window.outerHeight ?? l) - l) / 2), d = window.open(a.toString(), "vocalstack-connect", `popup=yes,width=${o},height=${l},left=${Math.round(c)},top=${Math.round(u)}`);
4935
4935
  return d ? new Promise((h, M) => {
4936
4936
  let N = !1;
4937
4937
  const p = (m) => {
4938
- N || (N = !0, window.removeEventListener("message", y), clearInterval(L), m());
4938
+ N || (N = !0, window.removeEventListener("message", y), clearInterval(v), m());
4939
4939
  }, y = (m) => {
4940
4940
  if (m.origin !== r.origin || m.source !== d) return;
4941
4941
  const f = m.data;
@@ -4964,50 +4964,50 @@ function $i(t, e, n) {
4964
4964
  }
4965
4965
  };
4966
4966
  window.addEventListener("message", y);
4967
- const L = setInterval(() => {
4967
+ const v = setInterval(() => {
4968
4968
  d.closed && p(() => h(null));
4969
4969
  }, 500);
4970
4970
  }) : Promise.reject(new Error("Your browser blocked the VocalStack window. Allow pop-ups for this site and try again."));
4971
4971
  }
4972
- async function Cc(t, e, n) {
4972
+ async function bc(t, e, n) {
4973
4973
  const r = await $i(t, { url: e }, n);
4974
4974
  return r === "connected" ? null : r;
4975
4975
  }
4976
4976
  const Bi = "vsp.connected";
4977
- function bc(t) {
4977
+ function xc(t) {
4978
4978
  try {
4979
4979
  return localStorage.getItem(Bi) === new URL(t ?? Yr).origin;
4980
4980
  } catch {
4981
4981
  return !1;
4982
4982
  }
4983
4983
  }
4984
- function xc(t) {
4984
+ function Dc(t) {
4985
4985
  try {
4986
4986
  localStorage.setItem(Bi, new URL(t ?? Yr).origin);
4987
4987
  } catch {
4988
4988
  }
4989
4989
  }
4990
- const Dc = {
4990
+ const Sc = {
4991
4991
  "signing-in": "Sign in to VocalStack in the window that opened…",
4992
4992
  consent: "Confirm in the VocalStack window…",
4993
4993
  looking: "Looking for your transcription of this video…",
4994
4994
  confirm: "Confirm in the VocalStack window…",
4995
4995
  checking: "Checking the link…",
4996
4996
  starting: "Starting the transcription…"
4997
- }, Sc = /^(https?:\/\/)?([\w-]+\.)+[a-z]{2,}(\/\S*)?$/i;
4998
- function Ac({ options: t, onStarted: e, onReplay: n, onClose: r }) {
4997
+ }, Ac = /^(https?:\/\/)?([\w-]+\.)+[a-z]{2,}(\/\S*)?$/i;
4998
+ function Ec({ options: t, onStarted: e, onReplay: n, onClose: r }) {
4999
4999
  const [s, a] = j(""), [o, l] = j(!1), [c, u] = j(null), [d, h] = j(null);
5000
5000
  Y(() => {
5001
- const y = (L) => {
5002
- L.key === "Escape" && r();
5001
+ const y = (v) => {
5002
+ v.key === "Escape" && r();
5003
5003
  };
5004
5004
  return window.addEventListener("keydown", y), () => window.removeEventListener("keydown", y);
5005
5005
  }, [r]);
5006
- const M = s.trim(), N = Sc.test(M), p = async () => {
5006
+ const M = s.trim(), N = Ac.test(M), p = async () => {
5007
5007
  if (!(!N || o)) {
5008
5008
  l(!0), u(null);
5009
5009
  try {
5010
- const y = await Cc(t.appUrl, /^https?:\/\//i.test(M) ? M : `https://${M}`, h);
5010
+ const y = await bc(t.appUrl, /^https?:\/\//i.test(M) ? M : `https://${M}`, h);
5011
5011
  y && e(y);
5012
5012
  } catch (y) {
5013
5013
  u(y instanceof Error ? y.message : "Something went wrong. Please try again.");
@@ -5031,7 +5031,7 @@ function Ac({ options: t, onStarted: e, onReplay: n, onClose: r }) {
5031
5031
  }, "aria-label": "Video link" }),
5032
5032
  /* @__PURE__ */ i("button", { type: "submit", className: "vsp-end__go", disabled: !N || o, children: o ? /* @__PURE__ */ i(it, { size: 15, color: "#050507", track: "rgba(5,5,7,.2)" }) : "Transcribe" })
5033
5033
  ] }),
5034
- o && /* @__PURE__ */ i("div", { className: "vsp-end__note", role: "status", children: Dc[d ?? "checking"] }),
5034
+ o && /* @__PURE__ */ i("div", { className: "vsp-end__note", role: "status", children: Sc[d ?? "checking"] }),
5035
5035
  c && /* @__PURE__ */ i("div", { className: "vsp-end__err", role: "alert", children: c }),
5036
5036
  /* @__PURE__ */ g("div", { className: "vsp-end__foot", children: [
5037
5037
  /* @__PURE__ */ i("span", { children: "Uses your VocalStack account. You'll be asked to sign in if you're not." }),
@@ -5050,15 +5050,15 @@ function Vi(t) {
5050
5050
  return window.addEventListener("resize", r), () => window.removeEventListener("resize", r);
5051
5051
  }, [t]), t ?? e;
5052
5052
  }
5053
- const Ec = { lang: null, subtitles: !0, speakerLabels: !1, wordHighlight: !0, translateAudio: !0, voices: "cloned", removeBackground: !1, muted: !1 };
5054
- function _c(t, e) {
5053
+ const _c = { lang: null, subtitles: !0, speakerLabels: !1, wordHighlight: !0, translateAudio: !0, voices: "cloned", removeBackground: !1, muted: !1 };
5054
+ function Yc(t, e) {
5055
5055
  const n = Oi(), [r, s] = Ti(), [a, o] = j(null), [l, c] = j("main"), u = Lr(n, t.lang), d = Ie(() => wi(n, "translation"), [n]), h = (_) => {
5056
5056
  e({ lang: _ }), s(_);
5057
5057
  }, M = Cr({ open: a === "lang" || a === "settings" && l === "lang", onClose: () => a === "lang" ? o(null) : c("main"), value: t.lang, onSelect: h, languages: d, none: "As spoken", pinned: t.lang ? [t.lang] : [], recent: r, keepOpen: !0 }), N = () => {
5058
5058
  o(null), c("main");
5059
5059
  }, p = t.lang ? /* @__PURE__ */ i("span", { style: { fontSize: 19, lineHeight: 1 }, children: u.flag }) : /* @__PURE__ */ i(oe, { d: ee.langAuto, size: 19, sw: 1.7 }), y = /* @__PURE__ */ i("button", { type: "button", className: "gfull__btn", "aria-label": `Language: ${t.lang ? u.label : "As spoken"}`, title: t.lang ? u.label : "As spoken", onClick: (_) => {
5060
5060
  _.stopPropagation(), c("main"), o((X) => X === "lang" ? null : "lang");
5061
- }, children: p }), L = /* @__PURE__ */ i(oe, { d: ee.chevronRight, size: 17, sw: 1.6, style: { flex: "none", color: "var(--ink-45)" } }), m = /* @__PURE__ */ g("span", { className: "vs-sheet__title", style: { position: "relative" }, children: [
5061
+ }, children: p }), v = /* @__PURE__ */ i(oe, { d: ee.chevronRight, size: 17, sw: 1.6, style: { flex: "none", color: "var(--ink-45)" } }), m = /* @__PURE__ */ g("span", { className: "vs-sheet__title", style: { position: "relative" }, children: [
5062
5062
  " ",
5063
5063
  /* @__PURE__ */ g("button", { type: "button", onClick: () => c("main"), "aria-label": "Back", className: "vsp-idlesheet__back", children: [
5064
5064
  /* @__PURE__ */ i(oe, { d: ee.chevronLeft, size: 18, sw: 1.8 }),
@@ -5088,7 +5088,7 @@ function _c(t, e) {
5088
5088
  /* @__PURE__ */ i("div", { className: "srow__s", children: t.lang ? `Translated to ${u.label}` : "Original language" })
5089
5089
  ] }),
5090
5090
  /* @__PURE__ */ i("span", { style: { fontSize: 18, lineHeight: 1 }, children: t.lang ? u.flag : null }),
5091
- L
5091
+ v
5092
5092
  ] }),
5093
5093
  /* @__PURE__ */ i("div", { className: "sdiv" }),
5094
5094
  /* @__PURE__ */ g("div", { className: "srow srow--tap", role: "button", onClick: () => c("subs"), children: [
@@ -5096,7 +5096,7 @@ function _c(t, e) {
5096
5096
  /* @__PURE__ */ i("div", { className: "srow__t", children: "Subtitles" }),
5097
5097
  /* @__PURE__ */ i("div", { className: "srow__s", children: t.subtitles ? "On · speaker labels and word highlighting" : "Off" })
5098
5098
  ] }),
5099
- L
5099
+ v
5100
5100
  ] }),
5101
5101
  /* @__PURE__ */ i("div", { className: "sdiv" }),
5102
5102
  /* @__PURE__ */ g("div", { className: "srow srow--tap", role: "button", onClick: () => c("audio"), children: [
@@ -5104,7 +5104,7 @@ function _c(t, e) {
5104
5104
  /* @__PURE__ */ i("div", { className: "srow__t", children: "Audio" }),
5105
5105
  /* @__PURE__ */ i("div", { className: "srow__s", children: t.lang && t.translateAudio ? `Translated, ${t.voices === "cloned" ? "cloned voices" : "synthetic voices"}` : t.removeBackground ? "Original speech, background removed" : "Original sound" })
5106
5106
  ] }),
5107
- L
5107
+ v
5108
5108
  ] })
5109
5109
  ] }), B = /* @__PURE__ */ g(De, { children: [
5110
5110
  /* @__PURE__ */ i(Vt, { open: a === "lang", onClose: N, title: "LANGUAGE", kind: "picker", header: M.search, sticky: !0, children: /* @__PURE__ */ i(gr, { children: M.list }) }),
@@ -5169,19 +5169,19 @@ const Nt = (t, e = "nonzero") => /* @__PURE__ */ i("path", { d: t, fill: "curren
5169
5169
  /* @__PURE__ */ i("circle", { cx: "8", cy: "12", r: "1.6", fill: "currentColor", stroke: "none" }),
5170
5170
  /* @__PURE__ */ i("path", { d: "M11.5 10h6M11.5 14h4" })
5171
5171
  ] }) }
5172
- ], Yc = 14, Uc = 4;
5173
- function Rc(t) {
5172
+ ], Uc = 14, Rc = 4;
5173
+ function Pc(t) {
5174
5174
  const e = ii.length, n = [];
5175
5175
  for (let r = 0; r < 11; r++) n.push(ii[(r + t * 7) % e]);
5176
5176
  return n;
5177
5177
  }
5178
- function Pc({ t }) {
5178
+ function Qc({ t }) {
5179
5179
  return /* @__PURE__ */ g("span", { className: "vsp-prov__tile", style: { "--tint": t.tint }, children: [
5180
5180
  /* @__PURE__ */ i("svg", { viewBox: "0 0 24 24", width: "100%", height: "100%", "aria-hidden": "true", children: t.glyph }),
5181
5181
  /* @__PURE__ */ i("span", { className: "vsp-prov__name", children: t.name })
5182
5182
  ] });
5183
5183
  }
5184
- function Qc() {
5184
+ function $c() {
5185
5185
  const t = k(null), [e, n] = j(!0), [r, s] = j(() => typeof document > "u" || !document.hidden);
5186
5186
  return Y(() => {
5187
5187
  const a = () => s(!document.hidden);
@@ -5191,9 +5191,9 @@ function Qc() {
5191
5191
  return o && typeof IntersectionObserver < "u" && (l = new IntersectionObserver(([c]) => n(c.isIntersecting)), l.observe(o)), () => {
5192
5192
  document.removeEventListener("visibilitychange", a), l == null || l.disconnect();
5193
5193
  };
5194
- }, []), /* @__PURE__ */ i("div", { ref: t, className: `vsp-prov${e && r ? "" : " vsp-prov--still"}`, "aria-hidden": "true", children: /* @__PURE__ */ i("div", { className: "vsp-prov__plane", children: Array.from({ length: Yc }, (a, o) => {
5195
- const l = Rc(o);
5196
- return /* @__PURE__ */ i("div", { className: `vsp-prov__row${o % 2 ? " vsp-prov__row--rev" : ""}`, style: { animationDuration: `${80 + o * 11}s`, animationDelay: `-${o * 17}s` }, children: Array.from({ length: Uc }, (c, u) => l.map((d, h) => /* @__PURE__ */ i(Pc, { t: d }, `${u}-${h}`))) }, o);
5194
+ }, []), /* @__PURE__ */ i("div", { ref: t, className: `vsp-prov${e && r ? "" : " vsp-prov--still"}`, "aria-hidden": "true", children: /* @__PURE__ */ i("div", { className: "vsp-prov__plane", children: Array.from({ length: Uc }, (a, o) => {
5195
+ const l = Pc(o);
5196
+ return /* @__PURE__ */ i("div", { className: `vsp-prov__row${o % 2 ? " vsp-prov__row--rev" : ""}`, style: { animationDuration: `${80 + o * 11}s`, animationDelay: `-${o * 17}s` }, children: Array.from({ length: Rc }, (c, u) => l.map((d, h) => /* @__PURE__ */ i(Qc, { t: d }, `${u}-${h}`))) }, o);
5197
5197
  }) }) });
5198
5198
  }
5199
5199
  const Hi = {
@@ -5211,8 +5211,8 @@ function hr(t) {
5211
5211
  return t;
5212
5212
  }
5213
5213
  }
5214
- function $c(t, e) {
5215
- const [n, r] = j(!1), [s, a] = j(null), [o, l] = j(null), [c, u] = j(() => bc(t)), d = Je((N) => {
5214
+ function Bc(t, e) {
5215
+ const [n, r] = j(!1), [s, a] = j(null), [o, l] = j(null), [c, u] = j(() => xc(t)), d = Je((N) => {
5216
5216
  if (n) return;
5217
5217
  r(!0), l(null);
5218
5218
  let p;
@@ -5222,30 +5222,30 @@ function $c(t, e) {
5222
5222
  p = Promise.reject(y);
5223
5223
  }
5224
5224
  p.then((y) => {
5225
- y && (xc(t), u(!0), y !== "connected" && e(y));
5225
+ y && (Dc(t), u(!0), y !== "connected" && e(y));
5226
5226
  }).catch((y) => l(y instanceof Error ? y.message : "Something went wrong. Please try again.")).finally(() => {
5227
5227
  r(!1), a(null);
5228
5228
  });
5229
5229
  }, [t, n, e]), h = Je(() => d({ connect: !0 }), [d]), M = Je((N, p) => d({ url: N, ask: p }), [d]);
5230
5230
  return { busy: n, status: s, err: o, connected: c, connect: h, start: M };
5231
5231
  }
5232
- function Bc(t) {
5232
+ function Vc(t) {
5233
5233
  return /\.(mp4|webm|mov|m4v|ogv|mkv)(\?|#|$)/i.test(t);
5234
5234
  }
5235
- function Vc({ poster: t, src: e }) {
5235
+ function Hc({ poster: t, src: e }) {
5236
5236
  const n = e ? Di(e) : null, r = t ?? (n ? `https://i.ytimg.com/vi/${n}/hqdefault.jpg` : null);
5237
- return r ? /* @__PURE__ */ i("div", { className: "vsp-idle__pic", style: { backgroundImage: `url(${r})` } }) : e && Bc(e) ? /* @__PURE__ */ i("video", { className: "vsp-idle__pic vsp-idle__frame", src: `${e}#t=1`, muted: !0, playsInline: !0, preload: "metadata", "aria-hidden": "true" }) : /* @__PURE__ */ g(De, { children: [
5237
+ return r ? /* @__PURE__ */ i("div", { className: "vsp-idle__pic", style: { backgroundImage: `url(${r})` } }) : e && Vc(e) ? /* @__PURE__ */ i("video", { className: "vsp-idle__pic vsp-idle__frame", src: `${e}#t=1`, muted: !0, playsInline: !0, preload: "metadata", "aria-hidden": "true" }) : /* @__PURE__ */ g(De, { children: [
5238
5238
  /* @__PURE__ */ i("div", { className: "vsp-idle__pic vsp-idle__pic--brand" }),
5239
- /* @__PURE__ */ i(Qc, {})
5239
+ /* @__PURE__ */ i($c, {})
5240
5240
  ] });
5241
5241
  }
5242
- const Hc = { live: !1, atEdge: !1, edgeFrac: null, pct: 0, atLabel: "0:00", labelAt: () => "0:00", endLabel: "0:00", onSeek: () => {
5242
+ const Wc = { live: !1, atEdge: !1, edgeFrac: null, pct: 0, atLabel: "0:00", labelAt: () => "0:00", endLabel: "0:00", onSeek: () => {
5243
5243
  } };
5244
5244
  function Dn({ idle: t, poster: e, src: n, title: r, page: s, onAct: a, children: o }) {
5245
- const l = _c(t.prefs, t.set), c = Vi(), u = k(null), [d, h] = j(!1);
5245
+ const l = Yc(t.prefs, t.set), c = Vi(), u = k(null), [d, h] = j(!1);
5246
5246
  Bt(() => {
5247
- var L;
5248
- const N = (L = u.current) == null ? void 0 : L.parentElement;
5247
+ var v;
5248
+ const N = (v = u.current) == null ? void 0 : v.parentElement;
5249
5249
  if (!N) return;
5250
5250
  const p = () => h(N.getBoundingClientRect().width < 560);
5251
5251
  if (p(), typeof ResizeObserver > "u") return;
@@ -5256,7 +5256,7 @@ function Dn({ idle: t, poster: e, src: n, title: r, page: s, onAct: a, children:
5256
5256
  }, onNext: () => {
5257
5257
  }, playing: !1, playable: !0, playTitle: "Connect to play", onPlay: a };
5258
5258
  return /* @__PURE__ */ g("div", { ref: u, className: `vsp-idleroot${d ? " vsp-idleroot--small" : ""}`, children: [
5259
- /* @__PURE__ */ i(Qi, { page: s, picture: /* @__PURE__ */ i(Vc, { poster: e, src: n }), title: r, desk: c, pos: Hc, sub: null, mute: { muted: t.prefs.muted, onToggle: () => t.set({ muted: !t.prefs.muted }) }, cc: { on: t.prefs.subtitles, onToggle: () => t.set({ subtitles: !t.prefs.subtitles }) }, chip: l.chip, transport: M, picker: l.sheets, sheet: null, voices: null, voicesBtn: null, sheetOpen: l.sheetOpen, onSettings: l.openSettings, onShare: () => Er(t.shareUrl ?? window.location.href, r), copied: null, onTouch: () => {
5259
+ /* @__PURE__ */ i(Qi, { page: s, picture: /* @__PURE__ */ i(Hc, { poster: e, src: n }), title: r, desk: c, pos: Wc, sub: null, mute: { muted: t.prefs.muted, onToggle: () => t.set({ muted: !t.prefs.muted }) }, cc: { on: t.prefs.subtitles, onToggle: () => t.set({ subtitles: !t.prefs.subtitles }) }, chip: l.chip, transport: M, picker: l.sheets, sheet: null, voices: null, voicesBtn: null, sheetOpen: l.sheetOpen, onSettings: l.openSettings, onShare: () => Er(t.shareUrl ?? window.location.href, r), copied: null, onTouch: () => {
5260
5260
  } }),
5261
5261
  !l.sheetOpen && /* @__PURE__ */ i("div", { className: "vsp-idle", "data-theme": "dark", children: /* @__PURE__ */ i("div", { className: "vsp-idle__box", children: o }) })
5262
5262
  ] });
@@ -5271,7 +5271,7 @@ function Wi({ connect: t, onClick: e, label: n }) {
5271
5271
  t.err && /* @__PURE__ */ i("div", { className: "vsp-end__err", role: "alert", children: t.err })
5272
5272
  ] });
5273
5273
  }
5274
- function Wc({ idle: t, src: e, ask: n, connect: r, page: s, poster: a = null, onClear: o }) {
5274
+ function Fc({ idle: t, src: e, ask: n, connect: r, page: s, poster: a = null, onClear: o }) {
5275
5275
  const l = () => r.start(e, n);
5276
5276
  return /* @__PURE__ */ g(Dn, { idle: t, poster: a, src: e, title: hr(e), page: s, onAct: l, children: [
5277
5277
  /* @__PURE__ */ i(Wi, { connect: r, onClick: l, label: r.connected ? "Play with VocalStack" : "Connect to VocalStack" }),
@@ -5279,7 +5279,7 @@ function Wc({ idle: t, src: e, ask: n, connect: r, page: s, poster: a = null, on
5279
5279
  o && !r.busy && /* @__PURE__ */ i("button", { type: "button", className: "vsp-idle__other", onClick: o, children: "Choose another video" })
5280
5280
  ] });
5281
5281
  }
5282
- function Fc({ idle: t, connect: e, page: n, poster: r = null, onPick: s }) {
5282
+ function Gc({ idle: t, connect: e, page: n, poster: r = null, onPick: s }) {
5283
5283
  const [a, o] = j(""), l = k(null), c = k(null), u = a.trim(), d = ai.test(u), h = () => {
5284
5284
  if (!d || e.busy) return;
5285
5285
  const p = /^https?:\/\//i.test(u) ? u : `https://${u}`;
@@ -5297,8 +5297,8 @@ function Fc({ idle: t, connect: e, page: n, poster: r = null, onPick: s }) {
5297
5297
  const y = p.trim();
5298
5298
  if (!ai.test(y) || e.busy || y === c.current) return;
5299
5299
  c.current = y;
5300
- const L = /^https?:\/\//i.test(y) ? y : `https://${y}`;
5301
- s(L), e.start(L, !1);
5300
+ const v = /^https?:\/\//i.test(y) ? y : `https://${y}`;
5301
+ s(v), e.start(v, !1);
5302
5302
  };
5303
5303
  return /* @__PURE__ */ g(Dn, { idle: t, poster: r, src: null, title: "VocalStack", page: n, onAct: M, children: [
5304
5304
  /* @__PURE__ */ i("form", { className: "vsp-idle__form", onSubmit: (p) => {
@@ -5315,7 +5315,7 @@ function Fc({ idle: t, connect: e, page: n, poster: r = null, onPick: s }) {
5315
5315
  e.err && /* @__PURE__ */ i("div", { className: "vsp-end__err", role: "alert", children: e.err })
5316
5316
  ] });
5317
5317
  }
5318
- function Gc({ idle: t, message: e, onRetry: n, page: r }) {
5318
+ function Zc({ idle: t, message: e, onRetry: n, page: r }) {
5319
5319
  return /* @__PURE__ */ g(Dn, { idle: t, poster: null, src: null, title: "VocalStack", page: r, onAct: n, children: [
5320
5320
  /* @__PURE__ */ g("div", { className: "vsp-idle__err", role: "alert", children: [
5321
5321
  /* @__PURE__ */ i(oe, { d: ee.warn, size: 16, sw: 1.8 }),
@@ -5327,7 +5327,7 @@ function Gc({ idle: t, message: e, onRetry: n, page: r }) {
5327
5327
  ] })
5328
5328
  ] });
5329
5329
  }
5330
- function Zc(t, e, n) {
5330
+ function qc(t, e, n) {
5331
5331
  const [r, s] = j(t && e ? void 0 : null);
5332
5332
  return Y(() => {
5333
5333
  if (!t) {
@@ -5354,8 +5354,8 @@ function Zc(t, e, n) {
5354
5354
  };
5355
5355
  }, [t, e, n]), r;
5356
5356
  }
5357
- const qc = 100, oi = (t) => t == null ? null : t ? "on" : "off";
5358
- function Kc(t) {
5357
+ const Kc = 100, oi = (t) => t == null ? null : t ? "on" : "off";
5358
+ function Jc(t) {
5359
5359
  const e = t.syncUrl && typeof window < "u" ? new URLSearchParams(window.location.search) : null, n = { ...t.initial ?? {}, ...t.settings ?? {} }, r = (a) => a === "on" || a === "off" ? a : null, s = Number(e == null ? void 0 : e.get("t"));
5360
5360
  return {
5361
5361
  lang: (e == null ? void 0 : e.get("lang")) || n.lang || null,
@@ -5364,74 +5364,74 @@ function Kc(t) {
5364
5364
  cc: e != null && e.get("cc") ? e.get("cc") !== "off" : n.subtitles ?? !0,
5365
5365
  translateAudio: e != null && e.get("audio") ? e.get("audio") !== "original" : n.translateAudio ?? !0,
5366
5366
  clonedVoices: e != null && e.get("voices") ? e.get("voices") !== "stock" : (n.voices ?? "cloned") === "cloned",
5367
- removeBackground: e && e.get("bg") ? io(e) : n.removeBackground ?? !1,
5367
+ removeBackground: e && e.get("bg") ? ao(e) : n.removeBackground ?? !1,
5368
5368
  startAt: Number.isFinite(s) && s > 0 ? s : t.startAt ?? null
5369
5369
  };
5370
5370
  }
5371
- const lu = va(function(e, n) {
5371
+ const cu = va(function(e, n) {
5372
5372
  var K;
5373
5373
  const r = k(null);
5374
5374
  ka(n, () => ({
5375
- seek: (v) => {
5375
+ seek: (L) => {
5376
5376
  var ie;
5377
- return (ie = r.current) == null ? void 0 : ie.seek(v);
5377
+ return (ie = r.current) == null ? void 0 : ie.seek(L);
5378
5378
  },
5379
5379
  play: () => {
5380
- var v;
5381
- return (v = r.current) == null ? void 0 : v.play();
5380
+ var L;
5381
+ return (L = r.current) == null ? void 0 : L.play();
5382
5382
  },
5383
5383
  toggleMute: () => {
5384
- var v;
5385
- return (v = r.current) == null ? void 0 : v.toggleMute();
5384
+ var L;
5385
+ return (L = r.current) == null ? void 0 : L.toggleMute();
5386
5386
  },
5387
5387
  pause: () => {
5388
- var v;
5389
- return (v = r.current) == null ? void 0 : v.pause();
5388
+ var L;
5389
+ return (L = r.current) == null ? void 0 : L.pause();
5390
5390
  },
5391
5391
  toggle: () => {
5392
- var v;
5393
- return (v = r.current) == null ? void 0 : v.toggle();
5392
+ var L;
5393
+ return (L = r.current) == null ? void 0 : L.toggle();
5394
5394
  }
5395
5395
  }), []);
5396
5396
  const [s, a] = j({ id: e.id ?? "", token: e.token });
5397
5397
  Y(() => {
5398
5398
  a({ id: e.id ?? "", token: e.token });
5399
5399
  }, [e.id, e.token, e.src]);
5400
- const o = Zc(e.src ?? null, e.token ?? null, e.baseUrl ?? null);
5400
+ const o = qc(e.src ?? null, e.token ?? null, e.baseUrl ?? null);
5401
5401
  Y(() => {
5402
5402
  o != null && o.id && a({ id: o.id, token: e.token });
5403
5403
  }, [o == null ? void 0 : o.id]);
5404
- const [l, c] = j(null), [u, d] = j(() => ({ ...Ec, ...Object.fromEntries(Object.entries({ ...e.initial ?? {}, ...e.settings ?? {} }).filter(([, v]) => v !== void 0)) })), [h, M] = j({}), N = { prefs: u, set: (v) => {
5405
- d((ie) => ({ ...ie, ...v })), M((ie) => ({ ...ie, ...v }));
5404
+ const [l, c] = j(null), [u, d] = j(() => ({ ..._c, ...Object.fromEntries(Object.entries({ ...e.initial ?? {}, ...e.settings ?? {} }).filter(([, L]) => L !== void 0)) })), [h, M] = j({}), N = { prefs: u, set: (L) => {
5405
+ d((ie) => ({ ...ie, ...L })), M((ie) => ({ ...ie, ...L }));
5406
5406
  }, shareUrl: (K = e.shareUrl) == null ? void 0 : K.call(e, null) }, { muted: p, ...y } = h;
5407
5407
  Y(() => {
5408
5408
  c(null);
5409
5409
  }, [e.id, e.src]);
5410
- const L = e.src ?? l, m = !s.id && !!L && (l != null || o !== void 0), f = !s.id && !e.src && !l, I = Ii({ id: s.id, token: s.token, baseUrl: e.baseUrl, listen: s.listen }), { source: b, gone: D, error: B, reload: _ } = Ho(I, s.id), X = Wo(I, (b == null ? void 0 : b.recording.id) ?? null), z = Ie(() => Bo(I, X), [I, X]);
5410
+ const v = e.src ?? l, m = !s.id && !!v && (l != null || o !== void 0), f = !s.id && !e.src && !l, I = Ii({ id: s.id, token: s.token, baseUrl: e.baseUrl, listen: s.listen }), { source: b, gone: D, error: B, reload: _ } = Wo(I, s.id), X = Fo(I, (b == null ? void 0 : b.recording.id) ?? null), z = Ie(() => Vo(I, X), [I, X]);
5411
5411
  Y(() => {
5412
- var v;
5413
- b && ((v = e.onSource) == null || v.call(e, b));
5412
+ var L;
5413
+ b && ((L = e.onSource) == null || L.call(e, b));
5414
5414
  }, [b]), Y(() => {
5415
- var v;
5416
- B && ((v = e.onError) == null || v.call(e, B));
5415
+ var L;
5416
+ B && ((L = e.onError) == null || L.call(e, B));
5417
5417
  }, [B]);
5418
- const F = Vi(e.desk), S = (e.layout ?? "embed") === "embed", T = e.appUrl ?? (e.endCard ? e.endCard.appUrl : void 0), E = Je((v) => a({ id: v.transcriptionId, token: null, listen: { transcriptionId: v.transcriptionId, recordingId: v.recordingId, token: v.token } }), []), O = $c(T, E), te = k(null);
5419
- return Y(() => (ri(S ? te.current : null), () => ri(null)), [S]), /* @__PURE__ */ i(Ro, { value: z, children: /* @__PURE__ */ i("div", { ref: te, className: `vsp${S ? " vsp--embed" : ""}${e.className ? ` ${e.className}` : ""}`, "data-theme": (e.mode ?? "video") === "video" || e.dark ? "dark" : "light", "data-mode": (e.mode ?? "video") === "video" ? "video" : "transcript", children: f ? /* @__PURE__ */ i(Fc, { idle: N, connect: O, page: !S, poster: e.poster ?? null, onPick: c }) : m ? /* @__PURE__ */ i(Wc, { idle: N, src: L, ask: !l, connect: O, page: !S, poster: e.poster ?? null, onClear: l ? () => c(null) : void 0 }) : s.id ? B && !b ? /* @__PURE__ */ i(Gc, { idle: N, message: B.message, onRetry: _, page: !S }) : /* @__PURE__ */ i(Jc, { ...e, initial: { ...e.initial ?? {}, ...y }, startMuted: p === !0, handle: r, id: s.id, api: z, shared: b, gone: D, loadError: B, reread: _, desk: F, dark: (e.mode ?? "video") === "video" || !!e.dark, onStarted: (v) => a({ id: v.transcriptionId, token: null, listen: { transcriptionId: v.transcriptionId, recordingId: v.recordingId, token: v.token } }) }, s.id) : /* @__PURE__ */ i("div", { className: "vsp-gate", "data-theme": "dark", children: /* @__PURE__ */ i("span", { className: "gfull__spin gfull__holdspin", "aria-label": "Loading" }) }) }) });
5418
+ const F = Vi(e.desk), S = (e.layout ?? "embed") === "embed", T = e.appUrl ?? (e.endCard ? e.endCard.appUrl : void 0), E = Je((L) => a({ id: L.transcriptionId, token: null, listen: { transcriptionId: L.transcriptionId, recordingId: L.recordingId, token: L.token } }), []), O = Bc(T, E), te = k(null);
5419
+ return Y(() => (ri(S ? te.current : null), () => ri(null)), [S]), /* @__PURE__ */ i(Po, { value: z, children: /* @__PURE__ */ i("div", { ref: te, className: `vsp${S ? " vsp--embed" : ""}${e.className ? ` ${e.className}` : ""}`, "data-theme": (e.mode ?? "video") === "video" || e.dark ? "dark" : "light", "data-mode": (e.mode ?? "video") === "video" ? "video" : "transcript", children: f ? /* @__PURE__ */ i(Gc, { idle: N, connect: O, page: !S, poster: e.poster ?? null, onPick: c }) : m ? /* @__PURE__ */ i(Fc, { idle: N, src: v, ask: !l, connect: O, page: !S, poster: e.poster ?? null, onClear: l ? () => c(null) : void 0 }) : s.id ? B && !b ? /* @__PURE__ */ i(Zc, { idle: N, message: B.message, onRetry: _, page: !S }) : /* @__PURE__ */ i(Xc, { ...e, initial: { ...e.initial ?? {}, ...y }, startMuted: p === !0, handle: r, id: s.id, api: z, shared: b, gone: D, loadError: B, reread: _, desk: F, dark: (e.mode ?? "video") === "video" || !!e.dark, onStarted: (L) => a({ id: L.transcriptionId, token: null, listen: { transcriptionId: L.transcriptionId, recordingId: L.recordingId, token: L.token } }) }, s.id) : /* @__PURE__ */ i("div", { className: "vsp-gate", "data-theme": "dark", children: /* @__PURE__ */ i("span", { className: "gfull__spin gfull__holdspin", "aria-label": "Loading" }) }) }) });
5420
5420
  });
5421
- function Jc(t) {
5421
+ function Xc(t) {
5422
5422
  var gs, fs, ps, Ns, ms, ys, Ts, ws, Ls, vs, ks, js, zs, Is, Os, Cs, bs, xs, Ds, Ss, As, Es, _s, Ys, Us, Rs;
5423
- const { api: e, shared: n, gone: r, desk: s, dark: a } = t, o = t.id ?? "", l = Ie(() => Kc(t), []), u = (t.mode ?? "video") === "video", [d, h] = j(t.loadError);
5423
+ const { api: e, shared: n, gone: r, desk: s, dark: a } = t, o = t.id ?? "", l = Ie(() => Jc(t), []), u = (t.mode ?? "video") === "video", [d, h] = j(t.loadError);
5424
5424
  Y(() => {
5425
5425
  t.loadError && h(t.loadError);
5426
5426
  }, [t.loadError]);
5427
- const [M, N] = j("none"), [p, y] = j(!1), [L, m] = j(""), [f, I] = Zl(), [b, D] = j(null), [B, _] = j(u ? "listen" : "read"), [X, z] = j(!1), F = k(null), S = k(/* @__PURE__ */ new Map()), [T, E] = j("main"), O = (w) => {
5427
+ const [M, N] = j("none"), [p, y] = j(!1), [v, m] = j(""), [f, I] = ql(), [b, D] = j(null), [B, _] = j(u ? "listen" : "read"), [X, z] = j(!1), F = k(null), S = k(/* @__PURE__ */ new Map()), [T, E] = j("main"), O = (w) => {
5428
5428
  const Ne = document.querySelector(".vs-sheet--settings"), Qe = Ne == null ? void 0 : Ne.parentElement;
5429
5429
  Ne && Qe && T === "main" && w !== "main" && Qe.style.setProperty("--vs-sheet-top", `${Math.round(Ne.getBoundingClientRect().top - Qe.getBoundingClientRect().top)}px`), E(w);
5430
5430
  };
5431
5431
  Y(() => {
5432
5432
  X || O("main");
5433
5433
  }, [X]);
5434
- const [te, K] = j(u), v = (n == null ? void 0 : n.recording) ?? null, ie = (v == null ? void 0 : v.id) ?? null, [ne, G] = j(l.lang), J = typeof ne == "string" ? ne : null, [pe, le] = j(l.labels), [Te, je] = j(l.words), [Ee, Le] = j(l.cc), [we, _e] = j(l.translateAudio), [Pe, Se] = j(l.clonedVoices), [$, H] = j(l.removeBackground), A = t.settings;
5434
+ const [te, K] = j(u), L = (n == null ? void 0 : n.recording) ?? null, ie = (L == null ? void 0 : L.id) ?? null, [ne, G] = j(l.lang), J = typeof ne == "string" ? ne : null, [pe, le] = j(l.labels), [Te, je] = j(l.words), [Ee, Le] = j(l.cc), [we, _e] = j(l.translateAudio), [Pe, Se] = j(l.clonedVoices), [$, H] = j(l.removeBackground), A = t.settings;
5435
5435
  Y(() => {
5436
5436
  (A == null ? void 0 : A.lang) !== void 0 && G(A.lang);
5437
5437
  }, [A == null ? void 0 : A.lang]), Y(() => {
@@ -5451,20 +5451,20 @@ function Jc(t) {
5451
5451
  Y(() => {
5452
5452
  if (!t.syncUrl) return;
5453
5453
  const w = new URL(window.location.href);
5454
- J ? w.searchParams.set("lang", J) : w.searchParams.delete("lang"), pe ? w.searchParams.set("labels", pe) : w.searchParams.delete("labels"), Te ? w.searchParams.set("words", Te) : w.searchParams.delete("words"), Ee ? w.searchParams.delete("cc") : w.searchParams.set("cc", "off"), we ? w.searchParams.delete("audio") : w.searchParams.set("audio", "original"), Pe ? w.searchParams.delete("voices") : w.searchParams.set("voices", "stock"), ao(w, $), w.href !== window.location.href && window.history.replaceState(window.history.state, "", w);
5454
+ J ? w.searchParams.set("lang", J) : w.searchParams.delete("lang"), pe ? w.searchParams.set("labels", pe) : w.searchParams.delete("labels"), Te ? w.searchParams.set("words", Te) : w.searchParams.delete("words"), Ee ? w.searchParams.delete("cc") : w.searchParams.set("cc", "off"), we ? w.searchParams.delete("audio") : w.searchParams.set("audio", "original"), Pe ? w.searchParams.delete("voices") : w.searchParams.set("voices", "stock"), oo(w, $), w.href !== window.location.href && window.history.replaceState(window.history.state, "", w);
5455
5455
  }, [J, pe, Te, Ee, we, Pe, $]), Y(() => {
5456
5456
  n && !n.allowTranslate && J && G(null);
5457
5457
  }, [n, J]);
5458
- const { model: ce, error: W, clearError: me, setLanguage: Z, mergeTranslations: ve, translating: ze, translateFailed: Fe, shownLang: Ae } = qo(ie, {
5458
+ const { model: ce, error: W, clearError: me, setLanguage: Z, mergeTranslations: ve, translating: ze, translateFailed: Fe, shownLang: Ae } = Ko(ie, {
5459
5459
  lang: null,
5460
5460
  onFrame: (w) => {
5461
5461
  w.type === "job.progress" && D({ state: w.state, processedS: w.processedS ?? 0, totalS: w.totalS ?? null, segmentsDone: w.segmentsDone ?? 0, segmentsTotal: w.segmentsTotal ?? null, pct: w.pct ?? 0, error: w.error ?? null });
5462
5462
  }
5463
- }), ge = Ie(() => Io(ce).filter((w) => !w.suppressed), [ce]), Ye = Ko((n == null ? void 0 : n.job) ?? null), Be = ["done", "failed", "stopped"].includes(cr((Ye == null ? void 0 : Ye.state) ?? ((gs = n == null ? void 0 : n.job) == null ? void 0 : gs.state))), Q = Be ? Ye : b ?? Ye, he = !!b && !["done", "failed", "stopped"].includes(cr(b.state)), ue = k(0);
5463
+ }), ge = Ie(() => Oo(ce).filter((w) => !w.suppressed), [ce]), Ye = Jo((n == null ? void 0 : n.job) ?? null), Be = ["done", "failed", "stopped"].includes(cr((Ye == null ? void 0 : Ye.state) ?? ((gs = n == null ? void 0 : n.job) == null ? void 0 : gs.state))), Q = Be ? Ye : b ?? Ye, he = !!b && !["done", "failed", "stopped"].includes(cr(b.state)), ue = k(0);
5464
5464
  Y(() => {
5465
5465
  !Be || !he || Date.now() - ue.current < 1e4 || (ue.current = Date.now(), t.reread());
5466
5466
  }, [Be, he, b == null ? void 0 : b.state, b == null ? void 0 : b.processedS, o]);
5467
- const ae = cr((Q == null ? void 0 : Q.state) ?? ((fs = n == null ? void 0 : n.job) == null ? void 0 : fs.state)), fe = !!ie && (ae === "transcribing" || ae === "queued"), Ue = u && !r && (!n || (fe || ae === "cropping") && ge.length === 0), U = fe ? (Q == null ? void 0 : Q.pct) ?? 0 : 100, R = Xo(n == null ? void 0 : n.job, Q) ?? (v == null ? void 0 : v.mediaDurationS) ?? null, q = ((ps = ce.segments.values().next().value) == null ? void 0 : ps.language) ?? (v == null ? void 0 : v.spokenLanguage) ?? null, re = n != null && n.sharedBy ? `Shared by ${n.sharedBy}` : "", de = ((ys = (ms = (Ns = n == null ? void 0 : n.job) == null ? void 0 : Ns.source) == null ? void 0 : ms.name) == null ? void 0 : ys.trim()) || null, Ce = n ? ((Ts = n.name) == null ? void 0 : Ts.trim()) || de : null, ye = !!((ws = n == null ? void 0 : n.job) != null && ws.hasAudio), ke = (Ls = n == null ? void 0 : n.job) == null ? void 0 : Ls.source, be = !ye && !!ke && (ke.kind !== "url" || ke.bytes != null) && (ae === "transcribing" || ae === "queued" || ae === "done"), Ge = ie && (n != null && n.allowDownload) && ye ? Ua(e.origin, ie, e.cred) : ie && (n != null && n.allowDownload) && be ? wn(e.origin, ie, "source", e.cred) : null, $e = ge[ge.length - 1], at = $e ? ((vs = $e.words[$e.words.length - 1]) == null ? void 0 : vs.end) ?? $e.start : 0, rt = u && fe ? Math.max(at, (Q == null ? void 0 : Q.processedS) ?? 0) : null, dt = tc(Ge, (ye || be) && !!(n != null && n.allowDownload), ge, R, be ? ((js = (ks = n == null ? void 0 : n.job) == null ? void 0 : ks.crop) == null ? void 0 : js.startS) ?? 0 : 0, rt), Oe = ((Is = (zs = n == null ? void 0 : n.job) == null ? void 0 : zs.source) == null ? void 0 : Is.kind) === "url" ? Di(n.job.source.url) : null, ot = Ja(Oe), lt = ec(ge, R, ((Cs = (Os = n == null ? void 0 : n.job) == null ? void 0 : Os.crop) == null ? void 0 : Cs.startS) ?? 0, rt), Ve = !!Oe, yt = Ve ? lt.player : dt, ht = Oi(), Ht = k(null), se = ac({ forcedVoice: t.voice ?? null, recordingId: ie, model: ce, rows: ge, lenS: R, ended: !!ie && !fe, cred: e.cred, langs: ht, srcLang: q, canTranslate: !!(n != null && n.allowTranslate), pickedLang: ne, setPickedLang: G, side: s && !te ? ic : void 0, hearOriginal: V, timed: !!Oe, stockVoices: u && !Pe, stickyPicker: u, pickerBusy: Ht.current }), Ct = k(null);
5467
+ const ae = cr((Q == null ? void 0 : Q.state) ?? ((fs = n == null ? void 0 : n.job) == null ? void 0 : fs.state) ?? (e.listen ? (L == null ? void 0 : L.state) === "finalized" ? "done" : L != null && L.state ? "transcribing" : void 0 : void 0)), fe = !!ie && (ae === "transcribing" || ae === "queued"), Ue = u && !r && (!n || (fe || ae === "cropping") && ge.length === 0), U = fe ? (Q == null ? void 0 : Q.pct) ?? 0 : 100, R = el(n == null ? void 0 : n.job, Q) ?? (L == null ? void 0 : L.mediaDurationS) ?? null, q = ((ps = ce.segments.values().next().value) == null ? void 0 : ps.language) ?? (L == null ? void 0 : L.spokenLanguage) ?? null, re = n != null && n.sharedBy ? `Shared by ${n.sharedBy}` : "", de = ((ys = (ms = (Ns = n == null ? void 0 : n.job) == null ? void 0 : Ns.source) == null ? void 0 : ms.name) == null ? void 0 : ys.trim()) || null, Ce = n ? ((Ts = n.name) == null ? void 0 : Ts.trim()) || de : null, ye = !!((ws = n == null ? void 0 : n.job) != null && ws.hasAudio), ke = (Ls = n == null ? void 0 : n.job) == null ? void 0 : Ls.source, be = !ye && !!ke && (ke.kind !== "url" || ke.bytes != null) && (ae === "transcribing" || ae === "queued" || ae === "done"), Ge = ie && (n != null && n.allowDownload) && ye ? Ua(e.origin, ie, e.cred) : ie && (n != null && n.allowDownload) && be ? wn(e.origin, ie, "source", e.cred) : null, $e = ge[ge.length - 1], at = $e ? ((vs = $e.words[$e.words.length - 1]) == null ? void 0 : vs.end) ?? $e.start : 0, rt = u && fe ? Math.max(at, (Q == null ? void 0 : Q.processedS) ?? 0) : null, dt = nc(Ge, (ye || be) && !!(n != null && n.allowDownload), ge, R, be ? ((js = (ks = n == null ? void 0 : n.job) == null ? void 0 : ks.crop) == null ? void 0 : js.startS) ?? 0 : 0, rt), Oe = ((Is = (zs = n == null ? void 0 : n.job) == null ? void 0 : zs.source) == null ? void 0 : Is.kind) === "url" ? Di(n.job.source.url) : null, ot = Ja(Oe), lt = tc(ge, R, ((Cs = (Os = n == null ? void 0 : n.job) == null ? void 0 : Os.crop) == null ? void 0 : Cs.startS) ?? 0, rt), Ve = !!Oe, yt = Ve ? lt.player : dt, ht = Oi(), Ht = k(null), se = oc({ forcedVoice: t.voice ?? null, recordingId: ie, model: ce, rows: ge, lenS: R, ended: !!ie && !fe, cred: e.cred, langs: ht, srcLang: q, canTranslate: !!(n != null && n.allowTranslate), pickedLang: ne, setPickedLang: G, side: s && !te ? ac : void 0, hearOriginal: V, timed: !!Oe, stockVoices: u && !Pe, stickyPicker: u, pickerBusy: Ht.current }), Ct = k(null);
5468
5468
  Y(() => {
5469
5469
  !ie || Ct.current === J || (Ct.current = J, Z(J));
5470
5470
  }, [J, ie]);
@@ -5479,23 +5479,23 @@ function Jc(t) {
5479
5479
  const an = Ie(() => ge.filter((w) => w.sentenceId != null).map((w, Ne, Qe) => {
5480
5480
  var We;
5481
5481
  return { sid: w.sentenceId, start: w.start, end: ((We = Qe[Ne + 1]) == null ? void 0 : We.start) ?? Et(w, w.start, w.start + 4) };
5482
- }), [ge]), jt = To({ on: Ve && se.on, lines: an, clips: se.clips, t: C.t, playing: C.playing, muted: C.muted }), Yt = !!J && (ze || se.relang || se.on && jt.missing != null);
5482
+ }), [ge]), jt = wo({ on: Ve && se.on, lines: an, clips: se.clips, t: C.t, playing: C.playing, muted: C.muted }), Yt = !!J && (ze || se.relang || se.on && jt.missing != null);
5483
5483
  Ht.current = Yt ? J : null, Y(() => {
5484
5484
  Ve && se.on && jt.sid != null && se.setNear(jt.sid);
5485
- }, [jt.sid, Ve, se.on]), Xl([yt, se.player], se.sampling);
5485
+ }, [jt.sid, Ve, se.on]), ec([yt, se.player], se.sampling);
5486
5486
  const nt = k(null);
5487
5487
  Y(() => {
5488
5488
  fe && !C.playing && nt.current && (nt.current.scrollTop = nt.current.scrollHeight);
5489
5489
  }, [fe, ge.length]);
5490
- const En = cc(nt, ge, p, L, y), on = /* @__PURE__ */ i(lc, { open: p, q: L, onQ: m, onClose: () => y(!1), hits: En, desk: s, inline: s }), qe = Xa({ name: n == null ? void 0 : n.name, sourceName: (xs = (bs = n == null ? void 0 : n.job) == null ? void 0 : bs.source) == null ? void 0 : xs.name, ytTitle: ot, url: ((Ss = (Ds = n == null ? void 0 : n.job) == null ? void 0 : Ds.source) == null ? void 0 : Ss.kind) === "url" ? n.job.source.url : t.src ?? null, id: o }), Mt = !!(n != null && n.allowDownload), bt = !!(n != null && n.allowExport), Tt = se.readLang, wt = Tt ? ((As = ht == null ? void 0 : ht.languages.find((w) => w.code === Tt)) == null ? void 0 : As.name) ?? Tt.toUpperCase() : null, Ut = async () => {
5490
+ const En = uc(nt, ge, p, v, y), on = /* @__PURE__ */ i(cc, { open: p, q: v, onQ: m, onClose: () => y(!1), hits: En, desk: s, inline: s }), qe = eo({ name: n == null ? void 0 : n.name, sourceName: (xs = (bs = n == null ? void 0 : n.job) == null ? void 0 : bs.source) == null ? void 0 : xs.name, ytTitle: ot, url: ((Ss = (Ds = n == null ? void 0 : n.job) == null ? void 0 : Ds.source) == null ? void 0 : Ss.kind) === "url" ? n.job.source.url : t.src ?? null, id: o }), Mt = !!(n != null && n.allowDownload), bt = !!(n != null && n.allowExport), Tt = se.readLang, wt = Tt ? ((As = ht == null ? void 0 : ht.languages.find((w) => w.code === Tt)) == null ? void 0 : As.name) ?? Tt.toUpperCase() : null, Ut = async () => {
5491
5491
  if (ie)
5492
5492
  try {
5493
5493
  if (Tt && se.canSpeak) {
5494
- I(`Preparing ${qe} in ${wt}${se.readVoiceName ? `, read by ${se.readVoiceName}` : ""} — the download starts when it is ready.`), await nl(e, { recordingId: ie, lang: Tt, voiceKey: se.readVoiceKey, cred: e.cred, request: se.requestTrack }), I(`Downloading ${qe} in ${wt}.`);
5494
+ I(`Preparing ${qe} in ${wt}${se.readVoiceName ? `, read by ${se.readVoiceName}` : ""} — the download starts when it is ready.`), await rl(e, { recordingId: ie, lang: Tt, voiceKey: se.readVoiceKey, cred: e.cred, request: se.requestTrack }), I(`Downloading ${qe} in ${wt}.`);
5495
5495
  return;
5496
5496
  }
5497
5497
  if (ye) {
5498
- I(`Preparing ${qe} as MP3 — the download starts when it is ready.`), await el(wn(e.origin, ie, "delivery", e.cred)), I(`Downloading ${qe}.`);
5498
+ I(`Preparing ${qe} as MP3 — the download starts when it is ready.`), await tl(wn(e.origin, ie, "delivery", e.cred)), I(`Downloading ${qe}.`);
5499
5499
  return;
5500
5500
  }
5501
5501
  Ar(wn(e.origin, ie, "source", e.cred)), I(`Downloading ${qe} — the full audio, since the transcript is still being written.`);
@@ -5505,10 +5505,10 @@ function Jc(t) {
5505
5505
  }, xt = (w) => {
5506
5506
  if (!ie) return;
5507
5507
  const Ne = wr.find((We) => We.key === w).name, Qe = wt ? ` in ${wt}` : "";
5508
- return tl(e, ie, w, { lang: Tt }).then(() => I(fe ? `${Ne} exported${Qe} for the first ${ge.length} segments — the rest is still transcribing.` : `${Ne} exported${Qe}.`)).catch((We) => {
5508
+ return nl(e, ie, w, { lang: Tt }).then(() => I(fe ? `${Ne} exported${Qe} for the first ${ge.length} segments — the rest is still transcribing.` : `${Ne} exported${Qe}.`)).catch((We) => {
5509
5509
  throw h(kt(We)), We;
5510
5510
  });
5511
- }, ct = fe ? "MORE TO COME…" : "END OF TRANSCRIPT", Wt = fe ? "var(--brand)" : "var(--ink-28)", st = Jo(Q, ge.length), zt = C.has && (!se.relang || !!Oe), Ze = k(C);
5511
+ }, ct = fe ? "MORE TO COME…" : "END OF TRANSCRIPT", Wt = fe ? "var(--brand)" : "var(--ink-28)", st = Xo(Q, ge.length), zt = C.has && (!se.relang || !!Oe), Ze = k(C);
5512
5512
  Ze.current = C;
5513
5513
  const Rt = `${J ?? ""}|${se.on ? "voice" : "source"}`, Ft = k({ key: Rt, idx: 0, t: 0, playing: !1, until: 0 });
5514
5514
  Y(() => {
@@ -5560,7 +5560,7 @@ function Jc(t) {
5560
5560
  return;
5561
5561
  }
5562
5562
  Ke.current = !0, Ze.current.toggle();
5563
- }, cn = (w) => /* @__PURE__ */ i(Gl, { player: C, size: w }), qt = !!ie && !fe, [Kt, P] = j(!1);
5563
+ }, cn = (w) => /* @__PURE__ */ i(Zl, { player: C, size: w }), qt = !!ie && !fe, [Kt, P] = j(!1);
5564
5564
  Y(() => {
5565
5565
  if (!ze) {
5566
5566
  P(!1);
@@ -5569,12 +5569,12 @@ function Jc(t) {
5569
5569
  const w = setTimeout(() => P(!0), 180);
5570
5570
  return () => clearTimeout(w);
5571
5571
  }, [ze]);
5572
- const xe = Kt ? Ae : J, He = gl(ie, J, ge, ve), ft = Cl(bl(v), ie, se.readLang), Jt = Mt || bt, Fi = (((_s = (Es = n == null ? void 0 : n.job) == null ? void 0 : Es.crop) == null ? void 0 : _s.startS) ?? 0) + vn(C, ge), Rn = B === "listen", St = Rn && (!!Oe || u), Gi = (w) => {
5572
+ const xe = Kt ? Ae : J, He = fl(ie, J, ge, ve), ft = bl(xl(L), ie, se.readLang), Jt = Mt || bt, Fi = (((_s = (Es = n == null ? void 0 : n.job) == null ? void 0 : Es.crop) == null ? void 0 : _s.startS) ?? 0) + vn(C, ge), Rn = B === "listen", St = Rn && (!!Oe || u), Gi = (w) => {
5573
5573
  yt.pause(), se.player.pause(), _(w), w === "read" && te && (nn(!1), K(!1));
5574
- }, Re = se.barChip, Pt = bi(Re.label), Ur = /* @__PURE__ */ i(Mr, { value: B, onChange: Gi, bordered: !1, options: Lc(Pt, !!Oe) }), Qt = [...qt ? [{ key: "summary", label: "Summary" }] : [], ...Jt ? [{ key: "export", label: "Export" }] : []], Rr = (w) => /* @__PURE__ */ g(De, { children: [
5575
- w === "summary" && qt && /* @__PURE__ */ i(xl, { s: ft }),
5576
- w === "export" && /* @__PURE__ */ i(Ol, { audio: Mt ? { name: qe, meta: Tt && se.canSpeak || ye ? `MP3${R ? ` · ${vt(R)}` : ""}` : "ORIGINAL AUDIO", onClick: Ut } : null, formats: bt, onExport: xt })
5577
- ] }), Zi = (w) => /* @__PURE__ */ i(ul, { index: C.idx, total: Math.max(1, ge.length), frac: C.dur > 0 ? Math.min(1, C.t / C.dur) : 0, glideMs: C.wordSync ? 0 : 220, atLabel: vt(C.t), durLabel: vt(C.dur), stepLabel: w ? `${C.idx + 1} / ${ge.length}` : "", onSeek: se.relang ? rc : C.seekRow, onSeekFrac: se.relang ? void 0 : C.seekFrac, onScrubStart: C.hold, onScrubEnd: C.release }), Pr = {
5574
+ }, Re = se.barChip, Pt = bi(Re.label), Ur = /* @__PURE__ */ i(Mr, { value: B, onChange: Gi, bordered: !1, options: vc(Pt, !!Oe) }), Qt = [...qt ? [{ key: "summary", label: "Summary" }] : [], ...Jt ? [{ key: "export", label: "Export" }] : []], Rr = (w) => /* @__PURE__ */ g(De, { children: [
5575
+ w === "summary" && qt && /* @__PURE__ */ i(Dl, { s: ft }),
5576
+ w === "export" && /* @__PURE__ */ i(Cl, { audio: Mt ? { name: qe, meta: Tt && se.canSpeak || ye ? `MP3${R ? ` · ${vt(R)}` : ""}` : "ORIGINAL AUDIO", onClick: Ut } : null, formats: bt, onExport: xt })
5577
+ ] }), Zi = (w) => /* @__PURE__ */ i(dl, { index: C.idx, total: Math.max(1, ge.length), frac: C.dur > 0 ? Math.min(1, C.t / C.dur) : 0, glideMs: C.wordSync ? 0 : 220, atLabel: vt(C.t), durLabel: vt(C.dur), stepLabel: w ? `${C.idx + 1} / ${ge.length}` : "", onSeek: se.relang ? sc : C.seekRow, onSeekFrac: se.relang ? void 0 : C.seekFrac, onScrubStart: C.hold, onScrubEnd: C.release }), Pr = {
5578
5578
  live: !1,
5579
5579
  atEdge: !1,
5580
5580
  edgeFrac: null,
@@ -5587,7 +5587,7 @@ function Jc(t) {
5587
5587
  var Ne;
5588
5588
  se.relang || (Ne = C.seekFrac) == null || Ne.call(C, w);
5589
5589
  }
5590
- }, [qi, Ki] = kc(se.on && !!C.preparing && C.playing, 1500), Pn = se.on && ((Ys = C.error) == null ? void 0 : Ys.code) === "voice_not_started", Qn = se.canSpeak && !se.error && !Pn, un = J ? ((Us = ht == null ? void 0 : ht.languages.find((w) => w.code === J)) == null ? void 0 : Us.name) ?? Re.label : "", et = te ? vc({ lang: J, langName: un, translating: ze && !!J, translateFailed: Fe, voiceFailed: Pn, relang: se.relang, starting: se.on ? C.starting : null, slowLine: qi, lineSince: Ki }) : null, $n = !!Oe && !!et && (et.kind === "translating" || et.kind === "voice" && se.relang), Qr = !$n || !et ? null : et.kind === "translating" ? `Translating into ${un || "the new language"}…` : `Preparing the ${un || "translated"} voice…`, Xt = !$n && ((et == null ? void 0 : et.kind) === "voice" || (et == null ? void 0 : et.kind) === "starting"), $r = Cr({ ...se.langList, keepOpen: !0, open: T === "lang", onClose: () => O("main") }), Br = so($, se.on), Ji = u && Br.bed && Mt && ie && (!fe || Ge) ? Qs(e.origin, ie, e.cred) : null, Vr = go(Ji, { t: vn(C, ge), playing: C.playing && !Xt && !(C.timed && C.preparing), muted: C.muted }), Xi = u && Br.speech && Mt && ie && (!fe || Ge) ? Qs(e.origin, ie, e.cred, "speech") : null, Bn = Li(Xi, { t: vn(C, ge), playing: !se.on && C.playing, muted: C.muted }), Vn = !se.on && Bn.on;
5590
+ }, [qi, Ki] = jc(se.on && !!C.preparing && C.playing, 1500), Pn = se.on && ((Ys = C.error) == null ? void 0 : Ys.code) === "voice_not_started", Qn = se.canSpeak && !se.error && !Pn, un = J ? ((Us = ht == null ? void 0 : ht.languages.find((w) => w.code === J)) == null ? void 0 : Us.name) ?? Re.label : "", et = te ? kc({ lang: J, langName: un, translating: ze && !!J, translateFailed: Fe, voiceFailed: Pn, relang: se.relang, starting: se.on ? C.starting : null, slowLine: qi, lineSince: Ki }) : null, $n = !!Oe && !!et && (et.kind === "translating" || et.kind === "voice" && se.relang), Qr = !$n || !et ? null : et.kind === "translating" ? `Translating into ${un || "the new language"}…` : `Preparing the ${un || "translated"} voice…`, Xt = !$n && ((et == null ? void 0 : et.kind) === "voice" || (et == null ? void 0 : et.kind) === "starting"), $r = Cr({ ...se.langList, keepOpen: !0, open: T === "lang", onClose: () => O("main") }), Br = io($, se.on), Ji = u && Br.bed && Mt && ie && (!fe || Ge) ? Qs(e.origin, ie, e.cred) : null, Vr = fo(Ji, { t: vn(C, ge), playing: C.playing && !Xt && !(C.timed && C.preparing), muted: C.muted }), Xi = u && Br.speech && Mt && ie && (!fe || Ge) ? Qs(e.origin, ie, e.cred, "speech") : null, Bn = Li(Xi, { t: vn(C, ge), playing: !se.on && C.playing, muted: C.muted }), Vn = !se.on && Bn.on;
5591
5591
  Y(() => {
5592
5592
  var w;
5593
5593
  lt.setVideoSound(!(Ve && (se.on || Vn))), (w = dt.silence) == null || w.call(dt, !Ve && Vn);
@@ -5604,7 +5604,7 @@ function Jc(t) {
5604
5604
  }, Hr = { prevOn: C.idx > 0, nextOn: C.idx < ge.length - 1, onPrev: C.prev, onNext: C.next, playing: C.playing, playable: zt, playTitle: se.playTitle ?? (C.playing ? "Pause" : "Play"), onPlay: () => {
5605
5605
  Ke.current = !0, C.toggle();
5606
5606
  }, busy: se.relang && !Oe || Xt };
5607
- vo(zt ? { playing: C.playing, toggle: () => {
5607
+ ko(zt ? { playing: C.playing, toggle: () => {
5608
5608
  Ke.current = !0, C.toggle();
5609
5609
  }, next: C.next, prev: C.prev } : null, Ce);
5610
5610
  const Fn = { background: "transparent", color: "#eef0f8", width: 74, justifyContent: "center", boxSizing: "border-box" }, Gn = (w, Ne) => !Re.can || !x.language ? null : u ? /* @__PURE__ */ g("button", { type: "button", className: "gfull__btn", title: Yt ? `${Re.label ?? Re.code}: still being prepared` : Re.label ?? Re.code, "aria-label": `Language: ${Re.label ?? Re.code}`, "aria-busy": Yt || void 0, onClick: () => {
@@ -5618,7 +5618,7 @@ function Jc(t) {
5618
5618
  C.t > 0.3 && sa(!0);
5619
5619
  }, [C.t]);
5620
5620
  const ia = !Oe && u && ie && (n != null && n.allowDownload) && !fe ? /* @__PURE__ */ i(Ka, { src: wn(e.origin, ie, "video", e.cred), t: vn(C, ge), playing: C.playing && !Xt, seekN: C.seekN, onToggle: C.has ? Zt : void 0 }, ie) : null, Fr = Oe ? /* @__PURE__ */ g(De, { children: [
5621
- /* @__PURE__ */ i(Hl, { ytId: Oe, title: qe, t: Fi, playing: C.playing && !Xt, waiting: se.on && !!C.timed && !!C.preparing, seekN: C.seekN, onTime: (w) => {
5621
+ /* @__PURE__ */ i(Wl, { ytId: Oe, title: qe, t: Fi, playing: C.playing && !Xt, waiting: se.on && !!C.timed && !!C.preparing, seekN: C.seekN, onTime: (w) => {
5622
5622
  var Ne, Qe, We;
5623
5623
  return (We = C.videoAt) == null ? void 0 : We.call(C, w - (((Qe = (Ne = n == null ? void 0 : n.job) == null ? void 0 : Ne.crop) == null ? void 0 : Qe.startS) ?? 0));
5624
5624
  }, onToggle: C.has ? Zt : void 0, onAd: _n, lead: Ve ? lt.lead : void 0 }),
@@ -5629,13 +5629,13 @@ function Jc(t) {
5629
5629
  ] }) : u ? /* @__PURE__ */ g(De, { children: [
5630
5630
  /* @__PURE__ */ i("div", { className: "vsp-idle__pic vsp-idle__pic--brand" }),
5631
5631
  ia
5632
- ] }) : null, Gr = St && Oe && !te ? /* @__PURE__ */ i(Dl, { ytId: Oe, title: qe, radius: 14, large: !0, style: s ? void 0 : { margin: "8px 20px 2px" }, picture: Fr, children: /* @__PURE__ */ i(mc, { pos: Pr, transport: Hr, chip: Gn({ ...Fn, width: 64, height: 28, minHeight: 28, padding: "0 8px" }, "sm"), voices: Wr, onFull: () => {
5632
+ ] }) : null, Gr = St && Oe && !te ? /* @__PURE__ */ i(Sl, { ytId: Oe, title: qe, radius: 14, large: !0, style: s ? void 0 : { margin: "8px 20px 2px" }, picture: Fr, children: /* @__PURE__ */ i(yc, { pos: Pr, transport: Hr, chip: Gn({ ...Fn, width: 64, height: 28, minHeight: 28, padding: "0 8px" }, "sm"), voices: Wr, onFull: () => {
5633
5633
  nn(!0), K(!0);
5634
- }, copied: null }) }) : null, Xe = C.wordSync ? il(ge, C.idx, C.t) ? ge[C.idx] : void 0 : ge[C.idx];
5634
+ }, copied: null }) }) : null, Xe = C.wordSync ? al(ge, C.idx, C.t) ? ge[C.idx] : void 0 : ge[C.idx];
5635
5635
  for (const w of ge) for (const [Ne, Qe] of Object.entries(w.translations)) Qe && S.current.set(`${w.sentenceId ?? w.start}|${Ne}`, Qe);
5636
5636
  const Zr = (w, Ne) => w.translations[Ne] || S.current.get(`${w.sentenceId ?? w.start}|${Ne}`) || null, Zn = (w, Ne) => !w || !Ne || w.language === Ne || !!Zr(w, Ne), Lt = Zn(Xe, J) ? J : Zn(Xe, F.current) ? F.current : J;
5637
5637
  Xe && Zn(Xe, Lt) && (F.current = Lt);
5638
- const qr = Xe && Lt && Xe.language !== Lt ? Zr(Xe, Lt) : null, aa = Xe && qr && Lt && !Xe.translations[Lt] ? Object.assign([...ge], { [C.idx]: { ...Xe, translations: { ...Xe.translations, [Lt]: qr } } }) : ge, dn = Xe ? Yi(aa, C.idx, Lt) : [], hn = Te ? Te === "on" : !u || se.on || !xe || xe === q, Kr = hn ? ti(C, C.idx, dn) : null, Jr = dn.map((w, Ne) => ({ t: w.text, sp: Ne < dn.length - 1 ? " " : "", dim: Kr != null && Ne > Kr })), Mn = pe ? pe === "on" : u ? !1 : Yo(ce, ge, v == null ? void 0 : v.settings), Xr = { lang: J, subtitles: Ee, speakerLabels: Mn, wordHighlight: hn, translateAudio: we, voices: Pe ? "cloned" : "synthetic", removeBackground: $ }, oa = JSON.stringify(Xr), gn = k(t.onSettingsChange);
5638
+ const qr = Xe && Lt && Xe.language !== Lt ? Zr(Xe, Lt) : null, aa = Xe && qr && Lt && !Xe.translations[Lt] ? Object.assign([...ge], { [C.idx]: { ...Xe, translations: { ...Xe.translations, [Lt]: qr } } }) : ge, dn = Xe ? Yi(aa, C.idx, Lt) : [], hn = Te ? Te === "on" : !u || se.on || !xe || xe === q, Kr = hn ? ti(C, C.idx, dn) : null, Jr = dn.map((w, Ne) => ({ t: w.text, sp: Ne < dn.length - 1 ? " " : "", dim: Kr != null && Ne > Kr })), Mn = pe ? pe === "on" : u ? !1 : Uo(ce, ge, L == null ? void 0 : L.settings), Xr = { lang: J, subtitles: Ee, speakerLabels: Mn, wordHighlight: hn, translateAudio: we, voices: Pe ? "cloned" : "synthetic", removeBackground: $ }, oa = JSON.stringify(Xr), gn = k(t.onSettingsChange);
5639
5639
  gn.current = t.onSettingsChange, Y(() => {
5640
5640
  var w;
5641
5641
  (w = gn.current) == null || w.call(gn, Xr);
@@ -5696,7 +5696,7 @@ function Jc(t) {
5696
5696
  Tn !== w && (w = Tn, We(ut));
5697
5697
  };
5698
5698
  Ne();
5699
- const Qe = window.setInterval(Ne, qc);
5699
+ const Qe = window.setInterval(Ne, Kc);
5700
5700
  return () => window.clearInterval(Qe);
5701
5701
  }, []);
5702
5702
  const da = () => t.onShare ? t.onShare() : Er(rs(null), qe, () => {
@@ -5765,7 +5765,7 @@ function Jc(t) {
5765
5765
  /* @__PURE__ */ g("div", { className: "srow", children: [
5766
5766
  /* @__PURE__ */ g("div", { style: { flex: 1, minWidth: 0 }, children: [
5767
5767
  /* @__PURE__ */ i("div", { className: "srow__t", children: bn }),
5768
- /* @__PURE__ */ i("div", { className: "srow__s", children: ro($, Hn, "video", se.on ? 0 : Bn.untilS) })
5768
+ /* @__PURE__ */ i("div", { className: "srow__s", children: so($, Hn, "video", se.on ? 0 : Bn.untilS) })
5769
5769
  ] }),
5770
5770
  /* @__PURE__ */ i(mt, { checked: $ && Mt, onChange: H, label: bn, disabled: !Mt || Hn === "unavailable" && !$ })
5771
5771
  ] })
@@ -5833,7 +5833,7 @@ function Jc(t) {
5833
5833
  cc: x.subtitles ? { on: Ee, onToggle: () => Le((w) => !w) } : void 0,
5834
5834
  noFull: !x.fullscreen,
5835
5835
  ad: ln,
5836
- wait: et && !$n ? /* @__PURE__ */ i(zc, { state: et, line: Xt ? Jr.map((w) => w.t + w.sp).join("") : null, onRetry: ta, onOriginal: na }) : C.edgeWait ? `Transcribing ${Math.round(U)}% — it plays on as more is written` : null,
5836
+ wait: et && !$n ? /* @__PURE__ */ i(Ic, { state: et, line: Xt ? Jr.map((w) => w.t + w.sp).join("") : null, onRetry: ta, onOriginal: na }) : C.edgeWait ? `Transcribing ${Math.round(U)}% — it plays on as more is written` : null,
5837
5837
  pct: fe ? Math.round(U) : null,
5838
5838
  sub: Ee && Xe ? { who: fn ? xr(ce, Xe.speaker) : null, color: fn ? fn.fg ?? `var(--lane-${fn.lane})` : "#fff", words: Jr, cursor: ti(C, C.idx, dn) } : null,
5839
5839
  chip: Gn(s ? Fn : { ...Fn, width: 64, padding: "0 6px" }, s ? void 0 : "sm"),
@@ -5881,20 +5881,20 @@ function Jc(t) {
5881
5881
  /* @__PURE__ */ i("span", { className: "s", children: st })
5882
5882
  ] }),
5883
5883
  !s && /* @__PURE__ */ i("div", { className: "pubprog__bar", style: { marginTop: 8 }, children: /* @__PURE__ */ i("div", { style: { width: `${U}%` } }) })
5884
- ] }), tr = r && /* @__PURE__ */ i("div", { className: "hint", style: { padding: "30px 20px", textAlign: "center", fontSize: 13 }, children: "This link is no longer shared. Ask the person who sent it for a new one." }), cs = /* @__PURE__ */ i(oc, { model: ce, rows: ge, player: C, tail: ct, tailFg: Wt, running: fe, desk: s, feedRef: nt, listener: !0, showLabels: Mn, find: L, findOpen: !s && p, lang: xe, warm: Kt, onVisible: He, wordHl: hn }), nr = /* @__PURE__ */ i(cl, { error: d ?? W ?? (Pn && te ? null : C.error) ?? se.error, onClose: () => {
5884
+ ] }), tr = r && /* @__PURE__ */ i("div", { className: "hint", style: { padding: "30px 20px", textAlign: "center", fontSize: 13 }, children: "This link is no longer shared. Ask the person who sent it for a new one." }), cs = /* @__PURE__ */ i(lc, { model: ce, rows: ge, player: C, tail: ct, tailFg: Wt, running: fe, desk: s, feedRef: nt, listener: !0, showLabels: Mn, find: v, findOpen: !s && p, lang: xe, warm: Kt, onVisible: He, wordHl: hn }), nr = /* @__PURE__ */ i(ul, { error: d ?? W ?? (Pn && te ? null : C.error) ?? se.error, onClose: () => {
5885
5885
  h(null), me(), C.clearError(), se.clearError();
5886
5886
  } }), us = [R ? vt(R) : null, q ? q.toUpperCase() : null, re || "Read-only copy"].filter(Boolean).join(" · "), ds = (w) => /* @__PURE__ */ i("div", { className: "ctrans", children: se.noVoice ? se.noVoiceNote : /* @__PURE__ */ g(De, { children: [
5887
5887
  /* @__PURE__ */ g("div", { className: "ctrans__row", children: [
5888
5888
  /* @__PURE__ */ i("span", { className: "ctrans__sp", "aria-hidden": "true" }),
5889
5889
  /* @__PURE__ */ g("div", { className: "ctrans__mid", children: [
5890
5890
  /* @__PURE__ */ i("button", { type: "button", className: "ctrans__step", "aria-label": "Previous segment", title: "Previous segment", style: { opacity: C.idx <= 0 ? 0.3 : 1 }, onClick: C.prev, children: /* @__PURE__ */ i(oe, { d: ee.chevronLeft, size: 16, sw: 1.8 }) }),
5891
- /* @__PURE__ */ i("button", { type: "button", className: "ctrans__play", "aria-label": se.relang ? "Preparing audio" : C.playing ? "Pause" : "Play", title: se.relang ? "Preparing audio…" : se.playTitle ?? (C.playing ? "Pause" : "Play"), disabled: !zt, onClick: C.toggle, children: se.relang ? /* @__PURE__ */ i("span", { className: "ctrans__spin" }) : /* @__PURE__ */ i("svg", { viewBox: "0 0 24 24", width: 16, height: 16, fill: "currentColor", "aria-hidden": "true", style: C.playing ? void 0 : { marginLeft: 2 }, children: C.playing ? Wl : Fl }) }),
5891
+ /* @__PURE__ */ i("button", { type: "button", className: "ctrans__play", "aria-label": se.relang ? "Preparing audio" : C.playing ? "Pause" : "Play", title: se.relang ? "Preparing audio…" : se.playTitle ?? (C.playing ? "Pause" : "Play"), disabled: !zt, onClick: C.toggle, children: se.relang ? /* @__PURE__ */ i("span", { className: "ctrans__spin" }) : /* @__PURE__ */ i("svg", { viewBox: "0 0 24 24", width: 16, height: 16, fill: "currentColor", "aria-hidden": "true", style: C.playing ? void 0 : { marginLeft: 2 }, children: C.playing ? Fl : Gl }) }),
5892
5892
  /* @__PURE__ */ i("button", { type: "button", className: "ctrans__step", "aria-label": "Next segment", title: "Next segment", style: { opacity: C.idx >= ge.length - 1 ? 0.3 : 1 }, onClick: C.next, children: /* @__PURE__ */ i(oe, { d: ee.chevronRight, size: 16, sw: 1.8 }) })
5893
5893
  ] }),
5894
5894
  /* @__PURE__ */ i("span", { className: "ctrans__mute", children: cn(36) })
5895
5895
  ] }),
5896
5896
  /* @__PURE__ */ i("div", { className: "ctrans__scrub", children: Zi(w) })
5897
- ] }) }), ga = El("ga", { tabs: Qt, cur: M, pref: (Rs = Qt[0]) == null ? void 0 : Rs.key, onPick: N }), hs = Math.max(0, Math.min(100, Math.round(U))), fa = Ue && /* @__PURE__ */ g("div", { className: "gfull gfull--hold", "data-theme": "dark", role: "status", "aria-live": "polite", children: [
5897
+ ] }) }), ga = _l("ga", { tabs: Qt, cur: M, pref: (Rs = Qt[0]) == null ? void 0 : Rs.key, onPick: N }), hs = Math.max(0, Math.min(100, Math.round(U))), fa = Ue && /* @__PURE__ */ g("div", { className: "gfull gfull--hold", "data-theme": "dark", role: "status", "aria-live": "polite", children: [
5898
5898
  Oe && /* @__PURE__ */ i("div", { className: "gfull__holdbg", style: { backgroundImage: `url(https://i.ytimg.com/vi/${Oe}/hqdefault.jpg)` } }),
5899
5899
  /* @__PURE__ */ i("div", { className: "gfull__hold", children: n ? /* @__PURE__ */ g(De, { children: [
5900
5900
  qe && /* @__PURE__ */ i("div", { className: "gfull__holdt", children: qe }),
@@ -5915,7 +5915,7 @@ function Jc(t) {
5915
5915
  Y(() => {
5916
5916
  sr || rr(!1);
5917
5917
  }, [sr]);
5918
- const Na = t.endCard !== !1 && sr && !pa && /* @__PURE__ */ i(Ac, { options: { appUrl: t.appUrl, ...t.endCard || {} }, onStarted: t.onStarted, onClose: () => rr(!0), onReplay: () => {
5918
+ const Na = t.endCard !== !1 && sr && !pa && /* @__PURE__ */ i(Ec, { options: { appUrl: t.appUrl, ...t.endCard || {} }, onStarted: t.onStarted, onClose: () => rr(!0), onReplay: () => {
5919
5919
  rr(!0), Ke.current = !0, C.seekFrac ? C.seekFrac(0) : C.seekRow(0), C.playing || C.toggle();
5920
5920
  } });
5921
5921
  if (u) return /* @__PURE__ */ g(De, { children: [
@@ -5948,10 +5948,10 @@ function Jc(t) {
5948
5948
  Ur
5949
5949
  ] })
5950
5950
  ] }),
5951
- Ne && /* @__PURE__ */ g(Ul, { id: "ga", className: "listenerside", gap: 20, plain: !0, children: [
5951
+ Ne && /* @__PURE__ */ g(Rl, { id: "ga", className: "listenerside", gap: 20, plain: !0, children: [
5952
5952
  !se.sidePanel && w,
5953
5953
  !se.sidePanel && Gr,
5954
- !se.sidePanel && Qt.length > 0 && /* @__PURE__ */ i("div", { "data-panel-grid": "", className: "listenerside__panels", children: /* @__PURE__ */ i(_l, { col: ga, order: ["summary", "export"], onPick: N, grip: { summary: 40, export: 28 }, render: (Qe) => /* @__PURE__ */ i(Ps, { panel: !0, children: Rr(Qe) }) }) }),
5954
+ !se.sidePanel && Qt.length > 0 && /* @__PURE__ */ i("div", { "data-panel-grid": "", className: "listenerside__panels", children: /* @__PURE__ */ i(Yl, { col: ga, order: ["summary", "export"], onPick: N, grip: { summary: 40, export: 28 }, render: (Qe) => /* @__PURE__ */ i(Ps, { panel: !0, children: Rr(Qe) }) }) }),
5955
5955
  se.sidePanel
5956
5956
  ] })
5957
5957
  ] }),
@@ -5966,7 +5966,7 @@ function Jc(t) {
5966
5966
  M !== "none" && Rr(M)
5967
5967
  ] }) });
5968
5968
  return /* @__PURE__ */ g(De, { children: [
5969
- /* @__PURE__ */ i(Tc, { dark: a, title: n ? qe : "", subline: n ? us : "", onOptions: () => z(!0), optionsActive: X }),
5969
+ /* @__PURE__ */ i(wc, { dark: a, title: n ? qe : "", subline: n ? us : "", onOptions: () => z(!0), optionsActive: X }),
5970
5970
  tr,
5971
5971
  ls,
5972
5972
  !r && ma,
@@ -5990,53 +5990,53 @@ function Jc(t) {
5990
5990
  ] });
5991
5991
  }
5992
5992
  export {
5993
- Ol as ExportPanel,
5993
+ Cl as ExportPanel,
5994
5994
  Qi as FullVideo,
5995
- mc as MiniPlayer,
5996
- Gl as MuteButton,
5997
- rc as NO_SEEK,
5998
- Wl as PAUSE_D,
5999
- Fl as PLAY_D,
6000
- ic as PUB_SIDE,
6001
- ou as PanelSeek,
6002
- Ro as PlayerApiProvider,
5995
+ yc as MiniPlayer,
5996
+ Zl as MuteButton,
5997
+ sc as NO_SEEK,
5998
+ Fl as PAUSE_D,
5999
+ Gl as PLAY_D,
6000
+ ac as PUB_SIDE,
6001
+ lu as PanelSeek,
6002
+ Po as PlayerApiProvider,
6003
6003
  bn as REMOVE_BG_LABEL,
6004
- to as REMOVE_BG_NOTE,
6005
- ul as ReplayScrub,
6006
- ml as SpeakerCast,
6007
- xl as SummaryPanel,
6008
- au as Transport,
6009
- lc as TxFind,
6010
- oc as TxLines,
6011
- lu as VocalStackPlayer,
6012
- yl as VoiceSheetBody,
6013
- Hl as YtFollow,
6014
- ro as bedNote,
6004
+ no as REMOVE_BG_NOTE,
6005
+ dl as ReplayScrub,
6006
+ yl as SpeakerCast,
6007
+ Dl as SummaryPanel,
6008
+ ou as Transport,
6009
+ cc as TxFind,
6010
+ lc as TxLines,
6011
+ cu as VocalStackPlayer,
6012
+ Tl as VoiceSheetBody,
6013
+ Wl as YtFollow,
6014
+ so as bedNote,
6015
6015
  nn as browserFull,
6016
6016
  Et as lineEnd,
6017
6017
  Yi as lineWords,
6018
6018
  vn as pictureT,
6019
6019
  jn as placePosition,
6020
6020
  zn as realFull,
6021
- iu as setErrorReporter,
6021
+ au as setErrorReporter,
6022
6022
  ri as setFullTarget,
6023
- Vl as snapPosition,
6023
+ Hl as snapPosition,
6024
6024
  ti as spokenWordOf,
6025
- so as trackPlan,
6025
+ io as trackPlan,
6026
6026
  Ii as useApi,
6027
- kl as useArchiveVoice,
6028
- go as useBackgroundBed,
6029
- Xl as useDuck,
6030
- cc as useFindPull,
6031
- Zl as useFlash,
6027
+ jl as useArchiveVoice,
6028
+ fo as useBackgroundBed,
6029
+ ec as useDuck,
6030
+ uc as useFindPull,
6031
+ ql as useFlash,
6032
6032
  _t as usePlayerApi,
6033
6033
  Li as useSeparatedTrack,
6034
- Cl as useSummaryIn,
6035
- qo as useTranscript,
6036
- tc as useTxPlayer,
6037
- ac as useTxVoice,
6038
- gl as useViewportTranslation,
6039
- Ll as useVoiceCatalogue,
6040
- ec as useYtLead
6034
+ bl as useSummaryIn,
6035
+ Ko as useTranscript,
6036
+ nc as useTxPlayer,
6037
+ oc as useTxVoice,
6038
+ fl as useViewportTranslation,
6039
+ vl as useVoiceCatalogue,
6040
+ tc as useYtLead
6041
6041
  };
6042
6042
  //# sourceMappingURL=index.js.map