@aigamo/hydrangean-diva 0.0.1-alpha.7 → 0.0.1-alpha.70
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs.js +2 -45
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.es.js +2263 -2462
- package/dist/index.es.js.map +1 -1
- package/dist/src/App.d.ts +9 -0
- package/dist/src/common/components/AppLink.d.ts +6 -0
- package/dist/src/common/components/AppPageTemplateHeader.d.ts +18 -0
- package/dist/src/features/common/helpers/bottomBarHeight.d.ts +1 -0
- package/dist/src/features/common/helpers/commandBarHeight.d.ts +1 -0
- package/dist/src/features/common/helpers/commandBarSpacerHeight.d.ts +1 -0
- package/dist/src/features/common/helpers/featureFlags.d.ts +5 -0
- package/dist/src/features/common/helpers/headerHeight.d.ts +1 -0
- package/dist/src/features/common/helpers/index.d.ts +2 -0
- package/dist/src/features/common/helpers/miniPlayerSize.d.ts +4 -0
- package/dist/src/features/common/helpers/videoServiceIcons.d.ts +2 -0
- package/dist/src/features/common/index.d.ts +1 -0
- package/dist/src/features/common/stores/localStorageStateKeys.d.ts +6 -0
- package/dist/src/features/index.d.ts +11 -0
- package/dist/src/features/media-player/components/HydrangeanDivaProvider.d.ts +7 -0
- package/dist/src/features/media-player/components/index.d.ts +2 -0
- package/dist/src/features/media-player/index.d.ts +1 -0
- package/dist/src/features/media-player.bottom-bar/components/BottomBar.d.ts +8 -0
- package/dist/src/features/media-player.bottom-bar/components/BottomBarCenterControls.d.ts +7 -0
- package/dist/src/features/media-player.bottom-bar/components/BottomBarLeftControls.d.ts +4 -0
- package/dist/src/features/media-player.bottom-bar/components/BottomBarProvider.d.ts +6 -0
- package/dist/src/features/media-player.bottom-bar/components/BottomBarRightControls.d.ts +6 -0
- package/dist/{AppRoutes.d.ts → src/features/media-player.bottom-bar/components/SeekBar.d.ts} +1 -1
- package/dist/src/features/media-player.bottom-bar/components/index.d.ts +1 -0
- package/dist/{features/media-player → src/features/media-player.bottom-bar}/index.d.ts +0 -1
- package/dist/src/features/media-player.bottom-bar/stores/BottomBarStore.d.ts +54 -0
- package/dist/src/features/media-player.bottom-bar.abstractions/contexts/BottomBarContext.d.ts +3 -0
- package/dist/src/features/media-player.bottom-bar.abstractions/index.d.ts +1 -0
- package/dist/src/features/media-player.bottom-bar.abstractions/interfaces/IBottomBarStore.d.ts +32 -0
- package/dist/src/features/media-player.bottom-bar.abstractions/interfaces/index.d.ts +1 -0
- package/dist/src/features/media-player.mini-player/components/CookieConsentPanel.d.ts +8 -0
- package/dist/src/features/media-player.mini-player/components/MiniPlayer.d.ts +4 -0
- package/dist/src/features/media-player.mini-player/components/MiniPlayerProvider.d.ts +6 -0
- package/dist/src/features/media-player.mini-player/components/index.d.ts +1 -0
- package/dist/src/features/media-player.mini-player/index.d.ts +1 -0
- package/dist/src/features/media-player.mini-player/stores/MiniPlayerStore.d.ts +21 -0
- package/dist/src/features/media-player.mini-player.abstractions/contexts/MiniPlayerContext.d.ts +3 -0
- package/dist/src/features/media-player.mini-player.abstractions/index.d.ts +1 -0
- package/dist/src/features/media-player.mini-player.abstractions/interfaces/IMiniPlayerStore.d.ts +12 -0
- package/dist/src/features/media-player.mini-player.abstractions/interfaces/index.d.ts +1 -0
- package/dist/src/features/media-player.play-queue/components/AddVideoButton.d.ts +7 -0
- package/dist/src/features/media-player.play-queue/components/AddVideoModal.d.ts +5 -0
- package/dist/src/features/media-player.play-queue/components/DeveloperToolsButton.d.ts +9 -0
- package/dist/src/features/media-player.play-queue/components/PlayQueueCommandBar.d.ts +9 -0
- package/dist/src/features/media-player.play-queue/components/PlayQueueProvider.d.ts +6 -0
- package/dist/src/features/media-player.play-queue/components/PlayQueueSection.d.ts +9 -0
- package/dist/src/features/media-player.play-queue/components/PlayQueueTable.d.ts +9 -0
- package/dist/src/features/media-player.play-queue/components/index.d.ts +1 -0
- package/dist/src/features/media-player.play-queue/helpers/isNoembedResult.d.ts +5 -0
- package/dist/src/features/media-player.play-queue/index.d.ts +2 -0
- package/dist/src/features/media-player.play-queue/pages/index.d.ts +1 -0
- package/dist/{features/media-player → src/features/media-player.play-queue}/stores/PlayQueueItemStore.d.ts +8 -9
- package/dist/{features/media-player → src/features/media-player.play-queue}/stores/PlayQueueStore.d.ts +25 -19
- package/dist/src/features/media-player.play-queue.abstractions/contexts/PlayQueueContext.d.ts +3 -0
- package/dist/src/features/media-player.play-queue.abstractions/contexts/index.d.ts +1 -0
- package/dist/src/features/media-player.play-queue.abstractions/index.d.ts +2 -0
- package/dist/{features/media-player/stores → src/features/media-player.play-queue.abstractions/interfaces}/IPlayQueueItemStore.d.ts +4 -8
- package/dist/src/features/media-player.play-queue.abstractions/interfaces/IPlayQueueStore.d.ts +46 -0
- package/dist/src/features/media-player.play-queue.abstractions/interfaces/PlayQueueDto.d.ts +11 -0
- package/dist/src/features/media-player.play-queue.abstractions/interfaces/PlayQueueItemDto.d.ts +9 -0
- package/dist/src/features/media-player.play-queue.abstractions/interfaces/index.d.ts +3 -0
- package/dist/src/features/media-player.player/components/PlayerProvider.d.ts +6 -0
- package/dist/src/features/media-player.player/stores/PlayerStore.d.ts +17 -0
- package/dist/src/features/media-player.player.abstractions/contexts/PlayerContext.d.ts +3 -0
- package/dist/src/features/media-player.player.abstractions/index.d.ts +1 -0
- package/dist/src/features/media-player.player.abstractions/interfaces/IPlayerStore.d.ts +13 -0
- package/dist/src/features/media-player.player.abstractions/interfaces/index.d.ts +1 -0
- package/dist/src/features/media-player.playlists/components/CreatePlaylistButton.d.ts +7 -0
- package/dist/src/features/media-player.playlists/components/CreatePlaylistModal.d.ts +4 -0
- package/dist/src/features/media-player.playlists/components/DeletePlaylistConfirmModal.d.ts +7 -0
- package/dist/src/features/media-player.playlists/components/PlaylistCommandBar.d.ts +9 -0
- package/dist/src/features/media-player.playlists/components/PlaylistListProvider.d.ts +6 -0
- package/dist/src/features/media-player.playlists/components/PlaylistListTable.d.ts +9 -0
- package/dist/src/features/media-player.playlists/components/PlaylistSection.d.ts +9 -0
- package/dist/src/features/media-player.playlists/components/PlaylistTable.d.ts +9 -0
- package/dist/src/features/media-player.playlists/components/RenamePlaylistModal.d.ts +7 -0
- package/dist/src/features/media-player.playlists/index.d.ts +1 -0
- package/dist/src/features/media-player.playlists/pages/PlaylistDetailsPage.d.ts +9 -0
- package/dist/src/features/media-player.playlists/pages/PlaylistListPage.d.ts +2 -0
- package/dist/src/features/media-player.playlists/pages/index.d.ts +2 -0
- package/dist/src/features/media-player.playlists/stores/PlaylistItemStore.d.ts +39 -0
- package/dist/src/features/media-player.playlists/stores/PlaylistListItemStore.d.ts +10 -0
- package/dist/src/features/media-player.playlists/stores/PlaylistListStore.d.ts +26 -0
- package/dist/src/features/media-player.playlists/stores/PlaylistStore.d.ts +46 -0
- package/dist/src/features/media-player.playlists.abstractions/contexts/PlaylistListContext.d.ts +3 -0
- package/dist/src/features/media-player.playlists.abstractions/contexts/index.d.ts +1 -0
- package/dist/src/features/media-player.playlists.abstractions/index.d.ts +1 -0
- package/dist/src/features/media-player.playlists.abstractions/interfaces/IPlaylistItemStore.d.ts +28 -0
- package/dist/src/features/media-player.playlists.abstractions/interfaces/IPlaylistListItemStore.d.ts +6 -0
- package/dist/src/features/media-player.playlists.abstractions/interfaces/IPlaylistListStore.d.ts +8 -0
- package/dist/src/features/media-player.playlists.abstractions/interfaces/IPlaylistStore.d.ts +26 -0
- package/dist/src/index.d.ts +1 -0
- package/dist/src/routeTree.gen.d.ts +91 -0
- package/dist/src/routes/__root.d.ts +1 -0
- package/dist/src/routes/_authenticated/index.d.ts +1 -0
- package/dist/src/routes/_authenticated/play-queue.d.ts +1 -0
- package/dist/src/routes/_authenticated/playlists/$playlistId.index.d.ts +1 -0
- package/dist/src/routes/_authenticated/playlists/index.d.ts +1 -0
- package/dist/src/routes/_authenticated.d.ts +1 -0
- package/dist/test/features/media-player/stores/PlayQueueStore.test.d.ts +1 -0
- package/dist/test/features/media-player/stores/PlayerStore.test.d.ts +1 -0
- package/package.json +59 -47
- package/dist/App.d.ts +0 -3
- package/dist/features/media-player/components/AddVideoButton.d.ts +0 -7
- package/dist/features/media-player/components/BottomBar.d.ts +0 -12
- package/dist/features/media-player/components/HydrangeanDiva.d.ts +0 -11
- package/dist/features/media-player/components/MiniPlayer.d.ts +0 -15
- package/dist/features/media-player/components/PlayQueueStoreContext.d.ts +0 -8
- package/dist/features/media-player/components/PlayQueueTable.d.ts +0 -9
- package/dist/features/media-player/components/PlayerStoreContext.d.ts +0 -8
- package/dist/features/media-player/components/index.d.ts +0 -6
- package/dist/features/media-player/stores/IObservableStateProvider.d.ts +0 -4
- package/dist/features/media-player/stores/IPlayQueueStore.d.ts +0 -15
- package/dist/features/media-player/stores/MobXObservableStateProvider.d.ts +0 -5
- package/dist/features/media-player/stores/ObservableStateProvider.d.ts +0 -5
- package/dist/features/media-player/stores/PlayQueueLocalStorageState.d.ts +0 -10
- package/dist/features/media-player/stores/PlayerStore.d.ts +0 -15
- package/dist/features/media-player/stores/index.d.ts +0 -6
- /package/dist/{common → src/features/common}/components/Compose.d.ts +0 -0
- /package/dist/{features/media-player → src/features/common}/stores/getOrAddSchema.d.ts +0 -0
- /package/dist/{features → src/features}/media-player/components/MediaPlayerLayout.d.ts +0 -0
- /package/dist/{features/media-player → src/features/media-player.header}/components/Header.d.ts +0 -0
- /package/dist/{features/media-player → src/features/media-player.play-queue}/pages/PlayQueuePage.d.ts +0 -0
- /package/dist/{features/media-player/stores → src/features/media-player.play-queue.abstractions/interfaces}/RepeatMode.d.ts +0 -0
- /package/dist/{main.d.ts → src/main.d.ts} +0 -0
- /package/dist/{sw.d.ts → src/sw.d.ts} +0 -0
- /package/dist/{icons.d.ts → test/features/media-player/stores/PlayQueueItemStore.test.d.ts} +0 -0
package/dist/index.es.js
CHANGED
|
@@ -1,2472 +1,2273 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
|
|
15
|
-
var
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
*/
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
if (m && m.defaultProps) for (C in h = m.defaultProps, h) R[C] === void 0 && (R[C] = h[C]);
|
|
35
|
-
return { $$typeof: e, type: m, key: B, ref: j, props: R, _owner: a.current };
|
|
36
|
-
}
|
|
37
|
-
return xe.Fragment = n, xe.jsx = f, xe.jsxs = f, xe;
|
|
1
|
+
import { Fragment as e, jsx as t, jsxs as n } from "@emotion/react/jsx-runtime";
|
|
2
|
+
import { createContext as r, memo as i, useCallback as a, useContext as o, useEffect as s, useLayoutEffect as c, useMemo as l, useRef as u, useState as d } from "react";
|
|
3
|
+
import ee from "ajv";
|
|
4
|
+
import { action as f, computed as p, makeObservable as m, observable as h, reaction as te } from "mobx";
|
|
5
|
+
import { useLocalStorageState as ne } from "@aigamo/route-sphere";
|
|
6
|
+
import { pull as re } from "lodash-es";
|
|
7
|
+
import { NostalgicDiva as ie, NostalgicDivaProvider as ae, findVideoService as oe, nullPlayerController as se, useNostalgicDiva as g } from "@aigamo/nostalgic-diva";
|
|
8
|
+
import { EuiBottomBar as ce, EuiButton as _, EuiButtonEmpty as v, EuiButtonIcon as y, EuiCheckbox as b, EuiConfirmModal as le, EuiContextMenu as x, EuiEmptyPrompt as ue, EuiFieldText as S, EuiFlexGroup as C, EuiFlexItem as w, EuiForm as de, EuiFormRow as T, EuiHideFor as E, EuiIcon as D, EuiLink as fe, EuiModal as pe, EuiModalBody as me, EuiModalFooter as he, EuiModalHeader as ge, EuiModalHeaderTitle as _e, EuiPageTemplate as O, EuiPopover as k, EuiRange as ve, EuiShowFor as ye, EuiSpacer as be, EuiTable as xe, EuiTableHeader as Se, EuiTableHeaderCell as A, EuiTableHeaderCellCheckbox as Ce, EuiTableHeaderMobile as we, EuiTableRow as Te, EuiTableRowCell as j, EuiTableRowCellCheckbox as Ee, useEuiTheme as M, useGeneratedHtmlId as De } from "@elastic/eui";
|
|
9
|
+
import { observer as N } from "mobx-react-lite";
|
|
10
|
+
import { AddRegular as P, ArrowDownloadRegular as Oe, ArrowRepeat1Filled as ke, ArrowRepeatAllFilled as Ae, ArrowRepeatAllOffFilled as je, ArrowShuffleFilled as Me, ArrowShuffleOffFilled as Ne, ArrowUploadRegular as Pe, DeleteRegular as Fe, DismissRegular as F, MoreHorizontalFilled as I, NavigationPlayRegular as Ie, NextFilled as Le, OpenRegular as Re, PauseFilled as ze, PlayFilled as Be, PlayRegular as L, PreviousFilled as Ve, RenameRegular as He, SkipBack10Regular as Ue, SkipForward30Regular as We, Speaker2Regular as Ge, TopSpeedRegular as Ke } from "@fluentui/react-icons";
|
|
11
|
+
import R from "ez-modal-react";
|
|
12
|
+
import { ReactSortable as qe } from "react-sortablejs";
|
|
13
|
+
import { useRouter as Je } from "@tanstack/react-router";
|
|
14
|
+
//#region src/features/common/helpers/bottomBarHeight.ts
|
|
15
|
+
var Ye = 81, z = new Map(Object.entries({
|
|
16
|
+
Audio: "",
|
|
17
|
+
Dailymotion: "https://www.dailymotion.com/favicon.ico",
|
|
18
|
+
Niconico: "https://www.nicovideo.jp/favicon.ico",
|
|
19
|
+
SoundCloud: "https://soundcloud.com/favicon.ico",
|
|
20
|
+
Spotify: "https://storage.googleapis.com/pr-newsroom-wp/1/2023/05/Spotify_Primary_Logo_RGB_Green.png",
|
|
21
|
+
Twitch: "https://www.twitch.tv/favicon.ico",
|
|
22
|
+
Vimeo: "https://vimeo.com/favicon.ico",
|
|
23
|
+
YouTube: "https://www.youtube.com/favicon.ico"
|
|
24
|
+
})), Xe = ({ components: n = [], children: r }) => /* @__PURE__ */ t(e, { children: n.reduceRight((e, n) => /* @__PURE__ */ t(n, { children: e }), r) }), B = {
|
|
25
|
+
playQueue: "PlayQueueStore",
|
|
26
|
+
bottomBar: "BottomBarStore",
|
|
27
|
+
playlistList: "PlaylistListStore",
|
|
28
|
+
playlist: (e) => `PlaylistStore/${e}`
|
|
29
|
+
}, Ze = r(void 0), V = () => o(Ze), Qe = new ee({ coerceTypes: !0 });
|
|
30
|
+
function $e(e, t) {
|
|
31
|
+
let n;
|
|
32
|
+
if (n = Qe.getSchema(t), n === void 0 && (Qe.addSchema(e, t), n = Qe.getSchema(t)), n === void 0 || n.schema !== e) throw Error(`Invalid schema. Expected: '${JSON.stringify(e)}', but got '${JSON.stringify(n?.schema)}'.`);
|
|
33
|
+
return n;
|
|
38
34
|
}
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
var
|
|
50
|
-
|
|
51
|
-
return wt || (wt = 1, process.env.NODE_ENV !== "production" && function() {
|
|
52
|
-
var t = Ft, 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"), m = Symbol.for("react.context"), h = Symbol.for("react.forward_ref"), p = Symbol.for("react.suspense"), C = Symbol.for("react.suspense_list"), R = Symbol.for("react.memo"), B = Symbol.for("react.lazy"), j = Symbol.for("react.offscreen"), z = Symbol.iterator, fe = "@@iterator";
|
|
53
|
-
function me(r) {
|
|
54
|
-
if (r === null || typeof r != "object")
|
|
55
|
-
return null;
|
|
56
|
-
var s = z && r[z] || r[fe];
|
|
57
|
-
return typeof s == "function" ? s : null;
|
|
58
|
-
}
|
|
59
|
-
var q = t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
|
60
|
-
function A(r) {
|
|
61
|
-
{
|
|
62
|
-
for (var s = arguments.length, c = new Array(s > 1 ? s - 1 : 0), v = 1; v < s; v++)
|
|
63
|
-
c[v - 1] = arguments[v];
|
|
64
|
-
M("error", r, c);
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
function M(r, s, c) {
|
|
68
|
-
{
|
|
69
|
-
var v = q.ReactDebugCurrentFrame, E = v.getStackAddendum();
|
|
70
|
-
E !== "" && (s += "%s", c = c.concat([E]));
|
|
71
|
-
var S = c.map(function(b) {
|
|
72
|
-
return String(b);
|
|
73
|
-
});
|
|
74
|
-
S.unshift("Warning: " + s), Function.prototype.apply.call(console[r], console, S);
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
var k = !1, u = !1, re = !1, Ne = !1, De = !1, Pe;
|
|
78
|
-
Pe = Symbol.for("react.module.reference");
|
|
79
|
-
function ze(r) {
|
|
80
|
-
return !!(typeof r == "string" || typeof r == "function" || r === i || r === l || De || r === a || r === p || r === C || Ne || r === j || k || u || re || typeof r == "object" && r !== null && (r.$$typeof === B || r.$$typeof === R || r.$$typeof === f || r.$$typeof === m || r.$$typeof === h || // This needs to include all possible module reference object
|
|
81
|
-
// types supported by any Flight configuration anywhere since
|
|
82
|
-
// we don't know which Flight build this will end up being used
|
|
83
|
-
// with.
|
|
84
|
-
r.$$typeof === Pe || r.getModuleId !== void 0));
|
|
85
|
-
}
|
|
86
|
-
function Le(r, s, c) {
|
|
87
|
-
var v = r.displayName;
|
|
88
|
-
if (v)
|
|
89
|
-
return v;
|
|
90
|
-
var E = s.displayName || s.name || "";
|
|
91
|
-
return E !== "" ? c + "(" + E + ")" : c;
|
|
92
|
-
}
|
|
93
|
-
function we(r) {
|
|
94
|
-
return r.displayName || "Context";
|
|
95
|
-
}
|
|
96
|
-
function H(r) {
|
|
97
|
-
if (r == null)
|
|
98
|
-
return null;
|
|
99
|
-
if (typeof r.tag == "number" && A("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof r == "function")
|
|
100
|
-
return r.displayName || r.name || null;
|
|
101
|
-
if (typeof r == "string")
|
|
102
|
-
return r;
|
|
103
|
-
switch (r) {
|
|
104
|
-
case i:
|
|
105
|
-
return "Fragment";
|
|
106
|
-
case n:
|
|
107
|
-
return "Portal";
|
|
108
|
-
case l:
|
|
109
|
-
return "Profiler";
|
|
110
|
-
case a:
|
|
111
|
-
return "StrictMode";
|
|
112
|
-
case p:
|
|
113
|
-
return "Suspense";
|
|
114
|
-
case C:
|
|
115
|
-
return "SuspenseList";
|
|
116
|
-
}
|
|
117
|
-
if (typeof r == "object")
|
|
118
|
-
switch (r.$$typeof) {
|
|
119
|
-
case m:
|
|
120
|
-
var s = r;
|
|
121
|
-
return we(s) + ".Consumer";
|
|
122
|
-
case f:
|
|
123
|
-
var c = r;
|
|
124
|
-
return we(c._context) + ".Provider";
|
|
125
|
-
case h:
|
|
126
|
-
return Le(r, r.render, "ForwardRef");
|
|
127
|
-
case R:
|
|
128
|
-
var v = r.displayName || null;
|
|
129
|
-
return v !== null ? v : H(r.type) || "Memo";
|
|
130
|
-
case B: {
|
|
131
|
-
var E = r, S = E._payload, b = E._init;
|
|
132
|
-
try {
|
|
133
|
-
return H(b(S));
|
|
134
|
-
} catch {
|
|
135
|
-
return null;
|
|
136
|
-
}
|
|
137
|
-
}
|
|
138
|
-
}
|
|
139
|
-
return null;
|
|
140
|
-
}
|
|
141
|
-
var X = Object.assign, ne = 0, _e, Oe, he, Ae, ve, ke, Me;
|
|
142
|
-
function Fe() {
|
|
143
|
-
}
|
|
144
|
-
Fe.__reactDisabledLog = !0;
|
|
145
|
-
function Ve() {
|
|
146
|
-
{
|
|
147
|
-
if (ne === 0) {
|
|
148
|
-
_e = console.log, Oe = console.info, he = console.warn, Ae = console.error, ve = console.group, ke = console.groupCollapsed, Me = console.groupEnd;
|
|
149
|
-
var r = {
|
|
150
|
-
configurable: !0,
|
|
151
|
-
enumerable: !0,
|
|
152
|
-
value: Fe,
|
|
153
|
-
writable: !0
|
|
154
|
-
};
|
|
155
|
-
Object.defineProperties(console, {
|
|
156
|
-
info: r,
|
|
157
|
-
log: r,
|
|
158
|
-
warn: r,
|
|
159
|
-
error: r,
|
|
160
|
-
group: r,
|
|
161
|
-
groupCollapsed: r,
|
|
162
|
-
groupEnd: r
|
|
163
|
-
});
|
|
164
|
-
}
|
|
165
|
-
ne++;
|
|
166
|
-
}
|
|
167
|
-
}
|
|
168
|
-
function Ye() {
|
|
169
|
-
{
|
|
170
|
-
if (ne--, ne === 0) {
|
|
171
|
-
var r = {
|
|
172
|
-
configurable: !0,
|
|
173
|
-
enumerable: !0,
|
|
174
|
-
writable: !0
|
|
175
|
-
};
|
|
176
|
-
Object.defineProperties(console, {
|
|
177
|
-
log: X({}, r, {
|
|
178
|
-
value: _e
|
|
179
|
-
}),
|
|
180
|
-
info: X({}, r, {
|
|
181
|
-
value: Oe
|
|
182
|
-
}),
|
|
183
|
-
warn: X({}, r, {
|
|
184
|
-
value: he
|
|
185
|
-
}),
|
|
186
|
-
error: X({}, r, {
|
|
187
|
-
value: Ae
|
|
188
|
-
}),
|
|
189
|
-
group: X({}, r, {
|
|
190
|
-
value: ve
|
|
191
|
-
}),
|
|
192
|
-
groupCollapsed: X({}, r, {
|
|
193
|
-
value: ke
|
|
194
|
-
}),
|
|
195
|
-
groupEnd: X({}, r, {
|
|
196
|
-
value: Me
|
|
197
|
-
})
|
|
198
|
-
});
|
|
199
|
-
}
|
|
200
|
-
ne < 0 && A("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
|
|
201
|
-
}
|
|
202
|
-
}
|
|
203
|
-
var pe = q.ReactCurrentDispatcher, ye;
|
|
204
|
-
function ae(r, s, c) {
|
|
205
|
-
{
|
|
206
|
-
if (ye === void 0)
|
|
207
|
-
try {
|
|
208
|
-
throw Error();
|
|
209
|
-
} catch (E) {
|
|
210
|
-
var v = E.stack.trim().match(/\n( *(at )?)/);
|
|
211
|
-
ye = v && v[1] || "";
|
|
212
|
-
}
|
|
213
|
-
return `
|
|
214
|
-
` + ye + r;
|
|
215
|
-
}
|
|
216
|
-
}
|
|
217
|
-
var ge = !1, se;
|
|
218
|
-
{
|
|
219
|
-
var Be = typeof WeakMap == "function" ? WeakMap : Map;
|
|
220
|
-
se = new Be();
|
|
221
|
-
}
|
|
222
|
-
function d(r, s) {
|
|
223
|
-
if (!r || ge)
|
|
224
|
-
return "";
|
|
225
|
-
{
|
|
226
|
-
var c = se.get(r);
|
|
227
|
-
if (c !== void 0)
|
|
228
|
-
return c;
|
|
229
|
-
}
|
|
230
|
-
var v;
|
|
231
|
-
ge = !0;
|
|
232
|
-
var E = Error.prepareStackTrace;
|
|
233
|
-
Error.prepareStackTrace = void 0;
|
|
234
|
-
var S;
|
|
235
|
-
S = pe.current, pe.current = null, Ve();
|
|
236
|
-
try {
|
|
237
|
-
if (s) {
|
|
238
|
-
var b = function() {
|
|
239
|
-
throw Error();
|
|
240
|
-
};
|
|
241
|
-
if (Object.defineProperty(b.prototype, "props", {
|
|
242
|
-
set: function() {
|
|
243
|
-
throw Error();
|
|
244
|
-
}
|
|
245
|
-
}), typeof Reflect == "object" && Reflect.construct) {
|
|
246
|
-
try {
|
|
247
|
-
Reflect.construct(b, []);
|
|
248
|
-
} catch (N) {
|
|
249
|
-
v = N;
|
|
250
|
-
}
|
|
251
|
-
Reflect.construct(r, [], b);
|
|
252
|
-
} else {
|
|
253
|
-
try {
|
|
254
|
-
b.call();
|
|
255
|
-
} catch (N) {
|
|
256
|
-
v = N;
|
|
257
|
-
}
|
|
258
|
-
r.call(b.prototype);
|
|
259
|
-
}
|
|
260
|
-
} else {
|
|
261
|
-
try {
|
|
262
|
-
throw Error();
|
|
263
|
-
} catch (N) {
|
|
264
|
-
v = N;
|
|
265
|
-
}
|
|
266
|
-
r();
|
|
267
|
-
}
|
|
268
|
-
} catch (N) {
|
|
269
|
-
if (N && v && typeof N.stack == "string") {
|
|
270
|
-
for (var g = N.stack.split(`
|
|
271
|
-
`), F = v.stack.split(`
|
|
272
|
-
`), P = g.length - 1, _ = F.length - 1; P >= 1 && _ >= 0 && g[P] !== F[_]; )
|
|
273
|
-
_--;
|
|
274
|
-
for (; P >= 1 && _ >= 0; P--, _--)
|
|
275
|
-
if (g[P] !== F[_]) {
|
|
276
|
-
if (P !== 1 || _ !== 1)
|
|
277
|
-
do
|
|
278
|
-
if (P--, _--, _ < 0 || g[P] !== F[_]) {
|
|
279
|
-
var L = `
|
|
280
|
-
` + g[P].replace(" at new ", " at ");
|
|
281
|
-
return r.displayName && L.includes("<anonymous>") && (L = L.replace("<anonymous>", r.displayName)), typeof r == "function" && se.set(r, L), L;
|
|
282
|
-
}
|
|
283
|
-
while (P >= 1 && _ >= 0);
|
|
284
|
-
break;
|
|
285
|
-
}
|
|
286
|
-
}
|
|
287
|
-
} finally {
|
|
288
|
-
ge = !1, pe.current = S, Ye(), Error.prepareStackTrace = E;
|
|
289
|
-
}
|
|
290
|
-
var ue = r ? r.displayName || r.name : "", oe = ue ? ae(ue) : "";
|
|
291
|
-
return typeof r == "function" && se.set(r, oe), oe;
|
|
292
|
-
}
|
|
293
|
-
function be(r, s, c) {
|
|
294
|
-
return d(r, !1);
|
|
295
|
-
}
|
|
296
|
-
function le(r) {
|
|
297
|
-
var s = r.prototype;
|
|
298
|
-
return !!(s && s.isReactComponent);
|
|
299
|
-
}
|
|
300
|
-
function ie(r, s, c) {
|
|
301
|
-
if (r == null)
|
|
302
|
-
return "";
|
|
303
|
-
if (typeof r == "function")
|
|
304
|
-
return d(r, le(r));
|
|
305
|
-
if (typeof r == "string")
|
|
306
|
-
return ae(r);
|
|
307
|
-
switch (r) {
|
|
308
|
-
case p:
|
|
309
|
-
return ae("Suspense");
|
|
310
|
-
case C:
|
|
311
|
-
return ae("SuspenseList");
|
|
312
|
-
}
|
|
313
|
-
if (typeof r == "object")
|
|
314
|
-
switch (r.$$typeof) {
|
|
315
|
-
case h:
|
|
316
|
-
return be(r.render);
|
|
317
|
-
case R:
|
|
318
|
-
return ie(r.type, s, c);
|
|
319
|
-
case B: {
|
|
320
|
-
var v = r, E = v._payload, S = v._init;
|
|
321
|
-
try {
|
|
322
|
-
return ie(S(E), s, c);
|
|
323
|
-
} catch {
|
|
324
|
-
}
|
|
325
|
-
}
|
|
326
|
-
}
|
|
327
|
-
return "";
|
|
328
|
-
}
|
|
329
|
-
var Ee = Object.prototype.hasOwnProperty, ut = {}, dt = q.ReactDebugCurrentFrame;
|
|
330
|
-
function $e(r) {
|
|
331
|
-
if (r) {
|
|
332
|
-
var s = r._owner, c = ie(r.type, r._source, s ? s.type : null);
|
|
333
|
-
dt.setExtraStackFrame(c);
|
|
334
|
-
} else
|
|
335
|
-
dt.setExtraStackFrame(null);
|
|
336
|
-
}
|
|
337
|
-
function er(r, s, c, v, E) {
|
|
338
|
-
{
|
|
339
|
-
var S = Function.call.bind(Ee);
|
|
340
|
-
for (var b in r)
|
|
341
|
-
if (S(r, b)) {
|
|
342
|
-
var g = void 0;
|
|
343
|
-
try {
|
|
344
|
-
if (typeof r[b] != "function") {
|
|
345
|
-
var F = Error((v || "React class") + ": " + c + " type `" + b + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof r[b] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
|
|
346
|
-
throw F.name = "Invariant Violation", F;
|
|
347
|
-
}
|
|
348
|
-
g = r[b](s, b, v, c, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
|
|
349
|
-
} catch (P) {
|
|
350
|
-
g = P;
|
|
351
|
-
}
|
|
352
|
-
g && !(g instanceof Error) && ($e(E), A("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", v || "React class", c, b, typeof g), $e(null)), g instanceof Error && !(g.message in ut) && (ut[g.message] = !0, $e(E), A("Failed %s type: %s", c, g.message), $e(null));
|
|
353
|
-
}
|
|
354
|
-
}
|
|
355
|
-
}
|
|
356
|
-
var tr = Array.isArray;
|
|
357
|
-
function We(r) {
|
|
358
|
-
return tr(r);
|
|
359
|
-
}
|
|
360
|
-
function rr(r) {
|
|
361
|
-
{
|
|
362
|
-
var s = typeof Symbol == "function" && Symbol.toStringTag, c = s && r[Symbol.toStringTag] || r.constructor.name || "Object";
|
|
363
|
-
return c;
|
|
364
|
-
}
|
|
365
|
-
}
|
|
366
|
-
function nr(r) {
|
|
367
|
-
try {
|
|
368
|
-
return ft(r), !1;
|
|
369
|
-
} catch {
|
|
370
|
-
return !0;
|
|
371
|
-
}
|
|
372
|
-
}
|
|
373
|
-
function ft(r) {
|
|
374
|
-
return "" + r;
|
|
375
|
-
}
|
|
376
|
-
function mt(r) {
|
|
377
|
-
if (nr(r))
|
|
378
|
-
return A("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", rr(r)), ft(r);
|
|
379
|
-
}
|
|
380
|
-
var ht = q.ReactCurrentOwner, ir = {
|
|
381
|
-
key: !0,
|
|
382
|
-
ref: !0,
|
|
383
|
-
__self: !0,
|
|
384
|
-
__source: !0
|
|
385
|
-
}, vt, pt;
|
|
386
|
-
function or(r) {
|
|
387
|
-
if (Ee.call(r, "ref")) {
|
|
388
|
-
var s = Object.getOwnPropertyDescriptor(r, "ref").get;
|
|
389
|
-
if (s && s.isReactWarning)
|
|
390
|
-
return !1;
|
|
391
|
-
}
|
|
392
|
-
return r.ref !== void 0;
|
|
393
|
-
}
|
|
394
|
-
function ar(r) {
|
|
395
|
-
if (Ee.call(r, "key")) {
|
|
396
|
-
var s = Object.getOwnPropertyDescriptor(r, "key").get;
|
|
397
|
-
if (s && s.isReactWarning)
|
|
398
|
-
return !1;
|
|
399
|
-
}
|
|
400
|
-
return r.key !== void 0;
|
|
401
|
-
}
|
|
402
|
-
function sr(r, s) {
|
|
403
|
-
typeof r.ref == "string" && ht.current;
|
|
404
|
-
}
|
|
405
|
-
function lr(r, s) {
|
|
406
|
-
{
|
|
407
|
-
var c = function() {
|
|
408
|
-
vt || (vt = !0, A("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", s));
|
|
409
|
-
};
|
|
410
|
-
c.isReactWarning = !0, Object.defineProperty(r, "key", {
|
|
411
|
-
get: c,
|
|
412
|
-
configurable: !0
|
|
413
|
-
});
|
|
414
|
-
}
|
|
415
|
-
}
|
|
416
|
-
function cr(r, s) {
|
|
417
|
-
{
|
|
418
|
-
var c = function() {
|
|
419
|
-
pt || (pt = !0, A("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", s));
|
|
420
|
-
};
|
|
421
|
-
c.isReactWarning = !0, Object.defineProperty(r, "ref", {
|
|
422
|
-
get: c,
|
|
423
|
-
configurable: !0
|
|
424
|
-
});
|
|
425
|
-
}
|
|
426
|
-
}
|
|
427
|
-
var ur = function(r, s, c, v, E, S, b) {
|
|
428
|
-
var g = {
|
|
429
|
-
// This tag allows us to uniquely identify this as a React Element
|
|
430
|
-
$$typeof: e,
|
|
431
|
-
// Built-in properties that belong on the element
|
|
432
|
-
type: r,
|
|
433
|
-
key: s,
|
|
434
|
-
ref: c,
|
|
435
|
-
props: b,
|
|
436
|
-
// Record the component responsible for creating this element.
|
|
437
|
-
_owner: S
|
|
438
|
-
};
|
|
439
|
-
return g._store = {}, Object.defineProperty(g._store, "validated", {
|
|
440
|
-
configurable: !1,
|
|
441
|
-
enumerable: !1,
|
|
442
|
-
writable: !0,
|
|
443
|
-
value: !1
|
|
444
|
-
}), Object.defineProperty(g, "_self", {
|
|
445
|
-
configurable: !1,
|
|
446
|
-
enumerable: !1,
|
|
447
|
-
writable: !1,
|
|
448
|
-
value: v
|
|
449
|
-
}), Object.defineProperty(g, "_source", {
|
|
450
|
-
configurable: !1,
|
|
451
|
-
enumerable: !1,
|
|
452
|
-
writable: !1,
|
|
453
|
-
value: E
|
|
454
|
-
}), Object.freeze && (Object.freeze(g.props), Object.freeze(g)), g;
|
|
455
|
-
};
|
|
456
|
-
function dr(r, s, c, v, E) {
|
|
457
|
-
{
|
|
458
|
-
var S, b = {}, g = null, F = null;
|
|
459
|
-
c !== void 0 && (mt(c), g = "" + c), ar(s) && (mt(s.key), g = "" + s.key), or(s) && (F = s.ref, sr(s, E));
|
|
460
|
-
for (S in s)
|
|
461
|
-
Ee.call(s, S) && !ir.hasOwnProperty(S) && (b[S] = s[S]);
|
|
462
|
-
if (r && r.defaultProps) {
|
|
463
|
-
var P = r.defaultProps;
|
|
464
|
-
for (S in P)
|
|
465
|
-
b[S] === void 0 && (b[S] = P[S]);
|
|
466
|
-
}
|
|
467
|
-
if (g || F) {
|
|
468
|
-
var _ = typeof r == "function" ? r.displayName || r.name || "Unknown" : r;
|
|
469
|
-
g && lr(b, _), F && cr(b, _);
|
|
470
|
-
}
|
|
471
|
-
return ur(r, g, F, E, v, ht.current, b);
|
|
472
|
-
}
|
|
473
|
-
}
|
|
474
|
-
var Ue = q.ReactCurrentOwner, yt = q.ReactDebugCurrentFrame;
|
|
475
|
-
function ce(r) {
|
|
476
|
-
if (r) {
|
|
477
|
-
var s = r._owner, c = ie(r.type, r._source, s ? s.type : null);
|
|
478
|
-
yt.setExtraStackFrame(c);
|
|
479
|
-
} else
|
|
480
|
-
yt.setExtraStackFrame(null);
|
|
481
|
-
}
|
|
482
|
-
var qe;
|
|
483
|
-
qe = !1;
|
|
484
|
-
function He(r) {
|
|
485
|
-
return typeof r == "object" && r !== null && r.$$typeof === e;
|
|
486
|
-
}
|
|
487
|
-
function gt() {
|
|
488
|
-
{
|
|
489
|
-
if (Ue.current) {
|
|
490
|
-
var r = H(Ue.current.type);
|
|
491
|
-
if (r)
|
|
492
|
-
return `
|
|
493
|
-
|
|
494
|
-
Check the render method of \`` + r + "`.";
|
|
495
|
-
}
|
|
496
|
-
return "";
|
|
497
|
-
}
|
|
498
|
-
}
|
|
499
|
-
function fr(r) {
|
|
500
|
-
return "";
|
|
501
|
-
}
|
|
502
|
-
var bt = {};
|
|
503
|
-
function mr(r) {
|
|
504
|
-
{
|
|
505
|
-
var s = gt();
|
|
506
|
-
if (!s) {
|
|
507
|
-
var c = typeof r == "string" ? r : r.displayName || r.name;
|
|
508
|
-
c && (s = `
|
|
509
|
-
|
|
510
|
-
Check the top-level render call using <` + c + ">.");
|
|
511
|
-
}
|
|
512
|
-
return s;
|
|
513
|
-
}
|
|
514
|
-
}
|
|
515
|
-
function Et(r, s) {
|
|
516
|
-
{
|
|
517
|
-
if (!r._store || r._store.validated || r.key != null)
|
|
518
|
-
return;
|
|
519
|
-
r._store.validated = !0;
|
|
520
|
-
var c = mr(s);
|
|
521
|
-
if (bt[c])
|
|
522
|
-
return;
|
|
523
|
-
bt[c] = !0;
|
|
524
|
-
var v = "";
|
|
525
|
-
r && r._owner && r._owner !== Ue.current && (v = " It was passed a child from " + H(r._owner.type) + "."), ce(r), A('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', c, v), ce(null);
|
|
526
|
-
}
|
|
527
|
-
}
|
|
528
|
-
function xt(r, s) {
|
|
529
|
-
{
|
|
530
|
-
if (typeof r != "object")
|
|
531
|
-
return;
|
|
532
|
-
if (We(r))
|
|
533
|
-
for (var c = 0; c < r.length; c++) {
|
|
534
|
-
var v = r[c];
|
|
535
|
-
He(v) && Et(v, s);
|
|
536
|
-
}
|
|
537
|
-
else if (He(r))
|
|
538
|
-
r._store && (r._store.validated = !0);
|
|
539
|
-
else if (r) {
|
|
540
|
-
var E = me(r);
|
|
541
|
-
if (typeof E == "function" && E !== r.entries)
|
|
542
|
-
for (var S = E.call(r), b; !(b = S.next()).done; )
|
|
543
|
-
He(b.value) && Et(b.value, s);
|
|
544
|
-
}
|
|
545
|
-
}
|
|
546
|
-
}
|
|
547
|
-
function hr(r) {
|
|
548
|
-
{
|
|
549
|
-
var s = r.type;
|
|
550
|
-
if (s == null || typeof s == "string")
|
|
551
|
-
return;
|
|
552
|
-
var c;
|
|
553
|
-
if (typeof s == "function")
|
|
554
|
-
c = s.propTypes;
|
|
555
|
-
else if (typeof s == "object" && (s.$$typeof === h || // Note: Memo only checks outer props here.
|
|
556
|
-
// Inner props are checked in the reconciler.
|
|
557
|
-
s.$$typeof === R))
|
|
558
|
-
c = s.propTypes;
|
|
559
|
-
else
|
|
560
|
-
return;
|
|
561
|
-
if (c) {
|
|
562
|
-
var v = H(s);
|
|
563
|
-
er(c, r.props, "prop", v, r);
|
|
564
|
-
} else if (s.PropTypes !== void 0 && !qe) {
|
|
565
|
-
qe = !0;
|
|
566
|
-
var E = H(s);
|
|
567
|
-
A("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", E || "Unknown");
|
|
568
|
-
}
|
|
569
|
-
typeof s.getDefaultProps == "function" && !s.getDefaultProps.isReactClassApproved && A("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
|
|
570
|
-
}
|
|
571
|
-
}
|
|
572
|
-
function vr(r) {
|
|
573
|
-
{
|
|
574
|
-
for (var s = Object.keys(r.props), c = 0; c < s.length; c++) {
|
|
575
|
-
var v = s[c];
|
|
576
|
-
if (v !== "children" && v !== "key") {
|
|
577
|
-
ce(r), A("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", v), ce(null);
|
|
578
|
-
break;
|
|
579
|
-
}
|
|
580
|
-
}
|
|
581
|
-
r.ref !== null && (ce(r), A("Invalid attribute `ref` supplied to `React.Fragment`."), ce(null));
|
|
582
|
-
}
|
|
583
|
-
}
|
|
584
|
-
var Tt = {};
|
|
585
|
-
function Ct(r, s, c, v, E, S) {
|
|
586
|
-
{
|
|
587
|
-
var b = ze(r);
|
|
588
|
-
if (!b) {
|
|
589
|
-
var g = "";
|
|
590
|
-
(r === void 0 || typeof r == "object" && r !== null && Object.keys(r).length === 0) && (g += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
|
|
591
|
-
var F = fr();
|
|
592
|
-
F ? g += F : g += gt();
|
|
593
|
-
var P;
|
|
594
|
-
r === null ? P = "null" : We(r) ? P = "array" : r !== void 0 && r.$$typeof === e ? (P = "<" + (H(r.type) || "Unknown") + " />", g = " Did you accidentally export a JSX literal instead of a component?") : P = typeof r, A("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", P, g);
|
|
595
|
-
}
|
|
596
|
-
var _ = dr(r, s, c, E, S);
|
|
597
|
-
if (_ == null)
|
|
598
|
-
return _;
|
|
599
|
-
if (b) {
|
|
600
|
-
var L = s.children;
|
|
601
|
-
if (L !== void 0)
|
|
602
|
-
if (v)
|
|
603
|
-
if (We(L)) {
|
|
604
|
-
for (var ue = 0; ue < L.length; ue++)
|
|
605
|
-
xt(L[ue], r);
|
|
606
|
-
Object.freeze && Object.freeze(L);
|
|
607
|
-
} else
|
|
608
|
-
A("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
|
|
609
|
-
else
|
|
610
|
-
xt(L, r);
|
|
611
|
-
}
|
|
612
|
-
if (Ee.call(s, "key")) {
|
|
613
|
-
var oe = H(r), N = Object.keys(s).filter(function(xr) {
|
|
614
|
-
return xr !== "key";
|
|
615
|
-
}), Ge = N.length > 0 ? "{key: someKey, " + N.join(": ..., ") + ": ...}" : "{key: someKey}";
|
|
616
|
-
if (!Tt[oe + Ge]) {
|
|
617
|
-
var Er = N.length > 0 ? "{" + N.join(": ..., ") + ": ...}" : "{}";
|
|
618
|
-
A(`A props object containing a "key" prop is being spread into JSX:
|
|
619
|
-
let props = %s;
|
|
620
|
-
<%s {...props} />
|
|
621
|
-
React keys must be passed directly to JSX without using spread:
|
|
622
|
-
let props = %s;
|
|
623
|
-
<%s key={someKey} {...props} />`, Ge, oe, Er, oe), Tt[oe + Ge] = !0;
|
|
624
|
-
}
|
|
625
|
-
}
|
|
626
|
-
return r === i ? vr(_) : hr(_), _;
|
|
627
|
-
}
|
|
628
|
-
}
|
|
629
|
-
function pr(r, s, c) {
|
|
630
|
-
return Ct(r, s, c, !0);
|
|
631
|
-
}
|
|
632
|
-
function yr(r, s, c) {
|
|
633
|
-
return Ct(r, s, c, !1);
|
|
634
|
-
}
|
|
635
|
-
var gr = yr, br = pr;
|
|
636
|
-
Te.Fragment = i, Te.jsx = gr, Te.jsxs = br;
|
|
637
|
-
}()), Te;
|
|
638
|
-
}
|
|
639
|
-
process.env.NODE_ENV === "production" ? tt.exports = pn() : tt.exports = yn();
|
|
640
|
-
var Se = tt.exports, rt = { exports: {} }, x = {};
|
|
641
|
-
/** @license React v16.13.1
|
|
642
|
-
* react-is.production.min.js
|
|
643
|
-
*
|
|
644
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
645
|
-
*
|
|
646
|
-
* This source code is licensed under the MIT license found in the
|
|
647
|
-
* LICENSE file in the root directory of this source tree.
|
|
648
|
-
*/
|
|
649
|
-
var _t;
|
|
650
|
-
function gn() {
|
|
651
|
-
if (_t) return x;
|
|
652
|
-
_t = 1;
|
|
653
|
-
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, m = t ? Symbol.for("react.context") : 60110, h = t ? Symbol.for("react.async_mode") : 60111, p = t ? Symbol.for("react.concurrent_mode") : 60111, C = t ? Symbol.for("react.forward_ref") : 60112, R = t ? Symbol.for("react.suspense") : 60113, B = t ? Symbol.for("react.suspense_list") : 60120, j = t ? Symbol.for("react.memo") : 60115, z = t ? Symbol.for("react.lazy") : 60116, fe = t ? Symbol.for("react.block") : 60121, me = t ? Symbol.for("react.fundamental") : 60117, q = t ? Symbol.for("react.responder") : 60118, A = t ? Symbol.for("react.scope") : 60119;
|
|
654
|
-
function M(u) {
|
|
655
|
-
if (typeof u == "object" && u !== null) {
|
|
656
|
-
var re = u.$$typeof;
|
|
657
|
-
switch (re) {
|
|
658
|
-
case e:
|
|
659
|
-
switch (u = u.type, u) {
|
|
660
|
-
case h:
|
|
661
|
-
case p:
|
|
662
|
-
case i:
|
|
663
|
-
case l:
|
|
664
|
-
case a:
|
|
665
|
-
case R:
|
|
666
|
-
return u;
|
|
667
|
-
default:
|
|
668
|
-
switch (u = u && u.$$typeof, u) {
|
|
669
|
-
case m:
|
|
670
|
-
case C:
|
|
671
|
-
case z:
|
|
672
|
-
case j:
|
|
673
|
-
case f:
|
|
674
|
-
return u;
|
|
675
|
-
default:
|
|
676
|
-
return re;
|
|
677
|
-
}
|
|
678
|
-
}
|
|
679
|
-
case n:
|
|
680
|
-
return re;
|
|
681
|
-
}
|
|
682
|
-
}
|
|
683
|
-
}
|
|
684
|
-
function k(u) {
|
|
685
|
-
return M(u) === p;
|
|
686
|
-
}
|
|
687
|
-
return x.AsyncMode = h, x.ConcurrentMode = p, x.ContextConsumer = m, x.ContextProvider = f, x.Element = e, x.ForwardRef = C, x.Fragment = i, x.Lazy = z, x.Memo = j, x.Portal = n, x.Profiler = l, x.StrictMode = a, x.Suspense = R, x.isAsyncMode = function(u) {
|
|
688
|
-
return k(u) || M(u) === h;
|
|
689
|
-
}, x.isConcurrentMode = k, x.isContextConsumer = function(u) {
|
|
690
|
-
return M(u) === m;
|
|
691
|
-
}, x.isContextProvider = function(u) {
|
|
692
|
-
return M(u) === f;
|
|
693
|
-
}, x.isElement = function(u) {
|
|
694
|
-
return typeof u == "object" && u !== null && u.$$typeof === e;
|
|
695
|
-
}, x.isForwardRef = function(u) {
|
|
696
|
-
return M(u) === C;
|
|
697
|
-
}, x.isFragment = function(u) {
|
|
698
|
-
return M(u) === i;
|
|
699
|
-
}, x.isLazy = function(u) {
|
|
700
|
-
return M(u) === z;
|
|
701
|
-
}, x.isMemo = function(u) {
|
|
702
|
-
return M(u) === j;
|
|
703
|
-
}, x.isPortal = function(u) {
|
|
704
|
-
return M(u) === n;
|
|
705
|
-
}, x.isProfiler = function(u) {
|
|
706
|
-
return M(u) === l;
|
|
707
|
-
}, x.isStrictMode = function(u) {
|
|
708
|
-
return M(u) === a;
|
|
709
|
-
}, x.isSuspense = function(u) {
|
|
710
|
-
return M(u) === R;
|
|
711
|
-
}, x.isValidElementType = function(u) {
|
|
712
|
-
return typeof u == "string" || typeof u == "function" || u === i || u === p || u === l || u === a || u === R || u === B || typeof u == "object" && u !== null && (u.$$typeof === z || u.$$typeof === j || u.$$typeof === f || u.$$typeof === m || u.$$typeof === C || u.$$typeof === me || u.$$typeof === q || u.$$typeof === A || u.$$typeof === fe);
|
|
713
|
-
}, x.typeOf = M, x;
|
|
35
|
+
//#endregion
|
|
36
|
+
//#region src/features/media-player.play-queue.abstractions/interfaces/RepeatMode.ts
|
|
37
|
+
var H = /* @__PURE__ */ function(e) {
|
|
38
|
+
return e.Off = "Off", e.All = "All", e.One = "One", e;
|
|
39
|
+
}({});
|
|
40
|
+
//#endregion
|
|
41
|
+
//#region \0@oxc-project+runtime@0.130.0/helpers/decorate.js
|
|
42
|
+
function U(e, t, n, r) {
|
|
43
|
+
var i = arguments.length, a = i < 3 ? t : r === null ? r = Object.getOwnPropertyDescriptor(t, n) : r, o;
|
|
44
|
+
if (typeof Reflect == "object" && typeof Reflect.decorate == "function") a = Reflect.decorate(e, t, n, r);
|
|
45
|
+
else for (var s = e.length - 1; s >= 0; s--) (o = e[s]) && (a = (i < 3 ? o(a) : i > 3 ? o(t, n, a) : o(t, n)) || a);
|
|
46
|
+
return i > 3 && a && Object.defineProperty(t, n, a), a;
|
|
714
47
|
}
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
var ie = le && le.$$typeof;
|
|
748
|
-
switch (ie) {
|
|
749
|
-
case m:
|
|
750
|
-
case C:
|
|
751
|
-
case z:
|
|
752
|
-
case j:
|
|
753
|
-
case f:
|
|
754
|
-
return ie;
|
|
755
|
-
default:
|
|
756
|
-
return be;
|
|
757
|
-
}
|
|
758
|
-
}
|
|
759
|
-
case n:
|
|
760
|
-
return be;
|
|
761
|
-
}
|
|
762
|
-
}
|
|
763
|
-
}
|
|
764
|
-
var u = h, re = p, Ne = m, De = f, Pe = e, ze = C, Le = i, we = z, H = j, X = n, ne = l, _e = a, Oe = R, he = !1;
|
|
765
|
-
function Ae(d) {
|
|
766
|
-
return he || (he = !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.")), ve(d) || k(d) === h;
|
|
767
|
-
}
|
|
768
|
-
function ve(d) {
|
|
769
|
-
return k(d) === p;
|
|
770
|
-
}
|
|
771
|
-
function ke(d) {
|
|
772
|
-
return k(d) === m;
|
|
773
|
-
}
|
|
774
|
-
function Me(d) {
|
|
775
|
-
return k(d) === f;
|
|
776
|
-
}
|
|
777
|
-
function Fe(d) {
|
|
778
|
-
return typeof d == "object" && d !== null && d.$$typeof === e;
|
|
779
|
-
}
|
|
780
|
-
function Ve(d) {
|
|
781
|
-
return k(d) === C;
|
|
782
|
-
}
|
|
783
|
-
function Ye(d) {
|
|
784
|
-
return k(d) === i;
|
|
785
|
-
}
|
|
786
|
-
function pe(d) {
|
|
787
|
-
return k(d) === z;
|
|
788
|
-
}
|
|
789
|
-
function ye(d) {
|
|
790
|
-
return k(d) === j;
|
|
791
|
-
}
|
|
792
|
-
function ae(d) {
|
|
793
|
-
return k(d) === n;
|
|
794
|
-
}
|
|
795
|
-
function ge(d) {
|
|
796
|
-
return k(d) === l;
|
|
797
|
-
}
|
|
798
|
-
function se(d) {
|
|
799
|
-
return k(d) === a;
|
|
800
|
-
}
|
|
801
|
-
function Be(d) {
|
|
802
|
-
return k(d) === R;
|
|
803
|
-
}
|
|
804
|
-
T.AsyncMode = u, T.ConcurrentMode = re, T.ContextConsumer = Ne, T.ContextProvider = De, T.Element = Pe, T.ForwardRef = ze, T.Fragment = Le, T.Lazy = we, T.Memo = H, T.Portal = X, T.Profiler = ne, T.StrictMode = _e, T.Suspense = Oe, T.isAsyncMode = Ae, T.isConcurrentMode = ve, T.isContextConsumer = ke, T.isContextProvider = Me, T.isElement = Fe, T.isForwardRef = Ve, T.isFragment = Ye, T.isLazy = pe, T.isMemo = ye, T.isPortal = ae, T.isProfiler = ge, T.isStrictMode = se, T.isSuspense = Be, T.isValidElementType = M, T.typeOf = k;
|
|
805
|
-
}()), T;
|
|
806
|
-
}
|
|
807
|
-
process.env.NODE_ENV === "production" ? rt.exports = gn() : rt.exports = bn();
|
|
808
|
-
var En = rt.exports, Bt = En, xn = {
|
|
809
|
-
$$typeof: !0,
|
|
810
|
-
render: !0,
|
|
811
|
-
defaultProps: !0,
|
|
812
|
-
displayName: !0,
|
|
813
|
-
propTypes: !0
|
|
814
|
-
}, Tn = {
|
|
815
|
-
$$typeof: !0,
|
|
816
|
-
compare: !0,
|
|
817
|
-
defaultProps: !0,
|
|
818
|
-
displayName: !0,
|
|
819
|
-
propTypes: !0,
|
|
820
|
-
type: !0
|
|
821
|
-
}, Wt = {};
|
|
822
|
-
Wt[Bt.ForwardRef] = xn;
|
|
823
|
-
Wt[Bt.Memo] = Tn;
|
|
824
|
-
var Cn = !0;
|
|
825
|
-
function Sn(t, e, n) {
|
|
826
|
-
var i = "";
|
|
827
|
-
return n.split(" ").forEach(function(a) {
|
|
828
|
-
t[a] !== void 0 ? e.push(t[a] + ";") : a && (i += a + " ");
|
|
829
|
-
}), i;
|
|
830
|
-
}
|
|
831
|
-
var Ut = function(e, n, i) {
|
|
832
|
-
var a = e.key + "-" + n.name;
|
|
833
|
-
// we only need to add the styles to the registered cache if the
|
|
834
|
-
// class name could be used further down
|
|
835
|
-
// the tree but if it's a string tag, we know it won't
|
|
836
|
-
// so we don't have to add it to registered cache.
|
|
837
|
-
// this improves memory usage since we can avoid storing the whole style string
|
|
838
|
-
(i === !1 || // we need to always store it if we're in compat mode and
|
|
839
|
-
// in node since emotion-server relies on whether a style is in
|
|
840
|
-
// the registered cache to know whether a style is global or not
|
|
841
|
-
// also, note that this check will be dead code eliminated in the browser
|
|
842
|
-
Cn === !1) && e.registered[a] === void 0 && (e.registered[a] = n.styles);
|
|
843
|
-
}, In = function(e, n, i) {
|
|
844
|
-
Ut(e, n, i);
|
|
845
|
-
var a = e.key + "-" + n.name;
|
|
846
|
-
if (e.inserted[n.name] === void 0) {
|
|
847
|
-
var l = n;
|
|
848
|
-
do
|
|
849
|
-
e.insert(n === l ? "." + a : "", l, e.sheet, !0), l = l.next;
|
|
850
|
-
while (l !== void 0);
|
|
851
|
-
}
|
|
48
|
+
//#endregion
|
|
49
|
+
//#region src/features/media-player.bottom-bar/stores/BottomBarStore.ts
|
|
50
|
+
var et = {
|
|
51
|
+
type: "object",
|
|
52
|
+
properties: {
|
|
53
|
+
repeat: {
|
|
54
|
+
type: "string",
|
|
55
|
+
enum: Object.values(H),
|
|
56
|
+
nullable: !0
|
|
57
|
+
},
|
|
58
|
+
shuffle: {
|
|
59
|
+
type: "boolean",
|
|
60
|
+
nullable: !0
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
}, tt = class {
|
|
64
|
+
bottomBar;
|
|
65
|
+
constructor(e) {
|
|
66
|
+
this.bottomBar = e, m(this);
|
|
67
|
+
}
|
|
68
|
+
get state() {
|
|
69
|
+
return {
|
|
70
|
+
repeat: this.bottomBar.repeat,
|
|
71
|
+
shuffle: this.bottomBar.shuffle
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
set state(e) {
|
|
75
|
+
this.bottomBar.repeat = e.repeat ?? H.Off, this.bottomBar.shuffle = e.shuffle ?? !1;
|
|
76
|
+
}
|
|
77
|
+
validateState(e) {
|
|
78
|
+
return $e(et, "BottomBarLocalStorageState")(e);
|
|
79
|
+
}
|
|
852
80
|
};
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
}
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
81
|
+
U([p.struct], tt.prototype, "state", null);
|
|
82
|
+
var W = class {
|
|
83
|
+
player;
|
|
84
|
+
playQueue;
|
|
85
|
+
localStorageState;
|
|
86
|
+
repeat = H.Off;
|
|
87
|
+
shuffle = !1;
|
|
88
|
+
constructor(e, t) {
|
|
89
|
+
this.player = e, this.playQueue = t, m(this), this.localStorageState = new tt(this);
|
|
90
|
+
}
|
|
91
|
+
get controller() {
|
|
92
|
+
return this.player.controller;
|
|
93
|
+
}
|
|
94
|
+
get playing() {
|
|
95
|
+
return this.player.playing;
|
|
96
|
+
}
|
|
97
|
+
get percent() {
|
|
98
|
+
return this.player.percent;
|
|
99
|
+
}
|
|
100
|
+
get canSeek() {
|
|
101
|
+
return !this.playQueue.isEmpty && this.controller.supports("setCurrentTime");
|
|
102
|
+
}
|
|
103
|
+
get currentItem() {
|
|
104
|
+
return this.playQueue.currentItem;
|
|
105
|
+
}
|
|
106
|
+
get canToggleRepeat() {
|
|
107
|
+
return !0;
|
|
108
|
+
}
|
|
109
|
+
get canToggleShuffle() {
|
|
110
|
+
return !1;
|
|
111
|
+
}
|
|
112
|
+
get canPlay() {
|
|
113
|
+
return this.playQueue.canPlay && this.controller.supports("play");
|
|
114
|
+
}
|
|
115
|
+
get canPause() {
|
|
116
|
+
return this.playQueue.canPause && this.controller.supports("pause");
|
|
117
|
+
}
|
|
118
|
+
get canPrevious() {
|
|
119
|
+
return !this.playQueue.isEmpty;
|
|
120
|
+
}
|
|
121
|
+
get canNext() {
|
|
122
|
+
return this.playQueue.hasNextItem;
|
|
123
|
+
}
|
|
124
|
+
get canSkipBack10() {
|
|
125
|
+
return this.canSeek;
|
|
126
|
+
}
|
|
127
|
+
get canSkipForward30() {
|
|
128
|
+
return this.canSeek;
|
|
129
|
+
}
|
|
130
|
+
get canRemoveFromPlayQueue() {
|
|
131
|
+
return !this.playQueue.isEmpty;
|
|
132
|
+
}
|
|
133
|
+
setPercent(e) {
|
|
134
|
+
this.player.setPercent(e);
|
|
135
|
+
}
|
|
136
|
+
setSeeking(e) {
|
|
137
|
+
this.player.setSeeking(e);
|
|
138
|
+
}
|
|
139
|
+
toggleRepeat() {
|
|
140
|
+
switch (this.repeat) {
|
|
141
|
+
case H.Off:
|
|
142
|
+
this.repeat = H.All;
|
|
143
|
+
break;
|
|
144
|
+
case H.All:
|
|
145
|
+
this.repeat = H.One;
|
|
146
|
+
break;
|
|
147
|
+
case H.One:
|
|
148
|
+
this.repeat = H.Off;
|
|
149
|
+
break;
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
toggleShuffle() {
|
|
153
|
+
this.shuffle = !this.shuffle;
|
|
154
|
+
}
|
|
155
|
+
play() {
|
|
156
|
+
return this.controller.play();
|
|
157
|
+
}
|
|
158
|
+
pause() {
|
|
159
|
+
return this.controller.pause();
|
|
160
|
+
}
|
|
161
|
+
async previous() {
|
|
162
|
+
if (this.playQueue.hasPreviousItem) {
|
|
163
|
+
let e = await this.controller.getCurrentTime();
|
|
164
|
+
e === void 0 || e < 5 ? await this.playQueue.previous() : await this.controller.setCurrentTime(0);
|
|
165
|
+
} else await this.controller.setCurrentTime(0);
|
|
166
|
+
}
|
|
167
|
+
next() {
|
|
168
|
+
return this.playQueue.next();
|
|
169
|
+
}
|
|
170
|
+
async skipBack10() {
|
|
171
|
+
let e = await this.controller.getCurrentTime();
|
|
172
|
+
e !== void 0 && await this.controller.setCurrentTime(e - 10);
|
|
173
|
+
}
|
|
174
|
+
async skipForward30() {
|
|
175
|
+
let e = await this.controller.getCurrentTime();
|
|
176
|
+
e !== void 0 && await this.controller.setCurrentTime(e + 30);
|
|
177
|
+
}
|
|
178
|
+
async removeFromPlayQueue() {
|
|
179
|
+
this.currentItem !== void 0 && await this.playQueue.removeItems([this.currentItem]);
|
|
180
|
+
}
|
|
921
181
|
};
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
}
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
182
|
+
U([h], W.prototype, "repeat", void 0), U([h], W.prototype, "shuffle", void 0), U([p], W.prototype, "controller", null), U([p], W.prototype, "playing", null), U([p], W.prototype, "percent", null), U([p], W.prototype, "canSeek", null), U([p], W.prototype, "currentItem", null), U([p], W.prototype, "canToggleRepeat", null), U([p], W.prototype, "canToggleShuffle", null), U([p], W.prototype, "canPlay", null), U([p], W.prototype, "canPause", null), U([p], W.prototype, "canPrevious", null), U([p], W.prototype, "canNext", null), U([p], W.prototype, "canSkipBack10", null), U([p], W.prototype, "canSkipForward30", null), U([p], W.prototype, "canRemoveFromPlayQueue", null), U([f.bound], W.prototype, "setPercent", null), U([f.bound], W.prototype, "setSeeking", null), U([f.bound], W.prototype, "toggleRepeat", null), U([f.bound], W.prototype, "toggleShuffle", null), U([f.bound], W.prototype, "play", null), U([f.bound], W.prototype, "pause", null), U([f.bound], W.prototype, "previous", null), U([f.bound], W.prototype, "next", null), U([f.bound], W.prototype, "skipBack10", null), U([f.bound], W.prototype, "skipForward30", null), U([f.bound], W.prototype, "removeFromPlayQueue", null);
|
|
183
|
+
//#endregion
|
|
184
|
+
//#region src/features/media-player.play-queue.abstractions/contexts/PlayQueueContext.ts
|
|
185
|
+
var nt = r(void 0), G = () => o(nt), rt = r(void 0), it = () => o(rt), at = ({ children: e }) => {
|
|
186
|
+
let n = it(), r = G(), [i] = d(() => new W(n, r));
|
|
187
|
+
return ne(B.bottomBar, i.localStorageState), /* @__PURE__ */ t(Ze.Provider, {
|
|
188
|
+
value: i,
|
|
189
|
+
children: e
|
|
190
|
+
});
|
|
191
|
+
}, ot = r(void 0), st = () => o(ot), K = class {
|
|
192
|
+
player;
|
|
193
|
+
playQueue;
|
|
194
|
+
bottomBar;
|
|
195
|
+
constructor(e, t, n) {
|
|
196
|
+
this.player = e, this.playQueue = t, this.bottomBar = n, m(this);
|
|
197
|
+
}
|
|
198
|
+
get interacted() {
|
|
199
|
+
return this.playQueue.interacted;
|
|
200
|
+
}
|
|
201
|
+
get controller() {
|
|
202
|
+
return this.player.controller;
|
|
203
|
+
}
|
|
204
|
+
get currentItem() {
|
|
205
|
+
return this.playQueue.currentItem;
|
|
206
|
+
}
|
|
207
|
+
async onLoaded() {
|
|
208
|
+
this.interacted && await this.controller.play();
|
|
209
|
+
}
|
|
210
|
+
onPlay() {
|
|
211
|
+
this.player.onPlay();
|
|
212
|
+
}
|
|
213
|
+
onPause() {
|
|
214
|
+
this.player.onPause();
|
|
215
|
+
}
|
|
216
|
+
async onEnded() {
|
|
217
|
+
switch (this.bottomBar.repeat) {
|
|
218
|
+
case H.One:
|
|
219
|
+
await this.controller.setCurrentTime(0);
|
|
220
|
+
break;
|
|
221
|
+
case H.Off:
|
|
222
|
+
case H.All:
|
|
223
|
+
if (this.playQueue.isLastItem) switch (this.bottomBar.repeat) {
|
|
224
|
+
case H.Off:
|
|
225
|
+
this.player.onEnded();
|
|
226
|
+
break;
|
|
227
|
+
case H.All:
|
|
228
|
+
this.playQueue.hasMultipleItems ? await this.playQueue.goToFirst() : await this.controller.setCurrentTime(0);
|
|
229
|
+
break;
|
|
230
|
+
}
|
|
231
|
+
else await this.playQueue.next();
|
|
232
|
+
break;
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
onTimeUpdate(e) {
|
|
236
|
+
this.player.onTimeUpdate(e);
|
|
237
|
+
}
|
|
238
|
+
onControllerChange(e) {
|
|
239
|
+
this.player.onControllerChange(e);
|
|
240
|
+
}
|
|
948
241
|
};
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
}
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
}
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
)
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
}
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
var h = {};
|
|
1086
|
-
for (var p in t)
|
|
1087
|
-
je.call(t, p) && p !== "css" && p !== nt && (h[p] = t[p]);
|
|
1088
|
-
return h.className = f, n && (h.ref = n), /* @__PURE__ */ Z.createElement(Z.Fragment, null, /* @__PURE__ */ Z.createElement(Dn, {
|
|
1089
|
-
cache: e,
|
|
1090
|
-
serialized: m,
|
|
1091
|
-
isStringTag: typeof a == "string"
|
|
1092
|
-
}), /* @__PURE__ */ Z.createElement(a, h));
|
|
1093
|
-
}), Jt = zn, Re = Se.Fragment, o = function(e, n, i) {
|
|
1094
|
-
return je.call(n, "css") ? Se.jsx(Jt, Gt(e, n), i) : Se.jsx(e, n, i);
|
|
1095
|
-
}, O = function(e, n, i) {
|
|
1096
|
-
return je.call(n, "css") ? Se.jsxs(Jt, Gt(e, n), i) : Se.jsxs(e, n, i);
|
|
1097
|
-
}, I = /* @__PURE__ */ ((t) => (t.Off = "Off", t.All = "All", t.One = "One", t))(I || {});
|
|
1098
|
-
const Kt = 80, Ln = D(({ playerStore: t }) => {
|
|
1099
|
-
const e = te(), n = $(
|
|
1100
|
-
(l) => {
|
|
1101
|
-
const f = Number(l.currentTarget.value) / 100;
|
|
1102
|
-
t.setPercent(f);
|
|
1103
|
-
},
|
|
1104
|
-
[t]
|
|
1105
|
-
), i = $(
|
|
1106
|
-
(l) => {
|
|
1107
|
-
l.button === 0 && t.setSeeking(!0);
|
|
1108
|
-
},
|
|
1109
|
-
[t]
|
|
1110
|
-
), a = $(
|
|
1111
|
-
async (l) => {
|
|
1112
|
-
if (l.button === 0) {
|
|
1113
|
-
const f = Number(l.currentTarget.value) / 100;
|
|
1114
|
-
t.setSeeking(!1);
|
|
1115
|
-
const m = await e.getDuration();
|
|
1116
|
-
m !== void 0 && await e.setCurrentTime(m * f);
|
|
1117
|
-
}
|
|
1118
|
-
},
|
|
1119
|
-
[t, e]
|
|
1120
|
-
);
|
|
1121
|
-
return /* @__PURE__ */ o(
|
|
1122
|
-
Nt,
|
|
1123
|
-
{
|
|
1124
|
-
min: 0,
|
|
1125
|
-
max: 100,
|
|
1126
|
-
step: 1e-7,
|
|
1127
|
-
value: t.percent * 100,
|
|
1128
|
-
onChange: n,
|
|
1129
|
-
onMouseDown: i,
|
|
1130
|
-
onMouseUp: a,
|
|
1131
|
-
fullWidth: !0,
|
|
1132
|
-
showRange: !0,
|
|
1133
|
-
css: { blockSize: 32 }
|
|
1134
|
-
}
|
|
1135
|
-
);
|
|
1136
|
-
}), Vn = K(
|
|
1137
|
-
({ button: t, isOpen: e, closePopover: n }) => {
|
|
1138
|
-
const [i, a] = Y("0"), l = te();
|
|
1139
|
-
Ir(() => {
|
|
1140
|
-
e && l.getVolume().then((m) => {
|
|
1141
|
-
m !== void 0 && a(Math.floor(m * 100).toString());
|
|
1142
|
-
});
|
|
1143
|
-
}, [e, l]);
|
|
1144
|
-
const f = $(
|
|
1145
|
-
async (m) => {
|
|
1146
|
-
a(m.currentTarget.value), await l.setVolume(Number(m.currentTarget.value) / 100);
|
|
1147
|
-
},
|
|
1148
|
-
[l]
|
|
1149
|
-
);
|
|
1150
|
-
return /* @__PURE__ */ o(
|
|
1151
|
-
st,
|
|
1152
|
-
{
|
|
1153
|
-
button: t,
|
|
1154
|
-
isOpen: e,
|
|
1155
|
-
closePopover: n,
|
|
1156
|
-
anchorPosition: "upRight",
|
|
1157
|
-
children: /* @__PURE__ */ o(Ze, { children: /* @__PURE__ */ O(
|
|
1158
|
-
de,
|
|
1159
|
-
{
|
|
1160
|
-
responsive: !1,
|
|
1161
|
-
gutterSize: "s",
|
|
1162
|
-
justifyContent: "center",
|
|
1163
|
-
alignItems: "center",
|
|
1164
|
-
children: [
|
|
1165
|
-
/* @__PURE__ */ o(
|
|
1166
|
-
G,
|
|
1167
|
-
{
|
|
1168
|
-
title: "Mute",
|
|
1169
|
-
"aria-label": "Mute",
|
|
1170
|
-
iconType: Vt,
|
|
1171
|
-
size: "s",
|
|
1172
|
-
iconSize: "l"
|
|
1173
|
-
}
|
|
1174
|
-
),
|
|
1175
|
-
/* @__PURE__ */ o(
|
|
1176
|
-
Nt,
|
|
1177
|
-
{
|
|
1178
|
-
min: 0,
|
|
1179
|
-
max: 100,
|
|
1180
|
-
step: 1,
|
|
1181
|
-
value: i,
|
|
1182
|
-
onChange: f,
|
|
1183
|
-
css: { blockSize: 32 }
|
|
1184
|
-
}
|
|
1185
|
-
)
|
|
1186
|
-
]
|
|
1187
|
-
}
|
|
1188
|
-
) })
|
|
1189
|
-
}
|
|
1190
|
-
);
|
|
1191
|
-
}
|
|
1192
|
-
), Yn = K(
|
|
1193
|
-
({
|
|
1194
|
-
playQueueStore: t,
|
|
1195
|
-
closePopover: e
|
|
1196
|
-
}) => {
|
|
1197
|
-
const n = te(), i = $(async () => {
|
|
1198
|
-
const p = await n.getCurrentTime();
|
|
1199
|
-
p !== void 0 && await n.setCurrentTime(p - 10), e();
|
|
1200
|
-
}, [n, e]), a = $(async () => {
|
|
1201
|
-
const p = await n.getCurrentTime();
|
|
1202
|
-
p !== void 0 && await n.setCurrentTime(p + 30), e();
|
|
1203
|
-
}, [n, e]), l = $(
|
|
1204
|
-
async (p) => {
|
|
1205
|
-
await n.setPlaybackRate(p), e();
|
|
1206
|
-
},
|
|
1207
|
-
[n, e]
|
|
1208
|
-
), f = $(async () => {
|
|
1209
|
-
t.currentItem !== void 0 && await t.removeItems([
|
|
1210
|
-
t.currentItem
|
|
1211
|
-
]), e();
|
|
1212
|
-
}, [t, e]), [m] = Y(), h = $t(
|
|
1213
|
-
() => [
|
|
1214
|
-
{
|
|
1215
|
-
id: 0,
|
|
1216
|
-
items: [
|
|
1217
|
-
{
|
|
1218
|
-
name: "Speed",
|
|
1219
|
-
icon: /* @__PURE__ */ o(W, { type: on, size: "m" }),
|
|
1220
|
-
panel: 1
|
|
1221
|
-
},
|
|
1222
|
-
{
|
|
1223
|
-
name: "Skip back 10 seconds",
|
|
1224
|
-
icon: /* @__PURE__ */ o(W, { type: an, size: "m" }),
|
|
1225
|
-
onClick: i,
|
|
1226
|
-
disabled: t.isEmpty
|
|
1227
|
-
},
|
|
1228
|
-
{
|
|
1229
|
-
name: "Skip forward 30 seconds",
|
|
1230
|
-
icon: /* @__PURE__ */ o(W, { type: sn, size: "m" }),
|
|
1231
|
-
onClick: a,
|
|
1232
|
-
disabled: t.isEmpty
|
|
1233
|
-
},
|
|
1234
|
-
{
|
|
1235
|
-
isSeparator: !0
|
|
1236
|
-
},
|
|
1237
|
-
{
|
|
1238
|
-
name: "Remove from play queue",
|
|
1239
|
-
icon: /* @__PURE__ */ o(W, { type: lt, size: "m" }),
|
|
1240
|
-
onClick: f,
|
|
1241
|
-
disabled: t.isEmpty
|
|
1242
|
-
}
|
|
1243
|
-
]
|
|
1244
|
-
},
|
|
1245
|
-
{
|
|
1246
|
-
id: 1,
|
|
1247
|
-
title: "Speed",
|
|
1248
|
-
items: [0.25, 0.5, 0.75, 1, 1.25, 1.5, 1.75, 2].map(
|
|
1249
|
-
(p) => ({
|
|
1250
|
-
name: p.toString(),
|
|
1251
|
-
onClick: () => l(p),
|
|
1252
|
-
icon: p === m ? "check" : "empty"
|
|
1253
|
-
})
|
|
1254
|
-
)
|
|
1255
|
-
}
|
|
1256
|
-
],
|
|
1257
|
-
[
|
|
1258
|
-
t,
|
|
1259
|
-
i,
|
|
1260
|
-
a,
|
|
1261
|
-
f,
|
|
1262
|
-
l,
|
|
1263
|
-
m
|
|
1264
|
-
]
|
|
1265
|
-
);
|
|
1266
|
-
return /* @__PURE__ */ o(Ar, { initialPanelId: 0, panels: h });
|
|
1267
|
-
}
|
|
1268
|
-
), Bn = K(
|
|
1269
|
-
({
|
|
1270
|
-
playQueueStore: t,
|
|
1271
|
-
button: e,
|
|
1272
|
-
isOpen: n,
|
|
1273
|
-
closePopover: i
|
|
1274
|
-
}) => /* @__PURE__ */ o(
|
|
1275
|
-
st,
|
|
1276
|
-
{
|
|
1277
|
-
button: e,
|
|
1278
|
-
isOpen: n,
|
|
1279
|
-
closePopover: i,
|
|
1280
|
-
panelPaddingSize: "none",
|
|
1281
|
-
anchorPosition: "upRight",
|
|
1282
|
-
children: /* @__PURE__ */ o(
|
|
1283
|
-
Yn,
|
|
1284
|
-
{
|
|
1285
|
-
playQueueStore: t,
|
|
1286
|
-
closePopover: i
|
|
1287
|
-
}
|
|
1288
|
-
)
|
|
1289
|
-
}
|
|
1290
|
-
)
|
|
1291
|
-
), Wn = {
|
|
1292
|
-
[I.Off]: Xr,
|
|
1293
|
-
[I.All]: Kr,
|
|
1294
|
-
[I.One]: Jr
|
|
1295
|
-
}, Un = D(
|
|
1296
|
-
({
|
|
1297
|
-
playerStore: t,
|
|
1298
|
-
playQueueStore: e
|
|
1299
|
-
}) => {
|
|
1300
|
-
const n = te(), i = $(async () => {
|
|
1301
|
-
if (e.hasPreviousItem) {
|
|
1302
|
-
const a = await n.getCurrentTime();
|
|
1303
|
-
a === void 0 || a < 5 ? await e.previous() : await n.setCurrentTime(0);
|
|
1304
|
-
} else
|
|
1305
|
-
await n.setCurrentTime(0);
|
|
1306
|
-
}, [e, n]);
|
|
1307
|
-
return /* @__PURE__ */ O(
|
|
1308
|
-
de,
|
|
1309
|
-
{
|
|
1310
|
-
responsive: !1,
|
|
1311
|
-
gutterSize: "s",
|
|
1312
|
-
justifyContent: "center",
|
|
1313
|
-
alignItems: "center",
|
|
1314
|
-
children: [
|
|
1315
|
-
/* @__PURE__ */ o(
|
|
1316
|
-
G,
|
|
1317
|
-
{
|
|
1318
|
-
title: `Shuffle: ${e.shuffle ? "On" : "Off"}`,
|
|
1319
|
-
"aria-label": `Shuffle: ${e.shuffle ? "On" : "Off"}`,
|
|
1320
|
-
iconType: e.shuffle ? Zr : Qr,
|
|
1321
|
-
size: "s",
|
|
1322
|
-
iconSize: "l",
|
|
1323
|
-
onClick: e.toggleShuffle,
|
|
1324
|
-
disabled: !0
|
|
1325
|
-
}
|
|
1326
|
-
),
|
|
1327
|
-
/* @__PURE__ */ o(
|
|
1328
|
-
G,
|
|
1329
|
-
{
|
|
1330
|
-
title: "Previous",
|
|
1331
|
-
"aria-label": "Previous",
|
|
1332
|
-
iconType: en,
|
|
1333
|
-
size: "s",
|
|
1334
|
-
iconSize: "l",
|
|
1335
|
-
onClick: i,
|
|
1336
|
-
disabled: e.isEmpty
|
|
1337
|
-
}
|
|
1338
|
-
),
|
|
1339
|
-
t.playing ? /* @__PURE__ */ o(
|
|
1340
|
-
G,
|
|
1341
|
-
{
|
|
1342
|
-
title: "Pause",
|
|
1343
|
-
"aria-label": "Pause",
|
|
1344
|
-
iconType: tn,
|
|
1345
|
-
size: "s",
|
|
1346
|
-
iconSize: "l",
|
|
1347
|
-
onClick: () => n.pause(),
|
|
1348
|
-
disabled: !e.canPlay
|
|
1349
|
-
}
|
|
1350
|
-
) : /* @__PURE__ */ o(
|
|
1351
|
-
G,
|
|
1352
|
-
{
|
|
1353
|
-
title: "Play",
|
|
1354
|
-
"aria-label": "Play",
|
|
1355
|
-
iconType: rn,
|
|
1356
|
-
size: "s",
|
|
1357
|
-
iconSize: "l",
|
|
1358
|
-
onClick: () => n.play(),
|
|
1359
|
-
disabled: !e.canPlay
|
|
1360
|
-
}
|
|
1361
|
-
),
|
|
1362
|
-
/* @__PURE__ */ o(
|
|
1363
|
-
G,
|
|
1364
|
-
{
|
|
1365
|
-
title: "Next",
|
|
1366
|
-
"aria-label": "Next",
|
|
1367
|
-
iconType: nn,
|
|
1368
|
-
size: "s",
|
|
1369
|
-
iconSize: "l",
|
|
1370
|
-
onClick: e.next,
|
|
1371
|
-
disabled: !e.hasNextItem
|
|
1372
|
-
}
|
|
1373
|
-
),
|
|
1374
|
-
/* @__PURE__ */ o(
|
|
1375
|
-
G,
|
|
1376
|
-
{
|
|
1377
|
-
title: `Repeat: ${e.repeat === I.All ? "All" : e.repeat === I.One ? "One" : "Off"}`,
|
|
1378
|
-
"aria-label": `Repeat: ${e.repeat === I.All ? "All" : e.repeat === I.One ? "One" : "Off"}`,
|
|
1379
|
-
iconType: Wn[e.repeat],
|
|
1380
|
-
size: "s",
|
|
1381
|
-
iconSize: "l",
|
|
1382
|
-
onClick: e.toggleRepeat
|
|
1383
|
-
}
|
|
1384
|
-
)
|
|
1385
|
-
]
|
|
1386
|
-
}
|
|
1387
|
-
);
|
|
1388
|
-
}
|
|
1389
|
-
), qn = K(() => {
|
|
1390
|
-
const [t, e] = Y(!1);
|
|
1391
|
-
return /* @__PURE__ */ o(
|
|
1392
|
-
Vn,
|
|
1393
|
-
{
|
|
1394
|
-
button: /* @__PURE__ */ o(
|
|
1395
|
-
G,
|
|
1396
|
-
{
|
|
1397
|
-
title: "Volume",
|
|
1398
|
-
"aria-label": "Volume",
|
|
1399
|
-
iconType: Vt,
|
|
1400
|
-
size: "s",
|
|
1401
|
-
iconSize: "l",
|
|
1402
|
-
onClick: () => e(!t)
|
|
1403
|
-
}
|
|
1404
|
-
),
|
|
1405
|
-
isOpen: t,
|
|
1406
|
-
closePopover: () => e(!1)
|
|
1407
|
-
}
|
|
1408
|
-
);
|
|
1409
|
-
}), Hn = K(
|
|
1410
|
-
({ playQueueStore: t }) => {
|
|
1411
|
-
const [e, n] = Y(!1);
|
|
1412
|
-
return /* @__PURE__ */ o(
|
|
1413
|
-
Bn,
|
|
1414
|
-
{
|
|
1415
|
-
playQueueStore: t,
|
|
1416
|
-
button: /* @__PURE__ */ o(
|
|
1417
|
-
G,
|
|
1418
|
-
{
|
|
1419
|
-
title: "More options",
|
|
1420
|
-
"aria-label": "More options",
|
|
1421
|
-
iconType: Yt,
|
|
1422
|
-
size: "s",
|
|
1423
|
-
iconSize: "l",
|
|
1424
|
-
onClick: () => n(!e)
|
|
1425
|
-
}
|
|
1426
|
-
),
|
|
1427
|
-
isOpen: e,
|
|
1428
|
-
closePopover: () => n(!1)
|
|
1429
|
-
}
|
|
1430
|
-
);
|
|
1431
|
-
}
|
|
1432
|
-
), Gn = K(
|
|
1433
|
-
({ playQueueStore: t }) => /* @__PURE__ */ O(
|
|
1434
|
-
de,
|
|
1435
|
-
{
|
|
1436
|
-
responsive: !1,
|
|
1437
|
-
gutterSize: "s",
|
|
1438
|
-
justifyContent: "flexEnd",
|
|
1439
|
-
alignItems: "center",
|
|
1440
|
-
children: [
|
|
1441
|
-
/* @__PURE__ */ o(qn, {}),
|
|
1442
|
-
/* @__PURE__ */ o(Hn, { playQueueStore: t })
|
|
1443
|
-
]
|
|
1444
|
-
}
|
|
1445
|
-
)
|
|
1446
|
-
), Ii = D(
|
|
1447
|
-
({ playerStore: t, playQueueStore: e }) => /* @__PURE__ */ o(Or, { paddingSize: "s", children: /* @__PURE__ */ O(de, { direction: "column", gutterSize: "none", children: [
|
|
1448
|
-
/* @__PURE__ */ o(U, { children: /* @__PURE__ */ o(Ln, { playerStore: t }) }),
|
|
1449
|
-
/* @__PURE__ */ o(U, { children: /* @__PURE__ */ O(de, { responsive: !1, children: [
|
|
1450
|
-
/* @__PURE__ */ o(U, { css: { width: "calc(100% / 3)" } }),
|
|
1451
|
-
/* @__PURE__ */ o(U, { css: { width: "calc(100% / 3)" }, children: /* @__PURE__ */ o(
|
|
1452
|
-
Un,
|
|
1453
|
-
{
|
|
1454
|
-
playerStore: t,
|
|
1455
|
-
playQueueStore: e
|
|
1456
|
-
}
|
|
1457
|
-
) }),
|
|
1458
|
-
/* @__PURE__ */ o(U, { css: { width: "calc(100% / 3)" }, children: /* @__PURE__ */ o(
|
|
1459
|
-
Gn,
|
|
1460
|
-
{
|
|
1461
|
-
playQueueStore: e
|
|
1462
|
-
}
|
|
1463
|
-
) })
|
|
1464
|
-
] }) })
|
|
1465
|
-
] }) })
|
|
1466
|
-
), Jn = ({
|
|
1467
|
-
onCancel: t,
|
|
1468
|
-
onSave: e
|
|
1469
|
-
}) => {
|
|
1470
|
-
const [n, i] = Y(""), [a, l] = Y(""), [f, m] = Y(!1);
|
|
1471
|
-
return /* @__PURE__ */ O(Dr, { onClose: t, initialFocus: "[name=url]", children: [
|
|
1472
|
-
/* @__PURE__ */ o(Mr, { children: /* @__PURE__ */ o(kr, { children: "Add video" }) }),
|
|
1473
|
-
/* @__PURE__ */ o($r, { children: /* @__PURE__ */ O(Fr, { component: "form", children: [
|
|
1474
|
-
/* @__PURE__ */ o(Ze, { label: "URL", children: /* @__PURE__ */ o(
|
|
1475
|
-
St,
|
|
1476
|
-
{
|
|
1477
|
-
name: "url",
|
|
1478
|
-
value: n,
|
|
1479
|
-
onChange: (h) => i(h.target.value)
|
|
1480
|
-
}
|
|
1481
|
-
) }),
|
|
1482
|
-
/* @__PURE__ */ o(Ze, { label: "Title", children: /* @__PURE__ */ o(
|
|
1483
|
-
St,
|
|
1484
|
-
{
|
|
1485
|
-
name: "title",
|
|
1486
|
-
value: a,
|
|
1487
|
-
onChange: (h) => l(h.target.value)
|
|
1488
|
-
}
|
|
1489
|
-
) })
|
|
1490
|
-
] }) }),
|
|
1491
|
-
/* @__PURE__ */ O(jr, { children: [
|
|
1492
|
-
/* @__PURE__ */ o(Nr, { onClick: t, children: "Cancel" }),
|
|
1493
|
-
/* @__PURE__ */ o(
|
|
1494
|
-
ee,
|
|
1495
|
-
{
|
|
1496
|
-
type: "submit",
|
|
1497
|
-
onClick: async () => {
|
|
1498
|
-
try {
|
|
1499
|
-
m(!0), await e({ url: n, title: a });
|
|
1500
|
-
} finally {
|
|
1501
|
-
m(!1);
|
|
1502
|
-
}
|
|
1503
|
-
},
|
|
1504
|
-
fill: !0,
|
|
1505
|
-
disabled: n.trim().length === 0,
|
|
1506
|
-
isLoading: f,
|
|
1507
|
-
children: "Save"
|
|
1508
|
-
}
|
|
1509
|
-
)
|
|
1510
|
-
] })
|
|
1511
|
-
] });
|
|
242
|
+
U([p], K.prototype, "interacted", null), U([p], K.prototype, "controller", null), U([p], K.prototype, "currentItem", null), U([f.bound], K.prototype, "onLoaded", null), U([f.bound], K.prototype, "onPlay", null), U([f.bound], K.prototype, "onPause", null), U([f.bound], K.prototype, "onEnded", null), U([f.bound], K.prototype, "onTimeUpdate", null), U([f.bound], K.prototype, "onControllerChange", null);
|
|
243
|
+
//#endregion
|
|
244
|
+
//#region src/features/media-player.mini-player/components/MiniPlayerProvider.tsx
|
|
245
|
+
var ct = ({ children: e }) => {
|
|
246
|
+
let n = it(), r = G(), i = V(), [a] = d(() => new K(n, r, i));
|
|
247
|
+
return /* @__PURE__ */ t(ot.Provider, {
|
|
248
|
+
value: a,
|
|
249
|
+
children: e
|
|
250
|
+
});
|
|
251
|
+
}, lt = {
|
|
252
|
+
type: "object",
|
|
253
|
+
properties: {
|
|
254
|
+
url: { type: "string" },
|
|
255
|
+
type: { type: "string" },
|
|
256
|
+
videoId: { type: "string" },
|
|
257
|
+
title: { type: "string" }
|
|
258
|
+
},
|
|
259
|
+
required: [
|
|
260
|
+
"url",
|
|
261
|
+
"type",
|
|
262
|
+
"videoId",
|
|
263
|
+
"title"
|
|
264
|
+
]
|
|
265
|
+
}, ut = {
|
|
266
|
+
type: "object",
|
|
267
|
+
properties: {
|
|
268
|
+
version: {
|
|
269
|
+
type: "string",
|
|
270
|
+
nullable: !0
|
|
271
|
+
},
|
|
272
|
+
repeat: {
|
|
273
|
+
type: "string",
|
|
274
|
+
enum: Object.values(H),
|
|
275
|
+
nullable: !0
|
|
276
|
+
},
|
|
277
|
+
shuffle: {
|
|
278
|
+
type: "boolean",
|
|
279
|
+
nullable: !0
|
|
280
|
+
},
|
|
281
|
+
items: {
|
|
282
|
+
type: "array",
|
|
283
|
+
nullable: !0,
|
|
284
|
+
items: lt
|
|
285
|
+
},
|
|
286
|
+
currentIndex: {
|
|
287
|
+
type: "integer",
|
|
288
|
+
nullable: !0
|
|
289
|
+
}
|
|
290
|
+
}
|
|
291
|
+
}, q = class e {
|
|
292
|
+
playQueue;
|
|
293
|
+
dto;
|
|
294
|
+
static nextId = 1;
|
|
295
|
+
id;
|
|
296
|
+
isSelected = !1;
|
|
297
|
+
constructor(t, n) {
|
|
298
|
+
this.playQueue = t, this.dto = n, m(this), this.id = e.nextId++;
|
|
299
|
+
}
|
|
300
|
+
static fromDto(t, n) {
|
|
301
|
+
return new e(t, n);
|
|
302
|
+
}
|
|
303
|
+
get url() {
|
|
304
|
+
return this.dto.url;
|
|
305
|
+
}
|
|
306
|
+
get type() {
|
|
307
|
+
return this.dto.type;
|
|
308
|
+
}
|
|
309
|
+
get videoId() {
|
|
310
|
+
return this.dto.videoId;
|
|
311
|
+
}
|
|
312
|
+
get title() {
|
|
313
|
+
return this.dto.title;
|
|
314
|
+
}
|
|
315
|
+
get isCurrent() {
|
|
316
|
+
return this.playQueue.currentItem === this;
|
|
317
|
+
}
|
|
318
|
+
get index() {
|
|
319
|
+
return this.playQueue.items.indexOf(this);
|
|
320
|
+
}
|
|
321
|
+
get isFirst() {
|
|
322
|
+
return this.index === 0;
|
|
323
|
+
}
|
|
324
|
+
get isLast() {
|
|
325
|
+
return this.index === this.playQueue.items.length - 1;
|
|
326
|
+
}
|
|
327
|
+
get canMoveToTop() {
|
|
328
|
+
return !this.isFirst;
|
|
329
|
+
}
|
|
330
|
+
get canMoveToBottom() {
|
|
331
|
+
return !this.isLast;
|
|
332
|
+
}
|
|
333
|
+
get canRemoveToTop() {
|
|
334
|
+
return !this.isFirst;
|
|
335
|
+
}
|
|
336
|
+
get canRemoveOthers() {
|
|
337
|
+
return this.playQueue.hasMultipleItems;
|
|
338
|
+
}
|
|
339
|
+
clone() {
|
|
340
|
+
return this.playQueue.createItemFromDto(this.dto);
|
|
341
|
+
}
|
|
342
|
+
unselect() {
|
|
343
|
+
this.isSelected = !1;
|
|
344
|
+
}
|
|
345
|
+
select() {
|
|
346
|
+
this.isSelected = !0;
|
|
347
|
+
}
|
|
348
|
+
toggleSelected() {
|
|
349
|
+
this.isSelected = !this.isSelected;
|
|
350
|
+
}
|
|
351
|
+
play() {
|
|
352
|
+
return this.playQueue.setCurrentItem(this), Promise.resolve();
|
|
353
|
+
}
|
|
354
|
+
remove() {
|
|
355
|
+
return this.playQueue.removeItems([this]);
|
|
356
|
+
}
|
|
357
|
+
playFirst() {
|
|
358
|
+
return this.playQueue.playFirst([this.clone()]);
|
|
359
|
+
}
|
|
360
|
+
playNext() {
|
|
361
|
+
return this.playQueue.playNext([this.clone()]);
|
|
362
|
+
}
|
|
363
|
+
addToPlayQueue() {
|
|
364
|
+
return this.playQueue.addItems([this.clone()]);
|
|
365
|
+
}
|
|
366
|
+
moveToTop() {
|
|
367
|
+
this.playQueue.moveItem(this, 0);
|
|
368
|
+
}
|
|
369
|
+
moveToBottom() {
|
|
370
|
+
this.playQueue.moveItem(this, this.playQueue.items.length - 1);
|
|
371
|
+
}
|
|
372
|
+
removeToTop() {
|
|
373
|
+
return this.playQueue.removeItemsAbove(this);
|
|
374
|
+
}
|
|
375
|
+
removeOthers() {
|
|
376
|
+
return this.playQueue.removeOtherItems(this);
|
|
377
|
+
}
|
|
1512
378
|
};
|
|
1513
|
-
|
|
1514
|
-
|
|
1515
|
-
|
|
1516
|
-
|
|
1517
|
-
|
|
1518
|
-
|
|
1519
|
-
|
|
1520
|
-
|
|
1521
|
-
|
|
1522
|
-
|
|
1523
|
-
|
|
1524
|
-
|
|
1525
|
-
|
|
1526
|
-
|
|
1527
|
-
|
|
1528
|
-
|
|
1529
|
-
|
|
1530
|
-
|
|
1531
|
-
|
|
1532
|
-
|
|
1533
|
-
|
|
1534
|
-
title: a.title || (Kn(h) ? h.title : f)
|
|
1535
|
-
})
|
|
1536
|
-
]);
|
|
1537
|
-
}
|
|
1538
|
-
}
|
|
1539
|
-
n(!1);
|
|
1540
|
-
},
|
|
1541
|
-
[t]
|
|
1542
|
-
);
|
|
1543
|
-
return /* @__PURE__ */ O(Re, { children: [
|
|
1544
|
-
/* @__PURE__ */ o(
|
|
1545
|
-
ee,
|
|
1546
|
-
{
|
|
1547
|
-
onClick: () => n(!0),
|
|
1548
|
-
iconType: ct,
|
|
1549
|
-
color: "primary",
|
|
1550
|
-
children: "Add video"
|
|
1551
|
-
}
|
|
1552
|
-
),
|
|
1553
|
-
e && /* @__PURE__ */ o(
|
|
1554
|
-
Jn,
|
|
1555
|
-
{
|
|
1556
|
-
onCancel: () => n(!1),
|
|
1557
|
-
onSave: i
|
|
1558
|
-
}
|
|
1559
|
-
)
|
|
1560
|
-
] });
|
|
1561
|
-
}
|
|
1562
|
-
), Zn = D(
|
|
1563
|
-
({ playQueueStore: t }) => {
|
|
1564
|
-
const { euiTheme: e } = Dt();
|
|
1565
|
-
return /* @__PURE__ */ O(
|
|
1566
|
-
Lr,
|
|
1567
|
-
{
|
|
1568
|
-
style: {
|
|
1569
|
-
position: "sticky",
|
|
1570
|
-
top: 112,
|
|
1571
|
-
zIndex: 998,
|
|
1572
|
-
background: e.colors.backgroundBasePlain
|
|
1573
|
-
},
|
|
1574
|
-
children: [
|
|
1575
|
-
/* @__PURE__ */ o(zr, { children: /* @__PURE__ */ o(
|
|
1576
|
-
zt,
|
|
1577
|
-
{
|
|
1578
|
-
id: "",
|
|
1579
|
-
checked: t.allItemsSelected,
|
|
1580
|
-
onChange: (n) => {
|
|
1581
|
-
t.allItemsSelected = n.target.checked;
|
|
1582
|
-
}
|
|
1583
|
-
}
|
|
1584
|
-
) }),
|
|
1585
|
-
/* @__PURE__ */ o(Je, { width: 24 }),
|
|
1586
|
-
/* @__PURE__ */ o(Je, { children: "Title" }),
|
|
1587
|
-
/* @__PURE__ */ o(Je, {})
|
|
1588
|
-
]
|
|
1589
|
-
}
|
|
1590
|
-
);
|
|
1591
|
-
}
|
|
1592
|
-
), Qn = K(
|
|
1593
|
-
({
|
|
1594
|
-
item: t,
|
|
1595
|
-
closePopover: e
|
|
1596
|
-
}) => {
|
|
1597
|
-
const n = K(
|
|
1598
|
-
({
|
|
1599
|
-
onClick: i,
|
|
1600
|
-
...a
|
|
1601
|
-
}) => {
|
|
1602
|
-
const l = $(
|
|
1603
|
-
(f) => {
|
|
1604
|
-
e(), i == null || i(f);
|
|
1605
|
-
},
|
|
1606
|
-
[i]
|
|
1607
|
-
);
|
|
1608
|
-
return /* @__PURE__ */ o(Vr, { ...a, onClick: l });
|
|
1609
|
-
}
|
|
1610
|
-
);
|
|
1611
|
-
return /* @__PURE__ */ O(Yr, { children: [
|
|
1612
|
-
/* @__PURE__ */ o(
|
|
1613
|
-
n,
|
|
1614
|
-
{
|
|
1615
|
-
icon: /* @__PURE__ */ o(W, { type: "" }),
|
|
1616
|
-
onClick: t.playFirst,
|
|
1617
|
-
children: "Play first"
|
|
1618
|
-
}
|
|
1619
|
-
),
|
|
1620
|
-
/* @__PURE__ */ o(
|
|
1621
|
-
n,
|
|
1622
|
-
{
|
|
1623
|
-
icon: /* @__PURE__ */ o(W, { type: "" }),
|
|
1624
|
-
onClick: t.playNext,
|
|
1625
|
-
children: "Play next"
|
|
1626
|
-
}
|
|
1627
|
-
),
|
|
1628
|
-
/* @__PURE__ */ o(
|
|
1629
|
-
n,
|
|
1630
|
-
{
|
|
1631
|
-
icon: /* @__PURE__ */ o(W, { type: ct }),
|
|
1632
|
-
onClick: t.addToPlayQueue,
|
|
1633
|
-
children: "Add to play queue"
|
|
1634
|
-
}
|
|
1635
|
-
),
|
|
1636
|
-
/* @__PURE__ */ o(It, { margin: "none" }),
|
|
1637
|
-
/* @__PURE__ */ o(
|
|
1638
|
-
n,
|
|
1639
|
-
{
|
|
1640
|
-
icon: /* @__PURE__ */ o(W, { type: ln }),
|
|
1641
|
-
onClick: t.moveToTop,
|
|
1642
|
-
disabled: !t.canMoveToTop,
|
|
1643
|
-
children: "Move to the top"
|
|
1644
|
-
}
|
|
1645
|
-
),
|
|
1646
|
-
/* @__PURE__ */ o(
|
|
1647
|
-
n,
|
|
1648
|
-
{
|
|
1649
|
-
icon: /* @__PURE__ */ o(W, { type: cn }),
|
|
1650
|
-
onClick: t.moveToBottom,
|
|
1651
|
-
disabled: !t.canMoveToBottom,
|
|
1652
|
-
children: "Move to the bottom"
|
|
1653
|
-
}
|
|
1654
|
-
),
|
|
1655
|
-
/* @__PURE__ */ o(It, { margin: "none" }),
|
|
1656
|
-
/* @__PURE__ */ o(
|
|
1657
|
-
n,
|
|
1658
|
-
{
|
|
1659
|
-
icon: /* @__PURE__ */ o(W, { type: "" }),
|
|
1660
|
-
onClick: t.removeToTop,
|
|
1661
|
-
disabled: !t.canRemoveToTop,
|
|
1662
|
-
children: "Remove to the top"
|
|
1663
|
-
}
|
|
1664
|
-
),
|
|
1665
|
-
/* @__PURE__ */ o(
|
|
1666
|
-
n,
|
|
1667
|
-
{
|
|
1668
|
-
icon: /* @__PURE__ */ o(W, { type: "" }),
|
|
1669
|
-
onClick: t.removeOthers,
|
|
1670
|
-
disabled: !t.canRemoveOthers,
|
|
1671
|
-
children: "Remove others"
|
|
1672
|
-
}
|
|
1673
|
-
)
|
|
1674
|
-
] });
|
|
1675
|
-
}
|
|
1676
|
-
), ei = K(
|
|
1677
|
-
({ item: t }) => {
|
|
1678
|
-
const [e, n] = Y(!1), i = $(() => n(!e), [e]), a = $(() => n(!1), []);
|
|
1679
|
-
return /* @__PURE__ */ o(
|
|
1680
|
-
st,
|
|
1681
|
-
{
|
|
1682
|
-
button: /* @__PURE__ */ o(
|
|
1683
|
-
G,
|
|
1684
|
-
{
|
|
1685
|
-
title: "More options",
|
|
1686
|
-
"aria-label": "More options",
|
|
1687
|
-
iconType: Yt,
|
|
1688
|
-
size: "s",
|
|
1689
|
-
color: "text",
|
|
1690
|
-
onClick: i
|
|
1691
|
-
}
|
|
1692
|
-
),
|
|
1693
|
-
isOpen: e,
|
|
1694
|
-
closePopover: a,
|
|
1695
|
-
panelPaddingSize: "none",
|
|
1696
|
-
anchorPosition: "leftCenter",
|
|
1697
|
-
children: /* @__PURE__ */ o(
|
|
1698
|
-
Qn,
|
|
1699
|
-
{
|
|
1700
|
-
item: t,
|
|
1701
|
-
closePopover: a
|
|
1702
|
-
}
|
|
1703
|
-
)
|
|
1704
|
-
}
|
|
1705
|
-
);
|
|
1706
|
-
}
|
|
1707
|
-
), ti = D(
|
|
1708
|
-
({ item: t }) => {
|
|
1709
|
-
const e = te();
|
|
1710
|
-
return /* @__PURE__ */ O(Qe, { textOnly: !1, hasActions: !0, align: "right", children: [
|
|
1711
|
-
/* @__PURE__ */ o(
|
|
1712
|
-
ee,
|
|
1713
|
-
{
|
|
1714
|
-
iconType: un,
|
|
1715
|
-
size: "s",
|
|
1716
|
-
onClick: async () => {
|
|
1717
|
-
t.isCurrent ? await e.setCurrentTime(0) : t.play();
|
|
1718
|
-
},
|
|
1719
|
-
children: "Play"
|
|
1720
|
-
}
|
|
1721
|
-
),
|
|
1722
|
-
/* @__PURE__ */ o(
|
|
1723
|
-
ee,
|
|
1724
|
-
{
|
|
1725
|
-
iconType: lt,
|
|
1726
|
-
size: "s",
|
|
1727
|
-
onClick: t.remove,
|
|
1728
|
-
children: "Remove"
|
|
1729
|
-
}
|
|
1730
|
-
),
|
|
1731
|
-
/* @__PURE__ */ o(ei, { item: t })
|
|
1732
|
-
] });
|
|
1733
|
-
}
|
|
1734
|
-
), ri = {
|
|
1735
|
-
Audio: "",
|
|
1736
|
-
Dailymotion: "https://www.dailymotion.com/favicon.ico",
|
|
1737
|
-
Niconico: "https://www.nicovideo.jp/favicon.ico",
|
|
1738
|
-
SoundCloud: "https://soundcloud.com/favicon.ico",
|
|
1739
|
-
Twitch: "https://www.twitch.tv/favicon.ico",
|
|
1740
|
-
Vimeo: "https://vimeo.com/favicon.ico",
|
|
1741
|
-
YouTube: "https://www.youtube.com/favicon.ico"
|
|
1742
|
-
}, ni = D(
|
|
1743
|
-
({ item: t }) => {
|
|
1744
|
-
const e = te();
|
|
1745
|
-
return /* @__PURE__ */ O(Ur, { isSelected: t.isCurrent, children: [
|
|
1746
|
-
/* @__PURE__ */ o(Br, { children: /* @__PURE__ */ o(
|
|
1747
|
-
zt,
|
|
1748
|
-
{
|
|
1749
|
-
id: t.id.toString(),
|
|
1750
|
-
checked: t.isSelected,
|
|
1751
|
-
onChange: t.toggleSelected
|
|
1752
|
-
}
|
|
1753
|
-
) }),
|
|
1754
|
-
/* @__PURE__ */ o(Qe, { textOnly: !1, children: /* @__PURE__ */ o(
|
|
1755
|
-
"img",
|
|
1756
|
-
{
|
|
1757
|
-
src: ri[t.type],
|
|
1758
|
-
width: 16,
|
|
1759
|
-
height: 16,
|
|
1760
|
-
alt: t.type
|
|
1761
|
-
}
|
|
1762
|
-
) }),
|
|
1763
|
-
/* @__PURE__ */ o(Qe, { children: /* @__PURE__ */ o(
|
|
1764
|
-
Wr,
|
|
1765
|
-
{
|
|
1766
|
-
href: t.url,
|
|
1767
|
-
target: "_blank",
|
|
1768
|
-
external: !0,
|
|
1769
|
-
onClick: () => e.pause(),
|
|
1770
|
-
children: t.title
|
|
1771
|
-
}
|
|
1772
|
-
) }),
|
|
1773
|
-
/* @__PURE__ */ o(ti, { item: t })
|
|
1774
|
-
] }, t.id);
|
|
1775
|
-
}
|
|
1776
|
-
), ii = D(
|
|
1777
|
-
({ playQueueStore: t }) => /* @__PURE__ */ o(
|
|
1778
|
-
fn,
|
|
1779
|
-
{
|
|
1780
|
-
tag: "tbody",
|
|
1781
|
-
list: t.items,
|
|
1782
|
-
setList: (e) => t.setItems(e),
|
|
1783
|
-
children: t.items.map((e) => /* @__PURE__ */ o(ni, { item: e }, e.id))
|
|
1784
|
-
}
|
|
1785
|
-
)
|
|
1786
|
-
), oi = D(
|
|
1787
|
-
({ playQueueStore: t }) => /* @__PURE__ */ O(qr, { children: [
|
|
1788
|
-
/* @__PURE__ */ o(Zn, { playQueueStore: t }),
|
|
1789
|
-
/* @__PURE__ */ o(ii, { playQueueStore: t })
|
|
1790
|
-
] })
|
|
1791
|
-
), ai = D(
|
|
1792
|
-
({ playQueueStore: t }) => {
|
|
1793
|
-
const [e, n] = Y(!1);
|
|
1794
|
-
return /* @__PURE__ */ O(Re, { children: [
|
|
1795
|
-
e && /* @__PURE__ */ o(
|
|
1796
|
-
Gr,
|
|
1797
|
-
{
|
|
1798
|
-
type: "push",
|
|
1799
|
-
size: "s",
|
|
1800
|
-
onClose: () => n(!1),
|
|
1801
|
-
children: /* @__PURE__ */ o("div", { style: { blockSize: "100%" }, children: /* @__PURE__ */ o(
|
|
1802
|
-
Hr,
|
|
1803
|
-
{
|
|
1804
|
-
language: "json",
|
|
1805
|
-
overflowHeight: "100%",
|
|
1806
|
-
isCopyable: !0,
|
|
1807
|
-
isVirtualized: !0,
|
|
1808
|
-
children: JSON.stringify(
|
|
1809
|
-
t.localStorageState,
|
|
1810
|
-
void 0,
|
|
1811
|
-
2
|
|
1812
|
-
)
|
|
1813
|
-
}
|
|
1814
|
-
) })
|
|
1815
|
-
}
|
|
1816
|
-
),
|
|
1817
|
-
/* @__PURE__ */ o(Xn, { playQueueStore: t })
|
|
1818
|
-
] });
|
|
1819
|
-
}
|
|
1820
|
-
), si = D(
|
|
1821
|
-
({ playerStore: t, playQueueStore: e }) => {
|
|
1822
|
-
const { euiTheme: n } = Dt();
|
|
1823
|
-
return /* @__PURE__ */ O(Re, { children: [
|
|
1824
|
-
/* @__PURE__ */ O(
|
|
1825
|
-
de,
|
|
1826
|
-
{
|
|
1827
|
-
alignItems: "center",
|
|
1828
|
-
gutterSize: "m",
|
|
1829
|
-
style: {
|
|
1830
|
-
position: "sticky",
|
|
1831
|
-
top: 48,
|
|
1832
|
-
zIndex: 998,
|
|
1833
|
-
background: n.colors.backgroundBasePlain
|
|
1834
|
-
},
|
|
1835
|
-
children: [
|
|
1836
|
-
/* @__PURE__ */ o(U, { grow: !1, children: /* @__PURE__ */ o(
|
|
1837
|
-
ee,
|
|
1838
|
-
{
|
|
1839
|
-
disabled: e.isEmpty || e.selectedItems.length === 0,
|
|
1840
|
-
onClick: e.playSelectedItemsNext,
|
|
1841
|
-
children: "Play next"
|
|
1842
|
-
}
|
|
1843
|
-
) }),
|
|
1844
|
-
/* @__PURE__ */ o(U, { grow: !1, children: /* @__PURE__ */ o(
|
|
1845
|
-
ee,
|
|
1846
|
-
{
|
|
1847
|
-
iconType: ct,
|
|
1848
|
-
onClick: e.addSelectedItems,
|
|
1849
|
-
disabled: e.isEmpty || e.selectedItems.length === 0,
|
|
1850
|
-
children: "Add to play queue"
|
|
1851
|
-
}
|
|
1852
|
-
) }),
|
|
1853
|
-
/* @__PURE__ */ o(U, { grow: !1, children: /* @__PURE__ */ o(
|
|
1854
|
-
ee,
|
|
1855
|
-
{
|
|
1856
|
-
iconType: lt,
|
|
1857
|
-
onClick: e.removeSelectedItems,
|
|
1858
|
-
disabled: e.isEmpty || e.selectedItems.length === 0,
|
|
1859
|
-
children: "Remove"
|
|
1860
|
-
}
|
|
1861
|
-
) }),
|
|
1862
|
-
/* @__PURE__ */ o(U, { grow: !1, children: /* @__PURE__ */ o(
|
|
1863
|
-
ee,
|
|
1864
|
-
{
|
|
1865
|
-
iconType: dn,
|
|
1866
|
-
onClick: e.clear,
|
|
1867
|
-
disabled: e.isEmpty,
|
|
1868
|
-
children: "Clear"
|
|
1869
|
-
}
|
|
1870
|
-
) }),
|
|
1871
|
-
/* @__PURE__ */ o(U, { grow: !0 }),
|
|
1872
|
-
/* @__PURE__ */ o(U, { grow: !1, children: /* @__PURE__ */ o(ai, { playQueueStore: e }) })
|
|
1873
|
-
]
|
|
1874
|
-
}
|
|
1875
|
-
),
|
|
1876
|
-
!e.isEmpty && /* @__PURE__ */ O(Re, { children: [
|
|
1877
|
-
/* @__PURE__ */ o(
|
|
1878
|
-
Lt,
|
|
1879
|
-
{
|
|
1880
|
-
size: "l",
|
|
1881
|
-
style: {
|
|
1882
|
-
position: "sticky",
|
|
1883
|
-
top: 88,
|
|
1884
|
-
zIndex: 998,
|
|
1885
|
-
background: n.colors.backgroundBasePlain
|
|
1886
|
-
}
|
|
1887
|
-
}
|
|
1888
|
-
),
|
|
1889
|
-
/* @__PURE__ */ o(oi, { playQueueStore: e })
|
|
1890
|
-
] })
|
|
1891
|
-
] });
|
|
1892
|
-
}
|
|
1893
|
-
), Ri = D(
|
|
1894
|
-
({ playerStore: t, playQueueStore: e }) => /* @__PURE__ */ O(Re, { children: [
|
|
1895
|
-
/* @__PURE__ */ o(
|
|
1896
|
-
et.Header,
|
|
1897
|
-
{
|
|
1898
|
-
pageTitle: "Play queue",
|
|
1899
|
-
rightSideItems: []
|
|
1900
|
-
}
|
|
1901
|
-
),
|
|
1902
|
-
/* @__PURE__ */ o(et.Section, { children: /* @__PURE__ */ o(
|
|
1903
|
-
si,
|
|
1904
|
-
{
|
|
1905
|
-
playerStore: t,
|
|
1906
|
-
playQueueStore: e
|
|
1907
|
-
}
|
|
1908
|
-
) })
|
|
1909
|
-
] })
|
|
1910
|
-
), it = {
|
|
1911
|
-
width: 16 * 25,
|
|
1912
|
-
height: 9 * 25
|
|
1913
|
-
}, Pi = D(
|
|
1914
|
-
({ playerStore: t, playQueueStore: e }) => {
|
|
1915
|
-
const n = te(), i = $(async () => {
|
|
1916
|
-
e.interacted && await n.play();
|
|
1917
|
-
}, [e, n]), a = $(async () => {
|
|
1918
|
-
switch (e.repeat) {
|
|
1919
|
-
case I.One:
|
|
1920
|
-
await n.setCurrentTime(0);
|
|
1921
|
-
break;
|
|
1922
|
-
case I.Off:
|
|
1923
|
-
case I.All:
|
|
1924
|
-
if (e.isLastItem)
|
|
1925
|
-
switch (e.repeat) {
|
|
1926
|
-
case I.Off:
|
|
1927
|
-
t.onEnded();
|
|
1928
|
-
break;
|
|
1929
|
-
case I.All:
|
|
1930
|
-
e.hasMultipleItems ? await e.goToFirst() : await n.setCurrentTime(0);
|
|
1931
|
-
break;
|
|
1932
|
-
}
|
|
1933
|
-
else
|
|
1934
|
-
await e.next();
|
|
1935
|
-
break;
|
|
1936
|
-
}
|
|
1937
|
-
}, [e, t, n]), l = $t(
|
|
1938
|
-
() => ({
|
|
1939
|
-
onLoaded: i,
|
|
1940
|
-
onPlay: t.onPlay,
|
|
1941
|
-
onPause: t.onPause,
|
|
1942
|
-
onEnded: a,
|
|
1943
|
-
onTimeUpdate: t.onTimeUpdate
|
|
1944
|
-
}),
|
|
1945
|
-
[t, i, a]
|
|
1946
|
-
);
|
|
1947
|
-
return /* @__PURE__ */ o(
|
|
1948
|
-
"div",
|
|
1949
|
-
{
|
|
1950
|
-
css: {
|
|
1951
|
-
position: "fixed",
|
|
1952
|
-
right: 0,
|
|
1953
|
-
bottom: Kt,
|
|
1954
|
-
width: it.width,
|
|
1955
|
-
height: it.height,
|
|
1956
|
-
zIndex: 998,
|
|
1957
|
-
backgroundColor: "rgb(39, 39, 39)",
|
|
1958
|
-
display: "flex",
|
|
1959
|
-
flexDirection: "column"
|
|
1960
|
-
},
|
|
1961
|
-
children: /* @__PURE__ */ o("div", { css: { flexGrow: 1, backgroundColor: "black" }, children: e.currentItem && /* @__PURE__ */ o(
|
|
1962
|
-
_r,
|
|
1963
|
-
{
|
|
1964
|
-
src: e.currentItem.url,
|
|
1965
|
-
options: l
|
|
1966
|
-
}
|
|
1967
|
-
) })
|
|
1968
|
-
}
|
|
1969
|
-
);
|
|
1970
|
-
}
|
|
1971
|
-
);
|
|
1972
|
-
class Xt {
|
|
1973
|
-
makeObservable(e, n) {
|
|
1974
|
-
return mn(e, n);
|
|
1975
|
-
}
|
|
1976
|
-
}
|
|
1977
|
-
const Ce = class Ce {
|
|
1978
|
-
constructor(e, n, i) {
|
|
1979
|
-
V(this, "id");
|
|
1980
|
-
V(this, "isSelected", !1);
|
|
1981
|
-
this.observableStateProvider = e, this.playQueueStore = n, this.dto = i, this.id = Ce.nextId++, e.makeObservable(this, {
|
|
1982
|
-
isSelected: Q,
|
|
1983
|
-
isCurrent: w,
|
|
1984
|
-
index: w,
|
|
1985
|
-
isFirst: w,
|
|
1986
|
-
isLast: w,
|
|
1987
|
-
canMoveToTop: w,
|
|
1988
|
-
canMoveToBottom: w,
|
|
1989
|
-
canRemoveToTop: w,
|
|
1990
|
-
canRemoveOthers: w,
|
|
1991
|
-
unselect: y,
|
|
1992
|
-
toggleSelected: y.bound,
|
|
1993
|
-
play: y,
|
|
1994
|
-
remove: y.bound,
|
|
1995
|
-
playFirst: y.bound,
|
|
1996
|
-
playNext: y.bound,
|
|
1997
|
-
addToPlayQueue: y.bound,
|
|
1998
|
-
moveToTop: y.bound,
|
|
1999
|
-
moveToBottom: y.bound,
|
|
2000
|
-
removeToTop: y.bound,
|
|
2001
|
-
removeOthers: y.bound
|
|
2002
|
-
});
|
|
2003
|
-
}
|
|
2004
|
-
static fromDto(e, n, i) {
|
|
2005
|
-
return new Ce(
|
|
2006
|
-
e,
|
|
2007
|
-
n,
|
|
2008
|
-
i
|
|
2009
|
-
);
|
|
2010
|
-
}
|
|
2011
|
-
get url() {
|
|
2012
|
-
return this.dto.url;
|
|
2013
|
-
}
|
|
2014
|
-
get type() {
|
|
2015
|
-
return this.dto.type;
|
|
2016
|
-
}
|
|
2017
|
-
get videoId() {
|
|
2018
|
-
return this.dto.videoId;
|
|
2019
|
-
}
|
|
2020
|
-
get title() {
|
|
2021
|
-
return this.dto.title;
|
|
2022
|
-
}
|
|
2023
|
-
get isCurrent() {
|
|
2024
|
-
return this.playQueueStore.currentItem === this;
|
|
2025
|
-
}
|
|
2026
|
-
get index() {
|
|
2027
|
-
return this.playQueueStore.items.indexOf(this);
|
|
2028
|
-
}
|
|
2029
|
-
get isFirst() {
|
|
2030
|
-
return this.index === 0;
|
|
2031
|
-
}
|
|
2032
|
-
get isLast() {
|
|
2033
|
-
return this.index === this.playQueueStore.items.length - 1;
|
|
2034
|
-
}
|
|
2035
|
-
get canMoveToTop() {
|
|
2036
|
-
return !this.isFirst;
|
|
2037
|
-
}
|
|
2038
|
-
get canMoveToBottom() {
|
|
2039
|
-
return !this.isLast;
|
|
2040
|
-
}
|
|
2041
|
-
get canRemoveToTop() {
|
|
2042
|
-
return !this.isFirst;
|
|
2043
|
-
}
|
|
2044
|
-
get canRemoveOthers() {
|
|
2045
|
-
return this.playQueueStore.hasMultipleItems;
|
|
2046
|
-
}
|
|
2047
|
-
clone() {
|
|
2048
|
-
return this.playQueueStore.createItem(this.dto);
|
|
2049
|
-
}
|
|
2050
|
-
unselect() {
|
|
2051
|
-
this.isSelected = !1;
|
|
2052
|
-
}
|
|
2053
|
-
toggleSelected() {
|
|
2054
|
-
this.isSelected = !this.isSelected;
|
|
2055
|
-
}
|
|
2056
|
-
play() {
|
|
2057
|
-
this.playQueueStore.setCurrentItem(this);
|
|
2058
|
-
}
|
|
2059
|
-
remove() {
|
|
2060
|
-
return this.playQueueStore.removeItems([this]);
|
|
2061
|
-
}
|
|
2062
|
-
async playFirst() {
|
|
2063
|
-
await this.playQueueStore.playFirst([this.clone()]);
|
|
2064
|
-
}
|
|
2065
|
-
async playNext() {
|
|
2066
|
-
await this.playQueueStore.playNext([this.clone()]);
|
|
2067
|
-
}
|
|
2068
|
-
async addToPlayQueue() {
|
|
2069
|
-
await this.playQueueStore.addItems([this.clone()]);
|
|
2070
|
-
}
|
|
2071
|
-
moveToTop() {
|
|
2072
|
-
this.playQueueStore.moveItem(this, 0);
|
|
2073
|
-
}
|
|
2074
|
-
moveToBottom() {
|
|
2075
|
-
this.playQueueStore.moveItem(
|
|
2076
|
-
this,
|
|
2077
|
-
this.playQueueStore.items.length - 1
|
|
2078
|
-
);
|
|
2079
|
-
}
|
|
2080
|
-
removeToTop() {
|
|
2081
|
-
return this.playQueueStore.removeItemsAbove(this);
|
|
2082
|
-
}
|
|
2083
|
-
removeOthers() {
|
|
2084
|
-
return this.playQueueStore.removeOtherItems(this);
|
|
2085
|
-
}
|
|
379
|
+
U([h], q.prototype, "isSelected", void 0), U([p], q.prototype, "isCurrent", null), U([p], q.prototype, "index", null), U([p], q.prototype, "isFirst", null), U([p], q.prototype, "isLast", null), U([p], q.prototype, "canMoveToTop", null), U([p], q.prototype, "canMoveToBottom", null), U([p], q.prototype, "canRemoveToTop", null), U([p], q.prototype, "canRemoveOthers", null), U([f.bound], q.prototype, "unselect", null), U([f.bound], q.prototype, "select", null), U([f.bound], q.prototype, "toggleSelected", null), U([f.bound], q.prototype, "play", null), U([f.bound], q.prototype, "remove", null), U([f.bound], q.prototype, "playFirst", null), U([f.bound], q.prototype, "playNext", null), U([f.bound], q.prototype, "addToPlayQueue", null), U([f.bound], q.prototype, "moveToTop", null), U([f.bound], q.prototype, "moveToBottom", null), U([f.bound], q.prototype, "removeToTop", null), U([f.bound], q.prototype, "removeOthers", null);
|
|
380
|
+
//#endregion
|
|
381
|
+
//#region src/features/media-player.play-queue/stores/PlayQueueStore.ts
|
|
382
|
+
var dt = class {
|
|
383
|
+
playQueue;
|
|
384
|
+
constructor(e) {
|
|
385
|
+
this.playQueue = e, m(this);
|
|
386
|
+
}
|
|
387
|
+
get state() {
|
|
388
|
+
return {
|
|
389
|
+
version: "1.0",
|
|
390
|
+
items: this.playQueue.items.map((e) => e.dto),
|
|
391
|
+
currentIndex: this.playQueue.currentIndex
|
|
392
|
+
};
|
|
393
|
+
}
|
|
394
|
+
set state(e) {
|
|
395
|
+
this.playQueue.items = e.items?.map((e) => this.playQueue.createItemFromDto(e)) ?? [], this.playQueue.currentIndex = e.currentIndex;
|
|
396
|
+
}
|
|
397
|
+
validateState(e) {
|
|
398
|
+
return $e(ut, "PlayQueueDto")(e);
|
|
399
|
+
}
|
|
2086
400
|
};
|
|
2087
|
-
|
|
2088
|
-
|
|
2089
|
-
|
|
2090
|
-
|
|
401
|
+
U([p.struct], dt.prototype, "state", null);
|
|
402
|
+
var J = class {
|
|
403
|
+
interacted = !1;
|
|
404
|
+
localStorageState;
|
|
405
|
+
items = [];
|
|
406
|
+
currentId;
|
|
407
|
+
constructor() {
|
|
408
|
+
m(this), this.localStorageState = new dt(this);
|
|
409
|
+
}
|
|
410
|
+
createItemFromDto(e) {
|
|
411
|
+
return q.fromDto(this, {
|
|
412
|
+
url: e.url,
|
|
413
|
+
type: e.type,
|
|
414
|
+
videoId: e.videoId,
|
|
415
|
+
title: e.title
|
|
416
|
+
});
|
|
417
|
+
}
|
|
418
|
+
get isEmpty() {
|
|
419
|
+
return this.items.length === 0;
|
|
420
|
+
}
|
|
421
|
+
get canClear() {
|
|
422
|
+
return !this.isEmpty;
|
|
423
|
+
}
|
|
424
|
+
get currentItem() {
|
|
425
|
+
return this.items.find((e) => e.id === this.currentId);
|
|
426
|
+
}
|
|
427
|
+
get canPlay() {
|
|
428
|
+
return this.currentItem !== void 0;
|
|
429
|
+
}
|
|
430
|
+
get canPause() {
|
|
431
|
+
return this.currentItem !== void 0;
|
|
432
|
+
}
|
|
433
|
+
get hasMultipleItems() {
|
|
434
|
+
return this.items.length > 1;
|
|
435
|
+
}
|
|
436
|
+
get currentIndex() {
|
|
437
|
+
return this.currentId === void 0 ? void 0 : this.items.findIndex((e) => e.id === this.currentId);
|
|
438
|
+
}
|
|
439
|
+
set currentIndex(e) {
|
|
440
|
+
this.currentId = e === void 0 ? void 0 : this.items.at(e)?.id;
|
|
441
|
+
}
|
|
442
|
+
get hasPreviousItem() {
|
|
443
|
+
return this.hasMultipleItems && this.currentIndex !== void 0 && this.currentIndex > 0;
|
|
444
|
+
}
|
|
445
|
+
get hasNextItem() {
|
|
446
|
+
return this.hasMultipleItems && this.currentIndex !== void 0 && this.currentIndex < this.items.length - 1;
|
|
447
|
+
}
|
|
448
|
+
get isLastItem() {
|
|
449
|
+
return this.currentIndex !== void 0 && this.currentIndex === this.items.length - 1;
|
|
450
|
+
}
|
|
451
|
+
get selectedItems() {
|
|
452
|
+
return this.items.filter((e) => e.isSelected);
|
|
453
|
+
}
|
|
454
|
+
get allItemsSelected() {
|
|
455
|
+
return this.selectedItems.length === this.items.length;
|
|
456
|
+
}
|
|
457
|
+
get hasSelectedItems() {
|
|
458
|
+
return this.selectedItems.length > 0;
|
|
459
|
+
}
|
|
460
|
+
get selectedItemsOrAllItems() {
|
|
461
|
+
return this.hasSelectedItems ? this.selectedItems : this.items;
|
|
462
|
+
}
|
|
463
|
+
get canAddSelectedItems() {
|
|
464
|
+
return !this.isEmpty && this.hasSelectedItems;
|
|
465
|
+
}
|
|
466
|
+
get canPlaySelectedItemsNext() {
|
|
467
|
+
return !this.isEmpty && this.hasSelectedItems;
|
|
468
|
+
}
|
|
469
|
+
get canRemoveSelectedItems() {
|
|
470
|
+
return !this.isEmpty && this.hasSelectedItems;
|
|
471
|
+
}
|
|
472
|
+
setItems(e) {
|
|
473
|
+
this.items = e;
|
|
474
|
+
}
|
|
475
|
+
interact() {
|
|
476
|
+
this.interacted = !0;
|
|
477
|
+
}
|
|
478
|
+
clear() {
|
|
479
|
+
this.interact(), this.currentIndex = void 0, this.items = [];
|
|
480
|
+
}
|
|
481
|
+
unselectAll() {
|
|
482
|
+
for (let e of this.items) e.unselect();
|
|
483
|
+
}
|
|
484
|
+
selectAll() {
|
|
485
|
+
for (let e of this.items) e.select();
|
|
486
|
+
}
|
|
487
|
+
setCurrentItem(e) {
|
|
488
|
+
this.interact(), this.currentId = e?.id;
|
|
489
|
+
}
|
|
490
|
+
setNextItems(e) {
|
|
491
|
+
this.currentIndex !== void 0 && this.items.splice(this.currentIndex + 1, 0, ...e);
|
|
492
|
+
}
|
|
493
|
+
clearAndSetItems(e) {
|
|
494
|
+
this.clear(), this.setCurrentItem(e[0]), this.setNextItems(e);
|
|
495
|
+
}
|
|
496
|
+
async playNext(e) {
|
|
497
|
+
if (this.isEmpty) {
|
|
498
|
+
this.clearAndSetItems(e);
|
|
499
|
+
return;
|
|
500
|
+
}
|
|
501
|
+
this.setNextItems(e);
|
|
502
|
+
}
|
|
503
|
+
async playSelectedItemsNext() {
|
|
504
|
+
await this.playNext(this.selectedItemsOrAllItems.map((e) => e.clone())), this.unselectAll();
|
|
505
|
+
}
|
|
506
|
+
async addItems(e) {
|
|
507
|
+
if (this.isEmpty) {
|
|
508
|
+
this.clearAndSetItems(e);
|
|
509
|
+
return;
|
|
510
|
+
}
|
|
511
|
+
this.items.push(...e);
|
|
512
|
+
}
|
|
513
|
+
async addSelectedItems() {
|
|
514
|
+
await this.addItems(this.selectedItemsOrAllItems.map((e) => e.clone())), this.unselectAll();
|
|
515
|
+
}
|
|
516
|
+
async playFirst(e) {
|
|
517
|
+
if (this.isEmpty) {
|
|
518
|
+
this.clearAndSetItems(e);
|
|
519
|
+
return;
|
|
520
|
+
}
|
|
521
|
+
let { currentIndex: t } = this;
|
|
522
|
+
t !== void 0 && (this.interact(), this.items.splice(t, 0, ...e), this.currentIndex = t);
|
|
523
|
+
}
|
|
524
|
+
moveItem(e, t) {
|
|
525
|
+
let n = this.items.splice(this.items.indexOf(e), 1)[0];
|
|
526
|
+
this.items.splice(t, 0, n);
|
|
527
|
+
}
|
|
528
|
+
async goToFirst() {
|
|
529
|
+
this.currentIndex !== void 0 && (this.currentIndex = 0);
|
|
530
|
+
}
|
|
531
|
+
async removeItems(e) {
|
|
532
|
+
let { currentItem: t } = this;
|
|
533
|
+
re(this.items, ...e.filter((e) => e !== t));
|
|
534
|
+
let { currentIndex: n, isLastItem: r } = this;
|
|
535
|
+
re(this.items, e.find((e) => e === t)), this.currentItem !== t && (this.interact(), r ? await this.goToFirst() : this.currentIndex = n);
|
|
536
|
+
}
|
|
537
|
+
async removeSelectedItems() {
|
|
538
|
+
await this.removeItems(this.selectedItemsOrAllItems), this.unselectAll();
|
|
539
|
+
}
|
|
540
|
+
async removeOtherItems(e) {
|
|
541
|
+
let t = e.id;
|
|
542
|
+
return this.removeItems(this.items.filter((e) => e.id !== t));
|
|
543
|
+
}
|
|
544
|
+
async removeItemsAbove(e) {
|
|
545
|
+
let t = this.items.indexOf(e);
|
|
546
|
+
return this.removeItems(this.items.filter((e, n) => n < t));
|
|
547
|
+
}
|
|
548
|
+
async previous() {
|
|
549
|
+
this.currentIndex !== void 0 && this.hasPreviousItem && (this.interact(), this.currentIndex--);
|
|
550
|
+
}
|
|
551
|
+
async next() {
|
|
552
|
+
this.currentIndex !== void 0 && this.hasNextItem && (this.interact(), this.currentIndex++);
|
|
553
|
+
}
|
|
554
|
+
addItemFromDto(e) {
|
|
555
|
+
let t = this.createItemFromDto(e);
|
|
556
|
+
return this.addItems([t]);
|
|
557
|
+
}
|
|
558
|
+
};
|
|
559
|
+
U([h], J.prototype, "interacted", void 0), U([h], J.prototype, "items", void 0), U([h], J.prototype, "currentId", void 0), U([p], J.prototype, "isEmpty", null), U([p], J.prototype, "canClear", null), U([p], J.prototype, "currentItem", null), U([p], J.prototype, "canPlay", null), U([p], J.prototype, "canPause", null), U([p], J.prototype, "hasMultipleItems", null), U([p], J.prototype, "currentIndex", null), U([p], J.prototype, "hasPreviousItem", null), U([p], J.prototype, "hasNextItem", null), U([p], J.prototype, "isLastItem", null), U([p], J.prototype, "selectedItems", null), U([p], J.prototype, "allItemsSelected", null), U([p], J.prototype, "hasSelectedItems", null), U([p], J.prototype, "selectedItemsOrAllItems", null), U([p], J.prototype, "canAddSelectedItems", null), U([p], J.prototype, "canPlaySelectedItemsNext", null), U([p], J.prototype, "canRemoveSelectedItems", null), U([f.bound], J.prototype, "setItems", null), U([f.bound], J.prototype, "interact", null), U([f.bound], J.prototype, "clear", null), U([f.bound], J.prototype, "unselectAll", null), U([f.bound], J.prototype, "selectAll", null), U([f.bound], J.prototype, "setCurrentItem", null), U([f.bound], J.prototype, "setNextItems", null), U([f.bound], J.prototype, "clearAndSetItems", null), U([f.bound], J.prototype, "playNext", null), U([f.bound], J.prototype, "playSelectedItemsNext", null), U([f.bound], J.prototype, "addItems", null), U([f.bound], J.prototype, "addSelectedItems", null), U([f.bound], J.prototype, "playFirst", null), U([f.bound], J.prototype, "moveItem", null), U([f.bound], J.prototype, "goToFirst", null), U([f.bound], J.prototype, "removeItems", null), U([f.bound], J.prototype, "removeSelectedItems", null), U([f.bound], J.prototype, "removeOtherItems", null), U([f.bound], J.prototype, "removeItemsAbove", null), U([f.bound], J.prototype, "previous", null), U([f.bound], J.prototype, "next", null), U([f.bound], J.prototype, "addItemFromDto", null);
|
|
560
|
+
//#endregion
|
|
561
|
+
//#region src/features/media-player.play-queue/components/PlayQueueProvider.tsx
|
|
562
|
+
var ft = ({ children: e }) => {
|
|
563
|
+
let [n] = d(() => new J());
|
|
564
|
+
ne(B.playQueue, n.localStorageState);
|
|
565
|
+
let r = g();
|
|
566
|
+
return s(() => te(() => n.currentItem, async (e, t) => {
|
|
567
|
+
e === void 0 || t === void 0 || e.type === t.type && e.videoId === t.videoId && await r.setCurrentTime(0);
|
|
568
|
+
}), [n, r]), /* @__PURE__ */ t(nt.Provider, {
|
|
569
|
+
value: n,
|
|
570
|
+
children: e
|
|
571
|
+
});
|
|
572
|
+
}, Y = class {
|
|
573
|
+
controller = se;
|
|
574
|
+
playing = !1;
|
|
575
|
+
percent = 0;
|
|
576
|
+
seeking = !1;
|
|
577
|
+
constructor() {
|
|
578
|
+
m(this);
|
|
579
|
+
}
|
|
580
|
+
setPlaying(e) {
|
|
581
|
+
this.playing = e;
|
|
582
|
+
}
|
|
583
|
+
setPercent(e) {
|
|
584
|
+
this.percent = e;
|
|
585
|
+
}
|
|
586
|
+
setSeeking(e) {
|
|
587
|
+
this.seeking = e;
|
|
588
|
+
}
|
|
589
|
+
onControllerChange(e) {
|
|
590
|
+
this.controller = e;
|
|
591
|
+
}
|
|
592
|
+
onPlay() {
|
|
593
|
+
this.playing = !0;
|
|
594
|
+
}
|
|
595
|
+
onPause() {
|
|
596
|
+
this.playing = !1;
|
|
597
|
+
}
|
|
598
|
+
onEnded() {
|
|
599
|
+
this.playing = !1;
|
|
600
|
+
}
|
|
601
|
+
onTimeUpdate({ percent: e }) {
|
|
602
|
+
e !== void 0 && (this.seeking || (this.percent = e));
|
|
603
|
+
}
|
|
604
|
+
};
|
|
605
|
+
U([h], Y.prototype, "controller", void 0), U([h], Y.prototype, "playing", void 0), U([h], Y.prototype, "percent", void 0), U([h], Y.prototype, "seeking", void 0), U([f.bound], Y.prototype, "setPlaying", null), U([f.bound], Y.prototype, "setPercent", null), U([f.bound], Y.prototype, "setSeeking", null), U([f.bound], Y.prototype, "onControllerChange", null), U([f.bound], Y.prototype, "onPlay", null), U([f.bound], Y.prototype, "onPause", null), U([f.bound], Y.prototype, "onEnded", null), U([f.bound], Y.prototype, "onTimeUpdate", null);
|
|
606
|
+
//#endregion
|
|
607
|
+
//#region src/features/media-player.player/components/PlayerProvider.tsx
|
|
608
|
+
var pt = ({ children: e }) => {
|
|
609
|
+
let [n] = d(() => new Y());
|
|
610
|
+
return /* @__PURE__ */ t(rt.Provider, {
|
|
611
|
+
value: n,
|
|
612
|
+
children: e
|
|
613
|
+
});
|
|
614
|
+
}, mt = r(void 0), ht = () => o(mt), X = class {
|
|
615
|
+
playlistList;
|
|
616
|
+
id;
|
|
617
|
+
name;
|
|
618
|
+
constructor(e, t, n) {
|
|
619
|
+
this.playlistList = e, m(this), this.id = t, this.name = n;
|
|
620
|
+
}
|
|
621
|
+
async rename(e) {
|
|
622
|
+
this.name = e;
|
|
623
|
+
}
|
|
624
|
+
remove() {
|
|
625
|
+
return this.playlistList.removeItem(this);
|
|
626
|
+
}
|
|
627
|
+
};
|
|
628
|
+
U([h], X.prototype, "id", void 0), U([h], X.prototype, "name", void 0), U([f.bound], X.prototype, "rename", null), U([f.bound], X.prototype, "remove", null);
|
|
629
|
+
//#endregion
|
|
630
|
+
//#region src/features/media-player.playlists/stores/PlaylistListStore.ts
|
|
631
|
+
var gt = class {
|
|
632
|
+
playlistList;
|
|
633
|
+
constructor(e) {
|
|
634
|
+
this.playlistList = e, m(this);
|
|
635
|
+
}
|
|
636
|
+
get state() {
|
|
637
|
+
return { items: this.playlistList.items.map((e) => ({
|
|
638
|
+
id: e.id,
|
|
639
|
+
name: e.name
|
|
640
|
+
})) };
|
|
641
|
+
}
|
|
642
|
+
set state(e) {
|
|
643
|
+
this.playlistList.items = e.items?.map((e) => new X(this.playlistList, e.id, e.name)) ?? [];
|
|
644
|
+
}
|
|
645
|
+
validateState(e) {
|
|
646
|
+
return !0;
|
|
647
|
+
}
|
|
648
|
+
};
|
|
649
|
+
U([p.struct], gt.prototype, "state", null);
|
|
650
|
+
var Z = class {
|
|
651
|
+
localStorageState;
|
|
652
|
+
items = [];
|
|
653
|
+
constructor() {
|
|
654
|
+
m(this), this.localStorageState = new gt(this);
|
|
655
|
+
}
|
|
656
|
+
createItem(e) {
|
|
657
|
+
return new X(this, crypto.randomUUID(), e);
|
|
658
|
+
}
|
|
659
|
+
setItems(e) {
|
|
660
|
+
this.items = e;
|
|
661
|
+
}
|
|
662
|
+
async addItem(e) {
|
|
663
|
+
this.items.push(e);
|
|
664
|
+
}
|
|
665
|
+
async removeItem(e) {
|
|
666
|
+
re(this.items, e);
|
|
667
|
+
}
|
|
668
|
+
};
|
|
669
|
+
U([h], Z.prototype, "items", void 0), U([f.bound], Z.prototype, "setItems", null), U([f.bound], Z.prototype, "addItem", null), U([f.bound], Z.prototype, "removeItem", null);
|
|
670
|
+
//#endregion
|
|
671
|
+
//#region src/features/media-player.playlists/components/PlaylistListProvider.tsx
|
|
672
|
+
var _t = ({ children: e }) => {
|
|
673
|
+
let [n] = d(() => new Z());
|
|
674
|
+
return ne(B.playlistList, n.localStorageState), /* @__PURE__ */ t(mt.Provider, {
|
|
675
|
+
value: n,
|
|
676
|
+
children: e
|
|
677
|
+
});
|
|
678
|
+
}, vt = ({ children: e, nostalgicDivaProps: n }) => /* @__PURE__ */ t(ae, {
|
|
679
|
+
...n,
|
|
680
|
+
children: /* @__PURE__ */ t(Xe, {
|
|
681
|
+
components: [
|
|
682
|
+
pt,
|
|
683
|
+
ft,
|
|
684
|
+
at,
|
|
685
|
+
ct,
|
|
686
|
+
_t
|
|
687
|
+
],
|
|
688
|
+
children: e
|
|
689
|
+
})
|
|
690
|
+
}), yt = {
|
|
691
|
+
width: 400,
|
|
692
|
+
height: 225
|
|
693
|
+
}, bt = N(({ children: e }) => /* @__PURE__ */ n(O, {
|
|
694
|
+
panelled: !0,
|
|
695
|
+
style: { minBlockSize: "max(460px, 100vh - 81px)" },
|
|
696
|
+
children: [e, !G().isEmpty && /* @__PURE__ */ t(be, { style: { blockSize: yt.height } })]
|
|
697
|
+
})), xt = N(() => {
|
|
698
|
+
let e = V();
|
|
699
|
+
return /* @__PURE__ */ t(y, {
|
|
700
|
+
title: `Shuffle: ${e.shuffle ? "On" : "Off"}`,
|
|
701
|
+
"aria-label": `Shuffle: ${e.shuffle ? "On" : "Off"}`,
|
|
702
|
+
iconType: e.shuffle ? Me : Ne,
|
|
703
|
+
size: "s",
|
|
704
|
+
iconSize: "l",
|
|
705
|
+
onClick: e.toggleShuffle,
|
|
706
|
+
disabled: !e.canToggleShuffle
|
|
707
|
+
});
|
|
708
|
+
}), St = N(() => {
|
|
709
|
+
let e = V();
|
|
710
|
+
return /* @__PURE__ */ t(y, {
|
|
711
|
+
title: "Previous",
|
|
712
|
+
"aria-label": "Previous",
|
|
713
|
+
iconType: Ve,
|
|
714
|
+
size: "s",
|
|
715
|
+
iconSize: "l",
|
|
716
|
+
onClick: e.previous,
|
|
717
|
+
disabled: !e.canPrevious
|
|
718
|
+
});
|
|
719
|
+
}), Ct = N(() => {
|
|
720
|
+
let e = V();
|
|
721
|
+
return /* @__PURE__ */ t(y, {
|
|
722
|
+
title: "Skip back 10 seconds",
|
|
723
|
+
"aria-label": "Skip back 10 seconds",
|
|
724
|
+
iconType: Ue,
|
|
725
|
+
size: "s",
|
|
726
|
+
iconSize: "l",
|
|
727
|
+
onClick: e.skipBack10,
|
|
728
|
+
disabled: !e.canSkipBack10
|
|
729
|
+
});
|
|
730
|
+
}), wt = N(() => {
|
|
731
|
+
let e = V();
|
|
732
|
+
return /* @__PURE__ */ t(y, {
|
|
733
|
+
title: "Pause",
|
|
734
|
+
"aria-label": "Pause",
|
|
735
|
+
iconType: ze,
|
|
736
|
+
size: "s",
|
|
737
|
+
iconSize: "l",
|
|
738
|
+
onClick: e.pause,
|
|
739
|
+
disabled: !e.canPause
|
|
740
|
+
});
|
|
741
|
+
}), Tt = N(() => {
|
|
742
|
+
let e = V();
|
|
743
|
+
return /* @__PURE__ */ t(y, {
|
|
744
|
+
title: "Play",
|
|
745
|
+
"aria-label": "Play",
|
|
746
|
+
iconType: Be,
|
|
747
|
+
size: "s",
|
|
748
|
+
iconSize: "l",
|
|
749
|
+
onClick: e.play,
|
|
750
|
+
disabled: !e.canPlay
|
|
751
|
+
});
|
|
752
|
+
}), Et = N(() => {
|
|
753
|
+
let e = V();
|
|
754
|
+
return /* @__PURE__ */ t(y, {
|
|
755
|
+
title: "Skip forward 30 seconds",
|
|
756
|
+
"aria-label": "Skip forward 30 seconds",
|
|
757
|
+
iconType: We,
|
|
758
|
+
size: "s",
|
|
759
|
+
iconSize: "l",
|
|
760
|
+
onClick: e.skipForward30,
|
|
761
|
+
disabled: !e.canSkipForward30
|
|
762
|
+
});
|
|
763
|
+
}), Dt = N(() => {
|
|
764
|
+
let e = V();
|
|
765
|
+
return /* @__PURE__ */ t(y, {
|
|
766
|
+
title: "Next",
|
|
767
|
+
"aria-label": "Next",
|
|
768
|
+
iconType: Le,
|
|
769
|
+
size: "s",
|
|
770
|
+
iconSize: "l",
|
|
771
|
+
onClick: e.next,
|
|
772
|
+
disabled: !e.canNext
|
|
773
|
+
});
|
|
774
|
+
}), Ot = {
|
|
775
|
+
[H.Off]: je,
|
|
776
|
+
[H.All]: Ae,
|
|
777
|
+
[H.One]: ke
|
|
778
|
+
}, kt = N(() => {
|
|
779
|
+
let e = V();
|
|
780
|
+
return /* @__PURE__ */ t(y, {
|
|
781
|
+
title: `Repeat: ${e.repeat === H.All ? "All" : e.repeat === H.One ? "One" : "Off"}`,
|
|
782
|
+
"aria-label": `Repeat: ${e.repeat === H.All ? "All" : e.repeat === H.One ? "One" : "Off"}`,
|
|
783
|
+
iconType: Ot[e.repeat],
|
|
784
|
+
size: "s",
|
|
785
|
+
iconSize: "l",
|
|
786
|
+
onClick: e.toggleRepeat,
|
|
787
|
+
disabled: !e.canToggleRepeat
|
|
788
|
+
});
|
|
789
|
+
}), At = N(() => {
|
|
790
|
+
let e = V();
|
|
791
|
+
return /* @__PURE__ */ n(C, {
|
|
792
|
+
responsive: !1,
|
|
793
|
+
gutterSize: "s",
|
|
794
|
+
justifyContent: "center",
|
|
795
|
+
alignItems: "center",
|
|
796
|
+
children: [
|
|
797
|
+
/* @__PURE__ */ t(E, {
|
|
798
|
+
sizes: ["xs"],
|
|
799
|
+
children: /* @__PURE__ */ t(xt, {})
|
|
800
|
+
}),
|
|
801
|
+
/* @__PURE__ */ t(St, {}),
|
|
802
|
+
/* @__PURE__ */ t(E, {
|
|
803
|
+
sizes: ["xs"],
|
|
804
|
+
children: /* @__PURE__ */ t(Ct, {})
|
|
805
|
+
}),
|
|
806
|
+
e.playing ? /* @__PURE__ */ t(wt, {}) : /* @__PURE__ */ t(Tt, {}),
|
|
807
|
+
/* @__PURE__ */ t(E, {
|
|
808
|
+
sizes: ["xs"],
|
|
809
|
+
children: /* @__PURE__ */ t(Et, {})
|
|
810
|
+
}),
|
|
811
|
+
/* @__PURE__ */ t(Dt, {}),
|
|
812
|
+
/* @__PURE__ */ t(E, {
|
|
813
|
+
sizes: ["xs"],
|
|
814
|
+
children: /* @__PURE__ */ t(kt, {})
|
|
815
|
+
})
|
|
816
|
+
]
|
|
817
|
+
});
|
|
818
|
+
}), jt = i(({ item: e, closePopover: n }) => {
|
|
819
|
+
let r = a(({ name: e, icon: t, onClick: r }) => ({
|
|
820
|
+
name: e,
|
|
821
|
+
icon: t,
|
|
822
|
+
onClick: async (e) => {
|
|
823
|
+
n(), r(e);
|
|
824
|
+
}
|
|
825
|
+
}), [n]);
|
|
826
|
+
return /* @__PURE__ */ t(x, {
|
|
827
|
+
initialPanelId: 0,
|
|
828
|
+
panels: l(() => [{
|
|
829
|
+
id: 0,
|
|
830
|
+
items: [
|
|
831
|
+
r({
|
|
832
|
+
name: "Open in new tab",
|
|
833
|
+
icon: /* @__PURE__ */ t(D, { type: Re }),
|
|
834
|
+
onClick: async () => {
|
|
835
|
+
window.open(e.dto.url, "_blank");
|
|
836
|
+
}
|
|
837
|
+
}),
|
|
838
|
+
r({
|
|
839
|
+
name: "Copy link address",
|
|
840
|
+
icon: /* @__PURE__ */ t(D, { type: "" }),
|
|
841
|
+
onClick: async () => {
|
|
842
|
+
await navigator.clipboard.writeText(e.dto.url);
|
|
843
|
+
}
|
|
844
|
+
}),
|
|
845
|
+
r({
|
|
846
|
+
name: "Copy link text",
|
|
847
|
+
icon: /* @__PURE__ */ t(D, { type: "" }),
|
|
848
|
+
onClick: async () => {
|
|
849
|
+
await navigator.clipboard.writeText(e.dto.title);
|
|
850
|
+
}
|
|
851
|
+
})
|
|
852
|
+
]
|
|
853
|
+
}], [r, e])
|
|
854
|
+
});
|
|
855
|
+
}), Mt = i(({ item: e }) => {
|
|
856
|
+
let [n, r] = d(!1), i = a(() => r(!n), [n]), o = a(() => r(!1), []);
|
|
857
|
+
return /* @__PURE__ */ t(k, {
|
|
858
|
+
button: /* @__PURE__ */ t(v, {
|
|
859
|
+
iconType: z.get(e.type),
|
|
860
|
+
size: "s",
|
|
861
|
+
onClick: i,
|
|
862
|
+
children: e.title
|
|
863
|
+
}),
|
|
864
|
+
isOpen: n,
|
|
865
|
+
closePopover: o,
|
|
866
|
+
panelPaddingSize: "none",
|
|
867
|
+
anchorPosition: "upLeft",
|
|
868
|
+
children: /* @__PURE__ */ t(jt, {
|
|
869
|
+
item: e,
|
|
870
|
+
closePopover: o
|
|
871
|
+
})
|
|
872
|
+
});
|
|
873
|
+
}), Nt = N(() => {
|
|
874
|
+
let e = V();
|
|
875
|
+
return /* @__PURE__ */ t(C, {
|
|
876
|
+
responsive: !1,
|
|
877
|
+
gutterSize: "s",
|
|
878
|
+
justifyContent: "flexStart",
|
|
879
|
+
alignItems: "center",
|
|
880
|
+
children: e.currentItem && /* @__PURE__ */ t(Mt, { item: e.currentItem })
|
|
881
|
+
});
|
|
882
|
+
}), Pt = N(() => /* @__PURE__ */ t(y, {
|
|
883
|
+
title: "Mute",
|
|
884
|
+
"aria-label": "Mute",
|
|
885
|
+
iconType: Ge,
|
|
886
|
+
size: "s",
|
|
887
|
+
iconSize: "l",
|
|
888
|
+
disabled: !V().controller.supports("setMuted")
|
|
889
|
+
})), Ft = N(({ button: e, isOpen: r, closePopover: i }) => {
|
|
890
|
+
let o = V(), [s, l] = d("0"), u = g();
|
|
891
|
+
c(() => {
|
|
892
|
+
r && u.getVolume().then((e) => {
|
|
893
|
+
e !== void 0 && l(Math.floor(e * 100).toString());
|
|
894
|
+
});
|
|
895
|
+
}, [r, u]);
|
|
896
|
+
let ee = a(async (e) => {
|
|
897
|
+
l(e.currentTarget.value), await u.setVolume(Number(e.currentTarget.value) / 100);
|
|
898
|
+
}, [u]);
|
|
899
|
+
return /* @__PURE__ */ t(k, {
|
|
900
|
+
button: e,
|
|
901
|
+
isOpen: r,
|
|
902
|
+
closePopover: i,
|
|
903
|
+
anchorPosition: "upRight",
|
|
904
|
+
children: /* @__PURE__ */ t(T, { children: /* @__PURE__ */ n(C, {
|
|
905
|
+
responsive: !1,
|
|
906
|
+
gutterSize: "s",
|
|
907
|
+
justifyContent: "center",
|
|
908
|
+
alignItems: "center",
|
|
909
|
+
children: [/* @__PURE__ */ t(Pt, {}), /* @__PURE__ */ t(ve, {
|
|
910
|
+
min: 0,
|
|
911
|
+
max: 100,
|
|
912
|
+
step: 1,
|
|
913
|
+
value: s,
|
|
914
|
+
onChange: ee,
|
|
915
|
+
css: { blockSize: 32 },
|
|
916
|
+
disabled: !o.controller.supports("setVolume")
|
|
917
|
+
})]
|
|
918
|
+
}) })
|
|
919
|
+
});
|
|
920
|
+
}), It = N(() => {
|
|
921
|
+
let e = V(), [n, r] = d(!1);
|
|
922
|
+
return /* @__PURE__ */ t(Ft, {
|
|
923
|
+
button: /* @__PURE__ */ t(y, {
|
|
924
|
+
title: "Volume",
|
|
925
|
+
"aria-label": "Volume",
|
|
926
|
+
iconType: Ge,
|
|
927
|
+
size: "s",
|
|
928
|
+
iconSize: "l",
|
|
929
|
+
onClick: () => r(!n),
|
|
930
|
+
disabled: !e.controller.supports("getVolume")
|
|
931
|
+
}),
|
|
932
|
+
isOpen: n,
|
|
933
|
+
closePopover: () => r(!1)
|
|
934
|
+
});
|
|
935
|
+
}), Lt = ({ onClickPlayQueueButton: e }) => /* @__PURE__ */ t(y, {
|
|
936
|
+
title: "Play queue",
|
|
937
|
+
"aria-label": "Play queue",
|
|
938
|
+
iconType: Ie,
|
|
939
|
+
size: "s",
|
|
940
|
+
iconSize: "l",
|
|
941
|
+
onClick: e
|
|
942
|
+
}), Rt = N(({ closePopover: e }) => {
|
|
943
|
+
let n = V(), r = g(), [i, o] = d(), s = a(async () => {
|
|
944
|
+
await n.controller.getPlaybackRate().then((e) => o(e));
|
|
945
|
+
}, [n]), c = a(({ name: t, icon: n, onClick: r, disabled: i, className: a }) => ({
|
|
946
|
+
name: t,
|
|
947
|
+
icon: n,
|
|
948
|
+
onClick: async () => {
|
|
949
|
+
e(), r();
|
|
950
|
+
},
|
|
951
|
+
disabled: i,
|
|
952
|
+
className: a
|
|
953
|
+
}), [e]);
|
|
954
|
+
return /* @__PURE__ */ t(x, {
|
|
955
|
+
initialPanelId: 0,
|
|
956
|
+
panels: l(() => [{
|
|
957
|
+
id: 0,
|
|
958
|
+
items: [
|
|
959
|
+
{
|
|
960
|
+
name: "Speed",
|
|
961
|
+
icon: /* @__PURE__ */ t(D, { type: Ke }),
|
|
962
|
+
panel: 1,
|
|
963
|
+
onClick: s,
|
|
964
|
+
disabled: !n.controller.supports("getPlaybackRate")
|
|
965
|
+
},
|
|
966
|
+
c({
|
|
967
|
+
name: "Skip back 10 seconds",
|
|
968
|
+
icon: /* @__PURE__ */ t(D, { type: Ue }),
|
|
969
|
+
onClick: n.skipBack10,
|
|
970
|
+
disabled: !n.canSkipBack10
|
|
971
|
+
}),
|
|
972
|
+
c({
|
|
973
|
+
name: "Skip forward 30 seconds",
|
|
974
|
+
icon: /* @__PURE__ */ t(D, { type: We }),
|
|
975
|
+
onClick: n.skipForward30,
|
|
976
|
+
disabled: !n.canSkipForward30
|
|
977
|
+
}),
|
|
978
|
+
c({
|
|
979
|
+
name: `Shuffle: ${n.shuffle ? "On" : "Off"}`,
|
|
980
|
+
icon: /* @__PURE__ */ t(D, { type: n.shuffle ? Me : Ne }),
|
|
981
|
+
onClick: n.toggleShuffle,
|
|
982
|
+
disabled: !n.canToggleShuffle,
|
|
983
|
+
className: "eui-showFor--xs--flex"
|
|
984
|
+
}),
|
|
985
|
+
c({
|
|
986
|
+
name: `Repeat: ${n.repeat === H.All ? "All" : n.repeat === H.One ? "One" : "Off"}`,
|
|
987
|
+
icon: /* @__PURE__ */ t(D, { type: Ot[n.repeat] }),
|
|
988
|
+
onClick: n.toggleRepeat,
|
|
989
|
+
disabled: !n.canToggleRepeat,
|
|
990
|
+
className: "eui-showFor--xs--flex"
|
|
991
|
+
}),
|
|
992
|
+
{ isSeparator: !0 },
|
|
993
|
+
c({
|
|
994
|
+
name: "Remove from play queue",
|
|
995
|
+
icon: /* @__PURE__ */ t(D, { type: F }),
|
|
996
|
+
onClick: n.removeFromPlayQueue,
|
|
997
|
+
disabled: !n.canRemoveFromPlayQueue
|
|
998
|
+
})
|
|
999
|
+
]
|
|
1000
|
+
}, {
|
|
1001
|
+
id: 1,
|
|
1002
|
+
title: "Speed",
|
|
1003
|
+
items: [
|
|
1004
|
+
.25,
|
|
1005
|
+
.5,
|
|
1006
|
+
.75,
|
|
1007
|
+
1,
|
|
1008
|
+
1.25,
|
|
1009
|
+
1.5,
|
|
1010
|
+
1.75,
|
|
1011
|
+
2
|
|
1012
|
+
].map((e) => c({
|
|
1013
|
+
name: e.toString(),
|
|
1014
|
+
onClick: () => r.setPlaybackRate(e),
|
|
1015
|
+
icon: e === i ? "check" : "empty",
|
|
1016
|
+
disabled: !n.controller.supports("setPlaybackRate")
|
|
1017
|
+
}))
|
|
1018
|
+
}], [
|
|
1019
|
+
n,
|
|
1020
|
+
c,
|
|
1021
|
+
s,
|
|
1022
|
+
r,
|
|
1023
|
+
i
|
|
1024
|
+
])
|
|
1025
|
+
});
|
|
1026
|
+
}), zt = i(({ button: e, isOpen: n, closePopover: r }) => /* @__PURE__ */ t(k, {
|
|
1027
|
+
button: e,
|
|
1028
|
+
isOpen: n,
|
|
1029
|
+
closePopover: r,
|
|
1030
|
+
panelPaddingSize: "none",
|
|
1031
|
+
anchorPosition: "upRight",
|
|
1032
|
+
children: /* @__PURE__ */ t(Rt, { closePopover: r })
|
|
1033
|
+
})), Bt = i(() => {
|
|
1034
|
+
let [e, n] = d(!1);
|
|
1035
|
+
return /* @__PURE__ */ t(zt, {
|
|
1036
|
+
button: /* @__PURE__ */ t(y, {
|
|
1037
|
+
title: "More options",
|
|
1038
|
+
"aria-label": "More options",
|
|
1039
|
+
iconType: I,
|
|
1040
|
+
size: "s",
|
|
1041
|
+
iconSize: "l",
|
|
1042
|
+
onClick: () => n(!e)
|
|
1043
|
+
}),
|
|
1044
|
+
isOpen: e,
|
|
1045
|
+
closePopover: () => n(!1)
|
|
1046
|
+
});
|
|
1047
|
+
}), Vt = i(({ onClickPlayQueueButton: e }) => /* @__PURE__ */ n(C, {
|
|
1048
|
+
responsive: !1,
|
|
1049
|
+
gutterSize: "s",
|
|
1050
|
+
justifyContent: "flexEnd",
|
|
1051
|
+
alignItems: "center",
|
|
1052
|
+
children: [
|
|
1053
|
+
/* @__PURE__ */ t(It, {}),
|
|
1054
|
+
e && /* @__PURE__ */ t(Lt, { onClickPlayQueueButton: e }),
|
|
1055
|
+
/* @__PURE__ */ t(Bt, {})
|
|
1056
|
+
]
|
|
1057
|
+
})), Ht = N(() => {
|
|
1058
|
+
let e = V(), n = g(), r = a((t) => {
|
|
1059
|
+
let n = Number(t.currentTarget.value) / 100;
|
|
1060
|
+
e.setPercent(n);
|
|
1061
|
+
}, [e]), i = a((t) => {
|
|
1062
|
+
t.button === 0 && e.setSeeking(!0);
|
|
1063
|
+
}, [e]), o = a(async (t) => {
|
|
1064
|
+
if (t.button === 0) {
|
|
1065
|
+
let r = Number(t.currentTarget.value) / 100;
|
|
1066
|
+
e.setSeeking(!1);
|
|
1067
|
+
let i = await n.getDuration();
|
|
1068
|
+
i !== void 0 && await n.setCurrentTime(i * r);
|
|
1069
|
+
}
|
|
1070
|
+
}, [e, n]);
|
|
1071
|
+
return /* @__PURE__ */ t(ve, {
|
|
1072
|
+
min: 0,
|
|
1073
|
+
max: 100,
|
|
1074
|
+
step: 1e-7,
|
|
1075
|
+
value: e.percent * 100,
|
|
1076
|
+
onChange: r,
|
|
1077
|
+
onMouseDown: i,
|
|
1078
|
+
onMouseUp: o,
|
|
1079
|
+
fullWidth: !0,
|
|
1080
|
+
showRange: !0,
|
|
1081
|
+
css: { blockSize: 32 },
|
|
1082
|
+
disabled: !e.canSeek
|
|
1083
|
+
});
|
|
1084
|
+
}), Ut = N(({ onClickPlayQueueButton: e }) => /* @__PURE__ */ t(ce, {
|
|
1085
|
+
paddingSize: "s",
|
|
1086
|
+
children: /* @__PURE__ */ n(C, {
|
|
1087
|
+
direction: "column",
|
|
1088
|
+
gutterSize: "none",
|
|
1089
|
+
children: [/* @__PURE__ */ t(w, { children: /* @__PURE__ */ t(Ht, {}) }), /* @__PURE__ */ t(w, { children: /* @__PURE__ */ n(C, {
|
|
1090
|
+
responsive: !1,
|
|
1091
|
+
children: [
|
|
1092
|
+
/* @__PURE__ */ t(w, {
|
|
1093
|
+
css: { width: "calc(100% / 3)" },
|
|
1094
|
+
children: /* @__PURE__ */ t(Nt, {})
|
|
1095
|
+
}),
|
|
1096
|
+
/* @__PURE__ */ t(w, {
|
|
1097
|
+
css: { width: "calc(100% / 3)" },
|
|
1098
|
+
children: /* @__PURE__ */ t(At, {})
|
|
1099
|
+
}),
|
|
1100
|
+
/* @__PURE__ */ t(w, {
|
|
1101
|
+
css: { width: "calc(100% / 3)" },
|
|
1102
|
+
children: /* @__PURE__ */ t(Vt, { onClickPlayQueueButton: e })
|
|
1103
|
+
})
|
|
1104
|
+
]
|
|
1105
|
+
}) })]
|
|
1106
|
+
})
|
|
1107
|
+
})), Wt = N(() => {
|
|
1108
|
+
let e = st(), n = l(() => ({
|
|
1109
|
+
onLoaded: e.onLoaded,
|
|
1110
|
+
onPlay: e.onPlay,
|
|
1111
|
+
onPause: e.onPause,
|
|
1112
|
+
onEnded: e.onEnded,
|
|
1113
|
+
onTimeUpdate: e.onTimeUpdate
|
|
1114
|
+
}), [e]);
|
|
1115
|
+
return /* @__PURE__ */ t("div", {
|
|
1116
|
+
css: {
|
|
1117
|
+
position: "fixed",
|
|
1118
|
+
right: 0,
|
|
1119
|
+
bottom: 81,
|
|
1120
|
+
width: yt.width,
|
|
1121
|
+
height: yt.height,
|
|
1122
|
+
zIndex: 998,
|
|
1123
|
+
backgroundColor: "rgb(39, 39, 39)",
|
|
1124
|
+
display: "flex",
|
|
1125
|
+
flexDirection: "column"
|
|
1126
|
+
},
|
|
1127
|
+
children: /* @__PURE__ */ t("div", {
|
|
1128
|
+
css: {
|
|
1129
|
+
flexGrow: 1,
|
|
1130
|
+
backgroundColor: "black"
|
|
1131
|
+
},
|
|
1132
|
+
children: e.currentItem && /* @__PURE__ */ t(ie, {
|
|
1133
|
+
src: e.currentItem.url,
|
|
1134
|
+
options: n,
|
|
1135
|
+
onControllerChange: e.onControllerChange
|
|
1136
|
+
})
|
|
1137
|
+
})
|
|
1138
|
+
});
|
|
2091
1139
|
});
|
|
2092
|
-
|
|
2093
|
-
|
|
2094
|
-
|
|
2095
|
-
|
|
2096
|
-
`Invalid schema. Expected: '${JSON.stringify(
|
|
2097
|
-
t
|
|
2098
|
-
)}', but got '${JSON.stringify(n == null ? void 0 : n.schema)}'.`
|
|
2099
|
-
);
|
|
2100
|
-
return n;
|
|
2101
|
-
}
|
|
2102
|
-
const ci = {
|
|
2103
|
-
type: "object",
|
|
2104
|
-
properties: {
|
|
2105
|
-
version: {
|
|
2106
|
-
type: "string",
|
|
2107
|
-
nullable: !0
|
|
2108
|
-
},
|
|
2109
|
-
repeat: {
|
|
2110
|
-
type: "string",
|
|
2111
|
-
enum: Object.values(I),
|
|
2112
|
-
nullable: !0
|
|
2113
|
-
},
|
|
2114
|
-
shuffle: {
|
|
2115
|
-
type: "boolean",
|
|
2116
|
-
nullable: !0
|
|
2117
|
-
},
|
|
2118
|
-
items: {
|
|
2119
|
-
type: "array",
|
|
2120
|
-
nullable: !0,
|
|
2121
|
-
items: {
|
|
2122
|
-
type: "object",
|
|
2123
|
-
properties: {
|
|
2124
|
-
url: {
|
|
2125
|
-
type: "string"
|
|
2126
|
-
},
|
|
2127
|
-
type: {
|
|
2128
|
-
type: "string"
|
|
2129
|
-
},
|
|
2130
|
-
videoId: {
|
|
2131
|
-
type: "string"
|
|
2132
|
-
},
|
|
2133
|
-
title: {
|
|
2134
|
-
type: "string"
|
|
2135
|
-
}
|
|
2136
|
-
},
|
|
2137
|
-
required: ["url", "type", "videoId", "title"]
|
|
2138
|
-
}
|
|
2139
|
-
},
|
|
2140
|
-
currentIndex: {
|
|
2141
|
-
type: "integer",
|
|
2142
|
-
nullable: !0
|
|
2143
|
-
}
|
|
2144
|
-
}
|
|
2145
|
-
}, ui = li(
|
|
2146
|
-
ci,
|
|
2147
|
-
"PlayQueueStore"
|
|
2148
|
-
);
|
|
2149
|
-
class di {
|
|
2150
|
-
constructor(e) {
|
|
2151
|
-
V(this, "interacted", !1);
|
|
2152
|
-
V(this, "items", []);
|
|
2153
|
-
V(this, "currentId");
|
|
2154
|
-
V(this, "repeat", I.Off);
|
|
2155
|
-
V(this, "shuffle", !1);
|
|
2156
|
-
this.observableStateProvider = e, e.makeObservable(this, {
|
|
2157
|
-
interacted: Q,
|
|
2158
|
-
items: Q,
|
|
2159
|
-
currentId: Q,
|
|
2160
|
-
repeat: Q,
|
|
2161
|
-
shuffle: Q,
|
|
2162
|
-
localStorageState: w.struct,
|
|
2163
|
-
isEmpty: w,
|
|
2164
|
-
currentItem: w,
|
|
2165
|
-
canPlay: w,
|
|
2166
|
-
canPause: w,
|
|
2167
|
-
hasMultipleItems: w,
|
|
2168
|
-
currentIndex: w,
|
|
2169
|
-
hasPreviousItem: w,
|
|
2170
|
-
hasNextItem: w,
|
|
2171
|
-
isLastItem: w,
|
|
2172
|
-
selectedItems: w,
|
|
2173
|
-
allItemsSelected: w,
|
|
2174
|
-
selectedItemsOrAllItems: w,
|
|
2175
|
-
setItems: y,
|
|
2176
|
-
interact: y,
|
|
2177
|
-
clear: y.bound,
|
|
2178
|
-
unselectAll: y,
|
|
2179
|
-
setCurrentItem: y,
|
|
2180
|
-
setNextItems: y,
|
|
2181
|
-
clearAndSetItems: y,
|
|
2182
|
-
playNext: y,
|
|
2183
|
-
playSelectedItemsNext: y.bound,
|
|
2184
|
-
addItems: y,
|
|
2185
|
-
addSelectedItems: y.bound,
|
|
2186
|
-
playFirst: y,
|
|
2187
|
-
moveItem: y,
|
|
2188
|
-
removeItems: y,
|
|
2189
|
-
removeSelectedItems: y.bound,
|
|
2190
|
-
removeOtherItems: y,
|
|
2191
|
-
removeItemsAbove: y,
|
|
2192
|
-
toggleRepeat: y.bound,
|
|
2193
|
-
toggleShuffle: y.bound,
|
|
2194
|
-
previous: y,
|
|
2195
|
-
next: y.bound,
|
|
2196
|
-
goToFirst: y
|
|
2197
|
-
});
|
|
2198
|
-
}
|
|
2199
|
-
createItem(e) {
|
|
2200
|
-
return ot.fromDto(
|
|
2201
|
-
this.observableStateProvider,
|
|
2202
|
-
this,
|
|
2203
|
-
e
|
|
2204
|
-
);
|
|
2205
|
-
}
|
|
2206
|
-
get localStorageState() {
|
|
2207
|
-
return {
|
|
2208
|
-
version: "1.0",
|
|
2209
|
-
repeat: this.repeat,
|
|
2210
|
-
shuffle: this.shuffle,
|
|
2211
|
-
items: this.items.map((e) => e.dto),
|
|
2212
|
-
currentIndex: this.currentIndex
|
|
2213
|
-
};
|
|
2214
|
-
}
|
|
2215
|
-
set localStorageState(e) {
|
|
2216
|
-
var n;
|
|
2217
|
-
this.repeat = e.repeat ?? I.Off, this.shuffle = e.shuffle ?? !1, this.items = ((n = e.items) == null ? void 0 : n.map((i) => this.createItem(i))) ?? [], this.currentIndex = e.currentIndex;
|
|
2218
|
-
}
|
|
2219
|
-
validateLocalStorageState(e) {
|
|
2220
|
-
return ui(e);
|
|
2221
|
-
}
|
|
2222
|
-
get isEmpty() {
|
|
2223
|
-
return this.items.length === 0;
|
|
2224
|
-
}
|
|
2225
|
-
get currentItem() {
|
|
2226
|
-
return this.items.find((e) => e.id === this.currentId);
|
|
2227
|
-
}
|
|
2228
|
-
get canPlay() {
|
|
2229
|
-
return this.currentItem !== void 0;
|
|
2230
|
-
}
|
|
2231
|
-
get canPause() {
|
|
2232
|
-
return this.currentItem !== void 0;
|
|
2233
|
-
}
|
|
2234
|
-
get hasMultipleItems() {
|
|
2235
|
-
return this.items.length > 1;
|
|
2236
|
-
}
|
|
2237
|
-
get currentIndex() {
|
|
2238
|
-
return this.currentId !== void 0 ? this.items.findIndex((e) => e.id === this.currentId) : void 0;
|
|
2239
|
-
}
|
|
2240
|
-
set currentIndex(e) {
|
|
2241
|
-
var n;
|
|
2242
|
-
this.currentId = e !== void 0 ? (n = this.items.at(e)) == null ? void 0 : n.id : void 0;
|
|
2243
|
-
}
|
|
2244
|
-
get hasPreviousItem() {
|
|
2245
|
-
return this.hasMultipleItems && this.currentIndex !== void 0 && this.currentIndex > 0;
|
|
2246
|
-
}
|
|
2247
|
-
get hasNextItem() {
|
|
2248
|
-
return this.hasMultipleItems && this.currentIndex !== void 0 && this.currentIndex < this.items.length - 1;
|
|
2249
|
-
}
|
|
2250
|
-
get isLastItem() {
|
|
2251
|
-
return this.currentIndex !== void 0 && this.currentIndex === this.items.length - 1;
|
|
2252
|
-
}
|
|
2253
|
-
get selectedItems() {
|
|
2254
|
-
return this.items.filter((e) => e.isSelected);
|
|
2255
|
-
}
|
|
2256
|
-
get allItemsSelected() {
|
|
2257
|
-
return this.selectedItems.length === this.items.length;
|
|
2258
|
-
}
|
|
2259
|
-
set allItemsSelected(e) {
|
|
2260
|
-
for (const n of this.items)
|
|
2261
|
-
n.isSelected = e;
|
|
2262
|
-
}
|
|
2263
|
-
get selectedItemsOrAllItems() {
|
|
2264
|
-
return this.selectedItems.length > 0 ? this.selectedItems : this.items;
|
|
2265
|
-
}
|
|
2266
|
-
setItems(e) {
|
|
2267
|
-
this.items = e;
|
|
2268
|
-
}
|
|
2269
|
-
interact() {
|
|
2270
|
-
this.interacted = !0;
|
|
2271
|
-
}
|
|
2272
|
-
clear() {
|
|
2273
|
-
this.interact(), this.currentIndex = void 0, this.items = [];
|
|
2274
|
-
}
|
|
2275
|
-
unselectAll() {
|
|
2276
|
-
for (const e of this.items)
|
|
2277
|
-
e.unselect();
|
|
2278
|
-
}
|
|
2279
|
-
setCurrentItem(e) {
|
|
2280
|
-
this.interact(), this.currentId = e == null ? void 0 : e.id;
|
|
2281
|
-
}
|
|
2282
|
-
setNextItems(e) {
|
|
2283
|
-
this.currentIndex !== void 0 && this.items.splice(this.currentIndex + 1, 0, ...e);
|
|
2284
|
-
}
|
|
2285
|
-
clearAndSetItems(e) {
|
|
2286
|
-
this.clear(), this.setCurrentItem(e[0]), this.setNextItems(e);
|
|
2287
|
-
}
|
|
2288
|
-
async playNext(e) {
|
|
2289
|
-
if (this.isEmpty) {
|
|
2290
|
-
this.clearAndSetItems(e);
|
|
2291
|
-
return;
|
|
2292
|
-
}
|
|
2293
|
-
this.setNextItems(e);
|
|
2294
|
-
}
|
|
2295
|
-
async playSelectedItemsNext() {
|
|
2296
|
-
await this.playNext(
|
|
2297
|
-
this.selectedItemsOrAllItems.map((e) => e.clone())
|
|
2298
|
-
), this.unselectAll();
|
|
2299
|
-
}
|
|
2300
|
-
async addItems(e) {
|
|
2301
|
-
if (this.isEmpty) {
|
|
2302
|
-
this.clearAndSetItems(e);
|
|
2303
|
-
return;
|
|
2304
|
-
}
|
|
2305
|
-
this.items.push(...e);
|
|
2306
|
-
}
|
|
2307
|
-
async addSelectedItems() {
|
|
2308
|
-
await this.addItems(
|
|
2309
|
-
this.selectedItemsOrAllItems.map((e) => e.clone())
|
|
2310
|
-
), this.unselectAll();
|
|
2311
|
-
}
|
|
2312
|
-
async playFirst(e) {
|
|
2313
|
-
if (this.isEmpty) {
|
|
2314
|
-
this.clearAndSetItems(e);
|
|
2315
|
-
return;
|
|
2316
|
-
}
|
|
2317
|
-
const { currentIndex: n } = this;
|
|
2318
|
-
n !== void 0 && (this.interact(), this.items.splice(n, 0, ...e), this.currentIndex = n);
|
|
2319
|
-
}
|
|
2320
|
-
moveItem(e, n) {
|
|
2321
|
-
const i = this.items.splice(this.items.indexOf(e), 1)[0];
|
|
2322
|
-
this.items.splice(n, 0, i);
|
|
2323
|
-
}
|
|
2324
|
-
async removeItems(e) {
|
|
2325
|
-
const { currentItem: n } = this;
|
|
2326
|
-
Rt(this.items, ...e.filter((l) => l !== n));
|
|
2327
|
-
const { currentIndex: i, isLastItem: a } = this;
|
|
2328
|
-
Rt(
|
|
2329
|
-
this.items,
|
|
2330
|
-
e.find((l) => l === n)
|
|
2331
|
-
), this.currentItem !== n && (this.interact(), a ? await this.goToFirst() : this.currentIndex = i);
|
|
2332
|
-
}
|
|
2333
|
-
async removeSelectedItems() {
|
|
2334
|
-
await this.removeItems(this.selectedItemsOrAllItems), this.unselectAll();
|
|
2335
|
-
}
|
|
2336
|
-
async removeOtherItems(e) {
|
|
2337
|
-
const n = e.id;
|
|
2338
|
-
return this.removeItems(
|
|
2339
|
-
this.items.filter((i) => i.id !== n)
|
|
2340
|
-
);
|
|
2341
|
-
}
|
|
2342
|
-
async removeItemsAbove(e) {
|
|
2343
|
-
const n = this.items.indexOf(e);
|
|
2344
|
-
return this.removeItems(
|
|
2345
|
-
this.items.filter((i, a) => a < n)
|
|
2346
|
-
);
|
|
2347
|
-
}
|
|
2348
|
-
toggleRepeat() {
|
|
2349
|
-
switch (this.repeat) {
|
|
2350
|
-
case I.Off:
|
|
2351
|
-
this.repeat = I.All;
|
|
2352
|
-
break;
|
|
2353
|
-
case I.All:
|
|
2354
|
-
this.repeat = I.One;
|
|
2355
|
-
break;
|
|
2356
|
-
case I.One:
|
|
2357
|
-
this.repeat = I.Off;
|
|
2358
|
-
break;
|
|
2359
|
-
}
|
|
2360
|
-
}
|
|
2361
|
-
toggleShuffle() {
|
|
2362
|
-
this.shuffle = !this.shuffle;
|
|
2363
|
-
}
|
|
2364
|
-
async previous() {
|
|
2365
|
-
this.currentIndex !== void 0 && this.hasPreviousItem && (this.interact(), this.currentIndex--);
|
|
2366
|
-
}
|
|
2367
|
-
async next() {
|
|
2368
|
-
this.currentIndex !== void 0 && this.hasNextItem && (this.interact(), this.currentIndex++);
|
|
2369
|
-
}
|
|
2370
|
-
async goToFirst() {
|
|
2371
|
-
this.currentIndex !== void 0 && (this.currentIndex = 0);
|
|
2372
|
-
}
|
|
1140
|
+
//#endregion
|
|
1141
|
+
//#region src/features/media-player.play-queue/helpers/isNoembedResult.ts
|
|
1142
|
+
function Gt(e) {
|
|
1143
|
+
return typeof e == "object" && !!e && "title" in e && typeof e.title == "string";
|
|
2373
1144
|
}
|
|
2374
|
-
|
|
2375
|
-
|
|
2376
|
-
}) => {
|
|
2377
|
-
|
|
2378
|
-
|
|
2379
|
-
|
|
2380
|
-
|
|
2381
|
-
|
|
2382
|
-
|
|
2383
|
-
|
|
2384
|
-
|
|
2385
|
-
|
|
2386
|
-
|
|
2387
|
-
|
|
2388
|
-
|
|
2389
|
-
|
|
2390
|
-
|
|
2391
|
-
|
|
2392
|
-
|
|
2393
|
-
|
|
2394
|
-
|
|
2395
|
-
|
|
2396
|
-
|
|
2397
|
-
|
|
2398
|
-
|
|
2399
|
-
|
|
2400
|
-
|
|
2401
|
-
|
|
2402
|
-
|
|
2403
|
-
|
|
2404
|
-
|
|
2405
|
-
|
|
2406
|
-
|
|
2407
|
-
|
|
2408
|
-
|
|
2409
|
-
|
|
2410
|
-
|
|
2411
|
-
|
|
2412
|
-
|
|
2413
|
-
|
|
2414
|
-
|
|
2415
|
-
|
|
2416
|
-
|
|
2417
|
-
|
|
2418
|
-
|
|
2419
|
-
|
|
2420
|
-
|
|
2421
|
-
|
|
2422
|
-
|
|
2423
|
-
|
|
2424
|
-
|
|
2425
|
-
|
|
2426
|
-
|
|
2427
|
-
|
|
2428
|
-
|
|
2429
|
-
|
|
2430
|
-
|
|
2431
|
-
|
|
2432
|
-
|
|
2433
|
-
|
|
2434
|
-
|
|
2435
|
-
|
|
2436
|
-
|
|
2437
|
-
|
|
2438
|
-
|
|
2439
|
-
|
|
2440
|
-
|
|
2441
|
-
|
|
2442
|
-
|
|
2443
|
-
|
|
2444
|
-
|
|
2445
|
-
|
|
2446
|
-
|
|
2447
|
-
|
|
2448
|
-
|
|
2449
|
-
|
|
2450
|
-
|
|
2451
|
-
}
|
|
2452
|
-
|
|
2453
|
-
|
|
2454
|
-
|
|
2455
|
-
|
|
2456
|
-
|
|
2457
|
-
|
|
2458
|
-
|
|
2459
|
-
|
|
2460
|
-
|
|
2461
|
-
|
|
2462
|
-
|
|
2463
|
-
|
|
2464
|
-
|
|
2465
|
-
|
|
2466
|
-
|
|
2467
|
-
|
|
2468
|
-
|
|
2469
|
-
|
|
2470
|
-
|
|
1145
|
+
//#endregion
|
|
1146
|
+
//#region src/features/media-player.play-queue/components/AddVideoModal.tsx
|
|
1147
|
+
var Kt = R.create(({ remove: e, resolve: r }) => {
|
|
1148
|
+
let i = De({ prefix: "modalForm" }), [a, o] = d(""), [s, c] = d(""), [l, u] = d(!1);
|
|
1149
|
+
return /* @__PURE__ */ n(pe, {
|
|
1150
|
+
onClose: e,
|
|
1151
|
+
initialFocus: "[name=url]",
|
|
1152
|
+
children: [
|
|
1153
|
+
/* @__PURE__ */ t(ge, { children: /* @__PURE__ */ t(_e, { children: "Add video" }) }),
|
|
1154
|
+
/* @__PURE__ */ t(me, { children: /* @__PURE__ */ n(de, {
|
|
1155
|
+
id: i,
|
|
1156
|
+
component: "form",
|
|
1157
|
+
onSubmit: async (t) => {
|
|
1158
|
+
t.preventDefault();
|
|
1159
|
+
try {
|
|
1160
|
+
u(!0);
|
|
1161
|
+
let t = oe(a);
|
|
1162
|
+
if (t === void 0) return;
|
|
1163
|
+
let n = t.extractVideoId(a);
|
|
1164
|
+
if (n === void 0) return;
|
|
1165
|
+
let i = await (await fetch(`https://noembed.com/embed?url=${encodeURIComponent(a)}`)).json();
|
|
1166
|
+
r({
|
|
1167
|
+
url: a,
|
|
1168
|
+
type: t.type,
|
|
1169
|
+
videoId: n,
|
|
1170
|
+
title: s || (Gt(i) ? i.title : n)
|
|
1171
|
+
}), e();
|
|
1172
|
+
} finally {
|
|
1173
|
+
u(!1);
|
|
1174
|
+
}
|
|
1175
|
+
},
|
|
1176
|
+
children: [/* @__PURE__ */ t(T, {
|
|
1177
|
+
label: "URL",
|
|
1178
|
+
children: /* @__PURE__ */ t(S, {
|
|
1179
|
+
name: "url",
|
|
1180
|
+
value: a,
|
|
1181
|
+
onChange: (e) => o(e.target.value)
|
|
1182
|
+
})
|
|
1183
|
+
}), /* @__PURE__ */ t(T, {
|
|
1184
|
+
label: "Title",
|
|
1185
|
+
children: /* @__PURE__ */ t(S, {
|
|
1186
|
+
name: "title",
|
|
1187
|
+
value: s,
|
|
1188
|
+
onChange: (e) => c(e.target.value)
|
|
1189
|
+
})
|
|
1190
|
+
})]
|
|
1191
|
+
}) }),
|
|
1192
|
+
/* @__PURE__ */ n(he, { children: [/* @__PURE__ */ t(v, {
|
|
1193
|
+
onClick: e,
|
|
1194
|
+
children: "Cancel"
|
|
1195
|
+
}), /* @__PURE__ */ t(_, {
|
|
1196
|
+
type: "submit",
|
|
1197
|
+
form: i,
|
|
1198
|
+
fill: !0,
|
|
1199
|
+
disabled: a.trim().length === 0,
|
|
1200
|
+
isLoading: l,
|
|
1201
|
+
children: "Add video"
|
|
1202
|
+
})] })
|
|
1203
|
+
]
|
|
1204
|
+
});
|
|
1205
|
+
}), qt = i(({ onFulfilled: e }) => /* @__PURE__ */ t(_, {
|
|
1206
|
+
onClick: () => R.show(Kt).then(e),
|
|
1207
|
+
iconType: P,
|
|
1208
|
+
color: "primary",
|
|
1209
|
+
children: "Add video"
|
|
1210
|
+
})), Jt = N(({ playQueue: e }) => /* @__PURE__ */ t(_, {
|
|
1211
|
+
iconType: P,
|
|
1212
|
+
onClick: e.addSelectedItems,
|
|
1213
|
+
disabled: !e.canAddSelectedItems,
|
|
1214
|
+
children: "Add to play queue"
|
|
1215
|
+
})), Yt = N(({ playQueue: e, closePopover: n }) => {
|
|
1216
|
+
let r = a(({ name: e, icon: t, disabled: r, onClick: i }) => ({
|
|
1217
|
+
name: e,
|
|
1218
|
+
icon: t,
|
|
1219
|
+
disabled: r,
|
|
1220
|
+
onClick: async (e) => {
|
|
1221
|
+
n(), i(e);
|
|
1222
|
+
}
|
|
1223
|
+
}), [n]);
|
|
1224
|
+
return /* @__PURE__ */ t(x, {
|
|
1225
|
+
initialPanelId: 0,
|
|
1226
|
+
panels: l(() => [{
|
|
1227
|
+
id: 0,
|
|
1228
|
+
items: [
|
|
1229
|
+
r({
|
|
1230
|
+
name: "Play next",
|
|
1231
|
+
icon: /* @__PURE__ */ t(D, { type: "" }),
|
|
1232
|
+
disabled: !e.canPlaySelectedItemsNext,
|
|
1233
|
+
onClick: e.playSelectedItemsNext
|
|
1234
|
+
}),
|
|
1235
|
+
r({
|
|
1236
|
+
name: "Add to play queue",
|
|
1237
|
+
icon: /* @__PURE__ */ t(D, { type: P }),
|
|
1238
|
+
onClick: e.addSelectedItems,
|
|
1239
|
+
disabled: !e.canAddSelectedItems
|
|
1240
|
+
}),
|
|
1241
|
+
r({
|
|
1242
|
+
name: "Remove",
|
|
1243
|
+
icon: /* @__PURE__ */ t(D, { type: F }),
|
|
1244
|
+
onClick: e.removeSelectedItems,
|
|
1245
|
+
disabled: !e.canRemoveSelectedItems
|
|
1246
|
+
}),
|
|
1247
|
+
r({
|
|
1248
|
+
name: "Clear",
|
|
1249
|
+
icon: /* @__PURE__ */ t(D, { type: Fe }),
|
|
1250
|
+
onClick: e.clear,
|
|
1251
|
+
disabled: !e.canClear
|
|
1252
|
+
})
|
|
1253
|
+
]
|
|
1254
|
+
}], [r, e])
|
|
1255
|
+
});
|
|
1256
|
+
}), Xt = i(({ playQueue: e }) => {
|
|
1257
|
+
let [n, r] = d(!1), i = a(() => r(!n), [n]), o = a(() => r(!1), []);
|
|
1258
|
+
return /* @__PURE__ */ t(k, {
|
|
1259
|
+
button: /* @__PURE__ */ t(y, {
|
|
1260
|
+
display: "base",
|
|
1261
|
+
size: "m",
|
|
1262
|
+
iconType: I,
|
|
1263
|
+
onClick: i
|
|
1264
|
+
}),
|
|
1265
|
+
isOpen: n,
|
|
1266
|
+
closePopover: o,
|
|
1267
|
+
panelPaddingSize: "none",
|
|
1268
|
+
anchorPosition: "downLeft",
|
|
1269
|
+
children: /* @__PURE__ */ t(Yt, {
|
|
1270
|
+
playQueue: e,
|
|
1271
|
+
closePopover: o
|
|
1272
|
+
})
|
|
1273
|
+
});
|
|
1274
|
+
}), Zt = N(({ playQueue: e }) => {
|
|
1275
|
+
let { euiTheme: r } = M();
|
|
1276
|
+
return /* @__PURE__ */ n(C, {
|
|
1277
|
+
alignItems: "center",
|
|
1278
|
+
gutterSize: "m",
|
|
1279
|
+
responsive: !1,
|
|
1280
|
+
style: {
|
|
1281
|
+
position: "sticky",
|
|
1282
|
+
top: 48,
|
|
1283
|
+
zIndex: 998,
|
|
1284
|
+
background: r.colors.backgroundBasePlain
|
|
1285
|
+
},
|
|
1286
|
+
children: [
|
|
1287
|
+
/* @__PURE__ */ n(E, {
|
|
1288
|
+
sizes: ["xs"],
|
|
1289
|
+
children: [
|
|
1290
|
+
/* @__PURE__ */ t(w, {
|
|
1291
|
+
grow: !1,
|
|
1292
|
+
children: /* @__PURE__ */ t(_, {
|
|
1293
|
+
disabled: !e.canPlaySelectedItemsNext,
|
|
1294
|
+
onClick: e.playSelectedItemsNext,
|
|
1295
|
+
children: "Play next"
|
|
1296
|
+
})
|
|
1297
|
+
}),
|
|
1298
|
+
/* @__PURE__ */ t(w, {
|
|
1299
|
+
grow: !1,
|
|
1300
|
+
children: /* @__PURE__ */ t(Jt, { playQueue: e })
|
|
1301
|
+
}),
|
|
1302
|
+
/* @__PURE__ */ t(w, {
|
|
1303
|
+
grow: !1,
|
|
1304
|
+
children: /* @__PURE__ */ t(_, {
|
|
1305
|
+
iconType: F,
|
|
1306
|
+
onClick: e.removeSelectedItems,
|
|
1307
|
+
disabled: !e.canRemoveSelectedItems,
|
|
1308
|
+
children: "Remove"
|
|
1309
|
+
})
|
|
1310
|
+
}),
|
|
1311
|
+
/* @__PURE__ */ t(w, {
|
|
1312
|
+
grow: !1,
|
|
1313
|
+
children: /* @__PURE__ */ t(_, {
|
|
1314
|
+
iconType: Fe,
|
|
1315
|
+
onClick: e.clear,
|
|
1316
|
+
disabled: !e.canClear,
|
|
1317
|
+
children: "Clear"
|
|
1318
|
+
})
|
|
1319
|
+
})
|
|
1320
|
+
]
|
|
1321
|
+
}),
|
|
1322
|
+
/* @__PURE__ */ t(ye, {
|
|
1323
|
+
sizes: ["xs"],
|
|
1324
|
+
children: /* @__PURE__ */ t(Xt, { playQueue: e })
|
|
1325
|
+
}),
|
|
1326
|
+
/* @__PURE__ */ t(w, { grow: !0 }),
|
|
1327
|
+
/* @__PURE__ */ t(w, {
|
|
1328
|
+
grow: !1,
|
|
1329
|
+
children: /* @__PURE__ */ t(qt, { onFulfilled: e.addItemFromDto })
|
|
1330
|
+
})
|
|
1331
|
+
]
|
|
1332
|
+
});
|
|
1333
|
+
}), Qt = N(({ playQueue: r }) => {
|
|
1334
|
+
let { euiTheme: i } = M();
|
|
1335
|
+
return /* @__PURE__ */ n(e, { children: [/* @__PURE__ */ t(we, { children: /* @__PURE__ */ t(C, {
|
|
1336
|
+
responsive: !1,
|
|
1337
|
+
justifyContent: "spaceBetween",
|
|
1338
|
+
alignItems: "baseline",
|
|
1339
|
+
children: /* @__PURE__ */ t(w, {
|
|
1340
|
+
grow: !1,
|
|
1341
|
+
children: /* @__PURE__ */ t(b, {
|
|
1342
|
+
id: "",
|
|
1343
|
+
checked: r.allItemsSelected,
|
|
1344
|
+
onChange: (e) => {
|
|
1345
|
+
e.target.checked ? r.selectAll() : r.unselectAll();
|
|
1346
|
+
}
|
|
1347
|
+
})
|
|
1348
|
+
})
|
|
1349
|
+
}) }), /* @__PURE__ */ n(Se, {
|
|
1350
|
+
style: {
|
|
1351
|
+
position: "sticky",
|
|
1352
|
+
top: 112,
|
|
1353
|
+
zIndex: 998,
|
|
1354
|
+
background: i.colors.backgroundBasePlain
|
|
1355
|
+
},
|
|
1356
|
+
children: [
|
|
1357
|
+
/* @__PURE__ */ t(Ce, { children: /* @__PURE__ */ t(b, {
|
|
1358
|
+
id: "",
|
|
1359
|
+
checked: r.allItemsSelected,
|
|
1360
|
+
onChange: (e) => {
|
|
1361
|
+
e.target.checked ? r.selectAll() : r.unselectAll();
|
|
1362
|
+
}
|
|
1363
|
+
}) }),
|
|
1364
|
+
/* @__PURE__ */ t(A, { width: 24 }),
|
|
1365
|
+
/* @__PURE__ */ t(A, { children: "Title" }),
|
|
1366
|
+
/* @__PURE__ */ t(A, {})
|
|
1367
|
+
]
|
|
1368
|
+
})] });
|
|
1369
|
+
}), $t = N(({ item: e, closePopover: n }) => {
|
|
1370
|
+
let r = a(({ name: e, icon: t, disabled: r, onClick: i, className: a }) => ({
|
|
1371
|
+
name: e,
|
|
1372
|
+
icon: t,
|
|
1373
|
+
disabled: r,
|
|
1374
|
+
onClick: async (e) => {
|
|
1375
|
+
n(), i(e);
|
|
1376
|
+
},
|
|
1377
|
+
className: a
|
|
1378
|
+
}), [n]);
|
|
1379
|
+
return /* @__PURE__ */ t(x, {
|
|
1380
|
+
initialPanelId: 0,
|
|
1381
|
+
panels: l(() => [{
|
|
1382
|
+
id: 0,
|
|
1383
|
+
items: [
|
|
1384
|
+
r({
|
|
1385
|
+
name: "Play",
|
|
1386
|
+
icon: /* @__PURE__ */ t(D, { type: L }),
|
|
1387
|
+
onClick: e.play,
|
|
1388
|
+
className: "eui-showFor--xs--flex"
|
|
1389
|
+
}),
|
|
1390
|
+
r({
|
|
1391
|
+
name: "Play first",
|
|
1392
|
+
icon: /* @__PURE__ */ t(D, { type: "" }),
|
|
1393
|
+
onClick: e.playFirst
|
|
1394
|
+
}),
|
|
1395
|
+
r({
|
|
1396
|
+
name: "Play next",
|
|
1397
|
+
icon: /* @__PURE__ */ t(D, { type: "" }),
|
|
1398
|
+
onClick: e.playNext
|
|
1399
|
+
}),
|
|
1400
|
+
r({
|
|
1401
|
+
name: "Add to play queue",
|
|
1402
|
+
icon: /* @__PURE__ */ t(D, { type: P }),
|
|
1403
|
+
onClick: e.addToPlayQueue
|
|
1404
|
+
}),
|
|
1405
|
+
{ isSeparator: !0 },
|
|
1406
|
+
r({
|
|
1407
|
+
name: "Move to the top",
|
|
1408
|
+
icon: /* @__PURE__ */ t(D, { type: Pe }),
|
|
1409
|
+
onClick: e.moveToTop,
|
|
1410
|
+
disabled: !e.canMoveToTop
|
|
1411
|
+
}),
|
|
1412
|
+
r({
|
|
1413
|
+
name: "Move to the bottom",
|
|
1414
|
+
icon: /* @__PURE__ */ t(D, { type: Oe }),
|
|
1415
|
+
onClick: e.moveToBottom,
|
|
1416
|
+
disabled: !e.canMoveToBottom
|
|
1417
|
+
}),
|
|
1418
|
+
{ isSeparator: !0 },
|
|
1419
|
+
r({
|
|
1420
|
+
name: "Remove",
|
|
1421
|
+
icon: /* @__PURE__ */ t(D, { type: F }),
|
|
1422
|
+
onClick: e.remove,
|
|
1423
|
+
className: "eui-showFor--xs--flex"
|
|
1424
|
+
}),
|
|
1425
|
+
r({
|
|
1426
|
+
name: "Remove to the top",
|
|
1427
|
+
icon: /* @__PURE__ */ t(D, { type: "" }),
|
|
1428
|
+
onClick: e.removeToTop,
|
|
1429
|
+
disabled: !e.canRemoveToTop
|
|
1430
|
+
}),
|
|
1431
|
+
r({
|
|
1432
|
+
name: "Remove others",
|
|
1433
|
+
icon: /* @__PURE__ */ t(D, { type: "" }),
|
|
1434
|
+
onClick: e.removeOthers,
|
|
1435
|
+
disabled: !e.canRemoveOthers
|
|
1436
|
+
})
|
|
1437
|
+
]
|
|
1438
|
+
}], [r, e])
|
|
1439
|
+
});
|
|
1440
|
+
}), en = i(({ item: e }) => {
|
|
1441
|
+
let [n, r] = d(!1), i = a(() => r(!n), [n]), o = a(() => r(!1), []);
|
|
1442
|
+
return /* @__PURE__ */ t(k, {
|
|
1443
|
+
button: /* @__PURE__ */ t(y, {
|
|
1444
|
+
title: "More options",
|
|
1445
|
+
"aria-label": "More options",
|
|
1446
|
+
iconType: I,
|
|
1447
|
+
size: "s",
|
|
1448
|
+
color: "text",
|
|
1449
|
+
onClick: i
|
|
1450
|
+
}),
|
|
1451
|
+
isOpen: n,
|
|
1452
|
+
closePopover: o,
|
|
1453
|
+
panelPaddingSize: "none",
|
|
1454
|
+
anchorPosition: "leftCenter",
|
|
1455
|
+
children: /* @__PURE__ */ t($t, {
|
|
1456
|
+
item: e,
|
|
1457
|
+
closePopover: o
|
|
1458
|
+
})
|
|
1459
|
+
});
|
|
1460
|
+
}), tn = N(({ item: e }) => {
|
|
1461
|
+
let r = g();
|
|
1462
|
+
return /* @__PURE__ */ n(j, {
|
|
1463
|
+
textOnly: !1,
|
|
1464
|
+
hasActions: !0,
|
|
1465
|
+
align: "right",
|
|
1466
|
+
children: [/* @__PURE__ */ n(E, {
|
|
1467
|
+
sizes: ["xs"],
|
|
1468
|
+
children: [/* @__PURE__ */ t(_, {
|
|
1469
|
+
iconType: L,
|
|
1470
|
+
size: "s",
|
|
1471
|
+
onClick: async () => {
|
|
1472
|
+
e.isCurrent ? await r.setCurrentTime(0) : await e.play();
|
|
1473
|
+
},
|
|
1474
|
+
children: "Play"
|
|
1475
|
+
}), /* @__PURE__ */ t(_, {
|
|
1476
|
+
iconType: F,
|
|
1477
|
+
size: "s",
|
|
1478
|
+
onClick: e.remove,
|
|
1479
|
+
children: "Remove"
|
|
1480
|
+
})]
|
|
1481
|
+
}), /* @__PURE__ */ t(en, { item: e })]
|
|
1482
|
+
});
|
|
1483
|
+
}), nn = N(({ item: e }) => {
|
|
1484
|
+
let r = u(null), { isCurrent: i } = e;
|
|
1485
|
+
return s(() => {
|
|
1486
|
+
i && r.current?.closest("tr")?.scrollIntoView({
|
|
1487
|
+
behavior: "smooth",
|
|
1488
|
+
block: "center"
|
|
1489
|
+
});
|
|
1490
|
+
}, [i]), /* @__PURE__ */ n(Te, {
|
|
1491
|
+
isSelected: e.isCurrent,
|
|
1492
|
+
hasSelection: !0,
|
|
1493
|
+
hasActions: !0,
|
|
1494
|
+
children: [
|
|
1495
|
+
/* @__PURE__ */ t(Ee, { children: /* @__PURE__ */ t(b, {
|
|
1496
|
+
id: e.id.toString(),
|
|
1497
|
+
checked: e.isSelected,
|
|
1498
|
+
onChange: e.toggleSelected
|
|
1499
|
+
}) }),
|
|
1500
|
+
/* @__PURE__ */ t(j, {
|
|
1501
|
+
textOnly: !1,
|
|
1502
|
+
children: /* @__PURE__ */ t("img", {
|
|
1503
|
+
ref: r,
|
|
1504
|
+
src: z.get(e.type),
|
|
1505
|
+
width: 16,
|
|
1506
|
+
height: 16,
|
|
1507
|
+
alt: e.type
|
|
1508
|
+
})
|
|
1509
|
+
}),
|
|
1510
|
+
/* @__PURE__ */ t(j, {
|
|
1511
|
+
mobileOptions: {
|
|
1512
|
+
header: !1,
|
|
1513
|
+
enlarge: !0,
|
|
1514
|
+
width: "100%"
|
|
1515
|
+
},
|
|
1516
|
+
children: /* @__PURE__ */ t(fe, {
|
|
1517
|
+
href: e.url,
|
|
1518
|
+
target: "_blank",
|
|
1519
|
+
external: !0,
|
|
1520
|
+
children: e.title
|
|
1521
|
+
})
|
|
1522
|
+
}),
|
|
1523
|
+
/* @__PURE__ */ t(tn, { item: e })
|
|
1524
|
+
]
|
|
1525
|
+
});
|
|
1526
|
+
}), rn = N(({ playQueue: e }) => /* @__PURE__ */ t(qe, {
|
|
1527
|
+
tag: "tbody",
|
|
1528
|
+
list: e.items,
|
|
1529
|
+
setList: (t) => e.setItems(t),
|
|
1530
|
+
children: e.items.map((e) => /* @__PURE__ */ t(nn, { item: e }, e.id))
|
|
1531
|
+
})), an = N(({ playQueue: e }) => /* @__PURE__ */ n(xe, { children: [/* @__PURE__ */ t(Qt, { playQueue: e }), /* @__PURE__ */ t(rn, { playQueue: e })] })), on = N(({ playQueue: e }) => {
|
|
1532
|
+
let { euiTheme: r } = M();
|
|
1533
|
+
return /* @__PURE__ */ n(O.Section, { children: [
|
|
1534
|
+
/* @__PURE__ */ t(Zt, { playQueue: e }),
|
|
1535
|
+
/* @__PURE__ */ t(be, {
|
|
1536
|
+
size: "l",
|
|
1537
|
+
style: {
|
|
1538
|
+
position: "sticky",
|
|
1539
|
+
top: 88,
|
|
1540
|
+
zIndex: 998,
|
|
1541
|
+
background: r.colors.backgroundBasePlain
|
|
1542
|
+
}
|
|
1543
|
+
}),
|
|
1544
|
+
e.isEmpty ? /* @__PURE__ */ t(ue, {
|
|
1545
|
+
title: /* @__PURE__ */ t("h2", { children: "We couldn't find any videos" }),
|
|
1546
|
+
body: /* @__PURE__ */ t("p", { children: "Your video library doesn't contain any video content." }),
|
|
1547
|
+
actions: /* @__PURE__ */ t(qt, { onFulfilled: e.addItemFromDto })
|
|
1548
|
+
}) : /* @__PURE__ */ t(an, { playQueue: e })
|
|
1549
|
+
] });
|
|
1550
|
+
}), sn = ({ breadcrumbs: e, tabs: n, ...r }) => {
|
|
1551
|
+
let i = Je();
|
|
1552
|
+
return /* @__PURE__ */ t(O.Header, {
|
|
1553
|
+
...r,
|
|
1554
|
+
breadcrumbs: e?.map(({ linkProps: e, ...t }) => ({
|
|
1555
|
+
...t,
|
|
1556
|
+
href: e === void 0 ? void 0 : i.buildLocation(e).href,
|
|
1557
|
+
onClick: e === void 0 ? void 0 : async (t) => {
|
|
1558
|
+
t.preventDefault(), await i.navigate(e);
|
|
1559
|
+
}
|
|
1560
|
+
})),
|
|
1561
|
+
tabs: n?.map(({ linkProps: e, ...t }) => ({
|
|
1562
|
+
...t,
|
|
1563
|
+
href: e === void 0 ? void 0 : i.buildLocation(e).href,
|
|
1564
|
+
onClick: e === void 0 ? void 0 : async (t) => {
|
|
1565
|
+
t.preventDefault(), await i.navigate(e);
|
|
1566
|
+
}
|
|
1567
|
+
}))
|
|
1568
|
+
});
|
|
1569
|
+
}, cn = () => {
|
|
1570
|
+
let r = G();
|
|
1571
|
+
return /* @__PURE__ */ n(e, { children: [/* @__PURE__ */ t(sn, {
|
|
1572
|
+
pageTitle: "Play queue",
|
|
1573
|
+
rightSideItems: []
|
|
1574
|
+
}), /* @__PURE__ */ t(on, { playQueue: r })] });
|
|
1575
|
+
}, ln = R.create(({ remove: e, resolve: r, playlistListItem: i }) => {
|
|
1576
|
+
let [o, s] = d(!1);
|
|
1577
|
+
return /* @__PURE__ */ t(le, {
|
|
1578
|
+
title: "Delete playlist permanently?",
|
|
1579
|
+
onCancel: e,
|
|
1580
|
+
onConfirm: a(async () => {
|
|
1581
|
+
try {
|
|
1582
|
+
s(!0), r(), e();
|
|
1583
|
+
} finally {
|
|
1584
|
+
s(!1);
|
|
1585
|
+
}
|
|
1586
|
+
}, [r, e]),
|
|
1587
|
+
cancelButtonText: "Cancel",
|
|
1588
|
+
confirmButtonText: "Delete",
|
|
1589
|
+
buttonColor: "danger",
|
|
1590
|
+
isLoading: o,
|
|
1591
|
+
children: /* @__PURE__ */ n("p", { children: [
|
|
1592
|
+
"Are you sure you want to delete this playlist? If you delete '",
|
|
1593
|
+
i.name,
|
|
1594
|
+
"', you won't be able to recover it."
|
|
1595
|
+
] })
|
|
1596
|
+
});
|
|
1597
|
+
}), un = N(({ playlist: e }) => /* @__PURE__ */ t(_, {
|
|
1598
|
+
iconType: P,
|
|
1599
|
+
onClick: e.addSelectedItems,
|
|
1600
|
+
disabled: !e.canAddSelectedItems,
|
|
1601
|
+
children: "Add to play queue"
|
|
1602
|
+
})), dn = N(({ playlist: e, closePopover: n }) => {
|
|
1603
|
+
let r = a(({ name: e, icon: t, disabled: r, onClick: i }) => ({
|
|
1604
|
+
name: e,
|
|
1605
|
+
icon: t,
|
|
1606
|
+
disabled: r,
|
|
1607
|
+
onClick: async (e) => {
|
|
1608
|
+
n(), i(e);
|
|
1609
|
+
}
|
|
1610
|
+
}), [n]);
|
|
1611
|
+
return /* @__PURE__ */ t(x, {
|
|
1612
|
+
initialPanelId: 0,
|
|
1613
|
+
panels: l(() => [{
|
|
1614
|
+
id: 0,
|
|
1615
|
+
items: [
|
|
1616
|
+
r({
|
|
1617
|
+
name: "Play next",
|
|
1618
|
+
icon: /* @__PURE__ */ t(D, { type: "" }),
|
|
1619
|
+
disabled: !e.canPlaySelectedItemsNext,
|
|
1620
|
+
onClick: e.playSelectedItemsNext
|
|
1621
|
+
}),
|
|
1622
|
+
r({
|
|
1623
|
+
name: "Add to play queue",
|
|
1624
|
+
icon: /* @__PURE__ */ t(D, { type: P }),
|
|
1625
|
+
onClick: e.addSelectedItems,
|
|
1626
|
+
disabled: !e.canAddSelectedItems
|
|
1627
|
+
}),
|
|
1628
|
+
r({
|
|
1629
|
+
name: "Remove",
|
|
1630
|
+
icon: /* @__PURE__ */ t(D, { type: F }),
|
|
1631
|
+
onClick: e.removeSelectedItems,
|
|
1632
|
+
disabled: !e.canRemoveSelectedItems
|
|
1633
|
+
})
|
|
1634
|
+
]
|
|
1635
|
+
}], [r, e])
|
|
1636
|
+
});
|
|
1637
|
+
}), fn = i(({ playlist: e }) => {
|
|
1638
|
+
let [n, r] = d(!1), i = a(() => r(!n), [n]), o = a(() => r(!1), []);
|
|
1639
|
+
return /* @__PURE__ */ t(k, {
|
|
1640
|
+
button: /* @__PURE__ */ t(y, {
|
|
1641
|
+
display: "base",
|
|
1642
|
+
size: "m",
|
|
1643
|
+
iconType: I,
|
|
1644
|
+
onClick: i
|
|
1645
|
+
}),
|
|
1646
|
+
isOpen: n,
|
|
1647
|
+
closePopover: o,
|
|
1648
|
+
panelPaddingSize: "none",
|
|
1649
|
+
anchorPosition: "downLeft",
|
|
1650
|
+
children: /* @__PURE__ */ t(dn, {
|
|
1651
|
+
playlist: e,
|
|
1652
|
+
closePopover: o
|
|
1653
|
+
})
|
|
1654
|
+
});
|
|
1655
|
+
}), pn = N(({ playlist: e }) => {
|
|
1656
|
+
let { euiTheme: r } = M();
|
|
1657
|
+
return /* @__PURE__ */ n(C, {
|
|
1658
|
+
alignItems: "center",
|
|
1659
|
+
gutterSize: "m",
|
|
1660
|
+
responsive: !1,
|
|
1661
|
+
style: {
|
|
1662
|
+
position: "sticky",
|
|
1663
|
+
top: 48,
|
|
1664
|
+
zIndex: 998,
|
|
1665
|
+
background: r.colors.backgroundBasePlain
|
|
1666
|
+
},
|
|
1667
|
+
children: [
|
|
1668
|
+
/* @__PURE__ */ n(E, {
|
|
1669
|
+
sizes: ["xs"],
|
|
1670
|
+
children: [
|
|
1671
|
+
/* @__PURE__ */ t(w, {
|
|
1672
|
+
grow: !1,
|
|
1673
|
+
children: /* @__PURE__ */ t(_, {
|
|
1674
|
+
disabled: !e.canPlaySelectedItemsNext,
|
|
1675
|
+
onClick: e.playSelectedItemsNext,
|
|
1676
|
+
children: "Play next"
|
|
1677
|
+
})
|
|
1678
|
+
}),
|
|
1679
|
+
/* @__PURE__ */ t(w, {
|
|
1680
|
+
grow: !1,
|
|
1681
|
+
children: /* @__PURE__ */ t(un, { playlist: e })
|
|
1682
|
+
}),
|
|
1683
|
+
/* @__PURE__ */ t(w, {
|
|
1684
|
+
grow: !1,
|
|
1685
|
+
children: /* @__PURE__ */ t(_, {
|
|
1686
|
+
iconType: F,
|
|
1687
|
+
onClick: e.removeSelectedItems,
|
|
1688
|
+
disabled: !e.canRemoveSelectedItems,
|
|
1689
|
+
children: "Remove"
|
|
1690
|
+
})
|
|
1691
|
+
})
|
|
1692
|
+
]
|
|
1693
|
+
}),
|
|
1694
|
+
/* @__PURE__ */ t(ye, {
|
|
1695
|
+
sizes: ["xs"],
|
|
1696
|
+
children: /* @__PURE__ */ t(fn, { playlist: e })
|
|
1697
|
+
}),
|
|
1698
|
+
/* @__PURE__ */ t(w, { grow: !0 }),
|
|
1699
|
+
/* @__PURE__ */ t(w, {
|
|
1700
|
+
grow: !1,
|
|
1701
|
+
children: /* @__PURE__ */ t(qt, { onFulfilled: e.addItemFromDto })
|
|
1702
|
+
})
|
|
1703
|
+
]
|
|
1704
|
+
});
|
|
1705
|
+
}), mn = N(({ playlist: r }) => /* @__PURE__ */ n(e, { children: [/* @__PURE__ */ t(we, { children: /* @__PURE__ */ t(C, {
|
|
1706
|
+
responsive: !1,
|
|
1707
|
+
justifyContent: "spaceBetween",
|
|
1708
|
+
alignItems: "baseline",
|
|
1709
|
+
children: /* @__PURE__ */ t(w, {
|
|
1710
|
+
grow: !1,
|
|
1711
|
+
children: /* @__PURE__ */ t(b, {
|
|
1712
|
+
id: "",
|
|
1713
|
+
checked: r.allItemsSelected,
|
|
1714
|
+
onChange: (e) => {
|
|
1715
|
+
e.target.checked ? r.selectAll() : r.unselectAll();
|
|
1716
|
+
}
|
|
1717
|
+
})
|
|
1718
|
+
})
|
|
1719
|
+
}) }), /* @__PURE__ */ n(Se, { children: [
|
|
1720
|
+
/* @__PURE__ */ t(Ce, { children: /* @__PURE__ */ t(b, {
|
|
1721
|
+
id: "",
|
|
1722
|
+
checked: r.allItemsSelected,
|
|
1723
|
+
onChange: (e) => {
|
|
1724
|
+
e.target.checked ? r.selectAll() : r.unselectAll();
|
|
1725
|
+
}
|
|
1726
|
+
}) }),
|
|
1727
|
+
/* @__PURE__ */ t(A, { width: 24 }),
|
|
1728
|
+
/* @__PURE__ */ t(A, { children: "Title" }),
|
|
1729
|
+
/* @__PURE__ */ t(A, {})
|
|
1730
|
+
] })] })), hn = i(({ item: e, closePopover: n }) => {
|
|
1731
|
+
let r = a(({ name: e, icon: t, disabled: r, onClick: i, className: a }) => ({
|
|
1732
|
+
name: e,
|
|
1733
|
+
icon: t,
|
|
1734
|
+
disabled: r,
|
|
1735
|
+
onClick: async (e) => {
|
|
1736
|
+
n(), i(e);
|
|
1737
|
+
},
|
|
1738
|
+
className: a
|
|
1739
|
+
}), [n]);
|
|
1740
|
+
return /* @__PURE__ */ t(x, {
|
|
1741
|
+
initialPanelId: 0,
|
|
1742
|
+
panels: l(() => [{
|
|
1743
|
+
id: 0,
|
|
1744
|
+
items: [
|
|
1745
|
+
r({
|
|
1746
|
+
name: "Play",
|
|
1747
|
+
icon: /* @__PURE__ */ t(D, { type: L }),
|
|
1748
|
+
onClick: e.play,
|
|
1749
|
+
className: "eui-showFor--xs--flex"
|
|
1750
|
+
}),
|
|
1751
|
+
r({
|
|
1752
|
+
name: "Play first",
|
|
1753
|
+
icon: /* @__PURE__ */ t(D, { type: "" }),
|
|
1754
|
+
onClick: e.playFirst
|
|
1755
|
+
}),
|
|
1756
|
+
r({
|
|
1757
|
+
name: "Play next",
|
|
1758
|
+
icon: /* @__PURE__ */ t(D, { type: "" }),
|
|
1759
|
+
onClick: e.playNext
|
|
1760
|
+
}),
|
|
1761
|
+
r({
|
|
1762
|
+
name: "Add to play queue",
|
|
1763
|
+
icon: /* @__PURE__ */ t(D, { type: P }),
|
|
1764
|
+
onClick: e.addToPlayQueue
|
|
1765
|
+
}),
|
|
1766
|
+
{ isSeparator: !0 },
|
|
1767
|
+
r({
|
|
1768
|
+
name: "Move to the top",
|
|
1769
|
+
icon: /* @__PURE__ */ t(D, { type: Pe }),
|
|
1770
|
+
onClick: e.moveToTop,
|
|
1771
|
+
disabled: !e.canMoveToTop
|
|
1772
|
+
}),
|
|
1773
|
+
r({
|
|
1774
|
+
name: "Move to the bottom",
|
|
1775
|
+
icon: /* @__PURE__ */ t(D, { type: Oe }),
|
|
1776
|
+
onClick: e.moveToBottom,
|
|
1777
|
+
disabled: !e.canMoveToBottom
|
|
1778
|
+
}),
|
|
1779
|
+
{ isSeparator: !0 },
|
|
1780
|
+
r({
|
|
1781
|
+
name: "Remove",
|
|
1782
|
+
icon: /* @__PURE__ */ t(D, { type: F }),
|
|
1783
|
+
onClick: e.remove,
|
|
1784
|
+
className: "eui-showFor--xs--flex"
|
|
1785
|
+
}),
|
|
1786
|
+
r({
|
|
1787
|
+
name: "Remove to the top",
|
|
1788
|
+
icon: /* @__PURE__ */ t(D, { type: "" }),
|
|
1789
|
+
onClick: e.removeToTop,
|
|
1790
|
+
disabled: !e.canRemoveToTop
|
|
1791
|
+
}),
|
|
1792
|
+
r({
|
|
1793
|
+
name: "Remove others",
|
|
1794
|
+
icon: /* @__PURE__ */ t(D, { type: "" }),
|
|
1795
|
+
onClick: e.removeOthers,
|
|
1796
|
+
disabled: !e.canRemoveOthers
|
|
1797
|
+
})
|
|
1798
|
+
]
|
|
1799
|
+
}], [r, e])
|
|
1800
|
+
});
|
|
1801
|
+
}), gn = i(({ item: e }) => {
|
|
1802
|
+
let [n, r] = d(!1), i = a(() => r(!n), [n]), o = a(() => r(!1), []);
|
|
1803
|
+
return /* @__PURE__ */ t(k, {
|
|
1804
|
+
button: /* @__PURE__ */ t(y, {
|
|
1805
|
+
title: "More options",
|
|
1806
|
+
"aria-label": "More options",
|
|
1807
|
+
iconType: I,
|
|
1808
|
+
size: "s",
|
|
1809
|
+
color: "text",
|
|
1810
|
+
onClick: i
|
|
1811
|
+
}),
|
|
1812
|
+
isOpen: n,
|
|
1813
|
+
closePopover: o,
|
|
1814
|
+
panelPaddingSize: "none",
|
|
1815
|
+
anchorPosition: "leftCenter",
|
|
1816
|
+
children: /* @__PURE__ */ t(hn, {
|
|
1817
|
+
item: e,
|
|
1818
|
+
closePopover: o
|
|
1819
|
+
})
|
|
1820
|
+
});
|
|
1821
|
+
}), _n = N(({ item: e }) => /* @__PURE__ */ n(j, {
|
|
1822
|
+
textOnly: !1,
|
|
1823
|
+
hasActions: !0,
|
|
1824
|
+
align: "right",
|
|
1825
|
+
children: [/* @__PURE__ */ n(E, {
|
|
1826
|
+
sizes: ["xs"],
|
|
1827
|
+
children: [/* @__PURE__ */ t(_, {
|
|
1828
|
+
iconType: L,
|
|
1829
|
+
size: "s",
|
|
1830
|
+
onClick: e.play,
|
|
1831
|
+
children: "Play"
|
|
1832
|
+
}), /* @__PURE__ */ t(_, {
|
|
1833
|
+
iconType: F,
|
|
1834
|
+
size: "s",
|
|
1835
|
+
onClick: e.remove,
|
|
1836
|
+
children: "Remove"
|
|
1837
|
+
})]
|
|
1838
|
+
}), /* @__PURE__ */ t(gn, { item: e })]
|
|
1839
|
+
})), vn = N(({ item: e }) => /* @__PURE__ */ n(Te, {
|
|
1840
|
+
isSelected: e.isCurrent,
|
|
1841
|
+
hasSelection: !0,
|
|
1842
|
+
hasActions: !0,
|
|
1843
|
+
children: [
|
|
1844
|
+
/* @__PURE__ */ t(Ee, { children: /* @__PURE__ */ t(b, {
|
|
1845
|
+
id: e.id.toString(),
|
|
1846
|
+
checked: e.isSelected,
|
|
1847
|
+
onChange: e.toggleSelected
|
|
1848
|
+
}) }),
|
|
1849
|
+
/* @__PURE__ */ t(j, {
|
|
1850
|
+
textOnly: !1,
|
|
1851
|
+
children: /* @__PURE__ */ t("img", {
|
|
1852
|
+
src: z.get(e.type),
|
|
1853
|
+
width: 16,
|
|
1854
|
+
height: 16,
|
|
1855
|
+
alt: e.type
|
|
1856
|
+
})
|
|
1857
|
+
}),
|
|
1858
|
+
/* @__PURE__ */ t(j, {
|
|
1859
|
+
mobileOptions: {
|
|
1860
|
+
header: !1,
|
|
1861
|
+
enlarge: !0,
|
|
1862
|
+
width: "100%"
|
|
1863
|
+
},
|
|
1864
|
+
children: /* @__PURE__ */ t(fe, {
|
|
1865
|
+
href: e.url,
|
|
1866
|
+
target: "_blank",
|
|
1867
|
+
external: !0,
|
|
1868
|
+
children: e.title
|
|
1869
|
+
})
|
|
1870
|
+
}),
|
|
1871
|
+
/* @__PURE__ */ t(_n, { item: e })
|
|
1872
|
+
]
|
|
1873
|
+
})), yn = N(({ playlist: e }) => /* @__PURE__ */ t(qe, {
|
|
1874
|
+
tag: "tbody",
|
|
1875
|
+
list: e.items,
|
|
1876
|
+
setList: (t) => e.setItems(t),
|
|
1877
|
+
children: e.items.map((e) => /* @__PURE__ */ t(vn, { item: e }, e.id))
|
|
1878
|
+
})), bn = N(({ playlist: e }) => /* @__PURE__ */ n(xe, { children: [/* @__PURE__ */ t(mn, { playlist: e }), /* @__PURE__ */ t(yn, { playlist: e })] })), xn = N(({ playlist: r }) => {
|
|
1879
|
+
let { euiTheme: i } = M();
|
|
1880
|
+
return /* @__PURE__ */ n(O.Section, { children: [
|
|
1881
|
+
/* @__PURE__ */ t(pn, { playlist: r }),
|
|
1882
|
+
/* @__PURE__ */ t(be, {
|
|
1883
|
+
size: "l",
|
|
1884
|
+
style: {
|
|
1885
|
+
position: "sticky",
|
|
1886
|
+
top: 88,
|
|
1887
|
+
zIndex: 998,
|
|
1888
|
+
background: i.colors.backgroundBasePlain
|
|
1889
|
+
}
|
|
1890
|
+
}),
|
|
1891
|
+
r.isEmpty ? /* @__PURE__ */ t(e, {}) : /* @__PURE__ */ t(bn, { playlist: r })
|
|
1892
|
+
] });
|
|
1893
|
+
}), Sn = R.create(({ remove: e, resolve: r, playlistListItem: i }) => {
|
|
1894
|
+
let a = De({ prefix: "modalForm" }), [o, s] = d(i.name), [c, l] = d(!1);
|
|
1895
|
+
return /* @__PURE__ */ n(pe, {
|
|
1896
|
+
onClose: e,
|
|
1897
|
+
initialFocus: "[name=name]",
|
|
1898
|
+
children: [
|
|
1899
|
+
/* @__PURE__ */ t(ge, { children: /* @__PURE__ */ t(_e, { children: "Rename playlist" }) }),
|
|
1900
|
+
/* @__PURE__ */ t(me, { children: /* @__PURE__ */ t(de, {
|
|
1901
|
+
id: a,
|
|
1902
|
+
component: "form",
|
|
1903
|
+
onSubmit: async (t) => {
|
|
1904
|
+
t.preventDefault();
|
|
1905
|
+
try {
|
|
1906
|
+
l(!0), r(o), e();
|
|
1907
|
+
} finally {
|
|
1908
|
+
l(!1);
|
|
1909
|
+
}
|
|
1910
|
+
},
|
|
1911
|
+
children: /* @__PURE__ */ t(T, {
|
|
1912
|
+
label: "Name",
|
|
1913
|
+
children: /* @__PURE__ */ t(S, {
|
|
1914
|
+
name: "name",
|
|
1915
|
+
value: o,
|
|
1916
|
+
onChange: (e) => s(e.target.value)
|
|
1917
|
+
})
|
|
1918
|
+
})
|
|
1919
|
+
}) }),
|
|
1920
|
+
/* @__PURE__ */ n(he, { children: [/* @__PURE__ */ t(v, {
|
|
1921
|
+
onClick: e,
|
|
1922
|
+
children: "Cancel"
|
|
1923
|
+
}), /* @__PURE__ */ t(_, {
|
|
1924
|
+
type: "submit",
|
|
1925
|
+
form: a,
|
|
1926
|
+
fill: !0,
|
|
1927
|
+
disabled: o.trim().length === 0,
|
|
1928
|
+
isLoading: c,
|
|
1929
|
+
children: "Rename"
|
|
1930
|
+
})] })
|
|
1931
|
+
]
|
|
1932
|
+
});
|
|
1933
|
+
}), Q = class e {
|
|
1934
|
+
playQueue;
|
|
1935
|
+
playlist;
|
|
1936
|
+
dto;
|
|
1937
|
+
static nextId = 1;
|
|
1938
|
+
id;
|
|
1939
|
+
isSelected = !1;
|
|
1940
|
+
constructor(t, n, r) {
|
|
1941
|
+
this.playQueue = t, this.playlist = n, this.dto = r, m(this), this.id = e.nextId++;
|
|
1942
|
+
}
|
|
1943
|
+
static fromDto(t, n, r) {
|
|
1944
|
+
return new e(t, n, r);
|
|
1945
|
+
}
|
|
1946
|
+
get url() {
|
|
1947
|
+
return this.dto.url;
|
|
1948
|
+
}
|
|
1949
|
+
get type() {
|
|
1950
|
+
return this.dto.type;
|
|
1951
|
+
}
|
|
1952
|
+
get videoId() {
|
|
1953
|
+
return this.dto.videoId;
|
|
1954
|
+
}
|
|
1955
|
+
get title() {
|
|
1956
|
+
return this.dto.title;
|
|
1957
|
+
}
|
|
1958
|
+
get isCurrent() {
|
|
1959
|
+
return !1;
|
|
1960
|
+
}
|
|
1961
|
+
get index() {
|
|
1962
|
+
return this.playlist.items.indexOf(this);
|
|
1963
|
+
}
|
|
1964
|
+
get isFirst() {
|
|
1965
|
+
return this.index === 0;
|
|
1966
|
+
}
|
|
1967
|
+
get isLast() {
|
|
1968
|
+
return this.index === this.playlist.items.length - 1;
|
|
1969
|
+
}
|
|
1970
|
+
get canMoveToTop() {
|
|
1971
|
+
return !this.isFirst;
|
|
1972
|
+
}
|
|
1973
|
+
get canMoveToBottom() {
|
|
1974
|
+
return !this.isLast;
|
|
1975
|
+
}
|
|
1976
|
+
get canRemoveToTop() {
|
|
1977
|
+
return !this.isFirst;
|
|
1978
|
+
}
|
|
1979
|
+
get canRemoveOthers() {
|
|
1980
|
+
return this.playlist.hasMultipleItems;
|
|
1981
|
+
}
|
|
1982
|
+
unselect() {
|
|
1983
|
+
this.isSelected = !1;
|
|
1984
|
+
}
|
|
1985
|
+
select() {
|
|
1986
|
+
this.isSelected = !0;
|
|
1987
|
+
}
|
|
1988
|
+
toggleSelected() {
|
|
1989
|
+
this.isSelected = !this.isSelected;
|
|
1990
|
+
}
|
|
1991
|
+
play() {
|
|
1992
|
+
return this.playQueue.clearAndSetItems([this.playQueue.createItemFromDto(this.dto)]), Promise.resolve();
|
|
1993
|
+
}
|
|
1994
|
+
remove() {
|
|
1995
|
+
return this.playlist.removeItems([this]);
|
|
1996
|
+
}
|
|
1997
|
+
playFirst() {
|
|
1998
|
+
return this.playQueue.playFirst([this.playQueue.createItemFromDto(this.dto)]);
|
|
1999
|
+
}
|
|
2000
|
+
playNext() {
|
|
2001
|
+
return this.playQueue.playNext([this.playQueue.createItemFromDto(this.dto)]);
|
|
2002
|
+
}
|
|
2003
|
+
addToPlayQueue() {
|
|
2004
|
+
return this.playQueue.addItems([this.playQueue.createItemFromDto(this.dto)]);
|
|
2005
|
+
}
|
|
2006
|
+
moveToTop() {
|
|
2007
|
+
this.playlist.moveItem(this, 0);
|
|
2008
|
+
}
|
|
2009
|
+
moveToBottom() {
|
|
2010
|
+
this.playlist.moveItem(this, this.playlist.items.length - 1);
|
|
2011
|
+
}
|
|
2012
|
+
removeToTop() {
|
|
2013
|
+
return this.playlist.removeItemsAbove(this);
|
|
2014
|
+
}
|
|
2015
|
+
removeOthers() {
|
|
2016
|
+
return this.playlist.removeOtherItems(this);
|
|
2017
|
+
}
|
|
2018
|
+
};
|
|
2019
|
+
U([h], Q.prototype, "isSelected", void 0), U([p], Q.prototype, "isCurrent", null), U([p], Q.prototype, "index", null), U([p], Q.prototype, "isFirst", null), U([p], Q.prototype, "isLast", null), U([p], Q.prototype, "canMoveToTop", null), U([p], Q.prototype, "canMoveToBottom", null), U([p], Q.prototype, "canRemoveToTop", null), U([p], Q.prototype, "canRemoveOthers", null), U([f.bound], Q.prototype, "unselect", null), U([f.bound], Q.prototype, "select", null), U([f.bound], Q.prototype, "toggleSelected", null), U([f.bound], Q.prototype, "play", null), U([f.bound], Q.prototype, "remove", null), U([f.bound], Q.prototype, "playFirst", null), U([f.bound], Q.prototype, "playNext", null), U([f.bound], Q.prototype, "addToPlayQueue", null), U([f.bound], Q.prototype, "moveToTop", null), U([f.bound], Q.prototype, "moveToBottom", null), U([f.bound], Q.prototype, "removeToTop", null), U([f.bound], Q.prototype, "removeOthers", null);
|
|
2020
|
+
//#endregion
|
|
2021
|
+
//#region src/features/media-player.playlists/stores/PlaylistStore.ts
|
|
2022
|
+
var Cn = {
|
|
2023
|
+
type: "object",
|
|
2024
|
+
properties: {
|
|
2025
|
+
version: {
|
|
2026
|
+
type: "string",
|
|
2027
|
+
nullable: !0
|
|
2028
|
+
},
|
|
2029
|
+
items: {
|
|
2030
|
+
type: "array",
|
|
2031
|
+
nullable: !0,
|
|
2032
|
+
items: lt
|
|
2033
|
+
}
|
|
2034
|
+
}
|
|
2035
|
+
}, wn = class {
|
|
2036
|
+
playlist;
|
|
2037
|
+
constructor(e) {
|
|
2038
|
+
this.playlist = e, m(this);
|
|
2039
|
+
}
|
|
2040
|
+
get state() {
|
|
2041
|
+
return {
|
|
2042
|
+
version: "1.0",
|
|
2043
|
+
items: this.playlist.items.map((e) => e.dto)
|
|
2044
|
+
};
|
|
2045
|
+
}
|
|
2046
|
+
set state(e) {
|
|
2047
|
+
this.playlist.items = e.items?.map((e) => this.playlist.createItemFromDto(e)) ?? [];
|
|
2048
|
+
}
|
|
2049
|
+
validateState(e) {
|
|
2050
|
+
return $e(Cn, "PlaylistLocalStorageState")(e);
|
|
2051
|
+
}
|
|
2471
2052
|
};
|
|
2472
|
-
|
|
2053
|
+
U([p.struct], wn.prototype, "state", null);
|
|
2054
|
+
var $ = class {
|
|
2055
|
+
playQueue;
|
|
2056
|
+
localStorageState;
|
|
2057
|
+
items = [];
|
|
2058
|
+
constructor(e) {
|
|
2059
|
+
this.playQueue = e, m(this), this.localStorageState = new wn(this);
|
|
2060
|
+
}
|
|
2061
|
+
createItemFromDto(e) {
|
|
2062
|
+
return Q.fromDto(this.playQueue, this, {
|
|
2063
|
+
url: e.url,
|
|
2064
|
+
type: e.type,
|
|
2065
|
+
videoId: e.videoId,
|
|
2066
|
+
title: e.title
|
|
2067
|
+
});
|
|
2068
|
+
}
|
|
2069
|
+
get isEmpty() {
|
|
2070
|
+
return this.items.length === 0;
|
|
2071
|
+
}
|
|
2072
|
+
get hasMultipleItems() {
|
|
2073
|
+
return this.items.length > 1;
|
|
2074
|
+
}
|
|
2075
|
+
get selectedItems() {
|
|
2076
|
+
return this.items.filter((e) => e.isSelected);
|
|
2077
|
+
}
|
|
2078
|
+
get allItemsSelected() {
|
|
2079
|
+
return this.selectedItems.length === this.items.length;
|
|
2080
|
+
}
|
|
2081
|
+
get hasSelectedItems() {
|
|
2082
|
+
return this.selectedItems.length > 0;
|
|
2083
|
+
}
|
|
2084
|
+
get selectedItemsOrAllItems() {
|
|
2085
|
+
return this.hasSelectedItems ? this.selectedItems : this.items;
|
|
2086
|
+
}
|
|
2087
|
+
get canAddSelectedItems() {
|
|
2088
|
+
return !this.isEmpty && this.hasSelectedItems;
|
|
2089
|
+
}
|
|
2090
|
+
get canPlaySelectedItemsNext() {
|
|
2091
|
+
return !this.isEmpty && this.hasSelectedItems;
|
|
2092
|
+
}
|
|
2093
|
+
get canRemoveSelectedItems() {
|
|
2094
|
+
return !this.isEmpty && this.hasSelectedItems;
|
|
2095
|
+
}
|
|
2096
|
+
setItems(e) {
|
|
2097
|
+
this.items = e;
|
|
2098
|
+
}
|
|
2099
|
+
unselectAll() {
|
|
2100
|
+
for (let e of this.items) e.unselect();
|
|
2101
|
+
}
|
|
2102
|
+
selectAll() {
|
|
2103
|
+
for (let e of this.items) e.select();
|
|
2104
|
+
}
|
|
2105
|
+
async playSelectedItemsNext() {
|
|
2106
|
+
await this.playQueue.playNext(this.selectedItemsOrAllItems.map((e) => this.playQueue.createItemFromDto(e.dto))), this.unselectAll();
|
|
2107
|
+
}
|
|
2108
|
+
async addSelectedItems() {
|
|
2109
|
+
await this.playQueue.addItems(this.selectedItemsOrAllItems.map((e) => this.playQueue.createItemFromDto(e.dto))), this.unselectAll();
|
|
2110
|
+
}
|
|
2111
|
+
async addItems(e) {
|
|
2112
|
+
this.items.push(...e);
|
|
2113
|
+
}
|
|
2114
|
+
moveItem(e, t) {
|
|
2115
|
+
let n = this.items.splice(this.items.indexOf(e), 1)[0];
|
|
2116
|
+
this.items.splice(t, 0, n);
|
|
2117
|
+
}
|
|
2118
|
+
async removeItems(e) {
|
|
2119
|
+
re(this.items, ...e);
|
|
2120
|
+
}
|
|
2121
|
+
async removeSelectedItems() {
|
|
2122
|
+
await this.removeItems(this.selectedItemsOrAllItems), this.unselectAll();
|
|
2123
|
+
}
|
|
2124
|
+
async removeOtherItems(e) {
|
|
2125
|
+
let t = e.id;
|
|
2126
|
+
return this.removeItems(this.items.filter((e) => e.id !== t));
|
|
2127
|
+
}
|
|
2128
|
+
async removeItemsAbove(e) {
|
|
2129
|
+
let t = this.items.indexOf(e);
|
|
2130
|
+
return this.removeItems(this.items.filter((e, n) => n < t));
|
|
2131
|
+
}
|
|
2132
|
+
addItemFromDto(e) {
|
|
2133
|
+
let t = this.createItemFromDto(e);
|
|
2134
|
+
return this.addItems([t]);
|
|
2135
|
+
}
|
|
2136
|
+
playAll() {
|
|
2137
|
+
return this.playQueue.clearAndSetItems(this.items.map((e) => this.playQueue.createItemFromDto(e.dto))), Promise.resolve();
|
|
2138
|
+
}
|
|
2139
|
+
};
|
|
2140
|
+
U([h], $.prototype, "items", void 0), U([p], $.prototype, "isEmpty", null), U([p], $.prototype, "hasMultipleItems", null), U([p], $.prototype, "selectedItems", null), U([p], $.prototype, "allItemsSelected", null), U([p], $.prototype, "hasSelectedItems", null), U([p], $.prototype, "selectedItemsOrAllItems", null), U([p], $.prototype, "canAddSelectedItems", null), U([p], $.prototype, "canPlaySelectedItemsNext", null), U([p], $.prototype, "canRemoveSelectedItems", null), U([f.bound], $.prototype, "setItems", null), U([f.bound], $.prototype, "unselectAll", null), U([f.bound], $.prototype, "selectAll", null), U([f.bound], $.prototype, "playSelectedItemsNext", null), U([f.bound], $.prototype, "addSelectedItems", null), U([f.bound], $.prototype, "addItems", null), U([f.bound], $.prototype, "moveItem", null), U([f.bound], $.prototype, "removeItems", null), U([f.bound], $.prototype, "removeSelectedItems", null), U([f.bound], $.prototype, "removeOtherItems", null), U([f.bound], $.prototype, "removeItemsAbove", null), U([f.bound], $.prototype, "addItemFromDto", null), U([f.bound], $.prototype, "playAll", null);
|
|
2141
|
+
//#endregion
|
|
2142
|
+
//#region src/features/media-player.playlists/pages/PlaylistDetailsPage.tsx
|
|
2143
|
+
var Tn = ({ onClick: e }) => /* @__PURE__ */ t(_, {
|
|
2144
|
+
onClick: e,
|
|
2145
|
+
iconType: L,
|
|
2146
|
+
fill: !0,
|
|
2147
|
+
children: "Play all"
|
|
2148
|
+
}), En = ({ playlistListItem: e, onFulfilled: n }) => /* @__PURE__ */ t(_, {
|
|
2149
|
+
onClick: () => R.show(Sn, { playlistListItem: e }).then(n),
|
|
2150
|
+
iconType: He,
|
|
2151
|
+
children: "Rename"
|
|
2152
|
+
}), Dn = ({ playlistListItem: e, onFulfilled: n }) => /* @__PURE__ */ t(_, {
|
|
2153
|
+
onClick: () => R.show(ln, { playlistListItem: e }).then(n),
|
|
2154
|
+
iconType: Fe,
|
|
2155
|
+
children: "Delete"
|
|
2156
|
+
}), On = N(({ playlistListItem: r }) => {
|
|
2157
|
+
let i = B.playlist(r.id), o = G(), [s] = d(() => new $(o));
|
|
2158
|
+
ne(i, s.localStorageState);
|
|
2159
|
+
let c = Je(), l = a(async (e) => {
|
|
2160
|
+
await r.rename(e);
|
|
2161
|
+
}, [r]), u = a(async () => {
|
|
2162
|
+
await c.navigate({ to: "/playlists" }), window.localStorage.removeItem(i), await r.remove();
|
|
2163
|
+
}, [
|
|
2164
|
+
r,
|
|
2165
|
+
c,
|
|
2166
|
+
i
|
|
2167
|
+
]);
|
|
2168
|
+
return /* @__PURE__ */ n(e, { children: [/* @__PURE__ */ t(sn, {
|
|
2169
|
+
pageTitle: r.name,
|
|
2170
|
+
breadcrumbs: [{
|
|
2171
|
+
text: "Playlists",
|
|
2172
|
+
linkProps: { to: "/playlists" }
|
|
2173
|
+
}, { text: r.name }],
|
|
2174
|
+
rightSideItems: [
|
|
2175
|
+
/* @__PURE__ */ t(Tn, { onClick: s.playAll }),
|
|
2176
|
+
/* @__PURE__ */ t(En, {
|
|
2177
|
+
playlistListItem: r,
|
|
2178
|
+
onFulfilled: l
|
|
2179
|
+
}),
|
|
2180
|
+
/* @__PURE__ */ t(Dn, {
|
|
2181
|
+
playlistListItem: r,
|
|
2182
|
+
onFulfilled: u
|
|
2183
|
+
})
|
|
2184
|
+
]
|
|
2185
|
+
}), /* @__PURE__ */ t(xn, { playlist: s })] });
|
|
2186
|
+
}), kn = R.create(({ remove: e, resolve: r }) => {
|
|
2187
|
+
let i = De({ prefix: "modalForm" }), [a, o] = d(""), [s, c] = d(!1);
|
|
2188
|
+
return /* @__PURE__ */ n(pe, {
|
|
2189
|
+
onClose: e,
|
|
2190
|
+
initialFocus: "[name=name]",
|
|
2191
|
+
children: [
|
|
2192
|
+
/* @__PURE__ */ t(ge, { children: /* @__PURE__ */ t(_e, { children: "Create playlist" }) }),
|
|
2193
|
+
/* @__PURE__ */ t(me, { children: /* @__PURE__ */ t(de, {
|
|
2194
|
+
id: i,
|
|
2195
|
+
component: "form",
|
|
2196
|
+
onSubmit: async (t) => {
|
|
2197
|
+
t.preventDefault();
|
|
2198
|
+
try {
|
|
2199
|
+
c(!0), r(a), e();
|
|
2200
|
+
} finally {
|
|
2201
|
+
c(!1);
|
|
2202
|
+
}
|
|
2203
|
+
},
|
|
2204
|
+
children: /* @__PURE__ */ t(T, {
|
|
2205
|
+
label: "Name",
|
|
2206
|
+
children: /* @__PURE__ */ t(S, {
|
|
2207
|
+
name: "name",
|
|
2208
|
+
value: a,
|
|
2209
|
+
onChange: (e) => o(e.target.value)
|
|
2210
|
+
})
|
|
2211
|
+
})
|
|
2212
|
+
}) }),
|
|
2213
|
+
/* @__PURE__ */ n(he, { children: [/* @__PURE__ */ t(v, {
|
|
2214
|
+
onClick: e,
|
|
2215
|
+
children: "Cancel"
|
|
2216
|
+
}), /* @__PURE__ */ t(_, {
|
|
2217
|
+
type: "submit",
|
|
2218
|
+
form: i,
|
|
2219
|
+
fill: !0,
|
|
2220
|
+
disabled: a.trim().length === 0,
|
|
2221
|
+
isLoading: s,
|
|
2222
|
+
children: "Create playlist"
|
|
2223
|
+
})] })
|
|
2224
|
+
]
|
|
2225
|
+
});
|
|
2226
|
+
}), An = ({ children: e, onFulfilled: n }) => /* @__PURE__ */ t(_, {
|
|
2227
|
+
onClick: () => R.show(kn).then(n),
|
|
2228
|
+
iconType: P,
|
|
2229
|
+
fill: !0,
|
|
2230
|
+
children: e
|
|
2231
|
+
}), jn = ({ linkProps: e, ...n }) => {
|
|
2232
|
+
let r = Je(), i = async (t) => {
|
|
2233
|
+
t.preventDefault(), await r.navigate(e);
|
|
2234
|
+
};
|
|
2235
|
+
return /* @__PURE__ */ t(fe, {
|
|
2236
|
+
...n,
|
|
2237
|
+
href: r.buildLocation(e).href,
|
|
2238
|
+
onClick: i
|
|
2239
|
+
});
|
|
2240
|
+
}, Mn = N(({ playlistList: e }) => /* @__PURE__ */ t(Se, { children: /* @__PURE__ */ t(A, { children: "Name" }) })), Nn = N(({ item: e }) => /* @__PURE__ */ t(Te, { children: /* @__PURE__ */ t(j, { children: /* @__PURE__ */ t(jn, {
|
|
2241
|
+
linkProps: {
|
|
2242
|
+
to: "/playlists/$playlistId",
|
|
2243
|
+
params: { playlistId: e.id }
|
|
2244
|
+
},
|
|
2245
|
+
children: e.name
|
|
2246
|
+
}) }) }, e.id)), Pn = N(({ playlistList: e }) => /* @__PURE__ */ t(qe, {
|
|
2247
|
+
tag: "tbody",
|
|
2248
|
+
list: e.items,
|
|
2249
|
+
setList: (t) => e.setItems(t),
|
|
2250
|
+
children: e.items.map((e) => /* @__PURE__ */ t(Nn, { item: e }, e.id))
|
|
2251
|
+
})), Fn = N(({ playlistList: e }) => /* @__PURE__ */ n(xe, { children: [/* @__PURE__ */ t(Mn, { playlistList: e }), /* @__PURE__ */ t(Pn, { playlistList: e })] })), In = () => /* @__PURE__ */ t(sn, {
|
|
2252
|
+
pageTitle: "Playlists",
|
|
2253
|
+
breadcrumbs: [{ text: "Playlists" }]
|
|
2254
|
+
}), Ln = N(({ playlistList: e }) => {
|
|
2255
|
+
let r = a(async (t) => {
|
|
2256
|
+
await e.addItem(e.createItem(t));
|
|
2257
|
+
}, [e]);
|
|
2258
|
+
return /* @__PURE__ */ n(O.Section, { children: [
|
|
2259
|
+
/* @__PURE__ */ t(An, {
|
|
2260
|
+
onFulfilled: r,
|
|
2261
|
+
children: "New playlist"
|
|
2262
|
+
}),
|
|
2263
|
+
/* @__PURE__ */ t(be, { size: "l" }),
|
|
2264
|
+
/* @__PURE__ */ t(Fn, { playlistList: e })
|
|
2265
|
+
] });
|
|
2266
|
+
}), Rn = i(() => {
|
|
2267
|
+
let r = ht();
|
|
2268
|
+
return /* @__PURE__ */ n(e, { children: [/* @__PURE__ */ t(In, {}), /* @__PURE__ */ t(Ln, { playlistList: r })] });
|
|
2269
|
+
});
|
|
2270
|
+
//#endregion
|
|
2271
|
+
export { Ut as BottomBar, vt as HydrangeanDivaProvider, bt as MediaPlayerLayout, Wt as MiniPlayer, nt as PlayQueueContext, cn as PlayQueuePage, on as PlayQueueSection, On as PlaylistDetailsPage, mt as PlaylistListContext, Rn as PlaylistListPage, H as RepeatMode, Ye as bottomBarHeight, G as usePlayQueue, ht as usePlaylistList, z as videoServiceIcons };
|
|
2272
|
+
|
|
2273
|
+
//# sourceMappingURL=index.es.js.map
|