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