strataplayer 1.2.11 → 1.2.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/strataplayer.es.js
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
import ze, { useState as
|
|
5
|
-
import { createRoot as
|
|
1
|
+
var Kt = Object.defineProperty;
|
|
2
|
+
var Yt = (s, t, i) => t in s ? Kt(s, t, { enumerable: !0, configurable: !0, writable: !0, value: i }) : s[t] = i;
|
|
3
|
+
var N = (s, t, i) => Yt(s, typeof t != "symbol" ? t + "" : t, i);
|
|
4
|
+
import ze, { useState as S, useEffect as P, useRef as I, useLayoutEffect as Zt, useMemo as Ce, useSyncExternalStore as ei, useCallback as Ne } from "react";
|
|
5
|
+
import { createRoot as ti } from "react-dom/client";
|
|
6
6
|
import { jsxs as l, jsx as e, Fragment as L } from "react/jsx-runtime";
|
|
7
|
-
|
|
7
|
+
import { createPortal as ii } from "react-dom";
|
|
8
|
+
class si {
|
|
8
9
|
constructor() {
|
|
9
|
-
|
|
10
|
+
N(this, "events");
|
|
10
11
|
this.events = /* @__PURE__ */ new Map();
|
|
11
12
|
}
|
|
12
13
|
on(t, i) {
|
|
@@ -28,10 +29,10 @@ class Yt {
|
|
|
28
29
|
this.events.clear();
|
|
29
30
|
}
|
|
30
31
|
}
|
|
31
|
-
class
|
|
32
|
+
class ni {
|
|
32
33
|
constructor(t) {
|
|
33
|
-
|
|
34
|
-
|
|
34
|
+
N(this, "state");
|
|
35
|
+
N(this, "listeners");
|
|
35
36
|
this.state = t, this.listeners = /* @__PURE__ */ new Set();
|
|
36
37
|
}
|
|
37
38
|
get() {
|
|
@@ -48,13 +49,13 @@ class Zt {
|
|
|
48
49
|
this.listeners.clear();
|
|
49
50
|
}
|
|
50
51
|
}
|
|
51
|
-
class
|
|
52
|
+
class ri {
|
|
52
53
|
constructor(t) {
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
54
|
+
N(this, "context", null);
|
|
55
|
+
N(this, "source", null);
|
|
56
|
+
N(this, "gainNode", null);
|
|
57
|
+
N(this, "video");
|
|
58
|
+
N(this, "isInitialized", !1);
|
|
58
59
|
this.video = t;
|
|
59
60
|
}
|
|
60
61
|
/**
|
|
@@ -88,7 +89,7 @@ const Re = {
|
|
|
88
89
|
isBold: !1,
|
|
89
90
|
textColor: "#ffffff",
|
|
90
91
|
verticalOffset: 40
|
|
91
|
-
},
|
|
92
|
+
}, kt = "strata-settings", B = {
|
|
92
93
|
isPlaying: !1,
|
|
93
94
|
isBuffering: !1,
|
|
94
95
|
isLive: !1,
|
|
@@ -105,6 +106,7 @@ const Re = {
|
|
|
105
106
|
currentAudioTrack: -1,
|
|
106
107
|
error: null,
|
|
107
108
|
isFullscreen: !1,
|
|
109
|
+
isWebFullscreen: !1,
|
|
108
110
|
isPip: !1,
|
|
109
111
|
subtitleTracks: [],
|
|
110
112
|
currentSubtitle: -1,
|
|
@@ -125,11 +127,11 @@ const Re = {
|
|
|
125
127
|
isAutoSized: !1,
|
|
126
128
|
isLooping: !1,
|
|
127
129
|
controlsVisible: !0
|
|
128
|
-
},
|
|
130
|
+
}, St = (s = {}) => {
|
|
129
131
|
let t = {};
|
|
130
132
|
if (!s.disablePersistence && typeof window < "u")
|
|
131
133
|
try {
|
|
132
|
-
const r = localStorage.getItem(
|
|
134
|
+
const r = localStorage.getItem(kt);
|
|
133
135
|
r && (t = JSON.parse(r));
|
|
134
136
|
} catch {
|
|
135
137
|
}
|
|
@@ -139,48 +141,48 @@ const Re = {
|
|
|
139
141
|
...s.subtitleSettings || {}
|
|
140
142
|
};
|
|
141
143
|
return {
|
|
142
|
-
...
|
|
144
|
+
...B,
|
|
143
145
|
...t,
|
|
144
146
|
// Load saved first
|
|
145
147
|
// Override with config if present (not undefined)
|
|
146
|
-
volume: s.volume ?? t.volume ??
|
|
147
|
-
isMuted: s.muted ?? t.isMuted ??
|
|
148
|
-
playbackRate: s.playbackRate ?? t.playbackRate ??
|
|
149
|
-
audioGain: s.audioGain ?? t.audioGain ??
|
|
150
|
-
theme: s.theme ?? t.theme ??
|
|
151
|
-
themeColor: s.themeColor ?? t.themeColor ??
|
|
152
|
-
iconSize: s.iconSize ?? t.iconSize ??
|
|
148
|
+
volume: s.volume ?? t.volume ?? B.volume,
|
|
149
|
+
isMuted: s.muted ?? t.isMuted ?? B.isMuted,
|
|
150
|
+
playbackRate: s.playbackRate ?? t.playbackRate ?? B.playbackRate,
|
|
151
|
+
audioGain: s.audioGain ?? t.audioGain ?? B.audioGain,
|
|
152
|
+
theme: s.theme ?? t.theme ?? B.theme,
|
|
153
|
+
themeColor: s.themeColor ?? t.themeColor ?? B.themeColor,
|
|
154
|
+
iconSize: s.iconSize ?? t.iconSize ?? B.iconSize,
|
|
153
155
|
subtitleSettings: i,
|
|
154
156
|
// Config overrides state for these visual modes
|
|
155
|
-
isAutoSized: s.autoSize ??
|
|
156
|
-
isLive: s.isLive ?? t.isLive ??
|
|
157
|
-
isLooping: s.loop ?? t.isLooping ??
|
|
157
|
+
isAutoSized: s.autoSize ?? B.isAutoSized,
|
|
158
|
+
isLive: s.isLive ?? t.isLive ?? B.isLive,
|
|
159
|
+
isLooping: s.loop ?? t.isLooping ?? B.isLooping
|
|
158
160
|
};
|
|
159
161
|
};
|
|
160
|
-
class
|
|
162
|
+
class oi {
|
|
161
163
|
constructor(t = {}, i) {
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
164
|
+
N(this, "video");
|
|
165
|
+
N(this, "container", null);
|
|
166
|
+
N(this, "events");
|
|
167
|
+
N(this, "store");
|
|
168
|
+
N(this, "plugins", /* @__PURE__ */ new Map());
|
|
169
|
+
N(this, "audioEngine");
|
|
170
|
+
N(this, "config");
|
|
171
|
+
N(this, "resizeObserver", null);
|
|
170
172
|
// Retry Logic
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
173
|
+
N(this, "retryCount", 0);
|
|
174
|
+
N(this, "maxRetries", 5);
|
|
175
|
+
N(this, "retryTimer", null);
|
|
176
|
+
N(this, "currentSource", null);
|
|
177
|
+
N(this, "currentSrc", "");
|
|
178
|
+
N(this, "currentTracks", []);
|
|
177
179
|
// Cast
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
this.config = t, this.config.autoOrientation = this.config.autoOrientation ?? !0, this.config.fetchTimeout = this.config.fetchTimeout ?? 3e4, this.config.centerControls = this.config.centerControls ?? !0, this.config.gestureSeek = this.config.gestureSeek ?? !1, this.video = i || document.createElement("video"), this.video.crossOrigin = "anonymous", t.playsInline !== !1 && (this.video.playsInline = !0), this.events = new
|
|
182
|
-
const r =
|
|
183
|
-
this.store = new
|
|
180
|
+
N(this, "castInitialized", !1);
|
|
181
|
+
N(this, "boundCueChange");
|
|
182
|
+
N(this, "boundFullscreenChange");
|
|
183
|
+
this.config = t, this.config.autoOrientation = this.config.autoOrientation ?? !0, this.config.fetchTimeout = this.config.fetchTimeout ?? 3e4, this.config.centerControls = this.config.centerControls ?? !0, this.config.gestureSeek = this.config.gestureSeek ?? !1, this.video = i || document.createElement("video"), this.video.crossOrigin = "anonymous", t.playsInline !== !1 && (this.video.playsInline = !0), this.events = new si();
|
|
184
|
+
const r = St(t);
|
|
185
|
+
this.store = new ni(r), this.audioEngine = new ri(this.video), this.boundCueChange = this.handleCueChange.bind(this), this.boundFullscreenChange = () => {
|
|
184
186
|
const a = !!document.fullscreenElement;
|
|
185
187
|
if (this.store.setState({ isFullscreen: a }), this.emit("resize"), this.emit(a ? "fullscreen" : "fullscreen_exit"), a && this.config.autoOrientation && screen.orientation && "lock" in screen.orientation) {
|
|
186
188
|
const m = this.video.videoWidth > this.video.videoHeight ? "landscape" : "portrait";
|
|
@@ -202,7 +204,7 @@ class ti {
|
|
|
202
204
|
isLive: a.isLive,
|
|
203
205
|
isLooping: a.isLooping
|
|
204
206
|
};
|
|
205
|
-
localStorage.setItem(
|
|
207
|
+
localStorage.setItem(kt, JSON.stringify(d));
|
|
206
208
|
});
|
|
207
209
|
}
|
|
208
210
|
// --- Instance Properties ---
|
|
@@ -447,12 +449,12 @@ class ti {
|
|
|
447
449
|
for (let d = 0; d < i; d++) {
|
|
448
450
|
const m = new AbortController(), v = setTimeout(() => m.abort(), a);
|
|
449
451
|
try {
|
|
450
|
-
const
|
|
451
|
-
if (clearTimeout(v), !
|
|
452
|
-
return
|
|
453
|
-
} catch (
|
|
454
|
-
if (clearTimeout(v), d === i - 1) throw
|
|
455
|
-
|
|
452
|
+
const x = await fetch(t, { signal: m.signal });
|
|
453
|
+
if (clearTimeout(v), !x.ok) throw new Error(`HTTP ${x.status}`);
|
|
454
|
+
return x;
|
|
455
|
+
} catch (x) {
|
|
456
|
+
if (clearTimeout(v), d === i - 1) throw x;
|
|
457
|
+
x.name === "AbortError" && console.warn(`Fetch timeout (${a}ms) for ${t}`), await new Promise((b) => setTimeout(b, 1e3 * Math.pow(2, d)));
|
|
456
458
|
}
|
|
457
459
|
}
|
|
458
460
|
throw new Error("Fetch failed");
|
|
@@ -499,9 +501,9 @@ class ti {
|
|
|
499
501
|
}), this.updateMediaSessionMetadata();
|
|
500
502
|
let v = a.type || "auto";
|
|
501
503
|
v === "auto" && (a.url.includes(".m3u8") ? v = "hls" : a.url.includes(".mpd") ? v = "dash" : a.url.includes(".flv") || a.url.includes(".ts") ? v = "mpegts" : a.url.startsWith("magnet:") || a.url.includes(".torrent") ? v = "webtorrent" : v = "mp4"), this.events.emit("load", { url: a.url, type: v });
|
|
502
|
-
const
|
|
503
|
-
for (;
|
|
504
|
-
|
|
504
|
+
const x = this.video.getElementsByTagName("track");
|
|
505
|
+
for (; x.length > 0; )
|
|
506
|
+
x[0].remove();
|
|
505
507
|
i.length > 0 && i.forEach((b) => {
|
|
506
508
|
this.fetchWithRetry(b.src).then(() => {
|
|
507
509
|
this.addTextTrackInternal(b.src, b.label, b.srcLang, b.default);
|
|
@@ -517,8 +519,8 @@ class ti {
|
|
|
517
519
|
addTextTrack(t, i) {
|
|
518
520
|
const r = new FileReader();
|
|
519
521
|
r.onload = (a) => {
|
|
520
|
-
var
|
|
521
|
-
if (!((
|
|
522
|
+
var x;
|
|
523
|
+
if (!((x = a.target) != null && x.result)) return;
|
|
522
524
|
let d = a.target.result;
|
|
523
525
|
(t.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
|
|
524
526
|
|
|
@@ -580,6 +582,13 @@ class ti {
|
|
|
580
582
|
console.error("Fullscreen toggle failed", t);
|
|
581
583
|
}
|
|
582
584
|
}
|
|
585
|
+
toggleWebFullscreen() {
|
|
586
|
+
const t = this.store.get().isWebFullscreen;
|
|
587
|
+
document.fullscreenElement && document.exitFullscreen().catch(() => {
|
|
588
|
+
});
|
|
589
|
+
const i = !t;
|
|
590
|
+
this.store.setState({ isWebFullscreen: i }), typeof document < "u" && (document.body.style.overflow = i ? "hidden" : ""), this.emit("webfullscreen", i);
|
|
591
|
+
}
|
|
583
592
|
togglePip() {
|
|
584
593
|
document.pictureInPictureElement ? document.exitPictureInPicture() : this.video !== document.pictureInPictureElement && this.video.requestPictureInPicture && this.video.requestPictureInPicture();
|
|
585
594
|
}
|
|
@@ -715,14 +724,14 @@ class ti {
|
|
|
715
724
|
const a = await this.fetchWithRetry(t);
|
|
716
725
|
if (!a.body) throw new Error("No body");
|
|
717
726
|
const d = a.body.getReader(), m = a.headers.get("Content-Length"), v = m ? parseInt(m, 10) : 0;
|
|
718
|
-
let
|
|
727
|
+
let x = 0;
|
|
719
728
|
const b = [];
|
|
720
729
|
for (; ; ) {
|
|
721
730
|
const { done: z, value: R } = await d.read();
|
|
722
731
|
if (z) break;
|
|
723
|
-
if (b.push(R),
|
|
724
|
-
const
|
|
725
|
-
this.notify({ id: i, type: "loading", message: `Downloading... ${
|
|
732
|
+
if (b.push(R), x += R.length, v) {
|
|
733
|
+
const p = Math.round(x / v * 100);
|
|
734
|
+
this.notify({ id: i, type: "loading", message: `Downloading... ${p}%`, progress: p });
|
|
726
735
|
}
|
|
727
736
|
}
|
|
728
737
|
const h = new Blob(b), y = window.URL.createObjectURL(h), k = document.createElement("a");
|
|
@@ -746,7 +755,7 @@ class ti {
|
|
|
746
755
|
}));
|
|
747
756
|
}
|
|
748
757
|
destroy() {
|
|
749
|
-
this.retryTimer && clearTimeout(this.retryTimer), this.resizeObserver && (this.resizeObserver.disconnect(), this.resizeObserver = null), document.removeEventListener("fullscreenchange", this.boundFullscreenChange), this.video.pause(), this.video.src = "";
|
|
758
|
+
this.retryTimer && clearTimeout(this.retryTimer), this.resizeObserver && (this.resizeObserver.disconnect(), this.resizeObserver = null), this.store.get().isWebFullscreen && typeof document < "u" && (document.body.style.overflow = ""), document.removeEventListener("fullscreenchange", this.boundFullscreenChange), this.video.pause(), this.video.src = "";
|
|
750
759
|
const t = this.video.getElementsByTagName("track");
|
|
751
760
|
for (; t.length > 0; ) t[0].remove();
|
|
752
761
|
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();
|
|
@@ -756,7 +765,7 @@ const Te = (s) => {
|
|
|
756
765
|
if (isNaN(s)) return "00:00";
|
|
757
766
|
const t = Math.floor(s / 3600), i = Math.floor(s % 3600 / 60), r = Math.floor(s % 60);
|
|
758
767
|
return t > 0 ? `${t}:${i.toString().padStart(2, "0")}:${r.toString().padStart(2, "0")}` : `${i}:${r.toString().padStart(2, "0")}`;
|
|
759
|
-
},
|
|
768
|
+
}, ai = async (s, t = 3, i = 2e4) => {
|
|
760
769
|
for (let r = 0; r < t; r++) {
|
|
761
770
|
const a = new AbortController(), d = setTimeout(() => a.abort(), i);
|
|
762
771
|
try {
|
|
@@ -769,12 +778,12 @@ const Te = (s) => {
|
|
|
769
778
|
}
|
|
770
779
|
}
|
|
771
780
|
throw new Error("Failed");
|
|
772
|
-
},
|
|
781
|
+
}, li = async (s, t, i = 2e4) => {
|
|
773
782
|
try {
|
|
774
|
-
const a = (await
|
|
783
|
+
const a = (await ai(s, 3, i)).split(`
|
|
775
784
|
`), d = [];
|
|
776
785
|
let m = null, v = null;
|
|
777
|
-
const
|
|
786
|
+
const x = s.substring(0, s.lastIndexOf("/") + 1), b = (h) => {
|
|
778
787
|
const y = h.split(":");
|
|
779
788
|
let k = 0;
|
|
780
789
|
return y.length === 3 ? (k += parseFloat(y[0]) * 3600, k += parseFloat(y[1]) * 60, k += parseFloat(y[2])) : (k += parseFloat(y[0]) * 60, k += parseFloat(y[1])), k;
|
|
@@ -785,20 +794,20 @@ const Te = (s) => {
|
|
|
785
794
|
m = b(y[0].trim()), v = b(y[1].trim());
|
|
786
795
|
} else if (m !== null && v !== null && h.length > 0) {
|
|
787
796
|
let [y, k] = h.split("#");
|
|
788
|
-
!y.match(/^https?:\/\//) && !y.startsWith("data:") && (y =
|
|
789
|
-
let z = 0, R = 0,
|
|
797
|
+
!y.match(/^https?:\/\//) && !y.startsWith("data:") && (y = x + y);
|
|
798
|
+
let z = 0, R = 0, p = 0, W = 0;
|
|
790
799
|
if (k && k.startsWith("xywh=")) {
|
|
791
800
|
const D = k.replace("xywh=", "").split(",");
|
|
792
|
-
D.length === 4 && (z = parseInt(D[0]), R = parseInt(D[1]),
|
|
801
|
+
D.length === 4 && (z = parseInt(D[0]), R = parseInt(D[1]), p = parseInt(D[2]), W = parseInt(D[3]));
|
|
793
802
|
}
|
|
794
|
-
|
|
803
|
+
p > 0 && W > 0 && d.push({ start: m, end: v, url: y, x: z, y: R, w: p, h: W }), m = null, v = null;
|
|
795
804
|
}
|
|
796
805
|
return d;
|
|
797
806
|
} catch {
|
|
798
807
|
return t({ type: "warning", message: "Failed to load thumbnails", duration: 4e3 }), [];
|
|
799
808
|
}
|
|
800
|
-
},
|
|
801
|
-
const [i, r] =
|
|
809
|
+
}, mt = (s, t = 200) => {
|
|
810
|
+
const [i, r] = S(s), [a, d] = S(!1);
|
|
802
811
|
return P(() => {
|
|
803
812
|
if (s)
|
|
804
813
|
r(!0), requestAnimationFrame(() => {
|
|
@@ -814,7 +823,7 @@ const Te = (s) => {
|
|
|
814
823
|
return () => clearTimeout(m);
|
|
815
824
|
}
|
|
816
825
|
}, [s, t]), { isMounted: i, isVisible: a };
|
|
817
|
-
},
|
|
826
|
+
}, g = ({ className: s, children: t, fill: i = "none", strokeWidth: r = 2, viewBox: a = "0 0 24 24" }) => /* @__PURE__ */ e(
|
|
818
827
|
"svg",
|
|
819
828
|
{
|
|
820
829
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -827,70 +836,70 @@ const Te = (s) => {
|
|
|
827
836
|
className: s,
|
|
828
837
|
children: t
|
|
829
838
|
}
|
|
830
|
-
),
|
|
839
|
+
), ft = ({ className: s }) => /* @__PURE__ */ e(g, { className: s, children: /* @__PURE__ */ e("polygon", { points: "5 3 19 12 5 21 5 3" }) }), pt = ({ className: s }) => /* @__PURE__ */ l(g, { className: s, children: [
|
|
831
840
|
/* @__PURE__ */ e("rect", { width: "4", height: "16", x: "6", y: "4", rx: "1" }),
|
|
832
841
|
/* @__PURE__ */ e("rect", { width: "4", height: "16", x: "14", y: "4", rx: "1" })
|
|
833
|
-
] }),
|
|
842
|
+
] }), ci = ({ className: s }) => /* @__PURE__ */ l(g, { className: s, children: [
|
|
834
843
|
/* @__PURE__ */ e("polygon", { points: "11 5 6 9 2 9 2 15 6 15 11 19 11 5" }),
|
|
835
844
|
/* @__PURE__ */ e("path", { d: "M19.07 4.93a10 10 0 0 1 0 14.14" }),
|
|
836
845
|
/* @__PURE__ */ e("path", { d: "M15.54 8.46a5 5 0 0 1 0 7.07" })
|
|
837
|
-
] }),
|
|
846
|
+
] }), di = ({ className: s }) => /* @__PURE__ */ l(g, { className: s, children: [
|
|
838
847
|
/* @__PURE__ */ e("polygon", { points: "11 5 6 9 2 9 2 15 6 15 11 19 11 5" }),
|
|
839
848
|
/* @__PURE__ */ e("path", { d: "M15.54 8.46a5 5 0 0 1 0 7.07" })
|
|
840
|
-
] }),
|
|
849
|
+
] }), ui = ({ className: s }) => /* @__PURE__ */ l(g, { className: s, children: [
|
|
841
850
|
/* @__PURE__ */ e("polygon", { points: "11 5 6 9 2 9 2 15 6 15 11 19 11 5" }),
|
|
842
851
|
/* @__PURE__ */ e("line", { x1: "23", x2: "17", y1: "9", y2: "15" }),
|
|
843
852
|
/* @__PURE__ */ e("line", { x1: "17", x2: "23", y1: "9", y2: "15" })
|
|
844
|
-
] }),
|
|
853
|
+
] }), hi = ({ className: s }) => /* @__PURE__ */ l(g, { className: s, children: [
|
|
845
854
|
/* @__PURE__ */ e("path", { d: "M8 3H5a2 2 0 0 0-2 2v3" }),
|
|
846
855
|
/* @__PURE__ */ e("path", { d: "M21 8V5a2 2 0 0 0-2-2h-3" }),
|
|
847
856
|
/* @__PURE__ */ e("path", { d: "M3 16v3a2 2 0 0 0 2 2h3" }),
|
|
848
857
|
/* @__PURE__ */ e("path", { d: "M16 21h3a2 2 0 0 0 2-2v-3" })
|
|
849
|
-
] }),
|
|
858
|
+
] }), mi = ({ className: s }) => /* @__PURE__ */ l(g, { className: s, children: [
|
|
850
859
|
/* @__PURE__ */ e("path", { d: "M8 3v3a2 2 0 0 1-2 2H3" }),
|
|
851
860
|
/* @__PURE__ */ e("path", { d: "M21 8h-3a2 2 0 0 1-2-2V3" }),
|
|
852
861
|
/* @__PURE__ */ e("path", { d: "M3 16h3a2 2 0 0 1 2 2v3" }),
|
|
853
862
|
/* @__PURE__ */ e("path", { d: "M16 21v-3a2 2 0 0 1 2-2h3" })
|
|
854
|
-
] }),
|
|
863
|
+
] }), fi = ({ className: s }) => /* @__PURE__ */ l(g, { className: s, children: [
|
|
855
864
|
/* @__PURE__ */ e("path", { d: "M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.09a2 2 0 0 1-1-1.74v-.47a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z" }),
|
|
856
865
|
/* @__PURE__ */ e("circle", { cx: "12", cy: "12", r: "3" })
|
|
857
|
-
] }), Le = ({ className: s }) => /* @__PURE__ */ e(
|
|
866
|
+
] }), Le = ({ className: s }) => /* @__PURE__ */ e(g, { className: s, children: /* @__PURE__ */ e("path", { d: "M20 6 9 17l-5-5" }) }), pi = ({ className: s }) => /* @__PURE__ */ l(g, { className: s, children: [
|
|
858
867
|
/* @__PURE__ */ e("path", { d: "M21 9V6a2 2 0 0 0-2-2H4a2 2 0 0 0-2 2v10c0 1.1.9 2 2 2h4" }),
|
|
859
868
|
/* @__PURE__ */ e("rect", { x: "12", y: "13", width: "10", height: "7", rx: "2" })
|
|
860
|
-
] }),
|
|
869
|
+
] }), bi = ({ className: s }) => /* @__PURE__ */ l(g, { className: s, children: [
|
|
861
870
|
/* @__PURE__ */ e("rect", { width: "18", height: "14", x: "3", y: "5", rx: "2", ry: "2" }),
|
|
862
871
|
/* @__PURE__ */ e("path", { d: "M7 15h4" }),
|
|
863
872
|
/* @__PURE__ */ e("path", { d: "M15 15h2" }),
|
|
864
873
|
/* @__PURE__ */ e("path", { d: "M7 11h2" }),
|
|
865
874
|
/* @__PURE__ */ e("path", { d: "M13 11h4" })
|
|
866
|
-
] }),
|
|
875
|
+
] }), vi = ({ className: s }) => /* @__PURE__ */ l(g, { className: s, children: [
|
|
867
876
|
/* @__PURE__ */ e("path", { d: "M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4" }),
|
|
868
877
|
/* @__PURE__ */ e("polyline", { points: "7 10 12 15 17 10" }),
|
|
869
878
|
/* @__PURE__ */ e("line", { x1: "12", x2: "12", y1: "15", y2: "3" })
|
|
870
|
-
] }),
|
|
879
|
+
] }), gi = ({ className: s }) => /* @__PURE__ */ l(g, { className: s, children: [
|
|
871
880
|
/* @__PURE__ */ e("path", { d: "M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4" }),
|
|
872
881
|
/* @__PURE__ */ e("polyline", { points: "17 8 12 3 7 8" }),
|
|
873
882
|
/* @__PURE__ */ e("line", { x1: "12", x2: "12", y1: "3", y2: "15" })
|
|
874
|
-
] }),
|
|
883
|
+
] }), xi = ({ className: s }) => /* @__PURE__ */ l(g, { className: s, children: [
|
|
875
884
|
/* @__PURE__ */ e("path", { d: "m12 19-7-7 7-7" }),
|
|
876
885
|
/* @__PURE__ */ e("path", { d: "M19 12H5" })
|
|
877
|
-
] }), Ie = ({ className: s }) => /* @__PURE__ */ e(
|
|
886
|
+
] }), Ie = ({ className: s }) => /* @__PURE__ */ e(g, { className: s, children: /* @__PURE__ */ e("path", { d: "M21 12a9 9 0 1 1-6.219-8.56" }) }), wi = ({ className: s }) => /* @__PURE__ */ l(g, { className: s, children: [
|
|
878
887
|
/* @__PURE__ */ e("path", { d: "M2 16.1A5 5 0 0 1 5.9 20" }),
|
|
879
888
|
/* @__PURE__ */ e("path", { d: "M2 12.05A9 9 0 0 1 9.95 20" }),
|
|
880
889
|
/* @__PURE__ */ e("path", { d: "M2 8V6a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2h-6" }),
|
|
881
890
|
/* @__PURE__ */ e("line", { x1: "2", x2: "2.01", y1: "20", y2: "20" })
|
|
882
|
-
] }),
|
|
891
|
+
] }), yi = ({ className: s }) => /* @__PURE__ */ l(g, { className: s, children: [
|
|
883
892
|
/* @__PURE__ */ e("path", { d: "M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2" }),
|
|
884
893
|
/* @__PURE__ */ e("circle", { cx: "9", cy: "7", r: "4" }),
|
|
885
894
|
/* @__PURE__ */ e("path", { d: "M22 21v-2a4 4 0 0 0-3-3.87" }),
|
|
886
895
|
/* @__PURE__ */ e("path", { d: "M16 3.13a4 4 0 0 1 0 7.75" })
|
|
887
|
-
] }),
|
|
896
|
+
] }), ki = ({ className: s }) => /* @__PURE__ */ l(g, { className: s, children: [
|
|
888
897
|
/* @__PURE__ */ e("circle", { cx: "12", cy: "12", r: "10" }),
|
|
889
898
|
/* @__PURE__ */ e("polyline", { points: "12 6 12 12 16 14" })
|
|
890
|
-
] }),
|
|
899
|
+
] }), Si = ({ className: s }) => /* @__PURE__ */ e(g, { className: s, children: /* @__PURE__ */ e("path", { d: "M5 12h14" }) }), Ci = ({ className: s }) => /* @__PURE__ */ l(g, { className: s, children: [
|
|
891
900
|
/* @__PURE__ */ e("path", { d: "M5 12h14" }),
|
|
892
901
|
/* @__PURE__ */ e("path", { d: "M12 5v14" })
|
|
893
|
-
] }),
|
|
902
|
+
] }), Ni = ({ className: s }) => /* @__PURE__ */ l(g, { className: s, children: [
|
|
894
903
|
/* @__PURE__ */ e("path", { d: "M4 21v-7" }),
|
|
895
904
|
/* @__PURE__ */ e("path", { d: "M4 10V3" }),
|
|
896
905
|
/* @__PURE__ */ e("path", { d: "M12 21v-9" }),
|
|
@@ -900,87 +909,87 @@ const Te = (s) => {
|
|
|
900
909
|
/* @__PURE__ */ e("path", { d: "M1 14h6" }),
|
|
901
910
|
/* @__PURE__ */ e("path", { d: "M9 8h6" }),
|
|
902
911
|
/* @__PURE__ */ e("path", { d: "M17 16h6" })
|
|
903
|
-
] }),
|
|
912
|
+
] }), Ti = ({ className: s }) => /* @__PURE__ */ l(g, { className: s, children: [
|
|
904
913
|
/* @__PURE__ */ e("polyline", { points: "4 7 4 4 20 4 20 7" }),
|
|
905
914
|
/* @__PURE__ */ e("line", { x1: "9", x2: "15", y1: "20", y2: "20" }),
|
|
906
915
|
/* @__PURE__ */ e("line", { x1: "12", x2: "12", y1: "4", y2: "20" })
|
|
907
|
-
] }),
|
|
916
|
+
] }), Ct = ({ className: s }) => /* @__PURE__ */ l(g, { className: s, children: [
|
|
908
917
|
/* @__PURE__ */ e("circle", { cx: "13.5", cy: "6.5", r: ".5", fill: "currentColor" }),
|
|
909
918
|
/* @__PURE__ */ e("circle", { cx: "17.5", cy: "10.5", r: ".5", fill: "currentColor" }),
|
|
910
919
|
/* @__PURE__ */ e("circle", { cx: "8.5", cy: "7.5", r: ".5", fill: "currentColor" }),
|
|
911
920
|
/* @__PURE__ */ e("circle", { cx: "6.5", cy: "12.5", r: ".5", fill: "currentColor" }),
|
|
912
921
|
/* @__PURE__ */ e("path", { d: "M12 2C6.5 2 2 6.5 2 12s4.5 10 10 10c.926 0 1.648-.746 1.648-1.688 0-.437-.18-.835-.437-1.125-.29-.289-.438-.652-.438-1.125a1.64 1.64 0 0 1 1.668-1.668h1.996c3.051 0 5.555-2.503 5.555-5.554C21.965 6.012 17.461 2 12 2z" })
|
|
913
|
-
] }),
|
|
922
|
+
] }), Mi = ({ className: s }) => /* @__PURE__ */ l(g, { className: s, children: [
|
|
914
923
|
/* @__PURE__ */ e("path", { d: "M2 12s3-7 10-7 10 7 10 7-3 7-10 7-10-7-10-7Z" }),
|
|
915
924
|
/* @__PURE__ */ e("circle", { cx: "12", cy: "12", r: "3" })
|
|
916
|
-
] }),
|
|
925
|
+
] }), zi = ({ className: s }) => /* @__PURE__ */ l(g, { className: s, children: [
|
|
917
926
|
/* @__PURE__ */ e("polyline", { points: "8 18 12 22 16 18" }),
|
|
918
927
|
/* @__PURE__ */ e("polyline", { points: "8 6 12 2 16 6" }),
|
|
919
928
|
/* @__PURE__ */ e("line", { x1: "12", x2: "12", y1: "2", y2: "22" })
|
|
920
|
-
] }),
|
|
929
|
+
] }), Ii = ({ className: s }) => /* @__PURE__ */ l(g, { className: s, children: [
|
|
921
930
|
/* @__PURE__ */ e("path", { d: "M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8" }),
|
|
922
931
|
/* @__PURE__ */ e("path", { d: "M3 3v5h5" })
|
|
923
|
-
] }),
|
|
932
|
+
] }), Ri = ({ className: s }) => /* @__PURE__ */ l(g, { className: s, children: [
|
|
924
933
|
/* @__PURE__ */ e("path", { d: "M6 4h8a4 4 0 0 1 4 4 4 4 0 0 1-4 4H6z" }),
|
|
925
934
|
/* @__PURE__ */ e("path", { d: "M6 12h9a4 4 0 0 1 4 4 4 4 0 0 1-4 4H6z" })
|
|
926
|
-
] }),
|
|
935
|
+
] }), Li = ({ className: s }) => /* @__PURE__ */ l(g, { className: s, children: [
|
|
927
936
|
/* @__PURE__ */ e("path", { d: "m3 17 4-10 4 10" }),
|
|
928
937
|
/* @__PURE__ */ e("path", { d: "M4 13h6" }),
|
|
929
938
|
/* @__PURE__ */ e("path", { d: "M15 12h4.5a2.5 2.5 0 0 1 0 5H15V7h4a2.5 2.5 0 0 1 0 5h-4" })
|
|
930
|
-
] }),
|
|
939
|
+
] }), $i = ({ className: s }) => /* @__PURE__ */ e(g, { className: s, children: /* @__PURE__ */ e("path", { d: "M12 22a7 7 0 0 0 7-7c0-2-1-3.9-3-5.5s-3.5-4-4-6.5c-.5 2.5-2 4.9-4 6.5C6 11.1 5 13 5 15a7 7 0 0 0 7 7z" }) }), Ei = ({ className: s }) => /* @__PURE__ */ l(g, { className: s, children: [
|
|
931
940
|
/* @__PURE__ */ e("path", { d: "M14.5 4h-5L7 7H4a2 2 0 0 0-2 2v9a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V9a2 2 0 0 0-2-2h-3l-2.5-3z" }),
|
|
932
941
|
/* @__PURE__ */ e("circle", { cx: "12", cy: "13", r: "3" })
|
|
933
|
-
] }),
|
|
942
|
+
] }), Pi = ({ className: s }) => /* @__PURE__ */ l(g, { className: s, children: [
|
|
934
943
|
/* @__PURE__ */ e("rect", { width: "18", height: "11", x: "3", y: "11", rx: "2", ry: "2" }),
|
|
935
944
|
/* @__PURE__ */ e("path", { d: "M7 11V7a5 5 0 0 1 10 0v4" })
|
|
936
|
-
] }),
|
|
945
|
+
] }), Fi = ({ className: s }) => /* @__PURE__ */ l(g, { className: s, children: [
|
|
937
946
|
/* @__PURE__ */ e("rect", { width: "18", height: "11", x: "3", y: "11", rx: "2", ry: "2" }),
|
|
938
947
|
/* @__PURE__ */ e("path", { d: "M7 11V7a5 5 0 0 1 9.9-1" })
|
|
939
|
-
] }),
|
|
948
|
+
] }), Ai = ({ className: s }) => /* @__PURE__ */ l(g, { className: s, children: [
|
|
940
949
|
/* @__PURE__ */ e("rect", { width: "20", height: "14", x: "2", y: "3", rx: "2" }),
|
|
941
950
|
/* @__PURE__ */ e("line", { x1: "8", x2: "16", y1: "21", y2: "21" }),
|
|
942
951
|
/* @__PURE__ */ e("line", { x1: "12", x2: "12", y1: "17", y2: "21" })
|
|
943
|
-
] }),
|
|
952
|
+
] }), Bi = ({ className: s }) => /* @__PURE__ */ l(g, { className: s, children: [
|
|
944
953
|
/* @__PURE__ */ e("polygon", { points: "13 19 22 12 13 5 13 19" }),
|
|
945
954
|
/* @__PURE__ */ e("polygon", { points: "2 19 11 12 2 5 2 19" })
|
|
946
|
-
] }),
|
|
955
|
+
] }), Vi = ({ className: s }) => /* @__PURE__ */ l(g, { className: s, children: [
|
|
947
956
|
/* @__PURE__ */ e("path", { d: "M18 6 6 18" }),
|
|
948
957
|
/* @__PURE__ */ e("path", { d: "m6 6 12 12" })
|
|
949
|
-
] }),
|
|
958
|
+
] }), Oi = ({ className: s }) => /* @__PURE__ */ l(g, { className: s, children: [
|
|
950
959
|
/* @__PURE__ */ e("circle", { cx: "12", cy: "12", r: "10" }),
|
|
951
960
|
/* @__PURE__ */ e("path", { d: "M12 16v-4" }),
|
|
952
961
|
/* @__PURE__ */ e("path", { d: "M12 8h.01" })
|
|
953
|
-
] }),
|
|
954
|
-
/* @__PURE__ */ l(
|
|
962
|
+
] }), bt = ({ className: s }) => /* @__PURE__ */ l("div", { className: `relative flex items-center justify-center ${s}`, children: [
|
|
963
|
+
/* @__PURE__ */ l(g, { className: "w-full h-full", children: [
|
|
955
964
|
/* @__PURE__ */ e("path", { d: "M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8" }),
|
|
956
965
|
/* @__PURE__ */ e("path", { d: "M3 3v5h5" })
|
|
957
966
|
] }),
|
|
958
967
|
/* @__PURE__ */ e("span", { className: "absolute inset-0 flex items-center justify-center text-[32%] font-bold select-none mt-[1px]", children: "10" })
|
|
959
|
-
] }),
|
|
960
|
-
/* @__PURE__ */ l(
|
|
968
|
+
] }), vt = ({ className: s }) => /* @__PURE__ */ l("div", { className: `relative flex items-center justify-center ${s}`, children: [
|
|
969
|
+
/* @__PURE__ */ l(g, { className: "w-full h-full", children: [
|
|
961
970
|
/* @__PURE__ */ e("path", { d: "M21 12a9 9 0 1 1-9-9 9.75 9.75 0 0 1 6.74 2.74L21 8" }),
|
|
962
971
|
/* @__PURE__ */ e("path", { d: "M21 3v5h-5" })
|
|
963
972
|
] }),
|
|
964
973
|
/* @__PURE__ */ e("span", { className: "absolute inset-0 flex items-center justify-center text-[32%] font-bold select-none mt-[1px]", children: "10" })
|
|
965
|
-
] }),
|
|
974
|
+
] }), ji = ({ notifications: s }) => /* @__PURE__ */ e("div", { className: "absolute top-4 left-4 z-25 flex flex-col gap-2 pointer-events-none font-sans max-w-[85%] md:max-w-[320px]", children: s.map((t) => /* @__PURE__ */ l(
|
|
966
975
|
"div",
|
|
967
976
|
{
|
|
968
977
|
className: `
|
|
969
|
-
bg-zinc-950/90 backdrop-blur-md border border-white/10 text-white px-
|
|
978
|
+
bg-zinc-950/90 backdrop-blur-md border border-white/10 text-white px-3 py-2 rounded-lg shadow-xl text-xs font-medium flex items-start gap-2.5 animate-in slide-in-from-left-2 fade-in duration-300 pointer-events-auto
|
|
970
979
|
w-fit max-w-full
|
|
971
980
|
${t.type === "error" ? "border-red-500/50 text-red-100" : ""}
|
|
972
981
|
${t.type === "warning" ? "border-amber-500/50 text-amber-100" : ""}
|
|
973
982
|
`,
|
|
974
983
|
children: [
|
|
975
|
-
t.type === "loading" && /* @__PURE__ */ e(Ie, { className: "w-
|
|
984
|
+
t.type === "loading" && /* @__PURE__ */ e(Ie, { className: "w-3.5 h-3.5 animate-spin text-[var(--accent)] shrink-0 mt-0.5" }),
|
|
976
985
|
/* @__PURE__ */ l("div", { className: "flex flex-col gap-1 min-w-0", children: [
|
|
977
986
|
/* @__PURE__ */ e("span", { className: "break-words line-clamp-4 leading-relaxed whitespace-pre-wrap", children: t.message }),
|
|
978
|
-
typeof t.progress == "number" && /* @__PURE__ */ e("div", { className: "h-
|
|
987
|
+
typeof t.progress == "number" && /* @__PURE__ */ e("div", { className: "h-0.5 w-full bg-white/10 rounded-full overflow-hidden mt-1.5", children: /* @__PURE__ */ e("div", { className: "h-full bg-[var(--accent)] transition-all duration-300", style: { width: `${t.progress}%` } }) })
|
|
979
988
|
] })
|
|
980
989
|
]
|
|
981
990
|
},
|
|
982
991
|
t.id
|
|
983
|
-
)) }),
|
|
992
|
+
)) }), Hi = ({ cues: s, settings: t }) => {
|
|
984
993
|
if (t.useNative || s.length === 0) return null;
|
|
985
994
|
const i = () => {
|
|
986
995
|
switch (t.textStyle) {
|
|
@@ -1031,18 +1040,18 @@ const Te = (s) => {
|
|
|
1031
1040
|
))
|
|
1032
1041
|
}
|
|
1033
1042
|
);
|
|
1034
|
-
},
|
|
1043
|
+
}, Nt = ({ children: s, onClose: t, align: i = "right", maxHeight: r, className: a }) => {
|
|
1035
1044
|
const d = I(null), m = i === "center" ? "left-1/2 -translate-x-1/2 origin-bottom" : "right-0 origin-bottom-right", v = r ? { maxHeight: `${r}px` } : {};
|
|
1036
1045
|
return /* @__PURE__ */ e(
|
|
1037
1046
|
"div",
|
|
1038
1047
|
{
|
|
1039
1048
|
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 ${a}`,
|
|
1040
1049
|
style: { ...v, borderRadius: "var(--radius-lg)" },
|
|
1041
|
-
onClick: (
|
|
1050
|
+
onClick: (x) => x.stopPropagation(),
|
|
1042
1051
|
children: /* @__PURE__ */ e("div", { className: "overflow-y-auto hide-scrollbar flex-1", style: { borderRadius: "var(--radius)" }, children: /* @__PURE__ */ e("div", { ref: d, children: s }) })
|
|
1043
1052
|
}
|
|
1044
1053
|
);
|
|
1045
|
-
},
|
|
1054
|
+
}, gt = ({ content: s, className: t }) => typeof s == "string" ? s.trim().startsWith("<") ? /* @__PURE__ */ e("span", { className: t, dangerouslySetInnerHTML: { __html: s } }) : /* @__PURE__ */ e("span", { className: t, children: s }) : /* @__PURE__ */ e("span", { className: t, children: s }), T = ({ label: s, value: t, active: i, onClick: r, hasSubmenu: a, icon: d }) => /* @__PURE__ */ l(
|
|
1046
1055
|
"button",
|
|
1047
1056
|
{
|
|
1048
1057
|
onClick: r,
|
|
@@ -1050,8 +1059,8 @@ const Te = (s) => {
|
|
|
1050
1059
|
style: { borderRadius: "var(--radius)" },
|
|
1051
1060
|
children: [
|
|
1052
1061
|
/* @__PURE__ */ l("div", { className: "flex items-center gap-3 overflow-hidden", children: [
|
|
1053
|
-
d && /* @__PURE__ */ e("span", { className: "text-zinc-400 shrink-0 group-hover:text-zinc-300 transition-colors flex items-center justify-center w-4 h-4", children: /* @__PURE__ */ e(
|
|
1054
|
-
/* @__PURE__ */ e("span", { className: `font-medium truncate text-sm flex items-center ${i ? "text-[var(--accent)]" : ""}`, title: typeof s == "string" ? s : void 0, children: /* @__PURE__ */ e(
|
|
1062
|
+
d && /* @__PURE__ */ e("span", { className: "text-zinc-400 shrink-0 group-hover:text-zinc-300 transition-colors flex items-center justify-center w-4 h-4", children: /* @__PURE__ */ e(gt, { content: d }) }),
|
|
1063
|
+
/* @__PURE__ */ e("span", { className: `font-medium truncate text-sm flex items-center ${i ? "text-[var(--accent)]" : ""}`, title: typeof s == "string" ? s : void 0, children: /* @__PURE__ */ e(gt, { content: s }) })
|
|
1055
1064
|
] }),
|
|
1056
1065
|
/* @__PURE__ */ l("div", { className: "flex items-center gap-2 text-zinc-400 shrink-0", children: [
|
|
1057
1066
|
t && /* @__PURE__ */ e("span", { className: "text-xs font-medium truncate max-w-[60px]", title: t, children: t }),
|
|
@@ -1072,7 +1081,7 @@ const Te = (s) => {
|
|
|
1072
1081
|
className: "flex items-center gap-2 hover:text-white transition-colors focus:outline-none",
|
|
1073
1082
|
onClick: t,
|
|
1074
1083
|
children: [
|
|
1075
|
-
/* @__PURE__ */ e(
|
|
1084
|
+
/* @__PURE__ */ e(xi, { className: "w-3 h-3" }),
|
|
1076
1085
|
/* @__PURE__ */ e("span", { children: s })
|
|
1077
1086
|
]
|
|
1078
1087
|
}
|
|
@@ -1080,7 +1089,7 @@ const Te = (s) => {
|
|
|
1080
1089
|
i
|
|
1081
1090
|
]
|
|
1082
1091
|
}
|
|
1083
|
-
),
|
|
1092
|
+
), xt = () => /* @__PURE__ */ e("div", { className: "h-px bg-white/5 mx-2 my-1" }), de = ({ content: s }) => typeof s == "string" ? s.trim().startsWith("<") ? /* @__PURE__ */ e("span", { dangerouslySetInnerHTML: { __html: s } }) : /* @__PURE__ */ e("span", { children: s }) : /* @__PURE__ */ e(L, { children: s }), K = ({ label: s, checked: t, onChange: i, icon: r, tooltip: a }) => /* @__PURE__ */ l(
|
|
1084
1093
|
"div",
|
|
1085
1094
|
{
|
|
1086
1095
|
className: "flex items-center justify-between py-2.5 px-3 hover:bg-white/5 group transition-colors",
|
|
@@ -1107,7 +1116,7 @@ const Te = (s) => {
|
|
|
1107
1116
|
children: /* @__PURE__ */ e(
|
|
1108
1117
|
"div",
|
|
1109
1118
|
{
|
|
1110
|
-
className: `absolute top-1/2 -translate-y-1/2 left-
|
|
1119
|
+
className: `absolute top-1/2 -translate-y-1/2 left-1 bg-white w-4 h-4 transition-transform shadow-sm ${t ? "translate-x-5" : "translate-x-0"}`,
|
|
1111
1120
|
style: { borderRadius: "var(--radius-full)" }
|
|
1112
1121
|
}
|
|
1113
1122
|
)
|
|
@@ -1144,7 +1153,7 @@ const Te = (s) => {
|
|
|
1144
1153
|
max: r,
|
|
1145
1154
|
step: a,
|
|
1146
1155
|
value: t,
|
|
1147
|
-
onChange: (
|
|
1156
|
+
onChange: (x) => d(parseFloat(x.target.value)),
|
|
1148
1157
|
className: "w-full h-1.5 appearance-none cursor-pointer focus:outline-none focus:ring-2 strata-range-input",
|
|
1149
1158
|
style: {
|
|
1150
1159
|
borderRadius: "var(--radius-full)",
|
|
@@ -1173,7 +1182,7 @@ const Te = (s) => {
|
|
|
1173
1182
|
] })
|
|
1174
1183
|
]
|
|
1175
1184
|
}
|
|
1176
|
-
),
|
|
1185
|
+
), Wi = ({ label: s, value: t, options: i, onChange: r, icon: a }) => /* @__PURE__ */ l(
|
|
1177
1186
|
"div",
|
|
1178
1187
|
{
|
|
1179
1188
|
className: "py-2.5 px-3 hover:bg-white/5 group transition-colors",
|
|
@@ -1201,9 +1210,9 @@ const Te = (s) => {
|
|
|
1201
1210
|
), Y = ({ title: s, children: t }) => /* @__PURE__ */ l("div", { className: "py-2", children: [
|
|
1202
1211
|
s && /* @__PURE__ */ e("h4", { className: "px-3 text-[10px] font-bold text-[var(--accent)] uppercase tracking-wider mb-1 mt-2", children: s }),
|
|
1203
1212
|
/* @__PURE__ */ e("div", { className: "space-y-0.5", children: t })
|
|
1204
|
-
] }),
|
|
1205
|
-
const [k, z] =
|
|
1206
|
-
return /* @__PURE__ */ l(
|
|
1213
|
+
] }), Di = ({ tracks: s, current: t, onSelect: i, onUpload: r, onClose: a, settings: d, onSettingsChange: m, onReset: v, offset: x, onOffsetChange: b, maxHeight: h, animationClass: y }) => {
|
|
1214
|
+
const [k, z] = S("main"), R = I(null);
|
|
1215
|
+
return /* @__PURE__ */ l(Nt, { onClose: a, align: "right", maxHeight: h, className: y, children: [
|
|
1207
1216
|
k === "main" && /* @__PURE__ */ l("div", { className: "animate-in slide-in-from-left-4 fade-in duration-200", children: [
|
|
1208
1217
|
/* @__PURE__ */ e(
|
|
1209
1218
|
"div",
|
|
@@ -1218,22 +1227,22 @@ const Te = (s) => {
|
|
|
1218
1227
|
T,
|
|
1219
1228
|
{
|
|
1220
1229
|
label: "Upload Subtitle",
|
|
1221
|
-
icon: /* @__PURE__ */ e(
|
|
1230
|
+
icon: /* @__PURE__ */ e(gi, { className: "w-4 h-4" }),
|
|
1222
1231
|
onClick: () => {
|
|
1223
|
-
var
|
|
1224
|
-
return (
|
|
1232
|
+
var p;
|
|
1233
|
+
return (p = R.current) == null ? void 0 : p.click();
|
|
1225
1234
|
}
|
|
1226
1235
|
}
|
|
1227
1236
|
),
|
|
1228
|
-
/* @__PURE__ */ e("input", { type: "file", accept: ".vtt,.srt", ref: R, className: "hidden", onChange: (
|
|
1237
|
+
/* @__PURE__ */ e("input", { type: "file", accept: ".vtt,.srt", ref: R, className: "hidden", onChange: (p) => {
|
|
1229
1238
|
var W;
|
|
1230
|
-
(W =
|
|
1239
|
+
(W = p.target.files) != null && W[0] && r(p.target.files[0]);
|
|
1231
1240
|
} }),
|
|
1232
1241
|
/* @__PURE__ */ e(
|
|
1233
1242
|
T,
|
|
1234
1243
|
{
|
|
1235
1244
|
label: "Customize",
|
|
1236
|
-
icon: /* @__PURE__ */ e(
|
|
1245
|
+
icon: /* @__PURE__ */ e(Ni, { className: "w-4 h-4" }),
|
|
1237
1246
|
onClick: () => z("customize"),
|
|
1238
1247
|
hasSubmenu: !0
|
|
1239
1248
|
}
|
|
@@ -1249,17 +1258,17 @@ const Te = (s) => {
|
|
|
1249
1258
|
}
|
|
1250
1259
|
}
|
|
1251
1260
|
),
|
|
1252
|
-
s.map((
|
|
1261
|
+
s.map((p) => /* @__PURE__ */ e(
|
|
1253
1262
|
T,
|
|
1254
1263
|
{
|
|
1255
|
-
label:
|
|
1256
|
-
value:
|
|
1257
|
-
active: t ===
|
|
1264
|
+
label: p.label,
|
|
1265
|
+
value: p.language,
|
|
1266
|
+
active: t === p.index,
|
|
1258
1267
|
onClick: () => {
|
|
1259
|
-
i(
|
|
1268
|
+
i(p.index), a();
|
|
1260
1269
|
}
|
|
1261
1270
|
},
|
|
1262
|
-
|
|
1271
|
+
p.index
|
|
1263
1272
|
))
|
|
1264
1273
|
] })
|
|
1265
1274
|
] }),
|
|
@@ -1269,7 +1278,7 @@ const Te = (s) => {
|
|
|
1269
1278
|
{
|
|
1270
1279
|
label: "Customize",
|
|
1271
1280
|
onBack: () => z("main"),
|
|
1272
|
-
rightAction: /* @__PURE__ */ e("button", { onClick: v, className: "p-1.5 text-zinc-400 hover:text-white transition-colors rounded-md hover:bg-white/10", title: "Reset All", children: /* @__PURE__ */ e(
|
|
1281
|
+
rightAction: /* @__PURE__ */ e("button", { onClick: v, className: "p-1.5 text-zinc-400 hover:text-white transition-colors rounded-md hover:bg-white/10", title: "Reset All", children: /* @__PURE__ */ e(Ii, { className: "w-4 h-4" }) })
|
|
1273
1282
|
}
|
|
1274
1283
|
),
|
|
1275
1284
|
/* @__PURE__ */ l("div", { className: "pb-1", children: [
|
|
@@ -1278,36 +1287,36 @@ const Te = (s) => {
|
|
|
1278
1287
|
{
|
|
1279
1288
|
label: "Native Video Subtitle",
|
|
1280
1289
|
checked: d.useNative,
|
|
1281
|
-
onChange: (
|
|
1290
|
+
onChange: (p) => m({ useNative: p })
|
|
1282
1291
|
}
|
|
1283
1292
|
) }),
|
|
1284
1293
|
!d.useNative && /* @__PURE__ */ l(L, { children: [
|
|
1285
1294
|
/* @__PURE__ */ l(Y, { title: "Sync & Position", children: [
|
|
1286
1295
|
/* @__PURE__ */ l("div", { className: "py-2.5 px-3 rounded-lg hover:bg-white/5 group transition-colors", children: [
|
|
1287
1296
|
/* @__PURE__ */ e("div", { className: "flex justify-between items-center mb-2", children: /* @__PURE__ */ l("div", { className: "flex items-center gap-3", children: [
|
|
1288
|
-
/* @__PURE__ */ e(
|
|
1297
|
+
/* @__PURE__ */ e(ki, { className: "w-4 h-4 text-zinc-500 group-hover:text-zinc-400 transition-colors" }),
|
|
1289
1298
|
/* @__PURE__ */ e("span", { className: "text-xs font-bold text-zinc-400 uppercase tracking-wider group-hover:text-zinc-300 transition-colors", children: "Sync Offset" })
|
|
1290
1299
|
] }) }),
|
|
1291
1300
|
/* @__PURE__ */ l("div", { className: "flex items-center gap-2", children: [
|
|
1292
1301
|
/* @__PURE__ */ e(
|
|
1293
1302
|
"button",
|
|
1294
1303
|
{
|
|
1295
|
-
onClick: () => b(Math.round((
|
|
1304
|
+
onClick: () => b(Math.round((x - 0.1) * 10) / 10),
|
|
1296
1305
|
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",
|
|
1297
|
-
children: /* @__PURE__ */ e(
|
|
1306
|
+
children: /* @__PURE__ */ e(Si, { className: "w-4 h-4" })
|
|
1298
1307
|
}
|
|
1299
1308
|
),
|
|
1300
1309
|
/* @__PURE__ */ l("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: [
|
|
1301
|
-
|
|
1302
|
-
(
|
|
1310
|
+
x > 0 ? "+" : "",
|
|
1311
|
+
(x == null ? void 0 : x.toFixed(1)) || "0.0",
|
|
1303
1312
|
"s"
|
|
1304
1313
|
] }),
|
|
1305
1314
|
/* @__PURE__ */ e(
|
|
1306
1315
|
"button",
|
|
1307
1316
|
{
|
|
1308
|
-
onClick: () => b(Math.round((
|
|
1317
|
+
onClick: () => b(Math.round((x + 0.1) * 10) / 10),
|
|
1309
1318
|
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",
|
|
1310
|
-
children: /* @__PURE__ */ e(
|
|
1319
|
+
children: /* @__PURE__ */ e(Ci, { className: "w-4 h-4" })
|
|
1311
1320
|
}
|
|
1312
1321
|
)
|
|
1313
1322
|
] })
|
|
@@ -1316,13 +1325,13 @@ const Te = (s) => {
|
|
|
1316
1325
|
ce,
|
|
1317
1326
|
{
|
|
1318
1327
|
label: "Vertical Position",
|
|
1319
|
-
icon: /* @__PURE__ */ e(
|
|
1328
|
+
icon: /* @__PURE__ */ e(zi, { className: "w-4 h-4" }),
|
|
1320
1329
|
value: d.verticalOffset,
|
|
1321
1330
|
min: 0,
|
|
1322
1331
|
max: 200,
|
|
1323
1332
|
step: 5,
|
|
1324
|
-
onChange: (
|
|
1325
|
-
formatValue: (
|
|
1333
|
+
onChange: (p) => m({ verticalOffset: p }),
|
|
1334
|
+
formatValue: (p) => `${p}px`
|
|
1326
1335
|
}
|
|
1327
1336
|
)
|
|
1328
1337
|
] }),
|
|
@@ -1331,29 +1340,29 @@ const Te = (s) => {
|
|
|
1331
1340
|
ce,
|
|
1332
1341
|
{
|
|
1333
1342
|
label: "Text Size",
|
|
1334
|
-
icon: /* @__PURE__ */ e(
|
|
1343
|
+
icon: /* @__PURE__ */ e(Ti, { className: "w-4 h-4" }),
|
|
1335
1344
|
value: d.textSize,
|
|
1336
1345
|
min: 50,
|
|
1337
1346
|
max: 200,
|
|
1338
1347
|
step: 10,
|
|
1339
|
-
onChange: (
|
|
1340
|
-
formatValue: (
|
|
1348
|
+
onChange: (p) => m({ textSize: p }),
|
|
1349
|
+
formatValue: (p) => `${p}%`
|
|
1341
1350
|
}
|
|
1342
1351
|
),
|
|
1343
1352
|
/* @__PURE__ */ l("div", { className: "py-2.5 px-3 rounded-lg hover:bg-white/5 group transition-colors", children: [
|
|
1344
1353
|
/* @__PURE__ */ l("div", { className: "flex items-center gap-3 mb-2", children: [
|
|
1345
|
-
/* @__PURE__ */ e(
|
|
1354
|
+
/* @__PURE__ */ e(Ct, { className: "w-4 h-4 text-zinc-500 group-hover:text-zinc-400 transition-colors" }),
|
|
1346
1355
|
/* @__PURE__ */ e("span", { className: "text-xs font-bold text-zinc-400 uppercase tracking-wider group-hover:text-zinc-300 transition-colors", children: "Text Color" })
|
|
1347
1356
|
] }),
|
|
1348
1357
|
/* @__PURE__ */ l("div", { className: "flex items-center justify-between gap-2 p-1 bg-zinc-800/50 rounded-lg", children: [
|
|
1349
|
-
["#ffffff", "#ffff00", "#00ffff", "#ff00ff", "#ff0000", "#00ff00"].map((
|
|
1358
|
+
["#ffffff", "#ffff00", "#00ffff", "#ff00ff", "#ff0000", "#00ff00"].map((p) => /* @__PURE__ */ e(
|
|
1350
1359
|
"button",
|
|
1351
1360
|
{
|
|
1352
|
-
onClick: () => m({ textColor:
|
|
1353
|
-
className: `w-6 h-6 rounded-full border border-white/10 transition-transform hover:scale-110 ${d.textColor ===
|
|
1354
|
-
style: { backgroundColor:
|
|
1361
|
+
onClick: () => m({ textColor: p }),
|
|
1362
|
+
className: `w-6 h-6 rounded-full border border-white/10 transition-transform hover:scale-110 ${d.textColor === p ? "ring-2 scale-110" : ""}`,
|
|
1363
|
+
style: { backgroundColor: p, "--tw-ring-color": "var(--accent)" }
|
|
1355
1364
|
},
|
|
1356
|
-
|
|
1365
|
+
p
|
|
1357
1366
|
)),
|
|
1358
1367
|
/* @__PURE__ */ e("div", { className: "w-px h-6 bg-white/10 mx-1" }),
|
|
1359
1368
|
/* @__PURE__ */ e("div", { className: "relative w-6 h-6 rounded-full overflow-hidden ring-1 ring-white/20 cursor-pointer", children: /* @__PURE__ */ e(
|
|
@@ -1361,14 +1370,14 @@ const Te = (s) => {
|
|
|
1361
1370
|
{
|
|
1362
1371
|
type: "color",
|
|
1363
1372
|
value: d.textColor,
|
|
1364
|
-
onChange: (
|
|
1373
|
+
onChange: (p) => m({ textColor: p.target.value }),
|
|
1365
1374
|
className: "absolute inset-[-4px] w-[150%] h-[150%] cursor-pointer p-0 border-0"
|
|
1366
1375
|
}
|
|
1367
1376
|
) })
|
|
1368
1377
|
] })
|
|
1369
1378
|
] }),
|
|
1370
1379
|
/* @__PURE__ */ e(
|
|
1371
|
-
|
|
1380
|
+
Wi,
|
|
1372
1381
|
{
|
|
1373
1382
|
label: "Text Style",
|
|
1374
1383
|
value: d.textStyle,
|
|
@@ -1379,12 +1388,12 @@ const Te = (s) => {
|
|
|
1379
1388
|
{ label: "Depressed", value: "depressed" },
|
|
1380
1389
|
{ label: "Drop Shadow", value: "shadow" }
|
|
1381
1390
|
],
|
|
1382
|
-
onChange: (
|
|
1391
|
+
onChange: (p) => m({ textStyle: p })
|
|
1383
1392
|
}
|
|
1384
1393
|
),
|
|
1385
1394
|
/* @__PURE__ */ l("div", { className: "grid grid-cols-2 gap-2 mt-1 px-1", children: [
|
|
1386
|
-
/* @__PURE__ */ e(K, { label: "Bold", icon: /* @__PURE__ */ e(
|
|
1387
|
-
/* @__PURE__ */ e(K, { label: "Fix Caps", icon: /* @__PURE__ */ e(
|
|
1395
|
+
/* @__PURE__ */ e(K, { label: "Bold", icon: /* @__PURE__ */ e(Ri, { className: "w-4 h-4" }), checked: d.isBold, onChange: (p) => m({ isBold: p }) }),
|
|
1396
|
+
/* @__PURE__ */ e(K, { label: "Fix Caps", icon: /* @__PURE__ */ e(Li, { className: "w-4 h-4" }), checked: d.fixCapitalization, onChange: (p) => m({ fixCapitalization: p }) })
|
|
1388
1397
|
] })
|
|
1389
1398
|
] }),
|
|
1390
1399
|
/* @__PURE__ */ l(Y, { title: "Background", children: [
|
|
@@ -1392,16 +1401,16 @@ const Te = (s) => {
|
|
|
1392
1401
|
ce,
|
|
1393
1402
|
{
|
|
1394
1403
|
label: "Opacity",
|
|
1395
|
-
icon: /* @__PURE__ */ e(
|
|
1404
|
+
icon: /* @__PURE__ */ e(Mi, { className: "w-4 h-4" }),
|
|
1396
1405
|
value: d.backgroundOpacity,
|
|
1397
1406
|
min: 0,
|
|
1398
1407
|
max: 100,
|
|
1399
1408
|
step: 5,
|
|
1400
|
-
onChange: (
|
|
1401
|
-
formatValue: (
|
|
1409
|
+
onChange: (p) => m({ backgroundOpacity: p }),
|
|
1410
|
+
formatValue: (p) => `${p}%`
|
|
1402
1411
|
}
|
|
1403
1412
|
),
|
|
1404
|
-
/* @__PURE__ */ e(K, { label: "Blur Background", icon: /* @__PURE__ */ e(
|
|
1413
|
+
/* @__PURE__ */ e(K, { label: "Blur Background", icon: /* @__PURE__ */ e($i, { className: "w-4 h-4" }), checked: d.backgroundBlur, onChange: (p) => m({ backgroundBlur: p }) }),
|
|
1405
1414
|
d.backgroundBlur && /* @__PURE__ */ e(
|
|
1406
1415
|
ce,
|
|
1407
1416
|
{
|
|
@@ -1410,8 +1419,8 @@ const Te = (s) => {
|
|
|
1410
1419
|
min: 0,
|
|
1411
1420
|
max: 20,
|
|
1412
1421
|
step: 1,
|
|
1413
|
-
onChange: (
|
|
1414
|
-
formatValue: (
|
|
1422
|
+
onChange: (p) => m({ backgroundBlurAmount: p }),
|
|
1423
|
+
formatValue: (p) => `${p}px`
|
|
1415
1424
|
}
|
|
1416
1425
|
)
|
|
1417
1426
|
] })
|
|
@@ -1419,19 +1428,19 @@ const Te = (s) => {
|
|
|
1419
1428
|
] })
|
|
1420
1429
|
] })
|
|
1421
1430
|
] });
|
|
1422
|
-
}, Me = ({ content: s }) => typeof s == "string" ? s.trim().startsWith("<") ? /* @__PURE__ */ e("span", { dangerouslySetInnerHTML: { __html: s } }) : /* @__PURE__ */ e("span", { children: s }) : /* @__PURE__ */ e(L, { children: s }),
|
|
1423
|
-
const m = I(null), [v,
|
|
1431
|
+
}, Me = ({ content: s }) => typeof s == "string" ? s.trim().startsWith("<") ? /* @__PURE__ */ e("span", { dangerouslySetInnerHTML: { __html: s } }) : /* @__PURE__ */ e("span", { children: s }) : /* @__PURE__ */ e(L, { children: s }), Ui = ({ x: s, y: t, items: i, onClose: r, containerWidth: a, containerHeight: d }) => {
|
|
1432
|
+
const m = I(null), [v, x] = S({
|
|
1424
1433
|
top: t,
|
|
1425
1434
|
left: s,
|
|
1426
1435
|
opacity: 0
|
|
1427
1436
|
});
|
|
1428
|
-
return
|
|
1437
|
+
return Zt(() => {
|
|
1429
1438
|
if (!m.current) return;
|
|
1430
1439
|
const b = m.current.getBoundingClientRect(), h = b.width, y = b.height;
|
|
1431
1440
|
let k = s, z = t;
|
|
1432
1441
|
s + h > a - 10 && (k = s - h), k < 10 && (k = 10), k + h > a && (k = Math.max(10, a - h - 10)), t + y > d - 10 && (z = t - y);
|
|
1433
1442
|
let R = d - 20;
|
|
1434
|
-
z < 10 && (z = 10), z + y > d - 10 && (z = Math.max(10, d - y - 10)),
|
|
1443
|
+
z < 10 && (z = 10), z + y > d - 10 && (z = Math.max(10, d - y - 10)), x({
|
|
1435
1444
|
top: z,
|
|
1436
1445
|
left: k,
|
|
1437
1446
|
maxHeight: R,
|
|
@@ -1478,11 +1487,11 @@ const Te = (s) => {
|
|
|
1478
1487
|
] }, h))
|
|
1479
1488
|
}
|
|
1480
1489
|
);
|
|
1481
|
-
},
|
|
1482
|
-
const [i, r] =
|
|
1490
|
+
}, Gi = ({ player: s, onClose: t }) => {
|
|
1491
|
+
const [i, r] = S({});
|
|
1483
1492
|
return P(() => {
|
|
1484
1493
|
const a = () => {
|
|
1485
|
-
var
|
|
1494
|
+
var x;
|
|
1486
1495
|
if (!s.video) return;
|
|
1487
1496
|
const m = s.video, v = m.getVideoPlaybackQuality ? m.getVideoPlaybackQuality() : null;
|
|
1488
1497
|
r({
|
|
@@ -1493,7 +1502,7 @@ const Te = (s) => {
|
|
|
1493
1502
|
Volume: `${Math.round(m.volume * 100)}%`,
|
|
1494
1503
|
"Dropped Frames": v ? v.droppedVideoFrames : "N/A",
|
|
1495
1504
|
Buffer: m.buffered.length > 0 ? `${(m.buffered.end(m.buffered.length - 1) - m.currentTime).toFixed(2)}s` : "0s",
|
|
1496
|
-
Engine: ((
|
|
1505
|
+
Engine: ((x = s.store.get().sources[s.store.get().currentSourceIndex]) == null ? void 0 : x.type) || "native",
|
|
1497
1506
|
URL: m.currentSrc
|
|
1498
1507
|
});
|
|
1499
1508
|
};
|
|
@@ -1514,7 +1523,7 @@ const Te = (s) => {
|
|
|
1514
1523
|
a.stopPropagation(), t();
|
|
1515
1524
|
},
|
|
1516
1525
|
className: "absolute top-3 right-3 p-1.5 text-zinc-400 hover:text-white hover:bg-white/10 rounded-full transition-colors",
|
|
1517
|
-
children: /* @__PURE__ */ e(
|
|
1526
|
+
children: /* @__PURE__ */ e(Vi, { className: "w-4 h-4" })
|
|
1518
1527
|
}
|
|
1519
1528
|
),
|
|
1520
1529
|
/* @__PURE__ */ e("h3", { className: "text-sm font-bold text-white mb-4 uppercase tracking-wider border-b border-white/10 pb-2", children: "Video Statistics" })
|
|
@@ -1526,38 +1535,38 @@ const Te = (s) => {
|
|
|
1526
1535
|
]
|
|
1527
1536
|
}
|
|
1528
1537
|
) });
|
|
1529
|
-
},
|
|
1538
|
+
}, _i = [
|
|
1530
1539
|
{ label: "Strata", value: "#6366f1" },
|
|
1531
1540
|
{ label: "Emerald", value: "#10b981" },
|
|
1532
1541
|
{ label: "Rose", value: "#f43f5e" },
|
|
1533
1542
|
{ label: "Amber", value: "#f59e0b" },
|
|
1534
1543
|
{ label: "Sky", value: "#0ea5e9" },
|
|
1535
1544
|
{ label: "Violet", value: "#8b5cf6" }
|
|
1536
|
-
],
|
|
1545
|
+
], qi = [
|
|
1537
1546
|
{ label: "Default", value: "default", color: "#6366f1" },
|
|
1538
1547
|
{ label: "Pixel", value: "pixel", color: "#ef4444" },
|
|
1539
1548
|
{ label: "Game", value: "game", color: "#eab308" },
|
|
1540
1549
|
{ label: "Hacker", value: "hacker", color: "#22c55e" }
|
|
1541
|
-
],
|
|
1542
|
-
var
|
|
1543
|
-
const { src: t, type: i, sources: r, poster: a, autoPlay: d, thumbnails: m, textTracks: v, plugins:
|
|
1550
|
+
], wt = ({ content: s, className: t, style: i }) => typeof s == "string" ? s.trim().startsWith("<") ? /* @__PURE__ */ e("div", { className: t, style: i, dangerouslySetInnerHTML: { __html: s } }) : /* @__PURE__ */ e("div", { className: t, style: i, children: s }) : /* @__PURE__ */ e("div", { className: t, style: i, children: s }), yt = (s) => {
|
|
1551
|
+
var dt, ut;
|
|
1552
|
+
const { src: t, type: i, sources: r, poster: a, autoPlay: d, thumbnails: m, textTracks: v, plugins: x, onGetInstance: b, ...h } = s, y = h.screenshot ?? !1, k = h.pip ?? !0, z = h.setting ?? !0, R = h.fullscreen ?? !0, p = h.fullscreenWeb ?? !1, W = h.lock ?? !1, D = h.fastForward ?? !0, Tt = h.flip ?? !0, Mt = h.aspectRatio ?? !0, $e = h.hotKey ?? !0, zt = h.backdrop ?? !0, ue = h.gestureSeek ?? !1, It = h.centerControls ?? !0, Ee = h.fetchTimeout ?? 3e4;
|
|
1544
1553
|
h.autoOrientation;
|
|
1545
|
-
const q = I(null), [n, Pe] =
|
|
1554
|
+
const q = I(null), [n, Pe] = S(null), [he, me] = S(!1), [Fe, Rt] = S(0), [Lt, $t] = S(0), [Ae, Et] = S(!1), Be = Ce(() => St(h), []), o = ei(
|
|
1546
1555
|
Ne((c) => n ? n.store.subscribe(c) : () => {
|
|
1547
1556
|
}, [n]),
|
|
1548
1557
|
() => n ? n.store.get() : Be,
|
|
1549
1558
|
() => Be
|
|
1550
|
-
), [$,
|
|
1559
|
+
), [$, V] = S(!1), [E, U] = S(!1), [F, M] = S("main"), [Z, fe] = S({ x: 0, y: 0, visible: !1 }), [Pt, Ve] = S(!1), Oe = mt($, 200), je = mt(E, 200), [pe, ne] = S(!1), [re, be] = S(0), [Ft, He] = S(!1), [At, We] = S(!1), [ve, oe] = S(!1), [De, Ue] = S([]), [Ge, _e] = S(null), [Bt, Vt] = S(0), [G, qe] = S(null), [Q, ae] = S(null), [Qi, Qe] = S(null), [ge, Xe] = S(!1), xe = I(null), Je = I(1), te = I(null), Ke = I(0), ee = I(!1), ie = I(null), _ = I(null), we = I(null), ye = I(null), se = I(null);
|
|
1551
1560
|
P(() => {
|
|
1552
|
-
if (!q.current) return;
|
|
1553
|
-
const c = new
|
|
1554
|
-
|
|
1555
|
-
const
|
|
1556
|
-
for (const
|
|
1557
|
-
|
|
1561
|
+
if (Et("ontouchstart" in window || navigator.maxTouchPoints > 0), !q.current) return;
|
|
1562
|
+
const c = new oi({ ...h, poster: a });
|
|
1563
|
+
x && x.length > 0 && x.forEach((w) => c.use(w)), c.attach(q.current), Pe(c), b && b(c);
|
|
1564
|
+
const f = new ResizeObserver((w) => {
|
|
1565
|
+
for (const C of w)
|
|
1566
|
+
Rt(C.contentRect.height), $t(C.contentRect.width);
|
|
1558
1567
|
});
|
|
1559
|
-
return
|
|
1560
|
-
|
|
1568
|
+
return f.observe(q.current), () => {
|
|
1569
|
+
f.disconnect(), c.destroy(), Pe(null);
|
|
1561
1570
|
};
|
|
1562
1571
|
}, []), P(() => {
|
|
1563
1572
|
if (!n) return;
|
|
@@ -1568,72 +1577,76 @@ const Te = (s) => {
|
|
|
1568
1577
|
const c = v || [];
|
|
1569
1578
|
r && r.length > 0 ? (me(!1), n.setSources(r, c)) : t && (me(!1), n.setSources([{ url: t, type: i || "auto" }], c));
|
|
1570
1579
|
}, [t, i, r, v, n]), P(() => {
|
|
1571
|
-
n && d &&
|
|
1572
|
-
|
|
1580
|
+
n && d && n.play().catch(() => {
|
|
1581
|
+
console.warn("Autoplay failed (likely needs user interaction)");
|
|
1582
|
+
});
|
|
1573
1583
|
}, [n, d]), P(() => {
|
|
1574
1584
|
o.isPlaying && !he && me(!0);
|
|
1575
1585
|
}, [o.isPlaying, he]), P(() => {
|
|
1576
|
-
m && n ?
|
|
1586
|
+
m && n ? li(m, n.notify.bind(n), Ee).then((c) => Ue(c)) : Ue([]);
|
|
1577
1587
|
}, [m, n, Ee]), P(() => (Q && (se.current && clearTimeout(se.current), se.current = setTimeout(() => {
|
|
1578
|
-
|
|
1588
|
+
ae(null);
|
|
1579
1589
|
}, 600)), () => {
|
|
1580
1590
|
se.current && clearTimeout(se.current);
|
|
1581
1591
|
}), [Q]), P(() => {
|
|
1582
|
-
const c = (
|
|
1583
|
-
var
|
|
1584
|
-
if (!
|
|
1585
|
-
|
|
1586
|
-
|
|
1587
|
-
|
|
1588
|
-
|
|
1589
|
-
|
|
1590
|
-
|
|
1591
|
-
|
|
1592
|
-
|
|
1593
|
-
|
|
1594
|
-
|
|
1595
|
-
|
|
1596
|
-
|
|
1597
|
-
|
|
1598
|
-
|
|
1599
|
-
|
|
1600
|
-
|
|
1601
|
-
|
|
1602
|
-
|
|
1603
|
-
|
|
1604
|
-
|
|
1605
|
-
|
|
1606
|
-
|
|
1607
|
-
|
|
1608
|
-
|
|
1592
|
+
const c = (f) => {
|
|
1593
|
+
var C;
|
|
1594
|
+
if (!n || !$e || ((C = document.activeElement) == null ? void 0 : C.tagName) === "INPUT") return;
|
|
1595
|
+
switch (f.key.toLowerCase()) {
|
|
1596
|
+
case " ":
|
|
1597
|
+
case "k":
|
|
1598
|
+
f.preventDefault(), n.togglePlay();
|
|
1599
|
+
break;
|
|
1600
|
+
case "arrowright":
|
|
1601
|
+
f.preventDefault(), n.skip(5);
|
|
1602
|
+
break;
|
|
1603
|
+
case "arrowleft":
|
|
1604
|
+
f.preventDefault(), n.skip(-5);
|
|
1605
|
+
break;
|
|
1606
|
+
case "arrowup":
|
|
1607
|
+
f.preventDefault(), n.setVolume(n.video.volume + 0.1);
|
|
1608
|
+
break;
|
|
1609
|
+
case "arrowdown":
|
|
1610
|
+
f.preventDefault(), n.setVolume(n.video.volume - 0.1);
|
|
1611
|
+
break;
|
|
1612
|
+
case "f":
|
|
1613
|
+
f.preventDefault(), n.toggleFullscreen();
|
|
1614
|
+
break;
|
|
1615
|
+
case "m":
|
|
1616
|
+
f.preventDefault(), n.toggleMute();
|
|
1617
|
+
break;
|
|
1618
|
+
case "escape":
|
|
1619
|
+
n.store.get().isWebFullscreen && (f.preventDefault(), n.toggleWebFullscreen());
|
|
1620
|
+
break;
|
|
1621
|
+
}
|
|
1609
1622
|
};
|
|
1610
1623
|
return window.addEventListener("keydown", c), () => window.removeEventListener("keydown", c);
|
|
1611
1624
|
}, [n, $e]);
|
|
1612
|
-
const
|
|
1625
|
+
const Ye = () => {
|
|
1613
1626
|
n && (n.setControlsVisible(!0), _.current && clearTimeout(_.current), !($ || E) && (_.current = setTimeout(() => {
|
|
1614
1627
|
!o.isPlaying || $ || E || n.setControlsVisible(!1);
|
|
1615
1628
|
}, 2500)));
|
|
1616
1629
|
};
|
|
1617
1630
|
P(() => {
|
|
1618
|
-
n && (!$ && !E && o.isPlaying ?
|
|
1631
|
+
n && (!$ && !E && o.isPlaying ? Ye() : ($ || E) && (n.setControlsVisible(!0), _.current && clearTimeout(_.current)));
|
|
1619
1632
|
}, [$, E, o.isPlaying, n]);
|
|
1620
|
-
const
|
|
1621
|
-
!D || !n || !o.isPlaying || o.isLocked || (
|
|
1622
|
-
n.video.playbackRate = 2,
|
|
1633
|
+
const Ze = Ne(() => {
|
|
1634
|
+
!D || !n || !o.isPlaying || o.isLocked || (Je.current = n.video.playbackRate, xe.current = setTimeout(() => {
|
|
1635
|
+
n.video.playbackRate = 2, Xe(!0);
|
|
1623
1636
|
}, 500));
|
|
1624
1637
|
}, [D, n, o.isPlaying, o.isLocked]), ke = Ne(() => {
|
|
1625
|
-
xe.current && clearTimeout(xe.current), ge && n && (n.video.playbackRate =
|
|
1626
|
-
}, [ge, n]),
|
|
1627
|
-
|
|
1628
|
-
},
|
|
1638
|
+
xe.current && clearTimeout(xe.current), ge && n && (n.video.playbackRate = Je.current, Xe(!1));
|
|
1639
|
+
}, [ge, n]), Ot = (c) => {
|
|
1640
|
+
Ze(), ue && !o.isLocked && (te.current = c.touches[0].clientX, Ke.current = o.currentTime, ee.current = !1);
|
|
1641
|
+
}, jt = (c) => {
|
|
1629
1642
|
if (!o.isLocked && ue && te.current !== null) {
|
|
1630
|
-
const
|
|
1631
|
-
if (Math.abs(
|
|
1632
|
-
const
|
|
1643
|
+
const f = c.touches[0].clientX - te.current;
|
|
1644
|
+
if (Math.abs(f) > 10 && (ke(), ee.current = !0, ne(!0), q.current && o.duration)) {
|
|
1645
|
+
const w = q.current.getBoundingClientRect(), C = f / w.width, j = Math.max(0, Math.min(o.duration, Ke.current + C * o.duration));
|
|
1633
1646
|
be(j);
|
|
1634
1647
|
}
|
|
1635
1648
|
}
|
|
1636
|
-
},
|
|
1649
|
+
}, Ht = (c) => {
|
|
1637
1650
|
if (ke(), ue && ee.current) {
|
|
1638
1651
|
n == null || n.seek(re), ne(!1), ee.current = !1, te.current = null;
|
|
1639
1652
|
return;
|
|
@@ -1641,63 +1654,61 @@ const Te = (s) => {
|
|
|
1641
1654
|
te.current = null;
|
|
1642
1655
|
}, Se = (c) => {
|
|
1643
1656
|
if (!we.current || !o.duration) return 0;
|
|
1644
|
-
const
|
|
1645
|
-
return Math.max(0, Math.min(1, (
|
|
1646
|
-
},
|
|
1657
|
+
const f = we.current.getBoundingClientRect(), w = "touches" in c ? c.touches[0].clientX : c.clientX;
|
|
1658
|
+
return Math.max(0, Math.min(1, (w - f.left) / f.width)) * o.duration;
|
|
1659
|
+
}, et = (c) => {
|
|
1647
1660
|
if (o.isLocked) return;
|
|
1648
1661
|
ne(!0), be(Se(c));
|
|
1649
|
-
const
|
|
1650
|
-
n == null || n.seek(Se(
|
|
1662
|
+
const f = (C) => be(Se(C)), w = (C) => {
|
|
1663
|
+
n == null || n.seek(Se(C)), ne(!1), document.removeEventListener("mousemove", f), document.removeEventListener("touchmove", f), document.removeEventListener("mouseup", w), document.removeEventListener("touchend", w);
|
|
1651
1664
|
};
|
|
1652
|
-
document.addEventListener("mousemove",
|
|
1653
|
-
}, et = (c) => {
|
|
1654
|
-
if (!ye.current) return 0;
|
|
1655
|
-
const p = ye.current.getBoundingClientRect(), g = "touches" in c ? c.touches[0].clientX : c.clientX;
|
|
1656
|
-
return Math.max(0, Math.min(1, (g - p.left) / p.width));
|
|
1665
|
+
document.addEventListener("mousemove", f), document.addEventListener("touchmove", f), document.addEventListener("mouseup", w), document.addEventListener("touchend", w);
|
|
1657
1666
|
}, tt = (c) => {
|
|
1667
|
+
if (!ye.current) return 0;
|
|
1668
|
+
const f = ye.current.getBoundingClientRect(), w = "touches" in c ? c.touches[0].clientX : c.clientX;
|
|
1669
|
+
return Math.max(0, Math.min(1, (w - f.left) / f.width));
|
|
1670
|
+
}, it = (c) => {
|
|
1658
1671
|
if (!n || o.isLocked) return;
|
|
1659
|
-
|
|
1660
|
-
const
|
|
1661
|
-
|
|
1672
|
+
He(!0), n.setVolume(tt(c));
|
|
1673
|
+
const f = (C) => n.setVolume(tt(C)), w = () => {
|
|
1674
|
+
He(!1), document.removeEventListener("mousemove", f), document.removeEventListener("touchmove", f), document.removeEventListener("mouseup", w), document.removeEventListener("touchend", w);
|
|
1662
1675
|
};
|
|
1663
|
-
document.addEventListener("mousemove",
|
|
1664
|
-
},
|
|
1676
|
+
document.addEventListener("mousemove", f), document.addEventListener("touchmove", f), document.addEventListener("mouseup", w), document.addEventListener("touchend", w);
|
|
1677
|
+
}, Wt = (c) => {
|
|
1665
1678
|
if (!o.duration || o.isLive) return;
|
|
1666
|
-
const
|
|
1667
|
-
|
|
1679
|
+
const f = c.currentTarget.getBoundingClientRect(), w = (c.clientX - f.left) / f.width, C = w * o.duration;
|
|
1680
|
+
Vt(w * 100), _e(C), De.length > 0 && qe(De.find((j) => C >= j.start && C < j.end) || null);
|
|
1668
1681
|
}, le = (c) => {
|
|
1669
|
-
!n || o.isLocked || (n.skip(c === "forward" ? 10 : -10),
|
|
1670
|
-
},
|
|
1682
|
+
!n || o.isLocked || (n.skip(c === "forward" ? 10 : -10), Qe(c), setTimeout(() => Qe(null), 300));
|
|
1683
|
+
}, Dt = (c) => {
|
|
1671
1684
|
if (!n) return;
|
|
1672
1685
|
if (ee.current) {
|
|
1673
1686
|
ee.current = !1;
|
|
1674
1687
|
return;
|
|
1675
1688
|
}
|
|
1676
|
-
if ($ &&
|
|
1689
|
+
if ($ && V(!1), E && U(!1), ve && oe(!1), Z.visible && fe({ ...Z, visible: !1 }), n.setControlsVisible(!0), _.current && clearTimeout(_.current), _.current = setTimeout(() => {
|
|
1677
1690
|
!o.isPlaying || $ || E || n.setControlsVisible(!1);
|
|
1678
1691
|
}, 2500), o.isLocked) return;
|
|
1679
|
-
const
|
|
1680
|
-
ie.current ? (clearTimeout(ie.current), ie.current = null,
|
|
1692
|
+
const f = c.currentTarget.getBoundingClientRect(), w = c.clientX - f.left, C = f.width, j = Date.now();
|
|
1693
|
+
ie.current ? (clearTimeout(ie.current), ie.current = null, w < C * 0.35 ? (le("rewind"), ae({ type: "rewind", id: j })) : w > C * 0.65 ? (le("forward"), ae({ type: "forward", id: j })) : n.toggleFullscreen()) : ie.current = setTimeout(() => {
|
|
1681
1694
|
n.togglePlay(), ie.current = null;
|
|
1682
1695
|
}, 250);
|
|
1683
|
-
},
|
|
1684
|
-
var
|
|
1696
|
+
}, Ut = (c) => {
|
|
1697
|
+
var w;
|
|
1685
1698
|
if (c.preventDefault(), o.isLocked) return;
|
|
1686
|
-
const
|
|
1687
|
-
|
|
1699
|
+
const f = (w = q.current) == null ? void 0 : w.getBoundingClientRect();
|
|
1700
|
+
f && fe({
|
|
1688
1701
|
visible: !0,
|
|
1689
|
-
x: c.clientX -
|
|
1690
|
-
y: c.clientY -
|
|
1702
|
+
x: c.clientX - f.left,
|
|
1703
|
+
y: c.clientY - f.top
|
|
1691
1704
|
});
|
|
1692
|
-
},
|
|
1693
|
-
c.stopPropagation()
|
|
1694
|
-
|
|
1695
|
-
if (ve) {
|
|
1696
|
-
ae(!1);
|
|
1705
|
+
}, Gt = (c) => {
|
|
1706
|
+
if (c.stopPropagation(), ve) {
|
|
1707
|
+
oe(!1);
|
|
1697
1708
|
return;
|
|
1698
1709
|
}
|
|
1699
|
-
|
|
1700
|
-
},
|
|
1710
|
+
Ae ? oe(!0) : n == null || n.toggleMute();
|
|
1711
|
+
}, _t = o.isMuted || o.volume === 0 ? ui : o.volume < 0.5 ? di : ci, st = Math.max(100, Fe - 120), qt = () => {
|
|
1701
1712
|
switch (o.iconSize) {
|
|
1702
1713
|
case "small":
|
|
1703
1714
|
return "w-4 h-4";
|
|
@@ -1706,7 +1717,7 @@ const Te = (s) => {
|
|
|
1706
1717
|
default:
|
|
1707
1718
|
return "w-5 h-5";
|
|
1708
1719
|
}
|
|
1709
|
-
},
|
|
1720
|
+
}, Qt = () => {
|
|
1710
1721
|
switch (o.iconSize) {
|
|
1711
1722
|
case "small":
|
|
1712
1723
|
return "p-2 min-w-[32px] min-h-[32px]";
|
|
@@ -1715,7 +1726,7 @@ const Te = (s) => {
|
|
|
1715
1726
|
default:
|
|
1716
1727
|
return "p-2.5 min-w-[36px] min-h-[36px]";
|
|
1717
1728
|
}
|
|
1718
|
-
},
|
|
1729
|
+
}, A = qt(), O = Qt(), X = (() => {
|
|
1719
1730
|
switch (o.iconSize) {
|
|
1720
1731
|
case "small":
|
|
1721
1732
|
return {
|
|
@@ -1739,7 +1750,7 @@ const Te = (s) => {
|
|
|
1739
1750
|
skipIcon: "w-6 h-6"
|
|
1740
1751
|
};
|
|
1741
1752
|
}
|
|
1742
|
-
})(),
|
|
1753
|
+
})(), Xt = !o.isLocked && (o.controlsVisible || !o.isPlaying || $ || E), nt = At || Ft || ve, rt = zt ? "backdrop-blur-xl bg-black/80" : "bg-black/95", ot = Ce(() => {
|
|
1743
1754
|
const c = [
|
|
1744
1755
|
{ id: "play", position: "left", index: 10, isBuiltIn: !0 },
|
|
1745
1756
|
{ id: "volume", position: "left", index: 20, isBuiltIn: !0 },
|
|
@@ -1752,12 +1763,12 @@ const Te = (s) => {
|
|
|
1752
1763
|
{ id: "fullscreenWeb", position: "right", index: 110, isBuiltIn: !0 },
|
|
1753
1764
|
{ id: "fullscreen", position: "right", index: 120, isBuiltIn: !0 }
|
|
1754
1765
|
];
|
|
1755
|
-
return h.controls && h.controls.forEach((
|
|
1756
|
-
const
|
|
1757
|
-
|
|
1758
|
-
}), c.filter((
|
|
1759
|
-
}, [h.controls, y, k, z, R,
|
|
1760
|
-
var
|
|
1766
|
+
return h.controls && h.controls.forEach((f) => {
|
|
1767
|
+
const w = c.find((C) => C.id === f.id);
|
|
1768
|
+
w ? Object.assign(w, f) : c.push(f);
|
|
1769
|
+
}), c.filter((f) => !(f.id === "screenshot" && !y || f.id === "pip" && !k || f.id === "settings" && !z || f.id === "fullscreen" && !R || f.id === "fullscreenWeb" && !p)).sort((f, w) => f.index - w.index);
|
|
1770
|
+
}, [h.controls, y, k, z, R, p]), at = (c) => {
|
|
1771
|
+
var f, w, C, j, ht;
|
|
1761
1772
|
if (!c.isBuiltIn)
|
|
1762
1773
|
return /* @__PURE__ */ e(
|
|
1763
1774
|
"button",
|
|
@@ -1768,41 +1779,41 @@ const Te = (s) => {
|
|
|
1768
1779
|
className: `strata-control-btn text-zinc-300 hover:text-white transition-colors hover:bg-white/10 focus:outline-none flex items-center justify-center ${O} ${c.className || ""}`,
|
|
1769
1780
|
style: { borderRadius: "var(--radius)", ...c.style },
|
|
1770
1781
|
title: c.tooltip,
|
|
1771
|
-
children: /* @__PURE__ */ e(
|
|
1782
|
+
children: /* @__PURE__ */ e(wt, { content: c.html || "" })
|
|
1772
1783
|
},
|
|
1773
1784
|
c.index
|
|
1774
1785
|
);
|
|
1775
1786
|
switch (c.id) {
|
|
1776
1787
|
case "play":
|
|
1777
|
-
return /* @__PURE__ */ e("button", { onClick: () => n == null ? void 0 : n.togglePlay(), className: `strata-control-btn text-zinc-300 hover:text-white transition-colors hover:bg-white/10 focus:outline-none ${O}`, style: { borderRadius: "var(--radius)" }, children: o.isPlaying ? /* @__PURE__ */ e(
|
|
1788
|
+
return /* @__PURE__ */ e("button", { onClick: () => n == null ? void 0 : n.togglePlay(), className: `strata-control-btn text-zinc-300 hover:text-white transition-colors hover:bg-white/10 focus:outline-none ${O}`, style: { borderRadius: "var(--radius)" }, children: o.isPlaying ? /* @__PURE__ */ e(pt, { className: `${A} fill-current` }) : /* @__PURE__ */ e(ft, { className: `${A} fill-current` }) }, "play");
|
|
1778
1789
|
case "volume":
|
|
1779
1790
|
return /* @__PURE__ */ l(
|
|
1780
1791
|
"div",
|
|
1781
1792
|
{
|
|
1782
1793
|
className: "flex items-center gap-2 group/vol relative",
|
|
1783
1794
|
onMouseEnter: () => {
|
|
1784
|
-
window.matchMedia("(hover: hover)").matches &&
|
|
1795
|
+
window.matchMedia("(hover: hover)").matches && We(!0);
|
|
1785
1796
|
},
|
|
1786
1797
|
onMouseLeave: () => {
|
|
1787
|
-
window.matchMedia("(hover: hover)").matches &&
|
|
1798
|
+
window.matchMedia("(hover: hover)").matches && We(!1);
|
|
1788
1799
|
},
|
|
1789
1800
|
children: [
|
|
1790
|
-
/* @__PURE__ */ e("button", { onClick:
|
|
1791
|
-
/* @__PURE__ */ e("div", { className: `relative h-8 flex items-center transition-all duration-300 ease-out overflow-hidden ${
|
|
1801
|
+
/* @__PURE__ */ e("button", { onClick: Gt, className: `strata-control-btn text-zinc-300 hover:text-white hover:bg-white/10 focus:outline-none ${O}`, style: { borderRadius: "var(--radius)" }, children: /* @__PURE__ */ e(_t, { className: A }) }),
|
|
1802
|
+
/* @__PURE__ */ e("div", { className: `relative h-8 flex items-center transition-all duration-300 ease-out overflow-hidden ${nt ? "w-28 opacity-100 ml-1" : "w-0 opacity-0"}`, children: /* @__PURE__ */ l("div", { ref: ye, className: "relative w-full h-full flex items-center cursor-pointer px-2", onMouseDown: it, onTouchStart: it, children: [
|
|
1792
1803
|
/* @__PURE__ */ e("div", { className: "w-full h-1 bg-white/20 overflow-hidden", style: { borderRadius: "var(--radius-full)" }, children: /* @__PURE__ */ e("div", { className: "h-full bg-white", style: { width: `${(o.isMuted ? 0 : o.volume) * 100}%`, borderRadius: "var(--radius-full)" } }) }),
|
|
1793
1804
|
/* @__PURE__ */ e("div", { className: "absolute h-3 w-3 bg-white shadow-md top-1/2 -translate-y-1/2 pointer-events-none", style: { left: `calc(${(o.isMuted ? 0 : o.volume) * 100}% * 0.85 + 4px)`, borderRadius: "var(--radius-full)" } })
|
|
1794
1805
|
] }) }),
|
|
1795
|
-
|
|
1806
|
+
nt && /* @__PURE__ */ e("div", { className: "strata-tooltip absolute bottom-full mb-2 px-1.5 py-0.5 rounded text-[10px] font-bold font-mono shadow-lg pointer-events-none whitespace-nowrap z-50 transform -translate-x-1/2", style: { left: `calc(52px + ${(o.isMuted ? 0 : o.volume) * 80}px)` }, children: o.isMuted ? "0%" : `${Math.round(o.volume * 100)}%` })
|
|
1796
1807
|
]
|
|
1797
1808
|
},
|
|
1798
1809
|
"volume"
|
|
1799
1810
|
);
|
|
1800
1811
|
case "time":
|
|
1801
|
-
return h.isLive ? /* @__PURE__ */ l("div", { className: "flex items-center gap-2 px-2 py-0.5
|
|
1802
|
-
/* @__PURE__ */ e("div", { className: "w-2 h-2 rounded-full
|
|
1803
|
-
/* @__PURE__ */ e("span", { className: "text-[10px] font-bold
|
|
1812
|
+
return h.isLive ? /* @__PURE__ */ l("div", { className: "flex items-center gap-2 px-2 py-0.5 rounded-md border border-white/10", style: { backgroundColor: `${o.themeColor}1a`, borderColor: `${o.themeColor}33` }, children: [
|
|
1813
|
+
/* @__PURE__ */ e("div", { className: "w-2 h-2 rounded-full animate-pulse", style: { backgroundColor: o.themeColor } }),
|
|
1814
|
+
/* @__PURE__ */ e("span", { className: "text-[10px] font-bold tracking-wider", style: { color: o.themeColor }, children: "LIVE" })
|
|
1804
1815
|
] }, "live") : /* @__PURE__ */ l("div", { className: "text-xs font-medium text-zinc-400 font-mono select-none hidden sm:block tabular-nums", children: [
|
|
1805
|
-
Te(
|
|
1816
|
+
Te(pe ? re : o.currentTime),
|
|
1806
1817
|
" ",
|
|
1807
1818
|
/* @__PURE__ */ e("span", { className: "text-zinc-600", children: "/" }),
|
|
1808
1819
|
" ",
|
|
@@ -1811,10 +1822,10 @@ const Te = (s) => {
|
|
|
1811
1822
|
case "subtitle":
|
|
1812
1823
|
return /* @__PURE__ */ l("div", { className: "relative", children: [
|
|
1813
1824
|
/* @__PURE__ */ e("button", { onClick: (u) => {
|
|
1814
|
-
u.stopPropagation(), U(!E),
|
|
1815
|
-
}, className: `strata-control-btn transition-colors focus:outline-none ${O} ${E ? "text-[var(--accent)] bg-white/10" : "text-zinc-300 hover:text-white hover:bg-white/10"}`, style: { borderRadius: "var(--radius)" }, children: /* @__PURE__ */ e(
|
|
1816
|
-
|
|
1817
|
-
|
|
1825
|
+
u.stopPropagation(), U(!E), V(!1);
|
|
1826
|
+
}, className: `strata-control-btn transition-colors focus:outline-none ${O} ${E ? "text-[var(--accent)] bg-white/10" : "text-zinc-300 hover:text-white hover:bg-white/10"}`, style: { borderRadius: "var(--radius)" }, children: /* @__PURE__ */ e(bi, { className: A }) }),
|
|
1827
|
+
je.isMounted && /* @__PURE__ */ e(
|
|
1828
|
+
Di,
|
|
1818
1829
|
{
|
|
1819
1830
|
tracks: o.subtitleTracks,
|
|
1820
1831
|
current: o.currentSubtitle,
|
|
@@ -1826,40 +1837,40 @@ const Te = (s) => {
|
|
|
1826
1837
|
onReset: () => n == null ? void 0 : n.resetSubtitleSettings(),
|
|
1827
1838
|
offset: o.subtitleOffset,
|
|
1828
1839
|
onOffsetChange: (u) => n == null ? void 0 : n.setSubtitleOffset(u),
|
|
1829
|
-
maxHeight:
|
|
1830
|
-
animationClass: `strata-backdrop ${
|
|
1840
|
+
maxHeight: st,
|
|
1841
|
+
animationClass: `strata-backdrop ${rt} ${je.isVisible ? "opacity-100 translate-y-0 scale-100" : "opacity-0 translate-y-2 scale-95"}`
|
|
1831
1842
|
}
|
|
1832
1843
|
)
|
|
1833
1844
|
] }, "subtitle");
|
|
1834
1845
|
case "screenshot":
|
|
1835
|
-
return /* @__PURE__ */ e("button", { onClick: () => n == null ? void 0 : n.screenshot(), className: `strata-control-btn text-zinc-300 hover:text-white hover:bg-white/10 transition-colors hidden sm:block focus:outline-none ${O}`, style: { borderRadius: "var(--radius)" }, title: "Screenshot", children: /* @__PURE__ */ e(
|
|
1846
|
+
return /* @__PURE__ */ e("button", { onClick: () => n == null ? void 0 : n.screenshot(), className: `strata-control-btn text-zinc-300 hover:text-white hover:bg-white/10 transition-colors hidden sm:block focus:outline-none ${O}`, style: { borderRadius: "var(--radius)" }, title: "Screenshot", children: /* @__PURE__ */ e(Ei, { className: A }) }, "ss");
|
|
1836
1847
|
case "pip":
|
|
1837
|
-
return /* @__PURE__ */ e("button", { onClick: () => n == null ? void 0 : n.togglePip(), className: `strata-control-btn text-zinc-300 hover:text-white hover:bg-white/10 transition-colors hidden sm:block focus:outline-none ${O}`, style: { borderRadius: "var(--radius)" }, children: /* @__PURE__ */ e(
|
|
1848
|
+
return /* @__PURE__ */ e("button", { onClick: () => n == null ? void 0 : n.togglePip(), className: `strata-control-btn text-zinc-300 hover:text-white hover:bg-white/10 transition-colors hidden sm:block focus:outline-none ${O}`, style: { borderRadius: "var(--radius)" }, children: /* @__PURE__ */ e(pi, { className: A }) }, "pip");
|
|
1838
1849
|
case "download":
|
|
1839
|
-
return /* @__PURE__ */ e("button", { onClick: () => n == null ? void 0 : n.download(), className: `strata-control-btn text-zinc-300 hover:text-white hover:bg-white/10 transition-colors hidden sm:block focus:outline-none ${O}`, style: { borderRadius: "var(--radius)" }, children: /* @__PURE__ */ e(
|
|
1850
|
+
return /* @__PURE__ */ e("button", { onClick: () => n == null ? void 0 : n.download(), className: `strata-control-btn text-zinc-300 hover:text-white hover:bg-white/10 transition-colors hidden sm:block focus:outline-none ${O}`, style: { borderRadius: "var(--radius)" }, children: /* @__PURE__ */ e(vi, { className: A }) }, "dl");
|
|
1840
1851
|
case "fullscreen":
|
|
1841
|
-
return /* @__PURE__ */ e("button", { onClick: () => n == null ? void 0 : n.toggleFullscreen(), className: `strata-control-btn text-zinc-300 hover:text-white hover:bg-white/10 rounded-lg transition-transform
|
|
1852
|
+
return /* @__PURE__ */ e("button", { onClick: () => n == null ? void 0 : n.toggleFullscreen(), className: `strata-control-btn text-zinc-300 hover:text-white hover:bg-white/10 rounded-lg transition-transform focus:outline-none ${O}`, style: { borderRadius: "var(--radius)" }, children: o.isFullscreen ? /* @__PURE__ */ e(mi, { className: A }) : /* @__PURE__ */ e(hi, { className: A }) }, "fs");
|
|
1842
1853
|
case "fullscreenWeb":
|
|
1843
|
-
return /* @__PURE__ */ e("button", { className: `strata-control-btn text-zinc-300 hover:text-white hover:bg-white/10 hidden sm:block focus:outline-none ${O}`, style: { borderRadius: "var(--radius)" }, title: "Web Fullscreen", children: /* @__PURE__ */ e(
|
|
1854
|
+
return /* @__PURE__ */ e("button", { onClick: () => n == null ? void 0 : n.toggleWebFullscreen(), className: `strata-control-btn text-zinc-300 hover:text-white hover:bg-white/10 hidden sm:block focus:outline-none ${O} ${o.isWebFullscreen ? "text-[var(--accent)]" : ""}`, style: { borderRadius: "var(--radius)" }, title: "Web Fullscreen", children: /* @__PURE__ */ e(Ai, { className: A }) }, "fsw");
|
|
1844
1855
|
case "settings":
|
|
1845
1856
|
return /* @__PURE__ */ l("div", { className: "relative", children: [
|
|
1846
1857
|
/* @__PURE__ */ e("button", { onClick: (u) => {
|
|
1847
|
-
u.stopPropagation(),
|
|
1848
|
-
}, className: `strata-control-btn transition-all duration-300 focus:outline-none ${O} ${$ ? "rotate-90 text-[var(--accent)] bg-white/10" : "text-zinc-300 hover:text-white hover:bg-white/10"}`, style: { borderRadius: "var(--radius)" }, children: /* @__PURE__ */ e(
|
|
1849
|
-
|
|
1850
|
-
|
|
1858
|
+
u.stopPropagation(), V(!$), U(!1), M("main");
|
|
1859
|
+
}, className: `strata-control-btn transition-all duration-300 focus:outline-none ${O} ${$ ? "rotate-90 text-[var(--accent)] bg-white/10" : "text-zinc-300 hover:text-white hover:bg-white/10"}`, style: { borderRadius: "var(--radius)" }, children: /* @__PURE__ */ e(fi, { className: A }) }),
|
|
1860
|
+
Oe.isMounted && /* @__PURE__ */ e(Nt, { onClose: () => V(!1), align: "right", maxHeight: st, className: `strata-backdrop ${rt} ${Oe.isVisible ? "opacity-100 translate-y-0 scale-100" : "opacity-0 translate-y-2 scale-95"}`, children: /* @__PURE__ */ l("div", { className: "w-full", children: [
|
|
1861
|
+
F === "main" && /* @__PURE__ */ l("div", { className: "animate-in slide-in-from-left-4 fade-in duration-200", children: [
|
|
1851
1862
|
/* @__PURE__ */ e("div", { className: "px-3 py-2 mb-1 border-b border-white/5 font-bold text-zinc-400 uppercase text-[11px] tracking-wider flex justify-between items-center bg-white/5 sticky top-0 z-10 backdrop-blur-md", style: { borderRadius: "var(--radius)" }, children: /* @__PURE__ */ e("span", { children: "Settings" }) }),
|
|
1852
|
-
o.sources.length > 1 && /* @__PURE__ */ e(T, { label: "Source", value: ((
|
|
1863
|
+
o.sources.length > 1 && /* @__PURE__ */ e(T, { label: "Source", value: ((f = o.sources[o.currentSourceIndex]) == null ? void 0 : f.name) || `Source ${o.currentSourceIndex + 1}`, onClick: () => M("sources"), hasSubmenu: !0 }),
|
|
1853
1864
|
/* @__PURE__ */ e(T, { label: "Speed", value: `${o.playbackRate}x`, onClick: () => M("speed"), hasSubmenu: !0 }),
|
|
1854
|
-
/* @__PURE__ */ e(T, { label: "Quality", value: o.currentQuality === -1 ? "Auto" : `${(
|
|
1855
|
-
/* @__PURE__ */ e(T, { label: "Audio", value: ((
|
|
1856
|
-
|
|
1857
|
-
|
|
1858
|
-
/* @__PURE__ */ e(
|
|
1865
|
+
/* @__PURE__ */ e(T, { label: "Quality", value: o.currentQuality === -1 ? "Auto" : `${(w = o.qualityLevels[o.currentQuality]) == null ? void 0 : w.height}p`, onClick: () => M("quality"), hasSubmenu: !0 }),
|
|
1866
|
+
/* @__PURE__ */ e(T, { label: "Audio", value: ((C = o.audioTracks[o.currentAudioTrack]) == null ? void 0 : C.label) || "Default", onClick: () => M("audio"), hasSubmenu: !0 }),
|
|
1867
|
+
Tt && /* @__PURE__ */ e(T, { label: "Flip", value: o.flipState.horizontal ? "H" : o.flipState.vertical ? "V" : "Normal", onClick: () => M("flip"), hasSubmenu: !0 }),
|
|
1868
|
+
Mt && /* @__PURE__ */ e(T, { label: "Aspect Ratio", value: o.aspectRatio, onClick: () => M("ratio"), hasSubmenu: !0 }),
|
|
1869
|
+
/* @__PURE__ */ e(xt, {}),
|
|
1859
1870
|
/* @__PURE__ */ e(T, { label: "Audio Boost", value: o.audioGain > 1 ? `${o.audioGain}x` : "Off", onClick: () => M("boost"), hasSubmenu: !0 }),
|
|
1860
|
-
/* @__PURE__ */ e(T, { label: "Watch Party", icon: /* @__PURE__ */ e(
|
|
1861
|
-
/* @__PURE__ */ e(T, { label: "Cast to Device", icon: /* @__PURE__ */ e(
|
|
1862
|
-
n == null || n.requestCast(),
|
|
1871
|
+
/* @__PURE__ */ e(T, { label: "Watch Party", icon: /* @__PURE__ */ e(yi, { className: "w-4 h-4" }), onClick: () => M("party"), hasSubmenu: !0 }),
|
|
1872
|
+
/* @__PURE__ */ e(T, { label: "Cast to Device", icon: /* @__PURE__ */ e(wi, { className: "w-4 h-4" }), onClick: () => {
|
|
1873
|
+
n == null || n.requestCast(), V(!1);
|
|
1863
1874
|
} }),
|
|
1864
1875
|
(j = h.settings) == null ? void 0 : j.map((u, J) => u.switch !== void 0 ? /* @__PURE__ */ e("div", { className: "px-1", children: /* @__PURE__ */ e(
|
|
1865
1876
|
K,
|
|
@@ -1868,7 +1879,7 @@ const Te = (s) => {
|
|
|
1868
1879
|
icon: u.icon,
|
|
1869
1880
|
checked: u.switch,
|
|
1870
1881
|
tooltip: u.tooltip,
|
|
1871
|
-
onChange: (
|
|
1882
|
+
onChange: (Ji) => {
|
|
1872
1883
|
u.onSwitch && u.onSwitch(u);
|
|
1873
1884
|
}
|
|
1874
1885
|
}
|
|
@@ -1878,62 +1889,62 @@ const Te = (s) => {
|
|
|
1878
1889
|
label: u.html,
|
|
1879
1890
|
icon: u.icon,
|
|
1880
1891
|
onClick: () => {
|
|
1881
|
-
u.click ? u.click() : u.onClick && u.onClick(),
|
|
1892
|
+
u.click ? u.click() : u.onClick && u.onClick(), V(!1);
|
|
1882
1893
|
}
|
|
1883
1894
|
},
|
|
1884
1895
|
`cust-${J}`
|
|
1885
1896
|
)),
|
|
1886
|
-
/* @__PURE__ */ e(
|
|
1887
|
-
/* @__PURE__ */ e(T, { label: "Appearance", icon: /* @__PURE__ */ e(
|
|
1897
|
+
/* @__PURE__ */ e(xt, {}),
|
|
1898
|
+
/* @__PURE__ */ e(T, { label: "Appearance", icon: /* @__PURE__ */ e(Ct, { className: "w-4 h-4" }), onClick: () => M("appearance"), hasSubmenu: !0 })
|
|
1888
1899
|
] }),
|
|
1889
|
-
["speed", "quality", "audio", "boost", "party", "appearance", "sources", "flip", "ratio"].includes(
|
|
1890
|
-
|
|
1900
|
+
["speed", "quality", "audio", "boost", "party", "appearance", "sources", "flip", "ratio"].includes(F) && /* @__PURE__ */ l("div", { className: "animate-in slide-in-from-right-4 fade-in duration-200", children: [
|
|
1901
|
+
F === "sources" && /* @__PURE__ */ l(L, { children: [
|
|
1891
1902
|
/* @__PURE__ */ e(H, { label: "Select Source", onBack: () => M("main") }),
|
|
1892
1903
|
o.sources.map((u, J) => /* @__PURE__ */ e(T, { label: u.name || `Source ${J + 1}`, value: u.type, active: o.currentSourceIndex === J, onClick: () => n == null ? void 0 : n.switchSource(J) }, J))
|
|
1893
1904
|
] }),
|
|
1894
|
-
|
|
1905
|
+
F === "speed" && /* @__PURE__ */ l(L, { children: [
|
|
1895
1906
|
/* @__PURE__ */ e(H, { label: "Speed", onBack: () => M("main") }),
|
|
1896
1907
|
[0.5, 1, 1.5, 2].map((u) => /* @__PURE__ */ e(T, { label: `${u}x`, active: o.playbackRate === u, onClick: () => n.video.playbackRate = u }, u))
|
|
1897
1908
|
] }),
|
|
1898
|
-
|
|
1909
|
+
F === "quality" && /* @__PURE__ */ l(L, { children: [
|
|
1899
1910
|
/* @__PURE__ */ e(H, { label: "Quality", onBack: () => M("main") }),
|
|
1900
1911
|
/* @__PURE__ */ e(T, { label: "Auto", active: o.currentQuality === -1, onClick: () => n == null ? void 0 : n.setQuality(-1) }),
|
|
1901
1912
|
o.qualityLevels.map((u) => /* @__PURE__ */ e(T, { label: `${u.height}p`, value: `${Math.round(u.bitrate / 1e3)}k`, active: o.currentQuality === u.index, onClick: () => n == null ? void 0 : n.setQuality(u.index) }, u.index))
|
|
1902
1913
|
] }),
|
|
1903
|
-
|
|
1914
|
+
F === "audio" && /* @__PURE__ */ l(L, { children: [
|
|
1904
1915
|
/* @__PURE__ */ e(H, { label: "Audio Track", onBack: () => M("main") }),
|
|
1905
1916
|
o.audioTracks.length === 0 && /* @__PURE__ */ e("div", { className: "px-4 py-3 text-zinc-500 text-xs text-center", children: "No tracks available" }),
|
|
1906
1917
|
o.audioTracks.map((u) => /* @__PURE__ */ e(T, { label: u.label, value: u.language, active: o.currentAudioTrack === u.index, onClick: () => n == null ? void 0 : n.setAudioTrack(u.index) }, u.index))
|
|
1907
1918
|
] }),
|
|
1908
|
-
|
|
1919
|
+
F === "boost" && /* @__PURE__ */ l(L, { children: [
|
|
1909
1920
|
/* @__PURE__ */ e(H, { label: "Audio Boost", onBack: () => M("main") }),
|
|
1910
1921
|
[1, 1.5, 2, 3].map((u) => /* @__PURE__ */ e(T, { label: u === 1 ? "Off" : `${u}x`, active: o.audioGain === u, onClick: () => n == null ? void 0 : n.setAudioGain(u) }, u))
|
|
1911
1922
|
] }),
|
|
1912
|
-
|
|
1923
|
+
F === "flip" && /* @__PURE__ */ l(L, { children: [
|
|
1913
1924
|
/* @__PURE__ */ e(H, { label: "Video Flip", onBack: () => M("main") }),
|
|
1914
1925
|
/* @__PURE__ */ l("div", { className: "p-2 space-y-1", children: [
|
|
1915
1926
|
/* @__PURE__ */ e(K, { label: "Horizontal Flip", checked: o.flipState.horizontal, onChange: () => n == null ? void 0 : n.setFlip("horizontal") }),
|
|
1916
1927
|
/* @__PURE__ */ e(K, { label: "Vertical Flip", checked: o.flipState.vertical, onChange: () => n == null ? void 0 : n.setFlip("vertical") })
|
|
1917
1928
|
] })
|
|
1918
1929
|
] }),
|
|
1919
|
-
|
|
1930
|
+
F === "ratio" && /* @__PURE__ */ l(L, { children: [
|
|
1920
1931
|
/* @__PURE__ */ e(H, { label: "Aspect Ratio", onBack: () => M("main") }),
|
|
1921
1932
|
["default", "16:9", "4:3"].map((u) => /* @__PURE__ */ e(T, { label: u === "default" ? "Default" : u, active: o.aspectRatio === u, onClick: () => n == null ? void 0 : n.setAspectRatio(u) }, u))
|
|
1922
1933
|
] }),
|
|
1923
|
-
|
|
1934
|
+
F === "party" && /* @__PURE__ */ l(L, { children: [
|
|
1924
1935
|
/* @__PURE__ */ e(H, { label: "Watch Party", onBack: () => M("main") }),
|
|
1925
1936
|
/* @__PURE__ */ l("div", { className: "p-4 space-y-3", children: [
|
|
1926
1937
|
/* @__PURE__ */ e("p", { className: "text-xs text-zinc-400 leading-relaxed", children: "Create a synchronized room on WatchParty.me to watch together." }),
|
|
1927
|
-
/* @__PURE__ */ e("a", { href: `https://www.watchparty.me/create?video=${encodeURIComponent(((
|
|
1938
|
+
/* @__PURE__ */ e("a", { href: `https://www.watchparty.me/create?video=${encodeURIComponent(((ht = o.sources[o.currentSourceIndex]) == null ? void 0 : ht.url) || t || "")}`, target: "_blank", rel: "noopener noreferrer", className: "flex items-center justify-center w-full py-2.5 bg-[var(--accent)] hover:opacity-90 text-white font-medium transition-opacity text-xs", style: { borderRadius: "var(--radius)" }, children: "Create Room" })
|
|
1928
1939
|
] })
|
|
1929
1940
|
] }),
|
|
1930
|
-
|
|
1941
|
+
F === "appearance" && /* @__PURE__ */ l(L, { children: [
|
|
1931
1942
|
/* @__PURE__ */ e(H, { label: "Appearance", onBack: () => M("main") }),
|
|
1932
1943
|
/* @__PURE__ */ l("div", { className: "pb-1", children: [
|
|
1933
|
-
/* @__PURE__ */ e(Y, { title: "Theme", children: /* @__PURE__ */ e("div", { className: "grid grid-cols-2 gap-2 px-3", children:
|
|
1944
|
+
/* @__PURE__ */ e(Y, { title: "Theme", children: /* @__PURE__ */ e("div", { className: "grid grid-cols-2 gap-2 px-3", children: qi.map((u) => /* @__PURE__ */ e("button", { onClick: () => n == null ? void 0 : n.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 ${o.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)) }) }),
|
|
1934
1945
|
/* @__PURE__ */ e(Y, { title: "Icon Size", children: /* @__PURE__ */ e("div", { className: "grid grid-cols-3 gap-1 px-3", children: ["small", "medium", "large"].map((u) => /* @__PURE__ */ e("button", { onClick: () => n == null ? void 0 : n.setAppearance({ iconSize: u }), className: `py-1.5 text-xs font-medium transition-colors ${o.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)) }) }),
|
|
1935
1946
|
/* @__PURE__ */ l(Y, { title: "Theme Color", children: [
|
|
1936
|
-
/* @__PURE__ */ e("div", { className: "grid grid-cols-6 gap-2 px-3", children:
|
|
1947
|
+
/* @__PURE__ */ e("div", { className: "grid grid-cols-6 gap-2 px-3", children: _i.map((u) => /* @__PURE__ */ e("button", { title: u.label, onClick: () => n == null ? void 0 : n.setAppearance({ themeColor: u.value }), className: `w-6 h-6 transition-transform hover:scale-110 ${o.themeColor === u.value ? "ring-2 ring-white scale-110" : "ring-1 ring-white/10"}`, style: { backgroundColor: u.value, borderRadius: "var(--radius-full)" }, children: o.themeColor === u.value && /* @__PURE__ */ e(Le, { className: "w-3 h-3 text-white mx-auto stroke-[3]" }) }, u.value)) }),
|
|
1937
1948
|
/* @__PURE__ */ e("div", { className: "px-3 pt-4", children: /* @__PURE__ */ l("div", { className: "flex items-center gap-3 bg-white/5 p-2 hover:bg-white/10 transition-colors group", style: { borderRadius: "var(--radius)" }, children: [
|
|
1938
1949
|
/* @__PURE__ */ e("div", { className: "relative w-6 h-6 overflow-hidden ring-1 ring-white/20", style: { borderRadius: "var(--radius-full)" }, children: /* @__PURE__ */ e("input", { type: "color", value: o.themeColor, onChange: (u) => n == null ? void 0 : n.setAppearance({ themeColor: u.target.value }), className: "absolute inset-[-4px] w-[150%] h-[150%] cursor-pointer p-0 border-0" }) }),
|
|
1939
1950
|
/* @__PURE__ */ e("span", { className: "text-xs text-zinc-400 font-medium group-hover:text-zinc-200", children: "Custom Color" }),
|
|
@@ -1948,7 +1959,7 @@ const Te = (s) => {
|
|
|
1948
1959
|
default:
|
|
1949
1960
|
return null;
|
|
1950
1961
|
}
|
|
1951
|
-
},
|
|
1962
|
+
}, Jt = Ce(() => {
|
|
1952
1963
|
const c = [
|
|
1953
1964
|
// Loop (Playback Group)
|
|
1954
1965
|
{ html: "Playback", isLabel: !0 },
|
|
@@ -1972,7 +1983,7 @@ const Te = (s) => {
|
|
|
1972
1983
|
// Stats
|
|
1973
1984
|
{
|
|
1974
1985
|
html: "Video Info",
|
|
1975
|
-
icon: /* @__PURE__ */ e(
|
|
1986
|
+
icon: /* @__PURE__ */ e(Oi, { className: "w-3.5 h-3.5" }),
|
|
1976
1987
|
onClick: () => Ve(!0)
|
|
1977
1988
|
},
|
|
1978
1989
|
{ separator: !0 }
|
|
@@ -1982,31 +1993,30 @@ const Te = (s) => {
|
|
|
1982
1993
|
disabled: !0
|
|
1983
1994
|
}), c.push({
|
|
1984
1995
|
html: "Close",
|
|
1985
|
-
onClick: (
|
|
1996
|
+
onClick: (f) => f(),
|
|
1986
1997
|
// Wrapper handles close
|
|
1987
1998
|
icon: /* @__PURE__ */ e("div", { className: "text-red-400", children: /* @__PURE__ */ l("svg", { width: "12", height: "12", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "3", strokeLinecap: "round", strokeLinejoin: "round", children: [
|
|
1988
1999
|
/* @__PURE__ */ e("path", { d: "M18 6 6 18" }),
|
|
1989
2000
|
/* @__PURE__ */ e("path", { d: "m6 6 12 12" })
|
|
1990
2001
|
] }) })
|
|
1991
2002
|
}), c;
|
|
1992
|
-
}, [h.contextmenu, o.aspectRatio, o.isLooping, n])
|
|
1993
|
-
return /* @__PURE__ */ l(
|
|
2003
|
+
}, [h.contextmenu, o.aspectRatio, o.isLooping, n]), lt = o.isWebFullscreen, ct = /* @__PURE__ */ l(
|
|
1994
2004
|
"div",
|
|
1995
2005
|
{
|
|
1996
2006
|
id: h.id,
|
|
1997
2007
|
ref: q,
|
|
1998
|
-
className: `group
|
|
2008
|
+
className: `group bg-black overflow-hidden select-none font-[family-name:var(--font-main)] outline-none text-zinc-100 strata-player-reset ${lt ? "fixed inset-0 z-[2147483647] w-screen h-screen rounded-none" : "relative w-full h-full rounded-[var(--radius)]"} ${h.container || ""}`,
|
|
1999
2009
|
style: { touchAction: "manipulation", "--accent": o.themeColor },
|
|
2000
|
-
onMouseMove:
|
|
2010
|
+
onMouseMove: Ye,
|
|
2001
2011
|
onMouseLeave: () => {
|
|
2002
2012
|
o.isPlaying && !$ && !E && n && n.setControlsVisible(!1);
|
|
2003
2013
|
},
|
|
2004
|
-
onMouseDown:
|
|
2014
|
+
onMouseDown: Ze,
|
|
2005
2015
|
onMouseUp: ke,
|
|
2006
|
-
onTouchStart:
|
|
2007
|
-
onTouchMove:
|
|
2008
|
-
onTouchEnd:
|
|
2009
|
-
onContextMenu:
|
|
2016
|
+
onTouchStart: Ot,
|
|
2017
|
+
onTouchMove: jt,
|
|
2018
|
+
onTouchEnd: Ht,
|
|
2019
|
+
onContextMenu: Ut,
|
|
2010
2020
|
tabIndex: 0,
|
|
2011
2021
|
role: "region",
|
|
2012
2022
|
"aria-label": "Video Player",
|
|
@@ -2109,18 +2119,18 @@ const Te = (s) => {
|
|
|
2109
2119
|
o.theme === "hacker" && /* @__PURE__ */ e("div", { className: "strata-scanlines" }),
|
|
2110
2120
|
!n && /* @__PURE__ */ e("div", { className: "absolute inset-0 flex items-center justify-center bg-zinc-950 z-50", children: /* @__PURE__ */ e(Ie, { className: "w-10 h-10 text-[var(--accent)] animate-spin" }) }),
|
|
2111
2121
|
n && /* @__PURE__ */ l(L, { children: [
|
|
2112
|
-
(
|
|
2122
|
+
(dt = h.layers) == null ? void 0 : dt.map((c, f) => /* @__PURE__ */ e(
|
|
2113
2123
|
"div",
|
|
2114
2124
|
{
|
|
2115
2125
|
className: `absolute inset-0 pointer-events-none z-10 ${c.className || ""}`,
|
|
2116
2126
|
style: c.style,
|
|
2117
|
-
children: /* @__PURE__ */ e(
|
|
2127
|
+
children: /* @__PURE__ */ e(wt, { content: c.html || "", className: "w-full h-full" })
|
|
2118
2128
|
},
|
|
2119
|
-
|
|
2129
|
+
f
|
|
2120
2130
|
)),
|
|
2121
|
-
/* @__PURE__ */ e(
|
|
2122
|
-
/* @__PURE__ */ e(
|
|
2123
|
-
/* @__PURE__ */ e("div", { className: "absolute inset-0 z-0", onClick:
|
|
2131
|
+
/* @__PURE__ */ e(ji, { notifications: o.notifications }),
|
|
2132
|
+
/* @__PURE__ */ e(Hi, { cues: o.activeCues, settings: o.subtitleSettings }),
|
|
2133
|
+
/* @__PURE__ */ e("div", { className: "absolute inset-0 z-0", onClick: Dt, "aria-hidden": "true" }),
|
|
2124
2134
|
a && !he && /* @__PURE__ */ e(
|
|
2125
2135
|
"div",
|
|
2126
2136
|
{
|
|
@@ -2129,38 +2139,38 @@ const Te = (s) => {
|
|
|
2129
2139
|
}
|
|
2130
2140
|
),
|
|
2131
2141
|
Z.visible && /* @__PURE__ */ e(
|
|
2132
|
-
|
|
2142
|
+
Ui,
|
|
2133
2143
|
{
|
|
2134
2144
|
x: Z.x,
|
|
2135
2145
|
y: Z.y,
|
|
2136
|
-
items:
|
|
2137
|
-
onClose: () =>
|
|
2138
|
-
containerWidth:
|
|
2139
|
-
containerHeight:
|
|
2146
|
+
items: Jt,
|
|
2147
|
+
onClose: () => fe({ ...Z, visible: !1 }),
|
|
2148
|
+
containerWidth: Lt,
|
|
2149
|
+
containerHeight: Fe
|
|
2140
2150
|
}
|
|
2141
2151
|
),
|
|
2142
|
-
|
|
2152
|
+
Pt && n && /* @__PURE__ */ e(Gi, { player: n, onClose: () => Ve(!1) }),
|
|
2143
2153
|
ge && /* @__PURE__ */ l("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: [
|
|
2144
|
-
/* @__PURE__ */ e(
|
|
2154
|
+
/* @__PURE__ */ e(Bi, { className: "w-4 h-4 text-[var(--accent)] fill-current" }),
|
|
2145
2155
|
/* @__PURE__ */ e("span", { className: "text-xs font-bold tracking-wider", children: "2x Speed" })
|
|
2146
2156
|
] }),
|
|
2147
|
-
W && o.controlsVisible && /* @__PURE__ */ e(
|
|
2157
|
+
W && Ae && o.controlsVisible && /* @__PURE__ */ e(
|
|
2148
2158
|
"button",
|
|
2149
2159
|
{
|
|
2150
2160
|
onClick: (c) => {
|
|
2151
2161
|
c.stopPropagation(), n.toggleLock();
|
|
2152
2162
|
},
|
|
2153
2163
|
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 ${o.isLocked ? "text-[var(--accent)] bg-white/10" : "hover:bg-white/10"}`,
|
|
2154
|
-
children: o.isLocked ? /* @__PURE__ */ e(
|
|
2164
|
+
children: o.isLocked ? /* @__PURE__ */ e(Pi, { className: "w-5 h-5" }) : /* @__PURE__ */ e(Fi, { className: "w-5 h-5" })
|
|
2155
2165
|
}
|
|
2156
2166
|
),
|
|
2157
2167
|
Q && /* @__PURE__ */ e(
|
|
2158
2168
|
"div",
|
|
2159
2169
|
{
|
|
2160
2170
|
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 ${Q.type === "rewind" ? "left-0 rounded-r-[4rem]" : "right-0 rounded-l-[4rem]"}`,
|
|
2161
|
-
onAnimationEnd: () =>
|
|
2171
|
+
onAnimationEnd: () => ae(null),
|
|
2162
2172
|
children: /* @__PURE__ */ l("div", { className: "flex flex-col items-center text-white drop-shadow-lg", children: [
|
|
2163
|
-
Q.type === "rewind" ? /* @__PURE__ */ e(
|
|
2173
|
+
Q.type === "rewind" ? /* @__PURE__ */ e(bt, { className: "w-12 h-12 animate-pulse" }) : /* @__PURE__ */ e(vt, { className: "w-12 h-12 animate-pulse" }),
|
|
2164
2174
|
/* @__PURE__ */ e("span", { className: "font-bold text-sm mt-2 font-mono", children: Q.type === "rewind" ? "-10s" : "+10s" })
|
|
2165
2175
|
] })
|
|
2166
2176
|
},
|
|
@@ -2173,29 +2183,29 @@ const Te = (s) => {
|
|
|
2173
2183
|
/* @__PURE__ */ e("p", { className: "text-zinc-400 text-sm", children: o.error }),
|
|
2174
2184
|
/* @__PURE__ */ e("button", { onClick: () => n.load(n.store.get().sources[n.store.get().currentSourceIndex] || { url: t || "" }, v), 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" })
|
|
2175
2185
|
] }) }),
|
|
2176
|
-
|
|
2186
|
+
It && !o.isLocked && (!o.isPlaying && !o.isBuffering && !o.error || o.controlsVisible) && !o.isBuffering ? /* @__PURE__ */ e(
|
|
2177
2187
|
"div",
|
|
2178
2188
|
{
|
|
2179
2189
|
className: `absolute inset-0 flex items-center justify-center z-10 transition-opacity duration-300 pointer-events-none ${o.controlsVisible || !o.isPlaying ? "opacity-100" : "opacity-0"}`,
|
|
2180
2190
|
children: /* @__PURE__ */ l("div", { className: "flex items-center gap-8 md:gap-16 pointer-events-auto", children: [
|
|
2181
2191
|
/* @__PURE__ */ e("button", { onClick: (c) => {
|
|
2182
|
-
c.stopPropagation(),
|
|
2183
|
-
}, className: `group flex items-center justify-center rounded-full bg-black/40 hover:bg-black/60 border border-white/10 transition-all active:scale-
|
|
2192
|
+
c.stopPropagation(), V(!1), U(!1), le("rewind");
|
|
2193
|
+
}, className: `group flex items-center justify-center rounded-full bg-black/40 hover:bg-black/60 border border-white/10 transition-all duration-300 active:scale-125 active:opacity-80 text-white/90 focus:outline-none backdrop-blur-sm ${X.skipBtn}`, children: /* @__PURE__ */ e(bt, { className: X.skipIcon }) }),
|
|
2184
2194
|
/* @__PURE__ */ e("button", { onClick: (c) => {
|
|
2185
|
-
c.stopPropagation(),
|
|
2186
|
-
}, 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
|
|
2195
|
+
c.stopPropagation(), V(!1), U(!1), n.togglePlay();
|
|
2196
|
+
}, className: `group relative flex items-center justify-center rounded-full bg-white/10 hover:bg-[var(--accent)] border border-white/10 shadow-2xl transition-all duration-300 active:scale-90 active:opacity-80 focus:outline-none backdrop-blur-md ${X.playBtn}`, children: o.isPlaying ? /* @__PURE__ */ e(pt, { className: `${X.playIcon} text-white fill-current` }) : /* @__PURE__ */ e(ft, { className: `${X.playIcon} text-white ml-1 fill-current` }) }),
|
|
2187
2197
|
/* @__PURE__ */ e("button", { onClick: (c) => {
|
|
2188
|
-
c.stopPropagation(),
|
|
2189
|
-
}, className: `group flex items-center justify-center rounded-full bg-black/40 hover:bg-black/60 border border-white/10 transition-all active:scale-
|
|
2198
|
+
c.stopPropagation(), V(!1), U(!1), le("forward");
|
|
2199
|
+
}, className: `group flex items-center justify-center rounded-full bg-black/40 hover:bg-black/60 border border-white/10 transition-all duration-300 active:scale-125 active:opacity-80 text-white/90 focus:outline-none backdrop-blur-sm ${X.skipBtn}`, children: /* @__PURE__ */ e(vt, { className: X.skipIcon }) })
|
|
2190
2200
|
] })
|
|
2191
2201
|
}
|
|
2192
2202
|
) : null,
|
|
2193
2203
|
/* @__PURE__ */ l(
|
|
2194
2204
|
"div",
|
|
2195
2205
|
{
|
|
2196
|
-
className: `absolute inset-x-0 bottom-0 z-30 transition-all duration-300 px-4 md:px-6 py-4 bg-gradient-to-t from-black/90 via-black/50 to-transparent ${
|
|
2206
|
+
className: `absolute inset-x-0 bottom-0 z-30 transition-all duration-300 px-4 md:px-6 py-4 bg-gradient-to-t from-black/90 via-black/50 to-transparent ${Xt ? "opacity-100 translate-y-0" : "opacity-0 translate-y-4 pointer-events-none"}`,
|
|
2197
2207
|
onClick: (c) => {
|
|
2198
|
-
c.target === c.currentTarget && (
|
|
2208
|
+
c.target === c.currentTarget && (V(!1), U(!1), oe(!1)), c.stopPropagation();
|
|
2199
2209
|
},
|
|
2200
2210
|
children: [
|
|
2201
2211
|
!h.isLive && /* @__PURE__ */ l(
|
|
@@ -2203,28 +2213,28 @@ const Te = (s) => {
|
|
|
2203
2213
|
{
|
|
2204
2214
|
ref: we,
|
|
2205
2215
|
className: "relative w-full h-3 group/slider mb-3 cursor-pointer touch-none flex items-center",
|
|
2206
|
-
onMouseMove:
|
|
2216
|
+
onMouseMove: Wt,
|
|
2207
2217
|
onMouseLeave: () => {
|
|
2208
|
-
|
|
2218
|
+
_e(null), qe(null);
|
|
2209
2219
|
},
|
|
2210
|
-
onMouseDown:
|
|
2211
|
-
onTouchStart:
|
|
2220
|
+
onMouseDown: et,
|
|
2221
|
+
onTouchStart: et,
|
|
2212
2222
|
children: [
|
|
2213
|
-
(
|
|
2214
|
-
|
|
2223
|
+
(ut = h.highlight) == null ? void 0 : ut.map((c, f) => /* @__PURE__ */ e("div", { className: "absolute top-1/2 -translate-y-1/2 w-1.5 h-1.5 bg-yellow-400 rounded-full z-10 pointer-events-none", style: { left: `${c.time / o.duration * 100}%` }, title: c.text }, f)),
|
|
2224
|
+
Ge !== null && /* @__PURE__ */ l("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, ${Bt}%, calc(100% - 70px))` }, children: [
|
|
2215
2225
|
G && /* @__PURE__ */ e("div", { className: "bg-black/90 border border-white/10 shadow-2xl overflow-hidden backdrop-blur-sm", style: { width: `${G.w * 0.5}px`, height: `${G.h * 0.5}px`, borderRadius: "var(--radius)" }, children: /* @__PURE__ */ e("div", { style: { backgroundImage: `url("${G.url}")`, width: `${G.w}px`, height: `${G.h}px`, backgroundPosition: `-${G.x}px -${G.y}px`, backgroundRepeat: "no-repeat", transform: "scale(0.5)", transformOrigin: "top left" } }) }),
|
|
2216
|
-
/* @__PURE__ */ e("div", { className: "strata-tooltip px-2 py-0.5 text-[11px] font-bold font-mono shadow-lg tabular-nums mt-1", children: Te(
|
|
2226
|
+
/* @__PURE__ */ e("div", { className: "strata-tooltip px-2 py-0.5 text-[11px] font-bold font-mono shadow-lg tabular-nums mt-1", children: Te(Ge) })
|
|
2217
2227
|
] }),
|
|
2218
2228
|
/* @__PURE__ */ l("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: [
|
|
2219
|
-
o.duration > 0 && o.buffered.map((c,
|
|
2220
|
-
/* @__PURE__ */ e("div", { className: "absolute left-0 top-0 bottom-0 bg-[var(--accent)]", style: { width: `${(
|
|
2229
|
+
o.duration > 0 && o.buffered.map((c, f) => /* @__PURE__ */ e("div", { className: "absolute top-0 bottom-0 bg-white/20", style: { left: `${c.start / o.duration * 100}%`, width: `${(c.end - c.start) / o.duration * 100}%` } }, f)),
|
|
2230
|
+
/* @__PURE__ */ e("div", { className: "absolute left-0 top-0 bottom-0 bg-[var(--accent)]", style: { width: `${(pe ? re : o.currentTime) / o.duration * 100}%` } })
|
|
2221
2231
|
] }),
|
|
2222
2232
|
/* @__PURE__ */ e(
|
|
2223
2233
|
"div",
|
|
2224
2234
|
{
|
|
2225
2235
|
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",
|
|
2226
2236
|
style: {
|
|
2227
|
-
left: `${(
|
|
2237
|
+
left: `${(pe ? re : o.currentTime) / o.duration * 100}%`,
|
|
2228
2238
|
borderRadius: "var(--radius-full)"
|
|
2229
2239
|
}
|
|
2230
2240
|
}
|
|
@@ -2233,8 +2243,8 @@ const Te = (s) => {
|
|
|
2233
2243
|
}
|
|
2234
2244
|
),
|
|
2235
2245
|
/* @__PURE__ */ l("div", { className: "flex items-center justify-between pointer-events-auto", children: [
|
|
2236
|
-
/* @__PURE__ */ e("div", { className: "flex items-center gap-3", children:
|
|
2237
|
-
/* @__PURE__ */ e("div", { className: "flex items-center gap-1", children:
|
|
2246
|
+
/* @__PURE__ */ e("div", { className: "flex items-center gap-3", children: ot.filter((c) => c.position === "left" || c.position === "center").map(at) }),
|
|
2247
|
+
/* @__PURE__ */ e("div", { className: "flex items-center gap-1", children: ot.filter((c) => c.position === "right").map(at) })
|
|
2238
2248
|
] })
|
|
2239
2249
|
]
|
|
2240
2250
|
}
|
|
@@ -2243,20 +2253,21 @@ const Te = (s) => {
|
|
|
2243
2253
|
]
|
|
2244
2254
|
}
|
|
2245
2255
|
);
|
|
2246
|
-
|
|
2247
|
-
|
|
2248
|
-
|
|
2256
|
+
return lt && typeof document < "u" ? ii(ct, document.body) : ct;
|
|
2257
|
+
}, is = (s, t) => {
|
|
2258
|
+
const i = ti(s);
|
|
2259
|
+
return i.render(ze.createElement(yt, t)), {
|
|
2249
2260
|
unmount: () => {
|
|
2250
2261
|
i.unmount();
|
|
2251
2262
|
},
|
|
2252
2263
|
update: (r) => {
|
|
2253
|
-
i.render(ze.createElement(
|
|
2264
|
+
i.render(ze.createElement(yt, { ...t, ...r }));
|
|
2254
2265
|
}
|
|
2255
2266
|
};
|
|
2256
2267
|
};
|
|
2257
2268
|
export {
|
|
2258
|
-
|
|
2259
|
-
|
|
2260
|
-
|
|
2269
|
+
oi as StrataCore,
|
|
2270
|
+
yt as StrataPlayer,
|
|
2271
|
+
is as mountStrataPlayer
|
|
2261
2272
|
};
|
|
2262
2273
|
//# sourceMappingURL=strataplayer.es.js.map
|