playron 1.0.37 → 1.0.39

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,6 +1,6 @@
1
1
  import { jsx as s, jsxs as u, Fragment as oe } from "react/jsx-runtime";
2
- import { createContext as de, useState as b, useEffect as k, useMemo as Ue, useContext as re, memo as kt, useRef as O, useCallback as $ } from "react";
3
- class St {
2
+ import { createContext as ce, useState as b, useEffect as k, useMemo as Ue, useContext as re, memo as kt, useRef as O, useCallback as $ } from "react";
3
+ class At {
4
4
  listeners = /* @__PURE__ */ new Map();
5
5
  /**
6
6
  * Event dinleyicisi ekle
@@ -47,7 +47,7 @@ class St {
47
47
  return this.listeners.get(e)?.size || 0;
48
48
  }
49
49
  }
50
- const ge = new St(), x = {
50
+ const ge = new At(), x = {
51
51
  // Playback events
52
52
  PLAY: "play",
53
53
  PAUSE: "pause",
@@ -78,7 +78,7 @@ const ge = new St(), x = {
78
78
  EMPTIED: "emptied",
79
79
  // Other events
80
80
  RESIZE: "resize"
81
- }, Ae = {
81
+ }, Se = {
82
82
  MEDIA_ERR_ABORTED: 1,
83
83
  // Fetching process aborted by user
84
84
  MEDIA_ERR_NETWORK: 2,
@@ -91,7 +91,7 @@ const ge = new St(), x = {
91
91
  function Ei(a) {
92
92
  return Object.values(x).includes(a);
93
93
  }
94
- class At {
94
+ class St {
95
95
  videoElement = null;
96
96
  isPlaying = !1;
97
97
  isMuted = !1;
@@ -122,10 +122,10 @@ class At {
122
122
  console.error("Video error:", e), this.videoElement?.error && console.error("Video error details:", {
123
123
  code: this.videoElement.error.code,
124
124
  message: this.videoElement.error.message,
125
- MEDIA_ERR_ABORTED: this.videoElement.error.code === Ae.MEDIA_ERR_ABORTED,
126
- MEDIA_ERR_NETWORK: this.videoElement.error.code === Ae.MEDIA_ERR_NETWORK,
127
- MEDIA_ERR_DECODE: this.videoElement.error.code === Ae.MEDIA_ERR_DECODE,
128
- MEDIA_ERR_SRC_NOT_SUPPORTED: this.videoElement.error.code === Ae.MEDIA_ERR_SRC_NOT_SUPPORTED
125
+ MEDIA_ERR_ABORTED: this.videoElement.error.code === Se.MEDIA_ERR_ABORTED,
126
+ MEDIA_ERR_NETWORK: this.videoElement.error.code === Se.MEDIA_ERR_NETWORK,
127
+ MEDIA_ERR_DECODE: this.videoElement.error.code === Se.MEDIA_ERR_DECODE,
128
+ MEDIA_ERR_SRC_NOT_SUPPORTED: this.videoElement.error.code === Se.MEDIA_ERR_SRC_NOT_SUPPORTED
129
129
  });
130
130
  }));
131
131
  }
@@ -560,8 +560,8 @@ class Tt {
560
560
  const i = (n) => {
561
561
  const o = {};
562
562
  let l = !1;
563
- e.forEach((d) => {
564
- r[d] !== n[d] && (o[d] = n[d], l = !0);
563
+ e.forEach((c) => {
564
+ r[c] !== n[c] && (o[c] = n[c], l = !0);
565
565
  }), l && t(o), r = { ...n };
566
566
  };
567
567
  this.subscribe(i);
@@ -710,7 +710,7 @@ class Pt {
710
710
  hasDVR: !1,
711
711
  isEngineSupported: this.preCheckCapability("hls")
712
712
  };
713
- const i = t.includes("#EXT-X-MEDIA-SEQUENCE"), n = t.includes("#EXT-X-ENDLIST"), o = t.includes("#EXT-X-PLAYLIST-TYPE:EVENT"), l = this.extractTargetDuration(t), d = this.extractMediaSequence(t);
713
+ const i = t.includes("#EXT-X-MEDIA-SEQUENCE"), n = t.includes("#EXT-X-ENDLIST"), o = t.includes("#EXT-X-PLAYLIST-TYPE:EVENT"), l = this.extractTargetDuration(t), c = this.extractMediaSequence(t);
714
714
  return i && !n ? {
715
715
  type: "live",
716
716
  protocol: "hls",
@@ -718,7 +718,7 @@ class Pt {
718
718
  hasDVR: o,
719
719
  // EVENT type supports DVR
720
720
  targetDuration: l,
721
- mediaSequence: d,
721
+ mediaSequence: c,
722
722
  isEngineSupported: this.preCheckCapability("hls")
723
723
  } : {
724
724
  type: "vod",
@@ -914,17 +914,17 @@ async function nt(a, e, t, r, i) {
914
914
  let n = new Error("License request failed");
915
915
  for (let o = 0; o <= r; o++) {
916
916
  if (o > 0) {
917
- const c = i * Math.pow(2, o - 1);
918
- await new Promise((h) => setTimeout(h, c));
917
+ const d = i * Math.pow(2, o - 1);
918
+ await new Promise((h) => setTimeout(h, d));
919
919
  }
920
- const l = new AbortController(), d = setTimeout(() => l.abort(), t);
920
+ const l = new AbortController(), c = setTimeout(() => l.abort(), t);
921
921
  try {
922
- const c = await fetch(a, { ...e, signal: l.signal });
923
- if (clearTimeout(d), !c.ok)
924
- throw new Error(`HTTP ${c.status}: ${c.statusText}`);
925
- return await c.arrayBuffer();
926
- } catch (c) {
927
- clearTimeout(d), c instanceof Error && c.name === "AbortError" ? n = new Error(`Request timed out after ${t}ms (attempt ${o + 1}/${r + 1})`) : n = c instanceof Error ? c : new Error(String(c));
922
+ const d = await fetch(a, { ...e, signal: l.signal });
923
+ if (clearTimeout(c), !d.ok)
924
+ throw new Error(`HTTP ${d.status}: ${d.statusText}`);
925
+ return await d.arrayBuffer();
926
+ } catch (d) {
927
+ clearTimeout(c), d instanceof Error && d.name === "AbortError" ? n = new Error(`Request timed out after ${t}ms (attempt ${o + 1}/${r + 1})`) : n = d instanceof Error ? d : new Error(String(d));
928
928
  }
929
929
  }
930
930
  throw n;
@@ -949,11 +949,11 @@ function $t() {
949
949
  }
950
950
  async function Ft(a, e, t = {}, r = !1, i = {}) {
951
951
  const n = i.timeout ?? _t, o = i.maxRetries ?? Vt, l = i.retryDelay ?? Nt;
952
- let d = e;
953
- i.prepareLicenseRequest && (d = await i.prepareLicenseRequest(e));
954
- const c = {
952
+ let c = e;
953
+ i.prepareLicenseRequest && (c = await i.prepareLicenseRequest(e));
954
+ const d = {
955
955
  method: "POST",
956
- body: d,
956
+ body: c,
957
957
  headers: {
958
958
  "Content-Type": "application/octet-stream",
959
959
  ...t
@@ -963,7 +963,7 @@ async function Ft(a, e, t = {}, r = !1, i = {}) {
963
963
  console.debug("[LicenseManager] Acquiring license from:", a);
964
964
  let h = await nt(
965
965
  a,
966
- c,
966
+ d,
967
967
  n,
968
968
  o,
969
969
  l
@@ -1372,8 +1372,8 @@ class Xt {
1372
1372
  try {
1373
1373
  const l = new o.media.MediaInfo(e, t);
1374
1374
  l.streamType = i ? o.media.StreamType.LIVE : o.media.StreamType.BUFFERED, l.metadata = null;
1375
- const d = new o.media.LoadRequest(l);
1376
- d.currentTime = r, d.autoplay = !0, await n.loadMedia(d), console.log(`[ChromecastManager] Media loaded on receiver: ${e} (t=${r}s)`);
1375
+ const c = new o.media.LoadRequest(l);
1376
+ c.currentTime = r, c.autoplay = !0, await n.loadMedia(c), console.log(`[ChromecastManager] Media loaded on receiver: ${e} (t=${r}s)`);
1377
1377
  } catch (l) {
1378
1378
  console.error("[ChromecastManager] loadMedia error:", l);
1379
1379
  }
@@ -1500,7 +1500,7 @@ class fe {
1500
1500
  */
1501
1501
  initialize() {
1502
1502
  if (!this.videoElement) return;
1503
- this.videoEngine = new At(this.videoElement);
1503
+ this.videoEngine = new St(this.videoElement);
1504
1504
  const e = this.loadPersistedVolume();
1505
1505
  e !== null && (this.videoElement.volume = e), this.stateManager = new Tt({
1506
1506
  isPlaying: !1,
@@ -1791,7 +1791,9 @@ class fe {
1791
1791
  const r = this.streamInfo?.isDynamic ?? !1, i = t.protocol === "hls" ? "application/x-mpegURL" : t.protocol === "dash" ? "application/dash+xml" : "video/mp4";
1792
1792
  this.castManager.loadMedia(e, i, 0, r);
1793
1793
  }
1794
- this.startStallDetector();
1794
+ this.startStallDetector(), this.videoElement?.autoplay && this.videoElement.play().catch((r) => {
1795
+ r instanceof DOMException && (r.name === "AbortError" || r.name === "NotAllowedError") || console.warn("[PlayerCore] Autoplay failed:", r);
1796
+ });
1795
1797
  }
1796
1798
  /**
1797
1799
  * Aktif streaming engine'i temizle
@@ -1805,7 +1807,9 @@ class fe {
1805
1807
  async fallbackToNative(e, t) {
1806
1808
  if (!(!this.videoElement || !this.videoEngine))
1807
1809
  try {
1808
- console.log(`[PlayerCore] Attempting native fallback for ${t} stream`), this.videoEngine.setSource(e), this.streamType = "vod", this.streamInfo = {
1810
+ console.log(`[PlayerCore] Attempting native fallback for ${t} stream`), this.videoEngine.setSource(e), this.videoElement?.autoplay && this.videoElement.play().catch((r) => {
1811
+ r instanceof DOMException && (r.name === "AbortError" || r.name);
1812
+ }), this.streamType = "vod", this.streamInfo = {
1809
1813
  type: "vod",
1810
1814
  protocol: "progressive",
1811
1815
  isDynamic: !1,
@@ -2068,7 +2072,7 @@ class fe {
2068
2072
  this.stallDetector?.destroy(), this.stallDetector = null, this.destroyAirPlay(), this.destroyChromecast(), this.destroyStreamingEngines(), this.videoEngine && (this.videoEngine.destroy(), this.videoEngine = null), this.stateManager && (this.stateManager.reset(), this.stateManager = null), this.configManager && (this.configManager.reset(), this.configManager = null), this.videoElement = null, this.container = null;
2069
2073
  }
2070
2074
  }
2071
- const st = de(null), ot = {
2075
+ const st = ce(null), ot = {
2072
2076
  isPlaying: !1,
2073
2077
  isMuted: !1,
2074
2078
  volume: 1,
@@ -2077,7 +2081,7 @@ const st = de(null), ot = {
2077
2081
  isLive: !1,
2078
2082
  isAtLiveEdge: !1,
2079
2083
  liveLatency: 0
2080
- }, at = de(ot), lt = de(null);
2084
+ }, at = ce(ot), lt = ce(null);
2081
2085
  function Gt({ children: a, playerInstance: e }) {
2082
2086
  const [t, r] = b(ot);
2083
2087
  k(() => {
@@ -2085,20 +2089,20 @@ function Gt({ children: a, playerInstance: e }) {
2085
2089
  const n = e.getStateManager();
2086
2090
  if (!n) return;
2087
2091
  r(n.getState());
2088
- const o = (d) => {
2089
- r(d);
2092
+ const o = (c) => {
2093
+ r(c);
2090
2094
  };
2091
2095
  n.subscribe(o);
2092
2096
  const l = e.getVideoElement();
2093
2097
  if (l) {
2094
- const d = () => {
2098
+ const c = () => {
2095
2099
  const g = e.isLive();
2096
2100
  n.updateState({
2097
2101
  currentTime: l.currentTime,
2098
2102
  duration: l.duration || 0,
2099
2103
  isLive: g
2100
2104
  });
2101
- }, c = () => {
2105
+ }, d = () => {
2102
2106
  n.set("isPlaying", !l.paused);
2103
2107
  }, h = () => {
2104
2108
  n.updateState({
@@ -2112,8 +2116,8 @@ function Gt({ children: a, playerInstance: e }) {
2112
2116
  isLive: !0
2113
2117
  });
2114
2118
  };
2115
- return e.events.on("livelatencyupdate", p), l.addEventListener(x.TIME_UPDATE, d), l.addEventListener(x.PLAY, c), l.addEventListener(x.PAUSE, c), l.addEventListener(x.VOLUME_CHANGE, h), l.addEventListener(x.LOADED_METADATA, d), () => {
2116
- e.events.off("livelatencyupdate", p), l.removeEventListener(x.TIME_UPDATE, d), l.removeEventListener(x.PLAY, c), l.removeEventListener(x.PAUSE, c), l.removeEventListener(x.VOLUME_CHANGE, h), l.removeEventListener(x.LOADED_METADATA, d), n.unsubscribe(o);
2119
+ return e.events.on("livelatencyupdate", p), l.addEventListener(x.TIME_UPDATE, c), l.addEventListener(x.PLAY, d), l.addEventListener(x.PAUSE, d), l.addEventListener(x.VOLUME_CHANGE, h), l.addEventListener(x.LOADED_METADATA, c), () => {
2120
+ e.events.off("livelatencyupdate", p), l.removeEventListener(x.TIME_UPDATE, c), l.removeEventListener(x.PLAY, d), l.removeEventListener(x.PAUSE, d), l.removeEventListener(x.VOLUME_CHANGE, h), l.removeEventListener(x.LOADED_METADATA, c), n.unsubscribe(o);
2117
2121
  };
2118
2122
  }
2119
2123
  return () => {
@@ -2273,24 +2277,24 @@ const Zt = "_overlay_3mfq6_3", Jt = "_iconContainer_3mfq6_17", er = "_loading_3m
2273
2277
  customIcon: rr
2274
2278
  };
2275
2279
  function ir({ config: a, isAdLoading: e }) {
2276
- const t = Y((D) => D.isPlaying), { togglePlay: r, toggleFullscreen: i, getPlayer: n } = q(), [o, l] = b(!1), [d, c] = b("play"), [h, p] = b(!1), g = O(null);
2280
+ const t = Y((I) => I.isPlaying), { togglePlay: r, toggleFullscreen: i, getPlayer: n } = q(), [o, l] = b(!1), [c, d] = b("play"), [h, p] = b(!1), g = O(null);
2277
2281
  k(() => {
2278
- console.log("[VideoOverlay] isAdLoading changed:", e), e ? (console.log("[VideoOverlay] ✅ Showing ad loading icon"), p(!0), c("loading"), l(!0)) : (console.log("[VideoOverlay] ❌ Hiding ad loading icon"), p(!1), l(!1));
2282
+ console.log("[VideoOverlay] isAdLoading changed:", e), e ? (console.log("[VideoOverlay] ✅ Showing ad loading icon"), p(!0), d("loading"), l(!0)) : (console.log("[VideoOverlay] ❌ Hiding ad loading icon"), p(!1), l(!1));
2279
2283
  }, [e]);
2280
- const m = a?.ui?.showOverlayIcons !== !1, S = a?.ui?.showPlayPauseIcons !== !1, I = a?.ui?.overlayIcons?.playIcon, C = a?.ui?.overlayIcons?.pauseIcon, T = a?.ui?.overlayIcons?.iconSize || 40, w = a?.ui?.overlayIcons?.containerSize || 80;
2284
+ const m = a?.ui?.showOverlayIcons !== !1, A = a?.ui?.showPlayPauseIcons !== !1, R = a?.ui?.overlayIcons?.playIcon, C = a?.ui?.overlayIcons?.pauseIcon, T = a?.ui?.overlayIcons?.iconSize || 40, w = a?.ui?.overlayIcons?.containerSize || 80;
2281
2285
  k(() => {
2282
- const D = n();
2283
- if (!D) return;
2284
- const A = D.video || D.videoElement;
2285
- if (!A) return;
2286
+ const I = n();
2287
+ if (!I) return;
2288
+ const S = I.video || I.videoElement;
2289
+ if (!S) return;
2286
2290
  const _ = () => {
2287
- p(!0), c("loading"), l(!0), g.current && clearTimeout(g.current);
2291
+ p(!0), d("loading"), l(!0), g.current && clearTimeout(g.current);
2288
2292
  }, W = () => {
2289
2293
  g.current = window.setTimeout(() => {
2290
2294
  p(!1), l(!1);
2291
2295
  }, 300);
2292
2296
  }, E = () => {
2293
- p(!0), c("loading"), l(!0);
2297
+ p(!0), d("loading"), l(!0);
2294
2298
  }, M = () => {
2295
2299
  h && (g.current = window.setTimeout(() => {
2296
2300
  p(!1), l(!1);
@@ -2300,42 +2304,42 @@ function ir({ config: a, isAdLoading: e }) {
2300
2304
  p(!1), l(!1);
2301
2305
  }, 300));
2302
2306
  }, H = () => {
2303
- p(!0), c("loading"), l(!0);
2307
+ p(!0), d("loading"), l(!0);
2304
2308
  };
2305
- return A.addEventListener(x.SEEKING, _), A.addEventListener(x.SEEKED, W), A.addEventListener(x.WAITING, E), A.addEventListener(x.PLAYING, M), A.addEventListener(x.CAN_PLAY, N), A.addEventListener(x.LOAD_START, H), () => {
2306
- A.removeEventListener(x.SEEKING, _), A.removeEventListener(x.SEEKED, W), A.removeEventListener(x.WAITING, E), A.removeEventListener(x.PLAYING, M), A.removeEventListener(x.CAN_PLAY, N), A.removeEventListener(x.LOAD_START, H), g.current && clearTimeout(g.current);
2309
+ return S.addEventListener(x.SEEKING, _), S.addEventListener(x.SEEKED, W), S.addEventListener(x.WAITING, E), S.addEventListener(x.PLAYING, M), S.addEventListener(x.CAN_PLAY, N), S.addEventListener(x.LOAD_START, H), () => {
2310
+ S.removeEventListener(x.SEEKING, _), S.removeEventListener(x.SEEKED, W), S.removeEventListener(x.WAITING, E), S.removeEventListener(x.PLAYING, M), S.removeEventListener(x.CAN_PLAY, N), S.removeEventListener(x.LOAD_START, H), g.current && clearTimeout(g.current);
2307
2311
  };
2308
2312
  }, [n, h]), k(() => {
2309
2313
  if (!h) {
2310
- c(t ? "pause" : "play"), l(!0);
2311
- const D = setTimeout(() => {
2314
+ d(t ? "pause" : "play"), l(!0);
2315
+ const I = setTimeout(() => {
2312
2316
  l(!1);
2313
2317
  }, 600);
2314
- return () => clearTimeout(D);
2318
+ return () => clearTimeout(I);
2315
2319
  }
2316
2320
  }, [t, h]);
2317
2321
  const y = $(async () => {
2318
2322
  await r();
2319
2323
  }, [r]), G = $(() => {
2320
2324
  i();
2321
- }, [i]), X = (D) => {
2322
- const A = D === "play" ? I : C;
2323
- return A ? /^https?:\/\//.test(A) || /\.(jpg|jpeg|png|svg|gif|webp)$/i.test(A) ? /* @__PURE__ */ s(
2325
+ }, [i]), X = (I) => {
2326
+ const S = I === "play" ? R : C;
2327
+ return S ? /^https?:\/\//.test(S) || /\.(jpg|jpeg|png|svg|gif|webp)$/i.test(S) ? /* @__PURE__ */ s(
2324
2328
  "img",
2325
2329
  {
2326
- src: A,
2327
- alt: D === "play" ? "Play" : "Pause",
2330
+ src: S,
2331
+ alt: I === "play" ? "Play" : "Pause",
2328
2332
  className: ne.customIcon,
2329
2333
  style: { "--icon-size": `${T}px` }
2330
2334
  }
2331
2335
  ) : /* @__PURE__ */ s(
2332
2336
  "div",
2333
2337
  {
2334
- dangerouslySetInnerHTML: { __html: A },
2338
+ dangerouslySetInnerHTML: { __html: S },
2335
2339
  className: ne.customIcon,
2336
2340
  style: { "--icon-size": `${T}px` }
2337
2341
  }
2338
- ) : D === "play" ? /* @__PURE__ */ s(
2342
+ ) : I === "play" ? /* @__PURE__ */ s(
2339
2343
  "svg",
2340
2344
  {
2341
2345
  xmlns: "http://www.w3.org/2000/svg",
@@ -2387,7 +2391,7 @@ function ir({ config: a, isAdLoading: e }) {
2387
2391
  className: `virtus-video-overlay ${ne.overlay}`,
2388
2392
  onClick: y,
2389
2393
  onDoubleClick: G,
2390
- children: m && o && !e && (d === "loading" || S) && /* @__PURE__ */ s(
2394
+ children: m && o && !e && (c === "loading" || A) && /* @__PURE__ */ s(
2391
2395
  "div",
2392
2396
  {
2393
2397
  className: `${ne.iconContainer} ${h ? ne.loading : ""}`,
@@ -2395,7 +2399,7 @@ function ir({ config: a, isAdLoading: e }) {
2395
2399
  "--icon-container-size": `${w}px`,
2396
2400
  "--icon-size": `${T}px`
2397
2401
  },
2398
- children: d === "loading" ? /* @__PURE__ */ s(Xe, { size: T }) : X(d)
2402
+ children: c === "loading" ? /* @__PURE__ */ s(Xe, { size: T }) : X(c)
2399
2403
  }
2400
2404
  )
2401
2405
  }
@@ -2409,13 +2413,13 @@ function Ce() {
2409
2413
  throw new Error("usePlayer must be used within PlayerProvider");
2410
2414
  return a;
2411
2415
  }
2412
- const sr = "_errorOverlay_4djr8_5", or = "_variant_drm_4djr8_19", ar = "_variant_network_4djr8_23", lr = "_variant_decode_4djr8_27", dr = "_variant_generic_4djr8_31", cr = "_errorContent_4djr8_37", ur = "_errorIcon_4djr8_51", hr = "_iconPulse_4djr8_1", pr = "_drmGlow_4djr8_1", gr = "_netGlow_4djr8_1", fr = "_errorTitle_4djr8_86", mr = "_errorMessage_4djr8_100", yr = "_errorHint_4djr8_109", vr = "_browserList_4djr8_117", br = "_browserItem_4djr8_126", Er = "_errorCode_4djr8_142", wr = "_retryButton_4djr8_152", te = {
2416
+ const sr = "_errorOverlay_4djr8_5", or = "_variant_drm_4djr8_19", ar = "_variant_network_4djr8_23", lr = "_variant_decode_4djr8_27", cr = "_variant_generic_4djr8_31", dr = "_errorContent_4djr8_37", ur = "_errorIcon_4djr8_51", hr = "_iconPulse_4djr8_1", pr = "_drmGlow_4djr8_1", gr = "_netGlow_4djr8_1", fr = "_errorTitle_4djr8_86", mr = "_errorMessage_4djr8_100", yr = "_errorHint_4djr8_109", vr = "_browserList_4djr8_117", br = "_browserItem_4djr8_126", Er = "_errorCode_4djr8_142", wr = "_retryButton_4djr8_152", te = {
2413
2417
  errorOverlay: sr,
2414
2418
  variant_drm: or,
2415
2419
  variant_network: ar,
2416
2420
  variant_decode: lr,
2417
- variant_generic: dr,
2418
- errorContent: cr,
2421
+ variant_generic: cr,
2422
+ errorContent: dr,
2419
2423
  errorIcon: ur,
2420
2424
  iconPulse: hr,
2421
2425
  drmGlow: pr,
@@ -2508,10 +2512,10 @@ function kr(a) {
2508
2512
  };
2509
2513
  }
2510
2514
  }
2511
- const Sr = 12e3;
2512
- function Ar({ onRetry: a, drmConfig: e }) {
2513
- const t = Ce(), [r, i] = b(null), [n, o] = b(null), l = O(null), d = O(null);
2514
- d.current = r, k(() => {
2515
+ const Ar = 12e3;
2516
+ function Sr({ onRetry: a, drmConfig: e }) {
2517
+ const t = Ce(), [r, i] = b(null), [n, o] = b(null), l = O(null), c = O(null);
2518
+ c.current = r, k(() => {
2515
2519
  it().then((g) => {
2516
2520
  o(g);
2517
2521
  const m = Ge(e, g);
@@ -2526,15 +2530,15 @@ function Ar({ onRetry: a, drmConfig: e }) {
2526
2530
  }, []), k(() => {
2527
2531
  if (!n || !e?.enabled) return;
2528
2532
  const g = Ge(e, n);
2529
- g && !d.current && i({ type: g, code: "DRM_NOT_SUPPORTED", rawMessage: "Browser does not support the required DRM key system.", persistent: !0 });
2533
+ g && !c.current && i({ type: g, code: "DRM_NOT_SUPPORTED", rawMessage: "Browser does not support the required DRM key system.", persistent: !0 });
2530
2534
  }, [e, n]), k(() => {
2531
2535
  if (!t || !e?.enabled) return;
2532
2536
  const g = t.getVideoElement();
2533
2537
  if (!g) return;
2534
2538
  const m = () => {
2535
2539
  g.currentTime > 0.5 || (l.current = setTimeout(() => {
2536
- if (d.current) return;
2537
- const I = n, C = I ? I.fairplay && !I.widevine && !I.playready ? "drm_fairplay_needed" : !I.widevine && !I.fairplay && !I.playready ? "drm_browser_unsupported" : "drm_generic" : "drm_generic";
2540
+ if (c.current) return;
2541
+ const R = n, C = R ? R.fairplay && !R.widevine && !R.playready ? "drm_fairplay_needed" : !R.widevine && !R.fairplay && !R.playready ? "drm_browser_unsupported" : "drm_generic" : "drm_generic";
2538
2542
  i({
2539
2543
  type: C,
2540
2544
  code: "DRM_TIMEOUT",
@@ -2542,19 +2546,19 @@ function Ar({ onRetry: a, drmConfig: e }) {
2542
2546
  persistent: !0
2543
2547
  // don't let a late loadedmetadata dismiss this
2544
2548
  });
2545
- }, Sr));
2546
- }, S = () => {
2549
+ }, Ar));
2550
+ }, A = () => {
2547
2551
  l.current && (clearTimeout(l.current), l.current = null);
2548
2552
  };
2549
- return g.addEventListener("waiting", m), g.addEventListener("playing", S), g.addEventListener("timeupdate", S), () => {
2550
- g.removeEventListener("waiting", m), g.removeEventListener("playing", S), g.removeEventListener("timeupdate", S), S();
2553
+ return g.addEventListener("waiting", m), g.addEventListener("playing", A), g.addEventListener("timeupdate", A), () => {
2554
+ g.removeEventListener("waiting", m), g.removeEventListener("playing", A), g.removeEventListener("timeupdate", A), A();
2551
2555
  };
2552
2556
  }, [t, e, n]), k(() => {
2553
2557
  if (!t) return;
2554
2558
  const g = (m) => {
2555
2559
  console.error("[ErrorOverlay] Player error:", m);
2556
- const S = xr(m, n);
2557
- i({ type: S, code: m.code, rawMessage: m.message ?? "Unknown error" });
2560
+ const A = xr(m, n);
2561
+ i({ type: A, code: m.code, rawMessage: m.message ?? "Unknown error" });
2558
2562
  };
2559
2563
  return t.events.on("error", g), () => {
2560
2564
  t.events.off("error", g);
@@ -2566,7 +2570,7 @@ function Ar({ onRetry: a, drmConfig: e }) {
2566
2570
  t.events.off("play", g), t.events.off("loadedmetadata", g);
2567
2571
  };
2568
2572
  }, [t]);
2569
- const c = $(() => {
2573
+ const d = $(() => {
2570
2574
  if (i(null), a) {
2571
2575
  a();
2572
2576
  return;
@@ -2590,7 +2594,7 @@ function Ar({ onRetry: a, drmConfig: e }) {
2590
2594
  h.hint && /* @__PURE__ */ s("p", { className: te.errorHint, children: h.hint }),
2591
2595
  h.browsers && /* @__PURE__ */ s("ul", { className: te.browserList, children: h.browsers.map((g) => /* @__PURE__ */ s("li", { className: te.browserItem, children: g }, g)) }),
2592
2596
  r.code && h.variant !== "drm" && /* @__PURE__ */ s("p", { className: te.errorCode, children: r.code }),
2593
- h.showRetry && /* @__PURE__ */ s("button", { onClick: c, className: te.retryButton, children: "↻ Try Again" })
2597
+ h.showRetry && /* @__PURE__ */ s("button", { onClick: d, className: te.retryButton, children: "↻ Try Again" })
2594
2598
  ] }) });
2595
2599
  }
2596
2600
  const se = {
@@ -2807,18 +2811,18 @@ function Mr({
2807
2811
  nextTitle: i,
2808
2812
  thumbnail: n
2809
2813
  }) {
2810
- const [o, l] = b(r), d = O(null), c = $(() => {
2811
- d.current && (clearInterval(d.current), d.current = null);
2814
+ const [o, l] = b(r), c = O(null), d = $(() => {
2815
+ c.current && (clearInterval(c.current), c.current = null);
2812
2816
  }, []);
2813
2817
  if (k(() => {
2814
2818
  if (!a) {
2815
- c(), l(r);
2819
+ d(), l(r);
2816
2820
  return;
2817
2821
  }
2818
- return l(r), d.current = setInterval(() => {
2819
- l((m) => m <= 1 ? (c(), e(), 0) : m - 1);
2820
- }, 1e3), c;
2821
- }, [a, r, e, c]), !a) return null;
2822
+ return l(r), c.current = setInterval(() => {
2823
+ l((m) => m <= 1 ? (d(), e(), 0) : m - 1);
2824
+ }, 1e3), d;
2825
+ }, [a, r, e, d]), !a) return null;
2822
2826
  const h = 16, p = 2 * Math.PI * h, g = (r - o) / r * p;
2823
2827
  return /* @__PURE__ */ u(
2824
2828
  "div",
@@ -3047,10 +3051,10 @@ function Pr({ type: a, value: e }) {
3047
3051
  function Lr({ player: a, skipSec: e = 10 }) {
3048
3052
  const [t, r] = b(null), i = O(null), n = $((p) => {
3049
3053
  r(p), i.current && clearTimeout(i.current), i.current = setTimeout(() => r(null), 900);
3050
- }, []), o = O(null), l = 300, d = $((p) => {
3054
+ }, []), o = O(null), l = 300, c = $((p) => {
3051
3055
  if (!a) return;
3052
- const g = p.touches[0], m = Date.now(), S = o.current;
3053
- if (S && m - S.time < l) {
3056
+ const g = p.touches[0], m = Date.now(), A = o.current;
3057
+ if (A && m - A.time < l) {
3054
3058
  const C = p.currentTarget.getBoundingClientRect();
3055
3059
  if (g.clientX - C.left > C.width / 2) {
3056
3060
  const w = a.getVideoElement();
@@ -3063,10 +3067,10 @@ function Lr({ player: a, skipSec: e = 10 }) {
3063
3067
  return;
3064
3068
  }
3065
3069
  o.current = { time: m, x: g.clientX };
3066
- }, [a, e, n]), c = $((p) => {
3070
+ }, [a, e, n]), d = $((p) => {
3067
3071
  }, []), h = $(() => {
3068
3072
  }, []);
3069
- return { onTouchStart: d, onTouchMove: c, onTouchEnd: h, gestureHint: t };
3073
+ return { onTouchStart: c, onTouchMove: d, onTouchEnd: h, gestureHint: t };
3070
3074
  }
3071
3075
  function Rr(a, e) {
3072
3076
  let t;
@@ -3114,16 +3118,16 @@ function Ir({
3114
3118
  break;
3115
3119
  case "ArrowLeft":
3116
3120
  n.preventDefault();
3117
- const d = Math.max(0, l.currentTime - e);
3118
- a.seekTo(d);
3121
+ const c = Math.max(0, l.currentTime - e);
3122
+ a.seekTo(c);
3119
3123
  break;
3120
3124
  case "ArrowRight":
3121
3125
  n.preventDefault();
3122
- const c = Math.min(
3126
+ const d = Math.min(
3123
3127
  l.duration,
3124
3128
  l.currentTime + e
3125
3129
  );
3126
- a.seekTo(c);
3130
+ a.seekTo(d);
3127
3131
  break;
3128
3132
  case "ArrowUp":
3129
3133
  n.preventDefault();
@@ -3166,10 +3170,10 @@ class _r {
3166
3170
  try {
3167
3171
  const n = await this.fetchVAST(e), o = this.parseXML(n), l = o.querySelector("Wrapper");
3168
3172
  if (l) {
3169
- const d = l.querySelector("VASTAdTagURI")?.textContent?.trim();
3170
- if (!d)
3173
+ const c = l.querySelector("VASTAdTagURI")?.textContent?.trim();
3174
+ if (!c)
3171
3175
  throw new Error("Wrapper missing VASTAdTagURI");
3172
- return this.parse(d, t + 1, r);
3176
+ return this.parse(c, t + 1, r);
3173
3177
  }
3174
3178
  return this.parseInline(o);
3175
3179
  } catch (n) {
@@ -3229,14 +3233,14 @@ class _r {
3229
3233
  try {
3230
3234
  const l = o.querySelector("Wrapper");
3231
3235
  if (l) {
3232
- const d = l.querySelector("VASTAdTagURI")?.textContent?.trim();
3233
- if (d) {
3234
- const c = await this.parse(d, 1);
3235
- n.push(c);
3236
+ const c = l.querySelector("VASTAdTagURI")?.textContent?.trim();
3237
+ if (c) {
3238
+ const d = await this.parse(c, 1);
3239
+ n.push(d);
3236
3240
  }
3237
3241
  } else {
3238
- const d = this.parseAdElement(o, r);
3239
- d && n.push(d);
3242
+ const c = this.parseAdElement(o, r);
3243
+ c && n.push(c);
3240
3244
  }
3241
3245
  } catch (l) {
3242
3246
  console.warn("[VASTParser] Failed to parse Ad in pod, skipping:", l);
@@ -3265,17 +3269,17 @@ class _r {
3265
3269
  const T = Array.from(e.children).map((w) => w.tagName);
3266
3270
  throw T.length === 0 ? new Error("VAST Ad element is empty (no ads available)") : new Error(`VAST InLine not found. Found: ${T.join(", ")}`);
3267
3271
  }
3268
- const o = e.getAttribute("id") || `ad-${Date.now()}`, l = n.querySelector("AdTitle")?.textContent?.trim(), d = n.querySelector("Duration")?.textContent?.trim(), c = this.parseDuration(d || "00:00:00"), { mediaFile: h, isVpaid: p, vpaidUrl: g } = this.getMediaFileInfo(n);
3272
+ const o = e.getAttribute("id") || `ad-${Date.now()}`, l = n.querySelector("AdTitle")?.textContent?.trim(), c = n.querySelector("Duration")?.textContent?.trim(), d = this.parseDuration(c || "00:00:00"), { mediaFile: h, isVpaid: p, vpaidUrl: g } = this.getMediaFileInfo(n);
3269
3273
  if (!h) throw new Error("VAST MediaFile not found");
3270
- const m = n.querySelector("ClickThrough")?.textContent?.trim(), S = this.parseTrackingEvents(n, t), I = this.getErrorUrls(t), C = this.parseCompanions(n);
3274
+ const m = n.querySelector("ClickThrough")?.textContent?.trim(), A = this.parseTrackingEvents(n, t), R = this.getErrorUrls(t), C = this.parseCompanions(n);
3271
3275
  return {
3272
3276
  id: o,
3273
3277
  title: l,
3274
- duration: c,
3278
+ duration: d,
3275
3279
  mediaFile: h,
3276
3280
  clickThrough: m,
3277
- trackingEvents: S,
3278
- errorUrls: I,
3281
+ trackingEvents: A,
3282
+ errorUrls: R,
3279
3283
  companions: C.length > 0 ? C : void 0,
3280
3284
  isVpaid: p,
3281
3285
  vpaidUrl: g,
@@ -3286,7 +3290,7 @@ class _r {
3286
3290
  parseCompanions(e) {
3287
3291
  const t = [];
3288
3292
  return e.querySelectorAll("CompanionAds > Companion").forEach((i) => {
3289
- const n = parseInt(i.getAttribute("width") || "0", 10), o = parseInt(i.getAttribute("height") || "0", 10), l = i.getAttribute("id") ?? void 0, d = i.querySelector("StaticResource"), c = i.querySelector("HTMLResource"), h = i.querySelector("IFrameResource"), p = d?.textContent?.trim() ?? void 0, g = c?.textContent?.trim() ?? void 0, m = h?.textContent?.trim() ?? void 0, S = d?.getAttribute("creativeType") ?? void 0, I = i.querySelector("CompanionClickThrough")?.textContent?.trim() ?? void 0, C = i.querySelector("AltText")?.textContent?.trim() ?? void 0, T = [];
3293
+ const n = parseInt(i.getAttribute("width") || "0", 10), o = parseInt(i.getAttribute("height") || "0", 10), l = i.getAttribute("id") ?? void 0, c = i.querySelector("StaticResource"), d = i.querySelector("HTMLResource"), h = i.querySelector("IFrameResource"), p = c?.textContent?.trim() ?? void 0, g = d?.textContent?.trim() ?? void 0, m = h?.textContent?.trim() ?? void 0, A = c?.getAttribute("creativeType") ?? void 0, R = i.querySelector("CompanionClickThrough")?.textContent?.trim() ?? void 0, C = i.querySelector("AltText")?.textContent?.trim() ?? void 0, T = [];
3290
3294
  i.querySelectorAll('TrackingEvents > Tracking[event="creativeView"]').forEach((w) => {
3291
3295
  const y = w.textContent?.trim();
3292
3296
  y && T.push(y);
@@ -3297,8 +3301,8 @@ class _r {
3297
3301
  staticResource: p,
3298
3302
  htmlResource: g,
3299
3303
  iFrameResource: m,
3300
- type: S,
3301
- clickThrough: I,
3304
+ type: A,
3305
+ clickThrough: R,
3302
3306
  altText: C,
3303
3307
  viewTrackingUrls: T.length > 0 ? T : void 0
3304
3308
  });
@@ -3342,8 +3346,8 @@ class _r {
3342
3346
  i.length > 0 && (r.impression = Array.from(i).map((o) => o.textContent?.trim()).filter(Boolean));
3343
3347
  const n = ["start", "firstQuartile", "midpoint", "thirdQuartile", "complete", "skip", "pause", "resume"];
3344
3348
  return e.querySelectorAll("Tracking").forEach((o) => {
3345
- const l = o.getAttribute("event"), d = o.textContent?.trim();
3346
- !l || !d || !n.includes(l) || (r[l] || (r[l] = []), r[l].push(d));
3349
+ const l = o.getAttribute("event"), c = o.textContent?.trim();
3350
+ !l || !c || !n.includes(l) || (r[l] || (r[l] = []), r[l].push(c));
3347
3351
  }), r;
3348
3352
  }
3349
3353
  /**
@@ -3369,12 +3373,12 @@ class Vr {
3369
3373
  const t = await this.fetchVMAP(e), r = this.parseXML(t), i = "http://www.iab.net/videosuite/vmap";
3370
3374
  let n = r.querySelector("vmap\\:VMAP, VMAP");
3371
3375
  if (!n) {
3372
- const d = r.getElementsByTagNameNS(i, "VMAP");
3373
- if (d.length > 0)
3374
- n = d[0];
3376
+ const c = r.getElementsByTagNameNS(i, "VMAP");
3377
+ if (c.length > 0)
3378
+ n = c[0];
3375
3379
  else {
3376
- const c = r.getElementsByTagName("VMAP");
3377
- c.length > 0 && (n = c[0]);
3380
+ const d = r.getElementsByTagName("VMAP");
3381
+ d.length > 0 && (n = d[0]);
3378
3382
  }
3379
3383
  }
3380
3384
  if (!n)
@@ -3453,9 +3457,9 @@ class Vr {
3453
3457
  const r = this.parseTimeOffset(t), i = "http://www.iab.net/videosuite/vmap";
3454
3458
  let n = e.querySelector("vmap\\:AdSource, AdSource");
3455
3459
  if (!n) {
3456
- const c = e.getElementsByTagNameNS(i, "AdSource");
3457
- if (c.length > 0)
3458
- n = c[0];
3460
+ const d = e.getElementsByTagNameNS(i, "AdSource");
3461
+ if (d.length > 0)
3462
+ n = d[0];
3459
3463
  else {
3460
3464
  const h = e.getElementsByTagName("AdSource");
3461
3465
  h.length > 0 && (n = h[0]);
@@ -3465,22 +3469,22 @@ class Vr {
3465
3469
  return console.warn("[VMAPParser] AdBreak missing AdSource, skipping"), null;
3466
3470
  let o = n.querySelector("vmap\\:AdTagURI, AdTagURI");
3467
3471
  if (!o) {
3468
- const c = n.getElementsByTagNameNS(i, "AdTagURI");
3469
- if (c.length > 0)
3470
- o = c[0];
3472
+ const d = n.getElementsByTagNameNS(i, "AdTagURI");
3473
+ if (d.length > 0)
3474
+ o = d[0];
3471
3475
  else {
3472
3476
  const h = n.getElementsByTagName("AdTagURI");
3473
3477
  h.length > 0 && (o = h[0]);
3474
3478
  }
3475
3479
  }
3476
3480
  if (!o)
3477
- return console.warn("[VMAPParser] AdSource missing AdTagURI, skipping"), console.warn("[VMAPParser] AdSource children:", Array.from(n.children).map((c) => c.tagName)), null;
3481
+ return console.warn("[VMAPParser] AdSource missing AdTagURI, skipping"), console.warn("[VMAPParser] AdSource children:", Array.from(n.children).map((d) => d.tagName)), null;
3478
3482
  let l = o.textContent?.trim() || o.innerHTML?.trim();
3479
3483
  if (!l)
3480
3484
  return console.warn("[VMAPParser] AdTagURI is empty, skipping"), null;
3481
3485
  l = l.replace(/<!\\[CDATA\\[(.*?)\\]\\]>/g, "$1").trim();
3482
- const d = document.createElement("textarea");
3483
- return d.innerHTML = l, l = d.value, console.log("[VMAPParser] AdBreak parsed:", {
3486
+ const c = document.createElement("textarea");
3487
+ return c.innerHTML = l, l = c.value, console.log("[VMAPParser] AdBreak parsed:", {
3484
3488
  timeOffset: r,
3485
3489
  timeOffsetStr: t,
3486
3490
  vastUrl: l.substring(0, 100) + (l.length > 100 ? "..." : "")
@@ -3705,20 +3709,20 @@ class Br {
3705
3709
  window.getVPAIDAd = function() { return typeof window.VPAIDCreative !== 'undefined' ? new window.VPAIDCreative() : null; };
3706
3710
  <\/script>
3707
3711
  </body></html>`), l.close(), this.vpaidIframe.onload = () => {
3708
- const c = this.vpaidIframe?.contentWindow?.getVPAIDAd?.() ?? null;
3709
- if (!c) {
3712
+ const d = this.vpaidIframe?.contentWindow?.getVPAIDAd?.() ?? null;
3713
+ if (!d) {
3710
3714
  console.warn("[AdPlayer] VPAID creative not found in iframe, skipping"), this.hideLoadingCallback && this.hideLoadingCallback(), t();
3711
3715
  return;
3712
3716
  }
3713
- this.vpaidCreative = c, c.handshakeVersion("2.0"), c.subscribe(t, "AdStopped"), c.subscribe(t, "AdVideoComplete"), c.subscribe(t, "AdSkipped"), c.subscribe(() => {
3717
+ this.vpaidCreative = d, d.handshakeVersion("2.0"), d.subscribe(t, "AdStopped"), d.subscribe(t, "AdVideoComplete"), d.subscribe(t, "AdSkipped"), d.subscribe(() => {
3714
3718
  this.hideLoadingCallback && this.hideLoadingCallback(), this.tracker.trackStart(e);
3715
- }, "AdStarted"), c.subscribe(() => {
3719
+ }, "AdStarted"), d.subscribe(() => {
3716
3720
  r(new Error("VPAID AdError"));
3717
- }, "AdError"), c.initAd(n, o, "normal", -1, { AdParameters: "" }, {
3721
+ }, "AdError"), d.initAd(n, o, "normal", -1, { AdParameters: "" }, {
3718
3722
  slot: i,
3719
3723
  videoSlot: this.adVideo,
3720
3724
  videoSlotCanAutoPlay: !0
3721
- }), c.startAd();
3725
+ }), d.startAd();
3722
3726
  };
3723
3727
  });
3724
3728
  }
@@ -3807,12 +3811,12 @@ class Br {
3807
3811
  const i = this.adVideo;
3808
3812
  let n = !1;
3809
3813
  const o = () => {
3810
- i.play().catch((S) => {
3811
- n || (m(), r(S));
3814
+ i.play().catch((A) => {
3815
+ n || (m(), r(A));
3812
3816
  });
3813
- }, l = () => this.tracker.trackStart(e), d = () => {
3817
+ }, l = () => this.tracker.trackStart(e), c = () => {
3814
3818
  console.log("[AdPlayer] Ad video playing, hiding loading..."), this.hideLoadingCallback && this.hideLoadingCallback();
3815
- }, c = () => this.updateUI(e), h = () => {
3819
+ }, d = () => this.updateUI(e), h = () => {
3816
3820
  n || (m(), t());
3817
3821
  };
3818
3822
  let p = !1;
@@ -3822,22 +3826,22 @@ class Br {
3822
3826
  t();
3823
3827
  return;
3824
3828
  }
3825
- const S = i.error?.code;
3826
- if (S === 4) {
3829
+ const A = i.error?.code;
3830
+ if (A === 4) {
3827
3831
  m(), t();
3828
3832
  return;
3829
3833
  }
3830
- m(), r(new Error(`Ad video playback error: ${i.error?.message ?? "Unknown"} (code: ${S})`));
3834
+ m(), r(new Error(`Ad video playback error: ${i.error?.message ?? "Unknown"} (code: ${A})`));
3831
3835
  }, m = () => {
3832
3836
  if (!n) {
3833
3837
  n = !0;
3834
3838
  try {
3835
- i.removeEventListener("canplay", o), i.removeEventListener("play", l), i.removeEventListener("playing", d), i.removeEventListener("timeupdate", c), i.removeEventListener("ended", h), i.removeEventListener("error", g), i.pause(), i.parentNode && i.parentNode.removeChild(i);
3839
+ i.removeEventListener("canplay", o), i.removeEventListener("play", l), i.removeEventListener("playing", c), i.removeEventListener("timeupdate", d), i.removeEventListener("ended", h), i.removeEventListener("error", g), i.pause(), i.parentNode && i.parentNode.removeChild(i);
3836
3840
  } catch {
3837
3841
  }
3838
3842
  }
3839
3843
  };
3840
- i.addEventListener("canplay", o), i.addEventListener("play", l), i.addEventListener("playing", d), i.addEventListener("timeupdate", c), i.addEventListener("ended", h), i.addEventListener("error", g), i.src = e.mediaFile, i.load(), setTimeout(() => {
3844
+ i.addEventListener("canplay", o), i.addEventListener("play", l), i.addEventListener("playing", c), i.addEventListener("timeupdate", d), i.addEventListener("ended", h), i.addEventListener("error", g), i.src = e.mediaFile, i.load(), setTimeout(() => {
3841
3845
  this.state.isPlaying && this.state.currentTime === 0 && !n && (m(), r(new Error("Ad video timeout")));
3842
3846
  }, this.config.timeout || 1e4);
3843
3847
  });
@@ -4205,29 +4209,29 @@ class $r {
4205
4209
  this.hideAdLoading(), this.adPlayer.destroy(), this.preRollPlayed = !1, this.midRollsPlayed.clear(), this.postRollPlayed = !1, this.vmapData = null, console.log("[AdManager] Destroyed");
4206
4210
  }
4207
4211
  }
4208
- const dt = {
4212
+ const ct = {
4209
4213
  bottomOffset: 110,
4210
4214
  fontSize: 18,
4211
4215
  color: "#ffffff",
4212
4216
  background: "rgba(0,0,0,0.75)"
4213
- }, ct = de({
4214
- style: dt,
4217
+ }, dt = ce({
4218
+ style: ct,
4215
4219
  setStyle: () => {
4216
4220
  }
4217
4221
  });
4218
4222
  function Fr({ children: a }) {
4219
- const [e, t] = b(dt), r = (i) => t((n) => ({ ...n, ...i }));
4220
- return /* @__PURE__ */ s(ct.Provider, { value: { style: e, setStyle: r }, children: a });
4223
+ const [e, t] = b(ct), r = (i) => t((n) => ({ ...n, ...i }));
4224
+ return /* @__PURE__ */ s(dt.Provider, { value: { style: e, setStyle: r }, children: a });
4221
4225
  }
4222
4226
  function ut() {
4223
- return re(ct);
4227
+ return re(dt);
4224
4228
  }
4225
4229
  function Ur({ videoElement: a }) {
4226
4230
  const { style: e } = ut(), [t, r] = b([]), i = O(""), n = O(0);
4227
4231
  return k(() => {
4228
4232
  if (!a) return;
4229
4233
  const o = () => {
4230
- const l = a.textTracks, d = [];
4234
+ const l = a.textTracks, c = [];
4231
4235
  for (let h = 0; h < l.length; h++) {
4232
4236
  const p = l[h];
4233
4237
  if (p.kind !== "subtitles" && p.kind !== "captions" || p.mode === "disabled") continue;
@@ -4235,12 +4239,12 @@ function Ur({ videoElement: a }) {
4235
4239
  const g = p.activeCues;
4236
4240
  if (g)
4237
4241
  for (let m = 0; m < g.length; m++) {
4238
- const S = g[m];
4239
- S.text && d.push(S.text);
4242
+ const A = g[m];
4243
+ A.text && c.push(A.text);
4240
4244
  }
4241
4245
  }
4242
- const c = d.join("\0");
4243
- c !== i.current && (i.current = c, r(d)), n.current = requestAnimationFrame(o);
4246
+ const d = c.join("\0");
4247
+ d !== i.current && (i.current = d, r(c)), n.current = requestAnimationFrame(o);
4244
4248
  };
4245
4249
  return n.current = requestAnimationFrame(o), () => {
4246
4250
  cancelAnimationFrame(n.current);
@@ -4285,7 +4289,7 @@ function Ur({ videoElement: a }) {
4285
4289
  }
4286
4290
  );
4287
4291
  }
4288
- const He = de(!0);
4292
+ const He = ce(!0);
4289
4293
  function wi({
4290
4294
  src: a = "https://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4",
4291
4295
  defaultControls: e = !1,
@@ -4295,14 +4299,14 @@ function wi({
4295
4299
  className: n,
4296
4300
  children: o,
4297
4301
  config: l,
4298
- onAdLoading: d,
4299
- onNextEpisode: c,
4302
+ onAdLoading: c,
4303
+ onNextEpisode: d,
4300
4304
  nextEpisodeTitle: h,
4301
4305
  nextEpisodeThumbnail: p,
4302
4306
  endCardCountdown: g = 5,
4303
4307
  crossOrigin: m
4304
4308
  }) {
4305
- const S = O(null), I = O(null), [C, T] = b(null), w = O(null), [y, G] = b(!1), [X, D] = b(!1), A = $(() => D(!0), []), _ = $(() => D(!1), []), [W, E] = b(!1), { onTouchStart: M, onTouchMove: N, onTouchEnd: H, gestureHint: Q } = Lr({
4309
+ const A = O(null), R = O(null), [C, T] = b(null), w = O(null), [y, G] = b(!1), [X, I] = b(!1), S = $(() => I(!0), []), _ = $(() => I(!1), []), [W, E] = b(!1), { onTouchStart: M, onTouchMove: N, onTouchEnd: H, gestureHint: Q } = Lr({
4306
4310
  player: C,
4307
4311
  skipSec: 10
4308
4312
  }), { isActive: L } = Dr({
@@ -4313,7 +4317,7 @@ function wi({
4313
4317
  player: C,
4314
4318
  seekStep: 10,
4315
4319
  enabled: !0,
4316
- onShowShortcuts: A
4320
+ onShowShortcuts: S
4317
4321
  });
4318
4322
  const B = Ue(() => !l?.ads?.enabled || !l.ads.vastUrl && !l.ads.vmapUrl ? null : {
4319
4323
  enabled: !0,
@@ -4331,17 +4335,19 @@ function wi({
4331
4335
  l?.ads?.maxWrapperDepth
4332
4336
  ]);
4333
4337
  k(() => {
4334
- if (!I.current || !S.current) return;
4338
+ R.current && (R.current.muted = r);
4339
+ }, [r]), k(() => {
4340
+ if (!R.current || !A.current) return;
4335
4341
  console.log("[Player] Initializing PlayerCore");
4336
- const F = new fe(I.current);
4337
- return fe.preloadEngines(), F.container = S.current, T(F), () => {
4342
+ const F = new fe(R.current);
4343
+ return fe.preloadEngines(), F.container = A.current, T(F), () => {
4338
4344
  console.log("[Player] Cleanup called - destroying PlayerCore"), w.current && (console.log("[Player] Destroying AdManager"), w.current.destroy(), w.current = null), F.destroy(), T(null);
4339
4345
  };
4340
4346
  }, []), k(() => {
4341
4347
  if (!C || !B) return;
4342
4348
  console.log("[Player] Setting up ads");
4343
4349
  const F = (J) => {
4344
- G(J), d?.(J);
4350
+ G(J), c?.(J);
4345
4351
  }, Z = new $r(C, B, F);
4346
4352
  return w.current = Z, Z.setup().catch((J) => {
4347
4353
  console.error("[Player] Failed to setup ads:", J);
@@ -4359,16 +4365,16 @@ function wi({
4359
4365
  console.error("[Player] setSource failed:", F);
4360
4366
  }));
4361
4367
  }, [C, a]), k(() => {
4362
- if (!C || !c) return;
4368
+ if (!C || !d) return;
4363
4369
  const F = C.getVideoElement();
4364
4370
  if (!F) return;
4365
4371
  const Z = () => E(!0);
4366
4372
  return F.addEventListener("ended", Z), () => F.removeEventListener("ended", Z);
4367
- }, [C, c]), /* @__PURE__ */ u(Fr, { children: [
4373
+ }, [C, d]), /* @__PURE__ */ u(Fr, { children: [
4368
4374
  /* @__PURE__ */ u(
4369
4375
  "div",
4370
4376
  {
4371
- ref: S,
4377
+ ref: A,
4372
4378
  role: "region",
4373
4379
  "aria-label": "Video Player",
4374
4380
  className: `playron-wrapper ${n || ""}`,
@@ -4403,7 +4409,7 @@ function wi({
4403
4409
  /* @__PURE__ */ s(
4404
4410
  "video",
4405
4411
  {
4406
- ref: I,
4412
+ ref: R,
4407
4413
  className: `virtus-video-element ${n || ""}`,
4408
4414
  style: {
4409
4415
  width: "100%",
@@ -4423,17 +4429,17 @@ function wi({
4423
4429
  }
4424
4430
  ),
4425
4431
  C ? /* @__PURE__ */ s(Gt, { playerInstance: C, children: /* @__PURE__ */ u(He.Provider, { value: L, children: [
4426
- /* @__PURE__ */ s(Ur, { videoElement: I.current }),
4432
+ /* @__PURE__ */ s(Ur, { videoElement: R.current }),
4427
4433
  /* @__PURE__ */ s(nr, { config: l, isAdLoading: y }),
4428
4434
  /* @__PURE__ */ s(Pr, { type: Q?.type ?? null, value: Q?.value ?? "" }),
4429
- /* @__PURE__ */ s(Ar, { drmConfig: l?.drm }),
4435
+ /* @__PURE__ */ s(Sr, { drmConfig: l?.drm }),
4430
4436
  /* @__PURE__ */ s(Tr, { isOpen: X, onClose: _ }),
4431
- c && /* @__PURE__ */ s(
4437
+ d && /* @__PURE__ */ s(
4432
4438
  Mr,
4433
4439
  {
4434
4440
  isVisible: W,
4435
4441
  onNextEpisode: () => {
4436
- E(!1), c();
4442
+ E(!1), d();
4437
4443
  },
4438
4444
  onDismiss: () => E(!1),
4439
4445
  countdownSec: g,
@@ -4494,9 +4500,9 @@ function zr({
4494
4500
  style: o,
4495
4501
  ...l
4496
4502
  }) {
4497
- const d = Y((g) => g.isPlaying), { togglePlay: c } = q(), h = async (g) => {
4503
+ const c = Y((g) => g.isPlaying), { togglePlay: d } = q(), h = async (g) => {
4498
4504
  try {
4499
- await c();
4505
+ await d();
4500
4506
  } catch (m) {
4501
4507
  console.error("Play/Pause error:", m);
4502
4508
  }
@@ -4506,14 +4512,14 @@ function zr({
4506
4512
  "button",
4507
4513
  {
4508
4514
  className: `virtus-btn virtus-play-button ${Hr.playButton} ${a || ""}`,
4509
- "aria-label": d ? "Pause" : "Play",
4515
+ "aria-label": c ? "Pause" : "Play",
4510
4516
  onClick: h,
4511
4517
  style: {
4512
4518
  ...p !== void 0 ? { "--btn-hover-bg": p } : {},
4513
4519
  ...o
4514
4520
  },
4515
4521
  ...l,
4516
- children: d ? i ?? /* @__PURE__ */ s(
4522
+ children: c ? i ?? /* @__PURE__ */ s(
4517
4523
  "svg",
4518
4524
  {
4519
4525
  "aria-hidden": "true",
@@ -4612,7 +4618,7 @@ function jr({
4612
4618
  style: o,
4613
4619
  ...l
4614
4620
  }) {
4615
- const { toggleFullscreen: d } = q(), [c, h] = b(!1);
4621
+ const { toggleFullscreen: c } = q(), [d, h] = b(!1);
4616
4622
  k(() => {
4617
4623
  const m = () => {
4618
4624
  h(!!document.fullscreenElement);
@@ -4622,20 +4628,20 @@ function jr({
4622
4628
  };
4623
4629
  }, []);
4624
4630
  const p = (m) => {
4625
- d(), e?.(m);
4631
+ c(), e?.(m);
4626
4632
  }, g = typeof r == "string" ? r : r === !1 ? "transparent" : void 0;
4627
4633
  return /* @__PURE__ */ s(
4628
4634
  "button",
4629
4635
  {
4630
4636
  className: `virtus-btn virtus-fullscreen-button ${be.controlButton} ${a || ""}`,
4631
- "aria-label": c ? "Exit Fullscreen" : "Fullscreen",
4637
+ "aria-label": d ? "Exit Fullscreen" : "Fullscreen",
4632
4638
  onClick: p,
4633
4639
  style: {
4634
4640
  ...g !== void 0 ? { "--btn-hover-bg": g } : {},
4635
4641
  ...o
4636
4642
  },
4637
4643
  ...l,
4638
- children: c ? n ?? /* @__PURE__ */ s(
4644
+ children: d ? n ?? /* @__PURE__ */ s(
4639
4645
  "svg",
4640
4646
  {
4641
4647
  xmlns: "http://www.w3.org/2000/svg",
@@ -4676,8 +4682,8 @@ function Kr({ className: a, onClick: e, ...t }) {
4676
4682
  const o = async (l) => {
4677
4683
  try {
4678
4684
  await r();
4679
- } catch (d) {
4680
- console.error("PiP toggle error:", d);
4685
+ } catch (c) {
4686
+ console.error("PiP toggle error:", c);
4681
4687
  }
4682
4688
  e?.(l);
4683
4689
  };
@@ -4794,7 +4800,7 @@ function Yr(a, e, t = !0) {
4794
4800
  };
4795
4801
  }, [a, e, t]);
4796
4802
  }
4797
- const Te = de({
4803
+ const Te = ce({
4798
4804
  isOpen: !1,
4799
4805
  toggle: () => {
4800
4806
  },
@@ -4804,7 +4810,7 @@ const Te = de({
4804
4810
  }
4805
4811
  });
4806
4812
  function ht({ children: a }) {
4807
- const [e, t] = b(!1), r = O(null), i = () => t((d) => !d), n = () => t(!1), o = () => t(!0);
4813
+ const [e, t] = b(!1), r = O(null), i = () => t((c) => !c), n = () => t(!1), o = () => t(!0);
4808
4814
  Yr(r, n, e);
4809
4815
  const l = {
4810
4816
  isOpen: e,
@@ -5008,16 +5014,16 @@ function We({
5008
5014
  }
5009
5015
  );
5010
5016
  }
5011
- function Si() {
5017
+ function Ai() {
5012
5018
  const a = q(), e = Y(), [t, r] = b(1), [i, n] = b(!1), o = [0.25, 0.5, 0.75, 1, 1.25, 1.5, 1.75, 2];
5013
5019
  k(() => {
5014
5020
  e?.playbackRate !== void 0 && r(e.playbackRate);
5015
5021
  }, [e?.playbackRate]);
5016
- const l = (c) => {
5017
- a.setPlaybackRate(c), r(c);
5018
- }, d = () => {
5019
- const c = !i;
5020
- n(c), a.setLoop(c);
5022
+ const l = (d) => {
5023
+ a.setPlaybackRate(d), r(d);
5024
+ }, c = () => {
5025
+ const d = !i;
5026
+ n(d), a.setLoop(d);
5021
5027
  };
5022
5028
  return /* @__PURE__ */ u(ht, { children: [
5023
5029
  /* @__PURE__ */ s(pt, { children: /* @__PURE__ */ s(
@@ -5037,11 +5043,11 @@ function Si() {
5037
5043
  cursor: "pointer",
5038
5044
  transition: "all 0.2s ease"
5039
5045
  },
5040
- onMouseEnter: (c) => {
5041
- c.currentTarget.style.background = "rgba(255, 255, 255, 0.2)", c.currentTarget.style.transform = "scale(1.05)";
5046
+ onMouseEnter: (d) => {
5047
+ d.currentTarget.style.background = "rgba(255, 255, 255, 0.2)", d.currentTarget.style.transform = "scale(1.05)";
5042
5048
  },
5043
- onMouseLeave: (c) => {
5044
- c.currentTarget.style.background = "rgba(255, 255, 255, 0.1)", c.currentTarget.style.transform = "scale(1)";
5049
+ onMouseLeave: (d) => {
5050
+ d.currentTarget.style.background = "rgba(255, 255, 255, 0.1)", d.currentTarget.style.transform = "scale(1)";
5045
5051
  },
5046
5052
  children: /* @__PURE__ */ u(
5047
5053
  "svg",
@@ -5063,20 +5069,20 @@ function Si() {
5063
5069
  ) }),
5064
5070
  /* @__PURE__ */ u(gt, { title: "Settings", placement: "top-right", children: [
5065
5071
  /* @__PURE__ */ s("div", { style: { padding: "8px 16px 4px", color: "rgba(255, 255, 255, 0.6)", fontSize: "12px", fontWeight: 600 }, children: "Playback Speed" }),
5066
- o.map((c) => /* @__PURE__ */ u(
5072
+ o.map((d) => /* @__PURE__ */ u(
5067
5073
  We,
5068
5074
  {
5069
- selected: t === c,
5070
- onClick: () => l(c),
5075
+ selected: t === d,
5076
+ onClick: () => l(d),
5071
5077
  children: [
5072
- c,
5078
+ d,
5073
5079
  "x"
5074
5080
  ]
5075
5081
  },
5076
- c
5082
+ d
5077
5083
  )),
5078
5084
  /* @__PURE__ */ s("div", { style: { height: "1px", background: "rgba(255, 255, 255, 0.1)", margin: "8px 0" } }),
5079
- /* @__PURE__ */ u(We, { selected: i, onClick: d, children: [
5085
+ /* @__PURE__ */ u(We, { selected: i, onClick: c, children: [
5080
5086
  "Loop ",
5081
5087
  i ? "On" : "Off"
5082
5088
  ] })
@@ -5184,23 +5190,23 @@ const ri = "_container_6dw0q_3", ii = "_skipButton_6dw0q_11", Fe = {
5184
5190
  container: ri,
5185
5191
  skipButton: ii
5186
5192
  };
5187
- function Ai({ introOutro: a }) {
5193
+ function Si({ introOutro: a }) {
5188
5194
  const { currentTime: e } = Y(), { seekTo: t } = q(), [r, i] = b(!1), [n, o] = b(!1);
5189
5195
  k(() => {
5190
5196
  if (a) {
5191
5197
  if (a.intro) {
5192
- const c = e >= a.intro.start && e < a.intro.end;
5193
- i(c);
5198
+ const d = e >= a.intro.start && e < a.intro.end;
5199
+ i(d);
5194
5200
  }
5195
5201
  if (a.outro) {
5196
- const c = e >= a.outro.start && e < a.outro.end;
5197
- o(c);
5202
+ const d = e >= a.outro.start && e < a.outro.end;
5203
+ o(d);
5198
5204
  }
5199
5205
  }
5200
5206
  }, [e, a]);
5201
5207
  const l = $(() => {
5202
5208
  a?.intro && (t(a.intro.end), i(!1));
5203
- }, [a, t]), d = $(() => {
5209
+ }, [a, t]), c = $(() => {
5204
5210
  a?.outro && (t(a.outro.end), o(!1));
5205
5211
  }, [a, t]);
5206
5212
  return !r && !n ? null : /* @__PURE__ */ u("div", { className: Fe.container, children: [
@@ -5217,7 +5223,7 @@ function Ai({ introOutro: a }) {
5217
5223
  }
5218
5224
  )
5219
5225
  ] }),
5220
- n && /* @__PURE__ */ u("button", { onClick: d, className: Fe.skipButton, children: [
5226
+ n && /* @__PURE__ */ u("button", { onClick: c, className: Fe.skipButton, children: [
5221
5227
  /* @__PURE__ */ s("span", { children: "Skip Outro" }),
5222
5228
  /* @__PURE__ */ s(
5223
5229
  "svg",
@@ -5264,7 +5270,7 @@ function ni({
5264
5270
  showTooltip: r = !0,
5265
5271
  onClick: i
5266
5272
  }) {
5267
- const [n, o] = b(!1), l = Qe[a.type] || Qe.event, d = a.icon || l.icon, c = a.color || l.color, h = (p) => {
5273
+ const [n, o] = b(!1), l = Qe[a.type] || Qe.event, c = a.icon || l.icon, d = a.color || l.color, h = (p) => {
5268
5274
  p.stopPropagation(), i && i(a.time);
5269
5275
  };
5270
5276
  return /* @__PURE__ */ u(
@@ -5294,7 +5300,7 @@ function ni({
5294
5300
  display: "flex",
5295
5301
  alignItems: "center",
5296
5302
  justifyContent: "center",
5297
- backgroundColor: c,
5303
+ backgroundColor: d,
5298
5304
  border: "2px solid rgba(255, 255, 255, 0.9)",
5299
5305
  boxShadow: n ? "0 4px 16px rgba(0, 0, 0, 0.4)" : "0 2px 8px rgba(0, 0, 0, 0.4)",
5300
5306
  transition: "transform 0.2s cubic-bezier(0.4, 0, 0.2, 1)",
@@ -5310,7 +5316,7 @@ function ni({
5310
5316
  display: "inline-block",
5311
5317
  transform: "translateY(-1px)"
5312
5318
  },
5313
- children: d
5319
+ children: c
5314
5320
  }
5315
5321
  )
5316
5322
  }
@@ -5386,16 +5392,16 @@ class si {
5386
5392
  for (; n < i.length; ) {
5387
5393
  const o = i[n].trim();
5388
5394
  if (o.includes("-->")) {
5389
- const [l, d] = o.split("-->").map((m) => m.trim()), c = this.parseTime(l), h = this.parseTime(d);
5395
+ const [l, c] = o.split("-->").map((m) => m.trim()), d = this.parseTime(l), h = this.parseTime(c);
5390
5396
  n++;
5391
5397
  const p = [];
5392
5398
  for (; n < i.length && i[n].trim() !== "" && !i[n].includes("-->"); )
5393
5399
  p.push(i[n].trim()), n++;
5394
5400
  const g = p.join(`
5395
5401
  `).trim();
5396
- if (g && c >= 0 && h > c) {
5402
+ if (g && d >= 0 && h > d) {
5397
5403
  const m = this.parseCueLine(g, t);
5398
- m && r.push({ startTime: c, endTime: h, ...m });
5404
+ m && r.push({ startTime: d, endTime: h, ...m });
5399
5405
  }
5400
5406
  } else
5401
5407
  n++;
@@ -5404,15 +5410,15 @@ class si {
5404
5410
  }
5405
5411
  parseCueLine(e, t) {
5406
5412
  const r = e.lastIndexOf("#xywh=");
5407
- let i, n = 0, o = 0, l = 0, d = 0;
5413
+ let i, n = 0, o = 0, l = 0, c = 0;
5408
5414
  if (r !== -1) {
5409
5415
  i = e.slice(0, r);
5410
5416
  const h = e.slice(r + 6).split(",").map(Number);
5411
- h.length === 4 && h.every((p) => !isNaN(p)) && ([n, o, l, d] = h);
5417
+ h.length === 4 && h.every((p) => !isNaN(p)) && ([n, o, l, c] = h);
5412
5418
  } else
5413
5419
  i = e;
5414
- const c = this.resolveUrl(i.trim(), t);
5415
- return c ? { url: c, x: n, y: o, w: l, h: d } : null;
5420
+ const d = this.resolveUrl(i.trim(), t);
5421
+ return d ? { url: d, x: n, y: o, w: l, h: c } : null;
5416
5422
  }
5417
5423
  resolveUrl(e, t) {
5418
5424
  if (e.startsWith("http://") || e.startsWith("https://") || e.startsWith("//"))
@@ -5438,17 +5444,17 @@ function ai({
5438
5444
  thumbnailsVttUrl: n,
5439
5445
  seekBarStyle: o
5440
5446
  }) {
5441
- const l = re(He), d = O(null), [c, h] = b(!1), [p, g] = b(null), [m, S] = b(null), [I, C] = b([]), T = O(null), { currentTime: w, duration: y, isLive: G, isPlaying: X, playbackRate: D } = Y(), { seekTo: A, getDVRRange: _, getBufferedRanges: W } = q(), [E, M] = b(w), N = O(null), H = O({ time: w, ts: performance.now() });
5447
+ const l = re(He), c = O(null), [d, h] = b(!1), [p, g] = b(null), [m, A] = b(null), [R, C] = b([]), T = O(null), { currentTime: w, duration: y, isLive: G, isPlaying: X, playbackRate: I } = Y(), { seekTo: S, getDVRRange: _, getBufferedRanges: W } = q(), [E, M] = b(w), N = O(null), H = O({ time: w, ts: performance.now() });
5442
5448
  k(() => {
5443
5449
  H.current = { time: w, ts: performance.now() }, M(w);
5444
5450
  }, [w]);
5445
5451
  const Q = $(() => {
5446
5452
  if (X) {
5447
- const { time: v, ts: R } = H.current, V = D ?? 1, U = (performance.now() - R) / 1e3, ee = Math.min(y || 1 / 0, v + U * V);
5453
+ const { time: v, ts: D } = H.current, V = I ?? 1, U = (performance.now() - D) / 1e3, ee = Math.min(y || 1 / 0, v + U * V);
5448
5454
  M(ee);
5449
5455
  }
5450
5456
  N.current = requestAnimationFrame(Q);
5451
- }, [X, D, y]);
5457
+ }, [X, I, y]);
5452
5458
  k(() => (N.current = requestAnimationFrame(Q), () => {
5453
5459
  N.current !== null && cancelAnimationFrame(N.current);
5454
5460
  }), [Q]), k(() => {
@@ -5463,50 +5469,50 @@ function ai({
5463
5469
  }, 500);
5464
5470
  return () => clearInterval(v);
5465
5471
  }, [W]);
5466
- const L = a === "live" || !!G, B = L ? _() : null, P = B !== null && B.end - B.start > 5, F = P ? B.end - B.start : 0, Z = P && F > 0 ? (E - B.start) / F * 100 : 0, J = L ? Math.min(100, Math.max(0, Z)) : y > 0 ? E / y * 100 : 0, Ee = o?.trackColor ?? "rgba(255, 255, 255, 0.3)", ae = o?.progressColor ?? (L ? "#ff2020" : "#6366f1"), ce = o?.bufferedColor ?? "rgba(255, 255, 255, 0.25)", j = o?.handleColor ?? "#ffffff", Me = o?.height ?? 4, ue = o?.borderRadius ?? 2, me = o?.showHandle !== !1, Pe = o?.showTooltip !== !1, ye = o?.paddingX ?? 20, Le = o?.paddingY ?? 0, Re = o?.bottom ?? 64, le = (v) => {
5472
+ const L = a === "live" || !!G, B = L ? _() : null, P = B !== null && B.end - B.start > 5, F = P ? B.end - B.start : 0, Z = P && F > 0 ? (E - B.start) / F * 100 : 0, J = L ? Math.min(100, Math.max(0, Z)) : y > 0 ? E / y * 100 : 0, Ee = o?.trackColor ?? "rgba(255, 255, 255, 0.3)", ae = o?.progressColor ?? (L ? "#ff2020" : "#6366f1"), de = o?.bufferedColor ?? "rgba(255, 255, 255, 0.25)", j = o?.handleColor ?? "#ffffff", Me = o?.height ?? 4, ue = o?.borderRadius ?? 2, me = o?.showHandle !== !1, Pe = o?.showTooltip !== !1, ye = o?.paddingX ?? 20, Le = o?.paddingY ?? 0, Re = o?.bottom ?? 64, le = (v) => {
5467
5473
  if (!isFinite(v) || isNaN(v)) return "0:00";
5468
- const R = Math.floor(v / 3600), V = Math.floor(v % 3600 / 60), U = Math.floor(v % 60);
5469
- return R > 0 ? `${R}:${V.toString().padStart(2, "0")}:${U.toString().padStart(2, "0")}` : `${V}:${U.toString().padStart(2, "0")}`;
5474
+ const D = Math.floor(v / 3600), V = Math.floor(v % 3600 / 60), U = Math.floor(v % 60);
5475
+ return D > 0 ? `${D}:${V.toString().padStart(2, "0")}:${U.toString().padStart(2, "0")}` : `${V}:${U.toString().padStart(2, "0")}`;
5470
5476
  }, ve = (v) => {
5471
- if (!d.current) return 0;
5472
- const R = d.current.getBoundingClientRect(), V = (v.clientX - R.left) / R.width;
5477
+ if (!c.current) return 0;
5478
+ const D = c.current.getBoundingClientRect(), V = (v.clientX - D.left) / D.width;
5473
5479
  return Math.max(0, Math.min(1, V));
5474
5480
  }, we = (v) => {
5475
5481
  if (!(L && !P)) {
5476
5482
  if (L && P) {
5477
- A(B.start + v * F);
5483
+ S(B.start + v * F);
5478
5484
  return;
5479
5485
  }
5480
- y !== 0 && A(v * y);
5486
+ y !== 0 && S(v * y);
5481
5487
  }
5482
5488
  }, De = (v) => {
5483
5489
  if (L && !P) return;
5484
5490
  v.preventDefault(), h(!0);
5485
- const R = ve(v);
5486
- we(R);
5491
+ const D = ve(v);
5492
+ we(D);
5487
5493
  }, Ie = (v) => {
5488
- if (!d.current) return;
5489
- const R = ve(v);
5490
- if (g(R), T.current) {
5491
- const V = P ? B.start + R * F : R * y;
5492
- S(T.current.getThumbnailAt(V));
5494
+ if (!c.current) return;
5495
+ const D = ve(v);
5496
+ if (g(D), T.current) {
5497
+ const V = P ? B.start + D * F : D * y;
5498
+ A(T.current.getThumbnailAt(V));
5493
5499
  }
5494
5500
  }, _e = () => {
5495
- g(null), S(null);
5501
+ g(null), A(null);
5496
5502
  };
5497
5503
  return k(() => {
5498
- if (!c) return;
5504
+ if (!d) return;
5499
5505
  const v = (V) => {
5500
- if (!d.current) return;
5506
+ if (!c.current) return;
5501
5507
  const U = ve(V);
5502
5508
  g(U), we(U);
5503
- }, R = () => {
5509
+ }, D = () => {
5504
5510
  h(!1);
5505
5511
  };
5506
- return window.addEventListener("mousemove", v), window.addEventListener("mouseup", R), () => {
5507
- window.removeEventListener("mousemove", v), window.removeEventListener("mouseup", R);
5512
+ return window.addEventListener("mousemove", v), window.addEventListener("mouseup", D), () => {
5513
+ window.removeEventListener("mousemove", v), window.removeEventListener("mouseup", D);
5508
5514
  };
5509
- }, [c, y]), /* @__PURE__ */ u(
5515
+ }, [d, y]), /* @__PURE__ */ u(
5510
5516
  "div",
5511
5517
  {
5512
5518
  style: {
@@ -5607,7 +5613,7 @@ function ai({
5607
5613
  /* @__PURE__ */ u(
5608
5614
  "div",
5609
5615
  {
5610
- ref: d,
5616
+ ref: c,
5611
5617
  role: L && !P ? void 0 : "slider",
5612
5618
  tabIndex: L && !P ? void 0 : 0,
5613
5619
  "aria-label": L ? "DVR seek" : "Seek",
@@ -5621,28 +5627,28 @@ function ai({
5621
5627
  onMouseLeave: _e,
5622
5628
  onKeyDown: (v) => {
5623
5629
  if (L && !P) return;
5624
- const R = 5, V = 30, U = P ? B.start : 0, ee = P ? B.end : y;
5630
+ const D = 5, V = 30, U = P ? B.start : 0, ee = P ? B.end : y;
5625
5631
  if (ee !== 0)
5626
5632
  switch (v.key) {
5627
5633
  case "ArrowLeft":
5628
5634
  case "ArrowDown":
5629
- v.preventDefault(), A(Math.max(U, w - R));
5635
+ v.preventDefault(), S(Math.max(U, w - D));
5630
5636
  break;
5631
5637
  case "ArrowRight":
5632
5638
  case "ArrowUp":
5633
- v.preventDefault(), A(Math.min(ee, w + R));
5639
+ v.preventDefault(), S(Math.min(ee, w + D));
5634
5640
  break;
5635
5641
  case "PageDown":
5636
- v.preventDefault(), A(Math.max(U, w - V));
5642
+ v.preventDefault(), S(Math.max(U, w - V));
5637
5643
  break;
5638
5644
  case "PageUp":
5639
- v.preventDefault(), A(Math.min(ee, w + V));
5645
+ v.preventDefault(), S(Math.min(ee, w + V));
5640
5646
  break;
5641
5647
  case "Home":
5642
- v.preventDefault(), A(U);
5648
+ v.preventDefault(), S(U);
5643
5649
  break;
5644
5650
  case "End":
5645
- v.preventDefault(), A(ee);
5651
+ v.preventDefault(), S(ee);
5646
5652
  break;
5647
5653
  }
5648
5654
  },
@@ -5668,7 +5674,7 @@ function ai({
5668
5674
  borderRadius: `${ue}px`
5669
5675
  },
5670
5676
  children: [
5671
- !L && I.map((v, R) => {
5677
+ !L && R.map((v, D) => {
5672
5678
  if (y <= 0) return null;
5673
5679
  const V = v.start / y * 100, U = (v.end - v.start) / y * 100;
5674
5680
  return /* @__PURE__ */ s(
@@ -5680,12 +5686,12 @@ function ai({
5680
5686
  top: 0,
5681
5687
  height: "100%",
5682
5688
  width: `${U}%`,
5683
- backgroundColor: ce,
5689
+ backgroundColor: de,
5684
5690
  borderRadius: `${ue}px`,
5685
5691
  pointerEvents: "none"
5686
5692
  }
5687
5693
  },
5688
- R
5694
+ D
5689
5695
  );
5690
5696
  }),
5691
5697
  /* @__PURE__ */ s(
@@ -5704,13 +5710,13 @@ function ai({
5704
5710
  }
5705
5711
  ),
5706
5712
  !L && e.map((v) => {
5707
- const R = y > 0 ? v.startTime / y * 100 : 0;
5713
+ const D = y > 0 ? v.startTime / y * 100 : 0;
5708
5714
  return /* @__PURE__ */ s(
5709
5715
  "div",
5710
5716
  {
5711
5717
  style: {
5712
5718
  position: "absolute",
5713
- left: `${R}%`,
5719
+ left: `${D}%`,
5714
5720
  top: "50%",
5715
5721
  transform: "translate(-50%, -50%)",
5716
5722
  width: "3px",
@@ -5723,7 +5729,7 @@ function ai({
5723
5729
  v.id
5724
5730
  );
5725
5731
  }),
5726
- r && !L && y > 0 && t.map((v, R) => {
5732
+ r && !L && y > 0 && t.map((v, D) => {
5727
5733
  const V = v.time / y * 100;
5728
5734
  return V < 0 || V > 100 ? null : /* @__PURE__ */ s(
5729
5735
  ni,
@@ -5732,9 +5738,9 @@ function ai({
5732
5738
  position: V,
5733
5739
  size: i,
5734
5740
  showTooltip: !0,
5735
- onClick: (U) => A(U)
5741
+ onClick: (U) => S(U)
5736
5742
  },
5737
- `timeline-${R}-${v.time}`
5743
+ `timeline-${D}-${v.time}`
5738
5744
  );
5739
5745
  }),
5740
5746
  P && /* @__PURE__ */ s(
@@ -5782,15 +5788,15 @@ function ai({
5782
5788
  left: `${J}%`,
5783
5789
  top: "50%",
5784
5790
  transform: "translate(-50%, -50%)",
5785
- width: c ? "16px" : "14px",
5786
- height: c ? "16px" : "14px",
5791
+ width: d ? "16px" : "14px",
5792
+ height: d ? "16px" : "14px",
5787
5793
  backgroundColor: j,
5788
5794
  borderRadius: "50%",
5789
5795
  boxShadow: "0 2px 8px rgba(0, 0, 0, 0.3)",
5790
5796
  pointerEvents: "none",
5791
5797
  zIndex: 1e3,
5792
- opacity: c || p !== null ? 1 : 0,
5793
- transition: c ? "none" : "all 0.15s ease"
5798
+ opacity: d || p !== null ? 1 : 0,
5799
+ transition: d ? "none" : "all 0.15s ease"
5794
5800
  }
5795
5801
  }
5796
5802
  )
@@ -5798,9 +5804,9 @@ function ai({
5798
5804
  }
5799
5805
  ),
5800
5806
  Pe && (!L || P) && p !== null && (() => {
5801
- const v = P ? B.start + p * F : p * y, R = d.current?.offsetWidth ?? 0, V = p * 100, U = p * R, ee = Ze / 2;
5807
+ const v = P ? B.start + p * F : p * y, D = c.current?.offsetWidth ?? 0, V = p * 100, U = p * D, ee = Ze / 2;
5802
5808
  let he = "-50%";
5803
- return U < ee ? he = "0%" : R - U < ee && (he = "-100%"), m ? (
5809
+ return U < ee ? he = "0%" : D - U < ee && (he = "-100%"), m ? (
5804
5810
  /* Thumbnail card */
5805
5811
  /* @__PURE__ */ u(
5806
5812
  "div",
@@ -5960,7 +5966,7 @@ function li({
5960
5966
  }
5961
5967
  );
5962
5968
  }
5963
- function di({
5969
+ function ci({
5964
5970
  seconds: a = 15,
5965
5971
  iconSize: e = 24,
5966
5972
  hoverBackground: t,
@@ -6024,7 +6030,7 @@ function di({
6024
6030
  }
6025
6031
  );
6026
6032
  }
6027
- function ci({ sliderDirection: a = "right", theme: e, iconSize: t = 20, hoverBackground: r }) {
6033
+ function di({ sliderDirection: a = "right", theme: e, iconSize: t = 20, hoverBackground: r }) {
6028
6034
  const i = {
6029
6035
  sliderBackground: e?.sliderBackground ?? "rgba(10, 10, 20, 0.88)",
6030
6036
  borderColor: e?.borderColor ?? "rgba(255,255,255,0.1)",
@@ -6034,21 +6040,21 @@ function ci({ sliderDirection: a = "right", theme: e, iconSize: t = 20, hoverBac
6034
6040
  trackColor: e?.trackColor ?? "rgba(255,255,255,0.3)",
6035
6041
  fillColor: e?.fillColor ?? "#3b82f6",
6036
6042
  handleColor: e?.handleColor ?? "#fff"
6037
- }, { isMuted: n, volume: o } = Y(), { toggleMute: l, setVolume: d } = q(), [c, h] = b(!1), [p, g] = b(!1), m = O(null), S = a === "top" || a === "bottom", I = $((E, M) => {
6043
+ }, { isMuted: n, volume: o } = Y(), { toggleMute: l, setVolume: c } = q(), [d, h] = b(!1), [p, g] = b(!1), m = O(null), A = a === "top" || a === "bottom", R = $((E, M) => {
6038
6044
  if (!m.current) return;
6039
- const N = m.current.getBoundingClientRect(), H = S ? Math.max(0, Math.min(1, 1 - (M - N.top) / N.height)) : Math.max(0, Math.min(1, (E - N.left) / N.width));
6040
- d(H);
6041
- }, [d, S]), C = $((E) => {
6042
- g(!0), n && l(), I(E.clientX, E.clientY);
6043
- }, [I, n, l]);
6045
+ const N = m.current.getBoundingClientRect(), H = A ? Math.max(0, Math.min(1, 1 - (M - N.top) / N.height)) : Math.max(0, Math.min(1, (E - N.left) / N.width));
6046
+ c(H);
6047
+ }, [c, A]), C = $((E) => {
6048
+ g(!0), n && l(), R(E.clientX, E.clientY);
6049
+ }, [R, n, l]);
6044
6050
  k(() => {
6045
6051
  if (!p) return;
6046
- const E = (N) => I(N.clientX, N.clientY), M = () => g(!1);
6052
+ const E = (N) => R(N.clientX, N.clientY), M = () => g(!1);
6047
6053
  return window.addEventListener("mousemove", E), window.addEventListener("mouseup", M), () => {
6048
6054
  window.removeEventListener("mousemove", E), window.removeEventListener("mouseup", M);
6049
6055
  };
6050
- }, [p, I]);
6051
- const T = p ? o : n ? 0 : o, w = c || p, y = {
6056
+ }, [p, R]);
6057
+ const T = p ? o : n ? 0 : o, w = d || p, y = {
6052
6058
  position: "absolute",
6053
6059
  opacity: w ? 1 : 0,
6054
6060
  transition: "all 0.25s ease",
@@ -6110,7 +6116,7 @@ function ci({ sliderDirection: a = "right", theme: e, iconSize: t = 20, hoverBac
6110
6116
  borderLeft: "none"
6111
6117
  };
6112
6118
  }
6113
- })(), X = S ? { width: "40px", height: "110px", display: "flex", justifyContent: "center", alignItems: "center", cursor: "pointer", position: "relative", outline: "none" } : { width: "110px", height: "40px", display: "flex", alignItems: "center", cursor: "pointer", position: "relative", paddingRight: "8px", outline: "none" }, D = S ? { width: "4px", height: "100%", backgroundColor: i.trackColor, borderRadius: "2px", position: "relative" } : { width: "100%", height: "4px", backgroundColor: i.trackColor, borderRadius: "2px", position: "relative" }, A = S ? {
6119
+ })(), X = A ? { width: "40px", height: "110px", display: "flex", justifyContent: "center", alignItems: "center", cursor: "pointer", position: "relative", outline: "none" } : { width: "110px", height: "40px", display: "flex", alignItems: "center", cursor: "pointer", position: "relative", paddingRight: "8px", outline: "none" }, I = A ? { width: "4px", height: "100%", backgroundColor: i.trackColor, borderRadius: "2px", position: "relative" } : { width: "100%", height: "4px", backgroundColor: i.trackColor, borderRadius: "2px", position: "relative" }, S = A ? {
6114
6120
  position: "absolute",
6115
6121
  bottom: 0,
6116
6122
  left: 0,
@@ -6128,7 +6134,7 @@ function ci({ sliderDirection: a = "right", theme: e, iconSize: t = 20, hoverBac
6128
6134
  backgroundColor: i.fillColor,
6129
6135
  borderRadius: "2px",
6130
6136
  transition: p ? "none" : "width 0.1s ease"
6131
- }, _ = p ? 14 : 12, W = S ? {
6137
+ }, _ = p ? 14 : 12, W = A ? {
6132
6138
  position: "absolute",
6133
6139
  bottom: `calc(${T * 100}% - ${T * _}px)`,
6134
6140
  left: "50%",
@@ -6219,23 +6225,23 @@ function ci({ sliderDirection: a = "right", theme: e, iconSize: t = 20, hoverBac
6219
6225
  switch (E.key) {
6220
6226
  case "ArrowRight":
6221
6227
  case "ArrowUp":
6222
- E.preventDefault(), d(Math.min(1, H + 0.05));
6228
+ E.preventDefault(), c(Math.min(1, H + 0.05));
6223
6229
  break;
6224
6230
  case "ArrowLeft":
6225
6231
  case "ArrowDown":
6226
- E.preventDefault(), d(Math.max(0, H - 0.05));
6232
+ E.preventDefault(), c(Math.max(0, H - 0.05));
6227
6233
  break;
6228
6234
  case "PageUp":
6229
- E.preventDefault(), d(Math.min(1, H + 0.2));
6235
+ E.preventDefault(), c(Math.min(1, H + 0.2));
6230
6236
  break;
6231
6237
  case "PageDown":
6232
- E.preventDefault(), d(Math.max(0, H - 0.2));
6238
+ E.preventDefault(), c(Math.max(0, H - 0.2));
6233
6239
  break;
6234
6240
  case "Home":
6235
- E.preventDefault(), d(0);
6241
+ E.preventDefault(), c(0);
6236
6242
  break;
6237
6243
  case "End":
6238
- E.preventDefault(), d(1);
6244
+ E.preventDefault(), c(1);
6239
6245
  break;
6240
6246
  case "m":
6241
6247
  case "M":
@@ -6244,8 +6250,8 @@ function ci({ sliderDirection: a = "right", theme: e, iconSize: t = 20, hoverBac
6244
6250
  }
6245
6251
  },
6246
6252
  style: X,
6247
- children: /* @__PURE__ */ u("div", { style: D, children: [
6248
- /* @__PURE__ */ s("div", { style: A }),
6253
+ children: /* @__PURE__ */ u("div", { style: I, children: [
6254
+ /* @__PURE__ */ s("div", { style: S }),
6249
6255
  /* @__PURE__ */ s("div", { style: W })
6250
6256
  ] })
6251
6257
  }
@@ -6338,7 +6344,7 @@ function Ci() {
6338
6344
  ] }) })
6339
6345
  ] });
6340
6346
  }
6341
- const ze = de({
6347
+ const ze = ce({
6342
6348
  textColor: "#fff",
6343
6349
  accentColor: "#6366f1",
6344
6350
  accentAlpha15: "rgba(99,102,241,0.15)",
@@ -6387,16 +6393,16 @@ function et({ values: a, color: e, gradId: t }) {
6387
6393
  const n = Math.max(...a, 1e-3), o = a.map((h, p) => [
6388
6394
  p / (hi - 1) * 292,
6389
6395
  48 - h / n * 42
6390
- ]), l = o.map(([h, p], g) => `${g === 0 ? "M" : "L"}${h.toFixed(1)},${p.toFixed(1)}`).join(" "), d = l + ` L${292 .toFixed(1)},52 L0,52 Z`, c = o[o.length - 1];
6396
+ ]), l = o.map(([h, p], g) => `${g === 0 ? "M" : "L"}${h.toFixed(1)},${p.toFixed(1)}`).join(" "), c = l + ` L${292 .toFixed(1)},52 L0,52 Z`, d = o[o.length - 1];
6391
6397
  return /* @__PURE__ */ u("svg", { width: 292, height: 52, style: { display: "block", overflow: "visible" }, children: [
6392
6398
  /* @__PURE__ */ s("defs", { children: /* @__PURE__ */ u("linearGradient", { id: t, x1: "0", y1: "0", x2: "0", y2: "1", children: [
6393
6399
  /* @__PURE__ */ s("stop", { offset: "0%", stopColor: e, stopOpacity: 0.4 }),
6394
6400
  /* @__PURE__ */ s("stop", { offset: "100%", stopColor: e, stopOpacity: 0.02 })
6395
6401
  ] }) }),
6396
- /* @__PURE__ */ s("path", { d, fill: `url(#${t})` }),
6402
+ /* @__PURE__ */ s("path", { d: c, fill: `url(#${t})` }),
6397
6403
  /* @__PURE__ */ s("path", { d: l, fill: "none", stroke: e, strokeWidth: 1.8, strokeLinejoin: "round", strokeLinecap: "round" }),
6398
- /* @__PURE__ */ s("circle", { cx: c[0], cy: c[1], r: 3.5, fill: e }),
6399
- /* @__PURE__ */ s("circle", { cx: c[0], cy: c[1], r: 6, fill: e, fillOpacity: 0.25 })
6404
+ /* @__PURE__ */ s("circle", { cx: d[0], cy: d[1], r: 3.5, fill: e }),
6405
+ /* @__PURE__ */ s("circle", { cx: d[0], cy: d[1], r: 6, fill: e, fillOpacity: 0.25 })
6400
6406
  ] });
6401
6407
  }
6402
6408
  function z({
@@ -6407,7 +6413,7 @@ function z({
6407
6413
  selected: i = !1,
6408
6414
  isBack: n = !1
6409
6415
  }) {
6410
- const [o, l] = b(!1), { textColor: d, accentColor: c, accentAlpha15: h, accentAlpha30: p, fontSize: g } = re(ze);
6416
+ const [o, l] = b(!1), { textColor: c, accentColor: d, accentAlpha15: h, accentAlpha30: p, fontSize: g } = re(ze);
6411
6417
  return /* @__PURE__ */ u(
6412
6418
  "button",
6413
6419
  {
@@ -6418,7 +6424,7 @@ function z({
6418
6424
  onMouseLeave: () => l(!1),
6419
6425
  style: {
6420
6426
  ...mi,
6421
- color: d,
6427
+ color: c,
6422
6428
  fontSize: g,
6423
6429
  background: o ? "rgba(255,255,255,0.07)" : i ? h : "transparent",
6424
6430
  fontWeight: i ? 600 : 400,
@@ -6435,9 +6441,9 @@ function z({
6435
6441
  alignItems: "center",
6436
6442
  justifyContent: "center",
6437
6443
  flexShrink: 0,
6438
- color: i ? c : "rgba(255,255,255,0.65)",
6444
+ color: i ? d : "rgba(255,255,255,0.65)",
6439
6445
  transition: "background 0.15s, color 0.15s"
6440
- }, children: t }) : i ? /* @__PURE__ */ s("svg", { "aria-hidden": "true", width: "14", height: "14", viewBox: "0 0 24 24", fill: "none", stroke: c, strokeWidth: "3", style: { flexShrink: 0 }, children: /* @__PURE__ */ s("polyline", { points: "20 6 9 17 4 12" }) }) : /* @__PURE__ */ s("span", { style: { display: "inline-block", width: "14px", flexShrink: 0 } }),
6446
+ }, children: t }) : i ? /* @__PURE__ */ s("svg", { "aria-hidden": "true", width: "14", height: "14", viewBox: "0 0 24 24", fill: "none", stroke: d, strokeWidth: "3", style: { flexShrink: 0 }, children: /* @__PURE__ */ s("polyline", { points: "20 6 9 17 4 12" }) }) : /* @__PURE__ */ s("span", { style: { display: "inline-block", width: "14px", flexShrink: 0 } }),
6441
6447
  /* @__PURE__ */ s("span", { style: { overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap" }, children: a })
6442
6448
  ] }),
6443
6449
  e !== void 0 && /* @__PURE__ */ u("span", { style: { display: "flex", alignItems: "center", gap: "4px", flexShrink: 0 }, children: [
@@ -6459,32 +6465,32 @@ function yi({
6459
6465
  hoverBackground: r,
6460
6466
  gearIcon: i
6461
6467
  } = {}) {
6462
- const n = a?.accentColor ?? "#6366f1", o = a?.textColor ?? "#fff", l = a?.background ?? "rgba(12, 12, 20, 0.97)", d = a?.borderColor ?? "rgba(255,255,255,0.1)", c = a?.fontSize ?? "13.5px", h = {
6468
+ const n = a?.accentColor ?? "#6366f1", o = a?.textColor ?? "#fff", l = a?.background ?? "rgba(12, 12, 20, 0.97)", c = a?.borderColor ?? "rgba(255,255,255,0.1)", d = a?.fontSize ?? "13.5px", h = {
6463
6469
  textColor: o,
6464
6470
  accentColor: n,
6465
6471
  accentAlpha15: n.startsWith("#") ? Je(n, 0.15) : "rgba(99,102,241,0.15)",
6466
6472
  accentAlpha30: n.startsWith("#") ? Je(n, 0.3) : "rgba(99,102,241,0.3)",
6467
- borderColor: d.replace("0.1)", "0.07)"),
6468
- fontSize: c
6473
+ borderColor: c.replace("0.1)", "0.07)"),
6474
+ fontSize: d
6469
6475
  }, p = {
6470
6476
  ...fi,
6471
6477
  color: o,
6472
- fontSize: c,
6473
- borderBottom: `1px solid ${d.replace("0.1)", "0.08)")}`
6478
+ fontSize: d,
6479
+ borderBottom: `1px solid ${c.replace("0.1)", "0.08)")}`
6474
6480
  }, g = e?.vertical ?? "top", m = e?.horizontal ?? "right", {
6475
- setQuality: S,
6476
- setAudioTrack: I,
6481
+ setQuality: A,
6482
+ setAudioTrack: R,
6477
6483
  setPlaybackRate: C,
6478
6484
  setSubtitleTrack: T,
6479
6485
  getPlayerStats: w
6480
- } = q(), y = Ce(), { playbackRate: G = 1, isLive: X } = Y(), { style: D, setStyle: A } = ut(), [_, W] = b(!1), [E, M] = b("root");
6486
+ } = q(), y = Ce(), { playbackRate: G = 1, isLive: X } = Y(), { style: I, setStyle: S } = ut(), [_, W] = b(!1), [E, M] = b("root");
6481
6487
  k(() => {
6482
6488
  X && E === "speed" && M("root");
6483
6489
  }, [X, E]);
6484
- const [N, H] = b([]), [Q, L] = b(null), [B, P] = b([]), [F, Z] = b(""), [J, Ee] = b([]), [ae, ce] = b(null), [j, Me] = b(null), [ue, me] = b([]);
6490
+ const [N, H] = b([]), [Q, L] = b(null), [B, P] = b([]), [F, Z] = b(""), [J, Ee] = b([]), [ae, de] = b(null), [j, Me] = b(null), [ue, me] = b([]);
6485
6491
  k(() => {
6486
6492
  const f = () => {
6487
- H(y.getAvailableQualities()), L(y.getQuality()), P(y.getAvailableAudioTracks()), Z(y.getAudioTrack()), Ee(y.getSubtitleTracks()), ce(y.getActiveSubtitleLanguage());
6493
+ H(y.getAvailableQualities()), L(y.getQuality()), P(y.getAvailableAudioTracks()), Z(y.getAudioTrack()), Ee(y.getSubtitleTracks()), de(y.getActiveSubtitleLanguage());
6488
6494
  };
6489
6495
  y.events.on("tracksready", f), y.events.on("streamTypeDetected", f), y.events.on("qualitychange", f), y.events.on("loadedmetadata", f), f();
6490
6496
  const K = setTimeout(f, 100);
@@ -6492,7 +6498,7 @@ function yi({
6492
6498
  y.events.off("tracksready", f), y.events.off("streamTypeDetected", f), y.events.off("qualitychange", f), y.events.off("loadedmetadata", f), clearTimeout(K);
6493
6499
  };
6494
6500
  }, [y]), k(() => {
6495
- _ && (H(y.getAvailableQualities()), L(y.getQuality()), P(y.getAvailableAudioTracks()), Z(y.getAudioTrack()), Ee(y.getSubtitleTracks()), ce(y.getActiveSubtitleLanguage()));
6501
+ _ && (H(y.getAvailableQualities()), L(y.getQuality()), P(y.getAvailableAudioTracks()), Z(y.getAudioTrack()), Ee(y.getSubtitleTracks()), de(y.getActiveSubtitleLanguage()));
6496
6502
  }, [_, y]);
6497
6503
  const Pe = B.length > 1;
6498
6504
  k(() => {
@@ -6538,7 +6544,7 @@ function yi({
6538
6544
  /* @__PURE__ */ s("path", { d: "M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z" }),
6539
6545
  /* @__PURE__ */ s("line", { x1: "9", y1: "10", x2: "15", y2: "10" }),
6540
6546
  /* @__PURE__ */ s("line", { x1: "9", y1: "14", x2: "12", y2: "14" })
6541
- ] }), R = /* @__PURE__ */ u("svg", { width: "14", height: "14", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "1.8", strokeLinecap: "round", strokeLinejoin: "round", children: [
6547
+ ] }), D = /* @__PURE__ */ u("svg", { width: "14", height: "14", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "1.8", strokeLinecap: "round", strokeLinejoin: "round", children: [
6542
6548
  /* @__PURE__ */ s("circle", { cx: "12", cy: "12", r: "3" }),
6543
6549
  /* @__PURE__ */ s("path", { d: "M20.39 18.39A5 5 0 0 0 18 9h-1.26A8 8 0 1 0 3 16.3" }),
6544
6550
  /* @__PURE__ */ s("polyline", { points: "16 16 12 20 8 16" })
@@ -6560,7 +6566,7 @@ function yi({
6560
6566
  Pe && /* @__PURE__ */ s(z, { icon: _e, label: "Audio Track", value: ve, onClick: () => M("audio") }),
6561
6567
  /* @__PURE__ */ s(tt, {}),
6562
6568
  /* @__PURE__ */ s(z, { icon: v, label: "Subtitles", value: we, onClick: () => M("subtitles") }),
6563
- /* @__PURE__ */ s(z, { icon: R, label: "Subtitle Style", value: `${D.fontSize}px`, onClick: () => M("subtitleStyle") }),
6569
+ /* @__PURE__ */ s(z, { icon: D, label: "Subtitle Style", value: `${I.fontSize}px`, onClick: () => M("subtitleStyle") }),
6564
6570
  /* @__PURE__ */ s(tt, {}),
6565
6571
  /* @__PURE__ */ s(z, { icon: V, label: "Statistics", onClick: () => M("statistics") })
6566
6572
  ] })
@@ -6573,7 +6579,7 @@ function yi({
6573
6579
  label: f.id === "auto" ? "Auto" : f.label,
6574
6580
  selected: Q?.id === f.id,
6575
6581
  onClick: () => {
6576
- S(f.id), L(f), W(!1), M("root");
6582
+ A(f.id), L(f), W(!1), M("root");
6577
6583
  }
6578
6584
  },
6579
6585
  f.id
@@ -6601,7 +6607,7 @@ function yi({
6601
6607
  label: f.label || f.language || f.id,
6602
6608
  selected: F === f.id,
6603
6609
  onClick: () => {
6604
- I(f.id), Z(f.id), W(!1), M("root");
6610
+ R(f.id), Z(f.id), W(!1), M("root");
6605
6611
  }
6606
6612
  },
6607
6613
  f.id
@@ -6615,7 +6621,7 @@ function yi({
6615
6621
  label: "Off",
6616
6622
  selected: ae === null,
6617
6623
  onClick: () => {
6618
- T(null), ce(null), W(!1), M("root");
6624
+ T(null), de(null), W(!1), M("root");
6619
6625
  }
6620
6626
  },
6621
6627
  "off"
@@ -6626,7 +6632,7 @@ function yi({
6626
6632
  label: f.label || f.language,
6627
6633
  selected: ae === f.language,
6628
6634
  onClick: () => {
6629
- T(f.language), ce(f.language), W(!1), M("root");
6635
+ T(f.language), de(f.language), W(!1), M("root");
6630
6636
  }
6631
6637
  },
6632
6638
  f.url || `${f.language}-${K}`
@@ -6640,7 +6646,7 @@ function yi({
6640
6646
  /* @__PURE__ */ u("div", { style: { display: "flex", justifyContent: "space-between", alignItems: "center", marginBottom: "6px" }, children: [
6641
6647
  /* @__PURE__ */ s("span", { style: { fontSize: "13px", color: "rgba(255,255,255,0.8)" }, children: "Position" }),
6642
6648
  /* @__PURE__ */ u("span", { style: { fontSize: "12px", color: "rgba(255,255,255,0.5)" }, children: [
6643
- D.bottomOffset,
6649
+ I.bottomOffset,
6644
6650
  "px from bottom"
6645
6651
  ] })
6646
6652
  ] }),
@@ -6651,8 +6657,8 @@ function yi({
6651
6657
  min: 10,
6652
6658
  max: 200,
6653
6659
  step: 5,
6654
- value: D.bottomOffset,
6655
- onChange: (f) => A({ bottomOffset: Number(f.target.value) }),
6660
+ value: I.bottomOffset,
6661
+ onChange: (f) => S({ bottomOffset: Number(f.target.value) }),
6656
6662
  style: { width: "100%", accentColor: "#3b82f6", cursor: "pointer" }
6657
6663
  }
6658
6664
  )
@@ -6661,7 +6667,7 @@ function yi({
6661
6667
  /* @__PURE__ */ u("div", { style: { display: "flex", justifyContent: "space-between", alignItems: "center", marginBottom: "6px" }, children: [
6662
6668
  /* @__PURE__ */ s("span", { style: { fontSize: "13px", color: "rgba(255,255,255,0.8)" }, children: "Font Size" }),
6663
6669
  /* @__PURE__ */ u("span", { style: { fontSize: "12px", color: "rgba(255,255,255,0.5)" }, children: [
6664
- D.fontSize,
6670
+ I.fontSize,
6665
6671
  "px"
6666
6672
  ] })
6667
6673
  ] }),
@@ -6672,8 +6678,8 @@ function yi({
6672
6678
  min: 12,
6673
6679
  max: 40,
6674
6680
  step: 1,
6675
- value: D.fontSize,
6676
- onChange: (f) => A({ fontSize: Number(f.target.value) }),
6681
+ value: I.fontSize,
6682
+ onChange: (f) => S({ fontSize: Number(f.target.value) }),
6677
6683
  style: { width: "100%", accentColor: "#3b82f6", cursor: "pointer" }
6678
6684
  }
6679
6685
  )
@@ -6683,17 +6689,17 @@ function yi({
6683
6689
  /* @__PURE__ */ s(
6684
6690
  "button",
6685
6691
  {
6686
- onClick: () => A({ background: D.background ? "" : "rgba(0,0,0,0.75)" }),
6692
+ onClick: () => S({ background: I.background ? "" : "rgba(0,0,0,0.75)" }),
6687
6693
  style: {
6688
6694
  padding: "4px 12px",
6689
6695
  borderRadius: "6px",
6690
6696
  border: "1px solid rgba(255,255,255,0.2)",
6691
- background: D.background ? "#3b82f6" : "transparent",
6697
+ background: I.background ? "#3b82f6" : "transparent",
6692
6698
  color: "#fff",
6693
6699
  fontSize: "12px",
6694
6700
  cursor: "pointer"
6695
6701
  },
6696
- children: D.background ? "On" : "Off"
6702
+ children: I.background ? "On" : "Off"
6697
6703
  }
6698
6704
  )
6699
6705
  ] }),
@@ -6702,14 +6708,14 @@ function yi({
6702
6708
  /* @__PURE__ */ s("div", { style: { display: "flex", gap: "6px" }, children: ["#ffffff", "#ffff00", "#00ff00", "#00cfff"].map((f) => /* @__PURE__ */ s(
6703
6709
  "button",
6704
6710
  {
6705
- onClick: () => A({ color: f }),
6711
+ onClick: () => S({ color: f }),
6706
6712
  title: f,
6707
6713
  style: {
6708
6714
  width: "22px",
6709
6715
  height: "22px",
6710
6716
  borderRadius: "50%",
6711
6717
  background: f,
6712
- border: D.color === f ? "2px solid #3b82f6" : "2px solid transparent",
6718
+ border: I.color === f ? "2px solid #3b82f6" : "2px solid transparent",
6713
6719
  cursor: "pointer",
6714
6720
  outline: "none",
6715
6721
  padding: 0,
@@ -6730,7 +6736,7 @@ function yi({
6730
6736
  }, children: [
6731
6737
  /* @__PURE__ */ s("div", { style: { fontSize: "10px", color: "rgba(255,255,255,0.4)", textTransform: "uppercase", letterSpacing: "0.06em", marginBottom: "3px" }, children: ie }),
6732
6738
  /* @__PURE__ */ s("div", { style: { fontSize: "12px", color: "#fff", fontFamily: "monospace", overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap" }, children: xt })
6733
- ] }), Se = j?.segmentUrl ?? "", wt = Se.length > 36 ? "…" + Se.slice(-36) : Se || "—";
6739
+ ] }), Ae = j?.segmentUrl ?? "", wt = Ae.length > 36 ? "…" + Ae.slice(-36) : Ae || "—";
6734
6740
  return /* @__PURE__ */ u(oe, { children: [
6735
6741
  /* @__PURE__ */ u("div", { style: { ...p, justifyContent: "space-between" }, children: [
6736
6742
  /* @__PURE__ */ s("div", { style: { display: "flex", alignItems: "center", gap: "8px" }, children: /* @__PURE__ */ s(z, { label: "Statistics", isBack: !0, onClick: () => M("root") }) }),
@@ -6778,7 +6784,7 @@ function yi({
6778
6784
  minWidth: 0
6779
6785
  }, children: [
6780
6786
  /* @__PURE__ */ s("div", { style: { fontSize: "10px", color: "rgba(255,255,255,0.4)", textTransform: "uppercase", letterSpacing: "0.06em", marginBottom: "3px" }, children: "Segment" }),
6781
- /* @__PURE__ */ s("div", { style: { fontSize: "11px", color: "rgba(255,255,255,0.7)", fontFamily: "monospace", overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap" }, title: Se, children: wt })
6787
+ /* @__PURE__ */ s("div", { style: { fontSize: "11px", color: "rgba(255,255,255,0.7)", fontFamily: "monospace", overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap" }, title: Ae, children: wt })
6782
6788
  ] })
6783
6789
  ] })
6784
6790
  ] }),
@@ -6869,8 +6875,8 @@ function yi({
6869
6875
  style: {
6870
6876
  ...gi,
6871
6877
  background: l,
6872
- border: `1px solid ${d}`,
6873
- boxShadow: `0 12px 48px rgba(0,0,0,0.7), 0 0 0 1px ${d.replace("0.1)", "0.08)")}`,
6878
+ border: `1px solid ${c}`,
6879
+ boxShadow: `0 12px 48px rgba(0,0,0,0.7), 0 0 0 1px ${c.replace("0.1)", "0.08)")}`,
6874
6880
  width: E === "statistics" ? "360px" : "320px",
6875
6881
  ...g === "bottom" ? { top: "52px" } : { bottom: "52px" },
6876
6882
  ...m === "left" ? { left: 0 } : { right: 0 }
@@ -6891,11 +6897,11 @@ function Ti({ label: a = "AirPlay", className: e = "" }) {
6891
6897
  k(() => {
6892
6898
  if (!t) return;
6893
6899
  i(t.isAirPlayAvailable()), o(t.isAirPlayActive());
6894
- const d = ({ isAvailable: c, isActive: h }) => {
6895
- i(c), o(h);
6900
+ const c = ({ isAvailable: d, isActive: h }) => {
6901
+ i(d), o(h);
6896
6902
  };
6897
- return t.events.on("airplaychange", d), () => {
6898
- t.events.off("airplaychange", d);
6903
+ return t.events.on("airplaychange", c), () => {
6904
+ t.events.off("airplaychange", c);
6899
6905
  };
6900
6906
  }, [t]);
6901
6907
  const l = $(() => {
@@ -6948,14 +6954,14 @@ function Mi({
6948
6954
  k(() => {
6949
6955
  if (!t) return;
6950
6956
  i(t.isCastAvailable()), o(t.isCastActive());
6951
- const d = ({
6952
- isAvailable: c,
6957
+ const c = ({
6958
+ isAvailable: d,
6953
6959
  isActive: h
6954
6960
  }) => {
6955
- i(c), o(h);
6961
+ i(d), o(h);
6956
6962
  };
6957
- return t.events.on("castchange", d), () => {
6958
- t.events.off("castchange", d);
6963
+ return t.events.on("castchange", c), () => {
6964
+ t.events.off("castchange", c);
6959
6965
  };
6960
6966
  }, [t]);
6961
6967
  const l = $(() => {
@@ -7015,15 +7021,15 @@ function Pi({ x: a, y: e, isOpen: t, onClose: r, actions: i, theme: n }) {
7015
7021
  }, l = O(null);
7016
7022
  return k(() => {
7017
7023
  if (!t) return;
7018
- const d = (c) => {
7019
- if ("key" in c) {
7020
- c.key === "Escape" && r();
7024
+ const c = (d) => {
7025
+ if ("key" in d) {
7026
+ d.key === "Escape" && r();
7021
7027
  return;
7022
7028
  }
7023
- l.current && !l.current.contains(c.target) && r();
7029
+ l.current && !l.current.contains(d.target) && r();
7024
7030
  };
7025
- return document.addEventListener("mousedown", d), document.addEventListener("keydown", d), () => {
7026
- document.removeEventListener("mousedown", d), document.removeEventListener("keydown", d);
7031
+ return document.addEventListener("mousedown", c), document.addEventListener("keydown", c), () => {
7032
+ document.removeEventListener("mousedown", c), document.removeEventListener("keydown", c);
7027
7033
  };
7028
7034
  }, [t, r]), t ? /* @__PURE__ */ u(oe, { children: [
7029
7035
  /* @__PURE__ */ s(
@@ -7048,13 +7054,13 @@ function Pi({ x: a, y: e, isOpen: t, onClose: r, actions: i, theme: n }) {
7048
7054
  animation: "ctxFadeIn 0.14s ease-out",
7049
7055
  overflow: "hidden"
7050
7056
  },
7051
- children: i.map((d, c) => /* @__PURE__ */ u("div", { children: [
7057
+ children: i.map((c, d) => /* @__PURE__ */ u("div", { children: [
7052
7058
  /* @__PURE__ */ u(
7053
7059
  "button",
7054
7060
  {
7055
7061
  role: "menuitem",
7056
7062
  onClick: () => {
7057
- d.onClick(), r();
7063
+ c.onClick(), r();
7058
7064
  },
7059
7065
  style: {
7060
7066
  display: "flex",
@@ -7064,38 +7070,38 @@ function Pi({ x: a, y: e, isOpen: t, onClose: r, actions: i, theme: n }) {
7064
7070
  padding: "9px 14px",
7065
7071
  background: "transparent",
7066
7072
  border: "none",
7067
- color: d.danger ? o.dangerColor : o.textColor,
7073
+ color: c.danger ? o.dangerColor : o.textColor,
7068
7074
  fontSize: "13.5px",
7069
7075
  textAlign: "left",
7070
7076
  cursor: "pointer",
7071
7077
  transition: "background 0.1s"
7072
7078
  },
7073
7079
  onMouseEnter: (h) => {
7074
- h.currentTarget.style.background = d.danger ? "rgba(239,68,68,0.12)" : o.hoverBackground;
7080
+ h.currentTarget.style.background = c.danger ? "rgba(239,68,68,0.12)" : o.hoverBackground;
7075
7081
  },
7076
7082
  onMouseLeave: (h) => {
7077
7083
  h.currentTarget.style.background = "transparent";
7078
7084
  },
7079
7085
  children: [
7080
- d.icon !== void 0 && /* @__PURE__ */ s("span", { style: {
7086
+ c.icon !== void 0 && /* @__PURE__ */ s("span", { style: {
7081
7087
  width: "28px",
7082
7088
  height: "28px",
7083
7089
  borderRadius: "7px",
7084
- background: d.danger ? "rgba(239,68,68,0.15)" : o.iconBackground,
7090
+ background: c.danger ? "rgba(239,68,68,0.15)" : o.iconBackground,
7085
7091
  display: "flex",
7086
7092
  alignItems: "center",
7087
7093
  justifyContent: "center",
7088
7094
  flexShrink: 0,
7089
- color: d.danger ? o.dangerColor : o.textColor,
7095
+ color: c.danger ? o.dangerColor : o.textColor,
7090
7096
  fontSize: "13px",
7091
7097
  lineHeight: 1
7092
- }, children: d.icon }),
7093
- /* @__PURE__ */ s("span", { style: { flex: 1 }, children: d.label })
7098
+ }, children: c.icon }),
7099
+ /* @__PURE__ */ s("span", { style: { flex: 1 }, children: c.label })
7094
7100
  ]
7095
7101
  }
7096
7102
  ),
7097
- d.dividerAfter && /* @__PURE__ */ s("div", { style: { height: "1px", background: o.dividerColor, margin: "3px 0" } })
7098
- ] }, c))
7103
+ c.dividerAfter && /* @__PURE__ */ s("div", { style: { height: "1px", background: o.dividerColor, margin: "3px 0" } })
7104
+ ] }, d))
7099
7105
  }
7100
7106
  ),
7101
7107
  /* @__PURE__ */ s("style", { children: `
@@ -7111,8 +7117,8 @@ const Li = ({ mode: a }) => {
7111
7117
  return /* @__PURE__ */ u(Or, { children: [
7112
7118
  /* @__PURE__ */ s(zr, {}),
7113
7119
  !t && /* @__PURE__ */ s(li, { seconds: 15 }),
7114
- !t && /* @__PURE__ */ s(di, { seconds: 15 }),
7115
- /* @__PURE__ */ s(ci, { sliderDirection: "top" }),
7120
+ !t && /* @__PURE__ */ s(ci, { seconds: 15 }),
7121
+ /* @__PURE__ */ s(di, { sliderDirection: "top" }),
7116
7122
  !t && /* @__PURE__ */ s(Jr, {}),
7117
7123
  /* @__PURE__ */ s("div", { style: { flex: 1 } }),
7118
7124
  /* @__PURE__ */ s(yi, { theme: { background: "#fb0000" } }),
@@ -7229,13 +7235,13 @@ export {
7229
7235
  Li as ControlsContainer,
7230
7236
  He as ControlsVisibilityContext,
7231
7237
  Mr as EndCard,
7232
- St as EventBus,
7238
+ At as EventBus,
7233
7239
  jr as FullscreenButton,
7234
7240
  Pr as GestureHintOverlay,
7235
7241
  ei as JumpToLiveButton,
7236
7242
  Tr as KeyboardShortcutsOverlay,
7237
7243
  ti as LiveLatencyDisplay,
7238
- Ae as MediaErrorCode,
7244
+ Se as MediaErrorCode,
7239
7245
  xi as MuteButton,
7240
7246
  Kr as PipButton,
7241
7247
  zr as PlayButton,
@@ -7247,18 +7253,18 @@ export {
7247
7253
  Mt as PlayronEventEmitter,
7248
7254
  ai as SeekBar,
7249
7255
  Ri as SeekBarContainer,
7250
- Si as SettingsButton,
7256
+ Ai as SettingsButton,
7251
7257
  yi as SettingsPanel,
7252
7258
  li as SkipBackwardButton,
7253
- di as SkipForwardButton,
7254
- Ai as SkipIntroButton,
7259
+ ci as SkipForwardButton,
7260
+ Si as SkipIntroButton,
7255
7261
  Rt as StallDetector,
7256
7262
  Pt as StreamDetector,
7257
7263
  ki as TheaterModeButton,
7258
7264
  si as ThumbnailManager,
7259
7265
  Jr as TimeDisplay,
7260
7266
  x as VideoEventType,
7261
- ci as VolumeControl,
7267
+ di as VolumeControl,
7262
7268
  wi as default,
7263
7269
  ge as eventBus,
7264
7270
  Ei as isVideoEventType,