@therealtinhtute/baroiplayer 1.0.1 → 1.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (73) hide show
  1. package/dist/context/media.js +2 -0
  2. package/dist/context/media.js.map +1 -0
  3. package/dist/context/media.mjs +15 -0
  4. package/dist/context/media.mjs.map +1 -0
  5. package/dist/context/store.js +2 -0
  6. package/dist/context/store.js.map +1 -0
  7. package/dist/context/store.mjs +5 -0
  8. package/dist/context/store.mjs.map +1 -0
  9. package/dist/context-Af84FynT.js +1179 -0
  10. package/dist/context-Af84FynT.js.map +1 -0
  11. package/dist/context-CwZnPdz0.cjs +23 -0
  12. package/dist/context-CwZnPdz0.cjs.map +1 -0
  13. package/dist/core-events-B5W_j8yU.js +480 -0
  14. package/dist/core-events-B5W_j8yU.js.map +1 -0
  15. package/dist/core-events-CN0-Vhhq.cjs +2 -0
  16. package/dist/core-events-CN0-Vhhq.cjs.map +1 -0
  17. package/dist/core-plugins-Bq9KLany.js +696 -0
  18. package/dist/core-plugins-Bq9KLany.js.map +1 -0
  19. package/dist/core-plugins-CPDSHMiQ.cjs +2 -0
  20. package/dist/core-plugins-CPDSHMiQ.cjs.map +1 -0
  21. package/dist/core.js +37 -0
  22. package/dist/core.js.map +1 -0
  23. package/dist/core.mjs +1217 -0
  24. package/dist/core.mjs.map +1 -0
  25. package/dist/enhanced-components-CXnYiOt6.cjs +2 -0
  26. package/dist/enhanced-components-CXnYiOt6.cjs.map +1 -0
  27. package/dist/enhanced-components-Da0TSvKe.js +1073 -0
  28. package/dist/enhanced-components-Da0TSvKe.js.map +1 -0
  29. package/dist/hooks-BhW_i-9L.js +2013 -0
  30. package/dist/hooks-BhW_i-9L.js.map +1 -0
  31. package/dist/hooks-DTXeB5Z-.cjs +4 -0
  32. package/dist/hooks-DTXeB5Z-.cjs.map +1 -0
  33. package/dist/index.d.ts +1 -1
  34. package/dist/index.js.map +1 -0
  35. package/dist/index.mjs.map +1 -0
  36. package/dist/minimal-components-B0bILe18.js +2002 -0
  37. package/dist/minimal-components-B0bILe18.js.map +1 -0
  38. package/dist/minimal-components-BsqodtY8.cjs +2 -0
  39. package/dist/minimal-components-BsqodtY8.cjs.map +1 -0
  40. package/dist/minimal-components.css +589 -0
  41. package/dist/mona-loading.gif +0 -0
  42. package/dist/performance-monitor--rzKTlbj.js +302 -0
  43. package/dist/performance-monitor--rzKTlbj.js.map +1 -0
  44. package/dist/performance-monitor-cjIvZE2D.cjs +2 -0
  45. package/dist/performance-monitor-cjIvZE2D.cjs.map +1 -0
  46. package/dist/src/components/AnimateLoading.tsx +1 -1
  47. package/dist/src/components/enhanced/debug-panel.tsx +1 -1
  48. package/dist/src/components/media-player.tsx +2 -2
  49. package/dist/src/components/ui/media-resource-preloader.tsx +9 -11
  50. package/dist/src/components/ui/seek-bar.tsx +1 -1
  51. package/dist/src/core/plugins/enhanced-plugin-system.ts +14 -8
  52. package/dist/src/core/providers/enhanced-hls-provider.ts +22 -53
  53. package/dist/src/hooks/use-enhanced-media-player.ts +19 -2
  54. package/dist/src/types/index.ts +40 -5
  55. package/dist/styles/minimal-player.css +589 -0
  56. package/dist/utils-Db13763z.cjs +9 -0
  57. package/dist/utils-Db13763z.cjs.map +1 -0
  58. package/dist/utils-nTO4AnHo.js +2809 -0
  59. package/dist/utils-nTO4AnHo.js.map +1 -0
  60. package/dist/utils.js +2 -0
  61. package/dist/utils.js.map +1 -0
  62. package/dist/utils.mjs +7 -0
  63. package/dist/utils.mjs.map +1 -0
  64. package/package.json +1 -1
  65. package/src/components/AnimateLoading.tsx +1 -1
  66. package/src/components/enhanced/debug-panel.tsx +1 -1
  67. package/src/components/media-player.tsx +2 -2
  68. package/src/components/ui/media-resource-preloader.tsx +9 -11
  69. package/src/components/ui/seek-bar.tsx +1 -1
  70. package/src/core/plugins/enhanced-plugin-system.ts +14 -8
  71. package/src/core/providers/enhanced-hls-provider.ts +22 -53
  72. package/src/hooks/use-enhanced-media-player.ts +19 -2
  73. package/src/types/index.ts +40 -5
@@ -0,0 +1,1073 @@
1
+ import { u as U, a as L, b, j as e, M as f } from "./context-Af84FynT.js";
2
+ import r, { useMemo as $ } from "react";
3
+ import { c as p, f as D, a as _ } from "./utils-nTO4AnHo.js";
4
+ function X(d, l, s, n) {
5
+ const [t, o] = r.useState(!0), [a, i] = r.useState(!1), [c, m] = r.useState(!1), u = r.useRef(null), w = r.useCallback(() => {
6
+ u.current && clearTimeout(u.current), d && (u.current = setTimeout(() => {
7
+ !a && !c && o(!1);
8
+ }, l));
9
+ }, [d, l, a, c]), C = r.useCallback(() => {
10
+ o(!0), w();
11
+ }, [w]);
12
+ r.useEffect(() => (d ? w() : o(!0), () => {
13
+ u.current && clearTimeout(u.current);
14
+ }), [d, w]);
15
+ const g = r.useCallback(() => {
16
+ s && (i(!0), o(!0));
17
+ }, [s]), y = r.useCallback(() => {
18
+ s && (i(!1), w());
19
+ }, [s, w]), h = r.useCallback(() => {
20
+ n && (m(!0), C());
21
+ }, [n, C]), N = r.useCallback(() => {
22
+ n && (m(!1), w());
23
+ }, [n, w]);
24
+ return {
25
+ showControls: t,
26
+ showControlsTemporarily: C,
27
+ handleMouseEnter: g,
28
+ handleMouseLeave: y,
29
+ handleTouchStart: h,
30
+ handleTouchEnd: N
31
+ };
32
+ }
33
+ function G(d) {
34
+ const l = L(), s = b((g) => g.isPlaying), n = b((g) => g.currentTime), t = b((g) => g.duration), o = b((g) => g.volume), [a, i] = r.useState(null), [c, m] = r.useState(!1), u = r.useCallback((g) => {
35
+ if (!d) return;
36
+ const y = g.touches[0];
37
+ if (!y) return;
38
+ const h = Date.now();
39
+ a && h - a.time < 300 ? (m(!0), l({
40
+ type: s ? f.PAUSE : f.PLAY
41
+ })) : (i({
42
+ x: y.clientX,
43
+ y: y.clientY,
44
+ time: h
45
+ }), m(!1));
46
+ }, [d, a, s, l]), w = r.useCallback((g) => {
47
+ if (!d || !a || c) return;
48
+ const y = g.touches[0];
49
+ if (!y) return;
50
+ const h = y.clientX - a.x, N = y.clientY - a.y;
51
+ if (Math.abs(h) > Math.abs(N) && Math.abs(h) > 50) {
52
+ const E = h / window.innerWidth * 30, T = Math.max(0, Math.min(t, n + E));
53
+ l({
54
+ type: f.SEEK,
55
+ detail: T
56
+ });
57
+ }
58
+ if (Math.abs(N) > Math.abs(h) && Math.abs(N) > 50 && a.x > window.innerWidth / 2) {
59
+ const E = -(N / window.innerHeight) * 1, T = Math.max(0, Math.min(1, o + E));
60
+ l({
61
+ type: f.SET_VOLUME,
62
+ detail: T
63
+ });
64
+ }
65
+ }, [d, a, c, t, n, o, l]), C = r.useCallback(() => {
66
+ d && setTimeout(() => {
67
+ i(null), m(!1);
68
+ }, 300);
69
+ }, [d]);
70
+ return {
71
+ handleTouchStart: u,
72
+ handleTouchMove: w,
73
+ handleTouchEnd: C
74
+ };
75
+ }
76
+ const Y = function({
77
+ children: l,
78
+ className: s,
79
+ autoHide: n = !0,
80
+ autoHideDelay: t = 3e3,
81
+ showControlsOnHover: o = !0,
82
+ showControlsOnTouch: a = !0,
83
+ enableKeyboardControls: i = !0,
84
+ enableTouchGestures: c = !0,
85
+ onPlay: m,
86
+ onPause: u,
87
+ onTimeUpdate: w,
88
+ onVolumeChange: C,
89
+ onFullscreenChange: g
90
+ }) {
91
+ const y = U(), h = L(), N = b(r.useCallback((k) => k.isPlaying, [])), E = b(r.useCallback((k) => k.isFullscreen, [])), T = b(r.useCallback((k) => k.currentTime, [])), S = b(r.useCallback((k) => k.volume, [])), x = b(r.useCallback((k) => k.error, [])), {
92
+ showControls: v,
93
+ showControlsTemporarily: B,
94
+ handleMouseEnter: z,
95
+ handleMouseLeave: A,
96
+ handleTouchStart: j,
97
+ handleTouchEnd: M
98
+ } = X(n, t, o, a), {
99
+ handleTouchStart: F,
100
+ handleTouchMove: V,
101
+ handleTouchEnd: R
102
+ } = G(c), H = r.useCallback((k) => {
103
+ j(), F(k);
104
+ }, [j, F]), O = r.useCallback(() => {
105
+ M(), R();
106
+ }, [M, R]), K = r.useCallback(() => {
107
+ B();
108
+ }, [B]);
109
+ return r.useEffect(() => {
110
+ if (!i) return;
111
+ const k = (P) => {
112
+ if (!(P.target instanceof HTMLInputElement || P.target instanceof HTMLTextAreaElement))
113
+ switch (P.code) {
114
+ case "Space":
115
+ case "KeyK":
116
+ P.preventDefault(), h({
117
+ type: N ? f.PAUSE : f.PLAY
118
+ });
119
+ break;
120
+ case "KeyF":
121
+ P.preventDefault(), h({
122
+ type: E ? f.EXIT_FULLSCREEN : f.ENTER_FULLSCREEN
123
+ });
124
+ break;
125
+ case "KeyM":
126
+ P.preventDefault(), h({ type: f.TOGGLE_MUTE });
127
+ break;
128
+ case "ArrowLeft":
129
+ P.preventDefault(), h({
130
+ type: f.SEEK,
131
+ detail: Math.max(0, T - 10)
132
+ });
133
+ break;
134
+ case "ArrowRight":
135
+ P.preventDefault(), h({
136
+ type: f.SEEK,
137
+ detail: T + 10
138
+ });
139
+ break;
140
+ case "ArrowUp":
141
+ P.preventDefault(), h({
142
+ type: f.SET_VOLUME,
143
+ detail: Math.min(1, S + 0.1)
144
+ });
145
+ break;
146
+ case "ArrowDown":
147
+ P.preventDefault(), h({
148
+ type: f.SET_VOLUME,
149
+ detail: Math.max(0, S - 0.1)
150
+ });
151
+ break;
152
+ }
153
+ };
154
+ return document.addEventListener("keydown", k), () => document.removeEventListener("keydown", k);
155
+ }, [i, h, N, E, T, S]), r.useEffect(() => {
156
+ N ? m?.() : u?.();
157
+ }, [N, m, u]), r.useEffect(() => {
158
+ w?.(T);
159
+ }, [T, w]), r.useEffect(() => {
160
+ C?.(S);
161
+ }, [S, C]), r.useEffect(() => {
162
+ g?.(E);
163
+ }, [E, g]), /* @__PURE__ */ e.jsx(
164
+ "div",
165
+ {
166
+ ref: y.rootRef,
167
+ className: p(
168
+ "relative isolate flex flex-col overflow-hidden rounded-lg bg-black outline-none",
169
+ "focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",
170
+ "data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
171
+ E && "fixed inset-0 z-50 rounded-none",
172
+ s
173
+ ),
174
+ "data-state": E ? "fullscreen" : "inline",
175
+ "data-disabled": x ? "" : void 0,
176
+ "data-controls-visible": v ? "" : void 0,
177
+ tabIndex: 0,
178
+ onMouseEnter: z,
179
+ onMouseLeave: A,
180
+ onTouchStart: H,
181
+ onTouchMove: V,
182
+ onTouchEnd: O,
183
+ onClick: K,
184
+ children: l
185
+ }
186
+ );
187
+ };
188
+ Y.displayName = "EnhancedMediaPlayer";
189
+ const W = function({
190
+ qualities: l,
191
+ currentQuality: s,
192
+ onQualityChange: n,
193
+ className: t
194
+ }) {
195
+ const [o, a] = r.useState(!1), i = r.useMemo(() => l.find((c) => c.id === s)?.label || "Auto", [l, s]);
196
+ return /* @__PURE__ */ e.jsxs("div", { className: p("relative", t), children: [
197
+ /* @__PURE__ */ e.jsxs(
198
+ "button",
199
+ {
200
+ type: "button",
201
+ onClick: () => a(!o),
202
+ className: "flex items-center gap-2 rounded-lg bg-black/50 px-3 py-2 text-white transition-colors hover:bg-black/70",
203
+ "aria-label": "Select quality",
204
+ children: [
205
+ /* @__PURE__ */ e.jsx("svg", { viewBox: "0 0 24 24", fill: "currentColor", className: "h-4 w-4", children: /* @__PURE__ */ e.jsx("path", { d: "M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-2 15l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z" }) }),
206
+ /* @__PURE__ */ e.jsx("span", { className: "text-sm", children: i }),
207
+ /* @__PURE__ */ e.jsx(
208
+ "svg",
209
+ {
210
+ viewBox: "0 0 24 24",
211
+ fill: "currentColor",
212
+ className: p("h-4 w-4 transition-transform", o && "rotate-180"),
213
+ children: /* @__PURE__ */ e.jsx("path", { d: "M7 10l5 5 5-5z" })
214
+ }
215
+ )
216
+ ]
217
+ }
218
+ ),
219
+ o && /* @__PURE__ */ e.jsx("div", { className: "absolute right-0 bottom-full mb-2 min-w-32 rounded-lg border border-white/20 bg-black/90 py-2 backdrop-blur-sm", children: l.map((c) => /* @__PURE__ */ e.jsxs(
220
+ "button",
221
+ {
222
+ onClick: () => {
223
+ n(c.id), a(!1);
224
+ },
225
+ className: p(
226
+ "w-full px-4 py-2 text-left text-sm text-white transition-colors hover:bg-white/10",
227
+ c.id === s && "bg-primary/20 text-primary"
228
+ ),
229
+ children: [
230
+ c.label,
231
+ c.bitrate && /* @__PURE__ */ e.jsxs("span", { className: "ml-2 text-white/60 text-xs", children: [
232
+ "(",
233
+ Math.round(c.bitrate / 1e3),
234
+ "k)"
235
+ ] })
236
+ ]
237
+ },
238
+ c.id
239
+ )) })
240
+ ] });
241
+ }, Q = function({
242
+ subtitles: l,
243
+ currentSubtitle: s,
244
+ onSubtitleChange: n,
245
+ className: t
246
+ }) {
247
+ const [o, a] = r.useState(!1), i = r.useMemo(() => s && l.find((c) => c.id === s)?.label || "Off", [l, s]);
248
+ return /* @__PURE__ */ e.jsxs("div", { className: p("relative", t), children: [
249
+ /* @__PURE__ */ e.jsxs(
250
+ "button",
251
+ {
252
+ type: "button",
253
+ onClick: () => a(!o),
254
+ className: "flex items-center gap-2 rounded-lg bg-black/50 px-3 py-2 text-white transition-colors hover:bg-black/70",
255
+ "aria-label": "Select subtitles",
256
+ children: [
257
+ /* @__PURE__ */ e.jsx("svg", { viewBox: "0 0 24 24", fill: "currentColor", className: "h-4 w-4", children: /* @__PURE__ */ e.jsx("path", { d: "M20 4H4c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zM4 12h4v2H4v-2zm10 6H4v-2h10v2zm6 0h-4v-2h4v2zm0-4H10v-2h10v2z" }) }),
258
+ /* @__PURE__ */ e.jsx("span", { className: "text-sm", children: i }),
259
+ /* @__PURE__ */ e.jsx(
260
+ "svg",
261
+ {
262
+ viewBox: "0 0 24 24",
263
+ fill: "currentColor",
264
+ className: p("h-4 w-4 transition-transform", o && "rotate-180"),
265
+ children: /* @__PURE__ */ e.jsx("path", { d: "M7 10l5 5 5-5z" })
266
+ }
267
+ )
268
+ ]
269
+ }
270
+ ),
271
+ o && /* @__PURE__ */ e.jsxs("div", { className: "absolute right-0 bottom-full mb-2 min-w-32 rounded-lg border border-white/20 bg-black/90 py-2 backdrop-blur-sm", children: [
272
+ /* @__PURE__ */ e.jsx(
273
+ "button",
274
+ {
275
+ onClick: () => {
276
+ n(null), a(!1);
277
+ },
278
+ className: p(
279
+ "w-full px-4 py-2 text-left text-sm text-white transition-colors hover:bg-white/10",
280
+ !s && "bg-primary/20 text-primary"
281
+ ),
282
+ children: "Off"
283
+ }
284
+ ),
285
+ l.map((c) => /* @__PURE__ */ e.jsx(
286
+ "button",
287
+ {
288
+ onClick: () => {
289
+ n(c.id), a(!1);
290
+ },
291
+ className: p(
292
+ "w-full px-4 py-2 text-left text-sm text-white transition-colors hover:bg-white/10",
293
+ c.id === s && "bg-primary/20 text-primary"
294
+ ),
295
+ children: c.label
296
+ },
297
+ c.id
298
+ ))
299
+ ] })
300
+ ] });
301
+ }, J = function({
302
+ className: l
303
+ }) {
304
+ const s = L(), n = b((c) => c.playbackRate), [t, o] = r.useState(!1), a = [0.25, 0.5, 0.75, 1, 1.25, 1.5, 1.75, 2], i = r.useCallback((c) => {
305
+ s({ type: f.SET_PLAYBACK_RATE, detail: c }), o(!1);
306
+ }, [s]);
307
+ return /* @__PURE__ */ e.jsxs("div", { className: p("relative", l), children: [
308
+ /* @__PURE__ */ e.jsxs(
309
+ "button",
310
+ {
311
+ type: "button",
312
+ onClick: () => o(!t),
313
+ className: "flex items-center gap-2 rounded-lg bg-black/50 px-3 py-2 text-white transition-colors hover:bg-black/70",
314
+ "aria-label": "Select playback speed",
315
+ children: [
316
+ /* @__PURE__ */ e.jsx("svg", { viewBox: "0 0 24 24", fill: "currentColor", className: "h-4 w-4", children: /* @__PURE__ */ e.jsx("path", { d: "M13,8A4,4 0 0,0 9,12A4,4 0 0,0 13,16A4,4 0 0,0 17,12A4,4 0 0,0 13,8M13,14A2,2 0 0,1 11,12A2,2 0 0,1 13,10A2,2 0 0,1 15,12A2,2 0 0,1 13,14M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2M12,4A8,8 0 0,1 20,12A8,8 0 0,1 12,20A8,8 0 0,1 4,12A8,8 0 0,1 12,4Z" }) }),
317
+ /* @__PURE__ */ e.jsxs("span", { className: "text-sm", children: [
318
+ n,
319
+ "x"
320
+ ] }),
321
+ /* @__PURE__ */ e.jsx(
322
+ "svg",
323
+ {
324
+ viewBox: "0 0 24 24",
325
+ fill: "currentColor",
326
+ className: p("h-4 w-4 transition-transform", t && "rotate-180"),
327
+ children: /* @__PURE__ */ e.jsx("path", { d: "M7 10l5 5 5-5z" })
328
+ }
329
+ )
330
+ ]
331
+ }
332
+ ),
333
+ t && /* @__PURE__ */ e.jsx("div", { className: "absolute right-0 bottom-full mb-2 min-w-20 rounded-lg border border-white/20 bg-black/90 py-2 backdrop-blur-sm", children: a.map((c) => /* @__PURE__ */ e.jsxs(
334
+ "button",
335
+ {
336
+ onClick: () => i(c),
337
+ className: p(
338
+ "w-full px-4 py-2 text-left text-sm text-white transition-colors hover:bg-white/10",
339
+ c === n && "bg-primary/20 text-primary"
340
+ ),
341
+ children: [
342
+ c,
343
+ "x"
344
+ ]
345
+ },
346
+ c
347
+ )) })
348
+ ] });
349
+ }, Z = function({
350
+ chapters: l,
351
+ onChapterSelect: s,
352
+ className: n
353
+ }) {
354
+ const t = b((a) => a.currentTime), o = r.useMemo(() => l.find(
355
+ (a) => t >= a.startTime && t < a.endTime
356
+ ), [l, t]);
357
+ return /* @__PURE__ */ e.jsxs("div", { className: p("rounded-lg border border-white/20 bg-black/90 p-4 backdrop-blur-sm", n), children: [
358
+ /* @__PURE__ */ e.jsx("h3", { className: "mb-3 font-semibold text-white", children: "Chapters" }),
359
+ /* @__PURE__ */ e.jsx("div", { className: "max-h-64 space-y-2 overflow-y-auto", children: l.map((a) => /* @__PURE__ */ e.jsxs(
360
+ "button",
361
+ {
362
+ onClick: () => s(a),
363
+ className: p(
364
+ "flex w-full items-center gap-3 rounded-lg p-3 text-left transition-colors",
365
+ "hover:bg-white/10",
366
+ a.id === o?.id && "border border-primary/30 bg-primary/20"
367
+ ),
368
+ children: [
369
+ a.thumbnail && /* @__PURE__ */ e.jsx(
370
+ "img",
371
+ {
372
+ src: a.thumbnail,
373
+ alt: a.title,
374
+ className: "h-9 w-16 rounded object-cover"
375
+ }
376
+ ),
377
+ /* @__PURE__ */ e.jsxs("div", { className: "min-w-0 flex-1", children: [
378
+ /* @__PURE__ */ e.jsx("div", { className: "truncate font-medium text-white", children: a.title }),
379
+ /* @__PURE__ */ e.jsxs("div", { className: "text-sm text-white/60", children: [
380
+ D(a.startTime),
381
+ " - ",
382
+ D(a.endTime)
383
+ ] })
384
+ ] })
385
+ ]
386
+ },
387
+ a.id
388
+ )) })
389
+ ] });
390
+ }, q = function({
391
+ className: l
392
+ }) {
393
+ const s = L(), n = b((o) => o.isPictureInPicture), t = r.useCallback(() => {
394
+ s({
395
+ type: n ? f.EXIT_PIP : f.ENTER_PIP
396
+ });
397
+ }, [s, n]);
398
+ return /* @__PURE__ */ e.jsx(
399
+ "button",
400
+ {
401
+ type: "button",
402
+ onClick: t,
403
+ className: p(
404
+ "flex h-10 w-10 items-center justify-center rounded-full text-white",
405
+ "transition-colors hover:bg-white/10",
406
+ l
407
+ ),
408
+ "aria-label": n ? "Exit Picture-in-Picture" : "Enter Picture-in-Picture",
409
+ children: /* @__PURE__ */ e.jsx("svg", { viewBox: "0 0 24 24", fill: "currentColor", className: "h-5 w-5", children: /* @__PURE__ */ e.jsx("path", { d: "M19 7h-8v6h8V7zm2-4H3c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h18c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm0 16H3V5h18v14z" }) })
410
+ }
411
+ );
412
+ }, ie = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
413
+ __proto__: null,
414
+ ChaptersPanel: Z,
415
+ PictureInPictureButton: q,
416
+ PlaybackSpeedSelector: J,
417
+ QualitySelector: W,
418
+ SubtitleSelector: Q
419
+ }, Symbol.toStringTag, { value: "Module" })), ee = function({
420
+ className: l,
421
+ size: s = "md"
422
+ }) {
423
+ const n = L(), t = b((m) => m.isPlaying), o = b((m) => m.isLoading), a = {
424
+ sm: "h-8 w-8",
425
+ md: "h-10 w-10",
426
+ lg: "h-12 w-12",
427
+ xl: "h-16 w-16"
428
+ }, i = {
429
+ sm: "h-4 w-4",
430
+ md: "h-5 w-5",
431
+ lg: "h-6 w-6",
432
+ xl: "h-8 w-8"
433
+ }, c = r.useCallback(() => {
434
+ n({
435
+ type: t ? f.PAUSE : f.PLAY
436
+ });
437
+ }, [n, t]);
438
+ return /* @__PURE__ */ e.jsx(
439
+ "button",
440
+ {
441
+ type: "button",
442
+ onClick: c,
443
+ disabled: o,
444
+ className: p(
445
+ "group relative flex items-center justify-center rounded-full bg-white/10 backdrop-blur-sm",
446
+ "border border-white/20 text-white transition-all duration-200",
447
+ "hover:scale-105 hover:bg-white/20 active:scale-95",
448
+ "focus:outline-none focus:ring-2 focus:ring-white/50",
449
+ "disabled:cursor-not-allowed disabled:opacity-50",
450
+ a[s],
451
+ l
452
+ ),
453
+ "aria-label": t ? "Pause" : "Play",
454
+ children: o ? /* @__PURE__ */ e.jsx("div", { className: p("animate-spin rounded-full border-2 border-white/30 border-t-white", i[s]) }) : /* @__PURE__ */ e.jsx("div", { className: p("transition-transform duration-200", i[s]), children: t ? /* @__PURE__ */ e.jsx("svg", { viewBox: "0 0 24 24", fill: "currentColor", className: "h-full w-full", children: /* @__PURE__ */ e.jsx("path", { d: "M6 4h4v16H6V4zm8 0h4v16h-4V4z" }) }) : /* @__PURE__ */ e.jsx("svg", { viewBox: "0 0 24 24", fill: "currentColor", className: "ml-0.5 h-full w-full", children: /* @__PURE__ */ e.jsx("path", { d: "M8 5v14l11-7z" }) }) })
455
+ }
456
+ );
457
+ }, se = function({
458
+ className: l
459
+ }) {
460
+ const s = L(), n = b((x) => x.currentTime), t = b((x) => x.duration), o = b((x) => x.buffered), a = b((x) => x.previewTime), [i, c] = r.useState(!1), [m, u] = r.useState(null), w = r.useRef(null), C = t > 0 ? n / t * 100 : 0, g = t > 0 && a !== null ? a / t * 100 : null, y = r.useMemo(() => {
461
+ if (!o || t === 0) return [];
462
+ const x = [];
463
+ for (let v = 0; v < o.length; v++)
464
+ x.push({
465
+ start: o.start(v) / t * 100,
466
+ end: o.end(v) / t * 100
467
+ });
468
+ return x;
469
+ }, [o, t]), h = r.useCallback((x) => {
470
+ if (!w.current) return 0;
471
+ const v = w.current.getBoundingClientRect();
472
+ return Math.max(0, Math.min(1, (x - v.left) / v.width)) * t;
473
+ }, [t]), N = r.useCallback((x) => {
474
+ if (!i) {
475
+ const v = h(x.clientX);
476
+ u(v), s({ type: f.PREVIEW_TIME, detail: v });
477
+ }
478
+ }, [i, h, s]), E = r.useCallback(() => {
479
+ i || (u(null), s({ type: f.CLEAR_PREVIEW }));
480
+ }, [i, s]), T = r.useCallback((x) => {
481
+ c(!0);
482
+ const v = h(x.clientX);
483
+ s({ type: f.SEEK, detail: v });
484
+ }, [h, s]), S = r.useCallback((x) => {
485
+ c(!0);
486
+ const v = h(x.touches[0]?.clientX || 0);
487
+ s({ type: f.SEEK, detail: v });
488
+ }, [h, s]);
489
+ return r.useEffect(() => {
490
+ const x = (z) => {
491
+ if (i) {
492
+ const A = h(z.clientX);
493
+ s({ type: f.SEEK, detail: A });
494
+ }
495
+ }, v = () => {
496
+ c(!1), u(null), s({ type: f.CLEAR_PREVIEW });
497
+ }, B = (z) => {
498
+ if (i) {
499
+ const A = h(z.touches[0]?.clientX || 0);
500
+ s({ type: f.SEEK, detail: A });
501
+ }
502
+ };
503
+ return i && (document.addEventListener("mousemove", x), document.addEventListener("mouseup", v), document.addEventListener("touchmove", B), document.addEventListener("touchend", v)), () => {
504
+ document.removeEventListener("mousemove", x), document.removeEventListener("mouseup", v), document.removeEventListener("touchmove", B), document.removeEventListener("touchend", v);
505
+ };
506
+ }, [i, h, s]), /* @__PURE__ */ e.jsxs("div", { className: p("group relative flex items-center", l), children: [
507
+ (m !== null || a !== null) && /* @__PURE__ */ e.jsx(
508
+ "div",
509
+ {
510
+ className: "pointer-events-none absolute bottom-full mb-2 rounded bg-black/80 px-2 py-1 text-white text-xs",
511
+ style: {
512
+ left: `${g || (m || 0) / t * 100}%`,
513
+ transform: "translateX(-50%)"
514
+ },
515
+ children: D(m || a || 0)
516
+ }
517
+ ),
518
+ /* @__PURE__ */ e.jsxs(
519
+ "div",
520
+ {
521
+ ref: w,
522
+ className: "relative h-2 w-full cursor-pointer rounded-full bg-white/20 transition-all duration-200 group-hover:h-3",
523
+ onMouseMove: N,
524
+ onMouseLeave: E,
525
+ onMouseDown: T,
526
+ onTouchStart: S,
527
+ children: [
528
+ y.map((x, v) => /* @__PURE__ */ e.jsx(
529
+ "div",
530
+ {
531
+ className: "absolute top-0 h-full rounded-full bg-white/30",
532
+ style: {
533
+ left: `${x.start}%`,
534
+ width: `${x.end - x.start}%`
535
+ }
536
+ },
537
+ v
538
+ )),
539
+ /* @__PURE__ */ e.jsx(
540
+ "div",
541
+ {
542
+ className: "absolute top-0 h-full rounded-full bg-primary transition-all duration-100",
543
+ style: { width: `${C}%` }
544
+ }
545
+ ),
546
+ g !== null && /* @__PURE__ */ e.jsx(
547
+ "div",
548
+ {
549
+ className: "absolute top-0 h-full w-1 rounded-full bg-white/80",
550
+ style: { left: `${g}%` }
551
+ }
552
+ ),
553
+ /* @__PURE__ */ e.jsx(
554
+ "div",
555
+ {
556
+ className: "-translate-y-1/2 absolute top-1/2 h-4 w-4 rounded-full border-2 border-white bg-primary opacity-0 shadow-lg transition-all duration-200 group-hover:opacity-100",
557
+ style: { left: `${C}%`, transform: "translateX(-50%) translateY(-50%)" }
558
+ }
559
+ )
560
+ ]
561
+ }
562
+ )
563
+ ] });
564
+ }, te = function({
565
+ className: l
566
+ }) {
567
+ const s = L(), n = b((u) => u.volume), t = b((u) => u.isMuted), [o, a] = r.useState(!1), i = r.useCallback(() => {
568
+ s({ type: f.TOGGLE_MUTE });
569
+ }, [s]), c = r.useCallback((u) => {
570
+ s({ type: f.SET_VOLUME, detail: u });
571
+ }, [s]), m = r.useMemo(() => t || n === 0 ? /* @__PURE__ */ e.jsx("svg", { viewBox: "0 0 24 24", fill: "currentColor", className: "h-5 w-5", children: /* @__PURE__ */ e.jsx("path", { d: "M16.5 12c0-1.77-1.02-3.29-2.5-4.03v2.21l2.45 2.45c.03-.2.05-.41.05-.63zm2.5 0c0 .94-.2 1.82-.54 2.64l1.51 1.51C20.63 14.91 21 13.5 21 12c0-4.28-2.99-7.86-7-8.77v2.06c2.89.86 5 3.54 5 6.71zM4.27 3L3 4.27 7.73 9H3v6h4l5 5v-6.73l4.25 4.25c-.67.52-1.42.93-2.25 1.18v2.06c1.38-.31 2.63-.95 3.69-1.81L19.73 21 21 19.73l-9-9L4.27 3zM12 4L9.91 6.09 12 8.18V4z" }) }) : n < 0.5 ? /* @__PURE__ */ e.jsx("svg", { viewBox: "0 0 24 24", fill: "currentColor", className: "h-5 w-5", children: /* @__PURE__ */ e.jsx("path", { d: "M18.5 12c0-1.77-1.02-3.29-2.5-4.03v8.05c1.48-.73 2.5-2.25 2.5-4.02zM5 9v6h4l5 5V4L9 9H5z" }) }) : /* @__PURE__ */ e.jsx("svg", { viewBox: "0 0 24 24", fill: "currentColor", className: "h-5 w-5", children: /* @__PURE__ */ e.jsx("path", { d: "M3 9v6h4l5 5V4L7 9H3zm13.5 3c0-1.77-1.02-3.29-2.5-4.03v8.05c1.48-.73 2.5-2.25 2.5-4.02zM14 3.23v2.06c2.89.86 5 3.54 5 6.71s-2.11 5.85-5 6.71v2.06c4.01-.91 7-4.49 7-8.77s-2.99-7.86-7-8.77z" }) }), [t, n]);
572
+ return /* @__PURE__ */ e.jsxs(
573
+ "div",
574
+ {
575
+ className: p("relative flex items-center", l),
576
+ onMouseEnter: () => a(!0),
577
+ onMouseLeave: () => a(!1),
578
+ children: [
579
+ /* @__PURE__ */ e.jsx(
580
+ "button",
581
+ {
582
+ type: "button",
583
+ onClick: i,
584
+ className: "flex h-10 w-10 items-center justify-center rounded-full text-white transition-colors hover:bg-white/10",
585
+ "aria-label": t ? "Unmute" : "Mute",
586
+ children: m
587
+ }
588
+ ),
589
+ /* @__PURE__ */ e.jsx("div", { className: p(
590
+ "absolute left-full ml-2 flex items-center transition-all duration-200",
591
+ o ? "translate-x-0 opacity-100" : "-translate-x-2 pointer-events-none opacity-0"
592
+ ), children: /* @__PURE__ */ e.jsx(
593
+ "input",
594
+ {
595
+ type: "range",
596
+ min: "0",
597
+ max: "1",
598
+ step: "0.01",
599
+ value: t ? 0 : n,
600
+ onChange: (u) => c(parseFloat(u.target.value)),
601
+ className: "slider h-1 w-20 cursor-pointer appearance-none rounded-lg bg-white/20"
602
+ }
603
+ ) })
604
+ ]
605
+ }
606
+ );
607
+ }, ne = function({
608
+ className: l,
609
+ size: s = "md",
610
+ skipTime: n = 10
611
+ }) {
612
+ const t = L(), o = b((m) => m.currentTime), a = {
613
+ sm: "h-8 w-8",
614
+ md: "h-10 w-10",
615
+ lg: "h-12 w-12"
616
+ }, i = {
617
+ sm: "h-4 w-4",
618
+ md: "h-5 w-5",
619
+ lg: "h-6 w-6"
620
+ }, c = r.useCallback(() => {
621
+ const m = Math.max(0, o - n);
622
+ t({ type: f.SEEK, detail: m });
623
+ }, [t, o, n]);
624
+ return /* @__PURE__ */ e.jsx(
625
+ "button",
626
+ {
627
+ type: "button",
628
+ onClick: c,
629
+ className: p(
630
+ "group relative flex items-center justify-center rounded-full bg-white/10 backdrop-blur-sm",
631
+ "border border-white/20 text-white transition-all duration-200",
632
+ "hover:scale-105 hover:bg-white/20 active:scale-95",
633
+ "focus:outline-none focus:ring-2 focus:ring-white/50",
634
+ a[s],
635
+ l
636
+ ),
637
+ "aria-label": `Backward ${n} seconds`,
638
+ title: `Backward ${n}s`,
639
+ children: /* @__PURE__ */ e.jsxs("div", { className: p("flex items-center transition-transform duration-200", i[s]), children: [
640
+ /* @__PURE__ */ e.jsxs("svg", { viewBox: "0 0 24 24", fill: "currentColor", className: "h-full w-full", children: [
641
+ /* @__PURE__ */ e.jsx("path", { d: "M7 6c.55 0 1 .45 1 1v10c0 .55-.45 1-1 1s-1-.45-1-1V7c0-.55.45-1 1-1zM15.5 7.5c0-.83-.67-1.5-1.5-1.5s-1.5.67-1.5 1.5v9c0 .83.67 1.5 1.5 1.5s1.5-.67 1.5-1.5v-9z" }),
642
+ /* @__PURE__ */ e.jsx("path", { d: "M5.5 12l7-4.5v9l-7-4.5z", opacity: "0.8" })
643
+ ] }),
644
+ n && /* @__PURE__ */ e.jsx("span", { className: "-bottom-1 absolute font-bold text-[10px]", children: n })
645
+ ] })
646
+ }
647
+ );
648
+ }, ae = function({
649
+ className: l,
650
+ size: s = "md",
651
+ skipTime: n = 10
652
+ }) {
653
+ const t = L(), o = b((u) => u.currentTime), a = b((u) => u.duration), i = {
654
+ sm: "h-8 w-8",
655
+ md: "h-10 w-10",
656
+ lg: "h-12 w-12"
657
+ }, c = {
658
+ sm: "h-4 w-4",
659
+ md: "h-5 w-5",
660
+ lg: "h-6 w-6"
661
+ }, m = r.useCallback(() => {
662
+ const u = Math.min(a, o + n);
663
+ t({ type: f.SEEK, detail: u });
664
+ }, [t, o, a, n]);
665
+ return /* @__PURE__ */ e.jsx(
666
+ "button",
667
+ {
668
+ type: "button",
669
+ onClick: m,
670
+ className: p(
671
+ "group relative flex items-center justify-center rounded-full bg-white/10 backdrop-blur-sm",
672
+ "border border-white/20 text-white transition-all duration-200",
673
+ "hover:scale-105 hover:bg-white/20 active:scale-95",
674
+ "focus:outline-none focus:ring-2 focus:ring-white/50",
675
+ i[s],
676
+ l
677
+ ),
678
+ "aria-label": `Forward ${n} seconds`,
679
+ title: `Forward ${n}s`,
680
+ children: /* @__PURE__ */ e.jsxs("div", { className: p("flex items-center transition-transform duration-200", c[s]), children: [
681
+ /* @__PURE__ */ e.jsxs("svg", { viewBox: "0 0 24 24", fill: "currentColor", className: "h-full w-full", children: [
682
+ /* @__PURE__ */ e.jsx("path", { d: "M17 6c.55 0 1 .45 1 1v10c0 .55-.45 1-1 1s-1-.45-1-1V7c0-.55.45-1 1-1zM8.5 7.5c0-.83.67-1.5 1.5-1.5s1.5.67 1.5 1.5v9c0 .83-.67 1.5-1.5 1.5s-1.5-.67-1.5-1.5v-9z" }),
683
+ /* @__PURE__ */ e.jsx("path", { d: "M18.5 12l-7-4.5v9l7-4.5z", opacity: "0.8" })
684
+ ] }),
685
+ n && /* @__PURE__ */ e.jsx("span", { className: "-bottom-1 absolute font-bold text-[10px]", children: n })
686
+ ] })
687
+ }
688
+ );
689
+ }, I = function({
690
+ variant: l = "current",
691
+ className: s
692
+ }) {
693
+ const n = b((a) => a.currentTime), t = b((a) => a.duration), o = r.useMemo(() => {
694
+ switch (l) {
695
+ case "current":
696
+ return D(n);
697
+ case "duration":
698
+ return D(t);
699
+ case "remaining":
700
+ return `-${D(t - n)}`;
701
+ default:
702
+ return D(n);
703
+ }
704
+ }, [l, n, t]);
705
+ return /* @__PURE__ */ e.jsx("div", { className: p("font-mono text-sm text-white tabular-nums", s), children: o });
706
+ }, le = function({
707
+ metrics: l,
708
+ className: s
709
+ }) {
710
+ if (!l || process.env.NODE_ENV !== "development")
711
+ return null;
712
+ const n = (o) => o >= 50 ? "text-green-400" : o >= 30 ? "text-yellow-400" : "text-red-400", t = (o) => o >= 5 ? "text-green-400" : o >= 2 ? "text-yellow-400" : "text-red-400";
713
+ return /* @__PURE__ */ e.jsxs("div", { className: p("flex items-center gap-3 font-mono text-xs", s), children: [
714
+ l.fps !== void 0 && /* @__PURE__ */ e.jsxs("div", { className: p("flex items-center gap-1", n(l.fps)), children: [
715
+ /* @__PURE__ */ e.jsx("div", { className: "h-2 w-2 rounded-full bg-current" }),
716
+ /* @__PURE__ */ e.jsxs("span", { children: [
717
+ l.fps,
718
+ " FPS"
719
+ ] })
720
+ ] }),
721
+ l.bufferHealth !== void 0 && /* @__PURE__ */ e.jsxs("div", { className: p("flex items-center gap-1", t(l.bufferHealth)), children: [
722
+ /* @__PURE__ */ e.jsx("div", { className: "h-2 w-2 rounded-full bg-current" }),
723
+ /* @__PURE__ */ e.jsxs("span", { children: [
724
+ l.bufferHealth.toFixed(1),
725
+ "s"
726
+ ] })
727
+ ] }),
728
+ l.quality !== void 0 && /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-1 text-blue-400", children: [
729
+ /* @__PURE__ */ e.jsx("div", { className: "h-2 w-2 rounded-full bg-current" }),
730
+ /* @__PURE__ */ e.jsxs("span", { children: [
731
+ l.quality,
732
+ "p"
733
+ ] })
734
+ ] })
735
+ ] });
736
+ }, de = function({
737
+ className: l,
738
+ showSkipButtons: s = !0,
739
+ showVolumeControl: n = !0,
740
+ showTimeDisplay: t = !0,
741
+ playButtonSize: o = "xl",
742
+ skipButtonSize: a = "md",
743
+ skipTime: i = 10,
744
+ showPerformanceIndicators: c = process.env.NODE_ENV === "development",
745
+ performanceMetrics: m
746
+ }) {
747
+ return /* @__PURE__ */ e.jsxs("div", { className: p("flex flex-col gap-4 bg-gradient-to-t from-black/80 to-transparent p-4", l), children: [
748
+ /* @__PURE__ */ e.jsx(se, { className: "w-full" }),
749
+ /* @__PURE__ */ e.jsxs("div", { className: "flex items-center justify-between", children: [
750
+ /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-3", children: [
751
+ s && /* @__PURE__ */ e.jsx(
752
+ ne,
753
+ {
754
+ size: a,
755
+ skipTime: i,
756
+ className: "shrink-0"
757
+ }
758
+ ),
759
+ /* @__PURE__ */ e.jsx(
760
+ ee,
761
+ {
762
+ size: o,
763
+ className: "shrink-0"
764
+ }
765
+ ),
766
+ s && /* @__PURE__ */ e.jsx(
767
+ ae,
768
+ {
769
+ size: a,
770
+ skipTime: i,
771
+ className: "shrink-0"
772
+ }
773
+ ),
774
+ n && /* @__PURE__ */ e.jsx(te, { className: "shrink-0" }),
775
+ t && /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-1 font-mono text-sm", children: [
776
+ /* @__PURE__ */ e.jsx(I, { variant: "current" }),
777
+ /* @__PURE__ */ e.jsx("span", { className: "text-white/60", children: "/" }),
778
+ /* @__PURE__ */ e.jsx(I, { variant: "duration" })
779
+ ] })
780
+ ] }),
781
+ /* @__PURE__ */ e.jsx("div", { className: "flex items-center gap-2", children: c && /* @__PURE__ */ e.jsx(
782
+ le,
783
+ {
784
+ metrics: m,
785
+ className: "text-white/80"
786
+ }
787
+ ) })
788
+ ] })
789
+ ] });
790
+ }, ue = ({
791
+ performanceMetrics: d = {},
792
+ preloadingStats: l = {},
793
+ playbackState: s = {},
794
+ hlsMetrics: n = {},
795
+ pluginInfo: t = {},
796
+ debugInfo: o = {},
797
+ className: a,
798
+ position: i = "top-right",
799
+ defaultCollapsed: c = !1,
800
+ title: m = "BaroiPlayer Debug Panel"
801
+ }) => {
802
+ const [u, w] = r.useState(c), [C, g] = r.useState("performance"), y = $(() => {
803
+ switch (i) {
804
+ case "top-left":
805
+ return "top-4 left-4";
806
+ case "top-right":
807
+ return "top-4 right-4";
808
+ case "bottom-left":
809
+ return "bottom-4 left-4";
810
+ case "bottom-right":
811
+ return "bottom-4 right-4";
812
+ default:
813
+ return "top-4 right-4";
814
+ }
815
+ }, [i]), h = (j) => {
816
+ if (j === 0) return "0 B";
817
+ const M = 1024, F = ["B", "KB", "MB", "GB"], V = Math.floor(Math.log(j) / Math.log(M));
818
+ return parseFloat((j / Math.pow(M, V)).toFixed(2)) + " " + F[V];
819
+ }, N = (j) => {
820
+ const M = Math.floor(j / 60), F = Math.floor(j % 60);
821
+ return `${M}:${F.toString().padStart(2, "0")}`;
822
+ }, E = () => /* @__PURE__ */ e.jsx("div", { className: "space-y-2", children: /* @__PURE__ */ e.jsxs("div", { className: "grid grid-cols-2 gap-2 text-xs", children: [
823
+ /* @__PURE__ */ e.jsxs("div", { children: [
824
+ /* @__PURE__ */ e.jsx("span", { className: "text-green-400", children: "FPS:" }),
825
+ /* @__PURE__ */ e.jsx("span", { className: "ml-2 font-mono", children: d.fps || 0 })
826
+ ] }),
827
+ /* @__PURE__ */ e.jsxs("div", { children: [
828
+ /* @__PURE__ */ e.jsx("span", { className: "text-blue-400", children: "Memory:" }),
829
+ /* @__PURE__ */ e.jsxs("span", { className: "ml-2 font-mono", children: [
830
+ ((d.memoryUsage || 0) / 1024 / 1024).toFixed(1),
831
+ " MB"
832
+ ] })
833
+ ] }),
834
+ /* @__PURE__ */ e.jsxs("div", { children: [
835
+ /* @__PURE__ */ e.jsx("span", { className: "text-yellow-400", children: "Buffer:" }),
836
+ /* @__PURE__ */ e.jsxs("span", { className: "ml-2 font-mono", children: [
837
+ (d.bufferHealth || 0).toFixed(2),
838
+ "s"
839
+ ] })
840
+ ] }),
841
+ /* @__PURE__ */ e.jsxs("div", { children: [
842
+ /* @__PURE__ */ e.jsx("span", { className: "text-purple-400", children: "Bandwidth:" }),
843
+ /* @__PURE__ */ e.jsxs("span", { className: "ml-2 font-mono", children: [
844
+ h(d.networkBandwidth || 0),
845
+ "/s"
846
+ ] })
847
+ ] }),
848
+ /* @__PURE__ */ e.jsxs("div", { children: [
849
+ /* @__PURE__ */ e.jsx("span", { className: "text-red-400", children: "Dropped:" }),
850
+ /* @__PURE__ */ e.jsxs("span", { className: "ml-2 font-mono", children: [
851
+ d.droppedFrames || 0,
852
+ " frames"
853
+ ] })
854
+ ] }),
855
+ /* @__PURE__ */ e.jsxs("div", { children: [
856
+ /* @__PURE__ */ e.jsx("span", { className: "text-cyan-400", children: "Decoded:" }),
857
+ /* @__PURE__ */ e.jsxs("span", { className: "ml-2 font-mono", children: [
858
+ d.decodedFrames || 0,
859
+ " frames"
860
+ ] })
861
+ ] })
862
+ ] }) }), T = () => /* @__PURE__ */ e.jsx("div", { className: "space-y-2", children: /* @__PURE__ */ e.jsxs("div", { className: "grid grid-cols-2 gap-2 text-xs", children: [
863
+ /* @__PURE__ */ e.jsxs("div", { children: [
864
+ /* @__PURE__ */ e.jsx("span", { className: "text-green-400", children: "Status:" }),
865
+ /* @__PURE__ */ e.jsx("span", { className: "ml-2 font-mono", children: s.isPlaying ? /* @__PURE__ */ e.jsx("span", { className: "text-green-300", children: "Playing" }) : /* @__PURE__ */ e.jsx("span", { className: "text-red-300", children: "Paused" }) })
866
+ ] }),
867
+ /* @__PURE__ */ e.jsxs("div", { children: [
868
+ /* @__PURE__ */ e.jsx("span", { className: "text-blue-400", children: "Time:" }),
869
+ /* @__PURE__ */ e.jsxs("span", { className: "ml-2 font-mono", children: [
870
+ N(s.currentTime || 0),
871
+ " / ",
872
+ N(s.duration || 0)
873
+ ] })
874
+ ] }),
875
+ /* @__PURE__ */ e.jsxs("div", { children: [
876
+ /* @__PURE__ */ e.jsx("span", { className: "text-yellow-400", children: "Volume:" }),
877
+ /* @__PURE__ */ e.jsxs("span", { className: "ml-2 font-mono", children: [
878
+ Math.round((s.volume || 0) * 100),
879
+ "%"
880
+ ] })
881
+ ] }),
882
+ /* @__PURE__ */ e.jsxs("div", { children: [
883
+ /* @__PURE__ */ e.jsx("span", { className: "text-purple-400", children: "Quality:" }),
884
+ /* @__PURE__ */ e.jsxs("span", { className: "ml-2 font-mono", children: [
885
+ s.quality || 0,
886
+ "p"
887
+ ] })
888
+ ] }),
889
+ /* @__PURE__ */ e.jsxs("div", { children: [
890
+ /* @__PURE__ */ e.jsx("span", { className: "text-red-400", children: "Buffering:" }),
891
+ /* @__PURE__ */ e.jsx("span", { className: "ml-2 font-mono", children: s.isBuffering ? /* @__PURE__ */ e.jsx("span", { className: "text-yellow-300", children: "Yes" }) : /* @__PURE__ */ e.jsx("span", { className: "text-green-300", children: "No" }) })
892
+ ] }),
893
+ s.error && /* @__PURE__ */ e.jsxs("div", { className: "col-span-2", children: [
894
+ /* @__PURE__ */ e.jsx("span", { className: "text-red-400", children: "Error:" }),
895
+ /* @__PURE__ */ e.jsx("span", { className: "ml-2 break-all font-mono text-red-300 text-xs", children: s.error })
896
+ ] })
897
+ ] }) }), S = () => /* @__PURE__ */ e.jsx("div", { className: "space-y-2", children: /* @__PURE__ */ e.jsxs("div", { className: "grid grid-cols-2 gap-2 text-xs", children: [
898
+ /* @__PURE__ */ e.jsxs("div", { children: [
899
+ /* @__PURE__ */ e.jsx("span", { className: "text-green-400", children: "Preloaded:" }),
900
+ /* @__PURE__ */ e.jsxs("span", { className: "ml-2 font-mono", children: [
901
+ l.preloadedItems || 0,
902
+ " items"
903
+ ] })
904
+ ] }),
905
+ /* @__PURE__ */ e.jsxs("div", { children: [
906
+ /* @__PURE__ */ e.jsx("span", { className: "text-blue-400", children: "Engagement:" }),
907
+ /* @__PURE__ */ e.jsxs("span", { className: "ml-2 font-mono", children: [
908
+ (l.engagementScore || 0).toFixed(1),
909
+ "%"
910
+ ] })
911
+ ] }),
912
+ /* @__PURE__ */ e.jsxs("div", { children: [
913
+ /* @__PURE__ */ e.jsx("span", { className: "text-yellow-400", children: "Queue:" }),
914
+ /* @__PURE__ */ e.jsxs("span", { className: "ml-2 font-mono", children: [
915
+ l.queueLength || 0,
916
+ " items"
917
+ ] })
918
+ ] }),
919
+ /* @__PURE__ */ e.jsxs("div", { children: [
920
+ /* @__PURE__ */ e.jsx("span", { className: "text-purple-400", children: "Hit Rate:" }),
921
+ /* @__PURE__ */ e.jsxs("span", { className: "ml-2 font-mono", children: [
922
+ (l.hitRate || 0).toFixed(1),
923
+ "%"
924
+ ] })
925
+ ] }),
926
+ /* @__PURE__ */ e.jsxs("div", { className: "col-span-2", children: [
927
+ /* @__PURE__ */ e.jsx("span", { className: "text-cyan-400", children: "Saved:" }),
928
+ /* @__PURE__ */ e.jsx("span", { className: "ml-2 font-mono", children: h(l.totalSaved || 0) })
929
+ ] })
930
+ ] }) }), x = () => /* @__PURE__ */ e.jsx("div", { className: "space-y-2", children: /* @__PURE__ */ e.jsxs("div", { className: "grid grid-cols-2 gap-2 text-xs", children: [
931
+ /* @__PURE__ */ e.jsxs("div", { children: [
932
+ /* @__PURE__ */ e.jsx("span", { className: "text-green-400", children: "Level:" }),
933
+ /* @__PURE__ */ e.jsxs("span", { className: "ml-2 font-mono", children: [
934
+ n.currentLevel || 0,
935
+ " / ",
936
+ n.availableLevels || 0
937
+ ] })
938
+ ] }),
939
+ /* @__PURE__ */ e.jsxs("div", { children: [
940
+ /* @__PURE__ */ e.jsx("span", { className: "text-blue-400", children: "Bandwidth:" }),
941
+ /* @__PURE__ */ e.jsxs("span", { className: "ml-2 font-mono", children: [
942
+ h(n.bandwidthEstimate || 0),
943
+ "/s"
944
+ ] })
945
+ ] }),
946
+ /* @__PURE__ */ e.jsxs("div", { children: [
947
+ /* @__PURE__ */ e.jsx("span", { className: "text-red-400", children: "Dropped:" }),
948
+ /* @__PURE__ */ e.jsxs("span", { className: "ml-2 font-mono", children: [
949
+ n.droppedFrames || 0,
950
+ " frames"
951
+ ] })
952
+ ] })
953
+ ] }) }), v = () => /* @__PURE__ */ e.jsx("div", { className: "space-y-2", children: /* @__PURE__ */ e.jsxs("div", { className: "text-xs", children: [
954
+ /* @__PURE__ */ e.jsxs("div", { children: [
955
+ /* @__PURE__ */ e.jsx("span", { className: "text-green-400", children: "Total:" }),
956
+ /* @__PURE__ */ e.jsxs("span", { className: "ml-2 font-mono", children: [
957
+ t.pluginCount || 0,
958
+ " plugins"
959
+ ] })
960
+ ] }),
961
+ /* @__PURE__ */ e.jsxs("div", { className: "mt-2", children: [
962
+ /* @__PURE__ */ e.jsx("span", { className: "text-blue-400", children: "Active:" }),
963
+ /* @__PURE__ */ e.jsx("div", { className: "ml-2 space-y-1 font-mono text-xs", children: t.activePlugins?.map((j, M) => /* @__PURE__ */ e.jsxs("div", { className: "text-green-300", children: [
964
+ "• ",
965
+ j
966
+ ] }, M)) || /* @__PURE__ */ e.jsx("div", { className: "text-gray-400", children: "None" }) })
967
+ ] }),
968
+ t.loadedPlugins && t.loadedPlugins.length > (t.activePlugins?.length ?? 0) && /* @__PURE__ */ e.jsxs("div", { className: "mt-2", children: [
969
+ /* @__PURE__ */ e.jsx("span", { className: "text-yellow-400", children: "Loaded (inactive):" }),
970
+ /* @__PURE__ */ e.jsx("div", { className: "ml-2 space-y-1 font-mono text-xs", children: t.loadedPlugins.filter((j) => !t.activePlugins?.includes(j)).map((j, M) => /* @__PURE__ */ e.jsxs("div", { className: "text-yellow-300", children: [
971
+ "• ",
972
+ j
973
+ ] }, M)) })
974
+ ] })
975
+ ] }) }), B = () => /* @__PURE__ */ e.jsx("div", { className: "space-y-2", children: /* @__PURE__ */ e.jsx("div", { className: "space-y-1 font-mono text-xs", children: Object.entries(o).map(([j, M]) => /* @__PURE__ */ e.jsxs("div", { children: [
976
+ /* @__PURE__ */ e.jsxs("span", { className: "text-yellow-400", children: [
977
+ j,
978
+ ":"
979
+ ] }),
980
+ /* @__PURE__ */ e.jsx("span", { className: "ml-2 text-gray-300", children: typeof M == "object" ? JSON.stringify(M, null, 2) : String(M) })
981
+ ] }, j)) }) }), z = () => /* @__PURE__ */ e.jsx("div", { className: "flex space-x-1 border-gray-600 border-b", children: [
982
+ { id: "performance", label: "Performance" },
983
+ { id: "hls", label: "HLS" },
984
+ { id: "plugins", label: "Plugins" },
985
+ { id: "debug", label: "Debug" }
986
+ ].map((j) => /* @__PURE__ */ e.jsx(
987
+ "button",
988
+ {
989
+ onClick: () => g(j.id),
990
+ className: _(
991
+ "px-2 py-1 font-medium text-xs transition-colors",
992
+ C === j.id ? "border-blue-400 border-b text-blue-400" : "text-gray-400 hover:text-white"
993
+ ),
994
+ children: j.label
995
+ },
996
+ j.id
997
+ )) }), A = () => {
998
+ switch (C) {
999
+ case "performance":
1000
+ return /* @__PURE__ */ e.jsxs("div", { className: "space-y-3", children: [
1001
+ E(),
1002
+ /* @__PURE__ */ e.jsx("hr", { className: "border-gray-600" }),
1003
+ T(),
1004
+ /* @__PURE__ */ e.jsx("hr", { className: "border-gray-600" }),
1005
+ S()
1006
+ ] });
1007
+ case "hls":
1008
+ return x();
1009
+ case "plugins":
1010
+ return v();
1011
+ case "debug":
1012
+ return B();
1013
+ default:
1014
+ return E();
1015
+ }
1016
+ };
1017
+ return process.env.NODE_ENV !== "development" ? null : /* @__PURE__ */ e.jsxs(
1018
+ "div",
1019
+ {
1020
+ className: _(
1021
+ "fixed z-50 min-w-80 max-w-96 rounded-lg border border-gray-700 bg-black/90 p-3 font-mono text-white text-xs backdrop-blur-sm",
1022
+ y,
1023
+ a
1024
+ ),
1025
+ children: [
1026
+ /* @__PURE__ */ e.jsxs("div", { className: "mb-3 flex items-center justify-between", children: [
1027
+ /* @__PURE__ */ e.jsx("h3", { className: "font-bold text-blue-400 text-sm", children: m }),
1028
+ /* @__PURE__ */ e.jsx("div", { className: "flex items-center space-x-2", children: /* @__PURE__ */ e.jsx(
1029
+ "button",
1030
+ {
1031
+ onClick: () => w(!u),
1032
+ className: "text-gray-400 transition-colors hover:text-white",
1033
+ "aria-label": u ? "Expand" : "Collapse",
1034
+ children: u ? /* @__PURE__ */ e.jsx("svg", { width: "12", height: "12", viewBox: "0 0 12 12", fill: "none", children: /* @__PURE__ */ e.jsx("path", { d: "M3 4.5L6 7.5L9 4.5", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }) }) : /* @__PURE__ */ e.jsx("svg", { width: "12", height: "12", viewBox: "0 0 12 12", fill: "none", children: /* @__PURE__ */ e.jsx("path", { d: "M3 7.5L6 4.5L9 7.5", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }) })
1035
+ }
1036
+ ) })
1037
+ ] }),
1038
+ u ? /* @__PURE__ */ e.jsxs("div", { className: "grid grid-cols-2 gap-2 text-xs", children: [
1039
+ /* @__PURE__ */ e.jsxs("div", { children: [
1040
+ /* @__PURE__ */ e.jsx("span", { className: "text-green-400", children: "FPS:" }),
1041
+ /* @__PURE__ */ e.jsx("span", { className: "ml-1 font-mono", children: d.fps || 0 })
1042
+ ] }),
1043
+ /* @__PURE__ */ e.jsxs("div", { children: [
1044
+ /* @__PURE__ */ e.jsx("span", { className: "text-blue-400", children: "Memory:" }),
1045
+ /* @__PURE__ */ e.jsxs("span", { className: "ml-1 font-mono", children: [
1046
+ ((d.memoryUsage || 0) / 1024 / 1024).toFixed(1),
1047
+ "MB"
1048
+ ] })
1049
+ ] })
1050
+ ] }) : /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
1051
+ z(),
1052
+ /* @__PURE__ */ e.jsx("div", { className: "mt-3 max-h-64 overflow-y-auto", children: A() })
1053
+ ] })
1054
+ ]
1055
+ }
1056
+ );
1057
+ };
1058
+ export {
1059
+ Z as C,
1060
+ ue as D,
1061
+ Y as E,
1062
+ q as P,
1063
+ W as Q,
1064
+ Q as S,
1065
+ J as a,
1066
+ ee as b,
1067
+ se as c,
1068
+ I as d,
1069
+ te as e,
1070
+ de as f,
1071
+ ie as g
1072
+ };
1073
+ //# sourceMappingURL=enhanced-components-Da0TSvKe.js.map