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