strataplayer 1.2.19 → 1.2.21

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