react-modern-audio-player 2.2.0 → 2.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (24) hide show
  1. package/README.md +75 -57
  2. package/dist/index.css +1 -1
  3. package/dist/index.es.js +993 -835
  4. package/dist/types/api/useAudioPlayer.d.ts +2 -0
  5. package/dist/types/api/useAudioPlayerPlayback.d.ts +2 -0
  6. package/dist/types/components/AudioPlayer/Context/PlaybackContext.d.ts +1 -0
  7. package/dist/types/components/AudioPlayer/Context/StateContext/audio.d.ts +2 -0
  8. package/dist/types/components/AudioPlayer/Context/StateContext/element.d.ts +1 -0
  9. package/dist/types/components/AudioPlayer/Context/StateContext/index.d.ts +2 -1
  10. package/dist/types/components/AudioPlayer/Context/StateContext/placement.d.ts +7 -5
  11. package/dist/types/components/AudioPlayer/Context/UIContext.d.ts +2 -1
  12. package/dist/types/components/AudioPlayer/Context/dispatchContext.d.ts +5 -2
  13. package/dist/types/components/AudioPlayer/Context/providerProps.d.ts +2 -1
  14. package/dist/types/components/AudioPlayer/Interface/Controller/SpeedSelector/SpeedSelector.d.ts +10 -0
  15. package/dist/types/components/AudioPlayer/Interface/Controller/SpeedSelector/index.d.ts +2 -0
  16. package/dist/types/components/AudioPlayer/Interface/Controller/Tooltip/Volume/index.d.ts +5 -1
  17. package/dist/types/components/AudioPlayer/Interface/hooks/index.d.ts +2 -0
  18. package/dist/types/components/AudioPlayer/Interface/hooks/useDropdownAutoPlacement.d.ts +5 -0
  19. package/dist/types/components/AudioPlayer/Interface/hooks/useResolvedDropdownProps.d.ts +18 -0
  20. package/dist/types/components/AudioPlayer/Player/index.d.ts +2 -2
  21. package/dist/types/components/AudioPlayer/Provider/AudioPlayerStateProvider.d.ts +2 -2
  22. package/dist/types/components/AudioPlayer/index.d.ts +5 -3
  23. package/package.json +1 -1
  24. package/dist/types/components/AudioPlayer/Interface/Controller/Tooltip/Volume/useVolume.d.ts +0 -5
package/dist/index.es.js CHANGED
@@ -1,16 +1,17 @@
1
1
  "use client";
2
2
  import './index.css';
3
- import { jsx as s, Fragment as R, jsxs as w } from "react/jsx-runtime";
4
- import ee, { createContext as O, useContext as he, useReducer as kt, useMemo as k, forwardRef as Pe, useCallback as g, useRef as A, useEffect as P, memo as G, useState as b, useId as Be, useLayoutEffect as Ct, cloneElement as xt, isValidElement as Mt } from "react";
5
- import _t, { flushSync as $e } from "react-dom";
6
- const H = {
3
+ import { jsx as c, Fragment as G, jsxs as w } from "react/jsx-runtime";
4
+ import te, { createContext as K, useContext as he, useReducer as xt, useMemo as x, forwardRef as Pe, useCallback as E, useRef as S, useEffect as P, memo as z, useState as N, useId as $e, useLayoutEffect as Mt, cloneElement as _t, isValidElement as Dt } from "react";
5
+ import Rt, { flushSync as Fe } from "react-dom";
6
+ const O = {
7
7
  isPlaying: !1,
8
8
  volume: 1,
9
9
  muted: !1,
10
10
  repeatType: "ALL",
11
11
  currentTime: 0,
12
- duration: 0
13
- }, _r = 10, de = {
12
+ duration: 0,
13
+ playbackRate: 1
14
+ }, Or = 11, de = {
14
15
  templateArea: {
15
16
  artwork: "row1-1",
16
17
  trackInfo: "row1-2",
@@ -20,17 +21,18 @@ const H = {
20
21
  repeatType: "row1-6",
21
22
  volume: "row1-7",
22
23
  playButton: "row1-8",
23
- playList: "row1-9"
24
+ playList: "row1-9",
25
+ playbackRate: "row1-10"
24
26
  }
25
- }, L = O(null);
26
- L.displayName = "AudioPlayerDispatchContext";
27
- const Fe = (e) => isFinite(e) ? Math.min(Math.max(e, 0), 1) : 1, Oe = (e, t) => Math.round(Math.random() * (t - e) + e), Dt = 1, Ve = (e, t, n) => {
27
+ }, b = K(null);
28
+ b.displayName = "AudioPlayerDispatchContext";
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) => {
28
30
  if (n - t < 1) return e;
29
- let a = Oe(t, n);
31
+ let a = Ke(t, n);
30
32
  for (; a === e; )
31
- a = Oe(t, n);
33
+ a = Ke(t, n);
32
34
  return a;
33
- }, Ut = (e, t) => {
35
+ }, Ot = (e, t) => {
34
36
  switch (t.type) {
35
37
  case "NEXT_AUDIO": {
36
38
  if (e.playList.length === 0) return e;
@@ -78,7 +80,7 @@ const Fe = (e) => isFinite(e) ? Math.min(Math.max(e, 0), 1) : 1, Oe = (e, t) =>
78
80
  };
79
81
  }
80
82
  case "PREV_AUDIO": {
81
- const n = e.playList.length <= 1, a = t.currentTime > Dt, r = e.curAudioState.repeatType === "NONE" && e.curIdx === 0;
83
+ const n = e.playList.length <= 1, a = t.currentTime > Ut, r = e.curAudioState.repeatType === "NONE" && e.curIdx === 0;
82
84
  if (n || a || r)
83
85
  return {
84
86
  ...e,
@@ -86,21 +88,23 @@ const Fe = (e) => isFinite(e) ? Math.min(Math.max(e, 0), 1) : 1, Oe = (e, t) =>
86
88
  curAudioState: { ...e.curAudioState, currentTime: 0 }
87
89
  };
88
90
  if (e.curAudioState.repeatType === "SHUFFLE") {
89
- const o = Ve(
91
+ const s = Ve(
90
92
  e.curIdx,
91
93
  0,
92
94
  e.playList.length - 1
93
95
  );
94
96
  return {
95
97
  ...e,
96
- curPlayId: e.playList[o].id,
97
- curIdx: o,
98
+ audioResetKey: e.audioResetKey + 1,
99
+ curPlayId: e.playList[s].id,
100
+ curIdx: s,
98
101
  curAudioState: { ...e.curAudioState, currentTime: 0 }
99
102
  };
100
103
  }
101
104
  const i = (e.curIdx - 1 + e.playList.length) % e.playList.length;
102
105
  return {
103
106
  ...e,
107
+ audioResetKey: e.audioResetKey + 1,
104
108
  curPlayId: e.playList[i].id,
105
109
  curIdx: i,
106
110
  curAudioState: {
@@ -154,7 +158,15 @@ const Fe = (e) => isFinite(e) ? Math.min(Math.max(e, 0), 1) : 1, Oe = (e, t) =>
154
158
  ...e,
155
159
  curAudioState: {
156
160
  ...e.curAudioState,
157
- volume: Fe(t.volume)
161
+ volume: He(t.volume)
162
+ }
163
+ };
164
+ case "SET_PLAYBACK_RATE":
165
+ return {
166
+ ...e,
167
+ curAudioState: {
168
+ ...e.curAudioState,
169
+ playbackRate: t.playbackRate
158
170
  }
159
171
  };
160
172
  case "SET_AUDIO_STATE":
@@ -247,26 +259,26 @@ const Fe = (e) => isFinite(e) ? Math.min(Math.max(e, 0), 1) : 1, Oe = (e, t) =>
247
259
  default:
248
260
  throw new Error("Unhandled action");
249
261
  }
250
- }, Ae = O(null);
251
- Ae.displayName = "PlaybackContext";
252
- const Ie = O(null);
262
+ }, Se = K(null);
263
+ Se.displayName = "PlaybackContext";
264
+ const Ie = K(null);
253
265
  Ie.displayName = "AudioAttrsContext";
254
- const Se = O(null);
255
- Se.displayName = "TrackContext";
256
- const we = O(null);
257
- we.displayName = "UIContext";
258
- const Le = O(null);
266
+ const we = K(null);
267
+ we.displayName = "TrackContext";
268
+ const be = K(null);
269
+ be.displayName = "UIContext";
270
+ const Le = K(null);
259
271
  Le.displayName = "ResourceContext";
260
- const Ne = O(null);
272
+ const Ne = K(null);
261
273
  Ne.displayName = "TimeContext";
262
- const E = (e) => {
274
+ const A = (e) => {
263
275
  const t = he(e);
264
276
  if (!t) {
265
277
  const n = e.displayName || "Context";
266
278
  throw new Error(`${n} is not provided`);
267
279
  }
268
280
  return t;
269
- }, C = () => E(Ae), te = () => E(Ne), K = () => E(Se), x = () => E(we), N = () => E(Le), Ot = () => E(Ie);
281
+ }, k = () => A(Se), re = () => A(Ne), $ = () => A(we), M = () => A(be), L = () => A(Le), Kt = () => A(Ie);
270
282
  function Vt(e) {
271
283
  const {
272
284
  playList: t,
@@ -274,12 +286,13 @@ function Vt(e) {
274
286
  activeUI: a,
275
287
  placement: r,
276
288
  customIcons: i,
277
- coverImgsCss: o
278
- } = e, c = {
279
- isPlaying: (n == null ? void 0 : n.isPlaying) ?? H.isPlaying,
280
- repeatType: (n == null ? void 0 : n.repeatType) ?? H.repeatType,
281
- volume: typeof (n == null ? void 0 : n.volume) == "number" ? Fe(n.volume) : H.volume,
282
- muted: (n == null ? void 0 : n.muted) ?? H.muted
289
+ coverImgsCss: s
290
+ } = e, o = {
291
+ isPlaying: (n == null ? void 0 : n.isPlaying) ?? O.isPlaying,
292
+ repeatType: (n == null ? void 0 : n.repeatType) ?? O.repeatType,
293
+ volume: typeof (n == null ? void 0 : n.volume) == "number" ? He(n.volume) : O.volume,
294
+ muted: (n == null ? void 0 : n.muted) ?? O.muted,
295
+ playbackRate: (n == null ? void 0 : n.playbackRate) ?? O.playbackRate
283
296
  }, u = a || { playButton: !0 }, d = {
284
297
  playerPlacement: r == null ? void 0 : r.player,
285
298
  playListPlacement: (r == null ? void 0 : r.playList) || "bottom",
@@ -288,35 +301,36 @@ function Vt(e) {
288
301
  playButton: de.templateArea.playButton
289
302
  }
290
303
  },
291
- volumeSliderPlacement: r == null ? void 0 : r.volumeSlider
292
- }, l = t.length === 0, p = n == null ? void 0 : n.curPlayId, m = p == null ? -1 : t.findIndex((y) => y.id === p);
304
+ volumeSliderPlacement: r == null ? void 0 : r.volumeSlider,
305
+ speedSelectorPlacement: r == null ? void 0 : r.speedSelector
306
+ }, l = t.length === 0, m = n == null ? void 0 : n.curPlayId, p = m == null ? -1 : t.findIndex((v) => v.id === m);
293
307
  return {
294
308
  playList: t,
295
- curPlayId: l ? 0 : m >= 0 ? p : t[0].id,
296
- curIdx: l ? -1 : m >= 0 ? m : 0,
297
- curAudioState: c,
309
+ curPlayId: l ? 0 : p >= 0 ? m : t[0].id,
310
+ curIdx: l ? -1 : p >= 0 ? p : 0,
311
+ curAudioState: o,
298
312
  activeUI: u,
299
313
  audioResetKey: 0,
300
314
  seekRequestKey: 0,
301
315
  ...d,
302
316
  customIcons: i,
303
- coverImgsCss: o
317
+ coverImgsCss: s
304
318
  };
305
319
  }
306
- const Kt = ({
320
+ const Bt = ({
307
321
  children: e,
308
322
  colorScheme: t,
309
323
  ...n
310
324
  }) => {
311
- var y, f;
312
- const [a, r] = kt(
313
- Ut,
325
+ var v, f;
326
+ const [a, r] = xt(
327
+ Ot,
314
328
  n,
315
329
  Vt
316
- ), i = k(
330
+ ), i = x(
317
331
  () => ({
318
- currentTime: a.curAudioState.currentTime ?? H.currentTime,
319
- duration: a.curAudioState.duration ?? H.duration,
332
+ currentTime: a.curAudioState.currentTime ?? O.currentTime,
333
+ duration: a.curAudioState.duration ?? O.duration,
320
334
  seekRequestKey: a.seekRequestKey
321
335
  }),
322
336
  [
@@ -324,14 +338,15 @@ const Kt = ({
324
338
  a.curAudioState.duration,
325
339
  a.seekRequestKey
326
340
  ]
327
- ), o = k(
341
+ ), s = x(
328
342
  () => ({
329
- isPlaying: a.curAudioState.isPlaying ?? H.isPlaying,
330
- volume: a.curAudioState.volume ?? H.volume,
331
- muted: a.curAudioState.muted ?? H.muted,
343
+ isPlaying: a.curAudioState.isPlaying ?? O.isPlaying,
344
+ volume: a.curAudioState.volume ?? O.volume,
345
+ muted: a.curAudioState.muted ?? O.muted,
332
346
  repeatType: a.curAudioState.repeatType,
333
347
  isLoadedMetaData: a.curAudioState.isLoadedMetaData,
334
- audioResetKey: a.audioResetKey
348
+ audioResetKey: a.audioResetKey,
349
+ playbackRate: a.curAudioState.playbackRate ?? O.playbackRate
335
350
  }),
336
351
  [
337
352
  a.curAudioState.isPlaying,
@@ -339,22 +354,24 @@ const Kt = ({
339
354
  a.curAudioState.volume,
340
355
  a.curAudioState.muted,
341
356
  a.curAudioState.repeatType,
357
+ a.curAudioState.playbackRate,
342
358
  a.audioResetKey
343
359
  ]
344
- ), c = k(
360
+ ), o = x(
345
361
  () => ({
346
362
  playList: a.playList,
347
363
  curPlayId: a.curPlayId,
348
364
  curIdx: a.curIdx
349
365
  }),
350
366
  [a.playList, a.curPlayId, a.curIdx]
351
- ), { audioInitialState: u } = n, d = u == null ? void 0 : u.playListExpanded, l = k(
367
+ ), { audioInitialState: u } = n, d = u == null ? void 0 : u.playListExpanded, l = x(
352
368
  () => ({
353
369
  activeUI: a.activeUI,
354
370
  playListPlacement: a.playListPlacement,
355
371
  playerPlacement: a.playerPlacement,
356
372
  interfacePlacement: a.interfacePlacement,
357
373
  volumeSliderPlacement: a.volumeSliderPlacement,
374
+ speedSelectorPlacement: a.speedSelectorPlacement,
358
375
  colorScheme: t,
359
376
  playListExpanded: d
360
377
  }),
@@ -364,82 +381,84 @@ const Kt = ({
364
381
  a.playerPlacement,
365
382
  a.interfacePlacement,
366
383
  a.volumeSliderPlacement,
384
+ a.speedSelectorPlacement,
367
385
  t,
368
386
  d
369
387
  ]
370
- ), p = k(() => {
388
+ ), m = x(() => {
371
389
  if (!u) return {};
372
390
  const {
373
- isPlaying: v,
391
+ isPlaying: y,
374
392
  repeatType: T,
375
393
  isLoadedMetaData: h,
376
- currentTime: I,
377
- duration: B,
378
- volume: re,
394
+ currentTime: g,
395
+ duration: C,
396
+ volume: W,
379
397
  muted: se,
380
- curPlayId: D,
381
- playListExpanded: ce,
382
- ...q
398
+ playbackRate: R,
399
+ curPlayId: ce,
400
+ playListExpanded: ae,
401
+ ...ye
383
402
  } = u;
384
- return q;
385
- }, [u]), m = k(
403
+ return ye;
404
+ }, [u]), p = x(
386
405
  () => ({
387
406
  elementRefs: a.elementRefs,
388
407
  customIcons: a.customIcons,
389
408
  coverImgsCss: a.coverImgsCss
390
409
  }),
391
410
  [
392
- (y = a.elementRefs) == null ? void 0 : y.audioEl,
411
+ (v = a.elementRefs) == null ? void 0 : v.audioEl,
393
412
  (f = a.elementRefs) == null ? void 0 : f.waveformInst,
394
413
  a.customIcons,
395
414
  a.coverImgsCss
396
415
  ]
397
416
  );
398
- return /* @__PURE__ */ s(Ne.Provider, { value: i, children: /* @__PURE__ */ s(Ae.Provider, { value: o, children: /* @__PURE__ */ s(Se.Provider, { value: c, children: /* @__PURE__ */ s(we.Provider, { value: l, children: /* @__PURE__ */ s(Le.Provider, { value: m, children: /* @__PURE__ */ s(Ie.Provider, { value: p, children: /* @__PURE__ */ s(L.Provider, { value: r, children: e }) }) }) }) }) }) });
399
- }, Q = {
417
+ return /* @__PURE__ */ c(Ne.Provider, { value: i, children: /* @__PURE__ */ c(Se.Provider, { value: s, children: /* @__PURE__ */ c(we.Provider, { value: o, children: /* @__PURE__ */ c(be.Provider, { value: l, children: /* @__PURE__ */ c(Le.Provider, { value: p, children: /* @__PURE__ */ c(Ie.Provider, { value: m, children: /* @__PURE__ */ c(b.Provider, { value: r, children: e }) }) }) }) }) }) });
418
+ }, J = {
400
419
  top: "auto",
401
420
  right: "auto",
402
421
  bottom: "auto",
403
422
  left: "auto"
404
- }, Bt = {
405
- bottom: { ...Q, bottom: 0 },
406
- top: { ...Q, top: 0 },
407
- "bottom-left": { ...Q, bottom: 0, left: 0 },
408
- "bottom-right": { ...Q, bottom: 0, right: 0 },
409
- "top-left": { ...Q, top: 0, left: 0 },
410
- "top-right": { ...Q, top: 0, right: 0 }
411
- }, He = ee.memo(({ children: e, rootContainerProps: t }) => {
412
- const { playerPlacement: n, colorScheme: a } = x(), r = k(
413
- () => n ? Bt[n] : void 0,
423
+ }, $t = {
424
+ bottom: { ...J, bottom: 0 },
425
+ top: { ...J, top: 0 },
426
+ "bottom-left": { ...J, bottom: 0, left: 0 },
427
+ "bottom-right": { ...J, bottom: 0, right: 0 },
428
+ "top-left": { ...J, top: 0, left: 0 },
429
+ "top-right": { ...J, top: 0, right: 0 }
430
+ }, Ge = te.memo(({ children: e, rootContainerProps: t }) => {
431
+ const { playerPlacement: n, colorScheme: a } = M(), r = x(
432
+ () => n ? $t[n] : void 0,
414
433
  [n]
415
- ), o = {
434
+ ), s = {
416
435
  width: "100%",
417
436
  position: n !== "static" && !!n ? "fixed" : "static",
418
437
  ...r,
419
438
  ...(t == null ? void 0 : t.style) ?? {}
420
439
  };
421
- return /* @__PURE__ */ s(
440
+ return /* @__PURE__ */ c(
422
441
  "div",
423
442
  {
424
443
  ...t,
425
444
  className: `rmap-player-provider${t != null && t.className ? ` ${t.className}` : ""}`,
426
445
  "data-theme": a ?? void 0,
427
- style: o,
446
+ style: s,
428
447
  children: e
429
448
  }
430
449
  );
431
450
  });
432
- He.displayName = "AudioPlayerContainer";
433
- const $t = ({
451
+ Ge.displayName = "AudioPlayerContainer";
452
+ const Ft = ({
434
453
  areas: e,
435
454
  columns: t,
436
455
  alignItems: n,
437
456
  justifyContent: a,
438
457
  minHeight: r,
439
458
  UNSAFE_className: i,
440
- children: o
459
+ children: s
441
460
  }) => {
442
- const c = {
461
+ const o = {
443
462
  display: "grid",
444
463
  gridTemplateAreas: e == null ? void 0 : e.map((u) => `"${u}"`).join(" "),
445
464
  gridTemplateColumns: t == null ? void 0 : t.join(" "),
@@ -447,8 +466,8 @@ const $t = ({
447
466
  justifyContent: a,
448
467
  minHeight: r
449
468
  };
450
- return /* @__PURE__ */ s("div", { className: i, style: c, children: o });
451
- }, Ft = $t, Re = Pe(
469
+ return /* @__PURE__ */ c("div", { className: i, style: o, children: s });
470
+ }, Ht = Ft, ze = Pe(
452
471
  ({
453
472
  children: e,
454
473
  visible: t = !0,
@@ -456,8 +475,8 @@ const $t = ({
456
475
  width: a,
457
476
  justifySelf: r = "center",
458
477
  padding: i,
459
- UNSAFE_className: o,
460
- style: c,
478
+ UNSAFE_className: s,
479
+ style: o,
461
480
  ...u
462
481
  }, d) => {
463
482
  if (!t) return null;
@@ -466,21 +485,21 @@ const $t = ({
466
485
  width: a,
467
486
  justifySelf: r,
468
487
  padding: i ?? "0 5px",
469
- ...c
488
+ ...o
470
489
  };
471
- return /* @__PURE__ */ s("div", { ref: d, className: o, style: l, ...u, children: e });
490
+ return /* @__PURE__ */ c("div", { ref: d, className: s, style: l, ...u, children: e });
472
491
  }
473
492
  );
474
- Re.displayName = "GridItem";
475
- const _ = Ft;
476
- _.Item = Re;
477
- const Ht = ({
493
+ ze.displayName = "GridItem";
494
+ const _ = Ht;
495
+ _.Item = ze;
496
+ const Gt = ({
478
497
  children: e,
479
498
  id: t,
480
499
  ...n
481
500
  }) => {
482
- var l, p;
483
- const a = C(), r = te(), i = K(), o = x(), c = N(), u = {
501
+ var l, m;
502
+ const a = k(), r = re(), i = $(), s = M(), o = L(), u = {
484
503
  curAudioState: {
485
504
  isPlaying: a.isPlaying,
486
505
  volume: a.volume,
@@ -493,123 +512,131 @@ const Ht = ({
493
512
  audioResetKey: a.audioResetKey,
494
513
  ...r,
495
514
  ...i,
496
- ...o,
497
- ...c
498
- }, d = (p = (l = o.interfacePlacement) == null ? void 0 : l.customComponentsArea) == null ? void 0 : p[t];
499
- return /* @__PURE__ */ s(
515
+ ...s,
516
+ ...o
517
+ }, d = (m = (l = s.interfacePlacement) == null ? void 0 : l.customComponentsArea) == null ? void 0 : m[t];
518
+ return /* @__PURE__ */ c(
500
519
  _.Item,
501
520
  {
502
521
  UNSAFE_className: "rmap-custom-component",
503
522
  gridArea: d,
504
523
  ...n,
505
- children: ee.cloneElement(e, { audioPlayerState: u })
524
+ children: te.cloneElement(e, { audioPlayerState: u })
506
525
  }
507
526
  );
508
- }, ze = "PlayListEmpty", Ge = () => null;
509
- Ge.displayName = ze;
510
- const Rt = () => {
527
+ }, We = "PlayListEmpty", je = () => null;
528
+ je.displayName = We;
529
+ const zt = () => {
511
530
  const {
512
531
  isPlaying: e,
513
532
  volume: t,
514
533
  repeatType: n,
515
- audioResetKey: a
516
- } = C(), { currentTime: r, seekRequestKey: i } = te(), { elementRefs: o } = N(), c = E(L), u = g(
534
+ audioResetKey: a,
535
+ playbackRate: r
536
+ } = k(), { currentTime: i, seekRequestKey: s } = re(), { elementRefs: o } = L(), u = A(b), d = E(
517
537
  (y) => {
518
538
  if (y.currentTarget.readyState === 0) return;
519
- const f = y.currentTarget.currentTime;
520
- c({
539
+ const T = y.currentTarget.currentTime;
540
+ u({
521
541
  type: "SET_AUDIO_STATE",
522
- audioState: { currentTime: f }
542
+ audioState: { currentTime: T }
523
543
  });
524
544
  },
525
- [c]
526
- ), d = g(() => {
545
+ [u]
546
+ ), l = E(() => {
527
547
  if (o != null && o.audioEl) {
528
548
  if (n === "ONE") {
529
- $e(() => {
530
- c({ type: "SEEK", time: 0 });
549
+ Fe(() => {
550
+ u({ type: "SEEK", time: 0 });
531
551
  }), o.audioEl.play();
532
552
  return;
533
553
  }
534
- c({ type: "NEXT_AUDIO" });
554
+ u({ type: "NEXT_AUDIO" });
535
555
  }
536
- }, [c, n, o == null ? void 0 : o.audioEl]), l = g(
556
+ }, [u, n, o == null ? void 0 : o.audioEl]), m = E(
557
+ (y) => {
558
+ t != null && (y.volume = t), r != null && (y.playbackRate = r);
559
+ },
560
+ [t, r]
561
+ ), p = E(
537
562
  (y) => {
538
- const { duration: f } = y.currentTarget;
539
- t != null && (y.currentTarget.volume = t), c({
563
+ const { duration: T } = y.currentTarget;
564
+ m(y.currentTarget), u({
540
565
  type: "SET_AUDIO_STATE",
541
- audioState: { isLoadedMetaData: !0, duration: f }
566
+ audioState: { isLoadedMetaData: !0, duration: T }
542
567
  });
543
568
  },
544
- [c, t]
545
- ), p = A(!1);
569
+ [u, m]
570
+ ), v = S(!1);
546
571
  P(() => {
547
572
  if (o != null && o.audioEl) {
548
- if (!p.current) {
549
- p.current = !0;
573
+ if (!v.current) {
574
+ v.current = !0;
550
575
  return;
551
576
  }
552
577
  o.audioEl.currentTime = 0;
553
578
  }
554
579
  }, [a, o == null ? void 0 : o.audioEl]), P(() => {
555
- o != null && o.audioEl && (e ? o.audioEl.play().catch(() => {
556
- c({
580
+ o != null && o.audioEl && (e ? o.audioEl.play().catch((y) => {
581
+ (y == null ? void 0 : y.name) !== "AbortError" && u({
557
582
  type: "SET_AUDIO_STATE",
558
583
  audioState: { isPlaying: !1 }
559
584
  });
560
585
  }) : o.audioEl.pause());
561
- }, [o == null ? void 0 : o.audioEl, e, c]), P(() => {
586
+ }, [o == null ? void 0 : o.audioEl, e, u, a]), P(() => {
562
587
  !(o != null && o.audioEl) || t == null || (o.audioEl.volume = t);
563
- }, [o == null ? void 0 : o.audioEl, t]);
564
- const m = A(0);
588
+ }, [o == null ? void 0 : o.audioEl, t]), P(() => {
589
+ !(o != null && o.audioEl) || r == null || (o.audioEl.playbackRate = r);
590
+ }, [o == null ? void 0 : o.audioEl, r]);
591
+ const f = S(0);
565
592
  return P(() => {
566
- if (i === m.current) return;
567
- m.current = i;
593
+ if (s === f.current) return;
594
+ f.current = s;
568
595
  const y = o == null ? void 0 : o.audioEl;
569
- if (!y || r == null) return;
570
- y.currentTime = r;
571
- const f = o == null ? void 0 : o.waveformInst, v = y.duration, T = Number.isFinite(v) && v > 0;
572
- if (!f || !T) return;
573
- const h = r / v, I = Math.min(1, Math.max(0, h));
574
- f.seekTo(I);
596
+ if (!y || i == null) return;
597
+ y.currentTime = i;
598
+ const T = o == null ? void 0 : o.waveformInst, h = y.duration, g = Number.isFinite(h) && h > 0;
599
+ if (!T || !g) return;
600
+ const C = i / h, W = Math.min(1, Math.max(0, C));
601
+ T.seekTo(W);
575
602
  }, [
603
+ s,
576
604
  i,
577
- r,
578
605
  o == null ? void 0 : o.audioEl,
579
606
  o == null ? void 0 : o.waveformInst
580
607
  ]), {
581
- onTimeUpdate: u,
582
- onEnded: d,
583
- onLoadedMetadata: l
608
+ onTimeUpdate: d,
609
+ onEnded: l,
610
+ onLoadedMetadata: p
584
611
  };
585
- }, We = ee.memo(({ audioRef: e }) => {
586
- const t = A(null), { muted: n } = C(), { curPlayId: a, playList: r } = K(), i = Ot(), o = E(L), c = r.find(
612
+ }, Ye = te.memo(({ audioRef: e }) => {
613
+ const t = S(null), { muted: n } = k(), { curPlayId: a, playList: r } = $(), i = Kt(), s = A(b), o = r.find(
587
614
  (d) => d.id === a
588
- ), u = Rt();
615
+ ), u = zt();
589
616
  return P(() => {
590
- t.current && (o({
617
+ t.current && (s({
591
618
  type: "SET_ELEMENT_REFS",
592
619
  elementRefs: { audioEl: t.current }
593
620
  }), e && (e.current = t.current));
594
- }, [o, e]), /* @__PURE__ */ s(
621
+ }, [s, e]), /* @__PURE__ */ c(
595
622
  "audio",
596
623
  {
597
624
  id: "rm-audio-player-audio",
598
625
  ...i,
599
626
  muted: n,
600
627
  ref: t,
601
- src: c == null ? void 0 : c.src,
628
+ src: o == null ? void 0 : o.src,
602
629
  ...u
603
630
  }
604
631
  );
605
632
  });
606
- We.displayName = "Audio";
607
- function z(e, t) {
633
+ Ye.displayName = "Audio";
634
+ function B(e, t) {
608
635
  var a, r;
609
- const { interfacePlacement: n } = x();
636
+ const { interfacePlacement: n } = M();
610
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]) ?? de.templateArea[e];
611
638
  }
612
- const j = Pe(({ className: e, type: t = "button", ...n }, a) => /* @__PURE__ */ s(
639
+ const q = Pe(({ className: e, type: t = "button", ...n }, a) => /* @__PURE__ */ c(
613
640
  "button",
614
641
  {
615
642
  ref: a,
@@ -618,10 +645,10 @@ const j = Pe(({ className: e, type: t = "button", ...n }, a) => /* @__PURE__ */
618
645
  ...n
619
646
  }
620
647
  ));
621
- j.displayName = "StyledBtn";
622
- const be = (e) => (
648
+ q.displayName = "StyledBtn";
649
+ const ke = (e) => (
623
650
  // eslint-disable-next-line react/display-name
624
- ({ size: t = "1em", color: n, style: a, ...r }) => /* @__PURE__ */ s(
651
+ ({ size: t = "1em", color: n, style: a, ...r }) => /* @__PURE__ */ c(
625
652
  "svg",
626
653
  {
627
654
  "aria-hidden": "true",
@@ -639,9 +666,9 @@ const be = (e) => (
639
666
  dangerouslySetInnerHTML: { __html: e }
640
667
  }
641
668
  )
642
- ), Y = (e) => (
669
+ ), X = (e) => (
643
670
  // eslint-disable-next-line react/display-name
644
- ({ size: t = "1em", color: n, style: a, ...r }) => /* @__PURE__ */ s(
671
+ ({ size: t = "1em", color: n, style: a, ...r }) => /* @__PURE__ */ c(
645
672
  "svg",
646
673
  {
647
674
  "aria-hidden": "true",
@@ -661,9 +688,9 @@ const be = (e) => (
661
688
  dangerouslySetInnerHTML: { __html: e }
662
689
  }
663
690
  )
664
- ), je = (e, t = "0 0 16 16") => (
691
+ ), qe = (e, t = "0 0 16 16") => (
665
692
  // eslint-disable-next-line react/display-name
666
- ({ size: n = "1em", color: a, style: r, ...i }) => /* @__PURE__ */ s(
693
+ ({ size: n = "1em", color: a, style: r, ...i }) => /* @__PURE__ */ c(
667
694
  "svg",
668
695
  {
669
696
  "aria-hidden": "true",
@@ -681,94 +708,94 @@ const be = (e) => (
681
708
  dangerouslySetInnerHTML: { __html: e }
682
709
  }
683
710
  )
684
- ), Ye = be(
711
+ ), Xe = ke(
685
712
  '<path fill="none" d="M0 0h24v24H0z"/><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 14.5v-9l6 4.5-6 4.5z"/>'
686
713
  );
687
- Ye.displayName = "MdPlayCircleFilled";
688
- const qe = be(
714
+ Xe.displayName = "MdPlayCircleFilled";
715
+ const Qe = ke(
689
716
  '<path fill="none" d="M0 0h24v24H0z"/><path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-1 14H9V8h2v8zm4 0h-2V8h2v8z"/>'
690
717
  );
691
- qe.displayName = "MdPauseCircleFilled";
692
- const Xe = be(
718
+ Qe.displayName = "MdPauseCircleFilled";
719
+ const Je = ke(
693
720
  '<path fill="none" d="M0 0h24v24H0z"/><path d="M3 10h11v2H3zM3 6h11v2H3zM3 14h7v2H3zM16 13v8l6-4z"/>'
694
721
  );
695
- Xe.displayName = "MdPlaylistPlay";
696
- const Qe = Y(
722
+ Je.displayName = "MdPlaylistPlay";
723
+ const Ze = X(
697
724
  '<path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M4 12v-3a3 3 0 0 1 3 -3h13m-3 -3l3 3l-3 3"/><path d="M20 12v3a3 3 0 0 1 -3 3h-13m3 3l-3 -3l3 -3"/>'
698
725
  );
699
- Qe.displayName = "TbRepeat";
700
- const Je = Y(
726
+ Ze.displayName = "TbRepeat";
727
+ const et = X(
701
728
  '<path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M4 12v-3a3 3 0 0 1 3 -3h13m-3 -3l3 3l-3 3"/><path d="M20 12v3a3 3 0 0 1 -3 3h-13m3 3l-3 -3l3 -3"/><path d="M11 11l1 -1v4"/>'
702
729
  );
703
- Je.displayName = "TbRepeatOnce";
704
- const Ze = Y(
730
+ et.displayName = "TbRepeatOnce";
731
+ const tt = X(
705
732
  '<path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M4 12v-3c0 -1.336 .873 -2.468 2.08 -2.856m3.92 -.144h10m-3 -3l3 3l-3 3"/><path d="M20 12v3a3 3 0 0 1 -.133 .886m-1.99 1.984a3 3 0 0 1 -.877 .13h-13m3 3l-3 -3l3 -3"/><path d="M3 3l18 18"/>'
706
733
  );
707
- Ze.displayName = "TbRepeatOff";
708
- const et = Y(
734
+ tt.displayName = "TbRepeatOff";
735
+ const rt = X(
709
736
  '<path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M18 4l3 3l-3 3"/><path d="M18 20l3 -3l-3 -3"/><path d="M3 7h3a5 5 0 0 1 5 5a5 5 0 0 0 5 5h5"/><path d="M21 7h-5a4.978 4.978 0 0 0 -2.998 .998m-4.002 8.003a4.984 4.984 0 0 1 -3 .999h-3"/>'
710
737
  );
711
- et.displayName = "TbArrowsShuffle";
712
- const tt = Y(
738
+ rt.displayName = "TbArrowsShuffle";
739
+ const at = X(
713
740
  '<path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M15 8a5 5 0 0 1 0 8"/><path d="M17.7 5a9 9 0 0 1 0 14"/><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"/>'
714
741
  );
715
- tt.displayName = "TbVolume";
716
- const rt = Y(
742
+ at.displayName = "TbVolume";
743
+ const nt = X(
717
744
  '<path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M15 8a5 5 0 0 1 0 8"/><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"/>'
718
745
  );
719
- rt.displayName = "TbVolume2";
720
- const at = Y(
746
+ nt.displayName = "TbVolume2";
747
+ const ot = X(
721
748
  '<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"/>'
722
749
  );
723
- at.displayName = "TbVolume3";
724
- const nt = je(
750
+ ot.displayName = "TbVolume3";
751
+ const it = qe(
725
752
  '<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"/>'
726
753
  );
727
- nt.displayName = "ImPrevious";
728
- const ot = je(
754
+ it.displayName = "ImPrevious";
755
+ const st = qe(
729
756
  '<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"/>'
730
757
  );
731
- ot.displayName = "ImNext";
732
- const M = ({ render: e, customIcon: t }) => /* @__PURE__ */ s(R, { children: t ?? e }), zt = G(function() {
733
- const { isPlaying: t } = C(), { customIcons: n } = N(), a = E(L);
734
- return /* @__PURE__ */ s(
735
- j,
758
+ st.displayName = "ImNext";
759
+ const D = ({ render: e, customIcon: t }) => /* @__PURE__ */ c(G, { children: t ?? e }), Wt = z(function() {
760
+ const { isPlaying: t } = k(), { customIcons: n } = L(), a = A(b);
761
+ return /* @__PURE__ */ c(
762
+ q,
736
763
  {
737
764
  type: "button",
738
765
  "aria-label": t ? "Pause" : "Play",
739
766
  onClick: () => a({ type: "CHANGE_PLAYING_STATE" }),
740
767
  className: "rmap-play-btn",
741
768
  "data-testid": "play-btn",
742
- children: t ? /* @__PURE__ */ s(
743
- M,
769
+ children: t ? /* @__PURE__ */ c(
770
+ D,
744
771
  {
745
- render: /* @__PURE__ */ s(qe, {}),
772
+ render: /* @__PURE__ */ c(Qe, {}),
746
773
  customIcon: n == null ? void 0 : n.pause
747
774
  }
748
- ) : /* @__PURE__ */ s(M, { render: /* @__PURE__ */ s(Ye, {}), customIcon: n == null ? void 0 : n.play })
775
+ ) : /* @__PURE__ */ c(D, { render: /* @__PURE__ */ c(Xe, {}), customIcon: n == null ? void 0 : n.play })
749
776
  }
750
777
  );
751
- }), Gt = G(function({ isVisible: t }) {
752
- const { customIcons: n, elementRefs: a } = N(), r = E(L);
753
- return t ? /* @__PURE__ */ s(
754
- j,
778
+ }), jt = z(function({ isVisible: t }) {
779
+ const { customIcons: n, elementRefs: a } = L(), r = A(b);
780
+ return t ? /* @__PURE__ */ c(
781
+ q,
755
782
  {
756
783
  type: "button",
757
784
  "aria-label": "Previous track",
758
785
  onClick: () => {
759
- var c;
760
- const o = ((c = a == null ? void 0 : a.audioEl) == null ? void 0 : c.currentTime) ?? 0;
761
- r({ type: "PREV_AUDIO", currentTime: o });
786
+ var o;
787
+ const s = ((o = a == null ? void 0 : a.audioEl) == null ? void 0 : o.currentTime) ?? 0;
788
+ r({ type: "PREV_AUDIO", currentTime: s });
762
789
  },
763
790
  className: "rmap-prev-btn",
764
791
  "data-testid": "prev-btn",
765
- children: /* @__PURE__ */ s(M, { render: /* @__PURE__ */ s(nt, {}), customIcon: n == null ? void 0 : n.prev })
792
+ children: /* @__PURE__ */ c(D, { render: /* @__PURE__ */ c(it, {}), customIcon: n == null ? void 0 : n.prev })
766
793
  }
767
794
  ) : null;
768
- }), Wt = G(function({ isVisible: t }) {
769
- const { customIcons: n } = N(), a = E(L);
770
- return t ? /* @__PURE__ */ s(
771
- j,
795
+ }), Yt = z(function({ isVisible: t }) {
796
+ const { customIcons: n } = L(), a = A(b);
797
+ return t ? /* @__PURE__ */ c(
798
+ q,
772
799
  {
773
800
  type: "button",
774
801
  "aria-label": "Next track",
@@ -777,83 +804,83 @@ const M = ({ render: e, customIcon: t }) => /* @__PURE__ */ s(R, { children: t ?
777
804
  },
778
805
  className: "rmap-next-btn",
779
806
  "data-testid": "next-btn",
780
- children: /* @__PURE__ */ s(M, { render: /* @__PURE__ */ s(ot, {}), customIcon: n == null ? void 0 : n.next })
807
+ children: /* @__PURE__ */ c(D, { render: /* @__PURE__ */ c(st, {}), customIcon: n == null ? void 0 : n.next })
781
808
  }
782
809
  ) : null;
783
- }), it = ({
810
+ }), ct = ({
784
811
  gridArea: e,
785
812
  visible: t,
786
813
  ...n
787
814
  }) => {
788
- const { activeUI: a } = x(), r = !!(a.prevNnext ?? a.all), i = z("playButton", e);
789
- return /* @__PURE__ */ s(_.Item, { gridArea: i, visible: t ?? !0, ...n, children: /* @__PURE__ */ w(
815
+ const { activeUI: a } = M(), r = !!(a.prevNnext ?? a.all), i = B("playButton", e);
816
+ return /* @__PURE__ */ c(_.Item, { gridArea: i, visible: t ?? !0, ...n, children: /* @__PURE__ */ w(
790
817
  "div",
791
818
  {
792
819
  className: "rmap-ctrl-btn-wrapper",
793
820
  role: "group",
794
821
  "aria-label": "Playback controls",
795
822
  children: [
796
- /* @__PURE__ */ s(Gt, { isVisible: r }),
797
- /* @__PURE__ */ s(zt, {}),
798
- /* @__PURE__ */ s(Wt, { isVisible: r })
823
+ /* @__PURE__ */ c(jt, { isVisible: r }),
824
+ /* @__PURE__ */ c(Wt, {}),
825
+ /* @__PURE__ */ c(Yt, { isVisible: r })
799
826
  ]
800
827
  }
801
828
  ) });
802
- }, jt = {
829
+ }, qt = {
803
830
  ALL: "Repeat: All tracks",
804
831
  ONE: "Repeat: One track",
805
832
  NONE: "Repeat: Off",
806
833
  SHUFFLE: "Shuffle"
807
- }, Yt = {
834
+ }, Xt = {
808
835
  ALL: "ONE",
809
836
  ONE: "NONE",
810
837
  NONE: "SHUFFLE",
811
838
  SHUFFLE: "ALL"
812
- }, st = G(
839
+ }, lt = z(
813
840
  function({ gridArea: t, visible: n, ...a }) {
814
- const { repeatType: r } = C(), { customIcons: i } = N(), o = E(
815
- L
816
- ), c = () => {
817
- o({
841
+ const { repeatType: r } = k(), { customIcons: i } = L(), s = A(
842
+ b
843
+ ), o = () => {
844
+ s({
818
845
  type: "SET_REPEAT_TYPE",
819
- repeatType: Yt[r]
846
+ repeatType: Xt[r]
820
847
  });
821
- }, u = z("repeatType", t);
822
- return /* @__PURE__ */ s(
848
+ }, u = B("repeatType", t);
849
+ return /* @__PURE__ */ c(
823
850
  _.Item,
824
851
  {
825
852
  gridArea: u,
826
853
  visible: n ?? !0,
827
854
  ...a,
828
855
  children: /* @__PURE__ */ w(
829
- j,
856
+ q,
830
857
  {
831
858
  type: "button",
832
- "aria-label": jt[r],
833
- onClick: c,
859
+ "aria-label": qt[r],
860
+ onClick: o,
834
861
  className: "rmap-repeat-btn",
835
862
  "data-testid": "repeat-btn",
836
863
  "data-repeattype": r,
837
864
  children: [
838
- r === "ALL" && /* @__PURE__ */ s(M, { render: /* @__PURE__ */ s(Qe, {}), customIcon: i == null ? void 0 : i.repeatAll }),
839
- r === "ONE" && /* @__PURE__ */ s(
840
- M,
865
+ r === "ALL" && /* @__PURE__ */ c(D, { render: /* @__PURE__ */ c(Ze, {}), customIcon: i == null ? void 0 : i.repeatAll }),
866
+ r === "ONE" && /* @__PURE__ */ c(
867
+ D,
841
868
  {
842
- render: /* @__PURE__ */ s(Je, {}),
869
+ render: /* @__PURE__ */ c(et, {}),
843
870
  customIcon: i == null ? void 0 : i.repeatOne
844
871
  }
845
872
  ),
846
- r === "NONE" && /* @__PURE__ */ s(
847
- M,
873
+ r === "NONE" && /* @__PURE__ */ c(
874
+ D,
848
875
  {
849
- render: /* @__PURE__ */ s(Ze, {}),
876
+ render: /* @__PURE__ */ c(tt, {}),
850
877
  customIcon: i == null ? void 0 : i.repeatNone
851
878
  }
852
879
  ),
853
- r === "SHUFFLE" && /* @__PURE__ */ s(
854
- M,
880
+ r === "SHUFFLE" && /* @__PURE__ */ c(
881
+ D,
855
882
  {
856
- render: /* @__PURE__ */ s(et, {}),
883
+ render: /* @__PURE__ */ c(rt, {}),
857
884
  customIcon: i == null ? void 0 : i.repeatShuffle
858
885
  }
859
886
  )
@@ -863,33 +890,33 @@ const M = ({ render: e, customIcon: t }) => /* @__PURE__ */ s(R, { children: t ?
863
890
  }
864
891
  );
865
892
  }
866
- ), fe = { size: "100%" }, ct = G(() => {
867
- var o;
868
- const { volume: e, muted: t } = C(), { customIcons: n, elementRefs: a } = N(), r = e ?? ((o = a == null ? void 0 : a.audioEl) == null ? void 0 : o.volume) ?? 0, i = r > 0 && r <= 0.5;
869
- return t || r === 0 ? /* @__PURE__ */ s(
870
- M,
893
+ ), Te = { size: "100%" }, ut = z(() => {
894
+ var s;
895
+ const { volume: e, muted: t } = k(), { customIcons: n, elementRefs: a } = L(), r = e ?? ((s = a == null ? void 0 : a.audioEl) == null ? void 0 : s.volume) ?? 0, i = r > 0 && r <= 0.5;
896
+ return t || r === 0 ? /* @__PURE__ */ c(
897
+ D,
871
898
  {
872
- render: /* @__PURE__ */ s(at, { ...fe }),
899
+ render: /* @__PURE__ */ c(ot, { ...Te }),
873
900
  customIcon: n == null ? void 0 : n.volumeMuted
874
901
  }
875
- ) : i ? /* @__PURE__ */ s(
876
- M,
902
+ ) : i ? /* @__PURE__ */ c(
903
+ D,
877
904
  {
878
- render: /* @__PURE__ */ s(rt, { ...fe }),
905
+ render: /* @__PURE__ */ c(nt, { ...Te }),
879
906
  customIcon: n == null ? void 0 : n.volumeHalf
880
907
  }
881
- ) : /* @__PURE__ */ s(
882
- M,
908
+ ) : /* @__PURE__ */ c(
909
+ D,
883
910
  {
884
- render: /* @__PURE__ */ s(tt, { ...fe }),
911
+ render: /* @__PURE__ */ c(at, { ...Te }),
885
912
  customIcon: n == null ? void 0 : n.volumeFull
886
913
  }
887
914
  );
888
915
  });
889
- ct.displayName = "VolumeIcon";
890
- const ie = O(null);
916
+ ut.displayName = "VolumeIcon";
917
+ const ie = K(null);
891
918
  ie.displayName = "DrawerContext";
892
- const lt = (e, t) => {
919
+ const dt = (e, t) => {
893
920
  P(() => {
894
921
  const n = (a) => {
895
922
  const r = e.current, { target: i } = a;
@@ -897,7 +924,7 @@ const lt = (e, t) => {
897
924
  };
898
925
  return document.addEventListener("click", n), () => document.removeEventListener("click", n);
899
926
  }, [e, t]);
900
- }, ne = ({
927
+ }, oe = ({
901
928
  outboundClickActive: e = !1,
902
929
  placement: t = "bottom",
903
930
  children: n,
@@ -905,165 +932,165 @@ const lt = (e, t) => {
905
932
  onOpenChange: r,
906
933
  initialOpen: i
907
934
  }) => {
908
- const o = A(null), [c, u] = ee.Children.toArray(n), [d, l] = b(
935
+ const s = S(null), [o, u] = te.Children.toArray(n), [d, l] = N(
909
936
  a !== void 0 ? a : i ?? !1
910
- ), p = Be();
911
- lt(o, () => {
937
+ ), m = $e();
938
+ dt(s, () => {
912
939
  e && (l(!1), r && r(!1));
913
940
  }), P(() => {
914
941
  a !== void 0 && l(a);
915
942
  }, [a]);
916
- const m = k(
917
- () => ({ isOpen: d, setIsOpen: l, onOpenChange: r, drawerId: p }),
918
- [d, l, r, p]
943
+ const p = x(
944
+ () => ({ isOpen: d, setIsOpen: l, onOpenChange: r, drawerId: m }),
945
+ [d, l, r, m]
919
946
  );
920
- return /* @__PURE__ */ s("div", { className: "rmap-drawer-container", ref: o, children: /* @__PURE__ */ s(ie.Provider, { value: m, children: /* @__PURE__ */ w(R, { children: [
947
+ return /* @__PURE__ */ c("div", { className: "rmap-drawer-container", ref: s, children: /* @__PURE__ */ c(ie.Provider, { value: p, children: /* @__PURE__ */ w(G, { children: [
921
948
  t === "top" && u,
922
- c,
949
+ o,
923
950
  t === "bottom" && u
924
951
  ] }) }) });
925
- }, ut = typeof window < "u", Te = ut ? Ct : P, ke = ({
952
+ }, pt = typeof window < "u", ge = pt ? Mt : P, Ce = ({
926
953
  visible: e,
927
954
  name: t,
928
955
  leaveTime: n,
929
956
  enterTime: a,
930
957
  clearTime: r,
931
958
  onExited: i,
932
- onEntered: o,
933
- children: c
959
+ onEntered: s,
960
+ children: o
934
961
  }) => {
935
- const [u, d] = b(""), [l, p] = b(!1), m = A(o), y = A(i), f = A(t), v = A(a), T = A(n), h = A(r);
936
- return Te(() => {
937
- m.current = o, y.current = i, f.current = t, v.current = a, T.current = n, h.current = r;
938
- }), Te(() => {
939
- const I = e ? "enter" : "leave", B = f.current, re = e ? v.current : T.current;
940
- e && !l && p(!0), d(`${B}-${I}`);
962
+ const [u, d] = N(""), [l, m] = N(!1), p = S(s), v = S(i), f = S(t), y = S(a), T = S(n), h = S(r);
963
+ return ge(() => {
964
+ p.current = s, v.current = i, f.current = t, y.current = a, T.current = n, h.current = r;
965
+ }), ge(() => {
966
+ const g = e ? "enter" : "leave", C = f.current, W = e ? y.current : T.current;
967
+ e && !l && m(!0), d(`${C}-${g}`);
941
968
  const se = setTimeout(() => {
942
- var ce, q;
969
+ var ce, ae;
943
970
  d(
944
- `${B}-${I} ${B}-${I}-active`
945
- ), I === "leave" ? (ce = y.current) == null || ce.call(y) : (q = m.current) == null || q.call(m);
946
- }, re), D = setTimeout(() => {
947
- e || (d(B), p(!1));
948
- }, re + h.current);
971
+ `${C}-${g} ${C}-${g}-active`
972
+ ), g === "leave" ? (ce = v.current) == null || ce.call(v) : (ae = p.current) == null || ae.call(p);
973
+ }, W), R = setTimeout(() => {
974
+ e || (d(C), m(!1));
975
+ }, W + h.current);
949
976
  return () => {
950
- clearTimeout(se), clearTimeout(D);
977
+ clearTimeout(se), clearTimeout(R);
951
978
  };
952
- }, [e, l]), l ? xt(c, {
953
- className: `${c.props.className} ${u}`
979
+ }, [e, l]), l ? _t(o, {
980
+ className: `${o.props.className} ${u}`
954
981
  }) : null;
955
- }, qt = 'a[href], button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"]), [role="button"]:not([aria-disabled="true"])', Xt = ({
982
+ }, Qt = 'a[href], button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"]), [role="button"]:not([aria-disabled="true"])', Jt = ({
956
983
  children: e,
957
984
  isWithAnimation: t = !0,
958
985
  "aria-label": n = "Dialog"
959
986
  }) => {
960
- const { isOpen: a, setIsOpen: r, onOpenChange: i, drawerId: o } = E(ie), c = A(null), u = A(null), d = g(
987
+ const { isOpen: a, setIsOpen: r, onOpenChange: i, drawerId: s } = A(ie), o = S(null), u = S(null), d = E(
961
988
  () => {
962
- var v;
963
- return (v = c.current) == null ? void 0 : v.querySelectorAll(qt);
989
+ var y;
990
+ return (y = o.current) == null ? void 0 : y.querySelectorAll(Qt);
964
991
  },
965
992
  []
966
- ), l = g(() => {
967
- var v, T;
968
- (T = (v = d()) == null ? void 0 : v[0]) == null || T.focus();
969
- }, [d]), p = g(() => {
993
+ ), l = E(() => {
994
+ var y, T;
995
+ (T = (y = d()) == null ? void 0 : y[0]) == null || T.focus();
996
+ }, [d]), m = E(() => {
970
997
  u.current = document.activeElement, l();
971
- }, [l]), m = g(() => {
972
- var v;
973
- (v = u.current) == null || v.focus();
998
+ }, [l]), p = E(() => {
999
+ var y;
1000
+ (y = u.current) == null || y.focus();
974
1001
  }, []);
975
1002
  P(() => {
976
- var v;
977
- a && !t ? (u.current = document.activeElement, l()) : !a && !t && ((v = u.current) == null || v.focus());
1003
+ var y;
1004
+ a && !t ? (u.current = document.activeElement, l()) : !a && !t && ((y = u.current) == null || y.focus());
978
1005
  }, [a, t, l]);
979
- const y = g(
980
- (v) => {
981
- if (v.key === "Escape") {
1006
+ const v = E(
1007
+ (y) => {
1008
+ if (y.key === "Escape") {
982
1009
  r(!1), i && i(!1);
983
1010
  return;
984
1011
  }
985
- if (v.key === "Tab") {
1012
+ if (y.key === "Tab") {
986
1013
  const T = d();
987
1014
  if (!T || T.length === 0) return;
988
- const h = T[0], I = T[T.length - 1];
989
- v.shiftKey ? document.activeElement === h && (v.preventDefault(), I.focus()) : document.activeElement === I && (v.preventDefault(), h.focus());
1015
+ const h = T[0], g = T[T.length - 1];
1016
+ y.shiftKey ? document.activeElement === h && (y.preventDefault(), g.focus()) : document.activeElement === g && (y.preventDefault(), h.focus());
990
1017
  }
991
1018
  },
992
1019
  [r, i, d]
993
- ), f = /* @__PURE__ */ s(
1020
+ ), f = /* @__PURE__ */ c(
994
1021
  "div",
995
1022
  {
996
- ref: c,
1023
+ ref: o,
997
1024
  className: "rmap-drawer-content-container",
998
1025
  role: "dialog",
999
1026
  "aria-modal": "true",
1000
1027
  "aria-label": n,
1001
- id: o,
1002
- onKeyDown: y,
1028
+ id: s,
1029
+ onKeyDown: v,
1003
1030
  children: e
1004
1031
  }
1005
1032
  );
1006
- return t ? /* @__PURE__ */ s(
1007
- ke,
1033
+ return t ? /* @__PURE__ */ c(
1034
+ Ce,
1008
1035
  {
1009
1036
  visible: a,
1010
1037
  name: "rmap-drawer-content",
1011
1038
  enterTime: 20,
1012
1039
  leaveTime: 60,
1013
1040
  clearTime: 300,
1014
- onEntered: p,
1015
- onExited: m,
1041
+ onEntered: m,
1042
+ onExited: p,
1016
1043
  children: f
1017
1044
  }
1018
1045
  ) : a ? f : null;
1019
- }, Qt = ({
1046
+ }, Zt = ({
1020
1047
  children: e,
1021
1048
  "aria-label": t,
1022
1049
  "data-testid": n
1023
1050
  }) => {
1024
- const { isOpen: a, setIsOpen: r, onOpenChange: i, drawerId: o } = E(ie), c = g(() => {
1051
+ const { isOpen: a, setIsOpen: r, onOpenChange: i, drawerId: s } = A(ie), o = E(() => {
1025
1052
  const u = !a;
1026
1053
  r(u), i == null || i(u);
1027
1054
  }, [a, r, i]);
1028
- return /* @__PURE__ */ s(
1029
- j,
1055
+ return /* @__PURE__ */ c(
1056
+ q,
1030
1057
  {
1031
1058
  className: "rmap-drawer-trigger",
1032
1059
  type: "button",
1033
1060
  "aria-expanded": a,
1034
- "aria-controls": o,
1061
+ "aria-controls": s,
1035
1062
  "aria-label": t,
1036
1063
  "data-testid": n,
1037
- onClick: c,
1064
+ onClick: o,
1038
1065
  children: e
1039
1066
  }
1040
1067
  );
1041
1068
  };
1042
- ne.Content = Xt;
1043
- ne.Trigger = Qt;
1044
- const ge = ({ children: e }) => /* @__PURE__ */ s("ul", { className: "rmap-sortable-list-container", "aria-label": "Sortable list", children: e }), Jt = ({
1069
+ oe.Content = Jt;
1070
+ oe.Trigger = Zt;
1071
+ const Ee = ({ children: e }) => /* @__PURE__ */ c("ul", { className: "rmap-sortable-list-container", "aria-label": "Sortable list", children: e }), er = ({
1045
1072
  index: e,
1046
1073
  dragStartIdx: t,
1047
1074
  listData: n,
1048
1075
  draggable: a = !0,
1049
1076
  onDragStart: r,
1050
1077
  onDragOver: i,
1051
- onDrop: o,
1052
- onReorder: c,
1078
+ onDrop: s,
1079
+ onReorder: o,
1053
1080
  onClick: u
1054
1081
  }) => {
1055
- const d = (l, p) => {
1082
+ const d = (l, m) => {
1056
1083
  if (l < 0 || l >= n.length) return;
1057
- const m = [...n], y = m.splice(e, 1)[0];
1058
- m.splice(l, 0, y);
1059
- const f = m.map((T, h) => ({
1084
+ const p = [...n], v = p.splice(e, 1)[0];
1085
+ p.splice(l, 0, v);
1086
+ const f = p.map((T, h) => ({
1060
1087
  ...T,
1061
1088
  index: h
1062
- })), v = (p == null ? void 0 : p.parentElement) ?? null;
1063
- if ($e(() => {
1064
- c == null || c(f);
1065
- }), v) {
1066
- const T = v.children[l];
1089
+ })), y = (m == null ? void 0 : m.parentElement) ?? null;
1090
+ if (Fe(() => {
1091
+ o == null || o(f);
1092
+ }), y) {
1093
+ const T = y.children[l];
1067
1094
  T == null || T.focus();
1068
1095
  }
1069
1096
  };
@@ -1080,16 +1107,16 @@ const ge = ({ children: e }) => /* @__PURE__ */ s("ul", { className: "rmap-sorta
1080
1107
  if (l.preventDefault(), a && l.altKey)
1081
1108
  d(e - 1, l.currentTarget);
1082
1109
  else {
1083
- const p = l.currentTarget.previousElementSibling;
1084
- p == null || p.focus();
1110
+ const m = l.currentTarget.previousElementSibling;
1111
+ m == null || m.focus();
1085
1112
  }
1086
1113
  break;
1087
1114
  case "ArrowDown":
1088
1115
  if (l.preventDefault(), a && l.altKey)
1089
1116
  d(e + 1, l.currentTarget);
1090
1117
  else {
1091
- const p = l.currentTarget.nextElementSibling;
1092
- p == null || p.focus();
1118
+ const m = l.currentTarget.nextElementSibling;
1119
+ m == null || m.focus();
1093
1120
  }
1094
1121
  break;
1095
1122
  }
@@ -1111,40 +1138,40 @@ const ge = ({ children: e }) => /* @__PURE__ */ s("ul", { className: "rmap-sorta
1111
1138
  },
1112
1139
  onDrop: (l) => {
1113
1140
  l.stopPropagation(), l.currentTarget.classList.remove("rmap-drag-over");
1114
- const p = [...n], m = n[t];
1115
- p.splice(t, 1);
1116
- const y = [
1117
- ...p.slice(0, e),
1118
- m,
1119
- ...p.slice(e, p.length)
1120
- ].map((f, v) => ({ ...f, index: v }));
1121
- o == null || o(l, y);
1141
+ const m = [...n], p = n[t];
1142
+ m.splice(t, 1);
1143
+ const v = [
1144
+ ...m.slice(0, e),
1145
+ p,
1146
+ ...m.slice(e, m.length)
1147
+ ].map((f, y) => ({ ...f, index: y }));
1148
+ s == null || s(l, v);
1122
1149
  },
1123
1150
  onClick: (l) => {
1124
1151
  l.stopPropagation(), u == null || u(l);
1125
1152
  }
1126
1153
  };
1127
- }, Zt = (e) => {
1128
- const { children: t, ...n } = e, a = Jt(n);
1129
- return /* @__PURE__ */ s("li", { className: "rmap-sortable-item", ...a, children: /* @__PURE__ */ s("div", { className: "rmap-sortable-item-inner", children: t }) });
1154
+ }, tr = (e) => {
1155
+ const { children: t, ...n } = e, a = er(n);
1156
+ return /* @__PURE__ */ c("li", { className: "rmap-sortable-item", ...a, children: /* @__PURE__ */ c("div", { className: "rmap-sortable-item-inner", children: t }) });
1130
1157
  };
1131
- ge.Item = Zt;
1132
- const Ce = O(null);
1133
- Ce.displayName = "PlayListPortalContext";
1134
- const xe = O(null);
1135
- xe.displayName = "PlayListEmptyContext";
1136
- const er = G(function({
1158
+ Ee.Item = tr;
1159
+ const xe = K(null);
1160
+ xe.displayName = "PlayListPortalContext";
1161
+ const Me = K(null);
1162
+ Me.displayName = "PlayListEmptyContext";
1163
+ const rr = z(function({
1137
1164
  data: t
1138
1165
  }) {
1139
- const { curPlayId: n } = K(), { coverImgsCss: a } = N(), r = n === t.id;
1140
- return /* @__PURE__ */ s(
1166
+ const { curPlayId: n } = $(), { coverImgsCss: a } = L(), r = n === t.id;
1167
+ return /* @__PURE__ */ c(
1141
1168
  "div",
1142
1169
  {
1143
1170
  className: `rmap-playlist-item${r ? " rmap-cur-played" : ""}`,
1144
1171
  "data-testid": "playlist-item",
1145
1172
  "aria-current": r ? "true" : void 0,
1146
1173
  children: /* @__PURE__ */ w("div", { className: "rmap-playlist-item-contents", children: [
1147
- /* @__PURE__ */ s("div", { className: "rmap-playlist-album-cover", children: t.img && /* @__PURE__ */ s(
1174
+ /* @__PURE__ */ c("div", { className: "rmap-playlist-album-cover", children: t.img && /* @__PURE__ */ c(
1148
1175
  "img",
1149
1176
  {
1150
1177
  src: t.img,
@@ -1153,22 +1180,22 @@ const er = G(function({
1153
1180
  }
1154
1181
  ) }),
1155
1182
  /* @__PURE__ */ w("div", { className: "rmap-playlist-album-info", children: [
1156
- t.writer && /* @__PURE__ */ s("span", { className: "rmap-playlist-writer", children: t.writer }),
1157
- t.name && /* @__PURE__ */ s("span", { className: "rmap-playlist-title", children: t.name }),
1158
- t.description && /* @__PURE__ */ s("div", { className: "rmap-playlist-description", children: t.description })
1183
+ t.writer && /* @__PURE__ */ c("span", { className: "rmap-playlist-writer", children: t.writer }),
1184
+ t.name && /* @__PURE__ */ c("span", { className: "rmap-playlist-title", children: t.name }),
1185
+ t.description && /* @__PURE__ */ c("div", { className: "rmap-playlist-description", children: t.description })
1159
1186
  ] })
1160
1187
  ] })
1161
1188
  }
1162
1189
  );
1163
- }), tr = ({
1190
+ }), ar = ({
1164
1191
  setIsOpen: e
1165
1192
  }) => {
1166
- const { playList: t } = K(), { activeUI: n } = x(), a = E(L), [r, i] = b(0), o = g(
1167
- (c) => {
1193
+ const { playList: t } = $(), { activeUI: n } = M(), a = A(b), [r, i] = N(0), s = E(
1194
+ (o) => {
1168
1195
  a({
1169
1196
  type: "SET_CURRENT_AUDIO",
1170
- currentIndex: c,
1171
- currentAudioId: t[c].id
1197
+ currentIndex: o,
1198
+ currentAudioId: t[o].id
1172
1199
  });
1173
1200
  },
1174
1201
  [a, t]
@@ -1181,31 +1208,31 @@ const er = G(function({
1181
1208
  sortableItemEventProps: {
1182
1209
  draggable: n.playList !== "unSortable",
1183
1210
  dragStartIdx: r,
1184
- onDragStart: (c) => i(c),
1185
- onDrop: (c, u) => a({
1211
+ onDragStart: (o) => i(o),
1212
+ onDrop: (o, u) => a({
1186
1213
  type: "UPDATE_PLAY_LIST",
1187
1214
  playList: u
1188
1215
  }),
1189
- onReorder: (c) => a({
1216
+ onReorder: (o) => a({
1190
1217
  type: "UPDATE_PLAY_LIST",
1191
- playList: c
1218
+ playList: o
1192
1219
  }),
1193
- onClick: (c) => o(c)
1220
+ onClick: (o) => s(o)
1194
1221
  }
1195
1222
  };
1196
- }, rr = () => {
1197
- const { playList: e } = K(), { isOpen: t, setIsOpen: n } = E(ie), a = he(Ce), r = he(xe), { cssTransitionEventProps: i, sortableItemEventProps: o } = tr({
1223
+ }, nr = () => {
1224
+ const { playList: e } = $(), { isOpen: t, setIsOpen: n } = A(ie), a = he(xe), r = he(Me), { cssTransitionEventProps: i, sortableItemEventProps: s } = ar({
1198
1225
  setIsOpen: n
1199
1226
  }), {
1200
- onClick: c,
1227
+ onClick: o,
1201
1228
  onDragStart: u,
1202
1229
  ...d
1203
- } = o;
1204
- if (!a) return /* @__PURE__ */ s(R, {});
1230
+ } = s;
1231
+ if (!a) return /* @__PURE__ */ c(G, {});
1205
1232
  const l = e.length === 0;
1206
- return l && !r ? /* @__PURE__ */ s(R, {}) : _t.createPortal(
1207
- /* @__PURE__ */ s(
1208
- ke,
1233
+ return l && !r ? /* @__PURE__ */ c(G, {}) : Rt.createPortal(
1234
+ /* @__PURE__ */ c(
1235
+ Ce,
1209
1236
  {
1210
1237
  visible: t,
1211
1238
  name: "rmap-playlist-content",
@@ -1213,68 +1240,68 @@ const er = G(function({
1213
1240
  leaveTime: 20,
1214
1241
  clearTime: 300,
1215
1242
  ...i,
1216
- children: /* @__PURE__ */ s("div", { className: "rmap-playlist-container", children: l ? r : /* @__PURE__ */ s(ge, { children: e.map((p, m) => /* @__PURE__ */ s(
1217
- ge.Item,
1243
+ children: /* @__PURE__ */ c("div", { className: "rmap-playlist-container", children: l ? r : /* @__PURE__ */ c(Ee, { children: e.map((m, p) => /* @__PURE__ */ c(
1244
+ Ee.Item,
1218
1245
  {
1219
- index: m,
1246
+ index: p,
1220
1247
  listData: e,
1221
- onClick: () => c(m),
1222
- onDragStart: () => u(m),
1248
+ onClick: () => o(p),
1249
+ onDragStart: () => u(p),
1223
1250
  ...d,
1224
- children: /* @__PURE__ */ s(er, { data: p })
1251
+ children: /* @__PURE__ */ c(rr, { data: m })
1225
1252
  },
1226
- p.id
1253
+ m.id
1227
1254
  )) }) })
1228
1255
  }
1229
1256
  ),
1230
1257
  a
1231
1258
  );
1232
- }, ar = () => {
1233
- const { customIcons: e } = N();
1234
- return /* @__PURE__ */ s(
1235
- M,
1259
+ }, or = () => {
1260
+ const { customIcons: e } = L();
1261
+ return /* @__PURE__ */ c(
1262
+ D,
1236
1263
  {
1237
- render: /* @__PURE__ */ s(Xe, { size: "100%" }),
1264
+ render: /* @__PURE__ */ c(Je, { size: "100%" }),
1238
1265
  customIcon: e == null ? void 0 : e.playList
1239
1266
  }
1240
1267
  );
1241
- }, dt = ({
1268
+ }, mt = ({
1242
1269
  initialExpanded: e,
1243
1270
  gridArea: t,
1244
1271
  visible: n,
1245
1272
  ...a
1246
1273
  }) => {
1247
- const { playListExpanded: r } = x(), i = e ?? r, o = z("playList", t);
1248
- return /* @__PURE__ */ s(_.Item, { gridArea: o, visible: n ?? !0, ...a, children: /* @__PURE__ */ w(ne, { initialOpen: i, children: [
1249
- /* @__PURE__ */ s(
1250
- ne.Trigger,
1274
+ const { playListExpanded: r } = M(), i = e ?? r, s = B("playList", t);
1275
+ return /* @__PURE__ */ c(_.Item, { gridArea: s, visible: n ?? !0, ...a, children: /* @__PURE__ */ w(oe, { initialOpen: i, children: [
1276
+ /* @__PURE__ */ c(
1277
+ oe.Trigger,
1251
1278
  {
1252
1279
  "aria-label": "Playlist",
1253
1280
  "data-testid": "playlist-trigger-btn",
1254
- children: /* @__PURE__ */ s(ar, {})
1281
+ children: /* @__PURE__ */ c(or, {})
1255
1282
  }
1256
1283
  ),
1257
- /* @__PURE__ */ s(ne.Content, { "aria-label": "Playlist", children: /* @__PURE__ */ s(rr, {}) })
1284
+ /* @__PURE__ */ c(oe.Content, { "aria-label": "Playlist", children: /* @__PURE__ */ c(nr, {}) })
1258
1285
  ] }) });
1259
- }, Z = (e) => {
1286
+ }, ee = (e) => {
1260
1287
  const t = `${Math.floor(e / 60)}`.padStart(2, "0"), n = `${Math.floor(e % 60)}`.padStart(2, "0");
1261
1288
  return `${t}:${n}`;
1262
- }, me = (e, t, n = 0) => {
1289
+ }, pe = (e, t, n = 0) => {
1263
1290
  if (!t) return n;
1264
1291
  const a = e / t;
1265
1292
  return isFinite(a) ? a : n;
1266
- }, mt = () => {
1267
- const { isLoadedMetaData: e } = C(), { elementRefs: t } = N(), [n, a] = b(!1), r = g(
1293
+ }, yt = () => {
1294
+ const { isLoadedMetaData: e } = k(), { elementRefs: t } = L(), [n, a] = N(!1), r = E(
1268
1295
  (i) => {
1269
1296
  if (!(t != null && t.audioEl) || !e) return;
1270
- const { clientX: o } = i, { clientWidth: c } = i.currentTarget, u = i.currentTarget.getBoundingClientRect(), d = o - u.x, l = me(d, c) * t.audioEl.duration;
1297
+ const { clientX: s } = i, { clientWidth: o } = i.currentTarget, u = i.currentTarget.getBoundingClientRect(), d = s - u.x, l = pe(d, o) * t.audioEl.duration;
1271
1298
  t.audioEl.currentTime = l;
1272
1299
  },
1273
1300
  [e, t == null ? void 0 : t.audioEl]
1274
1301
  );
1275
1302
  return P(() => {
1276
1303
  if (!n) return;
1277
- const i = (o) => o.preventDefault();
1304
+ const i = (s) => s.preventDefault();
1278
1305
  return document.addEventListener("selectstart", i), () => {
1279
1306
  document.removeEventListener("selectstart", i);
1280
1307
  };
@@ -1285,9 +1312,9 @@ const er = G(function({
1285
1312
  onMouseMove: n ? r : void 0,
1286
1313
  onClick: r
1287
1314
  };
1288
- }, pt = (e) => {
1289
- const { isLoadedMetaData: t } = C(), { elementRefs: n } = N();
1290
- return g(
1315
+ }, vt = (e) => {
1316
+ const { isLoadedMetaData: t } = k(), { elementRefs: n } = L();
1317
+ return E(
1291
1318
  (a) => {
1292
1319
  if (!(n != null && n.audioEl) || !t) return;
1293
1320
  const r = n.audioEl;
@@ -1312,18 +1339,18 @@ const er = G(function({
1312
1339
  },
1313
1340
  [n == null ? void 0 : n.audioEl, t, e]
1314
1341
  );
1315
- }, nr = () => {
1316
- const { currentTime: e, duration: t } = te(), n = A(null), [a, r] = b(0);
1342
+ }, ir = () => {
1343
+ const { currentTime: e, duration: t } = re(), n = S(null), [a, r] = N(0);
1317
1344
  P(() => {
1318
1345
  const d = n.current;
1319
1346
  if (!d) return;
1320
1347
  r(d.offsetWidth);
1321
- const l = new ResizeObserver(([p]) => {
1322
- r(p.contentBoxSize[0].inlineSize);
1348
+ const l = new ResizeObserver(([m]) => {
1349
+ r(m.contentBoxSize[0].inlineSize);
1323
1350
  });
1324
1351
  return l.observe(d), () => l.disconnect();
1325
1352
  }, []);
1326
- const i = me(e, t), o = mt(), c = pt(), u = i * a;
1353
+ const i = pe(e, t), s = yt(), o = vt(), u = i * a;
1327
1354
  return /* @__PURE__ */ w(
1328
1355
  "div",
1329
1356
  {
@@ -1336,20 +1363,20 @@ const er = G(function({
1336
1363
  "aria-valuemin": 0,
1337
1364
  "aria-valuemax": 100,
1338
1365
  "aria-valuenow": Math.round(i * 100),
1339
- "aria-valuetext": `${Z(
1366
+ "aria-valuetext": `${ee(
1340
1367
  e
1341
- )} of ${Z(t)}`,
1342
- onKeyDown: c,
1343
- ...o,
1368
+ )} of ${ee(t)}`,
1369
+ onKeyDown: o,
1370
+ ...s,
1344
1371
  children: [
1345
- /* @__PURE__ */ s("div", { className: "rmap-progress-bar", children: /* @__PURE__ */ s(
1372
+ /* @__PURE__ */ c("div", { className: "rmap-progress-bar", children: /* @__PURE__ */ c(
1346
1373
  "div",
1347
1374
  {
1348
1375
  className: "rmap-progress-fill",
1349
1376
  style: { transform: `scaleX(${i})` }
1350
1377
  }
1351
1378
  ) }),
1352
- /* @__PURE__ */ s(
1379
+ /* @__PURE__ */ c(
1353
1380
  "div",
1354
1381
  {
1355
1382
  className: "rmap-progress-handle",
@@ -1361,65 +1388,65 @@ const er = G(function({
1361
1388
  ]
1362
1389
  }
1363
1390
  );
1364
- }, or = (e, t) => {
1365
- const n = A(), a = g(() => {
1391
+ }, sr = (e, t) => {
1392
+ const n = S(), a = E(() => {
1366
1393
  const r = document.getElementsByClassName("rmap-player-provider")[0];
1367
1394
  if (!r) return;
1368
1395
  const i = Object.entries(
1369
1396
  e
1370
1397
  ).reduce(
1371
- (o, [c, u]) => ({
1372
- ...o,
1373
- [c]: window.getComputedStyle(r).getPropertyValue(`${u}`)
1398
+ (s, [o, u]) => ({
1399
+ ...s,
1400
+ [o]: window.getComputedStyle(r).getPropertyValue(`${u}`)
1374
1401
  }),
1375
1402
  {}
1376
1403
  );
1377
1404
  n.current = i;
1378
1405
  }, [e]);
1379
- return Te(() => {
1406
+ return ge(() => {
1380
1407
  a();
1381
1408
  const r = window.matchMedia("(prefers-color-scheme: dark)");
1382
1409
  return r.addEventListener("change", a), () => r.removeEventListener("change", a);
1383
1410
  }, [a, t]), n;
1384
- }, ir = {
1411
+ }, cr = {
1385
1412
  progressColor: "--rm-audio-player-waveform-bar",
1386
1413
  waveColor: "--rm-audio-player-waveform-background"
1387
- }, sr = (e) => {
1414
+ }, lr = (e) => {
1388
1415
  const t = e.backend;
1389
1416
  if (!(!(t != null && t.media) || !t.mediaListeners))
1390
1417
  for (const [n, a] of Object.entries(t.mediaListeners))
1391
1418
  t.media.removeEventListener(n, a);
1392
- }, cr = (e) => {
1393
- const t = E(L), { isPlaying: n } = C(), { curPlayId: a } = K(), { elementRefs: r } = N(), { colorScheme: i } = x(), o = or(ir, i), c = A(r == null ? void 0 : r.waveformInst);
1394
- c.current = r == null ? void 0 : r.waveformInst, P(() => {
1395
- var y, f;
1396
- if (r != null && r.waveformInst || !((y = o.current) != null && y.progressColor) || !((f = o.current) != null && f.waveColor))
1419
+ }, ur = (e) => {
1420
+ const t = A(b), { isPlaying: n } = k(), { curPlayId: a } = $(), { elementRefs: r } = L(), { colorScheme: i } = M(), s = sr(cr, i), o = S(r == null ? void 0 : r.waveformInst);
1421
+ o.current = r == null ? void 0 : r.waveformInst, P(() => {
1422
+ var v, f;
1423
+ if (r != null && r.waveformInst || !((v = s.current) != null && v.progressColor) || !((f = s.current) != null && f.waveColor))
1397
1424
  return;
1398
- let m = !1;
1399
- return import("./wavesurfer-_j5aw4gZ.mjs").then((v) => v.w).then(({ default: v }) => {
1400
- var h, I;
1401
- if (m || !e.current || !((h = o.current) != null && h.progressColor) || !((I = o.current) != null && I.waveColor)) {
1425
+ let p = !1;
1426
+ return import("./wavesurfer-_j5aw4gZ.mjs").then((y) => y.w).then(({ default: y }) => {
1427
+ var h, g;
1428
+ if (p || !e.current || !((h = s.current) != null && h.progressColor) || !((g = s.current) != null && g.waveColor)) {
1402
1429
  console.error("[useWaveSurfer] missing required dependencies");
1403
1430
  return;
1404
1431
  }
1405
1432
  let T;
1406
1433
  try {
1407
- T = v.create({
1434
+ T = y.create({
1408
1435
  barWidth: 1,
1409
1436
  cursorWidth: 2,
1410
1437
  container: e.current,
1411
1438
  height: 80,
1412
- progressColor: o.current.progressColor,
1439
+ progressColor: s.current.progressColor,
1413
1440
  responsive: !0,
1414
- waveColor: o.current.waveColor,
1441
+ waveColor: s.current.waveColor,
1415
1442
  cursorColor: "var(--rm-audio-player-waveform-cursor)",
1416
1443
  backend: "MediaElement",
1417
1444
  removeMediaElementOnDestroy: !1
1418
1445
  });
1419
- } catch (B) {
1446
+ } catch (C) {
1420
1447
  console.error(
1421
1448
  "[useWaveSurfer] failed to create WaveSurfer instance",
1422
- B
1449
+ C
1423
1450
  );
1424
1451
  return;
1425
1452
  }
@@ -1427,41 +1454,41 @@ const er = G(function({
1427
1454
  type: "SET_ELEMENT_REFS",
1428
1455
  elementRefs: { waveformInst: T }
1429
1456
  });
1430
- }).catch((v) => {
1431
- console.error("[useWaveSurfer] failed to load wavesurfer.js", v);
1457
+ }).catch((y) => {
1458
+ console.error("[useWaveSurfer] failed to load wavesurfer.js", y);
1432
1459
  }), () => {
1433
- m = !0;
1460
+ p = !0;
1434
1461
  };
1435
- }, [r == null ? void 0 : r.waveformInst, t, o]);
1436
- const u = A(a);
1462
+ }, [r == null ? void 0 : r.waveformInst, t, s]);
1463
+ const u = S(a);
1437
1464
  P(() => {
1438
1465
  if (!(r != null && r.audioEl) || !(r != null && r.waveformInst)) return;
1439
- const m = r.audioEl;
1440
- if (!m.getAttribute("src")) return;
1441
- const y = r.waveformInst, f = u.current !== a;
1466
+ const p = r.audioEl;
1467
+ if (!p.getAttribute("src")) return;
1468
+ const v = r.waveformInst, f = u.current !== a;
1442
1469
  u.current = a;
1443
- const v = f ? 0 : m.currentTime, T = n;
1444
- sr(y), y.load(m);
1470
+ const y = f ? 0 : p.currentTime, T = n;
1471
+ lr(v), v.load(p);
1445
1472
  const h = () => {
1446
- !f && v > 0 && m.duration && (m.currentTime = v, y.seekTo(v / m.duration)), T && m.play();
1473
+ !f && y > 0 && p.duration && (p.currentTime = y, v.seekTo(y / p.duration)), T && p.play();
1447
1474
  };
1448
- return y.on("ready", h), () => {
1449
- y.un("ready", h);
1475
+ return v.on("ready", h), () => {
1476
+ v.un("ready", h);
1450
1477
  };
1451
1478
  }, [a, r == null ? void 0 : r.audioEl, r == null ? void 0 : r.waveformInst]), P(() => {
1452
1479
  if (!e.current || !(r != null && r.waveformInst)) return;
1453
- const m = () => {
1454
- var f, v;
1455
- (v = (f = r.waveformInst) == null ? void 0 : f.drawer) == null || v.fireEvent("redraw");
1456
- }, y = new ResizeObserver(m);
1457
- return y.observe(e.current), () => {
1458
- y.disconnect();
1480
+ const p = () => {
1481
+ var f, y;
1482
+ (y = (f = r.waveformInst) == null ? void 0 : f.drawer) == null || y.fireEvent("redraw");
1483
+ }, v = new ResizeObserver(p);
1484
+ return v.observe(e.current), () => {
1485
+ v.disconnect();
1459
1486
  };
1460
1487
  }, [r == null ? void 0 : r.waveformInst, e]), P(
1461
1488
  () => () => {
1462
- var y, f;
1463
- const m = (y = e.current) == null ? void 0 : y.querySelector("wave");
1464
- m && m.remove(), (f = c.current) == null || f.destroy(), t({
1489
+ var v, f;
1490
+ const p = (v = e.current) == null ? void 0 : v.querySelector("wave");
1491
+ p && p.remove(), (f = o.current) == null || f.destroy(), t({
1465
1492
  type: "SET_ELEMENT_REFS",
1466
1493
  elementRefs: { waveformInst: void 0 }
1467
1494
  });
@@ -1470,31 +1497,31 @@ const er = G(function({
1470
1497
  [t]
1471
1498
  );
1472
1499
  const d = () => {
1473
- var v, T;
1474
- const m = c.current;
1475
- if (!(m != null && m.isReady)) return;
1476
- const y = (v = o.current) == null ? void 0 : v.waveColor, f = (T = o.current) == null ? void 0 : T.progressColor;
1477
- y && m.setWaveColor(y), f && m.setProgressColor(f);
1478
- }, l = A(d);
1500
+ var y, T;
1501
+ const p = o.current;
1502
+ if (!(p != null && p.isReady)) return;
1503
+ const v = (y = s.current) == null ? void 0 : y.waveColor, f = (T = s.current) == null ? void 0 : T.progressColor;
1504
+ v && p.setWaveColor(v), f && p.setProgressColor(f);
1505
+ }, l = S(d);
1479
1506
  l.current = d;
1480
- const p = A(i);
1507
+ const m = S(i);
1481
1508
  P(() => {
1482
- p.current !== i && (p.current = i, l.current());
1509
+ m.current !== i && (m.current = i, l.current());
1483
1510
  }, [i, r == null ? void 0 : r.waveformInst]), P(() => {
1484
- const m = () => l.current(), y = window.matchMedia("(prefers-color-scheme: dark)");
1485
- return y.addEventListener("change", m), () => y.removeEventListener("change", m);
1511
+ const p = () => l.current(), v = window.matchMedia("(prefers-color-scheme: dark)");
1512
+ return v.addEventListener("change", p), () => v.removeEventListener("change", p);
1486
1513
  }, []);
1487
- }, lr = ({ isActive: e }) => {
1488
- var u, d, l, p;
1489
- const t = A(null), { isLoadedMetaData: n, isPlaying: a } = C(), { elementRefs: r } = N();
1490
- cr(t), P(() => {
1514
+ }, dr = ({ isActive: e }) => {
1515
+ var u, d, l, m;
1516
+ const t = S(null), { isLoadedMetaData: n, isPlaying: a } = k(), { elementRefs: r } = L();
1517
+ ur(t), P(() => {
1491
1518
  if (!e || !(r != null && r.waveformInst) || !(r != null && r.audioEl) || !n || a)
1492
1519
  return;
1493
- const m = me(
1520
+ const p = pe(
1494
1521
  r.audioEl.currentTime,
1495
1522
  r.audioEl.duration
1496
1523
  );
1497
- r.waveformInst.seekTo(m);
1524
+ r.waveformInst.seekTo(p);
1498
1525
  }, [
1499
1526
  e,
1500
1527
  n,
@@ -1502,14 +1529,14 @@ const er = G(function({
1502
1529
  r == null ? void 0 : r.audioEl,
1503
1530
  a
1504
1531
  ]);
1505
- const i = mt(), o = g(
1506
- (m, y) => {
1532
+ const i = yt(), s = E(
1533
+ (p, v) => {
1507
1534
  var f;
1508
- y && ((f = r == null ? void 0 : r.waveformInst) == null || f.seekTo(me(m, y)));
1535
+ v && ((f = r == null ? void 0 : r.waveformInst) == null || f.seekTo(pe(p, v)));
1509
1536
  },
1510
1537
  [r == null ? void 0 : r.waveformInst]
1511
- ), c = pt(o);
1512
- return /* @__PURE__ */ s("div", { className: "rmap-waveform-wrapper", "data-active": e, children: /* @__PURE__ */ s(
1538
+ ), o = vt(s);
1539
+ return /* @__PURE__ */ c("div", { className: "rmap-waveform-wrapper", "data-active": e, children: /* @__PURE__ */ c(
1513
1540
  "div",
1514
1541
  {
1515
1542
  id: "rm-waveform",
@@ -1522,105 +1549,60 @@ const er = G(function({
1522
1549
  "aria-valuenow": Math.round(
1523
1550
  (((u = r == null ? void 0 : r.audioEl) == null ? void 0 : u.currentTime) ?? 0) / (((d = r == null ? void 0 : r.audioEl) == null ? void 0 : d.duration) || 1) * 100
1524
1551
  ),
1525
- "aria-valuetext": `${Z(
1552
+ "aria-valuetext": `${ee(
1526
1553
  ((l = r == null ? void 0 : r.audioEl) == null ? void 0 : l.currentTime) ?? 0
1527
- )} of ${Z(((p = r == null ? void 0 : r.audioEl) == null ? void 0 : p.duration) ?? 0)}`,
1528
- onKeyDown: c,
1554
+ )} of ${ee(((m = r == null ? void 0 : r.audioEl) == null ? void 0 : m.duration) ?? 0)}`,
1555
+ onKeyDown: o,
1529
1556
  ...i
1530
1557
  }
1531
1558
  ) });
1532
- }, yt = ({
1559
+ }, ft = ({
1533
1560
  gridArea: e,
1534
1561
  visible: t,
1535
1562
  type: n,
1536
1563
  width: a,
1537
1564
  ...r
1538
1565
  }) => {
1539
- const { activeUI: i } = x(), o = n ?? (i.progress === "waveform" ? "waveform" : "bar"), c = o === "waveform", u = o === "bar", [d, l] = b(c);
1566
+ const { activeUI: i } = M(), s = n ?? (i.progress === "waveform" ? "waveform" : "bar"), o = s === "waveform", u = s === "bar", [d, l] = N(o);
1540
1567
  P(() => {
1541
- c && !d && l(!0);
1542
- }, [c, d]);
1543
- const p = z("progress", e);
1544
- return /* @__PURE__ */ s(
1568
+ o && !d && l(!0);
1569
+ }, [o, d]);
1570
+ const m = B("progress", e);
1571
+ return /* @__PURE__ */ c(
1545
1572
  _.Item,
1546
1573
  {
1547
- gridArea: p,
1574
+ gridArea: m,
1548
1575
  width: a ?? "100%",
1549
1576
  visible: t ?? !0,
1550
1577
  ...r,
1551
1578
  children: /* @__PURE__ */ w("div", { className: "rmap-progress-container", children: [
1552
- d && /* @__PURE__ */ s(lr, { isActive: c }),
1553
- u && /* @__PURE__ */ s(nr, {})
1579
+ d && /* @__PURE__ */ c(dr, { isActive: o }),
1580
+ u && /* @__PURE__ */ c(ir, {})
1554
1581
  ] })
1555
1582
  }
1556
1583
  );
1557
- }, ur = ({
1558
- placement: e
1559
- }) => {
1560
- var p;
1561
- const t = A(null), { volume: n, muted: a } = C(), { elementRefs: r } = N(), i = E(L), o = g(
1562
- (m) => {
1563
- m.stopPropagation(), m.preventDefault(), a && i({ type: "SET_MUTED", muted: !1 });
1564
- const { value: y } = m.target, f = parseFloat(y);
1565
- i({
1566
- type: "SET_VOLUME",
1567
- volume: f
1568
- });
1569
- },
1570
- [a, i]
1571
- ), c = n ?? ((p = r == null ? void 0 : r.audioEl) == null ? void 0 : p.volume) ?? 0, u = c * 100, d = Math.round(u), l = k(
1572
- () => ({
1573
- "--rm-audio-player-volume-value": `${u}%`
1574
- }),
1575
- [u]
1576
- );
1577
- return /* @__PURE__ */ s(
1578
- "div",
1579
- {
1580
- ref: t,
1581
- className: "rmap-volume-container",
1582
- "data-placement": e,
1583
- "data-testid": "volume-slider",
1584
- style: l,
1585
- children: /* @__PURE__ */ s("div", { className: "rmap-volume-panel", children: /* @__PURE__ */ s(
1586
- "input",
1587
- {
1588
- className: "rmap-volume-slider",
1589
- type: "range",
1590
- style: { cursor: "pointer" },
1591
- value: c,
1592
- onChange: o,
1593
- min: "0",
1594
- max: "1",
1595
- step: "0.01",
1596
- "aria-label": a ? "Volume (muted)" : "Volume",
1597
- "aria-valuetext": `${d} percent`
1598
- }
1599
- ) })
1600
- }
1601
- );
1602
- }, pe = O(null);
1603
- pe.displayName = "DropdownContext";
1604
- const vt = ({
1584
+ }, me = K(null);
1585
+ me.displayName = "DropdownContext";
1586
+ const Tt = ({
1605
1587
  clickArea: e,
1606
1588
  triggerType: t,
1607
1589
  isOpen: n,
1608
1590
  setIsOpen: a,
1609
1591
  onOpenChange: r
1610
1592
  }) => {
1611
- const i = A(), o = (l) => {
1612
- const p = () => {
1593
+ const i = S(), s = (l) => {
1594
+ const m = () => {
1613
1595
  clearTimeout(i.current), i.current = void 0;
1614
- }, m = (y) => {
1615
- a(y), r && r(y), p();
1596
+ }, p = (v) => {
1597
+ a(v), r && r(v), m();
1616
1598
  };
1617
- if (p(), l) {
1618
- i.current = window.setTimeout(() => m(!0), 100);
1599
+ if (m(), l) {
1600
+ i.current = window.setTimeout(() => p(!0), 100);
1619
1601
  return;
1620
1602
  }
1621
- i.current = window.setTimeout(() => m(!1), 100);
1622
- }, c = (l) => {
1623
- t === "hover" && o(l);
1603
+ i.current = window.setTimeout(() => p(!1), 100);
1604
+ }, o = (l) => {
1605
+ t === "hover" && s(l);
1624
1606
  };
1625
1607
  return {
1626
1608
  onClick: e === "content" ? (l) => {
@@ -1628,56 +1610,56 @@ const vt = ({
1628
1610
  } : () => {
1629
1611
  t === "click" && (a(!n), r && r(!n));
1630
1612
  },
1631
- onKeyUp: () => c(!0),
1632
- onMouseEnter: () => c(!0),
1633
- onMouseLeave: () => c(!1),
1634
- onFocus: () => c(!0),
1635
- onBlur: () => c(!1)
1613
+ onKeyUp: () => o(!0),
1614
+ onMouseEnter: () => o(!0),
1615
+ onMouseLeave: () => o(!1),
1616
+ onFocus: () => o(!0),
1617
+ onBlur: () => o(!1)
1636
1618
  };
1637
- }, oe = ({
1619
+ }, j = ({
1638
1620
  triggerType: e = "click",
1639
1621
  outboundClickActive: t = !0,
1640
1622
  children: n,
1641
1623
  isOpen: a,
1642
1624
  placement: r = "bottom",
1643
1625
  disabled: i = !1,
1644
- onOpenChange: o,
1645
- "data-testid": c
1626
+ onOpenChange: s,
1627
+ "data-testid": o
1646
1628
  }) => {
1647
- const u = A(null), [d, l] = ee.Children.toArray(n), [p, m] = b(!1), y = vt({
1648
- setIsOpen: m,
1649
- isOpen: p,
1629
+ const u = S(null), [d, l] = te.Children.toArray(n), [m, p] = N(!1), v = Tt({
1630
+ setIsOpen: p,
1631
+ isOpen: m,
1650
1632
  triggerType: e,
1651
1633
  clickArea: "root"
1652
- }), f = Be();
1653
- lt(u, () => t && m(!1)), P(() => {
1654
- a !== void 0 && m(a);
1634
+ }), f = $e();
1635
+ dt(u, () => t && p(!1)), P(() => {
1636
+ a !== void 0 && p(a);
1655
1637
  }, [a]);
1656
- const v = k(
1638
+ const y = x(
1657
1639
  () => ({
1658
1640
  dropdownRef: u,
1659
1641
  placement: r,
1660
- isOpen: p,
1661
- setIsOpen: m,
1662
- onOpenChange: o,
1642
+ isOpen: m,
1643
+ setIsOpen: p,
1644
+ onOpenChange: s,
1663
1645
  dropdownId: f
1664
1646
  }),
1665
- [r, p, o, f]
1647
+ [r, m, s, f]
1666
1648
  );
1667
- return /* @__PURE__ */ s(pe.Provider, { value: v, children: /* @__PURE__ */ s(
1649
+ return /* @__PURE__ */ c(me.Provider, { value: y, children: /* @__PURE__ */ c(
1668
1650
  "div",
1669
1651
  {
1670
1652
  className: "rmap-dropdown-container",
1671
1653
  ref: u,
1672
- "data-testid": c,
1673
- ...y,
1674
- children: /* @__PURE__ */ w(R, { children: [
1654
+ "data-testid": o,
1655
+ ...v,
1656
+ children: /* @__PURE__ */ w(G, { children: [
1675
1657
  d,
1676
1658
  !i && l
1677
1659
  ] })
1678
1660
  }
1679
1661
  ) });
1680
- }, dr = (e, t) => k(() => {
1662
+ }, pr = (e, t) => x(() => {
1681
1663
  if (t)
1682
1664
  return {
1683
1665
  position: "absolute",
@@ -1693,46 +1675,46 @@ const vt = ({
1693
1675
  isWithAnimation: t = !0,
1694
1676
  ...n
1695
1677
  }) => {
1696
- const { dropdownRef: a, placement: r, isOpen: i, setIsOpen: o, dropdownId: c } = E(pe), [u, d] = b(), { onClick: l } = vt({
1697
- setIsOpen: o,
1678
+ const { dropdownRef: a, placement: r, isOpen: i, setIsOpen: s, dropdownId: o } = A(me), [u, d] = N(), { onClick: l } = Tt({
1679
+ setIsOpen: s,
1698
1680
  isOpen: i,
1699
1681
  clickArea: "content"
1700
- }), p = () => o(!1), m = () => o(!0);
1682
+ }), m = () => s(!1), p = () => s(!0);
1701
1683
  P(() => {
1702
1684
  a.current && d({
1703
1685
  width: a.current.offsetWidth,
1704
1686
  height: a.current.offsetHeight
1705
1687
  });
1706
1688
  }, [a]);
1707
- const y = dr(r, u), f = u ? /* @__PURE__ */ s(
1689
+ const v = pr(r, u), f = u ? /* @__PURE__ */ c(
1708
1690
  "div",
1709
1691
  {
1710
1692
  ...n,
1711
- id: c,
1712
- style: { ...y, ...n.style },
1693
+ id: o,
1694
+ style: { ...v, ...n.style },
1713
1695
  onClick: l,
1714
1696
  children: e
1715
1697
  }
1716
1698
  ) : null;
1717
- return t ? /* @__PURE__ */ s(
1718
- ke,
1699
+ return t ? /* @__PURE__ */ c(
1700
+ Ce,
1719
1701
  {
1720
1702
  visible: i,
1721
1703
  name: "rmap-dropdown-content",
1722
1704
  enterTime: 20,
1723
1705
  leaveTime: 60,
1724
1706
  clearTime: 300,
1725
- onExited: p,
1726
- onEntered: m,
1707
+ onExited: m,
1708
+ onEntered: p,
1727
1709
  children: f
1728
1710
  }
1729
1711
  ) : i ? f : null;
1730
- }, ft = Pe(({ children: e, className: t, ...n }, a) => {
1731
- const { isOpen: r, dropdownId: i } = E(pe), o = t ? `rmap-dropdown-trigger ${t}` : "rmap-dropdown-trigger";
1732
- return /* @__PURE__ */ s(
1733
- j,
1712
+ }, ht = Pe(({ children: e, className: t, ...n }, a) => {
1713
+ const { isOpen: r, dropdownId: i } = A(me), s = t ? `rmap-dropdown-trigger ${t}` : "rmap-dropdown-trigger";
1714
+ return /* @__PURE__ */ c(
1715
+ q,
1734
1716
  {
1735
- className: o,
1717
+ className: s,
1736
1718
  type: "button",
1737
1719
  ...n,
1738
1720
  "aria-haspopup": "true",
@@ -1743,103 +1725,262 @@ const vt = ({
1743
1725
  }
1744
1726
  );
1745
1727
  });
1746
- ft.displayName = "DropdownTrigger";
1747
- oe.Content = mr;
1748
- oe.Trigger = ft;
1749
- const pr = ({
1728
+ ht.displayName = "DropdownTrigger";
1729
+ j.Content = mr;
1730
+ j.Trigger = ht;
1731
+ const yr = ({
1750
1732
  triggerRef: e,
1751
1733
  initialState: t
1752
1734
  }) => {
1753
- const { playerPlacement: n } = x(), [a, r] = b(t);
1735
+ const { playerPlacement: n } = M(), [a, r] = N(t);
1754
1736
  return P(() => {
1755
1737
  if (e.current) {
1756
- const i = () => e.current.getBoundingClientRect().top < window.innerHeight / 2 ? "bottom" : "top", o = setTimeout(() => {
1738
+ const i = () => e.current.getBoundingClientRect().top < window.innerHeight / 2 ? "bottom" : "top", s = setTimeout(() => {
1757
1739
  r(i());
1758
1740
  }, 0);
1759
1741
  return () => {
1760
- clearTimeout(o);
1742
+ clearTimeout(s);
1761
1743
  };
1762
1744
  }
1763
1745
  }, [n, e]), a;
1764
- }, ht = ({ gridArea: e, visible: t, ...n }) => {
1765
- const a = A(null), { muted: r } = C(), i = E(L), o = g(
1766
- () => i({ type: "SET_MUTED", muted: !r }),
1767
- [i, r]
1768
- ), {
1769
- activeUI: { volumeSlider: c },
1770
- volumeSliderPlacement: u
1771
- } = x(), d = pr({
1746
+ }, gt = ({
1747
+ triggerType: e,
1748
+ placement: t,
1749
+ contextPlacement: n,
1750
+ triggerRef: a,
1751
+ defaults: r
1752
+ }) => {
1753
+ const i = yr({
1772
1754
  triggerRef: a,
1773
- initialState: "bottom"
1774
- }), l = z("volume", e);
1775
- return /* @__PURE__ */ s(_.Item, { gridArea: l, visible: t ?? !0, ...n, children: /* @__PURE__ */ w(
1776
- oe,
1755
+ initialState: r.placement
1756
+ }), s = e ?? r.triggerType;
1757
+ return {
1758
+ triggerType: s,
1759
+ placement: t ?? n ?? i,
1760
+ contentRole: s === "hover" ? "tooltip" : "dialog"
1761
+ };
1762
+ }, vr = [
1763
+ 0.5,
1764
+ 0.75,
1765
+ 1,
1766
+ 1.25,
1767
+ 1.5,
1768
+ 1.75,
1769
+ 2
1770
+ ], fr = (e) => `${e}×`, _e = z(
1771
+ function({
1772
+ gridArea: t,
1773
+ visible: n,
1774
+ options: a,
1775
+ formatRate: r,
1776
+ triggerType: i,
1777
+ placement: s,
1778
+ ...o
1779
+ }) {
1780
+ const u = S(null), { playbackRate: d } = k(), l = A(
1781
+ b
1782
+ ), { speedSelectorPlacement: m } = M(), p = B("playbackRate", t), v = a ?? vr, f = r ?? fr, { triggerType: y, placement: T } = gt({
1783
+ triggerType: i,
1784
+ placement: s,
1785
+ contextPlacement: m,
1786
+ triggerRef: u,
1787
+ defaults: { triggerType: "click", placement: "top" }
1788
+ }), h = E(
1789
+ (g) => {
1790
+ l({ type: "SET_PLAYBACK_RATE", playbackRate: g });
1791
+ },
1792
+ [l]
1793
+ );
1794
+ return /* @__PURE__ */ c(
1795
+ _.Item,
1796
+ {
1797
+ gridArea: p,
1798
+ visible: n ?? !0,
1799
+ ...o,
1800
+ children: /* @__PURE__ */ w(
1801
+ j,
1802
+ {
1803
+ triggerType: y,
1804
+ placement: T,
1805
+ "data-testid": "speed-selector-dropdown",
1806
+ children: [
1807
+ /* @__PURE__ */ c(
1808
+ j.Trigger,
1809
+ {
1810
+ ref: u,
1811
+ "aria-label": `Playback speed, currently ${f(
1812
+ d
1813
+ )}`,
1814
+ className: "rmap-speed-selector-trigger",
1815
+ "data-testid": "speed-selector-trigger",
1816
+ children: f(d)
1817
+ }
1818
+ ),
1819
+ /* @__PURE__ */ c(j.Content, { children: /* @__PURE__ */ c(
1820
+ "ul",
1821
+ {
1822
+ role: "menu",
1823
+ "aria-label": "Playback speed",
1824
+ className: "rmap-speed-selector-menu",
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
+ })
1841
+ }
1842
+ ) })
1843
+ ]
1844
+ }
1845
+ )
1846
+ }
1847
+ );
1848
+ }
1849
+ );
1850
+ _e.displayName = "SpeedSelector";
1851
+ const Tr = ({
1852
+ placement: e
1853
+ }) => {
1854
+ var m;
1855
+ const t = S(null), { volume: n, muted: a } = k(), { elementRefs: r } = L(), i = A(b), s = E(
1856
+ (p) => {
1857
+ p.stopPropagation(), p.preventDefault(), a && i({ type: "SET_MUTED", muted: !1 });
1858
+ const { value: v } = p.target, f = parseFloat(v);
1859
+ i({
1860
+ type: "SET_VOLUME",
1861
+ volume: f
1862
+ });
1863
+ },
1864
+ [a, i]
1865
+ ), o = n ?? ((m = r == null ? void 0 : r.audioEl) == null ? void 0 : m.volume) ?? 0, u = o * 100, d = Math.round(u), l = x(
1866
+ () => ({
1867
+ "--rm-audio-player-volume-value": `${u}%`
1868
+ }),
1869
+ [u]
1870
+ );
1871
+ return /* @__PURE__ */ c(
1872
+ "div",
1777
1873
  {
1778
- placement: u || d,
1779
- triggerType: "hover",
1780
- disabled: c === !1,
1874
+ ref: t,
1875
+ className: "rmap-volume-container",
1876
+ "data-placement": e,
1877
+ "data-testid": "volume-slider",
1878
+ style: l,
1879
+ children: /* @__PURE__ */ c("div", { className: "rmap-volume-panel", children: /* @__PURE__ */ c(
1880
+ "input",
1881
+ {
1882
+ className: "rmap-volume-slider",
1883
+ type: "range",
1884
+ style: { cursor: "pointer" },
1885
+ value: o,
1886
+ onChange: s,
1887
+ min: "0",
1888
+ max: "1",
1889
+ step: "0.01",
1890
+ "aria-label": a ? "Volume (muted)" : "Volume",
1891
+ "aria-valuetext": `${d} percent`
1892
+ }
1893
+ ) })
1894
+ }
1895
+ );
1896
+ }, Et = ({
1897
+ gridArea: e,
1898
+ visible: t,
1899
+ triggerType: n,
1900
+ placement: a,
1901
+ ...r
1902
+ }) => {
1903
+ const i = S(null), { muted: s } = k(), o = A(b), u = E(
1904
+ () => o({ type: "SET_MUTED", muted: !s }),
1905
+ [o, s]
1906
+ ), {
1907
+ activeUI: { volumeSlider: d },
1908
+ volumeSliderPlacement: l
1909
+ } = M(), m = B("volume", e), {
1910
+ triggerType: p,
1911
+ placement: v,
1912
+ contentRole: f
1913
+ } = gt({
1914
+ triggerType: n,
1915
+ placement: a,
1916
+ contextPlacement: l,
1917
+ triggerRef: i,
1918
+ defaults: { triggerType: "hover", placement: "bottom" }
1919
+ });
1920
+ return /* @__PURE__ */ c(_.Item, { gridArea: m, visible: t ?? !0, ...r, children: /* @__PURE__ */ w(
1921
+ j,
1922
+ {
1923
+ placement: v,
1924
+ triggerType: p,
1925
+ disabled: d === !1,
1781
1926
  "data-testid": "volume-dropdown",
1782
1927
  children: [
1783
- /* @__PURE__ */ s(
1784
- oe.Trigger,
1928
+ /* @__PURE__ */ c(
1929
+ j.Trigger,
1785
1930
  {
1786
- ref: a,
1787
- "aria-label": r ? "Unmute" : "Mute",
1788
- "aria-pressed": r,
1789
- onClick: o,
1931
+ ref: i,
1932
+ "aria-label": s ? "Unmute" : "Mute",
1933
+ "aria-pressed": s,
1934
+ onClick: u,
1790
1935
  className: "rmap-volume-trigger",
1791
1936
  "data-testid": "volume-trigger-btn",
1792
- "data-muted": String(r),
1793
- children: /* @__PURE__ */ s(ct, {})
1937
+ "data-muted": String(s),
1938
+ children: /* @__PURE__ */ c(ut, {})
1794
1939
  }
1795
1940
  ),
1796
- /* @__PURE__ */ s(oe.Content, { role: "tooltip", children: /* @__PURE__ */ s(
1797
- ur,
1798
- {
1799
- placement: u || d
1800
- }
1801
- ) })
1941
+ /* @__PURE__ */ c(j.Content, { role: f, children: /* @__PURE__ */ c(Tr, { placement: v }) })
1802
1942
  ]
1803
1943
  }
1804
1944
  ) });
1805
- }, yr = () => {
1806
- const { activeUI: e } = x(), t = (n) => !!(e[n] ?? e.all);
1807
- return /* @__PURE__ */ w(R, { children: [
1808
- /* @__PURE__ */ s(yt, { visible: t("progress") }),
1809
- /* @__PURE__ */ s(st, { visible: t("repeatType") }),
1810
- /* @__PURE__ */ s(it, { visible: t("playButton") }),
1811
- /* @__PURE__ */ s(ht, { visible: t("volume") }),
1812
- /* @__PURE__ */ s(dt, { visible: t("playList") })
1945
+ }, hr = () => {
1946
+ const { activeUI: e } = M(), t = (n) => !!(e[n] ?? e.all);
1947
+ return /* @__PURE__ */ w(G, { children: [
1948
+ /* @__PURE__ */ c(ft, { visible: t("progress") }),
1949
+ /* @__PURE__ */ c(lt, { visible: t("repeatType") }),
1950
+ /* @__PURE__ */ c(ct, { visible: t("playButton") }),
1951
+ /* @__PURE__ */ c(Et, { visible: t("volume") }),
1952
+ /* @__PURE__ */ c(_e, { visible: t("playbackRate") }),
1953
+ /* @__PURE__ */ c(mt, { visible: t("playList") })
1813
1954
  ] });
1814
- }, Tt = G(function({
1955
+ }, At = z(function({
1815
1956
  gridArea: t,
1816
1957
  visible: n,
1817
1958
  ...a
1818
1959
  }) {
1819
- const { playList: r, curIdx: i } = K(), { coverImgsCss: o } = N(), c = r[i], u = [c == null ? void 0 : c.writer, c == null ? void 0 : c.name].filter(Boolean).join(" - ") || "Album artwork", d = z("artwork", t);
1820
- return /* @__PURE__ */ s(_.Item, { gridArea: d, visible: n ?? !0, ...a, children: /* @__PURE__ */ s("div", { className: "rmap-artwork-container", children: c != null && c.img ? /* @__PURE__ */ s("img", { src: c.img, alt: u, style: o == null ? void 0 : o.artwork }) : /* @__PURE__ */ s(
1960
+ const { playList: r, curIdx: i } = $(), { coverImgsCss: s } = L(), o = r[i], u = [o == null ? void 0 : o.writer, o == null ? void 0 : o.name].filter(Boolean).join(" - ") || "Album artwork", d = B("artwork", t);
1961
+ return /* @__PURE__ */ c(_.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: s == null ? void 0 : s.artwork }) : /* @__PURE__ */ c(
1821
1962
  "div",
1822
1963
  {
1823
1964
  className: "rmap-artwork-fallback",
1824
1965
  role: "img",
1825
1966
  "aria-label": u,
1826
- style: o == null ? void 0 : o.artwork,
1827
- children: (c == null ? void 0 : c.name) || "♪"
1967
+ style: s == null ? void 0 : s.artwork,
1968
+ children: (o == null ? void 0 : o.name) || "♪"
1828
1969
  }
1829
1970
  ) }) });
1830
- }), Me = G(function({
1971
+ }), De = z(function({
1831
1972
  gridArea: t,
1832
1973
  visible: n,
1833
1974
  ...a
1834
1975
  }) {
1835
- const { playList: r, curIdx: i } = K(), o = r[i], c = z("trackInfo", t);
1836
- return /* @__PURE__ */ s(_.Item, { gridArea: c, visible: n ?? !0, ...a, children: /* @__PURE__ */ s("div", { className: "rmap-track-info-container", children: o != null && o.customTrackInfo ? o.customTrackInfo : /* @__PURE__ */ w(R, { children: [
1837
- (o == null ? void 0 : o.name) && /* @__PURE__ */ s("span", { className: "title", "data-testid": "track-title", children: o.name }),
1838
- (o == null ? void 0 : o.writer) && /* @__PURE__ */ s("span", { className: "writer", children: o.writer })
1976
+ const { playList: r, curIdx: i } = $(), s = r[i], o = B("trackInfo", t);
1977
+ return /* @__PURE__ */ c(_.Item, { gridArea: o, visible: n ?? !0, ...a, children: /* @__PURE__ */ c("div", { className: "rmap-track-info-container", children: s != null && s.customTrackInfo ? s.customTrackInfo : /* @__PURE__ */ w(G, { children: [
1978
+ (s == null ? void 0 : s.name) && /* @__PURE__ */ c("span", { className: "title", "data-testid": "track-title", children: s.name }),
1979
+ (s == null ? void 0 : s.writer) && /* @__PURE__ */ c("span", { className: "writer", children: s.writer })
1839
1980
  ] }) }) });
1840
1981
  });
1841
- Me.displayName = "TrackInfo";
1842
- const gt = ({ position: e, className: t, children: n, ...a }) => /* @__PURE__ */ s(
1982
+ De.displayName = "TrackInfo";
1983
+ const Pt = ({ position: e, className: t, children: n, ...a }) => /* @__PURE__ */ c(
1843
1984
  "div",
1844
1985
  {
1845
1986
  className: `rmap-track-time-container${t ? ` ${t}` : ""}`,
@@ -1847,31 +1988,31 @@ const gt = ({ position: e, className: t, children: n, ...a }) => /* @__PURE__ */
1847
1988
  ...a,
1848
1989
  children: n
1849
1990
  }
1850
- ), vr = ({ position: e }) => {
1851
- const { currentTime: t } = te();
1852
- return /* @__PURE__ */ s(gt, { position: e, className: "rmap-track-time-current", children: /* @__PURE__ */ s(
1991
+ ), gr = ({ position: e }) => {
1992
+ const { currentTime: t } = re();
1993
+ return /* @__PURE__ */ c(Pt, { position: e, className: "rmap-track-time-current", children: /* @__PURE__ */ c(
1853
1994
  "span",
1854
1995
  {
1855
1996
  className: "rmap-track-current-time",
1856
1997
  "data-testid": "track-current-time",
1857
- children: Z(t)
1998
+ children: ee(t)
1858
1999
  }
1859
2000
  ) });
1860
- }, fr = ({ position: e }) => {
1861
- const { duration: t } = te();
1862
- return /* @__PURE__ */ s(
1863
- gt,
2001
+ }, Er = ({ position: e }) => {
2002
+ const { duration: t } = re();
2003
+ return /* @__PURE__ */ c(
2004
+ Pt,
1864
2005
  {
1865
2006
  position: e,
1866
2007
  className: "rmap-track-time-duration",
1867
- children: /* @__PURE__ */ s("span", { className: "rmap-track-duration", children: Z(t) })
2008
+ children: /* @__PURE__ */ c("span", { className: "rmap-track-duration", children: ee(t) })
1868
2009
  }
1869
2010
  );
1870
- }, Et = ({ visible: e }) => {
1871
- const t = z("trackTimeCurrent"), n = z("trackTimeDuration"), a = g(
2011
+ }, St = ({ visible: e }) => {
2012
+ const t = B("trackTimeCurrent"), n = B("trackTimeDuration"), a = E(
1872
2013
  (d) => +d.split(/[^\d]/).join(""),
1873
2014
  []
1874
- ), r = a(t), i = a(n), o = g(
2015
+ ), r = a(t), i = a(n), s = E(
1875
2016
  (d) => {
1876
2017
  switch (d) {
1877
2018
  case 1:
@@ -1883,28 +2024,28 @@ const gt = ({ position: e, className: t, children: n, ...a }) => /* @__PURE__ */
1883
2024
  }
1884
2025
  },
1885
2026
  []
1886
- ), c = {
1887
- current: o(r - i),
1888
- duration: o(i - r)
2027
+ ), o = {
2028
+ current: s(r - i),
2029
+ duration: s(i - r)
1889
2030
  }, u = e ?? !0;
1890
- return /* @__PURE__ */ w(R, { children: [
1891
- /* @__PURE__ */ s(_.Item, { gridArea: t, visible: u, children: /* @__PURE__ */ s(vr, { position: c.current }) }),
1892
- /* @__PURE__ */ s(_.Item, { gridArea: n, visible: u, children: /* @__PURE__ */ s(fr, { position: c.duration }) })
2031
+ return /* @__PURE__ */ w(G, { children: [
2032
+ /* @__PURE__ */ c(_.Item, { gridArea: t, visible: u, children: /* @__PURE__ */ c(gr, { position: o.current }) }),
2033
+ /* @__PURE__ */ c(_.Item, { gridArea: n, visible: u, children: /* @__PURE__ */ c(Er, { position: o.duration }) })
1893
2034
  ] });
1894
- }, hr = () => {
1895
- var r, i, o, c;
1896
- const { playList: e, curIdx: t } = K(), { activeUI: n } = x(), a = !!(((r = e[t]) == null ? void 0 : r.customTrackInfo) ?? ((i = e[t]) == null ? void 0 : i.writer) ?? ((o = e[t]) == null ? void 0 : o.name)) && !!(n.trackInfo ?? n.all);
1897
- return /* @__PURE__ */ w(R, { children: [
1898
- /* @__PURE__ */ s(
1899
- Tt,
2035
+ }, Ar = () => {
2036
+ var r, i, s, o;
2037
+ const { playList: e, curIdx: t } = $(), { activeUI: n } = M(), a = !!(((r = e[t]) == null ? void 0 : r.customTrackInfo) ?? ((i = e[t]) == null ? void 0 : i.writer) ?? ((s = e[t]) == null ? void 0 : s.name)) && !!(n.trackInfo ?? n.all);
2038
+ return /* @__PURE__ */ w(G, { children: [
2039
+ /* @__PURE__ */ c(
2040
+ At,
1900
2041
  {
1901
- visible: !!((c = e[t]) != null && c.img && (n.artwork ?? n.all))
2042
+ visible: !!((o = e[t]) != null && o.img && (n.artwork ?? n.all))
1902
2043
  }
1903
2044
  ),
1904
- /* @__PURE__ */ s(Me, { visible: a }),
1905
- /* @__PURE__ */ s(Et, { visible: !!(n.trackTime ?? n.all) })
2045
+ /* @__PURE__ */ c(De, { visible: a }),
2046
+ /* @__PURE__ */ c(St, { visible: !!(n.trackTime ?? n.all) })
1906
2047
  ] });
1907
- }, Ee = {
2048
+ }, Ae = {
1908
2049
  Progress: { displayName: "Progress", activeUIKey: "progress" },
1909
2050
  Volume: { displayName: "Volume", activeUIKey: "volume" },
1910
2051
  SortablePlayList: { displayName: "PlayList", activeUIKey: "playList" },
@@ -1912,201 +2053,202 @@ const gt = ({ position: e, className: t, children: n, ...a }) => /* @__PURE__ */
1912
2053
  RepeatTypeBtn: { displayName: "RepeatButton", activeUIKey: "repeatType" },
1913
2054
  Artwork: { displayName: "Artwork", activeUIKey: "artwork" },
1914
2055
  TrackInfo: { displayName: "TrackInfo", activeUIKey: "trackInfo" },
1915
- TrackTime: { displayName: "TrackTime", activeUIKey: "trackTime" }
2056
+ TrackTime: { displayName: "TrackTime", activeUIKey: "trackTime" },
2057
+ SpeedSelector: { displayName: "SpeedSelector", activeUIKey: "playbackRate" }
1916
2058
  };
1917
- function Tr(e, t) {
2059
+ function Pr(e, t) {
1918
2060
  const n = e[t];
1919
2061
  return n === !1 ? !1 : n !== void 0 ? !0 : !!e.all;
1920
2062
  }
1921
- function _e(e) {
2063
+ function Re(e) {
1922
2064
  const t = e.type;
1923
2065
  if (!t) return;
1924
2066
  const n = t.type ?? t;
1925
2067
  return n.displayName || n.name || void 0;
1926
2068
  }
1927
- const gr = (e, t, n, a) => {
1928
- const r = k(
1929
- () => (a ?? []).map(_e).map(
2069
+ const Sr = (e, t, n, a) => {
2070
+ const r = x(
2071
+ () => (a ?? []).map(Re).map(
1930
2072
  (h) => {
1931
- var I;
1932
- return h ? (I = Ee[h]) == null ? void 0 : I.activeUIKey : void 0;
2073
+ var g;
2074
+ return h ? (g = Ae[h]) == null ? void 0 : g.activeUIKey : void 0;
1933
2075
  }
1934
2076
  ).filter((h) => h !== void 0),
1935
2077
  [a]
1936
- ), i = k(
2078
+ ), i = x(
1937
2079
  () => [...r].sort().join(","),
1938
2080
  [r]
1939
- ), o = g(
1940
- (h, I, B, re) => {
2081
+ ), s = E(
2082
+ (h, g, C, W) => {
1941
2083
  const se = Object.keys(
1942
2084
  de.templateArea
1943
- ).filter((S) => (S === "trackTimeCurrent" || S === "trackTimeDuration") && h.trackTime === !1 ? !1 : h[S] !== void 0 ? h[S] : !0), D = h.all ? se : Object.entries(h).filter(([, S]) => S).map(([S]) => S);
1944
- for (const S of re)
1945
- D.includes(S) || D.push(S);
2085
+ ).filter((I) => (I === "trackTimeCurrent" || I === "trackTimeDuration") && h.trackTime === !1 ? !1 : h[I] !== void 0 ? h[I] : !0), R = h.all ? se : Object.entries(h).filter(([, I]) => I).map(([I]) => I);
2086
+ for (const I of W)
2087
+ R.includes(I) || R.push(I);
1946
2088
  (() => {
1947
- D.find((S) => S === "trackTime") && (D.splice(D.indexOf("trackTime"), 1), D.push("trackTimeCurrent"), D.push("trackTimeDuration"));
2089
+ R.find((I) => I === "trackTime") && (R.splice(R.indexOf("trackTime"), 1), R.push("trackTimeCurrent"), R.push("trackTimeDuration"));
1948
2090
  })();
1949
- const q = {
2091
+ const ae = {
1950
2092
  ...de.templateArea,
1951
- ...I
1952
- }, At = Object.entries(
1953
- q
1954
- ).filter(([S]) => D.includes(S));
2093
+ ...g
2094
+ }, ye = Object.entries(
2095
+ ae
2096
+ ).filter(([I]) => R.includes(I));
1955
2097
  let le = 1;
1956
- const ue = {}, It = [
1957
- ...At,
1958
- ...Object.entries(B || {})
1959
- ].flatMap(([S, U]) => {
2098
+ const ue = {}, wt = [
2099
+ ...ye,
2100
+ ...Object.entries(C || {})
2101
+ ].flatMap(([I, U]) => {
1960
2102
  if (U == null) return [];
1961
- const [$, F] = U.split("-"), W = +$.split("row")[1];
1962
- return le = Math.max(le, W), ue[W] = ue[W] ? ue[W] + 1 : 1, [
2103
+ const [F, H] = U.split("-"), Y = +F.split("row")[1];
2104
+ return le = Math.max(le, Y), ue[Y] = ue[Y] ? ue[Y] + 1 : 1, [
1963
2105
  {
1964
- key: S,
1965
- row: W,
1966
- col: +F
2106
+ key: I,
2107
+ row: Y,
2108
+ col: +H
1967
2109
  }
1968
2110
  ];
1969
- }).sort((S, U) => S.col - U.col), ye = Math.max(...Object.values(ue));
1970
- let De;
1971
- const St = new Array(le).fill("").map((S, U) => {
1972
- let $ = "", F;
1973
- const W = It.filter((V) => V.row !== U + 1 ? !1 : (V.key === "progress" && (F = V), !0));
1974
- if (F) {
2111
+ }).sort((I, U) => I.col - U.col), ve = Math.max(...Object.values(ue));
2112
+ let Ue;
2113
+ const bt = new Array(le).fill("").map((I, U) => {
2114
+ let F = "", H;
2115
+ const Y = wt.filter((V) => V.row !== U + 1 ? !1 : (V.key === "progress" && (H = V), !0));
2116
+ if (H) {
1975
2117
  const V = /* @__PURE__ */ new Map();
1976
- W.forEach((X) => V.set(X.col, X));
1977
- const ve = `row${U + 1}-${F.col}`, ae = [];
1978
- for (let X = 0; X < ye; X++) {
1979
- const Ue = X + 1;
1980
- V.has(Ue) ? ae.push(`row${U + 1}-${Ue}`) : ae.push(ve);
2118
+ Y.forEach((Q) => V.set(Q.col, Q));
2119
+ const fe = `row${U + 1}-${H.col}`, ne = [];
2120
+ for (let Q = 0; Q < ve; Q++) {
2121
+ const Oe = Q + 1;
2122
+ V.has(Oe) ? ne.push(`row${U + 1}-${Oe}`) : ne.push(fe);
1981
2123
  }
1982
- const Nt = ae.indexOf(ve), bt = ae.lastIndexOf(ve);
1983
- De = Math.floor((Nt + bt) / 2), $ = " " + ae.join(" ");
2124
+ const kt = ne.indexOf(fe), Ct = ne.lastIndexOf(fe);
2125
+ Ue = Math.floor((kt + Ct) / 2), F = " " + ne.join(" ");
1984
2126
  } else
1985
- for (let V = 0; V < ye; V++)
1986
- $ += ` row${U + 1}-${V + 1}`;
1987
- return $.trimStart();
1988
- }), wt = ut ? window.innerWidth - 100 : 1500, Lt = new Array(le).fill("").map((S, U) => {
1989
- let $ = "";
1990
- for (let F = 0; F < ye; F++) {
1991
- if (De === F && U === 0) {
1992
- $ += " 1fr";
2127
+ for (let V = 0; V < ve; V++)
2128
+ F += ` row${U + 1}-${V + 1}`;
2129
+ return F.trimStart();
2130
+ }), Lt = pt ? window.innerWidth - 100 : 1500, Nt = new Array(le).fill("").map((I, U) => {
2131
+ let F = "";
2132
+ for (let H = 0; H < ve; H++) {
2133
+ if (Ue === H && U === 0) {
2134
+ F += " 1fr";
1993
2135
  continue;
1994
2136
  }
1995
- $ += ` fit-content(${wt}px)`;
2137
+ F += ` fit-content(${Lt}px)`;
1996
2138
  }
1997
- return $.trimStart();
2139
+ return F.trimStart();
1998
2140
  });
1999
- return { gridAreas: St, gridColumns: Lt };
2141
+ return { gridAreas: bt, gridColumns: Nt };
2000
2142
  },
2001
2143
  []
2002
- ), [c, u] = b(e), [d, l] = b(i), [p, m] = b({
2144
+ ), [o, u] = N(e), [d, l] = N(i), [m, p] = N({
2003
2145
  templateArea: t,
2004
2146
  customComponentsArea: n
2005
- }), [y, f] = b();
2006
- if (!y) {
2007
- const { gridAreas: h, gridColumns: I } = o(
2008
- c,
2009
- p.templateArea,
2010
- p.customComponentsArea,
2147
+ }), [v, f] = N();
2148
+ if (!v) {
2149
+ const { gridAreas: h, gridColumns: g } = s(
2150
+ o,
2151
+ m.templateArea,
2152
+ m.customComponentsArea,
2011
2153
  r
2012
2154
  );
2013
- return f({ gridAreas: h, gridColumns: I }), [h, I];
2155
+ return f({ gridAreas: h, gridColumns: g }), [h, g];
2014
2156
  }
2015
- if (c !== e || d !== i || p.templateArea !== t || p.customComponentsArea !== n) {
2016
- u(e), l(i), m({ templateArea: t, customComponentsArea: n });
2017
- const { gridAreas: h, gridColumns: I } = o(
2157
+ if (o !== e || d !== i || m.templateArea !== t || m.customComponentsArea !== n) {
2158
+ u(e), l(i), p({ templateArea: t, customComponentsArea: n });
2159
+ const { gridAreas: h, gridColumns: g } = s(
2018
2160
  e,
2019
2161
  t,
2020
2162
  n,
2021
2163
  r
2022
2164
  );
2023
- f({ gridAreas: h, gridColumns: I });
2165
+ f({ gridAreas: h, gridColumns: g });
2024
2166
  }
2025
- const { gridAreas: v, gridColumns: T } = y;
2026
- return [v, T];
2167
+ const { gridAreas: y, gridColumns: T } = v;
2168
+ return [y, T];
2027
2169
  };
2028
- function Er(e) {
2029
- return k(() => {
2030
- const t = ee.Children.toArray(e).filter(Mt), n = t.find(Ke);
2170
+ function Ir(e) {
2171
+ return x(() => {
2172
+ const t = te.Children.toArray(e).filter(Dt), n = t.find(Be);
2031
2173
  return {
2032
2174
  compoundChildren: t.filter(
2033
- (a) => !Ke(a)
2175
+ (a) => !Be(a)
2034
2176
  ),
2035
- playListEmptyNode: Pr(n)
2177
+ playListEmptyNode: wr(n)
2036
2178
  };
2037
2179
  }, [e]);
2038
2180
  }
2039
- function Ke(e) {
2040
- return _e(e) === ze;
2181
+ function Be(e) {
2182
+ return Re(e) === We;
2041
2183
  }
2042
- function Pr(e) {
2184
+ function wr(e) {
2043
2185
  if (!e) return null;
2044
2186
  const t = e.props;
2045
2187
  return (t == null ? void 0 : t.children) ?? null;
2046
2188
  }
2047
- function Ar({
2189
+ function br({
2048
2190
  compoundChildren: e,
2049
2191
  activeUI: t
2050
2192
  }) {
2051
- const n = e.map(_e).filter((a) => !!(a && Ee[a])).sort().join(",");
2193
+ const n = e.map(Re).filter((a) => !!(a && Ae[a])).sort().join(",");
2052
2194
  P(() => {
2053
2195
  if (process.env.NODE_ENV === "production" || !n) return;
2054
2196
  const a = /* @__PURE__ */ new Set();
2055
2197
  for (const r of n.split(",")) {
2056
- const i = Ee[r];
2057
- i && (a.has(i.displayName) || Tr(t, i.activeUIKey) && (a.add(i.displayName), console.warn(
2198
+ const i = Ae[r];
2199
+ i && (a.has(i.displayName) || Pr(t, i.activeUIKey) && (a.add(i.displayName), console.warn(
2058
2200
  `[react-modern-audio-player] Both preset and compound '${i.displayName}' are rendered. Set \`activeUI.${i.activeUIKey}=false\` to replace the preset control.`
2059
2201
  )));
2060
2202
  }
2061
2203
  }, [n, t]);
2062
2204
  }
2063
- const Ir = ({ children: e }) => {
2064
- const { interfacePlacement: t, activeUI: n, playListPlacement: a } = x(), { compoundChildren: r, playListEmptyNode: i } = Er(e);
2065
- Ar({ compoundChildren: r, activeUI: n });
2066
- const [o, c] = gr(
2205
+ const Lr = ({ children: e }) => {
2206
+ const { interfacePlacement: t, activeUI: n, playListPlacement: a } = M(), { compoundChildren: r, playListEmptyNode: i } = Ir(e);
2207
+ br({ compoundChildren: r, activeUI: n });
2208
+ const [s, o] = Sr(
2067
2209
  n,
2068
2210
  t == null ? void 0 : t.templateArea,
2069
2211
  t == null ? void 0 : t.customComponentsArea,
2070
2212
  r
2071
- ), [u, d] = b(null);
2072
- return /* @__PURE__ */ s(
2213
+ ), [u, d] = N(null);
2214
+ return /* @__PURE__ */ c(
2073
2215
  "div",
2074
2216
  {
2075
2217
  className: "rmap-interface-container",
2076
2218
  "data-testid": "audio-player",
2077
2219
  role: "region",
2078
2220
  "aria-label": "Audio player",
2079
- children: /* @__PURE__ */ s(Ce.Provider, { value: u, children: /* @__PURE__ */ w(xe.Provider, { value: i, children: [
2080
- a === "top" && /* @__PURE__ */ s("div", { ref: d, className: "rmap-sortable-playlist" }),
2221
+ children: /* @__PURE__ */ c(xe.Provider, { value: u, children: /* @__PURE__ */ w(Me.Provider, { value: i, children: [
2222
+ a === "top" && /* @__PURE__ */ c("div", { ref: d, className: "rmap-sortable-playlist" }),
2081
2223
  /* @__PURE__ */ w(
2082
2224
  _,
2083
2225
  {
2084
2226
  alignItems: "center",
2085
2227
  justifyContent: "center",
2086
- areas: o,
2228
+ areas: s,
2087
2229
  minHeight: "30px",
2088
- columns: c,
2230
+ columns: o,
2089
2231
  UNSAFE_className: "rmap-interface-grid",
2090
2232
  children: [
2091
- /* @__PURE__ */ s(hr, {}),
2092
- /* @__PURE__ */ s(yr, {}),
2233
+ /* @__PURE__ */ c(Ar, {}),
2234
+ /* @__PURE__ */ c(hr, {}),
2093
2235
  r
2094
2236
  ]
2095
2237
  }
2096
2238
  ),
2097
- a === "bottom" && /* @__PURE__ */ s("div", { ref: d, className: "rmap-sortable-playlist" })
2239
+ a === "bottom" && /* @__PURE__ */ c("div", { ref: d, className: "rmap-sortable-playlist" })
2098
2240
  ] }) })
2099
2241
  }
2100
2242
  );
2101
- }, J = (e, t) => {
2102
- const n = A(!1);
2243
+ }, Z = (e, t) => {
2244
+ const n = S(!1);
2103
2245
  P(() => {
2104
2246
  if (n.current)
2105
2247
  return e();
2106
2248
  }, t), P(() => (n.current = !0, () => {
2107
2249
  n.current = !1;
2108
2250
  }), []);
2109
- }, Sr = ({
2251
+ }, Nr = ({
2110
2252
  placement: e = {},
2111
2253
  activeUI: t,
2112
2254
  coverImgsCss: n,
@@ -2114,73 +2256,87 @@ const Ir = ({ children: e }) => {
2114
2256
  playList: r,
2115
2257
  customIcons: i
2116
2258
  }) => {
2117
- const o = E(L);
2118
- J(() => {
2259
+ const s = A(b);
2260
+ Z(() => {
2119
2261
  const {
2120
- player: c,
2262
+ player: o,
2121
2263
  playList: u,
2122
2264
  interface: d,
2123
2265
  volumeSlider: l
2124
2266
  } = e;
2125
- o({
2267
+ s({
2126
2268
  type: "SET_PLACEMENTS",
2127
- playerPlacement: c,
2269
+ playerPlacement: o,
2128
2270
  playListPlacement: u,
2129
2271
  interfacePlacement: d,
2130
2272
  volumeSliderPlacement: l
2131
2273
  });
2132
- }, [o, e]), J(() => {
2133
- t && o({ type: "SET_ACTIVE_UI", activeUI: t });
2134
- }, [t, o]), J(() => {
2135
- n && o({ type: "SET_COVER_IMGS_CSS", coverImgsCss: n });
2136
- }, [o, n]), J(() => {
2137
- a && o({
2274
+ }, [s, e]), Z(() => {
2275
+ t && s({ type: "SET_ACTIVE_UI", activeUI: t });
2276
+ }, [t, s]), Z(() => {
2277
+ n && s({ type: "SET_COVER_IMGS_CSS", coverImgsCss: n });
2278
+ }, [s, n]), Z(() => {
2279
+ a && s({
2138
2280
  type: "SET_INITIAL_STATES",
2139
2281
  audioState: a,
2140
2282
  curPlayId: a.curPlayId
2141
2283
  });
2142
- }, [a, o]), J(() => {
2143
- o({ type: "UPDATE_PLAY_LIST", playList: r });
2144
- }, [o, r]), J(() => {
2145
- i && o({ type: "SET_CUSTOM_ICONS", customIcons: i });
2146
- }, [i, o]);
2147
- }, wr = ({
2284
+ }, [a, s]), Z(() => {
2285
+ s({ type: "UPDATE_PLAY_LIST", playList: r });
2286
+ }, [s, r]), Z(() => {
2287
+ i && s({ type: "SET_CUSTOM_ICONS", customIcons: i });
2288
+ }, [i, s]);
2289
+ }, kr = ({
2148
2290
  audioRef: e,
2149
2291
  children: t,
2150
2292
  ...n
2151
- }) => (Sr(n), /* @__PURE__ */ w("div", { id: "rm-audio-player", className: "rmap-player-container", children: [
2152
- /* @__PURE__ */ s(We, { audioRef: e }),
2153
- /* @__PURE__ */ s(Ir, { children: t })
2293
+ }) => (Nr(n), /* @__PURE__ */ w("div", { id: "rm-audio-player", className: "rmap-player-container", children: [
2294
+ /* @__PURE__ */ c(Ye, { audioRef: e }),
2295
+ /* @__PURE__ */ c(Lr, { children: t })
2154
2296
  ] }));
2155
- function Pt({
2297
+ function It({
2156
2298
  rootContainerProps: e,
2157
2299
  ...t
2158
2300
  }) {
2159
- return /* @__PURE__ */ s(Kt, { ...t, children: /* @__PURE__ */ s(He, { rootContainerProps: e, children: /* @__PURE__ */ s(wr, { ...t }) }) });
2301
+ return /* @__PURE__ */ c(Bt, { ...t, children: /* @__PURE__ */ c(Ge, { rootContainerProps: e, children: /* @__PURE__ */ c(kr, { ...t }) }) });
2160
2302
  }
2161
- Pt.displayName = "AudioPlayerWithProviders";
2162
- const Dr = Object.assign(Pt, {
2163
- Progress: yt,
2164
- Volume: ht,
2165
- PlayList: dt,
2166
- PlayListEmpty: Ge,
2167
- PlayButton: it,
2168
- RepeatButton: st,
2169
- Artwork: Tt,
2170
- TrackInfo: Me,
2171
- TrackTime: Et,
2172
- CustomComponent: Ht
2173
- }), Lr = () => {
2174
- const e = E(L), { isPlaying: t, repeatType: n } = C(), a = g(() => {
2303
+ It.displayName = "AudioPlayerWithProviders";
2304
+ const Kr = Object.assign(It, {
2305
+ Progress: ft,
2306
+ Volume: Et,
2307
+ PlayList: mt,
2308
+ PlayListEmpty: je,
2309
+ PlayButton: ct,
2310
+ RepeatButton: lt,
2311
+ SpeedSelector: _e,
2312
+ Artwork: At,
2313
+ TrackInfo: De,
2314
+ TrackTime: St,
2315
+ CustomComponent: Gt
2316
+ }), Cr = () => {
2317
+ const e = A(b), { isPlaying: t, repeatType: n, playbackRate: a } = k(), r = E(() => {
2175
2318
  e({ type: "CHANGE_PLAYING_STATE", state: !0 });
2176
- }, [e]), r = g(() => {
2319
+ }, [e]), i = E(() => {
2177
2320
  e({ type: "CHANGE_PLAYING_STATE", state: !1 });
2178
- }, [e]), i = g(() => {
2321
+ }, [e]), s = E(() => {
2179
2322
  e({ type: "CHANGE_PLAYING_STATE" });
2180
- }, [e]);
2181
- return { isPlaying: t, repeatType: n, play: a, pause: r, togglePlay: i };
2182
- }, Nr = () => {
2183
- const e = E(L), { playList: t, curIdx: n, curPlayId: a } = K(), { elementRefs: r } = N(), i = g(
2323
+ }, [e]), o = E(
2324
+ (u) => {
2325
+ e({ type: "SET_PLAYBACK_RATE", playbackRate: u });
2326
+ },
2327
+ [e]
2328
+ );
2329
+ return {
2330
+ isPlaying: t,
2331
+ repeatType: n,
2332
+ playbackRate: a,
2333
+ play: r,
2334
+ pause: i,
2335
+ togglePlay: s,
2336
+ setPlaybackRate: o
2337
+ };
2338
+ }, xr = () => {
2339
+ const e = A(b), { playList: t, curIdx: n, curPlayId: a } = $(), { elementRefs: r } = L(), i = E(
2184
2340
  (u) => {
2185
2341
  const d = t[u];
2186
2342
  d && e({
@@ -2190,9 +2346,9 @@ const Dr = Object.assign(Pt, {
2190
2346
  });
2191
2347
  },
2192
2348
  [e, t]
2193
- ), o = g(() => {
2349
+ ), s = E(() => {
2194
2350
  t.length !== 0 && e({ type: "NEXT_AUDIO" });
2195
- }, [e, t.length]), c = g(() => {
2351
+ }, [e, t.length]), o = E(() => {
2196
2352
  var d;
2197
2353
  if (t.length === 0) return;
2198
2354
  const u = ((d = r == null ? void 0 : r.audioEl) == null ? void 0 : d.currentTime) ?? 0;
@@ -2204,29 +2360,29 @@ const Dr = Object.assign(Pt, {
2204
2360
  playList: t,
2205
2361
  currentTrack: t[n] ?? null,
2206
2362
  setTrack: i,
2207
- next: o,
2208
- prev: c
2363
+ next: s,
2364
+ prev: o
2209
2365
  };
2210
- }, br = () => {
2211
- const e = E(L), { volume: t, muted: n } = C(), a = g(
2366
+ }, Mr = () => {
2367
+ const e = A(b), { volume: t, muted: n } = k(), a = E(
2212
2368
  (i) => {
2213
2369
  e({ type: "SET_VOLUME", volume: i });
2214
2370
  },
2215
2371
  [e]
2216
- ), r = g(() => {
2372
+ ), r = E(() => {
2217
2373
  e({ type: "SET_MUTED", muted: !n });
2218
2374
  }, [e, n]);
2219
2375
  return { volume: t, muted: n, setVolume: a, toggleMute: r };
2220
- }, kr = () => {
2221
- const e = E(L), { currentTime: t, duration: n } = te(), a = g(
2376
+ }, _r = () => {
2377
+ const e = A(b), { currentTime: t, duration: n } = re(), a = E(
2222
2378
  (r) => {
2223
2379
  e({ type: "SEEK", time: r });
2224
2380
  },
2225
2381
  [e]
2226
2382
  );
2227
2383
  return { currentTime: t, duration: n, seek: a };
2228
- }, Ur = () => {
2229
- const e = Lr(), t = Nr(), n = br(), a = kr();
2384
+ }, Vr = () => {
2385
+ const e = Cr(), t = xr(), n = Mr(), a = _r();
2230
2386
  return {
2231
2387
  isPlaying: e.isPlaying,
2232
2388
  volume: n.volume,
@@ -2234,6 +2390,7 @@ const Dr = Object.assign(Pt, {
2234
2390
  duration: a.duration,
2235
2391
  repeatType: e.repeatType,
2236
2392
  muted: n.muted,
2393
+ playbackRate: e.playbackRate,
2237
2394
  currentTrack: t.currentTrack,
2238
2395
  currentIndex: t.currentIndex,
2239
2396
  playList: t.playList,
@@ -2245,41 +2402,42 @@ const Dr = Object.assign(Pt, {
2245
2402
  seek: a.seek,
2246
2403
  setVolume: n.setVolume,
2247
2404
  toggleMute: n.toggleMute,
2248
- setTrack: t.setTrack
2405
+ setTrack: t.setTrack,
2406
+ setPlaybackRate: e.setPlaybackRate
2249
2407
  };
2250
- }, Or = () => {
2251
- const { elementRefs: e } = N();
2408
+ }, Br = () => {
2409
+ const { elementRefs: e } = L();
2252
2410
  return {
2253
2411
  audioEl: e == null ? void 0 : e.audioEl,
2254
2412
  waveformInst: e == null ? void 0 : e.waveformInst
2255
2413
  };
2256
2414
  };
2257
2415
  export {
2258
- wr as AudioPlayer,
2259
- He as AudioPlayerContainer,
2260
- Kt as AudioPlayerStateProvider,
2261
- H as DEFAULT_AUDIO_STATE,
2416
+ kr as AudioPlayer,
2417
+ Ge as AudioPlayerContainer,
2418
+ Bt as AudioPlayerStateProvider,
2419
+ O as DEFAULT_AUDIO_STATE,
2420
+ Or as DEFAULT_INTERFACE_GRID_BOUND,
2262
2421
  Ie as audioAttrsContext,
2263
- L as audioPlayerDispatchContext,
2264
- Ut as audioPlayerReducer,
2265
- Dr as default,
2422
+ b as audioPlayerDispatchContext,
2423
+ Ot as audioPlayerReducer,
2424
+ Kr as default,
2266
2425
  de as defaultInterfacePlacement,
2267
- _r as defaultInterfacePlacementMaxLength,
2268
- Ae as playbackContext,
2426
+ Se as playbackContext,
2269
2427
  Le as resourceContext,
2270
2428
  Ne as timeContext,
2271
- Se as trackContext,
2272
- we as uiContext,
2273
- Ot as useAudioAttrsContext,
2274
- Ur as useAudioPlayer,
2275
- Or as useAudioPlayerElement,
2276
- Lr as useAudioPlayerPlayback,
2277
- kr as useAudioPlayerTime,
2278
- Nr as useAudioPlayerTrack,
2279
- br as useAudioPlayerVolume,
2280
- C as usePlaybackContext,
2281
- N as useResourceContext,
2282
- te as useTimeContext,
2283
- K as useTrackContext,
2284
- x as useUIContext
2429
+ we as trackContext,
2430
+ be as uiContext,
2431
+ Kt as useAudioAttrsContext,
2432
+ Vr as useAudioPlayer,
2433
+ Br as useAudioPlayerElement,
2434
+ Cr as useAudioPlayerPlayback,
2435
+ _r as useAudioPlayerTime,
2436
+ xr as useAudioPlayerTrack,
2437
+ Mr as useAudioPlayerVolume,
2438
+ k as usePlaybackContext,
2439
+ L as useResourceContext,
2440
+ re as useTimeContext,
2441
+ $ as useTrackContext,
2442
+ M as useUIContext
2285
2443
  };