@glitchlab/vue-video-player 1.4.0 → 1.6.0

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.
Files changed (43) hide show
  1. package/README.md +228 -21
  2. package/dist/HLSPlayer.vue.d.ts +6 -0
  3. package/dist/HLSPlayer.vue.d.ts.map +1 -1
  4. package/dist/VideoPlayer.vue.d.ts +30 -1
  5. package/dist/VideoPlayer.vue.d.ts.map +1 -1
  6. package/dist/components/ControlBar.vue.d.ts +58 -0
  7. package/dist/components/ControlBar.vue.d.ts.map +1 -1
  8. package/dist/components/{IconQuality.vue.d.ts → IconAlert.vue.d.ts} +1 -1
  9. package/dist/components/IconAlert.vue.d.ts.map +1 -0
  10. package/dist/components/IconCheck.vue.d.ts +16 -0
  11. package/dist/components/IconCheck.vue.d.ts.map +1 -0
  12. package/dist/components/IconChevronRight.vue.d.ts +16 -0
  13. package/dist/components/IconChevronRight.vue.d.ts.map +1 -0
  14. package/dist/components/IconGear.vue.d.ts +16 -0
  15. package/dist/components/IconGear.vue.d.ts.map +1 -0
  16. package/dist/components/IconNext.vue.d.ts +16 -0
  17. package/dist/components/IconNext.vue.d.ts.map +1 -0
  18. package/dist/components/IconPrev.vue.d.ts +16 -0
  19. package/dist/components/IconPrev.vue.d.ts.map +1 -0
  20. package/dist/components/IconRefresh.vue.d.ts +16 -0
  21. package/dist/components/{IconQuality.vue.d.ts.map → IconRefresh.vue.d.ts.map} +1 -1
  22. package/dist/components/SettingsMenu.vue.d.ts +61 -0
  23. package/dist/components/SettingsMenu.vue.d.ts.map +1 -0
  24. package/dist/index.cjs +3 -1
  25. package/dist/index.cjs.map +1 -1
  26. package/dist/index.d.ts +4 -1
  27. package/dist/index.d.ts.map +1 -1
  28. package/dist/index.mjs +1869 -1058
  29. package/dist/index.mjs.map +1 -1
  30. package/dist/style.css +1 -1
  31. package/dist/utils/caption-style.d.ts +17 -0
  32. package/dist/utils/caption-style.d.ts.map +1 -0
  33. package/dist/utils/chapters.d.ts +33 -0
  34. package/dist/utils/chapters.d.ts.map +1 -0
  35. package/dist/utils/preferences.d.ts +26 -0
  36. package/dist/utils/preferences.d.ts.map +1 -0
  37. package/dist/utils/theme.d.ts +15 -0
  38. package/dist/utils/theme.d.ts.map +1 -0
  39. package/dist/utils/thumbnails.d.ts +37 -0
  40. package/dist/utils/thumbnails.d.ts.map +1 -0
  41. package/dist/utils/types.d.ts +95 -1
  42. package/dist/utils/types.d.ts.map +1 -1
  43. package/package.json +1 -1
package/dist/index.mjs CHANGED
@@ -1,27 +1,27 @@
1
- import { defineComponent as S, ref as k, onMounted as be, watch as R, onBeforeUnmount as ne, openBlock as i, createElementBlock as v, normalizeClass as y, renderSlot as Ee, createElementVNode as l, computed as N, createVNode as U, toDisplayString as O, Fragment as oe, renderList as ae, createCommentVNode as T, createBlock as j, normalizeStyle as ge, unref as ee, withCtx as Se } from "vue";
2
- import J from "hls.js";
3
- function xe(t, o, s) {
4
- const e = t == null ? void 0 : t.trim();
5
- if (e) return e;
6
- if (o) {
1
+ import { defineComponent as N, ref as g, onMounted as He, watch as V, onBeforeUnmount as ae, openBlock as r, createElementBlock as c, normalizeClass as L, renderSlot as Ue, createElementVNode as a, computed as I, createVNode as O, toDisplayString as Z, Fragment as oe, renderList as pe, createCommentVNode as x, createBlock as J, unref as le, normalizeStyle as ce, withDirectives as at, vShow as rt, withCtx as it } from "vue";
2
+ import se from "hls.js";
3
+ function De(e, s, t) {
4
+ const n = e == null ? void 0 : e.trim();
5
+ if (n) return n;
6
+ if (s) {
7
7
  try {
8
- const a = new Intl.DisplayNames(void 0, { type: "language" }).of(o);
9
- if (a && a !== o) return a;
8
+ const v = new Intl.DisplayNames(void 0, { type: "language" }).of(s);
9
+ if (v && v !== s) return v;
10
10
  } catch {
11
11
  }
12
- return o;
12
+ return s;
13
13
  }
14
- return `Audio ${s + 1}`;
14
+ return `Audio ${t + 1}`;
15
15
  }
16
- const He = {
16
+ const ut = {
17
17
  index: -1,
18
18
  height: 0,
19
19
  label: "Auto"
20
20
  };
21
- function Ae(t, o) {
22
- return t > 0 ? `${t}p` : `Level ${o + 1}`;
21
+ function ct(e, s) {
22
+ return e > 0 ? `${e}p` : `Level ${s + 1}`;
23
23
  }
24
- const Be = ["muted", "loop", "controls", "autoplay", "playsinline", "preload", "poster"], Ve = /* @__PURE__ */ S({
24
+ const dt = ["muted", "loop", "controls", "autoplay", "playsinline", "preload", "poster"], vt = /* @__PURE__ */ N({
25
25
  __name: "HLSPlayer",
26
26
  props: {
27
27
  src: {},
@@ -38,147 +38,153 @@ const Be = ["muted", "loop", "controls", "autoplay", "playsinline", "preload", "
38
38
  audioTrackIndex: { default: -1 },
39
39
  qualityLevelIndex: { default: -1 }
40
40
  },
41
- emits: ["play", "pause", "audio-tracks", "quality-levels", "current-level"],
42
- setup(t, { expose: o, emit: s }) {
43
- const e = t, f = s, a = k(null), w = k(null);
44
- let m, $;
45
- const E = globalThis.window !== void 0 && J.isSupported(), _ = (u) => !!e.isHls || E && u.endsWith(".m3u8");
46
- function A() {
47
- $ == null || $(), $ = void 0, m == null || m(), m = void 0, w.value && (w.value.destroy(), w.value = null);
48
- const u = a.value;
49
- if (u) {
50
- for (u.pause(), u.removeAttribute("src"); u.firstChild; ) u.firstChild.remove();
51
- u.load(), f("audio-tracks", []), f("quality-levels", []), f("current-level", -1);
41
+ emits: ["play", "pause", "ended", "fatal-error", "live-change", "audio-tracks", "quality-levels", "current-level"],
42
+ setup(e, { expose: s, emit: t }) {
43
+ const n = e, o = t, v = g(null), d = g(null);
44
+ let h, E;
45
+ const A = globalThis.window !== void 0 && se.isSupported(), S = (f) => !!n.isHls || A && f.endsWith(".m3u8");
46
+ function P() {
47
+ E == null || E(), E = void 0, h == null || h(), h = void 0, d.value && (d.value.destroy(), d.value = null);
48
+ const f = v.value;
49
+ if (f) {
50
+ for (f.pause(), f.removeAttribute("src"); f.firstChild; ) f.firstChild.remove();
51
+ f.load(), o("audio-tracks", []), o("quality-levels", []), o("current-level", -1), o("live-change", !1);
52
52
  }
53
53
  }
54
- function b(u) {
55
- var W, M, Z;
56
- const C = a.value;
57
- if (!C || !u) return;
58
- A();
59
- const B = () => {
60
- e.autoPlay && C.play().catch(() => {
54
+ function w(f) {
55
+ var j, K, re;
56
+ const M = v.value;
57
+ if (!M || !f) return;
58
+ P();
59
+ const z = () => {
60
+ n.autoPlay && M.play().catch(() => {
61
61
  });
62
62
  };
63
- if (_(u)) {
64
- const g = new J(e.hlsConfig);
65
- w.value = g;
66
- const P = () => {
67
- const I = g.audioTracks.map((H, z) => ({
68
- index: z,
69
- label: xe(H.name, H.lang, z),
63
+ if (S(f)) {
64
+ const C = new se(n.hlsConfig);
65
+ d.value = C;
66
+ const W = () => {
67
+ const F = C.audioTracks.map((H, R) => ({
68
+ index: R,
69
+ label: De(H.name, H.lang, R),
70
70
  lang: H.lang || void 0
71
71
  }));
72
- f("audio-tracks", I);
73
- }, V = () => {
74
- const I = g.levels.map((H, z) => ({
75
- index: z,
72
+ o("audio-tracks", F);
73
+ }, B = () => {
74
+ const F = C.levels.map((H, R) => ({
75
+ index: R,
76
76
  height: H.height || 0,
77
- label: Ae(H.height || 0, z)
77
+ label: ct(H.height || 0, R)
78
78
  }));
79
- f("quality-levels", I);
79
+ o("quality-levels", F);
80
80
  };
81
- g.on(J.Events.MANIFEST_PARSED, B), g.on(J.Events.MANIFEST_PARSED, V), g.on(J.Events.LEVELS_UPDATED, V), g.on(J.Events.LEVEL_SWITCHED, (I, H) => {
82
- f("current-level", H.level);
83
- }), g.on(J.Events.AUDIO_TRACKS_UPDATED, P), g.on(J.Events.AUDIO_TRACK_SWITCHED, P), g.on(J.Events.ERROR, (I, H) => {
84
- H.fatal && (g.destroy(), w.value = null);
85
- }), g.attachMedia(C), g.loadSource(u);
81
+ C.on(se.Events.MANIFEST_PARSED, z), C.on(se.Events.MANIFEST_PARSED, B), C.on(se.Events.LEVELS_UPDATED, B), C.on(se.Events.LEVEL_SWITCHED, (F, H) => {
82
+ o("current-level", H.level);
83
+ }), C.on(se.Events.AUDIO_TRACKS_UPDATED, W), C.on(se.Events.AUDIO_TRACK_SWITCHED, W), C.on(se.Events.LEVEL_LOADED, (F, H) => {
84
+ var R;
85
+ o("live-change", !!((R = H.details) != null && R.live));
86
+ });
87
+ let D = !1;
88
+ C.on(se.Events.ERROR, (F, H) => {
89
+ H.fatal && (H.type === se.ErrorTypes.NETWORK_ERROR && !D ? (D = !0, C.startLoad()) : H.type === se.ErrorTypes.MEDIA_ERROR && !D ? (D = !0, C.recoverMediaError()) : (C.destroy(), d.value = null, o("fatal-error")));
90
+ }), C.attachMedia(M), C.loadSource(f);
86
91
  } else {
87
- C.src = u, C.load(), C.addEventListener("loadedmetadata", B, { once: !0 }), $ = () => {
88
- C.removeEventListener("loadedmetadata", B);
92
+ M.src = f, M.load(), M.addEventListener("loadedmetadata", z, { once: !0 }), E = () => {
93
+ M.removeEventListener("loadedmetadata", z);
89
94
  };
90
- const g = C.audioTracks;
91
- if (g) {
92
- const P = () => {
93
- const V = [];
94
- for (let I = 0; I < g.length; I++) {
95
- const H = g[I];
96
- V.push({
97
- index: I,
98
- label: xe(H.label, H.language, I),
99
- lang: H.language || void 0
95
+ const C = M.audioTracks;
96
+ if (C) {
97
+ const W = () => {
98
+ const B = [];
99
+ for (let D = 0; D < C.length; D++) {
100
+ const F = C[D];
101
+ B.push({
102
+ index: D,
103
+ label: De(F.label, F.language, D),
104
+ lang: F.language || void 0
100
105
  });
101
106
  }
102
- f("audio-tracks", V);
107
+ o("audio-tracks", B);
103
108
  };
104
- (W = g.addEventListener) == null || W.call(g, "addtrack", P), (M = g.addEventListener) == null || M.call(g, "removetrack", P), (Z = g.addEventListener) == null || Z.call(g, "change", P), g.length > 0 && P(), m = () => {
105
- var V, I, H;
106
- (V = g.removeEventListener) == null || V.call(g, "addtrack", P), (I = g.removeEventListener) == null || I.call(g, "removetrack", P), (H = g.removeEventListener) == null || H.call(g, "change", P);
109
+ (j = C.addEventListener) == null || j.call(C, "addtrack", W), (K = C.addEventListener) == null || K.call(C, "removetrack", W), (re = C.addEventListener) == null || re.call(C, "change", W), C.length > 0 && W(), h = () => {
110
+ var B, D, F;
111
+ (B = C.removeEventListener) == null || B.call(C, "addtrack", W), (D = C.removeEventListener) == null || D.call(C, "removetrack", W), (F = C.removeEventListener) == null || F.call(C, "change", W);
107
112
  };
108
113
  }
109
114
  }
110
115
  }
111
- function h(u) {
112
- var W;
113
- if (u == null || u < 0) return;
114
- const C = w.value;
115
- if (C) {
116
- C.audioTrack !== u && (C.audioTrack = u);
116
+ function $(f) {
117
+ var j;
118
+ if (f == null || f < 0) return;
119
+ const M = d.value;
120
+ if (M) {
121
+ M.audioTrack !== f && (M.audioTrack = f);
117
122
  return;
118
123
  }
119
- const B = (W = a.value) == null ? void 0 : W.audioTracks;
120
- if (B)
121
- for (let M = 0; M < B.length; M++)
122
- B[M].enabled = M === u;
123
- }
124
- function x(u) {
125
- if (u == null) return;
126
- const C = w.value;
127
- C && C.currentLevel !== u && (C.currentLevel = u);
128
- }
129
- return be(() => {
130
- e.src && b(e.src);
131
- }), R(
132
- () => e.src,
133
- (u) => {
134
- u && b(u);
124
+ const z = (j = v.value) == null ? void 0 : j.audioTracks;
125
+ if (z)
126
+ for (let K = 0; K < z.length; K++)
127
+ z[K].enabled = K === f;
128
+ }
129
+ function T(f) {
130
+ if (f == null) return;
131
+ const M = d.value;
132
+ M && M.currentLevel !== f && (M.currentLevel = f);
133
+ }
134
+ return He(() => {
135
+ n.src && w(n.src);
136
+ }), V(
137
+ () => n.src,
138
+ (f) => {
139
+ f && w(f);
135
140
  }
136
- ), R(
137
- () => e.audioTrackIndex,
138
- (u) => h(u)
139
- ), R(
140
- () => e.qualityLevelIndex,
141
- (u) => x(u)
142
- ), ne(A), o({ videoEl: a }), (u, C) => (i(), v("video", {
141
+ ), V(
142
+ () => n.audioTrackIndex,
143
+ (f) => $(f)
144
+ ), V(
145
+ () => n.qualityLevelIndex,
146
+ (f) => T(f)
147
+ ), ae(P), s({ videoEl: v }), (f, M) => (r(), c("video", {
143
148
  ref_key: "videoEl",
144
- ref: a,
145
- muted: t.muted,
146
- loop: t.loop,
147
- controls: t.controls,
148
- autoplay: t.autoPlay,
149
- playsinline: t.playsInline,
150
- preload: t.preload,
151
- poster: t.poster,
152
- class: y(e.class),
153
- onPlay: C[0] || (C[0] = (B) => f("play")),
154
- onPause: C[1] || (C[1] = (B) => f("pause"))
149
+ ref: v,
150
+ muted: e.muted,
151
+ loop: e.loop,
152
+ controls: e.controls,
153
+ autoplay: e.autoPlay,
154
+ playsinline: e.playsInline,
155
+ preload: e.preload,
156
+ poster: e.poster,
157
+ class: L(n.class),
158
+ onPlay: M[0] || (M[0] = (z) => o("play")),
159
+ onPause: M[1] || (M[1] = (z) => o("pause")),
160
+ onEnded: M[2] || (M[2] = (z) => o("ended"))
155
161
  }, [
156
- Ee(u.$slots, "default")
157
- ], 42, Be));
162
+ Ue(f.$slots, "default")
163
+ ], 42, dt));
158
164
  }
159
- }), qe = { name: "IconAudio" }, De = /* @__PURE__ */ S({
160
- ...qe,
165
+ }), pt = { name: "IconAudio" }, ft = /* @__PURE__ */ N({
166
+ ...pt,
161
167
  props: {
162
168
  class: {}
163
169
  },
164
- setup(t) {
165
- const o = t;
166
- return (s, e) => (i(), v("svg", {
167
- class: y(["gvp-icon", o.class]),
170
+ setup(e) {
171
+ const s = e;
172
+ return (t, n) => (r(), c("svg", {
173
+ class: L(["gvp-icon", s.class]),
168
174
  width: "16",
169
175
  height: "16",
170
176
  viewBox: "0 0 24 24",
171
177
  fill: "none",
172
178
  xmlns: "http://www.w3.org/2000/svg",
173
179
  "aria-hidden": "true"
174
- }, [...e[0] || (e[0] = [
175
- l("path", {
180
+ }, [...n[0] || (n[0] = [
181
+ a("path", {
176
182
  d: "M3 14V10C3 9.44772 3.44772 9 4 9H6.58579C6.851 9 7.10536 8.89464 7.29289 8.70711L11.2929 4.70711C11.9229 4.07714 13 4.52331 13 5.41421V18.5858C13 19.4767 11.9229 19.9229 11.2929 19.2929L7.29289 15.2929C7.10536 15.1054 6.851 15 6.58579 15H4C3.44772 15 3 14.5523 3 14Z",
177
183
  stroke: "currentColor",
178
184
  "stroke-width": "1.5",
179
185
  "stroke-linejoin": "round"
180
186
  }, null, -1),
181
- l("path", {
187
+ a("path", {
182
188
  d: "M16.5 8C17.5 9 18 10.5 18 12C18 13.5 17.5 15 16.5 16M19 5.5C20.5 7 21.5 9.5 21.5 12C21.5 14.5 20.5 17 19 18.5",
183
189
  stroke: "currentColor",
184
190
  "stroke-width": "1.5",
@@ -186,23 +192,23 @@ const Be = ["muted", "loop", "controls", "autoplay", "playsinline", "preload", "
186
192
  }, null, -1)
187
193
  ])], 2));
188
194
  }
189
- }), Re = { name: "IconChevron" }, Le = /* @__PURE__ */ S({
190
- ...Re,
195
+ }), mt = { name: "IconChevron" }, Ze = /* @__PURE__ */ N({
196
+ ...mt,
191
197
  props: {
192
198
  class: {}
193
199
  },
194
- setup(t) {
195
- const o = t;
196
- return (s, e) => (i(), v("svg", {
197
- class: y(["gvp-icon", o.class]),
200
+ setup(e) {
201
+ const s = e;
202
+ return (t, n) => (r(), c("svg", {
203
+ class: L(["gvp-icon", s.class]),
198
204
  width: "12",
199
205
  height: "12",
200
206
  viewBox: "0 0 24 24",
201
207
  fill: "none",
202
208
  xmlns: "http://www.w3.org/2000/svg",
203
209
  "aria-hidden": "true"
204
- }, [...e[0] || (e[0] = [
205
- l("path", {
210
+ }, [...n[0] || (n[0] = [
211
+ a("path", {
206
212
  d: "M6 9L12 15L18 9",
207
213
  stroke: "currentColor",
208
214
  "stroke-width": "2",
@@ -211,93 +217,93 @@ const Be = ["muted", "loop", "controls", "autoplay", "playsinline", "preload", "
211
217
  }, null, -1)
212
218
  ])], 2));
213
219
  }
214
- }), Fe = ["aria-expanded"], Ne = { class: "gvp-audio-label" }, Oe = {
220
+ }), gt = ["aria-expanded"], ht = { class: "gvp-audio-label" }, kt = {
215
221
  key: 0,
216
222
  class: "gvp-audio-menu",
217
223
  role: "listbox",
218
224
  "aria-label": "Audio tracks"
219
- }, Ue = ["aria-selected", "onClick"], Ze = /* @__PURE__ */ S({
225
+ }, yt = ["aria-selected", "onClick"], bt = /* @__PURE__ */ N({
220
226
  __name: "AudioTrackSwitcher",
221
227
  props: {
222
228
  tracks: {},
223
229
  activeIndex: {}
224
230
  },
225
231
  emits: ["select"],
226
- setup(t, { emit: o }) {
227
- const s = t, e = o, f = k(!1), a = k(null), w = N(
228
- () => s.tracks.find((_) => _.index === s.activeIndex) ?? s.tracks[0]
232
+ setup(e, { emit: s }) {
233
+ const t = e, n = s, o = g(!1), v = g(null), d = I(
234
+ () => t.tracks.find((S) => S.index === t.activeIndex) ?? t.tracks[0]
229
235
  );
230
- function m(_) {
231
- a.value && !a.value.contains(_.target) && (f.value = !1);
236
+ function h(S) {
237
+ v.value && !v.value.contains(S.target) && (o.value = !1);
232
238
  }
233
- function $(_) {
234
- _.key === "Escape" && (f.value = !1);
239
+ function E(S) {
240
+ S.key === "Escape" && (o.value = !1);
235
241
  }
236
- R(f, (_) => {
237
- _ ? (document.addEventListener("mousedown", m), document.addEventListener("keydown", $)) : (document.removeEventListener("mousedown", m), document.removeEventListener("keydown", $));
238
- }), ne(() => {
239
- document.removeEventListener("mousedown", m), document.removeEventListener("keydown", $);
242
+ V(o, (S) => {
243
+ S ? (document.addEventListener("mousedown", h), document.addEventListener("keydown", E)) : (document.removeEventListener("mousedown", h), document.removeEventListener("keydown", E));
244
+ }), ae(() => {
245
+ document.removeEventListener("mousedown", h), document.removeEventListener("keydown", E);
240
246
  });
241
- function E(_) {
242
- e("select", _), f.value = !1;
247
+ function A(S) {
248
+ n("select", S), o.value = !1;
243
249
  }
244
- return (_, A) => {
245
- var b;
246
- return i(), v("div", {
250
+ return (S, P) => {
251
+ var w;
252
+ return r(), c("div", {
247
253
  ref_key: "rootEl",
248
- ref: a,
254
+ ref: v,
249
255
  class: "gvp-audio"
250
256
  }, [
251
- l("button", {
257
+ a("button", {
252
258
  type: "button",
253
259
  class: "gvp-audio-btn",
254
260
  "aria-haspopup": "listbox",
255
- "aria-expanded": f.value,
261
+ "aria-expanded": o.value,
256
262
  "aria-label": "Audio track",
257
- onClick: A[0] || (A[0] = (h) => f.value = !f.value)
263
+ onClick: P[0] || (P[0] = ($) => o.value = !o.value)
258
264
  }, [
259
- U(De),
260
- l("span", Ne, O((b = w.value) == null ? void 0 : b.label), 1),
261
- U(Le)
262
- ], 8, Fe),
263
- f.value ? (i(), v("ul", Oe, [
264
- (i(!0), v(oe, null, ae(t.tracks, (h) => (i(), v("li", {
265
- key: h.index
265
+ O(ft),
266
+ a("span", ht, Z((w = d.value) == null ? void 0 : w.label), 1),
267
+ O(Ze)
268
+ ], 8, gt),
269
+ o.value ? (r(), c("ul", kt, [
270
+ (r(!0), c(oe, null, pe(e.tracks, ($) => (r(), c("li", {
271
+ key: $.index
266
272
  }, [
267
- l("button", {
273
+ a("button", {
268
274
  type: "button",
269
275
  role: "option",
270
- "aria-selected": h.index === t.activeIndex,
271
- class: y(["gvp-audio-menu-item", { "is-active": h.index === t.activeIndex }]),
272
- onClick: (x) => E(h.index)
273
- }, O(h.label), 11, Ue)
276
+ "aria-selected": $.index === e.activeIndex,
277
+ class: L(["gvp-audio-menu-item", { "is-active": $.index === e.activeIndex }]),
278
+ onClick: (T) => A($.index)
279
+ }, Z($.label), 11, yt)
274
280
  ]))), 128))
275
- ])) : T("", !0)
281
+ ])) : x("", !0)
276
282
  ], 512);
277
283
  };
278
284
  }
279
- }), je = { name: "IconSpeed" }, $e = /* @__PURE__ */ S({
280
- ...je,
285
+ }), wt = { name: "IconSpeed" }, xt = /* @__PURE__ */ N({
286
+ ...wt,
281
287
  props: {
282
288
  class: {}
283
289
  },
284
- setup(t) {
285
- const o = t;
286
- return (s, e) => (i(), v("svg", {
287
- class: y(["gvp-icon", o.class]),
290
+ setup(e) {
291
+ const s = e;
292
+ return (t, n) => (r(), c("svg", {
293
+ class: L(["gvp-icon", s.class]),
288
294
  width: "16",
289
295
  height: "16",
290
296
  viewBox: "0 0 24 24",
291
297
  fill: "none",
292
298
  xmlns: "http://www.w3.org/2000/svg",
293
299
  "aria-hidden": "true"
294
- }, [...e[0] || (e[0] = [
295
- l("path", {
300
+ }, [...n[0] || (n[0] = [
301
+ a("path", {
296
302
  d: "M12 2C6.47715 2 2 6.47715 2 12C2 17.5228 6.47715 22 12 22C17.5228 22 22 17.5228 22 12C22 6.47715 17.5228 2 12 2Z",
297
303
  stroke: "currentColor",
298
304
  "stroke-width": "1.5"
299
305
  }, null, -1),
300
- l("path", {
306
+ a("path", {
301
307
  d: "M12 8V12L14.5 14.5",
302
308
  stroke: "currentColor",
303
309
  "stroke-width": "1.5",
@@ -306,80 +312,80 @@ const Be = ["muted", "loop", "controls", "autoplay", "playsinline", "preload", "
306
312
  }, null, -1)
307
313
  ])], 2));
308
314
  }
309
- }), Qe = ["aria-expanded"], We = { class: "gvp-speed-label" }, ze = {
315
+ }), Ct = ["aria-expanded"], Lt = { class: "gvp-speed-label" }, $t = {
310
316
  key: 0,
311
317
  class: "gvp-speed-menu",
312
318
  role: "listbox",
313
319
  "aria-label": "Playback speed"
314
- }, Ye = ["aria-selected", "onClick"], Ke = /* @__PURE__ */ S({
320
+ }, Et = ["aria-selected", "onClick"], _t = /* @__PURE__ */ N({
315
321
  __name: "SpeedSwitcher",
316
322
  props: {
317
323
  speed: {}
318
324
  },
319
325
  emits: ["select"],
320
- setup(t, { emit: o }) {
321
- const s = [0.5, 0.75, 1, 1.25, 1.5, 2], e = o, f = k(!1), a = k(null);
322
- function w(E) {
323
- a.value && !a.value.contains(E.target) && (f.value = !1);
324
- }
325
- function m(E) {
326
- E.key === "Escape" && (f.value = !1);
327
- }
328
- R(f, (E) => {
329
- E ? (document.addEventListener("mousedown", w), document.addEventListener("keydown", m)) : (document.removeEventListener("mousedown", w), document.removeEventListener("keydown", m));
330
- }), ne(() => {
331
- document.removeEventListener("mousedown", w), document.removeEventListener("keydown", m);
326
+ setup(e, { emit: s }) {
327
+ const t = [0.5, 0.75, 1, 1.25, 1.5, 2], n = s, o = g(!1), v = g(null);
328
+ function d(A) {
329
+ v.value && !v.value.contains(A.target) && (o.value = !1);
330
+ }
331
+ function h(A) {
332
+ A.key === "Escape" && (o.value = !1);
333
+ }
334
+ V(o, (A) => {
335
+ A ? (document.addEventListener("mousedown", d), document.addEventListener("keydown", h)) : (document.removeEventListener("mousedown", d), document.removeEventListener("keydown", h));
336
+ }), ae(() => {
337
+ document.removeEventListener("mousedown", d), document.removeEventListener("keydown", h);
332
338
  });
333
- function $(E) {
334
- e("select", E), f.value = !1;
339
+ function E(A) {
340
+ n("select", A), o.value = !1;
335
341
  }
336
- return (E, _) => (i(), v("div", {
342
+ return (A, S) => (r(), c("div", {
337
343
  ref_key: "rootEl",
338
- ref: a,
344
+ ref: v,
339
345
  class: "gvp-speed"
340
346
  }, [
341
- l("button", {
347
+ a("button", {
342
348
  type: "button",
343
349
  class: "gvp-speed-btn",
344
350
  "aria-haspopup": "listbox",
345
- "aria-expanded": f.value,
351
+ "aria-expanded": o.value,
346
352
  "aria-label": "`Playback speed: ${speed === 1 ? '1×' : speed + '×'}`",
347
- onClick: _[0] || (_[0] = (A) => f.value = !f.value)
353
+ onClick: S[0] || (S[0] = (P) => o.value = !o.value)
348
354
  }, [
349
- U($e),
350
- l("span", We, O(t.speed === 1 ? "1×" : `${t.speed}×`), 1),
351
- U(Le)
352
- ], 8, Qe),
353
- f.value ? (i(), v("ul", ze, [
354
- (i(), v(oe, null, ae(s, (A) => l("li", { key: A }, [
355
- l("button", {
355
+ O(xt),
356
+ a("span", Lt, Z(e.speed === 1 ? "1×" : `${e.speed}×`), 1),
357
+ O(Ze)
358
+ ], 8, Ct),
359
+ o.value ? (r(), c("ul", $t, [
360
+ (r(), c(oe, null, pe(t, (P) => a("li", { key: P }, [
361
+ a("button", {
356
362
  type: "button",
357
363
  role: "option",
358
- "aria-selected": A === t.speed,
359
- class: y(["gvp-speed-menu-item", { "is-active": A === t.speed }]),
360
- onClick: (b) => $(A)
361
- }, O(A === 1 ? "Normal" : `${A}×`), 11, Ye)
364
+ "aria-selected": P === e.speed,
365
+ class: L(["gvp-speed-menu-item", { "is-active": P === e.speed }]),
366
+ onClick: (w) => E(P)
367
+ }, Z(P === 1 ? "Normal" : `${P}×`), 11, Et)
362
368
  ])), 64))
363
- ])) : T("", !0)
369
+ ])) : x("", !0)
364
370
  ], 512));
365
371
  }
366
- }), Je = { name: "IconCaptions" }, Pe = /* @__PURE__ */ S({
367
- ...Je,
372
+ }), Pt = { name: "IconCaptions" }, Tt = /* @__PURE__ */ N({
373
+ ...Pt,
368
374
  props: {
369
375
  class: {}
370
376
  },
371
- setup(t) {
372
- const o = t;
373
- return (s, e) => (i(), v("svg", {
374
- class: y(["gvp-icon", o.class]),
377
+ setup(e) {
378
+ const s = e;
379
+ return (t, n) => (r(), c("svg", {
380
+ class: L(["gvp-icon", s.class]),
375
381
  width: "18",
376
382
  height: "18",
377
383
  viewBox: "0 0 24 24",
378
384
  fill: "none",
379
385
  xmlns: "http://www.w3.org/2000/svg",
380
386
  "aria-hidden": "true"
381
- }, [...e[0] || (e[0] = [
382
- l("rect", {
387
+ }, [...n[0] || (n[0] = [
388
+ a("rect", {
383
389
  x: "2",
384
390
  y: "5",
385
391
  width: "20",
@@ -388,7 +394,7 @@ const Be = ["muted", "loop", "controls", "autoplay", "playsinline", "preload", "
388
394
  stroke: "currentColor",
389
395
  "stroke-width": "1.5"
390
396
  }, null, -1),
391
- l("path", {
397
+ a("path", {
392
398
  d: "M7 12H11M13 12H17M7 15H9M11 15H13M15 15H17",
393
399
  stroke: "currentColor",
394
400
  "stroke-width": "1.5",
@@ -396,128 +402,128 @@ const Be = ["muted", "loop", "controls", "autoplay", "playsinline", "preload", "
396
402
  }, null, -1)
397
403
  ])], 2));
398
404
  }
399
- }), Xe = ["aria-expanded", "aria-pressed"], Ge = {
405
+ }), Mt = ["aria-expanded", "aria-pressed"], It = {
400
406
  key: 0,
401
407
  class: "gvp-captions-menu",
402
408
  role: "listbox",
403
409
  "aria-label": "Captions"
404
- }, et = ["aria-selected"], tt = ["aria-selected", "onClick"], nt = /* @__PURE__ */ S({
410
+ }, At = ["aria-selected"], St = ["aria-selected", "onClick"], Nt = /* @__PURE__ */ N({
405
411
  __name: "CaptionsSwitcher",
406
412
  props: {
407
413
  video: {}
408
414
  },
409
- setup(t) {
410
- const o = t, s = k([]), e = k(-1), f = k(!1), a = k(null);
411
- function w(b) {
412
- const h = [];
413
- for (let u = 0; u < b.length; u++) {
414
- const C = b[u];
415
- (C.kind === "subtitles" || C.kind === "captions") && h.push({ index: u, label: C.label || C.language || `Track ${u + 1}` });
415
+ setup(e) {
416
+ const s = e, t = g([]), n = g(-1), o = g(!1), v = g(null);
417
+ function d(w) {
418
+ const $ = [];
419
+ for (let f = 0; f < w.length; f++) {
420
+ const M = w[f];
421
+ (M.kind === "subtitles" || M.kind === "captions") && $.push({ index: f, label: M.label || M.language || `Track ${f + 1}` });
416
422
  }
417
- s.value = h;
418
- let x = -1;
419
- for (let u = 0; u < b.length; u++)
420
- if (b[u].mode === "showing") {
421
- x = u;
423
+ t.value = $;
424
+ let T = -1;
425
+ for (let f = 0; f < w.length; f++)
426
+ if (w[f].mode === "showing") {
427
+ T = f;
422
428
  break;
423
429
  }
424
- e.value = x;
430
+ n.value = T;
425
431
  }
426
- let m = null;
427
- R(() => o.video, (b) => {
428
- if (m == null || m(), m = null, !b) {
429
- s.value = [], e.value = -1;
432
+ let h = null;
433
+ V(() => s.video, (w) => {
434
+ if (h == null || h(), h = null, !w) {
435
+ t.value = [], n.value = -1;
430
436
  return;
431
437
  }
432
- const h = b.textTracks;
433
- w(h);
434
- const x = () => w(h);
435
- typeof h.addEventListener == "function" && (h.addEventListener("addtrack", x), h.addEventListener("removetrack", x), h.addEventListener("change", x), m = () => {
436
- h.removeEventListener("addtrack", x), h.removeEventListener("removetrack", x), h.removeEventListener("change", x);
438
+ const $ = w.textTracks;
439
+ d($);
440
+ const T = () => d($);
441
+ typeof $.addEventListener == "function" && ($.addEventListener("addtrack", T), $.addEventListener("removetrack", T), $.addEventListener("change", T), h = () => {
442
+ $.removeEventListener("addtrack", T), $.removeEventListener("removetrack", T), $.removeEventListener("change", T);
437
443
  });
438
- }, { immediate: !0 }), ne(() => {
439
- m == null || m(), document.removeEventListener("mousedown", $), document.removeEventListener("keydown", E);
444
+ }, { immediate: !0 }), ae(() => {
445
+ h == null || h(), document.removeEventListener("mousedown", E), document.removeEventListener("keydown", A);
440
446
  });
441
- function $(b) {
442
- a.value && !a.value.contains(b.target) && (f.value = !1);
447
+ function E(w) {
448
+ v.value && !v.value.contains(w.target) && (o.value = !1);
443
449
  }
444
- function E(b) {
445
- b.key === "Escape" && (f.value = !1);
450
+ function A(w) {
451
+ w.key === "Escape" && (o.value = !1);
446
452
  }
447
- R(f, (b) => {
448
- b ? (document.addEventListener("mousedown", $), document.addEventListener("keydown", E)) : (document.removeEventListener("mousedown", $), document.removeEventListener("keydown", E));
453
+ V(o, (w) => {
454
+ w ? (document.addEventListener("mousedown", E), document.addEventListener("keydown", A)) : (document.removeEventListener("mousedown", E), document.removeEventListener("keydown", A));
449
455
  });
450
- function _() {
451
- if (!o.video) return;
452
- const b = o.video.textTracks;
453
- for (let h = 0; h < b.length; h++) b[h].mode = "hidden";
454
- e.value = -1, f.value = !1;
455
- }
456
- function A(b) {
457
- if (!o.video) return;
458
- const h = o.video.textTracks;
459
- for (let x = 0; x < h.length; x++)
460
- h[x].mode = x === b ? "showing" : "hidden";
461
- e.value = b, f.value = !1;
462
- }
463
- return (b, h) => s.value.length > 0 ? (i(), v("div", {
456
+ function S() {
457
+ if (!s.video) return;
458
+ const w = s.video.textTracks;
459
+ for (let $ = 0; $ < w.length; $++) w[$].mode = "hidden";
460
+ n.value = -1, o.value = !1;
461
+ }
462
+ function P(w) {
463
+ if (!s.video) return;
464
+ const $ = s.video.textTracks;
465
+ for (let T = 0; T < $.length; T++)
466
+ $[T].mode = T === w ? "showing" : "hidden";
467
+ n.value = w, o.value = !1;
468
+ }
469
+ return (w, $) => t.value.length > 0 ? (r(), c("div", {
464
470
  key: 0,
465
471
  ref_key: "rootEl",
466
- ref: a,
472
+ ref: v,
467
473
  class: "gvp-captions"
468
474
  }, [
469
- l("button", {
475
+ a("button", {
470
476
  type: "button",
471
- class: y(["gvp-captions-btn", { "is-active": e.value >= 0 }]),
477
+ class: L(["gvp-captions-btn", { "is-active": n.value >= 0 }]),
472
478
  "aria-haspopup": "listbox",
473
- "aria-expanded": f.value,
474
- "aria-pressed": e.value >= 0,
479
+ "aria-expanded": o.value,
480
+ "aria-pressed": n.value >= 0,
475
481
  "aria-label": "Captions",
476
- onClick: h[0] || (h[0] = (x) => f.value = !f.value)
482
+ onClick: $[0] || ($[0] = (T) => o.value = !o.value)
477
483
  }, [
478
- U(Pe)
479
- ], 10, Xe),
480
- f.value ? (i(), v("ul", Ge, [
481
- l("li", null, [
482
- l("button", {
484
+ O(Tt)
485
+ ], 10, Mt),
486
+ o.value ? (r(), c("ul", It, [
487
+ a("li", null, [
488
+ a("button", {
483
489
  type: "button",
484
490
  role: "option",
485
- "aria-selected": e.value === -1,
486
- class: y(["gvp-captions-menu-item", { "is-active": e.value === -1 }]),
487
- onClick: _
488
- }, " Off ", 10, et)
491
+ "aria-selected": n.value === -1,
492
+ class: L(["gvp-captions-menu-item", { "is-active": n.value === -1 }]),
493
+ onClick: S
494
+ }, " Off ", 10, At)
489
495
  ]),
490
- (i(!0), v(oe, null, ae(s.value, (x) => (i(), v("li", {
491
- key: x.index
496
+ (r(!0), c(oe, null, pe(t.value, (T) => (r(), c("li", {
497
+ key: T.index
492
498
  }, [
493
- l("button", {
499
+ a("button", {
494
500
  type: "button",
495
501
  role: "option",
496
- "aria-selected": x.index === e.value,
497
- class: y(["gvp-captions-menu-item", { "is-active": x.index === e.value }]),
498
- onClick: (u) => A(x.index)
499
- }, O(x.label), 11, tt)
502
+ "aria-selected": T.index === n.value,
503
+ class: L(["gvp-captions-menu-item", { "is-active": T.index === n.value }]),
504
+ onClick: (f) => P(T.index)
505
+ }, Z(T.label), 11, St)
500
506
  ]))), 128))
501
- ])) : T("", !0)
502
- ], 512)) : T("", !0);
507
+ ])) : x("", !0)
508
+ ], 512)) : x("", !0);
503
509
  }
504
- }), lt = { name: "IconPause" }, ot = /* @__PURE__ */ S({
505
- ...lt,
510
+ }), Ht = { name: "IconPause" }, Vt = /* @__PURE__ */ N({
511
+ ...Ht,
506
512
  props: {
507
513
  class: {}
508
514
  },
509
- setup(t) {
510
- const o = t;
511
- return (s, e) => (i(), v("svg", {
512
- class: y(["gvp-icon", o.class]),
515
+ setup(e) {
516
+ const s = e;
517
+ return (t, n) => (r(), c("svg", {
518
+ class: L(["gvp-icon", s.class]),
513
519
  width: "16",
514
520
  height: "16",
515
521
  viewBox: "0 0 24 24",
516
522
  fill: "none",
517
523
  xmlns: "http://www.w3.org/2000/svg",
518
524
  "aria-hidden": "true"
519
- }, [...e[0] || (e[0] = [
520
- l("rect", {
525
+ }, [...n[0] || (n[0] = [
526
+ a("rect", {
521
527
  x: "6",
522
528
  y: "5",
523
529
  width: "4",
@@ -525,7 +531,7 @@ const Be = ["muted", "loop", "controls", "autoplay", "playsinline", "preload", "
525
531
  rx: "1",
526
532
  fill: "currentColor"
527
533
  }, null, -1),
528
- l("rect", {
534
+ a("rect", {
529
535
  x: "14",
530
536
  y: "5",
531
537
  width: "4",
@@ -535,164 +541,191 @@ const Be = ["muted", "loop", "controls", "autoplay", "playsinline", "preload", "
535
541
  }, null, -1)
536
542
  ])], 2));
537
543
  }
538
- }), at = { name: "IconPlaySolid" }, st = /* @__PURE__ */ S({
539
- ...at,
544
+ }), Bt = { name: "IconPlaySolid" }, Rt = /* @__PURE__ */ N({
545
+ ...Bt,
540
546
  props: {
541
547
  class: {}
542
548
  },
543
- setup(t) {
544
- const o = t;
545
- return (s, e) => (i(), v("svg", {
546
- class: y(["gvp-icon", o.class]),
549
+ setup(e) {
550
+ const s = e;
551
+ return (t, n) => (r(), c("svg", {
552
+ class: L(["gvp-icon", s.class]),
547
553
  width: "16",
548
554
  height: "16",
549
555
  viewBox: "0 0 24 24",
550
556
  fill: "none",
551
557
  xmlns: "http://www.w3.org/2000/svg",
552
558
  "aria-hidden": "true"
553
- }, [...e[0] || (e[0] = [
554
- l("path", {
559
+ }, [...n[0] || (n[0] = [
560
+ a("path", {
555
561
  d: "M7 5.5V18.5C7 19.2659 7.84856 19.7261 8.4899 19.3071L19.0801 12.4014C19.6644 12.0204 19.6644 11.9796 19.0801 11.5986L8.4899 4.69288C7.84856 4.27388 7 4.73408 7 5.5Z",
556
562
  fill: "currentColor"
557
563
  }, null, -1)
558
564
  ])], 2));
559
565
  }
560
- }), it = { name: "IconVolumeHigh" }, rt = /* @__PURE__ */ S({
561
- ...it,
566
+ }), Dt = { name: "IconPrev" }, Ft = /* @__PURE__ */ N({
567
+ ...Dt,
562
568
  props: {
563
569
  class: {}
564
570
  },
565
- setup(t) {
566
- const o = t;
567
- return (s, e) => (i(), v("svg", {
568
- class: y(["gvp-icon", o.class]),
569
- width: "18",
570
- height: "18",
571
+ setup(e) {
572
+ const s = e;
573
+ return (t, n) => (r(), c("svg", {
574
+ class: L(["gvp-icon", s.class]),
575
+ width: "16",
576
+ height: "16",
571
577
  viewBox: "0 0 24 24",
572
578
  fill: "none",
573
579
  xmlns: "http://www.w3.org/2000/svg",
574
580
  "aria-hidden": "true"
575
- }, [...e[0] || (e[0] = [
576
- l("path", {
577
- d: "M3 14V10C3 9.44772 3.44772 9 4 9H6.58579C6.851 9 7.10536 8.89464 7.29289 8.70711L11.2929 4.70711C11.9229 4.07714 13 4.52331 13 5.41421V18.5858C13 19.4767 11.9229 19.9229 11.2929 19.2929L7.29289 15.2929C7.10536 15.1054 6.851 15 6.58579 15H4C3.44772 15 3 14.5523 3 14Z",
581
+ }, [...n[0] || (n[0] = [
582
+ a("path", {
583
+ d: "M16.5 18.5V5.5C16.5 4.73408 15.6514 4.27388 15.0101 4.69288L6.91993 9.98432C6.33563 10.3653 6.33563 11.0347 6.91993 11.4157L15.0101 16.7071C15.6514 17.1261 16.5 16.6659 16.5 15.9V18.5Z",
584
+ fill: "currentColor"
585
+ }, null, -1),
586
+ a("path", {
587
+ d: "M6 5V19",
578
588
  stroke: "currentColor",
579
- "stroke-width": "1.5",
580
- "stroke-linejoin": "round"
589
+ "stroke-width": "2",
590
+ "stroke-linecap": "round"
591
+ }, null, -1)
592
+ ])], 2));
593
+ }
594
+ }), qt = { name: "IconNext" }, Ot = /* @__PURE__ */ N({
595
+ ...qt,
596
+ props: {
597
+ class: {}
598
+ },
599
+ setup(e) {
600
+ const s = e;
601
+ return (t, n) => (r(), c("svg", {
602
+ class: L(["gvp-icon", s.class]),
603
+ width: "16",
604
+ height: "16",
605
+ viewBox: "0 0 24 24",
606
+ fill: "none",
607
+ xmlns: "http://www.w3.org/2000/svg",
608
+ "aria-hidden": "true"
609
+ }, [...n[0] || (n[0] = [
610
+ a("path", {
611
+ d: "M7.5 5.5V18.5C7.5 19.2659 8.34856 19.7261 8.98990 19.3071L17.0801 14.0157C17.6644 13.6347 17.6644 12.9653 17.0801 12.5843L8.98990 7.29288C8.34856 6.87388 7.5 7.33408 7.5 8.1V5.5Z",
612
+ fill: "currentColor"
581
613
  }, null, -1),
582
- l("path", {
583
- d: "M16.5 8C17.5 9 18 10.5 18 12C18 13.5 17.5 15 16.5 16M19 5.5C20.5 7 21.5 9.5 21.5 12C21.5 14.5 20.5 17 19 18.5",
614
+ a("path", {
615
+ d: "M18 5V19",
584
616
  stroke: "currentColor",
585
- "stroke-width": "1.5",
617
+ "stroke-width": "2",
586
618
  "stroke-linecap": "round"
587
619
  }, null, -1)
588
620
  ])], 2));
589
621
  }
590
- }), ut = { name: "IconVolumeLow" }, ct = /* @__PURE__ */ S({
591
- ...ut,
622
+ }), jt = { name: "IconVolumeHigh" }, Ut = /* @__PURE__ */ N({
623
+ ...jt,
592
624
  props: {
593
625
  class: {}
594
626
  },
595
- setup(t) {
596
- const o = t;
597
- return (s, e) => (i(), v("svg", {
598
- class: y(["gvp-icon", o.class]),
627
+ setup(e) {
628
+ const s = e;
629
+ return (t, n) => (r(), c("svg", {
630
+ class: L(["gvp-icon", s.class]),
599
631
  width: "18",
600
632
  height: "18",
601
633
  viewBox: "0 0 24 24",
602
634
  fill: "none",
603
635
  xmlns: "http://www.w3.org/2000/svg",
604
636
  "aria-hidden": "true"
605
- }, [...e[0] || (e[0] = [
606
- l("path", {
637
+ }, [...n[0] || (n[0] = [
638
+ a("path", {
607
639
  d: "M3 14V10C3 9.44772 3.44772 9 4 9H6.58579C6.851 9 7.10536 8.89464 7.29289 8.70711L11.2929 4.70711C11.9229 4.07714 13 4.52331 13 5.41421V18.5858C13 19.4767 11.9229 19.9229 11.2929 19.2929L7.29289 15.2929C7.10536 15.1054 6.851 15 6.58579 15H4C3.44772 15 3 14.5523 3 14Z",
608
640
  stroke: "currentColor",
609
641
  "stroke-width": "1.5",
610
642
  "stroke-linejoin": "round"
611
643
  }, null, -1),
612
- l("path", {
613
- d: "M16.5 8C17.5 9 18 10.5 18 12C18 13.5 17.5 15 16.5 16",
644
+ a("path", {
645
+ d: "M16.5 8C17.5 9 18 10.5 18 12C18 13.5 17.5 15 16.5 16M19 5.5C20.5 7 21.5 9.5 21.5 12C21.5 14.5 20.5 17 19 18.5",
614
646
  stroke: "currentColor",
615
647
  "stroke-width": "1.5",
616
648
  "stroke-linecap": "round"
617
649
  }, null, -1)
618
650
  ])], 2));
619
651
  }
620
- }), dt = { name: "IconVolumeMuted" }, vt = /* @__PURE__ */ S({
621
- ...dt,
652
+ }), Zt = { name: "IconVolumeLow" }, zt = /* @__PURE__ */ N({
653
+ ...Zt,
622
654
  props: {
623
655
  class: {}
624
656
  },
625
- setup(t) {
626
- const o = t;
627
- return (s, e) => (i(), v("svg", {
628
- class: y(["gvp-icon", o.class]),
657
+ setup(e) {
658
+ const s = e;
659
+ return (t, n) => (r(), c("svg", {
660
+ class: L(["gvp-icon", s.class]),
629
661
  width: "18",
630
662
  height: "18",
631
663
  viewBox: "0 0 24 24",
632
664
  fill: "none",
633
665
  xmlns: "http://www.w3.org/2000/svg",
634
666
  "aria-hidden": "true"
635
- }, [...e[0] || (e[0] = [
636
- l("path", {
667
+ }, [...n[0] || (n[0] = [
668
+ a("path", {
637
669
  d: "M3 14V10C3 9.44772 3.44772 9 4 9H6.58579C6.851 9 7.10536 8.89464 7.29289 8.70711L11.2929 4.70711C11.9229 4.07714 13 4.52331 13 5.41421V18.5858C13 19.4767 11.9229 19.9229 11.2929 19.2929L7.29289 15.2929C7.10536 15.1054 6.851 15 6.58579 15H4C3.44772 15 3 14.5523 3 14Z",
638
670
  stroke: "currentColor",
639
671
  "stroke-width": "1.5",
640
672
  "stroke-linejoin": "round"
641
673
  }, null, -1),
642
- l("path", {
643
- d: "M16 9L22 15M22 9L16 15",
674
+ a("path", {
675
+ d: "M16.5 8C17.5 9 18 10.5 18 12C18 13.5 17.5 15 16.5 16",
644
676
  stroke: "currentColor",
645
677
  "stroke-width": "1.5",
646
678
  "stroke-linecap": "round"
647
679
  }, null, -1)
648
680
  ])], 2));
649
681
  }
650
- }), pt = { name: "IconQuality" }, ft = /* @__PURE__ */ S({
651
- ...pt,
682
+ }), Wt = { name: "IconVolumeMuted" }, Kt = /* @__PURE__ */ N({
683
+ ...Wt,
652
684
  props: {
653
685
  class: {}
654
686
  },
655
- setup(t) {
656
- const o = t;
657
- return (s, e) => (i(), v("svg", {
658
- class: y(["gvp-icon", o.class]),
659
- width: "16",
660
- height: "16",
687
+ setup(e) {
688
+ const s = e;
689
+ return (t, n) => (r(), c("svg", {
690
+ class: L(["gvp-icon", s.class]),
691
+ width: "18",
692
+ height: "18",
661
693
  viewBox: "0 0 24 24",
662
694
  fill: "none",
663
695
  xmlns: "http://www.w3.org/2000/svg",
664
696
  "aria-hidden": "true"
665
- }, [...e[0] || (e[0] = [
666
- l("path", {
667
- d: "M12 15C13.6569 15 15 13.6569 15 12C15 10.3431 13.6569 9 12 9C10.3431 9 9 10.3431 9 12C9 13.6569 10.3431 15 12 15Z",
697
+ }, [...n[0] || (n[0] = [
698
+ a("path", {
699
+ d: "M3 14V10C3 9.44772 3.44772 9 4 9H6.58579C6.851 9 7.10536 8.89464 7.29289 8.70711L11.2929 4.70711C11.9229 4.07714 13 4.52331 13 5.41421V18.5858C13 19.4767 11.9229 19.9229 11.2929 19.2929L7.29289 15.2929C7.10536 15.1054 6.851 15 6.58579 15H4C3.44772 15 3 14.5523 3 14Z",
668
700
  stroke: "currentColor",
669
- "stroke-width": "1.5"
701
+ "stroke-width": "1.5",
702
+ "stroke-linejoin": "round"
670
703
  }, null, -1),
671
- l("path", {
672
- d: "M3 12C3 12.6 3.08 13.18 3.23 13.73L4.6 14.5C4.86 14.65 5.02 14.94 5 15.24C4.98 15.58 4.96 15.92 5.07 16.24C5.18 16.56 5.39 16.83 5.62 17.08C5.83 17.3 6.13 17.4 6.42 17.36L7.99 17.13C8.28 17.09 8.57 17.21 8.74 17.45C9.07 17.93 9.49 18.34 9.97 18.66C10.21 18.83 10.34 19.11 10.31 19.4L10.13 20.97C10.1 21.26 10.21 21.55 10.43 21.74C10.91 22.16 11.45 22 12 22C12.55 22 13.09 22.16 13.57 21.74C13.79 21.55 13.9 21.26 13.87 20.97L13.69 19.4C13.66 19.11 13.79 18.83 14.03 18.66",
704
+ a("path", {
705
+ d: "M16 9L22 15M22 9L16 15",
673
706
  stroke: "currentColor",
674
707
  "stroke-width": "1.5",
675
708
  "stroke-linecap": "round"
676
709
  }, null, -1)
677
710
  ])], 2));
678
711
  }
679
- }), mt = { name: "IconPiP" }, Me = /* @__PURE__ */ S({
680
- ...mt,
712
+ }), Qt = { name: "IconPiP" }, ze = /* @__PURE__ */ N({
713
+ ...Qt,
681
714
  props: {
682
715
  class: {}
683
716
  },
684
- setup(t) {
685
- const o = t;
686
- return (s, e) => (i(), v("svg", {
687
- class: y(["gvp-icon", o.class]),
717
+ setup(e) {
718
+ const s = e;
719
+ return (t, n) => (r(), c("svg", {
720
+ class: L(["gvp-icon", s.class]),
688
721
  width: "18",
689
722
  height: "18",
690
723
  viewBox: "0 0 24 24",
691
724
  fill: "none",
692
725
  xmlns: "http://www.w3.org/2000/svg",
693
726
  "aria-hidden": "true"
694
- }, [...e[0] || (e[0] = [
695
- l("rect", {
727
+ }, [...n[0] || (n[0] = [
728
+ a("rect", {
696
729
  x: "2",
697
730
  y: "4",
698
731
  width: "20",
@@ -701,7 +734,7 @@ const Be = ["muted", "loop", "controls", "autoplay", "playsinline", "preload", "
701
734
  stroke: "currentColor",
702
735
  "stroke-width": "1.5"
703
736
  }, null, -1),
704
- l("rect", {
737
+ a("rect", {
705
738
  x: "12",
706
739
  y: "12",
707
740
  width: "8",
@@ -711,23 +744,23 @@ const Be = ["muted", "loop", "controls", "autoplay", "playsinline", "preload", "
711
744
  }, null, -1)
712
745
  ])], 2));
713
746
  }
714
- }), ht = { name: "IconFullscreen" }, gt = /* @__PURE__ */ S({
715
- ...ht,
747
+ }), Yt = { name: "IconFullscreen" }, Gt = /* @__PURE__ */ N({
748
+ ...Yt,
716
749
  props: {
717
750
  class: {}
718
751
  },
719
- setup(t) {
720
- const o = t;
721
- return (s, e) => (i(), v("svg", {
722
- class: y(["gvp-icon", o.class]),
752
+ setup(e) {
753
+ const s = e;
754
+ return (t, n) => (r(), c("svg", {
755
+ class: L(["gvp-icon", s.class]),
723
756
  width: "18",
724
757
  height: "18",
725
758
  viewBox: "0 0 24 24",
726
759
  fill: "none",
727
760
  xmlns: "http://www.w3.org/2000/svg",
728
761
  "aria-hidden": "true"
729
- }, [...e[0] || (e[0] = [
730
- l("path", {
762
+ }, [...n[0] || (n[0] = [
763
+ a("path", {
731
764
  d: "M4 9V4H9M15 4H20V9M20 15V20H15M9 20H4V15",
732
765
  stroke: "currentColor",
733
766
  "stroke-width": "1.75",
@@ -736,23 +769,23 @@ const Be = ["muted", "loop", "controls", "autoplay", "playsinline", "preload", "
736
769
  }, null, -1)
737
770
  ])], 2));
738
771
  }
739
- }), kt = { name: "IconFullscreenExit" }, yt = /* @__PURE__ */ S({
740
- ...kt,
772
+ }), Jt = { name: "IconFullscreenExit" }, Xt = /* @__PURE__ */ N({
773
+ ...Jt,
741
774
  props: {
742
775
  class: {}
743
776
  },
744
- setup(t) {
745
- const o = t;
746
- return (s, e) => (i(), v("svg", {
747
- class: y(["gvp-icon", o.class]),
777
+ setup(e) {
778
+ const s = e;
779
+ return (t, n) => (r(), c("svg", {
780
+ class: L(["gvp-icon", s.class]),
748
781
  width: "18",
749
782
  height: "18",
750
783
  viewBox: "0 0 24 24",
751
784
  fill: "none",
752
785
  xmlns: "http://www.w3.org/2000/svg",
753
786
  "aria-hidden": "true"
754
- }, [...e[0] || (e[0] = [
755
- l("path", {
787
+ }, [...n[0] || (n[0] = [
788
+ a("path", {
756
789
  d: "M9 4V9H4M15 9V4H20M15 20V15H20M9 15H4V20",
757
790
  stroke: "currentColor",
758
791
  "stroke-width": "1.75",
@@ -761,38 +794,458 @@ const Be = ["muted", "loop", "controls", "autoplay", "playsinline", "preload", "
761
794
  }, null, -1)
762
795
  ])], 2));
763
796
  }
797
+ }), en = { name: "IconGear" }, tn = /* @__PURE__ */ N({
798
+ ...en,
799
+ props: {
800
+ class: {}
801
+ },
802
+ setup(e) {
803
+ const s = e;
804
+ return (t, n) => (r(), c("svg", {
805
+ class: L(["gvp-icon", s.class]),
806
+ width: "16",
807
+ height: "16",
808
+ viewBox: "0 0 24 24",
809
+ fill: "none",
810
+ xmlns: "http://www.w3.org/2000/svg",
811
+ "aria-hidden": "true"
812
+ }, [...n[0] || (n[0] = [
813
+ a("path", {
814
+ d: "M12 15.5A3.5 3.5 0 1 0 12 8.5A3.5 3.5 0 0 0 12 15.5Z",
815
+ stroke: "currentColor",
816
+ "stroke-width": "2"
817
+ }, null, -1),
818
+ a("path", {
819
+ d: "M19.4 13A1.65 1.65 0 0 0 19.73 14.82L19.79 14.88A2 2 0 1 1 16.96 17.71L16.9 17.65A1.65 1.65 0 0 0 15.08 17.32A1.65 1.65 0 0 0 14 18.83V19A2 2 0 1 1 10 19V18.91A1.65 1.65 0 0 0 8.83 17.4A1.65 1.65 0 0 0 7.01 17.73L6.95 17.79A2 2 0 1 1 4.12 14.96L4.18 14.9A1.65 1.65 0 0 0 4.51 13.08A1.65 1.65 0 0 0 3 12H2.91A2 2 0 1 1 2.91 8H3A1.65 1.65 0 0 0 4.51 6.83A1.65 1.65 0 0 0 4.18 5.01L4.12 4.95A2 2 0 1 1 6.95 2.12L7.01 2.18A1.65 1.65 0 0 0 8.83 2.51H8.91A1.65 1.65 0 0 0 10 1V0.91A2 2 0 1 1 14 0.91V1A1.65 1.65 0 0 0 15.08 2.51A1.65 1.65 0 0 0 16.9 2.18L16.96 2.12A2 2 0 1 1 19.79 4.95L19.73 5.01A1.65 1.65 0 0 0 19.4 6.83V6.91A1.65 1.65 0 0 0 21 8H21.09A2 2 0 1 1 21.09 12H21A1.65 1.65 0 0 0 19.4 13Z",
820
+ stroke: "currentColor",
821
+ "stroke-width": "2",
822
+ "stroke-linecap": "round",
823
+ "stroke-linejoin": "round"
824
+ }, null, -1)
825
+ ])], 2));
826
+ }
827
+ }), nn = { name: "IconChevronRight" }, Ee = /* @__PURE__ */ N({
828
+ ...nn,
829
+ props: {
830
+ class: {}
831
+ },
832
+ setup(e) {
833
+ const s = e;
834
+ return (t, n) => (r(), c("svg", {
835
+ class: L(["gvp-icon", s.class]),
836
+ width: "14",
837
+ height: "14",
838
+ viewBox: "0 0 24 24",
839
+ fill: "none",
840
+ xmlns: "http://www.w3.org/2000/svg",
841
+ "aria-hidden": "true"
842
+ }, [...n[0] || (n[0] = [
843
+ a("path", {
844
+ d: "M9 6L15 12L9 18",
845
+ stroke: "currentColor",
846
+ "stroke-width": "2",
847
+ "stroke-linecap": "round",
848
+ "stroke-linejoin": "round"
849
+ }, null, -1)
850
+ ])], 2));
851
+ }
852
+ }), sn = { name: "IconCheck" }, we = /* @__PURE__ */ N({
853
+ ...sn,
854
+ props: {
855
+ class: {}
856
+ },
857
+ setup(e) {
858
+ const s = e;
859
+ return (t, n) => (r(), c("svg", {
860
+ class: L(["gvp-icon", s.class]),
861
+ width: "14",
862
+ height: "14",
863
+ viewBox: "0 0 24 24",
864
+ fill: "none",
865
+ xmlns: "http://www.w3.org/2000/svg",
866
+ "aria-hidden": "true"
867
+ }, [...n[0] || (n[0] = [
868
+ a("path", {
869
+ d: "M5 12L10 17L19 7",
870
+ stroke: "currentColor",
871
+ "stroke-width": "2.5",
872
+ "stroke-linecap": "round",
873
+ "stroke-linejoin": "round"
874
+ }, null, -1)
875
+ ])], 2));
876
+ }
877
+ }), ln = ["aria-expanded"], on = {
878
+ key: 0,
879
+ class: "gvp-settings-menu",
880
+ role: "menu"
881
+ }, an = { class: "gvp-settings-row-value" }, rn = { class: "gvp-settings-row-value" }, un = { class: "gvp-settings-row-value" }, cn = { class: "gvp-settings-row-value" }, dn = ["aria-checked", "onClick"], vn = { class: "gvp-settings-check" }, pn = ["aria-checked"], fn = { class: "gvp-settings-check" }, mn = ["aria-checked", "onClick"], gn = { class: "gvp-settings-check" }, hn = ["aria-checked"], kn = { class: "gvp-settings-check" }, yn = ["aria-checked", "onClick"], bn = { class: "gvp-settings-check" }, wn = ["aria-checked", "onClick"], xn = { class: "gvp-settings-check" }, Cn = { name: "SettingsMenu" }, Ln = /* @__PURE__ */ N({
882
+ ...Cn,
883
+ props: {
884
+ video: {},
885
+ qualityLevels: { default: () => [] },
886
+ currentLevel: { default: -1 },
887
+ selectedLevel: { default: -1 },
888
+ audioTracks: { default: () => [] },
889
+ audioTrackIndex: { default: -1 }
890
+ },
891
+ emits: ["select-level", "select-audio-track"],
892
+ setup(e, { emit: s }) {
893
+ const t = e, n = s, o = [0.5, 0.75, 1, 1.25, 1.5, 2], v = g(!1), d = g("root"), h = g(null), E = g(1);
894
+ V(() => t.video, (y) => {
895
+ if (!y) return;
896
+ const p = () => {
897
+ E.value = y.playbackRate;
898
+ };
899
+ p(), y.addEventListener("ratechange", p);
900
+ }, { immediate: !0 });
901
+ function A(y) {
902
+ t.video && (t.video.playbackRate = y), E.value = y, d.value = "root";
903
+ }
904
+ const S = g([]), P = g(-1);
905
+ function w(y) {
906
+ const p = [];
907
+ for (let m = 0; m < y.length; m++) {
908
+ const Q = y[m];
909
+ (Q.kind === "subtitles" || Q.kind === "captions") && p.push({ index: m, label: Q.label || Q.language || `Track ${m + 1}` });
910
+ }
911
+ S.value = p;
912
+ let ee = -1;
913
+ for (let m = 0; m < y.length; m++)
914
+ if (y[m].mode === "showing") {
915
+ ee = m;
916
+ break;
917
+ }
918
+ P.value = ee;
919
+ }
920
+ V(() => t.video, (y) => {
921
+ if (!y) {
922
+ S.value = [], P.value = -1;
923
+ return;
924
+ }
925
+ const p = y.textTracks;
926
+ w(p);
927
+ const ee = () => w(p);
928
+ typeof p.addEventListener == "function" && (p.addEventListener("addtrack", ee), p.addEventListener("removetrack", ee), p.addEventListener("change", ee));
929
+ }, { immediate: !0 });
930
+ function $(y) {
931
+ var ee;
932
+ const p = (ee = t.video) == null ? void 0 : ee.textTracks;
933
+ if (p)
934
+ for (let m = 0; m < p.length; m++)
935
+ p[m].mode = m === y ? "showing" : "hidden";
936
+ P.value = y, d.value = "root";
937
+ }
938
+ const T = I(
939
+ () => [...t.qualityLevels].sort((y, p) => p.height - y.height)
940
+ ), f = I(
941
+ () => t.qualityLevels.find((y) => y.index === t.currentLevel)
942
+ ), M = I(() => {
943
+ var y;
944
+ return t.selectedLevel < 0 ? f.value ? `Auto (${f.value.label})` : "Auto" : ((y = t.qualityLevels.find((p) => p.index === t.selectedLevel)) == null ? void 0 : y.label) ?? "Auto";
945
+ });
946
+ function z(y) {
947
+ n("select-level", y), d.value = "root";
948
+ }
949
+ const j = I(
950
+ () => t.audioTracks.find((y) => y.index === t.audioTrackIndex) ?? t.audioTracks[0]
951
+ );
952
+ function K(y) {
953
+ n("select-audio-track", y), d.value = "root";
954
+ }
955
+ const re = I(() => t.qualityLevels.length >= 2), C = I(() => S.value.length > 0), W = I(() => t.audioTracks.length > 1), B = I(() => E.value === 1 ? "Normal" : `${E.value}×`), D = I(
956
+ () => {
957
+ var y;
958
+ return P.value < 0 ? "Off" : ((y = S.value.find((p) => p.index === P.value)) == null ? void 0 : y.label) ?? "Off";
959
+ }
960
+ );
961
+ function F() {
962
+ v.value = !1, d.value = "root";
963
+ }
964
+ function H(y) {
965
+ h.value && !h.value.contains(y.target) && F();
966
+ }
967
+ function R(y) {
968
+ y.key === "Escape" && F();
969
+ }
970
+ V(v, (y) => {
971
+ y ? (document.addEventListener("mousedown", H), document.addEventListener("keydown", R)) : (document.removeEventListener("mousedown", H), document.removeEventListener("keydown", R));
972
+ }), ae(() => {
973
+ document.removeEventListener("mousedown", H), document.removeEventListener("keydown", R);
974
+ });
975
+ function fe() {
976
+ v.value = !v.value, d.value = "root";
977
+ }
978
+ return (y, p) => {
979
+ var ee;
980
+ return r(), c("div", {
981
+ ref_key: "rootEl",
982
+ ref: h,
983
+ class: "gvp-settings"
984
+ }, [
985
+ a("button", {
986
+ type: "button",
987
+ class: L(["gvp-ctrl-btn", { "is-active": v.value }]),
988
+ "aria-haspopup": "menu",
989
+ "aria-expanded": v.value,
990
+ "aria-label": "Settings",
991
+ onClick: fe
992
+ }, [
993
+ O(tn)
994
+ ], 10, ln),
995
+ v.value ? (r(), c("div", on, [
996
+ d.value === "root" ? (r(), c(oe, { key: 0 }, [
997
+ a("button", {
998
+ type: "button",
999
+ role: "menuitem",
1000
+ class: "gvp-settings-row",
1001
+ onClick: p[0] || (p[0] = (m) => d.value = "speed")
1002
+ }, [
1003
+ p[7] || (p[7] = a("span", { class: "gvp-settings-row-label" }, "Speed", -1)),
1004
+ a("span", an, Z(B.value), 1),
1005
+ O(Ee, { class: "gvp-settings-chevron" })
1006
+ ]),
1007
+ re.value ? (r(), c("button", {
1008
+ key: 0,
1009
+ type: "button",
1010
+ role: "menuitem",
1011
+ class: "gvp-settings-row",
1012
+ onClick: p[1] || (p[1] = (m) => d.value = "quality")
1013
+ }, [
1014
+ p[8] || (p[8] = a("span", { class: "gvp-settings-row-label" }, "Quality", -1)),
1015
+ a("span", rn, Z(M.value), 1),
1016
+ O(Ee, { class: "gvp-settings-chevron" })
1017
+ ])) : x("", !0),
1018
+ C.value ? (r(), c("button", {
1019
+ key: 1,
1020
+ type: "button",
1021
+ role: "menuitem",
1022
+ class: "gvp-settings-row",
1023
+ onClick: p[2] || (p[2] = (m) => d.value = "captions")
1024
+ }, [
1025
+ p[9] || (p[9] = a("span", { class: "gvp-settings-row-label" }, "Subtitles", -1)),
1026
+ a("span", un, Z(D.value), 1),
1027
+ O(Ee, { class: "gvp-settings-chevron" })
1028
+ ])) : x("", !0),
1029
+ W.value ? (r(), c("button", {
1030
+ key: 2,
1031
+ type: "button",
1032
+ role: "menuitem",
1033
+ class: "gvp-settings-row",
1034
+ onClick: p[3] || (p[3] = (m) => d.value = "audio")
1035
+ }, [
1036
+ p[10] || (p[10] = a("span", { class: "gvp-settings-row-label" }, "Audio", -1)),
1037
+ a("span", cn, Z((ee = j.value) == null ? void 0 : ee.label), 1),
1038
+ O(Ee, { class: "gvp-settings-chevron" })
1039
+ ])) : x("", !0)
1040
+ ], 64)) : x("", !0),
1041
+ d.value !== "root" ? (r(), c("button", {
1042
+ key: 1,
1043
+ type: "button",
1044
+ class: "gvp-settings-back",
1045
+ onClick: p[4] || (p[4] = (m) => d.value = "root")
1046
+ }, [
1047
+ O(Ee, { class: "gvp-settings-back-icon" }),
1048
+ a("span", null, Z(d.value === "speed" ? "Speed" : d.value === "quality" ? "Quality" : d.value === "captions" ? "Subtitles" : "Audio"), 1)
1049
+ ])) : x("", !0),
1050
+ d.value === "speed" ? (r(), c(oe, { key: 2 }, pe(o, (m) => a("button", {
1051
+ key: m,
1052
+ type: "button",
1053
+ role: "menuitemradio",
1054
+ "aria-checked": m === E.value,
1055
+ class: L(["gvp-settings-option", { "is-active": m === E.value }]),
1056
+ onClick: (Q) => A(m)
1057
+ }, [
1058
+ a("span", vn, [
1059
+ m === E.value ? (r(), J(we, { key: 0 })) : x("", !0)
1060
+ ]),
1061
+ a("span", null, Z(m === 1 ? "Normal" : `${m}×`), 1)
1062
+ ], 10, dn)), 64)) : x("", !0),
1063
+ d.value === "quality" ? (r(), c(oe, { key: 3 }, [
1064
+ a("button", {
1065
+ type: "button",
1066
+ role: "menuitemradio",
1067
+ "aria-checked": e.selectedLevel < 0,
1068
+ class: L(["gvp-settings-option", { "is-active": e.selectedLevel < 0 }]),
1069
+ onClick: p[5] || (p[5] = (m) => z(le(ut).index))
1070
+ }, [
1071
+ a("span", fn, [
1072
+ e.selectedLevel < 0 ? (r(), J(we, { key: 0 })) : x("", !0)
1073
+ ]),
1074
+ a("span", null, Z(f.value ? `Auto (${f.value.label})` : "Auto"), 1)
1075
+ ], 10, pn),
1076
+ (r(!0), c(oe, null, pe(T.value, (m) => (r(), c("button", {
1077
+ key: m.index,
1078
+ type: "button",
1079
+ role: "menuitemradio",
1080
+ "aria-checked": m.index === e.selectedLevel,
1081
+ class: L(["gvp-settings-option", { "is-active": m.index === e.selectedLevel }]),
1082
+ onClick: (Q) => z(m.index)
1083
+ }, [
1084
+ a("span", gn, [
1085
+ m.index === e.selectedLevel ? (r(), J(we, { key: 0 })) : x("", !0)
1086
+ ]),
1087
+ a("span", null, Z(m.label), 1)
1088
+ ], 10, mn))), 128))
1089
+ ], 64)) : x("", !0),
1090
+ d.value === "captions" ? (r(), c(oe, { key: 4 }, [
1091
+ a("button", {
1092
+ type: "button",
1093
+ role: "menuitemradio",
1094
+ "aria-checked": P.value === -1,
1095
+ class: L(["gvp-settings-option", { "is-active": P.value === -1 }]),
1096
+ onClick: p[6] || (p[6] = (m) => $(-1))
1097
+ }, [
1098
+ a("span", kn, [
1099
+ P.value === -1 ? (r(), J(we, { key: 0 })) : x("", !0)
1100
+ ]),
1101
+ p[11] || (p[11] = a("span", null, "Off", -1))
1102
+ ], 10, hn),
1103
+ (r(!0), c(oe, null, pe(S.value, (m) => (r(), c("button", {
1104
+ key: m.index,
1105
+ type: "button",
1106
+ role: "menuitemradio",
1107
+ "aria-checked": m.index === P.value,
1108
+ class: L(["gvp-settings-option", { "is-active": m.index === P.value }]),
1109
+ onClick: (Q) => $(m.index)
1110
+ }, [
1111
+ a("span", bn, [
1112
+ m.index === P.value ? (r(), J(we, { key: 0 })) : x("", !0)
1113
+ ]),
1114
+ a("span", null, Z(m.label), 1)
1115
+ ], 10, yn))), 128))
1116
+ ], 64)) : x("", !0),
1117
+ d.value === "audio" ? (r(!0), c(oe, { key: 5 }, pe(e.audioTracks, (m) => {
1118
+ var Q, Y, X;
1119
+ return r(), c("button", {
1120
+ key: m.index,
1121
+ type: "button",
1122
+ role: "menuitemradio",
1123
+ "aria-checked": m.index === (((Q = j.value) == null ? void 0 : Q.index) ?? -1),
1124
+ class: L([
1125
+ "gvp-settings-option",
1126
+ { "is-active": m.index === (((Y = j.value) == null ? void 0 : Y.index) ?? -1) }
1127
+ ]),
1128
+ onClick: (G) => K(m.index)
1129
+ }, [
1130
+ a("span", xn, [
1131
+ m.index === (((X = j.value) == null ? void 0 : X.index) ?? -1) ? (r(), J(we, { key: 0 })) : x("", !0)
1132
+ ]),
1133
+ a("span", null, Z(m.label), 1)
1134
+ ], 10, wn);
1135
+ }), 128)) : x("", !0)
1136
+ ])) : x("", !0)
1137
+ ], 512);
1138
+ };
1139
+ }
764
1140
  });
765
- function _e(t) {
766
- if (!Number.isFinite(t) || t < 0) return "--:--";
767
- const o = Math.floor(t), s = Math.floor(o / 3600), e = Math.floor(o % 3600 / 60), a = (o % 60).toString().padStart(2, "0");
768
- if (s > 0) {
769
- const w = e.toString().padStart(2, "0");
770
- return `${s}:${w}:${a}`;
1141
+ function _e(e) {
1142
+ if (!Number.isFinite(e) || e < 0) return "--:--";
1143
+ const s = Math.floor(e), t = Math.floor(s / 3600), n = Math.floor(s % 3600 / 60), v = (s % 60).toString().padStart(2, "0");
1144
+ if (t > 0) {
1145
+ const d = n.toString().padStart(2, "0");
1146
+ return `${t}:${d}:${v}`;
771
1147
  }
772
- return `${e}:${a}`;
1148
+ return `${n}:${v}`;
773
1149
  }
774
- const wt = { class: "gvp-controls-row" }, bt = ["aria-label", "aria-pressed"], Ct = { class: "gvp-seek" }, xt = { class: "gvp-seek-track" }, _t = ["value", "disabled", "aria-valuemax", "aria-valuenow"], Et = {
775
- class: "gvp-time",
776
- "aria-live": "off"
777
- }, Lt = ["aria-expanded", "aria-label"], $t = { class: "gvp-speed-label" }, Pt = {
778
- key: 0,
779
- class: "gvp-speed-menu",
780
- role: "listbox",
781
- "aria-label": "Playback speed"
782
- }, Mt = ["aria-selected", "onClick"], Tt = ["aria-expanded", "aria-label"], It = { class: "gvp-quality-label" }, St = {
783
- key: 0,
784
- class: "gvp-quality-menu",
785
- role: "listbox",
786
- "aria-label": "Quality"
787
- }, Ht = ["aria-selected"], At = ["aria-selected", "onClick"], Bt = ["aria-expanded", "aria-pressed"], Vt = {
788
- key: 0,
789
- class: "gvp-captions-menu",
790
- role: "listbox",
791
- "aria-label": "Captions"
792
- }, qt = ["aria-selected"], Dt = ["aria-selected", "onClick"], Rt = ["aria-label", "aria-pressed"], Ft = {
1150
+ function Fe(e) {
1151
+ const s = e.trim().split(":");
1152
+ if (s.length < 2 || s.length > 3) return NaN;
1153
+ const t = s.map(Number);
1154
+ return t.some((n) => !Number.isFinite(n)) ? NaN : t.length === 3 ? t[0] * 3600 + t[1] * 60 + t[2] : t[0] * 60 + t[1];
1155
+ }
1156
+ function $n(e, s) {
1157
+ try {
1158
+ return new URL(e, s).href;
1159
+ } catch {
1160
+ return e;
1161
+ }
1162
+ }
1163
+ function En(e, s) {
1164
+ const t = [], n = e.replace(/\r/g, "").split(`
1165
+ `);
1166
+ for (let o = 0; o < n.length; o++) {
1167
+ const v = n[o].indexOf("-->");
1168
+ if (v === -1) continue;
1169
+ const d = Fe(n[o].slice(0, v)), h = Fe(n[o].slice(v + 3));
1170
+ if (!Number.isFinite(d) || !Number.isFinite(h)) continue;
1171
+ const E = (n[o + 1] ?? "").trim();
1172
+ if (!E) continue;
1173
+ const A = E.indexOf("#xywh=");
1174
+ let S = E, P = 0, w = 0, $ = 0, T = 0;
1175
+ if (A !== -1) {
1176
+ S = E.slice(0, A);
1177
+ const f = E.slice(A + 6).split(",").map(Number);
1178
+ f.length === 4 && f.every(Number.isFinite) && ([P, w, $, T] = f);
1179
+ }
1180
+ t.push({ start: d, end: h, url: $n(S, s), x: P, y: w, w: $, h: T });
1181
+ }
1182
+ return t.sort((o, v) => o.start - v.start), t;
1183
+ }
1184
+ function _n(e) {
1185
+ return {
1186
+ cues: e,
1187
+ cueAt(s) {
1188
+ if (e.length === 0) return null;
1189
+ let t = 0, n = e.length - 1, o = e[0];
1190
+ for (; t <= n; ) {
1191
+ const v = t + n >> 1, d = e[v];
1192
+ if (s < d.start)
1193
+ n = v - 1;
1194
+ else if (s > d.end)
1195
+ o = d, t = v + 1;
1196
+ else
1197
+ return d;
1198
+ }
1199
+ return o;
1200
+ }
1201
+ };
1202
+ }
1203
+ function qe(e) {
1204
+ const s = e.trim().split(":");
1205
+ if (s.length < 2 || s.length > 3) return NaN;
1206
+ const t = s.map(Number);
1207
+ return t.some((n) => !Number.isFinite(n)) ? NaN : t.length === 3 ? t[0] * 3600 + t[1] * 60 + t[2] : t[0] * 60 + t[1];
1208
+ }
1209
+ function Pn(e) {
1210
+ const s = [], t = e.replace(/\r/g, "").split(`
1211
+ `);
1212
+ for (let n = 0; n < t.length; n++) {
1213
+ const o = t[n].indexOf("-->");
1214
+ if (o === -1) continue;
1215
+ const v = qe(t[n].slice(0, o)), d = qe(t[n].slice(o + 3));
1216
+ if (!Number.isFinite(v) || !Number.isFinite(d)) continue;
1217
+ const h = (t[n + 1] ?? "").trim();
1218
+ h && s.push({ start: v, end: d, title: h });
1219
+ }
1220
+ return s.sort((n, o) => n.start - o.start), s;
1221
+ }
1222
+ function Tn(e, s) {
1223
+ const t = e.filter((n) => Number.isFinite(n.start) && n.start >= 0 && n.title).sort((n, o) => n.start - o.start);
1224
+ return t.map((n, o) => {
1225
+ var v;
1226
+ return {
1227
+ start: n.start,
1228
+ end: Number.isFinite(n.end) ? n.end : ((v = t[o + 1]) == null ? void 0 : v.start) ?? s,
1229
+ title: n.title
1230
+ };
1231
+ });
1232
+ }
1233
+ function Mn(e, s) {
1234
+ for (const t of e)
1235
+ if (s >= t.start && s < t.end) return t;
1236
+ return null;
1237
+ }
1238
+ const In = { class: "gvp-controls-seek" }, An = {
1239
+ key: 1,
1240
+ class: "gvp-seek-preview-chapter"
1241
+ }, Sn = { class: "gvp-seek-preview-time" }, Nn = ["value", "disabled", "aria-valuemax", "aria-valuenow", "aria-valuetext"], Hn = { class: "gvp-controls-row" }, Vn = { class: "gvp-controls-left" }, Bn = ["aria-label", "aria-pressed"], Rn = ["disabled"], Dn = ["disabled"], Fn = ["aria-label", "aria-pressed"], qn = {
793
1242
  key: 0,
794
1243
  class: "gvp-volume-slider-wrap"
795
- }, Nt = { class: "gvp-volume-track" }, Ot = ["value", "aria-valuenow"], Ut = ["aria-label", "aria-pressed"], Zt = ["aria-label", "aria-pressed"], jt = 3e3, Qt = /* @__PURE__ */ S({
1244
+ }, On = { class: "gvp-volume-track" }, jn = ["value", "aria-valuenow", "aria-valuetext"], Un = {
1245
+ key: 2,
1246
+ class: "gvp-time",
1247
+ "aria-live": "off"
1248
+ }, Zn = ["disabled", "aria-label"], zn = { class: "gvp-controls-right" }, Wn = ["aria-label", "aria-pressed"], Kn = ["aria-label", "aria-pressed"], Qn = 3e3, Yn = 10, Gn = /* @__PURE__ */ N({
796
1249
  __name: "ControlBar",
797
1250
  props: {
798
1251
  video: {},
@@ -801,450 +1254,412 @@ const wt = { class: "gvp-controls-row" }, bt = ["aria-label", "aria-pressed"], C
801
1254
  onTogglePlay: {},
802
1255
  qualityLevels: { default: () => [] },
803
1256
  currentLevel: { default: -1 },
804
- selectedLevel: { default: -1 }
1257
+ selectedLevel: { default: -1 },
1258
+ thumbnails: {},
1259
+ chapters: {},
1260
+ hasPrev: { type: Boolean, default: !1 },
1261
+ hasNext: { type: Boolean, default: !1 },
1262
+ isLive: { type: Boolean, default: !1 },
1263
+ audioTracks: { default: () => [] },
1264
+ audioTrackIndex: { default: -1 }
805
1265
  },
806
- emits: ["select-level"],
807
- setup(t, { emit: o }) {
808
- const s = (() => {
1266
+ emits: ["select-level", "select-audio-track", "prev", "next"],
1267
+ setup(e, { emit: s }) {
1268
+ const t = (() => {
809
1269
  if (typeof navigator > "u") return !1;
810
- const n = navigator.userAgent;
811
- return /iPad|iPhone|iPod/.test(n) || n.includes("Mac") && navigator.maxTouchPoints > 1;
812
- })(), e = typeof navigator > "u" ? !1 : /iPhone|iPod/.test(navigator.userAgent), f = [0.5, 0.75, 1, 1.25, 1.5, 2], a = t, w = o, m = k(!0);
813
- let $ = null;
1270
+ const u = navigator.userAgent;
1271
+ return /iPad|iPhone|iPod/.test(u) || u.includes("Mac") && navigator.maxTouchPoints > 1;
1272
+ })(), n = typeof navigator > "u" ? !1 : /iPhone|iPod/.test(navigator.userAgent), o = e, v = s, d = g(!0);
1273
+ let h = null;
814
1274
  function E() {
815
- $ !== null && (clearTimeout($), $ = null);
816
- }
817
- function _() {
818
- E(), a.isPlaying && ($ = setTimeout(() => {
819
- m.value = !1;
820
- }, jt));
1275
+ h !== null && (clearTimeout(h), h = null);
821
1276
  }
822
1277
  function A() {
823
- m.value = !0, _();
824
- }
825
- R(() => a.isPlaying, (n) => {
826
- n ? _() : (E(), m.value = !0);
827
- }, { immediate: !0 }), R(() => a.container, (n) => {
828
- if (!n) return;
829
- const r = () => A();
830
- n.addEventListener("mousemove", r), n.addEventListener("touchstart", r), n.addEventListener("focusin", r);
1278
+ E(), o.isPlaying && (h = setTimeout(() => {
1279
+ d.value = !1;
1280
+ }, Qn));
1281
+ }
1282
+ function S() {
1283
+ d.value = !0, A();
1284
+ }
1285
+ V(() => o.isPlaying, (u) => {
1286
+ u ? A() : (E(), d.value = !0);
1287
+ }, { immediate: !0 }), V(() => o.container, (u) => {
1288
+ if (!u) return;
1289
+ const b = () => S();
1290
+ u.addEventListener("mousemove", b), u.addEventListener("touchstart", b), u.addEventListener("focusin", b);
831
1291
  }, { immediate: !0 });
832
- const b = k(0), h = k(0), x = k(0);
833
- R(() => a.video, (n) => {
834
- if (!n) return;
835
- const r = () => {
836
- b.value = n.currentTime;
837
- }, p = () => {
838
- h.value = Number.isFinite(n.duration) ? n.duration : 0;
839
- }, L = () => {
840
- const q = n.buffered;
1292
+ const P = g(0), w = g(0), $ = g(0), T = g(!1), f = g(!0), M = I(() => o.isLive || T.value);
1293
+ V(() => o.video, (u) => {
1294
+ if (!u) return;
1295
+ const b = () => {
1296
+ P.value = u.currentTime;
1297
+ }, _ = () => {
1298
+ w.value = Number.isFinite(u.duration) ? u.duration : 0;
1299
+ }, te = () => {
1300
+ const q = u.buffered;
841
1301
  if (!q || q.length === 0) {
842
- x.value = 0;
1302
+ $.value = 0;
843
1303
  return;
844
1304
  }
845
- let Ce = q.end(q.length - 1);
846
- for (let ie = 0; ie < q.length; ie++)
847
- if (q.start(ie) <= n.currentTime && n.currentTime <= q.end(ie)) {
848
- Ce = q.end(ie);
1305
+ let ke = q.end(q.length - 1);
1306
+ for (let ve = 0; ve < q.length; ve++)
1307
+ if (q.start(ve) <= u.currentTime && u.currentTime <= q.end(ve)) {
1308
+ ke = q.end(ve);
849
1309
  break;
850
1310
  }
851
- x.value = Ce;
852
- };
853
- r(), p(), L(), n.addEventListener("timeupdate", r), n.addEventListener("durationchange", p), n.addEventListener("loadedmetadata", p), n.addEventListener("progress", L), n.addEventListener("timeupdate", L);
854
- }, { immediate: !0 });
855
- const u = () => h.value > 0, C = () => u() ? b.value / h.value * 100 : 0, B = () => u() ? x.value / h.value * 100 : 0;
856
- function W(n) {
857
- const r = a.video;
858
- if (!r || !u()) return;
859
- const p = Number(n.target.value) / 100 * h.value;
860
- r.currentTime = p, b.value = p;
861
- }
862
- const M = k(1), Z = k(!1);
863
- R(() => a.video, (n) => {
864
- if (!n) return;
865
- const r = () => {
866
- M.value = n.volume, Z.value = n.muted;
1311
+ $.value = ke;
1312
+ }, he = () => {
1313
+ if (T.value = !Number.isFinite(u.duration) && u.duration > 0, M.value && u.seekable.length > 0) {
1314
+ const q = u.seekable.end(u.seekable.length - 1);
1315
+ f.value = q - u.currentTime <= Yn;
1316
+ }
867
1317
  };
868
- r(), n.addEventListener("volumechange", r);
1318
+ b(), _(), te(), he(), u.addEventListener("timeupdate", b), u.addEventListener("durationchange", _), u.addEventListener("loadedmetadata", _), u.addEventListener("progress", te), u.addEventListener("timeupdate", te), u.addEventListener("durationchange", he), u.addEventListener("loadedmetadata", he), u.addEventListener("timeupdate", he);
869
1319
  }, { immediate: !0 });
870
- function g() {
871
- a.video && (a.video.muted = !a.video.muted);
872
- }
873
- function P(n) {
874
- const r = a.video;
875
- if (!r) return;
876
- const p = Number(n.target.value) / 100;
877
- r.volume = p, p > 0 && r.muted && (r.muted = !1);
878
- }
879
- const V = k(1), I = k(!1), H = k(null);
880
- R(() => a.video, (n) => {
881
- if (!n) return;
882
- const r = () => {
883
- V.value = n.playbackRate;
884
- };
885
- r(), n.addEventListener("ratechange", r);
1320
+ function z() {
1321
+ const u = o.video;
1322
+ !u || u.seekable.length === 0 || (u.currentTime = u.seekable.end(u.seekable.length - 1));
1323
+ }
1324
+ const j = () => w.value > 0, K = () => j() ? P.value / w.value * 100 : 0, re = () => j() ? $.value / w.value * 100 : 0;
1325
+ function C(u) {
1326
+ const b = o.video;
1327
+ if (!b || !j()) return;
1328
+ const _ = Number(u.target.value) / 100 * w.value;
1329
+ b.currentTime = _, P.value = _;
1330
+ }
1331
+ const W = g(null), B = g(null), D = g(0), F = g(0), H = g(!1);
1332
+ V(() => o.thumbnails, (u) => {
1333
+ if (W.value = null, !u) return;
1334
+ let b = !1;
1335
+ fetch(u).then((_) => _.ok ? _.text() : Promise.reject(new Error("fetch failed"))).then((_) => {
1336
+ if (b) return;
1337
+ const te = En(_, new URL(u, location.href).href);
1338
+ W.value = te.length > 0 ? _n(te) : null;
1339
+ }).catch(() => {
1340
+ b || (W.value = null);
1341
+ }), ae(() => {
1342
+ b = !0;
1343
+ });
886
1344
  }, { immediate: !0 });
887
- function z(n) {
888
- a.video && (a.video.playbackRate = n), V.value = n, I.value = !1;
889
- }
890
- const X = k(!1), re = k(null), ke = N(() => a.qualityLevels.length >= 2), Q = N(
891
- () => [...a.qualityLevels].sort((n, r) => r.height - n.height)
892
- ), te = N(
893
- () => a.qualityLevels.find((n) => n.index === a.currentLevel)
894
- ), se = N(() => {
895
- if (a.selectedLevel < 0)
896
- return te.value ? `Auto (${te.value.label})` : "Auto";
897
- const n = a.qualityLevels.find((r) => r.index === a.selectedLevel);
898
- return (n == null ? void 0 : n.label) ?? "Auto";
899
- });
900
- function ue(n) {
901
- w("select-level", n), X.value = !1;
902
- }
903
- const le = k([]), F = k(-1), Y = k(!1), ce = k(null);
904
- function de(n) {
905
- const r = [];
906
- for (let L = 0; L < n.length; L++) {
907
- const q = n[L];
908
- (q.kind === "subtitles" || q.kind === "captions") && r.push({ index: L, label: q.label || q.language || `Track ${L + 1}` });
909
- }
910
- le.value = r;
911
- let p = -1;
912
- for (let L = 0; L < n.length; L++)
913
- if (n[L].mode === "showing") {
914
- p = L;
915
- break;
916
- }
917
- F.value = p;
1345
+ function R(u) {
1346
+ const b = B.value;
1347
+ if (!b || !j()) return;
1348
+ const _ = b.getBoundingClientRect(), te = Math.min(Math.max(u.clientX - _.left, 0), _.width);
1349
+ F.value = te, D.value = te / _.width * w.value, H.value = !0;
918
1350
  }
919
- R(() => a.video, (n) => {
920
- if (!n) {
921
- le.value = [], F.value = -1;
922
- return;
1351
+ function fe() {
1352
+ H.value = !1;
1353
+ }
1354
+ const y = I(
1355
+ () => {
1356
+ var u;
1357
+ return H.value ? ((u = W.value) == null ? void 0 : u.cueAt(D.value)) ?? null : null;
923
1358
  }
924
- const r = n.textTracks;
925
- de(r);
926
- const p = () => de(r);
927
- typeof r.addEventListener == "function" && (r.addEventListener("addtrack", p), r.addEventListener("removetrack", p), r.addEventListener("change", p));
1359
+ ), p = I(() => {
1360
+ const u = y.value;
1361
+ return u !== null && u.w > 0 && u.h > 0;
1362
+ }), ee = I(() => {
1363
+ var te;
1364
+ const u = y.value, b = ((te = B.value) == null ? void 0 : te.clientWidth) ?? 0;
1365
+ if (!p.value || !u || b === 0) return F.value;
1366
+ const _ = u.w / 2;
1367
+ return Math.min(Math.max(F.value, _), b - _);
1368
+ }), m = g([]);
1369
+ V(() => o.chapters, (u) => {
1370
+ if (m.value = [], typeof u != "string" || !u) return;
1371
+ let b = !1;
1372
+ fetch(u).then((_) => _.ok ? _.text() : Promise.reject(new Error("fetch failed"))).then((_) => {
1373
+ b || (m.value = Pn(_));
1374
+ }).catch(() => {
1375
+ b || (m.value = []);
1376
+ }), ae(() => {
1377
+ b = !0;
1378
+ });
928
1379
  }, { immediate: !0 });
929
- function ve(n) {
930
- var p;
931
- const r = (p = a.video) == null ? void 0 : p.textTracks;
932
- if (r) {
933
- for (let L = 0; L < r.length; L++) r[L].mode = L === n ? "showing" : "hidden";
934
- F.value = n, Y.value = !1;
935
- }
1380
+ const Q = I(() => typeof o.chapters == "string" ? m.value : Array.isArray(o.chapters) ? Tn(o.chapters, w.value) : []), Y = I(
1381
+ () => H.value ? Mn(Q.value, D.value) : null
1382
+ ), X = g(1), G = g(!1);
1383
+ V(() => o.video, (u) => {
1384
+ if (!u) return;
1385
+ const b = () => {
1386
+ X.value = u.volume, G.value = u.muted;
1387
+ };
1388
+ b(), u.addEventListener("volumechange", b);
1389
+ }, { immediate: !0 });
1390
+ function ge() {
1391
+ o.video && (o.video.muted = !o.video.muted);
936
1392
  }
937
- function pe() {
938
- var r;
939
- const n = (r = a.video) == null ? void 0 : r.textTracks;
940
- if (n) {
941
- for (let p = 0; p < n.length; p++) n[p].mode = "hidden";
942
- F.value = -1, Y.value = !1;
943
- }
1393
+ function ue(u) {
1394
+ const b = o.video;
1395
+ if (!b) return;
1396
+ const _ = Number(u.target.value) / 100;
1397
+ b.volume = _, _ > 0 && b.muted && (b.muted = !1);
944
1398
  }
945
- const c = k(!1), d = typeof document < "u" && !!document.pictureInPictureEnabled;
946
- R(() => a.video, (n) => {
947
- n && (n.addEventListener("enterpictureinpicture", () => {
948
- c.value = !0;
949
- }), n.addEventListener("leavepictureinpicture", () => {
950
- c.value = !1;
1399
+ const me = g(!1), Ie = typeof document < "u" && !!document.pictureInPictureEnabled;
1400
+ V(() => o.video, (u) => {
1401
+ u && (u.addEventListener("enterpictureinpicture", () => {
1402
+ me.value = !0;
1403
+ }), u.addEventListener("leavepictureinpicture", () => {
1404
+ me.value = !1;
951
1405
  }));
952
1406
  }, { immediate: !0 });
953
- function D() {
954
- a.video && (document.pictureInPictureElement ? document.exitPictureInPicture().catch(() => {
955
- }) : a.video.requestPictureInPicture().catch(() => {
1407
+ function Ae() {
1408
+ o.video && (document.pictureInPictureElement ? document.exitPictureInPicture().catch(() => {
1409
+ }) : o.video.requestPictureInPicture().catch(() => {
956
1410
  }));
957
1411
  }
958
- const K = k(!1), fe = typeof document > "u" ? !1 : !!(document.fullscreenEnabled || document.webkitFullscreenEnabled);
959
- function me() {
1412
+ const de = g(!1), Pe = typeof document > "u" ? !1 : !!(document.fullscreenEnabled || document.webkitFullscreenEnabled);
1413
+ function xe() {
960
1414
  return document.fullscreenElement ?? document.webkitFullscreenElement ?? null;
961
1415
  }
962
- function ye(n) {
963
- const r = n.requestFullscreen ?? n.webkitRequestFullscreen;
964
- return r ? r.call(n) : Promise.reject(new Error("unsupported"));
1416
+ function Ce(u) {
1417
+ const b = u.requestFullscreen ?? u.webkitRequestFullscreen;
1418
+ return b ? b.call(u) : Promise.reject(new Error("unsupported"));
965
1419
  }
966
- function he() {
967
- const n = document.exitFullscreen ?? document.webkitExitFullscreen;
968
- return n ? n.call(document) : Promise.reject(new Error("unsupported"));
1420
+ function Le() {
1421
+ const u = document.exitFullscreen ?? document.webkitExitFullscreen;
1422
+ return u ? u.call(document) : Promise.reject(new Error("unsupported"));
969
1423
  }
970
- function G() {
971
- K.value = me() === a.container;
1424
+ function U() {
1425
+ de.value = xe() === o.container;
972
1426
  }
973
- be(() => {
974
- document.addEventListener("fullscreenchange", G), document.addEventListener("webkitfullscreenchange", G);
975
- }), ne(() => {
976
- E(), document.removeEventListener("fullscreenchange", G), document.removeEventListener("webkitfullscreenchange", G);
1427
+ He(() => {
1428
+ document.addEventListener("fullscreenchange", U), document.addEventListener("webkitfullscreenchange", U);
1429
+ }), ae(() => {
1430
+ E(), document.removeEventListener("fullscreenchange", U), document.removeEventListener("webkitfullscreenchange", U);
977
1431
  });
978
- function Te() {
979
- var n, r;
980
- if (e) {
981
- (r = (n = a.video) == null ? void 0 : n.webkitEnterFullscreen) == null || r.call(n);
1432
+ function Se() {
1433
+ var u, b;
1434
+ if (n) {
1435
+ (b = (u = o.video) == null ? void 0 : u.webkitEnterFullscreen) == null || b.call(u);
982
1436
  return;
983
1437
  }
984
- K.value ? he().catch(() => {
985
- }) : a.container && ye(a.container).catch(() => {
1438
+ de.value ? Le().catch(() => {
1439
+ }) : o.container && Ce(o.container).catch(() => {
986
1440
  });
987
1441
  }
988
- const Ie = fe || e && a.video !== null && typeof a.video.webkitEnterFullscreen == "function";
989
- function we(n, r) {
990
- function p(q) {
991
- r.value && !r.value.contains(q.target) && (n.value = !1);
992
- }
993
- function L(q) {
994
- q.key === "Escape" && (n.value = !1);
995
- }
996
- R(n, (q) => {
997
- q ? (document.addEventListener("mousedown", p), document.addEventListener("keydown", L)) : (document.removeEventListener("mousedown", p), document.removeEventListener("keydown", L));
998
- }), ne(() => {
999
- document.removeEventListener("mousedown", p), document.removeEventListener("keydown", L);
1000
- });
1001
- }
1002
- return we(I, H), we(Y, ce), we(X, re), (n, r) => (i(), v("div", {
1442
+ const Ne = Pe || n && o.video !== null && typeof o.video.webkitEnterFullscreen == "function";
1443
+ return (u, b) => (r(), c("div", {
1003
1444
  role: "toolbar",
1004
1445
  "aria-label": "Video controls",
1005
- class: y(["gvp-controls", !m.value && "is-hidden"]),
1446
+ class: L(["gvp-controls", !d.value && "is-hidden"]),
1006
1447
  onMouseenter: E,
1007
- onMouseleave: _
1448
+ onMouseleave: A
1008
1449
  }, [
1009
- l("div", wt, [
1010
- l("button", {
1011
- type: "button",
1012
- class: "gvp-ctrl-btn",
1013
- "aria-label": t.isPlaying ? "Pause" : "Play",
1014
- "aria-pressed": t.isPlaying,
1015
- onClick: r[0] || (r[0] = //@ts-ignore
1016
- (...p) => t.onTogglePlay && t.onTogglePlay(...p))
1450
+ a("div", In, [
1451
+ a("div", {
1452
+ class: "gvp-seek",
1453
+ onPointermove: R,
1454
+ onPointerleave: fe
1017
1455
  }, [
1018
- t.isPlaying ? (i(), j(ot, { key: 0 })) : (i(), j(st, { key: 1 }))
1019
- ], 8, bt),
1020
- l("div", Ct, [
1021
- l("div", xt, [
1022
- l("div", {
1456
+ a("div", {
1457
+ ref_key: "seekTrackEl",
1458
+ ref: B,
1459
+ class: "gvp-seek-track"
1460
+ }, [
1461
+ a("div", {
1023
1462
  class: "gvp-seek-buffered",
1024
- style: ge({ width: `${B()}%` })
1463
+ style: ce({ width: `${re()}%` })
1025
1464
  }, null, 4),
1026
- l("div", {
1465
+ a("div", {
1027
1466
  class: "gvp-seek-progress",
1028
- style: ge({ width: `${C()}%` })
1029
- }, null, 4)
1030
- ]),
1031
- l("input", {
1467
+ style: ce({ width: `${K()}%` })
1468
+ }, null, 4),
1469
+ j() ? (r(!0), c(oe, { key: 0 }, pe(Q.value, (_) => at((r(), c("div", {
1470
+ key: `${_.start}-${_.title}`,
1471
+ class: "gvp-seek-chapter-tick",
1472
+ style: ce({ left: `${_.start / w.value * 100}%` })
1473
+ }, null, 4)), [
1474
+ [rt, _.start > 0 && _.start < w.value]
1475
+ ])), 128)) : x("", !0)
1476
+ ], 512),
1477
+ H.value && j() ? (r(), c("div", {
1478
+ key: 0,
1479
+ class: L(["gvp-seek-preview", { "has-thumb": p.value }]),
1480
+ style: ce({ left: `${ee.value}px` })
1481
+ }, [
1482
+ p.value && y.value ? (r(), c("div", {
1483
+ key: 0,
1484
+ class: "gvp-seek-preview-thumb",
1485
+ style: ce({
1486
+ width: `${y.value.w}px`,
1487
+ height: `${y.value.h}px`,
1488
+ backgroundImage: `url(${JSON.stringify(y.value.url)})`,
1489
+ backgroundPosition: `-${y.value.x}px -${y.value.y}px`
1490
+ })
1491
+ }, null, 4)) : x("", !0),
1492
+ Y.value ? (r(), c("span", An, Z(Y.value.title), 1)) : x("", !0),
1493
+ a("span", Sn, Z(le(_e)(D.value)), 1)
1494
+ ], 6)) : x("", !0),
1495
+ a("input", {
1032
1496
  type: "range",
1033
1497
  class: "gvp-seek-input",
1034
1498
  min: 0,
1035
1499
  max: 100,
1036
1500
  step: 0.1,
1037
- value: C(),
1038
- disabled: !u(),
1501
+ value: K(),
1502
+ disabled: !j(),
1039
1503
  "aria-label": "Seek",
1040
1504
  "aria-valuemin": 0,
1041
- "aria-valuemax": Math.floor(h.value),
1042
- "aria-valuenow": Math.floor(b.value),
1043
- onInput: W
1044
- }, null, 40, _t)
1045
- ]),
1046
- l("span", Et, O(ee(_e)(b.value)) + " / " + O(ee(_e)(h.value)), 1),
1047
- l("div", {
1048
- ref_key: "speedRootEl",
1049
- ref: H,
1050
- class: "gvp-speed"
1051
- }, [
1052
- l("button", {
1505
+ "aria-valuemax": Math.floor(w.value),
1506
+ "aria-valuenow": Math.floor(P.value),
1507
+ "aria-valuetext": `${le(_e)(P.value)} of ${le(_e)(w.value)}`,
1508
+ onInput: C
1509
+ }, null, 40, Nn)
1510
+ ], 32)
1511
+ ]),
1512
+ a("div", Hn, [
1513
+ a("div", Vn, [
1514
+ a("button", {
1053
1515
  type: "button",
1054
- class: "gvp-ctrl-btn gvp-speed-btn",
1055
- "aria-haspopup": "listbox",
1056
- "aria-expanded": I.value,
1057
- "aria-label": `Playback speed: ${V.value === 1 ? "1×" : V.value + "×"}`,
1058
- onClick: r[1] || (r[1] = (p) => I.value = !I.value)
1516
+ class: "gvp-ctrl-btn",
1517
+ "aria-label": e.isPlaying ? "Pause" : "Play",
1518
+ "aria-pressed": e.isPlaying,
1519
+ onClick: b[0] || (b[0] = //@ts-ignore
1520
+ (..._) => e.onTogglePlay && e.onTogglePlay(..._))
1059
1521
  }, [
1060
- U($e),
1061
- l("span", $t, O(V.value === 1 ? "1×" : `${V.value}×`), 1)
1062
- ], 8, Lt),
1063
- I.value ? (i(), v("ul", Pt, [
1064
- (i(), v(oe, null, ae(f, (p) => l("li", { key: p }, [
1065
- l("button", {
1066
- type: "button",
1067
- role: "option",
1068
- "aria-selected": p === V.value,
1069
- class: y(["gvp-speed-menu-item", { "is-active": p === V.value }]),
1070
- onClick: (L) => z(p)
1071
- }, O(p === 1 ? "Normal" : `${p}×`), 11, Mt)
1072
- ])), 64))
1073
- ])) : T("", !0)
1074
- ], 512),
1075
- ke.value ? (i(), v("div", {
1076
- key: 0,
1077
- ref_key: "qualityRootEl",
1078
- ref: re,
1079
- class: "gvp-quality"
1080
- }, [
1081
- l("button", {
1522
+ e.isPlaying ? (r(), J(Vt, { key: 0 })) : (r(), J(Rt, { key: 1 }))
1523
+ ], 8, Bn),
1524
+ e.hasPrev || e.hasNext ? (r(), c("button", {
1525
+ key: 0,
1082
1526
  type: "button",
1083
- class: "gvp-ctrl-btn gvp-quality-btn",
1084
- "aria-haspopup": "listbox",
1085
- "aria-expanded": X.value,
1086
- "aria-label": `Quality: ${se.value}`,
1087
- onClick: r[2] || (r[2] = (p) => X.value = !X.value)
1527
+ class: "gvp-ctrl-btn",
1528
+ "aria-label": "Previous video",
1529
+ disabled: !e.hasPrev,
1530
+ onClick: b[1] || (b[1] = (_) => v("prev"))
1088
1531
  }, [
1089
- U(ft),
1090
- l("span", It, O(se.value), 1)
1091
- ], 8, Tt),
1092
- X.value ? (i(), v("ul", St, [
1093
- l("li", null, [
1094
- l("button", {
1095
- type: "button",
1096
- role: "option",
1097
- "aria-selected": t.selectedLevel < 0,
1098
- class: y(["gvp-quality-menu-item", { "is-active": t.selectedLevel < 0 }]),
1099
- onClick: r[3] || (r[3] = (p) => ue(ee(He).index))
1100
- }, O(te.value ? `Auto (${te.value.label})` : "Auto"), 11, Ht)
1101
- ]),
1102
- (i(!0), v(oe, null, ae(Q.value, (p) => (i(), v("li", {
1103
- key: p.index
1104
- }, [
1105
- l("button", {
1106
- type: "button",
1107
- role: "option",
1108
- "aria-selected": p.index === t.selectedLevel,
1109
- class: y(["gvp-quality-menu-item", { "is-active": p.index === t.selectedLevel }]),
1110
- onClick: (L) => ue(p.index)
1111
- }, O(p.label), 11, At)
1112
- ]))), 128))
1113
- ])) : T("", !0)
1114
- ], 512)) : T("", !0),
1115
- le.value.length > 0 ? (i(), v("div", {
1116
- key: 1,
1117
- ref_key: "captionsRootEl",
1118
- ref: ce,
1119
- class: "gvp-captions"
1120
- }, [
1121
- l("button", {
1532
+ O(Ft)
1533
+ ], 8, Rn)) : x("", !0),
1534
+ e.hasPrev || e.hasNext ? (r(), c("button", {
1535
+ key: 1,
1122
1536
  type: "button",
1123
- class: y(["gvp-ctrl-btn", F.value >= 0 && "is-active"]),
1124
- "aria-haspopup": "listbox",
1125
- "aria-expanded": Y.value,
1126
- "aria-label": "Captions",
1127
- "aria-pressed": F.value >= 0,
1128
- onClick: r[4] || (r[4] = (p) => Y.value = !Y.value)
1537
+ class: "gvp-ctrl-btn",
1538
+ "aria-label": "Next video",
1539
+ disabled: !e.hasNext,
1540
+ onClick: b[2] || (b[2] = (_) => v("next"))
1129
1541
  }, [
1130
- U(Pe)
1131
- ], 10, Bt),
1132
- Y.value ? (i(), v("ul", Vt, [
1133
- l("li", null, [
1134
- l("button", {
1135
- type: "button",
1136
- role: "option",
1137
- "aria-selected": F.value === -1,
1138
- class: y(["gvp-captions-menu-item", { "is-active": F.value === -1 }]),
1139
- onClick: pe
1140
- }, "Off", 10, qt)
1141
- ]),
1142
- (i(!0), v(oe, null, ae(le.value, (p) => (i(), v("li", {
1143
- key: p.index
1542
+ O(Ot)
1543
+ ], 8, Dn)) : x("", !0),
1544
+ a("div", {
1545
+ class: L(["gvp-volume", !le(t) && "is-expandable"])
1546
+ }, [
1547
+ a("button", {
1548
+ type: "button",
1549
+ class: "gvp-ctrl-btn",
1550
+ "aria-label": G.value ? "Unmute" : "Mute",
1551
+ "aria-pressed": G.value,
1552
+ onClick: ge
1144
1553
  }, [
1145
- l("button", {
1146
- type: "button",
1147
- role: "option",
1148
- "aria-selected": p.index === F.value,
1149
- class: y(["gvp-captions-menu-item", { "is-active": p.index === F.value }]),
1150
- onClick: (L) => ve(p.index)
1151
- }, O(p.label), 11, Dt)
1152
- ]))), 128))
1153
- ])) : T("", !0)
1154
- ], 512)) : T("", !0),
1155
- l("div", {
1156
- class: y(["gvp-volume", !ee(s) && "is-expandable"])
1157
- }, [
1158
- l("button", {
1554
+ G.value || X.value === 0 ? (r(), J(Kt, { key: 0 })) : X.value < 0.5 ? (r(), J(zt, { key: 1 })) : (r(), J(Ut, { key: 2 }))
1555
+ ], 8, Fn),
1556
+ le(t) ? x("", !0) : (r(), c("div", qn, [
1557
+ a("div", On, [
1558
+ a("div", {
1559
+ class: "gvp-volume-fill",
1560
+ style: ce({ width: `${G.value ? 0 : Math.round(X.value * 100)}%` })
1561
+ }, null, 4)
1562
+ ]),
1563
+ a("input", {
1564
+ type: "range",
1565
+ class: "gvp-volume-input",
1566
+ min: 0,
1567
+ max: 100,
1568
+ step: 1,
1569
+ value: G.value ? 0 : Math.round(X.value * 100),
1570
+ "aria-label": "Volume",
1571
+ "aria-valuemin": 0,
1572
+ "aria-valuemax": 100,
1573
+ "aria-valuenow": G.value ? 0 : Math.round(X.value * 100),
1574
+ "aria-valuetext": `${G.value ? 0 : Math.round(X.value * 100)}%`,
1575
+ onInput: ue
1576
+ }, null, 40, jn)
1577
+ ]))
1578
+ ], 2),
1579
+ M.value ? x("", !0) : (r(), c("span", Un, Z(le(_e)(P.value)) + " / " + Z(le(_e)(w.value)), 1)),
1580
+ M.value ? (r(), c("button", {
1581
+ key: 3,
1159
1582
  type: "button",
1160
- class: "gvp-ctrl-btn",
1161
- "aria-label": Z.value ? "Unmute" : "Mute",
1162
- "aria-pressed": Z.value,
1163
- onClick: g
1583
+ class: L(["gvp-live", { "is-at-edge": f.value }]),
1584
+ disabled: f.value,
1585
+ "aria-label": f.value ? "Live" : "Go to live edge",
1586
+ onClick: z
1587
+ }, [...b[5] || (b[5] = [
1588
+ a("span", { class: "gvp-live-dot" }, null, -1),
1589
+ a("span", null, "LIVE", -1)
1590
+ ])], 10, Zn)) : x("", !0)
1591
+ ]),
1592
+ a("div", zn, [
1593
+ O(Ln, {
1594
+ video: e.video,
1595
+ "quality-levels": e.qualityLevels,
1596
+ "current-level": e.currentLevel,
1597
+ "selected-level": e.selectedLevel,
1598
+ "audio-tracks": e.audioTracks,
1599
+ "audio-track-index": e.audioTrackIndex,
1600
+ onSelectLevel: b[3] || (b[3] = (_) => v("select-level", _)),
1601
+ onSelectAudioTrack: b[4] || (b[4] = (_) => v("select-audio-track", _))
1602
+ }, null, 8, ["video", "quality-levels", "current-level", "selected-level", "audio-tracks", "audio-track-index"]),
1603
+ le(Ie) ? (r(), c("button", {
1604
+ key: 0,
1605
+ type: "button",
1606
+ class: L(["gvp-ctrl-btn", me.value && "is-active"]),
1607
+ "aria-label": me.value ? "Exit picture-in-picture" : "Picture-in-picture",
1608
+ "aria-pressed": me.value,
1609
+ onClick: Ae
1164
1610
  }, [
1165
- Z.value || M.value === 0 ? (i(), j(vt, { key: 0 })) : M.value < 0.5 ? (i(), j(ct, { key: 1 })) : (i(), j(rt, { key: 2 }))
1166
- ], 8, Rt),
1167
- ee(s) ? T("", !0) : (i(), v("div", Ft, [
1168
- l("div", Nt, [
1169
- l("div", {
1170
- class: "gvp-volume-fill",
1171
- style: ge({ width: `${Z.value ? 0 : Math.round(M.value * 100)}%` })
1172
- }, null, 4)
1173
- ]),
1174
- l("input", {
1175
- type: "range",
1176
- class: "gvp-volume-input",
1177
- min: 0,
1178
- max: 100,
1179
- step: 1,
1180
- value: Z.value ? 0 : Math.round(M.value * 100),
1181
- "aria-label": "Volume",
1182
- "aria-valuemin": 0,
1183
- "aria-valuemax": 100,
1184
- "aria-valuenow": Z.value ? 0 : Math.round(M.value * 100),
1185
- onInput: P
1186
- }, null, 40, Ot)
1187
- ]))
1188
- ], 2),
1189
- ee(d) ? (i(), v("button", {
1190
- key: 2,
1191
- type: "button",
1192
- class: y(["gvp-ctrl-btn", c.value && "is-active"]),
1193
- "aria-label": c.value ? "Exit picture-in-picture" : "Picture-in-picture",
1194
- "aria-pressed": c.value,
1195
- onClick: D
1196
- }, [
1197
- U(Me)
1198
- ], 10, Ut)) : T("", !0),
1199
- ee(Ie) ? (i(), v("button", {
1200
- key: 3,
1201
- type: "button",
1202
- class: y(["gvp-ctrl-btn", K.value && "is-active"]),
1203
- "aria-label": K.value ? "Exit fullscreen" : "Enter fullscreen",
1204
- "aria-pressed": K.value,
1205
- onClick: Te
1206
- }, [
1207
- K.value ? (i(), j(yt, { key: 0 })) : (i(), j(gt, { key: 1 }))
1208
- ], 10, Zt)) : T("", !0)
1611
+ O(ze)
1612
+ ], 10, Wn)) : x("", !0),
1613
+ le(Ne) ? (r(), c("button", {
1614
+ key: 1,
1615
+ type: "button",
1616
+ class: L(["gvp-ctrl-btn", de.value && "is-active"]),
1617
+ "aria-label": de.value ? "Exit fullscreen" : "Enter fullscreen",
1618
+ "aria-pressed": de.value,
1619
+ onClick: Se
1620
+ }, [
1621
+ de.value ? (r(), J(Xt, { key: 0 })) : (r(), J(Gt, { key: 1 }))
1622
+ ], 10, Kn)) : x("", !0)
1623
+ ])
1209
1624
  ])
1210
1625
  ], 34));
1211
1626
  }
1212
- }), Wt = { name: "IconDesktop" }, zt = /* @__PURE__ */ S({
1213
- ...Wt,
1627
+ }), Jn = { name: "IconDesktop" }, Xn = /* @__PURE__ */ N({
1628
+ ...Jn,
1214
1629
  props: {
1215
1630
  class: {}
1216
1631
  },
1217
- setup(t) {
1218
- const o = t;
1219
- return (s, e) => (i(), v("svg", {
1220
- class: y(["gvp-icon", o.class]),
1632
+ setup(e) {
1633
+ const s = e;
1634
+ return (t, n) => (r(), c("svg", {
1635
+ class: L(["gvp-icon", s.class]),
1221
1636
  width: "20",
1222
1637
  height: "20",
1223
1638
  viewBox: "0 0 24 24",
1224
1639
  fill: "none",
1225
1640
  xmlns: "http://www.w3.org/2000/svg",
1226
1641
  "aria-hidden": "true"
1227
- }, [...e[0] || (e[0] = [
1228
- l("path", {
1642
+ }, [...n[0] || (n[0] = [
1643
+ a("path", {
1229
1644
  d: "M14 2H10C6.72077 2 5.08116 2 3.91891 2.81382C3.48891 3.1149 3.1149 3.48891 2.81382 3.91891C2 5.08116 2 6.72077 2 10C2 13.2792 2 14.9188 2.81382 16.0811C3.1149 16.5111 3.48891 16.8851 3.91891 17.1862C5.08116 18 6.72077 18 10 18H14C17.2792 18 18.9188 18 20.0811 17.1862C20.5111 16.8851 20.8851 16.5111 21.1862 16.0811C22 14.9188 22 13.2792 22 10C22 6.72077 22 5.08116 21.1862 3.91891C20.8851 3.48891 20.5111 3.1149 20.0811 2.81382C18.9188 2 17.2792 2 14 2Z",
1230
1645
  stroke: "currentColor",
1231
1646
  "stroke-width": "1.5",
1232
1647
  "stroke-linecap": "round"
1233
1648
  }, null, -1),
1234
- l("path", {
1649
+ a("path", {
1235
1650
  d: "M11 15H13",
1236
1651
  stroke: "currentColor",
1237
1652
  "stroke-width": "1.5",
1238
1653
  "stroke-linecap": "round",
1239
1654
  "stroke-linejoin": "round"
1240
1655
  }, null, -1),
1241
- l("path", {
1656
+ a("path", {
1242
1657
  d: "M14.5 22L14.1845 21.5811C13.4733 20.6369 13.2969 19.1944 13.7468 18M9.5 22L9.8155 21.5811C10.5267 20.6369 10.7031 19.1944 10.2532 18",
1243
1658
  stroke: "currentColor",
1244
1659
  "stroke-width": "1.5",
1245
1660
  "stroke-linecap": "round"
1246
1661
  }, null, -1),
1247
- l("path", {
1662
+ a("path", {
1248
1663
  d: "M7 22H17",
1249
1664
  stroke: "currentColor",
1250
1665
  "stroke-width": "1.5",
@@ -1252,36 +1667,36 @@ const wt = { class: "gvp-controls-row" }, bt = ["aria-label", "aria-pressed"], C
1252
1667
  }, null, -1)
1253
1668
  ])], 2));
1254
1669
  }
1255
- }), Yt = { name: "IconMobile" }, Kt = /* @__PURE__ */ S({
1256
- ...Yt,
1670
+ }), es = { name: "IconMobile" }, ts = /* @__PURE__ */ N({
1671
+ ...es,
1257
1672
  props: {
1258
1673
  class: {}
1259
1674
  },
1260
- setup(t) {
1261
- const o = t;
1262
- return (s, e) => (i(), v("svg", {
1263
- class: y(["gvp-icon", o.class]),
1675
+ setup(e) {
1676
+ const s = e;
1677
+ return (t, n) => (r(), c("svg", {
1678
+ class: L(["gvp-icon", s.class]),
1264
1679
  width: "20",
1265
1680
  height: "20",
1266
1681
  viewBox: "0 0 24 24",
1267
1682
  fill: "none",
1268
1683
  xmlns: "http://www.w3.org/2000/svg",
1269
1684
  "aria-hidden": "true"
1270
- }, [...e[0] || (e[0] = [
1271
- l("path", {
1685
+ }, [...n[0] || (n[0] = [
1686
+ a("path", {
1272
1687
  d: "M5 9C5 5.70017 5 4.05025 6.02513 3.02513C7.05025 2 8.70017 2 12 2C15.2998 2 16.9497 2 17.9749 3.02513C19 4.05025 19 5.70017 19 9V15C19 18.2998 19 19.9497 17.9749 20.9749C16.9497 22 15.2998 22 12 22C8.70017 22 7.05025 22 6.02513 20.9749C5 19.9497 5 18.2998 5 15V9Z",
1273
1688
  stroke: "currentColor",
1274
1689
  "stroke-width": "2",
1275
1690
  "stroke-linecap": "round"
1276
1691
  }, null, -1),
1277
- l("path", {
1692
+ a("path", {
1278
1693
  d: "M11 19H13",
1279
1694
  stroke: "currentColor",
1280
1695
  "stroke-width": "2",
1281
1696
  "stroke-linecap": "round",
1282
1697
  "stroke-linejoin": "round"
1283
1698
  }, null, -1),
1284
- l("path", {
1699
+ a("path", {
1285
1700
  d: "M9 2L9.089 2.53402C9.28188 3.69129 9.37832 4.26993 9.77519 4.62204C10.1892 4.98934 10.7761 5 12 5C13.2239 5 13.8108 4.98934 14.2248 4.62204C14.6217 4.26993 14.7181 3.69129 14.911 2.53402L15 2",
1286
1701
  stroke: "currentColor",
1287
1702
  "stroke-width": "2",
@@ -1289,125 +1704,277 @@ const wt = { class: "gvp-controls-row" }, bt = ["aria-label", "aria-pressed"], C
1289
1704
  }, null, -1)
1290
1705
  ])], 2));
1291
1706
  }
1292
- }), Jt = { name: "IconPlay" }, Xt = /* @__PURE__ */ S({
1293
- ...Jt,
1707
+ }), ns = { name: "IconPlay" }, ss = /* @__PURE__ */ N({
1708
+ ...ns,
1294
1709
  props: {
1295
1710
  class: {}
1296
1711
  },
1297
- setup(t) {
1298
- const o = t;
1299
- return (s, e) => (i(), v("svg", {
1300
- class: y(["gvp-icon", o.class]),
1712
+ setup(e) {
1713
+ const s = e;
1714
+ return (t, n) => (r(), c("svg", {
1715
+ class: L(["gvp-icon", s.class]),
1301
1716
  width: "22",
1302
1717
  height: "22",
1303
1718
  viewBox: "0 0 16 16",
1304
1719
  fill: "none",
1305
1720
  xmlns: "http://www.w3.org/2000/svg",
1306
1721
  "aria-hidden": "true"
1307
- }, [...e[0] || (e[0] = [
1308
- l("path", {
1722
+ }, [...n[0] || (n[0] = [
1723
+ a("path", {
1309
1724
  d: "M5.3335 11.45V4.54997C5.3335 4.36108 5.40016 4.20275 5.5335 4.07497C5.66683 3.94719 5.82238 3.8833 6.00016 3.8833C6.05572 3.8833 6.11405 3.89163 6.17516 3.9083C6.23627 3.92497 6.29461 3.94997 6.35016 3.9833L11.7835 7.4333C11.8835 7.49997 11.9585 7.5833 12.0085 7.6833C12.0585 7.7833 12.0835 7.88886 12.0835 7.99997C12.0835 8.11108 12.0585 8.21663 12.0085 8.31663C11.9585 8.41663 11.8835 8.49997 11.7835 8.56663L6.35016 12.0166C6.29461 12.05 6.23627 12.075 6.17516 12.0916C6.11405 12.1083 6.05572 12.1166 6.00016 12.1166C5.82238 12.1166 5.66683 12.0527 5.5335 11.925C5.40016 11.7972 5.3335 11.6389 5.3335 11.45Z",
1310
1725
  fill: "currentColor"
1311
1726
  }, null, -1)
1312
1727
  ])], 2));
1313
1728
  }
1314
- }), Gt = { name: "IconX" }, en = /* @__PURE__ */ S({
1315
- ...Gt,
1729
+ }), ls = { name: "IconX" }, Oe = /* @__PURE__ */ N({
1730
+ ...ls,
1316
1731
  props: {
1317
1732
  class: {}
1318
1733
  },
1319
- setup(t) {
1320
- const o = t;
1321
- return (s, e) => (i(), v("svg", {
1322
- class: y(["gvp-icon", o.class]),
1734
+ setup(e) {
1735
+ const s = e;
1736
+ return (t, n) => (r(), c("svg", {
1737
+ class: L(["gvp-icon", s.class]),
1323
1738
  width: "14",
1324
1739
  height: "14",
1325
1740
  viewBox: "0 0 14 14",
1326
1741
  fill: "none",
1327
1742
  xmlns: "http://www.w3.org/2000/svg",
1328
1743
  "aria-hidden": "true"
1329
- }, [...e[0] || (e[0] = [
1330
- l("path", {
1744
+ }, [...n[0] || (n[0] = [
1745
+ a("path", {
1331
1746
  d: "M6.94994 5.53594L12.1929 0.292938C12.5834 -0.0975275 13.2165 -0.0975279 13.6069 0.292938C13.9974 0.683403 13.9974 1.31647 13.6069 1.70694L8.36394 6.94994L13.6069 12.1929C13.9974 12.5834 13.9974 13.2165 13.6069 13.6069C13.2165 13.9974 12.5834 13.9974 12.1929 13.6069L6.94994 8.36394L1.70694 13.6069C1.31647 13.9974 0.683403 13.9974 0.292938 13.6069C-0.0975279 13.2165 -0.0975277 12.5834 0.292938 12.1929L5.53594 6.94994L0.292938 1.70694C-0.0975279 1.31647 -0.0975279 0.683403 0.292938 0.292938C0.683403 -0.0975279 1.31647 -0.0975277 1.70694 0.292938L6.94994 5.53594Z",
1332
1747
  fill: "currentColor"
1333
1748
  }, null, -1)
1334
1749
  ])], 2));
1335
1750
  }
1751
+ }), os = { name: "IconAlert" }, as = /* @__PURE__ */ N({
1752
+ ...os,
1753
+ props: {
1754
+ class: {}
1755
+ },
1756
+ setup(e) {
1757
+ const s = e;
1758
+ return (t, n) => (r(), c("svg", {
1759
+ class: L(["gvp-icon", s.class]),
1760
+ width: "32",
1761
+ height: "32",
1762
+ viewBox: "0 0 24 24",
1763
+ fill: "none",
1764
+ xmlns: "http://www.w3.org/2000/svg",
1765
+ "aria-hidden": "true"
1766
+ }, [...n[0] || (n[0] = [
1767
+ a("path", {
1768
+ d: "M12 9V13M12 17H12.01M10.29 3.86L1.82 18A2 2 0 0 0 3.53 21H20.47A2 2 0 0 0 22.18 18L13.71 3.86A2 2 0 0 0 10.29 3.86Z",
1769
+ stroke: "currentColor",
1770
+ "stroke-width": "2",
1771
+ "stroke-linecap": "round",
1772
+ "stroke-linejoin": "round"
1773
+ }, null, -1)
1774
+ ])], 2));
1775
+ }
1776
+ }), rs = { name: "IconRefresh" }, is = /* @__PURE__ */ N({
1777
+ ...rs,
1778
+ props: {
1779
+ class: {}
1780
+ },
1781
+ setup(e) {
1782
+ const s = e;
1783
+ return (t, n) => (r(), c("svg", {
1784
+ class: L(["gvp-icon", s.class]),
1785
+ width: "16",
1786
+ height: "16",
1787
+ viewBox: "0 0 24 24",
1788
+ fill: "none",
1789
+ xmlns: "http://www.w3.org/2000/svg",
1790
+ "aria-hidden": "true"
1791
+ }, [...n[0] || (n[0] = [
1792
+ a("path", {
1793
+ d: "M21 12A9 9 0 1 1 18.36 5.64M21 3V9H15",
1794
+ stroke: "currentColor",
1795
+ "stroke-width": "2",
1796
+ "stroke-linecap": "round",
1797
+ "stroke-linejoin": "round"
1798
+ }, null, -1)
1799
+ ])], 2));
1800
+ }
1336
1801
  });
1337
- function tn(t) {
1338
- if (!t) return null;
1339
- if (/^[A-Za-z0-9_-]{11}$/.test(t)) return t;
1340
- let o;
1802
+ function us(e) {
1803
+ if (!e) return null;
1804
+ if (/^[A-Za-z0-9_-]{11}$/.test(e)) return e;
1805
+ let s;
1341
1806
  try {
1342
- o = new URL(t);
1807
+ s = new URL(e);
1343
1808
  } catch {
1344
1809
  return null;
1345
1810
  }
1346
- const s = o.hostname.replace(/^www\./, "");
1347
- if (s === "youtu.be") {
1348
- const e = o.pathname.slice(1).split("/")[0];
1349
- return /^[A-Za-z0-9_-]{11}$/.test(e) ? e : null;
1811
+ const t = s.hostname.replace(/^www\./, "");
1812
+ if (t === "youtu.be") {
1813
+ const n = s.pathname.slice(1).split("/")[0];
1814
+ return /^[A-Za-z0-9_-]{11}$/.test(n) ? n : null;
1350
1815
  }
1351
- if (s === "youtube.com" || s === "m.youtube.com" || s === "music.youtube.com" || s === "youtube-nocookie.com") {
1352
- const e = o.searchParams.get("v");
1353
- if (e && /^[A-Za-z0-9_-]{11}$/.test(e)) return e;
1354
- const f = /^\/(?:embed|shorts|v|live)\/([A-Za-z0-9_-]{11})/.exec(
1355
- o.pathname
1816
+ if (t === "youtube.com" || t === "m.youtube.com" || t === "music.youtube.com" || t === "youtube-nocookie.com") {
1817
+ const n = s.searchParams.get("v");
1818
+ if (n && /^[A-Za-z0-9_-]{11}$/.test(n)) return n;
1819
+ const o = /^\/(?:embed|shorts|v|live)\/([A-Za-z0-9_-]{11})/.exec(
1820
+ s.pathname
1356
1821
  );
1357
- if (f) return f[1];
1822
+ if (o) return o[1];
1358
1823
  }
1359
1824
  return null;
1360
1825
  }
1361
- function nn(t) {
1826
+ function cs(e) {
1362
1827
  try {
1363
- const o = new URL(t), s = o.searchParams.get("t") ?? o.searchParams.get("start");
1364
- if (!s) return null;
1365
- if (/^\d+s?$/.test(s)) return Number.parseInt(s, 10);
1366
- const e = /^(?:(\d+)h)?(?:(\d+)m)?(?:(\d+)s)?$/.exec(s);
1367
- if (e) {
1368
- const f = Number.parseInt(e[1] ?? "0", 10), a = Number.parseInt(e[2] ?? "0", 10), w = Number.parseInt(e[3] ?? "0", 10), m = f * 3600 + a * 60 + w;
1369
- return m > 0 ? m : null;
1828
+ const s = new URL(e), t = s.searchParams.get("t") ?? s.searchParams.get("start");
1829
+ if (!t) return null;
1830
+ if (/^\d+s?$/.test(t)) return Number.parseInt(t, 10);
1831
+ const n = /^(?:(\d+)h)?(?:(\d+)m)?(?:(\d+)s)?$/.exec(t);
1832
+ if (n) {
1833
+ const o = Number.parseInt(n[1] ?? "0", 10), v = Number.parseInt(n[2] ?? "0", 10), d = Number.parseInt(n[3] ?? "0", 10), h = o * 3600 + v * 60 + d;
1834
+ return h > 0 ? h : null;
1370
1835
  }
1371
1836
  } catch {
1372
1837
  }
1373
1838
  return null;
1374
1839
  }
1375
- function ln(t, o = {}) {
1840
+ function ds(e, s = {}) {
1376
1841
  const {
1377
- autoPlay: s = !1,
1378
- muted: e = !0,
1379
- loop: f = !1,
1380
- controls: a = !0,
1381
- startSeconds: w
1382
- } = o, m = new URLSearchParams({
1842
+ autoPlay: t = !1,
1843
+ muted: n = !0,
1844
+ loop: o = !1,
1845
+ controls: v = !0,
1846
+ startSeconds: d
1847
+ } = s, h = new URLSearchParams({
1383
1848
  rel: "0",
1384
1849
  modestbranding: "1",
1385
1850
  playsinline: "1",
1386
- controls: a ? "1" : "0"
1851
+ controls: v ? "1" : "0"
1387
1852
  });
1388
- return s ? (m.set("autoplay", "1"), m.set("mute", "1")) : e && m.set("mute", "1"), f && (m.set("loop", "1"), m.set("playlist", t)), w && w > 0 && m.set("start", String(w)), `https://www.youtube-nocookie.com/embed/${t}?${m.toString()}`;
1853
+ return t ? (h.set("autoplay", "1"), h.set("mute", "1")) : n && h.set("mute", "1"), o && (h.set("loop", "1"), h.set("playlist", e)), d && d > 0 && h.set("start", String(d)), `https://www.youtube-nocookie.com/embed/${e}?${h.toString()}`;
1389
1854
  }
1390
- const on = ["src"], an = {
1391
- key: 2,
1392
- class: "gvp-vignette"
1393
- }, sn = {
1855
+ const vs = "gvp:prefs:";
1856
+ function We(e) {
1857
+ return vs + e;
1858
+ }
1859
+ function Me(e) {
1860
+ if (typeof localStorage > "u") return {};
1861
+ try {
1862
+ const s = localStorage.getItem(We(e));
1863
+ if (!s) return {};
1864
+ const t = JSON.parse(s);
1865
+ return typeof t == "object" && t !== null ? t : {};
1866
+ } catch {
1867
+ return {};
1868
+ }
1869
+ }
1870
+ function Ke(e, s) {
1871
+ if (!(typeof localStorage > "u"))
1872
+ try {
1873
+ const n = { ...Me(e), ...s };
1874
+ localStorage.setItem(We(e), JSON.stringify(n));
1875
+ } catch {
1876
+ }
1877
+ }
1878
+ function je(e, s, t) {
1879
+ if (typeof localStorage > "u" || !s) return;
1880
+ const o = { ...Me(e).positions };
1881
+ t > 0 ? o[s] = t : delete o[s], Ke(e, { positions: o });
1882
+ }
1883
+ function ps(e, s) {
1884
+ var o;
1885
+ const n = (o = Me(e).positions) == null ? void 0 : o[s];
1886
+ return typeof n == "number" && n > 0 ? n : 0;
1887
+ }
1888
+ function fs(e) {
1889
+ const s = e.trim().replace(/^#/, "");
1890
+ if (/^[0-9a-f]{3}$/i.test(s))
1891
+ return [
1892
+ parseInt(s[0] + s[0], 16),
1893
+ parseInt(s[1] + s[1], 16),
1894
+ parseInt(s[2] + s[2], 16)
1895
+ ];
1896
+ if (/^[0-9a-f]{6}$/i.test(s))
1897
+ return [
1898
+ parseInt(s.slice(0, 2), 16),
1899
+ parseInt(s.slice(2, 4), 16),
1900
+ parseInt(s.slice(4, 6), 16)
1901
+ ];
1902
+ const t = /rgba?\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)/i.exec(e);
1903
+ return t ? [Number(t[1]), Number(t[2]), Number(t[3])] : null;
1904
+ }
1905
+ function ms(e, s) {
1906
+ const t = fs(e);
1907
+ return t ? `rgba(${t[0]}, ${t[1]}, ${t[2]}, ${s})` : e;
1908
+ }
1909
+ function gs(e, s) {
1910
+ if (!s) return "";
1911
+ const t = [];
1912
+ if (s.fontSize && t.push(`font-size: ${s.fontSize};`), s.textColor && t.push(`color: ${s.textColor};`), s.backgroundColor) {
1913
+ const n = typeof s.backgroundOpacity == "number" ? ms(s.backgroundColor, s.backgroundOpacity) : s.backgroundColor;
1914
+ t.push(`background-color: ${n};`);
1915
+ } else typeof s.backgroundOpacity == "number" && t.push(`background-color: rgba(0, 0, 0, ${s.backgroundOpacity});`);
1916
+ return t.length === 0 ? "" : `.${e}::cue { ${t.join(" ")} }`;
1917
+ }
1918
+ function hs(e) {
1919
+ const s = e.trim().replace(/^#/, "");
1920
+ if (/^[0-9a-f]{3}$/i.test(s)) {
1921
+ const n = parseInt(s[0] + s[0], 16), o = parseInt(s[1] + s[1], 16), v = parseInt(s[2] + s[2], 16);
1922
+ return `${n} ${o} ${v}`;
1923
+ }
1924
+ if (/^[0-9a-f]{6}$/i.test(s)) {
1925
+ const n = parseInt(s.slice(0, 2), 16), o = parseInt(s.slice(2, 4), 16), v = parseInt(s.slice(4, 6), 16);
1926
+ return `${n} ${o} ${v}`;
1927
+ }
1928
+ const t = /rgba?\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)/i.exec(e);
1929
+ return t ? `${t[1]} ${t[2]} ${t[3]}` : null;
1930
+ }
1931
+ function ks(e) {
1932
+ if (!e) return {};
1933
+ const s = {};
1934
+ if (e.accent) {
1935
+ const t = hs(e.accent);
1936
+ t ? s["--gvp-accent-rgb"] = t : s["--gvp-accent"] = e.accent;
1937
+ }
1938
+ return e.radius && (s["--gvp-radius"] = e.radius), s;
1939
+ }
1940
+ const ys = ["src"], bs = {
1394
1941
  key: 3,
1942
+ class: "gvp-vignette"
1943
+ }, ws = {
1944
+ key: 4,
1945
+ class: "gvp-sr-only",
1946
+ role: "status",
1947
+ "aria-live": "polite"
1948
+ }, xs = {
1949
+ key: 5,
1950
+ class: "gvp-loading",
1951
+ role: "status",
1952
+ "aria-live": "polite"
1953
+ }, Cs = {
1954
+ key: 6,
1955
+ class: "gvp-error",
1956
+ role: "alert"
1957
+ }, Ls = {
1958
+ key: 7,
1395
1959
  class: "gvp-toggle"
1396
- }, rn = { class: "gvp-toggle-pill" }, un = ["aria-pressed"], cn = ["aria-pressed"], dn = ["aria-label", "aria-pressed"], vn = ["aria-label"], pn = {
1397
- key: 10,
1960
+ }, $s = { class: "gvp-toggle-pill" }, Es = ["aria-pressed"], _s = ["aria-pressed"], Ps = ["aria-label", "aria-pressed"], Ts = ["aria-label"], Ms = {
1961
+ key: 14,
1398
1962
  class: "gvp-play-wrap"
1399
- }, fn = {
1963
+ }, Is = {
1400
1964
  key: 0,
1401
1965
  class: "gvp-tooltip",
1402
1966
  role: "tooltip"
1403
- }, mn = {
1404
- key: 12,
1967
+ }, As = {
1968
+ key: 16,
1405
1969
  class: "gvp-bottom-fade"
1406
- }, kn = /* @__PURE__ */ S({
1970
+ }, Hs = /* @__PURE__ */ N({
1407
1971
  __name: "VideoPlayer",
1408
1972
  props: {
1409
1973
  src: {},
1410
1974
  poster: {},
1975
+ playlist: {},
1976
+ defaultIndex: { default: 0 },
1977
+ autoAdvance: { type: Boolean, default: !0 },
1411
1978
  showDeviceToggle: { type: Boolean, default: !0 },
1412
1979
  defaultDevice: { default: "desktop" },
1413
1980
  hoverPlay: { type: Boolean, default: !1 },
@@ -1420,299 +1987,543 @@ const on = ["src"], an = {
1420
1987
  aspectRatio: {},
1421
1988
  hlsConfig: {},
1422
1989
  isHls: { type: Boolean },
1990
+ thumbnails: {},
1991
+ chapters: {},
1992
+ persistKey: {},
1993
+ captionStyle: {},
1994
+ theme: {},
1995
+ miniPlayer: { type: Boolean, default: !1 },
1996
+ miniPlayerPosition: { default: "bottom-right" },
1997
+ ambientMode: { type: Boolean, default: !1 },
1423
1998
  class: { default: "" },
1424
1999
  closable: { type: Boolean, default: !1 }
1425
2000
  },
1426
- emits: ["close", "play", "pause"],
1427
- setup(t, { emit: o }) {
1428
- const s = t, e = o, f = k(null), a = k(s.defaultDevice), w = k(!1), m = k(!1), $ = k(null), E = k([]), _ = k(-1), A = k([]), b = k(-1), h = k(-1), x = k(1), u = k(!1), C = k(!1), B = k(null), W = typeof document < "u" && !!document.pictureInPictureEnabled, M = N(
1429
- () => s.controls === !0 || s.controls === "custom"
1430
- ), Z = N(() => s.controls === "native"), g = N(() => tn(s.src)), P = N(() => g.value !== null), V = N(
1431
- () => g.value ? ln(g.value, {
1432
- autoPlay: s.autoPlay,
1433
- muted: s.muted,
1434
- loop: s.loop,
1435
- controls: M.value ? !0 : Z.value,
1436
- startSeconds: nn(s.src)
2001
+ emits: ["close", "play", "pause", "ended", "time-update", "seeked", "volume-change", "milestone", "error", "playlist-change"],
2002
+ setup(e, { emit: s }) {
2003
+ const t = e, n = s, o = g(null), v = g(t.defaultDevice), d = g(!1), h = g(!1), E = g(!1), A = g(!1), S = g(!1), P = g(0), w = g(null), $ = g([]), T = g(-1), f = g([]), M = g(-1), z = g(-1), j = g(1), K = g(!1), re = g(!1), C = g(null), W = typeof document < "u" && !!document.pictureInPictureEnabled, B = I(
2004
+ () => t.controls === !0 || t.controls === "custom"
2005
+ ), D = I(() => t.controls === "native"), F = `gvp-video-${Math.random().toString(36).slice(2, 10)}`, H = I(() => ks(t.theme)), R = g(!1), fe = g(!1), y = g(null);
2006
+ let p = null;
2007
+ V(y, (l) => {
2008
+ p == null || p.disconnect(), p = null, !(!t.miniPlayer || !l || typeof IntersectionObserver > "u") && (p = new IntersectionObserver(
2009
+ ([i]) => {
2010
+ i.isIntersecting ? (R.value = !1, fe.value = !1) : d.value && !fe.value && (R.value = !0);
2011
+ },
2012
+ { threshold: 0 }
2013
+ ), p.observe(l));
2014
+ }), V(d, (l) => {
2015
+ l || (R.value = !1);
2016
+ });
2017
+ function ee() {
2018
+ R.value = !1, fe.value = !0;
2019
+ }
2020
+ const m = g(null);
2021
+ let Q = 0;
2022
+ ae(() => {
2023
+ p == null || p.disconnect(), p = null, cancelAnimationFrame(Q);
2024
+ });
2025
+ let Y = null;
2026
+ V(
2027
+ () => t.captionStyle,
2028
+ (l) => {
2029
+ if (typeof document > "u") return;
2030
+ const i = gs(F, l);
2031
+ if (!i) {
2032
+ Y == null || Y.remove(), Y = null;
2033
+ return;
2034
+ }
2035
+ Y || (Y = document.createElement("style"), document.head.appendChild(Y)), Y.textContent = i;
2036
+ },
2037
+ { immediate: !0, deep: !0 }
2038
+ ), ae(() => {
2039
+ Y == null || Y.remove(), Y = null;
2040
+ });
2041
+ const X = I(
2042
+ () => Array.isArray(t.playlist) && t.playlist.length > 0
2043
+ ), G = g(
2044
+ X.value ? Math.min(Math.max(t.defaultIndex, 0), t.playlist.length - 1) : 0
2045
+ ), ge = I(
2046
+ () => X.value ? t.playlist[Math.min(G.value, t.playlist.length - 1)] : null
2047
+ ), ue = I(() => {
2048
+ var l;
2049
+ return ((l = ge.value) == null ? void 0 : l.src) ?? t.src ?? "";
2050
+ }), me = I(() => {
2051
+ var l;
2052
+ return ((l = ge.value) == null ? void 0 : l.poster) ?? t.poster;
2053
+ }), Ie = I(
2054
+ () => {
2055
+ var l;
2056
+ return ((l = ge.value) == null ? void 0 : l.thumbnails) ?? t.thumbnails;
2057
+ }
2058
+ ), Ae = I(
2059
+ () => {
2060
+ var l;
2061
+ return ((l = ge.value) == null ? void 0 : l.chapters) ?? t.chapters;
2062
+ }
2063
+ ), de = I(() => X.value && G.value > 0), Pe = I(
2064
+ () => X.value && G.value < t.playlist.length - 1
2065
+ );
2066
+ let xe = !1;
2067
+ function Ce(l, i = !1) {
2068
+ if (!X.value) return;
2069
+ const k = Math.min(Math.max(l, 0), t.playlist.length - 1);
2070
+ k !== G.value && (xe = i, G.value = k, n("playlist-change", k, t.playlist[k]));
2071
+ }
2072
+ const Le = I(() => us(ue.value)), U = I(() => Le.value !== null), Se = I(
2073
+ () => Le.value ? ds(Le.value, {
2074
+ autoPlay: t.autoPlay,
2075
+ muted: t.muted,
2076
+ loop: t.loop,
2077
+ controls: B.value ? !0 : D.value,
2078
+ startSeconds: cs(ue.value)
1437
2079
  }) : null
1438
2080
  );
1439
- function I(c) {
1440
- E.value = c, _.value = -1;
2081
+ function Ne(l) {
2082
+ $.value = l, T.value = -1;
1441
2083
  }
1442
- function H(c) {
1443
- A.value = c, h.value = -1;
2084
+ function u(l) {
2085
+ f.value = l, z.value = -1;
1444
2086
  }
1445
- const z = N(
1446
- () => !P.value && E.value.length > 1
1447
- ), X = N(
2087
+ const b = I(
2088
+ () => !U.value && $.value.length > 1
2089
+ ), _ = I(
1448
2090
  () => {
1449
- var c;
1450
- return _.value >= 0 ? _.value : ((c = E.value[0]) == null ? void 0 : c.index) ?? -1;
2091
+ var l;
2092
+ return T.value >= 0 ? T.value : ((l = $.value[0]) == null ? void 0 : l.index) ?? -1;
1451
2093
  }
1452
- ), re = N(
2094
+ ), te = I(
1453
2095
  () => {
1454
- var c, d;
1455
- return a.value === "mobile" ? ((c = s.aspectRatio) == null ? void 0 : c.mobile) ?? "9/16" : ((d = s.aspectRatio) == null ? void 0 : d.desktop) ?? "16/9";
2096
+ var l, i;
2097
+ return v.value === "mobile" ? ((l = t.aspectRatio) == null ? void 0 : l.mobile) ?? "9/16" : ((i = t.aspectRatio) == null ? void 0 : i.desktop) ?? "16/9";
1456
2098
  }
1457
- ), ke = N(
2099
+ ), he = I(
1458
2100
  () => {
1459
- var c, d;
1460
- return a.value === "mobile" ? ((c = s.frameMaxWidth) == null ? void 0 : c.mobile) ?? "420px" : ((d = s.frameMaxWidth) == null ? void 0 : d.desktop) ?? "960px";
2101
+ var l, i;
2102
+ return v.value === "mobile" ? ((l = t.frameMaxWidth) == null ? void 0 : l.mobile) ?? "420px" : ((i = t.frameMaxWidth) == null ? void 0 : i.desktop) ?? "960px";
1461
2103
  }
1462
- ), Q = N(() => {
1463
- var c;
1464
- return ((c = f.value) == null ? void 0 : c.videoEl) ?? null;
2104
+ ), q = I(() => {
2105
+ var l;
2106
+ return ((l = o.value) == null ? void 0 : l.videoEl) ?? null;
2107
+ });
2108
+ V([m, q], ([l, i]) => {
2109
+ if (cancelAnimationFrame(Q), !t.ambientMode || !l || !i || U.value) return;
2110
+ const k = l.getContext("2d");
2111
+ if (!k) return;
2112
+ let ne = 0;
2113
+ const ie = ($e) => {
2114
+ if (Q = requestAnimationFrame(ie), !($e - ne < 250) && (ne = $e, !(i.readyState < 2 || i.paused)))
2115
+ try {
2116
+ k.drawImage(i, 0, 0, l.width, l.height);
2117
+ } catch {
2118
+ }
2119
+ };
2120
+ Q = requestAnimationFrame(ie);
1465
2121
  });
1466
- async function te() {
1467
- const c = Q.value;
1468
- if (c)
2122
+ async function ke() {
2123
+ const l = q.value;
2124
+ if (l)
1469
2125
  try {
1470
- c.readyState < 2 && c.load();
1471
- const d = c.play();
1472
- $.value = d, await d, w.value = !0;
2126
+ l.readyState < 2 && l.load();
2127
+ const i = l.play();
2128
+ w.value = i, await i, d.value = !0;
1473
2129
  } catch {
1474
- w.value = !1;
2130
+ d.value = !1;
1475
2131
  } finally {
1476
- $.value = null;
2132
+ w.value = null;
1477
2133
  }
1478
2134
  }
1479
- async function se() {
1480
- const c = Q.value;
1481
- if (c) {
1482
- if ($.value)
2135
+ async function ve() {
2136
+ const l = q.value;
2137
+ if (l) {
2138
+ if (w.value)
1483
2139
  try {
1484
- await $.value;
2140
+ await w.value;
1485
2141
  } catch {
1486
2142
  }
1487
- c.pause();
2143
+ l.pause();
2144
+ }
2145
+ }
2146
+ async function Qe() {
2147
+ !t.hoverPlay || U.value || await ke();
2148
+ }
2149
+ async function Ye() {
2150
+ !t.hoverPlay || U.value || (await ve(), d.value = !1);
2151
+ }
2152
+ async function Te() {
2153
+ const l = q.value;
2154
+ l && (l.paused ? await ke() : (await ve(), d.value = !1));
2155
+ }
2156
+ function Ve() {
2157
+ const l = C.value;
2158
+ if (!l) return;
2159
+ if ((document.fullscreenElement ?? document.webkitFullscreenElement ?? null) === l) {
2160
+ const k = document.exitFullscreen ?? document.webkitExitFullscreen;
2161
+ k == null || k.call(document).catch(() => {
2162
+ });
2163
+ } else {
2164
+ const k = l.requestFullscreen ?? l.webkitRequestFullscreen;
2165
+ k == null || k.call(l).catch(() => {
2166
+ });
1488
2167
  }
1489
2168
  }
1490
- async function ue() {
1491
- !s.hoverPlay || P.value || await te();
2169
+ let ye = null;
2170
+ function Ge() {
2171
+ ye === null && (ye = setTimeout(() => {
2172
+ ye = null, Te();
2173
+ }, 250));
1492
2174
  }
1493
- async function le() {
1494
- !s.hoverPlay || P.value || (await se(), w.value = !1);
2175
+ function Je() {
2176
+ ye !== null && (clearTimeout(ye), ye = null), Ve();
1495
2177
  }
1496
- async function F() {
1497
- const c = Q.value;
1498
- c && (c.paused ? await te() : (await se(), w.value = !1));
2178
+ function Xe() {
2179
+ d.value = !1, n("ended"), X.value && t.autoAdvance && Pe.value && Ce(G.value + 1, !0);
1499
2180
  }
1500
- function Y() {
1501
- m.value = !0, ue();
2181
+ V(ue, () => {
2182
+ xe && (xe = !1, ke());
2183
+ });
2184
+ function et() {
2185
+ h.value = !0, Qe();
1502
2186
  }
1503
- function ce() {
1504
- m.value = !1, le();
2187
+ function tt() {
2188
+ h.value = !1, Ye();
1505
2189
  }
1506
- function de(c) {
1507
- x.value = c;
1508
- const d = Q.value;
1509
- d && (d.playbackRate = c);
2190
+ function nt(l) {
2191
+ j.value = l;
2192
+ const i = q.value;
2193
+ i && (i.playbackRate = l);
1510
2194
  }
1511
- R(Q, (c) => {
1512
- c && (c.addEventListener("ratechange", () => {
1513
- x.value = c.playbackRate;
1514
- }), c.addEventListener("enterpictureinpicture", () => {
1515
- u.value = !0;
1516
- }), c.addEventListener("leavepictureinpicture", () => {
1517
- u.value = !1;
1518
- }));
2195
+ V(q, (l) => {
2196
+ if (!l) return;
2197
+ l.addEventListener("ratechange", () => {
2198
+ j.value = l.playbackRate;
2199
+ }), l.addEventListener("enterpictureinpicture", () => {
2200
+ K.value = !0;
2201
+ }), l.addEventListener("leavepictureinpicture", () => {
2202
+ K.value = !1;
2203
+ });
2204
+ const i = /* @__PURE__ */ new Set();
2205
+ l.addEventListener("timeupdate", () => {
2206
+ const k = l.duration;
2207
+ if (n("time-update", l.currentTime, Number.isFinite(k) ? k : 0), !Number.isFinite(k) || k <= 0) return;
2208
+ const ne = l.currentTime / k * 100;
2209
+ for (const ie of [25, 50, 75, 100])
2210
+ ne >= ie && !i.has(ie) && (i.add(ie), n("milestone", ie));
2211
+ }), l.addEventListener("seeked", () => {
2212
+ n("seeked", l.currentTime);
2213
+ }), l.addEventListener("volumechange", () => {
2214
+ n("volume-change", l.volume, l.muted);
2215
+ }), l.addEventListener("error", () => {
2216
+ A.value = !0, E.value = !1, n("error");
2217
+ }), l.addEventListener("waiting", () => {
2218
+ E.value = !0;
2219
+ }), l.addEventListener("stalled", () => {
2220
+ E.value = !0;
2221
+ }), l.addEventListener("playing", () => {
2222
+ E.value = !1;
2223
+ }), l.addEventListener("canplay", () => {
2224
+ E.value = !1;
2225
+ }), l.addEventListener("seeked", () => {
2226
+ E.value = !1;
2227
+ });
2228
+ }), V(ue, () => {
2229
+ A.value = !1, E.value = !1;
1519
2230
  });
1520
- function ve() {
1521
- const c = Q.value;
1522
- c && (document.pictureInPictureElement ? document.exitPictureInPicture().catch(() => {
1523
- }) : c.requestPictureInPicture().catch(() => {
2231
+ function st() {
2232
+ A.value = !0, E.value = !1, n("error");
2233
+ }
2234
+ const lt = I(() => A.value ? "Video failed to load" : E.value ? "Loading" : d.value ? "Playing" : "Paused");
2235
+ function ot() {
2236
+ A.value = !1, E.value = !1, P.value += 1;
2237
+ }
2238
+ V(q, (l) => {
2239
+ if (!l || !t.persistKey) return;
2240
+ const i = t.persistKey, k = Me(i);
2241
+ typeof k.volume == "number" && (l.volume = k.volume), typeof k.muted == "boolean" && (l.muted = k.muted), typeof k.speed == "number" && (l.playbackRate = k.speed);
2242
+ const ne = () => {
2243
+ Ke(i, {
2244
+ volume: l.volume,
2245
+ muted: l.muted,
2246
+ speed: l.playbackRate
2247
+ });
2248
+ };
2249
+ l.addEventListener("volumechange", ne), l.addEventListener("ratechange", ne);
2250
+ }), V([q, ue], ([l, i]) => {
2251
+ if (!l || !t.persistKey || !i) return;
2252
+ const k = t.persistKey, ne = () => {
2253
+ const be = ps(k, i);
2254
+ be > 0 && (!Number.isFinite(l.duration) || be < l.duration - 1) && (l.currentTime = be);
2255
+ };
2256
+ l.readyState >= 1 ? ne() : l.addEventListener("loadedmetadata", ne, { once: !0 });
2257
+ let ie = 0;
2258
+ const $e = () => {
2259
+ const be = Date.now();
2260
+ be - ie < 1e3 || (ie = be, je(k, i, l.currentTime));
2261
+ };
2262
+ l.addEventListener("timeupdate", $e), l.addEventListener("pause", $e), l.addEventListener("ended", () => je(k, i, 0));
2263
+ }, { immediate: !0 });
2264
+ function Be() {
2265
+ const l = q.value;
2266
+ l && (document.pictureInPictureElement ? document.exitPictureInPicture().catch(() => {
2267
+ }) : l.requestPictureInPicture().catch(() => {
1524
2268
  }));
1525
2269
  }
1526
- function pe(c) {
1527
- var K, fe, me;
1528
- const d = Q.value;
1529
- if (!(!d || !C.value && !((K = B.value) != null && K.contains(document.activeElement)) || c.target.tagName === "INPUT" && c.key !== " "))
1530
- switch (c.key) {
2270
+ function Re(l) {
2271
+ var ne;
2272
+ const i = q.value;
2273
+ if (!(!i || !re.value && !((ne = C.value) != null && ne.contains(document.activeElement)) || l.target.tagName === "INPUT" && l.key !== " "))
2274
+ switch (l.key) {
1531
2275
  case " ":
1532
2276
  case "k":
1533
- c.preventDefault(), F();
2277
+ l.preventDefault(), Te();
1534
2278
  break;
1535
2279
  case "ArrowLeft":
1536
- c.preventDefault(), d.currentTime = Math.max(0, d.currentTime - 5);
2280
+ l.preventDefault(), i.currentTime = Math.max(0, i.currentTime - 5);
1537
2281
  break;
1538
2282
  case "ArrowRight":
1539
- c.preventDefault(), d.currentTime = Math.min(d.duration || 0, d.currentTime + 5);
2283
+ l.preventDefault(), i.currentTime = Math.min(i.duration || 0, i.currentTime + 5);
1540
2284
  break;
1541
2285
  case "ArrowUp":
1542
- c.preventDefault(), d.volume = Math.min(1, d.volume + 0.1), d.muted && (d.muted = !1);
2286
+ l.preventDefault(), i.volume = Math.min(1, i.volume + 0.1), i.muted && (i.muted = !1);
1543
2287
  break;
1544
2288
  case "ArrowDown":
1545
- c.preventDefault(), d.volume = Math.max(0, d.volume - 0.1);
2289
+ l.preventDefault(), i.volume = Math.max(0, i.volume - 0.1);
1546
2290
  break;
1547
2291
  case "m":
1548
- d.muted = !d.muted;
2292
+ i.muted = !i.muted;
1549
2293
  break;
1550
- case "f": {
1551
- const ye = document.fullscreenElement ?? document.webkitFullscreenElement ?? null, he = ((fe = B.value) == null ? void 0 : fe.requestFullscreen) ?? ((me = B.value) == null ? void 0 : me.webkitRequestFullscreen), G = document.exitFullscreen ?? document.webkitExitFullscreen;
1552
- ye === B.value ? G == null || G.call(document).catch(() => {
1553
- }) : he && B.value && he.call(B.value).catch(() => {
1554
- });
2294
+ case "f":
2295
+ Ve();
1555
2296
  break;
1556
- }
1557
2297
  case "p":
1558
- W && ve();
2298
+ W && Be();
1559
2299
  break;
1560
2300
  }
1561
2301
  }
1562
- return be(() => {
1563
- document.addEventListener("keydown", pe);
1564
- }), ne(() => {
1565
- document.removeEventListener("keydown", pe);
1566
- }), (c, d) => (i(), v("div", {
1567
- ref_key: "rootEl",
1568
- ref: B,
1569
- class: y(["gvp-root", s.class]),
1570
- style: ge({ width: ke.value, aspectRatio: re.value }),
1571
- onMouseenter: d[10] || (d[10] = (D) => {
1572
- C.value = !0, Y();
1573
- }),
1574
- onMouseleave: d[11] || (d[11] = (D) => {
1575
- C.value = !1, ce();
1576
- })
2302
+ return He(() => {
2303
+ document.addEventListener("keydown", Re);
2304
+ }), ae(() => {
2305
+ document.removeEventListener("keydown", Re);
2306
+ }), (l, i) => (r(), c("div", {
2307
+ class: L(["gvp-ambient-wrap", { "is-ambient": e.ambientMode }]),
2308
+ style: ce({ width: he.value })
1577
2309
  }, [
1578
- P.value ? (i(), v("iframe", {
2310
+ e.miniPlayer ? (r(), c("div", {
1579
2311
  key: 0,
1580
- class: "gvp-video gvp-youtube",
1581
- src: V.value ?? void 0,
1582
- title: "YouTube video player",
1583
- allow: "accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share",
1584
- allowfullscreen: "",
1585
- referrerpolicy: "strict-origin-when-cross-origin"
1586
- }, null, 8, on)) : (i(), j(Ve, {
2312
+ ref_key: "miniSentinelEl",
2313
+ ref: y,
2314
+ class: "gvp-mini-sentinel",
2315
+ "aria-hidden": "true"
2316
+ }, null, 512)) : x("", !0),
2317
+ e.ambientMode && !U.value && !R.value ? (r(), c("canvas", {
1587
2318
  key: 1,
1588
- ref_key: "hlsPlayerRef",
1589
- ref: f,
1590
- controls: Z.value,
1591
- "hls-config": t.hlsConfig,
1592
- "is-hls": t.isHls,
1593
- loop: t.loop,
1594
- muted: t.muted,
1595
- "auto-play": t.autoPlay,
1596
- "audio-track-index": _.value,
1597
- "quality-level-index": h.value,
1598
- "plays-inline": !0,
1599
- poster: t.poster,
1600
- src: t.src,
1601
- class: "gvp-video",
1602
- preload: "metadata",
1603
- onAudioTracks: I,
1604
- onQualityLevels: H,
1605
- onCurrentLevel: d[0] || (d[0] = (D) => b.value = D),
1606
- onPause: d[1] || (d[1] = (D) => {
1607
- w.value = !1, e("pause");
2319
+ ref_key: "ambientCanvasEl",
2320
+ ref: m,
2321
+ class: "gvp-ambient-canvas",
2322
+ width: "32",
2323
+ height: "18"
2324
+ }, null, 512)) : x("", !0),
2325
+ R.value ? (r(), c("div", {
2326
+ key: 2,
2327
+ class: "gvp-mini-placeholder",
2328
+ style: ce({ width: "100%", aspectRatio: te.value }),
2329
+ "aria-hidden": "true"
2330
+ }, null, 4)) : x("", !0),
2331
+ a("div", {
2332
+ ref_key: "rootEl",
2333
+ ref: C,
2334
+ class: L([
2335
+ "gvp-root",
2336
+ t.class,
2337
+ { "gvp-mini": R.value },
2338
+ R.value ? `gvp-mini-${e.miniPlayerPosition}` : ""
2339
+ ]),
2340
+ style: ce({ width: "100%", aspectRatio: te.value, ...H.value }),
2341
+ onMouseenter: i[14] || (i[14] = (k) => {
2342
+ re.value = !0, et();
1608
2343
  }),
1609
- onPlay: d[2] || (d[2] = (D) => {
1610
- w.value = !0, e("play");
2344
+ onMouseleave: i[15] || (i[15] = (k) => {
2345
+ re.value = !1, tt();
1611
2346
  })
1612
- }, {
1613
- default: Se(() => [
1614
- Ee(c.$slots, "default")
1615
- ]),
1616
- _: 3
1617
- }, 8, ["controls", "hls-config", "is-hls", "loop", "muted", "auto-play", "audio-track-index", "quality-level-index", "poster", "src"])),
1618
- P.value ? T("", !0) : (i(), v("div", an)),
1619
- t.showDeviceToggle ? (i(), v("div", sn, [
1620
- l("div", rn, [
1621
- l("button", {
1622
- "aria-pressed": a.value === "desktop",
1623
- class: y(["gvp-toggle-btn", { "is-active": a.value === "desktop" }]),
1624
- "aria-label": "Desktop view",
1625
- type: "button",
1626
- onClick: d[3] || (d[3] = (D) => a.value = "desktop")
1627
- }, [
1628
- U(zt)
1629
- ], 10, un),
1630
- d[12] || (d[12] = l("div", { class: "gvp-toggle-divider" }, null, -1)),
1631
- l("button", {
1632
- "aria-pressed": a.value === "mobile",
1633
- class: y(["gvp-toggle-btn", { "is-active": a.value === "mobile" }]),
1634
- "aria-label": "Mobile view",
2347
+ }, [
2348
+ R.value ? (r(), c("button", {
2349
+ key: 0,
2350
+ type: "button",
2351
+ class: "gvp-mini-close",
2352
+ "aria-label": "Close mini player",
2353
+ onClick: ee
2354
+ }, [
2355
+ O(Oe)
2356
+ ])) : x("", !0),
2357
+ U.value ? (r(), c("iframe", {
2358
+ key: 1,
2359
+ class: "gvp-video gvp-youtube",
2360
+ src: Se.value ?? void 0,
2361
+ title: "YouTube video player",
2362
+ allow: "accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share",
2363
+ allowfullscreen: "",
2364
+ referrerpolicy: "strict-origin-when-cross-origin"
2365
+ }, null, 8, ys)) : (r(), J(vt, {
2366
+ ref_key: "hlsPlayerRef",
2367
+ ref: o,
2368
+ key: `${ue.value}#${P.value}`,
2369
+ controls: D.value,
2370
+ "hls-config": e.hlsConfig,
2371
+ "is-hls": e.isHls,
2372
+ loop: e.loop,
2373
+ muted: e.muted,
2374
+ "auto-play": e.autoPlay,
2375
+ "audio-track-index": T.value,
2376
+ "quality-level-index": z.value,
2377
+ "plays-inline": !0,
2378
+ poster: me.value,
2379
+ src: ue.value,
2380
+ class: L(["gvp-video", F]),
2381
+ preload: "metadata",
2382
+ onAudioTracks: Ne,
2383
+ onQualityLevels: u,
2384
+ onCurrentLevel: i[0] || (i[0] = (k) => M.value = k),
2385
+ onEnded: Xe,
2386
+ onFatalError: st,
2387
+ onLiveChange: i[1] || (i[1] = (k) => S.value = k),
2388
+ onPause: i[2] || (i[2] = (k) => {
2389
+ d.value = !1, n("pause");
2390
+ }),
2391
+ onPlay: i[3] || (i[3] = (k) => {
2392
+ d.value = !0, n("play");
2393
+ })
2394
+ }, {
2395
+ default: it(() => [
2396
+ Ue(l.$slots, "default")
2397
+ ]),
2398
+ _: 3
2399
+ }, 8, ["controls", "hls-config", "is-hls", "loop", "muted", "auto-play", "audio-track-index", "quality-level-index", "poster", "src", "class"])),
2400
+ U.value ? x("", !0) : (r(), c("div", bs)),
2401
+ U.value ? x("", !0) : (r(), c("span", ws, Z(lt.value), 1)),
2402
+ !U.value && E.value && !A.value ? (r(), c("div", xs, [...i[16] || (i[16] = [
2403
+ a("div", { class: "gvp-spinner" }, null, -1),
2404
+ a("span", { class: "gvp-sr-only" }, "Loading…", -1)
2405
+ ])])) : x("", !0),
2406
+ !U.value && A.value ? (r(), c("div", Cs, [
2407
+ O(as, { class: "gvp-error-icon" }),
2408
+ i[18] || (i[18] = a("p", { class: "gvp-error-text" }, "This video couldn't be played.", -1)),
2409
+ a("button", {
1635
2410
  type: "button",
1636
- onClick: d[4] || (d[4] = (D) => a.value = "mobile")
2411
+ class: "gvp-error-retry",
2412
+ onClick: ot
1637
2413
  }, [
1638
- U(Kt)
1639
- ], 10, cn)
1640
- ])
1641
- ])) : T("", !0),
1642
- t.closable ? (i(), v("button", {
1643
- key: 4,
1644
- "aria-label": "Close",
1645
- class: "gvp-close",
1646
- type: "button",
1647
- onClick: d[5] || (d[5] = (D) => e("close"))
1648
- }, [
1649
- U(en)
1650
- ])) : T("", !0),
1651
- z.value && !M.value ? (i(), j(Ze, {
1652
- key: 5,
1653
- tracks: E.value,
1654
- "active-index": X.value,
1655
- onSelect: d[6] || (d[6] = (D) => _.value = D)
1656
- }, null, 8, ["tracks", "active-index"])) : T("", !0),
1657
- !P.value && !M.value ? (i(), j(Ke, {
1658
- key: 6,
1659
- speed: x.value,
1660
- onSelect: de
1661
- }, null, 8, ["speed"])) : T("", !0),
1662
- !P.value && !M.value ? (i(), j(nt, {
1663
- key: 7,
1664
- video: Q.value
1665
- }, null, 8, ["video"])) : T("", !0),
1666
- !P.value && ee(W) && !M.value ? (i(), v("button", {
1667
- key: 8,
1668
- type: "button",
1669
- class: y(["gvp-pip-btn", { "is-active": u.value }]),
1670
- "aria-label": u.value ? "Exit picture-in-picture" : "Picture-in-picture",
1671
- "aria-pressed": u.value,
1672
- onClick: ve
1673
- }, [
1674
- U(Me)
1675
- ], 10, dn)) : T("", !0),
1676
- !P.value && M.value ? (i(), v("button", {
1677
- key: 9,
1678
- type: "button",
1679
- class: "gvp-click-layer",
1680
- "aria-label": w.value ? "Pause" : "Play",
1681
- onClick: F
1682
- }, null, 8, vn)) : T("", !0),
1683
- !P.value && !M.value && !w.value ? (i(), v("div", pn, [
1684
- l("button", {
1685
- "aria-label": "Play",
1686
- class: "gvp-play",
2414
+ O(is),
2415
+ i[17] || (i[17] = a("span", null, "Retry", -1))
2416
+ ])
2417
+ ])) : x("", !0),
2418
+ e.showDeviceToggle ? (r(), c("div", Ls, [
2419
+ a("div", $s, [
2420
+ a("button", {
2421
+ "aria-pressed": v.value === "desktop",
2422
+ class: L(["gvp-toggle-btn", { "is-active": v.value === "desktop" }]),
2423
+ "aria-label": "Desktop view",
2424
+ type: "button",
2425
+ onClick: i[4] || (i[4] = (k) => v.value = "desktop")
2426
+ }, [
2427
+ O(Xn)
2428
+ ], 10, Es),
2429
+ i[19] || (i[19] = a("div", { class: "gvp-toggle-divider" }, null, -1)),
2430
+ a("button", {
2431
+ "aria-pressed": v.value === "mobile",
2432
+ class: L(["gvp-toggle-btn", { "is-active": v.value === "mobile" }]),
2433
+ "aria-label": "Mobile view",
2434
+ type: "button",
2435
+ onClick: i[5] || (i[5] = (k) => v.value = "mobile")
2436
+ }, [
2437
+ O(ts)
2438
+ ], 10, _s)
2439
+ ])
2440
+ ])) : x("", !0),
2441
+ e.closable ? (r(), c("button", {
2442
+ key: 8,
2443
+ "aria-label": "Close",
2444
+ class: "gvp-close",
1687
2445
  type: "button",
1688
- onClick: F,
1689
- onMouseenter: d[7] || (d[7] = (D) => m.value = !0),
1690
- onMouseleave: d[8] || (d[8] = (D) => m.value = !1)
2446
+ onClick: i[6] || (i[6] = (k) => n("close"))
1691
2447
  }, [
1692
- U(Xt),
1693
- t.tooltipText && m.value ? (i(), v("span", fn, O(t.tooltipText), 1)) : T("", !0)
1694
- ], 32)
1695
- ])) : T("", !0),
1696
- !P.value && M.value ? (i(), j(Qt, {
1697
- key: 11,
1698
- video: Q.value,
1699
- "is-playing": w.value,
1700
- container: B.value,
1701
- "on-toggle-play": F,
1702
- "quality-levels": A.value,
1703
- "current-level": b.value,
1704
- "selected-level": h.value,
1705
- onSelectLevel: d[9] || (d[9] = (D) => h.value = D)
1706
- }, null, 8, ["video", "is-playing", "container", "quality-levels", "current-level", "selected-level"])) : T("", !0),
1707
- !P.value && !M.value ? (i(), v("div", mn)) : T("", !0)
1708
- ], 38));
2448
+ O(Oe)
2449
+ ])) : x("", !0),
2450
+ b.value && !B.value ? (r(), J(bt, {
2451
+ key: 9,
2452
+ tracks: $.value,
2453
+ "active-index": _.value,
2454
+ onSelect: i[7] || (i[7] = (k) => T.value = k)
2455
+ }, null, 8, ["tracks", "active-index"])) : x("", !0),
2456
+ !U.value && !B.value ? (r(), J(_t, {
2457
+ key: 10,
2458
+ speed: j.value,
2459
+ onSelect: nt
2460
+ }, null, 8, ["speed"])) : x("", !0),
2461
+ !U.value && !B.value ? (r(), J(Nt, {
2462
+ key: 11,
2463
+ video: q.value
2464
+ }, null, 8, ["video"])) : x("", !0),
2465
+ !U.value && le(W) && !B.value ? (r(), c("button", {
2466
+ key: 12,
2467
+ type: "button",
2468
+ class: L(["gvp-pip-btn", { "is-active": K.value }]),
2469
+ "aria-label": K.value ? "Exit picture-in-picture" : "Picture-in-picture",
2470
+ "aria-pressed": K.value,
2471
+ onClick: Be
2472
+ }, [
2473
+ O(ze)
2474
+ ], 10, Ps)) : x("", !0),
2475
+ !U.value && B.value ? (r(), c("button", {
2476
+ key: 13,
2477
+ type: "button",
2478
+ class: "gvp-click-layer",
2479
+ "aria-label": d.value ? "Pause" : "Play",
2480
+ onClick: Ge,
2481
+ onDblclick: Je
2482
+ }, null, 40, Ts)) : x("", !0),
2483
+ !U.value && !B.value && !d.value ? (r(), c("div", Ms, [
2484
+ a("button", {
2485
+ "aria-label": "Play",
2486
+ class: "gvp-play",
2487
+ type: "button",
2488
+ onClick: Te,
2489
+ onMouseenter: i[8] || (i[8] = (k) => h.value = !0),
2490
+ onMouseleave: i[9] || (i[9] = (k) => h.value = !1)
2491
+ }, [
2492
+ O(ss),
2493
+ e.tooltipText && h.value ? (r(), c("span", Is, Z(e.tooltipText), 1)) : x("", !0)
2494
+ ], 32)
2495
+ ])) : x("", !0),
2496
+ !U.value && B.value ? (r(), J(Gn, {
2497
+ key: 15,
2498
+ video: q.value,
2499
+ "is-playing": d.value,
2500
+ container: C.value,
2501
+ "on-toggle-play": Te,
2502
+ "quality-levels": f.value,
2503
+ "current-level": M.value,
2504
+ "selected-level": z.value,
2505
+ thumbnails: Ie.value,
2506
+ chapters: Ae.value,
2507
+ "has-prev": de.value,
2508
+ "has-next": Pe.value,
2509
+ "is-live": S.value,
2510
+ "audio-tracks": $.value,
2511
+ "audio-track-index": _.value,
2512
+ onSelectLevel: i[10] || (i[10] = (k) => z.value = k),
2513
+ onSelectAudioTrack: i[11] || (i[11] = (k) => T.value = k),
2514
+ onPrev: i[12] || (i[12] = (k) => Ce(G.value - 1, !0)),
2515
+ onNext: i[13] || (i[13] = (k) => Ce(G.value + 1, !0))
2516
+ }, null, 8, ["video", "is-playing", "container", "quality-levels", "current-level", "selected-level", "thumbnails", "chapters", "has-prev", "has-next", "is-live", "audio-tracks", "audio-track-index"])) : x("", !0),
2517
+ !U.value && !B.value ? (r(), c("div", As)) : x("", !0)
2518
+ ], 38)
2519
+ ], 6));
1709
2520
  }
1710
2521
  });
1711
2522
  export {
1712
- Ve as HLSPlayer,
1713
- kn as VueVideoPlayer,
1714
- tn as parseYouTubeId,
1715
- nn as parseYouTubeStart,
1716
- ln as youTubeEmbedUrl
2523
+ vt as HLSPlayer,
2524
+ Hs as VueVideoPlayer,
2525
+ us as parseYouTubeId,
2526
+ cs as parseYouTubeStart,
2527
+ ds as youTubeEmbedUrl
1717
2528
  };
1718
2529
  //# sourceMappingURL=index.mjs.map