strataplayer 1.2.20 → 1.2.22

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