boss-web-player-sdk 1.1.21 → 1.1.23

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,12 +1,12 @@
1
1
  import { c as e, t, u as n } from "./src-B8eoxemB.js";
2
2
  import { createContext as r, createElement as i, forwardRef as a, useCallback as o, useContext as s, useEffect as c, useMemo as l, useRef as u, useState as d } from "react";
3
- import { createPortal as ee } from "react-dom";
4
- import { Fragment as te, jsx as f, jsxs as p } from "react/jsx-runtime";
5
- import { createRoot as ne } from "react-dom/client";
3
+ import { createPortal as f } from "react-dom";
4
+ import { Fragment as ee, jsx as p, jsxs as m } from "react/jsx-runtime";
5
+ import { createRoot as te } from "react-dom/client";
6
6
  //#region ../ui-controls/src/ErrorScreen.tsx
7
- function re({ title: e = "Something Went Wrong", subtitle: t = "We encountered an error while playing this video.\nPlease try again.", onRetry: n }) {
8
- return /* @__PURE__ */ p(te, { children: [
9
- /* @__PURE__ */ f("div", {
7
+ function ne({ title: e = "Something Went Wrong", subtitle: t = "We encountered an error while playing this video.\nPlease try again.", onRetry: n }) {
8
+ return /* @__PURE__ */ m(ee, { children: [
9
+ /* @__PURE__ */ p("div", {
10
10
  style: {
11
11
  width: 80,
12
12
  height: 80,
@@ -17,7 +17,7 @@ function re({ title: e = "Something Went Wrong", subtitle: t = "We encountered a
17
17
  justifyContent: "center",
18
18
  flexShrink: 0
19
19
  },
20
- children: /* @__PURE__ */ p("svg", {
20
+ children: /* @__PURE__ */ m("svg", {
21
21
  width: "36",
22
22
  height: "36",
23
23
  viewBox: "0 0 24 24",
@@ -27,14 +27,14 @@ function re({ title: e = "Something Went Wrong", subtitle: t = "We encountered a
27
27
  strokeLinecap: "round",
28
28
  strokeLinejoin: "round",
29
29
  children: [
30
- /* @__PURE__ */ f("path", { d: "M10.29 3.86L1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0z" }),
31
- /* @__PURE__ */ f("line", {
30
+ /* @__PURE__ */ p("path", { d: "M10.29 3.86L1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0z" }),
31
+ /* @__PURE__ */ p("line", {
32
32
  x1: "12",
33
33
  y1: "9",
34
34
  x2: "12",
35
35
  y2: "13"
36
36
  }),
37
- /* @__PURE__ */ f("line", {
37
+ /* @__PURE__ */ p("line", {
38
38
  x1: "12",
39
39
  y1: "17",
40
40
  x2: "12.01",
@@ -43,12 +43,12 @@ function re({ title: e = "Something Went Wrong", subtitle: t = "We encountered a
43
43
  ]
44
44
  })
45
45
  }),
46
- /* @__PURE__ */ p("div", {
46
+ /* @__PURE__ */ m("div", {
47
47
  style: {
48
48
  textAlign: "center",
49
49
  padding: "0 24px"
50
50
  },
51
- children: [/* @__PURE__ */ f("p", {
51
+ children: [/* @__PURE__ */ p("p", {
52
52
  style: {
53
53
  color: "#ffffff",
54
54
  fontSize: 22,
@@ -57,7 +57,7 @@ function re({ title: e = "Something Went Wrong", subtitle: t = "We encountered a
57
57
  letterSpacing: "-0.2px"
58
58
  },
59
59
  children: e
60
- }), /* @__PURE__ */ f("p", {
60
+ }), /* @__PURE__ */ p("p", {
61
61
  style: {
62
62
  color: "rgba(255,255,255,0.5)",
63
63
  fontSize: 14,
@@ -68,7 +68,7 @@ function re({ title: e = "Something Went Wrong", subtitle: t = "We encountered a
68
68
  children: t
69
69
  })]
70
70
  }),
71
- /* @__PURE__ */ p("button", {
71
+ /* @__PURE__ */ m("button", {
72
72
  onClick: n,
73
73
  style: {
74
74
  display: "flex",
@@ -84,7 +84,7 @@ function re({ title: e = "Something Went Wrong", subtitle: t = "We encountered a
84
84
  cursor: "pointer",
85
85
  letterSpacing: "-0.1px"
86
86
  },
87
- children: [/* @__PURE__ */ p("svg", {
87
+ children: [/* @__PURE__ */ m("svg", {
88
88
  width: "20",
89
89
  height: "20",
90
90
  viewBox: "0 0 24 24",
@@ -93,17 +93,17 @@ function re({ title: e = "Something Went Wrong", subtitle: t = "We encountered a
93
93
  strokeWidth: "2.5",
94
94
  strokeLinecap: "round",
95
95
  strokeLinejoin: "round",
96
- children: [/* @__PURE__ */ f("polyline", { points: "1 4 1 10 7 10" }), /* @__PURE__ */ f("path", { d: "M3.51 15a9 9 0 1 0 .49-3.51" })]
96
+ children: [/* @__PURE__ */ p("polyline", { points: "1 4 1 10 7 10" }), /* @__PURE__ */ p("path", { d: "M3.51 15a9 9 0 1 0 .49-3.51" })]
97
97
  }), "Retry Now"]
98
98
  })
99
99
  ] });
100
100
  }
101
101
  //#endregion
102
102
  //#region ../../node_modules/lucide-react/dist/esm/shared/src/utils/mergeClasses.mjs
103
- var m = (...e) => e.filter((e, t, n) => !!e && e.trim() !== "" && n.indexOf(e) === t).join(" ").trim(), ie = (e) => e.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase(), h = (e) => e.replace(/^([A-Z])|[\s-_]+(\w)/g, (e, t, n) => n ? n.toUpperCase() : t.toLowerCase()), ae = (e) => {
104
- let t = h(e);
103
+ var h = (...e) => e.filter((e, t, n) => !!e && e.trim() !== "" && n.indexOf(e) === t).join(" ").trim(), g = (e) => e.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase(), _ = (e) => e.replace(/^([A-Z])|[\s-_]+(\w)/g, (e, t, n) => n ? n.toUpperCase() : t.toLowerCase()), re = (e) => {
104
+ let t = _(e);
105
105
  return t.charAt(0).toUpperCase() + t.slice(1);
106
- }, oe = {
106
+ }, ie = {
107
107
  xmlns: "http://www.w3.org/2000/svg",
108
108
  width: 24,
109
109
  height: 24,
@@ -113,37 +113,37 @@ var m = (...e) => e.filter((e, t, n) => !!e && e.trim() !== "" && n.indexOf(e) =
113
113
  strokeWidth: 2,
114
114
  strokeLinecap: "round",
115
115
  strokeLinejoin: "round"
116
- }, se = (e) => {
116
+ }, ae = (e) => {
117
117
  for (let t in e) if (t.startsWith("aria-") || t === "role" || t === "title") return !0;
118
118
  return !1;
119
- }, ce = r({}), le = () => s(ce), ue = a(({ color: e, size: t, strokeWidth: n, absoluteStrokeWidth: r, className: a = "", children: o, iconNode: s, ...c }, l) => {
120
- let { size: u = 24, strokeWidth: d = 2, absoluteStrokeWidth: ee = !1, color: te = "currentColor", className: f = "" } = le() ?? {}, p = r ?? ee ? Number(n ?? d) * 24 / Number(t ?? u) : n ?? d;
119
+ }, oe = r({}), se = () => s(oe), ce = a(({ color: e, size: t, strokeWidth: n, absoluteStrokeWidth: r, className: a = "", children: o, iconNode: s, ...c }, l) => {
120
+ let { size: u = 24, strokeWidth: d = 2, absoluteStrokeWidth: f = !1, color: ee = "currentColor", className: p = "" } = se() ?? {}, m = r ?? f ? Number(n ?? d) * 24 / Number(t ?? u) : n ?? d;
121
121
  return i("svg", {
122
122
  ref: l,
123
- ...oe,
124
- width: t ?? u ?? oe.width,
125
- height: t ?? u ?? oe.height,
126
- stroke: e ?? te,
127
- strokeWidth: p,
128
- className: m("lucide", f, a),
129
- ...!o && !se(c) && { "aria-hidden": "true" },
123
+ ...ie,
124
+ width: t ?? u ?? ie.width,
125
+ height: t ?? u ?? ie.height,
126
+ stroke: e ?? ee,
127
+ strokeWidth: m,
128
+ className: h("lucide", p, a),
129
+ ...!o && !ae(c) && { "aria-hidden": "true" },
130
130
  ...c
131
131
  }, [...s.map(([e, t]) => i(e, t)), ...Array.isArray(o) ? o : [o]]);
132
- }), g = (e, t) => {
133
- let n = a(({ className: n, ...r }, a) => i(ue, {
132
+ }), v = (e, t) => {
133
+ let n = a(({ className: n, ...r }, a) => i(ce, {
134
134
  ref: a,
135
135
  iconNode: t,
136
- className: m(`lucide-${ie(ae(e))}`, `lucide-${e}`, n),
136
+ className: h(`lucide-${g(re(e))}`, `lucide-${e}`, n),
137
137
  ...r
138
138
  }));
139
- return n.displayName = ae(e), n;
140
- }, de = g("airplay", [["path", {
139
+ return n.displayName = re(e), n;
140
+ }, le = v("airplay", [["path", {
141
141
  d: "M5 17H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2h-1",
142
142
  key: "ns4c3b"
143
143
  }], ["path", {
144
144
  d: "m12 15 5 6H7Z",
145
145
  key: "14qnn2"
146
- }]]), fe = g("captions", [["rect", {
146
+ }]]), ue = v("captions", [["rect", {
147
147
  width: "18",
148
148
  height: "14",
149
149
  x: "3",
@@ -154,7 +154,7 @@ var m = (...e) => e.filter((e, t, n) => !!e && e.trim() !== "" && n.indexOf(e) =
154
154
  }], ["path", {
155
155
  d: "M7 15h4M15 15h2M7 11h2M13 11h4",
156
156
  key: "1ueiar"
157
- }]]), pe = g("cast", [
157
+ }]]), de = v("cast", [
158
158
  ["path", {
159
159
  d: "M2 8V6a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2h-6",
160
160
  key: "3zrzxg"
@@ -174,13 +174,13 @@ var m = (...e) => e.filter((e, t, n) => !!e && e.trim() !== "" && n.indexOf(e) =
174
174
  y2: "20",
175
175
  key: "xu2jvo"
176
176
  }]
177
- ]), _ = g("check", [["path", {
177
+ ]), y = v("check", [["path", {
178
178
  d: "M20 6 9 17l-5-5",
179
179
  key: "1gmf2c"
180
- }]]), me = g("chevron-left", [["path", {
180
+ }]]), fe = v("chevron-left", [["path", {
181
181
  d: "m15 18-6-6 6-6",
182
182
  key: "1wnfg3"
183
- }]]), he = g("external-link", [
183
+ }]]), pe = v("external-link", [
184
184
  ["path", {
185
185
  d: "M15 3h6v6",
186
186
  key: "1q9fwt"
@@ -193,13 +193,13 @@ var m = (...e) => e.filter((e, t, n) => !!e && e.trim() !== "" && n.indexOf(e) =
193
193
  d: "M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",
194
194
  key: "a6xqqp"
195
195
  }]
196
- ]), ge = g("gauge", [["path", {
196
+ ]), me = v("gauge", [["path", {
197
197
  d: "m12 14 4-4",
198
198
  key: "9kzdfg"
199
199
  }], ["path", {
200
200
  d: "M3.34 19a10 10 0 1 1 17.32 0",
201
201
  key: "19p75a"
202
- }]]), _e = g("languages", [
202
+ }]]), he = v("languages", [
203
203
  ["path", {
204
204
  d: "m5 8 6 6",
205
205
  key: "1wu5hv"
@@ -224,7 +224,7 @@ var m = (...e) => e.filter((e, t, n) => !!e && e.trim() !== "" && n.indexOf(e) =
224
224
  d: "M14 18h6",
225
225
  key: "1m8k6r"
226
226
  }]
227
- ]), ve = g("list-video", [
227
+ ]), ge = v("list-video", [
228
228
  ["path", {
229
229
  d: "M21 5H3",
230
230
  key: "1fi0y6"
@@ -241,7 +241,7 @@ var m = (...e) => e.filter((e, t, n) => !!e && e.trim() !== "" && n.indexOf(e) =
241
241
  d: "M15 12.003a1 1 0 0 1 1.517-.859l4.997 2.997a1 1 0 0 1 0 1.718l-4.997 2.997a1 1 0 0 1-1.517-.86z",
242
242
  key: "ms4nik"
243
243
  }]
244
- ]), ye = g("maximize", [
244
+ ]), _e = v("maximize", [
245
245
  ["path", {
246
246
  d: "M8 3H5a2 2 0 0 0-2 2v3",
247
247
  key: "1dcmit"
@@ -258,7 +258,7 @@ var m = (...e) => e.filter((e, t, n) => !!e && e.trim() !== "" && n.indexOf(e) =
258
258
  d: "M16 21h3a2 2 0 0 0 2-2v-3",
259
259
  key: "18trek"
260
260
  }]
261
- ]), be = g("minimize", [
261
+ ]), ve = v("minimize", [
262
262
  ["path", {
263
263
  d: "M8 3v3a2 2 0 0 1-2 2H3",
264
264
  key: "hohbtr"
@@ -275,7 +275,7 @@ var m = (...e) => e.filter((e, t, n) => !!e && e.trim() !== "" && n.indexOf(e) =
275
275
  d: "M16 21v-3a2 2 0 0 1 2-2h3",
276
276
  key: "ph8mxp"
277
277
  }]
278
- ]), v = g("pause", [["rect", {
278
+ ]), b = v("pause", [["rect", {
279
279
  x: "14",
280
280
  y: "3",
281
281
  width: "5",
@@ -289,7 +289,7 @@ var m = (...e) => e.filter((e, t, n) => !!e && e.trim() !== "" && n.indexOf(e) =
289
289
  height: "18",
290
290
  rx: "1",
291
291
  key: "1wsw3u"
292
- }]]), xe = g("picture-in-picture", [
292
+ }]]), ye = v("picture-in-picture", [
293
293
  ["path", {
294
294
  d: "M2 10h6V4",
295
295
  key: "zwrco"
@@ -314,28 +314,28 @@ var m = (...e) => e.filter((e, t, n) => !!e && e.trim() !== "" && n.indexOf(e) =
314
314
  rx: "1",
315
315
  key: "1wjs3o"
316
316
  }]
317
- ]), Se = g("play", [["path", {
317
+ ]), be = v("play", [["path", {
318
318
  d: "M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z",
319
319
  key: "10ikf1"
320
- }]]), Ce = g("rotate-ccw", [["path", {
320
+ }]]), xe = v("rotate-ccw", [["path", {
321
321
  d: "M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",
322
322
  key: "1357e3"
323
323
  }], ["path", {
324
324
  d: "M3 3v5h5",
325
325
  key: "1xhq8a"
326
- }]]), we = g("rotate-cw", [["path", {
326
+ }]]), Se = v("rotate-cw", [["path", {
327
327
  d: "M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8",
328
328
  key: "1p45f6"
329
329
  }], ["path", {
330
330
  d: "M21 3v5h-5",
331
331
  key: "1q7to0"
332
- }]]), Te = g("volume-1", [["path", {
332
+ }]]), Ce = v("volume-1", [["path", {
333
333
  d: "M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z",
334
334
  key: "uqj9uw"
335
335
  }], ["path", {
336
336
  d: "M16 9a5 5 0 0 1 0 6",
337
337
  key: "1q6k2b"
338
- }]]), Ee = g("volume-2", [
338
+ }]]), we = v("volume-2", [
339
339
  ["path", {
340
340
  d: "M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z",
341
341
  key: "uqj9uw"
@@ -348,7 +348,7 @@ var m = (...e) => e.filter((e, t, n) => !!e && e.trim() !== "" && n.indexOf(e) =
348
348
  d: "M19.364 18.364a9 9 0 0 0 0-12.728",
349
349
  key: "ijwkga"
350
350
  }]
351
- ]), De = g("volume-x", [
351
+ ]), Te = v("volume-x", [
352
352
  ["path", {
353
353
  d: "M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z",
354
354
  key: "uqj9uw"
@@ -367,15 +367,15 @@ var m = (...e) => e.filter((e, t, n) => !!e && e.trim() !== "" && n.indexOf(e) =
367
367
  y2: "15",
368
368
  key: "5ykzw1"
369
369
  }]
370
- ]), Oe = g("volume", [["path", {
370
+ ]), Ee = v("volume", [["path", {
371
371
  d: "M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z",
372
372
  key: "uqj9uw"
373
- }]]), ke = 1e4, Ae = !1, je = "\n html, body { margin: 0; padding: 0; height: 100%; background: #000; overflow: hidden; }\n * { box-sizing: border-box; }\n .gb-pip-video { width: 100%; height: 100%; object-fit: contain; display: block; background: #000; }\n .gb-pip-overlay {\n position: absolute; inset: 0; z-index: 2;\n display: flex; flex-direction: column; justify-content: space-between;\n font-family: system-ui, -apple-system, sans-serif; color: #fff;\n opacity: 0; transition: opacity 0.15s ease;\n background: linear-gradient(to bottom, rgba(0,0,0,0.35) 0%, rgba(0,0,0,0) 25%, rgba(0,0,0,0) 65%, rgba(0,0,0,0.55) 100%);\n }\n .gb-pip-overlay:hover, .gb-pip-overlay.gb-pip-paused { opacity: 1; }\n .gb-pip-center {\n flex: 1; display: flex; align-items: center; justify-content: center; gap: 28px;\n }\n .gb-pip-btn {\n background: rgba(0,0,0,0.35); border: none; color: #fff; border-radius: 50%;\n width: 44px; height: 44px; display: flex; align-items: center; justify-content: center;\n cursor: pointer; padding: 0;\n }\n .gb-pip-btn:hover { background: rgba(0,0,0,0.55); }\n .gb-pip-btn.gb-pip-play { width: 56px; height: 56px; }\n .gb-pip-bottom { padding: 6px 10px 8px; display: flex; flex-direction: column; gap: 4px; }\n .gb-pip-progress { position: relative; height: 4px; border-radius: 2px; background: rgba(255,255,255,0.3); cursor: pointer; }\n .gb-pip-progress-fill { position: absolute; inset: 0; width: 0%; border-radius: 2px; background: #fff; }\n .gb-pip-time { font-size: 11px; font-variant-numeric: tabular-nums; opacity: 0.9; }\n", Me = (e) => {
373
+ }]]), De = 1e4, Oe = !1, ke = "\n html, body { margin: 0; padding: 0; height: 100%; background: #000; overflow: hidden; }\n * { box-sizing: border-box; }\n .gb-pip-video { width: 100%; height: 100%; object-fit: contain; display: block; background: #000; }\n .gb-pip-overlay {\n position: absolute; inset: 0; z-index: 2;\n display: flex; flex-direction: column; justify-content: space-between;\n font-family: system-ui, -apple-system, sans-serif; color: #fff;\n opacity: 0; transition: opacity 0.15s ease;\n background: linear-gradient(to bottom, rgba(0,0,0,0.35) 0%, rgba(0,0,0,0) 25%, rgba(0,0,0,0) 65%, rgba(0,0,0,0.55) 100%);\n }\n .gb-pip-overlay:hover, .gb-pip-overlay.gb-pip-paused { opacity: 1; }\n .gb-pip-center {\n flex: 1; display: flex; align-items: center; justify-content: center; gap: 28px;\n }\n .gb-pip-btn {\n background: rgba(0,0,0,0.35); border: none; color: #fff; border-radius: 50%;\n width: 44px; height: 44px; display: flex; align-items: center; justify-content: center;\n cursor: pointer; padding: 0;\n }\n .gb-pip-btn:hover { background: rgba(0,0,0,0.55); }\n .gb-pip-btn.gb-pip-play { width: 56px; height: 56px; }\n .gb-pip-bottom { padding: 6px 10px 8px; display: flex; flex-direction: column; gap: 4px; }\n .gb-pip-progress { position: relative; height: 4px; border-radius: 2px; background: rgba(255,255,255,0.3); cursor: pointer; }\n .gb-pip-progress-fill { position: absolute; inset: 0; width: 0%; border-radius: 2px; background: #fff; }\n .gb-pip-time { font-size: 11px; font-variant-numeric: tabular-nums; opacity: 0.9; }\n", Ae = (e) => {
374
374
  let t = e.match(/#EXT-X-TITLE:(.+)/);
375
375
  if (t?.[1]?.trim()) return t[1].trim();
376
376
  let n = e.match(/#EXT-X-SESSION-DATA:[^\n]*DATA-ID="[^"]*title[^"]*"[^\n]*VALUE="([^"]+)"/i);
377
377
  return n?.[1]?.trim() ? n[1].trim() : null;
378
- }, y = (e) => {
378
+ }, je = (e) => {
379
379
  if (!e || e.length < 10 || e[0] !== 73 || e[1] !== 68 || e[2] !== 51) return null;
380
380
  let t = e[3], n = (e[6] & 127) << 21 | (e[7] & 127) << 14 | (e[8] & 127) << 7 | e[9] & 127, r = Math.min(10 + n, e.length), i = 10;
381
381
  for (; i + 10 <= r;) {
@@ -388,7 +388,7 @@ var m = (...e) => e.filter((e, t, n) => !!e && e.trim() !== "" && n.indexOf(e) =
388
388
  i += 10 + a;
389
389
  }
390
390
  return null;
391
- }, Ne = ({ size: e = 20 }) => /* @__PURE__ */ p("svg", {
391
+ }, Me = ({ size: e = 20 }) => /* @__PURE__ */ m("svg", {
392
392
  width: e,
393
393
  height: e,
394
394
  viewBox: "0 0 24 24",
@@ -398,17 +398,17 @@ var m = (...e) => e.filter((e, t, n) => !!e && e.trim() !== "" && n.indexOf(e) =
398
398
  strokeLinecap: "round",
399
399
  strokeLinejoin: "round",
400
400
  children: [
401
- /* @__PURE__ */ f("rect", {
401
+ /* @__PURE__ */ p("rect", {
402
402
  x: "2",
403
403
  y: "5",
404
404
  width: "20",
405
405
  height: "14",
406
406
  rx: "3"
407
407
  }),
408
- /* @__PURE__ */ f("path", { d: "M7 9v6M7 12h3M10 9v6" }),
409
- /* @__PURE__ */ f("path", { d: "M14 9h1.5a3 3 0 0 1 0 6H14z" })
408
+ /* @__PURE__ */ p("path", { d: "M7 9v6M7 12h3M10 9v6" }),
409
+ /* @__PURE__ */ p("path", { d: "M14 9h1.5a3 3 0 0 1 0 6H14z" })
410
410
  ]
411
- }), Pe = ({ size: e = 20 }) => /* @__PURE__ */ p("svg", {
411
+ }), Ne = ({ size: e = 20 }) => /* @__PURE__ */ m("svg", {
412
412
  width: e,
413
413
  height: e,
414
414
  viewBox: "0 0 24 24",
@@ -418,20 +418,20 @@ var m = (...e) => e.filter((e, t, n) => !!e && e.trim() !== "" && n.indexOf(e) =
418
418
  strokeLinecap: "round",
419
419
  strokeLinejoin: "round",
420
420
  children: [
421
- /* @__PURE__ */ f("rect", {
421
+ /* @__PURE__ */ p("rect", {
422
422
  x: "2",
423
423
  y: "5",
424
424
  width: "20",
425
425
  height: "14",
426
426
  rx: "3"
427
427
  }),
428
- /* @__PURE__ */ f("path", { d: "M7 9v6M7 12h3M10 9v6" }),
429
- /* @__PURE__ */ f("path", { d: "M14 9h1.5a3 3 0 0 1 0 6H14z" })
428
+ /* @__PURE__ */ p("path", { d: "M7 9v6M7 12h3M10 9v6" }),
429
+ /* @__PURE__ */ p("path", { d: "M14 9h1.5a3 3 0 0 1 0 6H14z" })
430
430
  ]
431
- }), Fe = (e) => {
431
+ }), Pe = (e) => {
432
432
  let t = e.replace("#", "");
433
433
  return t.length === 6 ? `${parseInt(t.substring(0, 2), 16)}, ${parseInt(t.substring(2, 4), 16)}, ${parseInt(t.substring(4, 6), 16)}` : t.length === 3 ? `${parseInt(t[0] + t[0], 16)}, ${parseInt(t[1] + t[1], 16)}, ${parseInt(t[2] + t[2], 16)}` : "99, 102, 241";
434
- }, Ie = {
434
+ }, Fe = {
435
435
  en: "English",
436
436
  eng: "English",
437
437
  fr: "French",
@@ -454,37 +454,37 @@ var m = (...e) => e.filter((e, t, n) => !!e && e.trim() !== "" && n.indexOf(e) =
454
454
  hi: "Hindi",
455
455
  ta: "Tamil",
456
456
  tam: "Tamil"
457
- }, Le = (e) => {
457
+ }, Ie = (e) => {
458
458
  if (!e) return null;
459
459
  let t = e.trim().toLowerCase(), n = t.match(/^(en|eng|fr|fre|fra|es|spa|de|ger|deu|it|ita|pt|por|ja|zh|ko|ru|ar|hi|ta|tam)/);
460
- if (n && Ie[n[0]]) return Ie[n[0]];
461
- for (let [e, n] of Object.entries(Ie)) if (t.includes(e)) return n;
460
+ if (n && Fe[n[0]]) return Fe[n[0]];
461
+ for (let [e, n] of Object.entries(Fe)) if (t.includes(e)) return n;
462
462
  return /english|anglais|ingles/i.test(t) ? "English" : /french|français/i.test(t) ? "French" : /spanish|español/i.test(t) ? "Spanish" : /german|deutsch/i.test(t) ? "German" : /italian|italiano/i.test(t) ? "Italian" : /portuguese|português/i.test(t) ? "Portuguese" : /japanese|nihongo/i.test(t) ? "Japanese" : /chinese|中文/i.test(t) ? "Chinese" : /korean|한국어/i.test(t) ? "Korean" : /tamil|தமிழ்/i.test(t) ? "Tamil" : /russian|русский/i.test(t) ? "Russian" : /arabic|العربية/i.test(t) ? "Arabic" : /hindi|हिन्दी/i.test(t) ? "Hindi" : null;
463
- }, b = (e) => {
463
+ }, x = (e) => {
464
464
  if (e.lang) {
465
- let t = Le(e.lang);
465
+ let t = Ie(e.lang);
466
466
  if (t) return t;
467
467
  }
468
468
  if (e.label) {
469
469
  let t = e.label.trim(), n = t.split(/[#\d\.\s\-_/|:]+/).filter(Boolean);
470
470
  for (let e = n.length - 1; e >= 0; --e) {
471
- let t = Le(n[e]);
471
+ let t = Ie(n[e]);
472
472
  if (t) return t;
473
473
  }
474
474
  let r = t.replace(/^[#\d\.\s]+/, "").trim();
475
- return Le(r) || r;
475
+ return Ie(r) || r;
476
476
  }
477
477
  return "Unknown";
478
- }, Re = (e) => {
478
+ }, Le = (e) => {
479
479
  let t = /* @__PURE__ */ new Set();
480
480
  return e.filter((e) => {
481
- let n = `${b(e).toLowerCase()}|${(e.lang || "").trim().toLowerCase()}`;
481
+ let n = `${x(e).toLowerCase()}|${(e.lang || "").trim().toLowerCase()}`;
482
482
  return t.has(n) ? !1 : (t.add(n), !0);
483
483
  });
484
- }, ze = (e) => {
484
+ }, Re = (e) => {
485
485
  let t = (e ?? "").split(":").map(Number);
486
486
  return (t[0] || 0) * 3600 + (t[1] || 0) * 60 + (t[2] || 0);
487
- }, Be = (e) => {
487
+ }, ze = (e) => {
488
488
  if (!e) return !1;
489
489
  try {
490
490
  let { protocol: t } = new URL(e, window.location.href);
@@ -492,23 +492,23 @@ var m = (...e) => e.filter((e, t, n) => !!e && e.trim() !== "" && n.indexOf(e) =
492
492
  } catch {
493
493
  return !1;
494
494
  }
495
- }, Ve = (e) => {
495
+ }, Be = (e) => {
496
496
  if (typeof e == "number") return Number.isFinite(e) && e >= 0 ? e : null;
497
497
  if (typeof e != "string") return null;
498
498
  let t = e.trim();
499
499
  if (!t) return null;
500
- if (/^\d+:\d{1,2}:\d{1,2}(\.\d+)?$/.test(t)) return ze(t);
500
+ if (/^\d+:\d{1,2}:\d{1,2}(\.\d+)?$/.test(t)) return Re(t);
501
501
  let n = Number(t);
502
502
  return Number.isFinite(n) && n >= 0 ? n : null;
503
- }, He = [
503
+ }, Ve = [
504
504
  0,
505
505
  1e3,
506
506
  2e3,
507
507
  3e3,
508
508
  5e3,
509
509
  8e3
510
- ];
511
- function Ue(e, t, n) {
510
+ ], He = 700, Ue = 8;
511
+ function We(e, t, n) {
512
512
  let r = !1, i, a = (o) => {
513
513
  i = setTimeout(() => {
514
514
  r || fetch(e).then((e) => e.json()).then((e) => {
@@ -518,54 +518,57 @@ function Ue(e, t, n) {
518
518
  n(i);
519
519
  return;
520
520
  }
521
- o + 1 < He.length && a(o + 1);
521
+ o + 1 < Ve.length && a(o + 1);
522
522
  }).catch(() => {
523
- r || o + 1 < He.length && a(o + 1);
523
+ r || o + 1 < Ve.length && a(o + 1);
524
524
  });
525
- }, He[o]);
525
+ }, Ve[o]);
526
526
  };
527
527
  return a(0), () => {
528
528
  r = !0, i && clearTimeout(i);
529
529
  };
530
530
  }
531
- var We = ({ src: r, autoplay: i = !1, muted: a = !1, chapters: s = [], keyMoments: ne, subtitles: m = [], watermark: ie, themeColor: h = "#6366f1", drmConfig: ae, firebaseConfig: oe, videoId: se, onAnalyticsEvent: ce, onAdBreakChange: le, onKeyMomentsLoaded: ue, enableControls: g = !0, enableChromecast: Ie, enableKeyMoments: Le, enableSubtitles: He, enableQuality: We, enablePlaybackSpeed: Ge, enablePiP: Ke, enableFullscreen: qe = !0, autoFullscreen: Je = !1, watchProgressInterval: Ye = 30, subtitleStyle: Xe = {}, resolvedEntitlement: Ze, licenseKey: Qe, title: x, chaptersDisplayMode: $e = "strip", volumeControlType: et = "slider", urlTransformer: tt, pauseAdOnTabSwitch: nt = !0, enableSkipAd: rt = !1, skipAdAfterSeconds: it = 5, overlayAdUrl: at, adTrackingUrl: ot, sources: S, activeSourceIndex: st = 0, onSourceChange: ct, initialTime: lt, onTimeUpdate: ut }) => {
532
- let dt = tt ?? ((e) => e), C = u(null), ft = u(null), pt = u(!1), w = u(null), mt = u(0), ht = u(null), T = u(null), gt = u(null), _t = u(null), vt = u(!1), E = u(!1), D = u(null), O = u(null), k = u(null), yt = u(null), bt = u(() => {}), A = u(null), xt = u(!1), St = u(null), Ct = (e) => {
533
- !e || St.current !== null || (St.current = e.muted, e.muted = !0);
534
- }, wt = (e) => {
535
- St.current !== null && (e && (e.muted = St.current), St.current = null);
536
- }, Tt = u(null), Et = u(!1), Dt = u(null), Ot = u(null), kt = u(null), j = u(null), At = u(null), jt = u(S), Mt = u(ct), Nt = u(!1), M = u(null), N = u(null), P = u(null), Pt = u(null), Ft = u(0), It = u(null), [Lt, Rt] = d(!1), zt = u(!1), Bt = u(null), [Vt, Ht] = d(null);
531
+ var Ge = ({ src: r, autoplay: i = !1, muted: a = !1, chapters: s = [], keyMoments: te, subtitles: h = [], watermark: g, themeColor: _ = "#6366f1", drmConfig: re, firebaseConfig: ie, videoId: ae, onAnalyticsEvent: oe, onAdBreakChange: se, onKeyMomentsLoaded: ce, enableControls: v = !0, enableChromecast: Fe, enableKeyMoments: Ie, enableSubtitles: Ve, enableQuality: Ge, enablePlaybackSpeed: Ke, enablePiP: S, enableFullscreen: qe = !0, autoFullscreen: Je = !1, watchProgressInterval: Ye = 30, subtitleStyle: Xe = {}, resolvedEntitlement: Ze, licenseKey: Qe, title: C, chaptersDisplayMode: $e = "strip", volumeControlType: et = "slider", urlTransformer: tt, pauseAdOnTabSwitch: nt = !0, enableSkipAd: rt = !1, skipAdAfterSeconds: it = 5, overlayAdUrl: at, adTrackingUrl: ot, sources: w, activeSourceIndex: st = 0, onSourceChange: ct, initialTime: lt, onTimeUpdate: ut }) => {
532
+ let dt = tt ?? ((e) => e), T = u(null), ft = u(null), pt = u(!1), E = u(null), mt = u(0), ht = u(null), gt = u(null), _t = u(null), vt = u(null), yt = u(!1), D = u(!1), O = u(null), k = u(null), A = u(null), bt = u(null), xt = u(() => {}), j = u(null), St = u(!1), Ct = u(null), wt = (e) => {
533
+ !e || Ct.current !== null || (Ct.current = e.muted, e.muted = !0);
534
+ }, Tt = (e) => {
535
+ Ct.current !== null && (e && (e.muted = Ct.current), Ct.current = null);
536
+ }, Et = u(null), Dt = u(!1), Ot = u(null), kt = u(null), At = u(null), jt = u(null), Mt = u(null), Nt = u(null), Pt = u(w), Ft = u(ct), It = u(!1), M = u(null), N = u(null), P = u(null), Lt = u(null), Rt = u(0), zt = u(null), [Bt, Vt] = d(!1), Ht = u(!1), Ut = u(null), [Wt, Gt] = d(null);
537
537
  c(() => {
538
- if (typeof window > "u" || Ae) return;
538
+ if (typeof window > "u" || Oe) return;
539
539
  let e = window.requestAnimationFrame(() => {
540
- let e = C.current;
540
+ let e = T.current;
541
541
  if (!e) return;
542
542
  let t = window.getComputedStyle(e);
543
- t.overflow !== "hidden" && t.borderTopLeftRadius === "0px" && (Ae = !0, console.warn("[boss-web-player-sdk] Player styles appear to be missing — the player will look broken/unstyled.\nImport the stylesheet once at your app entry point:\n import 'boss-web-player-sdk/css';"));
543
+ t.overflow !== "hidden" && t.borderTopLeftRadius === "0px" && (Oe = !0, console.warn("[boss-web-player-sdk] Player styles appear to be missing — the player will look broken/unstyled.\nImport the stylesheet once at your app entry point:\n import 'boss-web-player-sdk/css';"));
544
544
  });
545
545
  return () => window.cancelAnimationFrame(e);
546
546
  }, []), c(() => {
547
- let e = C.current;
547
+ let e = T.current;
548
548
  if (!e) return;
549
549
  let t = new ResizeObserver((e) => {
550
- for (let t of e) Rt(t.contentRect.width <= 768);
550
+ for (let t of e) Vt(t.contentRect.width <= 768);
551
551
  });
552
- return t.observe(e), Rt(e.getBoundingClientRect().width <= 768), () => t.disconnect();
552
+ return t.observe(e), Vt(e.getBoundingClientRect().width <= 768), () => t.disconnect();
553
553
  }, []);
554
- let [F, Ut] = d(null), [Wt, Gt] = d(!1), Kt = Ze ?? null, qt = Kt != null, Jt = Kt?.features ?? {}, Yt = qt ? !!(Jt.drm_protection && !Qe) : !1, I = {
555
- enableSubtitles: qt ? !!Jt.subtitle_support : typeof He == "boolean" ? He : !0,
556
- enableChromecast: qt ? !!Jt.chromecast : typeof Ie == "boolean" ? Ie : !0,
557
- enableKeyMoments: qt ? !!Jt.key_moments : typeof Le == "boolean" ? Le : !0,
558
- enableQuality: qt ? !!Jt.multiple_resolution : typeof We == "boolean" ? We : !0,
559
- enablePlaybackSpeed: qt ? !!Jt.playback_speed : typeof Ge == "boolean" ? Ge : !0,
560
- enablePiP: qt ? !!Jt.picture_in_picture : typeof Ke == "boolean" ? Ke : !0,
561
- allowAirplay: qt ? !!Jt.airplay : !1,
562
- allowMultipleAudio: qt ? !!Jt.multiple_audio : !0,
563
- m3u8_playback: qt ? !!Jt.m3u8_playback : !0,
564
- drm_protection: qt ? !!Jt.drm_protection : !1
565
- }, [Xt, Zt] = d(!1), [Qt, $t] = d(0), [en, tn] = d(!1), [L, nn] = d(0), [rn, an] = d(0), [on, sn] = d(1), [cn, ln] = d(!1), [un, dn] = d(!1), [fn, pn] = d(!1), [mn, hn] = d(!1), [gn, _n] = d(!1), vn = Lt || (fn || mn) && gn, [yn, bn] = d(!1), [xn, Sn] = d(null), [Cn, wn] = d(!1), [R, Tn] = d([]), z = u([]), En = u(/* @__PURE__ */ new Set()), Dn = S && S.length > 0 ? S.map((e) => e.url).join("|") : r, [On, kn] = d(/* @__PURE__ */ new Set()), [An, jn] = d(Dn), Mn = u(null), Nn = u(!1), Pn = u(null);
566
- An !== Dn && (jn(Dn), kn(/* @__PURE__ */ new Set()), En.current = /* @__PURE__ */ new Set(), Mn.current = null, Nn.current = !1);
567
- let Fn = u(null), In = u(!1), [Ln, Rn] = d([]), [zn, Bn] = d(null), Vn = u([]), Hn = u(null), Un = u(/* @__PURE__ */ new Set()), [Wn, Gn] = d([]), Kn = u([]), [qn, Jn] = d([]), Yn = (e) => {
568
- let t = Kn.current.find((t) => e >= t.startTimeSeconds && e < t.endTimeSeconds);
554
+ let [F, Kt] = d(null), [qt, Jt] = d(!1), Yt = Ze ?? null, Xt = Yt != null, Zt = Yt?.features ?? {}, Qt = Xt ? !!(Zt.drm_protection && !Qe) : !1, I = {
555
+ enableSubtitles: Xt ? !!Zt.subtitle_support : typeof Ve == "boolean" ? Ve : !0,
556
+ enableChromecast: Xt ? !!Zt.chromecast : typeof Fe == "boolean" ? Fe : !0,
557
+ enableKeyMoments: Xt ? !!Zt.key_moments : typeof Ie == "boolean" ? Ie : !0,
558
+ enableQuality: Xt ? !!Zt.multiple_resolution : typeof Ge == "boolean" ? Ge : !0,
559
+ enablePlaybackSpeed: Xt ? !!Zt.playback_speed : typeof Ke == "boolean" ? Ke : !0,
560
+ enablePiP: Xt ? !!Zt.picture_in_picture : typeof S == "boolean" ? S : !0,
561
+ allowAirplay: Xt ? !!Zt.airplay : !1,
562
+ allowMultipleAudio: Xt ? !!Zt.multiple_audio : !0,
563
+ m3u8_playback: Xt ? !!Zt.m3u8_playback : !0,
564
+ drm_protection: Xt ? !!Zt.drm_protection : !1
565
+ }, [$t, en] = d(!1), [tn, nn] = d(0), [rn, an] = d(!1), [L, on] = d(0), [sn, cn] = d(0), [ln, un] = d(1), [dn, fn] = d(!1), [pn, mn] = d(!1), [hn, gn] = d(!1), [_n, vn] = d(!1), [yn, bn] = d(!1), xn = Bt || (hn || _n) && yn, [Sn, Cn] = d(!1), [wn, Tn] = d(null), [En, Dn] = d(!1), [R, On] = d([]), z = u([]), kn = u(/* @__PURE__ */ new Set()), An = w && w.length > 0 ? w.map((e) => e.url).join("|") : r, [jn, Mn] = d(/* @__PURE__ */ new Set()), [Nn, Pn] = d(An), Fn = u(null), In = u(!1), Ln = u(null);
566
+ Nn !== An && (Pn(An), Mn(/* @__PURE__ */ new Set()), kn.current = /* @__PURE__ */ new Set(), Fn.current = null, In.current = !1);
567
+ let Rn = u(null), zn = u(!1), [Bn, Vn] = d([]), [Hn, Un] = d(null), Wn = u([]), Gn = u(null), Kn = u(/* @__PURE__ */ new Set()), [qn, Jn] = d([]), Yn = u([]), Xn = u(null), [Zn, Qn] = d({
568
+ w: 0,
569
+ h: 0
570
+ }), [$n, er] = d([]), [tr, nr] = d(0), rr = u(0), ir = u(0), ar = (e) => {
571
+ let t = Yn.current.find((t) => e >= t.startTimeSeconds && e < t.endTimeSeconds);
569
572
  if (t) return {
570
573
  start: t.startTimeSeconds,
571
574
  end: t.endTimeSeconds
@@ -575,7 +578,7 @@ var We = ({ src: r, autoplay: i = !1, muted: a = !1, chapters: s = [], keyMoment
575
578
  start: n.startTime,
576
579
  end: n.endTime
577
580
  } : null;
578
- }, Xn = l(() => R.reduce((e, t) => e + (t.endTime - t.startTime), 0), [R]), Zn = rn > 0 ? Math.max(0, rn - Xn) : 0, B = R.length > 0 && Zn > 0 ? Zn : rn, V = o((e) => {
581
+ }, or = l(() => R.reduce((e, t) => e + (t.endTime - t.startTime), 0), [R]), sr = sn > 0 ? Math.max(0, sn - or) : 0, B = R.length > 0 && sr > 0 ? sr : sn, V = o((e) => {
579
582
  let t = e;
580
583
  for (let n of R) e >= n.endTime ? t -= n.endTime - n.startTime : e >= n.startTime && (t -= e - n.startTime);
581
584
  return Math.max(0, t);
@@ -583,38 +586,38 @@ var We = ({ src: r, autoplay: i = !1, muted: a = !1, chapters: s = [], keyMoment
583
586
  let t = e;
584
587
  for (let e of R) t >= e.startTime && (t += e.endTime - e.startTime);
585
588
  return t;
586
- }, [R]), [Qn, $n] = d([]), [er, tr] = d({
589
+ }, [R]), [cr, lr] = d([]), [ur, dr] = d({
587
590
  id: -1,
588
591
  height: 0,
589
592
  width: 0,
590
593
  bitrate: 0,
591
594
  label: "Auto"
592
- }), [nr, rr] = d(""), [U, ir] = d("off"), [ar, or] = d(Re(m)), [sr, cr] = d([]), [lr, ur] = d(0);
595
+ }), [fr, pr] = d(""), [U, mr] = d("off"), [hr, gr] = d(Le(h)), [_r, vr] = d([]), [yr, br] = d(0);
593
596
  c(() => {
594
597
  if (F) {
595
598
  let e = F.subtitles.getTracks();
596
- or(Re([...m, ...e.filter((e) => !m.some((t) => t.id === e.id))]));
597
- } else or(Re(m));
598
- }, [m.map((e) => e.id).join(","), F]);
599
- let [dr, fr] = d({
599
+ gr(Le([...h, ...e.filter((e) => !h.some((t) => t.id === e.id))]));
600
+ } else gr(Le(h));
601
+ }, [h.map((e) => e.id).join(","), F]);
602
+ let [xr, Sr] = d({
600
603
  chapter: null,
601
604
  index: -1
602
- }), [W, pr] = d(ne || s || []), [G, K] = d("none"), [mr, hr] = d(1), [gr, _r] = d(!1), [vr, yr] = d({}), [br, xr] = d(""), [Sr, Cr] = d(null), wr = u(!1), Tr = JSON.stringify(W.map((e) => ({
605
+ }), [W, Cr] = d(te || s || []), [G, K] = d("none"), [wr, Tr] = d(1), [Er, Dr] = d(!1), [Or, kr] = d({}), [Ar, jr] = d(""), [Mr, Nr] = d(null), Pr = u(!1), Fr = JSON.stringify(W.map((e) => ({
603
606
  title: e.title,
604
607
  startTime: e.startTime
605
608
  })));
606
609
  c(() => {
607
- pr(ne || s || []);
608
- }, [(ne || s || []).map((e) => `${e.startTime}:${e.title}`).join(",")]), c(() => {
610
+ Cr(te || s || []);
611
+ }, [(te || s || []).map((e) => `${e.startTime}:${e.title}`).join(",")]), c(() => {
609
612
  if (!r || !W || W.length === 0) return;
610
- yr({});
613
+ kr({});
611
614
  let e = document.createElement("video");
612
615
  e.muted = !0, e.preload = "metadata", e.crossOrigin = "anonymous", e.style.cssText = "position:fixed;top:0;left:0;width:10px;height:10px;opacity:0.01;pointer-events:none;z-index:-9999;", document.body.appendChild(e);
613
616
  let t = null, i = r.includes(".m3u8"), a = document.createElement("canvas");
614
617
  a.width = 160, a.height = 90;
615
618
  let o = a.getContext("2d"), s = 0, c = !1, l = () => {
616
619
  if (s >= W.length) {
617
- ee();
620
+ f();
618
621
  return;
619
622
  }
620
623
  let t = W[s].startTime;
@@ -623,7 +626,7 @@ var We = ({ src: r, autoplay: i = !1, muted: a = !1, chapters: s = [], keyMoment
623
626
  if (o && e.readyState >= 2) {
624
627
  o.drawImage(e, 0, 0, a.width, a.height);
625
628
  let t = a.toDataURL("image/jpeg", .8);
626
- yr((e) => ({
629
+ kr((e) => ({
627
630
  ...e,
628
631
  [s]: t
629
632
  })), s++, l();
@@ -635,7 +638,7 @@ var We = ({ src: r, autoplay: i = !1, muted: a = !1, chapters: s = [], keyMoment
635
638
  enableWorker: !1,
636
639
  maxBufferLength: 5,
637
640
  xhrSetup: (e, t) => {
638
- let n = ae?.authToken;
641
+ let n = re?.authToken;
639
642
  try {
640
643
  let r = dt(t), i = new URL(r, window.location.origin);
641
644
  n && i.searchParams.set("token", n), e.open("GET", i.toString(), !0);
@@ -644,25 +647,25 @@ var We = ({ src: r, autoplay: i = !1, muted: a = !1, chapters: s = [], keyMoment
644
647
  }
645
648
  }
646
649
  }), t.loadSource(dt(r)), t.attachMedia(e)) : e.src = r, e.readyState >= 2 && d();
647
- let ee = () => {
650
+ let f = () => {
648
651
  e.removeEventListener("seeked", u), e.removeEventListener("canplay", d), t && t.destroy(), document.body.contains(e) && document.body.removeChild(e);
649
652
  };
650
- return ee;
651
- }, [r, Tr]);
652
- let [q, Er] = d(null), [Dr, Or] = d(null), kr = u(!1), [Ar, jr] = d(!1), [Mr, Nr] = d(!1), [Pr, Fr] = d(null), [Ir, Lr] = d(null), [Rr, zr] = d(0), [Br, Vr] = d(0), [Hr, Ur] = d(null), [Wr, Gr] = d(null), [J, Kr] = d(null);
653
+ return f;
654
+ }, [r, Fr]);
655
+ let [q, Ir] = d(null), [Lr, Rr] = d(null), zr = u(!1), [Br, Vr] = d(!1), [Hr, Ur] = d(!1), [Wr, Gr] = d(null), [Kr, qr] = d(null), [Jr, Yr] = d(0), [Xr, Zr] = d(0), [Qr, $r] = d(null), [ei, ti] = d(null), [J, ni] = d(null);
653
656
  c(() => {
654
- if (yt.current && !yt.current.querySelector("google-cast-launcher")) {
657
+ if (bt.current && !bt.current.querySelector("google-cast-launcher")) {
655
658
  let e = document.createElement("google-cast-launcher");
656
- e.style.cursor = "pointer", e.style.width = "100%", e.style.height = "100%", e.style.display = "block", yt.current.appendChild(e);
659
+ e.style.cursor = "pointer", e.style.width = "100%", e.style.height = "100%", e.style.display = "block", bt.current.appendChild(e);
657
660
  }
658
661
  }, []), c(() => {
659
662
  if (!F) {
660
- jr(!1), Nr(!1), Fr(null);
663
+ Vr(!1), Ur(!1), Gr(null);
661
664
  return;
662
665
  }
663
- let e = (e) => jr(e), t = () => {
666
+ let e = (e) => Vr(e), t = () => {
664
667
  let e = F.getVideoElement(), t = !!e?.webkitCurrentPlaybackTargetIsWireless;
665
- Nr(t), Fr(t ? e.webkitCurrentPlaybackTargetName || "AirPlay device" : null);
668
+ Ur(t), Gr(t ? e.webkitCurrentPlaybackTargetName || "AirPlay device" : null);
666
669
  };
667
670
  e(F.casting.isAirPlayAvailable()), t();
668
671
  let n = F.getVideoElement(), r = (t) => {
@@ -674,28 +677,28 @@ var We = ({ src: r, autoplay: i = !1, muted: a = !1, chapters: s = [], keyMoment
674
677
  "webkitShowPlaybackTargetPicker" in n && (n.removeEventListener("webkitplaybacktargetavailabilitychanged", r), n.removeEventListener("webkitcurrentplaybacktargetiswirelesschanged", i));
675
678
  };
676
679
  }, [F]);
677
- let [qr, Jr] = d(""), [Yr, Xr] = d(!0), [Y, Zr] = d(!1), [Qr, $r] = d(!1), ei = u(!1), ti = u(null), ni = u(!1), ri = u(!1), ii = u("none"), ai = u(m), oi = () => {
678
- Xr(!0), ti.current && window.clearTimeout(ti.current);
679
- let e = zt.current ? 3500 : 1e4;
680
- ti.current = window.setTimeout(() => {
681
- ni.current && ii.current === "none" && Xr(!1);
680
+ let [ri, ii] = d(""), [ai, oi] = d(!0), [Y, si] = d(!1), [ci, li] = d(!1), ui = u(!1), di = u(null), fi = u(!1), pi = u(!1), mi = u("none"), hi = u(h), gi = () => {
681
+ oi(!0), di.current && window.clearTimeout(di.current);
682
+ let e = Ht.current ? 3500 : 1e4;
683
+ di.current = window.setTimeout(() => {
684
+ fi.current && mi.current === "none" && oi(!1);
682
685
  }, e);
683
- }, si = o((e) => {
684
- j.current &&= (clearTimeout(j.current), null);
685
- let t = jt.current, n = t?.[e]?.label ?? "This format", r = t?.[0]?.label ?? "default";
686
- At.current = null, Cr(`${n} isn't supported on this device. Switched to ${r}.`), window.setTimeout(() => Cr(null), 4e3), Mt.current?.(0);
686
+ }, _i = o((e) => {
687
+ Mt.current &&= (clearTimeout(Mt.current), null);
688
+ let t = Pt.current, n = t?.[e]?.label ?? "This format", r = t?.[0]?.label ?? "default";
689
+ Nt.current = null, Nr(`${n} isn't supported on this device. Switched to ${r}.`), window.setTimeout(() => Nr(null), 4e3), Ft.current?.(0);
687
690
  }, []);
688
691
  c(() => {
689
- if (!C.current) return;
692
+ if (!T.current) return;
690
693
  let o = document.createElement("video");
691
- o.muted = !0, o.preload = "metadata", o.crossOrigin = "anonymous", o.style.cssText = "display:none;position:absolute;pointer-events:none;", document.body.appendChild(o), T.current = o;
694
+ o.muted = !0, o.preload = "metadata", o.crossOrigin = "anonymous", o.style.cssText = "display:none;position:absolute;pointer-events:none;", document.body.appendChild(o), gt.current = o;
692
695
  let s = r.includes(".m3u8");
693
696
  if (s && n.isSupported()) {
694
697
  let e = new n({
695
698
  enableWorker: !1,
696
699
  maxBufferLength: 5,
697
700
  xhrSetup: (e, t) => {
698
- let n = ae?.authToken;
701
+ let n = re?.authToken;
699
702
  try {
700
703
  let r = dt(t), i = new URL(r, window.location.origin);
701
704
  n && i.searchParams.set("token", n), e.open("GET", i.toString(), !0);
@@ -704,15 +707,15 @@ var We = ({ src: r, autoplay: i = !1, muted: a = !1, chapters: s = [], keyMoment
704
707
  }
705
708
  }
706
709
  });
707
- e.loadSource(dt(r)), e.attachMedia(o), gt.current = e, e.on(n.Events.MANIFEST_LOADED, (e, t) => {
708
- if (x) return;
709
- let n = Me(t?.networkDetails?.responseText ?? "");
710
- n && Jr(n);
710
+ e.loadSource(dt(r)), e.attachMedia(o), _t.current = e, e.on(n.Events.MANIFEST_LOADED, (e, t) => {
711
+ if (C) return;
712
+ let n = Ae(t?.networkDetails?.responseText ?? "");
713
+ n && ii(n);
711
714
  }), e.on(n.Events.FRAG_PARSING_METADATA, (e, t) => {
712
- if (!(x || qr)) for (let e of t?.samples ?? []) {
713
- let t = y(e.data);
715
+ if (!(C || ri)) for (let e of t?.samples ?? []) {
716
+ let t = je(e.data);
714
717
  if (t) {
715
- Jr(t);
718
+ ii(t);
716
719
  break;
717
720
  }
718
721
  }
@@ -722,76 +725,86 @@ var We = ({ src: r, autoplay: i = !1, muted: a = !1, chapters: s = [], keyMoment
722
725
  let e = ht.current;
723
726
  if (!e) return;
724
727
  let t = e.getContext("2d");
725
- t && o.readyState >= 2 && (t.drawImage(o, 0, 0, e.width, e.height), Ur(e.toDataURL("image/jpeg", .82)));
728
+ t && o.readyState >= 2 && (t.drawImage(o, 0, 0, e.width, e.height), $r(e.toDataURL("image/jpeg", .82)));
726
729
  });
727
730
  let c;
728
- if (oe) {
729
- let t = new e(oe);
731
+ if (ie) {
732
+ let t = new e(ie);
730
733
  ft.current = t, c = t.createCallback();
731
734
  }
732
- if (Yt) return;
735
+ if (Qt) return;
733
736
  let l = new t({
734
- container: C.current,
737
+ container: T.current,
735
738
  src: r,
736
- videoId: se,
739
+ videoId: ae,
737
740
  autoplay: i,
738
741
  muted: a,
739
742
  keyMoments: W,
740
- subtitles: m,
743
+ subtitles: h,
741
744
  drm: {
742
- watermarkText: ie,
745
+ watermarkText: g,
743
746
  allowedDomains: [
744
747
  "localhost",
745
748
  "127.0.0.1",
746
749
  window.location.hostname
747
750
  ],
748
- ...ae
751
+ ...re
749
752
  },
750
753
  analyticsCallback: (e) => {
751
- if (e.sessionId && (Mn.current === null ? Mn.current = e.sessionId : e.sessionId !== Mn.current && (e = {
754
+ if (e.sessionId && (Fn.current === null ? Fn.current = e.sessionId : e.sessionId !== Fn.current && (e = {
752
755
  ...e,
753
- sessionId: Mn.current
756
+ sessionId: Fn.current
754
757
  })), e.eventType === "session_start") {
755
- if (Nn.current) return;
756
- Nn.current = !0;
758
+ if (In.current) return;
759
+ In.current = !0;
757
760
  }
758
- c?.(e), ce && ce(e);
761
+ c?.(e), oe && oe(e);
759
762
  },
760
- analyticsSessionSeed: Pn.current?.key === Dn ? Pn.current.snapshot : void 0,
763
+ analyticsSessionSeed: Ln.current?.key === An ? Ln.current.snapshot : void 0,
761
764
  watchProgressInterval: Ye * 1e3,
762
- themeColor: h,
765
+ themeColor: _,
763
766
  urlTransformer: tt
764
767
  });
765
768
  l.on("keymomentsloaded", (e) => {
766
- pr(e), ue && ue(e);
769
+ Cr(e), ce && ce(e);
767
770
  }), l.on("chaptersloaded", (e) => {
768
- pr(e), ue && ue(e);
771
+ Cr(e), ce && ce(e);
769
772
  }), l.on("play", () => {
770
- tn(!0), wn(!1), te(l.getCurrentTime(), !1);
773
+ an(!0), Dn(!1), ee(l.getCurrentTime(), !1);
771
774
  }), l.on("pause", () => {
772
- tn(!1), te(l.getCurrentTime(), !0);
775
+ an(!1), ee(l.getCurrentTime(), !0);
773
776
  }), l.on("ended", () => {
774
- tn(!1), wn(!0);
777
+ an(!1), Dn(!0);
775
778
  });
776
779
  let u = () => {
777
- xt.current = !0, dn(!1), A.current && (A.current.style.opacity = "1"), Ct(l.getVideoElement());
780
+ St.current = !0, mn(!1), j.current && (j.current.style.opacity = "1"), wt(l.getVideoElement());
778
781
  }, d = () => {
779
782
  requestAnimationFrame(() => {
780
783
  requestAnimationFrame(() => {
781
- xt.current = !1, A.current && (A.current.style.opacity = "0"), wt(l.getVideoElement());
784
+ St.current = !1, j.current && (j.current.style.opacity = "0"), Tt(l.getVideoElement());
782
785
  let e = l.getVideoElement();
783
- e && !e.paused && e.readyState < 3 && dn(!0);
786
+ e && !e.paused && e.readyState < 3 && mn(!0);
784
787
  });
785
788
  });
786
- }, ee = (e, t = !1) => {
787
- E.current = !0;
788
- let n = t ? e + .5 : Dt.current ?? e + .5;
789
- t || (Dt.current = null), Et.current = t, D.current = n, O.current = l.getCurrentTime(), u(), l.seek(n), k.current && window.clearTimeout(k.current), k.current = window.setTimeout(() => {
790
- E.current = !1, D.current = null, O.current = null, k.current = null, Et.current = !1, d();
789
+ }, f = (e, t = !1) => {
790
+ D.current = !0;
791
+ let n = t ? e + .5 : Ot.current ?? e + .5;
792
+ t || (Ot.current = null), Dt.current = t, O.current = n, k.current = l.getCurrentTime(), u(), l.seek(n);
793
+ let r = l.getVideoElement();
794
+ if (r) {
795
+ let e = () => {
796
+ r.removeEventListener("seeked", e), A.current &&= (window.clearTimeout(A.current), null), D.current = !1, O.current = null, k.current = null;
797
+ let t = Dt.current;
798
+ Dt.current = !1, (t || Ot.current === null) && d();
799
+ };
800
+ r.addEventListener("seeked", e);
801
+ }
802
+ A.current && window.clearTimeout(A.current), A.current = window.setTimeout(() => {
803
+ D.current = !1, O.current = null, k.current = null, A.current = null, Dt.current = !1, d();
791
804
  }, 3e3);
792
805
  };
793
- Tt.current = ee;
794
- let te = (e, t) => {
806
+ Et.current = f;
807
+ let ee = (e, t) => {
795
808
  if (!("mediaSession" in navigator) || !navigator.mediaSession.setPositionState) return;
796
809
  navigator.mediaSession.playbackState = t ? "paused" : "playing";
797
810
  let n = l.getDuration(), r = z.current.find((t) => e >= t.startTime && e < t.endTime);
@@ -819,147 +832,175 @@ var We = ({ src: r, autoplay: i = !1, muted: a = !1, chapters: s = [], keyMoment
819
832
  }
820
833
  };
821
834
  if (l.on("timeupdate", (e) => {
822
- if (!E.current && N.current === null) {
823
- let t = z.current.find((t) => En.current.has(t.startTime) && e >= t.startTime - .5 && e < t.endTime);
835
+ if (!D.current && N.current === null) {
836
+ let t = z.current.find((t) => kn.current.has(t.startTime) && e >= t.startTime - .5 && e < t.endTime);
824
837
  if (t) {
825
- ee(t.endTime);
838
+ f(t.endTime);
826
839
  return;
827
840
  }
828
- Dt.current !== null && z.current.find((t) => e >= t.endTime - .5 && e < t.endTime) && u();
841
+ Ot.current !== null && z.current.find((t) => e >= t.endTime - .5 && e < t.endTime) && u();
829
842
  }
830
- if (E.current && D.current !== null) {
831
- let t = D.current;
832
- if (O.current !== null && t < O.current ? e <= t + 2 && e >= t - 2 : e >= t - 2) {
833
- E.current = !1, D.current = null, O.current = null, k.current &&= (window.clearTimeout(k.current), null);
834
- let t = z.current.some((t) => e >= t.startTime && e < t.endTime), n = Et.current;
835
- Et.current = !1, (n || !t && Dt.current === null) && d();
843
+ if (D.current && O.current !== null) {
844
+ let t = O.current;
845
+ if (k.current !== null && t < k.current ? e <= t + 2 && e >= t - 2 : e >= t - 2) {
846
+ D.current = !1, O.current = null, k.current = null, A.current &&= (window.clearTimeout(A.current), null);
847
+ let t = z.current.some((t) => e >= t.startTime && e < t.endTime), n = Dt.current;
848
+ Dt.current = !1, (n || !t && Ot.current === null) && d();
836
849
  } else return;
837
850
  }
838
- nn(e), Ft.current = e;
851
+ on(e), Rt.current = e;
839
852
  let t = l.getDuration();
840
- if (an(t), N.current !== null && e >= N.current - 2) {
853
+ if (cn(t), N.current !== null && e >= N.current - 2) {
841
854
  N.current = null, P.current &&= (window.clearTimeout(P.current), null);
842
- let t = z.current.find((t) => En.current.has(t.startTime) && e >= t.startTime && e < t.endTime);
843
- t && ee(t.endTime), requestAnimationFrame(() => {
855
+ let t = z.current.find((t) => kn.current.has(t.startTime) && e >= t.startTime && e < t.endTime);
856
+ t && f(t.endTime), requestAnimationFrame(() => {
844
857
  requestAnimationFrame(() => {
845
858
  M.current && (M.current.style.opacity = "0");
846
859
  });
847
860
  });
848
861
  }
849
- if (!Nt.current && kt.current === null && lt && lt > 0 && t > 0 && lt < t) {
850
- Nt.current = !0;
862
+ if (!It.current && At.current === null && lt && lt > 0 && t > 0 && lt < t) {
863
+ It.current = !0;
851
864
  let e = z.current.find((e) => lt >= e.startTime && lt < e.endTime), t = e ? e.startTime : lt;
852
- Pt.current = e ? null : lt, N.current = t, l.seek(t), P.current && window.clearTimeout(P.current), P.current = window.setTimeout(() => {
865
+ Lt.current = e ? null : lt, N.current = t, l.seek(t), P.current && window.clearTimeout(P.current), P.current = window.setTimeout(() => {
853
866
  N.current = null, P.current = null, M.current && (M.current.style.opacity = "0");
854
867
  }, 4e3);
855
868
  }
856
- if (ut?.(e), Vn.current.length > 0) if (Hn.current) {
857
- let t = Hn.current;
858
- (e >= t.startTimeSeconds + t.durationSeconds || e < t.startTimeSeconds) && (Bn(null), Hn.current = null);
869
+ if (ut?.(e), Wn.current.length > 0) if (Gn.current) {
870
+ let t = Gn.current;
871
+ (e >= t.startTimeSeconds + t.durationSeconds || e < t.startTimeSeconds) && (Un(null), Gn.current = null);
859
872
  } else {
860
- let t = Vn.current.find((t) => e >= t.startTimeSeconds && e < t.startTimeSeconds + t.durationSeconds && !Un.current.has(t.availId));
861
- t && (Bn(t), Hn.current = t, t.impressionBeacons.forEach((e) => {
873
+ let t = Wn.current.find((t) => e >= t.startTimeSeconds && e < t.startTimeSeconds + t.durationSeconds && !Kn.current.has(t.availId));
874
+ t && (Un(t), Gn.current = t, t.impressionBeacons.forEach((e) => {
862
875
  fetch(e, { mode: "no-cors" }).catch(() => {});
863
876
  }));
864
877
  }
865
878
  let n = l.keyMoments.getCurrentMoment(e);
866
- fr({
879
+ Sr({
867
880
  chapter: n.keyMoment,
868
881
  index: n.index
869
- }), te(e, l.getVideoElement().paused);
882
+ }), ee(e, l.getVideoElement().paused);
870
883
  }), l.on("qualitylevels", (e) => {
871
- $n(e);
884
+ lr(e);
885
+ let t = jt.current;
886
+ if (!t) return;
887
+ let n = t.qualityHeight === null ? void 0 : e.find((e) => e.height === t.qualityHeight);
888
+ n ? (l.setQuality(n.id), dr(n)) : dr({
889
+ id: -1,
890
+ height: 0,
891
+ width: 0,
892
+ bitrate: 0,
893
+ label: "Auto"
894
+ });
872
895
  }), l.on("qualitychange", (e) => {
873
- tr(e);
896
+ dr(e);
874
897
  }), l.on("buffering", (e) => {
875
- if (dn(e && !xt.current), !e && (j.current &&= (clearTimeout(j.current), null), At.current = null, kt.current !== null)) {
876
- let e = kt.current;
877
- kt.current = null, Nt.current = !0, N.current = e, P.current && window.clearTimeout(P.current), P.current = window.setTimeout(() => {
878
- N.current = null, P.current = null, M.current && (M.current.style.opacity = "0");
879
- }, 4e3), l.seek(e);
898
+ if (mn(e && !St.current), !e) {
899
+ Mt.current &&= (clearTimeout(Mt.current), null), Nt.current = null;
900
+ let e = jt.current;
901
+ if (e && (jt.current = null, e.playbackRate !== 1 && l.setPlaybackRate(e.playbackRate), l.setVolume(e.volume), l.setMute(e.muted)), At.current !== null) {
902
+ let e = At.current;
903
+ At.current = null, It.current = !0, N.current = e, P.current && window.clearTimeout(P.current), P.current = window.setTimeout(() => {
904
+ N.current = null, P.current = null, M.current && (M.current.style.opacity = "0");
905
+ }, 4e3), l.seek(e);
906
+ }
880
907
  }
881
908
  }), l.on("adbreakchange", (e) => {
882
- if (l.analytics.setAdBreak(e, l.getVideoElement()), le && le(e), e) {
909
+ if (l.analytics.setAdBreak(e, l.getVideoElement()), se && se(e), e) {
883
910
  let e = l.getCurrentTime(), t = z.current.find((t) => e >= t.startTime && e < t.endTime);
884
- if (ei.current = !1, $r(!1), t && En.current.has(t.startTime)) {
885
- u(), E.current || ee(t.endTime);
911
+ if (ui.current = !1, li(!1), t && kn.current.has(t.startTime)) {
912
+ u(), D.current || f(t.endTime);
886
913
  return;
887
914
  }
888
- t && (Fn.current = t.startTime), Zr(!0), K("none"), d();
889
- } else if (Fn.current !== null && (En.current.add(Fn.current), kn(new Set(En.current)), Fn.current = null), Zr(!1), Dt.current !== null) {
890
- let e = Dt.current;
891
- Dt.current = null, E.current = !0, D.current = e, O.current = l.getCurrentTime(), u(), l.seek(e), k.current && window.clearTimeout(k.current), k.current = window.setTimeout(() => {
892
- E.current = !1, D.current = null, O.current = null, k.current = null, d();
915
+ t && (Rn.current = t.startTime), si(!0), K("none"), d();
916
+ } else if (Rn.current !== null && (kn.current.add(Rn.current), Mn(new Set(kn.current)), Rn.current = null), si(!1), Ot.current !== null) {
917
+ let e = Ot.current;
918
+ Ot.current = null, D.current = !0, O.current = e, k.current = l.getCurrentTime(), u(), l.seek(e), A.current && window.clearTimeout(A.current), A.current = window.setTimeout(() => {
919
+ D.current = !1, O.current = null, k.current = null, A.current = null, d();
893
920
  }, 3e3);
894
921
  }
895
922
  }), l.on("adbreaksloaded", (e) => {
896
- z.current = e, Tn(e);
897
- let t = Pt.current;
923
+ z.current = e, On(e);
924
+ let t = Lt.current;
898
925
  if (t === null) return;
899
- Pt.current = null;
926
+ Lt.current = null;
900
927
  let n = e.find((e) => t >= e.startTime && t < e.endTime);
901
- if (!n || En.current.has(n.startTime)) return;
928
+ if (!n || kn.current.has(n.startTime)) return;
902
929
  let r = l.getCurrentTime();
903
930
  r < n.startTime || r >= n.endTime || (M.current && (M.current.style.opacity = "1"), N.current = n.startTime, P.current && window.clearTimeout(P.current), P.current = window.setTimeout(() => {
904
931
  N.current = null, P.current = null, M.current && (M.current.style.opacity = "0");
905
932
  }, 4e3), l.seek(n.startTime));
906
933
  }), l.on("volumechange", (e) => {
907
- sn(e.volume), St.current === null && ln(e.muted);
934
+ un(e.volume), Ct.current === null && fn(e.muted);
908
935
  }), l.on("pipchange", (e) => {
909
- bn(e);
936
+ Cn(e);
910
937
  }), l.on("error", () => {
911
- Zt(!0), dn(!1), N.current = null, P.current &&= (window.clearTimeout(P.current), null), M.current && (M.current.style.opacity = "0");
938
+ en(!0), mn(!1), N.current = null, P.current &&= (window.clearTimeout(P.current), null), M.current && (M.current.style.opacity = "0");
912
939
  }), l.on("unsupportedcodec", () => {
913
- let e = At.current;
914
- e && e.targetIdx !== 0 && (jt.current?.length ?? 0) > 1 && si(e.targetIdx);
940
+ let e = Nt.current;
941
+ e && e.targetIdx !== 0 && (Pt.current?.length ?? 0) > 1 && _i(e.targetIdx);
915
942
  }), l.subtitles.onSubtitleChange((e) => {
916
- rr(e);
943
+ pr(e);
917
944
  }), l.on("subtitlesloaded", (e) => {
918
945
  if (!I.enableSubtitles) return;
919
- or(Re([...e]));
920
- let t = e.find((e) => e.isDefault);
921
- t && (l.subtitles.setActiveTrack(t.id), ir(t.id));
946
+ gr(Le([...e]));
947
+ let t = jt.current;
948
+ if (t) {
949
+ let n = t.subtitleId === "off" ? "off" : e.find((e) => e.id === t.subtitleId)?.id ?? (t.subtitleLang ? e.find((e) => e.lang === t.subtitleLang)?.id : void 0);
950
+ if (n) {
951
+ l.subtitles.setActiveTrack(n), mr(n);
952
+ return;
953
+ }
954
+ }
955
+ let n = e.find((e) => e.isDefault);
956
+ n && (l.subtitles.setActiveTrack(n.id), mr(n.id));
922
957
  }), l.on("audiotracksloaded", (e) => {
923
- cr(e), ur(e[0]?.id ?? 0);
958
+ vr(e);
959
+ let t = jt.current, n = t ? e.find((e) => t.audioLang && e.lang === t.audioLang) ?? e.find((e) => t.audioLabel && e.label === t.audioLabel) : void 0;
960
+ if (n) {
961
+ l.setAudioTrack(n.id), br(n.id);
962
+ return;
963
+ }
964
+ br(e[0]?.id ?? 0);
924
965
  }), l.on("audiotrackchange", (e) => {
925
- ur(e);
966
+ br(e);
926
967
  }), l.casting.onCastStateChange((e, t) => {
927
968
  if (e) {
928
- kr.current = l.isMuted(), l.pause();
969
+ zr.current = l.isMuted(), l.pause();
929
970
  let e = l.getVideoElement();
930
- e.muted = !0, Er(t);
971
+ e.muted = !0, Ir(t);
931
972
  } else {
932
973
  let e = l.casting.getRemoteState();
933
- e && e.currentTime > 0 && (E.current = !0, D.current = e.currentTime, O.current = l.getCurrentTime(), l.seek(e.currentTime), k.current && window.clearTimeout(k.current), k.current = window.setTimeout(() => {
934
- E.current = !1, D.current = null, O.current = null, k.current = null;
974
+ e && e.currentTime > 0 && (D.current = !0, O.current = e.currentTime, k.current = l.getCurrentTime(), l.seek(e.currentTime), A.current && window.clearTimeout(A.current), A.current = window.setTimeout(() => {
975
+ D.current = !1, O.current = null, k.current = null, A.current = null;
935
976
  }, 3e3));
936
977
  let t = l.getVideoElement();
937
- t.muted = kr.current, Er(null), Or(null);
978
+ t.muted = zr.current, Ir(null), Rr(null);
938
979
  }
939
980
  }), l.casting.onRemoteStateChange((e) => {
940
- Or(e);
941
- }), sn(l.getVolume()), ln(l.isMuted()), "mediaSession" in navigator) try {
981
+ Rr(e);
982
+ }), un(l.getVolume()), fn(l.isMuted()), "mediaSession" in navigator) try {
942
983
  navigator.mediaSession.setActionHandler("seekto", (e) => {
943
- if (e.seekTime == null || ri.current || ei.current) return;
984
+ if (e.seekTime == null || pi.current || ui.current) return;
944
985
  let t = e.seekTime;
945
986
  for (let e of z.current) t >= e.startTime && (t += e.endTime - e.startTime);
946
- Ot.current?.(t);
987
+ kt.current?.(t);
947
988
  });
948
989
  let e = (e, t) => {
949
- if (ri.current || ei.current) return;
990
+ if (pi.current || ui.current) return;
950
991
  let n = t && t > 0 ? t : 10, r = l.getCurrentTime(), i = r;
951
992
  for (let e of z.current) r >= e.endTime ? i -= e.endTime - e.startTime : r >= e.startTime && (i -= r - e.startTime);
952
993
  if (e) {
953
994
  let e = z.current.reduce((e, t) => e + (t.endTime - t.startTime), 0), t = Math.max(0, l.getDuration() - e), r = Math.min(t, i + n);
954
995
  for (let e of z.current) r >= e.startTime && (r += e.endTime - e.startTime);
955
- Ot.current?.(r, {
996
+ kt.current?.(r, {
956
997
  eventType: "fast_forward",
957
998
  skipSeconds: n
958
999
  });
959
1000
  } else {
960
1001
  let e = Math.max(0, i - n);
961
1002
  for (let t of z.current) e >= t.startTime && (e += t.endTime - t.startTime);
962
- Ot.current?.(e, {
1003
+ kt.current?.(e, {
963
1004
  eventType: "fast_backward",
964
1005
  skipSeconds: n
965
1006
  });
@@ -967,34 +1008,34 @@ var We = ({ src: r, autoplay: i = !1, muted: a = !1, chapters: s = [], keyMoment
967
1008
  };
968
1009
  navigator.mediaSession.setActionHandler("seekforward", (t) => e(!0, t.seekOffset ?? void 0)), navigator.mediaSession.setActionHandler("seekbackward", (t) => e(!1, t.seekOffset ?? void 0));
969
1010
  } catch {}
970
- let f = l.getVideoElement(), p = () => {
971
- if (!(document.pictureInPictureElement === f || f.webkitPresentationMode === "picture-in-picture") || E.current || N.current !== null || kt.current !== null) return;
972
- let e = f.currentTime, t = Ft.current;
1011
+ let p = l.getVideoElement(), m = () => {
1012
+ if (!(document.pictureInPictureElement === p || p.webkitPresentationMode === "picture-in-picture") || D.current || N.current !== null || At.current !== null) return;
1013
+ let e = p.currentTime, t = Rt.current;
973
1014
  if (!(Math.abs(e - t) < .5)) {
974
- if (ri.current) {
975
- f.currentTime = t;
1015
+ if (pi.current) {
1016
+ p.currentTime = t;
976
1017
  return;
977
1018
  }
978
- f.currentTime = t, Ot.current?.(e);
1019
+ p.currentTime = t, kt.current?.(e);
979
1020
  }
980
1021
  };
981
- f.addEventListener("seeking", p), Ut(l);
982
- let ne = At.current;
983
- ne && ne.targetIdx !== 0 && (j.current && clearTimeout(j.current), j.current = setTimeout(() => {
984
- j.current = null, !l.getBufferedRanges().some((e) => e.end > e.start) && si(ne.targetIdx);
985
- }, ke)), kt.current !== null && (P.current && window.clearTimeout(P.current), P.current = window.setTimeout(() => {
986
- P.current = null, N.current = null, M.current && (M.current.style.opacity = "0"), dn(!1);
987
- }, 12e3)), Je && C.current && (pt.current = !0, C.current.requestFullscreen().catch(() => {
1022
+ p.addEventListener("seeking", m), Kt(l);
1023
+ let te = Nt.current;
1024
+ te && te.targetIdx !== 0 && (Mt.current && clearTimeout(Mt.current), Mt.current = setTimeout(() => {
1025
+ Mt.current = null, !l.getBufferedRanges().some((e) => e.end > e.start) && _i(te.targetIdx);
1026
+ }, De)), At.current !== null && (P.current && window.clearTimeout(P.current), P.current = window.setTimeout(() => {
1027
+ P.current = null, N.current = null, M.current && (M.current.style.opacity = "0"), mn(!1);
1028
+ }, 12e3)), Je && T.current && (pt.current = !0, T.current.requestFullscreen().catch(() => {
988
1029
  pt.current = !1;
989
1030
  }));
990
- let re = () => {
1031
+ let ne = () => {
991
1032
  let e = document, t = !!(document.fullscreenElement || e.webkitFullscreenElement);
992
- pn(t), t || hn(!1);
1033
+ gn(t), t || vn(!1);
993
1034
  let n = l.getVideoElement();
994
1035
  l.analytics.track(t ? "fullscreen_enter" : "fullscreen_exit", n);
995
1036
  };
996
- document.addEventListener("fullscreenchange", re), document.addEventListener("webkitfullscreenchange", re);
997
- let g = (e) => {
1037
+ document.addEventListener("fullscreenchange", ne), document.addEventListener("webkitfullscreenchange", ne);
1038
+ let v = (e) => {
998
1039
  let t = document.activeElement;
999
1040
  if (!(t && (t.tagName === "INPUT" || t.tagName === "TEXTAREA" || t.getAttribute("contenteditable") === "true" || t.getAttribute("role") === "slider"))) {
1000
1041
  switch (e.key.toLowerCase()) {
@@ -1007,19 +1048,19 @@ var We = ({ src: r, autoplay: i = !1, muted: a = !1, chapters: s = [], keyMoment
1007
1048
  let e = l.getVideoElement();
1008
1049
  e && !e.paused && e.pause();
1009
1050
  } catch {}
1010
- if (T.current && !T.current.paused) try {
1011
- T.current.pause();
1051
+ if (gt.current && !gt.current.paused) try {
1052
+ gt.current.pause();
1012
1053
  } catch {}
1013
1054
  }
1014
1055
  break;
1015
1056
  case "arrowleft":
1016
1057
  case "j":
1017
- if (e.preventDefault(), !ri.current) {
1058
+ if (e.preventDefault(), !pi.current) {
1018
1059
  let e = l.getCurrentTime(), t = e;
1019
1060
  for (let n of z.current) e >= n.endTime ? t -= n.endTime - n.startTime : e >= n.startTime && (t -= e - n.startTime);
1020
1061
  let n = Math.max(0, t - 10);
1021
1062
  for (let e of z.current) n >= e.startTime && (n += e.endTime - e.startTime);
1022
- Ot.current?.(n, {
1063
+ kt.current?.(n, {
1023
1064
  eventType: "fast_backward",
1024
1065
  skipSeconds: 10
1025
1066
  });
@@ -1027,12 +1068,12 @@ var We = ({ src: r, autoplay: i = !1, muted: a = !1, chapters: s = [], keyMoment
1027
1068
  break;
1028
1069
  case "arrowright":
1029
1070
  case "l":
1030
- if (e.preventDefault(), !ri.current) {
1071
+ if (e.preventDefault(), !pi.current) {
1031
1072
  let e = l.getCurrentTime(), t = z.current.reduce((e, t) => e + (t.endTime - t.startTime), 0), n = Math.max(0, l.getDuration() - t), r = e;
1032
1073
  for (let t of z.current) e >= t.endTime ? r -= t.endTime - t.startTime : e >= t.startTime && (r -= e - t.startTime);
1033
1074
  let i = Math.min(n, r + 10);
1034
1075
  for (let e of z.current) i >= e.startTime && (i += e.endTime - e.startTime);
1035
- Ot.current?.(i, {
1076
+ kt.current?.(i, {
1036
1077
  eventType: "fast_forward",
1037
1078
  skipSeconds: 10
1038
1079
  });
@@ -1048,32 +1089,32 @@ var We = ({ src: r, autoplay: i = !1, muted: a = !1, chapters: s = [], keyMoment
1048
1089
  e.preventDefault(), l.setMute(!l.isMuted());
1049
1090
  break;
1050
1091
  case "f":
1051
- e.preventDefault(), bt.current();
1092
+ e.preventDefault(), xt.current();
1052
1093
  break;
1053
1094
  case "p":
1054
- e.preventDefault(), ri.current || l.togglePictureInPicture();
1095
+ e.preventDefault(), pi.current || l.togglePictureInPicture();
1055
1096
  break;
1056
1097
  case "c":
1057
- if (e.preventDefault(), I.enableSubtitles && !ri.current) if (l.subtitles.getActiveTrackId() !== "off") l.subtitles.setActiveTrack("off"), ir("off");
1098
+ if (e.preventDefault(), I.enableSubtitles && !pi.current) if (l.subtitles.getActiveTrackId() !== "off") l.subtitles.setActiveTrack("off"), mr("off");
1058
1099
  else {
1059
- let e = ai.current;
1060
- e && e.length > 0 && (l.subtitles.setActiveTrack(e[0].id), ir(e[0].id));
1100
+ let e = hi.current;
1101
+ e && e.length > 0 && (l.subtitles.setActiveTrack(e[0].id), mr(e[0].id));
1061
1102
  }
1062
1103
  break;
1063
1104
  default: return;
1064
1105
  }
1065
- oi();
1106
+ gi();
1066
1107
  }
1067
1108
  };
1068
- return document.addEventListener("keydown", g), oi(), () => {
1069
- if (Pn.current = {
1070
- key: Dn,
1109
+ return document.addEventListener("keydown", v), gi(), () => {
1110
+ if (Ln.current = {
1111
+ key: An,
1071
1112
  snapshot: l.analytics.getSessionSnapshot()
1072
- }, It.current) {
1073
- let e = It.current, t = l.getVideoElement();
1074
- C.current && t.ownerDocument !== document && (t.classList.remove("gb-pip-video"), C.current.insertBefore(t, C.current.firstChild)), It.current = null, Sn(null), bn(!1), e.close();
1113
+ }, zt.current) {
1114
+ let e = zt.current, t = l.getVideoElement();
1115
+ T.current && t.ownerDocument !== document && (t.classList.remove("gb-pip-video"), T.current.insertBefore(t, T.current.firstChild)), zt.current = null, Tn(null), Cn(!1), e.close();
1075
1116
  }
1076
- if (l.destroy(), ft.current?.destroy(), ft.current = null, document.body.style.overflow = "", document.body.style.touchAction = "", document.removeEventListener("fullscreenchange", re), document.removeEventListener("webkitfullscreenchange", re), document.removeEventListener("keydown", g), ti.current && window.clearTimeout(ti.current), k.current &&= (window.clearTimeout(k.current), null), j.current &&= (clearTimeout(j.current), null), xt.current = !1, A.current && (A.current.style.opacity = "0"), f.removeEventListener("seeking", p), "mediaSession" in navigator) {
1117
+ if (l.destroy(), ft.current?.destroy(), ft.current = null, document.body.style.overflow = "", document.body.style.touchAction = "", document.removeEventListener("fullscreenchange", ne), document.removeEventListener("webkitfullscreenchange", ne), document.removeEventListener("keydown", v), di.current && window.clearTimeout(di.current), A.current &&= (window.clearTimeout(A.current), null), Mt.current &&= (clearTimeout(Mt.current), null), St.current = !1, j.current && (j.current.style.opacity = "0"), p.removeEventListener("seeking", m), "mediaSession" in navigator) {
1077
1118
  try {
1078
1119
  navigator.mediaSession.setActionHandler("seekto", null);
1079
1120
  } catch {}
@@ -1084,25 +1125,25 @@ var We = ({ src: r, autoplay: i = !1, muted: a = !1, chapters: s = [], keyMoment
1084
1125
  navigator.mediaSession.setActionHandler("seekbackward", null);
1085
1126
  } catch {}
1086
1127
  }
1087
- gt.current &&= (gt.current.destroy(), null), T.current &&= (document.body.removeChild(T.current), null), Nt.current = !1, N.current = null, P.current &&= (window.clearTimeout(P.current), null);
1128
+ _t.current &&= (_t.current.destroy(), null), gt.current &&= (document.body.removeChild(gt.current), null), It.current = !1, N.current = null, P.current &&= (window.clearTimeout(P.current), null);
1088
1129
  };
1089
1130
  }, [
1090
1131
  r,
1091
- ie,
1092
- Qt
1132
+ g,
1133
+ tn
1093
1134
  ]), c(() => {
1094
1135
  if (F) {
1095
1136
  F.keyMoments.setKeyMoments(W);
1096
- let e = C.current?.querySelector("video");
1137
+ let e = T.current?.querySelector("video");
1097
1138
  if (e) {
1098
1139
  let t = F.keyMoments.getCurrentMoment(e.currentTime);
1099
- fr({
1140
+ Sr({
1100
1141
  chapter: t.keyMoment,
1101
1142
  index: t.index
1102
1143
  });
1103
1144
  }
1104
1145
  }
1105
- }, [Tr, F]), c(() => {
1146
+ }, [Fr, F]), c(() => {
1106
1147
  let e = (e) => {
1107
1148
  G !== "none" && (e.target.closest(".sdk-menu-container") || K("none"));
1108
1149
  };
@@ -1110,17 +1151,17 @@ var We = ({ src: r, autoplay: i = !1, muted: a = !1, chapters: s = [], keyMoment
1110
1151
  document.removeEventListener("click", e);
1111
1152
  };
1112
1153
  }, [G]), c(() => {
1113
- ni.current = en;
1114
- }, [en]), c(() => {
1115
- ri.current = Y;
1154
+ fi.current = rn;
1155
+ }, [rn]), c(() => {
1156
+ pi.current = Y;
1116
1157
  }, [Y]), c(() => {
1117
- ei.current = Qr;
1118
- }, [Qr]);
1119
- let X = Y || Qr;
1158
+ ui.current = ci;
1159
+ }, [ci]);
1160
+ let X = Y || ci;
1120
1161
  c(() => {
1121
- It.current = xn;
1122
- }, [xn]), c(() => {
1123
- ii.current = G;
1162
+ zt.current = wn;
1163
+ }, [wn]), c(() => {
1164
+ mi.current = G;
1124
1165
  }, [G]), c(() => {
1125
1166
  if (!Y || !F) return;
1126
1167
  let e = 0, t = F.getCurrentTime(), n = performance.now(), r = () => {
@@ -1130,10 +1171,10 @@ var We = ({ src: r, autoplay: i = !1, muted: a = !1, chapters: s = [], keyMoment
1130
1171
  let e = i.playbackRate || 1;
1131
1172
  s = t + (o - n) / 1e3 * e;
1132
1173
  } else s = t;
1133
- let c = Yn(a);
1174
+ let c = ar(a);
1134
1175
  if (c) {
1135
1176
  let e = Math.min(s, a + .4, c.end), t = Math.min(100, Math.max(0, (e - c.start) / (c.end - c.start) * 100));
1136
- (C.current?.querySelectorAll(".sdk-ad-progress-fill"))?.forEach((e) => {
1177
+ (T.current?.querySelectorAll(".sdk-ad-progress-fill"))?.forEach((e) => {
1137
1178
  e.style.width = `${t}%`;
1138
1179
  });
1139
1180
  }
@@ -1141,38 +1182,53 @@ var We = ({ src: r, autoplay: i = !1, muted: a = !1, chapters: s = [], keyMoment
1141
1182
  };
1142
1183
  return e = requestAnimationFrame(r), () => cancelAnimationFrame(e);
1143
1184
  }, [Y, F]), c(() => {
1144
- ai.current = ar;
1145
- }, [ar]), c(() => {
1146
- zt.current = Lt;
1147
- }, [Lt]), c(() => {
1185
+ hi.current = hr;
1186
+ }, [hr]), c(() => {
1187
+ Ht.current = Bt;
1188
+ }, [Bt]), c(() => {
1148
1189
  z.current = R;
1149
1190
  }, [R]), c(() => {
1150
- Vn.current = Ln;
1151
- }, [Ln]), c(() => {
1152
- Hn.current = zn;
1153
- }, [zn]), c(() => {
1154
- Kn.current = Wn;
1155
- }, [Wn]), c(() => {
1156
- jt.current = S;
1157
- }, [S]), c(() => {
1158
- Mt.current = ct;
1191
+ Wn.current = Bn;
1192
+ }, [Bn]), c(() => {
1193
+ Gn.current = Hn;
1194
+ }, [Hn]), c(() => {
1195
+ Yn.current = qn;
1196
+ }, [qn]), c(() => {
1197
+ ir.current = L;
1198
+ }, [L]), c(() => {
1199
+ Pt.current = w;
1200
+ }, [w]), c(() => {
1201
+ let e = Xn.current;
1202
+ if (!Y || !e || typeof ResizeObserver > "u") return;
1203
+ let t = () => {
1204
+ let t = e.getBoundingClientRect();
1205
+ Qn((e) => e.w === t.width && e.h === t.height ? e : {
1206
+ w: t.width,
1207
+ h: t.height
1208
+ });
1209
+ };
1210
+ t();
1211
+ let n = new ResizeObserver(t);
1212
+ return n.observe(e), () => n.disconnect();
1213
+ }, [Y, qn]), c(() => {
1214
+ Ft.current = ct;
1159
1215
  }, [ct]), c(() => {
1160
- Fn.current = null, In.current = !1, Dt.current = null, Pt.current = null, Bn(null), Hn.current = null, Un.current = /* @__PURE__ */ new Set(), Zt(!1);
1216
+ Rn.current = null, zn.current = !1, Ot.current = null, Lt.current = null, Un(null), Gn.current = null, Kn.current = /* @__PURE__ */ new Set(), en(!1);
1161
1217
  }, [r]), c(() => {
1162
- Gt(!1);
1218
+ Jt(!1);
1163
1219
  }, [r]), c(() => {
1164
1220
  if (!F) return;
1165
1221
  let e = F.getVideoElement();
1166
1222
  if (e && e.readyState >= 1) {
1167
- Gt(!0);
1223
+ Jt(!0);
1168
1224
  return;
1169
1225
  }
1170
- let t = () => Gt(!0);
1226
+ let t = () => Jt(!0);
1171
1227
  return F.on("qualitylevels", t), e?.addEventListener("loadedmetadata", t), () => {
1172
1228
  F.off("qualitylevels", t), e?.removeEventListener("loadedmetadata", t);
1173
1229
  };
1174
1230
  }, [F]), c(() => {
1175
- if (Rn([]), !(!at || !Wt)) return Ue(at, (e) => {
1231
+ if (Vn([]), !(!at || !qt)) return We(at, (e) => {
1176
1232
  let t = /* @__PURE__ */ new Set(), n = [];
1177
1233
  for (let r of e.nonLinearAvails ?? []) {
1178
1234
  if (t.has(r.availId)) continue;
@@ -1186,13 +1242,13 @@ var We = ({ src: r, autoplay: i = !1, muted: a = !1, chapters: s = [], keyMoment
1186
1242
  let s = o.position ?? "bottom_center";
1187
1243
  n.push({
1188
1244
  availId: r.availId,
1189
- startTimeSeconds: ze(r.startTime ?? ""),
1190
- durationSeconds: ze(i.minSuggestedDuration ?? "00:00:15"),
1245
+ startTimeSeconds: Re(r.startTime ?? ""),
1246
+ durationSeconds: Re(i.minSuggestedDuration ?? "00:00:15"),
1191
1247
  imageUrl: i.staticResource,
1192
1248
  imageWidth: parseInt(i.width ?? "320", 10),
1193
1249
  imageHeight: parseInt(i.height ?? "50", 10),
1194
1250
  title: i.adTitle ?? "",
1195
- clickThrough: Be(i.clickThrough) ? i.clickThrough : "",
1251
+ clickThrough: ze(i.clickThrough) ? i.clickThrough : "",
1196
1252
  clickTrackingUrl: i.clickTracking ?? "",
1197
1253
  impressionBeacons: a,
1198
1254
  position: s,
@@ -1200,13 +1256,15 @@ var We = ({ src: r, autoplay: i = !1, muted: a = !1, chapters: s = [], keyMoment
1200
1256
  });
1201
1257
  }
1202
1258
  return n.length > 0 ? n : null;
1203
- }, Rn);
1259
+ }, Vn);
1204
1260
  }, [
1205
1261
  at,
1206
1262
  r,
1207
- Wt
1263
+ qt
1208
1264
  ]), c(() => {
1209
- if (Gn([]), Jn([]), !(!ot || !Wt)) return Ue(ot, (e) => {
1265
+ Jn([]), er([]), rr.current = 0;
1266
+ }, [r]), c(() => {
1267
+ if (ot) return We(ot, (e) => {
1210
1268
  let t = [], n = [];
1211
1269
  for (let r of e.avails ?? []) {
1212
1270
  let e = r.ads ?? [];
@@ -1216,11 +1274,11 @@ var We = ({ src: r, autoplay: i = !1, muted: a = !1, chapters: s = [], keyMoment
1216
1274
  startTime: i,
1217
1275
  endTime: r.durationInSeconds == null ? Math.max(o, i) : i + r.durationInSeconds
1218
1276
  }), e.forEach((n, r) => {
1219
- let i = Ve(n?.skipOffset), a = i !== null, o = {};
1277
+ let i = Be(n?.skipOffset), a = i !== null, o = {};
1220
1278
  try {
1221
1279
  o = JSON.parse(n?.adParameters ?? "{}");
1222
1280
  } catch {}
1223
- let s = o.ctaText && Be(o.redirectUrl) ? {
1281
+ let s = o.ctaText && ze(o.redirectUrl) ? {
1224
1282
  text: o.ctaText,
1225
1283
  url: o.redirectUrl,
1226
1284
  title: o.title || void 0,
@@ -1243,141 +1301,164 @@ var We = ({ src: r, autoplay: i = !1, muted: a = !1, chapters: s = [], keyMoment
1243
1301
  breaks: n
1244
1302
  } : null;
1245
1303
  }, ({ pods: e, breaks: t }) => {
1246
- Gn(e), Jn(t);
1304
+ Jn(e), er(t);
1247
1305
  });
1248
1306
  }, [
1249
1307
  ot,
1250
1308
  r,
1251
- Wt
1309
+ tr
1252
1310
  ]), c(() => {
1253
- !F || qn.length === 0 || F.setAdBreaks(qn);
1254
- }, [F, qn]), c(() => {
1311
+ if (!ot || !Y) return;
1312
+ let e = setInterval(() => {
1313
+ let e = ir.current;
1314
+ Yn.current.some((t) => e >= t.startTimeSeconds && e < t.endTimeSeconds) || rr.current >= Ue || (rr.current += 1, nr((e) => e + 1));
1315
+ }, He);
1316
+ return () => clearInterval(e);
1317
+ }, [ot, Y]), c(() => {
1318
+ !F || $n.length === 0 || F.setAdBreaks($n);
1319
+ }, [F, $n]), c(() => {
1255
1320
  if (!F) return;
1256
1321
  let e = () => {
1257
- document.hidden ? nt && ri.current && ni.current && (F.pause(), In.current = !0) : In.current &&= (F.play(), !1);
1322
+ document.hidden ? nt && pi.current && fi.current && (F.pause(), zn.current = !0) : zn.current &&= (F.play(), !1);
1258
1323
  };
1259
1324
  return document.addEventListener("visibilitychange", e), () => {
1260
1325
  document.removeEventListener("visibilitychange", e);
1261
1326
  };
1262
1327
  }, [F, nt]);
1263
- let ci = () => {
1264
- oi();
1265
- }, li = () => {
1266
- Je && !pt.current && C.current && (pt.current = !0, C.current.requestFullscreen().catch(() => {}));
1267
- }, ui = () => {
1328
+ let vi = () => {
1329
+ gi();
1330
+ }, yi = () => {
1331
+ Je && !pt.current && T.current && (pt.current = !0, T.current.requestFullscreen().catch(() => {}));
1332
+ }, bi = () => {
1268
1333
  if (F) {
1269
1334
  if (q) {
1270
- F.casting.remotePlayPause(), oi();
1335
+ F.casting.remotePlayPause(), gi();
1271
1336
  return;
1272
1337
  }
1273
- if (Cn) Z(0), li(), F.play(), wn(!1);
1274
- else if (en) {
1338
+ if (En) Z(0), yi(), F.play(), Dn(!1);
1339
+ else if (rn) {
1275
1340
  F.pause();
1276
1341
  try {
1277
1342
  let e = F.getVideoElement?.();
1278
1343
  e && !e.paused && e.pause();
1279
1344
  } catch {}
1280
- if (C.current && C.current.querySelectorAll("video").forEach((e) => {
1345
+ if (T.current && T.current.querySelectorAll("video").forEach((e) => {
1281
1346
  try {
1282
1347
  e.pause();
1283
1348
  } catch {}
1284
- }), T.current && !T.current.paused) try {
1285
- T.current.pause();
1349
+ }), gt.current && !gt.current.paused) try {
1350
+ gt.current.pause();
1286
1351
  } catch {}
1287
- } else li(), F.play();
1288
- oi();
1352
+ } else yi(), F.play();
1353
+ gi();
1289
1354
  }
1290
- }, di = (e) => {
1291
- if (!w.current || !F || B === 0) return 0;
1292
- let t = w.current.getBoundingClientRect();
1355
+ }, xi = (e) => {
1356
+ if (!E.current || !F || B === 0) return 0;
1357
+ let t = E.current.getBoundingClientRect();
1293
1358
  return H(Math.max(0, Math.min(1, (e.clientX - t.left) / t.width)) * B);
1294
- }, fi = (e) => {
1295
- if (!F || Y || Qr) return;
1296
- vt.current = !0, Kr(di(e));
1359
+ }, Si = (e) => {
1360
+ if (!F || Y || ci) return;
1361
+ yt.current = !0, ni(xi(e));
1297
1362
  let t = (e) => {
1298
- if (!vt.current || !w.current) return;
1299
- let t = w.current.getBoundingClientRect(), n = H(Math.max(0, Math.min(1, (e.clientX - t.left) / t.width)) * B);
1300
- Kr(n), Lr(e.clientX - t.left), Vr(n), T.current && (T.current.currentTime = n), oi();
1363
+ if (!yt.current || !E.current) return;
1364
+ let t = E.current.getBoundingClientRect(), n = H(Math.max(0, Math.min(1, (e.clientX - t.left) / t.width)) * B);
1365
+ ni(n), qr(e.clientX - t.left), Zr(n), gt.current && (gt.current.currentTime = n), gi();
1301
1366
  }, n = (e) => {
1302
- if (vt.current = !1, w.current) {
1303
- let t = w.current.getBoundingClientRect();
1367
+ if (yt.current = !1, E.current) {
1368
+ let t = E.current.getBoundingClientRect();
1304
1369
  Z(H(Math.max(0, Math.min(1, (e.clientX - t.left) / t.width)) * B));
1305
1370
  }
1306
- Kr(null), Lr(null), Ur(null), Gr(null), document.removeEventListener("mousemove", t), document.removeEventListener("mouseup", n);
1371
+ ni(null), qr(null), $r(null), ti(null), document.removeEventListener("mousemove", t), document.removeEventListener("mouseup", n);
1307
1372
  };
1308
1373
  document.addEventListener("mousemove", t), document.addEventListener("mouseup", n);
1309
1374
  }, Z = (e, t) => {
1310
1375
  if (!F) return;
1311
- if (Pt.current = null, q) {
1376
+ if (Lt.current = null, q) {
1312
1377
  F.casting.remoteSeek(e);
1313
1378
  return;
1314
1379
  }
1315
- let n = Math.max(0, rn > 0 ? Math.min(e, rn) : e);
1380
+ let n = Math.max(0, sn > 0 ? Math.min(e, sn) : e);
1316
1381
  if (t) {
1317
1382
  let { eventType: e, ...n } = t;
1318
1383
  F.attributeNextSeek(e, n);
1319
1384
  }
1320
1385
  let r = F.getCurrentTime();
1321
1386
  if (n > r && z.current.length > 0) {
1322
- let e = z.current.filter((e) => e.startTime < n && e.endTime > r && !En.current.has(e.startTime)).sort((e, t) => e.startTime - t.startTime);
1387
+ let e = z.current.filter((e) => e.startTime < n && e.endTime > r && !kn.current.has(e.startTime)).sort((e, t) => e.startTime - t.startTime);
1323
1388
  if (e.length > 0) {
1324
- Dt.current = n;
1389
+ Ot.current = n;
1325
1390
  let t = e[e.length - 1], i = Math.max(t.startTime, r);
1326
- E.current = !0, D.current = i, O.current = r, nn(i), ei.current = !0, $r(!0), A.current && (A.current.style.opacity = "1"), Ct(F.getVideoElement()), F.seek(i), k.current && window.clearTimeout(k.current), k.current = window.setTimeout(() => {
1327
- E.current = !1, ei.current = !1, $r(!1), D.current = null, O.current = null, k.current = null, xt.current = !1, A.current && (A.current.style.opacity = "0"), wt(F.getVideoElement());
1391
+ D.current = !0, O.current = i, k.current = r, on(i), ui.current = !0, li(!0), j.current && (j.current.style.opacity = "1"), wt(F.getVideoElement()), F.seek(i), A.current && window.clearTimeout(A.current), A.current = window.setTimeout(() => {
1392
+ D.current = !1, ui.current = !1, li(!1), O.current = null, k.current = null, A.current = null, St.current = !1, j.current && (j.current.style.opacity = "0"), Tt(F.getVideoElement());
1328
1393
  }, 3e3);
1329
1394
  return;
1330
1395
  }
1331
1396
  }
1332
- Dt.current = null;
1333
- let i = z.current.find((e) => En.current.has(e.startTime) && n >= e.startTime - .5 && n < e.endTime + 2), a = i ? Math.max(n, i.endTime + .5) : n;
1334
- E.current = !0, D.current = a, O.current = r, nn(a), xt.current = !1, A.current && (A.current.style.opacity = "0"), wt(F.getVideoElement()), F.seek(a), k.current && window.clearTimeout(k.current), k.current = window.setTimeout(() => {
1335
- E.current = !1, D.current = null, O.current = null, k.current = null, xt.current = !1, A.current && (A.current.style.opacity = "0");
1397
+ Ot.current = null;
1398
+ let i = z.current.find((e) => kn.current.has(e.startTime) && n >= e.startTime - .5 && n < e.endTime + 2), a = i ? Math.max(n, i.endTime + .5) : n;
1399
+ D.current = !0, O.current = a, k.current = r, on(a), St.current = !1, j.current && (j.current.style.opacity = "0"), Tt(F.getVideoElement()), F.seek(a), A.current && window.clearTimeout(A.current), A.current = window.setTimeout(() => {
1400
+ D.current = !1, O.current = null, k.current = null, A.current = null, St.current = !1, j.current && (j.current.style.opacity = "0");
1336
1401
  }, 3e3);
1337
1402
  };
1338
- Ot.current = Z;
1339
- let pi = () => {
1403
+ kt.current = Z;
1404
+ let Ci = () => {
1340
1405
  if (!F) return;
1341
1406
  if (q) {
1342
- F.casting.remoteSetMute(!(Dr?.isMuted ?? !1));
1407
+ F.casting.remoteSetMute(!(Lr?.isMuted ?? !1));
1343
1408
  return;
1344
1409
  }
1345
- let e = !cn;
1346
- F.setMute(e), ln(e);
1347
- }, mi = (e) => {
1348
- F && (F.setPlaybackRate(e), hr(e), K("none"), xr(`Playback speed: ${e === 1 ? "Normal" : `${e}x`}`));
1349
- }, hi = (e) => {
1410
+ let e = !dn;
1411
+ F.setMute(e), fn(e);
1412
+ }, wi = (e) => {
1413
+ F && (F.setPlaybackRate(e), Tr(e), K("none"), jr(`Playback speed: ${e === 1 ? "Normal" : `${e}x`}`));
1414
+ }, Ti = (e) => {
1350
1415
  if (!F) return;
1351
1416
  F.setQuality(e);
1352
- let t = Qn.find((t) => t.id === e);
1353
- t && (tr(t), xr(`Quality: ${t.label}`)), K("none");
1354
- }, gi = (e) => {
1355
- if (F) if (F.subtitles.setActiveTrack(e), ir(e), K("none"), e === "off") xr("Captions off");
1417
+ let t = cr.find((t) => t.id === e);
1418
+ t && (dr(t), jr(`Quality: ${t.label}`)), K("none");
1419
+ }, Ei = (e) => {
1420
+ if (F) if (F.subtitles.setActiveTrack(e), mr(e), K("none"), e === "off") jr("Captions off");
1356
1421
  else {
1357
- let t = ar.find((t) => t.id === e);
1358
- xr(`Captions: ${t ? b(t) : "on"}`);
1422
+ let t = hr.find((t) => t.id === e);
1423
+ jr(`Captions: ${t ? x(t) : "on"}`);
1359
1424
  }
1360
- }, _i = (e) => {
1361
- F && (j.current &&= (clearTimeout(j.current), null), Cr(null), M.current && (M.current.style.opacity = "1"), dn(!0), At.current === null && (kt.current = F.getCurrentTime()), At.current = { targetIdx: e }, K("none"), xr(`Source: ${S?.[e]?.label ?? ""}`), ct?.(e));
1362
- }, vi = (e, t) => {
1425
+ }, Di = (e) => {
1426
+ if (F) {
1427
+ if (Mt.current &&= (clearTimeout(Mt.current), null), Nr(null), M.current && (M.current.style.opacity = "1"), mn(!0), Nt.current === null) {
1428
+ At.current = F.getCurrentTime();
1429
+ let e = hr.find((e) => e.id === U), t = _r.find((e) => e.id === yr);
1430
+ jt.current = {
1431
+ playbackRate: wr,
1432
+ volume: ln,
1433
+ muted: dn,
1434
+ subtitleId: U,
1435
+ subtitleLang: e?.lang ?? null,
1436
+ audioLang: t && yr !== 0 ? t.lang : null,
1437
+ audioLabel: t && yr !== 0 ? t.label : null,
1438
+ qualityHeight: ur.id === -1 ? null : ur.height
1439
+ };
1440
+ }
1441
+ Nt.current = { targetIdx: e }, K("none"), jr(`Source: ${w?.[e]?.label ?? ""}`), ct?.(e);
1442
+ }
1443
+ }, Oi = (e, t) => {
1363
1444
  Z(e, {
1364
1445
  eventType: "key_moments",
1365
1446
  momentTitle: t?.title ?? "",
1366
1447
  momentTime: e
1367
1448
  }), K("none");
1368
- }, yi = o(() => {
1369
- if (!It.current) return;
1449
+ }, ki = o(() => {
1450
+ if (!zt.current) return;
1370
1451
  let e = F?.getVideoElement?.();
1371
- e && C.current && e.ownerDocument !== document && (e.classList.remove("gb-pip-video"), e.style.objectFit = "", C.current.insertBefore(e, C.current.firstChild)), It.current = null, Sn(null), bn(!1);
1372
- }, [F]), bi = async () => {
1452
+ e && T.current && e.ownerDocument !== document && (e.classList.remove("gb-pip-video"), e.style.objectFit = "", T.current.insertBefore(e, T.current.firstChild)), zt.current = null, Tn(null), Cn(!1);
1453
+ }, [F]), Ai = async () => {
1373
1454
  if (!F) return;
1374
1455
  let e = window.documentPictureInPicture;
1375
1456
  if (!e) {
1376
1457
  F.togglePictureInPicture();
1377
1458
  return;
1378
1459
  }
1379
- if (It.current) {
1380
- It.current.close();
1460
+ if (zt.current) {
1461
+ zt.current.close();
1381
1462
  return;
1382
1463
  }
1383
1464
  try {
@@ -1385,160 +1466,160 @@ var We = ({ src: r, autoplay: i = !1, muted: a = !1, chapters: s = [], keyMoment
1385
1466
  width: 360,
1386
1467
  height: Math.round(360 / n)
1387
1468
  }), i = r.document.createElement("style");
1388
- i.textContent = je, r.document.head.appendChild(i), t.classList.add("gb-pip-video"), r.document.body.appendChild(t), r.addEventListener("pagehide", () => yi(), { once: !0 }), It.current = r, Sn(r), bn(!0);
1469
+ i.textContent = ke, r.document.head.appendChild(i), t.classList.add("gb-pip-video"), r.document.body.appendChild(t), r.addEventListener("pagehide", () => ki(), { once: !0 }), zt.current = r, Tn(r), Cn(!0);
1389
1470
  } catch (e) {
1390
1471
  console.error("[PlayerSDK PiP] Failed to open custom Picture-in-Picture window:", e);
1391
1472
  }
1392
- }, xi = (e) => {
1393
- if (Y || Qr) return;
1473
+ }, ji = (e) => {
1474
+ if (Y || ci) return;
1394
1475
  let t = e.currentTarget.getBoundingClientRect();
1395
1476
  Z(H(Math.max(0, Math.min(1, (e.clientX - t.left) / t.width)) * B));
1396
- }, Si = () => {
1397
- if (!C.current) return;
1398
- let e = C.current, t = document, n = e, r = !!(document.fullscreenElement || t.webkitFullscreenElement), i = () => {
1399
- hn(!0), pn(!0), document.body.style.overflow = "hidden", document.body.style.touchAction = "none", F?.analytics.track("fullscreen_enter", F.getVideoElement());
1477
+ }, Mi = () => {
1478
+ if (!T.current) return;
1479
+ let e = T.current, t = document, n = e, r = !!(document.fullscreenElement || t.webkitFullscreenElement), i = () => {
1480
+ vn(!0), gn(!0), document.body.style.overflow = "hidden", document.body.style.touchAction = "none", F?.analytics.track("fullscreen_enter", F.getVideoElement());
1400
1481
  }, a = () => {
1401
- hn(!1), pn(!1), document.body.style.overflow = "", document.body.style.touchAction = "", F?.analytics.track("fullscreen_exit", F.getVideoElement());
1482
+ vn(!1), gn(!1), document.body.style.overflow = "", document.body.style.touchAction = "", F?.analytics.track("fullscreen_exit", F.getVideoElement());
1402
1483
  };
1403
- if (r || mn) _n(!1), document.fullscreenElement ? document.exitFullscreen() : t.webkitFullscreenElement ? t.webkitExitFullscreen?.() : a();
1484
+ if (r || _n) bn(!1), document.fullscreenElement ? document.exitFullscreen() : t.webkitFullscreenElement ? t.webkitExitFullscreen?.() : a();
1404
1485
  else {
1405
- _n(zt.current);
1486
+ bn(Ht.current);
1406
1487
  let t = e.requestFullscreen?.bind(e) ?? n.webkitRequestFullscreen?.bind(n);
1407
1488
  t ? t().catch(i) : i();
1408
1489
  }
1409
1490
  };
1410
1491
  c(() => {
1411
- bt.current = Si;
1492
+ xt.current = Mi;
1412
1493
  });
1413
- let Ci = () => {
1494
+ let Ni = () => {
1414
1495
  if (!Y) return;
1415
- let e = R.find((e) => L >= e.startTime && L < e.endTime), t = Wn.find((e) => L >= e.startTimeSeconds && L < e.endTimeSeconds);
1496
+ let e = R.find((e) => L >= e.startTime && L < e.endTime), t = qn.find((e) => L >= e.startTimeSeconds && L < e.endTimeSeconds);
1416
1497
  if (t) {
1417
1498
  let n = t.podIndex >= t.podTotal - 1;
1418
- Tt.current?.(n ? e?.endTime ?? t.endTimeSeconds : t.endTimeSeconds, !n);
1499
+ Et.current?.(n ? e?.endTime ?? t.endTimeSeconds : t.endTimeSeconds, !n);
1419
1500
  return;
1420
1501
  }
1421
- e && Tt.current?.(e.endTime);
1422
- }, wi = () => {
1423
- Hn.current && Un.current.add(Hn.current.availId), Bn(null), Hn.current = null;
1424
- }, Ti = (e) => {
1502
+ e && Et.current?.(e.endTime);
1503
+ }, Pi = () => {
1504
+ Gn.current && Kn.current.add(Gn.current.availId), Un(null), Gn.current = null;
1505
+ }, Fi = (e) => {
1425
1506
  e.clickTrackingUrl && fetch(e.clickTrackingUrl, { mode: "no-cors" }).catch(() => {}), e.clickThrough && window.open(e.clickThrough, "_blank", "noopener,noreferrer");
1426
- }, Ei = (e) => {
1507
+ }, Ii = (e) => {
1427
1508
  window.open(e.url, "_blank", "noopener,noreferrer");
1428
- }, Di = () => {
1509
+ }, Li = () => {
1429
1510
  F && (q ? F.casting.stopCasting() : F.casting.requestSession(r, L));
1430
- }, Oi = () => {
1511
+ }, Ri = () => {
1431
1512
  if (!F) return;
1432
1513
  let e = F.getVideoElement();
1433
- if (Mr) {
1514
+ if (Hr) {
1434
1515
  F.casting.stopAirPlay(e);
1435
1516
  return;
1436
1517
  }
1437
1518
  typeof e.webkitShowPlaybackTargetPicker == "function" || F.casting.isAirPlayAvailable() ? F.casting.requestAirPlaySession(e) : console.warn("[PlayerSDK AirPlay] AirPlay is not available on this device.");
1438
- }, ki = (e) => {
1439
- if (!w.current || B === 0 || !F || Y || Qr) return;
1440
- let t = w.current.getBoundingClientRect();
1441
- mt.current = t.width, zr(Math.max(192 / 2, Math.min(e.clientX - t.left, t.width - 192 / 2)));
1519
+ }, zi = (e) => {
1520
+ if (!E.current || B === 0 || !F || Y || ci) return;
1521
+ let t = E.current.getBoundingClientRect();
1522
+ mt.current = t.width, Yr(Math.max(192 / 2, Math.min(e.clientX - t.left, t.width - 192 / 2)));
1442
1523
  let n = H(Math.max(0, Math.min(1, (e.clientX - t.left) / t.width)) * B);
1443
- Lr(e.clientX - t.left), Vr(n), _t.current && window.clearTimeout(_t.current), _t.current = window.setTimeout(() => {
1444
- T.current && (T.current.currentTime = n);
1445
- }, 100), Gr(F.keyMoments.getCurrentMoment(n).keyMoment);
1446
- }, Ai = (e) => {
1447
- if (!w.current || B === 0) return 0;
1448
- let t = w.current.getBoundingClientRect();
1524
+ qr(e.clientX - t.left), Zr(n), vt.current && window.clearTimeout(vt.current), vt.current = window.setTimeout(() => {
1525
+ gt.current && (gt.current.currentTime = n);
1526
+ }, 100), ti(F.keyMoments.getCurrentMoment(n).keyMoment);
1527
+ }, Bi = (e) => {
1528
+ if (!E.current || B === 0) return 0;
1529
+ let t = E.current.getBoundingClientRect();
1449
1530
  return H(Math.max(0, Math.min(1, (e.clientX - t.left) / t.width)) * B);
1450
- }, ji = (e) => {
1451
- if (!F || Y || Qr || B === 0) return;
1452
- e.preventDefault(), vt.current = !0, Kr(Ai(e.touches[0]));
1531
+ }, Vi = (e) => {
1532
+ if (!F || Y || ci || B === 0) return;
1533
+ e.preventDefault(), yt.current = !0, ni(Bi(e.touches[0]));
1453
1534
  let t = (e) => {
1454
- if (!vt.current || !w.current) return;
1455
- let t = e.touches[0], n = w.current.getBoundingClientRect(), r = H(Math.max(0, Math.min(1, (t.clientX - n.left) / n.width)) * B);
1456
- Kr(r), Vr(r), oi();
1535
+ if (!yt.current || !E.current) return;
1536
+ let t = e.touches[0], n = E.current.getBoundingClientRect(), r = H(Math.max(0, Math.min(1, (t.clientX - n.left) / n.width)) * B);
1537
+ ni(r), Zr(r), gi();
1457
1538
  }, n = (e) => {
1458
- if (vt.current = !1, w.current && e.changedTouches[0]) {
1459
- let t = e.changedTouches[0], n = w.current.getBoundingClientRect();
1539
+ if (yt.current = !1, E.current && e.changedTouches[0]) {
1540
+ let t = e.changedTouches[0], n = E.current.getBoundingClientRect();
1460
1541
  Z(H(Math.max(0, Math.min(1, (t.clientX - n.left) / n.width)) * B));
1461
1542
  }
1462
- Kr(null), document.removeEventListener("touchmove", t), document.removeEventListener("touchend", n);
1543
+ ni(null), document.removeEventListener("touchmove", t), document.removeEventListener("touchend", n);
1463
1544
  };
1464
1545
  document.addEventListener("touchmove", t, { passive: !1 }), document.addEventListener("touchend", n);
1465
- }, Mi = () => {
1466
- Lr(null), Ur(null), Gr(null), _t.current && window.clearTimeout(_t.current);
1546
+ }, Hi = () => {
1547
+ qr(null), $r(null), ti(null), vt.current && window.clearTimeout(vt.current);
1467
1548
  }, Q = (e) => {
1468
1549
  if (isNaN(e) || e < 0) return "00:00";
1469
1550
  let t = Math.floor(e), n = Math.floor(t / 3600), r = Math.floor(t % 3600 / 60), i = t % 60, a = (e) => String(e).padStart(2, "0");
1470
1551
  return n > 0 ? `${a(n)}:${a(r)}:${a(i)}` : `${a(r)}:${a(i)}`;
1471
1552
  };
1472
1553
  c(() => {
1473
- wr.current && xr(en ? "Playing" : "Paused");
1474
- }, [en]), c(() => {
1475
- wr.current && xr(cn ? "Muted" : "Unmuted");
1476
- }, [cn]), c(() => {
1477
- wr.current = !0;
1554
+ Pr.current && jr(rn ? "Playing" : "Paused");
1555
+ }, [rn]), c(() => {
1556
+ Pr.current && jr(dn ? "Muted" : "Unmuted");
1557
+ }, [dn]), c(() => {
1558
+ Pr.current = !0;
1478
1559
  }, []), c(() => {
1479
1560
  let e = (e) => {
1480
- e.key === "Escape" && ii.current !== "none" && (e.preventDefault(), K("none"));
1561
+ e.key === "Escape" && mi.current !== "none" && (e.preventDefault(), K("none"));
1481
1562
  };
1482
1563
  return document.addEventListener("keydown", e), () => document.removeEventListener("keydown", e);
1483
1564
  }, []);
1484
- let Ni = q ? !(Dr?.isPaused ?? !0) : en, $ = q ? Dr?.currentTime ?? 0 : L, Pi = q ? Dr?.duration ?? 0 : B, Fi = q ? Dr?.volumeLevel ?? 1 : on, Ii = q ? Dr?.isMuted ?? !1 : cn, Li = o((e) => {
1485
- if (Y || Qr || e.target.closest(".sdk-mobile-ctrl")) return;
1486
- let t = Date.now(), n = C.current?.getBoundingClientRect(), r = e.clientX - (n?.left ?? 0), i = Bt.current;
1565
+ let Ui = q ? !(Lr?.isPaused ?? !0) : rn, $ = q ? Lr?.currentTime ?? 0 : L, Wi = q ? Lr?.duration ?? 0 : B, Gi = q ? Lr?.volumeLevel ?? 1 : ln, Ki = q ? Lr?.isMuted ?? !1 : dn, qi = o((e) => {
1566
+ if (Y || ci || e.target.closest(".sdk-mobile-ctrl")) return;
1567
+ let t = Date.now(), n = T.current?.getBoundingClientRect(), r = e.clientX - (n?.left ?? 0), i = Ut.current;
1487
1568
  if (i && t - i.time < 300) {
1488
- Bt.current = null;
1569
+ Ut.current = null;
1489
1570
  let e = r < (n?.width ?? 0) / 2, t = e ? -10 : 10;
1490
1571
  Z(H(Math.max(0, Math.min(B, V($) + t))), {
1491
1572
  eventType: e ? "fast_backward" : "fast_forward",
1492
1573
  skipSeconds: 10
1493
- }), Ht(e ? "left" : "right"), window.setTimeout(() => Ht(null), 700), oi();
1494
- } else Bt.current = {
1574
+ }), Gt(e ? "left" : "right"), window.setTimeout(() => Gt(null), 700), gi();
1575
+ } else Ut.current = {
1495
1576
  time: t,
1496
1577
  x: r
1497
- }, Yr ? (Xr(!1), ti.current && window.clearTimeout(ti.current)) : oi();
1578
+ }, ai ? (oi(!1), di.current && window.clearTimeout(di.current)) : gi();
1498
1579
  }, [
1499
1580
  Y,
1500
- Qr,
1581
+ ci,
1501
1582
  B,
1502
1583
  V,
1503
1584
  $,
1504
1585
  H,
1505
1586
  Z,
1506
- Yr
1507
- ]), Ri = () => f(Ii || Fi === 0 ? De : Fi < .3 ? Oe : Fi < .7 ? Te : Ee, { size: 18 }), zi = (e) => (t) => {
1587
+ ai
1588
+ ]), Ji = () => p(Ki || Gi === 0 ? Te : Gi < .3 ? Ee : Gi < .7 ? Ce : we, { size: 18 }), Yi = (e) => (t) => {
1508
1589
  t.key === "Enter" || t.key === " " ? (t.preventDefault(), e()) : t.key === "Escape" && (t.preventDefault(), K("none"));
1509
- }, Bi = (e) => (t) => {
1590
+ }, Xi = (e) => (t) => {
1510
1591
  (t.key === "Enter" || t.key === " ") && (t.preventDefault(), e());
1511
- }, Vi = (e) => {
1512
- if (!(Y || Qr)) if (e.key === "ArrowLeft" || e.key === "ArrowRight") {
1592
+ }, Zi = (e) => {
1593
+ if (!(Y || ci)) if (e.key === "ArrowLeft" || e.key === "ArrowRight") {
1513
1594
  e.preventDefault();
1514
1595
  let t = e.key === "ArrowLeft" ? -5 : 5;
1515
1596
  Z(H(Math.max(0, Math.min(B, V($) + t))));
1516
1597
  } else e.key === "Home" ? (e.preventDefault(), Z(H(0))) : e.key === "End" && (e.preventDefault(), Z(H(B)));
1517
- }, Hi = (e) => {
1598
+ }, Qi = (e) => {
1518
1599
  K(G === e ? "none" : e);
1519
- }, Ui = o((e) => {
1600
+ }, $i = o((e) => {
1520
1601
  if (!e) return;
1521
1602
  e.style.left = "";
1522
- let t = C.current;
1603
+ let t = T.current;
1523
1604
  if (!t) return;
1524
1605
  let n = e.getBoundingClientRect(), r = t.getBoundingClientRect(), i = n.right - (r.right - 8), a = r.left + 8 - n.left;
1525
1606
  i > 0 ? e.style.left = `calc(50% - ${Math.ceil(i)}px)` : a > 0 && (e.style.left = `calc(50% + ${Math.ceil(a)}px)`);
1526
1607
  }, []);
1527
- return /* @__PURE__ */ p("div", {
1528
- ref: C,
1608
+ return /* @__PURE__ */ m("div", {
1609
+ ref: T,
1529
1610
  role: "region",
1530
- "aria-label": x || qr ? `${x || qr} video player` : "Video player",
1531
- className: `sdk-player-container ${Yr ? "controls-active" : ""} ${mn ? "sdk-fs-simulated" : ""}`,
1532
- onMouseMove: ci,
1533
- onTouchStart: vn ? void 0 : oi,
1611
+ "aria-label": C || ri ? `${C || ri} video player` : "Video player",
1612
+ className: `sdk-player-container ${ai ? "controls-active" : ""} ${_n ? "sdk-fs-simulated" : ""}`,
1613
+ onMouseMove: vi,
1614
+ onTouchStart: xn ? void 0 : gi,
1534
1615
  onMouseLeave: () => {},
1535
1616
  style: {
1536
- border: mn ? "none" : "1px solid rgba(255, 255, 255, 0.08)",
1537
- "--sdk-theme-color": h,
1538
- "--sdk-theme-color-rgb": Fe(h)
1617
+ border: _n ? "none" : "1px solid rgba(255, 255, 255, 0.08)",
1618
+ "--sdk-theme-color": _,
1619
+ "--sdk-theme-color-rgb": Pe(_)
1539
1620
  },
1540
1621
  children: [
1541
- /* @__PURE__ */ f("canvas", {
1622
+ /* @__PURE__ */ p("canvas", {
1542
1623
  ref: ht,
1543
1624
  width: 160,
1544
1625
  height: 90,
@@ -1549,15 +1630,15 @@ var We = ({ src: r, autoplay: i = !1, muted: a = !1, chapters: s = [], keyMoment
1549
1630
  },
1550
1631
  "aria-hidden": "true"
1551
1632
  }),
1552
- /* @__PURE__ */ f("div", {
1633
+ /* @__PURE__ */ p("div", {
1553
1634
  role: "status",
1554
1635
  "aria-live": "polite",
1555
1636
  "aria-atomic": "true",
1556
1637
  className: "sdk-sr-only",
1557
- children: br
1638
+ children: Ar
1558
1639
  }),
1559
- /* @__PURE__ */ f("div", {
1560
- ref: A,
1640
+ /* @__PURE__ */ p("div", {
1641
+ ref: j,
1561
1642
  style: {
1562
1643
  opacity: 0,
1563
1644
  position: "absolute",
@@ -1569,15 +1650,15 @@ var We = ({ src: r, autoplay: i = !1, muted: a = !1, chapters: s = [], keyMoment
1569
1650
  },
1570
1651
  "aria-hidden": "true"
1571
1652
  }),
1572
- xn && /* @__PURE__ */ p("div", {
1653
+ wn && /* @__PURE__ */ m("div", {
1573
1654
  className: "sdk-pip-placeholder",
1574
1655
  "aria-hidden": "true",
1575
- children: [/* @__PURE__ */ f(xe, {
1656
+ children: [/* @__PURE__ */ p(ye, {
1576
1657
  size: 32,
1577
1658
  "aria-hidden": "true"
1578
- }), /* @__PURE__ */ f("span", { children: "Playing in Picture-in-Picture" })]
1659
+ }), /* @__PURE__ */ p("span", { children: "Playing in Picture-in-Picture" })]
1579
1660
  }),
1580
- /* @__PURE__ */ f("div", {
1661
+ /* @__PURE__ */ p("div", {
1581
1662
  ref: M,
1582
1663
  style: {
1583
1664
  opacity: lt && lt > 0 ? 1 : 0,
@@ -1590,12 +1671,12 @@ var We = ({ src: r, autoplay: i = !1, muted: a = !1, chapters: s = [], keyMoment
1590
1671
  },
1591
1672
  "aria-hidden": "true"
1592
1673
  }),
1593
- /* @__PURE__ */ f("div", {
1594
- className: `sdk-spinner-overlay ${un ? "active" : ""}`,
1674
+ /* @__PURE__ */ p("div", {
1675
+ className: `sdk-spinner-overlay ${pn ? "active" : ""}`,
1595
1676
  "aria-hidden": "true",
1596
- children: /* @__PURE__ */ f("div", { className: "sdk-spinner" })
1677
+ children: /* @__PURE__ */ p("div", { className: "sdk-spinner" })
1597
1678
  }),
1598
- Xt && /* @__PURE__ */ f("div", {
1679
+ $t && /* @__PURE__ */ p("div", {
1599
1680
  style: {
1600
1681
  position: "absolute",
1601
1682
  inset: 0,
@@ -1608,11 +1689,11 @@ var We = ({ src: r, autoplay: i = !1, muted: a = !1, chapters: s = [], keyMoment
1608
1689
  gap: 20,
1609
1690
  padding: "0 24px"
1610
1691
  },
1611
- children: /* @__PURE__ */ f(re, { onRetry: () => {
1612
- Zt(!1), $t((e) => e + 1);
1692
+ children: /* @__PURE__ */ p(ne, { onRetry: () => {
1693
+ en(!1), nn((e) => e + 1);
1613
1694
  } })
1614
1695
  }),
1615
- Sr && /* @__PURE__ */ f("div", {
1696
+ Mr && /* @__PURE__ */ p("div", {
1616
1697
  style: {
1617
1698
  position: "absolute",
1618
1699
  top: "50%",
@@ -1631,11 +1712,11 @@ var We = ({ src: r, autoplay: i = !1, muted: a = !1, chapters: s = [], keyMoment
1631
1712
  backdropFilter: "blur(8px)",
1632
1713
  border: "1px solid rgba(255,255,255,0.12)"
1633
1714
  },
1634
- children: Sr
1715
+ children: Mr
1635
1716
  }),
1636
- I.enableSubtitles && !Y && nr && U !== "off" && /* @__PURE__ */ f("div", {
1717
+ I.enableSubtitles && !Y && fr && U !== "off" && /* @__PURE__ */ p("div", {
1637
1718
  className: "sdk-subtitles-overlay",
1638
- children: /* @__PURE__ */ f("span", {
1719
+ children: /* @__PURE__ */ p("span", {
1639
1720
  className: "sdk-subtitles-text",
1640
1721
  style: {
1641
1722
  fontSize: Xe.size === "small" ? "14px" : Xe.size === "large" ? "24px" : "18px",
@@ -1644,92 +1725,119 @@ var We = ({ src: r, autoplay: i = !1, muted: a = !1, chapters: s = [], keyMoment
1644
1725
  border: Xe.background === "none" ? "none" : "1px solid rgba(255,255,255,0.08)",
1645
1726
  backdropFilter: Xe.background === "none" ? "none" : "blur(8px)"
1646
1727
  },
1647
- dangerouslySetInnerHTML: { __html: nr }
1728
+ dangerouslySetInnerHTML: { __html: fr }
1648
1729
  })
1649
1730
  }),
1650
- zn && /* @__PURE__ */ p("div", {
1651
- className: `sdk-overlay-ad sdk-overlay-ad--${zn.position}`,
1731
+ Hn && /* @__PURE__ */ m("div", {
1732
+ className: `sdk-overlay-ad sdk-overlay-ad--${Hn.position}`,
1652
1733
  role: "complementary",
1653
1734
  "aria-label": "Advertisement",
1654
- children: [/* @__PURE__ */ p("div", {
1735
+ children: [/* @__PURE__ */ m("div", {
1655
1736
  className: "sdk-overlay-ad-topbar",
1656
- children: [/* @__PURE__ */ f("span", {
1737
+ children: [/* @__PURE__ */ p("span", {
1657
1738
  className: "sdk-overlay-ad-label",
1658
1739
  children: "Ad"
1659
- }), zn.dismissible && /* @__PURE__ */ f("button", {
1740
+ }), Hn.dismissible && /* @__PURE__ */ p("button", {
1660
1741
  className: "sdk-overlay-ad-close",
1661
- onClick: wi,
1742
+ onClick: Pi,
1662
1743
  "aria-label": "Close advertisement",
1663
1744
  children: "✕"
1664
1745
  })]
1665
- }), /* @__PURE__ */ f("img", {
1666
- src: zn.imageUrl,
1667
- width: zn.imageWidth,
1668
- height: zn.imageHeight,
1669
- alt: zn.title || "Advertisement",
1746
+ }), /* @__PURE__ */ p("img", {
1747
+ src: Hn.imageUrl,
1748
+ width: Hn.imageWidth,
1749
+ height: Hn.imageHeight,
1750
+ alt: Hn.title || "Advertisement",
1670
1751
  className: "sdk-overlay-ad-img",
1671
- onClick: () => Ti(zn)
1752
+ onClick: () => Fi(Hn)
1672
1753
  })]
1673
1754
  }),
1674
1755
  Y && (() => {
1675
- let e = Wn.find((e) => L >= e.startTimeSeconds && L < e.endTimeSeconds), t = R.find((e) => L >= e.startTime && L < e.endTime), n = e ? Math.max(0, e.endTimeSeconds - L) : t ? Math.max(0, t.endTime - L) : 0, r = e ? L - e.startTimeSeconds : t ? L - t.startTime : 0, i = !!e && e.podTotal > 1, a = e ? e.skippable : rt, o = e ? e.skipOffsetSeconds : it, s = a && r >= o, c = Math.ceil(o - r);
1676
- return /* @__PURE__ */ p(te, { children: [
1677
- /* @__PURE__ */ p("div", {
1756
+ let e = qn.find((e) => L >= e.startTimeSeconds && L < e.endTimeSeconds), t = R.find((e) => L >= e.startTime && L < e.endTime), n = e ? Math.max(0, e.endTimeSeconds - L) : t ? Math.max(0, t.endTime - L) : 0, r = e ? L - e.startTimeSeconds : t ? L - t.startTime : 0, i = !!e && e.podTotal > 1, a = e ? e.skippable : rt, o = e ? e.skipOffsetSeconds : it, s = a && r >= o, c = Math.ceil(o - r), l = r + n, u = l > 0 ? Math.min(1, Math.max(0, r / l)) : 0, d = 2.5, { w: f, h: te } = Zn, ne = Math.max(0, f - d), h = Math.max(0, te - d), g = Math.min(22 - d / 2, h / 2), _ = Math.max(0, ne - 2 * g), re = Math.max(0, h - 2 * g), ie = `M${1.25 + g + _ / 2},1.25h${_ / 2}a${g},${g} 0 0 1 ${g},${g}v${re}a${g},${g} 0 0 1 ${-g},${g}h${-_}a${g},${g} 0 0 1 ${-g},${-g}v${-re}a${g},${g} 0 0 1 ${g},${-g}h${_ / 2}`, ae = 2 * _ + 2 * re + 2 * Math.PI * g;
1757
+ return /* @__PURE__ */ m(ee, { children: [
1758
+ /* @__PURE__ */ m("div", {
1759
+ ref: Xn,
1678
1760
  className: "sdk-ad-countdown",
1679
1761
  role: "timer",
1680
1762
  "aria-label": i ? `Advertisement ${e.podIndex + 1} of ${e.podTotal} — ${Q(n)} remaining` : `Advertisement — ${Q(n)} remaining`,
1681
1763
  "aria-live": "off",
1682
1764
  children: [
1683
- /* @__PURE__ */ f("span", {
1684
- className: "sdk-ad-countdown-label",
1765
+ f > 0 && te > 0 && /* @__PURE__ */ m("svg", {
1766
+ className: "sdk-ad-countdown-border",
1767
+ width: f,
1768
+ height: te,
1769
+ viewBox: `0 0 ${f} ${te}`,
1685
1770
  "aria-hidden": "true",
1686
- children: i ? `Ad ${e.podIndex + 1} of ${e.podTotal}` : "Ad"
1771
+ children: [/* @__PURE__ */ p("path", {
1772
+ className: "sdk-ad-countdown-border-track",
1773
+ d: ie,
1774
+ strokeWidth: d
1775
+ }), /* @__PURE__ */ p("path", {
1776
+ className: "sdk-ad-countdown-border-fill",
1777
+ d: ie,
1778
+ strokeWidth: d,
1779
+ strokeDasharray: ae,
1780
+ strokeDashoffset: ae * (1 - u)
1781
+ })]
1687
1782
  }),
1688
- !i && /* @__PURE__ */ f("span", {
1689
- className: "sdk-ad-countdown-sep",
1783
+ /* @__PURE__ */ p("span", {
1784
+ className: "sdk-ad-countdown-badge",
1785
+ "aria-hidden": "true",
1786
+ children: "Ad"
1787
+ }),
1788
+ i && /* @__PURE__ */ m("span", {
1789
+ className: "sdk-ad-countdown-count",
1690
1790
  "aria-hidden": "true",
1691
- children: "·"
1791
+ children: [
1792
+ e.podIndex + 1,
1793
+ " of ",
1794
+ e.podTotal
1795
+ ]
1692
1796
  }),
1693
- /* @__PURE__ */ f("span", {
1797
+ /* @__PURE__ */ p("span", {
1798
+ className: "sdk-ad-countdown-sep",
1799
+ "aria-hidden": "true"
1800
+ }),
1801
+ /* @__PURE__ */ p("span", {
1694
1802
  className: "sdk-ad-countdown-time",
1695
1803
  "aria-hidden": "true",
1696
1804
  children: Q(n)
1697
1805
  })
1698
1806
  ]
1699
1807
  }),
1700
- a && /* @__PURE__ */ f("button", {
1808
+ a && /* @__PURE__ */ p("button", {
1701
1809
  className: `sdk-skip-ad-btn ${s ? "sdk-skip-ad-btn--ready" : ""}`,
1702
- onClick: s ? Ci : void 0,
1810
+ onClick: s ? Ni : void 0,
1703
1811
  disabled: !s,
1704
1812
  "aria-label": s ? "Skip advertisement" : `Skip advertisement available in ${c} seconds`,
1705
1813
  "aria-disabled": !s,
1706
1814
  children: s ? "Skip Ad ›" : `Skip in ${c}s`
1707
1815
  }),
1708
1816
  e?.cta && (() => {
1709
- let t = e.cta, n = /* @__PURE__ */ p("button", {
1817
+ let t = e.cta, n = /* @__PURE__ */ m("button", {
1710
1818
  className: "sdk-ad-cta-btn",
1711
- onClick: () => Ei(t),
1819
+ onClick: () => Ii(t),
1712
1820
  "aria-label": `${t.text} — opens advertiser site in a new tab`,
1713
- children: [/* @__PURE__ */ f("span", {
1821
+ children: [/* @__PURE__ */ p("span", {
1714
1822
  className: "sdk-ad-cta-btn-text",
1715
1823
  children: t.text
1716
- }), /* @__PURE__ */ f(he, {
1824
+ }), /* @__PURE__ */ p(pe, {
1717
1825
  size: 15,
1718
1826
  "aria-hidden": "true"
1719
1827
  })]
1720
1828
  });
1721
- return /* @__PURE__ */ f("div", {
1829
+ return /* @__PURE__ */ p("div", {
1722
1830
  className: "sdk-ad-cta",
1723
1831
  role: "complementary",
1724
1832
  "aria-label": "Advertisement call to action",
1725
- children: t.title ? /* @__PURE__ */ p("div", {
1833
+ children: t.title ? /* @__PURE__ */ m("div", {
1726
1834
  className: "sdk-ad-cta-card",
1727
- children: [/* @__PURE__ */ p("div", {
1835
+ children: [/* @__PURE__ */ m("div", {
1728
1836
  className: "sdk-ad-cta-info",
1729
- children: [/* @__PURE__ */ f("div", {
1837
+ children: [/* @__PURE__ */ p("div", {
1730
1838
  className: "sdk-ad-cta-title",
1731
1839
  children: t.title
1732
- }), t.description && /* @__PURE__ */ f("div", {
1840
+ }), t.description && /* @__PURE__ */ p("div", {
1733
1841
  className: "sdk-ad-cta-desc",
1734
1842
  children: t.description
1735
1843
  })]
@@ -1739,7 +1847,7 @@ var We = ({ src: r, autoplay: i = !1, muted: a = !1, chapters: s = [], keyMoment
1739
1847
  })()
1740
1848
  ] });
1741
1849
  })(),
1742
- Yt && /* @__PURE__ */ f("div", {
1850
+ Qt && /* @__PURE__ */ p("div", {
1743
1851
  style: {
1744
1852
  position: "absolute",
1745
1853
  inset: 0,
@@ -1750,87 +1858,87 @@ var We = ({ src: r, autoplay: i = !1, muted: a = !1, chapters: s = [], keyMoment
1750
1858
  color: "#fff",
1751
1859
  zIndex: 60
1752
1860
  },
1753
- children: /* @__PURE__ */ p("div", {
1861
+ children: /* @__PURE__ */ m("div", {
1754
1862
  style: {
1755
1863
  maxWidth: 480,
1756
1864
  textAlign: "center",
1757
1865
  padding: 24
1758
1866
  },
1759
- children: [/* @__PURE__ */ f("h3", {
1867
+ children: [/* @__PURE__ */ p("h3", {
1760
1868
  style: { margin: "0 0 8px" },
1761
1869
  children: "Playback restricted"
1762
- }), /* @__PURE__ */ f("p", {
1870
+ }), /* @__PURE__ */ p("p", {
1763
1871
  style: { margin: 0 },
1764
1872
  children: "Your account is missing a required license key. Please contact your administrator."
1765
1873
  })]
1766
1874
  })
1767
1875
  }),
1768
- (q || Mr) && /* @__PURE__ */ f("div", { className: "sdk-cast-bg" }),
1769
- vn && /* @__PURE__ */ p("div", {
1770
- className: `sdk-mobile-overlay ${Yr ? "active" : ""}`,
1771
- onClick: Li,
1772
- children: [Vt && /* @__PURE__ */ f("div", {
1773
- className: `sdk-mobile-doubletap ${Vt}`,
1774
- children: /* @__PURE__ */ p("div", {
1876
+ (q || Hr) && /* @__PURE__ */ p("div", { className: "sdk-cast-bg" }),
1877
+ xn && /* @__PURE__ */ m("div", {
1878
+ className: `sdk-mobile-overlay ${ai ? "active" : ""}`,
1879
+ onClick: qi,
1880
+ children: [Wt && /* @__PURE__ */ p("div", {
1881
+ className: `sdk-mobile-doubletap ${Wt}`,
1882
+ children: /* @__PURE__ */ m("div", {
1775
1883
  className: "sdk-mobile-doubletap-icon",
1776
- children: [f(Vt === "left" ? Ce : we, { size: 26 }), /* @__PURE__ */ f("span", {
1884
+ children: [p(Wt === "left" ? xe : Se, { size: 26 }), /* @__PURE__ */ p("span", {
1777
1885
  className: "sdk-mobile-doubletap-label",
1778
1886
  children: "10s"
1779
1887
  })]
1780
1888
  })
1781
- }), g && /* @__PURE__ */ p(te, { children: [
1782
- /* @__PURE__ */ p("div", {
1889
+ }), v && /* @__PURE__ */ m(ee, { children: [
1890
+ /* @__PURE__ */ m("div", {
1783
1891
  className: "sdk-mobile-header sdk-mobile-ctrl",
1784
- children: [/* @__PURE__ */ p("div", {
1892
+ children: [/* @__PURE__ */ m("div", {
1785
1893
  className: "sdk-mobile-header-left",
1786
- children: [(fn || mn) && /* @__PURE__ */ f("button", {
1894
+ children: [(hn || _n) && /* @__PURE__ */ p("button", {
1787
1895
  className: "sdk-mobile-back-btn",
1788
- onClick: Si,
1896
+ onClick: Mi,
1789
1897
  "aria-label": "Exit fullscreen",
1790
- children: /* @__PURE__ */ f(me, {
1898
+ children: /* @__PURE__ */ p(fe, {
1791
1899
  size: 22,
1792
1900
  "aria-hidden": "true"
1793
1901
  })
1794
- }), (x || qr) && /* @__PURE__ */ f("div", {
1902
+ }), (C || ri) && /* @__PURE__ */ p("div", {
1795
1903
  className: "sdk-mobile-title",
1796
- children: x || qr
1904
+ children: C || ri
1797
1905
  })]
1798
- }), /* @__PURE__ */ p("div", {
1906
+ }), /* @__PURE__ */ m("div", {
1799
1907
  className: "sdk-mobile-header-actions",
1800
1908
  children: [
1801
- I.enablePiP && /* @__PURE__ */ f("button", {
1909
+ I.enablePiP && /* @__PURE__ */ p("button", {
1802
1910
  className: "sdk-mobile-hdr-btn",
1803
1911
  onClick: () => {
1804
- Y || bi();
1912
+ Y || Ai();
1805
1913
  },
1806
- style: { color: yn ? h : "" },
1807
- "aria-label": yn ? "Exit picture-in-picture" : "Enter picture-in-picture",
1808
- "aria-pressed": yn,
1809
- children: /* @__PURE__ */ f(xe, {
1914
+ style: { color: Sn ? _ : "" },
1915
+ "aria-label": Sn ? "Exit picture-in-picture" : "Enter picture-in-picture",
1916
+ "aria-pressed": Sn,
1917
+ children: /* @__PURE__ */ p(ye, {
1810
1918
  size: 20,
1811
1919
  "aria-hidden": "true"
1812
1920
  })
1813
1921
  }),
1814
- I.enableChromecast && !Y && /* @__PURE__ */ f("button", {
1922
+ I.enableChromecast && !Y && /* @__PURE__ */ p("button", {
1815
1923
  className: "sdk-mobile-hdr-btn",
1816
- onClick: Di,
1924
+ onClick: Li,
1817
1925
  "data-tooltip": q ? `Casting to ${q} — tap to disconnect` : "Cast to device",
1818
1926
  "aria-label": q ? `Stop casting to ${q}` : "Cast to device",
1819
1927
  "aria-pressed": !!q,
1820
1928
  style: { color: q ? "#3b82f6" : "" },
1821
- children: /* @__PURE__ */ f(pe, {
1929
+ children: /* @__PURE__ */ p(de, {
1822
1930
  size: 20,
1823
1931
  fill: q ? "currentColor" : "none",
1824
1932
  "aria-hidden": "true"
1825
1933
  })
1826
1934
  }),
1827
- I.allowAirplay && Ar && /* @__PURE__ */ f("button", {
1935
+ I.allowAirplay && Br && /* @__PURE__ */ p("button", {
1828
1936
  className: "sdk-mobile-hdr-btn",
1829
- onClick: Oi,
1830
- "aria-label": Mr ? `Stop AirPlay to ${Pr || "device"}` : "AirPlay to device",
1831
- "aria-pressed": Mr,
1832
- style: { color: Mr ? h : "" },
1833
- children: /* @__PURE__ */ f(de, {
1937
+ onClick: Ri,
1938
+ "aria-label": Hr ? `Stop AirPlay to ${Wr || "device"}` : "AirPlay to device",
1939
+ "aria-pressed": Hr,
1940
+ style: { color: Hr ? _ : "" },
1941
+ children: /* @__PURE__ */ p(le, {
1834
1942
  size: 20,
1835
1943
  "aria-hidden": "true"
1836
1944
  })
@@ -1838,54 +1946,54 @@ var We = ({ src: r, autoplay: i = !1, muted: a = !1, chapters: s = [], keyMoment
1838
1946
  ]
1839
1947
  })]
1840
1948
  }),
1841
- /* @__PURE__ */ p("div", {
1949
+ /* @__PURE__ */ m("div", {
1842
1950
  className: "sdk-mobile-center-controls sdk-mobile-ctrl",
1843
1951
  children: [
1844
- !Y && /* @__PURE__ */ p("button", {
1952
+ !Y && /* @__PURE__ */ m("button", {
1845
1953
  className: "sdk-mobile-seek-btn",
1846
1954
  onClick: () => Z(H(Math.max(0, V($) - 10)), {
1847
1955
  eventType: "fast_backward",
1848
1956
  skipSeconds: 10
1849
1957
  }),
1850
1958
  "aria-label": "Rewind 10 seconds",
1851
- children: [/* @__PURE__ */ f(Ce, {
1959
+ children: [/* @__PURE__ */ p(xe, {
1852
1960
  size: 22,
1853
1961
  "aria-hidden": "true"
1854
- }), /* @__PURE__ */ f("span", {
1962
+ }), /* @__PURE__ */ p("span", {
1855
1963
  className: "sdk-mobile-seek-label",
1856
1964
  "aria-hidden": "true",
1857
1965
  children: "10"
1858
1966
  })]
1859
1967
  }),
1860
- /* @__PURE__ */ f("button", {
1968
+ /* @__PURE__ */ p("button", {
1861
1969
  className: "sdk-mobile-play-btn",
1862
- onClick: ui,
1863
- "aria-label": Cn ? "Replay" : Ni ? "Pause" : "Play",
1864
- children: Cn ? /* @__PURE__ */ f(Ce, {
1970
+ onClick: bi,
1971
+ "aria-label": En ? "Replay" : Ui ? "Pause" : "Play",
1972
+ children: En ? /* @__PURE__ */ p(xe, {
1865
1973
  size: 38,
1866
1974
  "aria-hidden": "true"
1867
- }) : Ni ? /* @__PURE__ */ f(v, {
1975
+ }) : Ui ? /* @__PURE__ */ p(b, {
1868
1976
  size: 38,
1869
1977
  fill: "currentColor",
1870
1978
  "aria-hidden": "true"
1871
- }) : /* @__PURE__ */ f(Se, {
1979
+ }) : /* @__PURE__ */ p(be, {
1872
1980
  size: 38,
1873
1981
  fill: "currentColor",
1874
1982
  style: { marginLeft: "3px" },
1875
1983
  "aria-hidden": "true"
1876
1984
  })
1877
1985
  }),
1878
- !Y && /* @__PURE__ */ p("button", {
1986
+ !Y && /* @__PURE__ */ m("button", {
1879
1987
  className: "sdk-mobile-seek-btn",
1880
1988
  onClick: () => Z(H(Math.min(B, V($) + 10)), {
1881
1989
  eventType: "fast_forward",
1882
1990
  skipSeconds: 10
1883
1991
  }),
1884
1992
  "aria-label": "Skip forward 10 seconds",
1885
- children: [/* @__PURE__ */ f(we, {
1993
+ children: [/* @__PURE__ */ p(Se, {
1886
1994
  size: 22,
1887
1995
  "aria-hidden": "true"
1888
- }), /* @__PURE__ */ f("span", {
1996
+ }), /* @__PURE__ */ p("span", {
1889
1997
  className: "sdk-mobile-seek-label",
1890
1998
  "aria-hidden": "true",
1891
1999
  children: "10"
@@ -1893,28 +2001,28 @@ var We = ({ src: r, autoplay: i = !1, muted: a = !1, chapters: s = [], keyMoment
1893
2001
  })
1894
2002
  ]
1895
2003
  }),
1896
- /* @__PURE__ */ p("div", {
2004
+ /* @__PURE__ */ m("div", {
1897
2005
  className: "sdk-mobile-bottom-bar sdk-mobile-ctrl",
1898
2006
  children: [
1899
- I.enableKeyMoments && gr && W.length > 0 && /* @__PURE__ */ f("div", {
2007
+ I.enableKeyMoments && Er && W.length > 0 && /* @__PURE__ */ p("div", {
1900
2008
  className: "sdk-mobile-chapters-scroll",
1901
2009
  children: W.map((e, t) => {
1902
- let n = dr.index === t;
1903
- return /* @__PURE__ */ p("div", {
2010
+ let n = xr.index === t;
2011
+ return /* @__PURE__ */ m("div", {
1904
2012
  role: "button",
1905
2013
  tabIndex: 0,
1906
2014
  className: `sdk-mobile-chapter-card${n ? " active" : ""}`,
1907
- style: { borderColor: n ? h : void 0 },
2015
+ style: { borderColor: n ? _ : void 0 },
1908
2016
  "aria-label": `${e.title}, ${Q(e.startTime)}${n ? ", current chapter" : ""}`,
1909
2017
  "aria-current": n ? "true" : void 0,
1910
2018
  onClick: () => {
1911
- vi(e.startTime, e);
2019
+ Oi(e.startTime, e);
1912
2020
  },
1913
- onKeyDown: Bi(() => vi(e.startTime, e)),
1914
- children: [/* @__PURE__ */ p("div", {
2021
+ onKeyDown: Xi(() => Oi(e.startTime, e)),
2022
+ children: [/* @__PURE__ */ m("div", {
1915
2023
  className: "sdk-mobile-chapter-thumb",
1916
- children: [vr[t] || e.thumbnail ? /* @__PURE__ */ f("img", {
1917
- src: vr[t] || e.thumbnail,
2024
+ children: [Or[t] || e.thumbnail ? /* @__PURE__ */ p("img", {
2025
+ src: Or[t] || e.thumbnail,
1918
2026
  alt: "",
1919
2027
  "aria-hidden": "true",
1920
2028
  style: {
@@ -1923,25 +2031,25 @@ var We = ({ src: r, autoplay: i = !1, muted: a = !1, chapters: s = [], keyMoment
1923
2031
  objectFit: "cover",
1924
2032
  display: "block"
1925
2033
  }
1926
- }) : /* @__PURE__ */ f(ve, {
2034
+ }) : /* @__PURE__ */ p(ge, {
1927
2035
  size: 16,
1928
2036
  "aria-hidden": "true",
1929
- style: { color: n ? h : "rgba(255,255,255,0.3)" }
1930
- }), /* @__PURE__ */ f("span", {
2037
+ style: { color: n ? _ : "rgba(255,255,255,0.3)" }
2038
+ }), /* @__PURE__ */ p("span", {
1931
2039
  className: "sdk-mobile-chapter-time-badge",
1932
2040
  "aria-hidden": "true",
1933
2041
  children: Q(e.startTime)
1934
2042
  })]
1935
- }), /* @__PURE__ */ f("div", {
2043
+ }), /* @__PURE__ */ p("div", {
1936
2044
  className: "sdk-mobile-chapter-title",
1937
- style: { color: n ? h : void 0 },
2045
+ style: { color: n ? _ : void 0 },
1938
2046
  children: e.title
1939
2047
  })]
1940
2048
  }, t);
1941
2049
  })
1942
2050
  }),
1943
- /* @__PURE__ */ f("div", {
1944
- ref: w,
2051
+ /* @__PURE__ */ p("div", {
2052
+ ref: E,
1945
2053
  role: X ? void 0 : "slider",
1946
2054
  "aria-label": X ? void 0 : "Seek",
1947
2055
  "aria-valuemin": X ? void 0 : 0,
@@ -1950,41 +2058,41 @@ var We = ({ src: r, autoplay: i = !1, muted: a = !1, chapters: s = [], keyMoment
1950
2058
  "aria-valuetext": X ? void 0 : `${Q(V(J === null ? L : J))} of ${Q(B)}`,
1951
2059
  tabIndex: X ? void 0 : 0,
1952
2060
  className: `sdk-seekbar-container sdk-mobile-seekbar${Y ? " sdk-ad-mode" : ""}`,
1953
- onMouseDown: X ? void 0 : fi,
1954
- onMouseMove: X ? void 0 : ki,
1955
- onMouseLeave: X ? void 0 : Mi,
1956
- onTouchStart: X ? void 0 : ji,
1957
- onKeyDown: X ? void 0 : Vi,
2061
+ onMouseDown: X ? void 0 : Si,
2062
+ onMouseMove: X ? void 0 : zi,
2063
+ onMouseLeave: X ? void 0 : Hi,
2064
+ onTouchStart: X ? void 0 : Vi,
2065
+ onKeyDown: X ? void 0 : Zi,
1958
2066
  style: {
1959
2067
  pointerEvents: X ? "none" : void 0,
1960
2068
  touchAction: "none"
1961
2069
  },
1962
- children: Y ? /* @__PURE__ */ f("div", {
2070
+ children: Y ? /* @__PURE__ */ p("div", {
1963
2071
  className: "sdk-ad-progress-fill",
1964
2072
  style: { width: (() => {
1965
- let e = F ? F.getCurrentTime() : L, t = Yn(e);
2073
+ let e = F ? F.getCurrentTime() : L, t = ar(e);
1966
2074
  return t ? `${Math.min(100, Math.max(0, (e - t.start) / (t.end - t.start) * 100))}%` : "0%";
1967
2075
  })() }
1968
- }) : /* @__PURE__ */ p(te, { children: [
1969
- /* @__PURE__ */ f("div", {
2076
+ }) : /* @__PURE__ */ m(ee, { children: [
2077
+ /* @__PURE__ */ p("div", {
1970
2078
  className: "sdk-seekbar-buffered",
1971
- style: { width: `${rn ? (F && F.getBufferedRanges()[0]?.end || 0) / rn * 100 : 0}%` }
2079
+ style: { width: `${sn ? (F && F.getBufferedRanges()[0]?.end || 0) / sn * 100 : 0}%` }
1972
2080
  }),
1973
- B > 0 && R.filter((e) => !On.has(e.startTime)).map((e, t) => /* @__PURE__ */ f("div", {
2081
+ B > 0 && R.filter((e) => !jn.has(e.startTime)).map((e, t) => /* @__PURE__ */ p("div", {
1974
2082
  className: "sdk-seekbar-adbreak",
1975
2083
  style: {
1976
2084
  left: `${V(e.startTime) / B * 100}%`,
1977
2085
  width: "3px"
1978
2086
  }
1979
2087
  }, t)),
1980
- /* @__PURE__ */ f("div", {
2088
+ /* @__PURE__ */ p("div", {
1981
2089
  className: "sdk-seekbar-progress",
1982
2090
  style: {
1983
- width: q ? `${Pi > 0 ? $ / Pi * 100 : 0}%` : `${B ? V(J === null ? L : J) / B * 100 : 0}%`,
2091
+ width: q ? `${Wi > 0 ? $ / Wi * 100 : 0}%` : `${B ? V(J === null ? L : J) / B * 100 : 0}%`,
1984
2092
  background: "#ffffff",
1985
2093
  boxShadow: "none"
1986
2094
  },
1987
- children: /* @__PURE__ */ f("div", {
2095
+ children: /* @__PURE__ */ p("div", {
1988
2096
  className: "sdk-seekbar-handle",
1989
2097
  style: {
1990
2098
  opacity: 1,
@@ -1992,77 +2100,77 @@ var We = ({ src: r, autoplay: i = !1, muted: a = !1, chapters: s = [], keyMoment
1992
2100
  }
1993
2101
  })
1994
2102
  }),
1995
- I.enableKeyMoments && W.map((e, t) => B === 0 ? null : /* @__PURE__ */ f("div", {
2103
+ I.enableKeyMoments && W.map((e, t) => B === 0 ? null : /* @__PURE__ */ p("div", {
1996
2104
  className: "sdk-seekbar-chapter-marker sdk-desktop-chapter-dot",
1997
2105
  style: { left: `${V(e.startTime) / B * 100}%` }
1998
2106
  }, t))
1999
2107
  ] })
2000
2108
  }),
2001
- /* @__PURE__ */ p("div", {
2109
+ /* @__PURE__ */ m("div", {
2002
2110
  className: "sdk-mobile-controls-row",
2003
- children: [!Y && /* @__PURE__ */ f("span", {
2111
+ children: [!Y && /* @__PURE__ */ p("span", {
2004
2112
  className: "sdk-time-display",
2005
- children: q ? `${Q($)} / ${Q(Pi)}` : `${Q(V(J === null ? L : J))} / ${Q(B)}`
2006
- }), /* @__PURE__ */ p("div", {
2113
+ children: q ? `${Q($)} / ${Q(Wi)}` : `${Q(V(J === null ? L : J))} / ${Q(B)}`
2114
+ }), /* @__PURE__ */ m("div", {
2007
2115
  className: "sdk-mobile-bottom-icons",
2008
2116
  children: [
2009
- I.enableKeyMoments && W.length > 0 && !Y && /* @__PURE__ */ f("button", {
2010
- className: `sdk-mobile-icon-btn${gr ? " active" : ""}`,
2117
+ I.enableKeyMoments && W.length > 0 && !Y && /* @__PURE__ */ p("button", {
2118
+ className: `sdk-mobile-icon-btn${Er ? " active" : ""}`,
2011
2119
  onClick: () => {
2012
- _r(!gr);
2120
+ Dr(!Er);
2013
2121
  },
2014
- "aria-label": gr ? "Hide chapters" : "Show chapters",
2015
- "aria-pressed": gr,
2016
- children: /* @__PURE__ */ f(ve, {
2122
+ "aria-label": Er ? "Hide chapters" : "Show chapters",
2123
+ "aria-pressed": Er,
2124
+ children: /* @__PURE__ */ p(ge, {
2017
2125
  size: 18,
2018
2126
  "aria-hidden": "true"
2019
2127
  })
2020
2128
  }),
2021
- I.enableSubtitles && !Y && ar.some((e) => !e.isNative) && /* @__PURE__ */ p("div", {
2129
+ I.enableSubtitles && !Y && hr.some((e) => !e.isNative) && /* @__PURE__ */ m("div", {
2022
2130
  className: "sdk-menu-container",
2023
- children: [/* @__PURE__ */ f("button", {
2131
+ children: [/* @__PURE__ */ p("button", {
2024
2132
  className: `sdk-mobile-icon-btn${U === "off" ? "" : " active"}`,
2025
2133
  onClick: () => {
2026
- Hi("subtitles");
2134
+ Qi("subtitles");
2027
2135
  },
2028
2136
  "aria-label": "Captions",
2029
2137
  "aria-haspopup": "listbox",
2030
2138
  "aria-expanded": G === "subtitles",
2031
- children: /* @__PURE__ */ f(fe, {
2139
+ children: /* @__PURE__ */ p(ue, {
2032
2140
  size: 18,
2033
2141
  "aria-hidden": "true"
2034
2142
  })
2035
- }), G === "subtitles" && /* @__PURE__ */ p("div", {
2036
- ref: Ui,
2143
+ }), G === "subtitles" && /* @__PURE__ */ m("div", {
2144
+ ref: $i,
2037
2145
  className: "sdk-dropup-menu",
2038
2146
  role: "listbox",
2039
2147
  "aria-label": "Captions",
2040
2148
  children: [
2041
- /* @__PURE__ */ f("div", {
2149
+ /* @__PURE__ */ p("div", {
2042
2150
  className: "sdk-dropup-header",
2043
2151
  "aria-hidden": "true",
2044
2152
  children: "Subtitles"
2045
2153
  }),
2046
- /* @__PURE__ */ p("div", {
2154
+ /* @__PURE__ */ m("div", {
2047
2155
  role: "option",
2048
2156
  "aria-selected": U === "off",
2049
2157
  tabIndex: 0,
2050
2158
  className: `sdk-dropup-item ${U === "off" ? "active" : ""}`,
2051
- onClick: () => gi("off"),
2052
- onKeyDown: zi(() => gi("off")),
2053
- children: [/* @__PURE__ */ f("span", { children: "Off" }), U === "off" && /* @__PURE__ */ f(_, {
2159
+ onClick: () => Ei("off"),
2160
+ onKeyDown: Yi(() => Ei("off")),
2161
+ children: [/* @__PURE__ */ p("span", { children: "Off" }), U === "off" && /* @__PURE__ */ p(y, {
2054
2162
  size: 12,
2055
2163
  "aria-hidden": "true"
2056
2164
  })]
2057
2165
  }),
2058
- ar.map((e) => /* @__PURE__ */ p("div", {
2166
+ hr.map((e) => /* @__PURE__ */ m("div", {
2059
2167
  role: "option",
2060
2168
  "aria-selected": U === e.id,
2061
2169
  tabIndex: 0,
2062
2170
  className: `sdk-dropup-item ${U === e.id ? "active" : ""}`,
2063
- onClick: () => gi(e.id),
2064
- onKeyDown: zi(() => gi(e.id)),
2065
- children: [/* @__PURE__ */ f("span", { children: b(e) }), U === e.id && /* @__PURE__ */ f(_, {
2171
+ onClick: () => Ei(e.id),
2172
+ onKeyDown: Yi(() => Ei(e.id)),
2173
+ children: [/* @__PURE__ */ p("span", { children: x(e) }), U === e.id && /* @__PURE__ */ p(y, {
2066
2174
  size: 12,
2067
2175
  "aria-hidden": "true"
2068
2176
  })]
@@ -2070,67 +2178,67 @@ var We = ({ src: r, autoplay: i = !1, muted: a = !1, chapters: s = [], keyMoment
2070
2178
  ]
2071
2179
  })]
2072
2180
  }),
2073
- I.allowMultipleAudio && sr.length > 1 && !Y && /* @__PURE__ */ p("div", {
2181
+ I.allowMultipleAudio && _r.length > 1 && !Y && /* @__PURE__ */ m("div", {
2074
2182
  className: "sdk-menu-container",
2075
- children: [/* @__PURE__ */ f("button", {
2183
+ children: [/* @__PURE__ */ p("button", {
2076
2184
  className: `sdk-mobile-icon-btn${G === "audio" ? " active" : ""}`,
2077
2185
  onClick: () => {
2078
- Hi("audio");
2186
+ Qi("audio");
2079
2187
  },
2080
2188
  "aria-label": "Audio track",
2081
2189
  "aria-haspopup": "listbox",
2082
2190
  "aria-expanded": G === "audio",
2083
- children: /* @__PURE__ */ f(_e, {
2191
+ children: /* @__PURE__ */ p(he, {
2084
2192
  size: 18,
2085
2193
  "aria-hidden": "true"
2086
2194
  })
2087
- }), G === "audio" && /* @__PURE__ */ p("div", {
2088
- ref: Ui,
2195
+ }), G === "audio" && /* @__PURE__ */ m("div", {
2196
+ ref: $i,
2089
2197
  className: "sdk-dropup-menu",
2090
2198
  role: "listbox",
2091
2199
  "aria-label": "Audio track",
2092
- children: [/* @__PURE__ */ f("div", {
2200
+ children: [/* @__PURE__ */ p("div", {
2093
2201
  className: "sdk-dropup-header",
2094
2202
  "aria-hidden": "true",
2095
2203
  children: "Audio Track"
2096
- }), sr.map((e) => /* @__PURE__ */ p("div", {
2204
+ }), _r.map((e) => /* @__PURE__ */ m("div", {
2097
2205
  role: "option",
2098
- "aria-selected": lr === e.id,
2206
+ "aria-selected": yr === e.id,
2099
2207
  tabIndex: 0,
2100
- className: `sdk-dropup-item ${lr === e.id ? "active" : ""}`,
2208
+ className: `sdk-dropup-item ${yr === e.id ? "active" : ""}`,
2101
2209
  onClick: () => {
2102
- F?.setAudioTrack(e.id), ur(e.id), K("none"), xr(`Audio: ${b(e)}`);
2210
+ F?.setAudioTrack(e.id), br(e.id), K("none"), jr(`Audio: ${x(e)}`);
2103
2211
  },
2104
- onKeyDown: zi(() => {
2105
- F?.setAudioTrack(e.id), ur(e.id), K("none"), xr(`Audio: ${b(e)}`);
2212
+ onKeyDown: Yi(() => {
2213
+ F?.setAudioTrack(e.id), br(e.id), K("none"), jr(`Audio: ${x(e)}`);
2106
2214
  }),
2107
- children: [/* @__PURE__ */ f("span", { children: b(e) }), lr === e.id && /* @__PURE__ */ f(_, {
2215
+ children: [/* @__PURE__ */ p("span", { children: x(e) }), yr === e.id && /* @__PURE__ */ p(y, {
2108
2216
  size: 12,
2109
2217
  "aria-hidden": "true"
2110
2218
  })]
2111
2219
  }, e.id))]
2112
2220
  })]
2113
2221
  }),
2114
- I.enablePlaybackSpeed && !Y && /* @__PURE__ */ p("div", {
2222
+ I.enablePlaybackSpeed && !Y && /* @__PURE__ */ m("div", {
2115
2223
  className: "sdk-menu-container",
2116
- children: [/* @__PURE__ */ f("button", {
2224
+ children: [/* @__PURE__ */ p("button", {
2117
2225
  className: `sdk-mobile-icon-btn${G === "speed" ? " active" : ""}`,
2118
2226
  onClick: () => {
2119
- Hi("speed");
2227
+ Qi("speed");
2120
2228
  },
2121
2229
  "aria-label": "Playback speed",
2122
2230
  "aria-haspopup": "listbox",
2123
2231
  "aria-expanded": G === "speed",
2124
- children: /* @__PURE__ */ f(ge, {
2232
+ children: /* @__PURE__ */ p(me, {
2125
2233
  size: 18,
2126
2234
  "aria-hidden": "true"
2127
2235
  })
2128
- }), G === "speed" && /* @__PURE__ */ p("div", {
2129
- ref: Ui,
2236
+ }), G === "speed" && /* @__PURE__ */ m("div", {
2237
+ ref: $i,
2130
2238
  className: "sdk-dropup-menu",
2131
2239
  role: "listbox",
2132
2240
  "aria-label": "Playback speed",
2133
- children: [/* @__PURE__ */ f("div", {
2241
+ children: [/* @__PURE__ */ p("div", {
2134
2242
  className: "sdk-dropup-header",
2135
2243
  "aria-hidden": "true",
2136
2244
  children: "Speed"
@@ -2141,100 +2249,100 @@ var We = ({ src: r, autoplay: i = !1, muted: a = !1, chapters: s = [], keyMoment
2141
2249
  1.25,
2142
2250
  1.5,
2143
2251
  2
2144
- ].map((e) => /* @__PURE__ */ p("div", {
2252
+ ].map((e) => /* @__PURE__ */ m("div", {
2145
2253
  role: "option",
2146
- "aria-selected": mr === e,
2254
+ "aria-selected": wr === e,
2147
2255
  tabIndex: 0,
2148
- className: `sdk-dropup-item ${mr === e ? "active" : ""}`,
2149
- onClick: () => mi(e),
2150
- onKeyDown: zi(() => mi(e)),
2151
- children: [/* @__PURE__ */ f("span", { children: e === 1 ? "Normal" : `${e}x` }), mr === e && /* @__PURE__ */ f(_, {
2256
+ className: `sdk-dropup-item ${wr === e ? "active" : ""}`,
2257
+ onClick: () => wi(e),
2258
+ onKeyDown: Yi(() => wi(e)),
2259
+ children: [/* @__PURE__ */ p("span", { children: e === 1 ? "Normal" : `${e}x` }), wr === e && /* @__PURE__ */ p(y, {
2152
2260
  size: 12,
2153
2261
  "aria-hidden": "true"
2154
2262
  })]
2155
2263
  }, e))]
2156
2264
  })]
2157
2265
  }),
2158
- I.enableQuality && !Y && /* @__PURE__ */ p("div", {
2266
+ I.enableQuality && !Y && /* @__PURE__ */ m("div", {
2159
2267
  className: "sdk-menu-container",
2160
- children: [/* @__PURE__ */ f("button", {
2161
- className: `sdk-mobile-icon-btn${er.id === -1 ? "" : " active"}`,
2268
+ children: [/* @__PURE__ */ p("button", {
2269
+ className: `sdk-mobile-icon-btn${ur.id === -1 ? "" : " active"}`,
2162
2270
  onClick: () => {
2163
- Hi("quality");
2271
+ Qi("quality");
2164
2272
  },
2165
2273
  "aria-label": "Video quality",
2166
2274
  "aria-haspopup": "listbox",
2167
2275
  "aria-expanded": G === "quality",
2168
- children: /* @__PURE__ */ f(Ne, {
2276
+ children: /* @__PURE__ */ p(Me, {
2169
2277
  size: 18,
2170
2278
  "aria-hidden": "true"
2171
2279
  })
2172
- }), G === "quality" && /* @__PURE__ */ p("div", {
2173
- ref: Ui,
2280
+ }), G === "quality" && /* @__PURE__ */ m("div", {
2281
+ ref: $i,
2174
2282
  className: "sdk-dropup-menu large",
2175
2283
  role: "listbox",
2176
2284
  "aria-label": "Video quality",
2177
- children: [/* @__PURE__ */ f("div", {
2285
+ children: [/* @__PURE__ */ p("div", {
2178
2286
  className: "sdk-dropup-header",
2179
2287
  "aria-hidden": "true",
2180
2288
  children: "Quality"
2181
- }), Qn.map((e) => /* @__PURE__ */ p("div", {
2289
+ }), cr.map((e) => /* @__PURE__ */ m("div", {
2182
2290
  role: "option",
2183
- "aria-selected": er.id === e.id,
2291
+ "aria-selected": ur.id === e.id,
2184
2292
  tabIndex: 0,
2185
- className: `sdk-dropup-item ${er.id === e.id ? "active" : ""}`,
2186
- onClick: () => hi(e.id),
2187
- onKeyDown: zi(() => hi(e.id)),
2188
- children: [/* @__PURE__ */ f("span", { children: e.label }), er.id === e.id && /* @__PURE__ */ f(_, {
2293
+ className: `sdk-dropup-item ${ur.id === e.id ? "active" : ""}`,
2294
+ onClick: () => Ti(e.id),
2295
+ onKeyDown: Yi(() => Ti(e.id)),
2296
+ children: [/* @__PURE__ */ p("span", { children: e.label }), ur.id === e.id && /* @__PURE__ */ p(y, {
2189
2297
  size: 12,
2190
2298
  "aria-hidden": "true"
2191
2299
  })]
2192
2300
  }, e.id))]
2193
2301
  })]
2194
2302
  }),
2195
- S && S.length > 1 && !Y && /* @__PURE__ */ p("div", {
2303
+ w && w.length > 1 && !Y && /* @__PURE__ */ m("div", {
2196
2304
  className: "sdk-menu-container",
2197
- children: [/* @__PURE__ */ f("button", {
2305
+ children: [/* @__PURE__ */ p("button", {
2198
2306
  className: `sdk-mobile-icon-btn${G === "sources" ? " active" : ""}`,
2199
2307
  onClick: () => {
2200
- Hi("sources");
2308
+ Qi("sources");
2201
2309
  },
2202
2310
  "aria-label": "Select source",
2203
2311
  "aria-haspopup": "listbox",
2204
2312
  "aria-expanded": G === "sources",
2205
- children: /* @__PURE__ */ f(Pe, {
2313
+ children: /* @__PURE__ */ p(Ne, {
2206
2314
  size: 18,
2207
2315
  "aria-hidden": "true"
2208
2316
  })
2209
- }), G === "sources" && /* @__PURE__ */ p("div", {
2210
- ref: Ui,
2317
+ }), G === "sources" && /* @__PURE__ */ m("div", {
2318
+ ref: $i,
2211
2319
  className: "sdk-dropup-menu",
2212
2320
  role: "listbox",
2213
2321
  "aria-label": "Select source",
2214
- children: [/* @__PURE__ */ f("div", {
2322
+ children: [/* @__PURE__ */ p("div", {
2215
2323
  className: "sdk-dropup-header",
2216
2324
  "aria-hidden": "true",
2217
2325
  children: "Source"
2218
- }), S.map((e, t) => /* @__PURE__ */ p("div", {
2326
+ }), w.map((e, t) => /* @__PURE__ */ m("div", {
2219
2327
  role: "option",
2220
2328
  "aria-selected": st === t,
2221
2329
  tabIndex: 0,
2222
2330
  className: `sdk-dropup-item ${st === t ? "active" : ""}`,
2223
- onClick: () => _i(t),
2224
- onKeyDown: zi(() => _i(t)),
2225
- children: [/* @__PURE__ */ f("span", { children: e.label }), st === t && /* @__PURE__ */ f(_, {
2331
+ onClick: () => Di(t),
2332
+ onKeyDown: Yi(() => Di(t)),
2333
+ children: [/* @__PURE__ */ p("span", { children: e.label }), st === t && /* @__PURE__ */ p(y, {
2226
2334
  size: 12,
2227
2335
  "aria-hidden": "true"
2228
2336
  })]
2229
2337
  }, t))]
2230
2338
  })]
2231
2339
  }),
2232
- /* @__PURE__ */ f("button", {
2340
+ /* @__PURE__ */ p("button", {
2233
2341
  className: "sdk-mobile-icon-btn",
2234
- onClick: Si,
2235
- "aria-label": fn || mn ? "Exit fullscreen" : "Enter fullscreen",
2236
- "aria-pressed": fn || mn,
2237
- children: f(fn ? be : ye, {
2342
+ onClick: Mi,
2343
+ "aria-label": hn || _n ? "Exit fullscreen" : "Enter fullscreen",
2344
+ "aria-pressed": hn || _n,
2345
+ children: p(hn ? ve : _e, {
2238
2346
  size: 18,
2239
2347
  "aria-hidden": "true"
2240
2348
  })
@@ -2246,78 +2354,78 @@ var We = ({ src: r, autoplay: i = !1, muted: a = !1, chapters: s = [], keyMoment
2246
2354
  })
2247
2355
  ] })]
2248
2356
  }),
2249
- !vn && /* @__PURE__ */ p("div", {
2357
+ !xn && /* @__PURE__ */ m("div", {
2250
2358
  className: "sdk-controls-overlay",
2251
2359
  onClick: (e) => {
2252
- Y || e.target.closest(".sdk-desktop-header") || e.target.closest(".sdk-desktop-center-controls") || e.target.closest(".sdk-desktop-bottom") || ui();
2360
+ Y || e.target.closest(".sdk-desktop-header") || e.target.closest(".sdk-desktop-center-controls") || e.target.closest(".sdk-desktop-bottom") || bi();
2253
2361
  },
2254
- children: [/* @__PURE__ */ p("div", {
2362
+ children: [/* @__PURE__ */ m("div", {
2255
2363
  className: "sdk-desktop-header",
2256
- children: [/* @__PURE__ */ p("div", {
2364
+ children: [/* @__PURE__ */ m("div", {
2257
2365
  className: "sdk-desktop-header-left",
2258
- children: [(fn || mn) && /* @__PURE__ */ f("button", {
2366
+ children: [(hn || _n) && /* @__PURE__ */ p("button", {
2259
2367
  className: "sdk-desktop-back-btn",
2260
2368
  onClick: (e) => {
2261
- e.stopPropagation(), Si();
2369
+ e.stopPropagation(), Mi();
2262
2370
  },
2263
2371
  "aria-label": "Exit fullscreen",
2264
- children: /* @__PURE__ */ f(me, {
2372
+ children: /* @__PURE__ */ p(fe, {
2265
2373
  size: 22,
2266
2374
  "aria-hidden": "true"
2267
2375
  })
2268
- }), (x || qr) && /* @__PURE__ */ f("span", {
2376
+ }), (C || ri) && /* @__PURE__ */ p("span", {
2269
2377
  className: "sdk-desktop-title",
2270
- children: x || qr
2378
+ children: C || ri
2271
2379
  })]
2272
- }), /* @__PURE__ */ p("div", {
2380
+ }), /* @__PURE__ */ m("div", {
2273
2381
  className: "sdk-desktop-header-right",
2274
2382
  children: [
2275
- I.enableChromecast && !Y && /* @__PURE__ */ f("button", {
2383
+ I.enableChromecast && !Y && /* @__PURE__ */ p("button", {
2276
2384
  className: "sdk-desktop-hdr-btn",
2277
2385
  onClick: (e) => {
2278
- e.stopPropagation(), Di();
2386
+ e.stopPropagation(), Li();
2279
2387
  },
2280
2388
  "data-tooltip": q ? `Casting to ${q} — click to disconnect` : "Cast to device",
2281
2389
  "aria-label": q ? `Stop casting to ${q}` : "Cast to device",
2282
2390
  "aria-pressed": !!q,
2283
2391
  style: { color: q ? "#3b82f6" : "" },
2284
- children: /* @__PURE__ */ f(pe, {
2392
+ children: /* @__PURE__ */ p(de, {
2285
2393
  size: 20,
2286
2394
  fill: q ? "currentColor" : "none",
2287
2395
  "aria-hidden": "true"
2288
2396
  })
2289
2397
  }),
2290
- q && /* @__PURE__ */ p("span", {
2398
+ q && /* @__PURE__ */ m("span", {
2291
2399
  className: "sdk-cast-indicator",
2292
2400
  "aria-hidden": "true",
2293
- children: [/* @__PURE__ */ f(pe, {
2401
+ children: [/* @__PURE__ */ p(de, {
2294
2402
  size: 10,
2295
2403
  fill: "currentColor",
2296
2404
  "aria-hidden": "true"
2297
2405
  }), q]
2298
2406
  }),
2299
- I.allowAirplay && Ar && /* @__PURE__ */ f("button", {
2407
+ I.allowAirplay && Br && /* @__PURE__ */ p("button", {
2300
2408
  className: "sdk-desktop-hdr-btn",
2301
2409
  onClick: (e) => {
2302
- e.stopPropagation(), Oi();
2410
+ e.stopPropagation(), Ri();
2303
2411
  },
2304
- "data-tooltip": Mr ? `AirPlay to ${Pr || "device"} — click to disconnect` : "AirPlay to device",
2305
- "aria-label": Mr ? `Stop AirPlay to ${Pr || "device"}` : "AirPlay to device",
2306
- "aria-pressed": Mr,
2307
- style: { color: Mr ? h : "" },
2308
- children: /* @__PURE__ */ f(de, {
2412
+ "data-tooltip": Hr ? `AirPlay to ${Wr || "device"} — click to disconnect` : "AirPlay to device",
2413
+ "aria-label": Hr ? `Stop AirPlay to ${Wr || "device"}` : "AirPlay to device",
2414
+ "aria-pressed": Hr,
2415
+ style: { color: Hr ? _ : "" },
2416
+ children: /* @__PURE__ */ p(le, {
2309
2417
  size: 20,
2310
2418
  "aria-hidden": "true"
2311
2419
  })
2312
2420
  })
2313
2421
  ]
2314
2422
  })]
2315
- }), g && /* @__PURE__ */ p(te, { children: [
2316
- /* @__PURE__ */ p("div", {
2423
+ }), v && /* @__PURE__ */ m(ee, { children: [
2424
+ /* @__PURE__ */ m("div", {
2317
2425
  className: "sdk-desktop-center-controls",
2318
2426
  style: { pointerEvents: "none" },
2319
2427
  children: [
2320
- !Y && /* @__PURE__ */ f("button", {
2428
+ !Y && /* @__PURE__ */ p("button", {
2321
2429
  className: "sdk-desktop-seek-btn",
2322
2430
  style: { pointerEvents: "auto" },
2323
2431
  onClick: (e) => {
@@ -2327,45 +2435,45 @@ var We = ({ src: r, autoplay: i = !1, muted: a = !1, chapters: s = [], keyMoment
2327
2435
  });
2328
2436
  },
2329
2437
  "aria-label": "Rewind 10 seconds",
2330
- children: /* @__PURE__ */ p("div", {
2438
+ children: /* @__PURE__ */ m("div", {
2331
2439
  style: {
2332
2440
  position: "relative",
2333
2441
  display: "flex",
2334
2442
  alignItems: "center",
2335
2443
  justifyContent: "center"
2336
2444
  },
2337
- children: [/* @__PURE__ */ f(Ce, {
2445
+ children: [/* @__PURE__ */ p(xe, {
2338
2446
  size: 30,
2339
2447
  "aria-hidden": "true"
2340
- }), /* @__PURE__ */ f("span", {
2448
+ }), /* @__PURE__ */ p("span", {
2341
2449
  className: "sdk-desktop-seek-label",
2342
2450
  "aria-hidden": "true",
2343
2451
  children: "10"
2344
2452
  })]
2345
2453
  })
2346
2454
  }),
2347
- /* @__PURE__ */ f("button", {
2455
+ /* @__PURE__ */ p("button", {
2348
2456
  className: "sdk-desktop-play-btn",
2349
2457
  style: { pointerEvents: "auto" },
2350
2458
  onClick: (e) => {
2351
- e.stopPropagation(), ui();
2459
+ e.stopPropagation(), bi();
2352
2460
  },
2353
- "aria-label": Cn ? "Replay" : Ni ? "Pause" : "Play",
2354
- children: Cn ? /* @__PURE__ */ f(Ce, {
2461
+ "aria-label": En ? "Replay" : Ui ? "Pause" : "Play",
2462
+ children: En ? /* @__PURE__ */ p(xe, {
2355
2463
  size: 38,
2356
2464
  "aria-hidden": "true"
2357
- }) : Ni ? /* @__PURE__ */ f(v, {
2465
+ }) : Ui ? /* @__PURE__ */ p(b, {
2358
2466
  size: 38,
2359
2467
  fill: "currentColor",
2360
2468
  "aria-hidden": "true"
2361
- }) : /* @__PURE__ */ f(Se, {
2469
+ }) : /* @__PURE__ */ p(be, {
2362
2470
  size: 38,
2363
2471
  fill: "currentColor",
2364
2472
  style: { marginLeft: "4px" },
2365
2473
  "aria-hidden": "true"
2366
2474
  })
2367
2475
  }),
2368
- !Y && /* @__PURE__ */ f("button", {
2476
+ !Y && /* @__PURE__ */ p("button", {
2369
2477
  className: "sdk-desktop-seek-btn",
2370
2478
  style: { pointerEvents: "auto" },
2371
2479
  onClick: (e) => {
@@ -2375,17 +2483,17 @@ var We = ({ src: r, autoplay: i = !1, muted: a = !1, chapters: s = [], keyMoment
2375
2483
  });
2376
2484
  },
2377
2485
  "aria-label": "Skip forward 10 seconds",
2378
- children: /* @__PURE__ */ p("div", {
2486
+ children: /* @__PURE__ */ m("div", {
2379
2487
  style: {
2380
2488
  position: "relative",
2381
2489
  display: "flex",
2382
2490
  alignItems: "center",
2383
2491
  justifyContent: "center"
2384
2492
  },
2385
- children: [/* @__PURE__ */ f(we, {
2493
+ children: [/* @__PURE__ */ p(Se, {
2386
2494
  size: 30,
2387
2495
  "aria-hidden": "true"
2388
- }), /* @__PURE__ */ f("span", {
2496
+ }), /* @__PURE__ */ p("span", {
2389
2497
  className: "sdk-desktop-seek-label",
2390
2498
  "aria-hidden": "true",
2391
2499
  children: "10"
@@ -2394,31 +2502,31 @@ var We = ({ src: r, autoplay: i = !1, muted: a = !1, chapters: s = [], keyMoment
2394
2502
  })
2395
2503
  ]
2396
2504
  }),
2397
- I.enableKeyMoments && gr && W.length > 0 && $e === "panel" && /* @__PURE__ */ p("div", {
2505
+ I.enableKeyMoments && Er && W.length > 0 && $e === "panel" && /* @__PURE__ */ m("div", {
2398
2506
  className: "sdk-chapters-panel",
2399
2507
  onClick: (e) => e.stopPropagation(),
2400
- children: [/* @__PURE__ */ f("div", {
2508
+ children: [/* @__PURE__ */ p("div", {
2401
2509
  className: "sdk-chapters-panel-header",
2402
- children: /* @__PURE__ */ f("span", {
2510
+ children: /* @__PURE__ */ p("span", {
2403
2511
  className: "sdk-chapters-panel-title",
2404
2512
  children: "Chapters"
2405
2513
  })
2406
- }), /* @__PURE__ */ f("div", {
2514
+ }), /* @__PURE__ */ p("div", {
2407
2515
  className: "sdk-chapters-panel-list",
2408
2516
  children: W.map((e, t) => {
2409
- let n = dr.index === t;
2410
- return /* @__PURE__ */ p("div", {
2517
+ let n = xr.index === t;
2518
+ return /* @__PURE__ */ m("div", {
2411
2519
  role: "button",
2412
2520
  tabIndex: 0,
2413
2521
  className: `sdk-chapters-panel-item${n ? " active" : ""}`,
2414
2522
  "aria-label": `${e.title}, ${Q(e.startTime)}${n ? ", current chapter" : ""}`,
2415
2523
  "aria-current": n ? "true" : void 0,
2416
- onClick: () => vi(e.startTime, e),
2417
- onKeyDown: Bi(() => vi(e.startTime, e)),
2418
- children: [/* @__PURE__ */ f("div", {
2524
+ onClick: () => Oi(e.startTime, e),
2525
+ onKeyDown: Xi(() => Oi(e.startTime, e)),
2526
+ children: [/* @__PURE__ */ p("div", {
2419
2527
  className: "sdk-chapters-panel-thumb",
2420
- children: vr[t] || e.thumbnail ? /* @__PURE__ */ f("img", {
2421
- src: vr[t] || e.thumbnail,
2528
+ children: Or[t] || e.thumbnail ? /* @__PURE__ */ p("img", {
2529
+ src: Or[t] || e.thumbnail,
2422
2530
  alt: "",
2423
2531
  "aria-hidden": "true",
2424
2532
  style: {
@@ -2427,23 +2535,23 @@ var We = ({ src: r, autoplay: i = !1, muted: a = !1, chapters: s = [], keyMoment
2427
2535
  objectFit: "cover",
2428
2536
  display: "block"
2429
2537
  }
2430
- }) : /* @__PURE__ */ f(ve, {
2538
+ }) : /* @__PURE__ */ p(ge, {
2431
2539
  size: 18,
2432
2540
  "aria-hidden": "true",
2433
2541
  style: { color: "rgba(255,255,255,0.3)" }
2434
2542
  })
2435
- }), /* @__PURE__ */ p("div", {
2543
+ }), /* @__PURE__ */ m("div", {
2436
2544
  className: "sdk-chapters-panel-info",
2437
2545
  children: [
2438
- /* @__PURE__ */ f("div", {
2546
+ /* @__PURE__ */ p("div", {
2439
2547
  className: "sdk-chapters-panel-item-title",
2440
2548
  children: e.title
2441
2549
  }),
2442
- e.description && /* @__PURE__ */ f("div", {
2550
+ e.description && /* @__PURE__ */ p("div", {
2443
2551
  className: "sdk-chapters-panel-item-desc",
2444
2552
  children: e.description
2445
2553
  }),
2446
- /* @__PURE__ */ f("div", {
2554
+ /* @__PURE__ */ p("div", {
2447
2555
  className: "sdk-chapters-panel-item-time",
2448
2556
  "aria-hidden": "true",
2449
2557
  children: Q(e.startTime)
@@ -2454,28 +2562,28 @@ var We = ({ src: r, autoplay: i = !1, muted: a = !1, chapters: s = [], keyMoment
2454
2562
  })
2455
2563
  })]
2456
2564
  }),
2457
- /* @__PURE__ */ p("div", {
2565
+ /* @__PURE__ */ m("div", {
2458
2566
  className: "sdk-desktop-bottom",
2459
2567
  children: [
2460
- I.enableKeyMoments && gr && W.length > 0 && $e === "strip" && /* @__PURE__ */ f("div", {
2568
+ I.enableKeyMoments && Er && W.length > 0 && $e === "strip" && /* @__PURE__ */ p("div", {
2461
2569
  className: "sdk-desktop-chapters-strip",
2462
2570
  children: W.map((e, t) => {
2463
- let n = dr.index === t;
2464
- return /* @__PURE__ */ p("div", {
2571
+ let n = xr.index === t;
2572
+ return /* @__PURE__ */ m("div", {
2465
2573
  role: "button",
2466
2574
  tabIndex: 0,
2467
2575
  className: `sdk-desktop-chapter-card${n ? " active" : ""}`,
2468
2576
  "aria-label": `${e.title}, ${Q(e.startTime)}${n ? ", current chapter" : ""}`,
2469
2577
  "aria-current": n ? "true" : void 0,
2470
2578
  onClick: (t) => {
2471
- t.stopPropagation(), vi(e.startTime, e);
2579
+ t.stopPropagation(), Oi(e.startTime, e);
2472
2580
  },
2473
- onKeyDown: Bi(() => vi(e.startTime, e)),
2581
+ onKeyDown: Xi(() => Oi(e.startTime, e)),
2474
2582
  children: [
2475
- /* @__PURE__ */ f("div", {
2583
+ /* @__PURE__ */ p("div", {
2476
2584
  className: "sdk-desktop-chapter-thumb",
2477
- children: vr[t] || e.thumbnail ? /* @__PURE__ */ f("img", {
2478
- src: vr[t] || e.thumbnail,
2585
+ children: Or[t] || e.thumbnail ? /* @__PURE__ */ p("img", {
2586
+ src: Or[t] || e.thumbnail,
2479
2587
  alt: "",
2480
2588
  "aria-hidden": "true",
2481
2589
  style: {
@@ -2484,17 +2592,17 @@ var We = ({ src: r, autoplay: i = !1, muted: a = !1, chapters: s = [], keyMoment
2484
2592
  objectFit: "cover",
2485
2593
  display: "block"
2486
2594
  }
2487
- }) : /* @__PURE__ */ f(ve, {
2595
+ }) : /* @__PURE__ */ p(ge, {
2488
2596
  size: 18,
2489
2597
  "aria-hidden": "true",
2490
2598
  style: { color: "rgba(255,255,255,0.35)" }
2491
2599
  })
2492
2600
  }),
2493
- /* @__PURE__ */ f("div", {
2601
+ /* @__PURE__ */ p("div", {
2494
2602
  className: "sdk-desktop-chapter-title",
2495
2603
  children: e.title
2496
2604
  }),
2497
- /* @__PURE__ */ f("div", {
2605
+ /* @__PURE__ */ p("div", {
2498
2606
  className: "sdk-desktop-chapter-time",
2499
2607
  "aria-hidden": "true",
2500
2608
  children: Q(e.startTime)
@@ -2503,8 +2611,8 @@ var We = ({ src: r, autoplay: i = !1, muted: a = !1, chapters: s = [], keyMoment
2503
2611
  }, t);
2504
2612
  })
2505
2613
  }),
2506
- /* @__PURE__ */ f("div", {
2507
- ref: w,
2614
+ /* @__PURE__ */ p("div", {
2615
+ ref: E,
2508
2616
  role: X ? void 0 : "slider",
2509
2617
  "aria-label": X ? void 0 : "Seek",
2510
2618
  "aria-valuemin": X ? void 0 : 0,
@@ -2513,51 +2621,51 @@ var We = ({ src: r, autoplay: i = !1, muted: a = !1, chapters: s = [], keyMoment
2513
2621
  "aria-valuetext": X ? void 0 : `${Q(V(J === null ? L : J))} of ${Q(B)}`,
2514
2622
  tabIndex: X ? void 0 : 0,
2515
2623
  className: `sdk-seekbar-container sdk-desktop-seekbar${Y ? " sdk-ad-mode" : ""}`,
2516
- onMouseDown: X ? void 0 : fi,
2517
- onMouseMove: X ? void 0 : ki,
2518
- onMouseLeave: X ? void 0 : Mi,
2519
- onTouchStart: X ? void 0 : ji,
2520
- onKeyDown: X ? void 0 : Vi,
2624
+ onMouseDown: X ? void 0 : Si,
2625
+ onMouseMove: X ? void 0 : zi,
2626
+ onMouseLeave: X ? void 0 : Hi,
2627
+ onTouchStart: X ? void 0 : Vi,
2628
+ onKeyDown: X ? void 0 : Zi,
2521
2629
  style: { pointerEvents: X ? "none" : void 0 },
2522
- children: Y ? /* @__PURE__ */ f("div", {
2630
+ children: Y ? /* @__PURE__ */ p("div", {
2523
2631
  className: "sdk-ad-progress-fill",
2524
2632
  style: { width: (() => {
2525
- let e = F ? F.getCurrentTime() : L, t = Yn(e);
2633
+ let e = F ? F.getCurrentTime() : L, t = ar(e);
2526
2634
  return t ? `${Math.min(100, Math.max(0, (e - t.start) / (t.end - t.start) * 100))}%` : "0%";
2527
2635
  })() }
2528
- }) : /* @__PURE__ */ p(te, { children: [
2529
- /* @__PURE__ */ f("div", {
2636
+ }) : /* @__PURE__ */ m(ee, { children: [
2637
+ /* @__PURE__ */ p("div", {
2530
2638
  className: "sdk-seekbar-buffered",
2531
- style: { width: `${rn ? (F && F.getBufferedRanges()[0]?.end || 0) / rn * 100 : 0}%` }
2639
+ style: { width: `${sn ? (F && F.getBufferedRanges()[0]?.end || 0) / sn * 100 : 0}%` }
2532
2640
  }),
2533
- B > 0 && R.filter((e) => !On.has(e.startTime)).map((e, t) => /* @__PURE__ */ f("div", {
2641
+ B > 0 && R.filter((e) => !jn.has(e.startTime)).map((e, t) => /* @__PURE__ */ p("div", {
2534
2642
  className: "sdk-seekbar-adbreak",
2535
2643
  style: {
2536
2644
  left: `${V(e.startTime) / B * 100}%`,
2537
2645
  width: "3px"
2538
2646
  }
2539
2647
  }, t)),
2540
- /* @__PURE__ */ f("div", {
2648
+ /* @__PURE__ */ p("div", {
2541
2649
  className: "sdk-seekbar-progress",
2542
2650
  style: {
2543
- width: q ? `${Pi > 0 ? $ / Pi * 100 : 0}%` : `${B ? V(J === null ? L : J) / B * 100 : 0}%`,
2651
+ width: q ? `${Wi > 0 ? $ / Wi * 100 : 0}%` : `${B ? V(J === null ? L : J) / B * 100 : 0}%`,
2544
2652
  background: "#ffffff",
2545
2653
  boxShadow: "none"
2546
2654
  },
2547
- children: /* @__PURE__ */ f("div", { className: "sdk-seekbar-handle" })
2655
+ children: /* @__PURE__ */ p("div", { className: "sdk-seekbar-handle" })
2548
2656
  }),
2549
- I.enableKeyMoments && W.map((e, t) => B === 0 ? null : /* @__PURE__ */ f("div", {
2657
+ I.enableKeyMoments && W.map((e, t) => B === 0 ? null : /* @__PURE__ */ p("div", {
2550
2658
  className: "sdk-seekbar-chapter-marker sdk-desktop-chapter-dot",
2551
2659
  style: { left: `${V(e.startTime) / B * 100}%` }
2552
2660
  }, t)),
2553
- Ir !== null && Hr && /* @__PURE__ */ p("div", {
2661
+ Kr !== null && Qr && /* @__PURE__ */ m("div", {
2554
2662
  className: "sdk-thumbnail-tooltip",
2555
- style: { left: `${Rr}px` },
2663
+ style: { left: `${Jr}px` },
2556
2664
  children: [
2557
- /* @__PURE__ */ f("div", {
2665
+ /* @__PURE__ */ p("div", {
2558
2666
  className: "sdk-thumbnail-preview",
2559
- children: /* @__PURE__ */ f("img", {
2560
- src: Hr,
2667
+ children: /* @__PURE__ */ p("img", {
2668
+ src: Qr,
2561
2669
  alt: "preview",
2562
2670
  style: {
2563
2671
  width: "100%",
@@ -2568,115 +2676,115 @@ var We = ({ src: r, autoplay: i = !1, muted: a = !1, chapters: s = [], keyMoment
2568
2676
  }
2569
2677
  })
2570
2678
  }),
2571
- Wr && /* @__PURE__ */ f("div", {
2679
+ ei && /* @__PURE__ */ p("div", {
2572
2680
  className: "sdk-thumbnail-chapter-name",
2573
- children: Wr.title
2681
+ children: ei.title
2574
2682
  }),
2575
- /* @__PURE__ */ f("div", {
2683
+ /* @__PURE__ */ p("div", {
2576
2684
  className: "sdk-thumbnail-time-label",
2577
- children: Q(V(Br))
2685
+ children: Q(V(Xr))
2578
2686
  })
2579
2687
  ]
2580
2688
  })
2581
2689
  ] })
2582
2690
  }),
2583
- /* @__PURE__ */ p("div", {
2691
+ /* @__PURE__ */ m("div", {
2584
2692
  className: "sdk-desktop-controls-row",
2585
- children: [/* @__PURE__ */ p("div", {
2693
+ children: [/* @__PURE__ */ m("div", {
2586
2694
  className: "sdk-desktop-left-controls",
2587
- children: [!Y && /* @__PURE__ */ f("div", {
2695
+ children: [!Y && /* @__PURE__ */ p("div", {
2588
2696
  className: "sdk-time-display",
2589
- children: q ? `${Q($)} / ${Q(Pi)}` : `${Q(V(J === null ? L : J))} / ${Q(B)}`
2590
- }), et === "slider" && /* @__PURE__ */ p("div", {
2697
+ children: q ? `${Q($)} / ${Q(Wi)}` : `${Q(V(J === null ? L : J))} / ${Q(B)}`
2698
+ }), et === "slider" && /* @__PURE__ */ m("div", {
2591
2699
  className: "sdk-volume-control",
2592
- children: [/* @__PURE__ */ f("button", {
2700
+ children: [/* @__PURE__ */ p("button", {
2593
2701
  className: "sdk-desktop-icon-btn",
2594
2702
  onClick: (e) => {
2595
- e.stopPropagation(), pi();
2703
+ e.stopPropagation(), Ci();
2596
2704
  },
2597
- "data-tooltip": Ii ? "Unmute" : "Mute",
2598
- "aria-label": Ii ? "Unmute" : "Mute",
2599
- "aria-pressed": Ii,
2600
- children: Ri()
2601
- }), /* @__PURE__ */ f("input", {
2705
+ "data-tooltip": Ki ? "Unmute" : "Mute",
2706
+ "aria-label": Ki ? "Unmute" : "Mute",
2707
+ "aria-pressed": Ki,
2708
+ children: Ji()
2709
+ }), /* @__PURE__ */ p("input", {
2602
2710
  type: "range",
2603
2711
  className: "sdk-volume-slider",
2604
2712
  min: 0,
2605
2713
  max: 1,
2606
2714
  step: .02,
2607
- value: Ii ? 0 : Fi,
2715
+ value: Ki ? 0 : Gi,
2608
2716
  "aria-label": "Volume",
2609
- "aria-valuetext": Ii ? "Muted" : `${Math.round(Fi * 100)}%`,
2610
- style: { "--vol-pct": Math.round((Ii ? 0 : Fi) * 100) },
2717
+ "aria-valuetext": Ki ? "Muted" : `${Math.round(Gi * 100)}%`,
2718
+ style: { "--vol-pct": Math.round((Ki ? 0 : Gi) * 100) },
2611
2719
  onChange: (e) => {
2612
2720
  let t = parseFloat(e.target.value);
2613
- q ? (F?.casting.remoteSetVolume(t), t > 0 && F?.casting.remoteSetMute(!1)) : (F?.setVolume(t), t > 0 && cn && F?.setMute(!1));
2721
+ q ? (F?.casting.remoteSetVolume(t), t > 0 && F?.casting.remoteSetMute(!1)) : (F?.setVolume(t), t > 0 && dn && F?.setMute(!1));
2614
2722
  },
2615
2723
  onClick: (e) => e.stopPropagation()
2616
2724
  })]
2617
2725
  })]
2618
- }), /* @__PURE__ */ p("div", {
2726
+ }), /* @__PURE__ */ m("div", {
2619
2727
  className: "sdk-desktop-right-icons",
2620
2728
  children: [
2621
- I.enableKeyMoments && W.length > 0 && !Y && /* @__PURE__ */ f("button", {
2622
- className: `sdk-desktop-icon-btn${gr ? " active" : ""}`,
2729
+ I.enableKeyMoments && W.length > 0 && !Y && /* @__PURE__ */ p("button", {
2730
+ className: `sdk-desktop-icon-btn${Er ? " active" : ""}`,
2623
2731
  onClick: (e) => {
2624
- e.stopPropagation(), _r(!gr);
2732
+ e.stopPropagation(), Dr(!Er);
2625
2733
  },
2626
2734
  "data-tooltip": "Key Moments",
2627
- "aria-label": gr ? "Hide chapters" : "Show chapters",
2628
- "aria-pressed": gr,
2629
- children: /* @__PURE__ */ f(ve, {
2735
+ "aria-label": Er ? "Hide chapters" : "Show chapters",
2736
+ "aria-pressed": Er,
2737
+ children: /* @__PURE__ */ p(ge, {
2630
2738
  size: 20,
2631
2739
  "aria-hidden": "true"
2632
2740
  })
2633
2741
  }),
2634
- I.enableSubtitles && !Y && ar.some((e) => !e.isNative) && /* @__PURE__ */ p("div", {
2742
+ I.enableSubtitles && !Y && hr.some((e) => !e.isNative) && /* @__PURE__ */ m("div", {
2635
2743
  className: "sdk-menu-container",
2636
- children: [/* @__PURE__ */ f("button", {
2744
+ children: [/* @__PURE__ */ p("button", {
2637
2745
  className: `sdk-desktop-icon-btn${U === "off" ? "" : " active"}`,
2638
2746
  onClick: (e) => {
2639
- e.stopPropagation(), Hi("subtitles");
2747
+ e.stopPropagation(), Qi("subtitles");
2640
2748
  },
2641
2749
  "data-tooltip": "Captions",
2642
2750
  "aria-label": "Captions",
2643
2751
  "aria-haspopup": "listbox",
2644
2752
  "aria-expanded": G === "subtitles",
2645
- children: /* @__PURE__ */ f(fe, {
2753
+ children: /* @__PURE__ */ p(ue, {
2646
2754
  size: 20,
2647
2755
  "aria-hidden": "true"
2648
2756
  })
2649
- }), G === "subtitles" && /* @__PURE__ */ p("div", {
2650
- ref: Ui,
2757
+ }), G === "subtitles" && /* @__PURE__ */ m("div", {
2758
+ ref: $i,
2651
2759
  className: "sdk-dropup-menu",
2652
2760
  role: "listbox",
2653
2761
  "aria-label": "Captions",
2654
2762
  children: [
2655
- /* @__PURE__ */ f("div", {
2763
+ /* @__PURE__ */ p("div", {
2656
2764
  className: "sdk-dropup-header",
2657
2765
  "aria-hidden": "true",
2658
2766
  children: "Subtitles"
2659
2767
  }),
2660
- /* @__PURE__ */ p("div", {
2768
+ /* @__PURE__ */ m("div", {
2661
2769
  role: "option",
2662
2770
  "aria-selected": U === "off",
2663
2771
  tabIndex: 0,
2664
2772
  className: `sdk-dropup-item ${U === "off" ? "active" : ""}`,
2665
- onClick: () => gi("off"),
2666
- onKeyDown: zi(() => gi("off")),
2667
- children: [/* @__PURE__ */ f("span", { children: "Off" }), U === "off" && /* @__PURE__ */ f(_, {
2773
+ onClick: () => Ei("off"),
2774
+ onKeyDown: Yi(() => Ei("off")),
2775
+ children: [/* @__PURE__ */ p("span", { children: "Off" }), U === "off" && /* @__PURE__ */ p(y, {
2668
2776
  size: 12,
2669
2777
  "aria-hidden": "true"
2670
2778
  })]
2671
2779
  }),
2672
- ar.map((e) => /* @__PURE__ */ p("div", {
2780
+ hr.map((e) => /* @__PURE__ */ m("div", {
2673
2781
  role: "option",
2674
2782
  "aria-selected": U === e.id,
2675
2783
  tabIndex: 0,
2676
2784
  className: `sdk-dropup-item ${U === e.id ? "active" : ""}`,
2677
- onClick: () => gi(e.id),
2678
- onKeyDown: zi(() => gi(e.id)),
2679
- children: [/* @__PURE__ */ f("span", { children: b(e) }), U === e.id && /* @__PURE__ */ f(_, {
2785
+ onClick: () => Ei(e.id),
2786
+ onKeyDown: Yi(() => Ei(e.id)),
2787
+ children: [/* @__PURE__ */ p("span", { children: x(e) }), U === e.id && /* @__PURE__ */ p(y, {
2680
2788
  size: 12,
2681
2789
  "aria-hidden": "true"
2682
2790
  })]
@@ -2684,69 +2792,69 @@ var We = ({ src: r, autoplay: i = !1, muted: a = !1, chapters: s = [], keyMoment
2684
2792
  ]
2685
2793
  })]
2686
2794
  }),
2687
- I.allowMultipleAudio && sr.length > 1 && !Y && /* @__PURE__ */ p("div", {
2795
+ I.allowMultipleAudio && _r.length > 1 && !Y && /* @__PURE__ */ m("div", {
2688
2796
  className: "sdk-menu-container",
2689
- children: [/* @__PURE__ */ f("button", {
2797
+ children: [/* @__PURE__ */ p("button", {
2690
2798
  className: `sdk-desktop-icon-btn${G === "audio" ? " active" : ""}`,
2691
2799
  onClick: (e) => {
2692
- e.stopPropagation(), Hi("audio");
2800
+ e.stopPropagation(), Qi("audio");
2693
2801
  },
2694
2802
  "data-tooltip": "Audio Track",
2695
2803
  "aria-label": "Audio track",
2696
2804
  "aria-haspopup": "listbox",
2697
2805
  "aria-expanded": G === "audio",
2698
- children: /* @__PURE__ */ f(_e, {
2806
+ children: /* @__PURE__ */ p(he, {
2699
2807
  size: 20,
2700
2808
  "aria-hidden": "true"
2701
2809
  })
2702
- }), G === "audio" && /* @__PURE__ */ p("div", {
2703
- ref: Ui,
2810
+ }), G === "audio" && /* @__PURE__ */ m("div", {
2811
+ ref: $i,
2704
2812
  className: "sdk-dropup-menu",
2705
2813
  role: "listbox",
2706
2814
  "aria-label": "Audio track",
2707
- children: [/* @__PURE__ */ f("div", {
2815
+ children: [/* @__PURE__ */ p("div", {
2708
2816
  className: "sdk-dropup-header",
2709
2817
  "aria-hidden": "true",
2710
2818
  children: "Audio Track"
2711
- }), sr.map((e) => /* @__PURE__ */ p("div", {
2819
+ }), _r.map((e) => /* @__PURE__ */ m("div", {
2712
2820
  role: "option",
2713
- "aria-selected": lr === e.id,
2821
+ "aria-selected": yr === e.id,
2714
2822
  tabIndex: 0,
2715
- className: `sdk-dropup-item ${lr === e.id ? "active" : ""}`,
2823
+ className: `sdk-dropup-item ${yr === e.id ? "active" : ""}`,
2716
2824
  onClick: () => {
2717
- F?.setAudioTrack(e.id), ur(e.id), K("none"), xr(`Audio: ${b(e)}`);
2825
+ F?.setAudioTrack(e.id), br(e.id), K("none"), jr(`Audio: ${x(e)}`);
2718
2826
  },
2719
- onKeyDown: zi(() => {
2720
- F?.setAudioTrack(e.id), ur(e.id), K("none"), xr(`Audio: ${b(e)}`);
2827
+ onKeyDown: Yi(() => {
2828
+ F?.setAudioTrack(e.id), br(e.id), K("none"), jr(`Audio: ${x(e)}`);
2721
2829
  }),
2722
- children: [/* @__PURE__ */ f("span", { children: b(e) }), lr === e.id && /* @__PURE__ */ f(_, {
2830
+ children: [/* @__PURE__ */ p("span", { children: x(e) }), yr === e.id && /* @__PURE__ */ p(y, {
2723
2831
  size: 12,
2724
2832
  "aria-hidden": "true"
2725
2833
  })]
2726
2834
  }, e.id))]
2727
2835
  })]
2728
2836
  }),
2729
- I.enablePlaybackSpeed && !Y && /* @__PURE__ */ p("div", {
2837
+ I.enablePlaybackSpeed && !Y && /* @__PURE__ */ m("div", {
2730
2838
  className: "sdk-menu-container",
2731
- children: [/* @__PURE__ */ f("button", {
2839
+ children: [/* @__PURE__ */ p("button", {
2732
2840
  className: `sdk-desktop-icon-btn${G === "speed" ? " active" : ""}`,
2733
2841
  onClick: (e) => {
2734
- e.stopPropagation(), Hi("speed");
2842
+ e.stopPropagation(), Qi("speed");
2735
2843
  },
2736
2844
  "data-tooltip": "Playback Speed",
2737
2845
  "aria-label": "Playback speed",
2738
2846
  "aria-haspopup": "listbox",
2739
2847
  "aria-expanded": G === "speed",
2740
- children: /* @__PURE__ */ f(ge, {
2848
+ children: /* @__PURE__ */ p(me, {
2741
2849
  size: 20,
2742
2850
  "aria-hidden": "true"
2743
2851
  })
2744
- }), G === "speed" && /* @__PURE__ */ p("div", {
2745
- ref: Ui,
2852
+ }), G === "speed" && /* @__PURE__ */ m("div", {
2853
+ ref: $i,
2746
2854
  className: "sdk-dropup-menu",
2747
2855
  role: "listbox",
2748
2856
  "aria-label": "Playback speed",
2749
- children: [/* @__PURE__ */ f("div", {
2857
+ children: [/* @__PURE__ */ p("div", {
2750
2858
  className: "sdk-dropup-header",
2751
2859
  "aria-hidden": "true",
2752
2860
  children: "Speed"
@@ -2757,128 +2865,128 @@ var We = ({ src: r, autoplay: i = !1, muted: a = !1, chapters: s = [], keyMoment
2757
2865
  1.25,
2758
2866
  1.5,
2759
2867
  2
2760
- ].map((e) => /* @__PURE__ */ p("div", {
2868
+ ].map((e) => /* @__PURE__ */ m("div", {
2761
2869
  role: "option",
2762
- "aria-selected": mr === e,
2870
+ "aria-selected": wr === e,
2763
2871
  tabIndex: 0,
2764
- className: `sdk-dropup-item ${mr === e ? "active" : ""}`,
2765
- onClick: () => mi(e),
2766
- onKeyDown: zi(() => mi(e)),
2767
- children: [/* @__PURE__ */ f("span", { children: e === 1 ? "Normal" : `${e}x` }), mr === e && /* @__PURE__ */ f(_, {
2872
+ className: `sdk-dropup-item ${wr === e ? "active" : ""}`,
2873
+ onClick: () => wi(e),
2874
+ onKeyDown: Yi(() => wi(e)),
2875
+ children: [/* @__PURE__ */ p("span", { children: e === 1 ? "Normal" : `${e}x` }), wr === e && /* @__PURE__ */ p(y, {
2768
2876
  size: 12,
2769
2877
  "aria-hidden": "true"
2770
2878
  })]
2771
2879
  }, e))]
2772
2880
  })]
2773
2881
  }),
2774
- I.enableQuality && !Y && /* @__PURE__ */ p("div", {
2882
+ I.enableQuality && !Y && /* @__PURE__ */ m("div", {
2775
2883
  className: "sdk-menu-container",
2776
- children: [/* @__PURE__ */ f("button", {
2777
- className: `sdk-desktop-icon-btn${er.id === -1 ? "" : " active"}`,
2884
+ children: [/* @__PURE__ */ p("button", {
2885
+ className: `sdk-desktop-icon-btn${ur.id === -1 ? "" : " active"}`,
2778
2886
  onClick: (e) => {
2779
- e.stopPropagation(), Hi("quality");
2887
+ e.stopPropagation(), Qi("quality");
2780
2888
  },
2781
2889
  "data-tooltip": "Quality",
2782
2890
  "aria-label": "Video quality",
2783
2891
  "aria-haspopup": "listbox",
2784
2892
  "aria-expanded": G === "quality",
2785
- children: /* @__PURE__ */ f(Ne, {
2893
+ children: /* @__PURE__ */ p(Me, {
2786
2894
  size: 20,
2787
2895
  "aria-hidden": "true"
2788
2896
  })
2789
- }), G === "quality" && /* @__PURE__ */ p("div", {
2790
- ref: Ui,
2897
+ }), G === "quality" && /* @__PURE__ */ m("div", {
2898
+ ref: $i,
2791
2899
  className: "sdk-dropup-menu large",
2792
2900
  role: "listbox",
2793
2901
  "aria-label": "Video quality",
2794
- children: [/* @__PURE__ */ f("div", {
2902
+ children: [/* @__PURE__ */ p("div", {
2795
2903
  className: "sdk-dropup-header",
2796
2904
  "aria-hidden": "true",
2797
2905
  children: "Quality"
2798
- }), Qn.map((e) => /* @__PURE__ */ p("div", {
2906
+ }), cr.map((e) => /* @__PURE__ */ m("div", {
2799
2907
  role: "option",
2800
- "aria-selected": er.id === e.id,
2908
+ "aria-selected": ur.id === e.id,
2801
2909
  tabIndex: 0,
2802
- className: `sdk-dropup-item ${er.id === e.id ? "active" : ""}`,
2803
- onClick: () => hi(e.id),
2804
- onKeyDown: zi(() => hi(e.id)),
2805
- children: [/* @__PURE__ */ f("span", { children: e.label }), er.id === e.id && /* @__PURE__ */ f(_, {
2910
+ className: `sdk-dropup-item ${ur.id === e.id ? "active" : ""}`,
2911
+ onClick: () => Ti(e.id),
2912
+ onKeyDown: Yi(() => Ti(e.id)),
2913
+ children: [/* @__PURE__ */ p("span", { children: e.label }), ur.id === e.id && /* @__PURE__ */ p(y, {
2806
2914
  size: 12,
2807
2915
  "aria-hidden": "true"
2808
2916
  })]
2809
2917
  }, e.id))]
2810
2918
  })]
2811
2919
  }),
2812
- S && S.length > 1 && !Y && /* @__PURE__ */ p("div", {
2920
+ w && w.length > 1 && !Y && /* @__PURE__ */ m("div", {
2813
2921
  className: "sdk-menu-container",
2814
- children: [/* @__PURE__ */ f("button", {
2922
+ children: [/* @__PURE__ */ p("button", {
2815
2923
  className: `sdk-desktop-icon-btn${G === "sources" ? " active" : ""}`,
2816
2924
  onClick: (e) => {
2817
- e.stopPropagation(), Hi("sources");
2925
+ e.stopPropagation(), Qi("sources");
2818
2926
  },
2819
2927
  "data-tooltip": "Select Source",
2820
2928
  "aria-label": "Select source",
2821
2929
  "aria-haspopup": "listbox",
2822
2930
  "aria-expanded": G === "sources",
2823
- children: /* @__PURE__ */ f(Pe, {
2931
+ children: /* @__PURE__ */ p(Ne, {
2824
2932
  size: 20,
2825
2933
  "aria-hidden": "true"
2826
2934
  })
2827
- }), G === "sources" && /* @__PURE__ */ p("div", {
2828
- ref: Ui,
2935
+ }), G === "sources" && /* @__PURE__ */ m("div", {
2936
+ ref: $i,
2829
2937
  className: "sdk-dropup-menu",
2830
2938
  role: "listbox",
2831
2939
  "aria-label": "Select source",
2832
- children: [/* @__PURE__ */ f("div", {
2940
+ children: [/* @__PURE__ */ p("div", {
2833
2941
  className: "sdk-dropup-header",
2834
2942
  "aria-hidden": "true",
2835
2943
  children: "Source"
2836
- }), S.map((e, t) => /* @__PURE__ */ p("div", {
2944
+ }), w.map((e, t) => /* @__PURE__ */ m("div", {
2837
2945
  role: "option",
2838
2946
  "aria-selected": st === t,
2839
2947
  tabIndex: 0,
2840
2948
  className: `sdk-dropup-item ${st === t ? "active" : ""}`,
2841
- onClick: () => _i(t),
2842
- onKeyDown: zi(() => _i(t)),
2843
- children: [/* @__PURE__ */ f("span", { children: e.label }), st === t && /* @__PURE__ */ f(_, {
2949
+ onClick: () => Di(t),
2950
+ onKeyDown: Yi(() => Di(t)),
2951
+ children: [/* @__PURE__ */ p("span", { children: e.label }), st === t && /* @__PURE__ */ p(y, {
2844
2952
  size: 12,
2845
2953
  "aria-hidden": "true"
2846
2954
  })]
2847
2955
  }, t))]
2848
2956
  })]
2849
2957
  }),
2850
- I.enablePiP && !Y && /* @__PURE__ */ f("button", {
2851
- className: `sdk-desktop-icon-btn${yn ? " active" : ""}`,
2958
+ I.enablePiP && !Y && /* @__PURE__ */ p("button", {
2959
+ className: `sdk-desktop-icon-btn${Sn ? " active" : ""}`,
2852
2960
  onClick: (e) => {
2853
- e.stopPropagation(), bi();
2961
+ e.stopPropagation(), Ai();
2854
2962
  },
2855
2963
  "data-tooltip": "Picture-in-Picture",
2856
- "aria-label": yn ? "Exit picture-in-picture" : "Enter picture-in-picture",
2857
- "aria-pressed": yn,
2858
- children: /* @__PURE__ */ f(xe, {
2964
+ "aria-label": Sn ? "Exit picture-in-picture" : "Enter picture-in-picture",
2965
+ "aria-pressed": Sn,
2966
+ children: /* @__PURE__ */ p(ye, {
2859
2967
  size: 20,
2860
2968
  "aria-hidden": "true"
2861
2969
  })
2862
2970
  }),
2863
- et === "button" && /* @__PURE__ */ f("button", {
2971
+ et === "button" && /* @__PURE__ */ p("button", {
2864
2972
  className: "sdk-desktop-icon-btn",
2865
2973
  onClick: (e) => {
2866
- e.stopPropagation(), pi();
2974
+ e.stopPropagation(), Ci();
2867
2975
  },
2868
- "data-tooltip": Ii ? "Unmute" : "Mute",
2869
- "aria-label": Ii ? "Unmute" : "Mute",
2870
- "aria-pressed": Ii,
2871
- children: Ri()
2976
+ "data-tooltip": Ki ? "Unmute" : "Mute",
2977
+ "aria-label": Ki ? "Unmute" : "Mute",
2978
+ "aria-pressed": Ki,
2979
+ children: Ji()
2872
2980
  }),
2873
- qe && /* @__PURE__ */ f("button", {
2981
+ qe && /* @__PURE__ */ p("button", {
2874
2982
  className: "sdk-desktop-icon-btn",
2875
2983
  onClick: (e) => {
2876
- e.stopPropagation(), Si();
2984
+ e.stopPropagation(), Mi();
2877
2985
  },
2878
- "data-tooltip": fn || mn ? "Exit fullscreen" : "Fullscreen",
2879
- "aria-label": fn || mn ? "Exit fullscreen" : "Enter fullscreen",
2880
- "aria-pressed": fn || mn,
2881
- children: f(fn ? be : ye, {
2986
+ "data-tooltip": hn || _n ? "Exit fullscreen" : "Fullscreen",
2987
+ "aria-label": hn || _n ? "Exit fullscreen" : "Enter fullscreen",
2988
+ "aria-pressed": hn || _n,
2989
+ children: p(hn ? ve : _e, {
2882
2990
  size: 20,
2883
2991
  "aria-hidden": "true"
2884
2992
  })
@@ -2890,16 +2998,16 @@ var We = ({ src: r, autoplay: i = !1, muted: a = !1, chapters: s = [], keyMoment
2890
2998
  })
2891
2999
  ] })]
2892
3000
  }),
2893
- xn && (() => {
3001
+ wn && (() => {
2894
3002
  let e = R.find((e) => $ >= e.startTime && $ < e.endTime), t = e ? e.endTime - e.startTime : B, n = e ? Math.max(0, $ - e.startTime) : V($);
2895
- return ee(/* @__PURE__ */ p("div", {
2896
- className: `gb-pip-overlay${Ni ? "" : " gb-pip-paused"}`,
3003
+ return f(/* @__PURE__ */ m("div", {
3004
+ className: `gb-pip-overlay${Ui ? "" : " gb-pip-paused"}`,
2897
3005
  children: [
2898
- /* @__PURE__ */ f("div", {}),
2899
- /* @__PURE__ */ p("div", {
3006
+ /* @__PURE__ */ p("div", {}),
3007
+ /* @__PURE__ */ m("div", {
2900
3008
  className: "gb-pip-center",
2901
3009
  children: [
2902
- /* @__PURE__ */ f("button", {
3010
+ /* @__PURE__ */ p("button", {
2903
3011
  className: "gb-pip-btn",
2904
3012
  onClick: () => Z(H(Math.max(0, V($) - 10)), {
2905
3013
  eventType: "fast_backward",
@@ -2907,28 +3015,28 @@ var We = ({ src: r, autoplay: i = !1, muted: a = !1, chapters: s = [], keyMoment
2907
3015
  }),
2908
3016
  "aria-label": "Rewind 10 seconds",
2909
3017
  disabled: Y,
2910
- children: /* @__PURE__ */ f(Ce, {
3018
+ children: /* @__PURE__ */ p(xe, {
2911
3019
  size: 20,
2912
3020
  "aria-hidden": "true"
2913
3021
  })
2914
3022
  }),
2915
- /* @__PURE__ */ f("button", {
3023
+ /* @__PURE__ */ p("button", {
2916
3024
  className: "gb-pip-btn gb-pip-play",
2917
- onClick: ui,
2918
- "aria-label": Cn ? "Replay" : Ni ? "Pause" : "Play",
2919
- children: Cn ? /* @__PURE__ */ f(Ce, {
3025
+ onClick: bi,
3026
+ "aria-label": En ? "Replay" : Ui ? "Pause" : "Play",
3027
+ children: En ? /* @__PURE__ */ p(xe, {
2920
3028
  size: 24,
2921
3029
  "aria-hidden": "true"
2922
- }) : Ni ? /* @__PURE__ */ f(v, {
3030
+ }) : Ui ? /* @__PURE__ */ p(b, {
2923
3031
  size: 24,
2924
3032
  "aria-hidden": "true"
2925
- }) : /* @__PURE__ */ f(Se, {
3033
+ }) : /* @__PURE__ */ p(be, {
2926
3034
  size: 24,
2927
3035
  "aria-hidden": "true",
2928
3036
  style: { marginLeft: 2 }
2929
3037
  })
2930
3038
  }),
2931
- /* @__PURE__ */ f("button", {
3039
+ /* @__PURE__ */ p("button", {
2932
3040
  className: "gb-pip-btn",
2933
3041
  onClick: () => Z(H(Math.min(B, V($) + 10)), {
2934
3042
  eventType: "fast_forward",
@@ -2936,23 +3044,23 @@ var We = ({ src: r, autoplay: i = !1, muted: a = !1, chapters: s = [], keyMoment
2936
3044
  }),
2937
3045
  "aria-label": "Skip forward 10 seconds",
2938
3046
  disabled: Y,
2939
- children: /* @__PURE__ */ f(we, {
3047
+ children: /* @__PURE__ */ p(Se, {
2940
3048
  size: 20,
2941
3049
  "aria-hidden": "true"
2942
3050
  })
2943
3051
  })
2944
3052
  ]
2945
3053
  }),
2946
- /* @__PURE__ */ p("div", {
3054
+ /* @__PURE__ */ m("div", {
2947
3055
  className: "gb-pip-bottom",
2948
- children: [/* @__PURE__ */ f("div", {
3056
+ children: [/* @__PURE__ */ p("div", {
2949
3057
  className: "gb-pip-progress",
2950
- onClick: xi,
2951
- children: /* @__PURE__ */ f("div", {
3058
+ onClick: ji,
3059
+ children: /* @__PURE__ */ p("div", {
2952
3060
  className: "gb-pip-progress-fill",
2953
3061
  style: { width: `${t ? n / t * 100 : 0}%` }
2954
3062
  })
2955
- }), /* @__PURE__ */ p("div", {
3063
+ }), /* @__PURE__ */ m("div", {
2956
3064
  className: "gb-pip-time",
2957
3065
  children: [
2958
3066
  Q(n),
@@ -2962,30 +3070,30 @@ var We = ({ src: r, autoplay: i = !1, muted: a = !1, chapters: s = [], keyMoment
2962
3070
  })]
2963
3071
  })
2964
3072
  ]
2965
- }), xn.document.body);
3073
+ }), wn.document.body);
2966
3074
  })()
2967
3075
  ]
2968
3076
  });
2969
- }, Ge = "https://dev-api.go-boss.com";
2970
- function Ke(e) {
3077
+ }, Ke = "https://dev-api.go-boss.com";
3078
+ function S(e) {
2971
3079
  return {
2972
3080
  "x-player-key": e,
2973
3081
  "Content-Type": "application/json"
2974
3082
  };
2975
3083
  }
2976
- async function qe(e, t = Ge, n = {}) {
3084
+ async function qe(e, t = Ke, n = {}) {
2977
3085
  let r = await fetch(`${t}/api/player/sdk/init`, {
2978
3086
  method: "POST",
2979
- headers: Ke(e),
3087
+ headers: S(e),
2980
3088
  body: JSON.stringify({ videoUrl: n.videoUrl })
2981
3089
  });
2982
3090
  if (!r.ok) throw Error(`SDK init failed: ${r.status}`);
2983
3091
  return await r.json();
2984
3092
  }
2985
- async function Je(e, t, n = Ge) {
3093
+ async function Je(e, t, n = Ke) {
2986
3094
  let { sessionId: r, videoId: i, videoTitle: a, videoUrl: o, contentDurationSec: s } = t, c = await fetch(`${n}/api/player/sdk/session/start`, {
2987
3095
  method: "POST",
2988
- headers: Ke(e),
3096
+ headers: S(e),
2989
3097
  body: JSON.stringify({
2990
3098
  sessionId: r,
2991
3099
  videoId: i,
@@ -2996,22 +3104,22 @@ async function Je(e, t, n = Ge) {
2996
3104
  });
2997
3105
  if (!c.ok) throw Error(`Session start failed: ${c.status}`);
2998
3106
  }
2999
- async function Ye(e, t, n, r, i = Ge) {
3107
+ async function Ye(e, t, n, r, i = Ke) {
3000
3108
  let a = {
3001
3109
  sessionId: t,
3002
3110
  currentTime: n,
3003
3111
  duration: r
3004
3112
  }, o = await fetch(`${i}/api/player/sdk/session/heartbeat`, {
3005
3113
  method: "POST",
3006
- headers: Ke(e),
3114
+ headers: S(e),
3007
3115
  body: JSON.stringify(a)
3008
3116
  });
3009
3117
  if (!o.ok) throw Error(`Heartbeat failed: ${o.status}`);
3010
3118
  }
3011
- async function Xe(e, t, n = 0, r = 0, i = Ge) {
3119
+ async function Xe(e, t, n = 0, r = 0, i = Ke) {
3012
3120
  let a = await fetch(`${i}/api/player/sdk/session/end`, {
3013
3121
  method: "POST",
3014
- headers: Ke(e),
3122
+ headers: S(e),
3015
3123
  body: JSON.stringify({
3016
3124
  sessionId: t,
3017
3125
  currentTime: n,
@@ -3020,18 +3128,18 @@ async function Xe(e, t, n = 0, r = 0, i = Ge) {
3020
3128
  });
3021
3129
  if (!a.ok) throw Error(`Session end failed: ${a.status}`);
3022
3130
  }
3023
- async function Ze(e, t, n = Ge) {
3131
+ async function Ze(e, t, n = Ke) {
3024
3132
  let r = await fetch(`${n}/api/player/sdk/events`, {
3025
3133
  method: "POST",
3026
- headers: Ke(e),
3134
+ headers: S(e),
3027
3135
  body: JSON.stringify(t)
3028
3136
  });
3029
3137
  if (!r.ok) throw Error(`Event ${t.eventType} failed: ${r.status}`);
3030
3138
  }
3031
- function Qe(e, t, n = 0, r = 0, i = Ge) {
3139
+ function Qe(e, t, n = 0, r = 0, i = Ke) {
3032
3140
  fetch(`${i}/api/player/sdk/session/end`, {
3033
3141
  method: "POST",
3034
- headers: Ke(e),
3142
+ headers: S(e),
3035
3143
  body: JSON.stringify({
3036
3144
  sessionId: t,
3037
3145
  currentTime: n,
@@ -3042,7 +3150,7 @@ function Qe(e, t, n = 0, r = 0, i = Ge) {
3042
3150
  }
3043
3151
  //#endregion
3044
3152
  //#region src/delegate.ts
3045
- function x() {
3153
+ function C() {
3046
3154
  if (!(typeof screen > "u")) return screen.orientation?.type ?? void 0;
3047
3155
  }
3048
3156
  var $e = class {
@@ -3107,10 +3215,10 @@ var $e = class {
3107
3215
  break;
3108
3216
  }
3109
3217
  case "fullscreen_enter":
3110
- this.call("playerDidEnterFullscreen", x());
3218
+ this.call("playerDidEnterFullscreen", C());
3111
3219
  break;
3112
3220
  case "fullscreen_exit":
3113
- this.call("playerDidExitFullscreen", x());
3221
+ this.call("playerDidExitFullscreen", C());
3114
3222
  break;
3115
3223
  case "key_moments": {
3116
3224
  let t = e.momentTitle ?? "", n = e.momentTime ?? e.currentTime, r = this.keyMoments, i = r.findIndex((e) => t && e.title === t || e.startTime === n), a = i >= 0 ? r[i] : void 0;
@@ -3309,141 +3417,141 @@ function at(e, t) {
3309
3417
  default: return null;
3310
3418
  }
3311
3419
  }
3312
- function ot({ playerKey: e, src: t, subtitles: n, licenseKey: r, themeColor: i = "#6366f1", firebaseConfig: a, proxyDomains: s, apiBaseUrl: l, adTrackingUrl: ee, overlayAdUrl: te, videoId: ne, title: m, watermark: ie, autoplay: h = !1, muted: ae = !1, autoFullscreen: oe = !1, enableControls: se = !0, enableSkipAd: ce, skipAdAfterSeconds: le, chaptersDisplayMode: ue = "strip", volumeControlType: g = "slider", subtitleStyle: de, drmConfig: fe, onAnalyticsEvent: pe, delegate: _, onKeyMomentsLoaded: me, initialTime: he, onTimeUpdate: ge }) {
3313
- let [_e, ve] = d([]), [ye, be] = d(0), [v] = d(() => new $e());
3420
+ function ot({ playerKey: e, src: t, subtitles: n, licenseKey: r, themeColor: i = "#6366f1", firebaseConfig: a, proxyDomains: s, apiBaseUrl: l, adTrackingUrl: f, overlayAdUrl: ee, videoId: te, title: h, watermark: g, autoplay: _ = !1, muted: re = !1, autoFullscreen: ie = !1, enableControls: ae = !0, enableSkipAd: oe, skipAdAfterSeconds: se, chaptersDisplayMode: ce = "strip", volumeControlType: v = "slider", subtitleStyle: le, drmConfig: ue, onAnalyticsEvent: de, delegate: y, onKeyMomentsLoaded: fe, initialTime: pe, onTimeUpdate: me }) {
3421
+ let [he, ge] = d([]), [_e, ve] = d(0), [b] = d(() => new $e());
3314
3422
  c(() => {
3315
- v.setDelegate(_), v.setAutoplay(h);
3423
+ b.setDelegate(y), b.setAutoplay(_);
3316
3424
  }, [
3317
- v,
3318
- _,
3319
- h
3320
- ]), c(() => () => v.notifyDismissed(), [v]);
3321
- let xe = Array.isArray(t) ? t : [{
3425
+ b,
3426
+ y,
3427
+ _
3428
+ ]), c(() => () => b.notifyDismissed(), [b]);
3429
+ let ye = Array.isArray(t) ? t : [{
3322
3430
  label: "Default",
3323
3431
  url: t
3324
- }], Se = xe[ye]?.url ?? xe[0]?.url ?? "", [Ce, we] = d("loading"), [Te, Ee] = d(null), [De, Oe] = d(0), [ke, Ae] = d("network"), je = u(null), Me = u(!1), y = u(""), Ne = u(!1), Pe = u(!1), Fe = u(void 0), Ie = u(!1), Le = u(it), b = u(null), Re = u(0), ze = u(null), Be = u({
3432
+ }], be = ye[_e]?.url ?? ye[0]?.url ?? "", [xe, Se] = d("loading"), [Ce, we] = d(null), [Te, Ee] = d(0), [De, Oe] = d("network"), ke = u(null), Ae = u(!1), je = u(""), Me = u(!1), Ne = u(!1), Pe = u(void 0), Fe = u(!1), Ie = u(it), x = u(null), Le = u(0), Re = u(null), ze = u({
3325
3433
  currentTime: 0,
3326
3434
  duration: 0
3327
- }), Ve = u(() => {}), He = Se.split("/").filter(Boolean), Ue = ne || (He[He.length - 1] ?? "").replace(/\.m3u8.*$/, "") || "video", Ge = u(Se);
3435
+ }), Be = u(() => {}), Ve = be.split("/").filter(Boolean), He = te || (Ve[Ve.length - 1] ?? "").replace(/\.m3u8.*$/, "") || "video", Ue = u(be);
3328
3436
  c(() => {
3329
- Ge.current = Se;
3330
- }, [Se]);
3331
- let Ke = o(() => nt(s), [s])(), x = rt(i);
3437
+ Ue.current = be;
3438
+ }, [be]);
3439
+ let We = o(() => nt(s), [s])(), Ke = rt(i);
3332
3440
  c(() => {
3333
- document.documentElement.style.setProperty("--accent-indigo", i), document.documentElement.style.setProperty("--accent-indigo-rgb", x);
3334
- }, [i, x]), c(() => {
3441
+ document.documentElement.style.setProperty("--accent-indigo", i), document.documentElement.style.setProperty("--accent-indigo-rgb", Ke);
3442
+ }, [i, Ke]), c(() => {
3335
3443
  let t = !1;
3336
- return qe(e, l, { videoUrl: Ge.current }).then((e) => {
3444
+ return qe(e, l, { videoUrl: Ue.current }).then((e) => {
3337
3445
  if (t) return;
3338
- je.current = e;
3446
+ ke.current = e;
3339
3447
  let { features: n, planTier: r, heartbeatIntervalSeconds: i } = e.result.data;
3340
- Le.current = typeof i == "number" && i > 0 ? i * 1e3 : it;
3448
+ Ie.current = typeof i == "number" && i > 0 ? i * 1e3 : it;
3341
3449
  let a = {
3342
3450
  package: r,
3343
3451
  is_active: !0,
3344
3452
  features: tt(n),
3345
3453
  limits: { streaming_minutes: 0 }
3346
3454
  };
3347
- console.log("[SDK] Player key validated. Features:", a.features), Ee(a), we("ready");
3455
+ console.log("[SDK] Player key validated. Features:", a.features), we(a), Se("ready");
3348
3456
  }).catch((e) => {
3349
3457
  if (t) return;
3350
3458
  console.error("[SDK] Player key validation failed:", e);
3351
3459
  let n = e.message ?? "";
3352
- Ae(/init failed: 4\d\d/.test(n) ? "auth" : "network"), we("error");
3460
+ Oe(/init failed: 4\d\d/.test(n) ? "auth" : "network"), Se("error");
3353
3461
  }), () => {
3354
- t = !0, b.current &&= (clearTimeout(b.current), null), Re.current = 0, ze.current = null, we("loading"), Ee(null), Ne.current = !1, y.current = "", Pe.current = !1, Fe.current = void 0;
3462
+ t = !0, x.current &&= (clearTimeout(x.current), null), Le.current = 0, Re.current = null, Se("loading"), we(null), Me.current = !1, je.current = "", Ne.current = !1, Pe.current = void 0;
3355
3463
  };
3356
3464
  }, [
3357
3465
  e,
3358
3466
  l,
3359
- De
3467
+ Te
3360
3468
  ]);
3361
- let et = o(() => {
3362
- b.current && (clearTimeout(b.current), b.current = null, ze.current !== null && (Re.current += Date.now() - ze.current, ze.current = null));
3363
- }, []), ot = o(() => {
3364
- b.current &&= (clearTimeout(b.current), null), Re.current = 0, ze.current = null;
3365
- }, []), S = o(() => {
3366
- if (b.current || !y.current) return;
3367
- ze.current = Date.now();
3368
- let t = Le.current - Re.current;
3369
- b.current = setTimeout(() => {
3370
- b.current = null, Re.current = 0, ze.current = null;
3371
- let { currentTime: t, duration: n } = Be.current;
3372
- console.log(`[SDK] Heartbeat timer fired — ${Le.current / 1e3}s of real content elapsed`), Ye(e, y.current, t, n, l).catch((e) => console.warn("[SDK] Heartbeat failed:", e.message)), Ve.current();
3469
+ let S = o(() => {
3470
+ x.current && (clearTimeout(x.current), x.current = null, Re.current !== null && (Le.current += Date.now() - Re.current, Re.current = null));
3471
+ }, []), C = o(() => {
3472
+ x.current &&= (clearTimeout(x.current), null), Le.current = 0, Re.current = null;
3473
+ }, []), et = o(() => {
3474
+ if (x.current || !je.current) return;
3475
+ Re.current = Date.now();
3476
+ let t = Ie.current - Le.current;
3477
+ x.current = setTimeout(() => {
3478
+ x.current = null, Le.current = 0, Re.current = null;
3479
+ let { currentTime: t, duration: n } = ze.current;
3480
+ console.log(`[SDK] Heartbeat timer fired — ${Ie.current / 1e3}s of real content elapsed`), Ye(e, je.current, t, n, l).catch((e) => console.warn("[SDK] Heartbeat failed:", e.message)), Be.current();
3373
3481
  }, t);
3374
3482
  }, [e, l]);
3375
3483
  c(() => {
3376
- Ve.current = S;
3377
- }, [S]);
3378
- let st = u(!0);
3484
+ Be.current = et;
3485
+ }, [et]);
3486
+ let ot = u(!0);
3379
3487
  c(() => {
3380
- if (st.current) {
3381
- st.current = !1;
3488
+ if (ot.current) {
3489
+ ot.current = !1;
3382
3490
  return;
3383
3491
  }
3384
- Ie.current = !0, Fe.current = void 0, et();
3385
- }, [ye, et]), c(() => {
3492
+ Fe.current = !0, Pe.current = void 0, S();
3493
+ }, [_e, S]), c(() => {
3386
3494
  let t = () => {
3387
- if (v.notifyDismissed(), !y.current) return;
3388
- Pe.current = !0, ot();
3389
- let { currentTime: t, duration: n } = Be.current;
3390
- Qe(e, y.current, t, n, l);
3495
+ if (b.notifyDismissed(), !je.current) return;
3496
+ Ne.current = !0, C();
3497
+ let { currentTime: t, duration: n } = ze.current;
3498
+ Qe(e, je.current, t, n, l);
3391
3499
  };
3392
3500
  return window.addEventListener("beforeunload", t), () => {
3393
- window.removeEventListener("beforeunload", t), ot();
3501
+ window.removeEventListener("beforeunload", t), C();
3394
3502
  };
3395
3503
  }, [
3396
3504
  e,
3397
3505
  l,
3398
- ot,
3399
- v
3506
+ C,
3507
+ b
3400
3508
  ]);
3401
- let ct = o((t) => {
3509
+ let w = o((t) => {
3402
3510
  let n = t;
3403
- if (t.currentTime !== void 0 && (Be.current = {
3511
+ if (t.currentTime !== void 0 && (ze.current = {
3404
3512
  currentTime: t.currentTime,
3405
3513
  duration: t.duration
3406
- }), t.eventType === "session_start" && !Ne.current && (Ne.current = !0, Pe.current = !1, y.current = typeof n.sessionId == "string" ? n.sessionId : "", Je(e, {
3407
- sessionId: y.current,
3408
- videoId: Ue,
3409
- videoTitle: m,
3410
- videoUrl: Ge.current,
3514
+ }), t.eventType === "session_start" && !Me.current && (Me.current = !0, Ne.current = !1, je.current = typeof n.sessionId == "string" ? n.sessionId : "", Je(e, {
3515
+ sessionId: je.current,
3516
+ videoId: He,
3517
+ videoTitle: h,
3518
+ videoUrl: Ue.current,
3411
3519
  contentDurationSec: t.duration
3412
- }, l).catch((e) => console.warn("[SDK] Session start failed:", e.message)), Me.current || S()), t.eventType === "play" && Ne.current && !Me.current && !Ie.current && S(), t.eventType === "pause" && et(), t.eventType === "buffering_start" && et(), t.eventType === "buffering_end" && Ne.current && !Me.current && (Ie.current = !1, S()), t.eventType === "ended" && (ot(), y.current)) {
3413
- Pe.current = !0;
3414
- let { currentTime: t, duration: n } = Be.current;
3415
- Xe(e, y.current, t, n, l).catch((e) => console.warn("[SDK] Session end failed:", e.message));
3520
+ }, l).catch((e) => console.warn("[SDK] Session start failed:", e.message)), Ae.current || et()), t.eventType === "play" && Me.current && !Ae.current && !Fe.current && et(), t.eventType === "pause" && S(), t.eventType === "buffering_start" && S(), t.eventType === "buffering_end" && Me.current && !Ae.current && (Fe.current = !1, et()), t.eventType === "ended" && (C(), je.current)) {
3521
+ Ne.current = !0;
3522
+ let { currentTime: t, duration: n } = ze.current;
3523
+ Xe(e, je.current, t, n, l).catch((e) => console.warn("[SDK] Session end failed:", e.message));
3416
3524
  }
3417
- if (Ne.current && y.current && !Pe.current) {
3418
- let n = at(t, Fe.current);
3525
+ if (Me.current && je.current && !Ne.current) {
3526
+ let n = at(t, Pe.current);
3419
3527
  n && Ze(e, {
3420
3528
  eventType: n.eventType,
3421
- sessionId: y.current,
3529
+ sessionId: je.current,
3422
3530
  currentTime: t.currentTime ?? 0,
3423
- videoId: Ue,
3424
- videoTitle: m,
3531
+ videoId: He,
3532
+ videoTitle: h,
3425
3533
  ...n.extras
3426
3534
  }, l).catch((e) => console.warn(`[SDK] Event ${n.eventType} failed:`, e.message));
3427
3535
  }
3428
- t.eventType === "quality_change" && t.rendition && (Fe.current = t.rendition), console.log("[SDK Analytics]", t), v.handleAnalyticsEvent(t), pe?.(t);
3536
+ t.eventType === "quality_change" && t.rendition && (Pe.current = t.rendition), console.log("[SDK Analytics]", t), b.handleAnalyticsEvent(t), de?.(t);
3429
3537
  }, [
3430
3538
  e,
3431
3539
  l,
3432
- Ue,
3433
- m,
3434
- S,
3540
+ He,
3541
+ h,
3435
3542
  et,
3436
- ot,
3437
- pe,
3438
- v
3439
- ]), lt = o((e) => {
3440
- Me.current = e, e ? (et(), console.log("[SDK] Ad break started — heartbeat timer paused")) : (Ne.current && S(), console.log("[SDK] Ad break ended — heartbeat timer resumed"));
3441
- }, [et, S]), ut = o((e) => {
3442
- v.setKeyMoments(e), ve(e), me?.(e);
3443
- }, [me, v]), dt = o((e) => {
3444
- v.handleTimeUpdate(e), ge?.(e);
3445
- }, [ge, v]);
3446
- if (Ce === "loading") return /* @__PURE__ */ p("div", {
3543
+ S,
3544
+ C,
3545
+ de,
3546
+ b
3547
+ ]), st = o((e) => {
3548
+ Ae.current = e, e ? (S(), console.log("[SDK] Ad break started — heartbeat timer paused")) : (Me.current && et(), console.log("[SDK] Ad break ended — heartbeat timer resumed"));
3549
+ }, [S, et]), ct = o((e) => {
3550
+ b.setKeyMoments(e), ge(e), fe?.(e);
3551
+ }, [fe, b]), lt = o((e) => {
3552
+ b.handleTimeUpdate(e), me?.(e);
3553
+ }, [me, b]);
3554
+ if (xe === "loading") return /* @__PURE__ */ m("div", {
3447
3555
  style: {
3448
3556
  width: "100%",
3449
3557
  aspectRatio: "16 / 9",
@@ -3453,20 +3561,20 @@ function ot({ playerKey: e, src: t, subtitles: n, licenseKey: r, themeColor: i =
3453
3561
  alignItems: "center",
3454
3562
  justifyContent: "center"
3455
3563
  },
3456
- children: [/* @__PURE__ */ f("style", { children: "@keyframes boss-sdk-spin{to{transform:rotate(360deg)}}" }), /* @__PURE__ */ f("div", { style: {
3564
+ children: [/* @__PURE__ */ p("style", { children: "@keyframes boss-sdk-spin{to{transform:rotate(360deg)}}" }), /* @__PURE__ */ p("div", { style: {
3457
3565
  width: 60,
3458
3566
  height: 60,
3459
3567
  borderRadius: "50%",
3460
- border: `4px solid rgba(${x}, 0.1)`,
3568
+ border: `4px solid rgba(${Ke}, 0.1)`,
3461
3569
  borderLeftColor: i,
3462
- borderRightColor: `rgba(${x}, 0.2)`,
3463
- filter: `drop-shadow(0 0 10px rgba(${x}, 0.5))`,
3570
+ borderRightColor: `rgba(${Ke}, 0.2)`,
3571
+ filter: `drop-shadow(0 0 10px rgba(${Ke}, 0.5))`,
3464
3572
  animation: "boss-sdk-spin 1s linear infinite"
3465
3573
  } })]
3466
3574
  });
3467
- if (Ce === "error") {
3468
- let e = ke === "auth";
3469
- return /* @__PURE__ */ f("div", {
3575
+ if (xe === "error") {
3576
+ let e = De === "auth";
3577
+ return /* @__PURE__ */ p("div", {
3470
3578
  style: {
3471
3579
  width: "100%",
3472
3580
  aspectRatio: "16 / 9",
@@ -3478,51 +3586,51 @@ function ot({ playerKey: e, src: t, subtitles: n, licenseKey: r, themeColor: i =
3478
3586
  flexDirection: "column",
3479
3587
  gap: 20
3480
3588
  },
3481
- children: /* @__PURE__ */ f(re, {
3589
+ children: /* @__PURE__ */ p(ne, {
3482
3590
  title: e ? "Invalid Player Key" : "Something Went Wrong",
3483
3591
  subtitle: e ? "Your player key is invalid or expired.\nPlease check your configuration." : "We encountered an error while connecting.\nPlease try again.",
3484
- onRetry: () => Oe((e) => e + 1)
3592
+ onRetry: () => Ee((e) => e + 1)
3485
3593
  })
3486
3594
  });
3487
3595
  }
3488
- return /* @__PURE__ */ f(We, {
3489
- src: Se,
3490
- sources: xe,
3491
- activeSourceIndex: ye,
3492
- onSourceChange: (e) => be(e),
3596
+ return /* @__PURE__ */ p(Ge, {
3597
+ src: be,
3598
+ sources: ye,
3599
+ activeSourceIndex: _e,
3600
+ onSourceChange: (e) => ve(e),
3493
3601
  subtitles: n,
3494
- keyMoments: _e,
3602
+ keyMoments: he,
3495
3603
  themeColor: i,
3496
3604
  firebaseConfig: a,
3497
- resolvedEntitlement: Te,
3605
+ resolvedEntitlement: Ce,
3498
3606
  licenseKey: r,
3499
- title: m,
3500
- watermark: ie,
3501
- autoplay: h,
3502
- muted: ae,
3503
- autoFullscreen: oe,
3504
- enableControls: se,
3505
- enableSkipAd: ce,
3506
- skipAdAfterSeconds: le,
3507
- chaptersDisplayMode: ue,
3508
- volumeControlType: g,
3509
- subtitleStyle: de,
3510
- drmConfig: fe,
3511
- overlayAdUrl: te,
3512
- adTrackingUrl: ee,
3513
- videoId: Ue,
3514
- urlTransformer: Ke,
3515
- onAnalyticsEvent: ct,
3516
- onAdBreakChange: lt,
3517
- onKeyMomentsLoaded: ut,
3518
- initialTime: he,
3519
- onTimeUpdate: dt
3607
+ title: h,
3608
+ watermark: g,
3609
+ autoplay: _,
3610
+ muted: re,
3611
+ autoFullscreen: ie,
3612
+ enableControls: ae,
3613
+ enableSkipAd: oe,
3614
+ skipAdAfterSeconds: se,
3615
+ chaptersDisplayMode: ce,
3616
+ volumeControlType: v,
3617
+ subtitleStyle: le,
3618
+ drmConfig: ue,
3619
+ overlayAdUrl: ee,
3620
+ adTrackingUrl: f,
3621
+ videoId: He,
3622
+ urlTransformer: We,
3623
+ onAnalyticsEvent: w,
3624
+ onAdBreakChange: st,
3625
+ onKeyMomentsLoaded: ct,
3626
+ initialTime: pe,
3627
+ onTimeUpdate: lt
3520
3628
  });
3521
3629
  }
3522
3630
  //#endregion
3523
3631
  //#region src/create-player.ts
3524
- function S(e, t) {
3525
- let n = ne(e), r = t;
3632
+ function w(e, t) {
3633
+ let n = te(e), r = t;
3526
3634
  return n.render(i(ot, r)), {
3527
3635
  update(e) {
3528
3636
  r = {
@@ -3536,6 +3644,6 @@ function S(e, t) {
3536
3644
  };
3537
3645
  }
3538
3646
  //#endregion
3539
- export { ot as BossVideoPlayer, e as FirebaseAnalyticsProvider, t as VideoPlayerSDK, We as WebVideoPlayer, S as createPlayer, Xe as endSession, qe as initSdk, Ze as sendEvent, Ye as sendHeartbeat, Je as startSession };
3647
+ export { ot as BossVideoPlayer, e as FirebaseAnalyticsProvider, t as VideoPlayerSDK, Ge as WebVideoPlayer, w as createPlayer, Xe as endSession, qe as initSdk, Ze as sendEvent, Ye as sendHeartbeat, Je as startSession };
3540
3648
 
3541
3649
  //# sourceMappingURL=index.js.map