strataplayer 1.1.1 → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +80 -114
- package/dist/dash.d.ts +120 -5
- package/dist/hls.d.ts +120 -5
- package/dist/index.d.ts +121 -6
- package/dist/mpegts.d.ts +120 -5
- package/dist/strataplayer.cjs.js +80 -42
- package/dist/strataplayer.cjs.js.map +1 -1
- package/dist/strataplayer.es.js +1315 -717
- package/dist/strataplayer.es.js.map +1 -1
- package/dist/style.css +1 -1
- package/dist/webtorrent.cjs.js.map +1 -1
- package/dist/webtorrent.d.ts +120 -5
- package/dist/webtorrent.es.js.map +1 -1
- package/package.json +1 -1
package/dist/strataplayer.es.js
CHANGED
|
@@ -1,45 +1,45 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
import
|
|
5
|
-
import { createRoot as
|
|
6
|
-
import { jsxs as
|
|
7
|
-
class
|
|
1
|
+
var jt = Object.defineProperty;
|
|
2
|
+
var Ht = (o, e, i) => e in o ? jt(o, e, { enumerable: !0, configurable: !0, writable: !0, value: i }) : o[e] = i;
|
|
3
|
+
var w = (o, e, i) => Ht(o, typeof e != "symbol" ? e + "" : e, i);
|
|
4
|
+
import we, { useState as k, useEffect as P, forwardRef as ft, createElement as ke, useRef as F, useLayoutEffect as Wt, useMemo as ve, useSyncExternalStore as qt, useCallback as ge } from "react";
|
|
5
|
+
import { createRoot as Dt } from "react-dom/client";
|
|
6
|
+
import { jsxs as h, jsx as t, Fragment as R } from "react/jsx-runtime";
|
|
7
|
+
class Ut {
|
|
8
8
|
constructor() {
|
|
9
|
-
|
|
9
|
+
w(this, "events");
|
|
10
10
|
this.events = /* @__PURE__ */ new Map();
|
|
11
11
|
}
|
|
12
12
|
on(e, i) {
|
|
13
|
-
var
|
|
14
|
-
return this.events.has(e) || this.events.set(e, []), (
|
|
13
|
+
var r;
|
|
14
|
+
return this.events.has(e) || this.events.set(e, []), (r = this.events.get(e)) == null || r.push(i), () => this.off(e, i);
|
|
15
15
|
}
|
|
16
16
|
off(e, i) {
|
|
17
|
-
const
|
|
18
|
-
|
|
17
|
+
const r = this.events.get(e);
|
|
18
|
+
r && this.events.set(
|
|
19
19
|
e,
|
|
20
|
-
|
|
20
|
+
r.filter((n) => n !== i)
|
|
21
21
|
);
|
|
22
22
|
}
|
|
23
23
|
emit(e, i) {
|
|
24
|
-
const
|
|
25
|
-
|
|
24
|
+
const r = this.events.get(e);
|
|
25
|
+
r && r.forEach((n) => n(i));
|
|
26
26
|
}
|
|
27
27
|
destroy() {
|
|
28
28
|
this.events.clear();
|
|
29
29
|
}
|
|
30
30
|
}
|
|
31
|
-
class
|
|
31
|
+
class _t {
|
|
32
32
|
constructor(e) {
|
|
33
|
-
|
|
34
|
-
|
|
33
|
+
w(this, "state");
|
|
34
|
+
w(this, "listeners");
|
|
35
35
|
this.state = e, this.listeners = /* @__PURE__ */ new Set();
|
|
36
36
|
}
|
|
37
37
|
get() {
|
|
38
38
|
return this.state;
|
|
39
39
|
}
|
|
40
40
|
setState(e) {
|
|
41
|
-
const i = this.state,
|
|
42
|
-
this.state = { ...i, ...
|
|
41
|
+
const i = this.state, r = typeof e == "function" ? e(i) : e;
|
|
42
|
+
this.state = { ...i, ...r }, this.listeners.forEach((n) => n(this.state, i));
|
|
43
43
|
}
|
|
44
44
|
subscribe(e) {
|
|
45
45
|
return this.listeners.add(e), () => this.listeners.delete(e);
|
|
@@ -48,13 +48,13 @@ class ot {
|
|
|
48
48
|
this.listeners.clear();
|
|
49
49
|
}
|
|
50
50
|
}
|
|
51
|
-
class
|
|
51
|
+
class Gt {
|
|
52
52
|
constructor(e) {
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
53
|
+
w(this, "context", null);
|
|
54
|
+
w(this, "source", null);
|
|
55
|
+
w(this, "gainNode", null);
|
|
56
|
+
w(this, "video");
|
|
57
|
+
w(this, "isInitialized", !1);
|
|
58
58
|
this.video = e;
|
|
59
59
|
}
|
|
60
60
|
/**
|
|
@@ -77,7 +77,7 @@ class lt {
|
|
|
77
77
|
this.context && this.context.close(), this.isInitialized = !1;
|
|
78
78
|
}
|
|
79
79
|
}
|
|
80
|
-
const
|
|
80
|
+
const Ne = {
|
|
81
81
|
useNative: !1,
|
|
82
82
|
fixCapitalization: !1,
|
|
83
83
|
backgroundOpacity: 50,
|
|
@@ -88,9 +88,10 @@ const le = {
|
|
|
88
88
|
isBold: !1,
|
|
89
89
|
textColor: "#ffffff",
|
|
90
90
|
verticalOffset: 40
|
|
91
|
-
},
|
|
91
|
+
}, pt = "strata-settings-v3", V = {
|
|
92
92
|
isPlaying: !1,
|
|
93
93
|
isBuffering: !1,
|
|
94
|
+
isLive: !1,
|
|
94
95
|
currentTime: 0,
|
|
95
96
|
duration: 0,
|
|
96
97
|
buffered: [],
|
|
@@ -108,7 +109,7 @@ const le = {
|
|
|
108
109
|
subtitleTracks: [],
|
|
109
110
|
currentSubtitle: -1,
|
|
110
111
|
subtitleOffset: 0,
|
|
111
|
-
subtitleSettings:
|
|
112
|
+
subtitleSettings: Ne,
|
|
112
113
|
activeCues: [],
|
|
113
114
|
viewMode: "normal",
|
|
114
115
|
notifications: [],
|
|
@@ -116,108 +117,263 @@ const le = {
|
|
|
116
117
|
themeColor: "#6366f1",
|
|
117
118
|
theme: "default",
|
|
118
119
|
sources: [],
|
|
119
|
-
currentSourceIndex: -1
|
|
120
|
-
|
|
120
|
+
currentSourceIndex: -1,
|
|
121
|
+
// New State Defaults
|
|
122
|
+
isLocked: !1,
|
|
123
|
+
flipState: { horizontal: !1, vertical: !1 },
|
|
124
|
+
aspectRatio: "default",
|
|
125
|
+
isAutoSized: !1,
|
|
126
|
+
isLooping: !1,
|
|
127
|
+
controlsVisible: !0
|
|
128
|
+
}, bt = (o = {}) => {
|
|
121
129
|
let e = {};
|
|
122
|
-
if (!
|
|
130
|
+
if (!o.disablePersistence && typeof window < "u")
|
|
123
131
|
try {
|
|
124
|
-
const
|
|
125
|
-
|
|
132
|
+
const r = localStorage.getItem(pt);
|
|
133
|
+
r && (e = JSON.parse(r));
|
|
126
134
|
} catch {
|
|
127
135
|
}
|
|
128
136
|
const i = {
|
|
129
|
-
...
|
|
137
|
+
...Ne,
|
|
130
138
|
...e.subtitleSettings || {},
|
|
131
|
-
...
|
|
139
|
+
...o.subtitleSettings || {}
|
|
132
140
|
};
|
|
133
141
|
return {
|
|
134
|
-
...
|
|
142
|
+
...V,
|
|
135
143
|
...e,
|
|
136
144
|
// Load saved first
|
|
137
145
|
// Override with config if present (not undefined)
|
|
138
|
-
volume:
|
|
139
|
-
isMuted:
|
|
140
|
-
playbackRate:
|
|
141
|
-
audioGain:
|
|
142
|
-
theme:
|
|
143
|
-
themeColor:
|
|
144
|
-
iconSize:
|
|
145
|
-
subtitleSettings: i
|
|
146
|
+
volume: o.volume ?? e.volume ?? V.volume,
|
|
147
|
+
isMuted: o.muted ?? e.isMuted ?? V.isMuted,
|
|
148
|
+
playbackRate: o.playbackRate ?? e.playbackRate ?? V.playbackRate,
|
|
149
|
+
audioGain: o.audioGain ?? e.audioGain ?? V.audioGain,
|
|
150
|
+
theme: o.theme ?? e.theme ?? V.theme,
|
|
151
|
+
themeColor: o.themeColor ?? e.themeColor ?? V.themeColor,
|
|
152
|
+
iconSize: o.iconSize ?? e.iconSize ?? V.iconSize,
|
|
153
|
+
subtitleSettings: i,
|
|
154
|
+
// Config overrides state for these visual modes
|
|
155
|
+
isAutoSized: o.autoSize ?? V.isAutoSized,
|
|
156
|
+
isLive: o.isLive ?? e.isLive ?? V.isLive,
|
|
157
|
+
isLooping: o.loop ?? e.isLooping ?? V.isLooping
|
|
146
158
|
};
|
|
147
159
|
};
|
|
148
|
-
class
|
|
160
|
+
class Qt {
|
|
149
161
|
constructor(e = {}, i) {
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
162
|
+
w(this, "video");
|
|
163
|
+
w(this, "container", null);
|
|
164
|
+
w(this, "events");
|
|
165
|
+
w(this, "store");
|
|
166
|
+
w(this, "plugins", /* @__PURE__ */ new Map());
|
|
167
|
+
w(this, "audioEngine");
|
|
168
|
+
w(this, "config");
|
|
169
|
+
w(this, "resizeObserver", null);
|
|
157
170
|
// Retry Logic
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
171
|
+
w(this, "retryCount", 0);
|
|
172
|
+
w(this, "maxRetries", 5);
|
|
173
|
+
w(this, "retryTimer", null);
|
|
174
|
+
w(this, "currentSource", null);
|
|
175
|
+
w(this, "currentSrc", "");
|
|
176
|
+
w(this, "currentTracks", []);
|
|
164
177
|
// Cast
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
this.config = e, this.video = i || document.createElement("video"), this.video.crossOrigin = "anonymous", this.events = new
|
|
169
|
-
const
|
|
170
|
-
this.store = new
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
178
|
+
w(this, "castInitialized", !1);
|
|
179
|
+
w(this, "boundCueChange");
|
|
180
|
+
w(this, "boundFullscreenChange");
|
|
181
|
+
this.config = e, this.video = i || document.createElement("video"), this.video.crossOrigin = "anonymous", e.playsInline !== !1 && (this.video.playsInline = !0), this.events = new Ut();
|
|
182
|
+
const r = bt(e);
|
|
183
|
+
this.store = new _t(r), this.audioEngine = new Gt(this.video), this.boundCueChange = this.handleCueChange.bind(this), this.boundFullscreenChange = () => {
|
|
184
|
+
const n = !!document.fullscreenElement;
|
|
185
|
+
if (this.store.setState({ isFullscreen: n }), this.emit("resize"), this.emit(n ? "fullscreen" : "fullscreen_exit"), n && this.config.autoOrientation && screen.orientation && "lock" in screen.orientation) {
|
|
186
|
+
const m = this.video.videoWidth > this.video.videoHeight ? "landscape" : "portrait";
|
|
187
|
+
try {
|
|
188
|
+
screen.orientation.lock(m).catch(() => {
|
|
189
|
+
});
|
|
190
|
+
} catch {
|
|
191
|
+
}
|
|
192
|
+
} else !n && screen.orientation && "unlock" in screen.orientation && screen.orientation.unlock();
|
|
193
|
+
}, this.video.volume = r.volume, this.video.muted = r.isMuted, this.video.playbackRate = r.playbackRate, this.video.loop = r.isLooping, r.audioGain > 1 && this.audioEngine.setGain(r.audioGain), r.isAutoSized && (this.video.style.objectFit = "cover"), this.initVideoListeners(), this.initCast(), e.disablePersistence || this.store.subscribe((n) => {
|
|
194
|
+
const d = {
|
|
174
195
|
volume: n.volume,
|
|
175
196
|
isMuted: n.isMuted,
|
|
176
197
|
playbackRate: n.playbackRate,
|
|
177
198
|
subtitleSettings: n.subtitleSettings,
|
|
178
199
|
iconSize: n.iconSize,
|
|
179
200
|
themeColor: n.themeColor,
|
|
180
|
-
theme: n.theme
|
|
201
|
+
theme: n.theme,
|
|
202
|
+
isLive: n.isLive,
|
|
203
|
+
isLooping: n.isLooping
|
|
181
204
|
};
|
|
182
|
-
localStorage.setItem(
|
|
205
|
+
localStorage.setItem(pt, JSON.stringify(d));
|
|
183
206
|
});
|
|
184
207
|
}
|
|
208
|
+
// --- Instance Properties ---
|
|
209
|
+
get playing() {
|
|
210
|
+
return !this.video.paused && !this.video.ended && this.video.readyState > 2;
|
|
211
|
+
}
|
|
212
|
+
get currentTime() {
|
|
213
|
+
return this.video.currentTime;
|
|
214
|
+
}
|
|
215
|
+
set currentTime(e) {
|
|
216
|
+
this.seek(e);
|
|
217
|
+
}
|
|
218
|
+
get duration() {
|
|
219
|
+
return this.video.duration || 0;
|
|
220
|
+
}
|
|
221
|
+
get paused() {
|
|
222
|
+
return this.video.paused;
|
|
223
|
+
}
|
|
224
|
+
get volume() {
|
|
225
|
+
return this.video.volume;
|
|
226
|
+
}
|
|
227
|
+
set volume(e) {
|
|
228
|
+
this.setVolume(e);
|
|
229
|
+
}
|
|
230
|
+
get muted() {
|
|
231
|
+
return this.video.muted;
|
|
232
|
+
}
|
|
233
|
+
set muted(e) {
|
|
234
|
+
this.video.muted = e, this.store.setState({ isMuted: e });
|
|
235
|
+
}
|
|
236
|
+
get playbackRate() {
|
|
237
|
+
return this.video.playbackRate;
|
|
238
|
+
}
|
|
239
|
+
set playbackRate(e) {
|
|
240
|
+
this.video.playbackRate = e;
|
|
241
|
+
}
|
|
242
|
+
get loop() {
|
|
243
|
+
return this.video.loop;
|
|
244
|
+
}
|
|
245
|
+
set loop(e) {
|
|
246
|
+
this.video.loop = e, this.store.setState({ isLooping: e });
|
|
247
|
+
}
|
|
248
|
+
// --- Instance Methods ---
|
|
249
|
+
forward(e = 10) {
|
|
250
|
+
this.skip(e);
|
|
251
|
+
}
|
|
252
|
+
backward(e = 10) {
|
|
253
|
+
this.skip(-e);
|
|
254
|
+
}
|
|
255
|
+
// --- Event API ---
|
|
256
|
+
on(e, i) {
|
|
257
|
+
return this.events.on(e, i);
|
|
258
|
+
}
|
|
259
|
+
off(e, i) {
|
|
260
|
+
return this.events.off(e, i);
|
|
261
|
+
}
|
|
262
|
+
emit(e, i) {
|
|
263
|
+
return this.events.emit(e, i);
|
|
264
|
+
}
|
|
185
265
|
initVideoListeners() {
|
|
186
|
-
const e = (
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
266
|
+
const e = (r) => this.store.setState(r);
|
|
267
|
+
[
|
|
268
|
+
"abort",
|
|
269
|
+
"canplay",
|
|
270
|
+
"canplaythrough",
|
|
271
|
+
"durationchange",
|
|
272
|
+
"emptied",
|
|
273
|
+
"ended",
|
|
274
|
+
"error",
|
|
275
|
+
"loadeddata",
|
|
276
|
+
"loadedmetadata",
|
|
277
|
+
"loadstart",
|
|
278
|
+
"pause",
|
|
279
|
+
"play",
|
|
280
|
+
"playing",
|
|
281
|
+
"progress",
|
|
282
|
+
"ratechange",
|
|
283
|
+
"seeked",
|
|
284
|
+
"seeking",
|
|
285
|
+
"stalled",
|
|
286
|
+
"suspend",
|
|
287
|
+
"timeupdate",
|
|
288
|
+
"volumechange",
|
|
289
|
+
"waiting"
|
|
290
|
+
].forEach((r) => {
|
|
291
|
+
this.video.addEventListener(r, (n) => {
|
|
292
|
+
switch (this.emit(`video:${r}`, n), r === "play" && this.emit("play"), r === "pause" && this.emit("pause"), r === "ended" && this.emit("ended"), r === "error" && this.emit("error", this.video.error), r === "seeked" && this.emit("seek"), r) {
|
|
293
|
+
case "play":
|
|
294
|
+
e({ isPlaying: !0 });
|
|
295
|
+
break;
|
|
296
|
+
case "pause":
|
|
297
|
+
e({ isPlaying: !1 });
|
|
298
|
+
break;
|
|
299
|
+
case "ended":
|
|
300
|
+
e({ isPlaying: !1 });
|
|
301
|
+
break;
|
|
302
|
+
case "waiting":
|
|
303
|
+
e({ isBuffering: !0 }), this.emit("loading", !0);
|
|
304
|
+
break;
|
|
305
|
+
case "playing":
|
|
306
|
+
e({ isBuffering: !1 }), this.emit("loading", !1);
|
|
307
|
+
break;
|
|
308
|
+
case "canplay":
|
|
309
|
+
e({ isBuffering: !1 }), this.emit("loading", !1);
|
|
310
|
+
break;
|
|
311
|
+
case "loadeddata":
|
|
312
|
+
e({ isBuffering: !1 }), this.retryCount = 0, this.removeNotification("retry"), this.store.get().error && e({ error: null });
|
|
313
|
+
break;
|
|
314
|
+
case "timeupdate":
|
|
315
|
+
this.video.seeking || e({ currentTime: this.video.currentTime });
|
|
316
|
+
break;
|
|
317
|
+
case "seeked":
|
|
318
|
+
e({ currentTime: this.video.currentTime });
|
|
319
|
+
break;
|
|
320
|
+
case "durationchange":
|
|
321
|
+
e({ duration: this.video.duration });
|
|
322
|
+
break;
|
|
323
|
+
case "volumechange":
|
|
324
|
+
e({ volume: this.video.volume, isMuted: this.video.muted });
|
|
325
|
+
break;
|
|
326
|
+
case "ratechange":
|
|
327
|
+
e({ playbackRate: this.video.playbackRate });
|
|
328
|
+
break;
|
|
329
|
+
case "error":
|
|
330
|
+
this.handleError();
|
|
331
|
+
break;
|
|
332
|
+
case "progress":
|
|
333
|
+
this.updateBuffer();
|
|
334
|
+
break;
|
|
335
|
+
case "enterpictureinpicture":
|
|
336
|
+
e({ isPip: !0 });
|
|
337
|
+
break;
|
|
338
|
+
case "leavepictureinpicture":
|
|
339
|
+
e({ isPip: !1 });
|
|
340
|
+
break;
|
|
341
|
+
}
|
|
342
|
+
});
|
|
343
|
+
}), this.video.addEventListener("enterpictureinpicture", () => {
|
|
344
|
+
e({ isPip: !0 }), this.emit("pip", !0);
|
|
345
|
+
}), this.video.addEventListener("leavepictureinpicture", () => {
|
|
346
|
+
e({ isPip: !1 }), this.emit("pip", !1);
|
|
347
|
+
}), document.addEventListener("fullscreenchange", this.boundFullscreenChange), this.video.textTracks.addEventListener("addtrack", this.updateSubtitles.bind(this)), this.video.textTracks.addEventListener("removetrack", this.updateSubtitles.bind(this));
|
|
192
348
|
}
|
|
193
349
|
triggerError(e, i = !1) {
|
|
194
350
|
i ? this.handleError(e) : this.notify({ type: "warning", message: `Warning: ${e}`, duration: 5e3 });
|
|
195
351
|
}
|
|
196
352
|
handleError(e) {
|
|
197
|
-
const i = this.video.error,
|
|
198
|
-
if (this.removeNotification("retry"), this.retryCount < this.maxRetries) {
|
|
353
|
+
const i = this.video.error, r = e || (i == null ? void 0 : i.message) || (i ? `Code ${i.code}` : "Unknown Error");
|
|
354
|
+
if (this.removeNotification("retry"), this.emit("video:error", i), this.retryCount < this.maxRetries) {
|
|
199
355
|
this.retryCount++;
|
|
200
356
|
const n = Math.pow(2, this.retryCount - 1) * 1500;
|
|
201
357
|
this.notify({
|
|
202
358
|
id: "retry",
|
|
203
359
|
type: "loading",
|
|
204
|
-
message: `Error: ${
|
|
205
|
-
}), console.warn(`[StrataPlayer] Error: ${
|
|
360
|
+
message: `Error: ${r}. Retrying (${this.retryCount}/${this.maxRetries})...`
|
|
361
|
+
}), console.warn(`[StrataPlayer] Error: ${r}. Retrying in ${n}ms...`), this.retryTimer && clearTimeout(this.retryTimer), this.retryTimer = setTimeout(() => {
|
|
206
362
|
if (this.currentSource) {
|
|
207
363
|
this.load(this.currentSource, this.currentTracks, !0);
|
|
208
|
-
const
|
|
209
|
-
if (
|
|
210
|
-
const
|
|
211
|
-
this.video.currentTime =
|
|
364
|
+
const d = this.store.get().currentTime;
|
|
365
|
+
if (d > 0) {
|
|
366
|
+
const m = () => {
|
|
367
|
+
this.video.currentTime = d, this.video.removeEventListener("canplay", m);
|
|
212
368
|
};
|
|
213
|
-
this.video.addEventListener("canplay",
|
|
369
|
+
this.video.addEventListener("canplay", m);
|
|
214
370
|
}
|
|
215
371
|
}
|
|
216
372
|
}, n);
|
|
217
373
|
} else {
|
|
218
374
|
this.removeNotification("retry");
|
|
219
|
-
const n = `Failed to play after ${this.maxRetries} attempts: ${
|
|
220
|
-
this.store.setState({ error: n });
|
|
375
|
+
const n = `Failed to play after ${this.maxRetries} attempts: ${r}`;
|
|
376
|
+
this.store.setState({ error: n }), this.emit("error", n);
|
|
221
377
|
}
|
|
222
378
|
}
|
|
223
379
|
updateBuffer() {
|
|
@@ -231,9 +387,9 @@ class ct {
|
|
|
231
387
|
}
|
|
232
388
|
updateSubtitles() {
|
|
233
389
|
setTimeout(() => {
|
|
234
|
-
const e = Array.from(this.video.textTracks).filter((
|
|
235
|
-
label:
|
|
236
|
-
language:
|
|
390
|
+
const e = Array.from(this.video.textTracks).filter((r) => r.kind === "subtitles" || r.kind === "captions").map((r, n) => ({
|
|
391
|
+
label: r.label || r.language || `Track ${n + 1}`,
|
|
392
|
+
language: r.language,
|
|
237
393
|
index: n
|
|
238
394
|
}));
|
|
239
395
|
this.store.setState({ subtitleTracks: e });
|
|
@@ -243,20 +399,23 @@ class ct {
|
|
|
243
399
|
}
|
|
244
400
|
// --- Utility ---
|
|
245
401
|
async fetchWithRetry(e, i = 3) {
|
|
246
|
-
for (let
|
|
402
|
+
for (let r = 0; r < i; r++)
|
|
247
403
|
try {
|
|
248
404
|
const n = await fetch(e);
|
|
249
405
|
if (!n.ok) throw new Error(`HTTP ${n.status}`);
|
|
250
406
|
return n;
|
|
251
407
|
} catch (n) {
|
|
252
|
-
if (
|
|
253
|
-
await new Promise((
|
|
408
|
+
if (r === i - 1) throw n;
|
|
409
|
+
await new Promise((d) => setTimeout(d, 1e3 * Math.pow(2, r)));
|
|
254
410
|
}
|
|
255
411
|
throw new Error("Fetch failed");
|
|
256
412
|
}
|
|
257
413
|
// --- Core Methods ---
|
|
258
414
|
attach(e) {
|
|
259
|
-
this.container = e, this.container.contains(this.video) || (this.video.style.width = "100%", this.video.style.height = "100%", this.video.style.objectFit = "contain", this.video.style.backgroundColor = "black", this.container.appendChild(this.video))
|
|
415
|
+
this.container = e, this.container.contains(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.container.appendChild(this.video)), this.resizeObserver = new ResizeObserver((i) => {
|
|
416
|
+
for (const r of i)
|
|
417
|
+
this.emit("resize", { width: r.contentRect.width, height: r.contentRect.height });
|
|
418
|
+
}), this.resizeObserver.observe(this.container), this.emit("ready");
|
|
260
419
|
}
|
|
261
420
|
use(e) {
|
|
262
421
|
this.plugins.has(e.name) || (e.init(this), this.plugins.set(e.name, e));
|
|
@@ -267,19 +426,19 @@ class ct {
|
|
|
267
426
|
switchSource(e) {
|
|
268
427
|
const i = this.store.get().sources;
|
|
269
428
|
if (e >= 0 && e < i.length) {
|
|
270
|
-
const
|
|
429
|
+
const r = this.video.currentTime, n = !this.video.paused;
|
|
271
430
|
this.load(i[e], this.currentTracks);
|
|
272
|
-
const
|
|
273
|
-
this.video.currentTime =
|
|
431
|
+
const d = () => {
|
|
432
|
+
this.video.currentTime = r, n && this.video.play(), this.video.removeEventListener("canplay", d);
|
|
274
433
|
};
|
|
275
|
-
this.video.addEventListener("canplay",
|
|
434
|
+
this.video.addEventListener("canplay", d);
|
|
276
435
|
}
|
|
277
436
|
}
|
|
278
|
-
load(e, i = [],
|
|
437
|
+
load(e, i = [], r = !1) {
|
|
279
438
|
this.retryTimer && clearTimeout(this.retryTimer);
|
|
280
439
|
const n = typeof e == "string" ? { url: e, type: "auto" } : e;
|
|
281
|
-
|
|
282
|
-
const
|
|
440
|
+
r || (this.retryCount = 0, this.store.setState({ error: null }), this.removeNotification("retry")), this.currentSrc = n.url, this.currentSource = n, this.currentTracks = i;
|
|
441
|
+
const m = this.store.get().sources.findIndex((l) => l.url === n.url);
|
|
283
442
|
this.store.setState({
|
|
284
443
|
isBuffering: !0,
|
|
285
444
|
qualityLevels: [],
|
|
@@ -289,42 +448,46 @@ class ct {
|
|
|
289
448
|
currentAudioTrack: -1,
|
|
290
449
|
// Reset audio track
|
|
291
450
|
// subtitleTracks and currentSubtitle are purposely preserved
|
|
292
|
-
currentSourceIndex:
|
|
451
|
+
currentSourceIndex: m
|
|
293
452
|
});
|
|
294
453
|
let b = n.type || "auto";
|
|
295
454
|
b === "auto" && (n.url.includes(".m3u8") ? b = "hls" : n.url.includes(".mpd") ? b = "dash" : n.url.includes(".flv") || n.url.includes(".ts") ? b = "mpegts" : n.url.startsWith("magnet:") || n.url.includes(".torrent") ? b = "webtorrent" : b = "mp4"), this.events.emit("load", { url: n.url, type: b });
|
|
296
|
-
const
|
|
297
|
-
for (;
|
|
298
|
-
|
|
299
|
-
i.length > 0 && i.forEach((
|
|
300
|
-
this.fetchWithRetry(
|
|
301
|
-
this.addTextTrackInternal(
|
|
302
|
-
}).catch((
|
|
303
|
-
this.notify({ type: "warning", message: `Failed to load subtitle: ${
|
|
455
|
+
const y = this.video.getElementsByTagName("track");
|
|
456
|
+
for (; y.length > 0; )
|
|
457
|
+
y[0].remove();
|
|
458
|
+
i.length > 0 && i.forEach((l) => {
|
|
459
|
+
this.fetchWithRetry(l.src).then(() => {
|
|
460
|
+
this.addTextTrackInternal(l.src, l.label, l.srcLang, l.default);
|
|
461
|
+
}).catch((v) => {
|
|
462
|
+
this.notify({ type: "warning", message: `Failed to load subtitle: ${l.label}`, duration: 4e3 });
|
|
304
463
|
});
|
|
305
464
|
}), (b === "mp4" || b === "webm" || b === "ogg") && (this.video.src = n.url);
|
|
306
465
|
}
|
|
466
|
+
// Wrapper for external subtitle API
|
|
467
|
+
loadSubtitle(e, i = "Subtitle") {
|
|
468
|
+
this.addTextTrackInternal(e, i, void 0, !0);
|
|
469
|
+
}
|
|
307
470
|
addTextTrack(e, i) {
|
|
308
|
-
const
|
|
309
|
-
|
|
310
|
-
var
|
|
311
|
-
if (!((
|
|
312
|
-
let
|
|
313
|
-
(e.name.toLowerCase().endsWith(".srt") || !
|
|
471
|
+
const r = new FileReader();
|
|
472
|
+
r.onload = (n) => {
|
|
473
|
+
var y;
|
|
474
|
+
if (!((y = n.target) != null && y.result)) return;
|
|
475
|
+
let d = n.target.result;
|
|
476
|
+
(e.name.toLowerCase().endsWith(".srt") || !d.trim().startsWith("WEBVTT")) && (d = d.replace(/(\d{2}:\d{2}:\d{2}),(\d{3})/g, "$1.$2"), d.trim().startsWith("WEBVTT") || (d = `WEBVTT
|
|
314
477
|
|
|
315
|
-
` +
|
|
316
|
-
const
|
|
478
|
+
` + d));
|
|
479
|
+
const m = new Blob([d], { type: "text/vtt" }), b = URL.createObjectURL(m);
|
|
317
480
|
this.addTextTrackInternal(b, i, "user", !0), setTimeout(() => {
|
|
318
|
-
const
|
|
319
|
-
|
|
481
|
+
const v = this.store.get().subtitleTracks.findIndex((C) => C.label === i);
|
|
482
|
+
v !== -1 && (this.setSubtitle(v), this.notify({ type: "success", message: "Subtitle uploaded", duration: 3e3 }));
|
|
320
483
|
}, 200);
|
|
321
|
-
},
|
|
484
|
+
}, r.onerror = () => {
|
|
322
485
|
this.notify({ type: "error", message: "Failed to read file", duration: 3e3 });
|
|
323
|
-
},
|
|
486
|
+
}, r.readAsText(e);
|
|
324
487
|
}
|
|
325
|
-
addTextTrackInternal(e, i,
|
|
326
|
-
const
|
|
327
|
-
|
|
488
|
+
addTextTrackInternal(e, i, r = "", n = !1) {
|
|
489
|
+
const d = document.createElement("track");
|
|
490
|
+
d.kind = "subtitles", d.label = i, d.src = e, d.srclang = r, n && (d.default = !0), this.video.appendChild(d), this.updateSubtitles();
|
|
328
491
|
}
|
|
329
492
|
play() {
|
|
330
493
|
return this.video.play();
|
|
@@ -359,12 +522,56 @@ class ct {
|
|
|
359
522
|
setAudioTrack(e) {
|
|
360
523
|
this.store.setState({ currentAudioTrack: e }), this.events.emit("audio-track-request", e);
|
|
361
524
|
}
|
|
362
|
-
|
|
363
|
-
this.
|
|
525
|
+
setControlsVisible(e) {
|
|
526
|
+
this.store.get().controlsVisible !== e && (this.store.setState({ controlsVisible: e }), this.emit("control", e));
|
|
527
|
+
}
|
|
528
|
+
async toggleFullscreen() {
|
|
529
|
+
if (this.container)
|
|
530
|
+
try {
|
|
531
|
+
document.fullscreenElement ? await document.exitFullscreen() : await this.container.requestFullscreen();
|
|
532
|
+
} catch (e) {
|
|
533
|
+
console.error("Fullscreen toggle failed", e);
|
|
534
|
+
}
|
|
364
535
|
}
|
|
365
536
|
togglePip() {
|
|
366
537
|
document.pictureInPictureElement ? document.exitPictureInPicture() : this.video !== document.pictureInPictureElement && this.video.requestPictureInPicture && this.video.requestPictureInPicture();
|
|
367
538
|
}
|
|
539
|
+
screenshot() {
|
|
540
|
+
const e = document.createElement("canvas");
|
|
541
|
+
e.width = this.video.videoWidth, e.height = this.video.videoHeight;
|
|
542
|
+
const i = e.getContext("2d");
|
|
543
|
+
if (i) {
|
|
544
|
+
i.drawImage(this.video, 0, 0, e.width, e.height);
|
|
545
|
+
try {
|
|
546
|
+
const r = e.toDataURL("image/png"), n = document.createElement("a");
|
|
547
|
+
n.download = `screenshot-${(/* @__PURE__ */ new Date()).toISOString()}.png`, n.href = r, n.click(), this.notify({ type: "success", message: "Screenshot saved", duration: 2e3 });
|
|
548
|
+
} catch {
|
|
549
|
+
this.notify({ type: "error", message: "Failed to take screenshot", duration: 3e3 });
|
|
550
|
+
}
|
|
551
|
+
}
|
|
552
|
+
}
|
|
553
|
+
toggleLock() {
|
|
554
|
+
this.store.setState((e) => ({ isLocked: !e.isLocked }));
|
|
555
|
+
}
|
|
556
|
+
toggleLoop() {
|
|
557
|
+
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 });
|
|
558
|
+
}
|
|
559
|
+
setFlip(e) {
|
|
560
|
+
const i = this.store.get().flipState, r = {
|
|
561
|
+
...i,
|
|
562
|
+
[e]: !i[e]
|
|
563
|
+
};
|
|
564
|
+
this.store.setState({ flipState: r });
|
|
565
|
+
const n = r.horizontal ? -1 : 1, d = r.vertical ? -1 : 1;
|
|
566
|
+
this.video.style.transform = `scale(${n}, ${d})`;
|
|
567
|
+
}
|
|
568
|
+
setAspectRatio(e) {
|
|
569
|
+
if (this.store.setState({ aspectRatio: e }), e === "default") {
|
|
570
|
+
this.video.style.objectFit = this.store.get().isAutoSized ? "cover" : "contain", this.video.style.width = "100%", this.video.style.height = "100%";
|
|
571
|
+
return;
|
|
572
|
+
}
|
|
573
|
+
this.video.style.objectFit = "contain", this.notify({ type: "info", message: `Aspect Ratio: ${e} (CSS support limited)`, duration: 2e3 });
|
|
574
|
+
}
|
|
368
575
|
initCast() {
|
|
369
576
|
const e = window, i = () => {
|
|
370
577
|
if (!this.castInitialized)
|
|
@@ -373,12 +580,12 @@ class ct {
|
|
|
373
580
|
receiverApplicationId: e.chrome.cast.media.DEFAULT_MEDIA_RECEIVER_APP_ID,
|
|
374
581
|
autoJoinPolicy: e.chrome.cast.AutoJoinPolicy.ORIGIN_SCOPED
|
|
375
582
|
}), this.castInitialized = !0);
|
|
376
|
-
} catch (
|
|
377
|
-
console.warn("Cast Init Error or already initialized",
|
|
583
|
+
} catch (r) {
|
|
584
|
+
console.warn("Cast Init Error or already initialized", r);
|
|
378
585
|
}
|
|
379
586
|
};
|
|
380
|
-
e.cast && e.cast.framework ? i() : e.__onGCastApiAvailable = (
|
|
381
|
-
|
|
587
|
+
e.cast && e.cast.framework ? i() : e.__onGCastApiAvailable = (r) => {
|
|
588
|
+
r && i();
|
|
382
589
|
};
|
|
383
590
|
}
|
|
384
591
|
requestCast() {
|
|
@@ -401,10 +608,10 @@ class ct {
|
|
|
401
608
|
try {
|
|
402
609
|
const i = e.cast.framework.CastContext.getInstance().getCurrentSession();
|
|
403
610
|
if (!i) return;
|
|
404
|
-
const
|
|
611
|
+
const r = new e.chrome.cast.media.MediaInfo(this.currentSrc, this.currentSrc.includes(".m3u8") ? "application/x-mpegurl" : "video/mp4"), n = new e.chrome.cast.media.LoadRequest(r);
|
|
405
612
|
i.loadMedia(n).then(() => {
|
|
406
613
|
this.notify({ type: "success", message: "Casting...", duration: 3e3 });
|
|
407
|
-
}).catch((
|
|
614
|
+
}).catch((d) => console.error("Cast load error", d));
|
|
408
615
|
} catch (i) {
|
|
409
616
|
console.error("Failed to load media into Cast session", i);
|
|
410
617
|
}
|
|
@@ -415,9 +622,9 @@ class ct {
|
|
|
415
622
|
this.store.setState({ activeCues: [] });
|
|
416
623
|
return;
|
|
417
624
|
}
|
|
418
|
-
const
|
|
419
|
-
if (
|
|
420
|
-
const n = Array.from(
|
|
625
|
+
const r = Array.from(this.video.textTracks).filter((n) => n.kind === "subtitles" || n.kind === "captions")[e.currentSubtitle];
|
|
626
|
+
if (r && r.activeCues) {
|
|
627
|
+
const n = Array.from(r.activeCues).map((d) => d.text);
|
|
421
628
|
this.store.setState({ activeCues: n });
|
|
422
629
|
} else
|
|
423
630
|
this.store.setState({ activeCues: [] });
|
|
@@ -426,30 +633,30 @@ class ct {
|
|
|
426
633
|
if (Array.from(this.video.textTracks).forEach((i) => {
|
|
427
634
|
i.removeEventListener("cuechange", this.boundCueChange), i.mode = "hidden";
|
|
428
635
|
}), this.store.setState({ currentSubtitle: e, subtitleOffset: 0, activeCues: [] }), e !== -1) {
|
|
429
|
-
const
|
|
430
|
-
if (
|
|
636
|
+
const r = Array.from(this.video.textTracks).filter((n) => n.kind === "subtitles" || n.kind === "captions")[e];
|
|
637
|
+
if (r) {
|
|
431
638
|
const n = this.store.get().subtitleSettings;
|
|
432
|
-
|
|
639
|
+
r.mode = n.useNative ? "showing" : "hidden", r.addEventListener("cuechange", this.boundCueChange), this.handleCueChange();
|
|
433
640
|
}
|
|
434
641
|
}
|
|
435
642
|
}
|
|
436
643
|
updateSubtitleSettings(e) {
|
|
437
|
-
const
|
|
438
|
-
this.store.setState({ subtitleSettings:
|
|
644
|
+
const r = { ...this.store.get().subtitleSettings, ...e };
|
|
645
|
+
this.store.setState({ subtitleSettings: r }), e.useNative !== void 0 && this.setSubtitle(this.store.get().currentSubtitle);
|
|
439
646
|
}
|
|
440
647
|
resetSubtitleSettings() {
|
|
441
|
-
this.store.setState({ subtitleSettings:
|
|
648
|
+
this.store.setState({ subtitleSettings: Ne }), this.setSubtitle(this.store.get().currentSubtitle);
|
|
442
649
|
}
|
|
443
650
|
setSubtitleOffset(e) {
|
|
444
|
-
const i = this.store.get().subtitleOffset,
|
|
445
|
-
Math.abs(
|
|
446
|
-
(n.mode === "showing" || n.mode === "hidden") && n.cues && Array.from(n.cues).forEach((
|
|
447
|
-
|
|
651
|
+
const i = this.store.get().subtitleOffset, r = e - i;
|
|
652
|
+
Math.abs(r) < 1e-3 || (Array.from(this.video.textTracks).forEach((n) => {
|
|
653
|
+
(n.mode === "showing" || n.mode === "hidden") && n.cues && Array.from(n.cues).forEach((d) => {
|
|
654
|
+
d.startTime += r, d.endTime += r;
|
|
448
655
|
});
|
|
449
656
|
}), this.store.setState({ subtitleOffset: e }), this.notify({ type: "info", message: `Subtitle Offset: ${e > 0 ? "+" : ""}${e.toFixed(1)}s`, duration: 1500 }));
|
|
450
657
|
}
|
|
451
658
|
async download() {
|
|
452
|
-
var
|
|
659
|
+
var r;
|
|
453
660
|
if (!this.video.src) return;
|
|
454
661
|
const e = this.video.src;
|
|
455
662
|
if (e.includes("blob:") || e.includes(".m3u8")) {
|
|
@@ -460,30 +667,30 @@ class ct {
|
|
|
460
667
|
try {
|
|
461
668
|
const n = await this.fetchWithRetry(e);
|
|
462
669
|
if (!n.body) throw new Error("No body");
|
|
463
|
-
const
|
|
464
|
-
let
|
|
465
|
-
const
|
|
670
|
+
const d = n.body.getReader(), m = n.headers.get("Content-Length"), b = m ? parseInt(m, 10) : 0;
|
|
671
|
+
let y = 0;
|
|
672
|
+
const l = [];
|
|
466
673
|
for (; ; ) {
|
|
467
|
-
const { done:
|
|
468
|
-
if (
|
|
469
|
-
if (
|
|
470
|
-
const
|
|
471
|
-
this.notify({ id: i, type: "loading", message: `Downloading... ${
|
|
674
|
+
const { done: M, value: I } = await d.read();
|
|
675
|
+
if (M) break;
|
|
676
|
+
if (l.push(I), y += I.length, b) {
|
|
677
|
+
const p = Math.round(y / b * 100);
|
|
678
|
+
this.notify({ id: i, type: "loading", message: `Downloading... ${p}%`, progress: p });
|
|
472
679
|
}
|
|
473
680
|
}
|
|
474
|
-
const
|
|
475
|
-
|
|
681
|
+
const v = new Blob(l), C = window.URL.createObjectURL(v), N = document.createElement("a");
|
|
682
|
+
N.style.display = "none", N.href = C, N.download = ((r = e.split("/").pop()) == null ? void 0 : r.split("?")[0]) || "video.mp4", document.body.appendChild(N), N.click(), window.URL.revokeObjectURL(C), document.body.removeChild(N), this.notify({ id: i, type: "success", message: "Saved!", duration: 3e3 });
|
|
476
683
|
} catch {
|
|
477
684
|
this.notify({ id: i, type: "error", message: "Download failed.", duration: 4e3 }), window.open(e, "_blank");
|
|
478
685
|
}
|
|
479
686
|
}
|
|
480
687
|
notify(e) {
|
|
481
|
-
const i = e.id || Math.random().toString(36).substr(2, 9),
|
|
482
|
-
return this.store.setState({ notifications: [
|
|
688
|
+
const i = e.id || Math.random().toString(36).substr(2, 9), r = { ...e, id: i };
|
|
689
|
+
return this.store.setState({ notifications: [r] }), e.duration && setTimeout(() => this.removeNotification(i), e.duration), i;
|
|
483
690
|
}
|
|
484
691
|
removeNotification(e) {
|
|
485
692
|
const i = this.store.get().notifications;
|
|
486
|
-
this.store.setState({ notifications: i.filter((
|
|
693
|
+
this.store.setState({ notifications: i.filter((r) => r.id !== e) });
|
|
487
694
|
}
|
|
488
695
|
setAppearance(e) {
|
|
489
696
|
this.store.setState((i) => ({
|
|
@@ -492,72 +699,72 @@ class ct {
|
|
|
492
699
|
}));
|
|
493
700
|
}
|
|
494
701
|
destroy() {
|
|
495
|
-
this.retryTimer && clearTimeout(this.retryTimer), document.removeEventListener("fullscreenchange", this.boundFullscreenChange), this.video.pause(), this.video.src = "";
|
|
702
|
+
this.retryTimer && clearTimeout(this.retryTimer), this.resizeObserver && (this.resizeObserver.disconnect(), this.resizeObserver = null), document.removeEventListener("fullscreenchange", this.boundFullscreenChange), this.video.pause(), this.video.src = "";
|
|
496
703
|
const e = this.video.getElementsByTagName("track");
|
|
497
704
|
for (; e.length > 0; ) e[0].remove();
|
|
498
|
-
this.events.destroy(), this.store.destroy(), this.plugins.forEach((i) => i.destroy && i.destroy()), this.plugins.clear(), this.video.remove(), this.audioEngine.destroy();
|
|
705
|
+
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();
|
|
499
706
|
}
|
|
500
707
|
}
|
|
501
|
-
const
|
|
502
|
-
if (isNaN(
|
|
503
|
-
const e = Math.floor(
|
|
504
|
-
return e > 0 ? `${e}:${i.toString().padStart(2, "0")}:${
|
|
505
|
-
},
|
|
708
|
+
const xe = (o) => {
|
|
709
|
+
if (isNaN(o)) return "00:00";
|
|
710
|
+
const e = Math.floor(o / 3600), i = Math.floor(o % 3600 / 60), r = Math.floor(o % 60);
|
|
711
|
+
return e > 0 ? `${e}:${i.toString().padStart(2, "0")}:${r.toString().padStart(2, "0")}` : `${i}:${r.toString().padStart(2, "0")}`;
|
|
712
|
+
}, Xt = async (o, e = 3) => {
|
|
506
713
|
for (let i = 0; i < e; i++)
|
|
507
714
|
try {
|
|
508
|
-
const
|
|
509
|
-
if (!
|
|
510
|
-
return await
|
|
511
|
-
} catch (
|
|
512
|
-
if (i === e - 1) throw
|
|
715
|
+
const r = await fetch(o);
|
|
716
|
+
if (!r.ok) throw new Error(`HTTP ${r.status}`);
|
|
717
|
+
return await r.text();
|
|
718
|
+
} catch (r) {
|
|
719
|
+
if (i === e - 1) throw r;
|
|
513
720
|
await new Promise((n) => setTimeout(n, 1e3));
|
|
514
721
|
}
|
|
515
722
|
throw new Error("Failed");
|
|
516
|
-
},
|
|
723
|
+
}, Jt = async (o, e) => {
|
|
517
724
|
try {
|
|
518
|
-
const
|
|
725
|
+
const r = (await Xt(o)).split(`
|
|
519
726
|
`), n = [];
|
|
520
|
-
let
|
|
521
|
-
const b =
|
|
522
|
-
const
|
|
523
|
-
let
|
|
524
|
-
return
|
|
727
|
+
let d = null, m = null;
|
|
728
|
+
const b = o.substring(0, o.lastIndexOf("/") + 1), y = (l) => {
|
|
729
|
+
const v = l.split(":");
|
|
730
|
+
let C = 0;
|
|
731
|
+
return v.length === 3 ? (C += parseFloat(v[0]) * 3600, C += parseFloat(v[1]) * 60, C += parseFloat(v[2])) : (C += parseFloat(v[0]) * 60, C += parseFloat(v[1])), C;
|
|
525
732
|
};
|
|
526
|
-
for (let
|
|
527
|
-
if (
|
|
528
|
-
const
|
|
529
|
-
|
|
530
|
-
} else if (
|
|
531
|
-
let [
|
|
532
|
-
!
|
|
533
|
-
let
|
|
534
|
-
if (
|
|
535
|
-
const
|
|
536
|
-
|
|
733
|
+
for (let l of r)
|
|
734
|
+
if (l = l.trim(), l.includes("-->")) {
|
|
735
|
+
const v = l.split("-->");
|
|
736
|
+
d = y(v[0].trim()), m = y(v[1].trim());
|
|
737
|
+
} else if (d !== null && m !== null && l.length > 0) {
|
|
738
|
+
let [v, C] = l.split("#");
|
|
739
|
+
!v.match(/^https?:\/\//) && !v.startsWith("data:") && (v = b + v);
|
|
740
|
+
let N = 0, M = 0, I = 0, p = 0;
|
|
741
|
+
if (C && C.startsWith("xywh=")) {
|
|
742
|
+
const E = C.replace("xywh=", "").split(",");
|
|
743
|
+
E.length === 4 && (N = parseInt(E[0]), M = parseInt(E[1]), I = parseInt(E[2]), p = parseInt(E[3]));
|
|
537
744
|
}
|
|
538
|
-
|
|
745
|
+
I > 0 && p > 0 && n.push({ start: d, end: m, url: v, x: N, y: M, w: I, h: p }), d = null, m = null;
|
|
539
746
|
}
|
|
540
747
|
return n;
|
|
541
748
|
} catch {
|
|
542
749
|
return e({ type: "warning", message: "Failed to load thumbnails", duration: 4e3 }), [];
|
|
543
750
|
}
|
|
544
|
-
},
|
|
545
|
-
const [i,
|
|
546
|
-
return
|
|
547
|
-
if (
|
|
548
|
-
|
|
751
|
+
}, nt = (o, e = 200) => {
|
|
752
|
+
const [i, r] = k(o), [n, d] = k(!1);
|
|
753
|
+
return P(() => {
|
|
754
|
+
if (o)
|
|
755
|
+
r(!0), requestAnimationFrame(() => {
|
|
549
756
|
requestAnimationFrame(() => {
|
|
550
|
-
|
|
757
|
+
d(!0);
|
|
551
758
|
});
|
|
552
759
|
});
|
|
553
760
|
else {
|
|
554
|
-
|
|
555
|
-
const
|
|
556
|
-
|
|
761
|
+
d(!1);
|
|
762
|
+
const m = setTimeout(() => {
|
|
763
|
+
r(!1);
|
|
557
764
|
}, e);
|
|
558
|
-
return () => clearTimeout(
|
|
765
|
+
return () => clearTimeout(m);
|
|
559
766
|
}
|
|
560
|
-
}, [
|
|
767
|
+
}, [o, e]), { isMounted: i, isVisible: n };
|
|
561
768
|
};
|
|
562
769
|
/**
|
|
563
770
|
* @license lucide-react v0.462.0 - ISC
|
|
@@ -565,14 +772,14 @@ const se = (c) => {
|
|
|
565
772
|
* This source code is licensed under the ISC license.
|
|
566
773
|
* See the LICENSE file in the root directory of this source tree.
|
|
567
774
|
*/
|
|
568
|
-
const
|
|
775
|
+
const Kt = (o) => o.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase(), vt = (...o) => o.filter((e, i, r) => !!e && e.trim() !== "" && r.indexOf(e) === i).join(" ").trim();
|
|
569
776
|
/**
|
|
570
777
|
* @license lucide-react v0.462.0 - ISC
|
|
571
778
|
*
|
|
572
779
|
* This source code is licensed under the ISC license.
|
|
573
780
|
* See the LICENSE file in the root directory of this source tree.
|
|
574
781
|
*/
|
|
575
|
-
var
|
|
782
|
+
var Yt = {
|
|
576
783
|
xmlns: "http://www.w3.org/2000/svg",
|
|
577
784
|
width: 24,
|
|
578
785
|
height: 24,
|
|
@@ -589,31 +796,31 @@ var mt = {
|
|
|
589
796
|
* This source code is licensed under the ISC license.
|
|
590
797
|
* See the LICENSE file in the root directory of this source tree.
|
|
591
798
|
*/
|
|
592
|
-
const
|
|
799
|
+
const Zt = ft(
|
|
593
800
|
({
|
|
594
|
-
color:
|
|
801
|
+
color: o = "currentColor",
|
|
595
802
|
size: e = 24,
|
|
596
803
|
strokeWidth: i = 2,
|
|
597
|
-
absoluteStrokeWidth:
|
|
804
|
+
absoluteStrokeWidth: r,
|
|
598
805
|
className: n = "",
|
|
599
|
-
children:
|
|
600
|
-
iconNode:
|
|
806
|
+
children: d,
|
|
807
|
+
iconNode: m,
|
|
601
808
|
...b
|
|
602
|
-
},
|
|
809
|
+
}, y) => ke(
|
|
603
810
|
"svg",
|
|
604
811
|
{
|
|
605
|
-
ref:
|
|
606
|
-
...
|
|
812
|
+
ref: y,
|
|
813
|
+
...Yt,
|
|
607
814
|
width: e,
|
|
608
815
|
height: e,
|
|
609
|
-
stroke:
|
|
610
|
-
strokeWidth:
|
|
611
|
-
className:
|
|
816
|
+
stroke: o,
|
|
817
|
+
strokeWidth: r ? Number(i) * 24 / Number(e) : i,
|
|
818
|
+
className: vt("lucide", n),
|
|
612
819
|
...b
|
|
613
820
|
},
|
|
614
821
|
[
|
|
615
|
-
...
|
|
616
|
-
...Array.isArray(
|
|
822
|
+
...m.map(([l, v]) => ke(l, v)),
|
|
823
|
+
...Array.isArray(d) ? d : [d]
|
|
617
824
|
]
|
|
618
825
|
)
|
|
619
826
|
);
|
|
@@ -623,16 +830,16 @@ const pt = Fe(
|
|
|
623
830
|
* This source code is licensed under the ISC license.
|
|
624
831
|
* See the LICENSE file in the root directory of this source tree.
|
|
625
832
|
*/
|
|
626
|
-
const
|
|
627
|
-
const i =
|
|
628
|
-
({ className:
|
|
629
|
-
ref:
|
|
833
|
+
const x = (o, e) => {
|
|
834
|
+
const i = ft(
|
|
835
|
+
({ className: r, ...n }, d) => ke(Zt, {
|
|
836
|
+
ref: d,
|
|
630
837
|
iconNode: e,
|
|
631
|
-
className:
|
|
838
|
+
className: vt(`lucide-${Kt(o)}`, r),
|
|
632
839
|
...n
|
|
633
840
|
})
|
|
634
841
|
);
|
|
635
|
-
return i.displayName = `${
|
|
842
|
+
return i.displayName = `${o}`, i;
|
|
636
843
|
};
|
|
637
844
|
/**
|
|
638
845
|
* @license lucide-react v0.462.0 - ISC
|
|
@@ -640,7 +847,7 @@ const v = (c, e) => {
|
|
|
640
847
|
* This source code is licensed under the ISC license.
|
|
641
848
|
* See the LICENSE file in the root directory of this source tree.
|
|
642
849
|
*/
|
|
643
|
-
const
|
|
850
|
+
const ei = x("ArrowLeft", [
|
|
644
851
|
["path", { d: "m12 19-7-7 7-7", key: "1l729n" }],
|
|
645
852
|
["path", { d: "M19 12H5", key: "x3x0zl" }]
|
|
646
853
|
]);
|
|
@@ -650,7 +857,7 @@ const ft = v("ArrowLeft", [
|
|
|
650
857
|
* This source code is licensed under the ISC license.
|
|
651
858
|
* See the LICENSE file in the root directory of this source tree.
|
|
652
859
|
*/
|
|
653
|
-
const
|
|
860
|
+
const ti = x("Bold", [
|
|
654
861
|
[
|
|
655
862
|
"path",
|
|
656
863
|
{ d: "M6 12h9a4 4 0 0 1 0 8H7a1 1 0 0 1-1-1V5a1 1 0 0 1 1-1h7a4 4 0 0 1 0 8", key: "mg9rjx" }
|
|
@@ -662,7 +869,23 @@ const vt = v("Bold", [
|
|
|
662
869
|
* This source code is licensed under the ISC license.
|
|
663
870
|
* See the LICENSE file in the root directory of this source tree.
|
|
664
871
|
*/
|
|
665
|
-
const
|
|
872
|
+
const ii = x("Camera", [
|
|
873
|
+
[
|
|
874
|
+
"path",
|
|
875
|
+
{
|
|
876
|
+
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",
|
|
877
|
+
key: "1tc9qg"
|
|
878
|
+
}
|
|
879
|
+
],
|
|
880
|
+
["circle", { cx: "12", cy: "13", r: "3", key: "1vg3eu" }]
|
|
881
|
+
]);
|
|
882
|
+
/**
|
|
883
|
+
* @license lucide-react v0.462.0 - ISC
|
|
884
|
+
*
|
|
885
|
+
* This source code is licensed under the ISC license.
|
|
886
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
887
|
+
*/
|
|
888
|
+
const si = x("Captions", [
|
|
666
889
|
["rect", { width: "18", height: "14", x: "3", y: "5", rx: "2", ry: "2", key: "12ruh7" }],
|
|
667
890
|
["path", { d: "M7 15h4M15 15h2M7 11h2M13 11h4", key: "1ueiar" }]
|
|
668
891
|
]);
|
|
@@ -672,7 +895,7 @@ const bt = v("Captions", [
|
|
|
672
895
|
* This source code is licensed under the ISC license.
|
|
673
896
|
* See the LICENSE file in the root directory of this source tree.
|
|
674
897
|
*/
|
|
675
|
-
const
|
|
898
|
+
const ri = x("CaseUpper", [
|
|
676
899
|
["path", { d: "m3 15 4-8 4 8", key: "1vwr6u" }],
|
|
677
900
|
["path", { d: "M4 13h6", key: "1r9ots" }],
|
|
678
901
|
["path", { d: "M15 11h4.5a2 2 0 0 1 0 4H15V7h4a2 2 0 0 1 0 4", key: "1sqfas" }]
|
|
@@ -683,7 +906,7 @@ const gt = v("CaseUpper", [
|
|
|
683
906
|
* This source code is licensed under the ISC license.
|
|
684
907
|
* See the LICENSE file in the root directory of this source tree.
|
|
685
908
|
*/
|
|
686
|
-
const
|
|
909
|
+
const ni = x("Cast", [
|
|
687
910
|
["path", { d: "M2 8V6a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2h-6", key: "3zrzxg" }],
|
|
688
911
|
["path", { d: "M2 12a9 9 0 0 1 8 8", key: "g6cvee" }],
|
|
689
912
|
["path", { d: "M2 16a5 5 0 0 1 4 4", key: "1y1dii" }],
|
|
@@ -695,14 +918,14 @@ const yt = v("Cast", [
|
|
|
695
918
|
* This source code is licensed under the ISC license.
|
|
696
919
|
* See the LICENSE file in the root directory of this source tree.
|
|
697
920
|
*/
|
|
698
|
-
const
|
|
921
|
+
const ai = x("Check", [["path", { d: "M20 6 9 17l-5-5", key: "1gmf2c" }]]);
|
|
699
922
|
/**
|
|
700
923
|
* @license lucide-react v0.462.0 - ISC
|
|
701
924
|
*
|
|
702
925
|
* This source code is licensed under the ISC license.
|
|
703
926
|
* See the LICENSE file in the root directory of this source tree.
|
|
704
927
|
*/
|
|
705
|
-
const
|
|
928
|
+
const oi = x("Clock", [
|
|
706
929
|
["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
|
|
707
930
|
["polyline", { points: "12 6 12 12 16 14", key: "68esgv" }]
|
|
708
931
|
]);
|
|
@@ -712,7 +935,7 @@ const wt = v("Clock", [
|
|
|
712
935
|
* This source code is licensed under the ISC license.
|
|
713
936
|
* See the LICENSE file in the root directory of this source tree.
|
|
714
937
|
*/
|
|
715
|
-
const
|
|
938
|
+
const li = x("Download", [
|
|
716
939
|
["path", { d: "M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4", key: "ih7n3h" }],
|
|
717
940
|
["polyline", { points: "7 10 12 15 17 10", key: "2ggqvy" }],
|
|
718
941
|
["line", { x1: "12", x2: "12", y1: "15", y2: "3", key: "1vk2je" }]
|
|
@@ -723,7 +946,7 @@ const kt = v("Download", [
|
|
|
723
946
|
* This source code is licensed under the ISC license.
|
|
724
947
|
* See the LICENSE file in the root directory of this source tree.
|
|
725
948
|
*/
|
|
726
|
-
const
|
|
949
|
+
const ci = x("Droplet", [
|
|
727
950
|
[
|
|
728
951
|
"path",
|
|
729
952
|
{
|
|
@@ -738,7 +961,7 @@ const Ct = v("Droplet", [
|
|
|
738
961
|
* This source code is licensed under the ISC license.
|
|
739
962
|
* See the LICENSE file in the root directory of this source tree.
|
|
740
963
|
*/
|
|
741
|
-
const
|
|
964
|
+
const di = x("Eye", [
|
|
742
965
|
[
|
|
743
966
|
"path",
|
|
744
967
|
{
|
|
@@ -754,7 +977,18 @@ const Nt = v("Eye", [
|
|
|
754
977
|
* This source code is licensed under the ISC license.
|
|
755
978
|
* See the LICENSE file in the root directory of this source tree.
|
|
756
979
|
*/
|
|
757
|
-
const
|
|
980
|
+
const ui = x("Info", [
|
|
981
|
+
["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
|
|
982
|
+
["path", { d: "M12 16v-4", key: "1dtifu" }],
|
|
983
|
+
["path", { d: "M12 8h.01", key: "e9boi3" }]
|
|
984
|
+
]);
|
|
985
|
+
/**
|
|
986
|
+
* @license lucide-react v0.462.0 - ISC
|
|
987
|
+
*
|
|
988
|
+
* This source code is licensed under the ISC license.
|
|
989
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
990
|
+
*/
|
|
991
|
+
const hi = x("LoaderCircle", [
|
|
758
992
|
["path", { d: "M21 12a9 9 0 1 1-6.219-8.56", key: "13zald" }]
|
|
759
993
|
]);
|
|
760
994
|
/**
|
|
@@ -763,7 +997,27 @@ const St = v("LoaderCircle", [
|
|
|
763
997
|
* This source code is licensed under the ISC license.
|
|
764
998
|
* See the LICENSE file in the root directory of this source tree.
|
|
765
999
|
*/
|
|
766
|
-
const
|
|
1000
|
+
const mi = x("LockOpen", [
|
|
1001
|
+
["rect", { width: "18", height: "11", x: "3", y: "11", rx: "2", ry: "2", key: "1w4ew1" }],
|
|
1002
|
+
["path", { d: "M7 11V7a5 5 0 0 1 9.9-1", key: "1mm8w8" }]
|
|
1003
|
+
]);
|
|
1004
|
+
/**
|
|
1005
|
+
* @license lucide-react v0.462.0 - ISC
|
|
1006
|
+
*
|
|
1007
|
+
* This source code is licensed under the ISC license.
|
|
1008
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
1009
|
+
*/
|
|
1010
|
+
const fi = x("Lock", [
|
|
1011
|
+
["rect", { width: "18", height: "11", x: "3", y: "11", rx: "2", ry: "2", key: "1w4ew1" }],
|
|
1012
|
+
["path", { d: "M7 11V7a5 5 0 0 1 10 0v4", key: "fwvmzm" }]
|
|
1013
|
+
]);
|
|
1014
|
+
/**
|
|
1015
|
+
* @license lucide-react v0.462.0 - ISC
|
|
1016
|
+
*
|
|
1017
|
+
* This source code is licensed under the ISC license.
|
|
1018
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
1019
|
+
*/
|
|
1020
|
+
const pi = x("Maximize", [
|
|
767
1021
|
["path", { d: "M8 3H5a2 2 0 0 0-2 2v3", key: "1dcmit" }],
|
|
768
1022
|
["path", { d: "M21 8V5a2 2 0 0 0-2-2h-3", key: "1e4gt3" }],
|
|
769
1023
|
["path", { d: "M3 16v3a2 2 0 0 0 2 2h3", key: "wsl5sc" }],
|
|
@@ -775,7 +1029,7 @@ const zt = v("Maximize", [
|
|
|
775
1029
|
* This source code is licensed under the ISC license.
|
|
776
1030
|
* See the LICENSE file in the root directory of this source tree.
|
|
777
1031
|
*/
|
|
778
|
-
const
|
|
1032
|
+
const bi = x("Minimize", [
|
|
779
1033
|
["path", { d: "M8 3v3a2 2 0 0 1-2 2H3", key: "hohbtr" }],
|
|
780
1034
|
["path", { d: "M21 8h-3a2 2 0 0 1-2-2V3", key: "5jw1f3" }],
|
|
781
1035
|
["path", { d: "M3 16h3a2 2 0 0 1 2 2v3", key: "198tvr" }],
|
|
@@ -787,14 +1041,25 @@ const Tt = v("Minimize", [
|
|
|
787
1041
|
* This source code is licensed under the ISC license.
|
|
788
1042
|
* See the LICENSE file in the root directory of this source tree.
|
|
789
1043
|
*/
|
|
790
|
-
const
|
|
1044
|
+
const vi = x("Minus", [["path", { d: "M5 12h14", key: "1ays0h" }]]);
|
|
1045
|
+
/**
|
|
1046
|
+
* @license lucide-react v0.462.0 - ISC
|
|
1047
|
+
*
|
|
1048
|
+
* This source code is licensed under the ISC license.
|
|
1049
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
1050
|
+
*/
|
|
1051
|
+
const gi = x("Monitor", [
|
|
1052
|
+
["rect", { width: "20", height: "14", x: "2", y: "3", rx: "2", key: "48i651" }],
|
|
1053
|
+
["line", { x1: "8", x2: "16", y1: "21", y2: "21", key: "1svkeh" }],
|
|
1054
|
+
["line", { x1: "12", x2: "12", y1: "17", y2: "21", key: "vw1qmm" }]
|
|
1055
|
+
]);
|
|
791
1056
|
/**
|
|
792
1057
|
* @license lucide-react v0.462.0 - ISC
|
|
793
1058
|
*
|
|
794
1059
|
* This source code is licensed under the ISC license.
|
|
795
1060
|
* See the LICENSE file in the root directory of this source tree.
|
|
796
1061
|
*/
|
|
797
|
-
const
|
|
1062
|
+
const xi = x("MoveVertical", [
|
|
798
1063
|
["path", { d: "M12 2v20", key: "t6zp3m" }],
|
|
799
1064
|
["path", { d: "m8 18 4 4 4-4", key: "bh5tu3" }],
|
|
800
1065
|
["path", { d: "m8 6 4-4 4 4", key: "ybng9g" }]
|
|
@@ -805,7 +1070,7 @@ const Et = v("MoveVertical", [
|
|
|
805
1070
|
* This source code is licensed under the ISC license.
|
|
806
1071
|
* See the LICENSE file in the root directory of this source tree.
|
|
807
1072
|
*/
|
|
808
|
-
const
|
|
1073
|
+
const yi = x("Palette", [
|
|
809
1074
|
["circle", { cx: "13.5", cy: "6.5", r: ".5", fill: "currentColor", key: "1okk4w" }],
|
|
810
1075
|
["circle", { cx: "17.5", cy: "10.5", r: ".5", fill: "currentColor", key: "f64h9f" }],
|
|
811
1076
|
["circle", { cx: "8.5", cy: "7.5", r: ".5", fill: "currentColor", key: "fotxhn" }],
|
|
@@ -824,7 +1089,7 @@ const It = v("Palette", [
|
|
|
824
1089
|
* This source code is licensed under the ISC license.
|
|
825
1090
|
* See the LICENSE file in the root directory of this source tree.
|
|
826
1091
|
*/
|
|
827
|
-
const
|
|
1092
|
+
const wi = x("Pause", [
|
|
828
1093
|
["rect", { x: "14", y: "4", width: "4", height: "16", rx: "1", key: "zuxfzm" }],
|
|
829
1094
|
["rect", { x: "6", y: "4", width: "4", height: "16", rx: "1", key: "1okwgv" }]
|
|
830
1095
|
]);
|
|
@@ -834,7 +1099,7 @@ const Rt = v("Pause", [
|
|
|
834
1099
|
* This source code is licensed under the ISC license.
|
|
835
1100
|
* See the LICENSE file in the root directory of this source tree.
|
|
836
1101
|
*/
|
|
837
|
-
const
|
|
1102
|
+
const ki = x("PictureInPicture", [
|
|
838
1103
|
[
|
|
839
1104
|
"path",
|
|
840
1105
|
{
|
|
@@ -850,7 +1115,7 @@ const $t = v("PictureInPicture", [
|
|
|
850
1115
|
* This source code is licensed under the ISC license.
|
|
851
1116
|
* See the LICENSE file in the root directory of this source tree.
|
|
852
1117
|
*/
|
|
853
|
-
const
|
|
1118
|
+
const Ci = x("Play", [
|
|
854
1119
|
["polygon", { points: "6 3 20 12 6 21 6 3", key: "1oa8hb" }]
|
|
855
1120
|
]);
|
|
856
1121
|
/**
|
|
@@ -859,7 +1124,7 @@ const Pt = v("Play", [
|
|
|
859
1124
|
* This source code is licensed under the ISC license.
|
|
860
1125
|
* See the LICENSE file in the root directory of this source tree.
|
|
861
1126
|
*/
|
|
862
|
-
const
|
|
1127
|
+
const Ni = x("Plus", [
|
|
863
1128
|
["path", { d: "M5 12h14", key: "1ays0h" }],
|
|
864
1129
|
["path", { d: "M12 5v14", key: "s699le" }]
|
|
865
1130
|
]);
|
|
@@ -869,7 +1134,7 @@ const Lt = v("Plus", [
|
|
|
869
1134
|
* This source code is licensed under the ISC license.
|
|
870
1135
|
* See the LICENSE file in the root directory of this source tree.
|
|
871
1136
|
*/
|
|
872
|
-
const
|
|
1137
|
+
const Si = x("RefreshCcw", [
|
|
873
1138
|
["path", { d: "M21 12a9 9 0 0 0-9-9 9.75 9.75 0 0 0-6.74 2.74L3 8", key: "14sxne" }],
|
|
874
1139
|
["path", { d: "M3 3v5h5", key: "1xhq8a" }],
|
|
875
1140
|
["path", { d: "M3 12a9 9 0 0 0 9 9 9.75 9.75 0 0 0 6.74-2.74L21 16", key: "1hlbsb" }],
|
|
@@ -881,7 +1146,7 @@ const At = v("RefreshCcw", [
|
|
|
881
1146
|
* This source code is licensed under the ISC license.
|
|
882
1147
|
* See the LICENSE file in the root directory of this source tree.
|
|
883
1148
|
*/
|
|
884
|
-
const
|
|
1149
|
+
const zi = x("RotateCcw", [
|
|
885
1150
|
["path", { d: "M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8", key: "1357e3" }],
|
|
886
1151
|
["path", { d: "M3 3v5h5", key: "1xhq8a" }]
|
|
887
1152
|
]);
|
|
@@ -891,7 +1156,7 @@ const Bt = v("RotateCcw", [
|
|
|
891
1156
|
* This source code is licensed under the ISC license.
|
|
892
1157
|
* See the LICENSE file in the root directory of this source tree.
|
|
893
1158
|
*/
|
|
894
|
-
const
|
|
1159
|
+
const Ti = x("RotateCw", [
|
|
895
1160
|
["path", { d: "M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8", key: "1p45f6" }],
|
|
896
1161
|
["path", { d: "M21 3v5h-5", key: "1q7to0" }]
|
|
897
1162
|
]);
|
|
@@ -901,7 +1166,7 @@ const Vt = v("RotateCw", [
|
|
|
901
1166
|
* This source code is licensed under the ISC license.
|
|
902
1167
|
* See the LICENSE file in the root directory of this source tree.
|
|
903
1168
|
*/
|
|
904
|
-
const
|
|
1169
|
+
const Mi = x("Settings", [
|
|
905
1170
|
[
|
|
906
1171
|
"path",
|
|
907
1172
|
{
|
|
@@ -917,7 +1182,7 @@ const Ot = v("Settings", [
|
|
|
917
1182
|
* This source code is licensed under the ISC license.
|
|
918
1183
|
* See the LICENSE file in the root directory of this source tree.
|
|
919
1184
|
*/
|
|
920
|
-
const
|
|
1185
|
+
const Ii = x("SlidersHorizontal", [
|
|
921
1186
|
["line", { x1: "21", x2: "14", y1: "4", y2: "4", key: "obuewd" }],
|
|
922
1187
|
["line", { x1: "10", x2: "3", y1: "4", y2: "4", key: "1q6298" }],
|
|
923
1188
|
["line", { x1: "21", x2: "12", y1: "12", y2: "12", key: "1iu8h1" }],
|
|
@@ -934,7 +1199,7 @@ const jt = v("SlidersHorizontal", [
|
|
|
934
1199
|
* This source code is licensed under the ISC license.
|
|
935
1200
|
* See the LICENSE file in the root directory of this source tree.
|
|
936
1201
|
*/
|
|
937
|
-
const
|
|
1202
|
+
const Ri = x("Type", [
|
|
938
1203
|
["polyline", { points: "4 7 4 4 20 4 20 7", key: "1nosan" }],
|
|
939
1204
|
["line", { x1: "9", x2: "15", y1: "20", y2: "20", key: "swin9y" }],
|
|
940
1205
|
["line", { x1: "12", x2: "12", y1: "4", y2: "20", key: "1tx1rr" }]
|
|
@@ -945,7 +1210,7 @@ const Ft = v("Type", [
|
|
|
945
1210
|
* This source code is licensed under the ISC license.
|
|
946
1211
|
* See the LICENSE file in the root directory of this source tree.
|
|
947
1212
|
*/
|
|
948
|
-
const
|
|
1213
|
+
const Li = x("Upload", [
|
|
949
1214
|
["path", { d: "M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4", key: "ih7n3h" }],
|
|
950
1215
|
["polyline", { points: "17 8 12 3 7 8", key: "t8dd8p" }],
|
|
951
1216
|
["line", { x1: "12", x2: "12", y1: "3", y2: "15", key: "widbto" }]
|
|
@@ -956,7 +1221,7 @@ const qt = v("Upload", [
|
|
|
956
1221
|
* This source code is licensed under the ISC license.
|
|
957
1222
|
* See the LICENSE file in the root directory of this source tree.
|
|
958
1223
|
*/
|
|
959
|
-
const
|
|
1224
|
+
const $i = x("Users", [
|
|
960
1225
|
["path", { d: "M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2", key: "1yyitq" }],
|
|
961
1226
|
["circle", { cx: "9", cy: "7", r: "4", key: "nufk8" }],
|
|
962
1227
|
["path", { d: "M22 21v-2a4 4 0 0 0-3-3.87", key: "kshegd" }],
|
|
@@ -968,7 +1233,7 @@ const Ht = v("Users", [
|
|
|
968
1233
|
* This source code is licensed under the ISC license.
|
|
969
1234
|
* See the LICENSE file in the root directory of this source tree.
|
|
970
1235
|
*/
|
|
971
|
-
const
|
|
1236
|
+
const Pi = x("Volume1", [
|
|
972
1237
|
[
|
|
973
1238
|
"path",
|
|
974
1239
|
{
|
|
@@ -984,7 +1249,7 @@ const Dt = v("Volume1", [
|
|
|
984
1249
|
* This source code is licensed under the ISC license.
|
|
985
1250
|
* See the LICENSE file in the root directory of this source tree.
|
|
986
1251
|
*/
|
|
987
|
-
const
|
|
1252
|
+
const Ei = x("Volume2", [
|
|
988
1253
|
[
|
|
989
1254
|
"path",
|
|
990
1255
|
{
|
|
@@ -1001,7 +1266,7 @@ const Ut = v("Volume2", [
|
|
|
1001
1266
|
* This source code is licensed under the ISC license.
|
|
1002
1267
|
* See the LICENSE file in the root directory of this source tree.
|
|
1003
1268
|
*/
|
|
1004
|
-
const
|
|
1269
|
+
const Ai = x("VolumeX", [
|
|
1005
1270
|
[
|
|
1006
1271
|
"path",
|
|
1007
1272
|
{
|
|
@@ -1011,13 +1276,38 @@ const Gt = v("VolumeX", [
|
|
|
1011
1276
|
],
|
|
1012
1277
|
["line", { x1: "22", x2: "16", y1: "9", y2: "15", key: "1ewh16" }],
|
|
1013
1278
|
["line", { x1: "16", x2: "22", y1: "9", y2: "15", key: "5ykzw1" }]
|
|
1014
|
-
])
|
|
1015
|
-
|
|
1279
|
+
]);
|
|
1280
|
+
/**
|
|
1281
|
+
* @license lucide-react v0.462.0 - ISC
|
|
1282
|
+
*
|
|
1283
|
+
* This source code is licensed under the ISC license.
|
|
1284
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
1285
|
+
*/
|
|
1286
|
+
const Bi = x("X", [
|
|
1287
|
+
["path", { d: "M18 6 6 18", key: "1bl5f8" }],
|
|
1288
|
+
["path", { d: "m6 6 12 12", key: "d8bk6v" }]
|
|
1289
|
+
]);
|
|
1290
|
+
/**
|
|
1291
|
+
* @license lucide-react v0.462.0 - ISC
|
|
1292
|
+
*
|
|
1293
|
+
* This source code is licensed under the ISC license.
|
|
1294
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
1295
|
+
*/
|
|
1296
|
+
const Vi = x("Zap", [
|
|
1297
|
+
[
|
|
1298
|
+
"path",
|
|
1299
|
+
{
|
|
1300
|
+
d: "M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",
|
|
1301
|
+
key: "1xq2db"
|
|
1302
|
+
}
|
|
1303
|
+
]
|
|
1304
|
+
]), at = Ci, ot = wi, Fi = Ei, Oi = Pi, ji = Ai, Hi = pi, Wi = bi, qi = Mi, Se = ai, Di = ki, Ui = si, _i = li, Gi = Li, Qi = ei, Ce = hi, Xi = ni, Ji = $i, Ki = oi, Yi = vi, Zi = Ni, es = Ii, ts = Ri, gt = yi, is = di, ss = xi, rs = Si, ns = ti, as = ri, os = ci, ls = ii, cs = fi, ds = mi, us = gi, hs = Vi, ms = Bi, fs = ui, lt = ({ className: o }) => /* @__PURE__ */ h("div", { className: `relative flex items-center justify-center ${o}`, children: [
|
|
1305
|
+
/* @__PURE__ */ t(zi, { className: "w-full h-full", strokeWidth: 2 }),
|
|
1016
1306
|
/* @__PURE__ */ t("span", { className: "absolute inset-0 flex items-center justify-center text-[32%] font-bold select-none mt-[1px]", children: "10" })
|
|
1017
|
-
] }),
|
|
1018
|
-
/* @__PURE__ */ t(
|
|
1307
|
+
] }), ct = ({ className: o }) => /* @__PURE__ */ h("div", { className: `relative flex items-center justify-center ${o}`, children: [
|
|
1308
|
+
/* @__PURE__ */ t(Ti, { className: "w-full h-full", strokeWidth: 2 }),
|
|
1019
1309
|
/* @__PURE__ */ t("span", { className: "absolute inset-0 flex items-center justify-center text-[32%] font-bold select-none mt-[1px]", children: "10" })
|
|
1020
|
-
] }),
|
|
1310
|
+
] }), ps = ({ notifications: o }) => /* @__PURE__ */ t("div", { className: "absolute top-4 left-4 z-50 flex flex-col gap-2 pointer-events-none font-sans max-w-[85%] md:max-w-[400px]", children: o.map((e) => /* @__PURE__ */ h(
|
|
1021
1311
|
"div",
|
|
1022
1312
|
{
|
|
1023
1313
|
className: `
|
|
@@ -1027,16 +1317,16 @@ const Gt = v("VolumeX", [
|
|
|
1027
1317
|
${e.type === "warning" ? "border-amber-500/50 text-amber-100" : ""}
|
|
1028
1318
|
`,
|
|
1029
1319
|
children: [
|
|
1030
|
-
e.type === "loading" && /* @__PURE__ */ t(
|
|
1031
|
-
/* @__PURE__ */
|
|
1320
|
+
e.type === "loading" && /* @__PURE__ */ t(Ce, { className: "w-4 h-4 animate-spin text-[var(--accent)] shrink-0 mt-0.5" }),
|
|
1321
|
+
/* @__PURE__ */ h("div", { className: "flex flex-col gap-1 min-w-0", children: [
|
|
1032
1322
|
/* @__PURE__ */ t("span", { className: "break-words line-clamp-4 leading-relaxed whitespace-pre-wrap", children: e.message }),
|
|
1033
1323
|
typeof e.progress == "number" && /* @__PURE__ */ t("div", { className: "h-1 w-full bg-white/10 rounded-full overflow-hidden mt-1.5", children: /* @__PURE__ */ t("div", { className: "h-full bg-[var(--accent)] transition-all duration-300", style: { width: `${e.progress}%` } }) })
|
|
1034
1324
|
] })
|
|
1035
1325
|
]
|
|
1036
1326
|
},
|
|
1037
1327
|
e.id
|
|
1038
|
-
)) }),
|
|
1039
|
-
if (e.useNative ||
|
|
1328
|
+
)) }), bs = ({ cues: o, settings: e }) => {
|
|
1329
|
+
if (e.useNative || o.length === 0) return null;
|
|
1040
1330
|
const i = () => {
|
|
1041
1331
|
switch (e.textStyle) {
|
|
1042
1332
|
case "outline":
|
|
@@ -1058,7 +1348,7 @@ const Gt = v("VolumeX", [
|
|
|
1058
1348
|
style: {
|
|
1059
1349
|
bottom: `${e.verticalOffset}px`
|
|
1060
1350
|
},
|
|
1061
|
-
children:
|
|
1351
|
+
children: o.map((r, n) => /* @__PURE__ */ t(
|
|
1062
1352
|
"div",
|
|
1063
1353
|
{
|
|
1064
1354
|
className: "mb-1 inline-block max-w-[80%]",
|
|
@@ -1078,7 +1368,7 @@ const Gt = v("VolumeX", [
|
|
|
1078
1368
|
backgroundColor: `rgba(0, 0, 0, ${e.backgroundOpacity / 100})`,
|
|
1079
1369
|
backdropFilter: e.backgroundBlur ? `blur(${e.backgroundBlurAmount}px)` : "none"
|
|
1080
1370
|
},
|
|
1081
|
-
dangerouslySetInnerHTML: { __html:
|
|
1371
|
+
dangerouslySetInnerHTML: { __html: r }
|
|
1082
1372
|
}
|
|
1083
1373
|
)
|
|
1084
1374
|
},
|
|
@@ -1086,64 +1376,67 @@ const Gt = v("VolumeX", [
|
|
|
1086
1376
|
))
|
|
1087
1377
|
}
|
|
1088
1378
|
);
|
|
1089
|
-
},
|
|
1090
|
-
const
|
|
1379
|
+
}, xt = ({ children: o, onClose: e, align: i = "right", maxHeight: r, className: n }) => {
|
|
1380
|
+
const d = F(null), m = i === "center" ? "left-1/2 -translate-x-1/2 origin-bottom" : "right-0 origin-bottom-right", b = r ? { maxHeight: `${r}px` } : {};
|
|
1091
1381
|
return /* @__PURE__ */ t(
|
|
1092
1382
|
"div",
|
|
1093
1383
|
{
|
|
1094
|
-
className: `absolute bottom-full mb-4 ${
|
|
1384
|
+
className: `absolute bottom-full mb-4 ${m} bg-[var(--bg-panel)] backdrop-blur-xl border-[length:var(--border-width)] border-white/10 shadow-2xl overflow-hidden w-[300px] max-w-[calc(100vw-32px)] text-sm z-50 ring-1 ring-white/5 font-[family-name:var(--font-main)] flex flex-col p-1.5 transition-all duration-300 ease-out ${n}`,
|
|
1095
1385
|
style: { ...b, borderRadius: "var(--radius-lg)" },
|
|
1096
|
-
onClick: (
|
|
1097
|
-
children: /* @__PURE__ */ t("div", { className: "overflow-y-auto hide-scrollbar flex-1", style: { borderRadius: "var(--radius)" }, children: /* @__PURE__ */ t("div", { ref:
|
|
1386
|
+
onClick: (y) => y.stopPropagation(),
|
|
1387
|
+
children: /* @__PURE__ */ t("div", { className: "overflow-y-auto hide-scrollbar flex-1", style: { borderRadius: "var(--radius)" }, children: /* @__PURE__ */ t("div", { ref: d, children: o }) })
|
|
1098
1388
|
}
|
|
1099
1389
|
);
|
|
1100
|
-
},
|
|
1390
|
+
}, dt = ({ content: o, className: e }) => typeof o == "string" ? o.trim().startsWith("<") ? /* @__PURE__ */ t("span", { className: e, dangerouslySetInnerHTML: { __html: o } }) : /* @__PURE__ */ t("span", { className: e, children: o }) : /* @__PURE__ */ t("span", { className: e, children: o }), S = ({ label: o, value: e, active: i, onClick: r, hasSubmenu: n, icon: d }) => /* @__PURE__ */ h(
|
|
1101
1391
|
"button",
|
|
1102
1392
|
{
|
|
1103
|
-
onClick:
|
|
1393
|
+
onClick: r,
|
|
1104
1394
|
className: "w-full flex items-center justify-between px-3 py-2.5 hover:bg-white/10 transition-colors text-left text-zinc-200 active:bg-white/5 focus:outline-none focus:bg-white/10 group overflow-hidden my-0.5",
|
|
1105
1395
|
style: { borderRadius: "var(--radius)" },
|
|
1106
1396
|
children: [
|
|
1107
|
-
/* @__PURE__ */
|
|
1108
|
-
|
|
1109
|
-
/* @__PURE__ */ t("span", { className: `font-medium truncate text-sm ${i ? "text-[var(--accent)]" : ""}`, title:
|
|
1397
|
+
/* @__PURE__ */ h("div", { className: "flex items-center gap-3 overflow-hidden", children: [
|
|
1398
|
+
d && /* @__PURE__ */ t("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__ */ t(dt, { content: d }) }),
|
|
1399
|
+
/* @__PURE__ */ t("span", { className: `font-medium truncate text-sm flex items-center ${i ? "text-[var(--accent)]" : ""}`, title: typeof o == "string" ? o : void 0, children: /* @__PURE__ */ t(dt, { content: o }) })
|
|
1110
1400
|
] }),
|
|
1111
|
-
/* @__PURE__ */
|
|
1401
|
+
/* @__PURE__ */ h("div", { className: "flex items-center gap-2 text-zinc-400 shrink-0", children: [
|
|
1112
1402
|
e && /* @__PURE__ */ t("span", { className: "text-xs font-medium truncate max-w-[60px]", title: e, children: e }),
|
|
1113
|
-
i && /* @__PURE__ */ t(
|
|
1403
|
+
i && /* @__PURE__ */ t(Se, { className: "w-4 h-4 text-[var(--accent)] shrink-0" }),
|
|
1114
1404
|
n && /* @__PURE__ */ t("span", { className: "text-xs group-hover:translate-x-0.5 transition-transform text-zinc-500 shrink-0", children: "›" })
|
|
1115
1405
|
] })
|
|
1116
1406
|
]
|
|
1117
1407
|
}
|
|
1118
|
-
),
|
|
1408
|
+
), H = ({ label: o, onBack: e, rightAction: i }) => /* @__PURE__ */ h(
|
|
1119
1409
|
"div",
|
|
1120
1410
|
{
|
|
1121
1411
|
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",
|
|
1122
1412
|
style: { borderRadius: "var(--radius)" },
|
|
1123
1413
|
children: [
|
|
1124
|
-
/* @__PURE__ */
|
|
1414
|
+
/* @__PURE__ */ h(
|
|
1125
1415
|
"button",
|
|
1126
1416
|
{
|
|
1127
1417
|
className: "flex items-center gap-2 hover:text-white transition-colors focus:outline-none",
|
|
1128
1418
|
onClick: e,
|
|
1129
1419
|
children: [
|
|
1130
|
-
/* @__PURE__ */ t(
|
|
1131
|
-
/* @__PURE__ */ t("span", { children:
|
|
1420
|
+
/* @__PURE__ */ t(Qi, { className: "w-3 h-3" }),
|
|
1421
|
+
/* @__PURE__ */ t("span", { children: o })
|
|
1132
1422
|
]
|
|
1133
1423
|
}
|
|
1134
1424
|
),
|
|
1135
1425
|
i
|
|
1136
1426
|
]
|
|
1137
1427
|
}
|
|
1138
|
-
),
|
|
1428
|
+
), ut = () => /* @__PURE__ */ t("div", { className: "h-px bg-white/5 mx-2 my-1" }), ne = ({ content: o }) => typeof o == "string" ? o.trim().startsWith("<") ? /* @__PURE__ */ t("span", { dangerouslySetInnerHTML: { __html: o } }) : /* @__PURE__ */ t("span", { children: o }) : /* @__PURE__ */ t(R, { children: o }), X = ({ label: o, checked: e, onChange: i, icon: r, tooltip: n }) => /* @__PURE__ */ h(
|
|
1139
1429
|
"div",
|
|
1140
1430
|
{
|
|
1141
1431
|
className: "flex items-center justify-between py-2.5 px-3 hover:bg-white/5 group transition-colors",
|
|
1142
1432
|
style: { borderRadius: "var(--radius)" },
|
|
1143
1433
|
children: [
|
|
1144
|
-
/* @__PURE__ */
|
|
1145
|
-
|
|
1146
|
-
/* @__PURE__ */
|
|
1434
|
+
/* @__PURE__ */ h("div", { className: "flex items-center gap-3", children: [
|
|
1435
|
+
r && /* @__PURE__ */ t("span", { className: "text-zinc-500 group-hover:text-zinc-400 transition-colors flex items-center justify-center w-4 h-4", children: /* @__PURE__ */ t(ne, { content: r }) }),
|
|
1436
|
+
/* @__PURE__ */ h("div", { className: "flex flex-col", children: [
|
|
1437
|
+
/* @__PURE__ */ t("span", { className: "text-sm text-zinc-300 font-medium group-hover:text-white transition-colors flex items-center", children: /* @__PURE__ */ t(ne, { content: o }) }),
|
|
1438
|
+
n && /* @__PURE__ */ t("span", { className: "text-[10px] text-zinc-500", children: n })
|
|
1439
|
+
] })
|
|
1147
1440
|
] }),
|
|
1148
1441
|
/* @__PURE__ */ t(
|
|
1149
1442
|
"button",
|
|
@@ -1167,40 +1460,40 @@ const Gt = v("VolumeX", [
|
|
|
1167
1460
|
)
|
|
1168
1461
|
]
|
|
1169
1462
|
}
|
|
1170
|
-
),
|
|
1463
|
+
), re = ({ label: o, value: e, min: i, max: r, step: n, onChange: d, formatValue: m, icon: b }) => /* @__PURE__ */ h(
|
|
1171
1464
|
"div",
|
|
1172
1465
|
{
|
|
1173
1466
|
className: "py-2.5 px-3 hover:bg-white/5 group transition-colors",
|
|
1174
1467
|
style: { borderRadius: "var(--radius)" },
|
|
1175
1468
|
children: [
|
|
1176
|
-
/* @__PURE__ */
|
|
1177
|
-
/* @__PURE__ */
|
|
1178
|
-
b && /* @__PURE__ */ t("span", { className: "text-zinc-500 group-hover:text-zinc-400 transition-colors", children: b }),
|
|
1179
|
-
/* @__PURE__ */ t("span", { className: "text-xs font-bold text-zinc-400 uppercase tracking-wider group-hover:text-zinc-300 transition-colors", children:
|
|
1469
|
+
/* @__PURE__ */ h("div", { className: "flex justify-between items-center mb-2", children: [
|
|
1470
|
+
/* @__PURE__ */ h("div", { className: "flex items-center gap-3", children: [
|
|
1471
|
+
b && /* @__PURE__ */ t("span", { className: "text-zinc-500 group-hover:text-zinc-400 transition-colors flex items-center justify-center w-4 h-4", children: /* @__PURE__ */ t(ne, { content: b }) }),
|
|
1472
|
+
/* @__PURE__ */ t("span", { className: "text-xs font-bold text-zinc-400 uppercase tracking-wider group-hover:text-zinc-300 transition-colors", children: o })
|
|
1180
1473
|
] }),
|
|
1181
1474
|
/* @__PURE__ */ t(
|
|
1182
1475
|
"span",
|
|
1183
1476
|
{
|
|
1184
1477
|
className: "text-[10px] font-mono font-medium text-zinc-300 bg-white/10 px-1.5 py-0.5 tabular-nums",
|
|
1185
1478
|
style: { borderRadius: "var(--radius-sm)" },
|
|
1186
|
-
children:
|
|
1479
|
+
children: m ? m(e) : e
|
|
1187
1480
|
}
|
|
1188
1481
|
)
|
|
1189
1482
|
] }),
|
|
1190
|
-
/* @__PURE__ */
|
|
1483
|
+
/* @__PURE__ */ h("div", { className: "relative h-4 flex items-center px-1", children: [
|
|
1191
1484
|
/* @__PURE__ */ t(
|
|
1192
1485
|
"input",
|
|
1193
1486
|
{
|
|
1194
1487
|
type: "range",
|
|
1195
1488
|
min: i,
|
|
1196
|
-
max:
|
|
1489
|
+
max: r,
|
|
1197
1490
|
step: n,
|
|
1198
1491
|
value: e,
|
|
1199
|
-
onChange: (
|
|
1492
|
+
onChange: (y) => d(parseFloat(y.target.value)),
|
|
1200
1493
|
className: "w-full h-1.5 appearance-none cursor-pointer focus:outline-none focus:ring-2 strata-range-input",
|
|
1201
1494
|
style: {
|
|
1202
1495
|
borderRadius: "var(--radius-full)",
|
|
1203
|
-
background: `linear-gradient(to right, var(--accent) 0%, var(--accent) ${(e - i) / (
|
|
1496
|
+
background: `linear-gradient(to right, var(--accent) 0%, var(--accent) ${(e - i) / (r - i) * 100}%, #3f3f46 ${(e - i) / (r - i) * 100}%, #3f3f46 100%)`,
|
|
1204
1497
|
"--tw-ring-color": "var(--accent)"
|
|
1205
1498
|
}
|
|
1206
1499
|
}
|
|
@@ -1225,67 +1518,74 @@ const Gt = v("VolumeX", [
|
|
|
1225
1518
|
] })
|
|
1226
1519
|
]
|
|
1227
1520
|
}
|
|
1228
|
-
),
|
|
1521
|
+
), vs = ({ label: o, value: e, options: i, onChange: r, icon: n }) => /* @__PURE__ */ h(
|
|
1229
1522
|
"div",
|
|
1230
1523
|
{
|
|
1231
1524
|
className: "py-2.5 px-3 hover:bg-white/5 group transition-colors",
|
|
1232
1525
|
style: { borderRadius: "var(--radius)" },
|
|
1233
1526
|
children: [
|
|
1234
|
-
/* @__PURE__ */
|
|
1235
|
-
n && /* @__PURE__ */ t("span", { className: "text-zinc-500 group-hover:text-zinc-400 transition-colors", children: n }),
|
|
1236
|
-
/* @__PURE__ */ t("span", { className: "text-xs font-bold text-zinc-400 uppercase tracking-wider group-hover:text-zinc-300 transition-colors", children:
|
|
1527
|
+
/* @__PURE__ */ h("div", { className: "flex items-center gap-3 mb-2", children: [
|
|
1528
|
+
n && /* @__PURE__ */ t("span", { className: "text-zinc-500 group-hover:text-zinc-400 transition-colors flex items-center justify-center w-4 h-4", children: /* @__PURE__ */ t(ne, { content: n }) }),
|
|
1529
|
+
/* @__PURE__ */ t("span", { className: "text-xs font-bold text-zinc-400 uppercase tracking-wider group-hover:text-zinc-300 transition-colors", children: o })
|
|
1237
1530
|
] }),
|
|
1238
|
-
/* @__PURE__ */
|
|
1531
|
+
/* @__PURE__ */ h("div", { className: "relative", children: [
|
|
1239
1532
|
/* @__PURE__ */ t(
|
|
1240
1533
|
"select",
|
|
1241
1534
|
{
|
|
1242
1535
|
value: e,
|
|
1243
|
-
onChange: (
|
|
1536
|
+
onChange: (d) => r(d.target.value),
|
|
1244
1537
|
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",
|
|
1245
1538
|
style: { "--tw-ring-color": "var(--accent)", borderRadius: "var(--radius)" },
|
|
1246
|
-
children: i.map((
|
|
1539
|
+
children: i.map((d) => /* @__PURE__ */ t("option", { value: d.value, children: d.label }, d.value))
|
|
1247
1540
|
}
|
|
1248
1541
|
),
|
|
1249
1542
|
/* @__PURE__ */ t("div", { className: "absolute right-3 top-1/2 -translate-y-1/2 pointer-events-none text-zinc-400", children: /* @__PURE__ */ t("svg", { width: "10", height: "6", viewBox: "0 0 10 6", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ t("path", { d: "M1 1L5 5L9 1", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }) }) })
|
|
1250
1543
|
] })
|
|
1251
1544
|
]
|
|
1252
1545
|
}
|
|
1253
|
-
),
|
|
1254
|
-
|
|
1546
|
+
), J = ({ title: o, children: e }) => /* @__PURE__ */ h("div", { className: "py-2", children: [
|
|
1547
|
+
o && /* @__PURE__ */ t("h4", { className: "px-3 text-[10px] font-bold text-[var(--accent)] uppercase tracking-wider mb-1 mt-2", children: o }),
|
|
1255
1548
|
/* @__PURE__ */ t("div", { className: "space-y-0.5", children: e })
|
|
1256
|
-
] }),
|
|
1257
|
-
const [
|
|
1258
|
-
return /* @__PURE__ */
|
|
1259
|
-
|
|
1260
|
-
/* @__PURE__ */ t(
|
|
1261
|
-
|
|
1549
|
+
] }), gs = ({ tracks: o, current: e, onSelect: i, onUpload: r, onClose: n, settings: d, onSettingsChange: m, onReset: b, offset: y, onOffsetChange: l, maxHeight: v, animationClass: C }) => {
|
|
1550
|
+
const [N, M] = k("main"), I = F(null);
|
|
1551
|
+
return /* @__PURE__ */ h(xt, { onClose: n, align: "right", maxHeight: v, className: C, children: [
|
|
1552
|
+
N === "main" && /* @__PURE__ */ h("div", { className: "animate-in slide-in-from-left-4 fade-in duration-200", children: [
|
|
1553
|
+
/* @__PURE__ */ t(
|
|
1554
|
+
"div",
|
|
1555
|
+
{
|
|
1556
|
+
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",
|
|
1557
|
+
style: { borderRadius: "var(--radius)" },
|
|
1558
|
+
children: /* @__PURE__ */ t("span", { children: "Subtitles" })
|
|
1559
|
+
}
|
|
1560
|
+
),
|
|
1561
|
+
/* @__PURE__ */ h("div", { children: [
|
|
1262
1562
|
/* @__PURE__ */ t(
|
|
1263
|
-
|
|
1563
|
+
S,
|
|
1264
1564
|
{
|
|
1265
1565
|
label: "Upload Subtitle",
|
|
1266
|
-
icon: /* @__PURE__ */ t(
|
|
1566
|
+
icon: /* @__PURE__ */ t(Gi, { className: "w-4 h-4" }),
|
|
1267
1567
|
onClick: () => {
|
|
1268
|
-
var
|
|
1269
|
-
return (
|
|
1568
|
+
var p;
|
|
1569
|
+
return (p = I.current) == null ? void 0 : p.click();
|
|
1270
1570
|
}
|
|
1271
1571
|
}
|
|
1272
1572
|
),
|
|
1273
|
-
/* @__PURE__ */ t("input", { type: "file", accept: ".vtt,.srt", ref:
|
|
1274
|
-
var
|
|
1275
|
-
(
|
|
1573
|
+
/* @__PURE__ */ t("input", { type: "file", accept: ".vtt,.srt", ref: I, className: "hidden", onChange: (p) => {
|
|
1574
|
+
var E;
|
|
1575
|
+
(E = p.target.files) != null && E[0] && r(p.target.files[0]);
|
|
1276
1576
|
} }),
|
|
1277
1577
|
/* @__PURE__ */ t(
|
|
1278
|
-
|
|
1578
|
+
S,
|
|
1279
1579
|
{
|
|
1280
1580
|
label: "Customize",
|
|
1281
|
-
icon: /* @__PURE__ */ t(
|
|
1282
|
-
onClick: () =>
|
|
1581
|
+
icon: /* @__PURE__ */ t(es, { className: "w-4 h-4" }),
|
|
1582
|
+
onClick: () => M("customize"),
|
|
1283
1583
|
hasSubmenu: !0
|
|
1284
1584
|
}
|
|
1285
1585
|
),
|
|
1286
1586
|
/* @__PURE__ */ t("div", { className: "h-px bg-white/5 mx-2 my-1" }),
|
|
1287
1587
|
/* @__PURE__ */ t(
|
|
1288
|
-
|
|
1588
|
+
S,
|
|
1289
1589
|
{
|
|
1290
1590
|
label: "Off",
|
|
1291
1591
|
active: e === -1,
|
|
@@ -1294,129 +1594,129 @@ const Gt = v("VolumeX", [
|
|
|
1294
1594
|
}
|
|
1295
1595
|
}
|
|
1296
1596
|
),
|
|
1297
|
-
|
|
1298
|
-
|
|
1597
|
+
o.map((p) => /* @__PURE__ */ t(
|
|
1598
|
+
S,
|
|
1299
1599
|
{
|
|
1300
|
-
label:
|
|
1301
|
-
value:
|
|
1302
|
-
active: e ===
|
|
1600
|
+
label: p.label,
|
|
1601
|
+
value: p.language,
|
|
1602
|
+
active: e === p.index,
|
|
1303
1603
|
onClick: () => {
|
|
1304
|
-
i(
|
|
1604
|
+
i(p.index), n();
|
|
1305
1605
|
}
|
|
1306
1606
|
},
|
|
1307
|
-
|
|
1607
|
+
p.index
|
|
1308
1608
|
))
|
|
1309
1609
|
] })
|
|
1310
1610
|
] }),
|
|
1311
|
-
|
|
1611
|
+
N === "customize" && /* @__PURE__ */ h("div", { className: "animate-in slide-in-from-right-4 fade-in duration-200", children: [
|
|
1312
1612
|
/* @__PURE__ */ t(
|
|
1313
|
-
|
|
1613
|
+
H,
|
|
1314
1614
|
{
|
|
1315
1615
|
label: "Customize",
|
|
1316
|
-
onBack: () =>
|
|
1317
|
-
rightAction: /* @__PURE__ */ t("button", { onClick: b, className: "p-1.5 text-zinc-400 hover:text-white transition-colors rounded-md hover:bg-white/10", title: "Reset All", children: /* @__PURE__ */ t(
|
|
1616
|
+
onBack: () => M("main"),
|
|
1617
|
+
rightAction: /* @__PURE__ */ t("button", { onClick: b, className: "p-1.5 text-zinc-400 hover:text-white transition-colors rounded-md hover:bg-white/10", title: "Reset All", children: /* @__PURE__ */ t(rs, { className: "w-4 h-4" }) })
|
|
1318
1618
|
}
|
|
1319
1619
|
),
|
|
1320
|
-
/* @__PURE__ */
|
|
1321
|
-
/* @__PURE__ */ t(
|
|
1322
|
-
|
|
1620
|
+
/* @__PURE__ */ h("div", { className: "pb-1", children: [
|
|
1621
|
+
/* @__PURE__ */ t(J, { children: /* @__PURE__ */ t(
|
|
1622
|
+
X,
|
|
1323
1623
|
{
|
|
1324
1624
|
label: "Native Video Subtitle",
|
|
1325
|
-
checked:
|
|
1326
|
-
onChange: (
|
|
1625
|
+
checked: d.useNative,
|
|
1626
|
+
onChange: (p) => m({ useNative: p })
|
|
1327
1627
|
}
|
|
1328
1628
|
) }),
|
|
1329
|
-
!
|
|
1330
|
-
/* @__PURE__ */
|
|
1331
|
-
/* @__PURE__ */
|
|
1332
|
-
/* @__PURE__ */ t("div", { className: "flex justify-between items-center mb-2", children: /* @__PURE__ */
|
|
1333
|
-
/* @__PURE__ */ t(
|
|
1629
|
+
!d.useNative && /* @__PURE__ */ h(R, { children: [
|
|
1630
|
+
/* @__PURE__ */ h(J, { title: "Sync & Position", children: [
|
|
1631
|
+
/* @__PURE__ */ h("div", { className: "py-2.5 px-3 rounded-lg hover:bg-white/5 group transition-colors", children: [
|
|
1632
|
+
/* @__PURE__ */ t("div", { className: "flex justify-between items-center mb-2", children: /* @__PURE__ */ h("div", { className: "flex items-center gap-3", children: [
|
|
1633
|
+
/* @__PURE__ */ t(Ki, { className: "w-4 h-4 text-zinc-500 group-hover:text-zinc-400 transition-colors" }),
|
|
1334
1634
|
/* @__PURE__ */ t("span", { className: "text-xs font-bold text-zinc-400 uppercase tracking-wider group-hover:text-zinc-300 transition-colors", children: "Sync Offset" })
|
|
1335
1635
|
] }) }),
|
|
1336
|
-
/* @__PURE__ */
|
|
1636
|
+
/* @__PURE__ */ h("div", { className: "flex items-center gap-2", children: [
|
|
1337
1637
|
/* @__PURE__ */ t(
|
|
1338
1638
|
"button",
|
|
1339
1639
|
{
|
|
1340
|
-
onClick: () =>
|
|
1640
|
+
onClick: () => l(Math.round((y - 0.1) * 10) / 10),
|
|
1341
1641
|
className: "w-8 h-8 flex items-center justify-center bg-zinc-800 rounded-lg hover:bg-zinc-700 text-zinc-300 transition-colors active:scale-95",
|
|
1342
|
-
children: /* @__PURE__ */ t(
|
|
1642
|
+
children: /* @__PURE__ */ t(Yi, { className: "w-4 h-4" })
|
|
1343
1643
|
}
|
|
1344
1644
|
),
|
|
1345
|
-
/* @__PURE__ */
|
|
1346
|
-
|
|
1347
|
-
(
|
|
1645
|
+
/* @__PURE__ */ h("div", { className: "flex-1 bg-zinc-900 border border-white/5 rounded-lg h-8 flex items-center justify-center text-xs font-mono font-medium text-[var(--accent)]", children: [
|
|
1646
|
+
y > 0 ? "+" : "",
|
|
1647
|
+
(y == null ? void 0 : y.toFixed(1)) || "0.0",
|
|
1348
1648
|
"s"
|
|
1349
1649
|
] }),
|
|
1350
1650
|
/* @__PURE__ */ t(
|
|
1351
1651
|
"button",
|
|
1352
1652
|
{
|
|
1353
|
-
onClick: () =>
|
|
1653
|
+
onClick: () => l(Math.round((y + 0.1) * 10) / 10),
|
|
1354
1654
|
className: "w-8 h-8 flex items-center justify-center bg-zinc-800 rounded-lg hover:bg-zinc-700 text-zinc-300 transition-colors active:scale-95",
|
|
1355
|
-
children: /* @__PURE__ */ t(
|
|
1655
|
+
children: /* @__PURE__ */ t(Zi, { className: "w-4 h-4" })
|
|
1356
1656
|
}
|
|
1357
1657
|
)
|
|
1358
1658
|
] })
|
|
1359
1659
|
] }),
|
|
1360
1660
|
/* @__PURE__ */ t(
|
|
1361
|
-
|
|
1661
|
+
re,
|
|
1362
1662
|
{
|
|
1363
1663
|
label: "Vertical Position",
|
|
1364
|
-
icon: /* @__PURE__ */ t(
|
|
1365
|
-
value:
|
|
1664
|
+
icon: /* @__PURE__ */ t(ss, { className: "w-4 h-4" }),
|
|
1665
|
+
value: d.verticalOffset,
|
|
1366
1666
|
min: 0,
|
|
1367
1667
|
max: 200,
|
|
1368
1668
|
step: 5,
|
|
1369
|
-
onChange: (
|
|
1370
|
-
formatValue: (
|
|
1669
|
+
onChange: (p) => m({ verticalOffset: p }),
|
|
1670
|
+
formatValue: (p) => `${p}px`
|
|
1371
1671
|
}
|
|
1372
1672
|
)
|
|
1373
1673
|
] }),
|
|
1374
|
-
/* @__PURE__ */
|
|
1674
|
+
/* @__PURE__ */ h(J, { title: "Appearance", children: [
|
|
1375
1675
|
/* @__PURE__ */ t(
|
|
1376
|
-
|
|
1676
|
+
re,
|
|
1377
1677
|
{
|
|
1378
1678
|
label: "Text Size",
|
|
1379
|
-
icon: /* @__PURE__ */ t(
|
|
1380
|
-
value:
|
|
1679
|
+
icon: /* @__PURE__ */ t(ts, { className: "w-4 h-4" }),
|
|
1680
|
+
value: d.textSize,
|
|
1381
1681
|
min: 50,
|
|
1382
1682
|
max: 200,
|
|
1383
1683
|
step: 10,
|
|
1384
|
-
onChange: (
|
|
1385
|
-
formatValue: (
|
|
1684
|
+
onChange: (p) => m({ textSize: p }),
|
|
1685
|
+
formatValue: (p) => `${p}%`
|
|
1386
1686
|
}
|
|
1387
1687
|
),
|
|
1388
|
-
/* @__PURE__ */
|
|
1389
|
-
/* @__PURE__ */
|
|
1390
|
-
/* @__PURE__ */ t(
|
|
1688
|
+
/* @__PURE__ */ h("div", { className: "py-2.5 px-3 rounded-lg hover:bg-white/5 group transition-colors", children: [
|
|
1689
|
+
/* @__PURE__ */ h("div", { className: "flex items-center gap-3 mb-2", children: [
|
|
1690
|
+
/* @__PURE__ */ t(gt, { className: "w-4 h-4 text-zinc-500 group-hover:text-zinc-400 transition-colors" }),
|
|
1391
1691
|
/* @__PURE__ */ t("span", { className: "text-xs font-bold text-zinc-400 uppercase tracking-wider group-hover:text-zinc-300 transition-colors", children: "Text Color" })
|
|
1392
1692
|
] }),
|
|
1393
|
-
/* @__PURE__ */
|
|
1394
|
-
["#ffffff", "#ffff00", "#00ffff", "#ff00ff", "#ff0000", "#00ff00"].map((
|
|
1693
|
+
/* @__PURE__ */ h("div", { className: "flex items-center justify-between gap-2 p-1 bg-zinc-800/50 rounded-lg", children: [
|
|
1694
|
+
["#ffffff", "#ffff00", "#00ffff", "#ff00ff", "#ff0000", "#00ff00"].map((p) => /* @__PURE__ */ t(
|
|
1395
1695
|
"button",
|
|
1396
1696
|
{
|
|
1397
|
-
onClick: () =>
|
|
1398
|
-
className: `w-6 h-6 rounded-full border border-white/10 transition-transform hover:scale-110 ${
|
|
1399
|
-
style: { backgroundColor:
|
|
1697
|
+
onClick: () => m({ textColor: p }),
|
|
1698
|
+
className: `w-6 h-6 rounded-full border border-white/10 transition-transform hover:scale-110 ${d.textColor === p ? "ring-2 scale-110" : ""}`,
|
|
1699
|
+
style: { backgroundColor: p, "--tw-ring-color": "var(--accent)" }
|
|
1400
1700
|
},
|
|
1401
|
-
|
|
1701
|
+
p
|
|
1402
1702
|
)),
|
|
1403
1703
|
/* @__PURE__ */ t("div", { className: "w-px h-6 bg-white/10 mx-1" }),
|
|
1404
1704
|
/* @__PURE__ */ t("div", { className: "relative w-6 h-6 rounded-full overflow-hidden ring-1 ring-white/20 cursor-pointer", children: /* @__PURE__ */ t(
|
|
1405
1705
|
"input",
|
|
1406
1706
|
{
|
|
1407
1707
|
type: "color",
|
|
1408
|
-
value:
|
|
1409
|
-
onChange: (
|
|
1708
|
+
value: d.textColor,
|
|
1709
|
+
onChange: (p) => m({ textColor: p.target.value }),
|
|
1410
1710
|
className: "absolute inset-[-4px] w-[150%] h-[150%] cursor-pointer p-0 border-0"
|
|
1411
1711
|
}
|
|
1412
1712
|
) })
|
|
1413
1713
|
] })
|
|
1414
1714
|
] }),
|
|
1415
1715
|
/* @__PURE__ */ t(
|
|
1416
|
-
|
|
1716
|
+
vs,
|
|
1417
1717
|
{
|
|
1418
1718
|
label: "Text Style",
|
|
1419
|
-
value:
|
|
1719
|
+
value: d.textStyle,
|
|
1420
1720
|
options: [
|
|
1421
1721
|
{ label: "None", value: "none" },
|
|
1422
1722
|
{ label: "Outline", value: "outline" },
|
|
@@ -1424,39 +1724,39 @@ const Gt = v("VolumeX", [
|
|
|
1424
1724
|
{ label: "Depressed", value: "depressed" },
|
|
1425
1725
|
{ label: "Drop Shadow", value: "shadow" }
|
|
1426
1726
|
],
|
|
1427
|
-
onChange: (
|
|
1727
|
+
onChange: (p) => m({ textStyle: p })
|
|
1428
1728
|
}
|
|
1429
1729
|
),
|
|
1430
|
-
/* @__PURE__ */
|
|
1431
|
-
/* @__PURE__ */ t(
|
|
1432
|
-
/* @__PURE__ */ t(
|
|
1730
|
+
/* @__PURE__ */ h("div", { className: "grid grid-cols-2 gap-2 mt-1 px-1", children: [
|
|
1731
|
+
/* @__PURE__ */ t(X, { label: "Bold", icon: /* @__PURE__ */ t(ns, { className: "w-4 h-4" }), checked: d.isBold, onChange: (p) => m({ isBold: p }) }),
|
|
1732
|
+
/* @__PURE__ */ t(X, { label: "Fix Caps", icon: /* @__PURE__ */ t(as, { className: "w-4 h-4" }), checked: d.fixCapitalization, onChange: (p) => m({ fixCapitalization: p }) })
|
|
1433
1733
|
] })
|
|
1434
1734
|
] }),
|
|
1435
|
-
/* @__PURE__ */
|
|
1735
|
+
/* @__PURE__ */ h(J, { title: "Background", children: [
|
|
1436
1736
|
/* @__PURE__ */ t(
|
|
1437
|
-
|
|
1737
|
+
re,
|
|
1438
1738
|
{
|
|
1439
1739
|
label: "Opacity",
|
|
1440
|
-
icon: /* @__PURE__ */ t(
|
|
1441
|
-
value:
|
|
1740
|
+
icon: /* @__PURE__ */ t(is, { className: "w-4 h-4" }),
|
|
1741
|
+
value: d.backgroundOpacity,
|
|
1442
1742
|
min: 0,
|
|
1443
1743
|
max: 100,
|
|
1444
1744
|
step: 5,
|
|
1445
|
-
onChange: (
|
|
1446
|
-
formatValue: (
|
|
1745
|
+
onChange: (p) => m({ backgroundOpacity: p }),
|
|
1746
|
+
formatValue: (p) => `${p}%`
|
|
1447
1747
|
}
|
|
1448
1748
|
),
|
|
1449
|
-
/* @__PURE__ */ t(
|
|
1450
|
-
|
|
1451
|
-
|
|
1749
|
+
/* @__PURE__ */ t(X, { label: "Blur Background", icon: /* @__PURE__ */ t(os, { className: "w-4 h-4" }), checked: d.backgroundBlur, onChange: (p) => m({ backgroundBlur: p }) }),
|
|
1750
|
+
d.backgroundBlur && /* @__PURE__ */ t(
|
|
1751
|
+
re,
|
|
1452
1752
|
{
|
|
1453
1753
|
label: "Blur Intensity",
|
|
1454
|
-
value:
|
|
1754
|
+
value: d.backgroundBlurAmount,
|
|
1455
1755
|
min: 0,
|
|
1456
1756
|
max: 20,
|
|
1457
1757
|
step: 1,
|
|
1458
|
-
onChange: (
|
|
1459
|
-
formatValue: (
|
|
1758
|
+
onChange: (p) => m({ backgroundBlurAmount: p }),
|
|
1759
|
+
formatValue: (p) => `${p}px`
|
|
1460
1760
|
}
|
|
1461
1761
|
)
|
|
1462
1762
|
] })
|
|
@@ -1464,127 +1764,263 @@ const Gt = v("VolumeX", [
|
|
|
1464
1764
|
] })
|
|
1465
1765
|
] })
|
|
1466
1766
|
] });
|
|
1467
|
-
},
|
|
1767
|
+
}, ye = ({ content: o }) => typeof o == "string" ? o.trim().startsWith("<") ? /* @__PURE__ */ t("span", { dangerouslySetInnerHTML: { __html: o } }) : /* @__PURE__ */ t("span", { children: o }) : /* @__PURE__ */ t(R, { children: o }), xs = ({ x: o, y: e, items: i, onClose: r, containerWidth: n, containerHeight: d }) => {
|
|
1768
|
+
const m = F(null), [b, y] = k({
|
|
1769
|
+
top: e,
|
|
1770
|
+
left: o,
|
|
1771
|
+
opacity: 0
|
|
1772
|
+
});
|
|
1773
|
+
return Wt(() => {
|
|
1774
|
+
if (!m.current) return;
|
|
1775
|
+
const l = m.current.getBoundingClientRect(), v = l.width, C = l.height;
|
|
1776
|
+
let N = o, M = e;
|
|
1777
|
+
o + v > n - 10 && (N = o - v), N < 10 && (N = 10), N + v > n && (N = Math.max(10, n - v - 10)), e + C > d - 10 && (M = e - C);
|
|
1778
|
+
let I = d - 20;
|
|
1779
|
+
M < 10 && (M = 10), M + C > d - 10 && (M = Math.max(10, d - C - 10)), y({
|
|
1780
|
+
top: M,
|
|
1781
|
+
left: N,
|
|
1782
|
+
maxHeight: I,
|
|
1783
|
+
opacity: 1
|
|
1784
|
+
});
|
|
1785
|
+
}, [o, e, i, n, d]), P(() => {
|
|
1786
|
+
const l = (v) => {
|
|
1787
|
+
m.current && !m.current.contains(v.target) && r();
|
|
1788
|
+
};
|
|
1789
|
+
return document.addEventListener("mousedown", l), () => document.removeEventListener("mousedown", l);
|
|
1790
|
+
}, [r]), /* @__PURE__ */ t(
|
|
1791
|
+
"div",
|
|
1792
|
+
{
|
|
1793
|
+
ref: m,
|
|
1794
|
+
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",
|
|
1795
|
+
style: {
|
|
1796
|
+
top: b.top,
|
|
1797
|
+
left: b.left,
|
|
1798
|
+
maxHeight: b.maxHeight,
|
|
1799
|
+
opacity: b.opacity,
|
|
1800
|
+
borderRadius: "var(--radius-lg)"
|
|
1801
|
+
},
|
|
1802
|
+
onClick: (l) => l.stopPropagation(),
|
|
1803
|
+
children: i.map((l, v) => l.separator ? /* @__PURE__ */ t("div", { className: "h-0 border-t border-white/10 mx-2 my-1.5" }, v) : l.isLabel ? /* @__PURE__ */ t("div", { className: "px-3 py-1.5 text-[10px] font-bold text-zinc-500 uppercase tracking-wider select-none", children: /* @__PURE__ */ t(ye, { content: l.html || "" }) }, v) : /* @__PURE__ */ h(we.Fragment, { children: [
|
|
1804
|
+
/* @__PURE__ */ h(
|
|
1805
|
+
"button",
|
|
1806
|
+
{
|
|
1807
|
+
onClick: () => {
|
|
1808
|
+
l.disabled || (l.click ? l.click(r) : l.onClick && l.onClick(r));
|
|
1809
|
+
},
|
|
1810
|
+
disabled: l.disabled,
|
|
1811
|
+
className: "w-full text-left px-3 py-2.5 flex items-center justify-between hover:bg-white/10 focus:bg-white/10 focus:outline-none transition-colors text-sm text-zinc-200 disabled:opacity-50 disabled:cursor-not-allowed group my-0.5",
|
|
1812
|
+
style: { borderRadius: "var(--radius)" },
|
|
1813
|
+
children: [
|
|
1814
|
+
/* @__PURE__ */ h("div", { className: "flex items-center gap-3 overflow-hidden", children: [
|
|
1815
|
+
l.icon && /* @__PURE__ */ t("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__ */ t(ye, { content: l.icon }) }),
|
|
1816
|
+
/* @__PURE__ */ t("span", { className: `flex items-center font-medium truncate ${l.checked ? "text-[var(--accent)]" : ""}`, children: /* @__PURE__ */ t(ye, { content: l.html || "" }) })
|
|
1817
|
+
] }),
|
|
1818
|
+
l.checked && /* @__PURE__ */ t(Se, { className: "w-4 h-4 text-[var(--accent)] shrink-0 ml-2" })
|
|
1819
|
+
]
|
|
1820
|
+
}
|
|
1821
|
+
),
|
|
1822
|
+
l.showBorder && /* @__PURE__ */ t("div", { className: "h-0 border-t border-white/10 mx-2 my-1" })
|
|
1823
|
+
] }, v))
|
|
1824
|
+
}
|
|
1825
|
+
);
|
|
1826
|
+
}, ys = ({ player: o, onClose: e }) => {
|
|
1827
|
+
const [i, r] = k({});
|
|
1828
|
+
return P(() => {
|
|
1829
|
+
const n = () => {
|
|
1830
|
+
var y;
|
|
1831
|
+
if (!o.video) return;
|
|
1832
|
+
const m = o.video, b = m.getVideoPlaybackQuality ? m.getVideoPlaybackQuality() : null;
|
|
1833
|
+
r({
|
|
1834
|
+
"Player Size": `${m.offsetWidth} x ${m.offsetHeight}`,
|
|
1835
|
+
"Video Resolution": `${m.videoWidth} x ${m.videoHeight}`,
|
|
1836
|
+
"Current Time": `${m.currentTime.toFixed(3)}s`,
|
|
1837
|
+
Duration: `${m.duration.toFixed(3)}s`,
|
|
1838
|
+
Volume: `${Math.round(m.volume * 100)}%`,
|
|
1839
|
+
"Dropped Frames": b ? b.droppedVideoFrames : "N/A",
|
|
1840
|
+
Buffer: m.buffered.length > 0 ? `${(m.buffered.end(m.buffered.length - 1) - m.currentTime).toFixed(2)}s` : "0s",
|
|
1841
|
+
Engine: ((y = o.store.get().sources[o.store.get().currentSourceIndex]) == null ? void 0 : y.type) || "native",
|
|
1842
|
+
URL: m.currentSrc
|
|
1843
|
+
});
|
|
1844
|
+
};
|
|
1845
|
+
n();
|
|
1846
|
+
const d = setInterval(n, 1e3);
|
|
1847
|
+
return () => clearInterval(d);
|
|
1848
|
+
}, [o]), /* @__PURE__ */ t("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__ */ h(
|
|
1849
|
+
"div",
|
|
1850
|
+
{
|
|
1851
|
+
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",
|
|
1852
|
+
style: { borderRadius: "var(--radius)", maxHeight: "90%" },
|
|
1853
|
+
children: [
|
|
1854
|
+
/* @__PURE__ */ h("div", { className: "p-5 pb-0 flex-shrink-0 relative", children: [
|
|
1855
|
+
/* @__PURE__ */ t(
|
|
1856
|
+
"button",
|
|
1857
|
+
{
|
|
1858
|
+
onClick: (n) => {
|
|
1859
|
+
n.stopPropagation(), e();
|
|
1860
|
+
},
|
|
1861
|
+
className: "absolute top-3 right-3 p-1.5 text-zinc-400 hover:text-white hover:bg-white/10 rounded-full transition-colors",
|
|
1862
|
+
children: /* @__PURE__ */ t(ms, { className: "w-4 h-4" })
|
|
1863
|
+
}
|
|
1864
|
+
),
|
|
1865
|
+
/* @__PURE__ */ t("h3", { className: "text-sm font-bold text-white mb-4 uppercase tracking-wider border-b border-white/10 pb-2", children: "Video Statistics" })
|
|
1866
|
+
] }),
|
|
1867
|
+
/* @__PURE__ */ t("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(([n, d]) => /* @__PURE__ */ h("div", { className: "flex flex-col sm:flex-row sm:justify-between sm:items-center gap-1", children: [
|
|
1868
|
+
/* @__PURE__ */ t("span", { className: "text-zinc-500 font-bold shrink-0", children: n }),
|
|
1869
|
+
/* @__PURE__ */ t("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(d), children: String(d) })
|
|
1870
|
+
] }, n)) })
|
|
1871
|
+
]
|
|
1872
|
+
}
|
|
1873
|
+
) });
|
|
1874
|
+
}, ws = [
|
|
1468
1875
|
{ label: "Strata", value: "#6366f1" },
|
|
1469
1876
|
{ label: "Emerald", value: "#10b981" },
|
|
1470
1877
|
{ label: "Rose", value: "#f43f5e" },
|
|
1471
1878
|
{ label: "Amber", value: "#f59e0b" },
|
|
1472
1879
|
{ label: "Sky", value: "#0ea5e9" },
|
|
1473
1880
|
{ label: "Violet", value: "#8b5cf6" }
|
|
1474
|
-
],
|
|
1881
|
+
], ks = [
|
|
1475
1882
|
{ label: "Default", value: "default", color: "#6366f1" },
|
|
1476
1883
|
{ label: "Pixel", value: "pixel", color: "#ef4444" },
|
|
1477
1884
|
{ label: "Game", value: "game", color: "#eab308" },
|
|
1478
1885
|
{ label: "Hacker", value: "hacker", color: "#22c55e" }
|
|
1479
|
-
],
|
|
1480
|
-
var
|
|
1481
|
-
const { src: e,
|
|
1482
|
-
|
|
1886
|
+
], ht = ({ content: o, className: e, style: i }) => typeof o == "string" ? o.trim().startsWith("<") ? /* @__PURE__ */ t("div", { className: e, style: i, dangerouslySetInnerHTML: { __html: o } }) : /* @__PURE__ */ t("div", { className: e, style: i, children: o }) : /* @__PURE__ */ t("div", { className: e, style: i, children: o }), mt = (o) => {
|
|
1887
|
+
var it, st;
|
|
1888
|
+
const { src: e, type: i, sources: r, poster: n, autoPlay: d, thumbnails: m, textTracks: b, plugins: y, ...l } = o, v = l.screenshot ?? !1, C = l.pip ?? !0, N = l.setting ?? !0, M = l.fullscreen ?? !0, I = l.fullscreenWeb ?? !1, p = l.lock ?? !1, E = l.fastForward ?? !0, yt = l.flip ?? !0, wt = l.aspectRatio ?? !0, ze = l.hotKey ?? !0, kt = l.backdrop ?? !0, Y = F(null), [s, Te] = k(null), [ae, oe] = k(!1), [Me, Ct] = k(0), [Nt, St] = k(0), Ie = ve(() => bt(l), []), a = qt(
|
|
1889
|
+
ge((c) => s ? s.store.subscribe(c) : () => {
|
|
1483
1890
|
}, [s]),
|
|
1484
|
-
() => s ? s.store.get() :
|
|
1485
|
-
() =>
|
|
1486
|
-
), [
|
|
1487
|
-
|
|
1488
|
-
if (!
|
|
1489
|
-
const
|
|
1490
|
-
|
|
1491
|
-
const
|
|
1492
|
-
for (const
|
|
1493
|
-
|
|
1891
|
+
() => s ? s.store.get() : Ie,
|
|
1892
|
+
() => Ie
|
|
1893
|
+
), [L, O] = k(!1), [$, W] = k(!1), [A, T] = k("main"), [K, le] = k({ x: 0, y: 0, visible: !1 }), [zt, Re] = k(!1), Le = nt(L, 200), $e = nt($, 200), [ce, Pe] = k(!1), [de, Ee] = k(0), [Tt, Ae] = k(!1), [Mt, Be] = k(!1), [ue, te] = k(!1), [Ve, Fe] = k([]), [Oe, je] = k(null), [It, Rt] = k(0), [q, He] = k(null), [_, ie] = k(null), [Cs, We] = k(null), [he, qe] = k(!1), me = F(null), De = F(1), Z = F(null), D = F(null), fe = F(null), pe = F(null), ee = F(null);
|
|
1894
|
+
P(() => {
|
|
1895
|
+
if (!Y.current) return;
|
|
1896
|
+
const c = new Qt(l);
|
|
1897
|
+
y && y.length > 0 && y.forEach((g) => c.use(g)), c.attach(Y.current), Te(c);
|
|
1898
|
+
const f = new ResizeObserver((g) => {
|
|
1899
|
+
for (const z of g)
|
|
1900
|
+
Ct(z.contentRect.height), St(z.contentRect.width);
|
|
1494
1901
|
});
|
|
1495
|
-
return
|
|
1496
|
-
|
|
1902
|
+
return f.observe(Y.current), () => {
|
|
1903
|
+
f.disconnect(), c.destroy(), Te(null);
|
|
1497
1904
|
};
|
|
1498
|
-
}, []),
|
|
1905
|
+
}, []), P(() => {
|
|
1499
1906
|
if (!s) return;
|
|
1500
|
-
const
|
|
1501
|
-
|
|
1502
|
-
}, [s,
|
|
1907
|
+
const c = {};
|
|
1908
|
+
l.theme !== void 0 && l.theme !== a.theme && (c.theme = l.theme), l.themeColor !== void 0 && l.themeColor !== a.themeColor && (c.themeColor = l.themeColor), l.iconSize !== void 0 && l.iconSize !== a.iconSize && (c.iconSize = l.iconSize), Object.keys(c).length > 0 && s.setAppearance(c), l.volume !== void 0 && Math.abs(l.volume - a.volume) > 0.01 && s.setVolume(l.volume), l.muted !== void 0 && l.muted !== a.isMuted && (l.muted ? s.video.muted = !0 : s.video.muted = !1);
|
|
1909
|
+
}, [s, l.theme, l.themeColor, l.iconSize, l.volume, l.muted]), P(() => {
|
|
1503
1910
|
if (!s) return;
|
|
1504
|
-
const
|
|
1505
|
-
|
|
1506
|
-
}, [e, i,
|
|
1507
|
-
|
|
1508
|
-
s && n && (s.video.muted = !0, s.store.setState({ isMuted: !0 }), s.play().catch(() => {
|
|
1911
|
+
const c = b || [];
|
|
1912
|
+
r && r.length > 0 ? (oe(!1), s.setSources(r, c)) : e && (oe(!1), s.setSources([{ url: e, type: i || "auto" }], c));
|
|
1913
|
+
}, [e, i, r, b, s]), P(() => {
|
|
1914
|
+
s && d && (s.video.muted = !0, s.store.setState({ isMuted: !0 }), s.play().catch(() => {
|
|
1509
1915
|
}));
|
|
1510
|
-
}, [s,
|
|
1511
|
-
|
|
1512
|
-
}, [
|
|
1513
|
-
|
|
1514
|
-
}, [
|
|
1515
|
-
|
|
1916
|
+
}, [s, d]), P(() => {
|
|
1917
|
+
a.isPlaying && !ae && oe(!0);
|
|
1918
|
+
}, [a.isPlaying, ae]), P(() => {
|
|
1919
|
+
m && s ? Jt(m, s.notify.bind(s)).then((c) => Fe(c)) : Fe([]);
|
|
1920
|
+
}, [m, s]), P(() => (_ && (ee.current && clearTimeout(ee.current), ee.current = setTimeout(() => {
|
|
1921
|
+
ie(null);
|
|
1922
|
+
}, 600)), () => {
|
|
1923
|
+
ee.current && clearTimeout(ee.current);
|
|
1924
|
+
}), [_]), P(() => {
|
|
1925
|
+
const c = (f) => {
|
|
1516
1926
|
var g;
|
|
1517
|
-
if (s && ((g = document.activeElement) == null ? void 0 : g.tagName) !== "INPUT")
|
|
1518
|
-
switch (
|
|
1927
|
+
if (!(!s || !ze) && ((g = document.activeElement) == null ? void 0 : g.tagName) !== "INPUT")
|
|
1928
|
+
switch (f.key.toLowerCase()) {
|
|
1519
1929
|
case " ":
|
|
1520
1930
|
case "k":
|
|
1521
|
-
|
|
1931
|
+
f.preventDefault(), s.togglePlay();
|
|
1522
1932
|
break;
|
|
1523
1933
|
case "arrowright":
|
|
1524
|
-
|
|
1934
|
+
f.preventDefault(), s.skip(5);
|
|
1525
1935
|
break;
|
|
1526
1936
|
case "arrowleft":
|
|
1527
|
-
|
|
1937
|
+
f.preventDefault(), s.skip(-5);
|
|
1528
1938
|
break;
|
|
1529
1939
|
case "arrowup":
|
|
1530
|
-
|
|
1940
|
+
f.preventDefault(), s.setVolume(s.video.volume + 0.1);
|
|
1531
1941
|
break;
|
|
1532
1942
|
case "arrowdown":
|
|
1533
|
-
|
|
1943
|
+
f.preventDefault(), s.setVolume(s.video.volume - 0.1);
|
|
1534
1944
|
break;
|
|
1535
1945
|
case "f":
|
|
1536
|
-
|
|
1946
|
+
f.preventDefault(), s.toggleFullscreen();
|
|
1537
1947
|
break;
|
|
1538
1948
|
case "m":
|
|
1539
|
-
|
|
1949
|
+
f.preventDefault(), s.toggleMute();
|
|
1540
1950
|
break;
|
|
1541
1951
|
}
|
|
1542
1952
|
};
|
|
1543
|
-
return window.addEventListener("keydown",
|
|
1544
|
-
}, [s]);
|
|
1545
|
-
const
|
|
1546
|
-
|
|
1547
|
-
!
|
|
1548
|
-
}, 2500));
|
|
1953
|
+
return window.addEventListener("keydown", c), () => window.removeEventListener("keydown", c);
|
|
1954
|
+
}, [s, ze]);
|
|
1955
|
+
const Ue = () => {
|
|
1956
|
+
s && (s.setControlsVisible(!0), D.current && clearTimeout(D.current), !(L || $) && (D.current = setTimeout(() => {
|
|
1957
|
+
!a.isPlaying || L || $ || s.setControlsVisible(!1);
|
|
1958
|
+
}, 2500)));
|
|
1549
1959
|
};
|
|
1550
|
-
|
|
1551
|
-
|
|
1552
|
-
}, [
|
|
1553
|
-
const
|
|
1554
|
-
|
|
1555
|
-
|
|
1556
|
-
|
|
1557
|
-
},
|
|
1558
|
-
|
|
1559
|
-
|
|
1560
|
-
|
|
1960
|
+
P(() => {
|
|
1961
|
+
s && (!L && !$ && a.isPlaying ? Ue() : (L || $) && (s.setControlsVisible(!0), D.current && clearTimeout(D.current)));
|
|
1962
|
+
}, [L, $, a.isPlaying, s]);
|
|
1963
|
+
const _e = ge(() => {
|
|
1964
|
+
!E || !s || !a.isPlaying || a.isLocked || (De.current = s.video.playbackRate, me.current = setTimeout(() => {
|
|
1965
|
+
s.video.playbackRate = 2, qe(!0);
|
|
1966
|
+
}, 500));
|
|
1967
|
+
}, [E, s, a.isPlaying, a.isLocked]), Ge = ge(() => {
|
|
1968
|
+
me.current && clearTimeout(me.current), he && s && (s.video.playbackRate = De.current, qe(!1));
|
|
1969
|
+
}, [he, s]), be = (c) => {
|
|
1970
|
+
if (!fe.current || !a.duration) return 0;
|
|
1971
|
+
const f = fe.current.getBoundingClientRect(), g = "touches" in c ? c.touches[0].clientX : c.clientX;
|
|
1972
|
+
return Math.max(0, Math.min(1, (g - f.left) / f.width)) * a.duration;
|
|
1973
|
+
}, Qe = (c) => {
|
|
1974
|
+
if (a.isLocked) return;
|
|
1975
|
+
Pe(!0), Ee(be(c));
|
|
1976
|
+
const f = (z) => Ee(be(z)), g = (z) => {
|
|
1977
|
+
s == null || s.seek(be(z)), Pe(!1), document.removeEventListener("mousemove", f), document.removeEventListener("touchmove", f), document.removeEventListener("mouseup", g), document.removeEventListener("touchend", g);
|
|
1561
1978
|
};
|
|
1562
|
-
document.addEventListener("mousemove",
|
|
1563
|
-
},
|
|
1564
|
-
if (!
|
|
1565
|
-
const
|
|
1566
|
-
return Math.max(0, Math.min(1, (g -
|
|
1567
|
-
},
|
|
1568
|
-
if (!s) return;
|
|
1569
|
-
|
|
1570
|
-
const
|
|
1571
|
-
|
|
1979
|
+
document.addEventListener("mousemove", f), document.addEventListener("touchmove", f), document.addEventListener("mouseup", g), document.addEventListener("touchend", g);
|
|
1980
|
+
}, Xe = (c) => {
|
|
1981
|
+
if (!pe.current) return 0;
|
|
1982
|
+
const f = pe.current.getBoundingClientRect(), g = "touches" in c ? c.touches[0].clientX : c.clientX;
|
|
1983
|
+
return Math.max(0, Math.min(1, (g - f.left) / f.width));
|
|
1984
|
+
}, Je = (c) => {
|
|
1985
|
+
if (!s || a.isLocked) return;
|
|
1986
|
+
Ae(!0), s.setVolume(Xe(c));
|
|
1987
|
+
const f = (z) => s.setVolume(Xe(z)), g = () => {
|
|
1988
|
+
Ae(!1), document.removeEventListener("mousemove", f), document.removeEventListener("touchmove", f), document.removeEventListener("mouseup", g), document.removeEventListener("touchend", g);
|
|
1572
1989
|
};
|
|
1573
|
-
document.addEventListener("mousemove",
|
|
1574
|
-
},
|
|
1575
|
-
if (!
|
|
1576
|
-
const
|
|
1577
|
-
|
|
1578
|
-
},
|
|
1579
|
-
s
|
|
1580
|
-
},
|
|
1581
|
-
if (
|
|
1582
|
-
|
|
1583
|
-
|
|
1584
|
-
|
|
1990
|
+
document.addEventListener("mousemove", f), document.addEventListener("touchmove", f), document.addEventListener("mouseup", g), document.addEventListener("touchend", g);
|
|
1991
|
+
}, Lt = (c) => {
|
|
1992
|
+
if (!a.duration || a.isLive) return;
|
|
1993
|
+
const f = c.currentTarget.getBoundingClientRect(), g = (c.clientX - f.left) / f.width, z = g * a.duration;
|
|
1994
|
+
Rt(g * 100), je(z), Ve.length > 0 && He(Ve.find((U) => z >= U.start && z < U.end) || null);
|
|
1995
|
+
}, se = (c) => {
|
|
1996
|
+
!s || a.isLocked || (s.skip(c === "forward" ? 10 : -10), We(c), setTimeout(() => We(null), 300));
|
|
1997
|
+
}, $t = (c) => {
|
|
1998
|
+
if (!s || (L && O(!1), $ && W(!1), ue && te(!1), K.visible && le({ ...K, visible: !1 }), s.setControlsVisible(!0), D.current && clearTimeout(D.current), D.current = setTimeout(() => {
|
|
1999
|
+
!a.isPlaying || L || $ || s.setControlsVisible(!1);
|
|
2000
|
+
}, 2500), a.isLocked)) return;
|
|
2001
|
+
const f = c.currentTarget.getBoundingClientRect(), g = c.clientX - f.left, z = f.width, U = Date.now();
|
|
2002
|
+
Z.current ? (clearTimeout(Z.current), Z.current = null, g < z * 0.35 ? (se("rewind"), ie({ type: "rewind", id: U })) : g > z * 0.65 ? (se("forward"), ie({ type: "forward", id: U })) : s.toggleFullscreen()) : Z.current = setTimeout(() => {
|
|
2003
|
+
s.togglePlay(), Z.current = null;
|
|
1585
2004
|
}, 250);
|
|
1586
|
-
},
|
|
1587
|
-
|
|
2005
|
+
}, Pt = (c) => {
|
|
2006
|
+
var g;
|
|
2007
|
+
if (c.preventDefault(), a.isLocked) return;
|
|
2008
|
+
const f = (g = Y.current) == null ? void 0 : g.getBoundingClientRect();
|
|
2009
|
+
f && le({
|
|
2010
|
+
visible: !0,
|
|
2011
|
+
x: c.clientX - f.left,
|
|
2012
|
+
y: c.clientY - f.top
|
|
2013
|
+
});
|
|
2014
|
+
}, Et = (c) => {
|
|
2015
|
+
c.stopPropagation();
|
|
2016
|
+
const f = "ontouchstart" in window || navigator.maxTouchPoints > 0, g = window.matchMedia("(hover: none)").matches || f;
|
|
2017
|
+
if (ue) {
|
|
2018
|
+
te(!1);
|
|
2019
|
+
return;
|
|
2020
|
+
}
|
|
2021
|
+
g ? te(!0) : s == null || s.toggleMute();
|
|
2022
|
+
}, At = a.isMuted || a.volume === 0 ? ji : a.volume < 0.5 ? Oi : Fi, Ke = Math.max(100, Me - 120), Bt = () => {
|
|
2023
|
+
switch (a.iconSize) {
|
|
1588
2024
|
case "small":
|
|
1589
2025
|
return "w-4 h-4";
|
|
1590
2026
|
case "large":
|
|
@@ -1592,17 +2028,17 @@ const Gt = v("VolumeX", [
|
|
|
1592
2028
|
default:
|
|
1593
2029
|
return "w-5 h-5";
|
|
1594
2030
|
}
|
|
1595
|
-
},
|
|
1596
|
-
switch (
|
|
2031
|
+
}, Vt = () => {
|
|
2032
|
+
switch (a.iconSize) {
|
|
1597
2033
|
case "small":
|
|
1598
|
-
return "p-
|
|
2034
|
+
return "p-2 min-w-[32px] min-h-[32px]";
|
|
1599
2035
|
case "large":
|
|
1600
|
-
return "p-
|
|
2036
|
+
return "p-3 min-w-[44px] min-h-[44px]";
|
|
1601
2037
|
default:
|
|
1602
|
-
return "p-2";
|
|
2038
|
+
return "p-2.5 min-w-[36px] min-h-[36px]";
|
|
1603
2039
|
}
|
|
1604
|
-
},
|
|
1605
|
-
switch (
|
|
2040
|
+
}, B = Bt(), j = Vt(), G = (() => {
|
|
2041
|
+
switch (a.iconSize) {
|
|
1606
2042
|
case "small":
|
|
1607
2043
|
return {
|
|
1608
2044
|
playBtn: "w-14 h-14",
|
|
@@ -1625,21 +2061,277 @@ const Gt = v("VolumeX", [
|
|
|
1625
2061
|
skipIcon: "w-6 h-6"
|
|
1626
2062
|
};
|
|
1627
2063
|
}
|
|
1628
|
-
})()
|
|
1629
|
-
|
|
2064
|
+
})(), Ft = !a.isLocked && (a.controlsVisible || !a.isPlaying || L || $), Ye = Mt || Tt || ue, Ze = kt ? "backdrop-blur-xl bg-black/80" : "bg-black/95", et = ve(() => {
|
|
2065
|
+
const c = [
|
|
2066
|
+
{ id: "play", position: "left", index: 10, isBuiltIn: !0 },
|
|
2067
|
+
{ id: "volume", position: "left", index: 20, isBuiltIn: !0 },
|
|
2068
|
+
{ id: "time", position: "left", index: 30, isBuiltIn: !0 },
|
|
2069
|
+
{ id: "subtitle", position: "right", index: 80, isBuiltIn: !0 },
|
|
2070
|
+
{ id: "screenshot", position: "right", index: 85, isBuiltIn: !0 },
|
|
2071
|
+
{ id: "pip", position: "right", index: 90, isBuiltIn: !0 },
|
|
2072
|
+
{ id: "download", position: "right", index: 95, isBuiltIn: !0 },
|
|
2073
|
+
{ id: "settings", position: "right", index: 100, isBuiltIn: !0 },
|
|
2074
|
+
{ id: "fullscreenWeb", position: "right", index: 110, isBuiltIn: !0 },
|
|
2075
|
+
{ id: "fullscreen", position: "right", index: 120, isBuiltIn: !0 }
|
|
2076
|
+
];
|
|
2077
|
+
return l.controls && l.controls.forEach((f) => {
|
|
2078
|
+
const g = c.find((z) => z.id === f.id);
|
|
2079
|
+
g ? Object.assign(g, f) : c.push(f);
|
|
2080
|
+
}), c.filter((f) => !(f.id === "screenshot" && !v || f.id === "pip" && !C || f.id === "settings" && !N || f.id === "fullscreen" && !M || f.id === "fullscreenWeb" && !I)).sort((f, g) => f.index - g.index);
|
|
2081
|
+
}, [l.controls, v, C, N, M, I]), tt = (c) => {
|
|
2082
|
+
var f, g, z, U, rt;
|
|
2083
|
+
if (!c.isBuiltIn)
|
|
2084
|
+
return /* @__PURE__ */ t(
|
|
2085
|
+
"button",
|
|
2086
|
+
{
|
|
2087
|
+
onClick: () => {
|
|
2088
|
+
c.click ? c.click(s) : c.onClick && c.onClick(s);
|
|
2089
|
+
},
|
|
2090
|
+
className: `strata-control-btn text-zinc-300 hover:text-white transition-colors hover:bg-white/10 focus:outline-none flex items-center justify-center ${j} ${c.className || ""}`,
|
|
2091
|
+
style: { borderRadius: "var(--radius)", ...c.style },
|
|
2092
|
+
title: c.tooltip,
|
|
2093
|
+
children: /* @__PURE__ */ t(ht, { content: c.html || "" })
|
|
2094
|
+
},
|
|
2095
|
+
c.index
|
|
2096
|
+
);
|
|
2097
|
+
switch (c.id) {
|
|
2098
|
+
case "play":
|
|
2099
|
+
return /* @__PURE__ */ t("button", { onClick: () => s == null ? void 0 : s.togglePlay(), className: `strata-control-btn text-zinc-300 hover:text-white transition-colors hover:bg-white/10 focus:outline-none ${j}`, style: { borderRadius: "var(--radius)" }, children: a.isPlaying ? /* @__PURE__ */ t(ot, { className: `${B} fill-current` }) : /* @__PURE__ */ t(at, { className: `${B} fill-current` }) }, "play");
|
|
2100
|
+
case "volume":
|
|
2101
|
+
return /* @__PURE__ */ h(
|
|
2102
|
+
"div",
|
|
2103
|
+
{
|
|
2104
|
+
className: "flex items-center gap-2 group/vol relative",
|
|
2105
|
+
onMouseEnter: () => {
|
|
2106
|
+
window.matchMedia("(hover: hover)").matches && Be(!0);
|
|
2107
|
+
},
|
|
2108
|
+
onMouseLeave: () => {
|
|
2109
|
+
window.matchMedia("(hover: hover)").matches && Be(!1);
|
|
2110
|
+
},
|
|
2111
|
+
children: [
|
|
2112
|
+
/* @__PURE__ */ t("button", { onClick: Et, className: `strata-control-btn text-zinc-300 hover:text-white hover:bg-white/10 focus:outline-none ${j}`, style: { borderRadius: "var(--radius)" }, children: /* @__PURE__ */ t(At, { className: B }) }),
|
|
2113
|
+
/* @__PURE__ */ t("div", { className: `relative h-8 flex items-center transition-all duration-300 ease-out overflow-hidden ${Ye ? "w-28 opacity-100 ml-1" : "w-0 opacity-0"}`, children: /* @__PURE__ */ h("div", { ref: pe, className: "relative w-full h-full flex items-center cursor-pointer px-2", onMouseDown: Je, onTouchStart: Je, children: [
|
|
2114
|
+
/* @__PURE__ */ t("div", { className: "w-full h-1 bg-white/20 overflow-hidden", style: { borderRadius: "var(--radius-full)" }, children: /* @__PURE__ */ t("div", { className: "h-full bg-white", style: { width: `${(a.isMuted ? 0 : a.volume) * 100}%`, borderRadius: "var(--radius-full)" } }) }),
|
|
2115
|
+
/* @__PURE__ */ t("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)" } })
|
|
2116
|
+
] }) }),
|
|
2117
|
+
Ye && /* @__PURE__ */ t("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)}%` })
|
|
2118
|
+
]
|
|
2119
|
+
},
|
|
2120
|
+
"volume"
|
|
2121
|
+
);
|
|
2122
|
+
case "time":
|
|
2123
|
+
return l.isLive ? /* @__PURE__ */ h("div", { className: "flex items-center gap-2 px-2 py-0.5 bg-red-500/10 border border-red-500/20 rounded-md", children: [
|
|
2124
|
+
/* @__PURE__ */ t("div", { className: "w-2 h-2 rounded-full bg-red-500 animate-pulse" }),
|
|
2125
|
+
/* @__PURE__ */ t("span", { className: "text-[10px] font-bold text-red-500 tracking-wider", children: "LIVE" })
|
|
2126
|
+
] }, "live") : /* @__PURE__ */ h("div", { className: "text-xs font-medium text-zinc-400 font-mono select-none hidden sm:block tabular-nums", children: [
|
|
2127
|
+
xe(ce ? de : a.currentTime),
|
|
2128
|
+
" ",
|
|
2129
|
+
/* @__PURE__ */ t("span", { className: "text-zinc-600", children: "/" }),
|
|
2130
|
+
" ",
|
|
2131
|
+
xe(a.duration)
|
|
2132
|
+
] }, "time");
|
|
2133
|
+
case "subtitle":
|
|
2134
|
+
return /* @__PURE__ */ h("div", { className: "relative", children: [
|
|
2135
|
+
/* @__PURE__ */ t("button", { onClick: (u) => {
|
|
2136
|
+
u.stopPropagation(), W(!$), O(!1);
|
|
2137
|
+
}, className: `strata-control-btn transition-colors focus:outline-none ${j} ${$ ? "text-[var(--accent)] bg-white/10" : "text-zinc-300 hover:text-white hover:bg-white/10"}`, style: { borderRadius: "var(--radius)" }, children: /* @__PURE__ */ t(Ui, { className: B }) }),
|
|
2138
|
+
$e.isMounted && /* @__PURE__ */ t(
|
|
2139
|
+
gs,
|
|
2140
|
+
{
|
|
2141
|
+
tracks: a.subtitleTracks,
|
|
2142
|
+
current: a.currentSubtitle,
|
|
2143
|
+
onSelect: (u) => s == null ? void 0 : s.setSubtitle(u),
|
|
2144
|
+
onUpload: (u) => s == null ? void 0 : s.addTextTrack(u, u.name),
|
|
2145
|
+
onClose: () => W(!1),
|
|
2146
|
+
settings: a.subtitleSettings,
|
|
2147
|
+
onSettingsChange: (u) => s == null ? void 0 : s.updateSubtitleSettings(u),
|
|
2148
|
+
onReset: () => s == null ? void 0 : s.resetSubtitleSettings(),
|
|
2149
|
+
offset: a.subtitleOffset,
|
|
2150
|
+
onOffsetChange: (u) => s == null ? void 0 : s.setSubtitleOffset(u),
|
|
2151
|
+
maxHeight: Ke,
|
|
2152
|
+
animationClass: `strata-backdrop ${Ze} ${$e.isVisible ? "opacity-100 translate-y-0 scale-100" : "opacity-0 translate-y-2 scale-95"}`
|
|
2153
|
+
}
|
|
2154
|
+
)
|
|
2155
|
+
] }, "subtitle");
|
|
2156
|
+
case "screenshot":
|
|
2157
|
+
return /* @__PURE__ */ t("button", { onClick: () => s == null ? void 0 : s.screenshot(), className: `strata-control-btn text-zinc-300 hover:text-white hover:bg-white/10 transition-colors hidden sm:block focus:outline-none ${j}`, style: { borderRadius: "var(--radius)" }, title: "Screenshot", children: /* @__PURE__ */ t(ls, { className: B }) }, "ss");
|
|
2158
|
+
case "pip":
|
|
2159
|
+
return /* @__PURE__ */ t("button", { onClick: () => s == null ? void 0 : s.togglePip(), className: `strata-control-btn text-zinc-300 hover:text-white hover:bg-white/10 transition-colors hidden sm:block focus:outline-none ${j}`, style: { borderRadius: "var(--radius)" }, children: /* @__PURE__ */ t(Di, { className: B }) }, "pip");
|
|
2160
|
+
case "download":
|
|
2161
|
+
return /* @__PURE__ */ t("button", { onClick: () => s == null ? void 0 : s.download(), className: `strata-control-btn text-zinc-300 hover:text-white hover:bg-white/10 transition-colors hidden sm:block focus:outline-none ${j}`, style: { borderRadius: "var(--radius)" }, children: /* @__PURE__ */ t(_i, { className: B }) }, "dl");
|
|
2162
|
+
case "fullscreen":
|
|
2163
|
+
return /* @__PURE__ */ t("button", { onClick: () => s == null ? void 0 : s.toggleFullscreen(), className: `strata-control-btn text-zinc-300 hover:text-white hover:bg-white/10 rounded-lg transition-transform hover:scale-110 focus:outline-none ${j}`, style: { borderRadius: "var(--radius)" }, children: a.isFullscreen ? /* @__PURE__ */ t(Wi, { className: B }) : /* @__PURE__ */ t(Hi, { className: B }) }, "fs");
|
|
2164
|
+
case "fullscreenWeb":
|
|
2165
|
+
return /* @__PURE__ */ t("button", { className: `strata-control-btn text-zinc-300 hover:text-white hover:bg-white/10 hidden sm:block focus:outline-none ${j}`, style: { borderRadius: "var(--radius)" }, title: "Web Fullscreen", children: /* @__PURE__ */ t(us, { className: B }) }, "fsw");
|
|
2166
|
+
case "settings":
|
|
2167
|
+
return /* @__PURE__ */ h("div", { className: "relative", children: [
|
|
2168
|
+
/* @__PURE__ */ t("button", { onClick: (u) => {
|
|
2169
|
+
u.stopPropagation(), O(!L), W(!1), T("main");
|
|
2170
|
+
}, className: `strata-control-btn transition-all duration-300 focus:outline-none ${j} ${L ? "rotate-90 text-[var(--accent)] bg-white/10" : "text-zinc-300 hover:text-white hover:bg-white/10"}`, style: { borderRadius: "var(--radius)" }, children: /* @__PURE__ */ t(qi, { className: B }) }),
|
|
2171
|
+
Le.isMounted && /* @__PURE__ */ t(xt, { onClose: () => O(!1), align: "right", maxHeight: Ke, className: `strata-backdrop ${Ze} ${Le.isVisible ? "opacity-100 translate-y-0 scale-100" : "opacity-0 translate-y-2 scale-95"}`, children: /* @__PURE__ */ h("div", { className: "w-full", children: [
|
|
2172
|
+
A === "main" && /* @__PURE__ */ h("div", { className: "animate-in slide-in-from-left-4 fade-in duration-200", children: [
|
|
2173
|
+
/* @__PURE__ */ t("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__ */ t("span", { children: "Settings" }) }),
|
|
2174
|
+
a.sources.length > 1 && /* @__PURE__ */ t(S, { label: "Source", value: ((f = a.sources[a.currentSourceIndex]) == null ? void 0 : f.name) || `Source ${a.currentSourceIndex + 1}`, onClick: () => T("sources"), hasSubmenu: !0 }),
|
|
2175
|
+
/* @__PURE__ */ t(S, { label: "Speed", value: `${a.playbackRate}x`, onClick: () => T("speed"), hasSubmenu: !0 }),
|
|
2176
|
+
/* @__PURE__ */ t(S, { label: "Quality", value: a.currentQuality === -1 ? "Auto" : `${(g = a.qualityLevels[a.currentQuality]) == null ? void 0 : g.height}p`, onClick: () => T("quality"), hasSubmenu: !0 }),
|
|
2177
|
+
/* @__PURE__ */ t(S, { label: "Audio", value: ((z = a.audioTracks[a.currentAudioTrack]) == null ? void 0 : z.label) || "Default", onClick: () => T("audio"), hasSubmenu: !0 }),
|
|
2178
|
+
yt && /* @__PURE__ */ t(S, { label: "Flip", value: a.flipState.horizontal ? "H" : a.flipState.vertical ? "V" : "Normal", onClick: () => T("flip"), hasSubmenu: !0 }),
|
|
2179
|
+
wt && /* @__PURE__ */ t(S, { label: "Aspect Ratio", value: a.aspectRatio, onClick: () => T("ratio"), hasSubmenu: !0 }),
|
|
2180
|
+
/* @__PURE__ */ t(ut, {}),
|
|
2181
|
+
/* @__PURE__ */ t(S, { label: "Audio Boost", value: a.audioGain > 1 ? `${a.audioGain}x` : "Off", onClick: () => T("boost"), hasSubmenu: !0 }),
|
|
2182
|
+
/* @__PURE__ */ t(S, { label: "Watch Party", icon: /* @__PURE__ */ t(Ji, { className: "w-4 h-4" }), onClick: () => T("party"), hasSubmenu: !0 }),
|
|
2183
|
+
/* @__PURE__ */ t(S, { label: "Cast to Device", icon: /* @__PURE__ */ t(Xi, { className: "w-4 h-4" }), onClick: () => {
|
|
2184
|
+
s == null || s.requestCast(), O(!1);
|
|
2185
|
+
} }),
|
|
2186
|
+
(U = l.settings) == null ? void 0 : U.map((u, Q) => u.switch !== void 0 ? /* @__PURE__ */ t("div", { className: "px-1", children: /* @__PURE__ */ t(
|
|
2187
|
+
X,
|
|
2188
|
+
{
|
|
2189
|
+
label: u.html,
|
|
2190
|
+
icon: u.icon,
|
|
2191
|
+
checked: u.switch,
|
|
2192
|
+
tooltip: u.tooltip,
|
|
2193
|
+
onChange: (Ss) => {
|
|
2194
|
+
u.onSwitch && u.onSwitch(u);
|
|
2195
|
+
}
|
|
2196
|
+
}
|
|
2197
|
+
) }, `cust-${Q}`) : /* @__PURE__ */ t(
|
|
2198
|
+
S,
|
|
2199
|
+
{
|
|
2200
|
+
label: u.html,
|
|
2201
|
+
icon: u.icon,
|
|
2202
|
+
onClick: () => {
|
|
2203
|
+
u.click ? u.click() : u.onClick && u.onClick(), O(!1);
|
|
2204
|
+
}
|
|
2205
|
+
},
|
|
2206
|
+
`cust-${Q}`
|
|
2207
|
+
)),
|
|
2208
|
+
/* @__PURE__ */ t(ut, {}),
|
|
2209
|
+
/* @__PURE__ */ t(S, { label: "Appearance", icon: /* @__PURE__ */ t(gt, { className: "w-4 h-4" }), onClick: () => T("appearance"), hasSubmenu: !0 })
|
|
2210
|
+
] }),
|
|
2211
|
+
["speed", "quality", "audio", "boost", "party", "appearance", "sources", "flip", "ratio"].includes(A) && /* @__PURE__ */ h("div", { className: "animate-in slide-in-from-right-4 fade-in duration-200", children: [
|
|
2212
|
+
A === "sources" && /* @__PURE__ */ h(R, { children: [
|
|
2213
|
+
/* @__PURE__ */ t(H, { label: "Select Source", onBack: () => T("main") }),
|
|
2214
|
+
a.sources.map((u, Q) => /* @__PURE__ */ t(S, { label: u.name || `Source ${Q + 1}`, value: u.type, active: a.currentSourceIndex === Q, onClick: () => s == null ? void 0 : s.switchSource(Q) }, Q))
|
|
2215
|
+
] }),
|
|
2216
|
+
A === "speed" && /* @__PURE__ */ h(R, { children: [
|
|
2217
|
+
/* @__PURE__ */ t(H, { label: "Speed", onBack: () => T("main") }),
|
|
2218
|
+
[0.5, 1, 1.5, 2].map((u) => /* @__PURE__ */ t(S, { label: `${u}x`, active: a.playbackRate === u, onClick: () => s.video.playbackRate = u }, u))
|
|
2219
|
+
] }),
|
|
2220
|
+
A === "quality" && /* @__PURE__ */ h(R, { children: [
|
|
2221
|
+
/* @__PURE__ */ t(H, { label: "Quality", onBack: () => T("main") }),
|
|
2222
|
+
/* @__PURE__ */ t(S, { label: "Auto", active: a.currentQuality === -1, onClick: () => s == null ? void 0 : s.setQuality(-1) }),
|
|
2223
|
+
a.qualityLevels.map((u) => /* @__PURE__ */ t(S, { label: `${u.height}p`, value: `${Math.round(u.bitrate / 1e3)}k`, active: a.currentQuality === u.index, onClick: () => s == null ? void 0 : s.setQuality(u.index) }, u.index))
|
|
2224
|
+
] }),
|
|
2225
|
+
A === "audio" && /* @__PURE__ */ h(R, { children: [
|
|
2226
|
+
/* @__PURE__ */ t(H, { label: "Audio Track", onBack: () => T("main") }),
|
|
2227
|
+
a.audioTracks.length === 0 && /* @__PURE__ */ t("div", { className: "px-4 py-3 text-zinc-500 text-xs text-center", children: "No tracks available" }),
|
|
2228
|
+
a.audioTracks.map((u) => /* @__PURE__ */ t(S, { label: u.label, value: u.language, active: a.currentAudioTrack === u.index, onClick: () => s == null ? void 0 : s.setAudioTrack(u.index) }, u.index))
|
|
2229
|
+
] }),
|
|
2230
|
+
A === "boost" && /* @__PURE__ */ h(R, { children: [
|
|
2231
|
+
/* @__PURE__ */ t(H, { label: "Audio Boost", onBack: () => T("main") }),
|
|
2232
|
+
[1, 1.5, 2, 3].map((u) => /* @__PURE__ */ t(S, { label: u === 1 ? "Off" : `${u}x`, active: a.audioGain === u, onClick: () => s == null ? void 0 : s.setAudioGain(u) }, u))
|
|
2233
|
+
] }),
|
|
2234
|
+
A === "flip" && /* @__PURE__ */ h(R, { children: [
|
|
2235
|
+
/* @__PURE__ */ t(H, { label: "Video Flip", onBack: () => T("main") }),
|
|
2236
|
+
/* @__PURE__ */ h("div", { className: "p-2 space-y-1", children: [
|
|
2237
|
+
/* @__PURE__ */ t(X, { label: "Horizontal Flip", checked: a.flipState.horizontal, onChange: () => s == null ? void 0 : s.setFlip("horizontal") }),
|
|
2238
|
+
/* @__PURE__ */ t(X, { label: "Vertical Flip", checked: a.flipState.vertical, onChange: () => s == null ? void 0 : s.setFlip("vertical") })
|
|
2239
|
+
] })
|
|
2240
|
+
] }),
|
|
2241
|
+
A === "ratio" && /* @__PURE__ */ h(R, { children: [
|
|
2242
|
+
/* @__PURE__ */ t(H, { label: "Aspect Ratio", onBack: () => T("main") }),
|
|
2243
|
+
["default", "16:9", "4:3"].map((u) => /* @__PURE__ */ t(S, { label: u === "default" ? "Default" : u, active: a.aspectRatio === u, onClick: () => s == null ? void 0 : s.setAspectRatio(u) }, u))
|
|
2244
|
+
] }),
|
|
2245
|
+
A === "party" && /* @__PURE__ */ h(R, { children: [
|
|
2246
|
+
/* @__PURE__ */ t(H, { label: "Watch Party", onBack: () => T("main") }),
|
|
2247
|
+
/* @__PURE__ */ h("div", { className: "p-4 space-y-3", children: [
|
|
2248
|
+
/* @__PURE__ */ t("p", { className: "text-xs text-zinc-400 leading-relaxed", children: "Create a synchronized room on WatchParty.me to watch together." }),
|
|
2249
|
+
/* @__PURE__ */ t("a", { href: `https://www.watchparty.me/create?video=${encodeURIComponent(((rt = a.sources[a.currentSourceIndex]) == null ? void 0 : rt.url) || e || "")}`, 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" })
|
|
2250
|
+
] })
|
|
2251
|
+
] }),
|
|
2252
|
+
A === "appearance" && /* @__PURE__ */ h(R, { children: [
|
|
2253
|
+
/* @__PURE__ */ t(H, { label: "Appearance", onBack: () => T("main") }),
|
|
2254
|
+
/* @__PURE__ */ h("div", { className: "pb-1", children: [
|
|
2255
|
+
/* @__PURE__ */ t(J, { title: "Theme", children: /* @__PURE__ */ t("div", { className: "grid grid-cols-2 gap-2 px-3", children: ks.map((u) => /* @__PURE__ */ t("button", { onClick: () => s == null ? void 0 : s.setAppearance({ theme: u.value, themeColor: u.color }), className: `py-2 text-xs font-bold uppercase tracking-wide transition-colors border-[length:var(--border-width)] border-white/10 ${a.theme === u.value ? "bg-[var(--accent)] text-white" : "bg-white/5 text-zinc-400 hover:text-white"}`, style: { borderRadius: "var(--radius)" }, children: u.label }, u.value)) }) }),
|
|
2256
|
+
/* @__PURE__ */ t(J, { title: "Icon Size", children: /* @__PURE__ */ t("div", { className: "grid grid-cols-3 gap-1 px-3", children: ["small", "medium", "large"].map((u) => /* @__PURE__ */ t("button", { onClick: () => s == null ? void 0 : s.setAppearance({ iconSize: u }), className: `py-1.5 text-xs font-medium transition-colors ${a.iconSize === u ? "bg-white text-black" : "bg-white/5 text-zinc-400 hover:text-zinc-200"}`, style: { borderRadius: "var(--radius)" }, children: u.charAt(0).toUpperCase() + u.slice(1) }, u)) }) }),
|
|
2257
|
+
/* @__PURE__ */ h(J, { title: "Theme Color", children: [
|
|
2258
|
+
/* @__PURE__ */ t("div", { className: "grid grid-cols-6 gap-2 px-3", children: ws.map((u) => /* @__PURE__ */ t("button", { title: u.label, onClick: () => s == null ? void 0 : s.setAppearance({ themeColor: u.value }), className: `w-6 h-6 transition-transform hover:scale-110 ${a.themeColor === u.value ? "ring-2 ring-white scale-110" : "ring-1 ring-white/10"}`, style: { backgroundColor: u.value, borderRadius: "var(--radius-full)" }, children: a.themeColor === u.value && /* @__PURE__ */ t(Se, { className: "w-3 h-3 text-white mx-auto stroke-[3]" }) }, u.value)) }),
|
|
2259
|
+
/* @__PURE__ */ t("div", { className: "px-3 pt-4", children: /* @__PURE__ */ h("div", { className: "flex items-center gap-3 bg-white/5 p-2 hover:bg-white/10 transition-colors group", style: { borderRadius: "var(--radius)" }, children: [
|
|
2260
|
+
/* @__PURE__ */ t("div", { className: "relative w-6 h-6 overflow-hidden ring-1 ring-white/20", style: { borderRadius: "var(--radius-full)" }, children: /* @__PURE__ */ t("input", { type: "color", value: a.themeColor, onChange: (u) => s == null ? void 0 : s.setAppearance({ themeColor: u.target.value }), className: "absolute inset-[-4px] w-[150%] h-[150%] cursor-pointer p-0 border-0" }) }),
|
|
2261
|
+
/* @__PURE__ */ t("span", { className: "text-xs text-zinc-400 font-medium group-hover:text-zinc-200", children: "Custom Color" }),
|
|
2262
|
+
/* @__PURE__ */ t("span", { className: "text-[10px] font-mono text-zinc-500 ml-auto uppercase", children: a.themeColor })
|
|
2263
|
+
] }) })
|
|
2264
|
+
] })
|
|
2265
|
+
] })
|
|
2266
|
+
] })
|
|
2267
|
+
] })
|
|
2268
|
+
] }) })
|
|
2269
|
+
] }, "settings");
|
|
2270
|
+
default:
|
|
2271
|
+
return null;
|
|
2272
|
+
}
|
|
2273
|
+
}, Ot = ve(() => {
|
|
2274
|
+
const c = [
|
|
2275
|
+
// Loop (Playback Group)
|
|
2276
|
+
{ html: "Playback", isLabel: !0 },
|
|
2277
|
+
{
|
|
2278
|
+
html: "Loop",
|
|
2279
|
+
checked: a.isLooping,
|
|
2280
|
+
onClick: () => s == null ? void 0 : s.toggleLoop()
|
|
2281
|
+
},
|
|
2282
|
+
{ separator: !0 },
|
|
2283
|
+
// Flip (Transform Group)
|
|
2284
|
+
{ html: "Transform", isLabel: !0 },
|
|
2285
|
+
{ html: "Flip Horizontal", onClick: () => s == null ? void 0 : s.setFlip("horizontal") },
|
|
2286
|
+
{ html: "Flip Vertical", onClick: () => s == null ? void 0 : s.setFlip("vertical") },
|
|
2287
|
+
{ separator: !0 },
|
|
2288
|
+
// Aspect Ratio Group
|
|
2289
|
+
{ html: "Aspect Ratio", isLabel: !0 },
|
|
2290
|
+
{ html: "Default", checked: a.aspectRatio === "default", onClick: () => s == null ? void 0 : s.setAspectRatio("default") },
|
|
2291
|
+
{ html: "16:9", checked: a.aspectRatio === "16:9", onClick: () => s == null ? void 0 : s.setAspectRatio("16:9") },
|
|
2292
|
+
{ html: "4:3", checked: a.aspectRatio === "4:3", onClick: () => s == null ? void 0 : s.setAspectRatio("4:3") },
|
|
2293
|
+
{ separator: !0 },
|
|
2294
|
+
// Stats
|
|
2295
|
+
{
|
|
2296
|
+
html: "Video Info",
|
|
2297
|
+
icon: /* @__PURE__ */ t(fs, { className: "w-3.5 h-3.5" }),
|
|
2298
|
+
onClick: () => Re(!0)
|
|
2299
|
+
},
|
|
2300
|
+
{ separator: !0 }
|
|
2301
|
+
];
|
|
2302
|
+
return l.contextmenu && c.push(...l.contextmenu), c.push({
|
|
2303
|
+
html: /* @__PURE__ */ t("span", { className: "text-zinc-500 text-xs font-semibold tracking-wide", children: "StrataPlayer" }),
|
|
2304
|
+
disabled: !0
|
|
2305
|
+
}), c.push({
|
|
2306
|
+
html: "Close",
|
|
2307
|
+
onClick: (f) => f(),
|
|
2308
|
+
// Wrapper handles close
|
|
2309
|
+
icon: /* @__PURE__ */ t("div", { className: "text-red-400", children: /* @__PURE__ */ h("svg", { width: "12", height: "12", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "3", strokeLinecap: "round", strokeLinejoin: "round", children: [
|
|
2310
|
+
/* @__PURE__ */ t("path", { d: "M18 6 6 18" }),
|
|
2311
|
+
/* @__PURE__ */ t("path", { d: "m6 6 12 12" })
|
|
2312
|
+
] }) })
|
|
2313
|
+
}), c;
|
|
2314
|
+
}, [l.contextmenu, a.aspectRatio, a.isLooping, s]);
|
|
2315
|
+
return /* @__PURE__ */ h(
|
|
1630
2316
|
"div",
|
|
1631
2317
|
{
|
|
1632
|
-
|
|
1633
|
-
|
|
1634
|
-
|
|
2318
|
+
id: l.id,
|
|
2319
|
+
ref: Y,
|
|
2320
|
+
className: `group relative w-full h-full bg-black overflow-hidden select-none font-[family-name:var(--font-main)] outline-none rounded-[var(--radius)] text-zinc-100 strata-player-reset ${l.container || ""}`,
|
|
2321
|
+
style: { touchAction: "manipulation", "--accent": a.themeColor },
|
|
2322
|
+
onMouseMove: Ue,
|
|
1635
2323
|
onMouseLeave: () => {
|
|
1636
|
-
|
|
2324
|
+
a.isPlaying && !L && !$ && s && s.setControlsVisible(!1);
|
|
1637
2325
|
},
|
|
2326
|
+
onMouseDown: _e,
|
|
2327
|
+
onMouseUp: Ge,
|
|
2328
|
+
onTouchStart: _e,
|
|
2329
|
+
onTouchEnd: Ge,
|
|
2330
|
+
onContextMenu: Pt,
|
|
1638
2331
|
tabIndex: 0,
|
|
1639
2332
|
role: "region",
|
|
1640
2333
|
"aria-label": "Video Player",
|
|
1641
|
-
"data-theme":
|
|
1642
|
-
style: { "--accent": o.themeColor },
|
|
2334
|
+
"data-theme": a.theme,
|
|
1643
2335
|
children: [
|
|
1644
2336
|
/* @__PURE__ */ t("style", { children: `
|
|
1645
2337
|
[data-theme="default"] {
|
|
@@ -1693,7 +2385,6 @@ const Gt = v("VolumeX", [
|
|
|
1693
2385
|
text-shadow: 0 0 5px var(--accent);
|
|
1694
2386
|
}
|
|
1695
2387
|
|
|
1696
|
-
/* Specific Theme Overrides */
|
|
1697
2388
|
[data-theme="pixel"] .strata-control-btn {
|
|
1698
2389
|
border: 2px solid white;
|
|
1699
2390
|
background: black;
|
|
@@ -1731,255 +2422,162 @@ const Gt = v("VolumeX", [
|
|
|
1731
2422
|
border-radius: var(--radius-sm);
|
|
1732
2423
|
font-family: var(--font-main);
|
|
1733
2424
|
}
|
|
2425
|
+
|
|
2426
|
+
/* Override Backdrop for specific themes if needed */
|
|
2427
|
+
[data-theme="pixel"] .strata-backdrop { backdrop-filter: none; background: #000; }
|
|
2428
|
+
[data-theme="hacker"] .strata-backdrop { backdrop-filter: none; background: #000; }
|
|
1734
2429
|
` }),
|
|
1735
|
-
|
|
1736
|
-
!s && /* @__PURE__ */ t("div", { className: "absolute inset-0 flex items-center justify-center bg-zinc-950 z-50", children: /* @__PURE__ */ t(
|
|
1737
|
-
s && /* @__PURE__ */
|
|
1738
|
-
|
|
1739
|
-
|
|
1740
|
-
|
|
1741
|
-
|
|
2430
|
+
a.theme === "hacker" && /* @__PURE__ */ t("div", { className: "strata-scanlines" }),
|
|
2431
|
+
!s && /* @__PURE__ */ t("div", { className: "absolute inset-0 flex items-center justify-center bg-zinc-950 z-50", children: /* @__PURE__ */ t(Ce, { className: "w-10 h-10 text-[var(--accent)] animate-spin" }) }),
|
|
2432
|
+
s && /* @__PURE__ */ h(R, { children: [
|
|
2433
|
+
(it = l.layers) == null ? void 0 : it.map((c, f) => /* @__PURE__ */ t(
|
|
2434
|
+
"div",
|
|
2435
|
+
{
|
|
2436
|
+
className: `absolute inset-0 pointer-events-none z-10 ${c.className || ""}`,
|
|
2437
|
+
style: c.style,
|
|
2438
|
+
children: /* @__PURE__ */ t(ht, { content: c.html || "", className: "w-full h-full" })
|
|
2439
|
+
},
|
|
2440
|
+
f
|
|
2441
|
+
)),
|
|
2442
|
+
/* @__PURE__ */ t(ps, { notifications: a.notifications }),
|
|
2443
|
+
/* @__PURE__ */ t(bs, { cues: a.activeCues, settings: a.subtitleSettings }),
|
|
2444
|
+
/* @__PURE__ */ t("div", { className: "absolute inset-0 z-0", onClick: $t, "aria-hidden": "true" }),
|
|
2445
|
+
n && !ae && /* @__PURE__ */ t(
|
|
1742
2446
|
"div",
|
|
1743
2447
|
{
|
|
1744
2448
|
className: "absolute inset-0 bg-cover bg-center z-[5] pointer-events-none",
|
|
1745
|
-
style: { backgroundImage: `url(${
|
|
2449
|
+
style: { backgroundImage: `url(${n})` }
|
|
2450
|
+
}
|
|
2451
|
+
),
|
|
2452
|
+
K.visible && /* @__PURE__ */ t(
|
|
2453
|
+
xs,
|
|
2454
|
+
{
|
|
2455
|
+
x: K.x,
|
|
2456
|
+
y: K.y,
|
|
2457
|
+
items: Ot,
|
|
2458
|
+
onClose: () => le({ ...K, visible: !1 }),
|
|
2459
|
+
containerWidth: Nt,
|
|
2460
|
+
containerHeight: Me
|
|
2461
|
+
}
|
|
2462
|
+
),
|
|
2463
|
+
zt && s && /* @__PURE__ */ t(ys, { player: s, onClose: () => Re(!1) }),
|
|
2464
|
+
he && /* @__PURE__ */ h("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", children: [
|
|
2465
|
+
/* @__PURE__ */ t(hs, { className: "w-4 h-4 text-[var(--accent)] fill-current" }),
|
|
2466
|
+
/* @__PURE__ */ t("span", { className: "text-xs font-bold tracking-wider", children: "2x Speed" })
|
|
2467
|
+
] }),
|
|
2468
|
+
p && a.controlsVisible && /* @__PURE__ */ t(
|
|
2469
|
+
"button",
|
|
2470
|
+
{
|
|
2471
|
+
onClick: (c) => {
|
|
2472
|
+
c.stopPropagation(), s.toggleLock();
|
|
2473
|
+
},
|
|
2474
|
+
className: `absolute left-4 md:left-6 bottom-24 md:bottom-28 z-50 p-3 rounded-full bg-black/50 backdrop-blur-md border border-white/10 text-white transition-all active:scale-95 ${a.isLocked ? "text-[var(--accent)] bg-white/10" : "hover:bg-white/10"}`,
|
|
2475
|
+
children: a.isLocked ? /* @__PURE__ */ t(cs, { className: "w-5 h-5" }) : /* @__PURE__ */ t(ds, { className: "w-5 h-5" })
|
|
1746
2476
|
}
|
|
1747
2477
|
),
|
|
1748
|
-
|
|
1749
|
-
|
|
1750
|
-
|
|
1751
|
-
|
|
1752
|
-
|
|
1753
|
-
|
|
2478
|
+
_ && /* @__PURE__ */ t(
|
|
2479
|
+
"div",
|
|
2480
|
+
{
|
|
2481
|
+
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 ${_.type === "rewind" ? "left-0 rounded-r-[4rem]" : "right-0 rounded-l-[4rem]"}`,
|
|
2482
|
+
onAnimationEnd: () => ie(null),
|
|
2483
|
+
children: /* @__PURE__ */ h("div", { className: "flex flex-col items-center text-white drop-shadow-lg", children: [
|
|
2484
|
+
_.type === "rewind" ? /* @__PURE__ */ t(lt, { className: "w-12 h-12 animate-pulse" }) : /* @__PURE__ */ t(ct, { className: "w-12 h-12 animate-pulse" }),
|
|
2485
|
+
/* @__PURE__ */ t("span", { className: "font-bold text-sm mt-2 font-mono", children: _.type === "rewind" ? "-10s" : "+10s" })
|
|
2486
|
+
] })
|
|
2487
|
+
},
|
|
2488
|
+
_.id
|
|
2489
|
+
),
|
|
2490
|
+
a.isBuffering && /* @__PURE__ */ t("div", { className: "absolute inset-0 flex items-center justify-center z-20 pointer-events-none", children: /* @__PURE__ */ t(Ce, { className: "w-12 h-12 text-[var(--accent)] animate-spin drop-shadow-lg" }) }),
|
|
2491
|
+
a.error && /* @__PURE__ */ t("div", { className: "absolute inset-0 flex items-center justify-center z-30 bg-black/90 backdrop-blur-md animate-in fade-in", children: /* @__PURE__ */ h("div", { className: "flex flex-col items-center gap-4 text-red-500 p-8 max-w-md text-center", children: [
|
|
1754
2492
|
/* @__PURE__ */ t("span", { className: "text-5xl mb-2", children: "⚠️" }),
|
|
1755
2493
|
/* @__PURE__ */ t("h3", { className: "text-xl font-bold text-white", children: "Playback Error" }),
|
|
1756
|
-
/* @__PURE__ */ t("p", { className: "text-zinc-400 text-sm", children:
|
|
1757
|
-
/* @__PURE__ */ t("button", { onClick: () => s.load(s.store.get().sources[s.store.get().currentSourceIndex] || { url: e || "" },
|
|
2494
|
+
/* @__PURE__ */ t("p", { className: "text-zinc-400 text-sm", children: a.error }),
|
|
2495
|
+
/* @__PURE__ */ t("button", { onClick: () => s.load(s.store.get().sources[s.store.get().currentSourceIndex] || { url: e || "" }, b), 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" })
|
|
1758
2496
|
] }) }),
|
|
1759
|
-
(!
|
|
1760
|
-
|
|
1761
|
-
|
|
1762
|
-
|
|
1763
|
-
|
|
1764
|
-
|
|
1765
|
-
|
|
1766
|
-
|
|
1767
|
-
|
|
1768
|
-
|
|
1769
|
-
|
|
1770
|
-
|
|
1771
|
-
|
|
1772
|
-
|
|
1773
|
-
|
|
1774
|
-
|
|
1775
|
-
|
|
1776
|
-
|
|
1777
|
-
|
|
1778
|
-
|
|
1779
|
-
|
|
1780
|
-
|
|
1781
|
-
|
|
1782
|
-
|
|
1783
|
-
|
|
1784
|
-
|
|
1785
|
-
|
|
1786
|
-
|
|
1787
|
-
|
|
1788
|
-
|
|
1789
|
-
|
|
1790
|
-
|
|
1791
|
-
|
|
1792
|
-
|
|
1793
|
-
|
|
1794
|
-
|
|
1795
|
-
|
|
1796
|
-
className: "absolute top-1/2 -translate-y-1/2 -
|
|
1797
|
-
style: {
|
|
1798
|
-
|
|
1799
|
-
|
|
1800
|
-
}
|
|
1801
|
-
}
|
|
1802
|
-
)
|
|
1803
|
-
]
|
|
1804
|
-
}
|
|
1805
|
-
),
|
|
1806
|
-
/* @__PURE__ */ d("div", { className: "flex items-center justify-between", children: [
|
|
1807
|
-
/* @__PURE__ */ d("div", { className: "flex items-center gap-3", children: [
|
|
1808
|
-
/* @__PURE__ */ t("button", { onClick: () => s.togglePlay(), className: `strata-control-btn text-zinc-300 hover:text-white transition-colors hover:bg-white/10 focus:outline-none ${F}`, style: { borderRadius: "var(--radius)" }, children: o.isPlaying ? /* @__PURE__ */ t(Ae, { className: `${L} fill-current` }) : /* @__PURE__ */ t(Le, { className: `${L} fill-current` }) }),
|
|
1809
|
-
/* @__PURE__ */ d("div", { className: "flex items-center gap-2 group/vol relative", onMouseEnter: () => ve(!0), onMouseLeave: () => ve(!1), children: [
|
|
1810
|
-
/* @__PURE__ */ t("button", { onClick: () => s.toggleMute(), className: `strata-control-btn text-zinc-300 hover:text-white hover:bg-white/10 focus:outline-none ${F}`, style: { borderRadius: "var(--radius)" }, children: /* @__PURE__ */ t(Ke, { className: L }) }),
|
|
1811
|
-
/* @__PURE__ */ t("div", { className: `relative h-8 flex items-center transition-all duration-300 ease-out overflow-hidden ${fe || me ? "w-28 opacity-100 ml-1" : "w-0 opacity-0"}`, children: /* @__PURE__ */ d("div", { ref: ae, className: "relative w-full h-full flex items-center cursor-pointer px-2", onMouseDown: ze, onTouchStart: ze, children: [
|
|
1812
|
-
/* @__PURE__ */ t("div", { className: "w-full h-1 bg-white/20 overflow-hidden", style: { borderRadius: "var(--radius-full)" }, children: /* @__PURE__ */ t("div", { className: "h-full bg-white", style: { width: `${(o.isMuted ? 0 : o.volume) * 100}%`, borderRadius: "var(--radius-full)" } }) }),
|
|
1813
|
-
/* @__PURE__ */ t("div", { className: "absolute h-3 w-3 bg-white shadow-md top-1/2 -translate-y-1/2 pointer-events-none", style: { left: `calc(${(o.isMuted ? 0 : o.volume) * 100}% * 0.85 + 4px)`, borderRadius: "var(--radius-full)" } })
|
|
1814
|
-
] }) }),
|
|
1815
|
-
(fe || me) && /* @__PURE__ */ t(
|
|
1816
|
-
"div",
|
|
1817
|
-
{
|
|
1818
|
-
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",
|
|
1819
|
-
style: { left: `calc(52px + ${(o.isMuted ? 0 : o.volume) * 80}px)` },
|
|
1820
|
-
children: o.isMuted ? "0%" : `${Math.round(o.volume * 100)}%`
|
|
1821
|
-
}
|
|
1822
|
-
)
|
|
1823
|
-
] }),
|
|
1824
|
-
/* @__PURE__ */ d("div", { className: "text-xs font-medium text-zinc-400 font-mono select-none hidden sm:block tabular-nums", children: [
|
|
1825
|
-
se(Z ? ee : o.currentTime),
|
|
1826
|
-
" ",
|
|
1827
|
-
/* @__PURE__ */ t("span", { className: "text-zinc-600", children: "/" }),
|
|
1828
|
-
" ",
|
|
1829
|
-
se(o.duration)
|
|
1830
|
-
] })
|
|
1831
|
-
] }),
|
|
1832
|
-
/* @__PURE__ */ d("div", { className: "flex items-center gap-1", children: [
|
|
1833
|
-
/* @__PURE__ */ d("div", { className: "relative", children: [
|
|
1834
|
-
/* @__PURE__ */ t("button", { onClick: (r) => {
|
|
1835
|
-
r.stopPropagation(), B(!I), $(!1);
|
|
1836
|
-
}, className: `strata-control-btn transition-colors focus:outline-none ${F} ${I ? "text-[var(--accent)] bg-white/10" : "text-zinc-300 hover:text-white hover:bg-white/10"}`, style: { borderRadius: "var(--radius)" }, children: /* @__PURE__ */ t(Zt, { className: L }) }),
|
|
1837
|
-
de.isMounted && /* @__PURE__ */ t(
|
|
1838
|
-
yi,
|
|
1839
|
-
{
|
|
1840
|
-
tracks: o.subtitleTracks,
|
|
1841
|
-
current: o.currentSubtitle,
|
|
1842
|
-
onSelect: (r) => s.setSubtitle(r),
|
|
1843
|
-
onUpload: (r) => s.addTextTrack(r, r.name),
|
|
1844
|
-
onClose: () => B(!1),
|
|
1845
|
-
settings: o.subtitleSettings,
|
|
1846
|
-
onSettingsChange: (r) => s.updateSubtitleSettings(r),
|
|
1847
|
-
onReset: () => s.resetSubtitleSettings(),
|
|
1848
|
-
offset: o.subtitleOffset,
|
|
1849
|
-
onOffsetChange: (r) => s.setSubtitleOffset(r),
|
|
1850
|
-
maxHeight: Te,
|
|
1851
|
-
animationClass: de.isVisible ? "opacity-100 translate-y-0 scale-100" : "opacity-0 translate-y-2 scale-95"
|
|
1852
|
-
}
|
|
1853
|
-
)
|
|
1854
|
-
] }),
|
|
1855
|
-
/* @__PURE__ */ t("button", { onClick: () => s.togglePip(), className: `strata-control-btn text-zinc-300 hover:text-white hover:bg-white/10 transition-colors hidden sm:block focus:outline-none ${F}`, style: { borderRadius: "var(--radius)" }, children: /* @__PURE__ */ t(Yt, { className: L }) }),
|
|
1856
|
-
/* @__PURE__ */ t("button", { onClick: () => s.download(), className: `strata-control-btn text-zinc-300 hover:text-white hover:bg-white/10 transition-colors hidden sm:block focus:outline-none ${F}`, style: { borderRadius: "var(--radius)" }, children: /* @__PURE__ */ t(ei, { className: L }) }),
|
|
1857
|
-
/* @__PURE__ */ d("div", { className: "relative", children: [
|
|
1858
|
-
/* @__PURE__ */ t("button", { onClick: (r) => {
|
|
1859
|
-
r.stopPropagation(), $(!E), B(!1), N("main");
|
|
1860
|
-
}, className: `strata-control-btn transition-all duration-300 focus:outline-none ${F} ${E ? "rotate-90 text-[var(--accent)] bg-white/10" : "text-zinc-300 hover:text-white hover:bg-white/10"}`, style: { borderRadius: "var(--radius)" }, children: /* @__PURE__ */ t(Kt, { className: L }) }),
|
|
1861
|
-
ce.isMounted && /* @__PURE__ */ t(We, { onClose: () => $(!1), align: "right", maxHeight: Te, className: ce.isVisible ? "opacity-100 translate-y-0 scale-100" : "opacity-0 translate-y-2 scale-95", children: /* @__PURE__ */ d("div", { className: "w-full", children: [
|
|
1862
|
-
P === "main" && /* @__PURE__ */ d("div", { className: "animate-in slide-in-from-left-4 fade-in duration-200", children: [
|
|
1863
|
-
/* @__PURE__ */ t("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__ */ t("span", { children: "Settings" }) }),
|
|
1864
|
-
o.sources.length > 1 && /* @__PURE__ */ t(k, { label: "Source", value: ((Me = o.sources[o.currentSourceIndex]) == null ? void 0 : Me.name) || `Source ${o.currentSourceIndex + 1}`, onClick: () => N("sources"), hasSubmenu: !0 }),
|
|
1865
|
-
/* @__PURE__ */ t(k, { label: "Speed", value: `${o.playbackRate}x`, onClick: () => N("speed"), hasSubmenu: !0 }),
|
|
1866
|
-
/* @__PURE__ */ t(k, { label: "Quality", value: o.currentQuality === -1 ? "Auto" : `${(Ee = o.qualityLevels[o.currentQuality]) == null ? void 0 : Ee.height}p`, onClick: () => N("quality"), hasSubmenu: !0 }),
|
|
1867
|
-
/* @__PURE__ */ t(k, { label: "Audio", value: ((Ie = o.audioTracks[o.currentAudioTrack]) == null ? void 0 : Ie.label) || "Default", onClick: () => N("audio"), hasSubmenu: !0 }),
|
|
1868
|
-
/* @__PURE__ */ t(k, { label: "Audio Boost", value: o.audioGain > 1 ? `${o.audioGain}x` : "Off", onClick: () => N("boost"), hasSubmenu: !0 }),
|
|
1869
|
-
/* @__PURE__ */ t(Oe, {}),
|
|
1870
|
-
/* @__PURE__ */ t(k, { label: "Watch Party", icon: /* @__PURE__ */ t(ri, { className: "w-4 h-4" }), onClick: () => N("party"), hasSubmenu: !0 }),
|
|
1871
|
-
/* @__PURE__ */ t(k, { label: "Cast to Device", icon: /* @__PURE__ */ t(ai, { className: "w-4 h-4" }), onClick: () => {
|
|
1872
|
-
s.requestCast(), $(!1);
|
|
1873
|
-
} }),
|
|
1874
|
-
/* @__PURE__ */ t(Oe, {}),
|
|
1875
|
-
/* @__PURE__ */ t(k, { label: "Appearance", icon: /* @__PURE__ */ t(Ge, { className: "w-4 h-4" }), onClick: () => N("appearance"), hasSubmenu: !0 })
|
|
1876
|
-
] }),
|
|
1877
|
-
["speed", "quality", "audio", "boost", "party", "appearance", "sources"].includes(P) && /* @__PURE__ */ d("div", { className: "animate-in slide-in-from-right-4 fade-in duration-200", children: [
|
|
1878
|
-
P === "sources" && /* @__PURE__ */ d(A, { children: [
|
|
1879
|
-
/* @__PURE__ */ t(j, { label: "Select Source", onBack: () => N("main") }),
|
|
1880
|
-
o.sources.map((r, m) => /* @__PURE__ */ t(k, { label: r.name || `Source ${m + 1}`, value: r.type, active: o.currentSourceIndex === m, onClick: () => s.switchSource(m) }, m))
|
|
1881
|
-
] }),
|
|
1882
|
-
P === "speed" && /* @__PURE__ */ d(A, { children: [
|
|
1883
|
-
/* @__PURE__ */ t(j, { label: "Speed", onBack: () => N("main") }),
|
|
1884
|
-
[0.5, 1, 1.5, 2].map((r) => /* @__PURE__ */ t(k, { label: `${r}x`, active: o.playbackRate === r, onClick: () => s.video.playbackRate = r }, r))
|
|
1885
|
-
] }),
|
|
1886
|
-
P === "quality" && /* @__PURE__ */ d(A, { children: [
|
|
1887
|
-
/* @__PURE__ */ t(j, { label: "Quality", onBack: () => N("main") }),
|
|
1888
|
-
/* @__PURE__ */ t(k, { label: "Auto", active: o.currentQuality === -1, onClick: () => s.setQuality(-1) }),
|
|
1889
|
-
o.qualityLevels.map((r) => /* @__PURE__ */ t(k, { label: `${r.height}p`, value: `${Math.round(r.bitrate / 1e3)}k`, active: o.currentQuality === r.index, onClick: () => s.setQuality(r.index) }, r.index))
|
|
1890
|
-
] }),
|
|
1891
|
-
P === "audio" && /* @__PURE__ */ d(A, { children: [
|
|
1892
|
-
/* @__PURE__ */ t(j, { label: "Audio Track", onBack: () => N("main") }),
|
|
1893
|
-
o.audioTracks.length === 0 && /* @__PURE__ */ t("div", { className: "px-4 py-3 text-zinc-500 text-xs text-center", children: "No tracks available" }),
|
|
1894
|
-
o.audioTracks.map((r) => /* @__PURE__ */ t(k, { label: r.label, value: r.language, active: o.currentAudioTrack === r.index, onClick: () => s.setAudioTrack(r.index) }, r.index))
|
|
1895
|
-
] }),
|
|
1896
|
-
P === "boost" && /* @__PURE__ */ d(A, { children: [
|
|
1897
|
-
/* @__PURE__ */ t(j, { label: "Audio Boost", onBack: () => N("main") }),
|
|
1898
|
-
[1, 1.5, 2, 3].map((r) => /* @__PURE__ */ t(k, { label: r === 1 ? "Off" : `${r}x`, active: o.audioGain === r, onClick: () => s.setAudioGain(r) }, r))
|
|
2497
|
+
!a.isLocked && (!a.isPlaying && !a.isBuffering && !a.error || a.controlsVisible) && !a.isBuffering ? /* @__PURE__ */ t(
|
|
2498
|
+
"div",
|
|
2499
|
+
{
|
|
2500
|
+
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"}`,
|
|
2501
|
+
children: /* @__PURE__ */ h("div", { className: "flex items-center gap-8 md:gap-16 pointer-events-auto", children: [
|
|
2502
|
+
/* @__PURE__ */ t("button", { onClick: (c) => {
|
|
2503
|
+
c.stopPropagation(), O(!1), W(!1), se("rewind");
|
|
2504
|
+
}, className: `group flex items-center justify-center rounded-full bg-black/40 hover:bg-black/60 border border-white/10 transition-all active:scale-110 text-white/90 focus:outline-none backdrop-blur-sm ${G.skipBtn}`, children: /* @__PURE__ */ t(lt, { className: G.skipIcon }) }),
|
|
2505
|
+
/* @__PURE__ */ t("button", { onClick: (c) => {
|
|
2506
|
+
c.stopPropagation(), O(!1), W(!1), s.togglePlay();
|
|
2507
|
+
}, 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 hover:scale-105 active:scale-110 duration-75 focus:outline-none backdrop-blur-md ${G.playBtn}`, children: a.isPlaying ? /* @__PURE__ */ t(ot, { className: `${G.playIcon} text-white fill-current` }) : /* @__PURE__ */ t(at, { className: `${G.playIcon} text-white ml-1 fill-current` }) }),
|
|
2508
|
+
/* @__PURE__ */ t("button", { onClick: (c) => {
|
|
2509
|
+
c.stopPropagation(), O(!1), W(!1), se("forward");
|
|
2510
|
+
}, className: `group flex items-center justify-center rounded-full bg-black/40 hover:bg-black/60 border border-white/10 transition-all active:scale-110 text-white/90 focus:outline-none backdrop-blur-sm ${G.skipBtn}`, children: /* @__PURE__ */ t(ct, { className: G.skipIcon }) })
|
|
2511
|
+
] })
|
|
2512
|
+
}
|
|
2513
|
+
) : null,
|
|
2514
|
+
/* @__PURE__ */ h(
|
|
2515
|
+
"div",
|
|
2516
|
+
{
|
|
2517
|
+
className: `absolute inset-x-0 bottom-0 z-30 transition-all duration-300 px-4 md:px-6 pb-4 md:pb-6 pt-24 bg-gradient-to-t from-black/95 via-black/70 to-transparent ${Ft ? "opacity-100 translate-y-0" : "opacity-0 translate-y-4 pointer-events-none"}`,
|
|
2518
|
+
onClick: (c) => {
|
|
2519
|
+
c.target === c.currentTarget && (O(!1), W(!1), te(!1)), c.stopPropagation();
|
|
2520
|
+
},
|
|
2521
|
+
children: [
|
|
2522
|
+
!l.isLive && /* @__PURE__ */ h(
|
|
2523
|
+
"div",
|
|
2524
|
+
{
|
|
2525
|
+
ref: fe,
|
|
2526
|
+
className: "relative w-full h-3 group/slider mb-3 cursor-pointer touch-none flex items-center",
|
|
2527
|
+
onMouseMove: Lt,
|
|
2528
|
+
onMouseLeave: () => {
|
|
2529
|
+
je(null), He(null);
|
|
2530
|
+
},
|
|
2531
|
+
onMouseDown: Qe,
|
|
2532
|
+
onTouchStart: Qe,
|
|
2533
|
+
children: [
|
|
2534
|
+
(st = l.highlight) == null ? void 0 : st.map((c, f) => /* @__PURE__ */ t("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 }, f)),
|
|
2535
|
+
Oe !== null && /* @__PURE__ */ h("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, ${It}%, calc(100% - 70px))` }, children: [
|
|
2536
|
+
q && /* @__PURE__ */ t("div", { className: "bg-black/90 border border-white/10 shadow-2xl overflow-hidden backdrop-blur-sm", style: { width: `${q.w * 0.5}px`, height: `${q.h * 0.5}px`, borderRadius: "var(--radius)" }, children: /* @__PURE__ */ t("div", { style: { backgroundImage: `url("${q.url}")`, width: `${q.w}px`, height: `${q.h}px`, backgroundPosition: `-${q.x}px -${q.y}px`, backgroundRepeat: "no-repeat", transform: "scale(0.5)", transformOrigin: "top left" } }) }),
|
|
2537
|
+
/* @__PURE__ */ t("div", { className: "strata-tooltip px-2 py-0.5 text-[11px] font-bold font-mono shadow-lg tabular-nums mt-1", children: xe(Oe) })
|
|
1899
2538
|
] }),
|
|
1900
|
-
|
|
1901
|
-
/* @__PURE__ */ t(
|
|
1902
|
-
/* @__PURE__ */
|
|
1903
|
-
/* @__PURE__ */ t("p", { className: "text-xs text-zinc-400 leading-relaxed", children: "Create a synchronized room on WatchParty.me to watch together." }),
|
|
1904
|
-
/* @__PURE__ */ t("a", { href: `https://www.watchparty.me/create?video=${encodeURIComponent(((Re = o.sources[o.currentSourceIndex]) == null ? void 0 : Re.url) || e || "")}`, 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" })
|
|
1905
|
-
] })
|
|
2539
|
+
/* @__PURE__ */ h("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: [
|
|
2540
|
+
a.duration > 0 && a.buffered.map((c, f) => /* @__PURE__ */ t("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}%` } }, f)),
|
|
2541
|
+
/* @__PURE__ */ t("div", { className: "absolute left-0 top-0 bottom-0 bg-[var(--accent)]", style: { width: `${(ce ? de : a.currentTime) / a.duration * 100}%` } })
|
|
1906
2542
|
] }),
|
|
1907
|
-
|
|
1908
|
-
|
|
1909
|
-
|
|
1910
|
-
|
|
1911
|
-
|
|
1912
|
-
{
|
|
1913
|
-
|
|
1914
|
-
|
|
1915
|
-
|
|
1916
|
-
|
|
1917
|
-
|
|
1918
|
-
|
|
1919
|
-
|
|
1920
|
-
|
|
1921
|
-
|
|
1922
|
-
|
|
1923
|
-
|
|
1924
|
-
|
|
1925
|
-
|
|
1926
|
-
|
|
1927
|
-
},
|
|
1928
|
-
r
|
|
1929
|
-
)) }) }),
|
|
1930
|
-
/* @__PURE__ */ d(D, { title: "Theme Color", children: [
|
|
1931
|
-
/* @__PURE__ */ t("div", { className: "grid grid-cols-6 gap-2 px-3", children: xi.map((r) => /* @__PURE__ */ t(
|
|
1932
|
-
"button",
|
|
1933
|
-
{
|
|
1934
|
-
title: r.label,
|
|
1935
|
-
onClick: () => s.setAppearance({ themeColor: r.value }),
|
|
1936
|
-
className: `w-6 h-6 transition-transform hover:scale-110 ${o.themeColor === r.value ? "ring-2 ring-white scale-110" : "ring-1 ring-white/10"}`,
|
|
1937
|
-
style: { backgroundColor: r.value, borderRadius: "var(--radius-full)" },
|
|
1938
|
-
children: o.themeColor === r.value && /* @__PURE__ */ t(Ue, { className: "w-3 h-3 text-white mx-auto stroke-[3]" })
|
|
1939
|
-
},
|
|
1940
|
-
r.value
|
|
1941
|
-
)) }),
|
|
1942
|
-
/* @__PURE__ */ t("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: [
|
|
1943
|
-
/* @__PURE__ */ t("div", { className: "relative w-6 h-6 overflow-hidden ring-1 ring-white/20", style: { borderRadius: "var(--radius-full)" }, children: /* @__PURE__ */ t(
|
|
1944
|
-
"input",
|
|
1945
|
-
{
|
|
1946
|
-
type: "color",
|
|
1947
|
-
value: o.themeColor,
|
|
1948
|
-
onChange: (r) => s.setAppearance({ themeColor: r.target.value }),
|
|
1949
|
-
className: "absolute inset-[-4px] w-[150%] h-[150%] cursor-pointer p-0 border-0"
|
|
1950
|
-
}
|
|
1951
|
-
) }),
|
|
1952
|
-
/* @__PURE__ */ t("span", { className: "text-xs text-zinc-400 font-medium group-hover:text-zinc-200", children: "Custom Color" }),
|
|
1953
|
-
/* @__PURE__ */ t("span", { className: "text-[10px] font-mono text-zinc-500 ml-auto uppercase", children: o.themeColor })
|
|
1954
|
-
] }) })
|
|
1955
|
-
] })
|
|
1956
|
-
] })
|
|
1957
|
-
] })
|
|
1958
|
-
] })
|
|
1959
|
-
] }) })
|
|
1960
|
-
] }),
|
|
1961
|
-
/* @__PURE__ */ t("button", { onClick: () => s.toggleFullscreen(), className: `strata-control-btn text-zinc-300 hover:text-white hover:bg-white/10 rounded-lg transition-transform hover:scale-110 focus:outline-none ${F}`, style: { borderRadius: "var(--radius)" }, children: o.isFullscreen ? /* @__PURE__ */ t(Jt, { className: L }) : /* @__PURE__ */ t(Xt, { className: L }) })
|
|
1962
|
-
] })
|
|
1963
|
-
] })
|
|
1964
|
-
] })
|
|
2543
|
+
/* @__PURE__ */ t(
|
|
2544
|
+
"div",
|
|
2545
|
+
{
|
|
2546
|
+
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",
|
|
2547
|
+
style: {
|
|
2548
|
+
left: `${(ce ? de : a.currentTime) / a.duration * 100}%`,
|
|
2549
|
+
borderRadius: "var(--radius-full)"
|
|
2550
|
+
}
|
|
2551
|
+
}
|
|
2552
|
+
)
|
|
2553
|
+
]
|
|
2554
|
+
}
|
|
2555
|
+
),
|
|
2556
|
+
/* @__PURE__ */ h("div", { className: "flex items-center justify-between pointer-events-auto", children: [
|
|
2557
|
+
/* @__PURE__ */ t("div", { className: "flex items-center gap-3", children: et.filter((c) => c.position === "left" || c.position === "center").map(tt) }),
|
|
2558
|
+
/* @__PURE__ */ t("div", { className: "flex items-center gap-1", children: et.filter((c) => c.position === "right").map(tt) })
|
|
2559
|
+
] })
|
|
2560
|
+
]
|
|
2561
|
+
}
|
|
2562
|
+
)
|
|
1965
2563
|
] })
|
|
1966
2564
|
]
|
|
1967
2565
|
}
|
|
1968
2566
|
);
|
|
1969
|
-
},
|
|
1970
|
-
const i =
|
|
1971
|
-
return i.render(
|
|
2567
|
+
}, Rs = (o, e) => {
|
|
2568
|
+
const i = Dt(o);
|
|
2569
|
+
return i.render(we.createElement(mt, e)), {
|
|
1972
2570
|
unmount: () => {
|
|
1973
2571
|
i.unmount();
|
|
1974
2572
|
},
|
|
1975
|
-
update: (
|
|
1976
|
-
i.render(
|
|
2573
|
+
update: (r) => {
|
|
2574
|
+
i.render(we.createElement(mt, { ...e, ...r }));
|
|
1977
2575
|
}
|
|
1978
2576
|
};
|
|
1979
2577
|
};
|
|
1980
2578
|
export {
|
|
1981
|
-
|
|
1982
|
-
|
|
1983
|
-
|
|
2579
|
+
Qt as StrataCore,
|
|
2580
|
+
mt as StrataPlayer,
|
|
2581
|
+
Rs as mountStrataPlayer
|
|
1984
2582
|
};
|
|
1985
2583
|
//# sourceMappingURL=strataplayer.es.js.map
|