strataplayer 1.2.19 → 1.2.20

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,29 +1,29 @@
1
1
  var mi = Object.defineProperty;
2
- var fi = (i, t, n) => t in i ? mi(i, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : i[t] = n;
3
- var I = (i, t, n) => fi(i, typeof t != "symbol" ? t + "" : t, n);
4
- import ve, { useState as C, useEffect as q, useRef as H, useLayoutEffect as ze, useMemo as fe, useSyncExternalStore as bi, useCallback as Te } from "react";
2
+ var fi = (n, t, i) => t in n ? mi(n, t, { enumerable: !0, configurable: !0, writable: !0, value: i }) : n[t] = i;
3
+ var R = (n, t, i) => fi(n, typeof t != "symbol" ? t + "" : t, i);
4
+ import ke, { useState as N, useEffect as Q, useRef as U, useLayoutEffect as Ee, useMemo as xe, useSyncExternalStore as bi, useCallback as $e } from "react";
5
5
  import { createRoot as gi } from "react-dom/client";
6
- import { jsxs as d, jsx as e, Fragment as U } from "react/jsx-runtime";
6
+ import { jsxs as d, jsx as e, Fragment as _ } from "react/jsx-runtime";
7
7
  import { createPortal as vi } from "react-dom";
8
8
  class xi {
9
9
  constructor() {
10
- I(this, "events");
10
+ R(this, "events");
11
11
  this.events = /* @__PURE__ */ new Map();
12
12
  }
13
- on(t, n) {
13
+ on(t, i) {
14
14
  var o;
15
- return this.events.has(t) || this.events.set(t, []), (o = this.events.get(t)) == null || o.push(n), () => this.off(t, n);
15
+ return this.events.has(t) || this.events.set(t, []), (o = this.events.get(t)) == null || o.push(i), () => this.off(t, i);
16
16
  }
17
- off(t, n) {
17
+ off(t, i) {
18
18
  const o = this.events.get(t);
19
19
  o && this.events.set(
20
20
  t,
21
- o.filter((r) => r !== n)
21
+ o.filter((r) => r !== i)
22
22
  );
23
23
  }
24
- emit(t, n) {
24
+ emit(t, i) {
25
25
  const o = this.events.get(t);
26
- o && o.forEach((r) => r(n));
26
+ o && o.forEach((r) => r(i));
27
27
  }
28
28
  destroy() {
29
29
  this.events.clear();
@@ -31,16 +31,16 @@ class xi {
31
31
  }
32
32
  class wi {
33
33
  constructor(t) {
34
- I(this, "state");
35
- I(this, "listeners");
34
+ R(this, "state");
35
+ R(this, "listeners");
36
36
  this.state = t, this.listeners = /* @__PURE__ */ new Set();
37
37
  }
38
38
  get() {
39
39
  return this.state;
40
40
  }
41
41
  setState(t) {
42
- const n = this.state, o = typeof t == "function" ? t(n) : t;
43
- this.state = { ...n, ...o }, this.listeners.forEach((r) => r(this.state, n));
42
+ const i = this.state, o = typeof t == "function" ? t(i) : t;
43
+ this.state = { ...i, ...o }, this.listeners.forEach((r) => r(this.state, i));
44
44
  }
45
45
  subscribe(t) {
46
46
  return this.listeners.add(t), () => this.listeners.delete(t);
@@ -51,11 +51,11 @@ class wi {
51
51
  }
52
52
  class yi {
53
53
  constructor(t) {
54
- I(this, "context", null);
55
- I(this, "source", null);
56
- I(this, "gainNode", null);
57
- I(this, "video");
58
- I(this, "isInitialized", !1);
54
+ R(this, "context", null);
55
+ R(this, "source", null);
56
+ R(this, "gainNode", null);
57
+ R(this, "video");
58
+ R(this, "isInitialized", !1);
59
59
  this.video = t;
60
60
  }
61
61
  /**
@@ -66,8 +66,8 @@ class yi {
66
66
  this.context = new AudioContext(), this.gainNode = this.context.createGain();
67
67
  try {
68
68
  this.source = this.context.createMediaElementSource(this.video), this.source.connect(this.gainNode), this.gainNode.connect(this.context.destination), this.isInitialized = !0;
69
- } catch (n) {
70
- console.warn("StrataPlayer: Failed to initialize AudioEngine", n);
69
+ } catch (i) {
70
+ console.warn("StrataPlayer: Failed to initialize AudioEngine", i);
71
71
  }
72
72
  }
73
73
  }
@@ -78,46 +78,46 @@ class yi {
78
78
  this.context && this.context.close(), this.isInitialized = !1;
79
79
  }
80
80
  }
81
- const _e = (i) => {
82
- if (isNaN(i)) return "00:00";
83
- const t = Math.floor(i / 3600), n = Math.floor(i % 3600 / 60), o = Math.floor(i % 60);
84
- return t > 0 ? `${t}:${n.toString().padStart(2, "0")}:${o.toString().padStart(2, "0")}` : `${n}:${o.toString().padStart(2, "0")}`;
85
- }, ki = async (i, t = 3, n = 2e4) => {
81
+ const Je = (n) => {
82
+ if (isNaN(n)) return "00:00";
83
+ const t = Math.floor(n / 3600), i = Math.floor(n % 3600 / 60), o = Math.floor(n % 60);
84
+ return t > 0 ? `${t}:${i.toString().padStart(2, "0")}:${o.toString().padStart(2, "0")}` : `${i}:${o.toString().padStart(2, "0")}`;
85
+ }, ki = async (n, t = 3, i = 2e4) => {
86
86
  for (let o = 0; o < t; o++) {
87
- const r = new AbortController(), h = setTimeout(() => r.abort(), n);
87
+ const r = new AbortController(), h = setTimeout(() => r.abort(), i);
88
88
  try {
89
- const u = await fetch(i, { signal: r.signal });
89
+ const u = await fetch(n, { signal: r.signal });
90
90
  if (clearTimeout(h), !u.ok) throw new Error(`HTTP ${u.status}`);
91
91
  return await u.text();
92
92
  } catch (u) {
93
93
  if (clearTimeout(h), o === t - 1) throw u;
94
- await new Promise((b) => setTimeout(b, 1e3));
94
+ await new Promise((f) => setTimeout(f, 1e3));
95
95
  }
96
96
  }
97
97
  throw new Error("Failed");
98
- }, Si = async (i, t, n = 2e4) => {
98
+ }, Si = async (n, t, i = 2e4) => {
99
99
  try {
100
- const r = (await ki(i, 3, n)).split(`
100
+ const r = (await ki(n, 3, i)).split(`
101
101
  `), h = [];
102
- let u = null, b = null;
103
- const g = i.substring(0, i.lastIndexOf("/") + 1), x = (p) => {
102
+ let u = null, f = null;
103
+ const g = n.substring(0, n.lastIndexOf("/") + 1), x = (p) => {
104
104
  const w = p.split(":");
105
- let f = 0;
106
- return w.length === 3 ? (f += parseFloat(w[0]) * 3600, f += parseFloat(w[1]) * 60, f += parseFloat(w[2])) : (f += parseFloat(w[0]) * 60, f += parseFloat(w[1])), f;
105
+ let m = 0;
106
+ return w.length === 3 ? (m += parseFloat(w[0]) * 3600, m += parseFloat(w[1]) * 60, m += parseFloat(w[2])) : (m += parseFloat(w[0]) * 60, m += parseFloat(w[1])), m;
107
107
  };
108
108
  for (let p of r)
109
109
  if (p = p.trim(), p.includes("-->")) {
110
110
  const w = p.split("-->");
111
- u = x(w[0].trim()), b = x(w[1].trim());
112
- } else if (u !== null && b !== null && p.length > 0) {
113
- let [w, f] = p.split("#");
111
+ u = x(w[0].trim()), f = x(w[1].trim());
112
+ } else if (u !== null && f !== null && p.length > 0) {
113
+ let [w, m] = p.split("#");
114
114
  !w.match(/^https?:\/\//) && !w.startsWith("data:") && (w = g + w);
115
- let M = 0, z = 0, j = 0, D = 0;
116
- if (f && f.startsWith("xywh=")) {
117
- const O = f.replace("xywh=", "").split(",");
118
- O.length === 4 && (M = parseInt(O[0]), z = parseInt(O[1]), j = parseInt(O[2]), D = parseInt(O[3]));
115
+ let T = 0, I = 0, O = 0, Y = 0;
116
+ if (m && m.startsWith("xywh=")) {
117
+ const W = m.replace("xywh=", "").split(",");
118
+ W.length === 4 && (T = parseInt(W[0]), I = parseInt(W[1]), O = parseInt(W[2]), Y = parseInt(W[3]));
119
119
  }
120
- j > 0 && D > 0 && h.push({ start: u, end: b, url: w, x: M, y: z, w: j, h: D }), u = null, b = null;
120
+ O > 0 && Y > 0 && h.push({ start: u, end: f, url: w, x: T, y: I, w: O, h: Y }), u = null, f = null;
121
121
  }
122
122
  return h;
123
123
  } catch {
@@ -126,19 +126,19 @@ const _e = (i) => {
126
126
  }, Ci = () => {
127
127
  if (!(typeof document > "u")) {
128
128
  if (!document.getElementById("strata-fonts")) {
129
- const i = document.createElement("link");
130
- i.rel = "preconnect", i.href = "https://fonts.googleapis.com", document.head.appendChild(i);
129
+ const n = document.createElement("link");
130
+ n.rel = "preconnect", n.href = "https://fonts.googleapis.com", document.head.appendChild(n);
131
131
  const t = document.createElement("link");
132
132
  t.rel = "preconnect", t.href = "https://fonts.gstatic.com", t.crossOrigin = "anonymous", document.head.appendChild(t);
133
- const n = document.createElement("link");
134
- n.id = "strata-fonts", n.rel = "stylesheet", n.href = "https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500&family=Press+Start+2P&family=Cinzel:wght@400;600;700&display=swap", document.head.appendChild(n);
133
+ const i = document.createElement("link");
134
+ i.id = "strata-fonts", i.rel = "stylesheet", i.href = "https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500&family=Press+Start+2P&family=Cinzel:wght@400;600;700&display=swap", document.head.appendChild(i);
135
135
  }
136
136
  if (!document.querySelector('script[src*="cast_sender.js"]') && !window.cast) {
137
- const i = document.createElement("script");
138
- i.src = "https://www.gstatic.com/cv/js/sender/v1/cast_sender.js?loadCastFramework=1", document.head.appendChild(i);
137
+ const n = document.createElement("script");
138
+ n.src = "https://www.gstatic.com/cv/js/sender/v1/cast_sender.js?loadCastFramework=1", document.head.appendChild(n);
139
139
  }
140
140
  }
141
- }, Ke = {
141
+ }, tt = {
142
142
  useNative: !1,
143
143
  fixCapitalization: !1,
144
144
  backgroundOpacity: 50,
@@ -149,7 +149,7 @@ const _e = (i) => {
149
149
  isBold: !1,
150
150
  textColor: "#ffffff",
151
151
  verticalOffset: 40
152
- }, Ot = "strata-settings", Y = {
152
+ }, Ht = "strata-settings", te = {
153
153
  isPlaying: !1,
154
154
  isBuffering: !1,
155
155
  isLive: !1,
@@ -171,7 +171,7 @@ const _e = (i) => {
171
171
  subtitleTracks: [],
172
172
  currentSubtitle: -1,
173
173
  subtitleOffset: 0,
174
- subtitleSettings: Ke,
174
+ subtitleSettings: tt,
175
175
  activeCues: [],
176
176
  viewMode: "normal",
177
177
  notifications: [],
@@ -188,66 +188,66 @@ const _e = (i) => {
188
188
  isAutoSized: !1,
189
189
  isLooping: !1,
190
190
  controlsVisible: !0
191
- }, Ht = (i = {}) => {
191
+ }, Wt = (n = {}) => {
192
192
  let t = {};
193
- if (!i.disablePersistence && typeof window < "u")
193
+ if (!n.disablePersistence && typeof window < "u")
194
194
  try {
195
- const o = localStorage.getItem(Ot);
195
+ const o = localStorage.getItem(Ht);
196
196
  o && (t = JSON.parse(o));
197
197
  } catch {
198
198
  }
199
- const n = {
200
- ...Ke,
199
+ const i = {
200
+ ...tt,
201
201
  ...t.subtitleSettings || {},
202
- ...i.subtitleSettings || {}
202
+ ...n.subtitleSettings || {}
203
203
  };
204
204
  return {
205
- ...Y,
205
+ ...te,
206
206
  ...t,
207
207
  // Load saved first
208
208
  // Override with config if present (not undefined)
209
- volume: i.volume ?? t.volume ?? Y.volume,
210
- isMuted: i.muted ?? t.isMuted ?? Y.isMuted,
211
- playbackRate: i.playbackRate ?? t.playbackRate ?? Y.playbackRate,
212
- audioGain: i.audioGain ?? t.audioGain ?? Y.audioGain,
213
- theme: i.theme ?? t.theme ?? Y.theme,
214
- themeColor: i.themeColor ?? t.themeColor ?? Y.themeColor,
215
- iconSize: i.iconSize ?? t.iconSize ?? Y.iconSize,
216
- subtitleSettings: n,
209
+ volume: n.volume ?? t.volume ?? te.volume,
210
+ isMuted: n.muted ?? t.isMuted ?? te.isMuted,
211
+ playbackRate: n.playbackRate ?? t.playbackRate ?? te.playbackRate,
212
+ audioGain: n.audioGain ?? t.audioGain ?? te.audioGain,
213
+ theme: n.theme ?? t.theme ?? te.theme,
214
+ themeColor: n.themeColor ?? t.themeColor ?? te.themeColor,
215
+ iconSize: n.iconSize ?? t.iconSize ?? te.iconSize,
216
+ subtitleSettings: i,
217
217
  // Config overrides state for these visual modes
218
- isAutoSized: i.autoSize ?? Y.isAutoSized,
219
- isLive: i.isLive ?? t.isLive ?? Y.isLive,
220
- isLooping: i.loop ?? t.isLooping ?? Y.isLooping,
218
+ isAutoSized: n.autoSize ?? te.isAutoSized,
219
+ isLive: n.isLive ?? t.isLive ?? te.isLive,
220
+ isLooping: n.loop ?? t.isLooping ?? te.isLooping,
221
221
  sourceStatuses: {}
222
222
  // Never persist statuses
223
223
  };
224
224
  };
225
225
  class Ni {
226
- constructor(t = {}, n) {
227
- I(this, "video");
228
- I(this, "container", null);
229
- I(this, "events");
230
- I(this, "store");
231
- I(this, "plugins", /* @__PURE__ */ new Map());
232
- I(this, "audioEngine");
233
- I(this, "config");
234
- I(this, "resizeObserver", null);
226
+ constructor(t = {}, i) {
227
+ R(this, "video");
228
+ R(this, "container", null);
229
+ R(this, "events");
230
+ R(this, "store");
231
+ R(this, "plugins", /* @__PURE__ */ new Map());
232
+ R(this, "audioEngine");
233
+ R(this, "config");
234
+ R(this, "resizeObserver", null);
235
235
  // Retry Logic
236
- I(this, "retryCount", 0);
237
- I(this, "maxRetries", 5);
238
- I(this, "retryTimer", null);
239
- I(this, "currentSource", null);
240
- I(this, "currentSrc", "");
236
+ R(this, "retryCount", 0);
237
+ R(this, "maxRetries", 5);
238
+ R(this, "retryTimer", null);
239
+ R(this, "currentSource", null);
240
+ R(this, "currentSrc", "");
241
241
  // Track configs from setSources are stored here to lazy load
242
- I(this, "trackConfigs", []);
242
+ R(this, "trackConfigs", []);
243
243
  // Download Control
244
- I(this, "currentDownloadController", null);
244
+ R(this, "currentDownloadController", null);
245
245
  // Cast
246
- I(this, "castInitialized", !1);
247
- I(this, "boundCueChange");
248
- I(this, "boundFullscreenChange");
249
- Ci(), this.config = t, this.config.autoOrientation = this.config.autoOrientation ?? !0, this.config.fetchTimeout = this.config.fetchTimeout ?? 3e4, this.config.centerControls = this.config.centerControls ?? !0, this.config.gestureSeek = this.config.gestureSeek ?? !1, this.video = n || document.createElement("video"), this.video.crossOrigin = "anonymous", t.playsInline !== !1 && (this.video.playsInline = !0), this.events = new xi();
250
- const o = Ht(t);
246
+ R(this, "castInitialized", !1);
247
+ R(this, "boundCueChange");
248
+ R(this, "boundFullscreenChange");
249
+ Ci(), this.config = t, this.config.autoOrientation = this.config.autoOrientation ?? !0, this.config.fetchTimeout = this.config.fetchTimeout ?? 3e4, this.config.centerControls = this.config.centerControls ?? !0, this.config.gestureSeek = this.config.gestureSeek ?? !1, this.video = i || document.createElement("video"), this.video.crossOrigin = "anonymous", t.playsInline !== !1 && (this.video.playsInline = !0), this.events = new xi();
250
+ const o = Wt(t);
251
251
  this.store = new wi(o), this.audioEngine = new yi(this.video), this.boundCueChange = this.handleCueChange.bind(this), this.boundFullscreenChange = () => {
252
252
  const r = !!document.fullscreenElement;
253
253
  if (this.store.setState({ isFullscreen: r }), this.emit("resize"), this.emit(r ? "fullscreen" : "fullscreen_exit"), r && this.config.autoOrientation && screen.orientation && "lock" in screen.orientation) {
@@ -270,7 +270,7 @@ class Ni {
270
270
  isLive: r.isLive,
271
271
  isLooping: r.isLooping
272
272
  };
273
- localStorage.setItem(Ot, JSON.stringify(h));
273
+ localStorage.setItem(Ht, JSON.stringify(h));
274
274
  });
275
275
  }
276
276
  // --- Instance Properties ---
@@ -321,14 +321,14 @@ class Ni {
321
321
  this.skip(-t);
322
322
  }
323
323
  // --- Event API ---
324
- on(t, n) {
325
- return this.events.on(t, n);
324
+ on(t, i) {
325
+ return this.events.on(t, i);
326
326
  }
327
- off(t, n) {
328
- return this.events.off(t, n);
327
+ off(t, i) {
328
+ return this.events.off(t, i);
329
329
  }
330
- emit(t, n) {
331
- return this.events.emit(t, n);
330
+ emit(t, i) {
331
+ return this.events.emit(t, i);
332
332
  }
333
333
  initVideoListeners() {
334
334
  const t = (o) => this.store.setState(o);
@@ -418,64 +418,66 @@ class Ni {
418
418
  }), document.addEventListener("fullscreenchange", this.boundFullscreenChange);
419
419
  }
420
420
  updateSourceStatus(t) {
421
- const n = this.store.get().currentSourceIndex;
422
- n !== -1 && this.store.setState((o) => ({
423
- sourceStatuses: { ...o.sourceStatuses, [n]: t }
421
+ const i = this.store.get().currentSourceIndex;
422
+ i !== -1 && this.store.setState((o) => ({
423
+ sourceStatuses: { ...o.sourceStatuses, [i]: t }
424
424
  }));
425
425
  }
426
426
  // --- Media Session API ---
427
427
  initMediaSession() {
428
428
  if (!("mediaSession" in navigator)) return;
429
429
  const t = navigator.mediaSession;
430
- t.setActionHandler("play", () => this.play()), t.setActionHandler("pause", () => this.pause()), t.setActionHandler("seekbackward", (n) => this.skip(n.seekOffset ? -n.seekOffset : -10)), t.setActionHandler("seekforward", (n) => this.skip(n.seekOffset || 10)), t.setActionHandler("seekto", (n) => {
431
- n.seekTime !== void 0 && this.seek(n.seekTime);
430
+ t.setActionHandler("play", () => this.play()), t.setActionHandler("pause", () => this.pause()), t.setActionHandler("seekbackward", (i) => this.skip(i.seekOffset ? -i.seekOffset : -10)), t.setActionHandler("seekforward", (i) => this.skip(i.seekOffset || 10)), t.setActionHandler("seekto", (i) => {
431
+ i.seekTime !== void 0 && this.seek(i.seekTime);
432
432
  }), t.setActionHandler("stop", () => {
433
433
  this.pause(), this.seek(0);
434
434
  }), t.setActionHandler("previoustrack", () => {
435
- const n = this.store.get().currentSourceIndex;
436
- n > 0 && this.switchSource(n - 1);
435
+ const i = this.store.get().currentSourceIndex;
436
+ i > 0 && this.switchSource(i - 1);
437
437
  }), t.setActionHandler("nexttrack", () => {
438
- const n = this.store.get().currentSourceIndex, o = this.store.get().sources.length;
439
- n < o - 1 && this.switchSource(n + 1);
438
+ const i = this.store.get().currentSourceIndex, o = this.store.get().sources.length;
439
+ i < o - 1 && this.switchSource(i + 1);
440
440
  });
441
441
  }
442
442
  updateMediaSessionMetadata() {
443
443
  var o, r;
444
444
  if (!("mediaSession" in navigator)) return;
445
- const t = ((o = this.currentSource) == null ? void 0 : o.name) || ((r = this.currentSource) == null ? void 0 : r.url.split("/").pop()) || "Video", n = [];
446
- this.config.poster && n.push({ src: this.config.poster, sizes: "512x512", type: "image/jpeg" }), n.push({ src: "logo.png", sizes: "512x512", type: "image/png" }), navigator.mediaSession.metadata = new MediaMetadata({
445
+ const t = ((o = this.currentSource) == null ? void 0 : o.name) || ((r = this.currentSource) == null ? void 0 : r.url.split("/").pop()) || "Video", i = [];
446
+ this.config.poster && i.push({ src: this.config.poster, sizes: "512x512", type: "image/jpeg" }), i.push({ src: "logo.png", sizes: "512x512", type: "image/png" }), navigator.mediaSession.metadata = new MediaMetadata({
447
447
  title: t,
448
448
  artist: "StrataPlayer",
449
- artwork: n
449
+ artwork: i
450
450
  });
451
451
  }
452
452
  updateMediaSessionPosition() {
453
453
  if (!("mediaSession" in navigator)) return;
454
- const t = this.video.duration, n = this.video.currentTime, o = this.video.playbackRate;
455
- if (!isNaN(t) && isFinite(t) && !isNaN(n))
454
+ const t = this.video.duration, i = this.video.currentTime, o = this.video.playbackRate;
455
+ if (!isNaN(t) && isFinite(t) && !isNaN(i))
456
456
  try {
457
457
  navigator.mediaSession.setPositionState({
458
458
  duration: Math.max(0, t),
459
459
  playbackRate: o,
460
- position: Math.max(0, Math.min(n, t))
460
+ position: Math.max(0, Math.min(i, t))
461
461
  // Ensure within [0, duration]
462
462
  });
463
463
  } catch (r) {
464
464
  console.warn("MediaSession Position Error:", r);
465
465
  }
466
466
  }
467
- triggerError(t, n = !1) {
468
- n ? this.handleError(t) : this.notify({ type: "warning", message: `Warning: ${t}`, duration: 5e3 });
467
+ triggerError(t, i = !1) {
468
+ i ? this.handleError(t) : this.notify({ type: "warning", message: `Warning: ${t}`, duration: 5e3 });
469
469
  }
470
470
  handleError(t) {
471
- const n = this.video.error, o = t || (n == null ? void 0 : n.message) || (n ? `Code ${n.code}` : "Unknown Error");
472
- if (this.removeNotification("retry"), this.emit("video:error", n), this.retryCount < this.maxRetries) {
471
+ const i = this.video.error, o = t || (i == null ? void 0 : i.message) || (i ? `Code ${i.code}` : "Unknown Error");
472
+ if (this.removeNotification("retry"), this.emit("video:error", i), this.retryCount < this.maxRetries) {
473
473
  this.retryCount++;
474
474
  const r = Math.pow(2, this.retryCount - 1) * 1500;
475
475
  this.notify({
476
476
  id: "retry",
477
477
  type: "loading",
478
- message: `Error: ${o}. Retrying (${this.retryCount}/${this.maxRetries})...`
478
+ // Cleaned up formatting with newline
479
+ message: `Error: ${o}.
480
+ Retrying (${this.retryCount}/${this.maxRetries})`
479
481
  }), console.warn(`[StrataPlayer] Error: ${o}. Retrying in ${r}ms...`), this.retryTimer && clearTimeout(this.retryTimer), this.retryTimer = setTimeout(() => {
480
482
  if (this.currentSource) {
481
483
  this.load(this.currentSource, this.trackConfigs, !0);
@@ -496,31 +498,31 @@ class Ni {
496
498
  }
497
499
  updateBuffer() {
498
500
  const t = [];
499
- for (let n = 0; n < this.video.buffered.length; n++)
501
+ for (let i = 0; i < this.video.buffered.length; i++)
500
502
  t.push({
501
- start: this.video.buffered.start(n),
502
- end: this.video.buffered.end(n)
503
+ start: this.video.buffered.start(i),
504
+ end: this.video.buffered.end(i)
503
505
  });
504
506
  this.store.setState({ buffered: t });
505
507
  }
506
- updateSubtitleTrackState(t, n) {
508
+ updateSubtitleTrackState(t, i) {
507
509
  this.store.setState((o) => {
508
510
  const r = [...o.subtitleTracks];
509
- return r[t] && (r[t] = { ...r[t], ...n }), { subtitleTracks: r };
511
+ return r[t] && (r[t] = { ...r[t], ...i }), { subtitleTracks: r };
510
512
  });
511
513
  }
512
514
  // --- Utility ---
513
- async fetchWithRetry(t, n = 3, o, r) {
515
+ async fetchWithRetry(t, i = 3, o, r) {
514
516
  const h = o ?? this.config.fetchTimeout ?? 3e4;
515
- for (let u = 0; u < n; u++) {
516
- const b = r ? null : new AbortController(), g = r || (b == null ? void 0 : b.signal), x = setTimeout(() => b == null ? void 0 : b.abort(), h);
517
+ for (let u = 0; u < i; u++) {
518
+ const f = r ? null : new AbortController(), g = r || (f == null ? void 0 : f.signal), x = setTimeout(() => f == null ? void 0 : f.abort(), h);
517
519
  try {
518
520
  const p = await fetch(t, { signal: g });
519
521
  if (clearTimeout(x), !p.ok) throw new Error(`HTTP ${p.status}`);
520
522
  return p;
521
523
  } catch (p) {
522
524
  if (clearTimeout(x), r != null && r.aborted) throw new Error("Aborted");
523
- if (u === n - 1) throw p;
525
+ if (u === i - 1) throw p;
524
526
  if (p.name === "AbortError") {
525
527
  if (r != null && r.aborted) throw p;
526
528
  console.warn(`Fetch timeout (${h}ms) for ${t}`);
@@ -532,41 +534,52 @@ class Ni {
532
534
  }
533
535
  // Helper to ensure subtitle content is VTT
534
536
  convertToVTT(t) {
535
- return t.trim().startsWith("WEBVTT") ? t : `WEBVTT
537
+ let i = t.trim();
538
+ if (!i.startsWith("WEBVTT")) {
539
+ let o = i.replace(/(\d+:\d{2}:\d{2}),(\d{3})/g, "$1.$2");
540
+ return o = o.replace(/(\d{2}:\d{2}),(\d{3})/g, "$1.$2"), `WEBVTT
536
541
 
537
- ` + t.replace(/(\d{2}:\d{2}:\d{2}),(\d{3})/g, "$1.$2");
542
+ ` + o;
543
+ }
544
+ return i;
545
+ }
546
+ // Enhanced Format Duration: Days, Hours, Minutes, Seconds
547
+ formatDuration(t) {
548
+ if (!isFinite(t) || t <= 0) return "";
549
+ const i = Math.floor(t / 1e3), o = Math.floor(i / (3600 * 24)), r = Math.floor(i % (3600 * 24) / 3600), h = Math.floor(i % 3600 / 60), u = i % 60, f = [];
550
+ return o > 0 && f.push(`${o}d`), r > 0 && f.push(`${r}h`), h > 0 && f.push(`${h}m`), f.push(`${u}s`), f.join(" ");
538
551
  }
539
552
  // --- Core Methods ---
540
553
  attach(t) {
541
- this.resizeObserver && this.resizeObserver.disconnect(), this.container = t, this.container.appendChild(this.video), this.video.style.width = "100%", this.video.style.height = "100%", this.video.style.objectFit = this.store.get().isAutoSized ? "cover" : "contain", this.video.style.backgroundColor = "black", this.updateAspectRatio(), this.resizeObserver = new ResizeObserver((n) => {
542
- for (const o of n)
554
+ this.resizeObserver && this.resizeObserver.disconnect(), this.container = t, this.container.appendChild(this.video), this.video.style.width = "100%", this.video.style.height = "100%", this.video.style.objectFit = this.store.get().isAutoSized ? "cover" : "contain", this.video.style.backgroundColor = "black", this.updateAspectRatio(), this.resizeObserver = new ResizeObserver((i) => {
555
+ for (const o of i)
543
556
  this.emit("resize", { width: o.contentRect.width, height: o.contentRect.height }), this.updateAspectRatio();
544
557
  }), this.resizeObserver.observe(this.container), this.emit("ready");
545
558
  }
546
559
  use(t) {
547
560
  this.plugins.has(t.name) || (t.init(this), this.plugins.set(t.name, t));
548
561
  }
549
- setSources(t, n = []) {
550
- this.store.setState({ sources: t }), this.trackConfigs = n, t.length > 0 && this.load(t[0], n);
562
+ setSources(t, i = []) {
563
+ this.store.setState({ sources: t }), this.trackConfigs = i, t.length > 0 && this.load(t[0], i);
551
564
  }
552
565
  switchSource(t) {
553
- const n = this.store.get().sources;
554
- if (t >= 0 && t < n.length) {
566
+ const i = this.store.get().sources;
567
+ if (t >= 0 && t < i.length) {
555
568
  const o = this.video.currentTime, r = !this.video.paused;
556
- this.load(n[t], this.trackConfigs);
569
+ this.load(i[t], this.trackConfigs);
557
570
  const h = () => {
558
571
  this.video.currentTime = o, r && this.video.play(), this.video.removeEventListener("canplay", h);
559
572
  };
560
573
  this.video.addEventListener("canplay", h);
561
574
  }
562
575
  }
563
- load(t, n = [], o = !1) {
576
+ load(t, i = [], o = !1) {
564
577
  this.retryTimer && clearTimeout(this.retryTimer);
565
578
  const r = typeof t == "string" ? { url: t, type: "auto" } : t;
566
- o || (this.retryCount = 0, this.store.setState({ error: null }), this.removeNotification("retry")), this.currentSrc = r.url, this.currentSource = r, this.trackConfigs = n;
567
- const u = this.store.get().sources.findIndex((w) => w.url === r.url), b = n.map((w, f) => ({
579
+ o || (this.retryCount = 0, this.store.setState({ error: null }), this.removeNotification("retry")), this.currentSrc = r.url, this.currentSource = r, this.trackConfigs = i;
580
+ const u = this.store.get().sources.findIndex((w) => w.url === r.url), f = i.map((w, m) => ({
568
581
  ...w,
569
- index: f,
582
+ index: m,
570
583
  status: "idle",
571
584
  isDefault: !!w.default
572
585
  }));
@@ -578,7 +591,7 @@ class Ni {
578
591
  audioTracks: [],
579
592
  currentAudioTrack: -1,
580
593
  // Reset audio track
581
- subtitleTracks: b,
594
+ subtitleTracks: f,
582
595
  currentSubtitle: -1,
583
596
  currentSourceIndex: u
584
597
  }), this.updateMediaSessionMetadata();
@@ -587,14 +600,14 @@ class Ni {
587
600
  const x = this.video.getElementsByTagName("track");
588
601
  for (; x.length > 0; )
589
602
  x[0].remove();
590
- const p = b.findIndex((w) => w.default);
603
+ const p = f.findIndex((w) => w.default);
591
604
  p !== -1 && this.setSubtitle(p), (g === "mp4" || g === "webm" || g === "ogg") && (this.video.src = r.url);
592
605
  }
593
606
  // Wrapper for external subtitle API
594
- loadSubtitle(t, n = "Subtitle") {
607
+ loadSubtitle(t, i = "Subtitle") {
595
608
  const o = this.store.get().subtitleTracks.length, r = {
596
609
  src: t,
597
- label: n,
610
+ label: i,
598
611
  srcLang: "user",
599
612
  default: !0,
600
613
  kind: "subtitles",
@@ -606,22 +619,22 @@ class Ni {
606
619
  subtitleTracks: [...h.subtitleTracks, r]
607
620
  })), this.setSubtitle(o);
608
621
  }
609
- addTextTrack(t, n) {
622
+ addTextTrack(t, i) {
610
623
  const o = new FileReader();
611
624
  o.onload = (r) => {
612
625
  var g;
613
626
  if (!((g = r.target) != null && g.result)) return;
614
627
  let h = r.target.result;
615
628
  h = this.convertToVTT(h);
616
- const u = new Blob([h], { type: "text/vtt" }), b = URL.createObjectURL(u);
617
- this.loadSubtitle(b, n), this.notify({ type: "success", message: "Subtitle uploaded", duration: 3e3 });
629
+ const u = new Blob([h], { type: "text/vtt" }), f = URL.createObjectURL(u);
630
+ this.loadSubtitle(f, i), this.notify({ type: "success", message: "Subtitle uploaded", duration: 3e3 });
618
631
  }, o.onerror = () => {
619
632
  this.notify({ type: "error", message: "Failed to read file", duration: 3e3 });
620
633
  }, o.readAsText(t);
621
634
  }
622
- addTextTrackInternal(t, n, o = "", r = !1) {
635
+ addTextTrackInternal(t, i, o = "", r = !1) {
623
636
  const h = document.createElement("track");
624
- h.kind = "subtitles", h.label = n, h.src = t, h.srclang = o, r && (h.default = !0), this.video.appendChild(h);
637
+ h.kind = "subtitles", h.label = i, h.src = t, h.srclang = o, r && (h.default = !0), this.video.appendChild(h);
625
638
  }
626
639
  play() {
627
640
  return this.video.play();
@@ -634,15 +647,15 @@ class Ni {
634
647
  }
635
648
  seek(t) {
636
649
  if (isNaN(t)) return;
637
- const n = Math.max(0, Math.min(t, this.video.duration));
638
- this.store.setState({ currentTime: n }), this.video.currentTime = n;
650
+ const i = Math.max(0, Math.min(t, this.video.duration));
651
+ this.store.setState({ currentTime: i }), this.video.currentTime = i;
639
652
  }
640
653
  skip(t) {
641
654
  this.seek(this.video.currentTime + t);
642
655
  }
643
656
  setVolume(t) {
644
- const n = Math.max(0, Math.min(t, 1));
645
- this.video.volume = n, n > 0 && this.video.muted && (this.video.muted = !1), n === 0 && (this.video.muted = !0);
657
+ const i = Math.max(0, Math.min(t, 1));
658
+ this.video.volume = i, i > 0 && this.video.muted && (this.video.muted = !1), i === 0 && (this.video.muted = !0);
646
659
  }
647
660
  toggleMute() {
648
661
  this.video.muted = !this.video.muted;
@@ -681,8 +694,8 @@ class Ni {
681
694
  const t = this.store.get().isWebFullscreen;
682
695
  document.fullscreenElement && document.exitFullscreen().catch(() => {
683
696
  });
684
- const n = !t;
685
- this.store.setState({ isWebFullscreen: n }), typeof document < "u" && (document.body.style.overflow = n ? "hidden" : ""), this.emit("webfullscreen", n);
697
+ const i = !t;
698
+ this.store.setState({ isWebFullscreen: i }), typeof document < "u" && (document.body.style.overflow = i ? "hidden" : ""), this.emit("webfullscreen", i);
686
699
  }
687
700
  togglePip() {
688
701
  document.pictureInPictureElement ? document.exitPictureInPicture() : this.video !== document.pictureInPictureElement && this.video.requestPictureInPicture && this.video.requestPictureInPicture();
@@ -690,9 +703,9 @@ class Ni {
690
703
  screenshot() {
691
704
  const t = document.createElement("canvas");
692
705
  t.width = this.video.videoWidth, t.height = this.video.videoHeight;
693
- const n = t.getContext("2d");
694
- if (n) {
695
- n.drawImage(this.video, 0, 0, t.width, t.height);
706
+ const i = t.getContext("2d");
707
+ if (i) {
708
+ i.drawImage(this.video, 0, 0, t.width, t.height);
696
709
  try {
697
710
  const o = t.toDataURL("image/png"), r = document.createElement("a");
698
711
  r.download = `screenshot-${(/* @__PURE__ */ new Date()).toISOString()}.png`, r.href = o, r.click(), this.notify({ type: "success", message: "Screenshot saved", duration: 2e3 });
@@ -708,9 +721,9 @@ class Ni {
708
721
  this.video.loop = !this.video.loop, this.store.setState({ isLooping: this.video.loop }), this.notify({ type: "info", message: `Loop: ${this.video.loop ? "On" : "Off"}`, duration: 1500 });
709
722
  }
710
723
  setFlip(t) {
711
- const n = this.store.get().flipState, o = {
712
- ...n,
713
- [t]: !n[t]
724
+ const i = this.store.get().flipState, o = {
725
+ ...i,
726
+ [t]: !i[t]
714
727
  };
715
728
  this.store.setState({ flipState: o });
716
729
  const r = o.horizontal ? -1 : 1, h = o.vertical ? -1 : 1;
@@ -721,21 +734,21 @@ class Ni {
721
734
  }
722
735
  updateAspectRatio() {
723
736
  if (!this.container) return;
724
- const { aspectRatio: t, isAutoSized: n } = this.store.get();
737
+ const { aspectRatio: t, isAutoSized: i } = this.store.get();
725
738
  if (t === "default") {
726
- this.video.style.width = "100%", this.video.style.height = "100%", this.video.style.objectFit = n ? "cover" : "contain";
739
+ this.video.style.width = "100%", this.video.style.height = "100%", this.video.style.objectFit = i ? "cover" : "contain";
727
740
  return;
728
741
  }
729
742
  const [o, r] = t.split(":").map(Number);
730
743
  if (!o || !r) return;
731
744
  const h = o / r, u = this.container.getBoundingClientRect();
732
745
  if (u.width === 0 || u.height === 0) return;
733
- const b = u.width / u.height;
746
+ const f = u.width / u.height;
734
747
  let g, x;
735
- b > h ? (x = u.height, g = x * h) : (g = u.width, x = g / h), this.video.style.width = `${g}px`, this.video.style.height = `${x}px`, this.video.style.objectFit = "fill";
748
+ f > h ? (x = u.height, g = x * h) : (g = u.width, x = g / h), this.video.style.width = `${g}px`, this.video.style.height = `${x}px`, this.video.style.objectFit = "fill";
736
749
  }
737
750
  initCast() {
738
- const t = window, n = () => {
751
+ const t = window, i = () => {
739
752
  if (!this.castInitialized)
740
753
  try {
741
754
  t.cast && t.cast.framework && t.chrome && t.chrome.cast && (t.cast.framework.CastContext.getInstance().setOptions({
@@ -746,8 +759,8 @@ class Ni {
746
759
  console.warn("Cast Init Error or already initialized", o);
747
760
  }
748
761
  };
749
- t.cast && t.cast.framework ? n() : t.__onGCastApiAvailable = (o) => {
750
- o && n();
762
+ t.cast && t.cast.framework ? i() : t.__onGCastApiAvailable = (o) => {
763
+ o && i();
751
764
  };
752
765
  }
753
766
  requestCast() {
@@ -756,8 +769,8 @@ class Ni {
756
769
  try {
757
770
  this.castInitialized || this.initCast(), t.cast.framework.CastContext.getInstance().requestSession().then(() => {
758
771
  this.loadMediaToCast();
759
- }).catch((n) => {
760
- n !== "cancel" && this.notify({ type: "error", message: "Cast failed: " + n, duration: 3e3 });
772
+ }).catch((i) => {
773
+ i !== "cancel" && this.notify({ type: "error", message: "Cast failed: " + i, duration: 3e3 });
761
774
  });
762
775
  } catch {
763
776
  this.notify({ type: "warning", message: "Cast not available yet", duration: 3e3 });
@@ -768,14 +781,14 @@ class Ni {
768
781
  loadMediaToCast() {
769
782
  const t = window;
770
783
  try {
771
- const n = t.cast.framework.CastContext.getInstance().getCurrentSession();
772
- if (!n) return;
784
+ const i = t.cast.framework.CastContext.getInstance().getCurrentSession();
785
+ if (!i) return;
773
786
  const o = new t.chrome.cast.media.MediaInfo(this.currentSrc, this.currentSrc.includes(".m3u8") ? "application/x-mpegurl" : "video/mp4"), r = new t.chrome.cast.media.LoadRequest(o);
774
- n.loadMedia(r).then(() => {
787
+ i.loadMedia(r).then(() => {
775
788
  this.notify({ type: "success", message: "Casting...", duration: 3e3 });
776
789
  }).catch((h) => console.error("Cast load error", h));
777
- } catch (n) {
778
- console.error("Failed to load media into Cast session", n);
790
+ } catch (i) {
791
+ console.error("Failed to load media into Cast session", i);
779
792
  }
780
793
  }
781
794
  handleCueChange() {
@@ -798,17 +811,18 @@ class Ni {
798
811
  if (o.status === "idle" || o.status === "error") {
799
812
  this.updateSubtitleTrackState(t, { status: "loading" });
800
813
  try {
801
- let b = await (await this.fetchWithRetry(o.src)).text();
802
- b = this.convertToVTT(b);
803
- const g = new Blob([b], { type: "text/vtt" }), x = URL.createObjectURL(g);
804
- this.addTextTrackInternal(x, o.label, o.srcLang, o.isDefault || !1), this.updateSubtitleTrackState(t, { status: "success" });
814
+ let f = await (await this.fetchWithRetry(o.src)).text();
815
+ f = this.convertToVTT(f);
816
+ const g = new Blob([f], { type: "text/vtt" }), x = URL.createObjectURL(g);
817
+ this.addTextTrackInternal(x, o.label, o.srcLang, !1), this.updateSubtitleTrackState(t, { status: "success" });
805
818
  } catch (u) {
806
819
  this.updateSubtitleTrackState(t, { status: "error" }), console.error("Failed to load subtitle", u);
807
820
  return;
808
821
  }
809
822
  }
810
- const h = Array.from(this.video.textTracks).find((u) => u.label === o.label && u.language === o.srcLang);
811
- if (h) {
823
+ const r = Array.from(this.video.textTracks);
824
+ let h = r.find((u) => u.label === o.label && u.language === o.srcLang);
825
+ if (h || (h = r.find((u) => u.label === o.label)), h) {
812
826
  const u = this.store.get().subtitleSettings;
813
827
  h.mode = u.useNative ? "showing" : "hidden", h.addEventListener("cuechange", this.boundCueChange), this.handleCueChange();
814
828
  }
@@ -818,16 +832,16 @@ class Ni {
818
832
  if (this.store.setState({ subtitleSettings: o }), t.useNative !== void 0) {
819
833
  const r = this.store.get().currentSubtitle;
820
834
  if (r !== -1) {
821
- const u = this.store.get().subtitleTracks[r], b = Array.from(this.video.textTracks).find((g) => g.label === u.label && g.language === u.srcLang);
822
- b && (b.mode = t.useNative ? "showing" : "hidden");
835
+ const u = this.store.get().subtitleTracks[r], f = Array.from(this.video.textTracks).find((g) => g.label === u.label && g.language === u.srcLang);
836
+ f && (f.mode = t.useNative ? "showing" : "hidden");
823
837
  }
824
838
  }
825
839
  }
826
840
  resetSubtitleSettings() {
827
- this.store.setState({ subtitleSettings: Ke }), this.updateSubtitleSettings({ useNative: !1 });
841
+ this.store.setState({ subtitleSettings: tt }), this.updateSubtitleSettings({ useNative: !1 });
828
842
  }
829
843
  setSubtitleOffset(t) {
830
- const n = this.store.get().subtitleOffset, o = t - n;
844
+ const i = this.store.get().subtitleOffset, o = t - i;
831
845
  Math.abs(o) < 1e-3 || (Array.from(this.video.textTracks).forEach((r) => {
832
846
  (r.mode === "showing" || r.mode === "hidden") && r.cues && Array.from(r.cues).forEach((h) => {
833
847
  h.startTime += o, h.endTime += o;
@@ -838,21 +852,22 @@ class Ni {
838
852
  this.currentDownloadController && (this.currentDownloadController.abort(), this.currentDownloadController = null, this.notify({ type: "info", message: "Download cancelled", duration: 2e3 }));
839
853
  }
840
854
  async download(t = {}) {
841
- var h, u, b;
842
- const n = ((h = this.currentSource) == null ? void 0 : h.url) || this.video.src;
843
- if (!n) return;
844
- if (n.includes(".m3u8") || ((u = this.currentSource) == null ? void 0 : u.type) === "hls") {
845
- this.downloadHls(n, t.format || "ts");
855
+ var h, u, f;
856
+ const i = ((h = this.currentSource) == null ? void 0 : h.url) || this.video.src;
857
+ if (!i) return;
858
+ if (i.includes(".m3u8") || ((u = this.currentSource) == null ? void 0 : u.type) === "hls") {
859
+ this.downloadHls(i, t.format || "ts");
846
860
  return;
847
861
  }
848
- if (n.startsWith("blob:")) {
862
+ if (i.startsWith("blob:")) {
849
863
  this.notify({ type: "warning", message: "Stream download not supported in browser.", duration: 4e3 });
850
864
  return;
851
865
  }
852
866
  this.currentDownloadController && this.currentDownloadController.abort(), this.currentDownloadController = new AbortController();
853
867
  const o = this.currentDownloadController.signal, r = this.notify({
854
868
  type: "loading",
855
- message: "Preparing download...",
869
+ message: "Preparing download",
870
+ // Removed ...
856
871
  progress: 0,
857
872
  action: {
858
873
  label: "Cancel",
@@ -860,21 +875,37 @@ class Ni {
860
875
  }
861
876
  });
862
877
  try {
863
- const g = await this.fetchWithRetry(n, 3, void 0, o);
878
+ const g = await this.fetchWithRetry(i, 3, void 0, o);
864
879
  if (!g.body) throw new Error("No body");
865
880
  const x = g.body.getReader(), p = g.headers.get("Content-Length"), w = p ? parseInt(p, 10) : 0;
866
- let f = 0;
867
- const M = [];
881
+ let m = 0;
882
+ const T = [], I = Date.now(), O = [];
868
883
  for (; ; ) {
869
- const { done: O, value: m } = await x.read();
870
- if (O) break;
871
- if (M.push(m), f += m.length, w) {
872
- const V = Math.round(f / w * 100);
884
+ const { done: H, value: k } = await x.read();
885
+ if (H) break;
886
+ if (T.push(k), m += k.length, w) {
887
+ const q = Date.now(), $ = Math.round(m / w * 100);
888
+ for (O.push({ time: q, loaded: m }); O.length > 0 && q - O[0].time > 5e3; )
889
+ O.shift();
890
+ let j = "", Z = 0;
891
+ if (O.length > 1) {
892
+ const P = O[0], s = O[O.length - 1], ie = s.time - P.time, ne = s.loaded - P.loaded;
893
+ ie > 0 && (Z = ne / ie);
894
+ } else {
895
+ const P = q - I;
896
+ P > 0 && (Z = m / P);
897
+ }
898
+ if (Z > 0) {
899
+ const s = (w - m) / Z;
900
+ j = `
901
+ ${this.formatDuration(s)} remaining`;
902
+ }
873
903
  this.notify({
874
904
  id: r,
875
905
  type: "loading",
876
- message: `Downloading... ${V}%`,
877
- progress: V,
906
+ // Cleaned string
907
+ message: `${j}`,
908
+ progress: $,
878
909
  action: {
879
910
  label: "Cancel",
880
911
  onClick: () => this.cancelDownload()
@@ -882,90 +913,112 @@ class Ni {
882
913
  });
883
914
  }
884
915
  }
885
- const z = new Blob(M), j = window.URL.createObjectURL(z), D = document.createElement("a");
886
- D.style.display = "none", D.href = j, D.download = ((b = n.split("/").pop()) == null ? void 0 : b.split("?")[0]) || "video.mp4", document.body.appendChild(D), D.click(), window.URL.revokeObjectURL(j), document.body.removeChild(D), this.notify({ id: r, type: "success", message: "Saved!", duration: 3e3 });
916
+ const Y = new Blob(T), W = window.URL.createObjectURL(Y), b = document.createElement("a");
917
+ b.style.display = "none", b.href = W, b.download = ((f = i.split("/").pop()) == null ? void 0 : f.split("?")[0]) || "video.mp4", document.body.appendChild(b), b.click(), window.URL.revokeObjectURL(W), document.body.removeChild(b), this.notify({ id: r, type: "success", message: "Saved!", duration: 3e3 });
887
918
  } catch {
888
- o.aborted ? this.removeNotification(r) : (this.notify({ id: r, type: "error", message: "Download failed.", duration: 4e3 }), window.open(n, "_blank"));
919
+ o.aborted ? this.removeNotification(r) : (this.notify({ id: r, type: "error", message: "Download failed.", duration: 4e3 }), window.open(i, "_blank"));
889
920
  } finally {
890
921
  this.currentDownloadController = null;
891
922
  }
892
923
  }
893
- async downloadHls(t, n) {
924
+ async downloadHls(t, i) {
894
925
  var h;
895
926
  this.currentDownloadController && this.currentDownloadController.abort(), this.currentDownloadController = new AbortController();
896
927
  const o = this.currentDownloadController.signal, r = this.notify({
897
928
  type: "loading",
898
- message: "Analyzing HLS stream...",
929
+ message: "Analyzing HLS stream",
930
+ // Removed ...
899
931
  progress: 0,
900
932
  action: { label: "Cancel", onClick: () => this.cancelDownload() }
901
933
  });
902
934
  try {
903
- let u = await this.fetchWithRetry(t, 3, void 0, o), b = await u.text(), g = t.substring(0, t.lastIndexOf("/") + 1);
904
- if (b.includes("#EXT-X-STREAM-INF")) {
905
- this.notify({ id: r, type: "loading", message: "Selecting best quality...", progress: 0 });
906
- const m = b.split(`
935
+ let u = await this.fetchWithRetry(t, 3, void 0, o), f = await u.text(), g = t.substring(0, t.lastIndexOf("/") + 1);
936
+ if (f.includes("#EXT-X-STREAM-INF")) {
937
+ this.notify({ id: r, type: "loading", message: "Selecting best quality", progress: 0 });
938
+ const k = f.split(`
907
939
  `);
908
- let V = 0, B = "";
909
- for (let X = 0; X < m.length; X++)
910
- if (m[X].includes("#EXT-X-STREAM-INF")) {
911
- const ee = m[X].match(/BANDWIDTH=(\d+)/);
912
- if (ee) {
913
- const ue = parseInt(ee[1]);
914
- let ce = (h = m[X + 1]) == null ? void 0 : h.trim();
915
- ce && !ce.startsWith("#") && ue > V && (V = ue, B = ce);
940
+ let q = 0, $ = "";
941
+ for (let j = 0; j < k.length; j++)
942
+ if (k[j].includes("#EXT-X-STREAM-INF")) {
943
+ const Z = k[j].match(/BANDWIDTH=(\d+)/);
944
+ if (Z) {
945
+ const P = parseInt(Z[1]);
946
+ let s = (h = k[j + 1]) == null ? void 0 : h.trim();
947
+ s && !s.startsWith("#") && P > q && (q = P, $ = s);
916
948
  }
917
949
  }
918
- B && (B.startsWith("http") || (B = g + B), u = await this.fetchWithRetry(B, 3, void 0, o), b = await u.text(), g = B.substring(0, B.lastIndexOf("/") + 1));
950
+ $ && ($.startsWith("http") || ($ = g + $), u = await this.fetchWithRetry($, 3, void 0, o), f = await u.text(), g = $.substring(0, $.lastIndexOf("/") + 1));
919
951
  }
920
- if (b.includes("#EXT-X-KEY"))
952
+ if (f.includes("#EXT-X-KEY"))
921
953
  throw new Error("Encrypted HLS streams are not supported for download.");
922
- const x = b.split(`
954
+ const x = f.split(`
923
955
  `), p = [];
924
- for (let m of x)
925
- m = m.trim(), m && !m.startsWith("#") && (m.startsWith("http") ? p.push(m) : p.push(g + m));
956
+ for (let k of x)
957
+ k = k.trim(), k && !k.startsWith("#") && (k.startsWith("http") ? p.push(k) : p.push(g + k));
926
958
  if (p.length === 0) throw new Error("No segments found.");
927
- let w = n === "mp4" ? "mp4" : "ts", f = n === "mp4" ? "video/mp4" : "video/mp2t", M = null, z = null, j = [];
959
+ let w = i === "mp4" ? "mp4" : "ts", m = i === "mp4" ? "video/mp4" : "video/mp2t", T = null, I = null, O = [];
928
960
  if ("showSaveFilePicker" in window)
929
961
  try {
930
- M = await window.showSaveFilePicker({
962
+ T = await window.showSaveFilePicker({
931
963
  suggestedName: `video.${w}`,
932
964
  types: [{
933
- description: n === "mp4" ? "MPEG-4 Video" : "MPEG Transport Stream",
934
- accept: { [f]: [`.${w}`] }
965
+ description: i === "mp4" ? "MPEG-4 Video" : "MPEG Transport Stream",
966
+ accept: { [m]: [`.${w}`] }
935
967
  }]
936
- }), z = await M.createWritable();
937
- } catch (m) {
938
- console.warn("File System API cancelled or failed, falling back to memory", m);
968
+ }), I = await T.createWritable();
969
+ } catch (k) {
970
+ if (k.name === "AbortError") {
971
+ this.removeNotification(r), this.notify({ type: "info", message: "Download cancelled", duration: 2e3 }), this.currentDownloadController = null;
972
+ return;
973
+ }
974
+ console.warn("File System API cancelled or failed, falling back to memory", k);
975
+ }
976
+ let W = !1;
977
+ const b = Date.now(), H = [];
978
+ for (let k = 0; k < p.length && !o.aborted; k++) {
979
+ const q = Math.round((k + 1) / p.length * 100), $ = Date.now();
980
+ for (H.push({ time: $, count: k + 1 }); H.length > 0 && $ - H[0].time > 5e3; )
981
+ H.shift();
982
+ let j = "";
983
+ if (H.length > 1) {
984
+ const ie = H[0], ne = H[H.length - 1], le = ne.time - ie.time, ce = ne.count - ie.count;
985
+ if (le > 0 && ce > 0) {
986
+ const Se = le / ce, Ce = (p.length - (k + 1)) * Se;
987
+ j = `
988
+ ${this.formatDuration(Ce)} remaining`;
989
+ }
990
+ } else if (k > 0) {
991
+ const ne = ($ - b) / k, ce = (p.length - k) * ne;
992
+ j = `
993
+ ${this.formatDuration(ce)} remaining`;
939
994
  }
940
- let O = !1;
941
- for (let m = 0; m < p.length && !o.aborted; m++) {
942
- const V = Math.round((m + 1) / p.length * 100);
943
995
  this.notify({
944
996
  id: r,
945
997
  type: "loading",
946
- message: `Downloading segment ${m + 1}/${p.length}...`,
947
- progress: V,
998
+ // Cleaned string
999
+ message: `Downloading segment ${k + 1}/${p.length}${j}`,
1000
+ progress: q,
948
1001
  action: { label: "Cancel", onClick: () => this.cancelDownload() }
949
1002
  });
950
- const X = await (await this.fetchWithRetry(p[m], 3, void 0, o)).arrayBuffer();
951
- m === 0 && new Uint8Array(X.slice(0, 4))[0] === 71 && (O = !0, n === "mp4" && (this.notify({
1003
+ const P = await (await this.fetchWithRetry(p[k], 3, void 0, o)).arrayBuffer();
1004
+ k === 0 && new Uint8Array(P.slice(0, 4))[0] === 71 && (W = !0, i === "mp4" && (this.notify({
952
1005
  type: "info",
953
1006
  message: "Stream is MPEG-TS. Downloading as .ts to prevent corruption.",
954
1007
  duration: 5e3
955
- }), w = "ts", f = "video/mp2t"));
956
- const ee = new Blob([X]);
957
- z ? await z.write(ee) : j.push(ee);
1008
+ }), w = "ts", m = "video/mp2t"));
1009
+ const s = new Blob([P]);
1010
+ I ? await I.write(s) : O.push(s);
958
1011
  }
959
1012
  if (o.aborted)
960
- throw z && await z.abort(), new Error("Aborted");
961
- if (z)
962
- await z.close(), this.notify({ id: r, type: "success", message: "Download complete!", duration: 3e3 });
1013
+ throw I && await I.abort(), new Error("Aborted");
1014
+ if (I)
1015
+ await I.close(), this.notify({ id: r, type: "success", message: "Download complete!", duration: 3e3 });
963
1016
  else {
964
- this.notify({ id: r, type: "loading", message: "Stitching video...", progress: 100 });
965
- const m = new Blob(j, { type: f }), V = window.URL.createObjectURL(m), B = document.createElement("a");
966
- B.style.display = "none", B.href = V;
967
- const X = n === "mp4" && O ? "ts" : w;
968
- B.download = `video.${X}`, document.body.appendChild(B), B.click(), window.URL.revokeObjectURL(V), document.body.removeChild(B), this.notify({ id: r, type: "success", message: "Saved!", duration: 3e3 });
1017
+ this.notify({ id: r, type: "loading", message: "Stitching video", progress: 100 });
1018
+ const k = new Blob(O, { type: m }), q = window.URL.createObjectURL(k), $ = document.createElement("a");
1019
+ $.style.display = "none", $.href = q;
1020
+ const j = i === "mp4" && W ? "ts" : w;
1021
+ $.download = `video.${j}`, document.body.appendChild($), $.click(), window.URL.revokeObjectURL(q), document.body.removeChild($), this.notify({ id: r, type: "success", message: "Saved!", duration: 3e3 });
969
1022
  }
970
1023
  } catch (u) {
971
1024
  o.aborted ? this.removeNotification(r) : this.notify({ id: r, type: "error", message: `Download failed: ${u.message}`, duration: 4e3 });
@@ -974,16 +1027,16 @@ class Ni {
974
1027
  }
975
1028
  }
976
1029
  notify(t) {
977
- const n = t.id || Math.random().toString(36).substr(2, 9), o = { ...t, id: n };
978
- return this.store.setState((r) => r.notifications.find((u) => u.id === n) ? { notifications: r.notifications.map((u) => u.id === n ? o : u) } : { notifications: [...r.notifications, o] }), t.duration && setTimeout(() => this.removeNotification(n), t.duration), n;
1030
+ const i = t.id || Math.random().toString(36).substr(2, 9), o = { ...t, id: i };
1031
+ return this.store.setState((r) => r.notifications.find((u) => u.id === i) ? { notifications: r.notifications.map((u) => u.id === i ? o : u) } : { notifications: [...r.notifications, o] }), t.duration && setTimeout(() => this.removeNotification(i), t.duration), i;
979
1032
  }
980
1033
  removeNotification(t) {
981
- const n = this.store.get().notifications;
982
- this.store.setState({ notifications: n.filter((o) => o.id !== t) });
1034
+ const i = this.store.get().notifications;
1035
+ this.store.setState({ notifications: i.filter((o) => o.id !== t) });
983
1036
  }
984
1037
  setAppearance(t) {
985
- this.store.setState((n) => ({
986
- ...n,
1038
+ this.store.setState((i) => ({
1039
+ ...i,
987
1040
  ...t
988
1041
  }));
989
1042
  }
@@ -991,13 +1044,13 @@ class Ni {
991
1044
  this.retryTimer && clearTimeout(this.retryTimer), this.resizeObserver && (this.resizeObserver.disconnect(), this.resizeObserver = null), this.currentDownloadController && this.currentDownloadController.abort(), this.store.get().isWebFullscreen && typeof document < "u" && (document.body.style.overflow = ""), document.removeEventListener("fullscreenchange", this.boundFullscreenChange), this.video.pause(), this.video.src = "";
992
1045
  const t = this.video.getElementsByTagName("track");
993
1046
  for (; t.length > 0; ) t[0].remove();
994
- this.emit("destroy"), this.events.destroy(), this.store.destroy(), this.plugins.forEach((n) => n.destroy && n.destroy()), this.plugins.clear(), this.video.remove(), this.audioEngine.destroy();
1047
+ this.emit("destroy"), this.events.destroy(), this.store.destroy(), this.plugins.forEach((i) => i.destroy && i.destroy()), this.plugins.clear(), this.video.remove(), this.audioEngine.destroy();
995
1048
  }
996
1049
  }
997
- const qe = (i, t = 200) => {
998
- const [n, o] = C(i), [r, h] = C(!1);
999
- return q(() => {
1000
- if (i)
1050
+ const Ke = (n, t = 200) => {
1051
+ const [i, o] = N(n), [r, h] = N(!1);
1052
+ return Q(() => {
1053
+ if (n)
1001
1054
  o(!0), requestAnimationFrame(() => {
1002
1055
  requestAnimationFrame(() => {
1003
1056
  h(!0);
@@ -1010,11 +1063,11 @@ const qe = (i, t = 200) => {
1010
1063
  }, t);
1011
1064
  return () => clearTimeout(u);
1012
1065
  }
1013
- }, [i, t]), { isMounted: n, isVisible: r };
1066
+ }, [n, t]), { isMounted: i, isVisible: r };
1014
1067
  }, y = ({
1015
- className: i,
1068
+ className: n,
1016
1069
  children: t,
1017
- fill: n = "none",
1070
+ fill: i = "none",
1018
1071
  strokeWidth: o = 2,
1019
1072
  viewBox: r = "0 0 24 24"
1020
1073
  }) => /* @__PURE__ */ e(
@@ -1022,78 +1075,78 @@ const qe = (i, t = 200) => {
1022
1075
  {
1023
1076
  xmlns: "http://www.w3.org/2000/svg",
1024
1077
  viewBox: r,
1025
- fill: n,
1078
+ fill: i,
1026
1079
  stroke: "currentColor",
1027
1080
  strokeWidth: o,
1028
1081
  strokeLinecap: "round",
1029
1082
  strokeLinejoin: "round",
1030
- className: i,
1083
+ className: n,
1031
1084
  children: t
1032
1085
  }
1033
- ), $t = ({ className: i }) => /* @__PURE__ */ e(y, { className: i, children: /* @__PURE__ */ e("polygon", { points: "5 3 19 12 5 21 5 3" }) }), Et = ({ className: i }) => /* @__PURE__ */ d(y, { className: i, children: [
1086
+ ), Et = ({ className: n }) => /* @__PURE__ */ e(y, { className: n, children: /* @__PURE__ */ e("polygon", { points: "5 3 19 12 5 21 5 3" }) }), Ft = ({ className: n }) => /* @__PURE__ */ d(y, { className: n, children: [
1034
1087
  /* @__PURE__ */ e("rect", { width: "4", height: "16", x: "6", y: "4", rx: "1" }),
1035
1088
  /* @__PURE__ */ e("rect", { width: "4", height: "16", x: "14", y: "4", rx: "1" })
1036
- ] }), Mi = ({ className: i }) => /* @__PURE__ */ d(y, { className: i, children: [
1089
+ ] }), Mi = ({ className: n }) => /* @__PURE__ */ d(y, { className: n, children: [
1037
1090
  /* @__PURE__ */ e("polygon", { points: "11 5 6 9 2 9 2 15 6 15 11 19 11 5" }),
1038
1091
  /* @__PURE__ */ e("path", { d: "M19.07 4.93a10 10 0 0 1 0 14.14" }),
1039
1092
  /* @__PURE__ */ e("path", { d: "M15.54 8.46a5 5 0 0 1 0 7.07" })
1040
- ] }), Ti = ({ className: i }) => /* @__PURE__ */ d(y, { className: i, children: [
1093
+ ] }), Ti = ({ className: n }) => /* @__PURE__ */ d(y, { className: n, children: [
1041
1094
  /* @__PURE__ */ e("polygon", { points: "11 5 6 9 2 9 2 15 6 15 11 19 11 5" }),
1042
1095
  /* @__PURE__ */ e("path", { d: "M15.54 8.46a5 5 0 0 1 0 7.07" })
1043
- ] }), zi = ({ className: i }) => /* @__PURE__ */ d(y, { className: i, children: [
1096
+ ] }), zi = ({ className: n }) => /* @__PURE__ */ d(y, { className: n, children: [
1044
1097
  /* @__PURE__ */ e("polygon", { points: "11 5 6 9 2 9 2 15 6 15 11 19 11 5" }),
1045
1098
  /* @__PURE__ */ e("line", { x1: "23", x2: "17", y1: "9", y2: "15" }),
1046
1099
  /* @__PURE__ */ e("line", { x1: "17", x2: "23", y1: "9", y2: "15" })
1047
- ] }), Ii = ({ className: i }) => /* @__PURE__ */ d(y, { className: i, children: [
1100
+ ] }), Ii = ({ className: n }) => /* @__PURE__ */ d(y, { className: n, children: [
1048
1101
  /* @__PURE__ */ e("path", { d: "M8 3H5a2 2 0 0 0-2 2v3" }),
1049
1102
  /* @__PURE__ */ e("path", { d: "M21 8V5a2 2 0 0 0-2-2h-3" }),
1050
1103
  /* @__PURE__ */ e("path", { d: "M3 16v3a2 2 0 0 0 2 2h3" }),
1051
1104
  /* @__PURE__ */ e("path", { d: "M16 21h3a2 2 0 0 0 2-2v-3" })
1052
- ] }), Ri = ({ className: i }) => /* @__PURE__ */ d(y, { className: i, children: [
1105
+ ] }), Ri = ({ className: n }) => /* @__PURE__ */ d(y, { className: n, children: [
1053
1106
  /* @__PURE__ */ e("path", { d: "M8 3v3a2 2 0 0 1-2 2H3" }),
1054
1107
  /* @__PURE__ */ e("path", { d: "M21 8h-3a2 2 0 0 1-2-2V3" }),
1055
1108
  /* @__PURE__ */ e("path", { d: "M3 16h3a2 2 0 0 1 2 2v3" }),
1056
1109
  /* @__PURE__ */ e("path", { d: "M16 21v-3a2 2 0 0 1 2-2h3" })
1057
- ] }), Pi = ({ className: i }) => /* @__PURE__ */ d(y, { className: i, children: [
1110
+ ] }), Pi = ({ className: n }) => /* @__PURE__ */ d(y, { className: n, children: [
1058
1111
  /* @__PURE__ */ e("path", { d: "M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.09a2 2 0 0 1-1-1.74v-.47a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z" }),
1059
1112
  /* @__PURE__ */ e("circle", { cx: "12", cy: "12", r: "3" })
1060
- ] }), Pe = ({ className: i }) => /* @__PURE__ */ e(y, { className: i, children: /* @__PURE__ */ e("path", { d: "M20 6 9 17l-5-5" }) }), Li = ({ className: i }) => /* @__PURE__ */ d(y, { className: i, children: [
1113
+ ] }), Be = ({ className: n }) => /* @__PURE__ */ e(y, { className: n, children: /* @__PURE__ */ e("path", { d: "M20 6 9 17l-5-5" }) }), Li = ({ className: n }) => /* @__PURE__ */ d(y, { className: n, children: [
1061
1114
  /* @__PURE__ */ e("path", { d: "M21 9V6a2 2 0 0 0-2-2H4a2 2 0 0 0-2 2v10c0 1.1.9 2 2 2h4" }),
1062
1115
  /* @__PURE__ */ e("rect", { x: "12", y: "13", width: "10", height: "7", rx: "2" })
1063
- ] }), $i = ({ className: i }) => /* @__PURE__ */ d(y, { className: i, children: [
1116
+ ] }), $i = ({ className: n }) => /* @__PURE__ */ d(y, { className: n, children: [
1064
1117
  /* @__PURE__ */ e("rect", { width: "18", height: "14", x: "3", y: "5", rx: "2", ry: "2" }),
1065
1118
  /* @__PURE__ */ e("path", { d: "M7 15h4" }),
1066
1119
  /* @__PURE__ */ e("path", { d: "M15 15h2" }),
1067
1120
  /* @__PURE__ */ e("path", { d: "M7 11h2" }),
1068
1121
  /* @__PURE__ */ e("path", { d: "M13 11h4" })
1069
- ] }), Qe = ({ className: i }) => /* @__PURE__ */ d(y, { className: i, children: [
1122
+ ] }), Ze = ({ className: n }) => /* @__PURE__ */ d(y, { className: n, children: [
1070
1123
  /* @__PURE__ */ e("path", { d: "M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4" }),
1071
1124
  /* @__PURE__ */ e("polyline", { points: "7 10 12 15 17 10" }),
1072
1125
  /* @__PURE__ */ e("line", { x1: "12", x2: "12", y1: "15", y2: "3" })
1073
- ] }), Ei = ({ className: i }) => /* @__PURE__ */ d(y, { className: i, children: [
1126
+ ] }), Ei = ({ className: n }) => /* @__PURE__ */ d(y, { className: n, children: [
1074
1127
  /* @__PURE__ */ e("path", { d: "M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4" }),
1075
1128
  /* @__PURE__ */ e("polyline", { points: "17 8 12 3 7 8" }),
1076
1129
  /* @__PURE__ */ e("line", { x1: "12", x2: "12", y1: "3", y2: "15" })
1077
- ] }), Fi = ({ className: i }) => /* @__PURE__ */ d(y, { className: i, children: [
1130
+ ] }), Fi = ({ className: n }) => /* @__PURE__ */ d(y, { className: n, children: [
1078
1131
  /* @__PURE__ */ e("path", { d: "m12 19-7-7 7-7" }),
1079
1132
  /* @__PURE__ */ e("path", { d: "M19 12H5" })
1080
- ] }), Ie = ({ className: i }) => /* @__PURE__ */ e(y, { className: i, children: /* @__PURE__ */ e("path", { d: "M21 12a9 9 0 1 1-6.219-8.56" }) }), Ai = ({ className: i }) => /* @__PURE__ */ d(y, { className: i, children: [
1133
+ ] }), Fe = ({ className: n }) => /* @__PURE__ */ e(y, { className: n, children: /* @__PURE__ */ e("path", { d: "M21 12a9 9 0 1 1-6.219-8.56" }) }), Ai = ({ className: n }) => /* @__PURE__ */ d(y, { className: n, children: [
1081
1134
  /* @__PURE__ */ e("path", { d: "M2 16.1A5 5 0 0 1 5.9 20" }),
1082
1135
  /* @__PURE__ */ e("path", { d: "M2 12.05A9 9 0 0 1 9.95 20" }),
1083
1136
  /* @__PURE__ */ e("path", { d: "M2 8V6a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2h-6" }),
1084
1137
  /* @__PURE__ */ e("line", { x1: "2", x2: "2.01", y1: "20", y2: "20" })
1085
- ] }), Vi = ({ className: i }) => /* @__PURE__ */ d(y, { className: i, children: [
1138
+ ] }), Bi = ({ className: n }) => /* @__PURE__ */ d(y, { className: n, children: [
1086
1139
  /* @__PURE__ */ e("path", { d: "M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2" }),
1087
1140
  /* @__PURE__ */ e("circle", { cx: "9", cy: "7", r: "4" }),
1088
1141
  /* @__PURE__ */ e("path", { d: "M22 21v-2a4 4 0 0 0-3-3.87" }),
1089
1142
  /* @__PURE__ */ e("path", { d: "M16 3.13a4 4 0 0 1 0 7.75" })
1090
- ] }), Bi = ({ className: i }) => /* @__PURE__ */ d(y, { className: i, children: [
1143
+ ] }), Vi = ({ className: n }) => /* @__PURE__ */ d(y, { className: n, children: [
1091
1144
  /* @__PURE__ */ e("circle", { cx: "12", cy: "12", r: "10" }),
1092
1145
  /* @__PURE__ */ e("polyline", { points: "12 6 12 12 16 14" })
1093
- ] }), Di = ({ className: i }) => /* @__PURE__ */ e(y, { className: i, children: /* @__PURE__ */ e("path", { d: "M5 12h14" }) }), Oi = ({ className: i }) => /* @__PURE__ */ d(y, { className: i, children: [
1146
+ ] }), Di = ({ className: n }) => /* @__PURE__ */ e(y, { className: n, children: /* @__PURE__ */ e("path", { d: "M5 12h14" }) }), Oi = ({ className: n }) => /* @__PURE__ */ d(y, { className: n, children: [
1094
1147
  /* @__PURE__ */ e("path", { d: "M5 12h14" }),
1095
1148
  /* @__PURE__ */ e("path", { d: "M12 5v14" })
1096
- ] }), Wt = ({ className: i }) => /* @__PURE__ */ d(y, { className: i, children: [
1149
+ ] }), jt = ({ className: n }) => /* @__PURE__ */ d(y, { className: n, children: [
1097
1150
  /* @__PURE__ */ e("path", { d: "M4 21v-7" }),
1098
1151
  /* @__PURE__ */ e("path", { d: "M4 10V3" }),
1099
1152
  /* @__PURE__ */ e("path", { d: "M12 21v-9" }),
@@ -1103,134 +1156,134 @@ const qe = (i, t = 200) => {
1103
1156
  /* @__PURE__ */ e("path", { d: "M1 14h6" }),
1104
1157
  /* @__PURE__ */ e("path", { d: "M9 8h6" }),
1105
1158
  /* @__PURE__ */ e("path", { d: "M17 16h6" })
1106
- ] }), Hi = ({ className: i }) => /* @__PURE__ */ d(y, { className: i, children: [
1159
+ ] }), Hi = ({ className: n }) => /* @__PURE__ */ d(y, { className: n, children: [
1107
1160
  /* @__PURE__ */ e("polyline", { points: "4 7 4 4 20 4 20 7" }),
1108
1161
  /* @__PURE__ */ e("line", { x1: "9", x2: "15", y1: "20", y2: "20" }),
1109
1162
  /* @__PURE__ */ e("line", { x1: "12", x2: "12", y1: "4", y2: "20" })
1110
- ] }), jt = ({ className: i }) => /* @__PURE__ */ d(y, { className: i, children: [
1163
+ ] }), Ut = ({ className: n }) => /* @__PURE__ */ d(y, { className: n, children: [
1111
1164
  /* @__PURE__ */ e("circle", { cx: "13.5", cy: "6.5", r: ".5", fill: "currentColor" }),
1112
1165
  /* @__PURE__ */ e("circle", { cx: "17.5", cy: "10.5", r: ".5", fill: "currentColor" }),
1113
1166
  /* @__PURE__ */ e("circle", { cx: "8.5", cy: "7.5", r: ".5", fill: "currentColor" }),
1114
1167
  /* @__PURE__ */ e("circle", { cx: "6.5", cy: "12.5", r: ".5", fill: "currentColor" }),
1115
1168
  /* @__PURE__ */ e("path", { d: "M12 2C6.5 2 2 6.5 2 12s4.5 10 10 10c.926 0 1.648-.746 1.648-1.688 0-.437-.18-.835-.437-1.125-.29-.289-.438-.652-.438-1.125a1.64 1.64 0 0 1 1.668-1.668h1.996c3.051 0 5.555-2.503 5.555-5.554C21.965 6.012 17.461 2 12 2z" })
1116
- ] }), Wi = ({ className: i }) => /* @__PURE__ */ d(y, { className: i, children: [
1169
+ ] }), Wi = ({ className: n }) => /* @__PURE__ */ d(y, { className: n, children: [
1117
1170
  /* @__PURE__ */ e("path", { d: "M2 12s3-7 10-7 10 7 10 7-3 7-10 7-10-7-10-7Z" }),
1118
1171
  /* @__PURE__ */ e("circle", { cx: "12", cy: "12", r: "3" })
1119
- ] }), ji = ({ className: i }) => /* @__PURE__ */ d(y, { className: i, children: [
1172
+ ] }), ji = ({ className: n }) => /* @__PURE__ */ d(y, { className: n, children: [
1120
1173
  /* @__PURE__ */ e("polyline", { points: "8 18 12 22 16 18" }),
1121
1174
  /* @__PURE__ */ e("polyline", { points: "8 6 12 2 16 6" }),
1122
1175
  /* @__PURE__ */ e("line", { x1: "12", x2: "12", y1: "2", y2: "22" })
1123
- ] }), Ui = ({ className: i }) => /* @__PURE__ */ d(y, { className: i, children: [
1176
+ ] }), Ui = ({ className: n }) => /* @__PURE__ */ d(y, { className: n, children: [
1124
1177
  /* @__PURE__ */ e("path", { d: "M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8" }),
1125
1178
  /* @__PURE__ */ e("path", { d: "M3 3v5h5" })
1126
- ] }), Gi = ({ className: i }) => /* @__PURE__ */ d(y, { className: i, children: [
1179
+ ] }), Gi = ({ className: n }) => /* @__PURE__ */ d(y, { className: n, children: [
1127
1180
  /* @__PURE__ */ e("path", { d: "M6 4h8a4 4 0 0 1 4 4 4 4 0 0 1-4 4H6z" }),
1128
1181
  /* @__PURE__ */ e("path", { d: "M6 12h9a4 4 0 0 1 4 4 4 4 0 0 1-4 4H6z" })
1129
- ] }), _i = ({ className: i }) => /* @__PURE__ */ d(y, { className: i, children: [
1182
+ ] }), _i = ({ className: n }) => /* @__PURE__ */ d(y, { className: n, children: [
1130
1183
  /* @__PURE__ */ e("path", { d: "m3 17 4-10 4 10" }),
1131
1184
  /* @__PURE__ */ e("path", { d: "M4 13h6" }),
1132
1185
  /* @__PURE__ */ e("path", { d: "M15 12h4.5a2.5 2.5 0 0 1 0 5H15V7h4a2.5 2.5 0 0 1 0 5h-4" })
1133
- ] }), qi = ({ className: i }) => /* @__PURE__ */ e(y, { className: i, children: /* @__PURE__ */ e("path", { d: "M12 22a7 7 0 0 0 7-7c0-2-1-3.9-3-5.5s-3.5-4-4-6.5c-.5 2.5-2 4.9-4 6.5C6 11.1 5 13 5 15a7 7 0 0 0 7 7z" }) }), Xi = ({ className: i }) => /* @__PURE__ */ d(y, { className: i, children: [
1186
+ ] }), qi = ({ className: n }) => /* @__PURE__ */ e(y, { className: n, children: /* @__PURE__ */ e("path", { d: "M12 22a7 7 0 0 0 7-7c0-2-1-3.9-3-5.5s-3.5-4-4-6.5c-.5 2.5-2 4.9-4 6.5C6 11.1 5 13 5 15a7 7 0 0 0 7 7z" }) }), Xi = ({ className: n }) => /* @__PURE__ */ d(y, { className: n, children: [
1134
1187
  /* @__PURE__ */ e("path", { d: "M14.5 4h-5L7 7H4a2 2 0 0 0-2 2v9a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V9a2 2 0 0 0-2-2h-3l-2.5-3z" }),
1135
1188
  /* @__PURE__ */ e("circle", { cx: "12", cy: "13", r: "3" })
1136
- ] }), Qi = ({ className: i }) => /* @__PURE__ */ d(y, { className: i, children: [
1189
+ ] }), Qi = ({ className: n }) => /* @__PURE__ */ d(y, { className: n, children: [
1137
1190
  /* @__PURE__ */ e("rect", { width: "18", height: "11", x: "3", y: "11", rx: "2", ry: "2" }),
1138
1191
  /* @__PURE__ */ e("path", { d: "M7 11V7a5 5 0 0 1 10 0v4" })
1139
- ] }), Ji = ({ className: i }) => /* @__PURE__ */ d(y, { className: i, children: [
1192
+ ] }), Ji = ({ className: n }) => /* @__PURE__ */ d(y, { className: n, children: [
1140
1193
  /* @__PURE__ */ e("rect", { width: "18", height: "11", x: "3", y: "11", rx: "2", ry: "2" }),
1141
1194
  /* @__PURE__ */ e("path", { d: "M7 11V7a5 5 0 0 1 9.9-1" })
1142
- ] }), Ki = ({ className: i }) => /* @__PURE__ */ d(y, { className: i, children: [
1195
+ ] }), Ki = ({ className: n }) => /* @__PURE__ */ d(y, { className: n, children: [
1143
1196
  /* @__PURE__ */ e("rect", { width: "20", height: "14", x: "2", y: "3", rx: "2" }),
1144
1197
  /* @__PURE__ */ e("line", { x1: "8", x2: "16", y1: "21", y2: "21" }),
1145
1198
  /* @__PURE__ */ e("line", { x1: "12", x2: "12", y1: "17", y2: "21" })
1146
- ] }), Yi = ({ className: i }) => /* @__PURE__ */ d(y, { className: i, children: [
1199
+ ] }), Yi = ({ className: n }) => /* @__PURE__ */ d(y, { className: n, children: [
1147
1200
  /* @__PURE__ */ e("polygon", { points: "13 19 22 12 13 5 13 19" }),
1148
1201
  /* @__PURE__ */ e("polygon", { points: "2 19 11 12 2 5 2 19" })
1149
- ] }), Ut = ({ className: i }) => /* @__PURE__ */ d(y, { className: i, children: [
1202
+ ] }), Gt = ({ className: n }) => /* @__PURE__ */ d(y, { className: n, children: [
1150
1203
  /* @__PURE__ */ e("path", { d: "M18 6 6 18" }),
1151
1204
  /* @__PURE__ */ e("path", { d: "m6 6 12 12" })
1152
- ] }), Zi = ({ className: i }) => /* @__PURE__ */ d(y, { className: i, children: [
1205
+ ] }), Zi = ({ className: n }) => /* @__PURE__ */ d(y, { className: n, children: [
1153
1206
  /* @__PURE__ */ e("circle", { cx: "12", cy: "12", r: "10" }),
1154
1207
  /* @__PURE__ */ e("path", { d: "M12 16v-4" }),
1155
1208
  /* @__PURE__ */ e("path", { d: "M12 8h.01" })
1156
- ] }), en = ({ className: i }) => /* @__PURE__ */ d(y, { className: i, children: [
1209
+ ] }), en = ({ className: n }) => /* @__PURE__ */ d(y, { className: n, children: [
1157
1210
  /* @__PURE__ */ e("rect", { width: "20", height: "8", x: "2", y: "2", rx: "2", ry: "2" }),
1158
1211
  /* @__PURE__ */ e("rect", { width: "20", height: "8", x: "2", y: "14", rx: "2", ry: "2" }),
1159
1212
  /* @__PURE__ */ e("line", { x1: "6", x2: "6.01", y1: "6", y2: "6" }),
1160
1213
  /* @__PURE__ */ e("line", { x1: "6", x2: "6.01", y1: "18", y2: "18" })
1161
- ] }), tn = ({ className: i }) => /* @__PURE__ */ d(y, { className: i, children: [
1214
+ ] }), tn = ({ className: n }) => /* @__PURE__ */ d(y, { className: n, children: [
1162
1215
  /* @__PURE__ */ e("path", { d: "M6 2v14a2 2 0 0 0 2 2h14" }),
1163
1216
  /* @__PURE__ */ e("path", { d: "M18 22V8a2 2 0 0 0-2-2H2" })
1164
- ] }), nn = ({ className: i }) => /* @__PURE__ */ d(y, { className: i, children: [
1217
+ ] }), nn = ({ className: n }) => /* @__PURE__ */ d(y, { className: n, children: [
1165
1218
  /* @__PURE__ */ e("rect", { width: "16", height: "20", x: "4", y: "2", rx: "2" }),
1166
1219
  /* @__PURE__ */ e("circle", { cx: "12", cy: "14", r: "4" }),
1167
1220
  /* @__PURE__ */ e("line", { x1: "12", x2: "12.01", y1: "6", y2: "6" })
1168
- ] }), sn = ({ className: i }) => /* @__PURE__ */ d(y, { className: i, children: [
1221
+ ] }), sn = ({ className: n }) => /* @__PURE__ */ d(y, { className: n, children: [
1169
1222
  /* @__PURE__ */ e("path", { d: "m12 14 4-4" }),
1170
1223
  /* @__PURE__ */ e("path", { d: "M3.34 19a10 10 0 1 1 17.32 0" })
1171
- ] }), on = ({ className: i }) => /* @__PURE__ */ d(y, { className: i, children: [
1224
+ ] }), on = ({ className: n }) => /* @__PURE__ */ d(y, { className: n, children: [
1172
1225
  /* @__PURE__ */ e("path", { d: "M9 18V5l12-2v13" }),
1173
1226
  /* @__PURE__ */ e("circle", { cx: "6", cy: "18", r: "3" }),
1174
1227
  /* @__PURE__ */ e("circle", { cx: "18", cy: "16", r: "3" })
1175
- ] }), rn = ({ className: i }) => /* @__PURE__ */ d(y, { className: i, children: [
1228
+ ] }), rn = ({ className: n }) => /* @__PURE__ */ d(y, { className: n, children: [
1176
1229
  /* @__PURE__ */ e("path", { d: "M5 12.55a11 11 0 0 1 14.08 0" }),
1177
1230
  /* @__PURE__ */ e("path", { d: "M1.42 9a16 16 0 0 1 21.16 0" }),
1178
1231
  /* @__PURE__ */ e("path", { d: "M8.53 16.11a6 6 0 0 1 6.95 0" }),
1179
1232
  /* @__PURE__ */ e("line", { x1: "12", x2: "12.01", y1: "20", y2: "20" })
1180
- ] }), Je = ({ className: i }) => /* @__PURE__ */ d(y, { className: i, children: [
1233
+ ] }), et = ({ className: n }) => /* @__PURE__ */ d(y, { className: n, children: [
1181
1234
  /* @__PURE__ */ e("circle", { cx: "12", cy: "12", r: "10" }),
1182
1235
  /* @__PURE__ */ e("line", { x1: "12", x2: "12", y1: "8", y2: "12" }),
1183
1236
  /* @__PURE__ */ e("line", { x1: "12", x2: "12.01", y1: "16", y2: "16" })
1184
- ] }), an = ({ className: i }) => /* @__PURE__ */ d(y, { className: i, children: [
1237
+ ] }), an = ({ className: n }) => /* @__PURE__ */ d(y, { className: n, children: [
1185
1238
  /* @__PURE__ */ e("path", { d: "M2 20h.01" }),
1186
1239
  /* @__PURE__ */ e("path", { d: "M7 20v-4" }),
1187
1240
  /* @__PURE__ */ e("path", { d: "M12 20v-8" }),
1188
1241
  /* @__PURE__ */ e("path", { d: "M17 20V8" }),
1189
1242
  /* @__PURE__ */ e("path", { d: "M22 20V4" })
1190
- ] }), ln = ({ className: i }) => /* @__PURE__ */ d(y, { className: i, children: [
1243
+ ] }), ln = ({ className: n }) => /* @__PURE__ */ d(y, { className: n, children: [
1191
1244
  /* @__PURE__ */ e("path", { d: "M21 7v10a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V7a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z" }),
1192
1245
  /* @__PURE__ */ e("path", { d: "M16 2v4" }),
1193
1246
  /* @__PURE__ */ e("path", { d: "M8 2v4" }),
1194
1247
  /* @__PURE__ */ e("path", { d: "M3 12h18" })
1195
- ] }), cn = ({ className: i }) => /* @__PURE__ */ d(y, { className: i, children: [
1248
+ ] }), cn = ({ className: n }) => /* @__PURE__ */ d(y, { className: n, children: [
1196
1249
  /* @__PURE__ */ e("circle", { cx: "11", cy: "11", r: "8" }),
1197
1250
  /* @__PURE__ */ e("path", { d: "m21 21-4.3-4.3" })
1198
- ] }), Gt = ({ className: i }) => /* @__PURE__ */ d(y, { className: i, children: [
1251
+ ] }), _t = ({ className: n }) => /* @__PURE__ */ d(y, { className: n, children: [
1199
1252
  /* @__PURE__ */ e("path", { d: "M14.5 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7.5L14.5 2z" }),
1200
1253
  /* @__PURE__ */ e("polyline", { points: "14 2 14 8 20 8" }),
1201
1254
  /* @__PURE__ */ e("path", { d: "m9 15 2 2 4-4" })
1202
- ] }), dn = ({ className: i }) => /* @__PURE__ */ d(y, { className: i, children: [
1255
+ ] }), dn = ({ className: n }) => /* @__PURE__ */ d(y, { className: n, children: [
1203
1256
  /* @__PURE__ */ e("path", { d: "M14.5 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7.5L14.5 2z" }),
1204
1257
  /* @__PURE__ */ e("polyline", { points: "14 2 14 8 20 8" }),
1205
1258
  /* @__PURE__ */ e("path", { d: "M12 18h.01" }),
1206
1259
  /* @__PURE__ */ e("path", { d: "M12 12v4" })
1207
- ] }), Ft = ({ className: i }) => /* @__PURE__ */ d("div", { className: `relative flex items-center justify-center ${i}`, children: [
1260
+ ] }), At = ({ className: n }) => /* @__PURE__ */ d("div", { className: `relative flex items-center justify-center ${n}`, children: [
1208
1261
  /* @__PURE__ */ d(y, { className: "w-full h-full", children: [
1209
1262
  /* @__PURE__ */ e("path", { d: "M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8" }),
1210
1263
  /* @__PURE__ */ e("path", { d: "M3 3v5h5" })
1211
1264
  ] }),
1212
1265
  /* @__PURE__ */ e("span", { className: "absolute inset-0 flex items-center justify-center text-[32%] font-bold select-none mt-[1px]", children: "10" })
1213
- ] }), At = ({ className: i }) => /* @__PURE__ */ d("div", { className: `relative flex items-center justify-center ${i}`, children: [
1266
+ ] }), Bt = ({ className: n }) => /* @__PURE__ */ d("div", { className: `relative flex items-center justify-center ${n}`, children: [
1214
1267
  /* @__PURE__ */ d(y, { className: "w-full h-full", children: [
1215
1268
  /* @__PURE__ */ e("path", { d: "M21 12a9 9 0 1 1-9-9 9.75 9.75 0 0 1 6.74 2.74L21 8" }),
1216
1269
  /* @__PURE__ */ e("path", { d: "M21 3v5h-5" })
1217
1270
  ] }),
1218
1271
  /* @__PURE__ */ e("span", { className: "absolute inset-0 flex items-center justify-center text-[32%] font-bold select-none mt-[1px]", children: "10" })
1219
1272
  ] }), un = ({
1220
- notifications: i
1221
- }) => /* @__PURE__ */ e("div", { className: "absolute top-4 left-4 z-[100] flex flex-col gap-2 pointer-events-none font-sans max-w-[85%] md:max-w-[280px]", children: i.map((t) => {
1222
- const n = typeof t.progress == "number";
1273
+ notifications: n
1274
+ }) => /* @__PURE__ */ e("div", { className: "absolute top-4 left-4 z-[100] flex flex-col gap-2 pointer-events-none font-sans max-w-[85%] md:max-w-[280px]", children: n.map((t) => {
1275
+ const i = typeof t.progress == "number";
1223
1276
  return /* @__PURE__ */ e(
1224
1277
  "div",
1225
1278
  {
1226
1279
  className: `
1227
1280
  relative overflow-hidden bg-zinc-950/80 backdrop-blur-xl border border-white/10 text-zinc-100 shadow-2xl rounded-lg pointer-events-auto
1228
1281
  animate-in slide-in-from-left-4 fade-in duration-300
1229
- ${n ? "w-64" : "w-auto max-w-full px-3 py-2.5"}
1282
+ ${i ? "w-64" : "w-auto max-w-full px-3 py-2.5"}
1230
1283
  `,
1231
1284
  style: { borderRadius: "var(--radius)" },
1232
- children: n ? /* @__PURE__ */ e("div", { className: "p-3", children: /* @__PURE__ */ d("div", { className: "flex items-start gap-3", children: [
1233
- /* @__PURE__ */ e("div", { className: "w-7 h-7 rounded-full bg-white/10 flex items-center justify-center text-[var(--accent)] shrink-0", children: /* @__PURE__ */ e(Qe, { className: "w-3.5 h-3.5" }) }),
1285
+ children: i ? /* @__PURE__ */ e("div", { className: "p-3", children: /* @__PURE__ */ d("div", { className: "flex items-start gap-3", children: [
1286
+ /* @__PURE__ */ e("div", { className: "w-7 h-7 rounded-full bg-white/10 flex items-center justify-center text-[var(--accent)] shrink-0", children: /* @__PURE__ */ e(Ze, { className: "w-3.5 h-3.5" }) }),
1234
1287
  /* @__PURE__ */ d("div", { className: "flex-1 min-w-0 pt-0.5", children: [
1235
1288
  /* @__PURE__ */ d("div", { className: "flex justify-between items-baseline mb-1", children: [
1236
1289
  /* @__PURE__ */ e("span", { className: "text-xs font-bold text-white tracking-tight", children: "Downloading" }),
@@ -1239,7 +1292,7 @@ const qe = (i, t = 200) => {
1239
1292
  "%"
1240
1293
  ] })
1241
1294
  ] }),
1242
- /* @__PURE__ */ e("p", { className: "text-[10px] text-zinc-400 truncate mb-2 leading-tight", children: t.message.replace(/Downloading\.\.\. \d+%/, "").trim() || "Processing..." }),
1295
+ /* @__PURE__ */ e("p", { className: "text-[10px] text-zinc-400 mb-2 leading-tight whitespace-pre-wrap", children: t.message.replace(/Downloading\.\.\. \d+%/, "").trim() || "Processing..." }),
1243
1296
  /* @__PURE__ */ e("div", { className: "h-0.5 w-full bg-white/10 rounded-full overflow-hidden", children: /* @__PURE__ */ e(
1244
1297
  "div",
1245
1298
  {
@@ -1257,17 +1310,17 @@ const qe = (i, t = 200) => {
1257
1310
  },
1258
1311
  className: "text-zinc-500 hover:text-zinc-200 transition-colors p-1 -mt-1.5 -mr-1.5",
1259
1312
  title: t.action.label,
1260
- children: /* @__PURE__ */ e(Ut, { className: "w-3.5 h-3.5" })
1313
+ children: /* @__PURE__ */ e(Gt, { className: "w-3.5 h-3.5" })
1261
1314
  }
1262
1315
  )
1263
1316
  ] }) }) : /* @__PURE__ */ d("div", { className: "flex items-start gap-2.5", children: [
1264
- t.type === "loading" && /* @__PURE__ */ e(Ie, { className: "w-3.5 h-3.5 animate-spin text-[var(--accent)] shrink-0 mt-0.5" }),
1265
- t.type === "success" && /* @__PURE__ */ e(Pe, { className: "w-3.5 h-3.5 text-emerald-500 shrink-0 mt-0.5" }),
1266
- t.type === "error" && /* @__PURE__ */ e(Je, { className: "w-3.5 h-3.5 text-red-500 shrink-0 mt-0.5" }),
1267
- t.type === "warning" && /* @__PURE__ */ e(Je, { className: "w-3.5 h-3.5 text-amber-500 shrink-0 mt-0.5" }),
1317
+ t.type === "loading" && /* @__PURE__ */ e(Fe, { className: "w-3.5 h-3.5 animate-spin text-[var(--accent)] shrink-0 mt-0.5" }),
1318
+ t.type === "success" && /* @__PURE__ */ e(Be, { className: "w-3.5 h-3.5 text-emerald-500 shrink-0 mt-0.5" }),
1319
+ t.type === "error" && /* @__PURE__ */ e(et, { className: "w-3.5 h-3.5 text-red-500 shrink-0 mt-0.5" }),
1320
+ t.type === "warning" && /* @__PURE__ */ e(et, { className: "w-3.5 h-3.5 text-amber-500 shrink-0 mt-0.5" }),
1268
1321
  t.type === "info" && /* @__PURE__ */ e("div", { className: "w-1.5 h-1.5 rounded-full bg-[var(--accent)] mt-1.5 shrink-0" }),
1269
1322
  /* @__PURE__ */ d("div", { className: "flex flex-col gap-0.5 min-w-0", children: [
1270
- /* @__PURE__ */ e("span", { className: "text-xs font-medium leading-snug break-words text-zinc-200", children: t.message }),
1323
+ /* @__PURE__ */ e("span", { className: "text-xs font-medium leading-snug break-words text-zinc-200 whitespace-pre-wrap", children: t.message }),
1271
1324
  t.action && /* @__PURE__ */ e(
1272
1325
  "button",
1273
1326
  {
@@ -1284,9 +1337,12 @@ const qe = (i, t = 200) => {
1284
1337
  },
1285
1338
  t.id
1286
1339
  );
1287
- }) }), hn = ({ cues: i, settings: t }) => {
1288
- if (t.useNative || i.length === 0) return null;
1289
- const n = () => {
1340
+ }) }), hn = ({
1341
+ cues: n,
1342
+ settings: t
1343
+ }) => {
1344
+ if (t.useNative || n.length === 0) return null;
1345
+ const i = () => {
1290
1346
  switch (t.textStyle) {
1291
1347
  case "outline":
1292
1348
  return "0px 0px 4px black, 0px 0px 4px black";
@@ -1307,7 +1363,7 @@ const qe = (i, t = 200) => {
1307
1363
  style: {
1308
1364
  bottom: `${t.verticalOffset}px`
1309
1365
  },
1310
- children: i.map((o, r) => /* @__PURE__ */ e(
1366
+ children: n.map((o, r) => /* @__PURE__ */ e(
1311
1367
  "div",
1312
1368
  {
1313
1369
  className: "mb-1 inline-block max-w-[80%]",
@@ -1316,8 +1372,9 @@ const qe = (i, t = 200) => {
1316
1372
  color: t.textColor,
1317
1373
  fontWeight: t.isBold ? "bold" : "normal",
1318
1374
  textTransform: t.fixCapitalization ? "capitalize" : "none",
1319
- textShadow: n(),
1320
- lineHeight: 1.4
1375
+ textShadow: i(),
1376
+ lineHeight: 1.4,
1377
+ whiteSpace: "pre-line"
1321
1378
  },
1322
1379
  children: /* @__PURE__ */ e(
1323
1380
  "span",
@@ -1335,23 +1392,23 @@ const qe = (i, t = 200) => {
1335
1392
  ))
1336
1393
  }
1337
1394
  );
1338
- }, Re = ({ content: i }) => typeof i == "string" ? i.trim().startsWith("<") ? /* @__PURE__ */ e("span", { dangerouslySetInnerHTML: { __html: i } }) : /* @__PURE__ */ e("span", { children: i }) : /* @__PURE__ */ e(U, { children: i }), te = ({ label: i, checked: t, onChange: n, icon: o, tooltip: r }) => /* @__PURE__ */ d(
1395
+ }, Ae = ({ content: n }) => typeof n == "string" ? n.trim().startsWith("<") ? /* @__PURE__ */ e("span", { dangerouslySetInnerHTML: { __html: n } }) : /* @__PURE__ */ e("span", { children: n }) : /* @__PURE__ */ e(_, { children: n }), oe = ({ label: n, checked: t, onChange: i, icon: o, tooltip: r }) => /* @__PURE__ */ d(
1339
1396
  "div",
1340
1397
  {
1341
1398
  className: "flex items-center justify-between py-2.5 px-3 hover:bg-white/5 group transition-colors",
1342
1399
  style: { borderRadius: "var(--radius)" },
1343
1400
  children: [
1344
1401
  /* @__PURE__ */ d("div", { className: "flex items-center gap-3", children: [
1345
- o && /* @__PURE__ */ e("span", { className: "text-zinc-500 group-hover:text-zinc-400 transition-colors flex items-center justify-center w-4 h-4", children: /* @__PURE__ */ e(Re, { content: o }) }),
1402
+ o && /* @__PURE__ */ e("span", { className: "text-zinc-500 group-hover:text-zinc-400 transition-colors flex items-center justify-center w-4 h-4", children: /* @__PURE__ */ e(Ae, { content: o }) }),
1346
1403
  /* @__PURE__ */ d("div", { className: "flex flex-col", children: [
1347
- /* @__PURE__ */ e("span", { className: "text-sm text-zinc-300 font-medium group-hover:text-white transition-colors flex items-center", children: /* @__PURE__ */ e(Re, { content: i }) }),
1404
+ /* @__PURE__ */ e("span", { className: "text-sm text-zinc-300 font-medium group-hover:text-white transition-colors flex items-center", children: /* @__PURE__ */ e(Ae, { content: n }) }),
1348
1405
  r && /* @__PURE__ */ e("span", { className: "text-[10px] text-zinc-500", children: r })
1349
1406
  ] })
1350
1407
  ] }),
1351
1408
  /* @__PURE__ */ e(
1352
1409
  "button",
1353
1410
  {
1354
- onClick: () => n(!t),
1411
+ onClick: () => i(!t),
1355
1412
  className: `w-11 h-6 shrink-0 transition-colors relative focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-offset-zinc-900 ${t ? "bg-[var(--accent)]" : "bg-zinc-700"}`,
1356
1413
  style: {
1357
1414
  "--tw-ring-color": "var(--accent)",
@@ -1373,7 +1430,7 @@ const qe = (i, t = 200) => {
1373
1430
  )
1374
1431
  ]
1375
1432
  }
1376
- ), be = ({ label: i, value: t, min: n, max: o, step: r, onChange: h, formatValue: u, icon: b }) => /* @__PURE__ */ d(
1433
+ ), we = ({ label: n, value: t, min: i, max: o, step: r, onChange: h, formatValue: u, icon: f }) => /* @__PURE__ */ d(
1377
1434
  "div",
1378
1435
  {
1379
1436
  className: "py-2.5 px-3 hover:bg-white/5 group transition-colors",
@@ -1381,8 +1438,8 @@ const qe = (i, t = 200) => {
1381
1438
  children: [
1382
1439
  /* @__PURE__ */ d("div", { className: "flex justify-between items-center mb-2", children: [
1383
1440
  /* @__PURE__ */ d("div", { className: "flex items-center gap-3", children: [
1384
- b && /* @__PURE__ */ e("span", { className: "text-zinc-500 group-hover:text-zinc-400 transition-colors flex items-center justify-center w-4 h-4", children: /* @__PURE__ */ e(Re, { content: b }) }),
1385
- /* @__PURE__ */ e("span", { className: "text-xs font-bold text-zinc-400 uppercase tracking-wider group-hover:text-zinc-300 transition-colors", children: i })
1441
+ f && /* @__PURE__ */ e("span", { className: "text-zinc-500 group-hover:text-zinc-400 transition-colors flex items-center justify-center w-4 h-4", children: /* @__PURE__ */ e(Ae, { content: f }) }),
1442
+ /* @__PURE__ */ e("span", { className: "text-xs font-bold text-zinc-400 uppercase tracking-wider group-hover:text-zinc-300 transition-colors", children: n })
1386
1443
  ] }),
1387
1444
  /* @__PURE__ */ e(
1388
1445
  "span",
@@ -1398,7 +1455,7 @@ const qe = (i, t = 200) => {
1398
1455
  "input",
1399
1456
  {
1400
1457
  type: "range",
1401
- min: n,
1458
+ min: i,
1402
1459
  max: o,
1403
1460
  step: r,
1404
1461
  value: t,
@@ -1406,7 +1463,7 @@ const qe = (i, t = 200) => {
1406
1463
  className: "w-full h-1.5 appearance-none cursor-pointer focus:outline-none focus:ring-2 strata-range-input",
1407
1464
  style: {
1408
1465
  borderRadius: "var(--radius-full)",
1409
- background: `linear-gradient(to right, var(--accent) 0%, var(--accent) ${(t - n) / (o - n) * 100}%, #3f3f46 ${(t - n) / (o - n) * 100}%, #3f3f46 100%)`,
1466
+ background: `linear-gradient(to right, var(--accent) 0%, var(--accent) ${(t - i) / (o - i) * 100}%, #3f3f46 ${(t - i) / (o - i) * 100}%, #3f3f46 100%)`,
1410
1467
  "--tw-ring-color": "var(--accent)"
1411
1468
  }
1412
1469
  }
@@ -1431,15 +1488,15 @@ const qe = (i, t = 200) => {
1431
1488
  ] })
1432
1489
  ]
1433
1490
  }
1434
- ), pn = ({ label: i, value: t, options: n, onChange: o, icon: r }) => /* @__PURE__ */ d(
1491
+ ), pn = ({ label: n, value: t, options: i, onChange: o, icon: r }) => /* @__PURE__ */ d(
1435
1492
  "div",
1436
1493
  {
1437
1494
  className: "py-2.5 px-3 hover:bg-white/5 group transition-colors",
1438
1495
  style: { borderRadius: "var(--radius)" },
1439
1496
  children: [
1440
1497
  /* @__PURE__ */ d("div", { className: "flex items-center gap-3 mb-2", children: [
1441
- r && /* @__PURE__ */ e("span", { className: "text-zinc-500 group-hover:text-zinc-400 transition-colors flex items-center justify-center w-4 h-4", children: /* @__PURE__ */ e(Re, { content: r }) }),
1442
- /* @__PURE__ */ e("span", { className: "text-xs font-bold text-zinc-400 uppercase tracking-wider group-hover:text-zinc-300 transition-colors", children: i })
1498
+ r && /* @__PURE__ */ e("span", { className: "text-zinc-500 group-hover:text-zinc-400 transition-colors flex items-center justify-center w-4 h-4", children: /* @__PURE__ */ e(Ae, { content: r }) }),
1499
+ /* @__PURE__ */ e("span", { className: "text-xs font-bold text-zinc-400 uppercase tracking-wider group-hover:text-zinc-300 transition-colors", children: n })
1443
1500
  ] }),
1444
1501
  /* @__PURE__ */ d("div", { className: "relative", children: [
1445
1502
  /* @__PURE__ */ e(
@@ -1449,33 +1506,33 @@ const qe = (i, t = 200) => {
1449
1506
  onChange: (h) => o(h.target.value),
1450
1507
  className: "w-full bg-zinc-800 border-[length:var(--border-width)] border-white/10 px-3 py-2 text-sm text-zinc-200 focus:outline-none focus:ring-2 appearance-none hover:bg-zinc-700 transition-colors cursor-pointer",
1451
1508
  style: { "--tw-ring-color": "var(--accent)", borderRadius: "var(--radius)" },
1452
- children: n.map((h) => /* @__PURE__ */ e("option", { value: h.value, children: h.label }, h.value))
1509
+ children: i.map((h) => /* @__PURE__ */ e("option", { value: h.value, children: h.label }, h.value))
1453
1510
  }
1454
1511
  ),
1455
1512
  /* @__PURE__ */ e("div", { className: "absolute right-3 top-1/2 -translate-y-1/2 pointer-events-none text-zinc-400", children: /* @__PURE__ */ e("svg", { width: "10", height: "6", viewBox: "0 0 10 6", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ e("path", { d: "M1 1L5 5L9 1", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }) }) })
1456
1513
  ] })
1457
1514
  ]
1458
1515
  }
1459
- ), le = ({ title: i, children: t }) => /* @__PURE__ */ d("div", { className: "py-2", children: [
1460
- i && /* @__PURE__ */ e("h4", { className: "px-3 text-[10px] font-bold text-[var(--accent)] uppercase tracking-wider mb-1 mt-2", children: i }),
1516
+ ), me = ({ title: n, children: t }) => /* @__PURE__ */ d("div", { className: "py-2", children: [
1517
+ n && /* @__PURE__ */ e("h4", { className: "px-3 text-[10px] font-bold text-[var(--accent)] uppercase tracking-wider mb-1 mt-2", children: n }),
1461
1518
  /* @__PURE__ */ e("div", { className: "space-y-0.5", children: t })
1462
- ] }), Ye = ({
1463
- children: i,
1519
+ ] }), it = ({
1520
+ children: n,
1464
1521
  onClose: t,
1465
- align: n = "right",
1522
+ align: i = "right",
1466
1523
  maxHeight: o,
1467
1524
  className: r
1468
1525
  }) => {
1469
- const h = H(null), u = H(null), [b, g] = C("auto"), x = n === "center" ? "left-1/2 -translate-x-1/2 origin-bottom" : "right-0 origin-bottom-right";
1470
- ze(() => {
1526
+ const h = U(null), u = U(null), [f, g] = N("auto"), x = i === "center" ? "left-1/2 -translate-x-1/2 origin-bottom" : "right-0 origin-bottom-right";
1527
+ Ee(() => {
1471
1528
  if (!u.current) return;
1472
1529
  const w = () => {
1473
1530
  u.current && g(u.current.offsetHeight);
1474
- }, f = new ResizeObserver(w);
1475
- return f.observe(u.current), w(), () => f.disconnect();
1531
+ }, m = new ResizeObserver(w);
1532
+ return m.observe(u.current), w(), () => m.disconnect();
1476
1533
  }, []);
1477
1534
  const p = {
1478
- height: b === "auto" ? "auto" : `${b + 14}px`,
1535
+ height: f === "auto" ? "auto" : `${f + 14}px`,
1479
1536
  // + padding
1480
1537
  maxHeight: o ? `${o}px` : void 0
1481
1538
  };
@@ -1493,24 +1550,24 @@ const qe = (i, t = 200) => {
1493
1550
  {
1494
1551
  className: "overflow-y-auto hide-scrollbar flex-1",
1495
1552
  style: { borderRadius: "var(--radius)" },
1496
- children: /* @__PURE__ */ e("div", { ref: u, children: i })
1553
+ children: /* @__PURE__ */ e("div", { ref: u, children: n })
1497
1554
  }
1498
1555
  )
1499
1556
  }
1500
1557
  );
1501
- }, ge = ({
1502
- content: i,
1558
+ }, ye = ({
1559
+ content: n,
1503
1560
  className: t
1504
- }) => typeof i == "string" ? i.trim().startsWith("<") ? /* @__PURE__ */ e(
1561
+ }) => typeof n == "string" ? n.trim().startsWith("<") ? /* @__PURE__ */ e(
1505
1562
  "span",
1506
1563
  {
1507
1564
  className: t,
1508
- dangerouslySetInnerHTML: { __html: i }
1565
+ dangerouslySetInnerHTML: { __html: n }
1509
1566
  }
1510
- ) : /* @__PURE__ */ e("span", { className: t, children: i }) : /* @__PURE__ */ e("span", { className: t, children: i }), $ = ({
1511
- label: i,
1567
+ ) : /* @__PURE__ */ e("span", { className: t, children: n }) : /* @__PURE__ */ e("span", { className: t, children: n }), A = ({
1568
+ label: n,
1512
1569
  value: t,
1513
- active: n,
1570
+ active: i,
1514
1571
  onClick: o,
1515
1572
  hasSubmenu: r,
1516
1573
  icon: h,
@@ -1523,13 +1580,13 @@ const qe = (i, t = 200) => {
1523
1580
  style: { borderRadius: "var(--radius)" },
1524
1581
  children: [
1525
1582
  /* @__PURE__ */ d("div", { className: "flex items-center gap-3 overflow-hidden", children: [
1526
- h && /* @__PURE__ */ e("span", { className: "text-zinc-400 shrink-0 group-hover:text-zinc-300 transition-colors flex items-center justify-center w-4 h-4", children: /* @__PURE__ */ e(ge, { content: h }) }),
1583
+ h && /* @__PURE__ */ e("span", { className: "text-zinc-400 shrink-0 group-hover:text-zinc-300 transition-colors flex items-center justify-center w-4 h-4", children: /* @__PURE__ */ e(ye, { content: h }) }),
1527
1584
  /* @__PURE__ */ e(
1528
1585
  "span",
1529
1586
  {
1530
- className: `font-medium truncate text-sm flex items-center ${n ? "text-[var(--accent)]" : ""}`,
1531
- title: typeof i == "string" ? i : void 0,
1532
- children: /* @__PURE__ */ e(ge, { content: i })
1587
+ className: `font-medium truncate text-sm flex items-center ${i ? "text-[var(--accent)]" : ""}`,
1588
+ title: typeof n == "string" ? n : void 0,
1589
+ children: /* @__PURE__ */ e(ye, { content: n })
1533
1590
  }
1534
1591
  )
1535
1592
  ] }),
@@ -1539,19 +1596,19 @@ const qe = (i, t = 200) => {
1539
1596
  {
1540
1597
  className: "text-xs font-medium truncate max-w-[60px]",
1541
1598
  title: t,
1542
- children: /* @__PURE__ */ e(ge, { content: t })
1599
+ children: /* @__PURE__ */ e(ye, { content: t })
1543
1600
  }
1544
1601
  ),
1545
1602
  u,
1546
- n && /* @__PURE__ */ e(Pe, { className: "w-4 h-4 text-[var(--accent)] shrink-0" }),
1603
+ i && /* @__PURE__ */ e(Be, { className: "w-4 h-4 text-[var(--accent)] shrink-0" }),
1547
1604
  r && /* @__PURE__ */ e("span", { className: "text-xs group-hover:translate-x-0.5 transition-transform text-zinc-500 shrink-0", children: "›" })
1548
1605
  ] })
1549
1606
  ]
1550
1607
  }
1551
- ), J = ({
1552
- label: i,
1608
+ ), K = ({
1609
+ label: n,
1553
1610
  onBack: t,
1554
- rightAction: n
1611
+ rightAction: i
1555
1612
  }) => /* @__PURE__ */ d(
1556
1613
  "div",
1557
1614
  {
@@ -1565,102 +1622,102 @@ const qe = (i, t = 200) => {
1565
1622
  onClick: t,
1566
1623
  children: [
1567
1624
  /* @__PURE__ */ e(Fi, { className: "w-3 h-3" }),
1568
- /* @__PURE__ */ e("span", { children: /* @__PURE__ */ e(ge, { content: i }) })
1625
+ /* @__PURE__ */ e("span", { children: /* @__PURE__ */ e(ye, { content: n }) })
1569
1626
  ]
1570
1627
  }
1571
1628
  ),
1572
- n
1629
+ i
1573
1630
  ]
1574
1631
  }
1575
- ), ae = () => /* @__PURE__ */ e("div", { className: "h-px bg-white/5 mx-2 my-1" }), Vt = ({
1576
- items: i,
1632
+ ), pe = () => /* @__PURE__ */ e("div", { className: "h-px bg-white/5 mx-2 my-1" }), Vt = ({
1633
+ items: n,
1577
1634
  onClose: t,
1578
- title: n,
1635
+ title: i,
1579
1636
  maxHeight: o,
1580
1637
  className: r
1581
1638
  }) => {
1582
- const [h, u] = C([]), b = h.length > 0 ? h[h.length - 1] : null, g = b ? b.children || [] : i, x = b ? b.html : n || "Menu", p = () => {
1583
- u((f) => f.slice(0, -1));
1584
- }, w = (f) => {
1585
- f.children && u((M) => [...M, f]);
1639
+ const [h, u] = N([]), f = h.length > 0 ? h[h.length - 1] : null, g = f ? f.children || [] : n, x = f ? f.html : i || "Menu", p = () => {
1640
+ u((m) => m.slice(0, -1));
1641
+ }, w = (m) => {
1642
+ m.children && u((T) => [...T, m]);
1586
1643
  };
1587
- return /* @__PURE__ */ e(Ye, { onClose: t, maxHeight: o, className: r, children: /* @__PURE__ */ d("div", { className: "animate-in fade-in slide-in-from-right-4 duration-200", children: [
1588
- h.length > 0 ? /* @__PURE__ */ e(J, { label: x || "Menu", onBack: p }) : n && /* @__PURE__ */ e(
1644
+ return /* @__PURE__ */ e(it, { onClose: t, maxHeight: o, className: r, children: /* @__PURE__ */ d("div", { className: "animate-in fade-in slide-in-from-right-4 duration-200", children: [
1645
+ h.length > 0 ? /* @__PURE__ */ e(K, { label: x || "Menu", onBack: p }) : i && /* @__PURE__ */ e(
1589
1646
  "div",
1590
1647
  {
1591
1648
  className: "px-3 py-2 mb-1 border-b border-white/5 font-bold text-zinc-400 uppercase text-[11px] tracking-wider flex justify-between items-center bg-white/5 sticky top-0 z-10 backdrop-blur-md",
1592
1649
  style: { borderRadius: "var(--radius)" },
1593
- children: /* @__PURE__ */ e("span", { children: n })
1650
+ children: /* @__PURE__ */ e("span", { children: i })
1594
1651
  }
1595
1652
  ),
1596
- /* @__PURE__ */ e("div", { className: "pb-1", children: g.map((f, M) => f.separator ? /* @__PURE__ */ e(ae, {}, M) : f.isLabel ? /* @__PURE__ */ e(
1653
+ /* @__PURE__ */ e("div", { className: "pb-1", children: g.map((m, T) => m.separator ? /* @__PURE__ */ e(pe, {}, T) : m.isLabel ? /* @__PURE__ */ e(
1597
1654
  "div",
1598
1655
  {
1599
1656
  className: "px-3 py-1.5 text-[10px] font-bold text-zinc-500 uppercase tracking-wider select-none",
1600
- children: /* @__PURE__ */ e(ge, { content: f.html || "" })
1657
+ children: /* @__PURE__ */ e(ye, { content: m.html || "" })
1601
1658
  },
1602
- M
1603
- ) : f.range ? /* @__PURE__ */ e("div", { className: "px-1", children: /* @__PURE__ */ e(
1604
- be,
1659
+ T
1660
+ ) : m.range ? /* @__PURE__ */ e("div", { className: "px-1", children: /* @__PURE__ */ e(
1661
+ we,
1605
1662
  {
1606
- label: f.html,
1607
- icon: f.icon,
1608
- value: f.value ?? f.min ?? 0,
1609
- min: f.min ?? 0,
1610
- max: f.max ?? 100,
1611
- step: f.step ?? 1,
1612
- onChange: (z) => f.onRange && f.onRange(z),
1613
- formatValue: f.formatValue
1663
+ label: m.html,
1664
+ icon: m.icon,
1665
+ value: m.value ?? m.min ?? 0,
1666
+ min: m.min ?? 0,
1667
+ max: m.max ?? 100,
1668
+ step: m.step ?? 1,
1669
+ onChange: (I) => m.onRange && m.onRange(I),
1670
+ formatValue: m.formatValue
1614
1671
  }
1615
- ) }, M) : f.switch !== void 0 ? /* @__PURE__ */ e("div", { className: "px-1", children: /* @__PURE__ */ e(
1616
- te,
1672
+ ) }, T) : m.switch !== void 0 ? /* @__PURE__ */ e("div", { className: "px-1", children: /* @__PURE__ */ e(
1673
+ oe,
1617
1674
  {
1618
- label: f.html,
1619
- icon: f.icon,
1620
- checked: f.switch,
1621
- tooltip: f.tooltip,
1622
- onChange: (z) => f.onSwitch && f.onSwitch(f, z)
1675
+ label: m.html,
1676
+ icon: m.icon,
1677
+ checked: m.switch,
1678
+ tooltip: m.tooltip,
1679
+ onChange: (I) => m.onSwitch && m.onSwitch(m, I)
1623
1680
  }
1624
- ) }, M) : /* @__PURE__ */ e(ve.Fragment, { children: /* @__PURE__ */ e(
1625
- $,
1681
+ ) }, T) : /* @__PURE__ */ e(ke.Fragment, { children: /* @__PURE__ */ e(
1682
+ A,
1626
1683
  {
1627
- label: f.html,
1628
- icon: f.icon,
1629
- value: f.currentLabel || f.value,
1630
- active: f.active,
1631
- hasSubmenu: !!f.children,
1684
+ label: m.html,
1685
+ icon: m.icon,
1686
+ value: m.currentLabel || m.value,
1687
+ active: m.active,
1688
+ hasSubmenu: !!m.children,
1632
1689
  onClick: () => {
1633
- f.children ? w(f) : f.onClick ? (f.onClick(f), !f.switch && !f.range && t()) : f.click && (f.click(f), t());
1690
+ m.children ? w(m) : m.onClick ? (m.onClick(m), !m.switch && !m.range && t()) : m.click && (m.click(m), t());
1634
1691
  }
1635
1692
  }
1636
- ) }, M)) })
1693
+ ) }, T)) })
1637
1694
  ] }) });
1638
1695
  }, mn = ({
1639
- tracks: i,
1696
+ tracks: n,
1640
1697
  current: t,
1641
- onSelect: n,
1698
+ onSelect: i,
1642
1699
  onUpload: o,
1643
1700
  onClose: r,
1644
1701
  settings: h,
1645
1702
  onSettingsChange: u,
1646
- onReset: b,
1703
+ onReset: f,
1647
1704
  offset: g,
1648
1705
  onOffsetChange: x,
1649
1706
  maxHeight: p,
1650
1707
  animationClass: w
1651
1708
  }) => {
1652
- const [f, M] = C("main"), [z, j] = C(""), D = H(null), O = fe(() => z ? i.filter(
1653
- (m) => m.label.toLowerCase().includes(z.toLowerCase()) || m.srcLang && m.srcLang.toLowerCase().includes(z.toLowerCase())
1654
- ) : i, [i, z]);
1709
+ const [m, T] = N("main"), [I, O] = N(""), Y = U(null), W = xe(() => I ? n.filter(
1710
+ (b) => b.label.toLowerCase().includes(I.toLowerCase()) || b.srcLang && b.srcLang.toLowerCase().includes(I.toLowerCase())
1711
+ ) : n, [n, I]);
1655
1712
  return /* @__PURE__ */ d(
1656
- Ye,
1713
+ it,
1657
1714
  {
1658
1715
  onClose: r,
1659
1716
  align: "right",
1660
1717
  maxHeight: p,
1661
1718
  className: w,
1662
1719
  children: [
1663
- f === "main" && /* @__PURE__ */ d("div", { className: "animate-in slide-in-from-left-4 fade-in duration-200 flex flex-col h-full", children: [
1720
+ m === "main" && /* @__PURE__ */ d("div", { className: "animate-in slide-in-from-left-4 fade-in duration-200 flex flex-col h-full", children: [
1664
1721
  /* @__PURE__ */ e(
1665
1722
  "div",
1666
1723
  {
@@ -1671,13 +1728,13 @@ const qe = (i, t = 200) => {
1671
1728
  ),
1672
1729
  /* @__PURE__ */ d("div", { className: "px-1.5 pb-2 shrink-0", children: [
1673
1730
  /* @__PURE__ */ e(
1674
- $,
1731
+ A,
1675
1732
  {
1676
1733
  label: "Upload Subtitle",
1677
1734
  icon: /* @__PURE__ */ e(Ei, { className: "w-4 h-4" }),
1678
1735
  onClick: () => {
1679
- var m;
1680
- return (m = D.current) == null ? void 0 : m.click();
1736
+ var b;
1737
+ return (b = Y.current) == null ? void 0 : b.click();
1681
1738
  }
1682
1739
  }
1683
1740
  ),
@@ -1686,31 +1743,31 @@ const qe = (i, t = 200) => {
1686
1743
  {
1687
1744
  type: "file",
1688
1745
  accept: ".vtt,.srt",
1689
- ref: D,
1746
+ ref: Y,
1690
1747
  className: "hidden",
1691
- onChange: (m) => {
1692
- var V;
1693
- (V = m.target.files) != null && V[0] && o(m.target.files[0]);
1748
+ onChange: (b) => {
1749
+ var H;
1750
+ (H = b.target.files) != null && H[0] && o(b.target.files[0]);
1694
1751
  }
1695
1752
  }
1696
1753
  ),
1697
1754
  /* @__PURE__ */ e(
1698
- $,
1755
+ A,
1699
1756
  {
1700
1757
  label: "Customize",
1701
- icon: /* @__PURE__ */ e(Wt, { className: "w-4 h-4" }),
1702
- onClick: () => M("customize"),
1758
+ icon: /* @__PURE__ */ e(jt, { className: "w-4 h-4" }),
1759
+ onClick: () => T("customize"),
1703
1760
  hasSubmenu: !0
1704
1761
  }
1705
1762
  ),
1706
1763
  /* @__PURE__ */ e("div", { className: "h-px bg-white/5 mx-2 my-1" }),
1707
1764
  /* @__PURE__ */ e(
1708
- $,
1765
+ A,
1709
1766
  {
1710
1767
  label: "Off",
1711
1768
  active: t === -1,
1712
1769
  onClick: () => {
1713
- n(-1), r();
1770
+ i(-1), r();
1714
1771
  }
1715
1772
  }
1716
1773
  ),
@@ -1720,8 +1777,8 @@ const qe = (i, t = 200) => {
1720
1777
  {
1721
1778
  type: "text",
1722
1779
  placeholder: "Search subtitles...",
1723
- value: z,
1724
- onChange: (m) => j(m.target.value),
1780
+ value: I,
1781
+ onChange: (b) => O(b.target.value),
1725
1782
  className: "w-full bg-zinc-800/50 border border-white/10 rounded-md py-1.5 pl-8 pr-3 text-xs text-zinc-200 focus:outline-none focus:border-white/20 transition-colors"
1726
1783
  }
1727
1784
  ),
@@ -1729,35 +1786,35 @@ const qe = (i, t = 200) => {
1729
1786
  ] })
1730
1787
  ] }),
1731
1788
  /* @__PURE__ */ d("div", { className: "overflow-y-auto hide-scrollbar flex-1", children: [
1732
- O.map((m) => {
1733
- let V = null;
1734
- return m.status === "loading" ? V = /* @__PURE__ */ e(Ie, { className: "w-3.5 h-3.5 animate-spin text-[var(--accent)]" }) : m.status === "error" ? V = /* @__PURE__ */ e(dn, { className: "w-3.5 h-3.5 text-red-500" }) : m.status === "success" && (V = /* @__PURE__ */ e(Gt, { className: "w-3.5 h-3.5 text-emerald-500" })), /* @__PURE__ */ e(
1735
- $,
1789
+ W.map((b) => {
1790
+ let H = null;
1791
+ return b.status === "loading" ? H = /* @__PURE__ */ e(Fe, { className: "w-3.5 h-3.5 animate-spin text-[var(--accent)]" }) : b.status === "error" ? H = /* @__PURE__ */ e(dn, { className: "w-3.5 h-3.5 text-red-500" }) : b.status === "success" && (H = /* @__PURE__ */ e(_t, { className: "w-3.5 h-3.5 text-emerald-500" })), /* @__PURE__ */ e(
1792
+ A,
1736
1793
  {
1737
- label: m.label,
1738
- value: m.srcLang,
1739
- active: t === m.index,
1740
- rightIcon: V,
1794
+ label: b.label,
1795
+ value: b.srcLang,
1796
+ active: t === b.index,
1797
+ rightIcon: H,
1741
1798
  onClick: () => {
1742
- n(m.index), r();
1799
+ i(b.index), r();
1743
1800
  }
1744
1801
  },
1745
- m.index
1802
+ b.index
1746
1803
  );
1747
1804
  }),
1748
- O.length === 0 && z && /* @__PURE__ */ e("div", { className: "px-4 py-3 text-center text-xs text-zinc-500", children: "No results found" })
1805
+ W.length === 0 && I && /* @__PURE__ */ e("div", { className: "px-4 py-3 text-center text-xs text-zinc-500", children: "No results found" })
1749
1806
  ] })
1750
1807
  ] }),
1751
- f === "customize" && /* @__PURE__ */ d("div", { className: "animate-in slide-in-from-right-4 fade-in duration-200", children: [
1808
+ m === "customize" && /* @__PURE__ */ d("div", { className: "animate-in slide-in-from-right-4 fade-in duration-200", children: [
1752
1809
  /* @__PURE__ */ e(
1753
- J,
1810
+ K,
1754
1811
  {
1755
1812
  label: "Customize",
1756
- onBack: () => M("main"),
1813
+ onBack: () => T("main"),
1757
1814
  rightAction: /* @__PURE__ */ e(
1758
1815
  "button",
1759
1816
  {
1760
- onClick: b,
1817
+ onClick: f,
1761
1818
  className: "p-1.5 text-zinc-400 hover:text-white transition-colors rounded-md hover:bg-white/10",
1762
1819
  title: "Reset All",
1763
1820
  children: /* @__PURE__ */ e(Ui, { className: "w-4 h-4" })
@@ -1766,19 +1823,19 @@ const qe = (i, t = 200) => {
1766
1823
  }
1767
1824
  ),
1768
1825
  /* @__PURE__ */ d("div", { className: "pb-1", children: [
1769
- /* @__PURE__ */ e(le, { children: /* @__PURE__ */ e(
1770
- te,
1826
+ /* @__PURE__ */ e(me, { children: /* @__PURE__ */ e(
1827
+ oe,
1771
1828
  {
1772
1829
  label: "Native Video Subtitle",
1773
1830
  checked: h.useNative,
1774
- onChange: (m) => u({ useNative: m })
1831
+ onChange: (b) => u({ useNative: b })
1775
1832
  }
1776
1833
  ) }),
1777
- !h.useNative && /* @__PURE__ */ d(U, { children: [
1778
- /* @__PURE__ */ d(le, { title: "Sync & Position", children: [
1834
+ !h.useNative && /* @__PURE__ */ d(_, { children: [
1835
+ /* @__PURE__ */ d(me, { title: "Sync & Position", children: [
1779
1836
  /* @__PURE__ */ d("div", { className: "py-2.5 px-3 rounded-lg hover:bg-white/5 group transition-colors", children: [
1780
1837
  /* @__PURE__ */ e("div", { className: "flex justify-between items-center mb-2", children: /* @__PURE__ */ d("div", { className: "flex items-center gap-3", children: [
1781
- /* @__PURE__ */ e(Bi, { className: "w-4 h-4 text-zinc-500 group-hover:text-zinc-400 transition-colors" }),
1838
+ /* @__PURE__ */ e(Vi, { className: "w-4 h-4 text-zinc-500 group-hover:text-zinc-400 transition-colors" }),
1782
1839
  /* @__PURE__ */ e("span", { className: "text-xs font-bold text-zinc-400 uppercase tracking-wider group-hover:text-zinc-300 transition-colors", children: "Sync Offset" })
1783
1840
  ] }) }),
1784
1841
  /* @__PURE__ */ d("div", { className: "flex items-center gap-2", children: [
@@ -1806,7 +1863,7 @@ const qe = (i, t = 200) => {
1806
1863
  ] })
1807
1864
  ] }),
1808
1865
  /* @__PURE__ */ e(
1809
- be,
1866
+ we,
1810
1867
  {
1811
1868
  label: "Vertical Position",
1812
1869
  icon: /* @__PURE__ */ e(ji, { className: "w-4 h-4" }),
@@ -1814,14 +1871,14 @@ const qe = (i, t = 200) => {
1814
1871
  min: 0,
1815
1872
  max: 200,
1816
1873
  step: 5,
1817
- onChange: (m) => u({ verticalOffset: m }),
1818
- formatValue: (m) => `${m}px`
1874
+ onChange: (b) => u({ verticalOffset: b }),
1875
+ formatValue: (b) => `${b}px`
1819
1876
  }
1820
1877
  )
1821
1878
  ] }),
1822
- /* @__PURE__ */ d(le, { title: "Appearance", children: [
1879
+ /* @__PURE__ */ d(me, { title: "Appearance", children: [
1823
1880
  /* @__PURE__ */ e(
1824
- be,
1881
+ we,
1825
1882
  {
1826
1883
  label: "Text Size",
1827
1884
  icon: /* @__PURE__ */ e(Hi, { className: "w-4 h-4" }),
@@ -1829,13 +1886,13 @@ const qe = (i, t = 200) => {
1829
1886
  min: 50,
1830
1887
  max: 200,
1831
1888
  step: 10,
1832
- onChange: (m) => u({ textSize: m }),
1833
- formatValue: (m) => `${m}%`
1889
+ onChange: (b) => u({ textSize: b }),
1890
+ formatValue: (b) => `${b}%`
1834
1891
  }
1835
1892
  ),
1836
1893
  /* @__PURE__ */ d("div", { className: "py-2.5 px-3 rounded-lg hover:bg-white/5 group transition-colors", children: [
1837
1894
  /* @__PURE__ */ d("div", { className: "flex items-center gap-3 mb-2", children: [
1838
- /* @__PURE__ */ e(jt, { className: "w-4 h-4 text-zinc-500 group-hover:text-zinc-400 transition-colors" }),
1895
+ /* @__PURE__ */ e(Ut, { className: "w-4 h-4 text-zinc-500 group-hover:text-zinc-400 transition-colors" }),
1839
1896
  /* @__PURE__ */ e("span", { className: "text-xs font-bold text-zinc-400 uppercase tracking-wider group-hover:text-zinc-300 transition-colors", children: "Text Color" })
1840
1897
  ] }),
1841
1898
  /* @__PURE__ */ d("div", { className: "flex items-center justify-between gap-2 p-1 bg-zinc-800/50 rounded-lg", children: [
@@ -1846,17 +1903,17 @@ const qe = (i, t = 200) => {
1846
1903
  "#ff00ff",
1847
1904
  "#ff0000",
1848
1905
  "#00ff00"
1849
- ].map((m) => /* @__PURE__ */ e(
1906
+ ].map((b) => /* @__PURE__ */ e(
1850
1907
  "button",
1851
1908
  {
1852
- onClick: () => u({ textColor: m }),
1853
- className: `w-6 h-6 rounded-full border border-white/10 transition-transform hover:scale-110 ${h.textColor === m ? "ring-2 scale-110" : ""}`,
1909
+ onClick: () => u({ textColor: b }),
1910
+ className: `w-6 h-6 rounded-full border border-white/10 transition-transform hover:scale-110 ${h.textColor === b ? "ring-2 scale-110" : ""}`,
1854
1911
  style: {
1855
- backgroundColor: m,
1912
+ backgroundColor: b,
1856
1913
  "--tw-ring-color": "var(--accent)"
1857
1914
  }
1858
1915
  },
1859
- m
1916
+ b
1860
1917
  )),
1861
1918
  /* @__PURE__ */ e("div", { className: "w-px h-6 bg-white/10 mx-1" }),
1862
1919
  /* @__PURE__ */ e("div", { className: "relative w-6 h-6 rounded-full overflow-hidden ring-1 ring-white/20 cursor-pointer", children: /* @__PURE__ */ e(
@@ -1864,7 +1921,7 @@ const qe = (i, t = 200) => {
1864
1921
  {
1865
1922
  type: "color",
1866
1923
  value: h.textColor,
1867
- onChange: (m) => u({ textColor: m.target.value }),
1924
+ onChange: (b) => u({ textColor: b.target.value }),
1868
1925
  className: "absolute inset-[-4px] w-[150%] h-[150%] cursor-pointer p-0 border-0"
1869
1926
  }
1870
1927
  ) })
@@ -1882,35 +1939,35 @@ const qe = (i, t = 200) => {
1882
1939
  { label: "Depressed", value: "depressed" },
1883
1940
  { label: "Drop Shadow", value: "shadow" }
1884
1941
  ],
1885
- onChange: (m) => u({
1886
- textStyle: m
1942
+ onChange: (b) => u({
1943
+ textStyle: b
1887
1944
  })
1888
1945
  }
1889
1946
  ),
1890
1947
  /* @__PURE__ */ d("div", { className: "grid grid-cols-2 gap-2 mt-1 px-1", children: [
1891
1948
  /* @__PURE__ */ e(
1892
- te,
1949
+ oe,
1893
1950
  {
1894
1951
  label: "Bold",
1895
1952
  icon: /* @__PURE__ */ e(Gi, { className: "w-4 h-4" }),
1896
1953
  checked: h.isBold,
1897
- onChange: (m) => u({ isBold: m })
1954
+ onChange: (b) => u({ isBold: b })
1898
1955
  }
1899
1956
  ),
1900
1957
  /* @__PURE__ */ e(
1901
- te,
1958
+ oe,
1902
1959
  {
1903
1960
  label: "Fix Caps",
1904
1961
  icon: /* @__PURE__ */ e(_i, { className: "w-4 h-4" }),
1905
1962
  checked: h.fixCapitalization,
1906
- onChange: (m) => u({ fixCapitalization: m })
1963
+ onChange: (b) => u({ fixCapitalization: b })
1907
1964
  }
1908
1965
  )
1909
1966
  ] })
1910
1967
  ] }),
1911
- /* @__PURE__ */ d(le, { title: "Background", children: [
1968
+ /* @__PURE__ */ d(me, { title: "Background", children: [
1912
1969
  /* @__PURE__ */ e(
1913
- be,
1970
+ we,
1914
1971
  {
1915
1972
  label: "Opacity",
1916
1973
  icon: /* @__PURE__ */ e(Wi, { className: "w-4 h-4" }),
@@ -1918,29 +1975,29 @@ const qe = (i, t = 200) => {
1918
1975
  min: 0,
1919
1976
  max: 100,
1920
1977
  step: 5,
1921
- onChange: (m) => u({ backgroundOpacity: m }),
1922
- formatValue: (m) => `${m}%`
1978
+ onChange: (b) => u({ backgroundOpacity: b }),
1979
+ formatValue: (b) => `${b}%`
1923
1980
  }
1924
1981
  ),
1925
1982
  /* @__PURE__ */ e(
1926
- te,
1983
+ oe,
1927
1984
  {
1928
1985
  label: "Blur Background",
1929
1986
  icon: /* @__PURE__ */ e(qi, { className: "w-4 h-4" }),
1930
1987
  checked: h.backgroundBlur,
1931
- onChange: (m) => u({ backgroundBlur: m })
1988
+ onChange: (b) => u({ backgroundBlur: b })
1932
1989
  }
1933
1990
  ),
1934
1991
  h.backgroundBlur && /* @__PURE__ */ e(
1935
- be,
1992
+ we,
1936
1993
  {
1937
1994
  label: "Blur Intensity",
1938
1995
  value: h.backgroundBlurAmount,
1939
1996
  min: 0,
1940
1997
  max: 20,
1941
1998
  step: 1,
1942
- onChange: (m) => u({ backgroundBlurAmount: m }),
1943
- formatValue: (m) => `${m}px`
1999
+ onChange: (b) => u({ backgroundBlurAmount: b }),
2000
+ formatValue: (b) => `${b}px`
1944
2001
  }
1945
2002
  )
1946
2003
  ] })
@@ -1950,25 +2007,25 @@ const qe = (i, t = 200) => {
1950
2007
  ]
1951
2008
  }
1952
2009
  );
1953
- }, Xe = ({ content: i }) => typeof i == "string" ? i.trim().startsWith("<") ? /* @__PURE__ */ e("span", { dangerouslySetInnerHTML: { __html: i } }) : /* @__PURE__ */ e("span", { children: i }) : /* @__PURE__ */ e(U, { children: i }), fn = ({ x: i, y: t, items: n, onClose: o, containerWidth: r, containerHeight: h }) => {
1954
- const u = H(null), [b, g] = C({
2010
+ }, Ye = ({ content: n }) => typeof n == "string" ? n.trim().startsWith("<") ? /* @__PURE__ */ e("span", { dangerouslySetInnerHTML: { __html: n } }) : /* @__PURE__ */ e("span", { children: n }) : /* @__PURE__ */ e(_, { children: n }), fn = ({ x: n, y: t, items: i, onClose: o, containerWidth: r, containerHeight: h }) => {
2011
+ const u = U(null), [f, g] = N({
1955
2012
  top: t,
1956
- left: i,
2013
+ left: n,
1957
2014
  opacity: 0
1958
2015
  });
1959
- return ze(() => {
2016
+ return Ee(() => {
1960
2017
  if (!u.current) return;
1961
2018
  const x = u.current.getBoundingClientRect(), p = x.width, w = x.height;
1962
- let f = i, M = t;
1963
- i + p > r - 10 && (f = i - p), f < 10 && (f = 10), f + p > r && (f = Math.max(10, r - p - 10)), t + w > h - 10 && (M = t - w);
1964
- let z = h - 20;
1965
- M < 10 && (M = 10), M + w > h - 10 && (M = Math.max(10, h - w - 10)), g({
1966
- top: M,
1967
- left: f,
1968
- maxHeight: z,
2019
+ let m = n, T = t;
2020
+ n + p > r - 10 && (m = n - p), m < 10 && (m = 10), m + p > r && (m = Math.max(10, r - p - 10)), t + w > h - 10 && (T = t - w);
2021
+ let I = h - 20;
2022
+ T < 10 && (T = 10), T + w > h - 10 && (T = Math.max(10, h - w - 10)), g({
2023
+ top: T,
2024
+ left: m,
2025
+ maxHeight: I,
1969
2026
  opacity: 1
1970
2027
  });
1971
- }, [i, t, n, r, h]), q(() => {
2028
+ }, [n, t, i, r, h]), Q(() => {
1972
2029
  const x = (p) => {
1973
2030
  u.current && !u.current.contains(p.target) && o();
1974
2031
  };
@@ -1979,16 +2036,16 @@ const qe = (i, t = 200) => {
1979
2036
  ref: u,
1980
2037
  className: "absolute z-50 min-w-[200px] bg-[var(--bg-panel)] backdrop-blur-xl border-[length:var(--border-width)] border-white/10 shadow-2xl p-1.5 font-[family-name:var(--font-main)] overflow-y-auto hide-scrollbar flex flex-col",
1981
2038
  style: {
1982
- top: b.top,
1983
- left: b.left,
1984
- maxHeight: b.maxHeight,
1985
- opacity: b.opacity,
2039
+ top: f.top,
2040
+ left: f.left,
2041
+ maxHeight: f.maxHeight,
2042
+ opacity: f.opacity,
1986
2043
  borderRadius: "var(--radius-lg)"
1987
2044
  },
1988
2045
  onClick: (x) => x.stopPropagation(),
1989
2046
  onMouseDown: (x) => x.stopPropagation(),
1990
2047
  onTouchStart: (x) => x.stopPropagation(),
1991
- children: n.map((x, p) => x.separator ? /* @__PURE__ */ e("div", { className: "h-0 border-t border-white/10 mx-2 my-1.5" }, p) : x.isLabel ? /* @__PURE__ */ e("div", { className: "px-3 py-1.5 text-[10px] font-bold text-zinc-500 uppercase tracking-wider select-none", children: /* @__PURE__ */ e(Xe, { content: x.html || "" }) }, p) : /* @__PURE__ */ d(ve.Fragment, { children: [
2048
+ children: i.map((x, p) => x.separator ? /* @__PURE__ */ e("div", { className: "h-0 border-t border-white/10 mx-2 my-1.5" }, p) : x.isLabel ? /* @__PURE__ */ e("div", { className: "px-3 py-1.5 text-[10px] font-bold text-zinc-500 uppercase tracking-wider select-none", children: /* @__PURE__ */ e(Ye, { content: x.html || "" }) }, p) : /* @__PURE__ */ d(ke.Fragment, { children: [
1992
2049
  /* @__PURE__ */ d(
1993
2050
  "button",
1994
2051
  {
@@ -2000,10 +2057,10 @@ const qe = (i, t = 200) => {
2000
2057
  style: { borderRadius: "var(--radius)" },
2001
2058
  children: [
2002
2059
  /* @__PURE__ */ d("div", { className: "flex items-center gap-3 overflow-hidden", children: [
2003
- x.icon && /* @__PURE__ */ e("span", { className: "text-zinc-400 w-4 h-4 flex items-center justify-center shrink-0 group-hover:text-zinc-300 transition-colors", children: /* @__PURE__ */ e(Xe, { content: x.icon }) }),
2004
- /* @__PURE__ */ e("span", { className: `flex items-center font-medium truncate ${x.checked ? "text-[var(--accent)]" : ""}`, children: /* @__PURE__ */ e(Xe, { content: x.html || "" }) })
2060
+ x.icon && /* @__PURE__ */ e("span", { className: "text-zinc-400 w-4 h-4 flex items-center justify-center shrink-0 group-hover:text-zinc-300 transition-colors", children: /* @__PURE__ */ e(Ye, { content: x.icon }) }),
2061
+ /* @__PURE__ */ e("span", { className: `flex items-center font-medium truncate ${x.checked ? "text-[var(--accent)]" : ""}`, children: /* @__PURE__ */ e(Ye, { content: x.html || "" }) })
2005
2062
  ] }),
2006
- x.checked && /* @__PURE__ */ e(Pe, { className: "w-4 h-4 text-[var(--accent)] shrink-0 ml-2" })
2063
+ x.checked && /* @__PURE__ */ e(Be, { className: "w-4 h-4 text-[var(--accent)] shrink-0 ml-2" })
2007
2064
  ]
2008
2065
  }
2009
2066
  ),
@@ -2011,29 +2068,29 @@ const qe = (i, t = 200) => {
2011
2068
  ] }, p))
2012
2069
  }
2013
2070
  );
2014
- }, bn = ({ player: i, onClose: t }) => {
2015
- const [n, o] = C({});
2016
- return q(() => {
2071
+ }, bn = ({ player: n, onClose: t }) => {
2072
+ const [i, o] = N({});
2073
+ return Q(() => {
2017
2074
  const r = () => {
2018
2075
  var g;
2019
- if (!i.video) return;
2020
- const u = i.video, b = u.getVideoPlaybackQuality ? u.getVideoPlaybackQuality() : null;
2076
+ if (!n.video) return;
2077
+ const u = n.video, f = u.getVideoPlaybackQuality ? u.getVideoPlaybackQuality() : null;
2021
2078
  o({
2022
2079
  "Player Size": `${u.offsetWidth} x ${u.offsetHeight}`,
2023
2080
  "Video Resolution": `${u.videoWidth} x ${u.videoHeight}`,
2024
2081
  "Current Time": `${u.currentTime.toFixed(3)}s`,
2025
2082
  Duration: `${u.duration.toFixed(3)}s`,
2026
2083
  Volume: `${Math.round(u.volume * 100)}%`,
2027
- "Dropped Frames": b ? b.droppedVideoFrames : "N/A",
2084
+ "Dropped Frames": f ? f.droppedVideoFrames : "N/A",
2028
2085
  Buffer: u.buffered.length > 0 ? `${(u.buffered.end(u.buffered.length - 1) - u.currentTime).toFixed(2)}s` : "0s",
2029
- Engine: ((g = i.store.get().sources[i.store.get().currentSourceIndex]) == null ? void 0 : g.type) || "native",
2086
+ Engine: ((g = n.store.get().sources[n.store.get().currentSourceIndex]) == null ? void 0 : g.type) || "native",
2030
2087
  URL: u.currentSrc
2031
2088
  });
2032
2089
  };
2033
2090
  r();
2034
2091
  const h = setInterval(r, 1e3);
2035
2092
  return () => clearInterval(h);
2036
- }, [i]), /* @__PURE__ */ e("div", { className: "absolute inset-0 z-[60] flex items-center justify-center bg-black/60 backdrop-blur-sm p-4 animate-in fade-in duration-200", children: /* @__PURE__ */ d(
2093
+ }, [n]), /* @__PURE__ */ e("div", { className: "absolute inset-0 z-[60] flex items-center justify-center bg-black/60 backdrop-blur-sm p-4 animate-in fade-in duration-200", children: /* @__PURE__ */ d(
2037
2094
  "div",
2038
2095
  {
2039
2096
  className: "bg-[var(--bg-panel)] border border-white/10 rounded-xl w-full max-w-md shadow-2xl relative font-mono text-xs text-zinc-300 flex flex-col",
@@ -2047,12 +2104,12 @@ const qe = (i, t = 200) => {
2047
2104
  r.stopPropagation(), t();
2048
2105
  },
2049
2106
  className: "absolute top-3 right-3 p-1.5 text-zinc-400 hover:text-white hover:bg-white/10 rounded-full transition-colors",
2050
- children: /* @__PURE__ */ e(Ut, { className: "w-4 h-4" })
2107
+ children: /* @__PURE__ */ e(Gt, { className: "w-4 h-4" })
2051
2108
  }
2052
2109
  ),
2053
2110
  /* @__PURE__ */ e("h3", { className: "text-sm font-bold text-white mb-4 uppercase tracking-wider border-b border-white/10 pb-2", children: "Video Statistics" })
2054
2111
  ] }),
2055
- /* @__PURE__ */ e("div", { className: "overflow-y-auto hide-scrollbar p-5 pt-0 space-y-2.5 flex-1 min-h-0", children: Object.entries(n).map(([r, h]) => /* @__PURE__ */ d("div", { className: "flex flex-col sm:flex-row sm:justify-between sm:items-center gap-1", children: [
2112
+ /* @__PURE__ */ e("div", { className: "overflow-y-auto hide-scrollbar p-5 pt-0 space-y-2.5 flex-1 min-h-0", children: Object.entries(i).map(([r, h]) => /* @__PURE__ */ d("div", { className: "flex flex-col sm:flex-row sm:justify-between sm:items-center gap-1", children: [
2056
2113
  /* @__PURE__ */ e("span", { className: "text-zinc-500 font-bold shrink-0", children: r }),
2057
2114
  /* @__PURE__ */ e("span", { className: "text-zinc-200 truncate select-all font-medium bg-white/5 px-1.5 py-0.5 rounded break-all text-right", title: String(h), children: String(h) })
2058
2115
  ] }, r)) })
@@ -2060,11 +2117,11 @@ const qe = (i, t = 200) => {
2060
2117
  }
2061
2118
  ) });
2062
2119
  };
2063
- function gn(i) {
2064
- if (!i) return "#ffffff";
2065
- i = i.replace("#", ""), i.length === 3 && (i = i.split("").map((h) => h + h).join(""));
2066
- const t = parseInt(i.substring(0, 2), 16), n = parseInt(i.substring(2, 4), 16), o = parseInt(i.substring(4, 6), 16);
2067
- return (t * 299 + n * 587 + o * 114) / 1e3 >= 128 ? "#000000" : "#ffffff";
2120
+ function gn(n) {
2121
+ if (!n) return "#ffffff";
2122
+ n = n.replace("#", ""), n.length === 3 && (n = n.split("").map((h) => h + h).join(""));
2123
+ const t = parseInt(n.substring(0, 2), 16), i = parseInt(n.substring(2, 4), 16), o = parseInt(n.substring(4, 6), 16);
2124
+ return (t * 299 + i * 587 + o * 114) / 1e3 >= 128 ? "#000000" : "#ffffff";
2068
2125
  }
2069
2126
  const vn = [
2070
2127
  { label: "Strata", value: "#6366f1" },
@@ -2078,73 +2135,73 @@ const vn = [
2078
2135
  { label: "Pixel", value: "pixel", color: "#ef4444" },
2079
2136
  { label: "Game", value: "game", color: "#eab308" },
2080
2137
  { label: "Hacker", value: "hacker", color: "#22c55e" }
2081
- ], Bt = ({ content: i, className: t, style: n }) => typeof i == "string" ? i.trim().startsWith("<") ? /* @__PURE__ */ e("div", { className: t, style: n, dangerouslySetInnerHTML: { __html: i } }) : /* @__PURE__ */ e("div", { className: t, style: n, children: i }) : /* @__PURE__ */ e("div", { className: t, style: n, children: i }), Dt = (i) => {
2082
- var Pt, Lt;
2083
- const { src: t, type: n, sources: o, poster: r, autoPlay: h, thumbnails: u, textTracks: b, plugins: g, onGetInstance: x, ...p } = i, w = p.screenshot ?? !1, f = p.pip ?? !0, M = p.setting ?? !0, z = p.fullscreen ?? !0, j = p.fullscreenWeb ?? !1, D = p.lock ?? !1, O = p.fastForward ?? !0, m = p.flip ?? !0, V = p.aspectRatio ?? !0, B = p.hotKey ?? !0, X = p.backdrop ?? !0, ee = p.gestureSeek ?? !1, ue = p.centerControls ?? !0, ce = p.fetchTimeout ?? 3e4;
2138
+ ], Dt = ({ content: n, className: t, style: i }) => typeof n == "string" ? n.trim().startsWith("<") ? /* @__PURE__ */ e("div", { className: t, style: i, dangerouslySetInnerHTML: { __html: n } }) : /* @__PURE__ */ e("div", { className: t, style: i, children: n }) : /* @__PURE__ */ e("div", { className: t, style: i, children: n }), Ot = (n) => {
2139
+ var Lt, $t;
2140
+ const { src: t, type: i, sources: o, poster: r, autoPlay: h, thumbnails: u, textTracks: f, plugins: g, onGetInstance: x, ...p } = n, w = p.screenshot ?? !1, m = p.pip ?? !0, T = p.setting ?? !0, I = p.fullscreen ?? !0, O = p.fullscreenWeb ?? !1, Y = p.lock ?? !1, W = p.fastForward ?? !0, b = p.flip ?? !0, H = p.aspectRatio ?? !0, k = p.hotKey ?? !0, q = p.backdrop ?? !0, $ = p.gestureSeek ?? !1, j = p.centerControls ?? !0, Z = p.fetchTimeout ?? 3e4;
2084
2141
  p.autoOrientation;
2085
- const G = H(null), [s, Ze] = C(null), [Le, $e] = C(!1), [et, tt] = C(0), [_t, it] = C(0), [nt, qt] = C(!1), st = fe(() => Ht(p), []), a = bi(
2086
- Te((c) => s ? s.store.subscribe(c) : () => {
2142
+ const P = U(null), [s, ie] = N(null), [ne, le] = N(!1), [ce, Se] = N(0), [nt, Ce] = N(0), [st, qt] = N(!1), ot = xe(() => Wt(p), []), a = bi(
2143
+ $e((c) => s ? s.store.subscribe(c) : () => {
2087
2144
  }, [s]),
2088
- () => s ? s.store.get() : st,
2089
- () => st
2090
- ), Xt = fe(() => gn(a.themeColor), [a.themeColor]), [E, ot] = C(!1), [F, rt] = C(!1), [_, A] = C("main"), [P, Ee] = C(null), Fe = H(null);
2091
- P && (Fe.current = P);
2092
- const [Z, at] = C({ x: 0, y: 0, visible: !1 }), [Qt, lt] = C(!1), ct = qe(E, 300), dt = qe(F, 300), xe = qe(!!P, 300), S = Te(() => {
2093
- (E || F || P || Z.visible) && (ot(!1), rt(!1), Ee(null), at((c) => ({ ...c, visible: !1 })));
2094
- }, [E, F, P, Z.visible]);
2095
- q(() => {
2145
+ () => s ? s.store.get() : ot,
2146
+ () => ot
2147
+ ), Xt = xe(() => gn(a.themeColor), [a.themeColor]), [B, rt] = N(!1), [V, at] = N(!1), [X, D] = N("main"), [E, Ve] = N(null), De = U(null);
2148
+ E && (De.current = E);
2149
+ const [se, lt] = N({ x: 0, y: 0, visible: !1 }), [Qt, ct] = N(!1), dt = Ke(B, 300), ut = Ke(V, 300), Ne = Ke(!!E, 300), C = $e(() => {
2150
+ (B || V || E || se.visible) && (rt(!1), at(!1), Ve(null), lt((c) => ({ ...c, visible: !1 })));
2151
+ }, [B, V, E, se.visible]);
2152
+ Q(() => {
2096
2153
  const c = (v) => {
2097
- (E || F || P || Z.visible) && S();
2154
+ (B || V || E || se.visible) && C();
2098
2155
  };
2099
- return (E || F || P || Z.visible) && (document.addEventListener("click", c), document.addEventListener("touchstart", c)), () => {
2156
+ return (B || V || E || se.visible) && (document.addEventListener("click", c), document.addEventListener("touchstart", c)), () => {
2100
2157
  document.removeEventListener("click", c), document.removeEventListener("touchstart", c);
2101
2158
  };
2102
- }, [E, F, P, Z.visible, S]);
2103
- const [Ae, we] = C(!1), [ye, Ve] = C(0), [Jt, ut] = C(!1), [Kt, ht] = C(!1), [Be, ke] = C(!1), [pt, mt] = C([]), [ft, bt] = C(null), [Yt, Zt] = C(0), [ie, gt] = C(null), [se, Se] = C(null), [wn, vt] = C(null), [De, xt] = C(!1), Oe = H(null), wt = H(1), he = H(null), yt = H(0), de = H(!1), pe = H(null), ne = H(null), He = H(null), We = H(null), me = H(null);
2104
- ze(() => {
2105
- s && G.current && s.attach(G.current);
2106
- }, [s, a.isWebFullscreen]), ze(() => {
2107
- if (!G.current) return;
2159
+ }, [B, V, E, se.visible, C]);
2160
+ const [Oe, Me] = N(!1), [Te, He] = N(0), [Jt, ht] = N(!1), [Kt, pt] = N(!1), [We, ze] = N(!1), [mt, ft] = N([]), [bt, gt] = N(null), [Yt, Zt] = N(0), [re, vt] = N(null), [de, Ie] = N(null), [wn, xt] = N(null), [je, wt] = N(!1), Ue = U(null), yt = U(1), be = U(null), kt = U(0), fe = U(!1), ge = U(null), ae = U(null), Ge = U(null), _e = U(null), ve = U(null);
2161
+ Ee(() => {
2162
+ s && P.current && s.attach(P.current);
2163
+ }, [s, a.isWebFullscreen]), Ee(() => {
2164
+ if (!P.current) return;
2108
2165
  (() => {
2109
- G.current && (tt(G.current.clientHeight), it(G.current.clientWidth));
2166
+ P.current && (Se(P.current.clientHeight), Ce(P.current.clientWidth));
2110
2167
  })();
2111
- const v = new ResizeObserver((k) => {
2112
- for (const N of k)
2113
- tt(N.contentRect.height), it(N.contentRect.width);
2168
+ const v = new ResizeObserver((S) => {
2169
+ for (const M of S)
2170
+ Se(M.contentRect.height), Ce(M.contentRect.width);
2114
2171
  });
2115
- return v.observe(G.current), () => {
2172
+ return v.observe(P.current), () => {
2116
2173
  v.disconnect();
2117
2174
  };
2118
- }, [a.isWebFullscreen]), q(() => {
2119
- if (qt("ontouchstart" in window || navigator.maxTouchPoints > 0), !G.current) return;
2175
+ }, [a.isWebFullscreen]), Q(() => {
2176
+ if (qt("ontouchstart" in window || navigator.maxTouchPoints > 0), !P.current) return;
2120
2177
  const c = new Ni({ ...p, poster: r });
2121
- return g && g.length > 0 && g.forEach((v) => c.use(v)), c.attach(G.current), Ze(c), x && x(c), () => {
2122
- c.destroy(), Ze(null);
2178
+ return g && g.length > 0 && g.forEach((v) => c.use(v)), c.attach(P.current), ie(c), x && x(c), () => {
2179
+ c.destroy(), ie(null);
2123
2180
  };
2124
- }, []), q(() => {
2181
+ }, []), Q(() => {
2125
2182
  if (!s) return;
2126
2183
  const c = {};
2127
2184
  p.theme !== void 0 && p.theme !== a.theme && (c.theme = p.theme), p.themeColor !== void 0 && p.themeColor !== a.themeColor && (c.themeColor = p.themeColor), p.iconSize !== void 0 && p.iconSize !== a.iconSize && (c.iconSize = p.iconSize), Object.keys(c).length > 0 && s.setAppearance(c), p.volume !== void 0 && Math.abs(p.volume - a.volume) > 0.01 && s.setVolume(p.volume), p.muted !== void 0 && p.muted !== a.isMuted && (p.muted ? s.video.muted = !0 : s.video.muted = !1);
2128
- }, [s, p.theme, p.themeColor, p.iconSize, p.volume, p.muted]), q(() => {
2185
+ }, [s, p.theme, p.themeColor, p.iconSize, p.volume, p.muted]), Q(() => {
2129
2186
  if (!s) return;
2130
- const c = b || [];
2131
- o && o.length > 0 ? ($e(!1), s.setSources(o, c)) : t && ($e(!1), s.setSources([{ url: t, type: n || "auto" }], c));
2132
- }, [t, n, o, b, s]), q(() => {
2187
+ const c = f || [];
2188
+ o && o.length > 0 ? (le(!1), s.setSources(o, c)) : t && (le(!1), s.setSources([{ url: t, type: i || "auto" }], c));
2189
+ }, [t, i, o, f, s]), Q(() => {
2133
2190
  s && h && s.play().catch(() => {
2134
- s.pause(), s.notify({ type: "warning", message: "Autoplay blocked by browser. Click play to start.", duration: 5e3 });
2191
+ s.pause(), s.store.setState({ isPlaying: !1, isBuffering: !1 }), s.notify({ type: "warning", message: "Autoplay blocked by browser. Click play to start.", duration: 5e3 });
2135
2192
  });
2136
- }, [s, h]), q(() => {
2137
- a.isPlaying && !Le && $e(!0);
2138
- }, [a.isPlaying, Le]), q(() => {
2139
- u && s ? Si(u, s.notify.bind(s), ce).then((c) => mt(c)) : mt([]);
2140
- }, [u, s, ce]), q(() => (se && (me.current && clearTimeout(me.current), me.current = setTimeout(() => {
2141
- Se(null);
2193
+ }, [s, h]), Q(() => {
2194
+ a.isPlaying && !ne && le(!0);
2195
+ }, [a.isPlaying, ne]), Q(() => {
2196
+ u && s ? Si(u, s.notify.bind(s), Z).then((c) => ft(c)) : ft([]);
2197
+ }, [u, s, Z]), Q(() => (de && (ve.current && clearTimeout(ve.current), ve.current = setTimeout(() => {
2198
+ Ie(null);
2142
2199
  }, 600)), () => {
2143
- me.current && clearTimeout(me.current);
2144
- }), [se]), q(() => {
2200
+ ve.current && clearTimeout(ve.current);
2201
+ }), [de]), Q(() => {
2145
2202
  const c = (v) => {
2146
- var N;
2147
- if (!s || !B || ((N = document.activeElement) == null ? void 0 : N.tagName) === "INPUT") return;
2203
+ var M;
2204
+ if (!s || !k || ((M = document.activeElement) == null ? void 0 : M.tagName) === "INPUT") return;
2148
2205
  switch (v.key.toLowerCase()) {
2149
2206
  case " ":
2150
2207
  case "k":
@@ -2174,111 +2231,111 @@ const vn = [
2174
2231
  }
2175
2232
  };
2176
2233
  return window.addEventListener("keydown", c), () => window.removeEventListener("keydown", c);
2177
- }, [s, B]);
2178
- const kt = () => {
2179
- s && (s.setControlsVisible(!0), ne.current && clearTimeout(ne.current), !(E || F || P) && (ne.current = setTimeout(() => {
2180
- !a.isPlaying || E || F || P || s.setControlsVisible(!1);
2234
+ }, [s, k]);
2235
+ const St = () => {
2236
+ s && (s.setControlsVisible(!0), ae.current && clearTimeout(ae.current), !(B || V || E) && (ae.current = setTimeout(() => {
2237
+ !a.isPlaying || B || V || E || s.setControlsVisible(!1);
2181
2238
  }, 2500)));
2182
2239
  };
2183
- q(() => {
2184
- s && (!E && !F && !P && a.isPlaying ? kt() : (E || F || P) && (s.setControlsVisible(!0), ne.current && clearTimeout(ne.current)));
2185
- }, [E, F, P, a.isPlaying, s]);
2186
- const St = Te(() => {
2187
- if (!(!O || !s || !a.isPlaying || a.isLocked)) {
2188
- if (E || F || P) {
2189
- S();
2240
+ Q(() => {
2241
+ s && (!B && !V && !E && a.isPlaying ? St() : (B || V || E) && (s.setControlsVisible(!0), ae.current && clearTimeout(ae.current)));
2242
+ }, [B, V, E, a.isPlaying, s]);
2243
+ const Ct = $e(() => {
2244
+ if (!(!W || !s || !a.isPlaying || a.isLocked)) {
2245
+ if (B || V || E) {
2246
+ C();
2190
2247
  return;
2191
2248
  }
2192
- wt.current = s.video.playbackRate, Oe.current = setTimeout(() => {
2193
- s.video.playbackRate = 2, xt(!0);
2249
+ yt.current = s.video.playbackRate, Ue.current = setTimeout(() => {
2250
+ s.video.playbackRate = 2, wt(!0);
2194
2251
  }, 500);
2195
2252
  }
2196
- }, [O, s, a.isPlaying, a.isLocked, E, F, P]), je = Te(() => {
2197
- Oe.current && clearTimeout(Oe.current), De && s && (s.video.playbackRate = wt.current, xt(!1));
2198
- }, [De, s]), ei = (c) => {
2199
- if (St(), E || F || P) {
2200
- S();
2253
+ }, [W, s, a.isPlaying, a.isLocked, B, V, E]), qe = $e(() => {
2254
+ Ue.current && clearTimeout(Ue.current), je && s && (s.video.playbackRate = yt.current, wt(!1));
2255
+ }, [je, s]), ei = (c) => {
2256
+ if (Ct(), B || V || E) {
2257
+ C();
2201
2258
  return;
2202
2259
  }
2203
- ee && !a.isLocked && (he.current = c.touches[0].clientX, yt.current = a.currentTime, de.current = !1);
2260
+ $ && !a.isLocked && (be.current = c.touches[0].clientX, kt.current = a.currentTime, fe.current = !1);
2204
2261
  }, ti = (c) => {
2205
- if (!a.isLocked && ee && he.current !== null) {
2206
- const v = c.touches[0].clientX - he.current;
2207
- if (Math.abs(v) > 10 && (je(), de.current = !0, we(!0), G.current && a.duration)) {
2208
- const k = G.current.getBoundingClientRect(), N = v / k.width, R = Math.max(0, Math.min(a.duration, yt.current + N * a.duration));
2209
- Ve(R);
2262
+ if (!a.isLocked && $ && be.current !== null) {
2263
+ const v = c.touches[0].clientX - be.current;
2264
+ if (Math.abs(v) > 10 && (qe(), fe.current = !0, Me(!0), P.current && a.duration)) {
2265
+ const S = P.current.getBoundingClientRect(), M = v / S.width, L = Math.max(0, Math.min(a.duration, kt.current + M * a.duration));
2266
+ He(L);
2210
2267
  }
2211
2268
  }
2212
2269
  }, ii = (c) => {
2213
- if (je(), ee && de.current) {
2214
- s == null || s.seek(ye), we(!1), de.current = !1, he.current = null;
2270
+ if (qe(), $ && fe.current) {
2271
+ s == null || s.seek(Te), Me(!1), fe.current = !1, be.current = null;
2215
2272
  return;
2216
2273
  }
2217
- he.current = null;
2218
- }, Ue = (c) => {
2219
- if (!He.current || !a.duration) return 0;
2220
- const v = He.current.getBoundingClientRect(), k = "touches" in c ? c.touches[0].clientX : c.clientX;
2221
- return Math.max(0, Math.min(1, (k - v.left) / v.width)) * a.duration;
2222
- }, Ct = (c) => {
2274
+ be.current = null;
2275
+ }, Xe = (c) => {
2276
+ if (!Ge.current || !a.duration) return 0;
2277
+ const v = Ge.current.getBoundingClientRect(), S = "touches" in c ? c.touches[0].clientX : c.clientX;
2278
+ return Math.max(0, Math.min(1, (S - v.left) / v.width)) * a.duration;
2279
+ }, Nt = (c) => {
2223
2280
  if (c.stopPropagation(), a.isLocked) return;
2224
- (E || F || P) && S(), we(!0), Ve(Ue(c));
2225
- const v = (N) => Ve(Ue(N)), k = (N) => {
2226
- s == null || s.seek(Ue(N)), we(!1), document.removeEventListener("mousemove", v), document.removeEventListener("touchmove", v), document.removeEventListener("mouseup", k), document.removeEventListener("touchend", k);
2281
+ (B || V || E) && C(), Me(!0), He(Xe(c));
2282
+ const v = (M) => He(Xe(M)), S = (M) => {
2283
+ s == null || s.seek(Xe(M)), Me(!1), document.removeEventListener("mousemove", v), document.removeEventListener("touchmove", v), document.removeEventListener("mouseup", S), document.removeEventListener("touchend", S);
2227
2284
  };
2228
- document.addEventListener("mousemove", v), document.addEventListener("touchmove", v), document.addEventListener("mouseup", k), document.addEventListener("touchend", k);
2229
- }, Nt = (c) => {
2230
- if (!We.current) return 0;
2231
- const v = We.current.getBoundingClientRect(), k = "touches" in c ? c.touches[0].clientX : c.clientX;
2232
- return Math.max(0, Math.min(1, (k - v.left) / v.width));
2285
+ document.addEventListener("mousemove", v), document.addEventListener("touchmove", v), document.addEventListener("mouseup", S), document.addEventListener("touchend", S);
2233
2286
  }, Mt = (c) => {
2287
+ if (!_e.current) return 0;
2288
+ const v = _e.current.getBoundingClientRect(), S = "touches" in c ? c.touches[0].clientX : c.clientX;
2289
+ return Math.max(0, Math.min(1, (S - v.left) / v.width));
2290
+ }, Tt = (c) => {
2234
2291
  if (c.stopPropagation(), !s || a.isLocked) return;
2235
- ut(!0), s.setVolume(Nt(c));
2236
- const v = (N) => s.setVolume(Nt(N)), k = () => {
2237
- ut(!1), document.removeEventListener("mousemove", v), document.removeEventListener("touchmove", v), document.removeEventListener("mouseup", k), document.removeEventListener("touchend", k);
2292
+ ht(!0), s.setVolume(Mt(c));
2293
+ const v = (M) => s.setVolume(Mt(M)), S = () => {
2294
+ ht(!1), document.removeEventListener("mousemove", v), document.removeEventListener("touchmove", v), document.removeEventListener("mouseup", S), document.removeEventListener("touchend", S);
2238
2295
  };
2239
- document.addEventListener("mousemove", v), document.addEventListener("touchmove", v), document.addEventListener("mouseup", k), document.addEventListener("touchend", k);
2296
+ document.addEventListener("mousemove", v), document.addEventListener("touchmove", v), document.addEventListener("mouseup", S), document.addEventListener("touchend", S);
2240
2297
  }, ni = (c) => {
2241
2298
  if (!a.duration || a.isLive) return;
2242
- const v = c.currentTarget.getBoundingClientRect(), k = (c.clientX - v.left) / v.width, N = k * a.duration;
2243
- Zt(k * 100), bt(N), pt.length > 0 && gt(pt.find((R) => N >= R.start && N < R.end) || null);
2244
- }, Ce = (c) => {
2245
- !s || a.isLocked || (s.skip(c === "forward" ? 10 : -10), vt(c), setTimeout(() => vt(null), 300));
2299
+ const v = c.currentTarget.getBoundingClientRect(), S = (c.clientX - v.left) / v.width, M = S * a.duration;
2300
+ Zt(S * 100), gt(M), mt.length > 0 && vt(mt.find((L) => M >= L.start && M < L.end) || null);
2301
+ }, Re = (c) => {
2302
+ !s || a.isLocked || (s.skip(c === "forward" ? 10 : -10), xt(c), setTimeout(() => xt(null), 300));
2246
2303
  }, si = (c) => {
2247
2304
  if (!s) return;
2248
- if (de.current) {
2249
- de.current = !1;
2305
+ if (fe.current) {
2306
+ fe.current = !1;
2250
2307
  return;
2251
2308
  }
2252
- if (E || F || P || Z.visible) {
2253
- S();
2309
+ if (B || V || E || se.visible) {
2310
+ C();
2254
2311
  return;
2255
2312
  }
2256
- if (Be && ke(!1), s.setControlsVisible(!0), ne.current && clearTimeout(ne.current), ne.current = setTimeout(() => {
2257
- !a.isPlaying || E || F || P || s.setControlsVisible(!1);
2313
+ if (We && ze(!1), s.setControlsVisible(!0), ae.current && clearTimeout(ae.current), ae.current = setTimeout(() => {
2314
+ !a.isPlaying || B || V || E || s.setControlsVisible(!1);
2258
2315
  }, 2500), a.isLocked) return;
2259
- const v = c.currentTarget.getBoundingClientRect(), k = c.clientX - v.left, N = v.width, R = Date.now();
2260
- pe.current ? (clearTimeout(pe.current), pe.current = null, k < N * 0.35 ? (Ce("rewind"), Se({ type: "rewind", id: R })) : k > N * 0.65 ? (Ce("forward"), Se({ type: "forward", id: R })) : s.toggleFullscreen()) : pe.current = setTimeout(() => {
2261
- s.togglePlay(), pe.current = null;
2316
+ const v = c.currentTarget.getBoundingClientRect(), S = c.clientX - v.left, M = v.width, L = Date.now();
2317
+ ge.current ? (clearTimeout(ge.current), ge.current = null, S < M * 0.35 ? (Re("rewind"), Ie({ type: "rewind", id: L })) : S > M * 0.65 ? (Re("forward"), Ie({ type: "forward", id: L })) : s.toggleFullscreen()) : ge.current = setTimeout(() => {
2318
+ s.togglePlay(), ge.current = null;
2262
2319
  }, 250);
2263
2320
  }, oi = (c) => {
2264
- var k;
2321
+ var S;
2265
2322
  if (c.preventDefault(), c.stopPropagation(), a.isLocked) return;
2266
- S();
2267
- const v = (k = G.current) == null ? void 0 : k.getBoundingClientRect();
2323
+ C();
2324
+ const v = (S = P.current) == null ? void 0 : S.getBoundingClientRect();
2268
2325
  v && requestAnimationFrame(() => {
2269
- at({
2326
+ lt({
2270
2327
  visible: !0,
2271
2328
  x: c.clientX - v.left,
2272
2329
  y: c.clientY - v.top
2273
2330
  });
2274
2331
  });
2275
2332
  }, ri = (c) => {
2276
- if (c.stopPropagation(), S(), Be) {
2277
- ke(!1);
2333
+ if (c.stopPropagation(), C(), We) {
2334
+ ze(!1);
2278
2335
  return;
2279
2336
  }
2280
- nt ? ke(!0) : s == null || s.toggleMute();
2281
- }, ai = a.isMuted || a.volume === 0 ? zi : a.volume < 0.5 ? Ti : Mi, Ne = Math.max(100, et - 120), li = () => {
2337
+ st ? ze(!0) : s == null || s.toggleMute();
2338
+ }, ai = a.isMuted || a.volume === 0 ? zi : a.volume < 0.5 ? Ti : Mi, Pe = Math.max(100, ce - 120), li = () => {
2282
2339
  switch (a.iconSize) {
2283
2340
  case "small":
2284
2341
  return "w-4 h-4";
@@ -2296,7 +2353,7 @@ const vn = [
2296
2353
  default:
2297
2354
  return "p-2.5 min-w-[36px] min-h-[36px]";
2298
2355
  }
2299
- }, Q = li(), K = ci(), oe = (() => {
2356
+ }, J = li(), ee = ci(), ue = (() => {
2300
2357
  switch (a.iconSize) {
2301
2358
  case "small":
2302
2359
  return {
@@ -2320,7 +2377,7 @@ const vn = [
2320
2377
  skipIcon: "w-6 h-6"
2321
2378
  };
2322
2379
  }
2323
- })(), di = !a.isLocked && (a.controlsVisible || !a.isPlaying || E || F || P || Z.visible), Tt = Kt || Jt || Be, Me = X ? "backdrop-blur-xl bg-black/80" : "bg-black/95", zt = fe(() => {
2380
+ })(), di = !a.isLocked && (a.controlsVisible || !a.isPlaying || B || V || E || se.visible), zt = Kt || Jt || We, Le = q ? "backdrop-blur-xl bg-black/80" : "bg-black/95", It = xe(() => {
2324
2381
  const c = [
2325
2382
  { id: "play", position: "left", index: 10, isBuiltIn: !0 },
2326
2383
  { id: "volume", position: "left", index: 20, isBuiltIn: !0 },
@@ -2333,56 +2390,56 @@ const vn = [
2333
2390
  { id: "fullscreenWeb", position: "right", index: 110, isBuiltIn: !0 },
2334
2391
  { id: "fullscreen", position: "right", index: 120, isBuiltIn: !0 }
2335
2392
  ];
2336
- p.controls && p.controls.forEach((R) => {
2337
- const re = c.find((l) => l.id === R.id);
2338
- re ? Object.assign(re, R) : c.push(R);
2393
+ p.controls && p.controls.forEach((L) => {
2394
+ const he = c.find((l) => l.id === L.id);
2395
+ he ? Object.assign(he, L) : c.push(L);
2339
2396
  });
2340
- const v = a.sources[a.currentSourceIndex] || { url: t || "", type: n || "auto" }, k = v.type === "hls" || v.url.includes(".m3u8"), N = c.find((R) => R.id === "download");
2341
- return N && (k ? (N.children = [
2397
+ const v = a.sources[a.currentSourceIndex] || { url: t || "", type: i || "auto" }, S = v.type === "hls" || v.url.includes(".m3u8"), M = c.find((L) => L.id === "download");
2398
+ return M && (S ? (M.children = [
2342
2399
  { html: "Download Format", isLabel: !0 },
2343
2400
  {
2344
2401
  html: "MPEG-TS",
2345
2402
  value: "Original Stream",
2346
- icon: /* @__PURE__ */ e(Gt, { className: "w-3.5 h-3.5" }),
2403
+ icon: /* @__PURE__ */ e(_t, { className: "w-3.5 h-3.5" }),
2347
2404
  onClick: () => s == null ? void 0 : s.download({ format: "ts" })
2348
2405
  },
2349
2406
  {
2350
2407
  html: "MP4",
2351
2408
  value: "Converted",
2352
- icon: /* @__PURE__ */ e(Wt, { className: "w-3.5 h-3.5" }),
2409
+ icon: /* @__PURE__ */ e(jt, { className: "w-3.5 h-3.5" }),
2353
2410
  onClick: () => s == null ? void 0 : s.download({ format: "mp4" })
2354
2411
  }
2355
- ], N.onClick = void 0) : (N.children = void 0, N.onClick = (R) => R.download())), c.filter((R) => !(R.id === "screenshot" && !w || R.id === "pip" && !f || R.id === "settings" && !M || R.id === "fullscreen" && !z || R.id === "fullscreenWeb" && !j)).sort((R, re) => R.index - re.index);
2356
- }, [p.controls, w, f, M, z, j, a.currentSourceIndex, a.sources, t, n]), It = (c) => {
2357
- var v, k, N, R, re;
2412
+ ], M.onClick = void 0) : (M.children = void 0, M.onClick = (L) => L.download())), c.filter((L) => !(L.id === "screenshot" && !w || L.id === "pip" && !m || L.id === "settings" && !T || L.id === "fullscreen" && !I || L.id === "fullscreenWeb" && !O)).sort((L, he) => L.index - he.index);
2413
+ }, [p.controls, w, m, T, I, O, a.currentSourceIndex, a.sources, t, i]), Rt = (c) => {
2414
+ var v, S, M, L, he;
2358
2415
  if (!c.isBuiltIn) {
2359
- const l = c.id || `ctrl-${c.index}`, L = P === l, W = L || xe.isMounted && Fe.current === l;
2416
+ const l = c.id || `ctrl-${c.index}`, F = E === l, G = F || Ne.isMounted && De.current === l;
2360
2417
  return /* @__PURE__ */ d("div", { className: "relative", children: [
2361
2418
  /* @__PURE__ */ e(
2362
2419
  "button",
2363
2420
  {
2364
- onMouseDown: (T) => T.stopPropagation(),
2365
- onTouchStart: (T) => T.stopPropagation(),
2366
- onClick: (T) => {
2367
- if (T.stopPropagation(), c.children) {
2368
- const Ge = L;
2369
- S(), Ge || Ee(l);
2421
+ onMouseDown: (z) => z.stopPropagation(),
2422
+ onTouchStart: (z) => z.stopPropagation(),
2423
+ onClick: (z) => {
2424
+ if (z.stopPropagation(), c.children) {
2425
+ const Qe = F;
2426
+ C(), Qe || Ve(l);
2370
2427
  } else
2371
- S(), c.click ? c.click(s) : c.onClick && c.onClick(s);
2428
+ C(), c.click ? c.click(s) : c.onClick && c.onClick(s);
2372
2429
  },
2373
- className: `strata-control-btn transition-colors focus:outline-none flex items-center justify-center ${K} ${L ? "text-[var(--accent)] bg-white/10" : "text-zinc-300 hover:text-white hover:bg-white/10"} ${c.className || ""}`,
2430
+ className: `strata-control-btn transition-colors focus:outline-none flex items-center justify-center ${ee} ${F ? "text-[var(--accent)] bg-white/10" : "text-zinc-300 hover:text-white hover:bg-white/10"} ${c.className || ""}`,
2374
2431
  style: { borderRadius: "var(--radius)", ...c.style },
2375
2432
  title: c.tooltip,
2376
- children: /* @__PURE__ */ e(Bt, { content: c.html || "" })
2433
+ children: /* @__PURE__ */ e(Dt, { content: c.html || "" })
2377
2434
  }
2378
2435
  ),
2379
- c.children && W && /* @__PURE__ */ e(
2436
+ c.children && G && /* @__PURE__ */ e(
2380
2437
  Vt,
2381
2438
  {
2382
2439
  items: c.children,
2383
- onClose: S,
2384
- maxHeight: Ne,
2385
- className: `strata-backdrop ${Me} ${xe.isVisible ? "opacity-100 translate-y-0 scale-100 animate-in fade-in zoom-in-95 duration-300" : "opacity-0 translate-y-2 scale-95 duration-300"}`
2440
+ onClose: C,
2441
+ maxHeight: Pe,
2442
+ className: `strata-backdrop ${Le} ${Ne.isVisible ? "opacity-100 translate-y-0 scale-100 animate-in fade-in zoom-in-95 duration-300" : "opacity-0 translate-y-2 scale-95 duration-300"}`
2386
2443
  }
2387
2444
  )
2388
2445
  ] }, c.index);
@@ -2390,26 +2447,26 @@ const vn = [
2390
2447
  switch (c.id) {
2391
2448
  case "play":
2392
2449
  return /* @__PURE__ */ e("button", { onMouseDown: (l) => l.stopPropagation(), onTouchStart: (l) => l.stopPropagation(), onClick: (l) => {
2393
- l.stopPropagation(), S(), s == null || s.togglePlay();
2394
- }, className: `strata-control-btn text-zinc-300 hover:text-white transition-colors hover:bg-white/10 focus:outline-none ${K}`, style: { borderRadius: "var(--radius)" }, children: a.isPlaying ? /* @__PURE__ */ e(Et, { className: `${Q} fill-current` }) : /* @__PURE__ */ e($t, { className: `${Q} fill-current` }) }, "play");
2450
+ l.stopPropagation(), C(), s == null || s.togglePlay();
2451
+ }, className: `strata-control-btn text-zinc-300 hover:text-white transition-colors hover:bg-white/10 focus:outline-none ${ee}`, style: { borderRadius: "var(--radius)" }, children: a.isPlaying ? /* @__PURE__ */ e(Ft, { className: `${J} fill-current` }) : /* @__PURE__ */ e(Et, { className: `${J} fill-current` }) }, "play");
2395
2452
  case "volume":
2396
2453
  return /* @__PURE__ */ d(
2397
2454
  "div",
2398
2455
  {
2399
2456
  className: "flex items-center gap-2 group/vol relative",
2400
2457
  onMouseEnter: () => {
2401
- window.matchMedia("(hover: hover)").matches && ht(!0);
2458
+ window.matchMedia("(hover: hover)").matches && pt(!0);
2402
2459
  },
2403
2460
  onMouseLeave: () => {
2404
- window.matchMedia("(hover: hover)").matches && ht(!1);
2461
+ window.matchMedia("(hover: hover)").matches && pt(!1);
2405
2462
  },
2406
2463
  children: [
2407
- /* @__PURE__ */ e("button", { onMouseDown: (l) => l.stopPropagation(), onTouchStart: (l) => l.stopPropagation(), onClick: ri, className: `strata-control-btn text-zinc-300 hover:text-white hover:bg-white/10 focus:outline-none ${K}`, style: { borderRadius: "var(--radius)" }, children: /* @__PURE__ */ e(ai, { className: Q }) }),
2408
- /* @__PURE__ */ e("div", { className: `relative h-8 flex items-center transition-all duration-300 ease-out overflow-hidden ${Tt ? "w-28 opacity-100 ml-1" : "w-0 opacity-0"}`, children: /* @__PURE__ */ d("div", { ref: We, className: "relative w-full h-full flex items-center cursor-pointer px-2", onMouseDown: Mt, onTouchStart: Mt, children: [
2464
+ /* @__PURE__ */ e("button", { onMouseDown: (l) => l.stopPropagation(), onTouchStart: (l) => l.stopPropagation(), onClick: ri, className: `strata-control-btn text-zinc-300 hover:text-white hover:bg-white/10 focus:outline-none ${ee}`, style: { borderRadius: "var(--radius)" }, children: /* @__PURE__ */ e(ai, { className: J }) }),
2465
+ /* @__PURE__ */ e("div", { className: `relative h-8 flex items-center transition-all duration-300 ease-out overflow-hidden ${zt ? "w-28 opacity-100 ml-1" : "w-0 opacity-0"}`, children: /* @__PURE__ */ d("div", { ref: _e, className: "relative w-full h-full flex items-center cursor-pointer px-2", onMouseDown: Tt, onTouchStart: Tt, children: [
2409
2466
  /* @__PURE__ */ e("div", { className: "w-full h-1 bg-white/20 overflow-hidden", style: { borderRadius: "var(--radius-full)" }, children: /* @__PURE__ */ e("div", { className: "h-full bg-white", style: { width: `${(a.isMuted ? 0 : a.volume) * 100}%`, borderRadius: "var(--radius-full)" } }) }),
2410
2467
  /* @__PURE__ */ e("div", { className: "absolute h-3 w-3 bg-white shadow-md top-1/2 -translate-y-1/2 pointer-events-none", style: { left: `calc(${(a.isMuted ? 0 : a.volume) * 100}% * 0.85 + 4px)`, borderRadius: "var(--radius-full)" } })
2411
2468
  ] }) }),
2412
- Tt && /* @__PURE__ */ e("div", { className: "strata-tooltip absolute bottom-full mb-2 px-1.5 py-0.5 rounded text-[10px] font-bold font-mono shadow-lg pointer-events-none whitespace-nowrap z-50 transform -translate-x-1/2", style: { left: `calc(52px + ${(a.isMuted ? 0 : a.volume) * 80}px)` }, children: a.isMuted ? "0%" : `${Math.round(a.volume * 100)}%` })
2469
+ zt && /* @__PURE__ */ e("div", { className: "strata-tooltip absolute bottom-full mb-2 px-1.5 py-0.5 rounded text-[10px] font-bold font-mono shadow-lg pointer-events-none whitespace-nowrap z-50 transform -translate-x-1/2", style: { left: `calc(52px + ${(a.isMuted ? 0 : a.volume) * 80}px)` }, children: a.isMuted ? "0%" : `${Math.round(a.volume * 100)}%` })
2413
2470
  ]
2414
2471
  },
2415
2472
  "volume"
@@ -2419,214 +2476,214 @@ const vn = [
2419
2476
  /* @__PURE__ */ e("div", { className: "w-2 h-2 rounded-full animate-pulse", style: { backgroundColor: a.themeColor } }),
2420
2477
  /* @__PURE__ */ e("span", { className: "text-[10px] font-bold tracking-wider", style: { color: a.themeColor }, children: "LIVE" })
2421
2478
  ] }, "live") : /* @__PURE__ */ d("div", { className: "text-xs font-medium text-zinc-400 font-mono select-none hidden sm:block tabular-nums", children: [
2422
- _e(Ae ? ye : a.currentTime),
2479
+ Je(Oe ? Te : a.currentTime),
2423
2480
  " ",
2424
2481
  /* @__PURE__ */ e("span", { className: "text-zinc-600", children: "/" }),
2425
2482
  " ",
2426
- _e(a.duration)
2483
+ Je(a.duration)
2427
2484
  ] }, "time");
2428
2485
  case "subtitle":
2429
2486
  return /* @__PURE__ */ d("div", { className: "relative", children: [
2430
2487
  /* @__PURE__ */ e("button", { onMouseDown: (l) => l.stopPropagation(), onTouchStart: (l) => l.stopPropagation(), onClick: (l) => {
2431
2488
  l.stopPropagation();
2432
- const L = F;
2433
- S(), L || rt(!0);
2434
- }, className: `strata-control-btn transition-colors focus:outline-none ${K} ${F ? "text-[var(--accent)] bg-white/10" : "text-zinc-300 hover:text-white hover:bg-white/10"}`, style: { borderRadius: "var(--radius)" }, children: /* @__PURE__ */ e($i, { className: Q }) }),
2435
- dt.isMounted && /* @__PURE__ */ e(
2489
+ const F = V;
2490
+ C(), F || at(!0);
2491
+ }, className: `strata-control-btn transition-colors focus:outline-none ${ee} ${V ? "text-[var(--accent)] bg-white/10" : "text-zinc-300 hover:text-white hover:bg-white/10"}`, style: { borderRadius: "var(--radius)" }, children: /* @__PURE__ */ e($i, { className: J }) }),
2492
+ ut.isMounted && /* @__PURE__ */ e(
2436
2493
  mn,
2437
2494
  {
2438
2495
  tracks: a.subtitleTracks,
2439
2496
  current: a.currentSubtitle,
2440
2497
  onSelect: (l) => s == null ? void 0 : s.setSubtitle(l),
2441
2498
  onUpload: (l) => s == null ? void 0 : s.addTextTrack(l, l.name),
2442
- onClose: S,
2499
+ onClose: C,
2443
2500
  settings: a.subtitleSettings,
2444
2501
  onSettingsChange: (l) => s == null ? void 0 : s.updateSubtitleSettings(l),
2445
2502
  onReset: () => s == null ? void 0 : s.resetSubtitleSettings(),
2446
2503
  offset: a.subtitleOffset,
2447
2504
  onOffsetChange: (l) => s == null ? void 0 : s.setSubtitleOffset(l),
2448
- maxHeight: Ne,
2449
- animationClass: `strata-backdrop ${Me} ${dt.isVisible ? "opacity-100 translate-y-0 scale-100 animate-in fade-in zoom-in-95 duration-300" : "opacity-0 translate-y-2 scale-95 duration-300"}`
2505
+ maxHeight: Pe,
2506
+ animationClass: `strata-backdrop ${Le} ${ut.isVisible ? "opacity-100 translate-y-0 scale-100 animate-in fade-in zoom-in-95 duration-300" : "opacity-0 translate-y-2 scale-95 duration-300"}`
2450
2507
  }
2451
2508
  )
2452
2509
  ] }, "subtitle");
2453
2510
  case "screenshot":
2454
2511
  return /* @__PURE__ */ e("button", { onMouseDown: (l) => l.stopPropagation(), onTouchStart: (l) => l.stopPropagation(), onClick: (l) => {
2455
- l.stopPropagation(), S(), s == null || s.screenshot();
2456
- }, className: `strata-control-btn text-zinc-300 hover:text-white hover:bg-white/10 transition-colors hidden sm:block focus:outline-none ${K}`, style: { borderRadius: "var(--radius)" }, title: "Screenshot", children: /* @__PURE__ */ e(Xi, { className: Q }) }, "ss");
2512
+ l.stopPropagation(), C(), s == null || s.screenshot();
2513
+ }, className: `strata-control-btn text-zinc-300 hover:text-white hover:bg-white/10 transition-colors hidden sm:block focus:outline-none ${ee}`, style: { borderRadius: "var(--radius)" }, title: "Screenshot", children: /* @__PURE__ */ e(Xi, { className: J }) }, "ss");
2457
2514
  case "pip":
2458
2515
  return /* @__PURE__ */ e("button", { onMouseDown: (l) => l.stopPropagation(), onTouchStart: (l) => l.stopPropagation(), onClick: (l) => {
2459
- l.stopPropagation(), S(), s == null || s.togglePip();
2460
- }, className: `strata-control-btn text-zinc-300 hover:text-white hover:bg-white/10 transition-colors hidden sm:block focus:outline-none ${K}`, style: { borderRadius: "var(--radius)" }, children: /* @__PURE__ */ e(Li, { className: Q }) }, "pip");
2516
+ l.stopPropagation(), C(), s == null || s.togglePip();
2517
+ }, className: `strata-control-btn text-zinc-300 hover:text-white hover:bg-white/10 transition-colors hidden sm:block focus:outline-none ${ee}`, style: { borderRadius: "var(--radius)" }, children: /* @__PURE__ */ e(Li, { className: J }) }, "pip");
2461
2518
  case "download":
2462
2519
  if (c.children) {
2463
- const l = P === "download-menu", L = l || xe.isMounted && Fe.current === "download-menu";
2520
+ const l = E === "download-menu", F = l || Ne.isMounted && De.current === "download-menu";
2464
2521
  return /* @__PURE__ */ d("div", { className: "relative", children: [
2465
- /* @__PURE__ */ e("button", { onMouseDown: (W) => W.stopPropagation(), onTouchStart: (W) => W.stopPropagation(), onClick: (W) => {
2466
- W.stopPropagation();
2467
- const T = l;
2468
- S(), T || Ee("download-menu");
2469
- }, className: `strata-control-btn transition-colors hidden sm:block focus:outline-none ${K} ${l ? "text-[var(--accent)] bg-white/10" : "text-zinc-300 hover:text-white hover:bg-white/10"}`, style: { borderRadius: "var(--radius)" }, children: /* @__PURE__ */ e(Qe, { className: Q }) }),
2470
- L && /* @__PURE__ */ e(
2522
+ /* @__PURE__ */ e("button", { onMouseDown: (G) => G.stopPropagation(), onTouchStart: (G) => G.stopPropagation(), onClick: (G) => {
2523
+ G.stopPropagation();
2524
+ const z = l;
2525
+ C(), z || Ve("download-menu");
2526
+ }, className: `strata-control-btn transition-colors hidden sm:block focus:outline-none ${ee} ${l ? "text-[var(--accent)] bg-white/10" : "text-zinc-300 hover:text-white hover:bg-white/10"}`, style: { borderRadius: "var(--radius)" }, children: /* @__PURE__ */ e(Ze, { className: J }) }),
2527
+ F && /* @__PURE__ */ e(
2471
2528
  Vt,
2472
2529
  {
2473
2530
  items: c.children,
2474
- onClose: S,
2475
- maxHeight: Ne,
2476
- className: `strata-backdrop ${Me} ${xe.isVisible ? "opacity-100 translate-y-0 scale-100 animate-in fade-in zoom-in-95 duration-300" : "opacity-0 translate-y-2 scale-95 duration-300"}`
2531
+ onClose: C,
2532
+ maxHeight: Pe,
2533
+ className: `strata-backdrop ${Le} ${Ne.isVisible ? "opacity-100 translate-y-0 scale-100 animate-in fade-in zoom-in-95 duration-300" : "opacity-0 translate-y-2 scale-95 duration-300"}`
2477
2534
  }
2478
2535
  )
2479
2536
  ] }, "dl");
2480
2537
  }
2481
2538
  return /* @__PURE__ */ e("button", { onMouseDown: (l) => l.stopPropagation(), onTouchStart: (l) => l.stopPropagation(), onClick: (l) => {
2482
- l.stopPropagation(), S(), s == null || s.download();
2483
- }, className: `strata-control-btn text-zinc-300 hover:text-white hover:bg-white/10 transition-colors hidden sm:block focus:outline-none ${K}`, style: { borderRadius: "var(--radius)" }, children: /* @__PURE__ */ e(Qe, { className: Q }) }, "dl");
2539
+ l.stopPropagation(), C(), s == null || s.download();
2540
+ }, className: `strata-control-btn text-zinc-300 hover:text-white hover:bg-white/10 transition-colors hidden sm:block focus:outline-none ${ee}`, style: { borderRadius: "var(--radius)" }, children: /* @__PURE__ */ e(Ze, { className: J }) }, "dl");
2484
2541
  case "fullscreen":
2485
2542
  return /* @__PURE__ */ e("button", { onMouseDown: (l) => l.stopPropagation(), onTouchStart: (l) => l.stopPropagation(), onClick: (l) => {
2486
- l.stopPropagation(), S(), s == null || s.toggleFullscreen();
2487
- }, className: `strata-control-btn text-zinc-300 hover:text-white hover:bg-white/10 rounded-lg transition-transform focus:outline-none ${K}`, style: { borderRadius: "var(--radius)" }, children: a.isFullscreen || a.isWebFullscreen ? /* @__PURE__ */ e(Ri, { className: Q }) : /* @__PURE__ */ e(Ii, { className: Q }) }, "fs");
2543
+ l.stopPropagation(), C(), s == null || s.toggleFullscreen();
2544
+ }, className: `strata-control-btn text-zinc-300 hover:text-white hover:bg-white/10 rounded-lg transition-transform focus:outline-none ${ee}`, style: { borderRadius: "var(--radius)" }, children: a.isFullscreen || a.isWebFullscreen ? /* @__PURE__ */ e(Ri, { className: J }) : /* @__PURE__ */ e(Ii, { className: J }) }, "fs");
2488
2545
  case "fullscreenWeb":
2489
2546
  return /* @__PURE__ */ e("button", { onMouseDown: (l) => l.stopPropagation(), onTouchStart: (l) => l.stopPropagation(), onClick: (l) => {
2490
- l.stopPropagation(), S(), s == null || s.toggleWebFullscreen();
2491
- }, className: `strata-control-btn text-zinc-300 hover:text-white hover:bg-white/10 hidden sm:block focus:outline-none ${K} ${a.isWebFullscreen ? "text-[var(--accent)]" : ""}`, style: { borderRadius: "var(--radius)" }, title: "Web Fullscreen", children: /* @__PURE__ */ e(Ki, { className: Q }) }, "fsw");
2547
+ l.stopPropagation(), C(), s == null || s.toggleWebFullscreen();
2548
+ }, className: `strata-control-btn text-zinc-300 hover:text-white hover:bg-white/10 hidden sm:block focus:outline-none ${ee} ${a.isWebFullscreen ? "text-[var(--accent)]" : ""}`, style: { borderRadius: "var(--radius)" }, title: "Web Fullscreen", children: /* @__PURE__ */ e(Ki, { className: J }) }, "fsw");
2492
2549
  case "settings":
2493
2550
  return /* @__PURE__ */ d("div", { className: "relative", children: [
2494
2551
  /* @__PURE__ */ e("button", { onMouseDown: (l) => l.stopPropagation(), onTouchStart: (l) => l.stopPropagation(), onClick: (l) => {
2495
2552
  l.stopPropagation();
2496
- const L = E;
2497
- S(), L || (ot(!0), A("main"));
2498
- }, className: `strata-control-btn transition-all duration-300 focus:outline-none ${K} ${E ? "rotate-90 text-[var(--accent)] bg-white/10" : "text-zinc-300 hover:text-white hover:bg-white/10"}`, style: { borderRadius: "var(--radius)" }, children: /* @__PURE__ */ e(Pi, { className: Q }) }),
2499
- ct.isMounted && /* @__PURE__ */ e(Ye, { onClose: S, align: "right", maxHeight: Ne, className: `strata-backdrop ${Me} ${ct.isVisible ? "opacity-100 translate-y-0 scale-100 animate-in fade-in zoom-in-95 duration-300" : "opacity-0 translate-y-2 scale-95 duration-300"}`, children: /* @__PURE__ */ d("div", { className: "w-full", children: [
2500
- _ === "main" && /* @__PURE__ */ d("div", { className: "animate-in slide-in-from-left-4 fade-in duration-200", children: [
2553
+ const F = B;
2554
+ C(), F || (rt(!0), D("main"));
2555
+ }, className: `strata-control-btn transition-all duration-300 focus:outline-none ${ee} ${B ? "rotate-90 text-[var(--accent)] bg-white/10" : "text-zinc-300 hover:text-white hover:bg-white/10"}`, style: { borderRadius: "var(--radius)" }, children: /* @__PURE__ */ e(Pi, { className: J }) }),
2556
+ dt.isMounted && /* @__PURE__ */ e(it, { onClose: C, align: "right", maxHeight: Pe, className: `strata-backdrop ${Le} ${dt.isVisible ? "opacity-100 translate-y-0 scale-100 animate-in fade-in zoom-in-95 duration-300" : "opacity-0 translate-y-2 scale-95 duration-300"}`, children: /* @__PURE__ */ d("div", { className: "w-full", children: [
2557
+ X === "main" && /* @__PURE__ */ d("div", { className: "animate-in slide-in-from-left-4 fade-in duration-200", children: [
2501
2558
  /* @__PURE__ */ e("div", { className: "px-3 py-2 mb-1 border-b border-white/5 font-bold text-zinc-400 uppercase text-[11px] tracking-wider flex justify-between items-center bg-white/5 sticky top-0 z-10 backdrop-blur-md", style: { borderRadius: "var(--radius)" }, children: /* @__PURE__ */ e("span", { children: "Settings" }) }),
2502
- a.sources.length > 1 && /* @__PURE__ */ d(U, { children: [
2503
- /* @__PURE__ */ e($, { label: "Source", icon: /* @__PURE__ */ e(en, { className: "w-4 h-4" }), value: ((v = a.sources[a.currentSourceIndex]) == null ? void 0 : v.name) || `Source ${a.currentSourceIndex + 1}`, onClick: () => A("sources"), hasSubmenu: !0 }),
2504
- /* @__PURE__ */ e(ae, {})
2559
+ a.sources.length > 1 && /* @__PURE__ */ d(_, { children: [
2560
+ /* @__PURE__ */ e(A, { label: "Source", icon: /* @__PURE__ */ e(en, { className: "w-4 h-4" }), value: ((v = a.sources[a.currentSourceIndex]) == null ? void 0 : v.name) || `Source ${a.currentSourceIndex + 1}`, onClick: () => D("sources"), hasSubmenu: !0 }),
2561
+ /* @__PURE__ */ e(pe, {})
2505
2562
  ] }),
2506
- /* @__PURE__ */ e($, { label: "Quality", icon: /* @__PURE__ */ e(an, { className: "w-4 h-4" }), value: a.currentQuality === -1 ? "Auto" : `${(k = a.qualityLevels[a.currentQuality]) == null ? void 0 : k.height}p`, onClick: () => A("quality"), hasSubmenu: !0 }),
2507
- /* @__PURE__ */ e($, { label: "Speed", icon: /* @__PURE__ */ e(sn, { className: "w-4 h-4" }), value: `${a.playbackRate}x`, onClick: () => A("speed"), hasSubmenu: !0 }),
2508
- /* @__PURE__ */ e($, { label: "Audio", icon: /* @__PURE__ */ e(on, { className: "w-4 h-4" }), value: ((N = a.audioTracks[a.currentAudioTrack]) == null ? void 0 : N.label) || "Default", onClick: () => A("audio"), hasSubmenu: !0 }),
2509
- /* @__PURE__ */ e(ae, {}),
2510
- m && /* @__PURE__ */ e($, { label: "Flip", icon: /* @__PURE__ */ e(ln, { className: "w-4 h-4" }), value: a.flipState.horizontal ? "H" : a.flipState.vertical ? "V" : "Normal", onClick: () => A("flip"), hasSubmenu: !0 }),
2511
- V && /* @__PURE__ */ e($, { label: "Aspect Ratio", icon: /* @__PURE__ */ e(tn, { className: "w-4 h-4" }), value: a.aspectRatio, onClick: () => A("ratio"), hasSubmenu: !0 }),
2512
- /* @__PURE__ */ e($, { label: "Audio Boost", icon: /* @__PURE__ */ e(nn, { className: "w-4 h-4" }), value: a.audioGain > 1 ? `${a.audioGain}x` : "Off", onClick: () => A("boost"), hasSubmenu: !0 }),
2513
- /* @__PURE__ */ e(ae, {}),
2514
- /* @__PURE__ */ e($, { label: "Watch Party", icon: /* @__PURE__ */ e(Vi, { className: "w-4 h-4" }), onClick: () => A("party"), hasSubmenu: !0 }),
2515
- /* @__PURE__ */ e($, { label: "Cast to Device", icon: /* @__PURE__ */ e(Ai, { className: "w-4 h-4" }), onClick: () => {
2516
- s == null || s.requestCast(), S();
2563
+ /* @__PURE__ */ e(A, { label: "Quality", icon: /* @__PURE__ */ e(an, { className: "w-4 h-4" }), value: a.currentQuality === -1 ? "Auto" : `${(S = a.qualityLevels[a.currentQuality]) == null ? void 0 : S.height}p`, onClick: () => D("quality"), hasSubmenu: !0 }),
2564
+ /* @__PURE__ */ e(A, { label: "Speed", icon: /* @__PURE__ */ e(sn, { className: "w-4 h-4" }), value: `${a.playbackRate}x`, onClick: () => D("speed"), hasSubmenu: !0 }),
2565
+ /* @__PURE__ */ e(A, { label: "Audio", icon: /* @__PURE__ */ e(on, { className: "w-4 h-4" }), value: ((M = a.audioTracks[a.currentAudioTrack]) == null ? void 0 : M.label) || "Default", onClick: () => D("audio"), hasSubmenu: !0 }),
2566
+ /* @__PURE__ */ e(pe, {}),
2567
+ b && /* @__PURE__ */ e(A, { label: "Flip", icon: /* @__PURE__ */ e(ln, { className: "w-4 h-4" }), value: a.flipState.horizontal ? "H" : a.flipState.vertical ? "V" : "Normal", onClick: () => D("flip"), hasSubmenu: !0 }),
2568
+ H && /* @__PURE__ */ e(A, { label: "Aspect Ratio", icon: /* @__PURE__ */ e(tn, { className: "w-4 h-4" }), value: a.aspectRatio, onClick: () => D("ratio"), hasSubmenu: !0 }),
2569
+ /* @__PURE__ */ e(A, { label: "Audio Boost", icon: /* @__PURE__ */ e(nn, { className: "w-4 h-4" }), value: a.audioGain > 1 ? `${a.audioGain}x` : "Off", onClick: () => D("boost"), hasSubmenu: !0 }),
2570
+ /* @__PURE__ */ e(pe, {}),
2571
+ /* @__PURE__ */ e(A, { label: "Watch Party", icon: /* @__PURE__ */ e(Bi, { className: "w-4 h-4" }), onClick: () => D("party"), hasSubmenu: !0 }),
2572
+ /* @__PURE__ */ e(A, { label: "Cast to Device", icon: /* @__PURE__ */ e(Ai, { className: "w-4 h-4" }), onClick: () => {
2573
+ s == null || s.requestCast(), C();
2517
2574
  } }),
2518
- p.settings && p.settings.length > 0 && /* @__PURE__ */ e(ae, {}),
2519
- (R = p.settings) == null ? void 0 : R.map((l, L) => l.switch !== void 0 ? /* @__PURE__ */ e("div", { className: "px-1", children: /* @__PURE__ */ e(
2520
- te,
2575
+ p.settings && p.settings.length > 0 && /* @__PURE__ */ e(pe, {}),
2576
+ (L = p.settings) == null ? void 0 : L.map((l, F) => l.switch !== void 0 ? /* @__PURE__ */ e("div", { className: "px-1", children: /* @__PURE__ */ e(
2577
+ oe,
2521
2578
  {
2522
2579
  label: l.html,
2523
2580
  icon: l.icon,
2524
2581
  checked: l.switch,
2525
2582
  tooltip: l.tooltip,
2526
- onChange: (W) => {
2527
- l.onSwitch && l.onSwitch(l, W);
2583
+ onChange: (G) => {
2584
+ l.onSwitch && l.onSwitch(l, G);
2528
2585
  }
2529
2586
  }
2530
- ) }, `cust-${L}`) : /* @__PURE__ */ e(
2531
- $,
2587
+ ) }, `cust-${F}`) : /* @__PURE__ */ e(
2588
+ A,
2532
2589
  {
2533
2590
  label: l.html,
2534
2591
  icon: l.icon,
2535
2592
  value: l.currentLabel || l.value,
2536
2593
  hasSubmenu: !!l.children,
2537
2594
  onClick: () => {
2538
- l.children ? A(`custom-${L}`) : (l.click ? l.click(l) : l.onClick && l.onClick(l), S());
2595
+ l.children ? D(`custom-${F}`) : (l.click ? l.click(l) : l.onClick && l.onClick(l), C());
2539
2596
  }
2540
2597
  },
2541
- `cust-${L}`
2598
+ `cust-${F}`
2542
2599
  )),
2543
- /* @__PURE__ */ e(ae, {}),
2544
- /* @__PURE__ */ e($, { label: "Appearance", icon: /* @__PURE__ */ e(jt, { className: "w-4 h-4" }), onClick: () => A("appearance"), hasSubmenu: !0 })
2600
+ /* @__PURE__ */ e(pe, {}),
2601
+ /* @__PURE__ */ e(A, { label: "Appearance", icon: /* @__PURE__ */ e(Ut, { className: "w-4 h-4" }), onClick: () => D("appearance"), hasSubmenu: !0 })
2545
2602
  ] }),
2546
- _.startsWith("custom-") && (() => {
2547
- var W;
2548
- const l = parseInt(_.split("-")[1]), L = (W = p.settings) == null ? void 0 : W[l];
2549
- return !L || !L.children ? null : /* @__PURE__ */ d("div", { className: "animate-in slide-in-from-right-4 fade-in duration-200", children: [
2550
- /* @__PURE__ */ e(J, { label: L.html || "Menu", onBack: () => A("main") }),
2551
- L.children.map((T, Ge) => /* @__PURE__ */ d(ve.Fragment, { children: [
2552
- T.separator && /* @__PURE__ */ e(ae, {}),
2553
- T.switch !== void 0 && /* @__PURE__ */ e("div", { className: "px-1", children: /* @__PURE__ */ e(te, { label: T.html, checked: T.switch, onChange: (pi) => T.onSwitch && T.onSwitch(T, pi) }) }),
2554
- !T.separator && T.switch === void 0 && /* @__PURE__ */ e(
2555
- $,
2603
+ X.startsWith("custom-") && (() => {
2604
+ var G;
2605
+ const l = parseInt(X.split("-")[1]), F = (G = p.settings) == null ? void 0 : G[l];
2606
+ return !F || !F.children ? null : /* @__PURE__ */ d("div", { className: "animate-in slide-in-from-right-4 fade-in duration-200", children: [
2607
+ /* @__PURE__ */ e(K, { label: F.html || "Menu", onBack: () => D("main") }),
2608
+ F.children.map((z, Qe) => /* @__PURE__ */ d(ke.Fragment, { children: [
2609
+ z.separator && /* @__PURE__ */ e(pe, {}),
2610
+ z.switch !== void 0 && /* @__PURE__ */ e("div", { className: "px-1", children: /* @__PURE__ */ e(oe, { label: z.html, checked: z.switch, onChange: (pi) => z.onSwitch && z.onSwitch(z, pi) }) }),
2611
+ !z.separator && z.switch === void 0 && /* @__PURE__ */ e(
2612
+ A,
2556
2613
  {
2557
- label: T.html,
2558
- icon: T.icon,
2559
- value: T.value,
2560
- active: T.active,
2614
+ label: z.html,
2615
+ icon: z.icon,
2616
+ value: z.value,
2617
+ active: z.active,
2561
2618
  onClick: () => {
2562
- T.onClick ? T.onClick(T) : T.click && T.click(T), S();
2619
+ z.onClick ? z.onClick(z) : z.click && z.click(z), C();
2563
2620
  }
2564
2621
  }
2565
2622
  )
2566
- ] }, Ge))
2623
+ ] }, Qe))
2567
2624
  ] });
2568
2625
  })(),
2569
- ["speed", "quality", "audio", "boost", "party", "appearance", "sources", "flip", "ratio"].includes(_) && /* @__PURE__ */ d("div", { className: "animate-in slide-in-from-right-4 fade-in duration-200", children: [
2570
- _ === "sources" && /* @__PURE__ */ d(U, { children: [
2571
- /* @__PURE__ */ e(J, { label: "Select Source", onBack: () => A("main") }),
2572
- a.sources.map((l, L) => {
2573
- const W = a.sourceStatuses[L], T = W === "success" ? /* @__PURE__ */ e(rn, { className: "w-3.5 h-3.5 text-emerald-500" }) : W === "error" ? /* @__PURE__ */ e(Je, { className: "w-3.5 h-3.5 text-red-500" }) : null;
2626
+ ["speed", "quality", "audio", "boost", "party", "appearance", "sources", "flip", "ratio"].includes(X) && /* @__PURE__ */ d("div", { className: "animate-in slide-in-from-right-4 fade-in duration-200", children: [
2627
+ X === "sources" && /* @__PURE__ */ d(_, { children: [
2628
+ /* @__PURE__ */ e(K, { label: "Select Source", onBack: () => D("main") }),
2629
+ a.sources.map((l, F) => {
2630
+ const G = a.sourceStatuses[F], z = G === "success" ? /* @__PURE__ */ e(rn, { className: "w-3.5 h-3.5 text-emerald-500" }) : G === "error" ? /* @__PURE__ */ e(et, { className: "w-3.5 h-3.5 text-red-500" }) : null;
2574
2631
  return /* @__PURE__ */ e(
2575
- $,
2632
+ A,
2576
2633
  {
2577
- label: l.name || `Source ${L + 1}`,
2634
+ label: l.name || `Source ${F + 1}`,
2578
2635
  value: l.type,
2579
- active: a.currentSourceIndex === L,
2580
- rightIcon: T,
2581
- onClick: () => s == null ? void 0 : s.switchSource(L)
2636
+ active: a.currentSourceIndex === F,
2637
+ rightIcon: z,
2638
+ onClick: () => s == null ? void 0 : s.switchSource(F)
2582
2639
  },
2583
- L
2640
+ F
2584
2641
  );
2585
2642
  })
2586
2643
  ] }),
2587
- _ === "speed" && /* @__PURE__ */ d(U, { children: [
2588
- /* @__PURE__ */ e(J, { label: "Speed", onBack: () => A("main") }),
2589
- [0.5, 1, 1.5, 2].map((l) => /* @__PURE__ */ e($, { label: `${l}x`, active: a.playbackRate === l, onClick: () => s.video.playbackRate = l }, l))
2644
+ X === "speed" && /* @__PURE__ */ d(_, { children: [
2645
+ /* @__PURE__ */ e(K, { label: "Speed", onBack: () => D("main") }),
2646
+ [0.5, 1, 1.5, 2].map((l) => /* @__PURE__ */ e(A, { label: `${l}x`, active: a.playbackRate === l, onClick: () => s.video.playbackRate = l }, l))
2590
2647
  ] }),
2591
- _ === "quality" && /* @__PURE__ */ d(U, { children: [
2592
- /* @__PURE__ */ e(J, { label: "Quality", onBack: () => A("main") }),
2593
- /* @__PURE__ */ e($, { label: "Auto", active: a.currentQuality === -1, onClick: () => s == null ? void 0 : s.setQuality(-1) }),
2594
- a.qualityLevels.map((l) => /* @__PURE__ */ e($, { label: `${l.height}p`, value: `${Math.round(l.bitrate / 1e3)}k`, active: a.currentQuality === l.index, onClick: () => s == null ? void 0 : s.setQuality(l.index) }, l.index))
2648
+ X === "quality" && /* @__PURE__ */ d(_, { children: [
2649
+ /* @__PURE__ */ e(K, { label: "Quality", onBack: () => D("main") }),
2650
+ /* @__PURE__ */ e(A, { label: "Auto", active: a.currentQuality === -1, onClick: () => s == null ? void 0 : s.setQuality(-1) }),
2651
+ a.qualityLevels.map((l) => /* @__PURE__ */ e(A, { label: `${l.height}p`, value: `${Math.round(l.bitrate / 1e3)}k`, active: a.currentQuality === l.index, onClick: () => s == null ? void 0 : s.setQuality(l.index) }, l.index))
2595
2652
  ] }),
2596
- _ === "audio" && /* @__PURE__ */ d(U, { children: [
2597
- /* @__PURE__ */ e(J, { label: "Audio Track", onBack: () => A("main") }),
2653
+ X === "audio" && /* @__PURE__ */ d(_, { children: [
2654
+ /* @__PURE__ */ e(K, { label: "Audio Track", onBack: () => D("main") }),
2598
2655
  a.audioTracks.length === 0 && /* @__PURE__ */ e("div", { className: "px-4 py-3 text-zinc-500 text-xs text-center", children: "No tracks available" }),
2599
- a.audioTracks.map((l) => /* @__PURE__ */ e($, { label: l.label, value: l.language, active: a.currentAudioTrack === l.index, onClick: () => s == null ? void 0 : s.setAudioTrack(l.index) }, l.index))
2656
+ a.audioTracks.map((l) => /* @__PURE__ */ e(A, { label: l.label, value: l.language, active: a.currentAudioTrack === l.index, onClick: () => s == null ? void 0 : s.setAudioTrack(l.index) }, l.index))
2600
2657
  ] }),
2601
- _ === "boost" && /* @__PURE__ */ d(U, { children: [
2602
- /* @__PURE__ */ e(J, { label: "Audio Boost", onBack: () => A("main") }),
2603
- [1, 1.5, 2, 3].map((l) => /* @__PURE__ */ e($, { label: l === 1 ? "Off" : `${l}x`, active: a.audioGain === l, onClick: () => s == null ? void 0 : s.setAudioGain(l) }, l))
2658
+ X === "boost" && /* @__PURE__ */ d(_, { children: [
2659
+ /* @__PURE__ */ e(K, { label: "Audio Boost", onBack: () => D("main") }),
2660
+ [1, 1.5, 2, 3].map((l) => /* @__PURE__ */ e(A, { label: l === 1 ? "Off" : `${l}x`, active: a.audioGain === l, onClick: () => s == null ? void 0 : s.setAudioGain(l) }, l))
2604
2661
  ] }),
2605
- _ === "flip" && /* @__PURE__ */ d(U, { children: [
2606
- /* @__PURE__ */ e(J, { label: "Video Flip", onBack: () => A("main") }),
2662
+ X === "flip" && /* @__PURE__ */ d(_, { children: [
2663
+ /* @__PURE__ */ e(K, { label: "Video Flip", onBack: () => D("main") }),
2607
2664
  /* @__PURE__ */ d("div", { className: "p-2 space-y-1", children: [
2608
- /* @__PURE__ */ e(te, { label: "Horizontal Flip", checked: a.flipState.horizontal, onChange: () => s == null ? void 0 : s.setFlip("horizontal") }),
2609
- /* @__PURE__ */ e(te, { label: "Vertical Flip", checked: a.flipState.vertical, onChange: () => s == null ? void 0 : s.setFlip("vertical") })
2665
+ /* @__PURE__ */ e(oe, { label: "Horizontal Flip", checked: a.flipState.horizontal, onChange: () => s == null ? void 0 : s.setFlip("horizontal") }),
2666
+ /* @__PURE__ */ e(oe, { label: "Vertical Flip", checked: a.flipState.vertical, onChange: () => s == null ? void 0 : s.setFlip("vertical") })
2610
2667
  ] })
2611
2668
  ] }),
2612
- _ === "ratio" && /* @__PURE__ */ d(U, { children: [
2613
- /* @__PURE__ */ e(J, { label: "Aspect Ratio", onBack: () => A("main") }),
2614
- ["default", "16:9", "4:3"].map((l) => /* @__PURE__ */ e($, { label: l === "default" ? "Default" : l, active: a.aspectRatio === l, onClick: () => s == null ? void 0 : s.setAspectRatio(l) }, l))
2669
+ X === "ratio" && /* @__PURE__ */ d(_, { children: [
2670
+ /* @__PURE__ */ e(K, { label: "Aspect Ratio", onBack: () => D("main") }),
2671
+ ["default", "16:9", "4:3"].map((l) => /* @__PURE__ */ e(A, { label: l === "default" ? "Default" : l, active: a.aspectRatio === l, onClick: () => s == null ? void 0 : s.setAspectRatio(l) }, l))
2615
2672
  ] }),
2616
- _ === "party" && /* @__PURE__ */ d(U, { children: [
2617
- /* @__PURE__ */ e(J, { label: "Watch Party", onBack: () => A("main") }),
2673
+ X === "party" && /* @__PURE__ */ d(_, { children: [
2674
+ /* @__PURE__ */ e(K, { label: "Watch Party", onBack: () => D("main") }),
2618
2675
  /* @__PURE__ */ d("div", { className: "p-4 space-y-3", children: [
2619
2676
  /* @__PURE__ */ e("p", { className: "text-xs text-zinc-400 leading-relaxed", children: "Create a synchronized room on WatchParty.me to watch together." }),
2620
- /* @__PURE__ */ e("a", { href: `https://www.watchparty.me/create?video=${encodeURIComponent(((re = a.sources[a.currentSourceIndex]) == null ? void 0 : re.url) || t || "")}`, target: "_blank", rel: "noopener noreferrer", className: "flex items-center justify-center w-full py-2.5 bg-[var(--accent)] hover:opacity-90 text-white font-medium transition-opacity text-xs", style: { borderRadius: "var(--radius)" }, children: "Create Room" })
2677
+ /* @__PURE__ */ e("a", { href: `https://www.watchparty.me/create?video=${encodeURIComponent(((he = a.sources[a.currentSourceIndex]) == null ? void 0 : he.url) || t || "")}`, target: "_blank", rel: "noopener noreferrer", className: "flex items-center justify-center w-full py-2.5 bg-[var(--accent)] hover:opacity-90 text-white font-medium transition-opacity text-xs", style: { borderRadius: "var(--radius)" }, children: "Create Room" })
2621
2678
  ] })
2622
2679
  ] }),
2623
- _ === "appearance" && /* @__PURE__ */ d(U, { children: [
2624
- /* @__PURE__ */ e(J, { label: "Appearance", onBack: () => A("main") }),
2680
+ X === "appearance" && /* @__PURE__ */ d(_, { children: [
2681
+ /* @__PURE__ */ e(K, { label: "Appearance", onBack: () => D("main") }),
2625
2682
  /* @__PURE__ */ d("div", { className: "pb-1", children: [
2626
- /* @__PURE__ */ e(le, { title: "Theme", children: /* @__PURE__ */ e("div", { className: "grid grid-cols-2 gap-2 px-3", children: xn.map((l) => /* @__PURE__ */ e("button", { onClick: () => s == null ? void 0 : s.setAppearance({ theme: l.value, themeColor: l.color }), className: `py-2 text-xs font-bold uppercase tracking-wide transition-colors border-[length:var(--border-width)] border-white/10 ${a.theme === l.value ? "bg-[var(--accent)] text-white" : "bg-white/5 text-zinc-400 hover:text-white"}`, style: { borderRadius: "var(--radius)" }, children: l.label }, l.value)) }) }),
2627
- /* @__PURE__ */ e(le, { title: "Icon Size", children: /* @__PURE__ */ e("div", { className: "grid grid-cols-3 gap-1 px-3", children: ["small", "medium", "large"].map((l) => /* @__PURE__ */ e("button", { onClick: () => s == null ? void 0 : s.setAppearance({ iconSize: l }), className: `py-1.5 text-xs font-medium transition-colors ${a.iconSize === l ? "bg-white text-black" : "bg-white/5 text-zinc-400 hover:text-zinc-200"}`, style: { borderRadius: "var(--radius)" }, children: l.charAt(0).toUpperCase() + l.slice(1) }, l)) }) }),
2628
- /* @__PURE__ */ d(le, { title: "Theme Color", children: [
2629
- /* @__PURE__ */ e("div", { className: "grid grid-cols-6 gap-2 px-3", children: vn.map((l) => /* @__PURE__ */ e("button", { title: l.label, onClick: () => s == null ? void 0 : s.setAppearance({ themeColor: l.value }), className: `w-6 h-6 transition-transform hover:scale-110 ${a.themeColor === l.value ? "ring-2 ring-white scale-110" : "ring-1 ring-white/10"}`, style: { backgroundColor: l.value, borderRadius: "var(--radius-full)" }, children: a.themeColor === l.value && /* @__PURE__ */ e(Pe, { className: "w-3 h-3 text-white mx-auto stroke-[3]" }) }, l.value)) }),
2683
+ /* @__PURE__ */ e(me, { title: "Theme", children: /* @__PURE__ */ e("div", { className: "grid grid-cols-2 gap-2 px-3", children: xn.map((l) => /* @__PURE__ */ e("button", { onClick: () => s == null ? void 0 : s.setAppearance({ theme: l.value, themeColor: l.color }), className: `py-2 text-xs font-bold uppercase tracking-wide transition-colors border-[length:var(--border-width)] border-white/10 ${a.theme === l.value ? "bg-[var(--accent)] text-white" : "bg-white/5 text-zinc-400 hover:text-white"}`, style: { borderRadius: "var(--radius)" }, children: l.label }, l.value)) }) }),
2684
+ /* @__PURE__ */ e(me, { title: "Icon Size", children: /* @__PURE__ */ e("div", { className: "grid grid-cols-3 gap-1 px-3", children: ["small", "medium", "large"].map((l) => /* @__PURE__ */ e("button", { onClick: () => s == null ? void 0 : s.setAppearance({ iconSize: l }), className: `py-1.5 text-xs font-medium transition-colors ${a.iconSize === l ? "bg-white text-black" : "bg-white/5 text-zinc-400 hover:text-zinc-200"}`, style: { borderRadius: "var(--radius)" }, children: l.charAt(0).toUpperCase() + l.slice(1) }, l)) }) }),
2685
+ /* @__PURE__ */ d(me, { title: "Theme Color", children: [
2686
+ /* @__PURE__ */ e("div", { className: "grid grid-cols-6 gap-2 px-3", children: vn.map((l) => /* @__PURE__ */ e("button", { title: l.label, onClick: () => s == null ? void 0 : s.setAppearance({ themeColor: l.value }), className: `w-6 h-6 transition-transform hover:scale-110 ${a.themeColor === l.value ? "ring-2 ring-white scale-110" : "ring-1 ring-white/10"}`, style: { backgroundColor: l.value, borderRadius: "var(--radius-full)" }, children: a.themeColor === l.value && /* @__PURE__ */ e(Be, { className: "w-3 h-3 text-white mx-auto stroke-[3]" }) }, l.value)) }),
2630
2687
  /* @__PURE__ */ e("div", { className: "px-3 pt-4", children: /* @__PURE__ */ d("div", { className: "flex items-center gap-3 bg-white/5 p-2 hover:bg-white/10 transition-colors group", style: { borderRadius: "var(--radius)" }, children: [
2631
2688
  /* @__PURE__ */ e("div", { className: "relative w-6 h-6 overflow-hidden ring-1 ring-white/20", style: { borderRadius: "var(--radius-full)" }, children: /* @__PURE__ */ e("input", { type: "color", value: a.themeColor, onChange: (l) => s == null ? void 0 : s.setAppearance({ themeColor: l.target.value }), className: "absolute inset-[-4px] w-[150%] h-[150%] cursor-pointer p-0 border-0" }) }),
2632
2689
  /* @__PURE__ */ e("span", { className: "text-xs text-zinc-400 font-medium group-hover:text-zinc-200", children: "Custom Color" }),
@@ -2641,7 +2698,7 @@ const vn = [
2641
2698
  default:
2642
2699
  return null;
2643
2700
  }
2644
- }, ui = fe(() => {
2701
+ }, ui = xe(() => {
2645
2702
  const c = [
2646
2703
  // Loop (Playback Group)
2647
2704
  { html: "Playback", isLabel: !0 },
@@ -2666,7 +2723,7 @@ const vn = [
2666
2723
  {
2667
2724
  html: "Video Info",
2668
2725
  icon: /* @__PURE__ */ e(Zi, { className: "w-3.5 h-3.5" }),
2669
- onClick: () => lt(!0)
2726
+ onClick: () => ct(!0)
2670
2727
  },
2671
2728
  { separator: !0 }
2672
2729
  ];
@@ -2682,19 +2739,19 @@ const vn = [
2682
2739
  /* @__PURE__ */ e("path", { d: "m6 6 12 12" })
2683
2740
  ] }) })
2684
2741
  }), c;
2685
- }, [p.contextmenu, a.aspectRatio, a.isLooping, s]), hi = a.isWebFullscreen, Rt = /* @__PURE__ */ d(
2742
+ }, [p.contextmenu, a.aspectRatio, a.isLooping, s]), hi = a.isWebFullscreen, Pt = /* @__PURE__ */ d(
2686
2743
  "div",
2687
2744
  {
2688
2745
  id: p.id,
2689
- ref: G,
2746
+ ref: P,
2690
2747
  className: `group bg-black overflow-hidden select-none font-[family-name:var(--font-main)] outline-none text-zinc-100 strata-player-reset flex items-center justify-center ${hi ? "fixed inset-0 z-[2147483647] w-screen h-screen rounded-none" : "relative w-full h-full rounded-[var(--radius)]"} ${p.container || ""}`,
2691
2748
  style: { touchAction: "manipulation", "--accent": a.themeColor, "--accent-contrast": Xt },
2692
- onMouseMove: kt,
2749
+ onMouseMove: St,
2693
2750
  onMouseLeave: () => {
2694
- a.isPlaying && !E && !F && !P && s && s.setControlsVisible(!1);
2751
+ a.isPlaying && !B && !V && !E && s && s.setControlsVisible(!1);
2695
2752
  },
2696
- onMouseDown: St,
2697
- onMouseUp: je,
2753
+ onMouseDown: Ct,
2754
+ onMouseUp: qe,
2698
2755
  onTouchStart: ei,
2699
2756
  onTouchMove: ti,
2700
2757
  onTouchEnd: ii,
@@ -2799,14 +2856,14 @@ const vn = [
2799
2856
  [data-theme="hacker"] .strata-backdrop { backdrop-filter: none; background: #000; }
2800
2857
  ` }),
2801
2858
  a.theme === "hacker" && /* @__PURE__ */ e("div", { className: "strata-scanlines" }),
2802
- !s && /* @__PURE__ */ e("div", { className: "absolute inset-0 flex items-center justify-center bg-zinc-950 z-50", children: /* @__PURE__ */ e(Ie, { className: "w-10 h-10 text-[var(--accent)] animate-spin" }) }),
2803
- s && /* @__PURE__ */ d(U, { children: [
2804
- (Pt = p.layers) == null ? void 0 : Pt.map((c, v) => /* @__PURE__ */ e(
2859
+ !s && /* @__PURE__ */ e("div", { className: "absolute inset-0 flex items-center justify-center bg-zinc-950 z-50", children: /* @__PURE__ */ e(Fe, { className: "w-10 h-10 text-[var(--accent)] animate-spin" }) }),
2860
+ s && /* @__PURE__ */ d(_, { children: [
2861
+ (Lt = p.layers) == null ? void 0 : Lt.map((c, v) => /* @__PURE__ */ e(
2805
2862
  "div",
2806
2863
  {
2807
2864
  className: `absolute inset-0 pointer-events-none z-10 ${c.className || ""}`,
2808
2865
  style: c.style,
2809
- children: /* @__PURE__ */ e(Bt, { content: c.html || "", className: "w-full h-full" })
2866
+ children: /* @__PURE__ */ e(Dt, { content: c.html || "", className: "w-full h-full" })
2810
2867
  },
2811
2868
  v
2812
2869
  )),
@@ -2822,30 +2879,30 @@ const vn = [
2822
2879
  tabIndex: -1
2823
2880
  }
2824
2881
  ),
2825
- r && !Le && /* @__PURE__ */ e(
2882
+ r && !ne && /* @__PURE__ */ e(
2826
2883
  "div",
2827
2884
  {
2828
2885
  className: "absolute inset-0 bg-cover bg-center z-[5] pointer-events-none strata-poster",
2829
2886
  style: { backgroundImage: `url(${r})` }
2830
2887
  }
2831
2888
  ),
2832
- Z.visible && /* @__PURE__ */ e(
2889
+ se.visible && /* @__PURE__ */ e(
2833
2890
  fn,
2834
2891
  {
2835
- x: Z.x,
2836
- y: Z.y,
2892
+ x: se.x,
2893
+ y: se.y,
2837
2894
  items: ui,
2838
- onClose: S,
2839
- containerWidth: _t,
2840
- containerHeight: et
2895
+ onClose: C,
2896
+ containerWidth: nt,
2897
+ containerHeight: ce
2841
2898
  }
2842
2899
  ),
2843
- Qt && s && /* @__PURE__ */ e(bn, { player: s, onClose: () => lt(!1) }),
2844
- De && /* @__PURE__ */ d("div", { className: "absolute top-8 left-1/2 -translate-x-1/2 bg-black/50 backdrop-blur-md px-4 py-2 rounded-full flex items-center gap-2 z-40 animate-in fade-in zoom-in duration-200 pointer-events-none", children: [
2900
+ Qt && s && /* @__PURE__ */ e(bn, { player: s, onClose: () => ct(!1) }),
2901
+ je && /* @__PURE__ */ d("div", { className: "absolute top-8 left-1/2 -translate-x-1/2 bg-black/50 backdrop-blur-md px-4 py-2 rounded-full flex items-center gap-2 z-40 animate-in fade-in zoom-in duration-200 pointer-events-none", children: [
2845
2902
  /* @__PURE__ */ e(Yi, { className: "w-4 h-4 text-[var(--accent)] fill-current" }),
2846
2903
  /* @__PURE__ */ e("span", { className: "text-xs font-bold tracking-wider", children: "2x Speed" })
2847
2904
  ] }),
2848
- D && nt && a.controlsVisible && /* @__PURE__ */ e(
2905
+ Y && st && a.controlsVisible && /* @__PURE__ */ e(
2849
2906
  "button",
2850
2907
  {
2851
2908
  onMouseDown: (c) => c.stopPropagation(),
@@ -2857,39 +2914,39 @@ const vn = [
2857
2914
  children: a.isLocked ? /* @__PURE__ */ e(Qi, { className: "w-5 h-5" }) : /* @__PURE__ */ e(Ji, { className: "w-5 h-5" })
2858
2915
  }
2859
2916
  ),
2860
- se && /* @__PURE__ */ e(
2917
+ de && /* @__PURE__ */ e(
2861
2918
  "div",
2862
2919
  {
2863
- className: `absolute top-0 bottom-0 flex items-center justify-center w-[35%] z-20 bg-white/5 backdrop-blur-[1px] animate-out fade-out duration-500 fill-mode-forwards pointer-events-none ${se.type === "rewind" ? "left-0 rounded-r-[4rem]" : "right-0 rounded-l-[4rem]"}`,
2864
- onAnimationEnd: () => Se(null),
2920
+ className: `absolute top-0 bottom-0 flex items-center justify-center w-[35%] z-20 bg-white/5 backdrop-blur-[1px] animate-out fade-out duration-500 fill-mode-forwards pointer-events-none ${de.type === "rewind" ? "left-0 rounded-r-[4rem]" : "right-0 rounded-l-[4rem]"}`,
2921
+ onAnimationEnd: () => Ie(null),
2865
2922
  children: /* @__PURE__ */ d("div", { className: "flex flex-col items-center text-white drop-shadow-lg", children: [
2866
- se.type === "rewind" ? /* @__PURE__ */ e(Ft, { className: "w-12 h-12 animate-pulse" }) : /* @__PURE__ */ e(At, { className: "w-12 h-12 animate-pulse" }),
2867
- /* @__PURE__ */ e("span", { className: "font-bold text-sm mt-2 font-mono", children: se.type === "rewind" ? "-10s" : "+10s" })
2923
+ de.type === "rewind" ? /* @__PURE__ */ e(At, { className: "w-12 h-12 animate-pulse" }) : /* @__PURE__ */ e(Bt, { className: "w-12 h-12 animate-pulse" }),
2924
+ /* @__PURE__ */ e("span", { className: "font-bold text-sm mt-2 font-mono", children: de.type === "rewind" ? "-10s" : "+10s" })
2868
2925
  ] })
2869
2926
  },
2870
- se.id
2927
+ de.id
2871
2928
  ),
2872
- a.isBuffering && /* @__PURE__ */ e("div", { className: "absolute inset-0 flex items-center justify-center z-20 pointer-events-none", children: /* @__PURE__ */ e(Ie, { className: "w-12 h-12 text-[var(--accent)] animate-spin drop-shadow-lg" }) }),
2929
+ a.isBuffering && /* @__PURE__ */ e("div", { className: "absolute inset-0 flex items-center justify-center z-20 pointer-events-none", children: /* @__PURE__ */ e(Fe, { className: "w-12 h-12 text-[var(--accent)] animate-spin drop-shadow-lg" }) }),
2873
2930
  a.error && /* @__PURE__ */ e("div", { className: "absolute inset-0 flex items-center justify-center z-30 bg-black/90 backdrop-blur-md animate-in fade-in", children: /* @__PURE__ */ d("div", { className: "flex flex-col items-center gap-4 text-red-500 p-8 max-w-md text-center", children: [
2874
2931
  /* @__PURE__ */ e("span", { className: "text-5xl mb-2", children: "⚠️" }),
2875
2932
  /* @__PURE__ */ e("h3", { className: "text-xl font-bold text-white", children: "Playback Error" }),
2876
2933
  /* @__PURE__ */ e("p", { className: "text-zinc-400 text-sm", children: a.error }),
2877
- /* @__PURE__ */ e("button", { onClick: () => s.load(s.store.get().sources[s.store.get().currentSourceIndex] || { url: t || "", type: n || "auto" }, b), className: "px-6 py-2 bg-[var(--accent)] text-white font-medium rounded-full hover:opacity-90 transition-opacity mt-4 shadow-lg", children: "Try Again" })
2934
+ /* @__PURE__ */ e("button", { onClick: () => s.load(s.store.get().sources[s.store.get().currentSourceIndex] || { url: t || "", type: i || "auto" }, f), className: "px-6 py-2 bg-[var(--accent)] text-white font-medium rounded-full hover:opacity-90 transition-opacity mt-4 shadow-lg", children: "Try Again" })
2878
2935
  ] }) }),
2879
- ue && !a.isLocked && (!a.isPlaying && !a.isBuffering && !a.error || a.controlsVisible) && !a.isBuffering ? /* @__PURE__ */ e(
2936
+ j && !a.isLocked && (!a.isPlaying && !a.isBuffering && !a.error || a.controlsVisible) && !a.isBuffering ? /* @__PURE__ */ e(
2880
2937
  "div",
2881
2938
  {
2882
2939
  className: `absolute inset-0 flex items-center justify-center z-10 transition-opacity duration-300 pointer-events-none ${a.controlsVisible || !a.isPlaying ? "opacity-100" : "opacity-0"}`,
2883
2940
  children: /* @__PURE__ */ d("div", { className: "flex items-center gap-8 md:gap-16 pointer-events-auto", children: [
2884
2941
  /* @__PURE__ */ e("button", { onMouseDown: (c) => c.stopPropagation(), onTouchStart: (c) => c.stopPropagation(), onClick: (c) => {
2885
- c.stopPropagation(), S(), Ce("rewind");
2886
- }, className: `group flex items-center justify-center rounded-full bg-black/40 hover:bg-black/60 border border-white/10 transition-all duration-300 active:scale-125 active:opacity-80 text-white/90 focus:outline-none backdrop-blur-sm ${oe.skipBtn}`, children: /* @__PURE__ */ e(Ft, { className: oe.skipIcon }) }),
2942
+ c.stopPropagation(), C(), Re("rewind");
2943
+ }, className: `group flex items-center justify-center rounded-full bg-black/40 hover:bg-black/60 border border-white/10 transition-all duration-300 active:scale-125 active:opacity-80 text-white/90 focus:outline-none backdrop-blur-sm ${ue.skipBtn}`, children: /* @__PURE__ */ e(At, { className: ue.skipIcon }) }),
2887
2944
  /* @__PURE__ */ e("button", { onMouseDown: (c) => c.stopPropagation(), onTouchStart: (c) => c.stopPropagation(), onClick: (c) => {
2888
- c.stopPropagation(), S(), s.togglePlay();
2889
- }, className: `group relative flex items-center justify-center rounded-full bg-white/10 hover:bg-[var(--accent)] border border-white/10 shadow-2xl transition-all duration-300 active:scale-90 active:opacity-80 focus:outline-none backdrop-blur-md ${oe.playBtn}`, children: a.isPlaying ? /* @__PURE__ */ e(Et, { className: `${oe.playIcon} text-white fill-current` }) : /* @__PURE__ */ e($t, { className: `${oe.playIcon} text-white ml-1 fill-current` }) }),
2945
+ c.stopPropagation(), C(), s.togglePlay();
2946
+ }, className: `group relative flex items-center justify-center rounded-full bg-white/10 hover:bg-[var(--accent)] border border-white/10 shadow-2xl transition-all duration-300 active:scale-90 active:opacity-80 focus:outline-none backdrop-blur-md ${ue.playBtn}`, children: a.isPlaying ? /* @__PURE__ */ e(Ft, { className: `${ue.playIcon} text-white fill-current` }) : /* @__PURE__ */ e(Et, { className: `${ue.playIcon} text-white ml-1 fill-current` }) }),
2890
2947
  /* @__PURE__ */ e("button", { onMouseDown: (c) => c.stopPropagation(), onTouchStart: (c) => c.stopPropagation(), onClick: (c) => {
2891
- c.stopPropagation(), S(), Ce("forward");
2892
- }, className: `group flex items-center justify-center rounded-full bg-black/40 hover:bg-black/60 border border-white/10 transition-all duration-300 active:scale-125 active:opacity-80 text-white/90 focus:outline-none backdrop-blur-sm ${oe.skipBtn}`, children: /* @__PURE__ */ e(At, { className: oe.skipIcon }) })
2948
+ c.stopPropagation(), C(), Re("forward");
2949
+ }, className: `group flex items-center justify-center rounded-full bg-black/40 hover:bg-black/60 border border-white/10 transition-all duration-300 active:scale-125 active:opacity-80 text-white/90 focus:outline-none backdrop-blur-sm ${ue.skipBtn}`, children: /* @__PURE__ */ e(Bt, { className: ue.skipIcon }) })
2893
2950
  ] })
2894
2951
  }
2895
2952
  ) : null,
@@ -2898,36 +2955,36 @@ const vn = [
2898
2955
  {
2899
2956
  className: `absolute inset-x-0 bottom-0 z-30 transition-all duration-300 px-4 md:px-6 py-4 bg-gradient-to-t from-black/90 via-black/50 to-transparent ${di ? "opacity-100 translate-y-0" : "opacity-0 translate-y-4 pointer-events-none"}`,
2900
2957
  onClick: (c) => {
2901
- (E || F || P) && S(), c.target === c.currentTarget && ke(!1), c.stopPropagation();
2958
+ (B || V || E) && C(), c.target === c.currentTarget && ze(!1), c.stopPropagation();
2902
2959
  },
2903
2960
  children: [
2904
2961
  !p.isLive && /* @__PURE__ */ d(
2905
2962
  "div",
2906
2963
  {
2907
- ref: He,
2964
+ ref: Ge,
2908
2965
  className: "relative w-full h-3 group/slider mb-3 cursor-pointer touch-none flex items-center",
2909
2966
  onMouseMove: ni,
2910
2967
  onMouseLeave: () => {
2911
- bt(null), gt(null);
2968
+ gt(null), vt(null);
2912
2969
  },
2913
- onMouseDown: Ct,
2914
- onTouchStart: Ct,
2970
+ onMouseDown: Nt,
2971
+ onTouchStart: Nt,
2915
2972
  children: [
2916
- (Lt = p.highlight) == null ? void 0 : Lt.map((c, v) => /* @__PURE__ */ e("div", { className: "absolute top-1/2 -translate-y-1/2 w-1.5 h-1.5 bg-yellow-400 rounded-full z-10 pointer-events-none", style: { left: `${c.time / a.duration * 100}%` }, title: c.text }, v)),
2917
- ft !== null && /* @__PURE__ */ d("div", { className: "absolute bottom-full mb-1.5 flex flex-col items-center transform -translate-x-1/2 z-40 pointer-events-none transition-opacity duration-150", style: { left: `clamp(70px, ${Yt}%, calc(100% - 70px))` }, children: [
2918
- ie && /* @__PURE__ */ e("div", { className: "bg-black/90 border border-white/10 shadow-2xl overflow-hidden backdrop-blur-sm", style: { width: `${ie.w * 0.5}px`, height: `${ie.h * 0.5}px`, borderRadius: "var(--radius)" }, children: /* @__PURE__ */ e("div", { style: { backgroundImage: `url("${ie.url}")`, width: `${ie.w}px`, height: `${ie.h}px`, backgroundPosition: `-${ie.x}px -${ie.y}px`, backgroundRepeat: "no-repeat", transform: "scale(0.5)", transformOrigin: "top left" } }) }),
2919
- /* @__PURE__ */ e("div", { className: "strata-tooltip px-2 py-0.5 text-[11px] font-bold font-mono shadow-lg tabular-nums mt-1", children: _e(ft) })
2973
+ ($t = p.highlight) == null ? void 0 : $t.map((c, v) => /* @__PURE__ */ e("div", { className: "absolute top-1/2 -translate-y-1/2 w-1.5 h-1.5 bg-yellow-400 rounded-full z-10 pointer-events-none", style: { left: `${c.time / a.duration * 100}%` }, title: c.text }, v)),
2974
+ bt !== null && /* @__PURE__ */ d("div", { className: "absolute bottom-full mb-1.5 flex flex-col items-center transform -translate-x-1/2 z-40 pointer-events-none transition-opacity duration-150", style: { left: `clamp(70px, ${Yt}%, calc(100% - 70px))` }, children: [
2975
+ re && /* @__PURE__ */ e("div", { className: "bg-black/90 border border-white/10 shadow-2xl overflow-hidden backdrop-blur-sm", style: { width: `${re.w * 0.5}px`, height: `${re.h * 0.5}px`, borderRadius: "var(--radius)" }, children: /* @__PURE__ */ e("div", { style: { backgroundImage: `url("${re.url}")`, width: `${re.w}px`, height: `${re.h}px`, backgroundPosition: `-${re.x}px -${re.y}px`, backgroundRepeat: "no-repeat", transform: "scale(0.5)", transformOrigin: "top left" } }) }),
2976
+ /* @__PURE__ */ e("div", { className: "strata-tooltip px-2 py-0.5 text-[11px] font-bold font-mono shadow-lg tabular-nums mt-1", children: Je(bt) })
2920
2977
  ] }),
2921
2978
  /* @__PURE__ */ d("div", { className: "w-full h-1 bg-white/20 overflow-hidden relative backdrop-blur-sm border-[length:var(--border-width)] border-white/10", style: { borderRadius: "var(--radius-full)" }, children: [
2922
2979
  a.duration > 0 && a.buffered.map((c, v) => /* @__PURE__ */ e("div", { className: "absolute top-0 bottom-0 bg-white/20", style: { left: `${c.start / a.duration * 100}%`, width: `${(c.end - c.start) / a.duration * 100}%` } }, v)),
2923
- /* @__PURE__ */ e("div", { className: "absolute left-0 top-0 bottom-0 bg-[var(--accent)]", style: { width: `${(Ae ? ye : a.currentTime) / a.duration * 100}%` } })
2980
+ /* @__PURE__ */ e("div", { className: "absolute left-0 top-0 bottom-0 bg-[var(--accent)]", style: { width: `${(Oe ? Te : a.currentTime) / a.duration * 100}%` } })
2924
2981
  ] }),
2925
2982
  /* @__PURE__ */ e(
2926
2983
  "div",
2927
2984
  {
2928
2985
  className: "absolute top-1/2 -translate-y-1/2 -translate-x-1/2 w-3.5 h-3.5 bg-white shadow-md scale-0 group-hover/slider:scale-100 transition-transform duration-100 z-10",
2929
2986
  style: {
2930
- left: `${(Ae ? ye : a.currentTime) / a.duration * 100}%`,
2987
+ left: `${(Oe ? Te : a.currentTime) / a.duration * 100}%`,
2931
2988
  borderRadius: "var(--radius-full)"
2932
2989
  }
2933
2990
  }
@@ -2936,8 +2993,8 @@ const vn = [
2936
2993
  }
2937
2994
  ),
2938
2995
  /* @__PURE__ */ d("div", { className: "flex items-center justify-between pointer-events-auto", children: [
2939
- /* @__PURE__ */ e("div", { className: "flex items-center gap-3", children: zt.filter((c) => c.position === "left" || c.position === "center").map(It) }),
2940
- /* @__PURE__ */ e("div", { className: "flex items-center gap-1", children: zt.filter((c) => c.position === "right").map(It) })
2996
+ /* @__PURE__ */ e("div", { className: "flex items-center gap-3", children: It.filter((c) => c.position === "left" || c.position === "center").map(Rt) }),
2997
+ /* @__PURE__ */ e("div", { className: "flex items-center gap-1", children: It.filter((c) => c.position === "right").map(Rt) })
2941
2998
  ] })
2942
2999
  ]
2943
3000
  }
@@ -2946,21 +3003,21 @@ const vn = [
2946
3003
  ]
2947
3004
  }
2948
3005
  );
2949
- return a.isWebFullscreen && typeof document < "u" ? vi(Rt, document.body) : Rt;
2950
- }, Tn = (i, t) => {
2951
- const n = gi(i);
2952
- return n.render(ve.createElement(Dt, t)), {
3006
+ return a.isWebFullscreen && typeof document < "u" ? vi(Pt, document.body) : Pt;
3007
+ }, Tn = (n, t) => {
3008
+ const i = gi(n);
3009
+ return i.render(ke.createElement(Ot, t)), {
2953
3010
  unmount: () => {
2954
- n.unmount();
3011
+ i.unmount();
2955
3012
  },
2956
3013
  update: (o) => {
2957
- n.render(ve.createElement(Dt, { ...t, ...o }));
3014
+ i.render(ke.createElement(Ot, { ...t, ...o }));
2958
3015
  }
2959
3016
  };
2960
3017
  };
2961
3018
  export {
2962
3019
  Ni as StrataCore,
2963
- Dt as StrataPlayer,
3020
+ Ot as StrataPlayer,
2964
3021
  Tn as mountStrataPlayer
2965
3022
  };
2966
3023
  //# sourceMappingURL=strataplayer.es.js.map