react-modern-audio-player 2.3.0 → 2.3.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.
- package/README.md +21 -0
- package/dist/index.css +1 -1
- package/dist/index.es.js +501 -470
- package/dist/types/components/Grid/Grid.d.ts +1 -0
- package/package.json +1 -1
package/dist/index.es.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import './index.css';
|
|
3
|
-
import { jsx as c, Fragment as G, jsxs as
|
|
4
|
-
import te, { createContext as K, useContext as he, useReducer as xt, useMemo as
|
|
3
|
+
import { jsx as c, Fragment as G, jsxs as b } from "react/jsx-runtime";
|
|
4
|
+
import te, { createContext as K, useContext as he, useReducer as xt, useMemo as C, forwardRef as Pe, useCallback as g, useRef as P, useEffect as A, memo as z, useState as N, useId as $e, useLayoutEffect as Mt, cloneElement as _t, isValidElement as Dt } from "react";
|
|
5
5
|
import Rt, { flushSync as Fe } from "react-dom";
|
|
6
6
|
const O = {
|
|
7
7
|
isPlaying: !1,
|
|
@@ -11,7 +11,7 @@ const O = {
|
|
|
11
11
|
currentTime: 0,
|
|
12
12
|
duration: 0,
|
|
13
13
|
playbackRate: 1
|
|
14
|
-
},
|
|
14
|
+
}, Kr = 11, pe = {
|
|
15
15
|
templateArea: {
|
|
16
16
|
artwork: "row1-1",
|
|
17
17
|
trackInfo: "row1-2",
|
|
@@ -24,8 +24,8 @@ const O = {
|
|
|
24
24
|
playList: "row1-9",
|
|
25
25
|
playbackRate: "row1-10"
|
|
26
26
|
}
|
|
27
|
-
},
|
|
28
|
-
|
|
27
|
+
}, w = K(null);
|
|
28
|
+
w.displayName = "AudioPlayerDispatchContext";
|
|
29
29
|
const He = (e) => isFinite(e) ? Math.min(Math.max(e, 0), 1) : 1, Ke = (e, t) => Math.round(Math.random() * (t - e) + e), Ut = 1, Ve = (e, t, n) => {
|
|
30
30
|
if (n - t < 1) return e;
|
|
31
31
|
let a = Ke(t, n);
|
|
@@ -88,7 +88,7 @@ const He = (e) => isFinite(e) ? Math.min(Math.max(e, 0), 1) : 1, Ke = (e, t) =>
|
|
|
88
88
|
curAudioState: { ...e.curAudioState, currentTime: 0 }
|
|
89
89
|
};
|
|
90
90
|
if (e.curAudioState.repeatType === "SHUFFLE") {
|
|
91
|
-
const
|
|
91
|
+
const i = Ve(
|
|
92
92
|
e.curIdx,
|
|
93
93
|
0,
|
|
94
94
|
e.playList.length - 1
|
|
@@ -96,17 +96,17 @@ const He = (e) => isFinite(e) ? Math.min(Math.max(e, 0), 1) : 1, Ke = (e, t) =>
|
|
|
96
96
|
return {
|
|
97
97
|
...e,
|
|
98
98
|
audioResetKey: e.audioResetKey + 1,
|
|
99
|
-
curPlayId: e.playList[
|
|
100
|
-
curIdx:
|
|
99
|
+
curPlayId: e.playList[i].id,
|
|
100
|
+
curIdx: i,
|
|
101
101
|
curAudioState: { ...e.curAudioState, currentTime: 0 }
|
|
102
102
|
};
|
|
103
103
|
}
|
|
104
|
-
const
|
|
104
|
+
const s = (e.curIdx - 1 + e.playList.length) % e.playList.length;
|
|
105
105
|
return {
|
|
106
106
|
...e,
|
|
107
107
|
audioResetKey: e.audioResetKey + 1,
|
|
108
|
-
curPlayId: e.playList[
|
|
109
|
-
curIdx:
|
|
108
|
+
curPlayId: e.playList[s].id,
|
|
109
|
+
curIdx: s,
|
|
110
110
|
curAudioState: {
|
|
111
111
|
...e.curAudioState,
|
|
112
112
|
isLoadedMetaData: !1,
|
|
@@ -263,30 +263,30 @@ const He = (e) => isFinite(e) ? Math.min(Math.max(e, 0), 1) : 1, Ke = (e, t) =>
|
|
|
263
263
|
Se.displayName = "PlaybackContext";
|
|
264
264
|
const Ie = K(null);
|
|
265
265
|
Ie.displayName = "AudioAttrsContext";
|
|
266
|
-
const we = K(null);
|
|
267
|
-
we.displayName = "TrackContext";
|
|
268
266
|
const be = K(null);
|
|
269
|
-
be.displayName = "
|
|
267
|
+
be.displayName = "TrackContext";
|
|
268
|
+
const we = K(null);
|
|
269
|
+
we.displayName = "UIContext";
|
|
270
270
|
const Le = K(null);
|
|
271
271
|
Le.displayName = "ResourceContext";
|
|
272
272
|
const Ne = K(null);
|
|
273
273
|
Ne.displayName = "TimeContext";
|
|
274
|
-
const
|
|
274
|
+
const E = (e) => {
|
|
275
275
|
const t = he(e);
|
|
276
276
|
if (!t) {
|
|
277
277
|
const n = e.displayName || "Context";
|
|
278
278
|
throw new Error(`${n} is not provided`);
|
|
279
279
|
}
|
|
280
280
|
return t;
|
|
281
|
-
}, k = () =>
|
|
281
|
+
}, k = () => E(Se), re = () => E(Ne), $ = () => E(be), x = () => E(we), L = () => E(Le), Kt = () => E(Ie);
|
|
282
282
|
function Vt(e) {
|
|
283
283
|
const {
|
|
284
284
|
playList: t,
|
|
285
285
|
audioInitialState: n,
|
|
286
286
|
activeUI: a,
|
|
287
287
|
placement: r,
|
|
288
|
-
customIcons:
|
|
289
|
-
coverImgsCss:
|
|
288
|
+
customIcons: s,
|
|
289
|
+
coverImgsCss: i
|
|
290
290
|
} = e, o = {
|
|
291
291
|
isPlaying: (n == null ? void 0 : n.isPlaying) ?? O.isPlaying,
|
|
292
292
|
repeatType: (n == null ? void 0 : n.repeatType) ?? O.repeatType,
|
|
@@ -298,7 +298,7 @@ function Vt(e) {
|
|
|
298
298
|
playListPlacement: (r == null ? void 0 : r.playList) || "bottom",
|
|
299
299
|
interfacePlacement: (r == null ? void 0 : r.interface) || {
|
|
300
300
|
templateArea: {
|
|
301
|
-
playButton:
|
|
301
|
+
playButton: pe.templateArea.playButton
|
|
302
302
|
}
|
|
303
303
|
},
|
|
304
304
|
volumeSliderPlacement: r == null ? void 0 : r.volumeSlider,
|
|
@@ -313,8 +313,8 @@ function Vt(e) {
|
|
|
313
313
|
audioResetKey: 0,
|
|
314
314
|
seekRequestKey: 0,
|
|
315
315
|
...d,
|
|
316
|
-
customIcons:
|
|
317
|
-
coverImgsCss:
|
|
316
|
+
customIcons: s,
|
|
317
|
+
coverImgsCss: i
|
|
318
318
|
};
|
|
319
319
|
}
|
|
320
320
|
const Bt = ({
|
|
@@ -327,7 +327,7 @@ const Bt = ({
|
|
|
327
327
|
Ot,
|
|
328
328
|
n,
|
|
329
329
|
Vt
|
|
330
|
-
),
|
|
330
|
+
), s = C(
|
|
331
331
|
() => ({
|
|
332
332
|
currentTime: a.curAudioState.currentTime ?? O.currentTime,
|
|
333
333
|
duration: a.curAudioState.duration ?? O.duration,
|
|
@@ -338,7 +338,7 @@ const Bt = ({
|
|
|
338
338
|
a.curAudioState.duration,
|
|
339
339
|
a.seekRequestKey
|
|
340
340
|
]
|
|
341
|
-
),
|
|
341
|
+
), i = C(
|
|
342
342
|
() => ({
|
|
343
343
|
isPlaying: a.curAudioState.isPlaying ?? O.isPlaying,
|
|
344
344
|
volume: a.curAudioState.volume ?? O.volume,
|
|
@@ -357,14 +357,14 @@ const Bt = ({
|
|
|
357
357
|
a.curAudioState.playbackRate,
|
|
358
358
|
a.audioResetKey
|
|
359
359
|
]
|
|
360
|
-
), o =
|
|
360
|
+
), o = C(
|
|
361
361
|
() => ({
|
|
362
362
|
playList: a.playList,
|
|
363
363
|
curPlayId: a.curPlayId,
|
|
364
364
|
curIdx: a.curIdx
|
|
365
365
|
}),
|
|
366
366
|
[a.playList, a.curPlayId, a.curIdx]
|
|
367
|
-
), { audioInitialState: u } = n, d = u == null ? void 0 : u.playListExpanded, l =
|
|
367
|
+
), { audioInitialState: u } = n, d = u == null ? void 0 : u.playListExpanded, l = C(
|
|
368
368
|
() => ({
|
|
369
369
|
activeUI: a.activeUI,
|
|
370
370
|
playListPlacement: a.playListPlacement,
|
|
@@ -385,23 +385,23 @@ const Bt = ({
|
|
|
385
385
|
t,
|
|
386
386
|
d
|
|
387
387
|
]
|
|
388
|
-
), m =
|
|
388
|
+
), m = C(() => {
|
|
389
389
|
if (!u) return {};
|
|
390
390
|
const {
|
|
391
391
|
isPlaying: y,
|
|
392
392
|
repeatType: T,
|
|
393
393
|
isLoadedMetaData: h,
|
|
394
|
-
currentTime:
|
|
395
|
-
duration:
|
|
396
|
-
volume:
|
|
397
|
-
muted:
|
|
394
|
+
currentTime: S,
|
|
395
|
+
duration: D,
|
|
396
|
+
volume: j,
|
|
397
|
+
muted: ce,
|
|
398
398
|
playbackRate: R,
|
|
399
|
-
curPlayId:
|
|
399
|
+
curPlayId: le,
|
|
400
400
|
playListExpanded: ae,
|
|
401
401
|
...ye
|
|
402
402
|
} = u;
|
|
403
403
|
return ye;
|
|
404
|
-
}, [u]), p =
|
|
404
|
+
}, [u]), p = C(
|
|
405
405
|
() => ({
|
|
406
406
|
elementRefs: a.elementRefs,
|
|
407
407
|
customIcons: a.customIcons,
|
|
@@ -414,7 +414,7 @@ const Bt = ({
|
|
|
414
414
|
a.coverImgsCss
|
|
415
415
|
]
|
|
416
416
|
);
|
|
417
|
-
return /* @__PURE__ */ c(Ne.Provider, { value:
|
|
417
|
+
return /* @__PURE__ */ c(Ne.Provider, { value: s, children: /* @__PURE__ */ c(Se.Provider, { value: i, children: /* @__PURE__ */ c(be.Provider, { value: o, children: /* @__PURE__ */ c(we.Provider, { value: l, children: /* @__PURE__ */ c(Le.Provider, { value: p, children: /* @__PURE__ */ c(Ie.Provider, { value: m, children: /* @__PURE__ */ c(w.Provider, { value: r, children: e }) }) }) }) }) }) });
|
|
418
418
|
}, J = {
|
|
419
419
|
top: "auto",
|
|
420
420
|
right: "auto",
|
|
@@ -428,10 +428,10 @@ const Bt = ({
|
|
|
428
428
|
"top-left": { ...J, top: 0, left: 0 },
|
|
429
429
|
"top-right": { ...J, top: 0, right: 0 }
|
|
430
430
|
}, Ge = te.memo(({ children: e, rootContainerProps: t }) => {
|
|
431
|
-
const { playerPlacement: n, colorScheme: a } =
|
|
431
|
+
const { playerPlacement: n, colorScheme: a } = x(), r = C(
|
|
432
432
|
() => n ? $t[n] : void 0,
|
|
433
433
|
[n]
|
|
434
|
-
),
|
|
434
|
+
), i = {
|
|
435
435
|
width: "100%",
|
|
436
436
|
position: n !== "static" && !!n ? "fixed" : "static",
|
|
437
437
|
...r,
|
|
@@ -440,10 +440,11 @@ const Bt = ({
|
|
|
440
440
|
return /* @__PURE__ */ c(
|
|
441
441
|
"div",
|
|
442
442
|
{
|
|
443
|
+
"data-testid": "player-provider",
|
|
443
444
|
...t,
|
|
444
445
|
className: `rmap-player-provider${t != null && t.className ? ` ${t.className}` : ""}`,
|
|
445
446
|
"data-theme": a ?? void 0,
|
|
446
|
-
style:
|
|
447
|
+
style: i,
|
|
447
448
|
children: e
|
|
448
449
|
}
|
|
449
450
|
);
|
|
@@ -455,18 +456,19 @@ const Ft = ({
|
|
|
455
456
|
alignItems: n,
|
|
456
457
|
justifyContent: a,
|
|
457
458
|
minHeight: r,
|
|
458
|
-
UNSAFE_className:
|
|
459
|
-
|
|
459
|
+
UNSAFE_className: s,
|
|
460
|
+
"data-testid": i,
|
|
461
|
+
children: o
|
|
460
462
|
}) => {
|
|
461
|
-
const
|
|
463
|
+
const u = {
|
|
462
464
|
display: "grid",
|
|
463
|
-
gridTemplateAreas: e == null ? void 0 : e.map((
|
|
465
|
+
gridTemplateAreas: e == null ? void 0 : e.map((d) => `"${d}"`).join(" "),
|
|
464
466
|
gridTemplateColumns: t == null ? void 0 : t.join(" "),
|
|
465
467
|
alignItems: n,
|
|
466
468
|
justifyContent: a,
|
|
467
469
|
minHeight: r
|
|
468
470
|
};
|
|
469
|
-
return /* @__PURE__ */ c("div", { className:
|
|
471
|
+
return /* @__PURE__ */ c("div", { className: s, style: u, "data-testid": i, children: o });
|
|
470
472
|
}, Ht = Ft, ze = Pe(
|
|
471
473
|
({
|
|
472
474
|
children: e,
|
|
@@ -474,8 +476,8 @@ const Ft = ({
|
|
|
474
476
|
gridArea: n,
|
|
475
477
|
width: a,
|
|
476
478
|
justifySelf: r = "center",
|
|
477
|
-
padding:
|
|
478
|
-
UNSAFE_className:
|
|
479
|
+
padding: s,
|
|
480
|
+
UNSAFE_className: i,
|
|
479
481
|
style: o,
|
|
480
482
|
...u
|
|
481
483
|
}, d) => {
|
|
@@ -484,22 +486,22 @@ const Ft = ({
|
|
|
484
486
|
gridArea: n,
|
|
485
487
|
width: a,
|
|
486
488
|
justifySelf: r,
|
|
487
|
-
padding:
|
|
489
|
+
padding: s ?? "0 5px",
|
|
488
490
|
...o
|
|
489
491
|
};
|
|
490
|
-
return /* @__PURE__ */ c("div", { ref: d, className:
|
|
492
|
+
return /* @__PURE__ */ c("div", { ref: d, className: i, style: l, ...u, children: e });
|
|
491
493
|
}
|
|
492
494
|
);
|
|
493
495
|
ze.displayName = "GridItem";
|
|
494
|
-
const
|
|
495
|
-
|
|
496
|
+
const M = Ht;
|
|
497
|
+
M.Item = ze;
|
|
496
498
|
const Gt = ({
|
|
497
499
|
children: e,
|
|
498
500
|
id: t,
|
|
499
501
|
...n
|
|
500
502
|
}) => {
|
|
501
503
|
var l, m;
|
|
502
|
-
const a = k(), r = re(),
|
|
504
|
+
const a = k(), r = re(), s = $(), i = x(), o = L(), u = {
|
|
503
505
|
curAudioState: {
|
|
504
506
|
isPlaying: a.isPlaying,
|
|
505
507
|
volume: a.volume,
|
|
@@ -511,12 +513,12 @@ const Gt = ({
|
|
|
511
513
|
},
|
|
512
514
|
audioResetKey: a.audioResetKey,
|
|
513
515
|
...r,
|
|
514
|
-
...i,
|
|
515
516
|
...s,
|
|
517
|
+
...i,
|
|
516
518
|
...o
|
|
517
|
-
}, d = (m = (l =
|
|
519
|
+
}, d = (m = (l = i.interfacePlacement) == null ? void 0 : l.customComponentsArea) == null ? void 0 : m[t];
|
|
518
520
|
return /* @__PURE__ */ c(
|
|
519
|
-
|
|
521
|
+
M.Item,
|
|
520
522
|
{
|
|
521
523
|
UNSAFE_className: "rmap-custom-component",
|
|
522
524
|
gridArea: d,
|
|
@@ -533,7 +535,7 @@ const zt = () => {
|
|
|
533
535
|
repeatType: n,
|
|
534
536
|
audioResetKey: a,
|
|
535
537
|
playbackRate: r
|
|
536
|
-
} = k(), { currentTime:
|
|
538
|
+
} = k(), { currentTime: s, seekRequestKey: i } = re(), { elementRefs: o } = L(), u = E(w), d = g(
|
|
537
539
|
(y) => {
|
|
538
540
|
if (y.currentTarget.readyState === 0) return;
|
|
539
541
|
const T = y.currentTarget.currentTime;
|
|
@@ -543,7 +545,7 @@ const zt = () => {
|
|
|
543
545
|
});
|
|
544
546
|
},
|
|
545
547
|
[u]
|
|
546
|
-
), l =
|
|
548
|
+
), l = g(() => {
|
|
547
549
|
if (o != null && o.audioEl) {
|
|
548
550
|
if (n === "ONE") {
|
|
549
551
|
Fe(() => {
|
|
@@ -553,12 +555,12 @@ const zt = () => {
|
|
|
553
555
|
}
|
|
554
556
|
u({ type: "NEXT_AUDIO" });
|
|
555
557
|
}
|
|
556
|
-
}, [u, n, o == null ? void 0 : o.audioEl]), m =
|
|
558
|
+
}, [u, n, o == null ? void 0 : o.audioEl]), m = g(
|
|
557
559
|
(y) => {
|
|
558
560
|
t != null && (y.volume = t), r != null && (y.playbackRate = r);
|
|
559
561
|
},
|
|
560
562
|
[t, r]
|
|
561
|
-
), p =
|
|
563
|
+
), p = g(
|
|
562
564
|
(y) => {
|
|
563
565
|
const { duration: T } = y.currentTarget;
|
|
564
566
|
m(y.currentTarget), u({
|
|
@@ -567,8 +569,8 @@ const zt = () => {
|
|
|
567
569
|
});
|
|
568
570
|
},
|
|
569
571
|
[u, m]
|
|
570
|
-
), v =
|
|
571
|
-
|
|
572
|
+
), v = P(!1);
|
|
573
|
+
A(() => {
|
|
572
574
|
if (o != null && o.audioEl) {
|
|
573
575
|
if (!v.current) {
|
|
574
576
|
v.current = !0;
|
|
@@ -576,32 +578,32 @@ const zt = () => {
|
|
|
576
578
|
}
|
|
577
579
|
o.audioEl.currentTime = 0;
|
|
578
580
|
}
|
|
579
|
-
}, [a, o == null ? void 0 : o.audioEl]),
|
|
581
|
+
}, [a, o == null ? void 0 : o.audioEl]), A(() => {
|
|
580
582
|
o != null && o.audioEl && (e ? o.audioEl.play().catch((y) => {
|
|
581
583
|
(y == null ? void 0 : y.name) !== "AbortError" && u({
|
|
582
584
|
type: "SET_AUDIO_STATE",
|
|
583
585
|
audioState: { isPlaying: !1 }
|
|
584
586
|
});
|
|
585
587
|
}) : o.audioEl.pause());
|
|
586
|
-
}, [o == null ? void 0 : o.audioEl, e, u, a]),
|
|
588
|
+
}, [o == null ? void 0 : o.audioEl, e, u, a]), A(() => {
|
|
587
589
|
!(o != null && o.audioEl) || t == null || (o.audioEl.volume = t);
|
|
588
|
-
}, [o == null ? void 0 : o.audioEl, t]),
|
|
590
|
+
}, [o == null ? void 0 : o.audioEl, t]), A(() => {
|
|
589
591
|
!(o != null && o.audioEl) || r == null || (o.audioEl.playbackRate = r);
|
|
590
592
|
}, [o == null ? void 0 : o.audioEl, r]);
|
|
591
|
-
const f =
|
|
592
|
-
return
|
|
593
|
-
if (
|
|
594
|
-
f.current =
|
|
593
|
+
const f = P(0);
|
|
594
|
+
return A(() => {
|
|
595
|
+
if (i === f.current) return;
|
|
596
|
+
f.current = i;
|
|
595
597
|
const y = o == null ? void 0 : o.audioEl;
|
|
596
|
-
if (!y ||
|
|
597
|
-
y.currentTime =
|
|
598
|
-
const T = o == null ? void 0 : o.waveformInst, h = y.duration,
|
|
599
|
-
if (!T || !
|
|
600
|
-
const
|
|
601
|
-
T.seekTo(
|
|
598
|
+
if (!y || s == null) return;
|
|
599
|
+
y.currentTime = s;
|
|
600
|
+
const T = o == null ? void 0 : o.waveformInst, h = y.duration, S = Number.isFinite(h) && h > 0;
|
|
601
|
+
if (!T || !S) return;
|
|
602
|
+
const D = s / h, j = Math.min(1, Math.max(0, D));
|
|
603
|
+
T.seekTo(j);
|
|
602
604
|
}, [
|
|
603
|
-
s,
|
|
604
605
|
i,
|
|
606
|
+
s,
|
|
605
607
|
o == null ? void 0 : o.audioEl,
|
|
606
608
|
o == null ? void 0 : o.waveformInst
|
|
607
609
|
]), {
|
|
@@ -610,19 +612,19 @@ const zt = () => {
|
|
|
610
612
|
onLoadedMetadata: p
|
|
611
613
|
};
|
|
612
614
|
}, Ye = te.memo(({ audioRef: e }) => {
|
|
613
|
-
const t =
|
|
615
|
+
const t = P(null), { muted: n } = k(), { curPlayId: a, playList: r } = $(), s = Kt(), i = E(w), o = r.find(
|
|
614
616
|
(d) => d.id === a
|
|
615
617
|
), u = zt();
|
|
616
|
-
return
|
|
617
|
-
t.current && (
|
|
618
|
+
return A(() => {
|
|
619
|
+
t.current && (i({
|
|
618
620
|
type: "SET_ELEMENT_REFS",
|
|
619
621
|
elementRefs: { audioEl: t.current }
|
|
620
622
|
}), e && (e.current = t.current));
|
|
621
|
-
}, [
|
|
623
|
+
}, [i, e]), /* @__PURE__ */ c(
|
|
622
624
|
"audio",
|
|
623
625
|
{
|
|
624
626
|
id: "rm-audio-player-audio",
|
|
625
|
-
...
|
|
627
|
+
...s,
|
|
626
628
|
muted: n,
|
|
627
629
|
ref: t,
|
|
628
630
|
src: o == null ? void 0 : o.src,
|
|
@@ -633,8 +635,8 @@ const zt = () => {
|
|
|
633
635
|
Ye.displayName = "Audio";
|
|
634
636
|
function B(e, t) {
|
|
635
637
|
var a, r;
|
|
636
|
-
const { interfacePlacement: n } =
|
|
637
|
-
return t ?? ((a = n == null ? void 0 : n.itemCustomArea) == null ? void 0 : a[e]) ?? ((r = n == null ? void 0 : n.templateArea) == null ? void 0 : r[e]) ??
|
|
638
|
+
const { interfacePlacement: n } = x();
|
|
639
|
+
return t ?? ((a = n == null ? void 0 : n.itemCustomArea) == null ? void 0 : a[e]) ?? ((r = n == null ? void 0 : n.templateArea) == null ? void 0 : r[e]) ?? pe.templateArea[e];
|
|
638
640
|
}
|
|
639
641
|
const q = Pe(({ className: e, type: t = "button", ...n }, a) => /* @__PURE__ */ c(
|
|
640
642
|
"button",
|
|
@@ -690,7 +692,7 @@ const ke = (e) => (
|
|
|
690
692
|
)
|
|
691
693
|
), qe = (e, t = "0 0 16 16") => (
|
|
692
694
|
// eslint-disable-next-line react/display-name
|
|
693
|
-
({ size: n = "1em", color: a, style: r, ...
|
|
695
|
+
({ size: n = "1em", color: a, style: r, ...s }) => /* @__PURE__ */ c(
|
|
694
696
|
"svg",
|
|
695
697
|
{
|
|
696
698
|
"aria-hidden": "true",
|
|
@@ -704,7 +706,7 @@ const ke = (e) => (
|
|
|
704
706
|
color: a,
|
|
705
707
|
style: a ? { color: a, ...r } : r,
|
|
706
708
|
xmlns: "http://www.w3.org/2000/svg",
|
|
707
|
-
...
|
|
709
|
+
...s,
|
|
708
710
|
dangerouslySetInnerHTML: { __html: e }
|
|
709
711
|
}
|
|
710
712
|
)
|
|
@@ -748,16 +750,16 @@ const ot = X(
|
|
|
748
750
|
'<path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M6 15h-2a1 1 0 0 1 -1 -1v-4a1 1 0 0 1 1 -1h2l3.5 -4.5a0.8 .8 0 0 1 1.5 .5v14a0.8 .8 0 0 1 -1.5 .5l-3.5 -4.5"/><path d="M16 10l4 4m0 -4l-4 4"/>'
|
|
749
751
|
);
|
|
750
752
|
ot.displayName = "TbVolume3";
|
|
751
|
-
const
|
|
753
|
+
const st = qe(
|
|
752
754
|
'<path d="M8 0c-4.418 0-8 3.582-8 8s3.582 8 8 8 8-3.582 8-8-3.582-8-8-8zM8 14.5c-3.59 0-6.5-2.91-6.5-6.5s2.91-6.5 6.5-6.5 6.5 2.91 6.5 6.5-2.91 6.5-6.5 6.5z"/><path d="M7 8l4-3v6z"/><path d="M5 5h2v6h-2v-6z"/>'
|
|
753
755
|
);
|
|
754
|
-
|
|
755
|
-
const
|
|
756
|
+
st.displayName = "ImPrevious";
|
|
757
|
+
const it = qe(
|
|
756
758
|
'<path d="M8 0c4.418 0 8 3.582 8 8s-3.582 8-8 8-8-3.582-8-8 3.582-8 8-8zM8 14.5c3.59 0 6.5-2.91 6.5-6.5s-2.91-6.5-6.5-6.5-6.5 2.91-6.5 6.5 2.91 6.5 6.5 6.5z"/><path d="M9 8l-4-3v6z"/><path d="M11 5h-2v6h2v-6z"/>'
|
|
757
759
|
);
|
|
758
|
-
|
|
759
|
-
const
|
|
760
|
-
const { isPlaying: t } = k(), { customIcons: n } = L(), a =
|
|
760
|
+
it.displayName = "ImNext";
|
|
761
|
+
const _ = ({ render: e, customIcon: t }) => /* @__PURE__ */ c(G, { children: t ?? e }), Wt = z(function() {
|
|
762
|
+
const { isPlaying: t } = k(), { customIcons: n } = L(), a = E(w);
|
|
761
763
|
return /* @__PURE__ */ c(
|
|
762
764
|
q,
|
|
763
765
|
{
|
|
@@ -767,16 +769,16 @@ const D = ({ render: e, customIcon: t }) => /* @__PURE__ */ c(G, { children: t ?
|
|
|
767
769
|
className: "rmap-play-btn",
|
|
768
770
|
"data-testid": "play-btn",
|
|
769
771
|
children: t ? /* @__PURE__ */ c(
|
|
770
|
-
|
|
772
|
+
_,
|
|
771
773
|
{
|
|
772
774
|
render: /* @__PURE__ */ c(Qe, {}),
|
|
773
775
|
customIcon: n == null ? void 0 : n.pause
|
|
774
776
|
}
|
|
775
|
-
) : /* @__PURE__ */ c(
|
|
777
|
+
) : /* @__PURE__ */ c(_, { render: /* @__PURE__ */ c(Xe, {}), customIcon: n == null ? void 0 : n.play })
|
|
776
778
|
}
|
|
777
779
|
);
|
|
778
780
|
}), jt = z(function({ isVisible: t }) {
|
|
779
|
-
const { customIcons: n, elementRefs: a } = L(), r =
|
|
781
|
+
const { customIcons: n, elementRefs: a } = L(), r = E(w);
|
|
780
782
|
return t ? /* @__PURE__ */ c(
|
|
781
783
|
q,
|
|
782
784
|
{
|
|
@@ -784,16 +786,16 @@ const D = ({ render: e, customIcon: t }) => /* @__PURE__ */ c(G, { children: t ?
|
|
|
784
786
|
"aria-label": "Previous track",
|
|
785
787
|
onClick: () => {
|
|
786
788
|
var o;
|
|
787
|
-
const
|
|
788
|
-
r({ type: "PREV_AUDIO", currentTime:
|
|
789
|
+
const i = ((o = a == null ? void 0 : a.audioEl) == null ? void 0 : o.currentTime) ?? 0;
|
|
790
|
+
r({ type: "PREV_AUDIO", currentTime: i });
|
|
789
791
|
},
|
|
790
792
|
className: "rmap-prev-btn",
|
|
791
793
|
"data-testid": "prev-btn",
|
|
792
|
-
children: /* @__PURE__ */ c(
|
|
794
|
+
children: /* @__PURE__ */ c(_, { render: /* @__PURE__ */ c(st, {}), customIcon: n == null ? void 0 : n.prev })
|
|
793
795
|
}
|
|
794
796
|
) : null;
|
|
795
797
|
}), Yt = z(function({ isVisible: t }) {
|
|
796
|
-
const { customIcons: n } = L(), a =
|
|
798
|
+
const { customIcons: n } = L(), a = E(w);
|
|
797
799
|
return t ? /* @__PURE__ */ c(
|
|
798
800
|
q,
|
|
799
801
|
{
|
|
@@ -804,7 +806,7 @@ const D = ({ render: e, customIcon: t }) => /* @__PURE__ */ c(G, { children: t ?
|
|
|
804
806
|
},
|
|
805
807
|
className: "rmap-next-btn",
|
|
806
808
|
"data-testid": "next-btn",
|
|
807
|
-
children: /* @__PURE__ */ c(
|
|
809
|
+
children: /* @__PURE__ */ c(_, { render: /* @__PURE__ */ c(it, {}), customIcon: n == null ? void 0 : n.next })
|
|
808
810
|
}
|
|
809
811
|
) : null;
|
|
810
812
|
}), ct = ({
|
|
@@ -812,8 +814,8 @@ const D = ({ render: e, customIcon: t }) => /* @__PURE__ */ c(G, { children: t ?
|
|
|
812
814
|
visible: t,
|
|
813
815
|
...n
|
|
814
816
|
}) => {
|
|
815
|
-
const { activeUI: a } =
|
|
816
|
-
return /* @__PURE__ */ c(
|
|
817
|
+
const { activeUI: a } = x(), r = !!(a.prevNnext ?? a.all), s = B("playButton", e);
|
|
818
|
+
return /* @__PURE__ */ c(M.Item, { gridArea: s, visible: t ?? !0, ...n, children: /* @__PURE__ */ b(
|
|
817
819
|
"div",
|
|
818
820
|
{
|
|
819
821
|
className: "rmap-ctrl-btn-wrapper",
|
|
@@ -838,21 +840,21 @@ const D = ({ render: e, customIcon: t }) => /* @__PURE__ */ c(G, { children: t ?
|
|
|
838
840
|
SHUFFLE: "ALL"
|
|
839
841
|
}, lt = z(
|
|
840
842
|
function({ gridArea: t, visible: n, ...a }) {
|
|
841
|
-
const { repeatType: r } = k(), { customIcons:
|
|
842
|
-
|
|
843
|
+
const { repeatType: r } = k(), { customIcons: s } = L(), i = E(
|
|
844
|
+
w
|
|
843
845
|
), o = () => {
|
|
844
|
-
|
|
846
|
+
i({
|
|
845
847
|
type: "SET_REPEAT_TYPE",
|
|
846
848
|
repeatType: Xt[r]
|
|
847
849
|
});
|
|
848
850
|
}, u = B("repeatType", t);
|
|
849
851
|
return /* @__PURE__ */ c(
|
|
850
|
-
|
|
852
|
+
M.Item,
|
|
851
853
|
{
|
|
852
854
|
gridArea: u,
|
|
853
855
|
visible: n ?? !0,
|
|
854
856
|
...a,
|
|
855
|
-
children: /* @__PURE__ */
|
|
857
|
+
children: /* @__PURE__ */ b(
|
|
856
858
|
q,
|
|
857
859
|
{
|
|
858
860
|
type: "button",
|
|
@@ -862,26 +864,26 @@ const D = ({ render: e, customIcon: t }) => /* @__PURE__ */ c(G, { children: t ?
|
|
|
862
864
|
"data-testid": "repeat-btn",
|
|
863
865
|
"data-repeattype": r,
|
|
864
866
|
children: [
|
|
865
|
-
r === "ALL" && /* @__PURE__ */ c(
|
|
867
|
+
r === "ALL" && /* @__PURE__ */ c(_, { render: /* @__PURE__ */ c(Ze, {}), customIcon: s == null ? void 0 : s.repeatAll }),
|
|
866
868
|
r === "ONE" && /* @__PURE__ */ c(
|
|
867
|
-
|
|
869
|
+
_,
|
|
868
870
|
{
|
|
869
871
|
render: /* @__PURE__ */ c(et, {}),
|
|
870
|
-
customIcon:
|
|
872
|
+
customIcon: s == null ? void 0 : s.repeatOne
|
|
871
873
|
}
|
|
872
874
|
),
|
|
873
875
|
r === "NONE" && /* @__PURE__ */ c(
|
|
874
|
-
|
|
876
|
+
_,
|
|
875
877
|
{
|
|
876
878
|
render: /* @__PURE__ */ c(tt, {}),
|
|
877
|
-
customIcon:
|
|
879
|
+
customIcon: s == null ? void 0 : s.repeatNone
|
|
878
880
|
}
|
|
879
881
|
),
|
|
880
882
|
r === "SHUFFLE" && /* @__PURE__ */ c(
|
|
881
|
-
|
|
883
|
+
_,
|
|
882
884
|
{
|
|
883
885
|
render: /* @__PURE__ */ c(rt, {}),
|
|
884
|
-
customIcon:
|
|
886
|
+
customIcon: s == null ? void 0 : s.repeatShuffle
|
|
885
887
|
}
|
|
886
888
|
)
|
|
887
889
|
]
|
|
@@ -891,22 +893,22 @@ const D = ({ render: e, customIcon: t }) => /* @__PURE__ */ c(G, { children: t ?
|
|
|
891
893
|
);
|
|
892
894
|
}
|
|
893
895
|
), Te = { size: "100%" }, ut = z(() => {
|
|
894
|
-
var
|
|
895
|
-
const { volume: e, muted: t } = k(), { customIcons: n, elementRefs: a } = L(), r = e ?? ((
|
|
896
|
+
var i;
|
|
897
|
+
const { volume: e, muted: t } = k(), { customIcons: n, elementRefs: a } = L(), r = e ?? ((i = a == null ? void 0 : a.audioEl) == null ? void 0 : i.volume) ?? 0, s = r > 0 && r <= 0.5;
|
|
896
898
|
return t || r === 0 ? /* @__PURE__ */ c(
|
|
897
|
-
|
|
899
|
+
_,
|
|
898
900
|
{
|
|
899
901
|
render: /* @__PURE__ */ c(ot, { ...Te }),
|
|
900
902
|
customIcon: n == null ? void 0 : n.volumeMuted
|
|
901
903
|
}
|
|
902
|
-
) :
|
|
903
|
-
|
|
904
|
+
) : s ? /* @__PURE__ */ c(
|
|
905
|
+
_,
|
|
904
906
|
{
|
|
905
907
|
render: /* @__PURE__ */ c(nt, { ...Te }),
|
|
906
908
|
customIcon: n == null ? void 0 : n.volumeHalf
|
|
907
909
|
}
|
|
908
910
|
) : /* @__PURE__ */ c(
|
|
909
|
-
|
|
911
|
+
_,
|
|
910
912
|
{
|
|
911
913
|
render: /* @__PURE__ */ c(at, { ...Te }),
|
|
912
914
|
customIcon: n == null ? void 0 : n.volumeFull
|
|
@@ -914,13 +916,13 @@ const D = ({ render: e, customIcon: t }) => /* @__PURE__ */ c(G, { children: t ?
|
|
|
914
916
|
);
|
|
915
917
|
});
|
|
916
918
|
ut.displayName = "VolumeIcon";
|
|
917
|
-
const
|
|
918
|
-
|
|
919
|
+
const se = K(null);
|
|
920
|
+
se.displayName = "DrawerContext";
|
|
919
921
|
const dt = (e, t) => {
|
|
920
|
-
|
|
922
|
+
A(() => {
|
|
921
923
|
const n = (a) => {
|
|
922
|
-
const r = e.current, { target:
|
|
923
|
-
!a || !r || r.contains(
|
|
924
|
+
const r = e.current, { target: s } = a;
|
|
925
|
+
!a || !r || r.contains(s) || t(a);
|
|
924
926
|
};
|
|
925
927
|
return document.addEventListener("click", n), () => document.removeEventListener("click", n);
|
|
926
928
|
}, [e, t]);
|
|
@@ -930,51 +932,51 @@ const dt = (e, t) => {
|
|
|
930
932
|
children: n,
|
|
931
933
|
isOpen: a,
|
|
932
934
|
onOpenChange: r,
|
|
933
|
-
initialOpen:
|
|
935
|
+
initialOpen: s
|
|
934
936
|
}) => {
|
|
935
|
-
const
|
|
936
|
-
a !== void 0 ? a :
|
|
937
|
+
const i = P(null), [o, u] = te.Children.toArray(n), [d, l] = N(
|
|
938
|
+
a !== void 0 ? a : s ?? !1
|
|
937
939
|
), m = $e();
|
|
938
|
-
dt(
|
|
940
|
+
dt(i, () => {
|
|
939
941
|
e && (l(!1), r && r(!1));
|
|
940
|
-
}),
|
|
942
|
+
}), A(() => {
|
|
941
943
|
a !== void 0 && l(a);
|
|
942
944
|
}, [a]);
|
|
943
|
-
const p =
|
|
945
|
+
const p = C(
|
|
944
946
|
() => ({ isOpen: d, setIsOpen: l, onOpenChange: r, drawerId: m }),
|
|
945
947
|
[d, l, r, m]
|
|
946
948
|
);
|
|
947
|
-
return /* @__PURE__ */ c("div", { className: "rmap-drawer-container", ref:
|
|
949
|
+
return /* @__PURE__ */ c("div", { className: "rmap-drawer-container", ref: i, children: /* @__PURE__ */ c(se.Provider, { value: p, children: /* @__PURE__ */ b(G, { children: [
|
|
948
950
|
t === "top" && u,
|
|
949
951
|
o,
|
|
950
952
|
t === "bottom" && u
|
|
951
953
|
] }) }) });
|
|
952
|
-
}, pt = typeof window < "u", ge = pt ? Mt :
|
|
954
|
+
}, pt = typeof window < "u", ge = pt ? Mt : A, Ce = ({
|
|
953
955
|
visible: e,
|
|
954
956
|
name: t,
|
|
955
957
|
leaveTime: n,
|
|
956
958
|
enterTime: a,
|
|
957
959
|
clearTime: r,
|
|
958
|
-
onExited:
|
|
959
|
-
onEntered:
|
|
960
|
+
onExited: s,
|
|
961
|
+
onEntered: i,
|
|
960
962
|
children: o
|
|
961
963
|
}) => {
|
|
962
|
-
const [u, d] = N(""), [l, m] = N(!1), p =
|
|
964
|
+
const [u, d] = N(""), [l, m] = N(!1), p = P(i), v = P(s), f = P(t), y = P(a), T = P(n), h = P(r);
|
|
963
965
|
return ge(() => {
|
|
964
|
-
p.current =
|
|
966
|
+
p.current = i, v.current = s, f.current = t, y.current = a, T.current = n, h.current = r;
|
|
965
967
|
}), ge(() => {
|
|
966
|
-
const
|
|
967
|
-
e && !l && m(!0), d(`${
|
|
968
|
-
const
|
|
969
|
-
var
|
|
968
|
+
const S = e ? "enter" : "leave", D = f.current, j = e ? y.current : T.current;
|
|
969
|
+
e && !l && m(!0), d(`${D}-${S}`);
|
|
970
|
+
const ce = setTimeout(() => {
|
|
971
|
+
var le, ae;
|
|
970
972
|
d(
|
|
971
|
-
`${
|
|
972
|
-
),
|
|
973
|
-
},
|
|
974
|
-
e || (d(
|
|
975
|
-
},
|
|
973
|
+
`${D}-${S} ${D}-${S}-active`
|
|
974
|
+
), S === "leave" ? (le = v.current) == null || le.call(v) : (ae = p.current) == null || ae.call(p);
|
|
975
|
+
}, j), R = setTimeout(() => {
|
|
976
|
+
e || (d(D), m(!1));
|
|
977
|
+
}, j + h.current);
|
|
976
978
|
return () => {
|
|
977
|
-
clearTimeout(
|
|
979
|
+
clearTimeout(ce), clearTimeout(R);
|
|
978
980
|
};
|
|
979
981
|
}, [e, l]), l ? _t(o, {
|
|
980
982
|
className: `${o.props.className} ${u}`
|
|
@@ -984,39 +986,39 @@ const dt = (e, t) => {
|
|
|
984
986
|
isWithAnimation: t = !0,
|
|
985
987
|
"aria-label": n = "Dialog"
|
|
986
988
|
}) => {
|
|
987
|
-
const { isOpen: a, setIsOpen: r, onOpenChange:
|
|
989
|
+
const { isOpen: a, setIsOpen: r, onOpenChange: s, drawerId: i } = E(se), o = P(null), u = P(null), d = g(
|
|
988
990
|
() => {
|
|
989
991
|
var y;
|
|
990
992
|
return (y = o.current) == null ? void 0 : y.querySelectorAll(Qt);
|
|
991
993
|
},
|
|
992
994
|
[]
|
|
993
|
-
), l =
|
|
995
|
+
), l = g(() => {
|
|
994
996
|
var y, T;
|
|
995
997
|
(T = (y = d()) == null ? void 0 : y[0]) == null || T.focus();
|
|
996
|
-
}, [d]), m =
|
|
998
|
+
}, [d]), m = g(() => {
|
|
997
999
|
u.current = document.activeElement, l();
|
|
998
|
-
}, [l]), p =
|
|
1000
|
+
}, [l]), p = g(() => {
|
|
999
1001
|
var y;
|
|
1000
1002
|
(y = u.current) == null || y.focus();
|
|
1001
1003
|
}, []);
|
|
1002
|
-
|
|
1004
|
+
A(() => {
|
|
1003
1005
|
var y;
|
|
1004
1006
|
a && !t ? (u.current = document.activeElement, l()) : !a && !t && ((y = u.current) == null || y.focus());
|
|
1005
1007
|
}, [a, t, l]);
|
|
1006
|
-
const v =
|
|
1008
|
+
const v = g(
|
|
1007
1009
|
(y) => {
|
|
1008
1010
|
if (y.key === "Escape") {
|
|
1009
|
-
r(!1),
|
|
1011
|
+
r(!1), s && s(!1);
|
|
1010
1012
|
return;
|
|
1011
1013
|
}
|
|
1012
1014
|
if (y.key === "Tab") {
|
|
1013
1015
|
const T = d();
|
|
1014
1016
|
if (!T || T.length === 0) return;
|
|
1015
|
-
const h = T[0],
|
|
1016
|
-
y.shiftKey ? document.activeElement === h && (y.preventDefault(),
|
|
1017
|
+
const h = T[0], S = T[T.length - 1];
|
|
1018
|
+
y.shiftKey ? document.activeElement === h && (y.preventDefault(), S.focus()) : document.activeElement === S && (y.preventDefault(), h.focus());
|
|
1017
1019
|
}
|
|
1018
1020
|
},
|
|
1019
|
-
[r,
|
|
1021
|
+
[r, s, d]
|
|
1020
1022
|
), f = /* @__PURE__ */ c(
|
|
1021
1023
|
"div",
|
|
1022
1024
|
{
|
|
@@ -1025,7 +1027,7 @@ const dt = (e, t) => {
|
|
|
1025
1027
|
role: "dialog",
|
|
1026
1028
|
"aria-modal": "true",
|
|
1027
1029
|
"aria-label": n,
|
|
1028
|
-
id:
|
|
1030
|
+
id: i,
|
|
1029
1031
|
onKeyDown: v,
|
|
1030
1032
|
children: e
|
|
1031
1033
|
}
|
|
@@ -1048,17 +1050,17 @@ const dt = (e, t) => {
|
|
|
1048
1050
|
"aria-label": t,
|
|
1049
1051
|
"data-testid": n
|
|
1050
1052
|
}) => {
|
|
1051
|
-
const { isOpen: a, setIsOpen: r, onOpenChange:
|
|
1053
|
+
const { isOpen: a, setIsOpen: r, onOpenChange: s, drawerId: i } = E(se), o = g(() => {
|
|
1052
1054
|
const u = !a;
|
|
1053
|
-
r(u),
|
|
1054
|
-
}, [a, r,
|
|
1055
|
+
r(u), s == null || s(u);
|
|
1056
|
+
}, [a, r, s]);
|
|
1055
1057
|
return /* @__PURE__ */ c(
|
|
1056
1058
|
q,
|
|
1057
1059
|
{
|
|
1058
1060
|
className: "rmap-drawer-trigger",
|
|
1059
1061
|
type: "button",
|
|
1060
1062
|
"aria-expanded": a,
|
|
1061
|
-
"aria-controls":
|
|
1063
|
+
"aria-controls": i,
|
|
1062
1064
|
"aria-label": t,
|
|
1063
1065
|
"data-testid": n,
|
|
1064
1066
|
onClick: o,
|
|
@@ -1074,8 +1076,8 @@ const Ee = ({ children: e }) => /* @__PURE__ */ c("ul", { className: "rmap-sorta
|
|
|
1074
1076
|
listData: n,
|
|
1075
1077
|
draggable: a = !0,
|
|
1076
1078
|
onDragStart: r,
|
|
1077
|
-
onDragOver:
|
|
1078
|
-
onDrop:
|
|
1079
|
+
onDragOver: s,
|
|
1080
|
+
onDrop: i,
|
|
1079
1081
|
onReorder: o,
|
|
1080
1082
|
onClick: u
|
|
1081
1083
|
}) => {
|
|
@@ -1134,7 +1136,7 @@ const Ee = ({ children: e }) => /* @__PURE__ */ c("ul", { className: "rmap-sorta
|
|
|
1134
1136
|
l.stopPropagation(), l.currentTarget.classList.remove("rmap-drag-over");
|
|
1135
1137
|
},
|
|
1136
1138
|
onDragOver: (l) => {
|
|
1137
|
-
l.preventDefault(), l.stopPropagation(),
|
|
1139
|
+
l.preventDefault(), l.stopPropagation(), s == null || s(l);
|
|
1138
1140
|
},
|
|
1139
1141
|
onDrop: (l) => {
|
|
1140
1142
|
l.stopPropagation(), l.currentTarget.classList.remove("rmap-drag-over");
|
|
@@ -1145,7 +1147,7 @@ const Ee = ({ children: e }) => /* @__PURE__ */ c("ul", { className: "rmap-sorta
|
|
|
1145
1147
|
p,
|
|
1146
1148
|
...m.slice(e, m.length)
|
|
1147
1149
|
].map((f, y) => ({ ...f, index: y }));
|
|
1148
|
-
|
|
1150
|
+
i == null || i(l, v);
|
|
1149
1151
|
},
|
|
1150
1152
|
onClick: (l) => {
|
|
1151
1153
|
l.stopPropagation(), u == null || u(l);
|
|
@@ -1170,7 +1172,7 @@ const rr = z(function({
|
|
|
1170
1172
|
className: `rmap-playlist-item${r ? " rmap-cur-played" : ""}`,
|
|
1171
1173
|
"data-testid": "playlist-item",
|
|
1172
1174
|
"aria-current": r ? "true" : void 0,
|
|
1173
|
-
children: /* @__PURE__ */
|
|
1175
|
+
children: /* @__PURE__ */ b("div", { className: "rmap-playlist-item-contents", children: [
|
|
1174
1176
|
/* @__PURE__ */ c("div", { className: "rmap-playlist-album-cover", children: t.img && /* @__PURE__ */ c(
|
|
1175
1177
|
"img",
|
|
1176
1178
|
{
|
|
@@ -1179,7 +1181,7 @@ const rr = z(function({
|
|
|
1179
1181
|
style: a == null ? void 0 : a.listThumbnail
|
|
1180
1182
|
}
|
|
1181
1183
|
) }),
|
|
1182
|
-
/* @__PURE__ */
|
|
1184
|
+
/* @__PURE__ */ b("div", { className: "rmap-playlist-album-info", children: [
|
|
1183
1185
|
t.writer && /* @__PURE__ */ c("span", { className: "rmap-playlist-writer", children: t.writer }),
|
|
1184
1186
|
t.name && /* @__PURE__ */ c("span", { className: "rmap-playlist-title", children: t.name }),
|
|
1185
1187
|
t.description && /* @__PURE__ */ c("div", { className: "rmap-playlist-description", children: t.description })
|
|
@@ -1190,7 +1192,7 @@ const rr = z(function({
|
|
|
1190
1192
|
}), ar = ({
|
|
1191
1193
|
setIsOpen: e
|
|
1192
1194
|
}) => {
|
|
1193
|
-
const { playList: t } = $(), { activeUI: n } =
|
|
1195
|
+
const { playList: t } = $(), { activeUI: n } = x(), a = E(w), [r, s] = N(0), i = g(
|
|
1194
1196
|
(o) => {
|
|
1195
1197
|
a({
|
|
1196
1198
|
type: "SET_CURRENT_AUDIO",
|
|
@@ -1208,7 +1210,7 @@ const rr = z(function({
|
|
|
1208
1210
|
sortableItemEventProps: {
|
|
1209
1211
|
draggable: n.playList !== "unSortable",
|
|
1210
1212
|
dragStartIdx: r,
|
|
1211
|
-
onDragStart: (o) =>
|
|
1213
|
+
onDragStart: (o) => s(o),
|
|
1212
1214
|
onDrop: (o, u) => a({
|
|
1213
1215
|
type: "UPDATE_PLAY_LIST",
|
|
1214
1216
|
playList: u
|
|
@@ -1217,17 +1219,17 @@ const rr = z(function({
|
|
|
1217
1219
|
type: "UPDATE_PLAY_LIST",
|
|
1218
1220
|
playList: o
|
|
1219
1221
|
}),
|
|
1220
|
-
onClick: (o) =>
|
|
1222
|
+
onClick: (o) => i(o)
|
|
1221
1223
|
}
|
|
1222
1224
|
};
|
|
1223
1225
|
}, nr = () => {
|
|
1224
|
-
const { playList: e } = $(), { isOpen: t, setIsOpen: n } =
|
|
1226
|
+
const { playList: e } = $(), { isOpen: t, setIsOpen: n } = E(se), a = he(xe), r = he(Me), { cssTransitionEventProps: s, sortableItemEventProps: i } = ar({
|
|
1225
1227
|
setIsOpen: n
|
|
1226
1228
|
}), {
|
|
1227
1229
|
onClick: o,
|
|
1228
1230
|
onDragStart: u,
|
|
1229
1231
|
...d
|
|
1230
|
-
} =
|
|
1232
|
+
} = i;
|
|
1231
1233
|
if (!a) return /* @__PURE__ */ c(G, {});
|
|
1232
1234
|
const l = e.length === 0;
|
|
1233
1235
|
return l && !r ? /* @__PURE__ */ c(G, {}) : Rt.createPortal(
|
|
@@ -1239,7 +1241,7 @@ const rr = z(function({
|
|
|
1239
1241
|
enterTime: 20,
|
|
1240
1242
|
leaveTime: 20,
|
|
1241
1243
|
clearTime: 300,
|
|
1242
|
-
...
|
|
1244
|
+
...s,
|
|
1243
1245
|
children: /* @__PURE__ */ c("div", { className: "rmap-playlist-container", children: l ? r : /* @__PURE__ */ c(Ee, { children: e.map((m, p) => /* @__PURE__ */ c(
|
|
1244
1246
|
Ee.Item,
|
|
1245
1247
|
{
|
|
@@ -1259,7 +1261,7 @@ const rr = z(function({
|
|
|
1259
1261
|
}, or = () => {
|
|
1260
1262
|
const { customIcons: e } = L();
|
|
1261
1263
|
return /* @__PURE__ */ c(
|
|
1262
|
-
|
|
1264
|
+
_,
|
|
1263
1265
|
{
|
|
1264
1266
|
render: /* @__PURE__ */ c(Je, { size: "100%" }),
|
|
1265
1267
|
customIcon: e == null ? void 0 : e.playList
|
|
@@ -1271,8 +1273,8 @@ const rr = z(function({
|
|
|
1271
1273
|
visible: n,
|
|
1272
1274
|
...a
|
|
1273
1275
|
}) => {
|
|
1274
|
-
const { playListExpanded: r } =
|
|
1275
|
-
return /* @__PURE__ */ c(
|
|
1276
|
+
const { playListExpanded: r } = x(), s = e ?? r, i = B("playList", t);
|
|
1277
|
+
return /* @__PURE__ */ c(M.Item, { gridArea: i, visible: n ?? !0, ...a, children: /* @__PURE__ */ b(oe, { initialOpen: s, children: [
|
|
1276
1278
|
/* @__PURE__ */ c(
|
|
1277
1279
|
oe.Trigger,
|
|
1278
1280
|
{
|
|
@@ -1286,24 +1288,24 @@ const rr = z(function({
|
|
|
1286
1288
|
}, ee = (e) => {
|
|
1287
1289
|
const t = `${Math.floor(e / 60)}`.padStart(2, "0"), n = `${Math.floor(e % 60)}`.padStart(2, "0");
|
|
1288
1290
|
return `${t}:${n}`;
|
|
1289
|
-
},
|
|
1291
|
+
}, me = (e, t, n = 0) => {
|
|
1290
1292
|
if (!t) return n;
|
|
1291
1293
|
const a = e / t;
|
|
1292
1294
|
return isFinite(a) ? a : n;
|
|
1293
1295
|
}, yt = () => {
|
|
1294
|
-
const { isLoadedMetaData: e } = k(), { elementRefs: t } = L(), [n, a] = N(!1), r =
|
|
1295
|
-
(
|
|
1296
|
+
const { isLoadedMetaData: e } = k(), { elementRefs: t } = L(), [n, a] = N(!1), r = g(
|
|
1297
|
+
(s) => {
|
|
1296
1298
|
if (!(t != null && t.audioEl) || !e) return;
|
|
1297
|
-
const { clientX:
|
|
1299
|
+
const { clientX: i } = s, { clientWidth: o } = s.currentTarget, u = s.currentTarget.getBoundingClientRect(), d = i - u.x, l = me(d, o) * t.audioEl.duration;
|
|
1298
1300
|
t.audioEl.currentTime = l;
|
|
1299
1301
|
},
|
|
1300
1302
|
[e, t == null ? void 0 : t.audioEl]
|
|
1301
1303
|
);
|
|
1302
|
-
return
|
|
1304
|
+
return A(() => {
|
|
1303
1305
|
if (!n) return;
|
|
1304
|
-
const
|
|
1305
|
-
return document.addEventListener("selectstart",
|
|
1306
|
-
document.removeEventListener("selectstart",
|
|
1306
|
+
const s = (i) => i.preventDefault();
|
|
1307
|
+
return document.addEventListener("selectstart", s), () => {
|
|
1308
|
+
document.removeEventListener("selectstart", s);
|
|
1307
1309
|
};
|
|
1308
1310
|
}, [n]), {
|
|
1309
1311
|
onMouseDown: () => a(!0),
|
|
@@ -1314,34 +1316,34 @@ const rr = z(function({
|
|
|
1314
1316
|
};
|
|
1315
1317
|
}, vt = (e) => {
|
|
1316
1318
|
const { isLoadedMetaData: t } = k(), { elementRefs: n } = L();
|
|
1317
|
-
return
|
|
1319
|
+
return g(
|
|
1318
1320
|
(a) => {
|
|
1319
1321
|
if (!(n != null && n.audioEl) || !t) return;
|
|
1320
1322
|
const r = n.audioEl;
|
|
1321
|
-
let
|
|
1323
|
+
let s = null;
|
|
1322
1324
|
switch (a.key) {
|
|
1323
1325
|
case "ArrowRight":
|
|
1324
1326
|
case "ArrowUp":
|
|
1325
|
-
a.preventDefault(),
|
|
1327
|
+
a.preventDefault(), s = Math.min(r.currentTime + 5, r.duration);
|
|
1326
1328
|
break;
|
|
1327
1329
|
case "ArrowLeft":
|
|
1328
1330
|
case "ArrowDown":
|
|
1329
|
-
a.preventDefault(),
|
|
1331
|
+
a.preventDefault(), s = Math.max(r.currentTime - 5, 0);
|
|
1330
1332
|
break;
|
|
1331
1333
|
case "Home":
|
|
1332
|
-
a.preventDefault(),
|
|
1334
|
+
a.preventDefault(), s = 0;
|
|
1333
1335
|
break;
|
|
1334
1336
|
case "End":
|
|
1335
|
-
a.preventDefault(),
|
|
1337
|
+
a.preventDefault(), s = r.duration;
|
|
1336
1338
|
break;
|
|
1337
1339
|
}
|
|
1338
|
-
|
|
1340
|
+
s !== null && isFinite(r.duration) && (r.currentTime = s, e == null || e(s, r.duration));
|
|
1339
1341
|
},
|
|
1340
1342
|
[n == null ? void 0 : n.audioEl, t, e]
|
|
1341
1343
|
);
|
|
1342
|
-
},
|
|
1343
|
-
const { currentTime: e, duration: t } = re(), n =
|
|
1344
|
-
|
|
1344
|
+
}, sr = () => {
|
|
1345
|
+
const { currentTime: e, duration: t } = re(), n = P(null), [a, r] = N(0);
|
|
1346
|
+
A(() => {
|
|
1345
1347
|
const d = n.current;
|
|
1346
1348
|
if (!d) return;
|
|
1347
1349
|
r(d.offsetWidth);
|
|
@@ -1350,8 +1352,8 @@ const rr = z(function({
|
|
|
1350
1352
|
});
|
|
1351
1353
|
return l.observe(d), () => l.disconnect();
|
|
1352
1354
|
}, []);
|
|
1353
|
-
const
|
|
1354
|
-
return /* @__PURE__ */
|
|
1355
|
+
const s = me(e, t), i = yt(), o = vt(), u = s * a;
|
|
1356
|
+
return /* @__PURE__ */ b(
|
|
1355
1357
|
"div",
|
|
1356
1358
|
{
|
|
1357
1359
|
ref: n,
|
|
@@ -1362,18 +1364,18 @@ const rr = z(function({
|
|
|
1362
1364
|
"aria-label": "Seek",
|
|
1363
1365
|
"aria-valuemin": 0,
|
|
1364
1366
|
"aria-valuemax": 100,
|
|
1365
|
-
"aria-valuenow": Math.round(
|
|
1367
|
+
"aria-valuenow": Math.round(s * 100),
|
|
1366
1368
|
"aria-valuetext": `${ee(
|
|
1367
1369
|
e
|
|
1368
1370
|
)} of ${ee(t)}`,
|
|
1369
1371
|
onKeyDown: o,
|
|
1370
|
-
...
|
|
1372
|
+
...i,
|
|
1371
1373
|
children: [
|
|
1372
1374
|
/* @__PURE__ */ c("div", { className: "rmap-progress-bar", children: /* @__PURE__ */ c(
|
|
1373
1375
|
"div",
|
|
1374
1376
|
{
|
|
1375
1377
|
className: "rmap-progress-fill",
|
|
1376
|
-
style: { transform: `scaleX(${
|
|
1378
|
+
style: { transform: `scaleX(${s})` }
|
|
1377
1379
|
}
|
|
1378
1380
|
) }),
|
|
1379
1381
|
/* @__PURE__ */ c(
|
|
@@ -1388,20 +1390,20 @@ const rr = z(function({
|
|
|
1388
1390
|
]
|
|
1389
1391
|
}
|
|
1390
1392
|
);
|
|
1391
|
-
},
|
|
1392
|
-
const n =
|
|
1393
|
+
}, ir = (e, t) => {
|
|
1394
|
+
const n = P(), a = g(() => {
|
|
1393
1395
|
const r = document.getElementsByClassName("rmap-player-provider")[0];
|
|
1394
1396
|
if (!r) return;
|
|
1395
|
-
const
|
|
1397
|
+
const s = Object.entries(
|
|
1396
1398
|
e
|
|
1397
1399
|
).reduce(
|
|
1398
|
-
(
|
|
1399
|
-
...
|
|
1400
|
+
(i, [o, u]) => ({
|
|
1401
|
+
...i,
|
|
1400
1402
|
[o]: window.getComputedStyle(r).getPropertyValue(`${u}`)
|
|
1401
1403
|
}),
|
|
1402
1404
|
{}
|
|
1403
1405
|
);
|
|
1404
|
-
n.current =
|
|
1406
|
+
n.current = s;
|
|
1405
1407
|
}, [e]);
|
|
1406
1408
|
return ge(() => {
|
|
1407
1409
|
a();
|
|
@@ -1417,15 +1419,15 @@ const rr = z(function({
|
|
|
1417
1419
|
for (const [n, a] of Object.entries(t.mediaListeners))
|
|
1418
1420
|
t.media.removeEventListener(n, a);
|
|
1419
1421
|
}, ur = (e) => {
|
|
1420
|
-
const t =
|
|
1421
|
-
o.current = r == null ? void 0 : r.waveformInst,
|
|
1422
|
+
const t = E(w), { isPlaying: n } = k(), { curPlayId: a } = $(), { elementRefs: r } = L(), { colorScheme: s } = x(), i = ir(cr, s), o = P(r == null ? void 0 : r.waveformInst);
|
|
1423
|
+
o.current = r == null ? void 0 : r.waveformInst, A(() => {
|
|
1422
1424
|
var v, f;
|
|
1423
|
-
if (r != null && r.waveformInst || !((v =
|
|
1425
|
+
if (r != null && r.waveformInst || !((v = i.current) != null && v.progressColor) || !((f = i.current) != null && f.waveColor))
|
|
1424
1426
|
return;
|
|
1425
1427
|
let p = !1;
|
|
1426
1428
|
return import("./wavesurfer-_j5aw4gZ.mjs").then((y) => y.w).then(({ default: y }) => {
|
|
1427
|
-
var h,
|
|
1428
|
-
if (p || !e.current || !((h =
|
|
1429
|
+
var h, S;
|
|
1430
|
+
if (p || !e.current || !((h = i.current) != null && h.progressColor) || !((S = i.current) != null && S.waveColor)) {
|
|
1429
1431
|
console.error("[useWaveSurfer] missing required dependencies");
|
|
1430
1432
|
return;
|
|
1431
1433
|
}
|
|
@@ -1436,17 +1438,17 @@ const rr = z(function({
|
|
|
1436
1438
|
cursorWidth: 2,
|
|
1437
1439
|
container: e.current,
|
|
1438
1440
|
height: 80,
|
|
1439
|
-
progressColor:
|
|
1441
|
+
progressColor: i.current.progressColor,
|
|
1440
1442
|
responsive: !0,
|
|
1441
|
-
waveColor:
|
|
1443
|
+
waveColor: i.current.waveColor,
|
|
1442
1444
|
cursorColor: "var(--rm-audio-player-waveform-cursor)",
|
|
1443
1445
|
backend: "MediaElement",
|
|
1444
1446
|
removeMediaElementOnDestroy: !1
|
|
1445
1447
|
});
|
|
1446
|
-
} catch (
|
|
1448
|
+
} catch (D) {
|
|
1447
1449
|
console.error(
|
|
1448
1450
|
"[useWaveSurfer] failed to create WaveSurfer instance",
|
|
1449
|
-
|
|
1451
|
+
D
|
|
1450
1452
|
);
|
|
1451
1453
|
return;
|
|
1452
1454
|
}
|
|
@@ -1459,9 +1461,9 @@ const rr = z(function({
|
|
|
1459
1461
|
}), () => {
|
|
1460
1462
|
p = !0;
|
|
1461
1463
|
};
|
|
1462
|
-
}, [r == null ? void 0 : r.waveformInst, t,
|
|
1463
|
-
const u =
|
|
1464
|
-
|
|
1464
|
+
}, [r == null ? void 0 : r.waveformInst, t, i]);
|
|
1465
|
+
const u = P(a);
|
|
1466
|
+
A(() => {
|
|
1465
1467
|
if (!(r != null && r.audioEl) || !(r != null && r.waveformInst)) return;
|
|
1466
1468
|
const p = r.audioEl;
|
|
1467
1469
|
if (!p.getAttribute("src")) return;
|
|
@@ -1475,7 +1477,7 @@ const rr = z(function({
|
|
|
1475
1477
|
return v.on("ready", h), () => {
|
|
1476
1478
|
v.un("ready", h);
|
|
1477
1479
|
};
|
|
1478
|
-
}, [a, r == null ? void 0 : r.audioEl, r == null ? void 0 : r.waveformInst]),
|
|
1480
|
+
}, [a, r == null ? void 0 : r.audioEl, r == null ? void 0 : r.waveformInst]), A(() => {
|
|
1479
1481
|
if (!e.current || !(r != null && r.waveformInst)) return;
|
|
1480
1482
|
const p = () => {
|
|
1481
1483
|
var f, y;
|
|
@@ -1484,7 +1486,7 @@ const rr = z(function({
|
|
|
1484
1486
|
return v.observe(e.current), () => {
|
|
1485
1487
|
v.disconnect();
|
|
1486
1488
|
};
|
|
1487
|
-
}, [r == null ? void 0 : r.waveformInst, e]),
|
|
1489
|
+
}, [r == null ? void 0 : r.waveformInst, e]), A(
|
|
1488
1490
|
() => () => {
|
|
1489
1491
|
var v, f;
|
|
1490
1492
|
const p = (v = e.current) == null ? void 0 : v.querySelector("wave");
|
|
@@ -1500,24 +1502,24 @@ const rr = z(function({
|
|
|
1500
1502
|
var y, T;
|
|
1501
1503
|
const p = o.current;
|
|
1502
1504
|
if (!(p != null && p.isReady)) return;
|
|
1503
|
-
const v = (y =
|
|
1505
|
+
const v = (y = i.current) == null ? void 0 : y.waveColor, f = (T = i.current) == null ? void 0 : T.progressColor;
|
|
1504
1506
|
v && p.setWaveColor(v), f && p.setProgressColor(f);
|
|
1505
|
-
}, l =
|
|
1507
|
+
}, l = P(d);
|
|
1506
1508
|
l.current = d;
|
|
1507
|
-
const m =
|
|
1508
|
-
|
|
1509
|
-
m.current !==
|
|
1510
|
-
}, [
|
|
1509
|
+
const m = P(s);
|
|
1510
|
+
A(() => {
|
|
1511
|
+
m.current !== s && (m.current = s, l.current());
|
|
1512
|
+
}, [s, r == null ? void 0 : r.waveformInst]), A(() => {
|
|
1511
1513
|
const p = () => l.current(), v = window.matchMedia("(prefers-color-scheme: dark)");
|
|
1512
1514
|
return v.addEventListener("change", p), () => v.removeEventListener("change", p);
|
|
1513
1515
|
}, []);
|
|
1514
1516
|
}, dr = ({ isActive: e }) => {
|
|
1515
1517
|
var u, d, l, m;
|
|
1516
|
-
const t =
|
|
1517
|
-
ur(t),
|
|
1518
|
+
const t = P(null), { isLoadedMetaData: n, isPlaying: a } = k(), { elementRefs: r } = L();
|
|
1519
|
+
ur(t), A(() => {
|
|
1518
1520
|
if (!e || !(r != null && r.waveformInst) || !(r != null && r.audioEl) || !n || a)
|
|
1519
1521
|
return;
|
|
1520
|
-
const p =
|
|
1522
|
+
const p = me(
|
|
1521
1523
|
r.audioEl.currentTime,
|
|
1522
1524
|
r.audioEl.duration
|
|
1523
1525
|
);
|
|
@@ -1529,13 +1531,13 @@ const rr = z(function({
|
|
|
1529
1531
|
r == null ? void 0 : r.audioEl,
|
|
1530
1532
|
a
|
|
1531
1533
|
]);
|
|
1532
|
-
const
|
|
1534
|
+
const s = yt(), i = g(
|
|
1533
1535
|
(p, v) => {
|
|
1534
1536
|
var f;
|
|
1535
|
-
v && ((f = r == null ? void 0 : r.waveformInst) == null || f.seekTo(
|
|
1537
|
+
v && ((f = r == null ? void 0 : r.waveformInst) == null || f.seekTo(me(p, v)));
|
|
1536
1538
|
},
|
|
1537
1539
|
[r == null ? void 0 : r.waveformInst]
|
|
1538
|
-
), o = vt(
|
|
1540
|
+
), o = vt(i);
|
|
1539
1541
|
return /* @__PURE__ */ c("div", { className: "rmap-waveform-wrapper", "data-active": e, children: /* @__PURE__ */ c(
|
|
1540
1542
|
"div",
|
|
1541
1543
|
{
|
|
@@ -1553,7 +1555,7 @@ const rr = z(function({
|
|
|
1553
1555
|
((l = r == null ? void 0 : r.audioEl) == null ? void 0 : l.currentTime) ?? 0
|
|
1554
1556
|
)} of ${ee(((m = r == null ? void 0 : r.audioEl) == null ? void 0 : m.duration) ?? 0)}`,
|
|
1555
1557
|
onKeyDown: o,
|
|
1556
|
-
...
|
|
1558
|
+
...s
|
|
1557
1559
|
}
|
|
1558
1560
|
) });
|
|
1559
1561
|
}, ft = ({
|
|
@@ -1563,26 +1565,26 @@ const rr = z(function({
|
|
|
1563
1565
|
width: a,
|
|
1564
1566
|
...r
|
|
1565
1567
|
}) => {
|
|
1566
|
-
const { activeUI:
|
|
1567
|
-
|
|
1568
|
+
const { activeUI: s } = x(), i = n ?? (s.progress === "waveform" ? "waveform" : "bar"), o = i === "waveform", u = i === "bar", [d, l] = N(o);
|
|
1569
|
+
A(() => {
|
|
1568
1570
|
o && !d && l(!0);
|
|
1569
1571
|
}, [o, d]);
|
|
1570
1572
|
const m = B("progress", e);
|
|
1571
1573
|
return /* @__PURE__ */ c(
|
|
1572
|
-
|
|
1574
|
+
M.Item,
|
|
1573
1575
|
{
|
|
1574
1576
|
gridArea: m,
|
|
1575
1577
|
width: a ?? "100%",
|
|
1576
1578
|
visible: t ?? !0,
|
|
1577
1579
|
...r,
|
|
1578
|
-
children: /* @__PURE__ */
|
|
1580
|
+
children: /* @__PURE__ */ b("div", { className: "rmap-progress-container", children: [
|
|
1579
1581
|
d && /* @__PURE__ */ c(dr, { isActive: o }),
|
|
1580
|
-
u && /* @__PURE__ */ c(
|
|
1582
|
+
u && /* @__PURE__ */ c(sr, {})
|
|
1581
1583
|
] })
|
|
1582
1584
|
}
|
|
1583
1585
|
);
|
|
1584
|
-
},
|
|
1585
|
-
|
|
1586
|
+
}, ie = K(null);
|
|
1587
|
+
ie.displayName = "DropdownContext";
|
|
1586
1588
|
const Tt = ({
|
|
1587
1589
|
clickArea: e,
|
|
1588
1590
|
triggerType: t,
|
|
@@ -1590,19 +1592,19 @@ const Tt = ({
|
|
|
1590
1592
|
setIsOpen: a,
|
|
1591
1593
|
onOpenChange: r
|
|
1592
1594
|
}) => {
|
|
1593
|
-
const
|
|
1595
|
+
const s = P(), i = (l) => {
|
|
1594
1596
|
const m = () => {
|
|
1595
|
-
clearTimeout(
|
|
1597
|
+
clearTimeout(s.current), s.current = void 0;
|
|
1596
1598
|
}, p = (v) => {
|
|
1597
1599
|
a(v), r && r(v), m();
|
|
1598
1600
|
};
|
|
1599
1601
|
if (m(), l) {
|
|
1600
|
-
|
|
1602
|
+
s.current = window.setTimeout(() => p(!0), 100);
|
|
1601
1603
|
return;
|
|
1602
1604
|
}
|
|
1603
|
-
|
|
1605
|
+
s.current = window.setTimeout(() => p(!1), 100);
|
|
1604
1606
|
}, o = (l) => {
|
|
1605
|
-
t === "hover" &&
|
|
1607
|
+
t === "hover" && i(l);
|
|
1606
1608
|
};
|
|
1607
1609
|
return {
|
|
1608
1610
|
onClick: e === "content" ? (l) => {
|
|
@@ -1616,50 +1618,50 @@ const Tt = ({
|
|
|
1616
1618
|
onFocus: () => o(!0),
|
|
1617
1619
|
onBlur: () => o(!1)
|
|
1618
1620
|
};
|
|
1619
|
-
},
|
|
1621
|
+
}, W = ({
|
|
1620
1622
|
triggerType: e = "click",
|
|
1621
1623
|
outboundClickActive: t = !0,
|
|
1622
1624
|
children: n,
|
|
1623
1625
|
isOpen: a,
|
|
1624
1626
|
placement: r = "bottom",
|
|
1625
|
-
disabled:
|
|
1626
|
-
onOpenChange:
|
|
1627
|
+
disabled: s = !1,
|
|
1628
|
+
onOpenChange: i,
|
|
1627
1629
|
"data-testid": o
|
|
1628
1630
|
}) => {
|
|
1629
|
-
const u =
|
|
1631
|
+
const u = P(null), [d, l] = te.Children.toArray(n), [m, p] = N(!1), v = Tt({
|
|
1630
1632
|
setIsOpen: p,
|
|
1631
1633
|
isOpen: m,
|
|
1632
1634
|
triggerType: e,
|
|
1633
1635
|
clickArea: "root"
|
|
1634
1636
|
}), f = $e();
|
|
1635
|
-
dt(u, () => t && p(!1)),
|
|
1637
|
+
dt(u, () => t && p(!1)), A(() => {
|
|
1636
1638
|
a !== void 0 && p(a);
|
|
1637
1639
|
}, [a]);
|
|
1638
|
-
const y =
|
|
1640
|
+
const y = C(
|
|
1639
1641
|
() => ({
|
|
1640
1642
|
dropdownRef: u,
|
|
1641
1643
|
placement: r,
|
|
1642
1644
|
isOpen: m,
|
|
1643
1645
|
setIsOpen: p,
|
|
1644
|
-
onOpenChange:
|
|
1646
|
+
onOpenChange: i,
|
|
1645
1647
|
dropdownId: f
|
|
1646
1648
|
}),
|
|
1647
|
-
[r, m,
|
|
1649
|
+
[r, m, i, f]
|
|
1648
1650
|
);
|
|
1649
|
-
return /* @__PURE__ */ c(
|
|
1651
|
+
return /* @__PURE__ */ c(ie.Provider, { value: y, children: /* @__PURE__ */ c(
|
|
1650
1652
|
"div",
|
|
1651
1653
|
{
|
|
1652
1654
|
className: "rmap-dropdown-container",
|
|
1653
1655
|
ref: u,
|
|
1654
1656
|
"data-testid": o,
|
|
1655
1657
|
...v,
|
|
1656
|
-
children: /* @__PURE__ */
|
|
1658
|
+
children: /* @__PURE__ */ b(G, { children: [
|
|
1657
1659
|
d,
|
|
1658
|
-
!
|
|
1660
|
+
!s && l
|
|
1659
1661
|
] })
|
|
1660
1662
|
}
|
|
1661
1663
|
) });
|
|
1662
|
-
}, pr = (e, t) =>
|
|
1664
|
+
}, pr = (e, t) => C(() => {
|
|
1663
1665
|
if (t)
|
|
1664
1666
|
return {
|
|
1665
1667
|
position: "absolute",
|
|
@@ -1675,12 +1677,12 @@ const Tt = ({
|
|
|
1675
1677
|
isWithAnimation: t = !0,
|
|
1676
1678
|
...n
|
|
1677
1679
|
}) => {
|
|
1678
|
-
const { dropdownRef: a, placement: r, isOpen:
|
|
1679
|
-
setIsOpen:
|
|
1680
|
-
isOpen:
|
|
1680
|
+
const { dropdownRef: a, placement: r, isOpen: s, setIsOpen: i, dropdownId: o } = E(ie), [u, d] = N(), { onClick: l } = Tt({
|
|
1681
|
+
setIsOpen: i,
|
|
1682
|
+
isOpen: s,
|
|
1681
1683
|
clickArea: "content"
|
|
1682
|
-
}), m = () =>
|
|
1683
|
-
|
|
1684
|
+
}), m = () => i(!1), p = () => i(!0);
|
|
1685
|
+
A(() => {
|
|
1684
1686
|
a.current && d({
|
|
1685
1687
|
width: a.current.offsetWidth,
|
|
1686
1688
|
height: a.current.offsetHeight
|
|
@@ -1699,7 +1701,7 @@ const Tt = ({
|
|
|
1699
1701
|
return t ? /* @__PURE__ */ c(
|
|
1700
1702
|
Ce,
|
|
1701
1703
|
{
|
|
1702
|
-
visible:
|
|
1704
|
+
visible: s,
|
|
1703
1705
|
name: "rmap-dropdown-content",
|
|
1704
1706
|
enterTime: 20,
|
|
1705
1707
|
leaveTime: 60,
|
|
@@ -1708,38 +1710,38 @@ const Tt = ({
|
|
|
1708
1710
|
onEntered: p,
|
|
1709
1711
|
children: f
|
|
1710
1712
|
}
|
|
1711
|
-
) :
|
|
1713
|
+
) : s ? f : null;
|
|
1712
1714
|
}, ht = Pe(({ children: e, className: t, ...n }, a) => {
|
|
1713
|
-
const { isOpen: r, dropdownId:
|
|
1715
|
+
const { isOpen: r, dropdownId: s } = E(ie), i = t ? `rmap-dropdown-trigger ${t}` : "rmap-dropdown-trigger";
|
|
1714
1716
|
return /* @__PURE__ */ c(
|
|
1715
1717
|
q,
|
|
1716
1718
|
{
|
|
1717
|
-
className:
|
|
1719
|
+
className: i,
|
|
1718
1720
|
type: "button",
|
|
1719
1721
|
...n,
|
|
1720
1722
|
"aria-haspopup": "true",
|
|
1721
1723
|
"aria-expanded": r,
|
|
1722
|
-
"aria-controls":
|
|
1724
|
+
"aria-controls": s,
|
|
1723
1725
|
ref: a,
|
|
1724
1726
|
children: e
|
|
1725
1727
|
}
|
|
1726
1728
|
);
|
|
1727
1729
|
});
|
|
1728
1730
|
ht.displayName = "DropdownTrigger";
|
|
1729
|
-
|
|
1730
|
-
|
|
1731
|
+
W.Content = mr;
|
|
1732
|
+
W.Trigger = ht;
|
|
1731
1733
|
const yr = ({
|
|
1732
1734
|
triggerRef: e,
|
|
1733
1735
|
initialState: t
|
|
1734
1736
|
}) => {
|
|
1735
|
-
const { playerPlacement: n } =
|
|
1736
|
-
return
|
|
1737
|
+
const { playerPlacement: n } = x(), [a, r] = N(t);
|
|
1738
|
+
return A(() => {
|
|
1737
1739
|
if (e.current) {
|
|
1738
|
-
const
|
|
1739
|
-
r(
|
|
1740
|
+
const s = () => e.current.getBoundingClientRect().top < window.innerHeight / 2 ? "bottom" : "top", i = setTimeout(() => {
|
|
1741
|
+
r(s());
|
|
1740
1742
|
}, 0);
|
|
1741
1743
|
return () => {
|
|
1742
|
-
clearTimeout(
|
|
1744
|
+
clearTimeout(i);
|
|
1743
1745
|
};
|
|
1744
1746
|
}
|
|
1745
1747
|
}, [n, e]), a;
|
|
@@ -1750,14 +1752,14 @@ const yr = ({
|
|
|
1750
1752
|
triggerRef: a,
|
|
1751
1753
|
defaults: r
|
|
1752
1754
|
}) => {
|
|
1753
|
-
const
|
|
1755
|
+
const s = yr({
|
|
1754
1756
|
triggerRef: a,
|
|
1755
1757
|
initialState: r.placement
|
|
1756
|
-
}),
|
|
1758
|
+
}), i = e ?? r.triggerType;
|
|
1757
1759
|
return {
|
|
1758
|
-
triggerType:
|
|
1759
|
-
placement: t ?? n ??
|
|
1760
|
-
contentRole:
|
|
1760
|
+
triggerType: i,
|
|
1761
|
+
placement: t ?? n ?? s,
|
|
1762
|
+
contentRole: i === "hover" ? "tooltip" : "dialog"
|
|
1761
1763
|
};
|
|
1762
1764
|
}, vr = [
|
|
1763
1765
|
0.5,
|
|
@@ -1767,77 +1769,91 @@ const yr = ({
|
|
|
1767
1769
|
1.5,
|
|
1768
1770
|
1.75,
|
|
1769
1771
|
2
|
|
1770
|
-
], fr = (e) => `${e}×`,
|
|
1772
|
+
], fr = (e) => `${e}×`, Tr = ({
|
|
1773
|
+
rateOptions: e,
|
|
1774
|
+
playbackRate: t,
|
|
1775
|
+
formatRateLabel: n
|
|
1776
|
+
}) => {
|
|
1777
|
+
const a = E(w), { setIsOpen: r } = E(ie), s = g(
|
|
1778
|
+
(i) => {
|
|
1779
|
+
const o = Number(i.currentTarget.dataset.rate);
|
|
1780
|
+
a({ type: "SET_PLAYBACK_RATE", playbackRate: o }), r(!1);
|
|
1781
|
+
},
|
|
1782
|
+
[a, r]
|
|
1783
|
+
);
|
|
1784
|
+
return /* @__PURE__ */ c(
|
|
1785
|
+
"div",
|
|
1786
|
+
{
|
|
1787
|
+
role: "group",
|
|
1788
|
+
"aria-label": "Playback speed",
|
|
1789
|
+
className: "rmap-speed-selector-menu",
|
|
1790
|
+
children: e.map((i) => {
|
|
1791
|
+
const o = i === t;
|
|
1792
|
+
return /* @__PURE__ */ c(
|
|
1793
|
+
"button",
|
|
1794
|
+
{
|
|
1795
|
+
type: "button",
|
|
1796
|
+
"aria-pressed": o,
|
|
1797
|
+
className: o ? "rmap-speed-selector-option rmap-speed-selector-option--active" : "rmap-speed-selector-option",
|
|
1798
|
+
"data-testid": "speed-selector-option",
|
|
1799
|
+
"data-rate": i,
|
|
1800
|
+
onClick: s,
|
|
1801
|
+
children: n(i)
|
|
1802
|
+
},
|
|
1803
|
+
i
|
|
1804
|
+
);
|
|
1805
|
+
})
|
|
1806
|
+
}
|
|
1807
|
+
);
|
|
1808
|
+
}, _e = z(
|
|
1771
1809
|
function({
|
|
1772
1810
|
gridArea: t,
|
|
1773
1811
|
visible: n,
|
|
1774
1812
|
options: a,
|
|
1775
1813
|
formatRate: r,
|
|
1776
|
-
triggerType:
|
|
1777
|
-
placement:
|
|
1814
|
+
triggerType: s,
|
|
1815
|
+
placement: i,
|
|
1778
1816
|
...o
|
|
1779
1817
|
}) {
|
|
1780
|
-
const u =
|
|
1781
|
-
|
|
1782
|
-
|
|
1783
|
-
|
|
1784
|
-
placement: s,
|
|
1785
|
-
contextPlacement: m,
|
|
1818
|
+
const u = P(null), { playbackRate: d } = k(), { speedSelectorPlacement: l } = x(), m = B("playbackRate", t), p = a ?? vr, v = r ?? fr, { triggerType: f, placement: y } = gt({
|
|
1819
|
+
triggerType: s,
|
|
1820
|
+
placement: i,
|
|
1821
|
+
contextPlacement: l,
|
|
1786
1822
|
triggerRef: u,
|
|
1787
1823
|
defaults: { triggerType: "click", placement: "top" }
|
|
1788
|
-
})
|
|
1789
|
-
(g) => {
|
|
1790
|
-
l({ type: "SET_PLAYBACK_RATE", playbackRate: g });
|
|
1791
|
-
},
|
|
1792
|
-
[l]
|
|
1793
|
-
);
|
|
1824
|
+
});
|
|
1794
1825
|
return /* @__PURE__ */ c(
|
|
1795
|
-
|
|
1826
|
+
M.Item,
|
|
1796
1827
|
{
|
|
1797
|
-
gridArea:
|
|
1828
|
+
gridArea: m,
|
|
1798
1829
|
visible: n ?? !0,
|
|
1830
|
+
padding: "0",
|
|
1799
1831
|
...o,
|
|
1800
|
-
children: /* @__PURE__ */
|
|
1801
|
-
|
|
1832
|
+
children: /* @__PURE__ */ b(
|
|
1833
|
+
W,
|
|
1802
1834
|
{
|
|
1803
|
-
triggerType:
|
|
1804
|
-
placement:
|
|
1835
|
+
triggerType: f,
|
|
1836
|
+
placement: y,
|
|
1805
1837
|
"data-testid": "speed-selector-dropdown",
|
|
1806
1838
|
children: [
|
|
1807
1839
|
/* @__PURE__ */ c(
|
|
1808
|
-
|
|
1840
|
+
W.Trigger,
|
|
1809
1841
|
{
|
|
1810
1842
|
ref: u,
|
|
1811
|
-
"aria-label": `Playback speed, currently ${
|
|
1843
|
+
"aria-label": `Playback speed, currently ${v(
|
|
1812
1844
|
d
|
|
1813
1845
|
)}`,
|
|
1814
1846
|
className: "rmap-speed-selector-trigger",
|
|
1815
1847
|
"data-testid": "speed-selector-trigger",
|
|
1816
|
-
children:
|
|
1848
|
+
children: v(d)
|
|
1817
1849
|
}
|
|
1818
1850
|
),
|
|
1819
|
-
/* @__PURE__ */ c(
|
|
1820
|
-
|
|
1851
|
+
/* @__PURE__ */ c(W.Content, { children: /* @__PURE__ */ c(
|
|
1852
|
+
Tr,
|
|
1821
1853
|
{
|
|
1822
|
-
|
|
1823
|
-
|
|
1824
|
-
|
|
1825
|
-
children: v.map((g) => {
|
|
1826
|
-
const C = g === d;
|
|
1827
|
-
return /* @__PURE__ */ c("li", { role: "none", children: /* @__PURE__ */ c(
|
|
1828
|
-
"button",
|
|
1829
|
-
{
|
|
1830
|
-
type: "button",
|
|
1831
|
-
role: "menuitemradio",
|
|
1832
|
-
"aria-checked": C,
|
|
1833
|
-
className: C ? "rmap-speed-selector-option rmap-speed-selector-option--active" : "rmap-speed-selector-option",
|
|
1834
|
-
"data-testid": "speed-selector-option",
|
|
1835
|
-
"data-rate": g,
|
|
1836
|
-
onClick: () => h(g),
|
|
1837
|
-
children: f(g)
|
|
1838
|
-
}
|
|
1839
|
-
) }, g);
|
|
1840
|
-
})
|
|
1854
|
+
rateOptions: p,
|
|
1855
|
+
playbackRate: d,
|
|
1856
|
+
formatRateLabel: v
|
|
1841
1857
|
}
|
|
1842
1858
|
) })
|
|
1843
1859
|
]
|
|
@@ -1848,21 +1864,21 @@ const yr = ({
|
|
|
1848
1864
|
}
|
|
1849
1865
|
);
|
|
1850
1866
|
_e.displayName = "SpeedSelector";
|
|
1851
|
-
const
|
|
1867
|
+
const hr = ({
|
|
1852
1868
|
placement: e
|
|
1853
1869
|
}) => {
|
|
1854
1870
|
var m;
|
|
1855
|
-
const t =
|
|
1871
|
+
const t = P(null), { volume: n, muted: a } = k(), { elementRefs: r } = L(), s = E(w), i = g(
|
|
1856
1872
|
(p) => {
|
|
1857
|
-
p.stopPropagation(), p.preventDefault(), a &&
|
|
1873
|
+
p.stopPropagation(), p.preventDefault(), a && s({ type: "SET_MUTED", muted: !1 });
|
|
1858
1874
|
const { value: v } = p.target, f = parseFloat(v);
|
|
1859
|
-
|
|
1875
|
+
s({
|
|
1860
1876
|
type: "SET_VOLUME",
|
|
1861
1877
|
volume: f
|
|
1862
1878
|
});
|
|
1863
1879
|
},
|
|
1864
|
-
[a,
|
|
1865
|
-
), o = n ?? ((m = r == null ? void 0 : r.audioEl) == null ? void 0 : m.volume) ?? 0, u = o * 100, d = Math.round(u), l =
|
|
1880
|
+
[a, s]
|
|
1881
|
+
), o = n ?? ((m = r == null ? void 0 : r.audioEl) == null ? void 0 : m.volume) ?? 0, u = o * 100, d = Math.round(u), l = C(
|
|
1866
1882
|
() => ({
|
|
1867
1883
|
"--rm-audio-player-volume-value": `${u}%`
|
|
1868
1884
|
}),
|
|
@@ -1883,7 +1899,7 @@ const Tr = ({
|
|
|
1883
1899
|
type: "range",
|
|
1884
1900
|
style: { cursor: "pointer" },
|
|
1885
1901
|
value: o,
|
|
1886
|
-
onChange:
|
|
1902
|
+
onChange: i,
|
|
1887
1903
|
min: "0",
|
|
1888
1904
|
max: "1",
|
|
1889
1905
|
step: "0.01",
|
|
@@ -1900,13 +1916,13 @@ const Tr = ({
|
|
|
1900
1916
|
placement: a,
|
|
1901
1917
|
...r
|
|
1902
1918
|
}) => {
|
|
1903
|
-
const
|
|
1904
|
-
() => o({ type: "SET_MUTED", muted: !
|
|
1905
|
-
[o,
|
|
1919
|
+
const s = P(null), { muted: i } = k(), o = E(w), u = g(
|
|
1920
|
+
() => o({ type: "SET_MUTED", muted: !i }),
|
|
1921
|
+
[o, i]
|
|
1906
1922
|
), {
|
|
1907
1923
|
activeUI: { volumeSlider: d },
|
|
1908
1924
|
volumeSliderPlacement: l
|
|
1909
|
-
} =
|
|
1925
|
+
} = x(), m = B("volume", e), {
|
|
1910
1926
|
triggerType: p,
|
|
1911
1927
|
placement: v,
|
|
1912
1928
|
contentRole: f
|
|
@@ -1914,11 +1930,11 @@ const Tr = ({
|
|
|
1914
1930
|
triggerType: n,
|
|
1915
1931
|
placement: a,
|
|
1916
1932
|
contextPlacement: l,
|
|
1917
|
-
triggerRef:
|
|
1933
|
+
triggerRef: s,
|
|
1918
1934
|
defaults: { triggerType: "hover", placement: "bottom" }
|
|
1919
1935
|
});
|
|
1920
|
-
return /* @__PURE__ */ c(
|
|
1921
|
-
|
|
1936
|
+
return /* @__PURE__ */ c(M.Item, { gridArea: m, visible: t ?? !0, ...r, children: /* @__PURE__ */ b(
|
|
1937
|
+
W,
|
|
1922
1938
|
{
|
|
1923
1939
|
placement: v,
|
|
1924
1940
|
triggerType: p,
|
|
@@ -1926,25 +1942,25 @@ const Tr = ({
|
|
|
1926
1942
|
"data-testid": "volume-dropdown",
|
|
1927
1943
|
children: [
|
|
1928
1944
|
/* @__PURE__ */ c(
|
|
1929
|
-
|
|
1945
|
+
W.Trigger,
|
|
1930
1946
|
{
|
|
1931
|
-
ref:
|
|
1932
|
-
"aria-label":
|
|
1933
|
-
"aria-pressed":
|
|
1947
|
+
ref: s,
|
|
1948
|
+
"aria-label": i ? "Unmute" : "Mute",
|
|
1949
|
+
"aria-pressed": i,
|
|
1934
1950
|
onClick: u,
|
|
1935
1951
|
className: "rmap-volume-trigger",
|
|
1936
1952
|
"data-testid": "volume-trigger-btn",
|
|
1937
|
-
"data-muted": String(
|
|
1953
|
+
"data-muted": String(i),
|
|
1938
1954
|
children: /* @__PURE__ */ c(ut, {})
|
|
1939
1955
|
}
|
|
1940
1956
|
),
|
|
1941
|
-
/* @__PURE__ */ c(
|
|
1957
|
+
/* @__PURE__ */ c(W.Content, { role: f, children: /* @__PURE__ */ c(hr, { placement: v }) })
|
|
1942
1958
|
]
|
|
1943
1959
|
}
|
|
1944
1960
|
) });
|
|
1945
|
-
},
|
|
1946
|
-
const { activeUI: e } =
|
|
1947
|
-
return /* @__PURE__ */
|
|
1961
|
+
}, gr = () => {
|
|
1962
|
+
const { activeUI: e } = x(), t = (n) => !!(e[n] ?? e.all);
|
|
1963
|
+
return /* @__PURE__ */ b(G, { children: [
|
|
1948
1964
|
/* @__PURE__ */ c(ft, { visible: t("progress") }),
|
|
1949
1965
|
/* @__PURE__ */ c(lt, { visible: t("repeatType") }),
|
|
1950
1966
|
/* @__PURE__ */ c(ct, { visible: t("playButton") }),
|
|
@@ -1957,14 +1973,14 @@ const Tr = ({
|
|
|
1957
1973
|
visible: n,
|
|
1958
1974
|
...a
|
|
1959
1975
|
}) {
|
|
1960
|
-
const { playList: r, curIdx:
|
|
1961
|
-
return /* @__PURE__ */ c(
|
|
1976
|
+
const { playList: r, curIdx: s } = $(), { coverImgsCss: i } = L(), o = r[s], u = [o == null ? void 0 : o.writer, o == null ? void 0 : o.name].filter(Boolean).join(" - ") || "Album artwork", d = B("artwork", t);
|
|
1977
|
+
return /* @__PURE__ */ c(M.Item, { gridArea: d, visible: n ?? !0, ...a, children: /* @__PURE__ */ c("div", { className: "rmap-artwork-container", children: o != null && o.img ? /* @__PURE__ */ c("img", { src: o.img, alt: u, style: i == null ? void 0 : i.artwork }) : /* @__PURE__ */ c(
|
|
1962
1978
|
"div",
|
|
1963
1979
|
{
|
|
1964
1980
|
className: "rmap-artwork-fallback",
|
|
1965
1981
|
role: "img",
|
|
1966
1982
|
"aria-label": u,
|
|
1967
|
-
style:
|
|
1983
|
+
style: i == null ? void 0 : i.artwork,
|
|
1968
1984
|
children: (o == null ? void 0 : o.name) || "♪"
|
|
1969
1985
|
}
|
|
1970
1986
|
) }) });
|
|
@@ -1973,10 +1989,10 @@ const Tr = ({
|
|
|
1973
1989
|
visible: n,
|
|
1974
1990
|
...a
|
|
1975
1991
|
}) {
|
|
1976
|
-
const { playList: r, curIdx:
|
|
1977
|
-
return /* @__PURE__ */ c(
|
|
1978
|
-
(
|
|
1979
|
-
(
|
|
1992
|
+
const { playList: r, curIdx: s } = $(), i = r[s], o = B("trackInfo", t);
|
|
1993
|
+
return /* @__PURE__ */ c(M.Item, { gridArea: o, visible: n ?? !0, ...a, children: /* @__PURE__ */ c("div", { className: "rmap-track-info-container", children: i != null && i.customTrackInfo ? i.customTrackInfo : /* @__PURE__ */ b(G, { children: [
|
|
1994
|
+
(i == null ? void 0 : i.name) && /* @__PURE__ */ c("span", { className: "title", "data-testid": "track-title", children: i.name }),
|
|
1995
|
+
(i == null ? void 0 : i.writer) && /* @__PURE__ */ c("span", { className: "writer", children: i.writer })
|
|
1980
1996
|
] }) }) });
|
|
1981
1997
|
});
|
|
1982
1998
|
De.displayName = "TrackInfo";
|
|
@@ -1988,7 +2004,7 @@ const Pt = ({ position: e, className: t, children: n, ...a }) => /* @__PURE__ */
|
|
|
1988
2004
|
...a,
|
|
1989
2005
|
children: n
|
|
1990
2006
|
}
|
|
1991
|
-
),
|
|
2007
|
+
), Er = ({ position: e }) => {
|
|
1992
2008
|
const { currentTime: t } = re();
|
|
1993
2009
|
return /* @__PURE__ */ c(Pt, { position: e, className: "rmap-track-time-current", children: /* @__PURE__ */ c(
|
|
1994
2010
|
"span",
|
|
@@ -1998,7 +2014,7 @@ const Pt = ({ position: e, className: t, children: n, ...a }) => /* @__PURE__ */
|
|
|
1998
2014
|
children: ee(t)
|
|
1999
2015
|
}
|
|
2000
2016
|
) });
|
|
2001
|
-
},
|
|
2017
|
+
}, Ar = ({ position: e }) => {
|
|
2002
2018
|
const { duration: t } = re();
|
|
2003
2019
|
return /* @__PURE__ */ c(
|
|
2004
2020
|
Pt,
|
|
@@ -2009,10 +2025,10 @@ const Pt = ({ position: e, className: t, children: n, ...a }) => /* @__PURE__ */
|
|
|
2009
2025
|
}
|
|
2010
2026
|
);
|
|
2011
2027
|
}, St = ({ visible: e }) => {
|
|
2012
|
-
const t = B("trackTimeCurrent"), n = B("trackTimeDuration"), a =
|
|
2028
|
+
const t = B("trackTimeCurrent"), n = B("trackTimeDuration"), a = g(
|
|
2013
2029
|
(d) => +d.split(/[^\d]/).join(""),
|
|
2014
2030
|
[]
|
|
2015
|
-
), r = a(t),
|
|
2031
|
+
), r = a(t), s = a(n), i = g(
|
|
2016
2032
|
(d) => {
|
|
2017
2033
|
switch (d) {
|
|
2018
2034
|
case 1:
|
|
@@ -2025,17 +2041,17 @@ const Pt = ({ position: e, className: t, children: n, ...a }) => /* @__PURE__ */
|
|
|
2025
2041
|
},
|
|
2026
2042
|
[]
|
|
2027
2043
|
), o = {
|
|
2028
|
-
current:
|
|
2029
|
-
duration: s
|
|
2044
|
+
current: i(r - s),
|
|
2045
|
+
duration: i(s - r)
|
|
2030
2046
|
}, u = e ?? !0;
|
|
2031
|
-
return /* @__PURE__ */
|
|
2032
|
-
/* @__PURE__ */ c(
|
|
2033
|
-
/* @__PURE__ */ c(
|
|
2047
|
+
return /* @__PURE__ */ b(G, { children: [
|
|
2048
|
+
/* @__PURE__ */ c(M.Item, { gridArea: t, visible: u, children: /* @__PURE__ */ c(Er, { position: o.current }) }),
|
|
2049
|
+
/* @__PURE__ */ c(M.Item, { gridArea: n, visible: u, children: /* @__PURE__ */ c(Ar, { position: o.duration }) })
|
|
2034
2050
|
] });
|
|
2035
|
-
},
|
|
2036
|
-
var r,
|
|
2037
|
-
const { playList: e, curIdx: t } = $(), { activeUI: n } =
|
|
2038
|
-
return /* @__PURE__ */
|
|
2051
|
+
}, Pr = () => {
|
|
2052
|
+
var r, s, i, o;
|
|
2053
|
+
const { playList: e, curIdx: t } = $(), { activeUI: n } = x(), a = !!(((r = e[t]) == null ? void 0 : r.customTrackInfo) ?? ((s = e[t]) == null ? void 0 : s.writer) ?? ((i = e[t]) == null ? void 0 : i.name)) && !!(n.trackInfo ?? n.all);
|
|
2054
|
+
return /* @__PURE__ */ b(G, { children: [
|
|
2039
2055
|
/* @__PURE__ */ c(
|
|
2040
2056
|
At,
|
|
2041
2057
|
{
|
|
@@ -2056,7 +2072,7 @@ const Pt = ({ position: e, className: t, children: n, ...a }) => /* @__PURE__ */
|
|
|
2056
2072
|
TrackTime: { displayName: "TrackTime", activeUIKey: "trackTime" },
|
|
2057
2073
|
SpeedSelector: { displayName: "SpeedSelector", activeUIKey: "playbackRate" }
|
|
2058
2074
|
};
|
|
2059
|
-
function
|
|
2075
|
+
function Sr(e, t) {
|
|
2060
2076
|
const n = e[t];
|
|
2061
2077
|
return n === !1 ? !1 : n !== void 0 ? !0 : !!e.all;
|
|
2062
2078
|
}
|
|
@@ -2066,53 +2082,53 @@ function Re(e) {
|
|
|
2066
2082
|
const n = t.type ?? t;
|
|
2067
2083
|
return n.displayName || n.name || void 0;
|
|
2068
2084
|
}
|
|
2069
|
-
const
|
|
2070
|
-
const r =
|
|
2085
|
+
const Ir = (e, t, n, a) => {
|
|
2086
|
+
const r = C(
|
|
2071
2087
|
() => (a ?? []).map(Re).map(
|
|
2072
2088
|
(h) => {
|
|
2073
|
-
var
|
|
2074
|
-
return h ? (
|
|
2089
|
+
var S;
|
|
2090
|
+
return h ? (S = Ae[h]) == null ? void 0 : S.activeUIKey : void 0;
|
|
2075
2091
|
}
|
|
2076
2092
|
).filter((h) => h !== void 0),
|
|
2077
2093
|
[a]
|
|
2078
|
-
),
|
|
2094
|
+
), s = C(
|
|
2079
2095
|
() => [...r].sort().join(","),
|
|
2080
2096
|
[r]
|
|
2081
|
-
),
|
|
2082
|
-
(h,
|
|
2083
|
-
const
|
|
2084
|
-
|
|
2085
|
-
).filter((I) => (I === "trackTimeCurrent" || I === "trackTimeDuration") && h.trackTime === !1 ? !1 : h[I] !== void 0 ? h[I] : !0), R = h.all ?
|
|
2086
|
-
for (const I of
|
|
2097
|
+
), i = g(
|
|
2098
|
+
(h, S, D, j) => {
|
|
2099
|
+
const ce = Object.keys(
|
|
2100
|
+
pe.templateArea
|
|
2101
|
+
).filter((I) => (I === "trackTimeCurrent" || I === "trackTimeDuration") && h.trackTime === !1 ? !1 : h[I] !== void 0 ? h[I] : !0), R = h.all ? ce : Object.entries(h).filter(([, I]) => I).map(([I]) => I);
|
|
2102
|
+
for (const I of j)
|
|
2087
2103
|
R.includes(I) || R.push(I);
|
|
2088
2104
|
(() => {
|
|
2089
2105
|
R.find((I) => I === "trackTime") && (R.splice(R.indexOf("trackTime"), 1), R.push("trackTimeCurrent"), R.push("trackTimeDuration"));
|
|
2090
2106
|
})();
|
|
2091
2107
|
const ae = {
|
|
2092
|
-
...
|
|
2093
|
-
...
|
|
2108
|
+
...pe.templateArea,
|
|
2109
|
+
...S
|
|
2094
2110
|
}, ye = Object.entries(
|
|
2095
2111
|
ae
|
|
2096
2112
|
).filter(([I]) => R.includes(I));
|
|
2097
|
-
let
|
|
2098
|
-
const
|
|
2113
|
+
let ue = 1;
|
|
2114
|
+
const de = {}, bt = [
|
|
2099
2115
|
...ye,
|
|
2100
|
-
...Object.entries(
|
|
2116
|
+
...Object.entries(D || {})
|
|
2101
2117
|
].flatMap(([I, U]) => {
|
|
2102
2118
|
if (U == null) return [];
|
|
2103
2119
|
const [F, H] = U.split("-"), Y = +F.split("row")[1];
|
|
2104
|
-
return
|
|
2120
|
+
return ue = Math.max(ue, Y), de[Y] = de[Y] ? de[Y] + 1 : 1, [
|
|
2105
2121
|
{
|
|
2106
2122
|
key: I,
|
|
2107
2123
|
row: Y,
|
|
2108
2124
|
col: +H
|
|
2109
2125
|
}
|
|
2110
2126
|
];
|
|
2111
|
-
}).sort((I, U) => I.col - U.col), ve = Math.max(...Object.values(
|
|
2127
|
+
}).sort((I, U) => I.col - U.col), ve = Math.max(...Object.values(de));
|
|
2112
2128
|
let Ue;
|
|
2113
|
-
const
|
|
2129
|
+
const wt = new Array(ue).fill("").map((I, U) => {
|
|
2114
2130
|
let F = "", H;
|
|
2115
|
-
const Y =
|
|
2131
|
+
const Y = bt.filter((V) => V.row !== U + 1 ? !1 : (V.key === "progress" && (H = V), !0));
|
|
2116
2132
|
if (H) {
|
|
2117
2133
|
const V = /* @__PURE__ */ new Map();
|
|
2118
2134
|
Y.forEach((Q) => V.set(Q.col, Q));
|
|
@@ -2127,7 +2143,7 @@ const Sr = (e, t, n, a) => {
|
|
|
2127
2143
|
for (let V = 0; V < ve; V++)
|
|
2128
2144
|
F += ` row${U + 1}-${V + 1}`;
|
|
2129
2145
|
return F.trimStart();
|
|
2130
|
-
}), Lt = pt ? window.innerWidth - 100 : 1500, Nt = new Array(
|
|
2146
|
+
}), Lt = pt ? window.innerWidth - 100 : 1500, Nt = new Array(ue).fill("").map((I, U) => {
|
|
2131
2147
|
let F = "";
|
|
2132
2148
|
for (let H = 0; H < ve; H++) {
|
|
2133
2149
|
if (Ue === H && U === 0) {
|
|
@@ -2138,37 +2154,37 @@ const Sr = (e, t, n, a) => {
|
|
|
2138
2154
|
}
|
|
2139
2155
|
return F.trimStart();
|
|
2140
2156
|
});
|
|
2141
|
-
return { gridAreas:
|
|
2157
|
+
return { gridAreas: wt, gridColumns: Nt };
|
|
2142
2158
|
},
|
|
2143
2159
|
[]
|
|
2144
|
-
), [o, u] = N(e), [d, l] = N(
|
|
2160
|
+
), [o, u] = N(e), [d, l] = N(s), [m, p] = N({
|
|
2145
2161
|
templateArea: t,
|
|
2146
2162
|
customComponentsArea: n
|
|
2147
2163
|
}), [v, f] = N();
|
|
2148
2164
|
if (!v) {
|
|
2149
|
-
const { gridAreas: h, gridColumns:
|
|
2165
|
+
const { gridAreas: h, gridColumns: S } = i(
|
|
2150
2166
|
o,
|
|
2151
2167
|
m.templateArea,
|
|
2152
2168
|
m.customComponentsArea,
|
|
2153
2169
|
r
|
|
2154
2170
|
);
|
|
2155
|
-
return f({ gridAreas: h, gridColumns:
|
|
2171
|
+
return f({ gridAreas: h, gridColumns: S }), [h, S];
|
|
2156
2172
|
}
|
|
2157
|
-
if (o !== e || d !==
|
|
2158
|
-
u(e), l(
|
|
2159
|
-
const { gridAreas: h, gridColumns:
|
|
2173
|
+
if (o !== e || d !== s || m.templateArea !== t || m.customComponentsArea !== n) {
|
|
2174
|
+
u(e), l(s), p({ templateArea: t, customComponentsArea: n });
|
|
2175
|
+
const { gridAreas: h, gridColumns: S } = i(
|
|
2160
2176
|
e,
|
|
2161
2177
|
t,
|
|
2162
2178
|
n,
|
|
2163
2179
|
r
|
|
2164
2180
|
);
|
|
2165
|
-
f({ gridAreas: h, gridColumns:
|
|
2181
|
+
f({ gridAreas: h, gridColumns: S });
|
|
2166
2182
|
}
|
|
2167
2183
|
const { gridAreas: y, gridColumns: T } = v;
|
|
2168
2184
|
return [y, T];
|
|
2169
2185
|
};
|
|
2170
|
-
function
|
|
2171
|
-
return
|
|
2186
|
+
function br(e) {
|
|
2187
|
+
return C(() => {
|
|
2172
2188
|
const t = te.Children.toArray(e).filter(Dt), n = t.find(Be);
|
|
2173
2189
|
return {
|
|
2174
2190
|
compoundChildren: t.filter(
|
|
@@ -2186,26 +2202,26 @@ function wr(e) {
|
|
|
2186
2202
|
const t = e.props;
|
|
2187
2203
|
return (t == null ? void 0 : t.children) ?? null;
|
|
2188
2204
|
}
|
|
2189
|
-
function
|
|
2205
|
+
function Lr({
|
|
2190
2206
|
compoundChildren: e,
|
|
2191
2207
|
activeUI: t
|
|
2192
2208
|
}) {
|
|
2193
2209
|
const n = e.map(Re).filter((a) => !!(a && Ae[a])).sort().join(",");
|
|
2194
|
-
|
|
2210
|
+
A(() => {
|
|
2195
2211
|
if (process.env.NODE_ENV === "production" || !n) return;
|
|
2196
2212
|
const a = /* @__PURE__ */ new Set();
|
|
2197
2213
|
for (const r of n.split(",")) {
|
|
2198
|
-
const
|
|
2199
|
-
|
|
2200
|
-
`[react-modern-audio-player] Both preset and compound '${
|
|
2214
|
+
const s = Ae[r];
|
|
2215
|
+
s && (a.has(s.displayName) || Sr(t, s.activeUIKey) && (a.add(s.displayName), console.warn(
|
|
2216
|
+
`[react-modern-audio-player] Both preset and compound '${s.displayName}' are rendered. Set \`activeUI.${s.activeUIKey}=false\` to replace the preset control.`
|
|
2201
2217
|
)));
|
|
2202
2218
|
}
|
|
2203
2219
|
}, [n, t]);
|
|
2204
2220
|
}
|
|
2205
|
-
const
|
|
2206
|
-
const { interfacePlacement: t, activeUI: n, playListPlacement: a } =
|
|
2207
|
-
|
|
2208
|
-
const [
|
|
2221
|
+
const Nr = ({ children: e }) => {
|
|
2222
|
+
const { interfacePlacement: t, activeUI: n, playListPlacement: a } = x(), { compoundChildren: r, playListEmptyNode: s } = br(e);
|
|
2223
|
+
Lr({ compoundChildren: r, activeUI: n });
|
|
2224
|
+
const [i, o] = Ir(
|
|
2209
2225
|
n,
|
|
2210
2226
|
t == null ? void 0 : t.templateArea,
|
|
2211
2227
|
t == null ? void 0 : t.customComponentsArea,
|
|
@@ -2218,45 +2234,60 @@ const Lr = ({ children: e }) => {
|
|
|
2218
2234
|
"data-testid": "audio-player",
|
|
2219
2235
|
role: "region",
|
|
2220
2236
|
"aria-label": "Audio player",
|
|
2221
|
-
children: /* @__PURE__ */ c(xe.Provider, { value: u, children: /* @__PURE__ */
|
|
2222
|
-
a === "top" && /* @__PURE__ */ c(
|
|
2223
|
-
|
|
2224
|
-
|
|
2237
|
+
children: /* @__PURE__ */ c(xe.Provider, { value: u, children: /* @__PURE__ */ b(Me.Provider, { value: s, children: [
|
|
2238
|
+
a === "top" && /* @__PURE__ */ c(
|
|
2239
|
+
"div",
|
|
2240
|
+
{
|
|
2241
|
+
ref: d,
|
|
2242
|
+
className: "rmap-sortable-playlist",
|
|
2243
|
+
"data-testid": "sortable-playlist"
|
|
2244
|
+
}
|
|
2245
|
+
),
|
|
2246
|
+
/* @__PURE__ */ b(
|
|
2247
|
+
M,
|
|
2225
2248
|
{
|
|
2226
2249
|
alignItems: "center",
|
|
2227
2250
|
justifyContent: "center",
|
|
2228
|
-
areas:
|
|
2251
|
+
areas: i,
|
|
2229
2252
|
minHeight: "30px",
|
|
2230
2253
|
columns: o,
|
|
2231
2254
|
UNSAFE_className: "rmap-interface-grid",
|
|
2255
|
+
"data-testid": "interface-grid",
|
|
2232
2256
|
children: [
|
|
2233
|
-
/* @__PURE__ */ c(
|
|
2234
|
-
/* @__PURE__ */ c(
|
|
2257
|
+
/* @__PURE__ */ c(Pr, {}),
|
|
2258
|
+
/* @__PURE__ */ c(gr, {}),
|
|
2235
2259
|
r
|
|
2236
2260
|
]
|
|
2237
2261
|
}
|
|
2238
2262
|
),
|
|
2239
|
-
a === "bottom" && /* @__PURE__ */ c(
|
|
2263
|
+
a === "bottom" && /* @__PURE__ */ c(
|
|
2264
|
+
"div",
|
|
2265
|
+
{
|
|
2266
|
+
ref: d,
|
|
2267
|
+
className: "rmap-sortable-playlist",
|
|
2268
|
+
"data-testid": "sortable-playlist"
|
|
2269
|
+
}
|
|
2270
|
+
)
|
|
2240
2271
|
] }) })
|
|
2241
2272
|
}
|
|
2242
2273
|
);
|
|
2243
2274
|
}, Z = (e, t) => {
|
|
2244
|
-
const n =
|
|
2245
|
-
|
|
2275
|
+
const n = P(!1);
|
|
2276
|
+
A(() => {
|
|
2246
2277
|
if (n.current)
|
|
2247
2278
|
return e();
|
|
2248
|
-
}, t),
|
|
2279
|
+
}, t), A(() => (n.current = !0, () => {
|
|
2249
2280
|
n.current = !1;
|
|
2250
2281
|
}), []);
|
|
2251
|
-
},
|
|
2282
|
+
}, kr = ({
|
|
2252
2283
|
placement: e = {},
|
|
2253
2284
|
activeUI: t,
|
|
2254
2285
|
coverImgsCss: n,
|
|
2255
2286
|
audioInitialState: a,
|
|
2256
2287
|
playList: r,
|
|
2257
|
-
customIcons:
|
|
2288
|
+
customIcons: s
|
|
2258
2289
|
}) => {
|
|
2259
|
-
const
|
|
2290
|
+
const i = E(w);
|
|
2260
2291
|
Z(() => {
|
|
2261
2292
|
const {
|
|
2262
2293
|
player: o,
|
|
@@ -2264,44 +2295,44 @@ const Lr = ({ children: e }) => {
|
|
|
2264
2295
|
interface: d,
|
|
2265
2296
|
volumeSlider: l
|
|
2266
2297
|
} = e;
|
|
2267
|
-
|
|
2298
|
+
i({
|
|
2268
2299
|
type: "SET_PLACEMENTS",
|
|
2269
2300
|
playerPlacement: o,
|
|
2270
2301
|
playListPlacement: u,
|
|
2271
2302
|
interfacePlacement: d,
|
|
2272
2303
|
volumeSliderPlacement: l
|
|
2273
2304
|
});
|
|
2274
|
-
}, [
|
|
2275
|
-
t &&
|
|
2276
|
-
}, [t,
|
|
2277
|
-
n &&
|
|
2278
|
-
}, [
|
|
2279
|
-
a &&
|
|
2305
|
+
}, [i, e]), Z(() => {
|
|
2306
|
+
t && i({ type: "SET_ACTIVE_UI", activeUI: t });
|
|
2307
|
+
}, [t, i]), Z(() => {
|
|
2308
|
+
n && i({ type: "SET_COVER_IMGS_CSS", coverImgsCss: n });
|
|
2309
|
+
}, [i, n]), Z(() => {
|
|
2310
|
+
a && i({
|
|
2280
2311
|
type: "SET_INITIAL_STATES",
|
|
2281
2312
|
audioState: a,
|
|
2282
2313
|
curPlayId: a.curPlayId
|
|
2283
2314
|
});
|
|
2284
|
-
}, [a,
|
|
2285
|
-
|
|
2286
|
-
}, [
|
|
2287
|
-
|
|
2288
|
-
}, [
|
|
2289
|
-
},
|
|
2315
|
+
}, [a, i]), Z(() => {
|
|
2316
|
+
i({ type: "UPDATE_PLAY_LIST", playList: r });
|
|
2317
|
+
}, [i, r]), Z(() => {
|
|
2318
|
+
s && i({ type: "SET_CUSTOM_ICONS", customIcons: s });
|
|
2319
|
+
}, [s, i]);
|
|
2320
|
+
}, Cr = ({
|
|
2290
2321
|
audioRef: e,
|
|
2291
2322
|
children: t,
|
|
2292
2323
|
...n
|
|
2293
|
-
}) => (
|
|
2324
|
+
}) => (kr(n), /* @__PURE__ */ b("div", { id: "rm-audio-player", className: "rmap-player-container", children: [
|
|
2294
2325
|
/* @__PURE__ */ c(Ye, { audioRef: e }),
|
|
2295
|
-
/* @__PURE__ */ c(
|
|
2326
|
+
/* @__PURE__ */ c(Nr, { children: t })
|
|
2296
2327
|
] }));
|
|
2297
2328
|
function It({
|
|
2298
2329
|
rootContainerProps: e,
|
|
2299
2330
|
...t
|
|
2300
2331
|
}) {
|
|
2301
|
-
return /* @__PURE__ */ c(Bt, { ...t, children: /* @__PURE__ */ c(Ge, { rootContainerProps: e, children: /* @__PURE__ */ c(
|
|
2332
|
+
return /* @__PURE__ */ c(Bt, { ...t, children: /* @__PURE__ */ c(Ge, { rootContainerProps: e, children: /* @__PURE__ */ c(Cr, { ...t }) }) });
|
|
2302
2333
|
}
|
|
2303
2334
|
It.displayName = "AudioPlayerWithProviders";
|
|
2304
|
-
const
|
|
2335
|
+
const Vr = Object.assign(It, {
|
|
2305
2336
|
Progress: ft,
|
|
2306
2337
|
Volume: Et,
|
|
2307
2338
|
PlayList: mt,
|
|
@@ -2313,14 +2344,14 @@ const Kr = Object.assign(It, {
|
|
|
2313
2344
|
TrackInfo: De,
|
|
2314
2345
|
TrackTime: St,
|
|
2315
2346
|
CustomComponent: Gt
|
|
2316
|
-
}),
|
|
2317
|
-
const e =
|
|
2347
|
+
}), xr = () => {
|
|
2348
|
+
const e = E(w), { isPlaying: t, repeatType: n, playbackRate: a } = k(), r = g(() => {
|
|
2318
2349
|
e({ type: "CHANGE_PLAYING_STATE", state: !0 });
|
|
2319
|
-
}, [e]),
|
|
2350
|
+
}, [e]), s = g(() => {
|
|
2320
2351
|
e({ type: "CHANGE_PLAYING_STATE", state: !1 });
|
|
2321
|
-
}, [e]),
|
|
2352
|
+
}, [e]), i = g(() => {
|
|
2322
2353
|
e({ type: "CHANGE_PLAYING_STATE" });
|
|
2323
|
-
}, [e]), o =
|
|
2354
|
+
}, [e]), o = g(
|
|
2324
2355
|
(u) => {
|
|
2325
2356
|
e({ type: "SET_PLAYBACK_RATE", playbackRate: u });
|
|
2326
2357
|
},
|
|
@@ -2331,12 +2362,12 @@ const Kr = Object.assign(It, {
|
|
|
2331
2362
|
repeatType: n,
|
|
2332
2363
|
playbackRate: a,
|
|
2333
2364
|
play: r,
|
|
2334
|
-
pause:
|
|
2335
|
-
togglePlay:
|
|
2365
|
+
pause: s,
|
|
2366
|
+
togglePlay: i,
|
|
2336
2367
|
setPlaybackRate: o
|
|
2337
2368
|
};
|
|
2338
|
-
},
|
|
2339
|
-
const e =
|
|
2369
|
+
}, Mr = () => {
|
|
2370
|
+
const e = E(w), { playList: t, curIdx: n, curPlayId: a } = $(), { elementRefs: r } = L(), s = g(
|
|
2340
2371
|
(u) => {
|
|
2341
2372
|
const d = t[u];
|
|
2342
2373
|
d && e({
|
|
@@ -2346,9 +2377,9 @@ const Kr = Object.assign(It, {
|
|
|
2346
2377
|
});
|
|
2347
2378
|
},
|
|
2348
2379
|
[e, t]
|
|
2349
|
-
),
|
|
2380
|
+
), i = g(() => {
|
|
2350
2381
|
t.length !== 0 && e({ type: "NEXT_AUDIO" });
|
|
2351
|
-
}, [e, t.length]), o =
|
|
2382
|
+
}, [e, t.length]), o = g(() => {
|
|
2352
2383
|
var d;
|
|
2353
2384
|
if (t.length === 0) return;
|
|
2354
2385
|
const u = ((d = r == null ? void 0 : r.audioEl) == null ? void 0 : d.currentTime) ?? 0;
|
|
@@ -2359,30 +2390,30 @@ const Kr = Object.assign(It, {
|
|
|
2359
2390
|
currentIndex: n,
|
|
2360
2391
|
playList: t,
|
|
2361
2392
|
currentTrack: t[n] ?? null,
|
|
2362
|
-
setTrack:
|
|
2363
|
-
next:
|
|
2393
|
+
setTrack: s,
|
|
2394
|
+
next: i,
|
|
2364
2395
|
prev: o
|
|
2365
2396
|
};
|
|
2366
|
-
},
|
|
2367
|
-
const e =
|
|
2368
|
-
(
|
|
2369
|
-
e({ type: "SET_VOLUME", volume:
|
|
2397
|
+
}, _r = () => {
|
|
2398
|
+
const e = E(w), { volume: t, muted: n } = k(), a = g(
|
|
2399
|
+
(s) => {
|
|
2400
|
+
e({ type: "SET_VOLUME", volume: s });
|
|
2370
2401
|
},
|
|
2371
2402
|
[e]
|
|
2372
|
-
), r =
|
|
2403
|
+
), r = g(() => {
|
|
2373
2404
|
e({ type: "SET_MUTED", muted: !n });
|
|
2374
2405
|
}, [e, n]);
|
|
2375
2406
|
return { volume: t, muted: n, setVolume: a, toggleMute: r };
|
|
2376
|
-
},
|
|
2377
|
-
const e =
|
|
2407
|
+
}, Dr = () => {
|
|
2408
|
+
const e = E(w), { currentTime: t, duration: n } = re(), a = g(
|
|
2378
2409
|
(r) => {
|
|
2379
2410
|
e({ type: "SEEK", time: r });
|
|
2380
2411
|
},
|
|
2381
2412
|
[e]
|
|
2382
2413
|
);
|
|
2383
2414
|
return { currentTime: t, duration: n, seek: a };
|
|
2384
|
-
},
|
|
2385
|
-
const e =
|
|
2415
|
+
}, Br = () => {
|
|
2416
|
+
const e = xr(), t = Mr(), n = _r(), a = Dr();
|
|
2386
2417
|
return {
|
|
2387
2418
|
isPlaying: e.isPlaying,
|
|
2388
2419
|
volume: n.volume,
|
|
@@ -2405,7 +2436,7 @@ const Kr = Object.assign(It, {
|
|
|
2405
2436
|
setTrack: t.setTrack,
|
|
2406
2437
|
setPlaybackRate: e.setPlaybackRate
|
|
2407
2438
|
};
|
|
2408
|
-
},
|
|
2439
|
+
}, $r = () => {
|
|
2409
2440
|
const { elementRefs: e } = L();
|
|
2410
2441
|
return {
|
|
2411
2442
|
audioEl: e == null ? void 0 : e.audioEl,
|
|
@@ -2413,31 +2444,31 @@ const Kr = Object.assign(It, {
|
|
|
2413
2444
|
};
|
|
2414
2445
|
};
|
|
2415
2446
|
export {
|
|
2416
|
-
|
|
2447
|
+
Cr as AudioPlayer,
|
|
2417
2448
|
Ge as AudioPlayerContainer,
|
|
2418
2449
|
Bt as AudioPlayerStateProvider,
|
|
2419
2450
|
O as DEFAULT_AUDIO_STATE,
|
|
2420
|
-
|
|
2451
|
+
Kr as DEFAULT_INTERFACE_GRID_BOUND,
|
|
2421
2452
|
Ie as audioAttrsContext,
|
|
2422
|
-
|
|
2453
|
+
w as audioPlayerDispatchContext,
|
|
2423
2454
|
Ot as audioPlayerReducer,
|
|
2424
|
-
|
|
2425
|
-
|
|
2455
|
+
Vr as default,
|
|
2456
|
+
pe as defaultInterfacePlacement,
|
|
2426
2457
|
Se as playbackContext,
|
|
2427
2458
|
Le as resourceContext,
|
|
2428
2459
|
Ne as timeContext,
|
|
2429
|
-
|
|
2430
|
-
|
|
2460
|
+
be as trackContext,
|
|
2461
|
+
we as uiContext,
|
|
2431
2462
|
Kt as useAudioAttrsContext,
|
|
2432
|
-
|
|
2433
|
-
|
|
2434
|
-
|
|
2435
|
-
|
|
2436
|
-
|
|
2437
|
-
|
|
2463
|
+
Br as useAudioPlayer,
|
|
2464
|
+
$r as useAudioPlayerElement,
|
|
2465
|
+
xr as useAudioPlayerPlayback,
|
|
2466
|
+
Dr as useAudioPlayerTime,
|
|
2467
|
+
Mr as useAudioPlayerTrack,
|
|
2468
|
+
_r as useAudioPlayerVolume,
|
|
2438
2469
|
k as usePlaybackContext,
|
|
2439
2470
|
L as useResourceContext,
|
|
2440
2471
|
re as useTimeContext,
|
|
2441
2472
|
$ as useTrackContext,
|
|
2442
|
-
|
|
2473
|
+
x as useUIContext
|
|
2443
2474
|
};
|