@factorialco/f0-react 12.12.0 → 12.14.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{ArchiveThumbnail-b34U-zTc.js → ArchiveThumbnail-CgaNJ6v9.js} +1 -1
- package/dist/{ArchiveViewer-BpmryW7A.js → ArchiveViewer-Uohl6wf1.js} +2 -2
- package/dist/{ChatPostComposerDialog-Cr207fXs.js → ChatPostComposerDialog-Cr6Ci2dz.js} +2 -2
- package/dist/{CoachmarkProvider-CsytVD-X.js → CoachmarkProvider-Cfb6WvLp.js} +17551 -17550
- package/dist/{CodeThumbnail-8NiQ3uzU.js → CodeThumbnail-CFNKh12S.js} +1 -1
- package/dist/{CodeViewer-BNZqt-5s.js → CodeViewer-C4XxNdq4.js} +3 -3
- package/dist/{DocumentToolbar-DUe9R1rU.js → DocumentToolbar-CcEggNyX.js} +1 -1
- package/dist/{DocxViewer-BUMy2iL7.js → DocxViewer-DIiFGMl7.js} +1 -1
- package/dist/Ellipsis-CBouJQYY.js +34 -0
- package/dist/{F0AiProcessingOverlay-CiUTeBwG.js → F0AiProcessingOverlay-wFS85Arm.js} +1539 -1485
- package/dist/{F0Alert-Ca8sBfXN.js → F0Alert-DRK5Na7T.js} +10 -10
- package/dist/F0AudioPlayer-Ds4txTh4.js +2 -0
- package/dist/{F0CanvasPanel-BOo_mxBl.js → F0CanvasPanel-CbJxX6Qv.js} +8681 -7494
- package/dist/{F0DocumentViewer-CaYAO9ok.js → F0DocumentViewer-B2_6INMo.js} +1 -1
- package/dist/{F0DocumentViewer-h0XY5tgT.js → F0DocumentViewer-B6ccmcTZ.js} +2 -2
- package/dist/{F0Map-b1uYlF_H.js → F0Map-BkrkSniz.js} +15 -15
- package/dist/F0Text-CXHuzMbj.js +14 -0
- package/dist/F0VideoPlayer-5bnm6ryg.js +1 -0
- package/dist/{F0VideoPlayer-D85XCpqh.js → F0VideoPlayer-BkRdc58E.js} +312 -312
- package/dist/{HtmlViewer-DxOnMV30.js → HtmlViewer-qkAWMkJy.js} +3 -3
- package/dist/{Map-BOMgctnS.js → Map-CZcZoNEa.js} +26 -25
- package/dist/{PdfThumbnail-98PDy4ud.js → PdfThumbnail-RTw1aKm_.js} +1 -1
- package/dist/{PdfViewer-nBnKrTYD.js → PdfViewer-m56GqoJt.js} +5 -5
- package/dist/{SheetViewer-CD9SHbXJ.js → SheetViewer-C80n4nta.js} +12 -12
- package/dist/{TextViewer-DxRBCXzV.js → TextViewer-BINEouL8.js} +1 -1
- package/dist/ai.d.ts +2 -2
- package/dist/ai.js +3 -3
- package/dist/component-status.js +1 -1
- package/dist/experimental.d.ts +15 -3
- package/dist/experimental.js +5782 -5775
- package/dist/{exports-cxvNeHfV.d.ts → exports-BGemf1WM.d.ts} +13 -11
- package/dist/f0.d.ts +8 -129
- package/dist/f0.js +382 -382
- package/dist/{highlight-CqFL-_MG.js → highlight-BNASV9vz.js} +7 -7
- package/dist/{index-DF8ubeg6.d.ts → index-BkCnaiJG.d.ts} +326 -10
- package/dist/localized-CnKvEJya.js +73 -0
- package/dist/{maplibre-Ip4Qe9dM.js → maplibre-DTAAiC-N.js} +1 -1
- package/dist/{pdfWorker-DMjHHAyP.js → pdfWorker-D16_euGm.js} +1 -1
- package/dist/{types-geibVrTM.d.ts → types-C2gKTwyT.d.ts} +2 -179
- package/package.json +1 -1
- package/dist/F0AudioPlayer-BefDLQA2.js +0 -1083
- package/dist/F0AudioPlayer-CNb4kXOk.js +0 -3
- package/dist/F0SegmentedControl-DXoAzTmH.js +0 -103
- package/dist/F0VideoPlayer-_zLFiEIp.js +0 -1
- package/dist/localized-BrUgGMzm.js +0 -46
|
@@ -2,38 +2,38 @@ import { a as e, r as t } from "./i18n-provider-Bdgo-LeP.js";
|
|
|
2
2
|
import { n } from "./skeleton-AC0Fb8zj.js";
|
|
3
3
|
import { L as r, R as i } from "./tooltip-BX4dSfeL.js";
|
|
4
4
|
import { t as a } from "./F0Button-d91IgOnc.js";
|
|
5
|
-
import {
|
|
6
|
-
import { n as
|
|
7
|
-
import { t as
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import { t as
|
|
11
|
-
import { forwardRef as
|
|
12
|
-
import { jsx as
|
|
5
|
+
import { Ks as o, Po as s, do as c, fo as l, js as u, ms as d, ss as f, uo as p } from "./F0CanvasPanel-CbJxX6Qv.js";
|
|
6
|
+
import { n as m, t as h } from "./F0Icon-DmCBV0gK.js";
|
|
7
|
+
import { t as g } from "./Check-DAp9gCRh.js";
|
|
8
|
+
import { a as _, i as v, n as y, o as b, r as x, t as S } from "./localized-CnKvEJya.js";
|
|
9
|
+
import { A as C, B as w, F as T, H as E, I as D, P as O, R as k, a as A, i as j, k as ee, t as te, z as ne } from "./popover-ics24JxK.js";
|
|
10
|
+
import { t as re } from "./useFullscreen-CNwpzjpz.js";
|
|
11
|
+
import { forwardRef as M, useCallback as N, useEffect as P, useId as F, useMemo as I, useRef as L, useState as R } from "react";
|
|
12
|
+
import { jsx as z, jsxs as B } from "react/jsx-runtime";
|
|
13
13
|
//#region src/blocks/F0VideoPlayer/utils.ts
|
|
14
|
-
var
|
|
14
|
+
var V = [
|
|
15
15
|
.5,
|
|
16
16
|
.75,
|
|
17
17
|
1,
|
|
18
18
|
1.25,
|
|
19
19
|
1.5
|
|
20
|
-
],
|
|
20
|
+
], H = .1, ie = [
|
|
21
21
|
25,
|
|
22
22
|
50,
|
|
23
23
|
75
|
|
24
|
-
],
|
|
25
|
-
function
|
|
24
|
+
], U = 3e5, W = .03;
|
|
25
|
+
function G(e) {
|
|
26
26
|
return !Number.isFinite(e) || e < 0 ? "0:00" : `${Math.floor(e / 60)}:${Math.floor(e % 60).toString().padStart(2, "0")}`;
|
|
27
27
|
}
|
|
28
|
-
function
|
|
28
|
+
function K(e) {
|
|
29
29
|
return `${e}x`;
|
|
30
30
|
}
|
|
31
|
-
function
|
|
32
|
-
return
|
|
31
|
+
function q(e) {
|
|
32
|
+
return V.includes(e);
|
|
33
33
|
}
|
|
34
34
|
//#endregion
|
|
35
35
|
//#region src/blocks/F0VideoPlayer/components/AudioDescriptionToggleIcons.tsx
|
|
36
|
-
var
|
|
36
|
+
var J = {
|
|
37
37
|
x: 12,
|
|
38
38
|
y: 15,
|
|
39
39
|
textAnchor: "middle",
|
|
@@ -41,14 +41,14 @@ var Y = {
|
|
|
41
41
|
fontWeight: 700,
|
|
42
42
|
fontFamily: "inherit",
|
|
43
43
|
letterSpacing: -.4
|
|
44
|
-
},
|
|
44
|
+
}, Y = M(({ animate: e, ...t }, n) => /* @__PURE__ */ B("svg", {
|
|
45
45
|
xmlns: "http://www.w3.org/2000/svg",
|
|
46
46
|
viewBox: "0 0 24 24",
|
|
47
47
|
fill: "none",
|
|
48
48
|
ref: n,
|
|
49
49
|
...t,
|
|
50
50
|
"aria-hidden": "true",
|
|
51
|
-
children: [/* @__PURE__ */
|
|
51
|
+
children: [/* @__PURE__ */ z("rect", {
|
|
52
52
|
x: 3.5,
|
|
53
53
|
y: 6.5,
|
|
54
54
|
width: 17,
|
|
@@ -56,38 +56,38 @@ var Y = {
|
|
|
56
56
|
rx: 2.5,
|
|
57
57
|
stroke: "currentColor",
|
|
58
58
|
vectorEffect: "non-scaling-stroke"
|
|
59
|
-
}), /* @__PURE__ */
|
|
60
|
-
...
|
|
59
|
+
}), /* @__PURE__ */ z("text", {
|
|
60
|
+
...J,
|
|
61
61
|
fill: "currentColor",
|
|
62
62
|
children: "AD"
|
|
63
63
|
})]
|
|
64
64
|
}));
|
|
65
|
-
|
|
66
|
-
var
|
|
67
|
-
let r = `ad-mask-${
|
|
68
|
-
return /* @__PURE__ */
|
|
65
|
+
Y.displayName = "AudioDescriptionLineIcon";
|
|
66
|
+
var X = M(({ animate: e, ...t }, n) => {
|
|
67
|
+
let r = `ad-mask-${F().replace(/:/g, "")}`;
|
|
68
|
+
return /* @__PURE__ */ B("svg", {
|
|
69
69
|
xmlns: "http://www.w3.org/2000/svg",
|
|
70
70
|
viewBox: "0 0 24 24",
|
|
71
71
|
fill: "none",
|
|
72
72
|
ref: n,
|
|
73
73
|
...t,
|
|
74
74
|
"aria-hidden": "true",
|
|
75
|
-
children: [/* @__PURE__ */
|
|
75
|
+
children: [/* @__PURE__ */ B("mask", {
|
|
76
76
|
id: r,
|
|
77
77
|
maskUnits: "userSpaceOnUse",
|
|
78
|
-
children: [/* @__PURE__ */
|
|
78
|
+
children: [/* @__PURE__ */ z("rect", {
|
|
79
79
|
x: 3,
|
|
80
80
|
y: 6,
|
|
81
81
|
width: 18,
|
|
82
82
|
height: 12,
|
|
83
83
|
rx: 3,
|
|
84
84
|
fill: "white"
|
|
85
|
-
}), /* @__PURE__ */
|
|
86
|
-
...
|
|
85
|
+
}), /* @__PURE__ */ z("text", {
|
|
86
|
+
...J,
|
|
87
87
|
fill: "black",
|
|
88
88
|
children: "AD"
|
|
89
89
|
})]
|
|
90
|
-
}), /* @__PURE__ */
|
|
90
|
+
}), /* @__PURE__ */ z("rect", {
|
|
91
91
|
x: 3,
|
|
92
92
|
y: 6,
|
|
93
93
|
width: 18,
|
|
@@ -98,17 +98,17 @@ var Z = N(({ animate: e, ...t }, n) => {
|
|
|
98
98
|
})]
|
|
99
99
|
});
|
|
100
100
|
});
|
|
101
|
-
|
|
101
|
+
X.displayName = "AudioDescriptionFilledIcon";
|
|
102
102
|
//#endregion
|
|
103
103
|
//#region src/blocks/F0VideoPlayer/components/CaptionsToggleIcons.tsx
|
|
104
|
-
var
|
|
104
|
+
var Z = M(({ animate: e, ...t }, n) => /* @__PURE__ */ B("svg", {
|
|
105
105
|
xmlns: "http://www.w3.org/2000/svg",
|
|
106
106
|
fill: "none",
|
|
107
107
|
viewBox: "0 0 24 24",
|
|
108
108
|
ref: n,
|
|
109
109
|
...t,
|
|
110
110
|
children: [
|
|
111
|
-
/* @__PURE__ */
|
|
111
|
+
/* @__PURE__ */ z("rect", {
|
|
112
112
|
x: 3.5,
|
|
113
113
|
y: 6.5,
|
|
114
114
|
width: 17,
|
|
@@ -117,13 +117,13 @@ var Q = N(({ animate: e, ...t }, n) => /* @__PURE__ */ V("svg", {
|
|
|
117
117
|
stroke: "currentColor",
|
|
118
118
|
vectorEffect: "non-scaling-stroke"
|
|
119
119
|
}),
|
|
120
|
-
/* @__PURE__ */
|
|
120
|
+
/* @__PURE__ */ z("path", {
|
|
121
121
|
stroke: "currentColor",
|
|
122
122
|
strokeLinecap: "round",
|
|
123
123
|
d: "M7 10.75h8",
|
|
124
124
|
vectorEffect: "non-scaling-stroke"
|
|
125
125
|
}),
|
|
126
|
-
/* @__PURE__ */
|
|
126
|
+
/* @__PURE__ */ z("path", {
|
|
127
127
|
stroke: "currentColor",
|
|
128
128
|
strokeLinecap: "round",
|
|
129
129
|
d: "M7 13.75h4.5",
|
|
@@ -131,14 +131,14 @@ var Q = N(({ animate: e, ...t }, n) => /* @__PURE__ */ V("svg", {
|
|
|
131
131
|
})
|
|
132
132
|
]
|
|
133
133
|
}));
|
|
134
|
-
|
|
135
|
-
var
|
|
134
|
+
Z.displayName = "CaptionsLineIcon";
|
|
135
|
+
var ae = M(({ animate: e, ...t }, n) => /* @__PURE__ */ z("svg", {
|
|
136
136
|
xmlns: "http://www.w3.org/2000/svg",
|
|
137
137
|
fill: "none",
|
|
138
138
|
viewBox: "0 0 24 24",
|
|
139
139
|
ref: n,
|
|
140
140
|
...t,
|
|
141
|
-
children: /* @__PURE__ */
|
|
141
|
+
children: /* @__PURE__ */ z("path", {
|
|
142
142
|
fill: "currentColor",
|
|
143
143
|
fillRule: "evenodd",
|
|
144
144
|
clipRule: "evenodd",
|
|
@@ -146,23 +146,23 @@ var ie = N(({ animate: e, ...t }, n) => /* @__PURE__ */ B("svg", {
|
|
|
146
146
|
vectorEffect: "non-scaling-stroke"
|
|
147
147
|
})
|
|
148
148
|
}));
|
|
149
|
-
|
|
149
|
+
ae.displayName = "CaptionsFilledIcon";
|
|
150
150
|
//#endregion
|
|
151
151
|
//#region src/blocks/F0VideoPlayer/components/PlaybackRateMenu.tsx
|
|
152
|
-
function
|
|
153
|
-
let { t: o } = t(), [s, c] =
|
|
154
|
-
return /* @__PURE__ */
|
|
152
|
+
function oe({ value: e, onChange: n, containerRef: i }) {
|
|
153
|
+
let { t: o } = t(), [s, c] = R(!1);
|
|
154
|
+
return /* @__PURE__ */ B(te, {
|
|
155
155
|
open: s,
|
|
156
156
|
onOpenChange: c,
|
|
157
|
-
children: [/* @__PURE__ */
|
|
157
|
+
children: [/* @__PURE__ */ z(A, {
|
|
158
158
|
asChild: !0,
|
|
159
|
-
children: /* @__PURE__ */
|
|
159
|
+
children: /* @__PURE__ */ z(a, {
|
|
160
160
|
variant: "ghost",
|
|
161
161
|
size: "sm",
|
|
162
|
-
label:
|
|
163
|
-
"aria-label": o("videoPlayer.playbackSpeed", { rate:
|
|
162
|
+
label: K(e),
|
|
163
|
+
"aria-label": o("videoPlayer.playbackSpeed", { rate: K(e) })
|
|
164
164
|
})
|
|
165
|
-
}), /* @__PURE__ */
|
|
165
|
+
}), /* @__PURE__ */ z(j, {
|
|
166
166
|
container: i.current,
|
|
167
167
|
side: "top",
|
|
168
168
|
align: "end",
|
|
@@ -191,9 +191,9 @@ function ae({ value: e, onChange: n, containerRef: i }) {
|
|
|
191
191
|
}
|
|
192
192
|
e.preventDefault(), t[r]?.focus();
|
|
193
193
|
},
|
|
194
|
-
children:
|
|
194
|
+
children: V.map((t) => {
|
|
195
195
|
let i = t === e;
|
|
196
|
-
return /* @__PURE__ */
|
|
196
|
+
return /* @__PURE__ */ B("button", {
|
|
197
197
|
type: "button",
|
|
198
198
|
role: "menuitemradio",
|
|
199
199
|
"aria-checked": i,
|
|
@@ -201,10 +201,10 @@ function ae({ value: e, onChange: n, containerRef: i }) {
|
|
|
201
201
|
onClick: () => {
|
|
202
202
|
n(t), c(!1);
|
|
203
203
|
},
|
|
204
|
-
children: [i ? /* @__PURE__ */
|
|
204
|
+
children: [i ? /* @__PURE__ */ z("span", {
|
|
205
205
|
className: "absolute left-2.5 inline-flex items-center",
|
|
206
|
-
children: /* @__PURE__ */
|
|
207
|
-
}) : null,
|
|
206
|
+
children: /* @__PURE__ */ z(g, {})
|
|
207
|
+
}) : null, K(t)]
|
|
208
208
|
}, t);
|
|
209
209
|
})
|
|
210
210
|
})]
|
|
@@ -212,8 +212,8 @@ function ae({ value: e, onChange: n, containerRef: i }) {
|
|
|
212
212
|
}
|
|
213
213
|
//#endregion
|
|
214
214
|
//#region src/blocks/F0VideoPlayer/components/Seekbar.tsx
|
|
215
|
-
function
|
|
216
|
-
let { t: c } = t(), l =
|
|
215
|
+
function se({ currentTime: e, duration: n, markerTime: a, blockSeekPastMarker: o = !1, onSeek: s }) {
|
|
216
|
+
let { t: c } = t(), l = L(null), [u, d] = R(!1), [f, p] = R(null), m = n > 0 ? Math.min(1, e / n) : 0, h = a !== void 0 && n > 0 ? Math.min(1, a / n) : 0, g = a !== void 0 && n > 0 && a > 0 && a < n - .25 && e < a - .25, _ = (e) => {
|
|
217
217
|
let t = l.current;
|
|
218
218
|
if (!t) return 0;
|
|
219
219
|
let n = t.getBoundingClientRect();
|
|
@@ -227,7 +227,7 @@ function oe({ currentTime: e, duration: n, markerTime: a, blockSeekPastMarker: o
|
|
|
227
227
|
}, x = (e) => {
|
|
228
228
|
u && (d(!1), e.currentTarget.hasPointerCapture(e.pointerId) && e.currentTarget.releasePointerCapture(e.pointerId));
|
|
229
229
|
}, S = f !== null && o && a !== void 0 && f > h;
|
|
230
|
-
return /* @__PURE__ */
|
|
230
|
+
return /* @__PURE__ */ B("div", {
|
|
231
231
|
ref: l,
|
|
232
232
|
className: r("relative flex h-4 flex-1 items-center rounded-sm", "cursor-pointer touch-none", i()),
|
|
233
233
|
role: "slider",
|
|
@@ -237,8 +237,8 @@ function oe({ currentTime: e, duration: n, markerTime: a, blockSeekPastMarker: o
|
|
|
237
237
|
"aria-valuemax": n || 0,
|
|
238
238
|
"aria-valuenow": e,
|
|
239
239
|
"aria-valuetext": c("videoPlayer.timeProgress", {
|
|
240
|
-
current:
|
|
241
|
-
total:
|
|
240
|
+
current: G(e),
|
|
241
|
+
total: G(n)
|
|
242
242
|
}),
|
|
243
243
|
onPointerDown: y,
|
|
244
244
|
onPointerMove: b,
|
|
@@ -267,55 +267,55 @@ function oe({ currentTime: e, duration: n, markerTime: a, blockSeekPastMarker: o
|
|
|
267
267
|
t.preventDefault(), t.stopPropagation(), s(r);
|
|
268
268
|
},
|
|
269
269
|
children: [
|
|
270
|
-
/* @__PURE__ */
|
|
271
|
-
/* @__PURE__ */
|
|
270
|
+
/* @__PURE__ */ z("div", { className: "absolute inset-x-0 h-1 rounded-sm bg-f1-foreground/30" }),
|
|
271
|
+
/* @__PURE__ */ z("div", {
|
|
272
272
|
className: "pointer-events-none absolute left-0 h-1 rounded-sm bg-f1-foreground",
|
|
273
273
|
style: { width: `${m * 100}%` }
|
|
274
274
|
}),
|
|
275
|
-
g ? /* @__PURE__ */
|
|
275
|
+
g ? /* @__PURE__ */ z("div", {
|
|
276
276
|
className: "pointer-events-none absolute z-[1] h-2.5 w-0.5 -translate-x-px bg-f1-foreground/95",
|
|
277
277
|
style: { left: `${h * 100}%` },
|
|
278
278
|
"aria-hidden": "true"
|
|
279
279
|
}) : null,
|
|
280
|
-
/* @__PURE__ */
|
|
280
|
+
/* @__PURE__ */ z("div", {
|
|
281
281
|
className: "pointer-events-none absolute z-[2] h-3 w-3 -translate-x-1/2 rounded-full bg-f1-foreground shadow-[0_0_4px_rgba(0,0,0,0.4)]",
|
|
282
282
|
style: { left: `${m * 100}%` }
|
|
283
283
|
}),
|
|
284
|
-
S ? /* @__PURE__ */
|
|
284
|
+
S ? /* @__PURE__ */ z("div", { className: "absolute inset-0 cursor-not-allowed" }) : null
|
|
285
285
|
]
|
|
286
286
|
});
|
|
287
287
|
}
|
|
288
288
|
//#endregion
|
|
289
289
|
//#region src/blocks/F0VideoPlayer/components/SettingsMenu.tsx
|
|
290
|
-
var
|
|
290
|
+
var Q = "off", ce = "py-2 pr-4 text-base font-medium", le = "gap-2 py-2 pl-3 pr-2 text-base font-medium", ue = "max-h-[var(--radix-dropdown-menu-content-available-height)] min-w-[13rem] overflow-y-auto p-1";
|
|
291
291
|
function $({ icon: e, label: t, container: n, options: r, value: i, onLanguageChange: a, on: o, onOff: s, offLabel: c }) {
|
|
292
|
-
let l = s !== void 0, u = r.find((e) => e.locale === i), d = l && !o ? c : u ?
|
|
293
|
-
return /* @__PURE__ */
|
|
292
|
+
let l = s !== void 0, u = r.find((e) => e.locale === i), d = l && !o ? c : u ? x(u) : c;
|
|
293
|
+
return /* @__PURE__ */ B(k, { children: [/* @__PURE__ */ B(w, {
|
|
294
294
|
className: le,
|
|
295
295
|
children: [
|
|
296
|
-
/* @__PURE__ */
|
|
297
|
-
/* @__PURE__ */
|
|
296
|
+
/* @__PURE__ */ z(m, { icon: e }),
|
|
297
|
+
/* @__PURE__ */ z("span", {
|
|
298
298
|
className: "flex-1",
|
|
299
299
|
children: t
|
|
300
300
|
}),
|
|
301
|
-
/* @__PURE__ */
|
|
301
|
+
/* @__PURE__ */ z("span", {
|
|
302
302
|
className: "text-f1-foreground-secondary",
|
|
303
303
|
children: d
|
|
304
304
|
})
|
|
305
305
|
]
|
|
306
|
-
}), /* @__PURE__ */
|
|
306
|
+
}), /* @__PURE__ */ z(O, {
|
|
307
307
|
container: n ?? void 0,
|
|
308
|
-
children: /* @__PURE__ */
|
|
308
|
+
children: /* @__PURE__ */ z(ne, {
|
|
309
309
|
className: ue,
|
|
310
|
-
children: /* @__PURE__ */
|
|
311
|
-
value: l ? o ? i :
|
|
312
|
-
onValueChange: (e) => l && e ===
|
|
313
|
-
children: [r.map((e) => /* @__PURE__ */
|
|
310
|
+
children: /* @__PURE__ */ B(T, {
|
|
311
|
+
value: l ? o ? i : Q : i,
|
|
312
|
+
onValueChange: (e) => l && e === Q ? s() : a(e),
|
|
313
|
+
children: [r.map((e) => /* @__PURE__ */ z(D, {
|
|
314
314
|
value: e.locale,
|
|
315
315
|
className: ce,
|
|
316
|
-
children:
|
|
317
|
-
}, e.locale)), l ? /* @__PURE__ */
|
|
318
|
-
value:
|
|
316
|
+
children: x(e)
|
|
317
|
+
}, e.locale)), l ? /* @__PURE__ */ z(D, {
|
|
318
|
+
value: Q,
|
|
319
319
|
className: ce,
|
|
320
320
|
children: c
|
|
321
321
|
}) : null]
|
|
@@ -323,53 +323,53 @@ function $({ icon: e, label: t, container: n, options: r, value: i, onLanguageCh
|
|
|
323
323
|
})
|
|
324
324
|
})] });
|
|
325
325
|
}
|
|
326
|
-
function de({ containerRef: e, audioLanguages: n, audioLanguage: r, onAudioLanguageChange: i, captionLanguages: o, captionLanguage:
|
|
327
|
-
let { t: v } = t(),
|
|
328
|
-
return /* @__PURE__ */
|
|
326
|
+
function de({ containerRef: e, audioLanguages: n, audioLanguage: r, onAudioLanguageChange: i, captionLanguages: o, captionLanguage: c, captionsOn: l, onCaptionLanguageChange: d, onCaptionsOff: f, audioDescriptionLanguages: p, audioDescriptionLanguage: m, audioDescriptionOn: h, onAudioDescriptionLanguageChange: g, onAudioDescriptionOff: _ }) {
|
|
327
|
+
let { t: v } = t(), y = e.current, b = v("videoPlayer.off");
|
|
328
|
+
return /* @__PURE__ */ B(ee, { children: [/* @__PURE__ */ z(E, {
|
|
329
329
|
asChild: !0,
|
|
330
|
-
children: /* @__PURE__ */
|
|
330
|
+
children: /* @__PURE__ */ z(a, {
|
|
331
331
|
variant: "ghost",
|
|
332
332
|
size: "sm",
|
|
333
333
|
hideLabel: !0,
|
|
334
|
-
icon:
|
|
334
|
+
icon: s,
|
|
335
335
|
label: v("videoPlayer.settings")
|
|
336
336
|
})
|
|
337
|
-
}), /* @__PURE__ */
|
|
338
|
-
container:
|
|
337
|
+
}), /* @__PURE__ */ B(C, {
|
|
338
|
+
container: y,
|
|
339
339
|
side: "top",
|
|
340
340
|
align: "end",
|
|
341
341
|
className: ue,
|
|
342
342
|
children: [
|
|
343
|
-
n.length > 1 ? /* @__PURE__ */
|
|
344
|
-
icon:
|
|
343
|
+
n.length > 1 ? /* @__PURE__ */ z($, {
|
|
344
|
+
icon: u,
|
|
345
345
|
label: v("videoPlayer.audio"),
|
|
346
|
-
container:
|
|
346
|
+
container: y,
|
|
347
347
|
options: n,
|
|
348
348
|
value: r,
|
|
349
349
|
onLanguageChange: i,
|
|
350
|
-
offLabel:
|
|
350
|
+
offLabel: b
|
|
351
351
|
}) : null,
|
|
352
|
-
o.length > 1 ? /* @__PURE__ */
|
|
353
|
-
icon:
|
|
352
|
+
o.length > 1 ? /* @__PURE__ */ z($, {
|
|
353
|
+
icon: Z,
|
|
354
354
|
label: v("videoPlayer.subtitles"),
|
|
355
|
-
container:
|
|
355
|
+
container: y,
|
|
356
356
|
options: o,
|
|
357
|
-
value:
|
|
358
|
-
on:
|
|
359
|
-
onLanguageChange:
|
|
360
|
-
onOff:
|
|
361
|
-
offLabel:
|
|
357
|
+
value: c,
|
|
358
|
+
on: l,
|
|
359
|
+
onLanguageChange: d,
|
|
360
|
+
onOff: f,
|
|
361
|
+
offLabel: b
|
|
362
362
|
}) : null,
|
|
363
|
-
|
|
364
|
-
icon:
|
|
363
|
+
p.length > 1 ? /* @__PURE__ */ z($, {
|
|
364
|
+
icon: Y,
|
|
365
365
|
label: v("videoPlayer.audioDescription"),
|
|
366
|
-
container:
|
|
367
|
-
options:
|
|
368
|
-
value:
|
|
369
|
-
on:
|
|
366
|
+
container: y,
|
|
367
|
+
options: p,
|
|
368
|
+
value: m,
|
|
369
|
+
on: h,
|
|
370
370
|
onLanguageChange: g,
|
|
371
371
|
onOff: _,
|
|
372
|
-
offLabel:
|
|
372
|
+
offLabel: b
|
|
373
373
|
}) : null
|
|
374
374
|
]
|
|
375
375
|
})] });
|
|
@@ -380,34 +380,34 @@ function fe(e) {
|
|
|
380
380
|
//#endregion
|
|
381
381
|
//#region src/blocks/F0VideoPlayer/components/VolumeControl.tsx
|
|
382
382
|
function pe(e, t) {
|
|
383
|
-
return t || e === 0 ?
|
|
383
|
+
return t || e === 0 ? p : e <= .5 ? c : l;
|
|
384
384
|
}
|
|
385
385
|
function me({ volume: e, isMuted: n, onToggleMute: r, onVolumeChange: i, silent: o = !1 }) {
|
|
386
386
|
let { t: s } = t(), c = n || e === 0;
|
|
387
|
-
return o ? /* @__PURE__ */
|
|
387
|
+
return o ? /* @__PURE__ */ z(a, {
|
|
388
388
|
variant: "ghost",
|
|
389
389
|
size: "sm",
|
|
390
390
|
hideLabel: !0,
|
|
391
391
|
disabled: !0,
|
|
392
|
-
icon:
|
|
392
|
+
icon: p,
|
|
393
393
|
label: s("videoPlayer.noAudio")
|
|
394
|
-
}) : /* @__PURE__ */
|
|
394
|
+
}) : /* @__PURE__ */ B("div", {
|
|
395
395
|
className: "flex items-center gap-1",
|
|
396
|
-
children: [/* @__PURE__ */
|
|
396
|
+
children: [/* @__PURE__ */ z(a, {
|
|
397
397
|
variant: "ghost",
|
|
398
398
|
size: "sm",
|
|
399
399
|
hideLabel: !0,
|
|
400
400
|
icon: pe(e, c),
|
|
401
401
|
label: s(c ? "videoPlayer.unmute" : "videoPlayer.mute"),
|
|
402
402
|
onClick: r
|
|
403
|
-
}), /* @__PURE__ */
|
|
403
|
+
}), /* @__PURE__ */ z(he, {
|
|
404
404
|
value: c ? 0 : e,
|
|
405
405
|
onChange: i
|
|
406
406
|
})]
|
|
407
407
|
});
|
|
408
408
|
}
|
|
409
409
|
function he({ value: e, onChange: n }) {
|
|
410
|
-
let { t: a } = t(), o =
|
|
410
|
+
let { t: a } = t(), o = L(null), [s, c] = R(!1), l = Math.max(0, Math.min(1, e)), u = (e) => {
|
|
411
411
|
let t = o.current;
|
|
412
412
|
if (!t) return 0;
|
|
413
413
|
let n = t.getBoundingClientRect(), r = n.width - 12;
|
|
@@ -419,7 +419,7 @@ function he({ value: e, onChange: n }) {
|
|
|
419
419
|
}, p = (e) => {
|
|
420
420
|
s && (c(!1), e.currentTarget.hasPointerCapture(e.pointerId) && e.currentTarget.releasePointerCapture(e.pointerId));
|
|
421
421
|
};
|
|
422
|
-
return /* @__PURE__ */
|
|
422
|
+
return /* @__PURE__ */ B("div", {
|
|
423
423
|
ref: o,
|
|
424
424
|
className: r("relative flex h-4 w-[60px] items-center rounded-sm", "cursor-pointer touch-none", i()),
|
|
425
425
|
role: "slider",
|
|
@@ -439,11 +439,11 @@ function he({ value: e, onChange: n }) {
|
|
|
439
439
|
switch (e.key) {
|
|
440
440
|
case "ArrowRight":
|
|
441
441
|
case "ArrowUp":
|
|
442
|
-
t = Math.min(1, l +
|
|
442
|
+
t = Math.min(1, l + H);
|
|
443
443
|
break;
|
|
444
444
|
case "ArrowLeft":
|
|
445
445
|
case "ArrowDown":
|
|
446
|
-
t = Math.max(0, l -
|
|
446
|
+
t = Math.max(0, l - H);
|
|
447
447
|
break;
|
|
448
448
|
case "Home":
|
|
449
449
|
t = 0;
|
|
@@ -456,12 +456,12 @@ function he({ value: e, onChange: n }) {
|
|
|
456
456
|
e.preventDefault(), e.stopPropagation(), n(t);
|
|
457
457
|
},
|
|
458
458
|
children: [
|
|
459
|
-
/* @__PURE__ */
|
|
460
|
-
/* @__PURE__ */
|
|
459
|
+
/* @__PURE__ */ z("div", { className: "absolute inset-x-0 h-1 rounded-sm bg-f1-foreground/30" }),
|
|
460
|
+
/* @__PURE__ */ z("div", {
|
|
461
461
|
className: "pointer-events-none absolute left-0 h-1 rounded-sm bg-f1-foreground",
|
|
462
462
|
style: { width: `calc(12px + (100% - 12px) * ${l})` }
|
|
463
463
|
}),
|
|
464
|
-
/* @__PURE__ */
|
|
464
|
+
/* @__PURE__ */ z("div", {
|
|
465
465
|
className: "pointer-events-none absolute h-3 w-3 -translate-x-1/2 rounded-full bg-f1-foreground shadow-[0_0_4px_rgba(0,0,0,0.4)]",
|
|
466
466
|
style: { left: `calc(6px + (100% - 12px) * ${l})` }
|
|
467
467
|
})
|
|
@@ -470,99 +470,99 @@ function he({ value: e, onChange: n }) {
|
|
|
470
470
|
}
|
|
471
471
|
//#endregion
|
|
472
472
|
//#region src/blocks/F0VideoPlayer/components/Controls.tsx
|
|
473
|
-
function ge({ isPlaying: e, currentTime: n, duration: i, volume: s, isMuted:
|
|
474
|
-
let { t:
|
|
475
|
-
audioLanguages:
|
|
476
|
-
captionLanguages:
|
|
477
|
-
audioDescriptionLanguages:
|
|
473
|
+
function ge({ isPlaying: e, currentTime: n, duration: i, volume: s, isMuted: c, playbackRate: l, isFullscreen: u, markerTime: p, blockSeekPastMarker: m, containerRef: h, captionsAvailable: g, captionsOn: v, audioDescriptionAvailable: y, audioDescriptionOn: x, silent: S, persist: C, audioLanguages: w, audioLanguage: T, onAudioLanguageChange: E, captionLanguages: D, captionLanguage: O, onCaptionLanguageChange: k, onCaptionsOff: A, audioDescriptionLanguages: j, audioDescriptionLanguage: ee, onAudioDescriptionLanguageChange: te, onAudioDescriptionOff: ne, onTogglePlay: re, onToggleMute: M, onVolumeChange: N, onPlaybackRateChange: P, onToggleFullscreen: F, onToggleCaptions: I, onToggleAudioDescription: L, onSeek: R, download: V }) {
|
|
474
|
+
let { t: H } = t(), ie = g && D.length <= 1, U = y && j.length <= 1, W = fe({
|
|
475
|
+
audioLanguages: w.length,
|
|
476
|
+
captionLanguages: D.length,
|
|
477
|
+
audioDescriptionLanguages: j.length
|
|
478
478
|
});
|
|
479
|
-
return /* @__PURE__ */
|
|
479
|
+
return /* @__PURE__ */ B("div", {
|
|
480
480
|
className: r("dark absolute inset-x-0 bottom-0 z-[2] flex select-none items-center gap-2", "rounded-b-[inherit] bg-gradient-to-t from-[#000000f2] via-[#000000b3] to-transparent px-3 py-3", "[text-shadow:0_1px_2px_rgba(0,0,0,0.55)] [&_svg]:drop-shadow-[0_1px_2px_rgba(0,0,0,0.55)]", "transition-opacity duration-200 motion-reduce:transition-none", !e || C ? "opacity-100" : "opacity-0 group-hover:opacity-100 group-focus-within:opacity-100"),
|
|
481
481
|
children: [
|
|
482
|
-
/* @__PURE__ */
|
|
482
|
+
/* @__PURE__ */ z(a, {
|
|
483
483
|
variant: "ghost",
|
|
484
484
|
size: "sm",
|
|
485
485
|
hideLabel: !0,
|
|
486
|
-
icon: e ?
|
|
487
|
-
label:
|
|
488
|
-
onClick:
|
|
486
|
+
icon: e ? b : _,
|
|
487
|
+
label: H(e ? "videoPlayer.pause" : "videoPlayer.play"),
|
|
488
|
+
onClick: re
|
|
489
489
|
}),
|
|
490
|
-
/* @__PURE__ */
|
|
490
|
+
/* @__PURE__ */ z(se, {
|
|
491
491
|
currentTime: n,
|
|
492
492
|
duration: i,
|
|
493
|
-
markerTime:
|
|
494
|
-
blockSeekPastMarker:
|
|
495
|
-
onSeek:
|
|
493
|
+
markerTime: p,
|
|
494
|
+
blockSeekPastMarker: m,
|
|
495
|
+
onSeek: R
|
|
496
496
|
}),
|
|
497
|
-
/* @__PURE__ */
|
|
497
|
+
/* @__PURE__ */ B("span", {
|
|
498
498
|
className: "min-w-[80px] whitespace-nowrap text-center text-base font-medium tabular-nums text-f1-foreground",
|
|
499
499
|
children: [
|
|
500
|
-
|
|
500
|
+
G(n),
|
|
501
501
|
" / ",
|
|
502
|
-
|
|
502
|
+
G(i)
|
|
503
503
|
]
|
|
504
504
|
}),
|
|
505
|
-
/* @__PURE__ */
|
|
505
|
+
/* @__PURE__ */ z(me, {
|
|
506
506
|
volume: s,
|
|
507
|
-
isMuted:
|
|
508
|
-
onToggleMute:
|
|
509
|
-
onVolumeChange:
|
|
507
|
+
isMuted: c,
|
|
508
|
+
onToggleMute: M,
|
|
509
|
+
onVolumeChange: N,
|
|
510
510
|
silent: S
|
|
511
511
|
}),
|
|
512
|
-
/* @__PURE__ */
|
|
513
|
-
value:
|
|
514
|
-
onChange:
|
|
515
|
-
containerRef:
|
|
512
|
+
/* @__PURE__ */ z(oe, {
|
|
513
|
+
value: l,
|
|
514
|
+
onChange: P,
|
|
515
|
+
containerRef: h
|
|
516
516
|
}),
|
|
517
|
-
|
|
517
|
+
ie ? /* @__PURE__ */ z(a, {
|
|
518
518
|
variant: "ghost",
|
|
519
519
|
size: "sm",
|
|
520
520
|
hideLabel: !0,
|
|
521
|
-
icon:
|
|
522
|
-
label:
|
|
523
|
-
"aria-pressed":
|
|
524
|
-
onClick:
|
|
521
|
+
icon: v ? ae : Z,
|
|
522
|
+
label: H("videoPlayer.captions"),
|
|
523
|
+
"aria-pressed": v,
|
|
524
|
+
onClick: I
|
|
525
525
|
}) : null,
|
|
526
|
-
|
|
526
|
+
U ? /* @__PURE__ */ z(a, {
|
|
527
527
|
variant: "ghost",
|
|
528
528
|
size: "sm",
|
|
529
529
|
hideLabel: !0,
|
|
530
|
-
icon: x ?
|
|
531
|
-
label:
|
|
530
|
+
icon: x ? X : Y,
|
|
531
|
+
label: H("videoPlayer.audioDescription"),
|
|
532
532
|
"aria-pressed": x,
|
|
533
|
-
onClick:
|
|
533
|
+
onClick: L
|
|
534
534
|
}) : null,
|
|
535
|
-
|
|
536
|
-
containerRef:
|
|
537
|
-
audioLanguages:
|
|
538
|
-
audioLanguage:
|
|
539
|
-
onAudioLanguageChange:
|
|
540
|
-
captionLanguages:
|
|
541
|
-
captionLanguage:
|
|
542
|
-
captionsOn:
|
|
543
|
-
onCaptionLanguageChange:
|
|
544
|
-
onCaptionsOff:
|
|
545
|
-
audioDescriptionLanguages:
|
|
546
|
-
audioDescriptionLanguage:
|
|
535
|
+
W ? /* @__PURE__ */ z(de, {
|
|
536
|
+
containerRef: h,
|
|
537
|
+
audioLanguages: w,
|
|
538
|
+
audioLanguage: T,
|
|
539
|
+
onAudioLanguageChange: E,
|
|
540
|
+
captionLanguages: D,
|
|
541
|
+
captionLanguage: O,
|
|
542
|
+
captionsOn: v,
|
|
543
|
+
onCaptionLanguageChange: k,
|
|
544
|
+
onCaptionsOff: A,
|
|
545
|
+
audioDescriptionLanguages: j,
|
|
546
|
+
audioDescriptionLanguage: ee,
|
|
547
547
|
audioDescriptionOn: x,
|
|
548
|
-
onAudioDescriptionLanguageChange:
|
|
549
|
-
onAudioDescriptionOff:
|
|
548
|
+
onAudioDescriptionLanguageChange: te,
|
|
549
|
+
onAudioDescriptionOff: ne
|
|
550
550
|
}) : null,
|
|
551
|
-
|
|
551
|
+
V ? /* @__PURE__ */ z(a, {
|
|
552
552
|
variant: "ghost",
|
|
553
553
|
size: "sm",
|
|
554
554
|
hideLabel: !0,
|
|
555
|
-
icon:
|
|
556
|
-
label:
|
|
557
|
-
onClick:
|
|
555
|
+
icon: o,
|
|
556
|
+
label: V.label,
|
|
557
|
+
onClick: V.onClick
|
|
558
558
|
}) : null,
|
|
559
|
-
/* @__PURE__ */
|
|
559
|
+
/* @__PURE__ */ z(a, {
|
|
560
560
|
variant: "ghost",
|
|
561
561
|
size: "sm",
|
|
562
562
|
hideLabel: !0,
|
|
563
|
-
icon:
|
|
564
|
-
label:
|
|
565
|
-
onClick:
|
|
563
|
+
icon: u ? f : d,
|
|
564
|
+
label: H(u ? "videoPlayer.exitFullscreen" : "videoPlayer.enterFullscreen"),
|
|
565
|
+
onClick: F
|
|
566
566
|
})
|
|
567
567
|
]
|
|
568
568
|
});
|
|
@@ -571,8 +571,8 @@ function ge({ isPlaying: e, currentTime: n, duration: i, volume: s, isMuted: u,
|
|
|
571
571
|
//#region src/blocks/F0VideoPlayer/hooks/useVttSource.ts
|
|
572
572
|
var _e = (e) => e.trimStart().startsWith("WEBVTT");
|
|
573
573
|
function ve(e) {
|
|
574
|
-
let t = e !== void 0 && _e(e), [n, r] =
|
|
575
|
-
return
|
|
574
|
+
let t = e !== void 0 && _e(e), [n, r] = R();
|
|
575
|
+
return P(() => {
|
|
576
576
|
if (e === void 0 || !_e(e)) {
|
|
577
577
|
r(void 0);
|
|
578
578
|
return;
|
|
@@ -588,8 +588,8 @@ function ve(e) {
|
|
|
588
588
|
//#region src/blocks/F0VideoPlayer/hooks/useAudioDescription.ts
|
|
589
589
|
var ye = "descriptions";
|
|
590
590
|
function be(e, { enabled: t, describedSrc: n, descriptions: r }) {
|
|
591
|
-
let i = n !== void 0, { trackSrc: a, needsCrossOrigin: o } = ve(r), [s, c] =
|
|
592
|
-
return
|
|
591
|
+
let i = n !== void 0, { trackSrc: a, needsCrossOrigin: o } = ve(r), [s, c] = R(!1), l = i || r !== void 0 || s, [u, d] = R(), f = L(!1);
|
|
592
|
+
return P(() => {
|
|
593
593
|
if (!e) return;
|
|
594
594
|
let n = e.textTracks, a = typeof window < "u" && "speechSynthesis" in window, o = t && !i && a, s = () => {
|
|
595
595
|
f.current && (f.current = !1, e.play().catch(() => {}));
|
|
@@ -621,7 +621,7 @@ function be(e, { enabled: t, describedSrc: n, descriptions: r }) {
|
|
|
621
621
|
i,
|
|
622
622
|
r,
|
|
623
623
|
a
|
|
624
|
-
]),
|
|
624
|
+
]), I(() => ({
|
|
625
625
|
trackSrc: a,
|
|
626
626
|
needsCrossOrigin: o,
|
|
627
627
|
available: l,
|
|
@@ -636,7 +636,7 @@ function be(e, { enabled: t, describedSrc: n, descriptions: r }) {
|
|
|
636
636
|
//#endregion
|
|
637
637
|
//#region src/blocks/F0VideoPlayer/hooks/useKeyboardShortcuts.ts
|
|
638
638
|
function xe({ videoRef: e, seek: t, togglePlay: n, toggleMute: r, toggleFullscreen: i, setVolume: a }) {
|
|
639
|
-
return
|
|
639
|
+
return N((o) => {
|
|
640
640
|
let s = o.target;
|
|
641
641
|
if (s instanceof HTMLElement && (s.closest("button, a, input, textarea, select, [role=\"button\"], [contenteditable=\"true\"]") || s.closest("[role=\"menu\"], [role^=\"menuitem\"]") || s.getAttribute("role") === "slider")) return;
|
|
642
642
|
let c = e.current;
|
|
@@ -654,10 +654,10 @@ function xe({ videoRef: e, seek: t, togglePlay: n, toggleMute: r, toggleFullscre
|
|
|
654
654
|
return;
|
|
655
655
|
}
|
|
656
656
|
case "ArrowUp":
|
|
657
|
-
o.preventDefault(), a(Math.min(1, c.volume +
|
|
657
|
+
o.preventDefault(), a(Math.min(1, c.volume + H));
|
|
658
658
|
return;
|
|
659
659
|
case "ArrowDown":
|
|
660
|
-
o.preventDefault(), a(Math.max(0, c.volume -
|
|
660
|
+
o.preventDefault(), a(Math.max(0, c.volume - H));
|
|
661
661
|
return;
|
|
662
662
|
case "m":
|
|
663
663
|
o.preventDefault(), r();
|
|
@@ -679,12 +679,12 @@ function xe({ videoRef: e, seek: t, togglePlay: n, toggleMute: r, toggleFullscre
|
|
|
679
679
|
//#endregion
|
|
680
680
|
//#region src/blocks/F0VideoPlayer/hooks/useRestrictForwardSeek.ts
|
|
681
681
|
function Se({ video: e, enabled: t, resetKey: n }) {
|
|
682
|
-
let r =
|
|
682
|
+
let r = L(0), i = L(0), a = L(t);
|
|
683
683
|
a.current = t;
|
|
684
|
-
let [o, s] =
|
|
685
|
-
return
|
|
684
|
+
let [o, s] = R(0);
|
|
685
|
+
return P(() => {
|
|
686
686
|
r.current = 0, i.current = 0, s(0);
|
|
687
|
-
}, [n]),
|
|
687
|
+
}, [n]), P(() => {
|
|
688
688
|
if (!e) return;
|
|
689
689
|
let t = () => {
|
|
690
690
|
a.current && e.currentTime > r.current + .25 && (e.currentTime = r.current);
|
|
@@ -706,17 +706,17 @@ function Se({ video: e, enabled: t, resetKey: n }) {
|
|
|
706
706
|
};
|
|
707
707
|
}, [e]), {
|
|
708
708
|
maxWatchedTime: o,
|
|
709
|
-
clampSeek:
|
|
709
|
+
clampSeek: N((e) => a.current ? Math.min(e, r.current) : e, [])
|
|
710
710
|
};
|
|
711
711
|
}
|
|
712
712
|
//#endregion
|
|
713
713
|
//#region src/blocks/F0VideoPlayer/hooks/useVideoCaptions.ts
|
|
714
714
|
var Ce = /* @__PURE__ */ new Set(["captions", "subtitles"]), we = 2, Te = 3;
|
|
715
715
|
function Ee(e, t) {
|
|
716
|
-
let { trackSrc: n, needsCrossOrigin: r } = ve(t), [i, a] =
|
|
717
|
-
return
|
|
716
|
+
let { trackSrc: n, needsCrossOrigin: r } = ve(t), [i, a] = R(!1), [o, s] = R(!1), [c, l] = R(!1), u = o || t !== void 0 && !c;
|
|
717
|
+
return P(() => {
|
|
718
718
|
l(!1), s(!1);
|
|
719
|
-
}, [n]),
|
|
719
|
+
}, [n]), P(() => {
|
|
720
720
|
if (!e) return;
|
|
721
721
|
let t = e.textTracks, n = e.querySelector("track[kind=\"captions\"]"), r = () => {
|
|
722
722
|
let e = !1;
|
|
@@ -751,7 +751,7 @@ function Ee(e, t) {
|
|
|
751
751
|
t,
|
|
752
752
|
i,
|
|
753
753
|
n
|
|
754
|
-
]),
|
|
754
|
+
]), I(() => ({
|
|
755
755
|
trackSrc: n,
|
|
756
756
|
needsCrossOrigin: r,
|
|
757
757
|
available: u,
|
|
@@ -767,15 +767,15 @@ function Ee(e, t) {
|
|
|
767
767
|
//#endregion
|
|
768
768
|
//#region src/blocks/F0VideoPlayer/hooks/useVideoCompletion.ts
|
|
769
769
|
function De(e) {
|
|
770
|
-
return e - Math.min(10, e *
|
|
770
|
+
return e - Math.min(10, e * W);
|
|
771
771
|
}
|
|
772
772
|
function Oe({ video: e, onComplete: t, resetKey: n }) {
|
|
773
|
-
let r =
|
|
773
|
+
let r = L(t);
|
|
774
774
|
r.current = t;
|
|
775
|
-
let i =
|
|
776
|
-
|
|
775
|
+
let i = L(!1), a = !!t;
|
|
776
|
+
P(() => {
|
|
777
777
|
i.current = !1;
|
|
778
|
-
}, [n]),
|
|
778
|
+
}, [n]), P(() => {
|
|
779
779
|
if (!e || !a) return;
|
|
780
780
|
let t = () => {
|
|
781
781
|
!i.current && e.duration && e.currentTime >= De(e.duration) && (i.current = !0, r.current?.(e));
|
|
@@ -788,17 +788,17 @@ function Oe({ video: e, onComplete: t, resetKey: n }) {
|
|
|
788
788
|
//#endregion
|
|
789
789
|
//#region src/blocks/F0VideoPlayer/hooks/useVideoMilestones.ts
|
|
790
790
|
function ke({ video: e, onMilestone: t, resetKey: n }) {
|
|
791
|
-
let r =
|
|
791
|
+
let r = L(t);
|
|
792
792
|
r.current = t;
|
|
793
|
-
let i =
|
|
794
|
-
|
|
793
|
+
let i = L(/* @__PURE__ */ new Set()), a = !!t;
|
|
794
|
+
P(() => {
|
|
795
795
|
i.current.clear();
|
|
796
|
-
}, [n]),
|
|
796
|
+
}, [n]), P(() => {
|
|
797
797
|
if (!e || !a) return;
|
|
798
798
|
let t = () => {
|
|
799
799
|
if (!e.duration) return;
|
|
800
800
|
let t = Math.round(e.currentTime / e.duration * 100);
|
|
801
|
-
for (let n of
|
|
801
|
+
for (let n of ie) i.current.has(n) || t >= n && (i.current.add(n), r.current?.(n, e));
|
|
802
802
|
};
|
|
803
803
|
return e.addEventListener("timeupdate", t), () => {
|
|
804
804
|
e.removeEventListener("timeupdate", t);
|
|
@@ -808,18 +808,18 @@ function ke({ video: e, onMilestone: t, resetKey: n }) {
|
|
|
808
808
|
//#endregion
|
|
809
809
|
//#region src/blocks/F0VideoPlayer/hooks/useVideoState.ts
|
|
810
810
|
function Ae(e) {
|
|
811
|
-
let t =
|
|
811
|
+
let t = L(null), [n, r] = R(null), i = L(0), a = N((e) => {
|
|
812
812
|
t.current = e, r(e);
|
|
813
|
-
}, []), [o, s] =
|
|
814
|
-
return
|
|
813
|
+
}, []), [o, s] = R(!1), [c, l] = R(!1), [u, d] = R(0), [f, p] = R(0), [m, h] = R(1), [g, _] = R(!1), [v, y] = R(1);
|
|
814
|
+
return P(() => {
|
|
815
815
|
i.current = 0, t.current && (t.current.playbackRate = 1), s(!1), l(!1), d(0), p(0), y(1);
|
|
816
|
-
}, [e]),
|
|
816
|
+
}, [e]), P(() => {
|
|
817
817
|
let e = n;
|
|
818
818
|
if (!e) return;
|
|
819
819
|
let t = () => l(!0), r = () => l(!1), a = () => l(!1), o = () => {
|
|
820
820
|
h(e.volume), _(e.muted);
|
|
821
821
|
}, s = () => p(e.duration || 0), c = () => {
|
|
822
|
-
|
|
822
|
+
q(e.playbackRate) && y(e.playbackRate);
|
|
823
823
|
}, u = () => {
|
|
824
824
|
let t = performance.now();
|
|
825
825
|
t - i.current >= 250 && (i.current = t, d(e.currentTime));
|
|
@@ -839,25 +839,25 @@ function Ae(e) {
|
|
|
839
839
|
isMuted: g,
|
|
840
840
|
playbackRate: v,
|
|
841
841
|
setVideoLoaded: s,
|
|
842
|
-
togglePlay:
|
|
842
|
+
togglePlay: N(() => {
|
|
843
843
|
let e = t.current;
|
|
844
844
|
e && (e.paused || e.ended ? e.play().catch(() => {}) : e.pause());
|
|
845
845
|
}, []),
|
|
846
|
-
toggleMute:
|
|
846
|
+
toggleMute: N(() => {
|
|
847
847
|
let e = t.current;
|
|
848
848
|
e && (e.muted = !e.muted);
|
|
849
849
|
}, []),
|
|
850
|
-
setVolume:
|
|
850
|
+
setVolume: N((e) => {
|
|
851
851
|
let n = t.current;
|
|
852
852
|
if (!n) return;
|
|
853
853
|
let r = Math.max(0, Math.min(1, e));
|
|
854
854
|
n.volume = r, n.muted = r === 0;
|
|
855
855
|
}, []),
|
|
856
|
-
setPlaybackRate:
|
|
856
|
+
setPlaybackRate: N((e) => {
|
|
857
857
|
let n = t.current;
|
|
858
858
|
n && (n.playbackRate = e);
|
|
859
859
|
}, []),
|
|
860
|
-
seekTo:
|
|
860
|
+
seekTo: N((e) => {
|
|
861
861
|
let n = t.current;
|
|
862
862
|
if (!n) return;
|
|
863
863
|
let r = Math.max(0, Math.min(e, n.duration || e));
|
|
@@ -868,17 +868,17 @@ function Ae(e) {
|
|
|
868
868
|
//#endregion
|
|
869
869
|
//#region src/blocks/F0VideoPlayer/hooks/useVideoTracking.ts
|
|
870
870
|
function je({ video: e, onTrackAction: t }) {
|
|
871
|
-
let n =
|
|
871
|
+
let n = L(t);
|
|
872
872
|
n.current = t;
|
|
873
873
|
let r = !!t;
|
|
874
|
-
|
|
874
|
+
P(() => {
|
|
875
875
|
if (!e || !r) return;
|
|
876
876
|
let t = null, i = () => {
|
|
877
877
|
t &&= (clearInterval(t), null);
|
|
878
878
|
}, a = () => {
|
|
879
879
|
n.current?.(), i(), t = setInterval(() => {
|
|
880
880
|
n.current?.();
|
|
881
|
-
},
|
|
881
|
+
}, U);
|
|
882
882
|
}, o = () => {
|
|
883
883
|
n.current?.(), i();
|
|
884
884
|
}, s = () => i();
|
|
@@ -889,177 +889,177 @@ function je({ video: e, onTrackAction: t }) {
|
|
|
889
889
|
}
|
|
890
890
|
//#endregion
|
|
891
891
|
//#region src/blocks/F0VideoPlayer/internal.tsx
|
|
892
|
-
function Me({ src: e, poster: n, ariaLabel: a, silent: o = !1, persistControls: s = !1, content: c, defaultLanguage: l, autoPlay: u = !1, autoFocus: d = !1, download: f, restrictForwardSeek:
|
|
893
|
-
let { t:
|
|
894
|
-
enabled:
|
|
895
|
-
describedSrc:
|
|
896
|
-
descriptions:
|
|
897
|
-
}),
|
|
898
|
-
let e =
|
|
892
|
+
function Me({ src: e, poster: n, ariaLabel: a, silent: o = !1, persistControls: s = !1, content: c, defaultLanguage: l, autoPlay: u = !1, autoFocus: d = !1, download: f, restrictForwardSeek: p = !1, onTrackAction: m, onMilestone: g, onComplete: b, ...x }) {
|
|
893
|
+
let { t: C } = t(), w = L(null), T = I(() => S(e), [e]), [E, D] = R(() => y(T, l)), O = T.some((e) => e.locale === E) ? E : y(T, l), k = v(e, O) ?? "", A = I(() => S(c?.captions), [c?.captions]), [j, ee] = R(() => y(A, l)), te = A.some((e) => e.locale === j) ? j : y(A, l), ne = v(c?.captions, te), M = I(() => S(c?.descriptions, c?.describedSrc), [c?.descriptions, c?.describedSrc]), [F, V] = R(() => y(M, l)), H = M.some((e) => e.locale === F) ? F : y(M, l), ie = v(c?.descriptions, H), U = v(c?.describedSrc, H), [W, G] = R(!1), K = W && U ? U : k, q = Ae(K), J = Ee(q.videoElement, ne), Y = be(q.videoElement, {
|
|
894
|
+
enabled: W,
|
|
895
|
+
describedSrc: U,
|
|
896
|
+
descriptions: ie
|
|
897
|
+
}), X = N(() => {
|
|
898
|
+
let e = q.videoRef.current;
|
|
899
899
|
if (!e) return;
|
|
900
900
|
let t = e.currentTime, n = !e.paused, r = () => {
|
|
901
901
|
e.currentTime = t, n && e.play().catch(() => {}), e.removeEventListener("loadedmetadata", r);
|
|
902
902
|
};
|
|
903
903
|
e.addEventListener("loadedmetadata", r);
|
|
904
|
-
}, [
|
|
905
|
-
|
|
906
|
-
}, [
|
|
907
|
-
|
|
908
|
-
}, [
|
|
909
|
-
|
|
910
|
-
}, [
|
|
911
|
-
|
|
912
|
-
}, [
|
|
913
|
-
|
|
914
|
-
}, [
|
|
915
|
-
|
|
916
|
-
}, [
|
|
904
|
+
}, [q.videoRef]), Z = N((e) => {
|
|
905
|
+
X(), D(e);
|
|
906
|
+
}, [X]), ae = N(() => {
|
|
907
|
+
U && X(), G((e) => !e);
|
|
908
|
+
}, [U, X]), oe = N((e) => {
|
|
909
|
+
ee(e), J.showing || J.toggle();
|
|
910
|
+
}, [J]), se = N(() => {
|
|
911
|
+
J.showing && J.toggle();
|
|
912
|
+
}, [J]), Q = N((e) => {
|
|
913
|
+
U && X(), V(e), G(!0);
|
|
914
|
+
}, [U, X]), ce = N(() => {
|
|
915
|
+
U && X(), G(!1);
|
|
916
|
+
}, [U, X]);
|
|
917
917
|
je({
|
|
918
|
-
video:
|
|
919
|
-
onTrackAction:
|
|
918
|
+
video: q.videoElement,
|
|
919
|
+
onTrackAction: m
|
|
920
920
|
}), ke({
|
|
921
|
-
video:
|
|
921
|
+
video: q.videoElement,
|
|
922
922
|
onMilestone: g,
|
|
923
|
-
resetKey:
|
|
923
|
+
resetKey: k
|
|
924
924
|
}), Oe({
|
|
925
|
-
video:
|
|
926
|
-
onComplete:
|
|
927
|
-
resetKey:
|
|
925
|
+
video: q.videoElement,
|
|
926
|
+
onComplete: b,
|
|
927
|
+
resetKey: k
|
|
928
928
|
});
|
|
929
929
|
let { maxWatchedTime: le, clampSeek: ue } = Se({
|
|
930
|
-
video:
|
|
931
|
-
enabled:
|
|
932
|
-
resetKey:
|
|
933
|
-
}), $ =
|
|
934
|
-
|
|
935
|
-
let e =
|
|
930
|
+
video: q.videoElement,
|
|
931
|
+
enabled: p,
|
|
932
|
+
resetKey: k
|
|
933
|
+
}), $ = N((e) => q.seekTo(ue(e)), [q, ue]), { isFullscreen: de, toggleFullscreen: fe } = re({ targetRef: w }), pe = N(() => {}, []), me = !!(W && U);
|
|
934
|
+
P(() => {
|
|
935
|
+
let e = q.videoRef.current;
|
|
936
936
|
o && e && (e.muted = !me);
|
|
937
937
|
}, [
|
|
938
938
|
o,
|
|
939
939
|
me,
|
|
940
|
-
|
|
941
|
-
|
|
940
|
+
q.videoElement,
|
|
941
|
+
q.videoRef
|
|
942
942
|
]);
|
|
943
943
|
let he = xe({
|
|
944
|
-
videoRef:
|
|
944
|
+
videoRef: q.videoRef,
|
|
945
945
|
seek: $,
|
|
946
|
-
togglePlay:
|
|
947
|
-
toggleMute: o ? pe :
|
|
946
|
+
togglePlay: q.togglePlay,
|
|
947
|
+
toggleMute: o ? pe : q.toggleMute,
|
|
948
948
|
toggleFullscreen: fe,
|
|
949
|
-
setVolume: o ? pe :
|
|
949
|
+
setVolume: o ? pe : q.setVolume
|
|
950
950
|
});
|
|
951
|
-
|
|
952
|
-
d &&
|
|
951
|
+
P(() => {
|
|
952
|
+
d && w.current?.focus({ preventScroll: !0 });
|
|
953
953
|
}, [d]);
|
|
954
954
|
let _e = (e) => e.preventDefault();
|
|
955
|
-
return /* @__PURE__ */
|
|
956
|
-
ref:
|
|
955
|
+
return /* @__PURE__ */ B("div", {
|
|
956
|
+
ref: w,
|
|
957
957
|
className: r("group relative h-full w-full overflow-hidden rounded-[inherit] bg-f1-foreground dark:bg-f1-background", "[&:fullscreen]:h-screen [&:fullscreen]:w-screen [&:fullscreen]:rounded-none", i()),
|
|
958
958
|
role: "region",
|
|
959
|
-
"aria-label": a ??
|
|
959
|
+
"aria-label": a ?? C("videoPlayer.regionLabel"),
|
|
960
960
|
tabIndex: 0,
|
|
961
961
|
onKeyDown: he,
|
|
962
|
-
"data-video-captions": o ? "no-audio" :
|
|
963
|
-
...
|
|
962
|
+
"data-video-captions": o ? "no-audio" : J.available ? "available" : "missing",
|
|
963
|
+
...x,
|
|
964
964
|
children: [
|
|
965
|
-
/* @__PURE__ */
|
|
966
|
-
ref:
|
|
965
|
+
/* @__PURE__ */ B("video", {
|
|
966
|
+
ref: q.setVideoNode,
|
|
967
967
|
autoPlay: u,
|
|
968
968
|
playsInline: !0,
|
|
969
969
|
disablePictureInPicture: !0,
|
|
970
970
|
disableRemotePlayback: !0,
|
|
971
971
|
draggable: !1,
|
|
972
972
|
onContextMenu: _e,
|
|
973
|
-
onClick:
|
|
974
|
-
src:
|
|
973
|
+
onClick: q.togglePlay,
|
|
974
|
+
src: K,
|
|
975
975
|
poster: n,
|
|
976
|
-
crossOrigin:
|
|
977
|
-
onLoadedData: () =>
|
|
976
|
+
crossOrigin: J.needsCrossOrigin || Y.needsCrossOrigin ? "anonymous" : void 0,
|
|
977
|
+
onLoadedData: () => q.setVideoLoaded(!0),
|
|
978
978
|
className: r("block h-full w-full cursor-pointer rounded-[inherit] object-contain transition-opacity duration-300", "[&::-webkit-media-text-track-container]:![transform:translateY(-3.5rem)]"),
|
|
979
|
-
style: { opacity:
|
|
980
|
-
children: [
|
|
979
|
+
style: { opacity: q.videoLoaded || n ? 1 : 0 },
|
|
980
|
+
children: [J.trackSrc ? /* @__PURE__ */ z("track", {
|
|
981
981
|
kind: "captions",
|
|
982
|
-
src:
|
|
983
|
-
label:
|
|
982
|
+
src: J.trackSrc,
|
|
983
|
+
label: C("videoPlayer.captions"),
|
|
984
984
|
default: !1
|
|
985
|
-
}) : null,
|
|
985
|
+
}) : null, Y.trackSrc ? /* @__PURE__ */ z("track", {
|
|
986
986
|
kind: "descriptions",
|
|
987
|
-
src:
|
|
988
|
-
label:
|
|
987
|
+
src: Y.trackSrc,
|
|
988
|
+
label: C("videoPlayer.audioDescription"),
|
|
989
989
|
default: !1
|
|
990
990
|
}) : null]
|
|
991
991
|
}),
|
|
992
|
-
|
|
992
|
+
q.isPlaying ? null : /* @__PURE__ */ z("div", {
|
|
993
993
|
"aria-hidden": !0,
|
|
994
994
|
"data-video-play-overlay": !0,
|
|
995
995
|
className: "pointer-events-none absolute inset-0 z-[1] flex items-center justify-center",
|
|
996
|
-
children: /* @__PURE__ */
|
|
996
|
+
children: /* @__PURE__ */ z("button", {
|
|
997
997
|
type: "button",
|
|
998
998
|
tabIndex: -1,
|
|
999
|
-
onClick:
|
|
999
|
+
onClick: q.togglePlay,
|
|
1000
1000
|
className: "pointer-events-auto flex size-14 items-center justify-center rounded-full bg-f1-foreground/70 pl-0.5 shadow-[0_2px_8px_rgba(0,0,0,0.45)] transition-transform duration-150 hover:scale-105 motion-reduce:transition-none dark:bg-f1-background/70 [&_svg]:size-7",
|
|
1001
|
-
children: /* @__PURE__ */
|
|
1002
|
-
icon:
|
|
1001
|
+
children: /* @__PURE__ */ z(h, {
|
|
1002
|
+
icon: _,
|
|
1003
1003
|
size: "lg",
|
|
1004
1004
|
color: "#fff"
|
|
1005
1005
|
})
|
|
1006
1006
|
})
|
|
1007
1007
|
}),
|
|
1008
|
-
|
|
1008
|
+
J.showing && Y.activeCue ? /* @__PURE__ */ z("div", {
|
|
1009
1009
|
"aria-hidden": !0,
|
|
1010
1010
|
className: "dark pointer-events-none absolute inset-x-0 top-0 z-[2] flex justify-center p-3",
|
|
1011
|
-
children: /* @__PURE__ */
|
|
1011
|
+
children: /* @__PURE__ */ B("p", {
|
|
1012
1012
|
className: "max-w-[90%] rounded-md bg-f1-background/70 px-2 py-1 text-center text-base italic text-f1-foreground [text-shadow:0_1px_2px_rgba(0,0,0,0.55)]",
|
|
1013
|
-
children: [/* @__PURE__ */
|
|
1013
|
+
children: [/* @__PURE__ */ B("span", {
|
|
1014
1014
|
className: "pr-1 font-medium not-italic opacity-70",
|
|
1015
1015
|
children: [
|
|
1016
1016
|
"[",
|
|
1017
|
-
|
|
1017
|
+
C("videoPlayer.audioDescription"),
|
|
1018
1018
|
"]"
|
|
1019
1019
|
]
|
|
1020
|
-
}),
|
|
1020
|
+
}), Y.activeCue]
|
|
1021
1021
|
})
|
|
1022
1022
|
}) : null,
|
|
1023
|
-
/* @__PURE__ */
|
|
1023
|
+
/* @__PURE__ */ z("span", {
|
|
1024
1024
|
className: "sr-only",
|
|
1025
1025
|
"aria-live": "polite",
|
|
1026
|
-
children:
|
|
1026
|
+
children: q.isPlaying ? C("videoPlayer.playing") : C("videoPlayer.paused")
|
|
1027
1027
|
}),
|
|
1028
|
-
|
|
1029
|
-
isPlaying:
|
|
1030
|
-
currentTime:
|
|
1031
|
-
duration:
|
|
1032
|
-
volume:
|
|
1033
|
-
isMuted:
|
|
1034
|
-
playbackRate:
|
|
1028
|
+
q.videoLoaded ? /* @__PURE__ */ z(ge, {
|
|
1029
|
+
isPlaying: q.isPlaying,
|
|
1030
|
+
currentTime: q.currentTime,
|
|
1031
|
+
duration: q.duration,
|
|
1032
|
+
volume: q.volume,
|
|
1033
|
+
isMuted: q.isMuted,
|
|
1034
|
+
playbackRate: q.playbackRate,
|
|
1035
1035
|
isFullscreen: de,
|
|
1036
|
-
markerTime:
|
|
1037
|
-
blockSeekPastMarker:
|
|
1038
|
-
containerRef:
|
|
1039
|
-
captionsAvailable:
|
|
1040
|
-
captionsOn:
|
|
1041
|
-
audioDescriptionAvailable:
|
|
1042
|
-
audioDescriptionOn:
|
|
1036
|
+
markerTime: p ? le : void 0,
|
|
1037
|
+
blockSeekPastMarker: p,
|
|
1038
|
+
containerRef: w,
|
|
1039
|
+
captionsAvailable: J.available,
|
|
1040
|
+
captionsOn: J.showing,
|
|
1041
|
+
audioDescriptionAvailable: Y.available,
|
|
1042
|
+
audioDescriptionOn: W,
|
|
1043
1043
|
silent: o,
|
|
1044
1044
|
persist: s,
|
|
1045
|
-
audioLanguages:
|
|
1046
|
-
audioLanguage:
|
|
1047
|
-
onAudioLanguageChange:
|
|
1048
|
-
captionLanguages:
|
|
1049
|
-
captionLanguage:
|
|
1050
|
-
onCaptionLanguageChange:
|
|
1051
|
-
onCaptionsOff:
|
|
1052
|
-
audioDescriptionLanguages:
|
|
1053
|
-
audioDescriptionLanguage:
|
|
1054
|
-
onAudioDescriptionLanguageChange:
|
|
1045
|
+
audioLanguages: T,
|
|
1046
|
+
audioLanguage: O,
|
|
1047
|
+
onAudioLanguageChange: Z,
|
|
1048
|
+
captionLanguages: A,
|
|
1049
|
+
captionLanguage: te,
|
|
1050
|
+
onCaptionLanguageChange: oe,
|
|
1051
|
+
onCaptionsOff: se,
|
|
1052
|
+
audioDescriptionLanguages: M,
|
|
1053
|
+
audioDescriptionLanguage: H,
|
|
1054
|
+
onAudioDescriptionLanguageChange: Q,
|
|
1055
1055
|
onAudioDescriptionOff: ce,
|
|
1056
|
-
onTogglePlay:
|
|
1057
|
-
onToggleMute:
|
|
1058
|
-
onVolumeChange:
|
|
1059
|
-
onPlaybackRateChange:
|
|
1056
|
+
onTogglePlay: q.togglePlay,
|
|
1057
|
+
onToggleMute: q.toggleMute,
|
|
1058
|
+
onVolumeChange: q.setVolume,
|
|
1059
|
+
onPlaybackRateChange: q.setPlaybackRate,
|
|
1060
1060
|
onToggleFullscreen: () => void fe(),
|
|
1061
|
-
onToggleCaptions:
|
|
1062
|
-
onToggleAudioDescription:
|
|
1061
|
+
onToggleCaptions: J.toggle,
|
|
1062
|
+
onToggleAudioDescription: ae,
|
|
1063
1063
|
onSeek: $,
|
|
1064
1064
|
download: f
|
|
1065
1065
|
}) : null
|