@validol4ik/uikit 0.14.8 → 0.14.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,65 +1,65 @@
1
- var ne = (t) => {
1
+ var te = (t) => {
2
2
  throw TypeError(t);
3
3
  };
4
- var x = (t, r, e) => r.has(t) || ne("Cannot " + e);
5
- var b = (t, r, e) => (x(t, r, "read from private field"), e ? e.call(t) : r.get(t)), I = (t, r, e) => r.has(t) ? ne("Cannot add the same private member more than once") : r instanceof WeakSet ? r.add(t) : r.set(t, e), M = (t, r, e, s) => (x(t, r, "write to private field"), s ? s.call(t, e) : r.set(t, e), e), oe = (t, r, e) => (x(t, r, "access private method"), e);
6
- import { ref as P, onBeforeUnmount as de, defineComponent as ke, computed as Se, watch as F, onMounted as Re, createElementBlock as k, openBlock as S, unref as w, createCommentVNode as O, createElementVNode as G, normalizeClass as ie, toDisplayString as _e, nextTick as we } from "vue";
7
- import { V as T, D as Te, S as Le, a as le, b as Pe, E as Ae, c as Oe, d as De, B as Ce, e as ce, P as Ie, f as Ve, r as ze, g as Me, t as Ke, W as Ne, h as Be } from "../playback-DxTLyUrL.js";
8
- import { _ as Ue } from "../_plugin-vue_export-helper-CHgC5LLL.js";
9
- const He = (t, r, e) => {
10
- var n;
11
- const s = (l) => !e.includes(l);
12
- return t.hlsSrc && r.hls && s(T.Hls) ? T.Hls : t.dashSrc && r.dash && s(T.Dash) ? T.Dash : (n = t.sources) != null && n.length && s(T.Progressive) ? T.Progressive : null;
13
- }, We = () => {
14
- var s, n;
4
+ var U = (t, r, e) => r.has(t) || te("Cannot " + e);
5
+ var g = (t, r, e) => (U(t, r, "read from private field"), e ? e.call(t) : r.get(t)), I = (t, r, e) => r.has(t) ? te("Cannot add the same private member more than once") : r instanceof WeakSet ? r.add(t) : r.set(t, e), K = (t, r, e, a) => (U(t, r, "write to private field"), a ? a.call(t, e) : r.set(t, e), e), re = (t, r, e) => (U(t, r, "access private method"), e);
6
+ import { ref as D, onBeforeUnmount as ie, defineComponent as ye, computed as Ee, watch as se, onMounted as Se, createElementBlock as k, openBlock as b, unref as w, createCommentVNode as A, createElementVNode as G, normalizeClass as ae, toDisplayString as ge, nextTick as ke } from "vue";
7
+ import { V as _, D as be, S as Re, a as ne, b as we, E as _e, c as Te, d as Pe, B as Le, e as oe, P as Ae, f as De, r as Oe, g as Ce, t as Ie, W as ze, h as Ve } from "../playback-DK9szhgq.js";
8
+ import { _ as Ke } from "../_plugin-vue_export-helper-CHgC5LLL.js";
9
+ const Me = (t, r, e) => {
10
+ var o;
11
+ const a = (l) => !e.includes(l);
12
+ return t.hlsSrc && r.hls && a(_.Hls) ? _.Hls : t.dashSrc && r.dash && a(_.Dash) ? _.Dash : (o = t.sources) != null && o.length && a(_.Progressive) ? _.Progressive : null;
13
+ }, Ne = () => {
14
+ var a, o;
15
15
  const { ManagedMediaSource: t, MediaSource: r, WebKitMediaSource: e } = window;
16
- return !!((n = (s = t ?? r ?? e) == null ? void 0 : s.isTypeSupported) != null && n.call(s, Te));
17
- }, Ye = (t) => Le.filter((r) => t.includes(r)), $e = (t) => {
18
- const r = Ye(t.map(({ size: s }) => s)), e = r.includes(le) ? le : r[0];
19
- return t.find((s) => s.size === e) ?? t[0] ?? null;
20
- }, je = () => /iPhone|iPod/.test(navigator.userAgent), xe = () => je() || /iPad/.test(navigator.userAgent) || /Macintosh/.test(navigator.userAgent) && navigator.maxTouchPoints > 1;
21
- var N, V, B, C, A, K, pe;
22
- class Fe extends EventTarget {
23
- constructor(e, s, n) {
16
+ return !!((o = (a = t ?? r ?? e) == null ? void 0 : a.isTypeSupported) != null && o.call(a, be));
17
+ }, Be = (t) => Re.filter((r) => t.includes(r)), He = (t) => {
18
+ const r = Be(t.map(({ size: a }) => a)), e = r.includes(ne) ? ne : r[0];
19
+ return t.find((a) => a.size === e) ?? t[0] ?? null;
20
+ }, Ye = () => /iPhone|iPod/.test(navigator.userAgent), Fe = () => Ye() || /iPad/.test(navigator.userAgent) || /Macintosh/.test(navigator.userAgent) && navigator.maxTouchPoints > 1;
21
+ var N, z, B, C, P, M, le;
22
+ class We extends EventTarget {
23
+ constructor(e, a, o) {
24
24
  super();
25
- I(this, A);
25
+ I(this, P);
26
26
  I(this, N);
27
- I(this, V);
27
+ I(this, z);
28
28
  I(this, B);
29
29
  I(this, C, -1);
30
- M(this, N, e), M(this, V, [...s].sort((l, i) => i.size - l.size)), M(this, B, n);
30
+ K(this, N, e), K(this, z, [...a].sort((l, i) => i.size - l.size)), K(this, B, o);
31
31
  }
32
32
  get selectedIndex() {
33
- return b(this, C);
33
+ return g(this, C);
34
34
  }
35
35
  set selectedIndex(e) {
36
- const s = b(this, A, K);
37
- M(this, C, e), b(this, A, K) !== s && oe(this, A, pe).call(this), this.dispatchEvent(new Event("change"));
36
+ const a = g(this, P, M);
37
+ K(this, C, e), g(this, P, M) !== a && re(this, P, le).call(this), this.dispatchEvent(new Event("change"));
38
38
  }
39
39
  *[Symbol.iterator]() {
40
- for (const [e, s] of b(this, V).entries())
40
+ for (const [e, a] of g(this, z).entries())
41
41
  yield {
42
- id: String(s.size),
43
- height: s.size,
44
- selected: e === b(this, C),
45
- active: s === b(this, A, K)
42
+ id: String(a.size),
43
+ height: a.size,
44
+ selected: e === g(this, C),
45
+ active: a === g(this, P, M)
46
46
  };
47
47
  }
48
48
  }
49
- N = new WeakMap(), V = new WeakMap(), B = new WeakMap(), C = new WeakMap(), A = new WeakSet(), K = function() {
50
- return b(this, V)[b(this, C)] ?? b(this, B);
49
+ N = new WeakMap(), z = new WeakMap(), B = new WeakMap(), C = new WeakMap(), P = new WeakSet(), M = function() {
50
+ return g(this, z)[g(this, C)] ?? g(this, B);
51
51
  }, // Loading a new src resets the position and speed
52
- pe = function() {
53
- const e = b(this, N), s = e.currentTime, n = e.playbackRate, l = !e.paused;
52
+ le = function() {
53
+ const e = g(this, N), a = e.currentTime, o = e.playbackRate, l = !e.paused;
54
54
  e.addEventListener(
55
55
  "loadedmetadata",
56
56
  () => {
57
- s && (e.currentTime = s), e.playbackRate = n, l && e.play();
57
+ a && (e.currentTime = a), e.playbackRate = o, l && e.play();
58
58
  },
59
59
  { once: !0 }
60
- ), s && (e.preload = "metadata"), e.src = b(this, A, K).src;
60
+ ), a && (e.preload = "metadata"), e.src = g(this, P, M).src;
61
61
  };
62
- const Ge = (t, r) => {
62
+ const Ue = (t, r) => {
63
63
  t.preload = "metadata", t.addEventListener(
64
64
  "loadedmetadata",
65
65
  () => {
@@ -68,116 +68,116 @@ const Ge = (t, r) => {
68
68
  },
69
69
  { once: !0 }
70
70
  );
71
- }, fe = () => {
71
+ }, ce = () => {
72
72
  let t = 0, r = 0;
73
73
  return (e) => {
74
- const s = Date.now();
75
- if (s - r > De && (t = 0), r = s, t >= Ae) return !1;
76
- const n = t++;
77
- return setTimeout(() => e(n), Oe * 2 ** n), !0;
74
+ const a = Date.now();
75
+ if (a - r > Pe && (t = 0), r = a, t >= _e) return !1;
76
+ const o = t++;
77
+ return setTimeout(() => e(o), Te * 2 ** o), !0;
78
78
  };
79
- }, me = (t, r) => {
80
- const { currentTime: e, playbackRate: s, paused: n } = t;
79
+ }, ue = (t, r) => {
80
+ const { currentTime: e, playbackRate: a, paused: o } = t;
81
81
  return () => {
82
82
  t.addEventListener(
83
83
  "loadedmetadata",
84
84
  () => {
85
- t.currentTime = e, t.playbackRate = s, n || t.play().catch(() => {
85
+ t.currentTime = e, t.playbackRate = a, o || t.play().catch(() => {
86
86
  });
87
87
  },
88
88
  { once: !0 }
89
89
  ), r(e);
90
90
  };
91
- }, qe = (t, r, e) => {
92
- let s = null;
93
- const n = fe();
91
+ }, Ge = (t, r, e) => {
92
+ let a = null;
93
+ const o = ce();
94
94
  t.addEventListener("loadstart", () => {
95
- if (!t.engine || t.engine === s) return;
95
+ if (!t.engine || t.engine === a) return;
96
96
  const i = t.engine;
97
- s = i;
98
- const f = () => t.engine === i;
99
- i.on(r.Events.ERROR, async (d, p) => {
100
- var R;
101
- if (!p.fatal) return;
102
- const h = (o) => {
103
- var m, E;
97
+ a = i;
98
+ const p = () => t.engine === i;
99
+ i.on(r.Events.ERROR, async (u, d) => {
100
+ var T;
101
+ if (!d.fatal) return;
102
+ const m = (n) => {
103
+ var f, y;
104
104
  return e.report({
105
- type: p.type,
106
- details: p.details,
107
- status: (m = p.response) == null ? void 0 : m.code,
108
- url: ((E = p.frag) == null ? void 0 : E.url) ?? p.url,
109
- recovering: o
105
+ type: d.type,
106
+ details: d.details,
107
+ status: (f = d.response) == null ? void 0 : f.code,
108
+ url: ((y = d.frag) == null ? void 0 : y.url) ?? d.url,
109
+ recovering: n
110
110
  });
111
- }, u = () => {
112
- h(!0), e.dismissError();
111
+ }, S = () => {
112
+ m(!0), e.dismissError();
113
113
  };
114
- if (p.type === r.ErrorTypes.NETWORK_ERROR) {
115
- if (((R = p.response) == null ? void 0 : R.code) === 401 && await e.reauthorize()) {
116
- u(), i.startLoad(t.currentTime);
114
+ if (d.type === r.ErrorTypes.NETWORK_ERROR) {
115
+ if (((T = d.response) == null ? void 0 : T.code) === 401 && await e.reauthorize()) {
116
+ S(), i.startLoad(t.currentTime);
117
117
  return;
118
118
  }
119
- if (e.hasLoaded() && n(() => f() && i.startLoad(t.currentTime))) {
120
- u();
119
+ if (e.hasLoaded() && o(() => p() && i.startLoad(t.currentTime))) {
120
+ S();
121
121
  return;
122
122
  }
123
- } else if (p.type === r.ErrorTypes.MEDIA_ERROR && e.hasLoaded() && n((o) => {
124
- f() && (o > 0 && i.swapAudioCodec(), i.recoverMediaError());
123
+ } else if (d.type === r.ErrorTypes.MEDIA_ERROR && e.hasLoaded() && o((n) => {
124
+ p() && (n > 0 && i.swapAudioCodec(), i.recoverMediaError());
125
125
  })) {
126
- u();
126
+ S();
127
127
  return;
128
128
  }
129
- h(!1), e.fail();
129
+ m(!1), e.fail();
130
130
  }), i.on(r.Events.FRAG_LOADED, e.loaded);
131
131
  }), t.addEventListener("error", async () => {
132
132
  if (t.engine) return;
133
- const i = me(t, () => t.load()), f = (p) => {
134
- var h;
133
+ const i = ue(t, () => t.load()), p = (d) => {
134
+ var m;
135
135
  return e.report({
136
136
  type: "nativeError",
137
- details: String(((h = t.error) == null ? void 0 : h.code) ?? ""),
138
- recovering: p
137
+ details: String(((m = t.error) == null ? void 0 : m.code) ?? ""),
138
+ recovering: d
139
139
  });
140
140
  };
141
- if ((await e.reauthorize() || e.hasLoaded()) && n(() => t.isConnected && i())) {
142
- f(!0), e.dismissError();
141
+ if ((await e.reauthorize() || e.hasLoaded()) && o(() => t.isConnected && i())) {
142
+ p(!0), e.dismissError();
143
143
  return;
144
144
  }
145
- f(!1), e.fail();
145
+ p(!1), e.fail();
146
146
  }), t.addEventListener("loadeddata", e.loaded);
147
- const l = xe();
147
+ const l = Fe();
148
148
  e.withCredentials && !l && (t.crossOrigin = "use-credentials"), t.source = {
149
149
  src: e.src,
150
150
  preferPlayback: l ? "native" : "mse"
151
151
  };
152
- }, Je = (t, r) => {
152
+ }, je = (t, r) => {
153
153
  const e = t.engine;
154
154
  e.setXHRWithCredentialsForType("default", r.withCredentials);
155
- const s = fe(), n = () => me(
155
+ const a = ce(), o = () => ue(
156
156
  t,
157
157
  (l) => e.attachSource(r.src, l)
158
158
  );
159
159
  e.on("error", async (l) => {
160
- var p, h;
161
- const i = l.error, f = (h = (p = i.data) == null ? void 0 : p.response) == null ? void 0 : h.status, d = (u) => r.report({
160
+ var d, m;
161
+ const i = l.error, p = (m = (d = i.data) == null ? void 0 : d.response) == null ? void 0 : m.status, u = (S) => r.report({
162
162
  type: "dashError",
163
163
  details: String(i.code ?? ""),
164
- status: f,
165
- recovering: u
164
+ status: p,
165
+ recovering: S
166
166
  });
167
- if (f === 401) {
167
+ if (p === 401) {
168
168
  if (await r.reauthorize()) {
169
- d(!0), n()();
169
+ u(!0), o()();
170
170
  return;
171
171
  }
172
- } else if (!Pe.includes(i.code ?? -1))
172
+ } else if (!we.includes(i.code ?? -1))
173
173
  return;
174
- d(!1), r.fail();
174
+ u(!1), r.fail();
175
175
  }), e.on("fragmentLoadingCompleted", r.loaded), t.addEventListener("error", () => {
176
- var f;
177
- const l = n(), i = r.hasLoaded() && s(() => t.isConnected && l());
176
+ var p;
177
+ const l = o(), i = r.hasLoaded() && a(() => t.isConnected && l());
178
178
  r.report({
179
179
  type: "mediaError",
180
- details: String(((f = t.error) == null ? void 0 : f.code) ?? ""),
180
+ details: String(((p = t.error) == null ? void 0 : p.code) ?? ""),
181
181
  recovering: i
182
182
  }), i ? r.dismissError() : r.fail();
183
183
  }), t.source = {
@@ -192,117 +192,103 @@ const Ge = (t, r) => {
192
192
  }
193
193
  }
194
194
  };
195
- }, Qe = (t, r) => {
196
- const e = $e(r);
195
+ }, qe = (t, r) => {
196
+ const e = He(r);
197
197
  e && (Object.assign(t, {
198
- videoRenditions: new Fe(t, r, e)
198
+ videoRenditions: new We(t, r, e)
199
199
  }), t.src = e.src);
200
- }, Xe = "media-controls-content, .media-popup, media-error-dialog", Ze = (t) => t instanceof Element && t.matches(Xe), et = (t) => {
201
- const r = P(!1);
202
- let e, s = 1, n = !1, l = null;
200
+ }, Je = "media-controls-content, .media-popup, media-error-dialog", Qe = (t) => t instanceof Element && t.matches(Je), Xe = (t) => {
201
+ const r = D(!1);
202
+ let e, a = 1, o = !1, l = null;
203
203
  const i = () => {
204
- var o;
205
- return (o = t.value) == null ? void 0 : o.store;
206
- }, f = () => {
207
- n = !0;
208
- const o = i();
209
- !o || o.paused || o.playbackRate >= ce || (s = o.playbackRate, o.setPlaybackRate(ce), r.value = !0);
210
- }, d = () => {
211
- var m;
204
+ var n;
205
+ return (n = t.value) == null ? void 0 : n.store;
206
+ }, p = () => {
207
+ o = !0;
208
+ const n = i();
209
+ !n || n.paused || n.playbackRate >= oe || (a = n.playbackRate, n.setPlaybackRate(oe), r.value = !0);
210
+ }, u = () => {
211
+ var f;
212
212
  clearTimeout(e), l == null || l(), l = null;
213
- const o = n;
214
- return n = !1, r.value && (r.value = !1, (m = i()) == null || m.setPlaybackRate(s)), o;
215
- }, p = (o, m, E) => {
216
- d(), m && (e = setTimeout(f, Ce));
217
- const _ = (v) => {
218
- if (v instanceof KeyboardEvent) {
219
- if (v.key !== " ") return;
220
- v.preventDefault(), v.stopPropagation();
213
+ const n = o;
214
+ return o = !1, r.value && (r.value = !1, (f = i()) == null || f.setPlaybackRate(a)), n;
215
+ }, d = (n, f, y) => {
216
+ u(), f && (e = setTimeout(p, Le));
217
+ const R = (h) => {
218
+ if (h instanceof KeyboardEvent) {
219
+ if (h.key !== " ") return;
220
+ h.preventDefault(), h.stopPropagation();
221
221
  }
222
- const L = d();
223
- E == null || E(L);
222
+ const L = u();
223
+ y == null || y(L);
224
224
  };
225
- o.forEach((v) => window.addEventListener(v, _, !0)), window.addEventListener("blur", d), l = () => {
226
- o.forEach(
227
- (v) => window.removeEventListener(v, _, !0)
228
- ), window.removeEventListener("blur", d);
225
+ n.forEach((h) => window.addEventListener(h, R, !0)), window.addEventListener("blur", u), l = () => {
226
+ n.forEach(
227
+ (h) => window.removeEventListener(h, R, !0)
228
+ ), window.removeEventListener("blur", u);
229
229
  };
230
- }, h = (o) => {
231
- var v;
232
- if (o.key !== " " || o.altKey || o.ctrlKey || o.metaKey)
230
+ }, m = (n) => {
231
+ var h;
232
+ if (n.key !== " " || n.altKey || n.ctrlKey || n.metaKey)
233
233
  return;
234
- if (o.repeat) {
235
- l && (o.preventDefault(), o.stopPropagation());
234
+ if (n.repeat) {
235
+ l && (n.preventDefault(), n.stopPropagation());
236
236
  return;
237
237
  }
238
- const m = i(), E = document.activeElement;
239
- if (!m || !E || !((v = t.value) != null && v.contains(E))) return;
240
- o.preventDefault(), o.stopPropagation();
241
- const _ = m.paused;
242
- _ && m.play(), p(["keyup"], !_, (L) => {
243
- !_ && !L && m.pause();
238
+ const f = i(), y = document.activeElement;
239
+ if (!f || !y || !((h = t.value) != null && h.contains(y))) return;
240
+ n.preventDefault(), n.stopPropagation();
241
+ const R = f.paused;
242
+ R && f.play(), d(["keyup"], !R, (L) => {
243
+ !R && !L && f.pause();
244
244
  });
245
- }, u = (o) => {
246
- const m = i();
247
- !m || m.paused || o.button !== 0 || o.composedPath().some(Ze) || p(["pointerup", "pointercancel"], !0);
248
- }, R = (o) => {
249
- r.value && o.preventDefault();
245
+ }, S = (n) => {
246
+ const f = i();
247
+ !f || f.paused || n.button !== 0 || n.composedPath().some(Qe) || d(["pointerup", "pointercancel"], !0);
248
+ }, T = (n) => {
249
+ r.value && n.preventDefault();
250
250
  };
251
- return de(d), { boosted: r, release: d, onKeyDown: h, onPointerDown: u, onContextMenu: R };
252
- }, tt = 359999.999, Y = (t, r = 2) => String(t).padStart(r, "0"), ue = (t) => {
253
- const r = Math.round(t * 1e3), e = Math.floor(r / 36e5), s = Math.floor(r / 6e4) % 60, n = Math.floor(r / 1e3) % 60;
254
- return `${Y(e)}:${Y(s)}:${Y(n)}.${Y(r % 1e3, 3)}`;
255
- }, rt = (t) => t.replace(/\s+/g, " ").replace(/-->/g, "->").trim(), st = (t) => {
256
- const r = [...t].sort((s, n) => s.start - n.start);
257
- return `${["WEBVTT", ...r.map((s, n) => {
258
- var i;
259
- const l = ((i = r[n + 1]) == null ? void 0 : i.start) ?? tt;
260
- return `${ue(s.start)} --> ${ue(l)}
261
- ${rt(s.title)}`;
262
- })].join(`
263
-
264
- `)}
265
- `;
266
- }, q = "app-video-player", at = `linear-gradient(to top,
251
+ return ie(u), { boosted: r, release: u, onKeyDown: m, onPointerDown: S, onContextMenu: T };
252
+ }, j = "app-video-player", Ze = `linear-gradient(to top,
267
253
  color-mix(in oklab, var(--media-backdrop) 40%, transparent),
268
254
  color-mix(in oklab, var(--media-backdrop) 12%, transparent) 50%,
269
255
  color-mix(in oklab, var(--media-backdrop) 2%, transparent) 75%,
270
- transparent)`, nt = async () => {
271
- if (customElements.get(q)) return;
256
+ transparent)`, $e = async () => {
257
+ if (customElements.get(j)) return;
272
258
  const [{ createPlayer: t, definePlayerFeature: r }, { videoFeatures: e }] = await Promise.all([
273
259
  import("@videojs/html"),
274
260
  import("@videojs/html/video")
275
- ]), s = r({
261
+ ]), a = r({
276
262
  name: "idleControls",
277
263
  // the fields belong to the playback and controls features, this one only reads and sets them
278
264
  state: () => ({}),
279
- attach({ target: l, signal: i, store: f, get: d, set: p }) {
280
- var R;
281
- (R = l.container) == null || R.style.setProperty(
265
+ attach({ target: l, signal: i, store: p, get: u, set: d }) {
266
+ var T;
267
+ (T = l.container) == null || T.style.setProperty(
282
268
  "--media-controls-gradient",
283
- at
269
+ Ze
284
270
  );
285
- const h = () => {
286
- const { paused: o, started: m, ended: E, userActive: _, controlsVisible: v } = d();
287
- return o && m && !E && !_ && v;
288
- }, u = f.subscribe(() => {
289
- h() && queueMicrotask(() => {
290
- !i.aborted && h() && p({ controlsVisible: !1 });
271
+ const m = () => {
272
+ const { paused: n, started: f, ended: y, userActive: R, controlsVisible: h } = u();
273
+ return n && f && !y && !R && h;
274
+ }, S = p.subscribe(() => {
275
+ m() && queueMicrotask(() => {
276
+ !i.aborted && m() && d({ controlsVisible: !1 });
291
277
  });
292
278
  });
293
- i.addEventListener("abort", u, { once: !0 });
279
+ i.addEventListener("abort", S, { once: !0 });
294
280
  }
295
- }), { PlayerElement: n } = t({
296
- features: [...e, s]
281
+ }), { PlayerElement: o } = t({
282
+ features: [...e, a]
297
283
  });
298
- customElements.get(q) || customElements.define(q, n);
299
- }, ot = ["lang"], it = ["poster", "default-playback-rates"], lt = { class: "app-video__skin" }, ct = ["crossorigin"], ut = ["src"], dt = ["src"], pt = ["crossorigin"], ft = ["src"], mt = ["src"], ht = ["crossorigin"], vt = ["src"], yt = ["src"], Et = /* @__PURE__ */ ke({
284
+ customElements.get(j) || customElements.define(j, o);
285
+ }, xe = ["lang"], et = ["poster", "default-playback-rates"], tt = { class: "app-video__skin" }, rt = ["crossorigin"], st = ["src"], at = ["src"], nt = ["crossorigin"], ot = ["src"], it = ["src"], lt = ["crossorigin"], ct = ["src"], ut = ["src"], dt = /* @__PURE__ */ ye({
300
286
  __name: "AppVideo",
301
287
  props: {
302
288
  hlsSrc: {},
303
289
  dashSrc: {},
304
290
  sources: {},
305
- chapters: {},
291
+ chaptersSrc: {},
306
292
  thumbnailsSrc: {},
307
293
  poster: {},
308
294
  withCredentials: { type: Boolean, default: !0 },
@@ -313,219 +299,210 @@ ${rt(s.title)}`;
313
299
  },
314
300
  emits: ["error", "progress", "ended"],
315
301
  setup(t, { emit: r }) {
316
- const e = t, s = r, n = P(null), l = P(null), i = P(null), f = P([]), d = P(null), p = P(!0), h = P(!1), u = P(null), R = Se(() => {
317
- if (e.thumbnailsSrc)
302
+ const e = t, a = r, o = D(null), l = D(null), i = D(null), p = D([]), u = D(null), d = D(!0), m = D(!1), S = Ee(() => {
303
+ if (!(!e.chaptersSrc && !e.thumbnailsSrc))
318
304
  return e.withCredentials ? "use-credentials" : "anonymous";
319
- }), { boosted: o, release: m, onKeyDown: E, onPointerDown: _, onContextMenu: v } = et(n);
320
- let L = null, U = !1, H = !1, z, J, Q, $ = 0, g = null;
321
- const he = (a) => {
305
+ }), { boosted: T, release: n, onKeyDown: f, onPointerDown: y, onContextMenu: R } = Xe(o);
306
+ let h = null, L = !1, H = !1, V, q, J, F = 0, E = null;
307
+ const de = (s) => {
322
308
  var c;
323
- if (d.value !== a) return;
324
- const y = H ? l.value : null;
325
- g = {
326
- time: y ? y.currentTime : (g == null ? void 0 : g.time) ?? 0,
327
- rate: y ? y.playbackRate : (g == null ? void 0 : g.rate) ?? 1,
328
- playing: !!(g != null && g.playing) || ((c = n.value) == null ? void 0 : c.store.paused) === !1
329
- }, f.value = [...f.value, a];
330
- }, X = async () => {
309
+ if (u.value !== s) return;
310
+ const v = H ? l.value : null;
311
+ E = {
312
+ time: v ? v.currentTime : (E == null ? void 0 : E.time) ?? 0,
313
+ rate: v ? v.playbackRate : (E == null ? void 0 : E.rate) ?? 1,
314
+ playing: !!(E != null && E.playing) || ((c = o.value) == null ? void 0 : c.store.paused) === !1
315
+ }, p.value = [...p.value, s];
316
+ }, Q = async () => {
331
317
  if (!e.authorize) return !0;
332
318
  try {
333
319
  return await e.authorize(), !0;
334
- } catch (a) {
335
- return console.error("Video authorization failed", a), !1;
320
+ } catch (s) {
321
+ return console.error("Video authorization failed", s), !1;
336
322
  }
337
- }, Z = (a, y) => ({
338
- src: a ?? "",
323
+ }, X = (s, v) => ({
324
+ src: s ?? "",
339
325
  withCredentials: e.withCredentials,
340
- reauthorize: async () => U ? !1 : (U = !0, X()),
326
+ reauthorize: async () => L ? !1 : (L = !0, Q()),
341
327
  loaded: () => {
342
- U = !1, H = !0;
328
+ L = !1, H = !0;
343
329
  },
344
330
  hasLoaded: () => H,
345
- fail: () => he(y),
331
+ fail: () => de(v),
346
332
  report: (c) => {
347
- var D;
348
- return s("error", {
333
+ var O;
334
+ return a("error", {
349
335
  ...c,
350
- mode: y,
351
- time: ((D = l.value) == null ? void 0 : D.currentTime) ?? 0
336
+ mode: v,
337
+ time: ((O = l.value) == null ? void 0 : O.currentTime) ?? 0
352
338
  });
353
339
  },
354
340
  dismissError: () => queueMicrotask(() => {
355
341
  var c;
356
- return (c = n.value) == null ? void 0 : c.store.dismissError();
342
+ return (c = o.value) == null ? void 0 : c.store.dismissError();
357
343
  })
358
- }), ve = () => {
359
- e.watermark && (J = setInterval(() => {
360
- var a;
361
- (((a = n.value) == null ? void 0 : a.store.paused) ?? !0) || (h.value = !0, Q = setTimeout(() => {
362
- h.value = !1;
363
- }, Ne));
364
- }, Be));
365
- }, ee = () => {
366
- var a;
367
- u.value && URL.revokeObjectURL(u.value), u.value = (a = e.chapters) != null && a.length ? URL.createObjectURL(
368
- new Blob([st(e.chapters)], { type: "text/vtt" })
369
- ) : null;
370
- }, ye = async (a) => {
371
- var se;
372
- const y = ++$;
373
- await we();
374
- const c = l.value, D = (se = n.value) == null ? void 0 : se.store;
375
- if (!(!c || !D) && (U = !1, H = !1, a !== T.Progressive && await X(), y === $)) {
376
- if (e.resumeKey && ze(c, e.resumeKey), Me(c, () => o.value), Ke(
344
+ }), pe = () => {
345
+ e.watermark && (q = setInterval(() => {
346
+ var s;
347
+ (((s = o.value) == null ? void 0 : s.store.paused) ?? !0) || (m.value = !0, J = setTimeout(() => {
348
+ m.value = !1;
349
+ }, ze));
350
+ }, Ve));
351
+ }, fe = async (s) => {
352
+ var x;
353
+ const v = ++F;
354
+ await ke();
355
+ const c = l.value, O = (x = o.value) == null ? void 0 : x.store;
356
+ if (!(!c || !O) && (L = !1, H = !1, s !== _.Progressive && await Q(), v === F)) {
357
+ if (e.resumeKey && Oe(c, e.resumeKey), Ce(c, () => T.value), Ie(
377
358
  c,
378
- (W) => s("progress", W),
379
- () => s("ended")
380
- ), g) {
381
- const { time: W, rate: ge, playing: be } = g, ae = () => {
382
- g = null, W && (c.currentTime = W), c.playbackRate = ge;
359
+ (Y) => a("progress", Y),
360
+ () => a("ended")
361
+ ), E) {
362
+ const { time: Y, rate: me, playing: ve } = E, ee = () => {
363
+ E = null, Y && (c.currentTime = Y), c.playbackRate = me;
383
364
  };
384
- be ? Ge(c, ae) : c.addEventListener("loadedmetadata", ae, { once: !0 });
365
+ ve ? Ue(c, ee) : c.addEventListener("loadedmetadata", ee, { once: !0 });
385
366
  }
386
- a === T.Hls && L ? qe(
367
+ s === _.Hls && h ? Ge(
387
368
  c,
388
- L,
389
- Z(e.hlsSrc, a)
390
- ) : a === T.Dash ? Je(
369
+ h,
370
+ X(e.hlsSrc, s)
371
+ ) : s === _.Dash ? je(
391
372
  c,
392
- Z(e.dashSrc, a)
393
- ) : Qe(c, e.sources ?? []), p.value = D.controlsVisible, z = D.subscribe(() => {
394
- p.value = D.controlsVisible;
395
- }), ve();
373
+ X(e.dashSrc, s)
374
+ ) : qe(c, e.sources ?? []), d.value = O.controlsVisible, V = O.subscribe(() => {
375
+ d.value = O.controlsVisible;
376
+ }), pe();
396
377
  }
397
- }, j = () => {
398
- $++, m(), z == null || z(), z = void 0, clearInterval(J), clearTimeout(Q), h.value = !1;
399
- }, te = () => {
378
+ }, W = () => {
379
+ F++, n(), V == null || V(), V = void 0, clearInterval(q), clearTimeout(J), m.value = !1;
380
+ }, Z = () => {
400
381
  if (!i.value) return;
401
- const a = He(e, i.value, f.value);
402
- a !== d.value && (!a && d.value || (j(), d.value = a, a && ye(a)));
403
- }, Ee = async () => {
404
- const [a] = await Promise.all([
382
+ const s = Me(e, i.value, p.value);
383
+ s !== u.value && (!s && u.value || (W(), u.value = s, s && fe(s)));
384
+ }, he = async () => {
385
+ const [s] = await Promise.all([
405
386
  e.hlsSrc ? import("@videojs/hlsjs-video") : null,
406
387
  e.hlsSrc ? import("@videojs/html/media/hlsjs-video") : null,
407
388
  e.dashSrc ? import("@videojs/html/media/dash-video") : null,
408
389
  import("@videojs/html/i18n"),
409
390
  import("@videojs/html/i18n/locales/uk/register"),
410
- nt(),
391
+ $e(),
411
392
  import("@videojs/html/video/skin")
412
393
  ]);
413
- return L = (a == null ? void 0 : a.Hls) ?? null, {
414
- hls: !!L && (L.isSupported() || !!document.createElement("video").canPlayType("application/vnd.apple.mpegurl")),
415
- dash: !!e.dashSrc && We()
394
+ return h = (s == null ? void 0 : s.Hls) ?? null, {
395
+ hls: !!h && (h.isSupported() || !!document.createElement("video").canPlayType("application/vnd.apple.mpegurl")),
396
+ dash: !!e.dashSrc && Ne()
416
397
  };
417
- }, re = async () => {
418
- i.value = await Ee(), te();
398
+ }, $ = async () => {
399
+ i.value = await he(), Z();
419
400
  };
420
- return F(f, te), F(() => JSON.stringify(e.chapters), ee), F(
401
+ return se(p, Z), se(
421
402
  () => JSON.stringify([e.hlsSrc, e.dashSrc, e.sources]),
422
403
  () => {
423
- j(), g = null, d.value = null, i.value = null, f.value = [], re();
404
+ W(), E = null, u.value = null, i.value = null, p.value = [], $();
424
405
  }
425
- ), Re(() => {
426
- ee(), re();
427
- }), de(() => {
428
- j(), u.value && URL.revokeObjectURL(u.value);
429
- }), (a, y) => (S(), k("div", {
406
+ ), Se($), ie(W), (s, v) => (b(), k("div", {
430
407
  class: "app-video",
431
- onKeydownCapture: y[0] || (y[0] = //@ts-ignore
432
- (...c) => w(E) && w(E)(...c)),
433
- onPointerdownCapture: y[1] || (y[1] = //@ts-ignore
434
- (...c) => w(_) && w(_)(...c)),
435
- onContextmenuCapture: y[2] || (y[2] = //@ts-ignore
436
- (...c) => w(v) && w(v)(...c))
408
+ onKeydownCapture: v[0] || (v[0] = //@ts-ignore
409
+ (...c) => w(f) && w(f)(...c)),
410
+ onPointerdownCapture: v[1] || (v[1] = //@ts-ignore
411
+ (...c) => w(y) && w(y)(...c)),
412
+ onContextmenuCapture: v[2] || (v[2] = //@ts-ignore
413
+ (...c) => w(R) && w(R)(...c))
437
414
  }, [
438
- d.value ? (S(), k("media-i18n", {
439
- key: d.value,
440
- lang: w(Ie)
415
+ u.value ? (b(), k("media-i18n", {
416
+ key: u.value,
417
+ lang: w(Ae)
441
418
  }, [
442
419
  G("app-video-player", {
443
420
  ref_key: "playerEl",
444
- ref: n,
445
- poster: a.poster,
446
- "default-playback-rates": w(Ve).join(" ")
421
+ ref: o,
422
+ poster: s.poster,
423
+ "default-playback-rates": w(De).join(" ")
447
424
  }, [
448
- G("video-skin", lt, [
449
- d.value === w(T).Hls ? (S(), k("hlsjs-video", {
425
+ G("video-skin", tt, [
426
+ u.value === w(_).Hls ? (b(), k("hlsjs-video", {
450
427
  key: 0,
451
428
  ref_key: "mediaEl",
452
429
  ref: l,
453
- crossorigin: R.value,
430
+ crossorigin: S.value,
454
431
  preload: "none",
455
432
  playsinline: ""
456
433
  }, [
457
- u.value ? (S(), k("track", {
458
- key: u.value,
434
+ s.chaptersSrc ? (b(), k("track", {
435
+ key: s.chaptersSrc,
459
436
  kind: "chapters",
460
437
  default: "",
461
- src: u.value
462
- }, null, 8, ut)) : O("", !0),
463
- a.thumbnailsSrc ? (S(), k("track", {
464
- key: a.thumbnailsSrc,
438
+ src: s.chaptersSrc
439
+ }, null, 8, st)) : A("", !0),
440
+ s.thumbnailsSrc ? (b(), k("track", {
441
+ key: s.thumbnailsSrc,
465
442
  kind: "metadata",
466
443
  label: "thumbnails",
467
444
  default: "",
468
- src: a.thumbnailsSrc
469
- }, null, 8, dt)) : O("", !0)
470
- ], 8, ct)) : d.value === w(T).Dash ? (S(), k("dash-video", {
445
+ src: s.thumbnailsSrc
446
+ }, null, 8, at)) : A("", !0)
447
+ ], 8, rt)) : u.value === w(_).Dash ? (b(), k("dash-video", {
471
448
  key: 1,
472
449
  ref_key: "mediaEl",
473
450
  ref: l,
474
- crossorigin: R.value,
451
+ crossorigin: S.value,
475
452
  preload: "none",
476
453
  playsinline: ""
477
454
  }, [
478
- u.value ? (S(), k("track", {
479
- key: u.value,
455
+ s.chaptersSrc ? (b(), k("track", {
456
+ key: s.chaptersSrc,
480
457
  kind: "chapters",
481
458
  default: "",
482
- src: u.value
483
- }, null, 8, ft)) : O("", !0),
484
- a.thumbnailsSrc ? (S(), k("track", {
485
- key: a.thumbnailsSrc,
459
+ src: s.chaptersSrc
460
+ }, null, 8, ot)) : A("", !0),
461
+ s.thumbnailsSrc ? (b(), k("track", {
462
+ key: s.thumbnailsSrc,
486
463
  kind: "metadata",
487
464
  label: "thumbnails",
488
465
  default: "",
489
- src: a.thumbnailsSrc
490
- }, null, 8, mt)) : O("", !0)
491
- ], 8, pt)) : (S(), k("video", {
466
+ src: s.thumbnailsSrc
467
+ }, null, 8, it)) : A("", !0)
468
+ ], 8, nt)) : (b(), k("video", {
492
469
  key: 2,
493
470
  ref_key: "mediaEl",
494
471
  ref: l,
495
- crossorigin: R.value,
472
+ crossorigin: S.value,
496
473
  preload: "none",
497
474
  playsinline: ""
498
475
  }, [
499
- u.value ? (S(), k("track", {
500
- key: u.value,
476
+ s.chaptersSrc ? (b(), k("track", {
477
+ key: s.chaptersSrc,
501
478
  kind: "chapters",
502
479
  default: "",
503
- src: u.value
504
- }, null, 8, vt)) : O("", !0),
505
- a.thumbnailsSrc ? (S(), k("track", {
506
- key: a.thumbnailsSrc,
480
+ src: s.chaptersSrc
481
+ }, null, 8, ct)) : A("", !0),
482
+ s.thumbnailsSrc ? (b(), k("track", {
483
+ key: s.thumbnailsSrc,
507
484
  kind: "metadata",
508
485
  label: "thumbnails",
509
486
  default: "",
510
- src: a.thumbnailsSrc
511
- }, null, 8, yt)) : O("", !0)
512
- ], 8, ht)),
513
- a.watermark ? (S(), k("div", {
487
+ src: s.thumbnailsSrc
488
+ }, null, 8, ut)) : A("", !0)
489
+ ], 8, lt)),
490
+ s.watermark ? (b(), k("div", {
514
491
  key: 3,
515
- class: ie(["app-video__watermark", {
516
- "app-video__watermark_visible": h.value,
517
- "app-video__watermark_raised": p.value
492
+ class: ae(["app-video__watermark", {
493
+ "app-video__watermark_visible": m.value,
494
+ "app-video__watermark_raised": d.value
518
495
  }])
519
- }, _e(a.watermark), 3)) : O("", !0),
496
+ }, ge(s.watermark), 3)) : A("", !0),
520
497
  G("div", {
521
- class: ie(["app-video__boost", { "app-video__boost_visible": w(o) }])
498
+ class: ae(["app-video__boost", { "app-video__boost_visible": w(T) }])
522
499
  }, " 2× ", 2)
523
500
  ])
524
- ], 8, it)
525
- ], 8, ot)) : O("", !0)
501
+ ], 8, et)
502
+ ], 8, xe)) : A("", !0)
526
503
  ], 32));
527
504
  }
528
- }), Rt = /* @__PURE__ */ Ue(Et, [["__scopeId", "data-v-bde5aa9e"]]);
505
+ }), vt = /* @__PURE__ */ Ke(dt, [["__scopeId", "data-v-7fa00f90"]]);
529
506
  export {
530
- Rt as AppVideo
507
+ vt as AppVideo
531
508
  };