@instructure/studio-player 0.1.1 → 0.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (52) hide show
  1. package/dist/studio-player.es.js +842 -4
  2. package/dist/types.d.ts +1 -0
  3. package/package.json +1 -1
  4. package/dist/StudioPlayer/StudioPlayerContext.d.ts +0 -11
  5. package/dist/StudioPlayer/components/BufferingIndicator/BufferingIndicator.d.ts +0 -1
  6. package/dist/StudioPlayer/components/CaptionsButton/CaptionsButton.d.ts +0 -1
  7. package/dist/StudioPlayer/components/CaptionsOverlay/CaptionsOverlay.d.ts +0 -5
  8. package/dist/StudioPlayer/components/ControlsLayout/ControlsLayout.d.ts +0 -1
  9. package/dist/StudioPlayer/components/CustomSettingsMenu/CustomSettingsMenu.d.ts +0 -1
  10. package/dist/StudioPlayer/components/CustomSettingsMenu/CustomSettingsMenuContext.d.ts +0 -8
  11. package/dist/StudioPlayer/components/CustomSettingsMenu/menus/CaptionsMenu/CaptionsFontSizeMenu.d.ts +0 -1
  12. package/dist/StudioPlayer/components/CustomSettingsMenu/menus/CaptionsMenu/CaptionsLanguageMenu.d.ts +0 -1
  13. package/dist/StudioPlayer/components/CustomSettingsMenu/menus/CaptionsMenu/CaptionsMenu.d.ts +0 -1
  14. package/dist/StudioPlayer/components/CustomSettingsMenu/menus/MainMenu/MainMenu.d.ts +0 -1
  15. package/dist/StudioPlayer/components/CustomSettingsMenu/menus/QualityMenu/QualityMenu.d.ts +0 -1
  16. package/dist/StudioPlayer/components/CustomSettingsMenu/menus/SpeedMenu/SpeedMenu.d.ts +0 -1
  17. package/dist/StudioPlayer/components/CustomSettingsMenu/menus/buttons/BaseButton.d.ts +0 -8
  18. package/dist/StudioPlayer/components/CustomSettingsMenu/menus/buttons/CaptionsButton.d.ts +0 -1
  19. package/dist/StudioPlayer/components/CustomSettingsMenu/menus/buttons/CaptionsFontSizeButton.d.ts +0 -1
  20. package/dist/StudioPlayer/components/CustomSettingsMenu/menus/buttons/CaptionsLanguageButton.d.ts +0 -1
  21. package/dist/StudioPlayer/components/CustomSettingsMenu/menus/buttons/QualityButton.d.ts +0 -1
  22. package/dist/StudioPlayer/components/CustomSettingsMenu/menus/buttons/SpeedButton.d.ts +0 -1
  23. package/dist/StudioPlayer/components/CustomSettingsMenu/useCallbackOnEsc.d.ts +0 -1
  24. package/dist/StudioPlayer/components/CustomSettingsMenu/useCustomSettingsMenu.d.ts +0 -18
  25. package/dist/StudioPlayer/components/FeedbackOverlay/FeedbackIcon.d.ts +0 -1
  26. package/dist/StudioPlayer/components/FeedbackOverlay/FeedbackMessage.d.ts +0 -1
  27. package/dist/StudioPlayer/components/FeedbackOverlay/FeedbackOverlay.d.ts +0 -1
  28. package/dist/StudioPlayer/components/FeedbackOverlay/createFeedbackComponent.d.ts +0 -1
  29. package/dist/StudioPlayer/components/FullscreenButton/FullscreenButton.d.ts +0 -1
  30. package/dist/StudioPlayer/components/GesturesContainer/GesturesContainer.d.ts +0 -1
  31. package/dist/StudioPlayer/components/PlayPauseButton/PlayPauseButton.d.ts +0 -1
  32. package/dist/StudioPlayer/components/PosterContainer/PosterContainer.d.ts +0 -4
  33. package/dist/StudioPlayer/components/SmallLayoutOverlay/SmallLayoutOverlay.d.ts +0 -1
  34. package/dist/StudioPlayer/components/TimeIndicator/TimeIndicator.d.ts +0 -1
  35. package/dist/StudioPlayer/components/TimeLine/TimeLine.d.ts +0 -4
  36. package/dist/StudioPlayer/components/VolumeMenu/VolumeMenu.d.ts +0 -1
  37. package/dist/StudioPlayer/components/index.d.ts +0 -14
  38. package/dist/StudioPlayer/shortcuts.d.ts +0 -2
  39. package/dist/errors-DCJKAXTz.js +0 -70
  40. package/dist/index-BM9a_WKH.js +0 -33480
  41. package/dist/prod-DTLJXtPo.js +0 -994
  42. package/dist/srt-parser-CWqahKwO.js +0 -27
  43. package/dist/ssa-parser-BqjjKy4M.js +0 -209
  44. package/dist/vidstack-B-YW57m0-DZMwUKSQ.js +0 -140
  45. package/dist/vidstack-BFbyAy5g-DqVWIlTG.js +0 -378
  46. package/dist/vidstack-BGEqnOoX-BiZsT73r.js +0 -434
  47. package/dist/vidstack-CC0Rsbn0-Cf76Gp3K.js +0 -32
  48. package/dist/vidstack-CbSFenOv-DX2VhxT6.js +0 -60
  49. package/dist/vidstack-D2cUZes0-BnrvKkrf.js +0 -237
  50. package/dist/vidstack-Xu8hy52p-DHV2kI-e.js +0 -323
  51. package/dist/vidstack-Zc3I7oOd-DDsBgkhs.js +0 -31
  52. package/dist/vidstack-krOAtKMi-B4IZWKdc.js +0 -29
@@ -1,6 +1,844 @@
1
- import { E as a, P as A, S as E } from "./index-BM9a_WKH.js";
1
+ import { jsx as e, jsxs as l, Fragment as E } from "react/jsx-runtime";
2
+ import { useCallback as h, createContext as U, useContext as u, useEffect as Q, useState as T, useMemo as W, useRef as ce } from "react";
3
+ import { Spinner as F, useMediaState as r, isTrackCaptionKind as ie, useMediaRemote as D, Track as re, Captions as ue, usePlaybackRateOptions as de, useCaptionOptions as me, useVideoQualityOptions as he, useMediaStore as G, FullscreenButton as X, useMediaPlayer as _e, PlayButton as ge, Poster as pe, Time as z, TimeSlider as w, MuteButton as fe, VolumeSlider as V, MediaPlayer as be, MediaProvider as ke } from "@vidstack/react";
4
+ import { useFloating as Ce, autoUpdate as ve, flip as we, arrow as ye, useDismiss as Le, useInteractions as Ne, FloatingFocusManager as xe, FloatingArrow as Me } from "@floating-ui/react";
5
+ import './index.css';const Be = "_media-buffering-indicator_1fwjr_1", He = "_media-buffering-spinner_1fwjr_17", Ve = "_media-buffering-spin_1fwjr_17", Ie = "_media-buffering-track_1fwjr_22", Pe = "_media-buffering-track-fill_1fwjr_27", I = {
6
+ "media-buffering-indicator": "_media-buffering-indicator_1fwjr_1",
7
+ mediaBufferingIndicator: Be,
8
+ "media-buffering-spinner": "_media-buffering-spinner_1fwjr_17",
9
+ mediaBufferingSpinner: He,
10
+ "media-buffering-spin": "_media-buffering-spin_1fwjr_17",
11
+ mediaBufferingSpin: Ve,
12
+ "media-buffering-track": "_media-buffering-track_1fwjr_22",
13
+ mediaBufferingTrack: Ie,
14
+ "media-buffering-track-fill": "_media-buffering-track-fill_1fwjr_27",
15
+ mediaBufferingTrackFill: Pe
16
+ };
17
+ function Te() {
18
+ return /* @__PURE__ */ e("div", { className: I.mediaBufferingIndicator, children: /* @__PURE__ */ l(F.Root, { className: I.mediaBufferingSpinner, size: 96, children: [
19
+ /* @__PURE__ */ e(F.Track, { className: I.mediaBufferingTrack, width: 8 }),
20
+ /* @__PURE__ */ e(
21
+ F.TrackFill,
22
+ {
23
+ className: I.mediaBufferingTrackFill,
24
+ width: 8
25
+ }
26
+ )
27
+ ] }) });
28
+ }
29
+ const Y = (n) => /* @__PURE__ */ l("svg", { width: 24, height: 24, viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...n, children: [
30
+ /* @__PURE__ */ e("defs", { children: /* @__PURE__ */ e("clipPath", { id: "clip0_149_104418", children: /* @__PURE__ */ e("rect", { width: 24, height: 24, fill: "white" }) }) }),
31
+ /* @__PURE__ */ e("g", { clipPath: "url(#clip0_149_104418)", children: /* @__PURE__ */ e("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M22.5 21.8125V2.3125C22.5 1.9 22.1625 1.5625 21.75 1.5625H2.25C1.8375 1.5625 1.5 1.9 1.5 2.3125V21.8125C1.5 22.225 1.8375 22.5625 2.25 22.5625H21.75C22.1625 22.5625 22.5 22.225 22.5 21.8125ZM21.75 0.0625C22.9905 0.0625 24 1.072 24 2.3125V21.8125C24 23.053 22.9905 24.0625 21.75 24.0625H2.25C1.0095 24.0625 0 23.053 0 21.8125V2.3125C0 1.072 1.0095 0.0625 2.25 0.0625H21.75ZM10.744 10.6709H8.74403V10.0042H6.07736V14.0042H8.74403V13.3375H10.744V14.6709C10.744 15.4042 10.144 16.0042 9.41069 16.0042H5.41069C4.67736 16.0042 4.07736 15.4042 4.07736 14.6709V9.33753C4.07736 8.6042 4.67736 8.0042 5.41069 8.0042H9.41069C10.144 8.0042 10.744 8.6042 10.744 9.33753V10.6709ZM19.8065 10.6709H17.8065V10.0042H15.1399V14.0042H17.8065V13.3375H19.8065V14.6709C19.8065 15.4042 19.2065 16.0042 18.4732 16.0042H14.4732C13.7399 16.0042 13.1399 15.4042 13.1399 14.6709V9.33753C13.1399 8.6042 13.7399 8.0042 14.4732 8.0042H18.4732C19.2065 8.0042 19.8065 8.6042 19.8065 9.33753V10.6709Z", fill: "currentColor" }) })
32
+ ] }), J = (n) => /* @__PURE__ */ l("svg", { width: 24, height: 24, viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", ...n, children: [
33
+ /* @__PURE__ */ e("defs", { children: /* @__PURE__ */ e("clipPath", { id: "clip0_149_104406", children: /* @__PURE__ */ e("rect", { width: 24, height: 24, fill: "white" }) }) }),
34
+ /* @__PURE__ */ e("g", { clipPath: "url(#clip0_149_104406)", children: /* @__PURE__ */ e("path", { d: "M21.3333 0H2.66666C1.18666 0 0 1.35 0 3V21C0 22.65 1.18666 24 2.66666 24H21.3333C22.8 24 24 22.65 24 21V3C24 1.35 22.8 0 21.3333 0ZM10.6667 10.6667H8.66666V10H6V14H8.66666V13.3333H10.6667V14.6667C10.6667 15.4 10.0667 16 9.33334 16H5.33334C4.6 16 4 15.4 4 14.6667V9.33334C4 8.6 4.6 8 5.33334 8H9.33334C10.0667 8 10.6667 8.6 10.6667 9.33334V10.6667ZM20.0042 10.6667H18.0042V10H15.3375V14H18.0042V13.3333H20.0042V14.6667C20.0042 15.4 19.4042 16 18.6708 16H14.6708C13.9375 16 13.3375 15.4 13.3375 14.6667V9.33334C13.3375 8.6 13.9375 8 14.6708 8H18.6708C19.4042 8 20.0042 8.6 20.0042 9.33334V10.6667Z", fill: "currentColor" }) })
35
+ ] });
36
+ function Re() {
37
+ const n = r("hasCaptions"), t = r("textTrack"), a = t && ie(t), o = D(), c = h(
38
+ (i) => {
39
+ o.toggleCaptions(i.nativeEvent);
40
+ },
41
+ [o]
42
+ );
43
+ return n ? /* @__PURE__ */ e(
44
+ "button",
45
+ {
46
+ type: "button",
47
+ className: "controls-button",
48
+ onClick: c,
49
+ "aria-label": "Captions",
50
+ children: a ? /* @__PURE__ */ e(J, { className: "controls-button-icon" }) : /* @__PURE__ */ e(Y, { className: "controls-button-icon" })
51
+ }
52
+ ) : null;
53
+ }
54
+ const N = U(null), Se = "_captions_yfgdn_1", Fe = {
55
+ captions: Se
56
+ };
57
+ function $e({ captions: n }) {
58
+ const t = r("hasCaptions"), a = u(N);
59
+ return /* @__PURE__ */ l(E, { children: [
60
+ n.map((o) => /* @__PURE__ */ e(
61
+ re,
62
+ {
63
+ kind: "subtitles",
64
+ type: o.type,
65
+ language: o.language,
66
+ label: o.label,
67
+ src: o.src
68
+ },
69
+ o.label
70
+ )),
71
+ t ? /* @__PURE__ */ e(
72
+ ue,
73
+ {
74
+ className: Fe.captions,
75
+ style: {
76
+ "--captions-font-size-multiplier": (a == null ? void 0 : a.state.captionsFontSizeMultiplier.value) ?? 1
77
+ }
78
+ }
79
+ ) : null
80
+ ] });
81
+ }
82
+ const Ze = "_root_zdwuq_1", qe = "_left-controls_zdwuq_27", ze = "_right-controls_zdwuq_33", je = "_indicators_zdwuq_39", Oe = "_normal-timeline_zdwuq_48", Ae = "_compact-timeline_zdwuq_54", f = {
83
+ root: Ze,
84
+ "left-controls": "_left-controls_zdwuq_27",
85
+ leftControls: qe,
86
+ "right-controls": "_right-controls_zdwuq_33",
87
+ rightControls: ze,
88
+ indicators: je,
89
+ "normal-timeline": "_normal-timeline_zdwuq_48",
90
+ normalTimeline: Oe,
91
+ "compact-timeline": "_compact-timeline_zdwuq_54",
92
+ compactTimeline: Ae
93
+ };
94
+ function Ke() {
95
+ return /* @__PURE__ */ l("div", { className: f.root, children: [
96
+ /* @__PURE__ */ e(A, { className: f.normalTimeline }),
97
+ /* @__PURE__ */ l("div", { className: f.leftControls, children: [
98
+ /* @__PURE__ */ e(Qn, {}),
99
+ /* @__PURE__ */ e(wt, {})
100
+ ] }),
101
+ /* @__PURE__ */ e("div", { className: f.indicators, children: /* @__PURE__ */ e(ct, {}) }),
102
+ /* @__PURE__ */ e(A, { className: f.compactTimeline }),
103
+ /* @__PURE__ */ l("div", { className: f.rightControls, children: [
104
+ /* @__PURE__ */ e(Re, {}),
105
+ /* @__PURE__ */ e(Nn, {}),
106
+ /* @__PURE__ */ e(jn, {})
107
+ ] })
108
+ ] });
109
+ }
110
+ const Ee = (n) => /* @__PURE__ */ e("svg", { width: 24, height: 24, viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...n, children: /* @__PURE__ */ e("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M21.0692 12C21.0692 11.4776 21.0212 10.944 20.9238 10.4104L23.5511 8.13318L21.0579 3.87247L17.7431 4.97788C16.9059 4.28329 15.9515 3.73553 14.9449 3.37271L14.2616 0H9.28941L8.60612 3.37129C7.58823 3.73553 6.65082 4.27482 5.80659 4.97647L2.49318 3.87247L0 8.13318L2.62729 10.4104C2.52988 10.944 2.48188 11.4776 2.48188 12C2.48188 12.5224 2.52988 13.056 2.62729 13.5896L0 15.8668L2.49318 20.1275L5.808 19.0221C6.64518 19.7167 7.59953 20.2645 8.60612 20.6273L9.28941 24H14.2616L14.9449 20.6287C15.9614 20.2645 16.9002 19.7252 17.7445 19.0235L21.0579 20.1289L23.5511 15.8682L20.9238 13.5911C21.0212 13.056 21.0692 12.5224 21.0692 12ZM11.7755 16.9412C9.05082 16.9412 6.83435 14.7247 6.83435 12C6.83435 9.2753 9.05082 7.05883 11.7755 7.05883C14.5002 7.05883 16.7167 9.2753 16.7167 12C16.7167 14.7247 14.5002 16.9412 11.7755 16.9412Z", fill: "currentColor" }) }), m = U(null), Ue = (n) => /* @__PURE__ */ e("svg", { width: 18, height: 18, viewBox: "0 0 18 18", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...n, children: /* @__PURE__ */ e("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M6 3.03704L7.03704 2L14.037 9L7.03704 16L6 14.963L11.963 9L6 3.03704Z", fill: "currentColor" }) }), Qe = "_menu-hint_k49ve_1", We = "_menu-button_k49ve_5", De = "_menu-label_k49ve_37", Ge = "_menu-icon_k49ve_42", P = {
111
+ "menu-hint": "_menu-hint_k49ve_1",
112
+ menuHint: Qe,
113
+ "menu-button": "_menu-button_k49ve_5",
114
+ menuButton: We,
115
+ "menu-label": "_menu-label_k49ve_37",
116
+ menuLabel: De,
117
+ "menu-icon": "_menu-icon_k49ve_42",
118
+ menuIcon: Ge
119
+ };
120
+ function x({ label: n, hint: t, onClick: a, Icon: o }) {
121
+ return /* @__PURE__ */ l("button", { type: "button", className: P.menuButton, onClick: a, children: [
122
+ o && /* @__PURE__ */ e(o, { className: P.menuIcon }),
123
+ /* @__PURE__ */ e("span", { className: P.menuLabel, children: n }),
124
+ /* @__PURE__ */ e("span", { className: P.menuHint, children: t }),
125
+ /* @__PURE__ */ e(Ue, {})
126
+ ] });
127
+ }
128
+ const Xe = (n) => /* @__PURE__ */ e("svg", { width: 18, height: 18, viewBox: "0 0 18 18", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...n, children: /* @__PURE__ */ e("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M3.42229 2.82911C4.71149 1.83006 6.23876 1.19768 7.8383 1L7.96797 2.05432C6.55867 2.22862 5.21101 2.7866 4.07273 3.66874L3.42229 2.82911ZM5.44493 6.71393L9.49745 10.7665L17.0924 3.1705L17.8438 3.92297L9.49745 12.2693L4.69352 7.46534L5.44493 6.71393ZM17.932 8.83829C17.8618 8.27074 17.7364 7.70745 17.5589 7.16222L16.5482 7.49276C16.7055 7.97209 16.816 8.46843 16.8766 8.96689C16.917 9.29742 16.9372 9.6269 16.9372 9.96594C16.9372 10.305 16.917 10.6344 16.8777 10.9639C16.7033 12.3732 16.1454 13.7209 15.2632 14.8592L16.1029 15.5096C17.1019 14.2204 17.7343 12.6931 17.932 11.0925C17.9766 10.7205 18 10.3486 18 9.96594C18 9.58332 17.9766 9.21134 17.932 8.83829ZM1.05432 8.96795L0 8.83829C0.197684 7.23874 0.830061 5.71147 1.82911 4.42228L2.66874 5.07272C1.7866 6.211 1.22862 7.55865 1.05432 8.96795ZM0 11.0936C0.197684 12.6931 0.830061 14.2204 1.82911 15.5096L2.66874 14.8591C1.7866 13.7209 1.22862 12.3732 1.05432 10.9639L0 11.0936ZM10.0939 1.00011C11.6935 1.19673 13.2207 1.83017 14.5099 2.82922L13.8595 3.66884C12.7202 2.7867 11.3736 2.22872 9.96426 2.05442L10.0939 1.00011Z", fill: "currentColor" }) });
129
+ function Ye() {
130
+ const n = u(m), t = r("playbackRate"), a = h(() => {
131
+ n && n.setPage("speed");
132
+ }, [n]);
133
+ return n ? /* @__PURE__ */ e(
134
+ x,
135
+ {
136
+ label: "Playback Speed",
137
+ hint: `${t}x`,
138
+ onClick: a,
139
+ Icon: Xe
140
+ }
141
+ ) : null;
142
+ }
143
+ function Je() {
144
+ const n = u(m), t = r("hasCaptions"), a = r("textTrack"), o = h(() => {
145
+ n && n.setPage("captions");
146
+ }, [n]);
147
+ return n && t ? /* @__PURE__ */ e(
148
+ x,
149
+ {
150
+ label: "Captions",
151
+ hint: (a == null ? void 0 : a.label) ?? "Off",
152
+ onClick: o,
153
+ Icon: Y
154
+ }
155
+ ) : null;
156
+ }
157
+ const en = (n) => /* @__PURE__ */ l("svg", { width: 18, height: 18, viewBox: "0 0 18 18", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...n, children: [
158
+ /* @__PURE__ */ e("defs", { children: /* @__PURE__ */ e("clipPath", { id: "clip0_412_23039", children: /* @__PURE__ */ e("rect", { width: 18, height: 18, fill: "white" }) }) }),
159
+ /* @__PURE__ */ l("g", { clipPath: "url(#clip0_412_23039)", children: [
160
+ /* @__PURE__ */ e("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M2.46326 3.85039H0V2.65039H2.46326C2.7388 1.36449 3.88181 0.400391 5.24999 0.400391C6.61818 0.400391 7.76119 1.36449 8.03673 2.65039H18V3.85039H8.03673C7.76119 5.13629 6.61818 6.10039 5.24999 6.10039C3.88181 6.10039 2.7388 5.13629 2.46326 3.85039ZM3.59999 3.25039C3.59999 2.33912 4.33872 1.60039 5.24999 1.60039C6.16126 1.60039 6.89999 2.33912 6.89999 3.25039C6.89999 4.16166 6.16126 4.90039 5.24999 4.90039C4.33872 4.90039 3.59999 4.16166 3.59999 3.25039Z", fill: "currentColor" }),
161
+ /* @__PURE__ */ e("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M0 8.40039H9.46326C9.7388 7.11449 10.8818 6.15039 12.25 6.15039C13.6182 6.15039 14.7612 7.11449 15.0367 8.40039H18V9.60039H15.0367C14.7612 10.8863 13.6182 11.8504 12.25 11.8504C10.8818 11.8504 9.7388 10.8863 9.46326 9.60039H0V8.40039ZM12.25 7.35039C11.3387 7.35039 10.6 8.08912 10.6 9.00039C10.6 9.91166 11.3387 10.6504 12.25 10.6504C13.1613 10.6504 13.9 9.91166 13.9 9.00039C13.9 8.08912 13.1613 7.35039 12.25 7.35039Z", fill: "currentColor" }),
162
+ /* @__PURE__ */ e("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M5.24999 17.6004C6.61818 17.6004 7.76119 16.6363 8.03673 15.3504H18V14.1504H8.03673C7.76119 12.8645 6.61818 11.9004 5.24999 11.9004C3.88181 11.9004 2.7388 12.8645 2.46326 14.1504H0V15.3504H2.46326C2.7388 16.6363 3.88181 17.6004 5.24999 17.6004ZM5.24999 13.1004C4.33872 13.1004 3.59999 13.8391 3.59999 14.7504C3.59999 15.6617 4.33872 16.4004 5.24999 16.4004C6.16126 16.4004 6.89999 15.6617 6.89999 14.7504C6.89999 13.8391 6.16126 13.1004 5.24999 13.1004Z", fill: "currentColor" })
163
+ ] })
164
+ ] });
165
+ function nn() {
166
+ const n = u(m), t = r("autoQuality"), a = r("quality"), o = h(() => {
167
+ n && n.setPage("quality");
168
+ }, [n]);
169
+ return n && a ? /* @__PURE__ */ e(
170
+ x,
171
+ {
172
+ label: "Quality",
173
+ hint: t ? `Auto (${a.height}p)` : `${a.height}p`,
174
+ onClick: o,
175
+ Icon: en
176
+ }
177
+ ) : null;
178
+ }
179
+ function k(n) {
180
+ Q(() => {
181
+ const t = (a) => {
182
+ a.key === "Escape" && (n == null || n());
183
+ };
184
+ return document.addEventListener("keydown", t), () => {
185
+ document.removeEventListener("keydown", t);
186
+ };
187
+ }, []);
188
+ }
189
+ const tn = "_main-menu_7h96l_1", an = {
190
+ "main-menu": "_main-menu_7h96l_1",
191
+ mainMenu: tn
192
+ };
193
+ function on() {
194
+ const n = u(m);
195
+ return k(n == null ? void 0 : n.toggle), /* @__PURE__ */ l("div", { className: an.mainMenu, children: [
196
+ /* @__PURE__ */ e(Ye, {}),
197
+ /* @__PURE__ */ e(Je, {}),
198
+ /* @__PURE__ */ e(nn, {})
199
+ ] });
200
+ }
201
+ const R = (n) => /* @__PURE__ */ e("svg", { width: 18, height: 18, viewBox: "0 0 18 18", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...n, children: /* @__PURE__ */ e("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M17.1347 3.00061L6.55157 13.5825L0.865302 7.89624L0 8.76154L6.55157 15.3131L17.9988 3.86469L17.1347 3.00061Z", fill: "currentColor" }) }), M = (n) => /* @__PURE__ */ e("svg", { width: 18, height: 18, viewBox: "0 0 18 18", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...n, children: /* @__PURE__ */ e("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M12.037 3.03704L6.07407 9L12.037 14.963L11 16L4 9L11 2L12.037 3.03704Z", fill: "currentColor" }) }), b = [0.5, 0.75, 1, 1.25, 1.5, 2], ln = [
202
+ { label: "50%", value: 0.5 },
203
+ { label: "100%", value: 1 },
204
+ { label: "200%", value: 2 },
205
+ { label: "300%", value: 3 },
206
+ { label: "400%", value: 4 }
207
+ ], sn = "_menu-container_rqjaq_1", cn = "_menu-options_rqjaq_6", rn = "_menu-heading_rqjaq_11", un = "_check-icon_rqjaq_27", dn = "_menu-item-label_rqjaq_33", mn = "_menu-item_rqjaq_33", hn = "_menu-back-button_rqjaq_65", s = {
208
+ "menu-container": "_menu-container_rqjaq_1",
209
+ menuContainer: sn,
210
+ "menu-options": "_menu-options_rqjaq_6",
211
+ menuOptions: cn,
212
+ "menu-heading": "_menu-heading_rqjaq_11",
213
+ menuHeading: rn,
214
+ "check-icon": "_check-icon_rqjaq_27",
215
+ checkIcon: un,
216
+ "menu-item-label": "_menu-item-label_rqjaq_33",
217
+ menuItemLabel: dn,
218
+ "menu-item": "_menu-item_rqjaq_33",
219
+ menuItem: mn,
220
+ "menu-back-button": "_menu-back-button_rqjaq_65",
221
+ menuBackButton: hn
222
+ };
223
+ function _n() {
224
+ const n = u(m), t = de({
225
+ rates: b,
226
+ normalLabel: "1x"
227
+ });
228
+ return k(n == null ? void 0 : n.backToMain), n ? /* @__PURE__ */ l("div", { className: s.menuContainer, children: [
229
+ /* @__PURE__ */ l(
230
+ "button",
231
+ {
232
+ type: "button",
233
+ className: s.menuBackButton,
234
+ onClick: n.backToMain,
235
+ children: [
236
+ /* @__PURE__ */ e(M, {}),
237
+ /* @__PURE__ */ e("span", { children: "Back" })
238
+ ]
239
+ }
240
+ ),
241
+ /* @__PURE__ */ e("strong", { className: s.menuHeading, children: "Playback Speed" }),
242
+ /* @__PURE__ */ e("div", { role: "menu", className: s.menuOptions, children: t.map(({ value: a, label: o, select: c, selected: i }) => /* @__PURE__ */ l(
243
+ "button",
244
+ {
245
+ type: "button",
246
+ role: "menuitemradio",
247
+ "aria-checked": i,
248
+ onClick: () => {
249
+ c(), n.backToMain(), n.toggle();
250
+ },
251
+ className: s.menuItem,
252
+ children: [
253
+ /* @__PURE__ */ e(R, { className: s.checkIcon }),
254
+ /* @__PURE__ */ e("span", { className: s.menuItemLabel, children: o })
255
+ ]
256
+ },
257
+ a
258
+ )) })
259
+ ] }) : null;
260
+ }
261
+ function gn() {
262
+ const n = u(m), t = r("textTrack"), a = h(() => {
263
+ n && n.setPage("captionLanguage");
264
+ }, [n]);
265
+ return n ? /* @__PURE__ */ e(
266
+ x,
267
+ {
268
+ label: "Language",
269
+ hint: (t == null ? void 0 : t.label) ?? "Off",
270
+ onClick: a
271
+ }
272
+ ) : null;
273
+ }
274
+ function pn() {
275
+ const n = u(N), t = u(m), a = h(() => {
276
+ t && t.setPage("captionFontSize");
277
+ }, [t]);
278
+ return t && n ? /* @__PURE__ */ e(
279
+ x,
280
+ {
281
+ label: "Caption Font Size",
282
+ hint: n.state.captionsFontSizeMultiplier.label,
283
+ onClick: a
284
+ }
285
+ ) : null;
286
+ }
287
+ function fn() {
288
+ const n = u(m);
289
+ return k(n == null ? void 0 : n.backToMain), n ? /* @__PURE__ */ l("div", { className: s.menuContainer, children: [
290
+ /* @__PURE__ */ l(
291
+ "button",
292
+ {
293
+ type: "button",
294
+ className: s.menuBackButton,
295
+ onClick: n.backToMain,
296
+ children: [
297
+ /* @__PURE__ */ e(M, {}),
298
+ /* @__PURE__ */ e("span", { children: "Back" })
299
+ ]
300
+ }
301
+ ),
302
+ /* @__PURE__ */ e("strong", { className: s.menuHeading, children: "Captions" }),
303
+ /* @__PURE__ */ e(gn, {}),
304
+ /* @__PURE__ */ e(pn, {})
305
+ ] }) : null;
306
+ }
307
+ function bn() {
308
+ const n = u(m), t = me();
309
+ return k(n == null ? void 0 : n.backToCaptions), n ? /* @__PURE__ */ l("div", { className: s.menuContainer, children: [
310
+ /* @__PURE__ */ l(
311
+ "button",
312
+ {
313
+ type: "button",
314
+ className: s.menuBackButton,
315
+ onClick: n.backToCaptions,
316
+ children: [
317
+ /* @__PURE__ */ e(M, {}),
318
+ /* @__PURE__ */ e("span", { children: "Back" })
319
+ ]
320
+ }
321
+ ),
322
+ /* @__PURE__ */ e("strong", { className: s.menuHeading, children: "Captions" }),
323
+ /* @__PURE__ */ e("div", { role: "menu", className: s.menuOptions, children: t.map(({ value: a, label: o, select: c, selected: i }) => /* @__PURE__ */ l(
324
+ "button",
325
+ {
326
+ type: "button",
327
+ role: "menuitemradio",
328
+ "aria-checked": i,
329
+ onClick: () => {
330
+ c(), n.backToMain(), n.toggle();
331
+ },
332
+ className: s.menuItem,
333
+ children: [
334
+ /* @__PURE__ */ e(R, { className: s.checkIcon }),
335
+ /* @__PURE__ */ e("span", { className: s.menuItemLabel, children: o })
336
+ ]
337
+ },
338
+ a
339
+ )) })
340
+ ] }) : null;
341
+ }
342
+ function kn() {
343
+ const n = u(N), t = u(m);
344
+ return k(t == null ? void 0 : t.backToCaptions), n && t ? /* @__PURE__ */ l("div", { className: s.menuContainer, children: [
345
+ /* @__PURE__ */ l(
346
+ "button",
347
+ {
348
+ type: "button",
349
+ className: s.menuBackButton,
350
+ onClick: t.backToCaptions,
351
+ children: [
352
+ /* @__PURE__ */ e(M, {}),
353
+ /* @__PURE__ */ e("span", { children: "Back" })
354
+ ]
355
+ }
356
+ ),
357
+ /* @__PURE__ */ e("strong", { className: s.menuHeading, children: "Captions" }),
358
+ /* @__PURE__ */ e("div", { role: "menu", className: s.menuOptions, children: ln.map((a) => /* @__PURE__ */ l(
359
+ "button",
360
+ {
361
+ type: "button",
362
+ role: "menuitemradio",
363
+ "aria-checked": a.value === n.state.captionsFontSizeMultiplier.value,
364
+ onClick: () => {
365
+ n.setState((o) => ({
366
+ ...o,
367
+ captionsFontSizeMultiplier: a
368
+ })), t.backToMain(), t.toggle();
369
+ },
370
+ className: s.menuItem,
371
+ children: [
372
+ /* @__PURE__ */ e(R, { className: s.checkIcon }),
373
+ /* @__PURE__ */ e("span", { className: s.menuItemLabel, children: a.label })
374
+ ]
375
+ },
376
+ a.label
377
+ )) })
378
+ ] }) : null;
379
+ }
380
+ function Cn() {
381
+ const n = u(m), t = he({ sort: "descending" }), a = r("autoQuality");
382
+ return k(n == null ? void 0 : n.backToMain), n ? /* @__PURE__ */ l("div", { className: s.menuContainer, children: [
383
+ /* @__PURE__ */ l(
384
+ "button",
385
+ {
386
+ type: "button",
387
+ className: s.menuBackButton,
388
+ onClick: n.backToMain,
389
+ children: [
390
+ /* @__PURE__ */ e(M, {}),
391
+ /* @__PURE__ */ e("span", { children: "Back" })
392
+ ]
393
+ }
394
+ ),
395
+ /* @__PURE__ */ e("strong", { className: s.menuHeading, children: "Quality" }),
396
+ /* @__PURE__ */ e("div", { role: "menu", className: s.menuOptions, children: t.map(({ value: o, label: c, select: i, selected: _ }) => /* @__PURE__ */ l(
397
+ "button",
398
+ {
399
+ type: "button",
400
+ role: "menuitemradio",
401
+ "aria-checked": o === "auto" && a || _ && !a,
402
+ onClick: () => {
403
+ i(), n.backToMain(), n.toggle();
404
+ },
405
+ className: s.menuItem,
406
+ children: [
407
+ /* @__PURE__ */ e(R, { className: s.checkIcon }),
408
+ /* @__PURE__ */ e("span", { className: s.menuItemLabel, children: c })
409
+ ]
410
+ },
411
+ o
412
+ )) })
413
+ ] }) : null;
414
+ }
415
+ const vn = {
416
+ main: on,
417
+ speed: _n,
418
+ captions: fn,
419
+ captionLanguage: bn,
420
+ captionFontSize: kn,
421
+ quality: Cn
422
+ };
423
+ function wn() {
424
+ const [n, t] = T("main"), [a, o] = T(!1), c = h(() => {
425
+ o((v) => !v);
426
+ }, []), i = h((v) => {
427
+ t(v);
428
+ }, []), _ = h(() => {
429
+ t("captions");
430
+ }, []), p = h(() => {
431
+ t("main");
432
+ }, []), B = W(() => vn[n], [n]), C = ce(null), { refs: S, floatingStyles: H, context: q } = Ce({
433
+ open: a,
434
+ onOpenChange: (v) => {
435
+ o(v), p();
436
+ },
437
+ placement: "top-end",
438
+ whileElementsMounted: ve,
439
+ middleware: [
440
+ we(),
441
+ ye({
442
+ element: C
443
+ })
444
+ ]
445
+ }), oe = Le(q, { escapeKey: !1 }), { getReferenceProps: le, getFloatingProps: se } = Ne([oe]);
446
+ return {
447
+ Page: B,
448
+ open: a,
449
+ toggle: c,
450
+ setPage: i,
451
+ backToCaptions: _,
452
+ backToMain: p,
453
+ arrowRef: C,
454
+ refs: S,
455
+ floatingStyles: H,
456
+ context: q,
457
+ getReferenceProps: le,
458
+ getFloatingProps: se
459
+ };
460
+ }
461
+ const yn = "_settings-menu_hxlsv_1", Ln = "_arrow_hxlsv_15", j = {
462
+ "settings-menu": "_settings-menu_hxlsv_1",
463
+ settingsMenu: yn,
464
+ arrow: Ln
465
+ };
466
+ function Nn() {
467
+ const {
468
+ Page: n,
469
+ arrowRef: t,
470
+ backToCaptions: a,
471
+ backToMain: o,
472
+ context: c,
473
+ floatingStyles: i,
474
+ getFloatingProps: _,
475
+ getReferenceProps: p,
476
+ open: B,
477
+ refs: C,
478
+ setPage: S,
479
+ toggle: H
480
+ } = wn();
481
+ return /* @__PURE__ */ l(E, { children: [
482
+ /* @__PURE__ */ e(
483
+ "button",
484
+ {
485
+ ref: C.setReference,
486
+ type: "button",
487
+ className: "controls-button",
488
+ "aria-label": "Settings",
489
+ onClick: H,
490
+ "aria-expanded": B,
491
+ ...p(),
492
+ children: /* @__PURE__ */ e(Ee, { className: "controls-button-icon icon-rotate" })
493
+ }
494
+ ),
495
+ B && /* @__PURE__ */ e(xe, { context: c, initialFocus: -1, modal: !1, children: /* @__PURE__ */ l(
496
+ "div",
497
+ {
498
+ className: j.settingsMenu,
499
+ ref: C.setFloating,
500
+ style: i,
501
+ ..._(),
502
+ children: [
503
+ /* @__PURE__ */ e(
504
+ m.Provider,
505
+ {
506
+ value: { setPage: S, backToMain: o, backToCaptions: a, toggle: H },
507
+ children: /* @__PURE__ */ e(n, {})
508
+ }
509
+ ),
510
+ /* @__PURE__ */ e(
511
+ Me,
512
+ {
513
+ ref: t,
514
+ context: c,
515
+ className: j.arrow
516
+ }
517
+ )
518
+ ]
519
+ }
520
+ ) })
521
+ ] });
522
+ }
523
+ function ee(n, t = 1e3) {
524
+ return function() {
525
+ const o = r("lastKeyboardAction"), [c, i] = T(!1), _ = h(() => i(!1), []);
526
+ return Q(() => {
527
+ i(!!o);
528
+ const p = setTimeout(_, t);
529
+ return () => clearTimeout(p);
530
+ }, [o, t]), c ? /* @__PURE__ */ e(n, {}) : null;
531
+ };
532
+ }
533
+ const $ = (n) => /* @__PURE__ */ e("svg", { width: 24, height: 24, viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...n, children: /* @__PURE__ */ e("path", { d: "M 11,21 H 5 V 3 h 6 z m 8,0 H 13 V 3 h 6 z", fill: "currentColor" }) }), Z = (n) => /* @__PURE__ */ e("svg", { width: 24, height: 24, viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...n, children: /* @__PURE__ */ e("path", { d: "M 5,2 V 22 L 21,12.000665 Z", fill: "currentColor" }) }), ne = (n) => /* @__PURE__ */ e("svg", { width: 24, height: 24, viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...n, children: /* @__PURE__ */ e("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M14.1179 1.41211V22.589H11.2943L5.64717 16.9418V7.05928L11.2943 1.41211H14.1179ZM4.23537 7.05928V16.9418H2.11769C0.957618 16.9418 0.0189406 16.0147 0.00028305 14.8592L0 14.8241V9.17696C0 8.01689 0.927077 7.07822 2.0826 7.05956L2.11769 7.05928H4.23537ZM22.3744 7.93711L24 9.56119L21.5623 11.9988L24 14.4365L22.3744 16.0621L19.9383 13.6245L17.5006 16.0621L15.875 14.4365L18.3127 11.9988L15.875 9.56119L17.5006 7.93711L19.9383 10.3748L22.3744 7.93711Z", fill: "currentColor" }) }), te = (n) => /* @__PURE__ */ e("svg", { width: 24, height: 24, viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...n, children: /* @__PURE__ */ e("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M5.64714 6.98017V16.8627L11.2943 22.5099H14.1179V1.33301H11.2943L5.64714 6.98017ZM0 9.09785V14.745C0 15.9168 0.945899 16.8627 2.11768 16.8627H4.23537V6.98017H2.11768C0.945899 6.98017 0 7.92607 0 9.09785ZM18.3527 11.9207C18.3527 10.6134 17.8388 9.36962 16.9056 8.4209L17.9094 7.43123C19.1066 8.64396 19.7645 10.2393 19.7645 11.9207C19.7645 13.6036 19.1066 15.1989 17.9094 16.4116L16.9056 15.422C17.8388 14.4732 18.3527 13.2295 18.3527 11.9207Z", fill: "currentColor" }) }), ae = (n) => /* @__PURE__ */ e("svg", { width: 24, height: 24, viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...n, children: /* @__PURE__ */ e("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M5.64714 16.8627V6.98017L11.2943 1.33301H14.1179V22.5099H11.2943L5.64714 16.8627ZM0 14.745V9.09785C0 7.92607 0.945899 6.98017 2.11768 6.98017H4.23537V16.8627H2.11768C0.945899 16.8627 0 15.9168 0 14.745ZM16.9056 8.4209C17.8388 9.36962 18.3527 10.6134 18.3527 11.9207C18.3527 13.2295 17.8388 14.4732 16.9056 15.422L17.9094 16.4116C19.1066 15.1989 19.7645 13.6036 19.7645 11.9207C19.7645 10.2393 19.1066 8.64396 17.9094 7.43123L16.9056 8.4209ZM19.9016 5.43185L20.8997 4.43372C22.9002 6.43422 24 9.09403 24 11.9219C24 14.7497 22.9002 17.4081 20.8997 19.4086L19.9016 18.4104C21.6353 16.6782 22.5882 14.3727 22.5882 11.9219C22.5882 9.46957 21.6353 7.16553 19.9016 5.43185Z", fill: "currentColor" }) }), xn = (n) => /* @__PURE__ */ e("svg", { width: 24, height: 24, viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...n, children: /* @__PURE__ */ e("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M10.691 3.99987V10.5281L0 4.00655V20.2596L10.691 13.7367V20.2663L23.9987 12.1331L10.691 3.99987Z", fill: "currentColor" }) }), Mn = (n) => /* @__PURE__ */ e("svg", { width: 24, height: 24, viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...n, children: /* @__PURE__ */ e("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M13.309 3.99987L0 12.1331L13.309 20.2663V13.7367L23.9987 20.2596V4.00655L13.309 10.5281V3.99987Z", fill: "currentColor" }) }), Bn = "_feedback-overlay_v4lbu_1", Hn = "_feedback-message_v4lbu_14", Vn = "_feedback-icon_v4lbu_30", In = "_feedback-icon-animation_v4lbu_1", d = {
534
+ "feedback-overlay": "_feedback-overlay_v4lbu_1",
535
+ feedbackOverlay: Bn,
536
+ "feedback-message": "_feedback-message_v4lbu_14",
537
+ feedbackMessage: Hn,
538
+ "feedback-icon": "_feedback-icon_v4lbu_30",
539
+ feedbackIcon: Vn,
540
+ "feedback-icon-animation": "_feedback-icon-animation_v4lbu_1",
541
+ feedbackIconAnimation: In
542
+ };
543
+ function Pn() {
544
+ var a;
545
+ const n = G();
546
+ switch ((a = n.lastKeyboardAction) == null ? void 0 : a.action) {
547
+ case "togglePaused":
548
+ return /* @__PURE__ */ e("i", { className: d.feedbackIcon, children: n.paused ? /* @__PURE__ */ e($, {}) : /* @__PURE__ */ e(Z, {}) });
549
+ case "toggleCaptions":
550
+ case "nextCaptionLanguage":
551
+ case "previousCaptionLanguage":
552
+ return n.hasCaptions ? /* @__PURE__ */ e("i", { className: d.feedbackIcon, children: /* @__PURE__ */ e(J, {}) }) : null;
553
+ case "volumeUp":
554
+ case "volumeDown":
555
+ case "toggleMuted":
556
+ return /* @__PURE__ */ e("i", { className: d.feedbackIcon, children: n.muted || n.volume === 0 ? /* @__PURE__ */ e(ne, {}) : n.volume >= 0.5 ? /* @__PURE__ */ e(ae, {}) : /* @__PURE__ */ e(te, {}) });
557
+ case "seekForward":
558
+ case "seekForward10":
559
+ return /* @__PURE__ */ e("i", { className: d.feedbackIcon, children: /* @__PURE__ */ e(xn, { className: "right" }) });
560
+ case "seekBackward":
561
+ case "seekBackward10":
562
+ return /* @__PURE__ */ e("i", { className: d.feedbackIcon, children: /* @__PURE__ */ e(Mn, { className: "left" }) });
563
+ default:
564
+ return null;
565
+ }
566
+ }
567
+ function Tn() {
568
+ var a;
569
+ const n = G();
570
+ switch ((a = n.lastKeyboardAction) == null ? void 0 : a.action) {
571
+ case "toggleCaptions":
572
+ case "nextCaptionLanguage":
573
+ case "previousCaptionLanguage":
574
+ return /* @__PURE__ */ e("div", { className: d.feedbackMessage, children: n.textTrack ? `Caption Language: ${n.textTrack.label}` : "Captions: Off" });
575
+ case "volumeUp":
576
+ case "volumeDown":
577
+ case "toggleMuted":
578
+ return /* @__PURE__ */ e("div", { className: d.feedbackMessage, children: n.muted || n.volume === 0 ? "Muted" : `Volume: ${(n.volume * 100).toFixed(0)}%` });
579
+ case "increasePlaybackRate":
580
+ case "decreasePlaybackRate":
581
+ case "resetPlaybackRate":
582
+ return /* @__PURE__ */ l("div", { className: d.feedbackMessage, children: [
583
+ "Playback speed: ",
584
+ n.playbackRate,
585
+ "x"
586
+ ] });
587
+ case "seekForward":
588
+ return /* @__PURE__ */ e("div", { className: d.feedbackMessage, children: "Seek forward: 5 seconds" });
589
+ case "seekForward10":
590
+ return /* @__PURE__ */ e("div", { className: d.feedbackMessage, children: "Seek forward: 10 seconds" });
591
+ case "seekBackward":
592
+ return /* @__PURE__ */ e("div", { className: d.feedbackMessage, children: "Seek backward: 5 seconds" });
593
+ case "seekBackward10":
594
+ return /* @__PURE__ */ e("div", { className: d.feedbackMessage, children: "Seek backward: 10 seconds" });
595
+ default:
596
+ return null;
597
+ }
598
+ }
599
+ const Rn = ee(Pn, 500), Sn = ee(Tn, 1e3);
600
+ function Fn() {
601
+ return /* @__PURE__ */ l("div", { className: d.feedbackOverlay, children: [
602
+ /* @__PURE__ */ e(Rn, {}),
603
+ /* @__PURE__ */ e(Sn, {})
604
+ ] });
605
+ }
606
+ const $n = (n) => /* @__PURE__ */ e("svg", { width: 24, height: 24, viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...n, children: /* @__PURE__ */ e("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M14.1383 0.999867V3.66268H18.4561L3.66281 18.4546V14.1382H1V23H9.86449V20.3372H5.54542L20.3387 5.54528V9.86303H23.0001V0.999867H14.1383Z", fill: "currentColor" }) }), Zn = (n) => /* @__PURE__ */ e("svg", { width: 24, height: 24, viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...n, children: /* @__PURE__ */ e("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M15.562 6.58944L22.1514 0L24.0005 1.84907L17.4111 8.43851H21.6506V11.0552H12.9453V2.34861H15.562V6.58944ZM2.34861 15.5615V12.9461H11.0539V21.6501H8.43982V17.4106L1.84907 24L0 22.1509L6.59075 15.5615H2.34861Z", fill: "currentColor" }) }), qn = "_full-screen-button_8detf_2", zn = {
607
+ "full-screen-button": "_full-screen-button_8detf_2",
608
+ fullScreenButton: qn
609
+ };
610
+ function jn() {
611
+ const n = r("fullscreen"), t = u(N);
612
+ return t && !t.hideFullScreen ? /* @__PURE__ */ e(
613
+ X,
614
+ {
615
+ className: `controls-button ${zn.fullScreenButton}`,
616
+ children: n ? /* @__PURE__ */ e(Zn, { className: "controls-button-icon" }) : /* @__PURE__ */ e($n, { className: "controls-button-icon" })
617
+ }
618
+ ) : null;
619
+ }
620
+ const On = "_gestures-container_1fn3b_1", An = "_gesture_1fn3b_1", O = {
621
+ "gestures-container": "_gestures-container_1fn3b_1",
622
+ gesturesContainer: On,
623
+ gesture: An
624
+ };
625
+ function Kn() {
626
+ const n = D(), t = () => {
627
+ n.togglePaused();
628
+ };
629
+ return /* @__PURE__ */ e("div", { className: O.gesturesContainer, children: /* @__PURE__ */ e("div", { "aria-hidden": !0, className: O.gesture, onClick: t }) });
630
+ }
631
+ const En = "_play-pause-button_1owe7_1", Un = {
632
+ "play-pause-button": "_play-pause-button_1owe7_1",
633
+ playPauseButton: En
634
+ };
635
+ function Qn() {
636
+ const n = _e(), t = r("paused");
637
+ return n ? /* @__PURE__ */ e(
638
+ ge,
639
+ {
640
+ className: `${Un.playPauseButton} controls-button`,
641
+ onKeyDown: (a) => {
642
+ a.key === " " && (n == null || n.$state.lastKeyboardAction.set({
643
+ action: "togglePaused",
644
+ event: a.nativeEvent
645
+ }));
646
+ },
647
+ children: t ? /* @__PURE__ */ e(Z, { className: "controls-button-icon" }) : /* @__PURE__ */ e($, { className: "controls-button-icon" })
648
+ }
649
+ ) : null;
650
+ }
651
+ const Wn = "_poster_195hi_1", Dn = {
652
+ poster: Wn
653
+ };
654
+ function Gn({ src: n }) {
655
+ const t = r("source");
656
+ return t.type === "video/youtube" || t.type === "video/vimeo" ? null : /* @__PURE__ */ e(pe, { src: n, className: Dn.poster });
657
+ }
658
+ const Xn = (n) => /* @__PURE__ */ e("svg", { width: 18, height: 18, viewBox: "0 0 18 18", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...n, children: /* @__PURE__ */ e("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M8.94968 7.74766L3.99993 2.79791L2.79785 3.99999L7.7476 8.94974L2.79785 13.8995L3.99993 15.1016L8.94968 10.1518L13.8994 15.1016L15.1015 13.8995L10.1518 8.94974L15.1015 3.99999L13.8994 2.79791L8.94968 7.74766Z", fill: "currentColor" }) }), Yn = "_small-layout-overlay_xbovu_1", Jn = "_small-layout-button_xbovu_14", et = "_small-layout-icon-play_xbovu_24", nt = "_small-layout-icon-pause_xbovu_30", tt = "_full-screen-close-icon_xbovu_36", at = "_fade-out_xbovu_1", y = {
659
+ "small-layout-overlay": "_small-layout-overlay_xbovu_1",
660
+ smallLayoutOverlay: Yn,
661
+ "small-layout-button": "_small-layout-button_xbovu_14",
662
+ smallLayoutButton: Jn,
663
+ "small-layout-icon-play": "_small-layout-icon-play_xbovu_24",
664
+ smallLayoutIconPlay: et,
665
+ "small-layout-icon-pause": "_small-layout-icon-pause_xbovu_30",
666
+ smallLayoutIconPause: nt,
667
+ "full-screen-close-icon": "_full-screen-close-icon_xbovu_36",
668
+ fullScreenCloseIcon: tt,
669
+ "fade-out": "_fade-out_xbovu_1",
670
+ fadeOut: at
671
+ };
672
+ function ot() {
673
+ return /* @__PURE__ */ l("div", { className: y.smallLayoutOverlay, children: [
674
+ /* @__PURE__ */ e(X, { className: y.fullScreenCloseIcon, children: /* @__PURE__ */ e(Xn, {}) }),
675
+ /* @__PURE__ */ l("i", { className: y.smallLayoutButton, children: [
676
+ /* @__PURE__ */ e(Z, { className: y.smallLayoutIconPlay }),
677
+ /* @__PURE__ */ e($, { className: y.smallLayoutIconPause })
678
+ ] })
679
+ ] });
680
+ }
681
+ const lt = "_time-indicator_1wsym_1", st = {
682
+ "time-indicator": "_time-indicator_1wsym_1",
683
+ timeIndicator: lt
684
+ };
685
+ function ct() {
686
+ return /* @__PURE__ */ l("div", { className: st.timeIndicator, children: [
687
+ /* @__PURE__ */ e(z, { type: "current" }),
688
+ "/",
689
+ /* @__PURE__ */ e(z, { type: "duration" })
690
+ ] });
691
+ }
692
+ const it = "_timeline-wrapper_j9z56_1", rt = "_track_j9z56_8", ut = "_thumb_j9z56_19", dt = "_root_j9z56_33", mt = "_track-inner_j9z56_63", ht = "_progress_j9z56_69", _t = "_track-fill_j9z56_75", g = {
693
+ "timeline-wrapper": "_timeline-wrapper_j9z56_1",
694
+ timelineWrapper: it,
695
+ track: rt,
696
+ thumb: ut,
697
+ root: dt,
698
+ "track-inner": "_track-inner_j9z56_63",
699
+ trackInner: mt,
700
+ progress: ht,
701
+ "track-fill": "_track-fill_j9z56_75",
702
+ trackFill: _t
703
+ }, gt = `${g.progress} ${g.trackInner}`, pt = `${g.trackFill} ${g.trackInner}`;
704
+ function A({ className: n }) {
705
+ const t = n ? `${g.timelineWrapper} ${n}` : g.timelineWrapper;
706
+ return /* @__PURE__ */ e("div", { className: t, children: /* @__PURE__ */ l(w.Root, { className: g.root, children: [
707
+ /* @__PURE__ */ l(w.Track, { className: g.track, children: [
708
+ /* @__PURE__ */ e(w.Progress, { className: gt }),
709
+ /* @__PURE__ */ e(w.TrackFill, { className: pt })
710
+ ] }),
711
+ /* @__PURE__ */ e(w.Thumb, { className: g.thumb })
712
+ ] }) });
713
+ }
714
+ const ft = "_wrapper_3zgs9_1", bt = "_track_3zgs9_6", kt = "_thumb_3zgs9_16", Ct = "_track-fill_3zgs9_30", vt = "_root_3zgs9_48", L = {
715
+ wrapper: ft,
716
+ track: bt,
717
+ thumb: kt,
718
+ "track-fill": "_track-fill_3zgs9_30",
719
+ trackFill: Ct,
720
+ root: vt
721
+ };
722
+ function wt() {
723
+ const n = r("volume"), t = r("muted");
724
+ return /* @__PURE__ */ l("div", { className: L.wrapper, children: [
725
+ /* @__PURE__ */ e(fe, { className: "controls-button", children: t || n == 0 ? /* @__PURE__ */ e(ne, { className: "controls-button-icon" }) : n < 0.5 ? /* @__PURE__ */ e(te, { className: "controls-button-icon" }) : /* @__PURE__ */ e(ae, { className: "controls-button-icon" }) }),
726
+ /* @__PURE__ */ l(V.Root, { className: L.root, children: [
727
+ /* @__PURE__ */ e(V.Track, { className: L.track, children: /* @__PURE__ */ e(V.TrackFill, { className: L.trackFill }) }),
728
+ /* @__PURE__ */ e(V.Thumb, { className: L.thumb })
729
+ ] })
730
+ ] });
731
+ }
732
+ const K = {
733
+ togglePaused: ["Space", "Enter", "k"],
734
+ seekForward: ["ArrowRight"],
735
+ seekBackward: ["ArrowLeft"],
736
+ volumeUp: ["ArrowUp"],
737
+ volumeDown: ["ArrowDown"],
738
+ toggleFullscreen: ["f"],
739
+ toggleMuted: ["m"],
740
+ toggleCaptions: ["c"],
741
+ nextCaptionLanguage: {
742
+ keys: ["v"],
743
+ onKeyUp({ event: n, player: t, remote: a }) {
744
+ const o = t.textTracks.selectedIndex, c = o + 1;
745
+ a.changeTextTrackMode(o, "hidden"), a.changeTextTrackMode(
746
+ c >= t.textTracks.length ? 0 : c,
747
+ "showing"
748
+ ), t.$state.lastKeyboardAction.set({
749
+ action: "nextCaptionLanguage",
750
+ event: n
751
+ });
752
+ }
753
+ },
754
+ previousCaptionLanguage: {
755
+ keys: ["x"],
756
+ onKeyUp({ event: n, player: t, remote: a }) {
757
+ const o = t.textTracks.selectedIndex, c = o - 1;
758
+ a.changeTextTrackMode(o, "hidden"), a.changeTextTrackMode(
759
+ c < 0 ? t.textTracks.length - 1 : c,
760
+ "showing"
761
+ ), t.$state.lastKeyboardAction.set({
762
+ action: "previousCaptionLanguage",
763
+ event: n
764
+ });
765
+ }
766
+ },
767
+ decreasePlaybackRate: {
768
+ keys: ["a"],
769
+ onKeyUp({ event: n, player: t, remote: a }) {
770
+ const c = b.indexOf(t.playbackRate) - 1;
771
+ c >= 0 && (a.changePlaybackRate(b[c]), t.$state.lastKeyboardAction.set({
772
+ action: "decreasePlaybackRate",
773
+ event: n
774
+ }));
775
+ }
776
+ },
777
+ increasePlaybackRate: {
778
+ keys: ["d"],
779
+ onKeyUp({ event: n, player: t, remote: a }) {
780
+ const c = b.indexOf(t.playbackRate) + 1;
781
+ c < b.length && (a.changePlaybackRate(b[c]), t.$state.lastKeyboardAction.set({
782
+ action: "increasePlaybackRate",
783
+ event: n
784
+ }));
785
+ }
786
+ },
787
+ resetPlaybackRate: {
788
+ keys: ["s"],
789
+ onKeyUp({ event: n, player: t, remote: a }) {
790
+ a.changePlaybackRate(1), t.$state.lastKeyboardAction.set({
791
+ action: "resetPlaybackRate",
792
+ event: n
793
+ });
794
+ }
795
+ },
796
+ seekForward10Seconds: {
797
+ keys: ["l"],
798
+ onKeyUp({ event: n, player: t, remote: a }) {
799
+ a.seek(t.currentTime + 10), t.$state.lastKeyboardAction.set({
800
+ action: "seekForward10",
801
+ event: n
802
+ });
803
+ }
804
+ },
805
+ seekBackward10Seconds: {
806
+ keys: ["j"],
807
+ onKeyUp({ event: n, player: t, remote: a }) {
808
+ a.seek(t.currentTime - 10), t.$state.lastKeyboardAction.set({
809
+ action: "seekBackward10",
810
+ event: n
811
+ });
812
+ }
813
+ }
814
+ }, yt = {};
815
+ function Bt({
816
+ title: n,
817
+ src: t,
818
+ captions: a = [],
819
+ thumbnail: o,
820
+ hideFullScreen: c = !1
821
+ }) {
822
+ const [i, _] = T({
823
+ captionsFontSizeMultiplier: { label: "100%", value: 1 }
824
+ }), p = W(() => c ? {
825
+ ...K,
826
+ toggleFullscreen: []
827
+ } : K, [c]);
828
+ return /* @__PURE__ */ e(N.Provider, { value: { state: i, setState: _, hideFullScreen: c }, children: /* @__PURE__ */ l(be, { title: n, src: t, keyShortcuts: p, playsInline: !0, children: [
829
+ /* @__PURE__ */ l(ke, { className: yt.mediaProvider, children: [
830
+ /* @__PURE__ */ e(Te, {}),
831
+ /* @__PURE__ */ e(Gn, { src: o }),
832
+ /* @__PURE__ */ e($e, { captions: a }),
833
+ /* @__PURE__ */ e(Fn, {}),
834
+ /* @__PURE__ */ e(ot, {}),
835
+ /* @__PURE__ */ e(Kn, {})
836
+ ] }),
837
+ /* @__PURE__ */ e(Ke, {})
838
+ ] }) });
839
+ }
2
840
  export {
3
- a as CAPTION_FONT_SIZE_MULTIPLIERS,
4
- A as PLAYBACK_RATES,
5
- E as StudioPlayer
841
+ ln as CAPTION_FONT_SIZE_MULTIPLIERS,
842
+ b as PLAYBACK_RATES,
843
+ Bt as StudioPlayer
6
844
  };