@aigamo/hydrangean-diva 0.0.1-alpha.11 → 0.0.1-alpha.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (41) hide show
  1. package/dist/features/common/index.d.ts +2 -0
  2. package/dist/features/common/interfaces/index.d.ts +1 -0
  3. package/dist/features/{media-player → common}/stores/MobXObservableStateProvider.d.ts +1 -1
  4. package/dist/features/{media-player → common}/stores/ObservableStateProvider.d.ts +1 -1
  5. package/dist/features/common/stores/index.d.ts +2 -0
  6. package/dist/features/{media-player → media-player.play-queue}/components/AddVideoButton.d.ts +2 -2
  7. package/dist/features/media-player.play-queue/components/HydrangeanDiva.d.ts +9 -0
  8. package/dist/features/{media-player → media-player.play-queue}/components/PlayQueueTable.d.ts +2 -2
  9. package/dist/features/media-player.play-queue/components/index.d.ts +2 -0
  10. package/dist/features/media-player.play-queue/index.d.ts +2 -0
  11. package/dist/features/{media-player/stores → media-player.play-queue/interfaces}/IPlayQueueItemStore.d.ts +1 -6
  12. package/dist/features/media-player.play-queue/interfaces/IPlayQueueStore.d.ts +37 -0
  13. package/dist/features/media-player.play-queue/interfaces/PlayQueueDto.d.ts +11 -0
  14. package/dist/features/media-player.play-queue/interfaces/PlayQueueItemDto.d.ts +9 -0
  15. package/dist/features/media-player.play-queue/interfaces/index.d.ts +3 -0
  16. package/dist/features/{media-player → media-player.play-queue}/stores/PlayQueueItemStore.d.ts +5 -5
  17. package/dist/features/{media-player → media-player.play-queue}/stores/PlayQueueStore.d.ts +10 -9
  18. package/dist/features/media-player.player/components/BottomBar.d.ts +13 -0
  19. package/dist/features/{media-player → media-player.player}/components/MiniPlayer.d.ts +4 -4
  20. package/dist/features/{media-player → media-player.player}/components/PlayerStoreContext.d.ts +2 -2
  21. package/dist/features/{media-player → media-player.player}/components/index.d.ts +0 -2
  22. package/dist/features/{media-player → media-player.player}/index.d.ts +0 -1
  23. package/dist/features/media-player.player/interfaces/IPlayerStore.d.ts +11 -0
  24. package/dist/features/{media-player → media-player.player}/stores/PlayerStore.d.ts +3 -2
  25. package/dist/index.cjs.js +9 -9
  26. package/dist/index.cjs.js.map +1 -1
  27. package/dist/index.d.ts +3 -1
  28. package/dist/index.es.js +1006 -974
  29. package/dist/index.es.js.map +1 -1
  30. package/package.json +3 -1
  31. package/dist/features/media-player/components/BottomBar.d.ts +0 -12
  32. package/dist/features/media-player/components/HydrangeanDiva.d.ts +0 -11
  33. package/dist/features/media-player/stores/IPlayQueueStore.d.ts +0 -15
  34. package/dist/features/media-player/stores/PlayQueueLocalStorageState.d.ts +0 -10
  35. package/dist/features/media-player/stores/index.d.ts +0 -6
  36. /package/dist/features/{media-player/stores → common/interfaces}/IObservableStateProvider.d.ts +0 -0
  37. /package/dist/features/{media-player → common}/stores/getOrAddSchema.d.ts +0 -0
  38. /package/dist/features/{media-player → media-player.play-queue}/components/PlayQueueStoreContext.d.ts +0 -0
  39. /package/dist/features/{media-player/stores → media-player.play-queue/interfaces}/RepeatMode.d.ts +0 -0
  40. /package/dist/features/{media-player → media-player.play-queue}/pages/PlayQueuePage.d.ts +0 -0
  41. /package/dist/features/{media-player → media-player.player}/components/MediaPlayerLayout.d.ts +0 -0
package/dist/index.es.js CHANGED
@@ -1,17 +1,27 @@
1
1
  var Ir = Object.defineProperty;
2
2
  var Pr = (t, e, n) => e in t ? Ir(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n;
3
3
  var U = (t, e, n) => Pr(t, typeof e != "symbol" ? e + "" : e, n);
4
- import * as te from "react";
5
- import Dt, { forwardRef as Rr, useContext as st, useCallback as $, memo as Z, useState as q, useLayoutEffect as wr, useMemo as zt, createContext as Lt, useEffect as Or } from "react";
6
- import _r from "@emotion/cache";
7
- import { useNostalgicDiva as ie, findVideoService as Ar, NostalgicDiva as kr } from "@aigamo/nostalgic-diva";
8
- import { EuiRange as Vt, EuiButtonIcon as K, EuiFlexGroup as me, EuiFlexItem as G, EuiBottomBar as Mr, EuiFormRow as tt, EuiPopover as lt, EuiIcon as H, EuiContextMenu as Fr, EuiButton as ne, EuiModalHeaderTitle as jr, EuiModalHeader as Nr, EuiForm as $r, EuiFieldText as It, EuiModalBody as Dr, EuiModalFooter as zr, EuiButtonEmpty as Lr, EuiModal as Vr, useEuiTheme as Yt, EuiCheckbox as Bt, EuiTableHeaderCellCheckbox as Yr, EuiTableHeaderCell as Xe, EuiTableHeader as Br, EuiContextMenuItem as Wr, EuiHorizontalRule as Pt, EuiContextMenuPanel as Ur, EuiTableRowCell as rt, EuiTableRowCellCheckbox as qr, EuiLink as Hr, EuiTableRow as Gr, EuiTable as Jr, EuiCodeBlock as Kr, EuiFlyout as Xr, EuiSpacer as Wt, EuiEmptyPrompt as Zr, EuiPageTemplate as nt } from "@elastic/eui";
9
- import { ArrowRepeat1Filled as Qr, ArrowRepeatAllFilled as en, ArrowRepeatAllOffFilled as tn, ArrowShuffleFilled as rn, ArrowShuffleOffFilled as nn, PreviousFilled as on, PauseFilled as an, PlayFilled as sn, NextFilled as ln, Speaker2Regular as Ut, MoreHorizontalFilled as qt, TopSpeedRegular as cn, SkipBack10Regular as un, SkipForward30Regular as fn, DismissRegular as ct, AddRegular as ut, ArrowUploadRegular as dn, ArrowDownloadRegular as mn, PlayRegular as hn, DeleteRegular as vn } from "@fluentui/react-icons";
4
+ import { makeObservable as Rr, action as y, computed as _, observable as te, reaction as wr } from "mobx";
5
+ import * as re from "react";
6
+ import zt, { forwardRef as Or, useContext as st, memo as Z, useState as q, useCallback as $, createContext as Lt, useEffect as _r, useLayoutEffect as Ar, useMemo as Vt } from "react";
7
+ import kr from "@emotion/cache";
8
+ import { EuiButton as ne, EuiModalHeaderTitle as Mr, EuiModalHeader as Fr, EuiForm as jr, EuiFormRow as tt, EuiFieldText as It, EuiModalBody as Nr, EuiModalFooter as $r, EuiButtonEmpty as Dr, EuiModal as zr, useEuiTheme as Yt, EuiCheckbox as Bt, EuiTableHeaderCellCheckbox as Lr, EuiTableHeader as Vr, EuiContextMenuItem as Yr, EuiContextMenuPanel as Br, EuiTableRowCell as rt, EuiTableRowCellCheckbox as Wr, EuiLink as Ur, EuiTableRow as qr, EuiTable as Hr, EuiButtonIcon as G, EuiPopover as lt, EuiIcon as H, EuiHorizontalRule as Pt, EuiTableHeaderCell as Xe, EuiCodeBlock as Gr, EuiFlyout as Jr, EuiFlexGroup as me, EuiFlexItem as J, EuiSpacer as Wt, EuiEmptyPrompt as Kr, EuiPageTemplate as nt, EuiRange as Ut, EuiContextMenu as Xr, EuiBottomBar as Zr } from "@elastic/eui";
9
+ import { AddRegular as ct, PlayRegular as Qr, DismissRegular as ut, MoreHorizontalFilled as qt, ArrowUploadRegular as en, ArrowDownloadRegular as tn, WindowDevToolsRegular as rn, DeleteRegular as nn, Speaker2Regular as Ht, TopSpeedRegular as on, SkipBack10Regular as an, SkipForward30Regular as sn, ArrowRepeat1Filled as ln, ArrowRepeatAllFilled as cn, ArrowRepeatAllOffFilled as un, ArrowShuffleFilled as fn, ArrowShuffleOffFilled as dn, PreviousFilled as mn, PauseFilled as hn, PlayFilled as vn, NextFilled as pn, NavigationPlayRegular as yn } from "@fluentui/react-icons";
10
10
  import { observer as Y } from "mobx-react-lite";
11
- import { ReactSortable as pn } from "react-sortablejs";
12
- import { makeObservable as yn, action as y, computed as _, observable as re, reaction as gn } from "mobx";
11
+ import { findVideoService as gn, useNostalgicDiva as ie, NostalgicDiva as bn } from "@aigamo/nostalgic-diva";
12
+ import { ReactSortable as En } from "react-sortablejs";
13
13
  import { pull as Rt } from "lodash-es";
14
- import bn from "ajv";
14
+ import Tn from "ajv";
15
+ class Gt {
16
+ makeObservable(e, n) {
17
+ return Rr(e, n);
18
+ }
19
+ }
20
+ class _i {
21
+ makeObservable(e, n) {
22
+ return e;
23
+ }
24
+ }
15
25
  var $e = { exports: {} }, xe = {};
16
26
  /**
17
27
  * @license React
@@ -23,10 +33,10 @@ var $e = { exports: {} }, xe = {};
23
33
  * LICENSE file in the root directory of this source tree.
24
34
  */
25
35
  var wt;
26
- function En() {
36
+ function xn() {
27
37
  if (wt) return xe;
28
38
  wt = 1;
29
- var t = Dt, e = Symbol.for("react.element"), n = Symbol.for("react.fragment"), i = Object.prototype.hasOwnProperty, a = t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, l = { key: !0, ref: !0, __self: !0, __source: !0 };
39
+ var t = zt, e = Symbol.for("react.element"), n = Symbol.for("react.fragment"), i = Object.prototype.hasOwnProperty, a = t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, l = { key: !0, ref: !0, __self: !0, __source: !0 };
30
40
  function f(h, m, p) {
31
41
  var E, P = {}, D = null, j = null;
32
42
  p !== void 0 && (D = "" + p), m.key !== void 0 && (D = "" + m.key), m.ref !== void 0 && (j = m.ref);
@@ -47,9 +57,9 @@ var Se = {};
47
57
  * LICENSE file in the root directory of this source tree.
48
58
  */
49
59
  var Ot;
50
- function Tn() {
60
+ function Sn() {
51
61
  return Ot || (Ot = 1, process.env.NODE_ENV !== "production" && function() {
52
- var t = Dt, e = Symbol.for("react.element"), n = Symbol.for("react.portal"), i = Symbol.for("react.fragment"), a = Symbol.for("react.strict_mode"), l = Symbol.for("react.profiler"), f = Symbol.for("react.provider"), h = Symbol.for("react.context"), m = Symbol.for("react.forward_ref"), p = Symbol.for("react.suspense"), E = Symbol.for("react.suspense_list"), P = Symbol.for("react.memo"), D = Symbol.for("react.lazy"), j = Symbol.for("react.offscreen"), A = Symbol.iterator, B = "@@iterator";
62
+ var t = zt, e = Symbol.for("react.element"), n = Symbol.for("react.portal"), i = Symbol.for("react.fragment"), a = Symbol.for("react.strict_mode"), l = Symbol.for("react.profiler"), f = Symbol.for("react.provider"), h = Symbol.for("react.context"), m = Symbol.for("react.forward_ref"), p = Symbol.for("react.suspense"), E = Symbol.for("react.suspense_list"), P = Symbol.for("react.memo"), D = Symbol.for("react.lazy"), j = Symbol.for("react.offscreen"), A = Symbol.iterator, B = "@@iterator";
53
63
  function Q(r) {
54
64
  if (r === null || typeof r != "object")
55
65
  return null;
@@ -93,7 +103,7 @@ function Tn() {
93
103
  function Oe(r) {
94
104
  return r.displayName || "Context";
95
105
  }
96
- function J(r) {
106
+ function K(r) {
97
107
  if (r == null)
98
108
  return null;
99
109
  if (typeof r.tag == "number" && I("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof r == "function")
@@ -126,11 +136,11 @@ function Tn() {
126
136
  return Ye(r, r.render, "ForwardRef");
127
137
  case P:
128
138
  var v = r.displayName || null;
129
- return v !== null ? v : J(r.type) || "Memo";
139
+ return v !== null ? v : K(r.type) || "Memo";
130
140
  case D: {
131
141
  var T = r, C = T._payload, b = T._init;
132
142
  try {
133
- return J(b(C));
143
+ return K(b(C));
134
144
  } catch {
135
145
  return null;
136
146
  }
@@ -487,7 +497,7 @@ function Tn() {
487
497
  function bt() {
488
498
  {
489
499
  if (He.current) {
490
- var r = J(He.current.type);
500
+ var r = K(He.current.type);
491
501
  if (r)
492
502
  return `
493
503
 
@@ -522,7 +532,7 @@ Check the top-level render call using <` + u + ">.");
522
532
  return;
523
533
  Et[u] = !0;
524
534
  var v = "";
525
- r && r._owner && r._owner !== He.current && (v = " It was passed a child from " + J(r._owner.type) + "."), fe(r), I('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', u, v), fe(null);
535
+ r && r._owner && r._owner !== He.current && (v = " It was passed a child from " + K(r._owner.type) + "."), fe(r), I('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', u, v), fe(null);
526
536
  }
527
537
  }
528
538
  function xt(r, s) {
@@ -559,11 +569,11 @@ Check the top-level render call using <` + u + ">.");
559
569
  else
560
570
  return;
561
571
  if (u) {
562
- var v = J(s);
572
+ var v = K(s);
563
573
  nr(u, r.props, "prop", v, r);
564
574
  } else if (s.PropTypes !== void 0 && !Ge) {
565
575
  Ge = !0;
566
- var T = J(s);
576
+ var T = K(s);
567
577
  I("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", T || "Unknown");
568
578
  }
569
579
  typeof s.getDefaultProps == "function" && !s.getDefaultProps.isReactClassApproved && I("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
@@ -591,7 +601,7 @@ Check the top-level render call using <` + u + ">.");
591
601
  var N = vr();
592
602
  N ? g += N : g += bt();
593
603
  var O;
594
- r === null ? O = "null" : qe(r) ? O = "array" : r !== void 0 && r.$$typeof === e ? (O = "<" + (J(r.type) || "Unknown") + " />", g = " Did you accidentally export a JSX literal instead of a component?") : O = typeof r, I("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", O, g);
604
+ r === null ? O = "null" : qe(r) ? O = "array" : r !== void 0 && r.$$typeof === e ? (O = "<" + (K(r.type) || "Unknown") + " />", g = " Did you accidentally export a JSX literal instead of a component?") : O = typeof r, I("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", O, g);
595
605
  }
596
606
  var M = hr(r, s, u, T, C);
597
607
  if (M == null)
@@ -610,7 +620,7 @@ Check the top-level render call using <` + u + ">.");
610
620
  xt(W, r);
611
621
  }
612
622
  if (Te.call(s, "key")) {
613
- var se = J(r), V = Object.keys(s).filter(function(Cr) {
623
+ var se = K(r), V = Object.keys(s).filter(function(Cr) {
614
624
  return Cr !== "key";
615
625
  }), Ke = V.length > 0 ? "{key: someKey, " + V.join(": ..., ") + ": ...}" : "{key: someKey}";
616
626
  if (!St[se + Ke]) {
@@ -637,10 +647,10 @@ React keys must be passed directly to JSX without using spread:
637
647
  }()), Se;
638
648
  }
639
649
  var _t;
640
- function xn() {
641
- return _t || (_t = 1, process.env.NODE_ENV === "production" ? $e.exports = En() : $e.exports = Tn()), $e.exports;
650
+ function Cn() {
651
+ return _t || (_t = 1, process.env.NODE_ENV === "production" ? $e.exports = xn() : $e.exports = Sn()), $e.exports;
642
652
  }
643
- var Ie = xn(), De = { exports: {} }, x = {};
653
+ var Ie = Cn(), De = { exports: {} }, x = {};
644
654
  /** @license React v16.13.1
645
655
  * react-is.production.min.js
646
656
  *
@@ -650,7 +660,7 @@ var Ie = xn(), De = { exports: {} }, x = {};
650
660
  * LICENSE file in the root directory of this source tree.
651
661
  */
652
662
  var At;
653
- function Sn() {
663
+ function In() {
654
664
  if (At) return x;
655
665
  At = 1;
656
666
  var t = typeof Symbol == "function" && Symbol.for, e = t ? Symbol.for("react.element") : 60103, n = t ? Symbol.for("react.portal") : 60106, i = t ? Symbol.for("react.fragment") : 60107, a = t ? Symbol.for("react.strict_mode") : 60108, l = t ? Symbol.for("react.profiler") : 60114, f = t ? Symbol.for("react.provider") : 60109, h = t ? Symbol.for("react.context") : 60110, m = t ? Symbol.for("react.async_mode") : 60111, p = t ? Symbol.for("react.concurrent_mode") : 60111, E = t ? Symbol.for("react.forward_ref") : 60112, P = t ? Symbol.for("react.suspense") : 60113, D = t ? Symbol.for("react.suspense_list") : 60120, j = t ? Symbol.for("react.memo") : 60115, A = t ? Symbol.for("react.lazy") : 60116, B = t ? Symbol.for("react.block") : 60121, Q = t ? Symbol.for("react.fundamental") : 60117, z = t ? Symbol.for("react.responder") : 60118, I = t ? Symbol.for("react.scope") : 60119;
@@ -725,7 +735,7 @@ var S = {};
725
735
  * LICENSE file in the root directory of this source tree.
726
736
  */
727
737
  var kt;
728
- function Cn() {
738
+ function Pn() {
729
739
  return kt || (kt = 1, process.env.NODE_ENV !== "production" && function() {
730
740
  var t = typeof Symbol == "function" && Symbol.for, e = t ? Symbol.for("react.element") : 60103, n = t ? Symbol.for("react.portal") : 60106, i = t ? Symbol.for("react.fragment") : 60107, a = t ? Symbol.for("react.strict_mode") : 60108, l = t ? Symbol.for("react.profiler") : 60114, f = t ? Symbol.for("react.provider") : 60109, h = t ? Symbol.for("react.context") : 60110, m = t ? Symbol.for("react.async_mode") : 60111, p = t ? Symbol.for("react.concurrent_mode") : 60111, E = t ? Symbol.for("react.forward_ref") : 60112, P = t ? Symbol.for("react.suspense") : 60113, D = t ? Symbol.for("react.suspense_list") : 60120, j = t ? Symbol.for("react.memo") : 60115, A = t ? Symbol.for("react.lazy") : 60116, B = t ? Symbol.for("react.block") : 60121, Q = t ? Symbol.for("react.fundamental") : 60117, z = t ? Symbol.for("react.responder") : 60118, I = t ? Symbol.for("react.scope") : 60119;
731
741
  function k(d) {
@@ -764,7 +774,7 @@ function Cn() {
764
774
  }
765
775
  }
766
776
  }
767
- var c = m, L = p, he = h, Re = f, we = e, Ve = E, Ye = i, Oe = A, J = j, ee = n, oe = l, _e = a, Ae = P, ve = !1;
777
+ var c = m, L = p, he = h, Re = f, we = e, Ve = E, Ye = i, Oe = A, K = j, ee = n, oe = l, _e = a, Ae = P, ve = !1;
768
778
  function ke(d) {
769
779
  return ve || (ve = !0, console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API.")), pe(d) || w(d) === m;
770
780
  }
@@ -804,18 +814,18 @@ function Cn() {
804
814
  function Ue(d) {
805
815
  return w(d) === P;
806
816
  }
807
- S.AsyncMode = c, S.ConcurrentMode = L, S.ContextConsumer = he, S.ContextProvider = Re, S.Element = we, S.ForwardRef = Ve, S.Fragment = Ye, S.Lazy = Oe, S.Memo = J, S.Portal = ee, S.Profiler = oe, S.StrictMode = _e, S.Suspense = Ae, S.isAsyncMode = ke, S.isConcurrentMode = pe, S.isContextConsumer = Me, S.isContextProvider = Fe, S.isElement = je, S.isForwardRef = Be, S.isFragment = We, S.isLazy = ye, S.isMemo = ge, S.isPortal = le, S.isProfiler = be, S.isStrictMode = ce, S.isSuspense = Ue, S.isValidElementType = k, S.typeOf = w;
817
+ S.AsyncMode = c, S.ConcurrentMode = L, S.ContextConsumer = he, S.ContextProvider = Re, S.Element = we, S.ForwardRef = Ve, S.Fragment = Ye, S.Lazy = Oe, S.Memo = K, S.Portal = ee, S.Profiler = oe, S.StrictMode = _e, S.Suspense = Ae, S.isAsyncMode = ke, S.isConcurrentMode = pe, S.isContextConsumer = Me, S.isContextProvider = Fe, S.isElement = je, S.isForwardRef = Be, S.isFragment = We, S.isLazy = ye, S.isMemo = ge, S.isPortal = le, S.isProfiler = be, S.isStrictMode = ce, S.isSuspense = Ue, S.isValidElementType = k, S.typeOf = w;
808
818
  }()), S;
809
819
  }
810
820
  var Mt;
811
- function In() {
812
- return Mt || (Mt = 1, process.env.NODE_ENV === "production" ? De.exports = Sn() : De.exports = Cn()), De.exports;
821
+ function Rn() {
822
+ return Mt || (Mt = 1, process.env.NODE_ENV === "production" ? De.exports = In() : De.exports = Pn()), De.exports;
813
823
  }
814
824
  var Ze, Ft;
815
- function Pn() {
825
+ function wn() {
816
826
  if (Ft) return Ze;
817
827
  Ft = 1;
818
- var t = In(), e = {
828
+ var t = Rn(), e = {
819
829
  childContextTypes: !0,
820
830
  contextType: !0,
821
831
  contextTypes: !0,
@@ -877,15 +887,15 @@ function Pn() {
877
887
  }
878
888
  return Ze = j, Ze;
879
889
  }
880
- Pn();
881
- var Rn = !0;
882
- function wn(t, e, n) {
890
+ wn();
891
+ var On = !0;
892
+ function _n(t, e, n) {
883
893
  var i = "";
884
894
  return n.split(" ").forEach(function(a) {
885
895
  t[a] !== void 0 ? e.push(t[a] + ";") : a && (i += a + " ");
886
896
  }), i;
887
897
  }
888
- var Ht = function(e, n, i) {
898
+ var Jt = function(e, n, i) {
889
899
  var a = e.key + "-" + n.name;
890
900
  // we only need to add the styles to the registered cache if the
891
901
  // class name could be used further down
@@ -896,9 +906,9 @@ var Ht = function(e, n, i) {
896
906
  // in node since emotion-server relies on whether a style is in
897
907
  // the registered cache to know whether a style is global or not
898
908
  // also, note that this check will be dead code eliminated in the browser
899
- Rn === !1) && e.registered[a] === void 0 && (e.registered[a] = n.styles);
900
- }, On = function(e, n, i) {
901
- Ht(e, n, i);
909
+ On === !1) && e.registered[a] === void 0 && (e.registered[a] = n.styles);
910
+ }, An = function(e, n, i) {
911
+ Jt(e, n, i);
902
912
  var a = e.key + "-" + n.name;
903
913
  if (e.inserted[n.name] === void 0) {
904
914
  var l = n;
@@ -907,7 +917,7 @@ var Ht = function(e, n, i) {
907
917
  while (l !== void 0);
908
918
  }
909
919
  };
910
- function _n(t) {
920
+ function kn(t) {
911
921
  for (var e = 0, n, i = 0, a = t.length; a >= 4; ++i, a -= 4)
912
922
  n = t.charCodeAt(i) & 255 | (t.charCodeAt(++i) & 255) << 8 | (t.charCodeAt(++i) & 255) << 16 | (t.charCodeAt(++i) & 255) << 24, n = /* Math.imul(k, m): */
913
923
  (n & 65535) * 1540483477 + ((n >>> 16) * 59797 << 16), n ^= /* k >>> r: */
@@ -926,7 +936,7 @@ function _n(t) {
926
936
  return e ^= e >>> 13, e = /* Math.imul(h, m): */
927
937
  (e & 65535) * 1540483477 + ((e >>> 16) * 59797 << 16), ((e ^ e >>> 15) >>> 0).toString(36);
928
938
  }
929
- var An = {
939
+ var Mn = {
930
940
  animationIterationCount: 1,
931
941
  aspectRatio: 1,
932
942
  borderImageOutset: 1,
@@ -976,24 +986,24 @@ var An = {
976
986
  strokeOpacity: 1,
977
987
  strokeWidth: 1
978
988
  };
979
- function kn(t) {
989
+ function Fn(t) {
980
990
  var e = /* @__PURE__ */ Object.create(null);
981
991
  return function(n) {
982
992
  return e[n] === void 0 && (e[n] = t(n)), e[n];
983
993
  };
984
994
  }
985
- var Mn = /[A-Z]|^ms/g, Fn = /_EMO_([^_]+?)_([^]*?)_EMO_/g, Gt = function(e) {
995
+ var jn = /[A-Z]|^ms/g, Nn = /_EMO_([^_]+?)_([^]*?)_EMO_/g, Kt = function(e) {
986
996
  return e.charCodeAt(1) === 45;
987
997
  }, jt = function(e) {
988
998
  return e != null && typeof e != "boolean";
989
- }, Qe = /* @__PURE__ */ kn(function(t) {
990
- return Gt(t) ? t : t.replace(Mn, "-$&").toLowerCase();
999
+ }, Qe = /* @__PURE__ */ Fn(function(t) {
1000
+ return Kt(t) ? t : t.replace(jn, "-$&").toLowerCase();
991
1001
  }), Nt = function(e, n) {
992
1002
  switch (e) {
993
1003
  case "animation":
994
1004
  case "animationName":
995
1005
  if (typeof n == "string")
996
- return n.replace(Fn, function(i, a, l) {
1006
+ return n.replace(Nn, function(i, a, l) {
997
1007
  return X = {
998
1008
  name: a,
999
1009
  styles: l,
@@ -1001,7 +1011,7 @@ var Mn = /[A-Z]|^ms/g, Fn = /_EMO_([^_]+?)_([^]*?)_EMO_/g, Gt = function(e) {
1001
1011
  }, a;
1002
1012
  });
1003
1013
  }
1004
- return An[e] !== 1 && !Gt(e) && typeof n == "number" && n !== 0 ? n + "px" : n;
1014
+ return Mn[e] !== 1 && !Kt(e) && typeof n == "number" && n !== 0 ? n + "px" : n;
1005
1015
  };
1006
1016
  function Pe(t, e, n) {
1007
1017
  if (n == null)
@@ -1033,7 +1043,7 @@ function Pe(t, e, n) {
1033
1043
  var h = l.styles + ";";
1034
1044
  return h;
1035
1045
  }
1036
- return jn(t, e, n);
1046
+ return $n(t, e, n);
1037
1047
  }
1038
1048
  case "function": {
1039
1049
  if (t !== void 0) {
@@ -1046,7 +1056,7 @@ function Pe(t, e, n) {
1046
1056
  var E = n;
1047
1057
  return E;
1048
1058
  }
1049
- function jn(t, e, n) {
1059
+ function $n(t, e, n) {
1050
1060
  var i = "";
1051
1061
  if (Array.isArray(n))
1052
1062
  for (var a = 0; a < n.length; a++)
@@ -1076,7 +1086,7 @@ function jn(t, e, n) {
1076
1086
  return i;
1077
1087
  }
1078
1088
  var $t = /label:\s*([^\s;{]+)\s*(;|$)/g, X;
1079
- function Nn(t, e, n) {
1089
+ function Dn(t, e, n) {
1080
1090
  if (t.length === 1 && typeof t[0] == "object" && t[0] !== null && t[0].styles !== void 0)
1081
1091
  return t[0];
1082
1092
  var i = !0, a = "";
@@ -1096,708 +1106,331 @@ function Nn(t, e, n) {
1096
1106
  $t.lastIndex = 0;
1097
1107
  for (var p = "", E; (E = $t.exec(a)) !== null; )
1098
1108
  p += "-" + E[1];
1099
- var P = _n(a) + p;
1109
+ var P = kn(a) + p;
1100
1110
  return {
1101
1111
  name: P,
1102
1112
  styles: a,
1103
1113
  next: X
1104
1114
  };
1105
1115
  }
1106
- var $n = function(e) {
1116
+ var zn = function(e) {
1107
1117
  return e();
1108
- }, Dn = te.useInsertionEffect ? te.useInsertionEffect : !1, zn = Dn || $n, Jt = /* @__PURE__ */ te.createContext(
1118
+ }, Ln = re.useInsertionEffect ? re.useInsertionEffect : !1, Vn = Ln || zn, Xt = /* @__PURE__ */ re.createContext(
1109
1119
  // we're doing this to avoid preconstruct's dead code elimination in this one case
1110
1120
  // because this module is primarily intended for the browser and node
1111
1121
  // but it's also required in react native and similar environments sometimes
1112
1122
  // and we could have a special build just for that
1113
1123
  // but this is much easier and the native packages
1114
1124
  // might use a different theme context in the future anyway
1115
- typeof HTMLElement < "u" ? /* @__PURE__ */ _r({
1125
+ typeof HTMLElement < "u" ? /* @__PURE__ */ kr({
1116
1126
  key: "css"
1117
1127
  }) : null
1118
1128
  );
1119
- Jt.Provider;
1120
- var Ln = function(e) {
1121
- return /* @__PURE__ */ Rr(function(n, i) {
1122
- var a = st(Jt);
1129
+ Xt.Provider;
1130
+ var Yn = function(e) {
1131
+ return /* @__PURE__ */ Or(function(n, i) {
1132
+ var a = st(Xt);
1123
1133
  return e(n, a, i);
1124
1134
  });
1125
- }, Vn = /* @__PURE__ */ te.createContext({}), ze = {}.hasOwnProperty, it = "__EMOTION_TYPE_PLEASE_DO_NOT_USE__", Kt = function(e, n) {
1135
+ }, Bn = /* @__PURE__ */ re.createContext({}), ze = {}.hasOwnProperty, it = "__EMOTION_TYPE_PLEASE_DO_NOT_USE__", Zt = function(e, n) {
1126
1136
  var i = {};
1127
1137
  for (var a in n)
1128
1138
  ze.call(n, a) && (i[a] = n[a]);
1129
1139
  return i[it] = e, i;
1130
- }, Yn = function(e) {
1140
+ }, Wn = function(e) {
1131
1141
  var n = e.cache, i = e.serialized, a = e.isStringTag;
1132
- return Ht(n, i, a), zn(function() {
1133
- return On(n, i, a);
1142
+ return Jt(n, i, a), Vn(function() {
1143
+ return An(n, i, a);
1134
1144
  }), null;
1135
- }, Bn = /* @__PURE__ */ Ln(function(t, e, n) {
1145
+ }, Un = /* @__PURE__ */ Yn(function(t, e, n) {
1136
1146
  var i = t.css;
1137
1147
  typeof i == "string" && e.registered[i] !== void 0 && (i = e.registered[i]);
1138
1148
  var a = t[it], l = [i], f = "";
1139
- typeof t.className == "string" ? f = wn(e.registered, l, t.className) : t.className != null && (f = t.className + " ");
1140
- var h = Nn(l, void 0, te.useContext(Vn));
1149
+ typeof t.className == "string" ? f = _n(e.registered, l, t.className) : t.className != null && (f = t.className + " ");
1150
+ var h = Dn(l, void 0, re.useContext(Bn));
1141
1151
  f += e.key + "-" + h.name;
1142
1152
  var m = {};
1143
1153
  for (var p in t)
1144
1154
  ze.call(t, p) && p !== "css" && p !== it && (m[p] = t[p]);
1145
- return m.className = f, n && (m.ref = n), /* @__PURE__ */ te.createElement(te.Fragment, null, /* @__PURE__ */ te.createElement(Yn, {
1155
+ return m.className = f, n && (m.ref = n), /* @__PURE__ */ re.createElement(re.Fragment, null, /* @__PURE__ */ re.createElement(Wn, {
1146
1156
  cache: e,
1147
1157
  serialized: h,
1148
1158
  isStringTag: typeof a == "string"
1149
- }), /* @__PURE__ */ te.createElement(a, m));
1150
- }), Xt = Bn, Le = Ie.Fragment, o = function(e, n, i) {
1151
- return ze.call(n, "css") ? Ie.jsx(Xt, Kt(e, n), i) : Ie.jsx(e, n, i);
1159
+ }), /* @__PURE__ */ re.createElement(a, m));
1160
+ }), Qt = Un, Le = Ie.Fragment, o = function(e, n, i) {
1161
+ return ze.call(n, "css") ? Ie.jsx(Qt, Zt(e, n), i) : Ie.jsx(e, n, i);
1152
1162
  }, F = function(e, n, i) {
1153
- return ze.call(n, "css") ? Ie.jsxs(Xt, Kt(e, n), i) : Ie.jsxs(e, n, i);
1154
- }, R = /* @__PURE__ */ ((t) => (t.Off = "Off", t.All = "All", t.One = "One", t))(R || {});
1155
- const Zt = 80, Wn = Y(
1156
- ({ playerStore: t, playQueueStore: e }) => {
1157
- const n = ie(), i = $(
1158
- (f) => {
1159
- const h = Number(f.currentTarget.value) / 100;
1160
- t.setPercent(h);
1161
- },
1162
- [t]
1163
- ), a = $(
1164
- (f) => {
1165
- f.button === 0 && t.setSeeking(!0);
1166
- },
1167
- [t]
1168
- ), l = $(
1169
- async (f) => {
1170
- if (f.button === 0) {
1171
- const h = Number(f.currentTarget.value) / 100;
1172
- t.setSeeking(!1);
1173
- const m = await n.getDuration();
1174
- m !== void 0 && await n.setCurrentTime(m * h);
1163
+ return ze.call(n, "css") ? Ie.jsxs(Qt, Zt(e, n), i) : Ie.jsxs(e, n, i);
1164
+ };
1165
+ const qn = ({
1166
+ onCancel: t,
1167
+ onSave: e
1168
+ }) => {
1169
+ const [n, i] = q(""), [a, l] = q(""), [f, h] = q(!1);
1170
+ return /* @__PURE__ */ F(zr, { onClose: t, initialFocus: "[name=url]", children: [
1171
+ /* @__PURE__ */ o(Fr, { children: /* @__PURE__ */ o(Mr, { children: "Add video" }) }),
1172
+ /* @__PURE__ */ o(Nr, { children: /* @__PURE__ */ F(jr, { component: "form", children: [
1173
+ /* @__PURE__ */ o(tt, { label: "URL", children: /* @__PURE__ */ o(
1174
+ It,
1175
+ {
1176
+ name: "url",
1177
+ value: n,
1178
+ onChange: (m) => i(m.target.value)
1179
+ }
1180
+ ) }),
1181
+ /* @__PURE__ */ o(tt, { label: "Title", children: /* @__PURE__ */ o(
1182
+ It,
1183
+ {
1184
+ name: "title",
1185
+ value: a,
1186
+ onChange: (m) => l(m.target.value)
1187
+ }
1188
+ ) })
1189
+ ] }) }),
1190
+ /* @__PURE__ */ F($r, { children: [
1191
+ /* @__PURE__ */ o(Dr, { onClick: t, children: "Cancel" }),
1192
+ /* @__PURE__ */ o(
1193
+ ne,
1194
+ {
1195
+ type: "submit",
1196
+ onClick: async () => {
1197
+ try {
1198
+ h(!0), await e({ url: n, title: a });
1199
+ } finally {
1200
+ h(!1);
1201
+ }
1202
+ },
1203
+ fill: !0,
1204
+ disabled: n.trim().length === 0,
1205
+ isLoading: f,
1206
+ children: "Save"
1207
+ }
1208
+ )
1209
+ ] })
1210
+ ] });
1211
+ };
1212
+ function Hn(t) {
1213
+ return t !== null && typeof t == "object" && "title" in t && typeof t.title == "string";
1214
+ }
1215
+ const Dt = Z(
1216
+ ({ playQueueStore: t }) => {
1217
+ const [e, n] = q(!1), i = $(
1218
+ async (a) => {
1219
+ const l = gn(a.url);
1220
+ if (l !== void 0) {
1221
+ const f = l.extractVideoId(a.url);
1222
+ if (f !== void 0) {
1223
+ const m = await (await fetch(
1224
+ `https://noembed.com/embed?url=${encodeURIComponent(
1225
+ a.url
1226
+ )}`
1227
+ )).json();
1228
+ await t.addItems([
1229
+ t.createItem({
1230
+ url: a.url,
1231
+ type: l.type,
1232
+ videoId: f,
1233
+ title: a.title || (Hn(m) ? m.title : f)
1234
+ })
1235
+ ]);
1236
+ }
1175
1237
  }
1238
+ n(!1);
1176
1239
  },
1177
- [t, n]
1178
- );
1179
- return /* @__PURE__ */ o(
1180
- Vt,
1181
- {
1182
- min: 0,
1183
- max: 100,
1184
- step: 1e-7,
1185
- value: t.percent * 100,
1186
- onChange: i,
1187
- onMouseDown: a,
1188
- onMouseUp: l,
1189
- fullWidth: !0,
1190
- showRange: !0,
1191
- css: { blockSize: 32 },
1192
- disabled: e.isEmpty
1193
- }
1240
+ [t]
1194
1241
  );
1242
+ return /* @__PURE__ */ F(Le, { children: [
1243
+ /* @__PURE__ */ o(
1244
+ ne,
1245
+ {
1246
+ onClick: () => n(!0),
1247
+ iconType: ct,
1248
+ color: "primary",
1249
+ children: "Add video"
1250
+ }
1251
+ ),
1252
+ e && /* @__PURE__ */ o(
1253
+ qn,
1254
+ {
1255
+ onCancel: () => n(!1),
1256
+ onSave: i
1257
+ }
1258
+ )
1259
+ ] });
1195
1260
  }
1196
- ), Un = Z(
1197
- ({ button: t, isOpen: e, closePopover: n }) => {
1198
- const [i, a] = q("0"), l = ie();
1199
- wr(() => {
1200
- e && l.getVolume().then((h) => {
1201
- h !== void 0 && a(Math.floor(h * 100).toString());
1202
- });
1203
- }, [e, l]);
1204
- const f = $(
1205
- async (h) => {
1206
- a(h.currentTarget.value), await l.setVolume(Number(h.currentTarget.value) / 100);
1207
- },
1208
- [l]
1209
- );
1210
- return /* @__PURE__ */ o(
1211
- lt,
1261
+ ), Gn = Y(
1262
+ ({ playQueueStore: t }) => {
1263
+ const { euiTheme: e } = Yt();
1264
+ return /* @__PURE__ */ F(
1265
+ Vr,
1212
1266
  {
1213
- button: t,
1214
- isOpen: e,
1215
- closePopover: n,
1216
- anchorPosition: "upRight",
1217
- children: /* @__PURE__ */ o(tt, { children: /* @__PURE__ */ F(
1218
- me,
1219
- {
1220
- responsive: !1,
1221
- gutterSize: "s",
1222
- justifyContent: "center",
1223
- alignItems: "center",
1224
- children: [
1225
- /* @__PURE__ */ o(
1226
- K,
1227
- {
1228
- title: "Mute",
1229
- "aria-label": "Mute",
1230
- iconType: Ut,
1231
- size: "s",
1232
- iconSize: "l"
1233
- }
1234
- ),
1235
- /* @__PURE__ */ o(
1236
- Vt,
1237
- {
1238
- min: 0,
1239
- max: 100,
1240
- step: 1,
1241
- value: i,
1242
- onChange: f,
1243
- css: { blockSize: 32 }
1244
- }
1245
- )
1246
- ]
1247
- }
1248
- ) })
1267
+ style: {
1268
+ position: "sticky",
1269
+ top: 112,
1270
+ zIndex: 998,
1271
+ background: e.colors.backgroundBasePlain
1272
+ },
1273
+ children: [
1274
+ /* @__PURE__ */ o(Lr, { children: /* @__PURE__ */ o(
1275
+ Bt,
1276
+ {
1277
+ id: "",
1278
+ checked: t.allItemsSelected,
1279
+ onChange: (n) => {
1280
+ t.allItemsSelected = n.target.checked;
1281
+ }
1282
+ }
1283
+ ) }),
1284
+ /* @__PURE__ */ o(Xe, { width: 24 }),
1285
+ /* @__PURE__ */ o(Xe, { children: "Title" }),
1286
+ /* @__PURE__ */ o(Xe, {})
1287
+ ]
1249
1288
  }
1250
1289
  );
1251
1290
  }
1252
- ), qn = Z(
1291
+ ), Jn = Z(
1253
1292
  ({
1254
- playQueueStore: t,
1293
+ item: t,
1255
1294
  closePopover: e
1256
1295
  }) => {
1257
- const n = ie(), i = $(async () => {
1258
- const p = await n.getCurrentTime();
1259
- p !== void 0 && await n.setCurrentTime(p - 10), e();
1260
- }, [n, e]), a = $(async () => {
1261
- const p = await n.getCurrentTime();
1262
- p !== void 0 && await n.setCurrentTime(p + 30), e();
1263
- }, [n, e]), l = $(
1264
- async (p) => {
1265
- await n.setPlaybackRate(p), e();
1266
- },
1267
- [n, e]
1268
- ), f = $(async () => {
1269
- t.currentItem !== void 0 && await t.removeItems([
1270
- t.currentItem
1271
- ]), e();
1272
- }, [t, e]), [h] = q(), m = zt(
1273
- () => [
1296
+ const n = Z(
1297
+ ({
1298
+ onClick: i,
1299
+ ...a
1300
+ }) => {
1301
+ const l = $(
1302
+ (f) => {
1303
+ e(), i == null || i(f);
1304
+ },
1305
+ [i]
1306
+ );
1307
+ return /* @__PURE__ */ o(Yr, { ...a, onClick: l });
1308
+ }
1309
+ );
1310
+ return /* @__PURE__ */ F(Br, { children: [
1311
+ /* @__PURE__ */ o(
1312
+ n,
1274
1313
  {
1275
- id: 0,
1276
- items: [
1277
- {
1278
- name: "Speed",
1279
- icon: /* @__PURE__ */ o(H, { type: cn, size: "m" }),
1280
- panel: 1
1281
- },
1282
- {
1283
- name: "Skip back 10 seconds",
1284
- icon: /* @__PURE__ */ o(H, { type: un, size: "m" }),
1285
- onClick: i,
1286
- disabled: t.isEmpty
1287
- },
1288
- {
1289
- name: "Skip forward 30 seconds",
1290
- icon: /* @__PURE__ */ o(H, { type: fn, size: "m" }),
1291
- onClick: a,
1292
- disabled: t.isEmpty
1293
- },
1294
- {
1295
- isSeparator: !0
1296
- },
1297
- {
1298
- name: "Remove from play queue",
1299
- icon: /* @__PURE__ */ o(H, { type: ct, size: "m" }),
1300
- onClick: f,
1301
- disabled: t.isEmpty
1302
- }
1303
- ]
1304
- },
1314
+ icon: /* @__PURE__ */ o(H, { type: "" }),
1315
+ onClick: t.playFirst,
1316
+ children: "Play first"
1317
+ }
1318
+ ),
1319
+ /* @__PURE__ */ o(
1320
+ n,
1305
1321
  {
1306
- id: 1,
1307
- title: "Speed",
1308
- items: [0.25, 0.5, 0.75, 1, 1.25, 1.5, 1.75, 2].map(
1309
- (p) => ({
1310
- name: p.toString(),
1311
- onClick: () => l(p),
1312
- icon: p === h ? "check" : "empty"
1313
- })
1314
- )
1322
+ icon: /* @__PURE__ */ o(H, { type: "" }),
1323
+ onClick: t.playNext,
1324
+ children: "Play next"
1315
1325
  }
1316
- ],
1317
- [
1318
- t,
1319
- i,
1320
- a,
1321
- f,
1322
- l,
1323
- h
1324
- ]
1325
- );
1326
- return /* @__PURE__ */ o(Fr, { initialPanelId: 0, panels: m });
1327
- }
1328
- ), Hn = Z(
1329
- ({
1330
- playQueueStore: t,
1331
- button: e,
1332
- isOpen: n,
1333
- closePopover: i
1334
- }) => /* @__PURE__ */ o(
1335
- lt,
1336
- {
1337
- button: e,
1338
- isOpen: n,
1339
- closePopover: i,
1340
- panelPaddingSize: "none",
1341
- anchorPosition: "upRight",
1342
- children: /* @__PURE__ */ o(
1343
- qn,
1326
+ ),
1327
+ /* @__PURE__ */ o(
1328
+ n,
1344
1329
  {
1345
- playQueueStore: t,
1346
- closePopover: i
1330
+ icon: /* @__PURE__ */ o(H, { type: ct }),
1331
+ onClick: t.addToPlayQueue,
1332
+ children: "Add to play queue"
1347
1333
  }
1348
- )
1349
- }
1350
- )
1351
- ), Gn = {
1352
- [R.Off]: tn,
1353
- [R.All]: en,
1354
- [R.One]: Qr
1355
- }, Jn = Y(
1356
- ({
1357
- playerStore: t,
1358
- playQueueStore: e
1359
- }) => {
1360
- const n = ie(), i = $(async () => {
1361
- if (e.hasPreviousItem) {
1362
- const a = await n.getCurrentTime();
1363
- a === void 0 || a < 5 ? await e.previous() : await n.setCurrentTime(0);
1364
- } else
1365
- await n.setCurrentTime(0);
1366
- }, [e, n]);
1367
- return /* @__PURE__ */ F(
1368
- me,
1369
- {
1370
- responsive: !1,
1371
- gutterSize: "s",
1372
- justifyContent: "center",
1373
- alignItems: "center",
1374
- children: [
1375
- /* @__PURE__ */ o(
1376
- K,
1377
- {
1378
- title: `Shuffle: ${e.shuffle ? "On" : "Off"}`,
1379
- "aria-label": `Shuffle: ${e.shuffle ? "On" : "Off"}`,
1380
- iconType: e.shuffle ? rn : nn,
1381
- size: "s",
1382
- iconSize: "l",
1383
- onClick: e.toggleShuffle,
1384
- disabled: !0
1385
- }
1386
- ),
1387
- /* @__PURE__ */ o(
1388
- K,
1389
- {
1390
- title: "Previous",
1391
- "aria-label": "Previous",
1392
- iconType: on,
1393
- size: "s",
1394
- iconSize: "l",
1395
- onClick: i,
1396
- disabled: e.isEmpty
1397
- }
1398
- ),
1399
- t.playing ? /* @__PURE__ */ o(
1400
- K,
1401
- {
1402
- title: "Pause",
1403
- "aria-label": "Pause",
1404
- iconType: an,
1405
- size: "s",
1406
- iconSize: "l",
1407
- onClick: () => n.pause(),
1408
- disabled: !e.canPlay
1409
- }
1410
- ) : /* @__PURE__ */ o(
1411
- K,
1412
- {
1413
- title: "Play",
1414
- "aria-label": "Play",
1415
- iconType: sn,
1416
- size: "s",
1417
- iconSize: "l",
1418
- onClick: () => n.play(),
1419
- disabled: !e.canPlay
1420
- }
1421
- ),
1422
- /* @__PURE__ */ o(
1423
- K,
1424
- {
1425
- title: "Next",
1426
- "aria-label": "Next",
1427
- iconType: ln,
1428
- size: "s",
1429
- iconSize: "l",
1430
- onClick: e.next,
1431
- disabled: !e.hasNextItem
1432
- }
1433
- ),
1434
- /* @__PURE__ */ o(
1435
- K,
1436
- {
1437
- title: `Repeat: ${e.repeat === R.All ? "All" : e.repeat === R.One ? "One" : "Off"}`,
1438
- "aria-label": `Repeat: ${e.repeat === R.All ? "All" : e.repeat === R.One ? "One" : "Off"}`,
1439
- iconType: Gn[e.repeat],
1440
- size: "s",
1441
- iconSize: "l",
1442
- onClick: e.toggleRepeat
1443
- }
1444
- )
1445
- ]
1446
- }
1447
- );
1448
- }
1449
- ), Kn = Z(() => {
1450
- const [t, e] = q(!1);
1451
- return /* @__PURE__ */ o(
1452
- Un,
1453
- {
1454
- button: /* @__PURE__ */ o(
1455
- K,
1334
+ ),
1335
+ /* @__PURE__ */ o(Pt, { margin: "none" }),
1336
+ /* @__PURE__ */ o(
1337
+ n,
1456
1338
  {
1457
- title: "Volume",
1458
- "aria-label": "Volume",
1459
- iconType: Ut,
1460
- size: "s",
1461
- iconSize: "l",
1462
- onClick: () => e(!t)
1339
+ icon: /* @__PURE__ */ o(H, { type: en }),
1340
+ onClick: t.moveToTop,
1341
+ disabled: !t.canMoveToTop,
1342
+ children: "Move to the top"
1463
1343
  }
1464
1344
  ),
1465
- isOpen: t,
1466
- closePopover: () => e(!1)
1467
- }
1468
- );
1469
- }), Xn = Z(
1470
- ({ playQueueStore: t }) => {
1471
- const [e, n] = q(!1);
1345
+ /* @__PURE__ */ o(
1346
+ n,
1347
+ {
1348
+ icon: /* @__PURE__ */ o(H, { type: tn }),
1349
+ onClick: t.moveToBottom,
1350
+ disabled: !t.canMoveToBottom,
1351
+ children: "Move to the bottom"
1352
+ }
1353
+ ),
1354
+ /* @__PURE__ */ o(Pt, { margin: "none" }),
1355
+ /* @__PURE__ */ o(
1356
+ n,
1357
+ {
1358
+ icon: /* @__PURE__ */ o(H, { type: "" }),
1359
+ onClick: t.removeToTop,
1360
+ disabled: !t.canRemoveToTop,
1361
+ children: "Remove to the top"
1362
+ }
1363
+ ),
1364
+ /* @__PURE__ */ o(
1365
+ n,
1366
+ {
1367
+ icon: /* @__PURE__ */ o(H, { type: "" }),
1368
+ onClick: t.removeOthers,
1369
+ disabled: !t.canRemoveOthers,
1370
+ children: "Remove others"
1371
+ }
1372
+ )
1373
+ ] });
1374
+ }
1375
+ ), Kn = Z(
1376
+ ({ item: t }) => {
1377
+ const [e, n] = q(!1), i = $(() => n(!e), [e]), a = $(() => n(!1), []);
1472
1378
  return /* @__PURE__ */ o(
1473
- Hn,
1379
+ lt,
1474
1380
  {
1475
- playQueueStore: t,
1476
1381
  button: /* @__PURE__ */ o(
1477
- K,
1382
+ G,
1478
1383
  {
1479
1384
  title: "More options",
1480
1385
  "aria-label": "More options",
1481
1386
  iconType: qt,
1482
1387
  size: "s",
1483
- iconSize: "l",
1484
- onClick: () => n(!e)
1388
+ color: "text",
1389
+ onClick: i
1485
1390
  }
1486
1391
  ),
1487
1392
  isOpen: e,
1488
- closePopover: () => n(!1)
1393
+ closePopover: a,
1394
+ panelPaddingSize: "none",
1395
+ anchorPosition: "leftCenter",
1396
+ children: /* @__PURE__ */ o(
1397
+ Jn,
1398
+ {
1399
+ item: t,
1400
+ closePopover: a
1401
+ }
1402
+ )
1489
1403
  }
1490
1404
  );
1491
1405
  }
1492
- ), Zn = Z(
1493
- ({ playQueueStore: t }) => /* @__PURE__ */ F(
1494
- me,
1495
- {
1496
- responsive: !1,
1497
- gutterSize: "s",
1498
- justifyContent: "flexEnd",
1499
- alignItems: "center",
1500
- children: [
1501
- /* @__PURE__ */ o(Kn, {}),
1502
- /* @__PURE__ */ o(Xn, { playQueueStore: t })
1503
- ]
1504
- }
1505
- )
1506
- ), wi = Y(
1507
- ({ playerStore: t, playQueueStore: e }) => /* @__PURE__ */ o(Mr, { paddingSize: "s", children: /* @__PURE__ */ F(me, { direction: "column", gutterSize: "none", children: [
1508
- /* @__PURE__ */ o(G, { children: /* @__PURE__ */ o(
1509
- Wn,
1510
- {
1511
- playerStore: t,
1512
- playQueueStore: e
1513
- }
1514
- ) }),
1515
- /* @__PURE__ */ o(G, { children: /* @__PURE__ */ F(me, { responsive: !1, children: [
1516
- /* @__PURE__ */ o(G, { css: { width: "calc(100% / 3)" } }),
1517
- /* @__PURE__ */ o(G, { css: { width: "calc(100% / 3)" }, children: /* @__PURE__ */ o(
1518
- Jn,
1406
+ ), Xn = Y(
1407
+ ({ item: t }) => {
1408
+ const e = ie();
1409
+ return /* @__PURE__ */ F(rt, { textOnly: !1, hasActions: !0, align: "right", children: [
1410
+ /* @__PURE__ */ o(
1411
+ ne,
1519
1412
  {
1520
- playerStore: t,
1521
- playQueueStore: e
1413
+ iconType: Qr,
1414
+ size: "s",
1415
+ onClick: async () => {
1416
+ t.isCurrent ? await e.setCurrentTime(0) : t.play();
1417
+ },
1418
+ children: "Play"
1522
1419
  }
1523
- ) }),
1524
- /* @__PURE__ */ o(G, { css: { width: "calc(100% / 3)" }, children: /* @__PURE__ */ o(
1525
- Zn,
1420
+ ),
1421
+ /* @__PURE__ */ o(
1422
+ ne,
1526
1423
  {
1527
- playQueueStore: e
1528
- }
1529
- ) })
1530
- ] }) })
1531
- ] }) })
1532
- ), Qn = ({
1533
- onCancel: t,
1534
- onSave: e
1535
- }) => {
1536
- const [n, i] = q(""), [a, l] = q(""), [f, h] = q(!1);
1537
- return /* @__PURE__ */ F(Vr, { onClose: t, initialFocus: "[name=url]", children: [
1538
- /* @__PURE__ */ o(Nr, { children: /* @__PURE__ */ o(jr, { children: "Add video" }) }),
1539
- /* @__PURE__ */ o(Dr, { children: /* @__PURE__ */ F($r, { component: "form", children: [
1540
- /* @__PURE__ */ o(tt, { label: "URL", children: /* @__PURE__ */ o(
1541
- It,
1542
- {
1543
- name: "url",
1544
- value: n,
1545
- onChange: (m) => i(m.target.value)
1546
- }
1547
- ) }),
1548
- /* @__PURE__ */ o(tt, { label: "Title", children: /* @__PURE__ */ o(
1549
- It,
1550
- {
1551
- name: "title",
1552
- value: a,
1553
- onChange: (m) => l(m.target.value)
1554
- }
1555
- ) })
1556
- ] }) }),
1557
- /* @__PURE__ */ F(zr, { children: [
1558
- /* @__PURE__ */ o(Lr, { onClick: t, children: "Cancel" }),
1559
- /* @__PURE__ */ o(
1560
- ne,
1561
- {
1562
- type: "submit",
1563
- onClick: async () => {
1564
- try {
1565
- h(!0), await e({ url: n, title: a });
1566
- } finally {
1567
- h(!1);
1568
- }
1569
- },
1570
- fill: !0,
1571
- disabled: n.trim().length === 0,
1572
- isLoading: f,
1573
- children: "Save"
1574
- }
1575
- )
1576
- ] })
1577
- ] });
1578
- };
1579
- function ei(t) {
1580
- return t !== null && typeof t == "object" && "title" in t && typeof t.title == "string";
1581
- }
1582
- const Qt = Z(
1583
- ({ playQueueStore: t }) => {
1584
- const [e, n] = q(!1), i = $(
1585
- async (a) => {
1586
- const l = Ar(a.url);
1587
- if (l !== void 0) {
1588
- const f = l.extractVideoId(a.url);
1589
- if (f !== void 0) {
1590
- const m = await (await fetch(
1591
- `https://noembed.com/embed?url=${encodeURIComponent(
1592
- a.url
1593
- )}`
1594
- )).json();
1595
- await t.addItems([
1596
- t.createItem({
1597
- url: a.url,
1598
- type: l.type,
1599
- videoId: f,
1600
- title: a.title || (ei(m) ? m.title : f)
1601
- })
1602
- ]);
1603
- }
1604
- }
1605
- n(!1);
1606
- },
1607
- [t]
1608
- );
1609
- return /* @__PURE__ */ F(Le, { children: [
1610
- /* @__PURE__ */ o(
1611
- ne,
1612
- {
1613
- onClick: () => n(!0),
1614
- iconType: ut,
1615
- color: "primary",
1616
- children: "Add video"
1617
- }
1618
- ),
1619
- e && /* @__PURE__ */ o(
1620
- Qn,
1621
- {
1622
- onCancel: () => n(!1),
1623
- onSave: i
1624
- }
1625
- )
1626
- ] });
1627
- }
1628
- ), ti = Y(
1629
- ({ playQueueStore: t }) => {
1630
- const { euiTheme: e } = Yt();
1631
- return /* @__PURE__ */ F(
1632
- Br,
1633
- {
1634
- style: {
1635
- position: "sticky",
1636
- top: 112,
1637
- zIndex: 998,
1638
- background: e.colors.backgroundBasePlain
1639
- },
1640
- children: [
1641
- /* @__PURE__ */ o(Yr, { children: /* @__PURE__ */ o(
1642
- Bt,
1643
- {
1644
- id: "",
1645
- checked: t.allItemsSelected,
1646
- onChange: (n) => {
1647
- t.allItemsSelected = n.target.checked;
1648
- }
1649
- }
1650
- ) }),
1651
- /* @__PURE__ */ o(Xe, { width: 24 }),
1652
- /* @__PURE__ */ o(Xe, { children: "Title" }),
1653
- /* @__PURE__ */ o(Xe, {})
1654
- ]
1655
- }
1656
- );
1657
- }
1658
- ), ri = Z(
1659
- ({
1660
- item: t,
1661
- closePopover: e
1662
- }) => {
1663
- const n = Z(
1664
- ({
1665
- onClick: i,
1666
- ...a
1667
- }) => {
1668
- const l = $(
1669
- (f) => {
1670
- e(), i == null || i(f);
1671
- },
1672
- [i]
1673
- );
1674
- return /* @__PURE__ */ o(Wr, { ...a, onClick: l });
1675
- }
1676
- );
1677
- return /* @__PURE__ */ F(Ur, { children: [
1678
- /* @__PURE__ */ o(
1679
- n,
1680
- {
1681
- icon: /* @__PURE__ */ o(H, { type: "" }),
1682
- onClick: t.playFirst,
1683
- children: "Play first"
1684
- }
1685
- ),
1686
- /* @__PURE__ */ o(
1687
- n,
1688
- {
1689
- icon: /* @__PURE__ */ o(H, { type: "" }),
1690
- onClick: t.playNext,
1691
- children: "Play next"
1692
- }
1693
- ),
1694
- /* @__PURE__ */ o(
1695
- n,
1696
- {
1697
- icon: /* @__PURE__ */ o(H, { type: ut }),
1698
- onClick: t.addToPlayQueue,
1699
- children: "Add to play queue"
1700
- }
1701
- ),
1702
- /* @__PURE__ */ o(Pt, { margin: "none" }),
1703
- /* @__PURE__ */ o(
1704
- n,
1705
- {
1706
- icon: /* @__PURE__ */ o(H, { type: dn }),
1707
- onClick: t.moveToTop,
1708
- disabled: !t.canMoveToTop,
1709
- children: "Move to the top"
1710
- }
1711
- ),
1712
- /* @__PURE__ */ o(
1713
- n,
1714
- {
1715
- icon: /* @__PURE__ */ o(H, { type: mn }),
1716
- onClick: t.moveToBottom,
1717
- disabled: !t.canMoveToBottom,
1718
- children: "Move to the bottom"
1719
- }
1720
- ),
1721
- /* @__PURE__ */ o(Pt, { margin: "none" }),
1722
- /* @__PURE__ */ o(
1723
- n,
1724
- {
1725
- icon: /* @__PURE__ */ o(H, { type: "" }),
1726
- onClick: t.removeToTop,
1727
- disabled: !t.canRemoveToTop,
1728
- children: "Remove to the top"
1729
- }
1730
- ),
1731
- /* @__PURE__ */ o(
1732
- n,
1733
- {
1734
- icon: /* @__PURE__ */ o(H, { type: "" }),
1735
- onClick: t.removeOthers,
1736
- disabled: !t.canRemoveOthers,
1737
- children: "Remove others"
1738
- }
1739
- )
1740
- ] });
1741
- }
1742
- ), ni = Z(
1743
- ({ item: t }) => {
1744
- const [e, n] = q(!1), i = $(() => n(!e), [e]), a = $(() => n(!1), []);
1745
- return /* @__PURE__ */ o(
1746
- lt,
1747
- {
1748
- button: /* @__PURE__ */ o(
1749
- K,
1750
- {
1751
- title: "More options",
1752
- "aria-label": "More options",
1753
- iconType: qt,
1754
- size: "s",
1755
- color: "text",
1756
- onClick: i
1757
- }
1758
- ),
1759
- isOpen: e,
1760
- closePopover: a,
1761
- panelPaddingSize: "none",
1762
- anchorPosition: "leftCenter",
1763
- children: /* @__PURE__ */ o(
1764
- ri,
1765
- {
1766
- item: t,
1767
- closePopover: a
1768
- }
1769
- )
1770
- }
1771
- );
1772
- }
1773
- ), ii = Y(
1774
- ({ item: t }) => {
1775
- const e = ie();
1776
- return /* @__PURE__ */ F(rt, { textOnly: !1, hasActions: !0, align: "right", children: [
1777
- /* @__PURE__ */ o(
1778
- ne,
1779
- {
1780
- iconType: hn,
1781
- size: "s",
1782
- onClick: async () => {
1783
- t.isCurrent ? await e.setCurrentTime(0) : t.play();
1784
- },
1785
- children: "Play"
1786
- }
1787
- ),
1788
- /* @__PURE__ */ o(
1789
- ne,
1790
- {
1791
- iconType: ct,
1792
- size: "s",
1793
- onClick: t.remove,
1794
- children: "Remove"
1424
+ iconType: ut,
1425
+ size: "s",
1426
+ onClick: t.remove,
1427
+ children: "Remove"
1795
1428
  }
1796
1429
  ),
1797
- /* @__PURE__ */ o(ni, { item: t })
1430
+ /* @__PURE__ */ o(Kn, { item: t })
1798
1431
  ] });
1799
1432
  }
1800
- ), oi = {
1433
+ ), Zn = {
1801
1434
  Audio: "",
1802
1435
  Dailymotion: "https://www.dailymotion.com/favicon.ico",
1803
1436
  Niconico: "https://www.nicovideo.jp/favicon.ico",
@@ -1805,11 +1438,11 @@ const Qt = Z(
1805
1438
  Twitch: "https://www.twitch.tv/favicon.ico",
1806
1439
  Vimeo: "https://vimeo.com/favicon.ico",
1807
1440
  YouTube: "https://www.youtube.com/favicon.ico"
1808
- }, ai = Y(
1441
+ }, Qn = Y(
1809
1442
  ({ item: t }) => {
1810
1443
  const e = ie();
1811
- return /* @__PURE__ */ F(Gr, { isSelected: t.isCurrent, children: [
1812
- /* @__PURE__ */ o(qr, { children: /* @__PURE__ */ o(
1444
+ return /* @__PURE__ */ F(qr, { isSelected: t.isCurrent, children: [
1445
+ /* @__PURE__ */ o(Wr, { children: /* @__PURE__ */ o(
1813
1446
  Bt,
1814
1447
  {
1815
1448
  id: t.id.toString(),
@@ -1820,14 +1453,14 @@ const Qt = Z(
1820
1453
  /* @__PURE__ */ o(rt, { textOnly: !1, children: /* @__PURE__ */ o(
1821
1454
  "img",
1822
1455
  {
1823
- src: oi[t.type],
1456
+ src: Zn[t.type],
1824
1457
  width: 16,
1825
1458
  height: 16,
1826
1459
  alt: t.type
1827
1460
  }
1828
1461
  ) }),
1829
1462
  /* @__PURE__ */ o(rt, { children: /* @__PURE__ */ o(
1830
- Hr,
1463
+ Ur,
1831
1464
  {
1832
1465
  href: t.url,
1833
1466
  target: "_blank",
@@ -1836,36 +1469,37 @@ const Qt = Z(
1836
1469
  children: t.title
1837
1470
  }
1838
1471
  ) }),
1839
- /* @__PURE__ */ o(ii, { item: t })
1472
+ /* @__PURE__ */ o(Xn, { item: t })
1840
1473
  ] }, t.id);
1841
1474
  }
1842
- ), si = Y(
1475
+ ), ei = Y(
1843
1476
  ({ playQueueStore: t }) => /* @__PURE__ */ o(
1844
- pn,
1477
+ En,
1845
1478
  {
1846
1479
  tag: "tbody",
1847
1480
  list: t.items,
1848
1481
  setList: (e) => t.setItems(e),
1849
- children: t.items.map((e) => /* @__PURE__ */ o(ai, { item: e }, e.id))
1482
+ children: t.items.map((e) => /* @__PURE__ */ o(Qn, { item: e }, e.id))
1850
1483
  }
1851
1484
  )
1852
- ), li = Y(
1853
- ({ playQueueStore: t }) => /* @__PURE__ */ F(Jr, { children: [
1854
- /* @__PURE__ */ o(ti, { playQueueStore: t }),
1855
- /* @__PURE__ */ o(si, { playQueueStore: t })
1485
+ ), ti = Y(
1486
+ ({ playQueueStore: t }) => /* @__PURE__ */ F(Hr, { children: [
1487
+ /* @__PURE__ */ o(Gn, { playQueueStore: t }),
1488
+ /* @__PURE__ */ o(ei, { playQueueStore: t })
1856
1489
  ] })
1857
- ), ci = Y(
1490
+ );
1491
+ Y(
1858
1492
  ({ playQueueStore: t }) => {
1859
1493
  const [e, n] = q(!1);
1860
1494
  return /* @__PURE__ */ F(Le, { children: [
1861
1495
  e && /* @__PURE__ */ o(
1862
- Xr,
1496
+ Jr,
1863
1497
  {
1864
1498
  type: "push",
1865
1499
  size: "s",
1866
1500
  onClose: () => n(!1),
1867
1501
  children: /* @__PURE__ */ o("div", { style: { blockSize: "100%" }, children: /* @__PURE__ */ o(
1868
- Kr,
1502
+ Gr,
1869
1503
  {
1870
1504
  language: "json",
1871
1505
  overflowHeight: "100%",
@@ -1880,12 +1514,20 @@ const Qt = Z(
1880
1514
  ) })
1881
1515
  }
1882
1516
  ),
1883
- /* @__PURE__ */ o(Qt, { playQueueStore: t })
1517
+ /* @__PURE__ */ o(
1518
+ ne,
1519
+ {
1520
+ onClick: () => n((i) => !i),
1521
+ iconType: rn,
1522
+ children: "Developer tools"
1523
+ }
1524
+ )
1884
1525
  ] });
1885
1526
  }
1886
- ), ui = Y(
1887
- ({ playerStore: t, playQueueStore: e }) => {
1888
- const { euiTheme: n } = Yt();
1527
+ );
1528
+ const ri = Y(
1529
+ ({ playQueueStore: t }) => {
1530
+ const { euiTheme: e } = Yt();
1889
1531
  return /* @__PURE__ */ F(Le, { children: [
1890
1532
  /* @__PURE__ */ F(
1891
1533
  me,
@@ -1896,46 +1538,49 @@ const Qt = Z(
1896
1538
  position: "sticky",
1897
1539
  top: 48,
1898
1540
  zIndex: 998,
1899
- background: n.colors.backgroundBasePlain
1541
+ background: e.colors.backgroundBasePlain
1900
1542
  },
1901
1543
  children: [
1902
- /* @__PURE__ */ o(G, { grow: !1, children: /* @__PURE__ */ o(
1544
+ /* @__PURE__ */ o(J, { grow: !1, children: /* @__PURE__ */ o(
1903
1545
  ne,
1904
1546
  {
1905
- disabled: e.isEmpty || e.selectedItems.length === 0,
1906
- onClick: e.playSelectedItemsNext,
1547
+ disabled: t.isEmpty || t.selectedItems.length === 0,
1548
+ onClick: t.playSelectedItemsNext,
1907
1549
  children: "Play next"
1908
1550
  }
1909
1551
  ) }),
1910
- /* @__PURE__ */ o(G, { grow: !1, children: /* @__PURE__ */ o(
1552
+ /* @__PURE__ */ o(J, { grow: !1, children: /* @__PURE__ */ o(
1911
1553
  ne,
1912
1554
  {
1913
- iconType: ut,
1914
- onClick: e.addSelectedItems,
1915
- disabled: e.isEmpty || e.selectedItems.length === 0,
1555
+ iconType: ct,
1556
+ onClick: t.addSelectedItems,
1557
+ disabled: t.isEmpty || t.selectedItems.length === 0,
1916
1558
  children: "Add to play queue"
1917
1559
  }
1918
1560
  ) }),
1919
- /* @__PURE__ */ o(G, { grow: !1, children: /* @__PURE__ */ o(
1561
+ /* @__PURE__ */ o(J, { grow: !1, children: /* @__PURE__ */ o(
1920
1562
  ne,
1921
1563
  {
1922
- iconType: ct,
1923
- onClick: e.removeSelectedItems,
1924
- disabled: e.isEmpty || e.selectedItems.length === 0,
1564
+ iconType: ut,
1565
+ onClick: t.removeSelectedItems,
1566
+ disabled: t.isEmpty || t.selectedItems.length === 0,
1925
1567
  children: "Remove"
1926
1568
  }
1927
1569
  ) }),
1928
- /* @__PURE__ */ o(G, { grow: !1, children: /* @__PURE__ */ o(
1570
+ /* @__PURE__ */ o(J, { grow: !1, children: /* @__PURE__ */ o(
1929
1571
  ne,
1930
1572
  {
1931
- iconType: vn,
1932
- onClick: e.clear,
1933
- disabled: e.isEmpty,
1573
+ iconType: nn,
1574
+ onClick: t.clear,
1575
+ disabled: t.isEmpty,
1934
1576
  children: "Clear"
1935
1577
  }
1936
1578
  ) }),
1937
- /* @__PURE__ */ o(G, { grow: !0 }),
1938
- /* @__PURE__ */ o(G, { grow: !1, children: /* @__PURE__ */ o(ci, { playQueueStore: e }) })
1579
+ /* @__PURE__ */ o(J, { grow: !0 }),
1580
+ /* @__PURE__ */ F(J, { grow: !1, children: [
1581
+ !1,
1582
+ /* @__PURE__ */ o(Dt, { playQueueStore: t })
1583
+ ] })
1939
1584
  ]
1940
1585
  }
1941
1586
  ),
@@ -1947,22 +1592,22 @@ const Qt = Z(
1947
1592
  position: "sticky",
1948
1593
  top: 88,
1949
1594
  zIndex: 998,
1950
- background: n.colors.backgroundBasePlain
1595
+ background: e.colors.backgroundBasePlain
1951
1596
  }
1952
1597
  }
1953
1598
  ),
1954
- e.isEmpty ? /* @__PURE__ */ o(
1955
- Zr,
1599
+ t.isEmpty ? /* @__PURE__ */ o(
1600
+ Kr,
1956
1601
  {
1957
1602
  title: /* @__PURE__ */ o("h2", { children: "We couldn't find any videos" }),
1958
1603
  body: /* @__PURE__ */ o("p", { children: "Your video library doesn't contain any video content." }),
1959
- actions: /* @__PURE__ */ o(Qt, { playQueueStore: e })
1604
+ actions: /* @__PURE__ */ o(Dt, { playQueueStore: t })
1960
1605
  }
1961
- ) : /* @__PURE__ */ o(li, { playQueueStore: e })
1606
+ ) : /* @__PURE__ */ o(ti, { playQueueStore: t })
1962
1607
  ] });
1963
1608
  }
1964
- ), Oi = Y(
1965
- ({ playerStore: t, playQueueStore: e }) => /* @__PURE__ */ F(Le, { children: [
1609
+ ), Ai = Y(
1610
+ ({ playQueueStore: t }) => /* @__PURE__ */ F(Le, { children: [
1966
1611
  /* @__PURE__ */ o(
1967
1612
  nt.Header,
1968
1613
  {
@@ -1970,87 +1615,72 @@ const Qt = Z(
1970
1615
  rightSideItems: []
1971
1616
  }
1972
1617
  ),
1973
- /* @__PURE__ */ o(nt.Section, { children: /* @__PURE__ */ o(
1974
- ui,
1975
- {
1976
- playerStore: t,
1977
- playQueueStore: e
1978
- }
1979
- ) })
1618
+ /* @__PURE__ */ o(nt.Section, { children: /* @__PURE__ */ o(ri, { playQueueStore: t }) })
1980
1619
  ] })
1981
- ), ot = {
1982
- width: 16 * 25,
1983
- height: 9 * 25
1984
- }, _i = Y(
1985
- ({ playerStore: t, playQueueStore: e }) => {
1986
- const n = ie(), i = $(async () => {
1987
- e.interacted && await n.play();
1988
- }, [e, n]), a = $(async () => {
1989
- switch (e.repeat) {
1990
- case R.One:
1991
- await n.setCurrentTime(0);
1992
- break;
1993
- case R.Off:
1994
- case R.All:
1995
- if (e.isLastItem)
1996
- switch (e.repeat) {
1997
- case R.Off:
1998
- t.onEnded();
1999
- break;
2000
- case R.All:
2001
- e.hasMultipleItems ? await e.goToFirst() : await n.setCurrentTime(0);
2002
- break;
2003
- }
2004
- else
2005
- await e.next();
2006
- break;
2007
- }
2008
- }, [e, t, n]), l = zt(
2009
- () => ({
2010
- onLoaded: i,
2011
- onPlay: t.onPlay,
2012
- onPause: t.onPause,
2013
- onEnded: a,
2014
- onTimeUpdate: t.onTimeUpdate
2015
- }),
2016
- [t, i, a]
2017
- );
2018
- return /* @__PURE__ */ o(
2019
- "div",
2020
- {
2021
- css: {
2022
- position: "fixed",
2023
- right: 0,
2024
- bottom: Zt,
2025
- width: ot.width,
2026
- height: ot.height,
2027
- zIndex: 998,
2028
- backgroundColor: "rgb(39, 39, 39)",
2029
- display: "flex",
2030
- flexDirection: "column"
2031
- },
2032
- children: /* @__PURE__ */ o("div", { css: { flexGrow: 1, backgroundColor: "black" }, children: e.currentItem && /* @__PURE__ */ o(
2033
- kr,
2034
- {
2035
- src: e.currentItem.url,
2036
- options: l
2037
- }
2038
- ) })
2039
- }
1620
+ ), et = new Tn({
1621
+ coerceTypes: !0
1622
+ });
1623
+ function ni(t, e) {
1624
+ let n;
1625
+ if (n = et.getSchema(e), n === void 0 && (et.addSchema(t, e), n = et.getSchema(e)), n === void 0 || n.schema !== t)
1626
+ throw new Error(
1627
+ `Invalid schema. Expected: '${JSON.stringify(
1628
+ t
1629
+ )}', but got '${JSON.stringify(n == null ? void 0 : n.schema)}'.`
2040
1630
  );
2041
- }
2042
- );
2043
- class er {
2044
- makeObservable(e, n) {
2045
- return yn(e, n);
2046
- }
1631
+ return n;
2047
1632
  }
2048
- const Ce = class Ce {
1633
+ const ii = {
1634
+ type: "object",
1635
+ properties: {
1636
+ url: {
1637
+ type: "string"
1638
+ },
1639
+ type: {
1640
+ type: "string"
1641
+ },
1642
+ videoId: {
1643
+ type: "string"
1644
+ },
1645
+ title: {
1646
+ type: "string"
1647
+ }
1648
+ },
1649
+ required: ["url", "type", "videoId", "title"]
1650
+ };
1651
+ var R = /* @__PURE__ */ ((t) => (t.Off = "Off", t.All = "All", t.One = "One", t))(R || {});
1652
+ const oi = {
1653
+ type: "object",
1654
+ properties: {
1655
+ version: {
1656
+ type: "string",
1657
+ nullable: !0
1658
+ },
1659
+ repeat: {
1660
+ type: "string",
1661
+ enum: Object.values(R),
1662
+ nullable: !0
1663
+ },
1664
+ shuffle: {
1665
+ type: "boolean",
1666
+ nullable: !0
1667
+ },
1668
+ items: {
1669
+ type: "array",
1670
+ nullable: !0,
1671
+ items: ii
1672
+ },
1673
+ currentIndex: {
1674
+ type: "integer",
1675
+ nullable: !0
1676
+ }
1677
+ }
1678
+ }, Ce = class Ce {
2049
1679
  constructor(e, n, i) {
2050
1680
  U(this, "id");
2051
1681
  U(this, "isSelected", !1);
2052
1682
  this.observableStateProvider = e, this.playQueueStore = n, this.dto = i, this.id = Ce.nextId++, e.makeObservable(this, {
2053
- isSelected: re,
1683
+ isSelected: te,
2054
1684
  isCurrent: _,
2055
1685
  index: _,
2056
1686
  isFirst: _,
@@ -2156,68 +1786,8 @@ const Ce = class Ce {
2156
1786
  }
2157
1787
  };
2158
1788
  U(Ce, "nextId", 1);
2159
- let at = Ce;
2160
- const et = new bn({
2161
- coerceTypes: !0
2162
- });
2163
- function fi(t, e) {
2164
- let n;
2165
- if (n = et.getSchema(e), n === void 0 && (et.addSchema(t, e), n = et.getSchema(e)), n === void 0 || n.schema !== t)
2166
- throw new Error(
2167
- `Invalid schema. Expected: '${JSON.stringify(
2168
- t
2169
- )}', but got '${JSON.stringify(n == null ? void 0 : n.schema)}'.`
2170
- );
2171
- return n;
2172
- }
2173
- const di = {
2174
- type: "object",
2175
- properties: {
2176
- version: {
2177
- type: "string",
2178
- nullable: !0
2179
- },
2180
- repeat: {
2181
- type: "string",
2182
- enum: Object.values(R),
2183
- nullable: !0
2184
- },
2185
- shuffle: {
2186
- type: "boolean",
2187
- nullable: !0
2188
- },
2189
- items: {
2190
- type: "array",
2191
- nullable: !0,
2192
- items: {
2193
- type: "object",
2194
- properties: {
2195
- url: {
2196
- type: "string"
2197
- },
2198
- type: {
2199
- type: "string"
2200
- },
2201
- videoId: {
2202
- type: "string"
2203
- },
2204
- title: {
2205
- type: "string"
2206
- }
2207
- },
2208
- required: ["url", "type", "videoId", "title"]
2209
- }
2210
- },
2211
- currentIndex: {
2212
- type: "integer",
2213
- nullable: !0
2214
- }
2215
- }
2216
- }, mi = fi(
2217
- di,
2218
- "PlayQueueStore"
2219
- );
2220
- class hi {
1789
+ let ot = Ce;
1790
+ class ai {
2221
1791
  constructor(e) {
2222
1792
  U(this, "interacted", !1);
2223
1793
  U(this, "items", []);
@@ -2225,11 +1795,11 @@ class hi {
2225
1795
  U(this, "repeat", R.Off);
2226
1796
  U(this, "shuffle", !1);
2227
1797
  this.observableStateProvider = e, e.makeObservable(this, {
2228
- interacted: re,
2229
- items: re,
2230
- currentId: re,
2231
- repeat: re,
2232
- shuffle: re,
1798
+ interacted: te,
1799
+ items: te,
1800
+ currentId: te,
1801
+ repeat: te,
1802
+ shuffle: te,
2233
1803
  localStorageState: _.struct,
2234
1804
  isEmpty: _,
2235
1805
  currentItem: _,
@@ -2268,7 +1838,7 @@ class hi {
2268
1838
  });
2269
1839
  }
2270
1840
  createItem(e) {
2271
- return at.fromDto(
1841
+ return ot.fromDto(
2272
1842
  this.observableStateProvider,
2273
1843
  this,
2274
1844
  e
@@ -2288,7 +1858,10 @@ class hi {
2288
1858
  this.repeat = e.repeat ?? R.Off, this.shuffle = e.shuffle ?? !1, this.items = ((n = e.items) == null ? void 0 : n.map((i) => this.createItem(i))) ?? [], this.currentIndex = e.currentIndex;
2289
1859
  }
2290
1860
  validateLocalStorageState(e) {
2291
- return mi(e);
1861
+ return ni(
1862
+ oi,
1863
+ "PlayQueueDto"
1864
+ )(e);
2292
1865
  }
2293
1866
  get isEmpty() {
2294
1867
  return this.items.length === 0;
@@ -2368,119 +1941,583 @@ class hi {
2368
1941
  this.selectedItemsOrAllItems.map((e) => e.clone())
2369
1942
  ), this.unselectAll();
2370
1943
  }
2371
- async addItems(e) {
2372
- if (this.isEmpty) {
2373
- this.clearAndSetItems(e);
2374
- return;
1944
+ async addItems(e) {
1945
+ if (this.isEmpty) {
1946
+ this.clearAndSetItems(e);
1947
+ return;
1948
+ }
1949
+ this.items.push(...e);
1950
+ }
1951
+ async addSelectedItems() {
1952
+ await this.addItems(
1953
+ this.selectedItemsOrAllItems.map((e) => e.clone())
1954
+ ), this.unselectAll();
1955
+ }
1956
+ async playFirst(e) {
1957
+ if (this.isEmpty) {
1958
+ this.clearAndSetItems(e);
1959
+ return;
1960
+ }
1961
+ const { currentIndex: n } = this;
1962
+ n !== void 0 && (this.interact(), this.items.splice(n, 0, ...e), this.currentIndex = n);
1963
+ }
1964
+ moveItem(e, n) {
1965
+ const i = this.items.splice(this.items.indexOf(e), 1)[0];
1966
+ this.items.splice(n, 0, i);
1967
+ }
1968
+ async removeItems(e) {
1969
+ const { currentItem: n } = this;
1970
+ Rt(this.items, ...e.filter((l) => l !== n));
1971
+ const { currentIndex: i, isLastItem: a } = this;
1972
+ Rt(
1973
+ this.items,
1974
+ e.find((l) => l === n)
1975
+ ), this.currentItem !== n && (this.interact(), a ? await this.goToFirst() : this.currentIndex = i);
1976
+ }
1977
+ async removeSelectedItems() {
1978
+ await this.removeItems(this.selectedItemsOrAllItems), this.unselectAll();
1979
+ }
1980
+ async removeOtherItems(e) {
1981
+ const n = e.id;
1982
+ return this.removeItems(
1983
+ this.items.filter((i) => i.id !== n)
1984
+ );
1985
+ }
1986
+ async removeItemsAbove(e) {
1987
+ const n = this.items.indexOf(e);
1988
+ return this.removeItems(
1989
+ this.items.filter((i, a) => a < n)
1990
+ );
1991
+ }
1992
+ toggleRepeat() {
1993
+ switch (this.repeat) {
1994
+ case R.Off:
1995
+ this.repeat = R.All;
1996
+ break;
1997
+ case R.All:
1998
+ this.repeat = R.One;
1999
+ break;
2000
+ case R.One:
2001
+ this.repeat = R.Off;
2002
+ break;
2003
+ }
2004
+ }
2005
+ toggleShuffle() {
2006
+ this.shuffle = !this.shuffle;
2007
+ }
2008
+ async previous() {
2009
+ this.currentIndex !== void 0 && this.hasPreviousItem && (this.interact(), this.currentIndex--);
2010
+ }
2011
+ async next() {
2012
+ this.currentIndex !== void 0 && this.hasNextItem && (this.interact(), this.currentIndex++);
2013
+ }
2014
+ async goToFirst() {
2015
+ this.currentIndex !== void 0 && (this.currentIndex = 0);
2016
+ }
2017
+ }
2018
+ const er = Lt(void 0), ki = ({
2019
+ children: t
2020
+ }) => {
2021
+ const [e] = q(
2022
+ () => new ai(new Gt())
2023
+ ), n = ie();
2024
+ return _r(() => wr(
2025
+ () => e.currentItem,
2026
+ async (i, a) => {
2027
+ i === void 0 || a === void 0 || i.type === a.type && i.videoId === a.videoId && await n.setCurrentTime(0);
2028
+ }
2029
+ ), [e, n]), /* @__PURE__ */ o(er.Provider, { value: e, children: t });
2030
+ }, si = () => st(er), tr = 81, li = Y(
2031
+ ({ playerStore: t, playQueueStore: e }) => {
2032
+ const n = ie(), i = $(
2033
+ (f) => {
2034
+ const h = Number(f.currentTarget.value) / 100;
2035
+ t.setPercent(h);
2036
+ },
2037
+ [t]
2038
+ ), a = $(
2039
+ (f) => {
2040
+ f.button === 0 && t.setSeeking(!0);
2041
+ },
2042
+ [t]
2043
+ ), l = $(
2044
+ async (f) => {
2045
+ if (f.button === 0) {
2046
+ const h = Number(f.currentTarget.value) / 100;
2047
+ t.setSeeking(!1);
2048
+ const m = await n.getDuration();
2049
+ m !== void 0 && await n.setCurrentTime(m * h);
2050
+ }
2051
+ },
2052
+ [t, n]
2053
+ );
2054
+ return /* @__PURE__ */ o(
2055
+ Ut,
2056
+ {
2057
+ min: 0,
2058
+ max: 100,
2059
+ step: 1e-7,
2060
+ value: t.percent * 100,
2061
+ onChange: i,
2062
+ onMouseDown: a,
2063
+ onMouseUp: l,
2064
+ fullWidth: !0,
2065
+ showRange: !0,
2066
+ css: { blockSize: 32 },
2067
+ disabled: e.isEmpty
2068
+ }
2069
+ );
2070
+ }
2071
+ ), ci = Z(
2072
+ ({ button: t, isOpen: e, closePopover: n }) => {
2073
+ const [i, a] = q("0"), l = ie();
2074
+ Ar(() => {
2075
+ e && l.getVolume().then((h) => {
2076
+ h !== void 0 && a(Math.floor(h * 100).toString());
2077
+ });
2078
+ }, [e, l]);
2079
+ const f = $(
2080
+ async (h) => {
2081
+ a(h.currentTarget.value), await l.setVolume(Number(h.currentTarget.value) / 100);
2082
+ },
2083
+ [l]
2084
+ );
2085
+ return /* @__PURE__ */ o(
2086
+ lt,
2087
+ {
2088
+ button: t,
2089
+ isOpen: e,
2090
+ closePopover: n,
2091
+ anchorPosition: "upRight",
2092
+ children: /* @__PURE__ */ o(tt, { children: /* @__PURE__ */ F(
2093
+ me,
2094
+ {
2095
+ responsive: !1,
2096
+ gutterSize: "s",
2097
+ justifyContent: "center",
2098
+ alignItems: "center",
2099
+ children: [
2100
+ /* @__PURE__ */ o(
2101
+ G,
2102
+ {
2103
+ title: "Mute",
2104
+ "aria-label": "Mute",
2105
+ iconType: Ht,
2106
+ size: "s",
2107
+ iconSize: "l"
2108
+ }
2109
+ ),
2110
+ /* @__PURE__ */ o(
2111
+ Ut,
2112
+ {
2113
+ min: 0,
2114
+ max: 100,
2115
+ step: 1,
2116
+ value: i,
2117
+ onChange: f,
2118
+ css: { blockSize: 32 }
2119
+ }
2120
+ )
2121
+ ]
2122
+ }
2123
+ ) })
2124
+ }
2125
+ );
2126
+ }
2127
+ ), ui = Z(
2128
+ ({
2129
+ playQueueStore: t,
2130
+ closePopover: e
2131
+ }) => {
2132
+ const n = ie(), i = $(async () => {
2133
+ const p = await n.getCurrentTime();
2134
+ p !== void 0 && await n.setCurrentTime(p - 10), e();
2135
+ }, [n, e]), a = $(async () => {
2136
+ const p = await n.getCurrentTime();
2137
+ p !== void 0 && await n.setCurrentTime(p + 30), e();
2138
+ }, [n, e]), l = $(
2139
+ async (p) => {
2140
+ await n.setPlaybackRate(p), e();
2141
+ },
2142
+ [n, e]
2143
+ ), f = $(async () => {
2144
+ t.currentItem !== void 0 && await t.removeItems([
2145
+ t.currentItem
2146
+ ]), e();
2147
+ }, [t, e]), [h] = q(), m = Vt(
2148
+ () => [
2149
+ {
2150
+ id: 0,
2151
+ items: [
2152
+ {
2153
+ name: "Speed",
2154
+ icon: /* @__PURE__ */ o(H, { type: on, size: "m" }),
2155
+ panel: 1
2156
+ },
2157
+ {
2158
+ name: "Skip back 10 seconds",
2159
+ icon: /* @__PURE__ */ o(H, { type: an, size: "m" }),
2160
+ onClick: i,
2161
+ disabled: t.isEmpty
2162
+ },
2163
+ {
2164
+ name: "Skip forward 30 seconds",
2165
+ icon: /* @__PURE__ */ o(H, { type: sn, size: "m" }),
2166
+ onClick: a,
2167
+ disabled: t.isEmpty
2168
+ },
2169
+ {
2170
+ isSeparator: !0
2171
+ },
2172
+ {
2173
+ name: "Remove from play queue",
2174
+ icon: /* @__PURE__ */ o(H, { type: ut, size: "m" }),
2175
+ onClick: f,
2176
+ disabled: t.isEmpty
2177
+ }
2178
+ ]
2179
+ },
2180
+ {
2181
+ id: 1,
2182
+ title: "Speed",
2183
+ items: [0.25, 0.5, 0.75, 1, 1.25, 1.5, 1.75, 2].map(
2184
+ (p) => ({
2185
+ name: p.toString(),
2186
+ onClick: () => l(p),
2187
+ icon: p === h ? "check" : "empty"
2188
+ })
2189
+ )
2190
+ }
2191
+ ],
2192
+ [
2193
+ t,
2194
+ i,
2195
+ a,
2196
+ f,
2197
+ l,
2198
+ h
2199
+ ]
2200
+ );
2201
+ return /* @__PURE__ */ o(Xr, { initialPanelId: 0, panels: m });
2202
+ }
2203
+ ), fi = Z(
2204
+ ({
2205
+ playQueueStore: t,
2206
+ button: e,
2207
+ isOpen: n,
2208
+ closePopover: i
2209
+ }) => /* @__PURE__ */ o(
2210
+ lt,
2211
+ {
2212
+ button: e,
2213
+ isOpen: n,
2214
+ closePopover: i,
2215
+ panelPaddingSize: "none",
2216
+ anchorPosition: "upRight",
2217
+ children: /* @__PURE__ */ o(
2218
+ ui,
2219
+ {
2220
+ playQueueStore: t,
2221
+ closePopover: i
2222
+ }
2223
+ )
2224
+ }
2225
+ )
2226
+ ), di = {
2227
+ [R.Off]: un,
2228
+ [R.All]: cn,
2229
+ [R.One]: ln
2230
+ }, mi = Y(
2231
+ ({
2232
+ playerStore: t,
2233
+ playQueueStore: e
2234
+ }) => {
2235
+ const n = ie(), i = $(async () => {
2236
+ if (e.hasPreviousItem) {
2237
+ const a = await n.getCurrentTime();
2238
+ a === void 0 || a < 5 ? await e.previous() : await n.setCurrentTime(0);
2239
+ } else
2240
+ await n.setCurrentTime(0);
2241
+ }, [e, n]);
2242
+ return /* @__PURE__ */ F(
2243
+ me,
2244
+ {
2245
+ responsive: !1,
2246
+ gutterSize: "s",
2247
+ justifyContent: "center",
2248
+ alignItems: "center",
2249
+ children: [
2250
+ /* @__PURE__ */ o(
2251
+ G,
2252
+ {
2253
+ title: `Shuffle: ${e.shuffle ? "On" : "Off"}`,
2254
+ "aria-label": `Shuffle: ${e.shuffle ? "On" : "Off"}`,
2255
+ iconType: e.shuffle ? fn : dn,
2256
+ size: "s",
2257
+ iconSize: "l",
2258
+ onClick: e.toggleShuffle,
2259
+ disabled: !0
2260
+ }
2261
+ ),
2262
+ /* @__PURE__ */ o(
2263
+ G,
2264
+ {
2265
+ title: "Previous",
2266
+ "aria-label": "Previous",
2267
+ iconType: mn,
2268
+ size: "s",
2269
+ iconSize: "l",
2270
+ onClick: i,
2271
+ disabled: e.isEmpty
2272
+ }
2273
+ ),
2274
+ t.playing ? /* @__PURE__ */ o(
2275
+ G,
2276
+ {
2277
+ title: "Pause",
2278
+ "aria-label": "Pause",
2279
+ iconType: hn,
2280
+ size: "s",
2281
+ iconSize: "l",
2282
+ onClick: () => n.pause(),
2283
+ disabled: !e.canPlay
2284
+ }
2285
+ ) : /* @__PURE__ */ o(
2286
+ G,
2287
+ {
2288
+ title: "Play",
2289
+ "aria-label": "Play",
2290
+ iconType: vn,
2291
+ size: "s",
2292
+ iconSize: "l",
2293
+ onClick: () => n.play(),
2294
+ disabled: !e.canPlay
2295
+ }
2296
+ ),
2297
+ /* @__PURE__ */ o(
2298
+ G,
2299
+ {
2300
+ title: "Next",
2301
+ "aria-label": "Next",
2302
+ iconType: pn,
2303
+ size: "s",
2304
+ iconSize: "l",
2305
+ onClick: e.next,
2306
+ disabled: !e.hasNextItem
2307
+ }
2308
+ ),
2309
+ /* @__PURE__ */ o(
2310
+ G,
2311
+ {
2312
+ title: `Repeat: ${e.repeat === R.All ? "All" : e.repeat === R.One ? "One" : "Off"}`,
2313
+ "aria-label": `Repeat: ${e.repeat === R.All ? "All" : e.repeat === R.One ? "One" : "Off"}`,
2314
+ iconType: di[e.repeat],
2315
+ size: "s",
2316
+ iconSize: "l",
2317
+ onClick: e.toggleRepeat
2318
+ }
2319
+ )
2320
+ ]
2321
+ }
2322
+ );
2323
+ }
2324
+ ), hi = Z(() => {
2325
+ const [t, e] = q(!1);
2326
+ return /* @__PURE__ */ o(
2327
+ ci,
2328
+ {
2329
+ button: /* @__PURE__ */ o(
2330
+ G,
2331
+ {
2332
+ title: "Volume",
2333
+ "aria-label": "Volume",
2334
+ iconType: Ht,
2335
+ size: "s",
2336
+ iconSize: "l",
2337
+ onClick: () => e(!t)
2338
+ }
2339
+ ),
2340
+ isOpen: t,
2341
+ closePopover: () => e(!1)
2375
2342
  }
2376
- this.items.push(...e);
2377
- }
2378
- async addSelectedItems() {
2379
- await this.addItems(
2380
- this.selectedItemsOrAllItems.map((e) => e.clone())
2381
- ), this.unselectAll();
2343
+ );
2344
+ }), vi = ({
2345
+ onClickPlayQueueButton: t
2346
+ }) => /* @__PURE__ */ o(
2347
+ G,
2348
+ {
2349
+ title: "Play queue",
2350
+ "aria-label": "Play queue",
2351
+ iconType: yn,
2352
+ size: "s",
2353
+ iconSize: "l",
2354
+ onClick: t
2355
+ }
2356
+ ), pi = Z(
2357
+ ({ playQueueStore: t }) => {
2358
+ const [e, n] = q(!1);
2359
+ return /* @__PURE__ */ o(
2360
+ fi,
2361
+ {
2362
+ playQueueStore: t,
2363
+ button: /* @__PURE__ */ o(
2364
+ G,
2365
+ {
2366
+ title: "More options",
2367
+ "aria-label": "More options",
2368
+ iconType: qt,
2369
+ size: "s",
2370
+ iconSize: "l",
2371
+ onClick: () => n(!e)
2372
+ }
2373
+ ),
2374
+ isOpen: e,
2375
+ closePopover: () => n(!1)
2376
+ }
2377
+ );
2382
2378
  }
2383
- async playFirst(e) {
2384
- if (this.isEmpty) {
2385
- this.clearAndSetItems(e);
2386
- return;
2379
+ ), yi = Z(
2380
+ ({
2381
+ playQueueStore: t,
2382
+ onClickPlayQueueButton: e
2383
+ }) => /* @__PURE__ */ F(
2384
+ me,
2385
+ {
2386
+ responsive: !1,
2387
+ gutterSize: "s",
2388
+ justifyContent: "flexEnd",
2389
+ alignItems: "center",
2390
+ children: [
2391
+ /* @__PURE__ */ o(hi, {}),
2392
+ e && /* @__PURE__ */ o(
2393
+ vi,
2394
+ {
2395
+ onClickPlayQueueButton: e
2396
+ }
2397
+ ),
2398
+ /* @__PURE__ */ o(pi, { playQueueStore: t })
2399
+ ]
2387
2400
  }
2388
- const { currentIndex: n } = this;
2389
- n !== void 0 && (this.interact(), this.items.splice(n, 0, ...e), this.currentIndex = n);
2390
- }
2391
- moveItem(e, n) {
2392
- const i = this.items.splice(this.items.indexOf(e), 1)[0];
2393
- this.items.splice(n, 0, i);
2394
- }
2395
- async removeItems(e) {
2396
- const { currentItem: n } = this;
2397
- Rt(this.items, ...e.filter((l) => l !== n));
2398
- const { currentIndex: i, isLastItem: a } = this;
2399
- Rt(
2400
- this.items,
2401
- e.find((l) => l === n)
2402
- ), this.currentItem !== n && (this.interact(), a ? await this.goToFirst() : this.currentIndex = i);
2403
- }
2404
- async removeSelectedItems() {
2405
- await this.removeItems(this.selectedItemsOrAllItems), this.unselectAll();
2406
- }
2407
- async removeOtherItems(e) {
2408
- const n = e.id;
2409
- return this.removeItems(
2410
- this.items.filter((i) => i.id !== n)
2401
+ )
2402
+ ), Mi = Y(
2403
+ ({
2404
+ playerStore: t,
2405
+ playQueueStore: e,
2406
+ onClickPlayQueueButton: n
2407
+ }) => /* @__PURE__ */ o(Zr, { paddingSize: "s", children: /* @__PURE__ */ F(me, { direction: "column", gutterSize: "none", children: [
2408
+ /* @__PURE__ */ o(J, { children: /* @__PURE__ */ o(
2409
+ li,
2410
+ {
2411
+ playerStore: t,
2412
+ playQueueStore: e
2413
+ }
2414
+ ) }),
2415
+ /* @__PURE__ */ o(J, { children: /* @__PURE__ */ F(me, { responsive: !1, children: [
2416
+ /* @__PURE__ */ o(J, { css: { width: "calc(100% / 3)" } }),
2417
+ /* @__PURE__ */ o(J, { css: { width: "calc(100% / 3)" }, children: /* @__PURE__ */ o(
2418
+ mi,
2419
+ {
2420
+ playerStore: t,
2421
+ playQueueStore: e
2422
+ }
2423
+ ) }),
2424
+ /* @__PURE__ */ o(J, { css: { width: "calc(100% / 3)" }, children: /* @__PURE__ */ o(
2425
+ yi,
2426
+ {
2427
+ playQueueStore: e,
2428
+ onClickPlayQueueButton: n
2429
+ }
2430
+ ) })
2431
+ ] }) })
2432
+ ] }) })
2433
+ ), at = {
2434
+ width: 16 * 25,
2435
+ height: 9 * 25
2436
+ }, Fi = Y(
2437
+ ({ playerStore: t, playQueueStore: e }) => {
2438
+ const n = ie(), i = $(async () => {
2439
+ e.interacted && await n.play();
2440
+ }, [e, n]), a = $(async () => {
2441
+ switch (e.repeat) {
2442
+ case R.One:
2443
+ await n.setCurrentTime(0);
2444
+ break;
2445
+ case R.Off:
2446
+ case R.All:
2447
+ if (e.isLastItem)
2448
+ switch (e.repeat) {
2449
+ case R.Off:
2450
+ t.onEnded();
2451
+ break;
2452
+ case R.All:
2453
+ e.hasMultipleItems ? await e.goToFirst() : await n.setCurrentTime(0);
2454
+ break;
2455
+ }
2456
+ else
2457
+ await e.next();
2458
+ break;
2459
+ }
2460
+ }, [e, t, n]), l = Vt(
2461
+ () => ({
2462
+ onLoaded: i,
2463
+ onPlay: t.onPlay,
2464
+ onPause: t.onPause,
2465
+ onEnded: a,
2466
+ onTimeUpdate: t.onTimeUpdate
2467
+ }),
2468
+ [t, i, a]
2411
2469
  );
2412
- }
2413
- async removeItemsAbove(e) {
2414
- const n = this.items.indexOf(e);
2415
- return this.removeItems(
2416
- this.items.filter((i, a) => a < n)
2470
+ return /* @__PURE__ */ o(
2471
+ "div",
2472
+ {
2473
+ css: {
2474
+ position: "fixed",
2475
+ right: 0,
2476
+ bottom: tr,
2477
+ width: at.width,
2478
+ height: at.height,
2479
+ zIndex: 998,
2480
+ backgroundColor: "rgb(39, 39, 39)",
2481
+ display: "flex",
2482
+ flexDirection: "column"
2483
+ },
2484
+ children: /* @__PURE__ */ o("div", { css: { flexGrow: 1, backgroundColor: "black" }, children: e.currentItem && /* @__PURE__ */ o(
2485
+ bn,
2486
+ {
2487
+ src: e.currentItem.url,
2488
+ options: l
2489
+ }
2490
+ ) })
2491
+ }
2417
2492
  );
2418
2493
  }
2419
- toggleRepeat() {
2420
- switch (this.repeat) {
2421
- case R.Off:
2422
- this.repeat = R.All;
2423
- break;
2424
- case R.All:
2425
- this.repeat = R.One;
2426
- break;
2427
- case R.One:
2428
- this.repeat = R.Off;
2429
- break;
2430
- }
2431
- }
2432
- toggleShuffle() {
2433
- this.shuffle = !this.shuffle;
2434
- }
2435
- async previous() {
2436
- this.currentIndex !== void 0 && this.hasPreviousItem && (this.interact(), this.currentIndex--);
2437
- }
2438
- async next() {
2439
- this.currentIndex !== void 0 && this.hasNextItem && (this.interact(), this.currentIndex++);
2440
- }
2441
- async goToFirst() {
2442
- this.currentIndex !== void 0 && (this.currentIndex = 0);
2443
- }
2444
- }
2445
- const tr = Lt(void 0), Ai = ({
2446
- children: t
2447
- }) => {
2448
- const [e] = q(
2449
- () => new hi(new er())
2450
- ), n = ie();
2451
- return Or(() => gn(
2452
- () => e.currentItem,
2453
- async (i, a) => {
2454
- i === void 0 || a === void 0 || i.type === a.type && i.videoId === a.videoId && await n.setCurrentTime(0);
2455
- }
2456
- ), [e, n]), /* @__PURE__ */ o(tr.Provider, { value: e, children: t });
2457
- }, vi = () => st(tr), ki = Y(
2494
+ ), ji = Y(
2458
2495
  ({ children: t }) => {
2459
- const e = vi();
2496
+ const e = si();
2460
2497
  return /* @__PURE__ */ F(
2461
2498
  nt,
2462
2499
  {
2463
2500
  panelled: !0,
2464
2501
  style: {
2465
- minBlockSize: `max(460px, 100vh - ${Zt}px)`
2502
+ minBlockSize: `max(460px, 100vh - ${tr}px)`
2466
2503
  },
2467
2504
  children: [
2468
2505
  t,
2469
- !e.isEmpty && /* @__PURE__ */ o(Wt, { style: { blockSize: ot.height } })
2506
+ !e.isEmpty && /* @__PURE__ */ o(Wt, { style: { blockSize: at.height } })
2470
2507
  ]
2471
2508
  }
2472
2509
  );
2473
2510
  }
2474
2511
  );
2475
- class pi {
2512
+ class gi {
2476
2513
  constructor(e) {
2477
2514
  U(this, "playing", !1);
2478
2515
  U(this, "percent", 0);
2479
2516
  U(this, "seeking", !1);
2480
2517
  e.makeObservable(this, {
2481
- playing: re,
2482
- percent: re,
2483
- seeking: re,
2518
+ playing: te,
2519
+ percent: te,
2520
+ seeking: te,
2484
2521
  setPlaying: y,
2485
2522
  setPercent: y,
2486
2523
  setSeeking: y,
@@ -2512,32 +2549,27 @@ class pi {
2512
2549
  e !== void 0 && (this.seeking || (this.percent = e));
2513
2550
  }
2514
2551
  }
2515
- const rr = Lt(void 0), Mi = ({
2552
+ const rr = Lt(void 0), Ni = ({
2516
2553
  children: t
2517
2554
  }) => {
2518
2555
  const [e] = q(
2519
- () => new pi(new er())
2556
+ () => new gi(new Gt())
2520
2557
  );
2521
2558
  return /* @__PURE__ */ o(rr.Provider, { value: e, children: t });
2522
- }, Fi = () => st(rr);
2523
- class ji {
2524
- makeObservable(e, n) {
2525
- return e;
2526
- }
2527
- }
2559
+ }, $i = () => st(rr);
2528
2560
  export {
2529
- wi as BottomBar,
2530
- Oi as HydrangeanDiva,
2531
- ki as MediaPlayerLayout,
2532
- _i as MiniPlayer,
2533
- er as MobXObservableStateProvider,
2534
- ji as ObservableStateProvider,
2535
- Ai as PlayQueueStoreProvider,
2536
- Mi as PlayerStoreProvider,
2561
+ Mi as BottomBar,
2562
+ Ai as HydrangeanDiva,
2563
+ ji as MediaPlayerLayout,
2564
+ Fi as MiniPlayer,
2565
+ Gt as MobXObservableStateProvider,
2566
+ _i as ObservableStateProvider,
2567
+ ki as PlayQueueStoreProvider,
2568
+ Ni as PlayerStoreProvider,
2537
2569
  R as RepeatMode,
2538
- Zt as bottomBarHeight,
2539
- ot as miniPlayerSize,
2540
- vi as usePlayQueueStore,
2541
- Fi as usePlayerStore
2570
+ tr as bottomBarHeight,
2571
+ at as miniPlayerSize,
2572
+ si as usePlayQueueStore,
2573
+ $i as usePlayerStore
2542
2574
  };
2543
2575
  //# sourceMappingURL=index.es.js.map