@livo-tv/blocks 1.29.0 → 1.30.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/index.cjs +1314 -211
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +121 -5
- package/dist/index.d.ts +121 -5
- package/dist/index.js +1239 -146
- package/dist/index.js.map +1 -1
- package/package.json +22 -2
package/dist/index.cjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
'use strict';
|
|
3
3
|
|
|
4
|
-
var
|
|
4
|
+
var React11 = require('react');
|
|
5
5
|
var lucideReact = require('lucide-react');
|
|
6
6
|
var clsx = require('clsx');
|
|
7
7
|
var tailwindMerge = require('tailwind-merge');
|
|
@@ -35,16 +35,16 @@ function _interopNamespace(e) {
|
|
|
35
35
|
return Object.freeze(n);
|
|
36
36
|
}
|
|
37
37
|
|
|
38
|
-
var
|
|
38
|
+
var React11__namespace = /*#__PURE__*/_interopNamespace(React11);
|
|
39
39
|
var AlertDialogPrimitive__namespace = /*#__PURE__*/_interopNamespace(AlertDialogPrimitive);
|
|
40
40
|
var DropdownMenuPrimitive__namespace = /*#__PURE__*/_interopNamespace(DropdownMenuPrimitive);
|
|
41
41
|
var SliderPrimitive__namespace = /*#__PURE__*/_interopNamespace(SliderPrimitive);
|
|
42
42
|
var TogglePrimitive__namespace = /*#__PURE__*/_interopNamespace(TogglePrimitive);
|
|
43
43
|
var DialogPrimitive__namespace = /*#__PURE__*/_interopNamespace(DialogPrimitive);
|
|
44
44
|
|
|
45
|
-
var LanguageContext =
|
|
45
|
+
var LanguageContext = React11.createContext(null);
|
|
46
46
|
function useLanguageContext() {
|
|
47
|
-
return
|
|
47
|
+
return React11.useContext(LanguageContext);
|
|
48
48
|
}
|
|
49
49
|
function cn(...inputs) {
|
|
50
50
|
return tailwindMerge.twMerge(clsx.clsx(inputs));
|
|
@@ -651,20 +651,20 @@ function useEditableSection({
|
|
|
651
651
|
...DEFAULT_EDITABLE_SECTION_LABELS,
|
|
652
652
|
...labels
|
|
653
653
|
};
|
|
654
|
-
const [mode, setMode] =
|
|
655
|
-
const [status, setStatus] =
|
|
656
|
-
const [confirmOpen, setConfirmOpen] =
|
|
657
|
-
const [minHeightPx, setMinHeightPx] =
|
|
658
|
-
const contentRef =
|
|
659
|
-
const editButtonRef =
|
|
660
|
-
const measuredHeightRef =
|
|
661
|
-
const shouldFocusEditRef =
|
|
662
|
-
const shouldFocusFirstFieldRef =
|
|
663
|
-
const editButtonId =
|
|
664
|
-
const contentFormId =
|
|
654
|
+
const [mode, setMode] = React11.useState("reading");
|
|
655
|
+
const [status, setStatus] = React11.useState(null);
|
|
656
|
+
const [confirmOpen, setConfirmOpen] = React11.useState(false);
|
|
657
|
+
const [minHeightPx, setMinHeightPx] = React11.useState(void 0);
|
|
658
|
+
const contentRef = React11.useRef(null);
|
|
659
|
+
const editButtonRef = React11.useRef(null);
|
|
660
|
+
const measuredHeightRef = React11.useRef(0);
|
|
661
|
+
const shouldFocusEditRef = React11.useRef(false);
|
|
662
|
+
const shouldFocusFirstFieldRef = React11.useRef(false);
|
|
663
|
+
const editButtonId = React11.useId();
|
|
664
|
+
const contentFormId = React11.useId();
|
|
665
665
|
const isEditing = mode === "editing" || mode === "saving";
|
|
666
666
|
const isSaving = mode === "saving";
|
|
667
|
-
|
|
667
|
+
React11.useEffect(() => {
|
|
668
668
|
if (mode === "reading" && shouldFocusEditRef.current) {
|
|
669
669
|
shouldFocusEditRef.current = false;
|
|
670
670
|
editButtonRef.current?.focus();
|
|
@@ -682,18 +682,18 @@ function useEditableSection({
|
|
|
682
682
|
focusFirstField(contentRef.current);
|
|
683
683
|
}
|
|
684
684
|
}, [mode]);
|
|
685
|
-
const exitToReading =
|
|
685
|
+
const exitToReading = React11.useCallback(() => {
|
|
686
686
|
setConfirmOpen(false);
|
|
687
687
|
shouldFocusEditRef.current = true;
|
|
688
688
|
setMode("reading");
|
|
689
689
|
onDiscard?.();
|
|
690
690
|
}, [onDiscard]);
|
|
691
|
-
const startEdit =
|
|
691
|
+
const startEdit = React11.useCallback(() => {
|
|
692
692
|
setStatus(null);
|
|
693
693
|
shouldFocusFirstFieldRef.current = true;
|
|
694
694
|
setMode("editing");
|
|
695
695
|
}, []);
|
|
696
|
-
const requestCancel =
|
|
696
|
+
const requestCancel = React11.useCallback(() => {
|
|
697
697
|
if (isSaving) return;
|
|
698
698
|
if (isDirty) {
|
|
699
699
|
setConfirmOpen(true);
|
|
@@ -701,7 +701,7 @@ function useEditableSection({
|
|
|
701
701
|
}
|
|
702
702
|
exitToReading();
|
|
703
703
|
}, [exitToReading, isDirty, isSaving]);
|
|
704
|
-
const handleSubmit =
|
|
704
|
+
const handleSubmit = React11.useCallback(
|
|
705
705
|
(event) => {
|
|
706
706
|
event.preventDefault();
|
|
707
707
|
if (isSaving) return;
|
|
@@ -721,7 +721,7 @@ function useEditableSection({
|
|
|
721
721
|
},
|
|
722
722
|
[isSaving, onSave, resolvedLabels.saved]
|
|
723
723
|
);
|
|
724
|
-
const handleFormKeyDown =
|
|
724
|
+
const handleFormKeyDown = React11.useCallback(
|
|
725
725
|
(event) => {
|
|
726
726
|
if (event.key !== "Escape") return;
|
|
727
727
|
event.preventDefault();
|
|
@@ -729,7 +729,7 @@ function useEditableSection({
|
|
|
729
729
|
},
|
|
730
730
|
[requestCancel]
|
|
731
731
|
);
|
|
732
|
-
|
|
732
|
+
React11.useEffect(() => {
|
|
733
733
|
if (!stableHeight || !isEditing) return;
|
|
734
734
|
const el = contentRef.current;
|
|
735
735
|
if (!el) return;
|
|
@@ -968,13 +968,13 @@ function SafeImage({
|
|
|
968
968
|
onError,
|
|
969
969
|
...imgProps
|
|
970
970
|
}) {
|
|
971
|
-
const [failed, setFailed] =
|
|
972
|
-
const imgRef =
|
|
971
|
+
const [failed, setFailed] = React11.useState(false);
|
|
972
|
+
const imgRef = React11.useRef(null);
|
|
973
973
|
const resolvedSrc = typeof src === "string" && src.length > 0 ? src : null;
|
|
974
|
-
|
|
974
|
+
React11.useLayoutEffect(() => {
|
|
975
975
|
setFailed(false);
|
|
976
976
|
}, [resolvedSrc]);
|
|
977
|
-
|
|
977
|
+
React11.useLayoutEffect(() => {
|
|
978
978
|
const img = imgRef.current;
|
|
979
979
|
if (img && isBrokenImage(img)) {
|
|
980
980
|
setFailed(true);
|
|
@@ -1045,18 +1045,18 @@ function ThemeSwitcher({
|
|
|
1045
1045
|
labels: userLabels
|
|
1046
1046
|
}) {
|
|
1047
1047
|
const { theme, setTheme } = nextThemes.useTheme();
|
|
1048
|
-
const [mounted, setMounted] =
|
|
1048
|
+
const [mounted, setMounted] = React11.useState(false);
|
|
1049
1049
|
const reduceMotion = framerMotion.useReducedMotion();
|
|
1050
1050
|
const sizes = sizeClasses[size];
|
|
1051
1051
|
const shapeClass = shapeClasses[shape];
|
|
1052
1052
|
const labels = { ...defaultLabels, ...userLabels };
|
|
1053
|
-
const handleThemeClick =
|
|
1053
|
+
const handleThemeClick = React11.useCallback(
|
|
1054
1054
|
(themeKey) => {
|
|
1055
1055
|
setTheme(themeKey);
|
|
1056
1056
|
},
|
|
1057
1057
|
[setTheme]
|
|
1058
1058
|
);
|
|
1059
|
-
|
|
1059
|
+
React11.useEffect(() => {
|
|
1060
1060
|
setMounted(true);
|
|
1061
1061
|
}, []);
|
|
1062
1062
|
if (!mounted) {
|
|
@@ -1227,7 +1227,7 @@ function LanguageSwitcher({
|
|
|
1227
1227
|
const sizes = sizeClasses2[size];
|
|
1228
1228
|
const shapeClass = shapeClasses2[shape];
|
|
1229
1229
|
const reduceMotion = framerMotion.useReducedMotion();
|
|
1230
|
-
const layoutId = `${
|
|
1230
|
+
const layoutId = `${React11.useId()}-activeLanguage`;
|
|
1231
1231
|
const defaultLabels2 = {
|
|
1232
1232
|
language: labels.language ?? "Language"
|
|
1233
1233
|
};
|
|
@@ -1337,7 +1337,7 @@ function Slider({
|
|
|
1337
1337
|
max = 100,
|
|
1338
1338
|
...props
|
|
1339
1339
|
}) {
|
|
1340
|
-
const _values =
|
|
1340
|
+
const _values = React11__namespace.useMemo(
|
|
1341
1341
|
() => Array.isArray(value) ? value : Array.isArray(defaultValue) ? defaultValue : [min, max],
|
|
1342
1342
|
[value, defaultValue, min, max]
|
|
1343
1343
|
);
|
|
@@ -1448,18 +1448,18 @@ function AvatarEditor({
|
|
|
1448
1448
|
labels
|
|
1449
1449
|
}) {
|
|
1450
1450
|
const t = { ...DEFAULT_LABELS, ...labels };
|
|
1451
|
-
const canvasRef =
|
|
1452
|
-
const fileInputRef =
|
|
1453
|
-
const containerRef =
|
|
1454
|
-
const [image, setImage] =
|
|
1455
|
-
const [imageLoaded, setImageLoaded] =
|
|
1456
|
-
const [zoom, setZoom] =
|
|
1457
|
-
const [rotation, setRotation] =
|
|
1458
|
-
const [position, setPosition] =
|
|
1459
|
-
const [isDragging, setIsDragging] =
|
|
1460
|
-
const [dragStart, setDragStart] =
|
|
1461
|
-
const [showGrid, setShowGrid] =
|
|
1462
|
-
const generateOutput =
|
|
1451
|
+
const canvasRef = React11.useRef(null);
|
|
1452
|
+
const fileInputRef = React11.useRef(null);
|
|
1453
|
+
const containerRef = React11.useRef(null);
|
|
1454
|
+
const [image, setImage] = React11.useState(null);
|
|
1455
|
+
const [imageLoaded, setImageLoaded] = React11.useState(false);
|
|
1456
|
+
const [zoom, setZoom] = React11.useState(1);
|
|
1457
|
+
const [rotation, setRotation] = React11.useState(0);
|
|
1458
|
+
const [position, setPosition] = React11.useState({ x: 0, y: 0 });
|
|
1459
|
+
const [isDragging, setIsDragging] = React11.useState(false);
|
|
1460
|
+
const [dragStart, setDragStart] = React11.useState({ x: 0, y: 0 });
|
|
1461
|
+
const [showGrid, setShowGrid] = React11.useState(initialShowGrid);
|
|
1462
|
+
const generateOutput = React11.useCallback(() => {
|
|
1463
1463
|
if (!canvasRef.current || !image) return null;
|
|
1464
1464
|
const outputCanvas = document.createElement("canvas");
|
|
1465
1465
|
outputCanvas.width = outputSize;
|
|
@@ -1470,7 +1470,7 @@ function AvatarEditor({
|
|
|
1470
1470
|
const mimeType = `image/${outputFormat}`;
|
|
1471
1471
|
return outputCanvas.toDataURL(mimeType, outputQuality);
|
|
1472
1472
|
}, [image, outputSize, outputFormat, outputQuality]);
|
|
1473
|
-
|
|
1473
|
+
React11.useEffect(() => {
|
|
1474
1474
|
if (!canvasRef.current || !image || !imageLoaded) return;
|
|
1475
1475
|
const canvas = canvasRef.current;
|
|
1476
1476
|
const ctx = canvas.getContext("2d");
|
|
@@ -1514,12 +1514,12 @@ function AvatarEditor({
|
|
|
1514
1514
|
generateOutput,
|
|
1515
1515
|
onChange
|
|
1516
1516
|
]);
|
|
1517
|
-
const resetTransforms =
|
|
1517
|
+
const resetTransforms = React11.useCallback(() => {
|
|
1518
1518
|
setZoom(1);
|
|
1519
1519
|
setRotation(0);
|
|
1520
1520
|
setPosition({ x: 0, y: 0 });
|
|
1521
1521
|
}, []);
|
|
1522
|
-
const handleFileSelect =
|
|
1522
|
+
const handleFileSelect = React11.useCallback(
|
|
1523
1523
|
(e) => {
|
|
1524
1524
|
const file = e.target.files?.[0];
|
|
1525
1525
|
if (!file) return;
|
|
@@ -1538,7 +1538,7 @@ function AvatarEditor({
|
|
|
1538
1538
|
},
|
|
1539
1539
|
[resetTransforms]
|
|
1540
1540
|
);
|
|
1541
|
-
const handleMouseDown =
|
|
1541
|
+
const handleMouseDown = React11.useCallback(
|
|
1542
1542
|
(e) => {
|
|
1543
1543
|
if (!imageLoaded) return;
|
|
1544
1544
|
setIsDragging(true);
|
|
@@ -1546,7 +1546,7 @@ function AvatarEditor({
|
|
|
1546
1546
|
},
|
|
1547
1547
|
[imageLoaded, position]
|
|
1548
1548
|
);
|
|
1549
|
-
const handleMouseMove =
|
|
1549
|
+
const handleMouseMove = React11.useCallback(
|
|
1550
1550
|
(e) => {
|
|
1551
1551
|
if (!isDragging) return;
|
|
1552
1552
|
setPosition({
|
|
@@ -1556,10 +1556,10 @@ function AvatarEditor({
|
|
|
1556
1556
|
},
|
|
1557
1557
|
[isDragging, dragStart]
|
|
1558
1558
|
);
|
|
1559
|
-
const handleMouseUp =
|
|
1559
|
+
const handleMouseUp = React11.useCallback(() => {
|
|
1560
1560
|
setIsDragging(false);
|
|
1561
1561
|
}, []);
|
|
1562
|
-
const handleTouchStart =
|
|
1562
|
+
const handleTouchStart = React11.useCallback(
|
|
1563
1563
|
(e) => {
|
|
1564
1564
|
if (!imageLoaded) return;
|
|
1565
1565
|
const touch = e.touches[0];
|
|
@@ -1571,7 +1571,7 @@ function AvatarEditor({
|
|
|
1571
1571
|
},
|
|
1572
1572
|
[imageLoaded, position]
|
|
1573
1573
|
);
|
|
1574
|
-
const handleTouchMove =
|
|
1574
|
+
const handleTouchMove = React11.useCallback(
|
|
1575
1575
|
(e) => {
|
|
1576
1576
|
if (!isDragging) return;
|
|
1577
1577
|
const touch = e.touches[0];
|
|
@@ -1582,7 +1582,7 @@ function AvatarEditor({
|
|
|
1582
1582
|
},
|
|
1583
1583
|
[isDragging, dragStart]
|
|
1584
1584
|
);
|
|
1585
|
-
const handleDiscard =
|
|
1585
|
+
const handleDiscard = React11.useCallback(() => {
|
|
1586
1586
|
setImage(null);
|
|
1587
1587
|
setImageLoaded(false);
|
|
1588
1588
|
resetTransforms();
|
|
@@ -2150,8 +2150,8 @@ function DrawerTitle({
|
|
|
2150
2150
|
);
|
|
2151
2151
|
}
|
|
2152
2152
|
function useMediaQuery(query) {
|
|
2153
|
-
const [matches, setMatches] =
|
|
2154
|
-
|
|
2153
|
+
const [matches, setMatches] = React11.useState(false);
|
|
2154
|
+
React11.useEffect(() => {
|
|
2155
2155
|
const media = window.matchMedia(query);
|
|
2156
2156
|
if (media.matches !== matches) {
|
|
2157
2157
|
setMatches(media.matches);
|
|
@@ -2181,17 +2181,17 @@ function AvatarEditorDialog({
|
|
|
2181
2181
|
className,
|
|
2182
2182
|
editorLabels
|
|
2183
2183
|
}) {
|
|
2184
|
-
const [isOpen, setIsOpen] =
|
|
2185
|
-
const [editedValue, setEditedValue] =
|
|
2186
|
-
const [displaySrc, setDisplaySrc] =
|
|
2187
|
-
const [isSaving, setIsSaving] =
|
|
2188
|
-
const [feedback, setFeedback] =
|
|
2189
|
-
|
|
2184
|
+
const [isOpen, setIsOpen] = React11.useState(false);
|
|
2185
|
+
const [editedValue, setEditedValue] = React11.useState(value ?? null);
|
|
2186
|
+
const [displaySrc, setDisplaySrc] = React11.useState(value ?? null);
|
|
2187
|
+
const [isSaving, setIsSaving] = React11.useState(false);
|
|
2188
|
+
const [feedback, setFeedback] = React11.useState(null);
|
|
2189
|
+
React11.useEffect(() => {
|
|
2190
2190
|
setDisplaySrc(value ?? null);
|
|
2191
2191
|
}, [value]);
|
|
2192
2192
|
const isMobile = useMediaQuery("(max-width: 640px)");
|
|
2193
2193
|
const caption = (placeholder ?? "").trim();
|
|
2194
|
-
const handleOpenChange =
|
|
2194
|
+
const handleOpenChange = React11.useCallback(
|
|
2195
2195
|
(open) => {
|
|
2196
2196
|
if (open) {
|
|
2197
2197
|
setEditedValue(value ?? null);
|
|
@@ -2201,7 +2201,7 @@ function AvatarEditorDialog({
|
|
|
2201
2201
|
},
|
|
2202
2202
|
[value]
|
|
2203
2203
|
);
|
|
2204
|
-
const handleAccept =
|
|
2204
|
+
const handleAccept = React11.useCallback(async () => {
|
|
2205
2205
|
if (!editedValue) return;
|
|
2206
2206
|
setIsSaving(true);
|
|
2207
2207
|
setFeedback(null);
|
|
@@ -2373,6 +2373,424 @@ function AvatarEditorDialog({
|
|
|
2373
2373
|
] }) })
|
|
2374
2374
|
] });
|
|
2375
2375
|
}
|
|
2376
|
+
|
|
2377
|
+
// src/components/video/shader-config.ts
|
|
2378
|
+
var SHADER_CURTAIN_TYPES = ["plane", "sphere", "waterPlane"];
|
|
2379
|
+
var SHADER_VARIANTS = [
|
|
2380
|
+
"defaults",
|
|
2381
|
+
"cosmic",
|
|
2382
|
+
"glass",
|
|
2383
|
+
"positionMix"
|
|
2384
|
+
];
|
|
2385
|
+
var SHADER_LIGHT_TYPES = ["3d", "env"];
|
|
2386
|
+
var SHADER_ENV_PRESETS = ["city", "dawn", "lobby"];
|
|
2387
|
+
var SHADER_ON_OFF = ["on", "off"];
|
|
2388
|
+
var SHADER_RANGE = ["enabled", "disabled"];
|
|
2389
|
+
var DEFAULT_SHADER_CURTAIN_CONFIG = {
|
|
2390
|
+
type: "plane",
|
|
2391
|
+
shader: "defaults",
|
|
2392
|
+
animate: "on",
|
|
2393
|
+
uTime: 0,
|
|
2394
|
+
uSpeed: 0.4,
|
|
2395
|
+
uStrength: 2,
|
|
2396
|
+
uDensity: 1.2,
|
|
2397
|
+
uFrequency: 5.5,
|
|
2398
|
+
uAmplitude: 1,
|
|
2399
|
+
wireframe: false,
|
|
2400
|
+
loop: "on",
|
|
2401
|
+
loopDuration: 10,
|
|
2402
|
+
range: "disabled",
|
|
2403
|
+
rangeStart: 0,
|
|
2404
|
+
rangeEnd: 10,
|
|
2405
|
+
positionX: 0,
|
|
2406
|
+
positionY: 0,
|
|
2407
|
+
positionZ: 0,
|
|
2408
|
+
rotationX: 0,
|
|
2409
|
+
rotationY: 0,
|
|
2410
|
+
rotationZ: 0,
|
|
2411
|
+
color1: "#52ff89",
|
|
2412
|
+
color2: "#dbba95",
|
|
2413
|
+
color3: "#d0bce1",
|
|
2414
|
+
reflection: 0.1,
|
|
2415
|
+
brightness: 1.2,
|
|
2416
|
+
cAzimuthAngle: 180,
|
|
2417
|
+
cPolarAngle: 90,
|
|
2418
|
+
cDistance: 3.6,
|
|
2419
|
+
cameraZoom: 1,
|
|
2420
|
+
fov: 45,
|
|
2421
|
+
zoomOut: false,
|
|
2422
|
+
lightType: "3d",
|
|
2423
|
+
envPreset: "city",
|
|
2424
|
+
grain: "off",
|
|
2425
|
+
grainBlending: 0.3,
|
|
2426
|
+
pixelDensity: 1
|
|
2427
|
+
};
|
|
2428
|
+
var SHADER_CURTAIN_PRESETS = [
|
|
2429
|
+
{ id: "halo", title: "Halo", config: { ...DEFAULT_SHADER_CURTAIN_CONFIG } },
|
|
2430
|
+
{
|
|
2431
|
+
id: "pensive",
|
|
2432
|
+
title: "Pensive",
|
|
2433
|
+
config: {
|
|
2434
|
+
...DEFAULT_SHADER_CURTAIN_CONFIG,
|
|
2435
|
+
type: "waterPlane",
|
|
2436
|
+
color1: "#809bd6",
|
|
2437
|
+
color2: "#910aff",
|
|
2438
|
+
color3: "#af38ff",
|
|
2439
|
+
uSpeed: 0.3,
|
|
2440
|
+
uStrength: 0.3,
|
|
2441
|
+
uDensity: 0.8
|
|
2442
|
+
}
|
|
2443
|
+
},
|
|
2444
|
+
{
|
|
2445
|
+
id: "mint",
|
|
2446
|
+
title: "Mint",
|
|
2447
|
+
config: {
|
|
2448
|
+
...DEFAULT_SHADER_CURTAIN_CONFIG,
|
|
2449
|
+
type: "waterPlane",
|
|
2450
|
+
color1: "#73bfc4",
|
|
2451
|
+
color2: "#ffcc81",
|
|
2452
|
+
color3: "#c9f5d3",
|
|
2453
|
+
uSpeed: 0.2,
|
|
2454
|
+
uStrength: 1.1
|
|
2455
|
+
}
|
|
2456
|
+
},
|
|
2457
|
+
{
|
|
2458
|
+
id: "interstella",
|
|
2459
|
+
title: "Interstella",
|
|
2460
|
+
config: {
|
|
2461
|
+
...DEFAULT_SHADER_CURTAIN_CONFIG,
|
|
2462
|
+
type: "sphere",
|
|
2463
|
+
color1: "#000000",
|
|
2464
|
+
color2: "#0d57c8",
|
|
2465
|
+
color3: "#7a2150",
|
|
2466
|
+
uDensity: 1.8,
|
|
2467
|
+
cDistance: 7.1,
|
|
2468
|
+
cameraZoom: 15
|
|
2469
|
+
}
|
|
2470
|
+
},
|
|
2471
|
+
{
|
|
2472
|
+
id: "nightyNight",
|
|
2473
|
+
title: "Nighty night",
|
|
2474
|
+
config: {
|
|
2475
|
+
...DEFAULT_SHADER_CURTAIN_CONFIG,
|
|
2476
|
+
type: "waterPlane",
|
|
2477
|
+
color1: "#1a1a2e",
|
|
2478
|
+
color2: "#16213e",
|
|
2479
|
+
color3: "#0f3460",
|
|
2480
|
+
grain: "on"
|
|
2481
|
+
}
|
|
2482
|
+
},
|
|
2483
|
+
{
|
|
2484
|
+
id: "violaOrientalis",
|
|
2485
|
+
title: "Viola orientalis",
|
|
2486
|
+
config: {
|
|
2487
|
+
...DEFAULT_SHADER_CURTAIN_CONFIG,
|
|
2488
|
+
type: "plane",
|
|
2489
|
+
color1: "#611e69",
|
|
2490
|
+
color2: "#ff7eb3",
|
|
2491
|
+
color3: "#c9b1ff",
|
|
2492
|
+
uStrength: 3.2
|
|
2493
|
+
}
|
|
2494
|
+
},
|
|
2495
|
+
{
|
|
2496
|
+
id: "universe",
|
|
2497
|
+
title: "Universe",
|
|
2498
|
+
config: {
|
|
2499
|
+
...DEFAULT_SHADER_CURTAIN_CONFIG,
|
|
2500
|
+
type: "waterPlane",
|
|
2501
|
+
color1: "#0b1026",
|
|
2502
|
+
color2: "#3d5afe",
|
|
2503
|
+
color3: "#00e5ff",
|
|
2504
|
+
uDensity: 2.2,
|
|
2505
|
+
lightType: "env",
|
|
2506
|
+
envPreset: "city"
|
|
2507
|
+
}
|
|
2508
|
+
},
|
|
2509
|
+
{
|
|
2510
|
+
id: "sunset",
|
|
2511
|
+
title: "Sunset",
|
|
2512
|
+
config: {
|
|
2513
|
+
...DEFAULT_SHADER_CURTAIN_CONFIG,
|
|
2514
|
+
type: "plane",
|
|
2515
|
+
color1: "#ff6a1a",
|
|
2516
|
+
color2: "#ffb347",
|
|
2517
|
+
color3: "#fd4912",
|
|
2518
|
+
cPolarAngle: 125,
|
|
2519
|
+
cDistance: 5
|
|
2520
|
+
}
|
|
2521
|
+
},
|
|
2522
|
+
{
|
|
2523
|
+
id: "mandarin",
|
|
2524
|
+
title: "Mandarin",
|
|
2525
|
+
config: {
|
|
2526
|
+
...DEFAULT_SHADER_CURTAIN_CONFIG,
|
|
2527
|
+
type: "sphere",
|
|
2528
|
+
color1: "#ff7a33",
|
|
2529
|
+
color2: "#33a0ff",
|
|
2530
|
+
color3: "#ffc53d",
|
|
2531
|
+
uSpeed: 0.1,
|
|
2532
|
+
uStrength: 0.4,
|
|
2533
|
+
uDensity: 1.1,
|
|
2534
|
+
uAmplitude: 1.4
|
|
2535
|
+
}
|
|
2536
|
+
},
|
|
2537
|
+
{
|
|
2538
|
+
id: "cottonCandy",
|
|
2539
|
+
title: "Cotton candy",
|
|
2540
|
+
config: {
|
|
2541
|
+
...DEFAULT_SHADER_CURTAIN_CONFIG,
|
|
2542
|
+
type: "sphere",
|
|
2543
|
+
color1: "#ffd1dc",
|
|
2544
|
+
color2: "#c5e1ff",
|
|
2545
|
+
color3: "#fff5ba",
|
|
2546
|
+
uSpeed: 0.15,
|
|
2547
|
+
grain: "on"
|
|
2548
|
+
}
|
|
2549
|
+
}
|
|
2550
|
+
];
|
|
2551
|
+
var HEX = /^#([0-9a-fA-F]{6})$/;
|
|
2552
|
+
var ON_OFF = new Set(SHADER_ON_OFF);
|
|
2553
|
+
var TYPES = new Set(SHADER_CURTAIN_TYPES);
|
|
2554
|
+
var VARIANTS = new Set(SHADER_VARIANTS);
|
|
2555
|
+
var LIGHTS = new Set(SHADER_LIGHT_TYPES);
|
|
2556
|
+
var ENVS = new Set(SHADER_ENV_PRESETS);
|
|
2557
|
+
var RANGES = new Set(SHADER_RANGE);
|
|
2558
|
+
function clamp(value, min, max) {
|
|
2559
|
+
return Math.min(max, Math.max(min, value));
|
|
2560
|
+
}
|
|
2561
|
+
function numberParam(raw, fallback, min, max) {
|
|
2562
|
+
if (raw == null || raw === "") return fallback;
|
|
2563
|
+
const parsed = Number(raw);
|
|
2564
|
+
if (!Number.isFinite(parsed)) return fallback;
|
|
2565
|
+
return clamp(parsed, min, max);
|
|
2566
|
+
}
|
|
2567
|
+
function hexParam(raw, fallback) {
|
|
2568
|
+
if (!raw) return fallback;
|
|
2569
|
+
const value = raw.startsWith("#") ? raw : `#${raw}`;
|
|
2570
|
+
return HEX.test(value) ? value : fallback;
|
|
2571
|
+
}
|
|
2572
|
+
function enumParam(raw, allowed, fallback) {
|
|
2573
|
+
if (!raw) return fallback;
|
|
2574
|
+
return allowed.has(raw) ? raw : fallback;
|
|
2575
|
+
}
|
|
2576
|
+
function boolParam(raw, fallback) {
|
|
2577
|
+
if (raw == null) return fallback;
|
|
2578
|
+
if (raw === "true" || raw === "1" || raw === "on") return true;
|
|
2579
|
+
if (raw === "false" || raw === "0" || raw === "off") return false;
|
|
2580
|
+
return fallback;
|
|
2581
|
+
}
|
|
2582
|
+
function mergeShaderCurtainConfig(partial) {
|
|
2583
|
+
return { ...DEFAULT_SHADER_CURTAIN_CONFIG, ...partial };
|
|
2584
|
+
}
|
|
2585
|
+
function parseShaderGradientUrl(input) {
|
|
2586
|
+
const trimmed = input.trim();
|
|
2587
|
+
if (!trimmed) return null;
|
|
2588
|
+
let url;
|
|
2589
|
+
try {
|
|
2590
|
+
url = new URL(trimmed);
|
|
2591
|
+
} catch {
|
|
2592
|
+
try {
|
|
2593
|
+
url = new URL(`https://www.shadergradient.co/customize?${trimmed}`);
|
|
2594
|
+
} catch {
|
|
2595
|
+
return null;
|
|
2596
|
+
}
|
|
2597
|
+
}
|
|
2598
|
+
const q = url.searchParams;
|
|
2599
|
+
const known = [
|
|
2600
|
+
"type",
|
|
2601
|
+
"shader",
|
|
2602
|
+
"animate",
|
|
2603
|
+
"color1",
|
|
2604
|
+
"uSpeed",
|
|
2605
|
+
"uStrength",
|
|
2606
|
+
"cDistance",
|
|
2607
|
+
"lightType"
|
|
2608
|
+
];
|
|
2609
|
+
if (!known.some((key) => q.has(key))) return null;
|
|
2610
|
+
const base = DEFAULT_SHADER_CURTAIN_CONFIG;
|
|
2611
|
+
return {
|
|
2612
|
+
type: enumParam(q.get("type"), TYPES, base.type),
|
|
2613
|
+
shader: enumParam(q.get("shader"), VARIANTS, base.shader),
|
|
2614
|
+
animate: enumParam(q.get("animate"), ON_OFF, base.animate),
|
|
2615
|
+
uTime: numberParam(q.get("uTime"), base.uTime, 0, 40),
|
|
2616
|
+
uSpeed: numberParam(q.get("uSpeed"), base.uSpeed, 0, 4),
|
|
2617
|
+
uStrength: numberParam(q.get("uStrength"), base.uStrength, 0, 10),
|
|
2618
|
+
uDensity: numberParam(q.get("uDensity"), base.uDensity, 0, 8),
|
|
2619
|
+
uFrequency: numberParam(q.get("uFrequency"), base.uFrequency, 0, 12),
|
|
2620
|
+
uAmplitude: numberParam(q.get("uAmplitude"), base.uAmplitude, 0, 8),
|
|
2621
|
+
wireframe: boolParam(q.get("wireframe"), base.wireframe),
|
|
2622
|
+
loop: enumParam(q.get("loop"), ON_OFF, base.loop),
|
|
2623
|
+
loopDuration: numberParam(q.get("loopDuration"), base.loopDuration, 1, 60),
|
|
2624
|
+
range: enumParam(q.get("range"), RANGES, base.range),
|
|
2625
|
+
rangeStart: numberParam(q.get("rangeStart"), base.rangeStart, 0, 40),
|
|
2626
|
+
rangeEnd: numberParam(q.get("rangeEnd"), base.rangeEnd, 0, 40),
|
|
2627
|
+
positionX: numberParam(q.get("positionX"), base.positionX, -20, 20),
|
|
2628
|
+
positionY: numberParam(q.get("positionY"), base.positionY, -20, 20),
|
|
2629
|
+
positionZ: numberParam(q.get("positionZ"), base.positionZ, -20, 20),
|
|
2630
|
+
rotationX: numberParam(q.get("rotationX"), base.rotationX, 0, 360),
|
|
2631
|
+
rotationY: numberParam(q.get("rotationY"), base.rotationY, 0, 360),
|
|
2632
|
+
rotationZ: numberParam(q.get("rotationZ"), base.rotationZ, 0, 360),
|
|
2633
|
+
color1: hexParam(q.get("color1"), base.color1),
|
|
2634
|
+
color2: hexParam(q.get("color2"), base.color2),
|
|
2635
|
+
color3: hexParam(q.get("color3"), base.color3),
|
|
2636
|
+
reflection: numberParam(q.get("reflection"), base.reflection, 0, 1),
|
|
2637
|
+
brightness: numberParam(q.get("brightness"), base.brightness, 0, 4),
|
|
2638
|
+
cAzimuthAngle: numberParam(
|
|
2639
|
+
q.get("cAzimuthAngle"),
|
|
2640
|
+
base.cAzimuthAngle,
|
|
2641
|
+
0,
|
|
2642
|
+
360
|
|
2643
|
+
),
|
|
2644
|
+
cPolarAngle: numberParam(q.get("cPolarAngle"), base.cPolarAngle, 0, 180),
|
|
2645
|
+
cDistance: numberParam(q.get("cDistance"), base.cDistance, 0.1, 40),
|
|
2646
|
+
cameraZoom: numberParam(q.get("cameraZoom"), base.cameraZoom, 0.1, 50),
|
|
2647
|
+
fov: numberParam(q.get("fov"), base.fov, 10, 120),
|
|
2648
|
+
zoomOut: boolParam(q.get("zoomOut"), base.zoomOut),
|
|
2649
|
+
lightType: enumParam(q.get("lightType"), LIGHTS, base.lightType),
|
|
2650
|
+
envPreset: enumParam(q.get("envPreset"), ENVS, base.envPreset),
|
|
2651
|
+
grain: enumParam(q.get("grain"), ON_OFF, base.grain),
|
|
2652
|
+
grainBlending: numberParam(
|
|
2653
|
+
q.get("grainBlending"),
|
|
2654
|
+
base.grainBlending,
|
|
2655
|
+
0,
|
|
2656
|
+
1
|
|
2657
|
+
),
|
|
2658
|
+
pixelDensity: numberParam(q.get("pixelDensity"), base.pixelDensity, 0.5, 2)
|
|
2659
|
+
};
|
|
2660
|
+
}
|
|
2661
|
+
function toShaderGradientUrl(config) {
|
|
2662
|
+
const params = new URLSearchParams();
|
|
2663
|
+
Object.keys(DEFAULT_SHADER_CURTAIN_CONFIG).forEach((key) => {
|
|
2664
|
+
params.set(key, String(config[key]));
|
|
2665
|
+
});
|
|
2666
|
+
return `https://www.shadergradient.co/customize?${params.toString()}`;
|
|
2667
|
+
}
|
|
2668
|
+
function isShaderCurtainKind(kind) {
|
|
2669
|
+
return kind === "shader";
|
|
2670
|
+
}
|
|
2671
|
+
function webglAvailable() {
|
|
2672
|
+
if (typeof document === "undefined") return false;
|
|
2673
|
+
try {
|
|
2674
|
+
const canvas = document.createElement("canvas");
|
|
2675
|
+
return Boolean(
|
|
2676
|
+
canvas.getContext("webgl") || canvas.getContext("experimental-webgl")
|
|
2677
|
+
);
|
|
2678
|
+
} catch {
|
|
2679
|
+
return false;
|
|
2680
|
+
}
|
|
2681
|
+
}
|
|
2682
|
+
function Poster({
|
|
2683
|
+
url,
|
|
2684
|
+
alt,
|
|
2685
|
+
className
|
|
2686
|
+
}) {
|
|
2687
|
+
if (!url) {
|
|
2688
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
2689
|
+
"div",
|
|
2690
|
+
{
|
|
2691
|
+
className: cn("h-full w-full bg-zinc-950", className),
|
|
2692
|
+
"aria-hidden": alt ? void 0 : true
|
|
2693
|
+
}
|
|
2694
|
+
);
|
|
2695
|
+
}
|
|
2696
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
2697
|
+
"img",
|
|
2698
|
+
{
|
|
2699
|
+
src: url,
|
|
2700
|
+
alt,
|
|
2701
|
+
className: cn("h-full w-full object-cover", className)
|
|
2702
|
+
}
|
|
2703
|
+
);
|
|
2704
|
+
}
|
|
2705
|
+
function ShaderCurtain({
|
|
2706
|
+
config,
|
|
2707
|
+
posterUrl,
|
|
2708
|
+
envBasePath,
|
|
2709
|
+
className,
|
|
2710
|
+
preserveDrawingBuffer = false,
|
|
2711
|
+
reducedMotion = false,
|
|
2712
|
+
alt = ""
|
|
2713
|
+
}) {
|
|
2714
|
+
const [module, setModule] = React11__namespace.useState(null);
|
|
2715
|
+
const [failed, setFailed] = React11__namespace.useState(false);
|
|
2716
|
+
const resolved = mergeShaderCurtainConfig(config);
|
|
2717
|
+
React11__namespace.useEffect(() => {
|
|
2718
|
+
if (reducedMotion || !webglAvailable()) {
|
|
2719
|
+
setFailed(true);
|
|
2720
|
+
return;
|
|
2721
|
+
}
|
|
2722
|
+
let cancelled = false;
|
|
2723
|
+
void import('@shadergradient/react').then((loaded) => {
|
|
2724
|
+
if (cancelled) return;
|
|
2725
|
+
if (!loaded.ShaderGradientCanvas || !loaded.ShaderGradient) {
|
|
2726
|
+
setFailed(true);
|
|
2727
|
+
return;
|
|
2728
|
+
}
|
|
2729
|
+
setModule(loaded);
|
|
2730
|
+
}).catch(() => {
|
|
2731
|
+
if (!cancelled) setFailed(true);
|
|
2732
|
+
});
|
|
2733
|
+
return () => {
|
|
2734
|
+
cancelled = true;
|
|
2735
|
+
};
|
|
2736
|
+
}, [reducedMotion]);
|
|
2737
|
+
if (failed || reducedMotion || !module) {
|
|
2738
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Poster, { url: posterUrl, alt, className });
|
|
2739
|
+
}
|
|
2740
|
+
const { ShaderGradientCanvas, ShaderGradient } = module;
|
|
2741
|
+
const animate = resolved.animate === "off" || reducedMotion ? "off" : "on";
|
|
2742
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: cn("relative h-full w-full overflow-hidden", className), children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
2743
|
+
ShaderGradientCanvas,
|
|
2744
|
+
{
|
|
2745
|
+
style: { position: "absolute", inset: 0 },
|
|
2746
|
+
pixelDensity: resolved.pixelDensity,
|
|
2747
|
+
fov: resolved.fov,
|
|
2748
|
+
envBasePath,
|
|
2749
|
+
preserveDrawingBuffer,
|
|
2750
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
2751
|
+
ShaderGradient,
|
|
2752
|
+
{
|
|
2753
|
+
control: "props",
|
|
2754
|
+
type: resolved.type,
|
|
2755
|
+
shader: resolved.shader,
|
|
2756
|
+
animate,
|
|
2757
|
+
uTime: resolved.uTime,
|
|
2758
|
+
uSpeed: resolved.uSpeed,
|
|
2759
|
+
uStrength: resolved.uStrength,
|
|
2760
|
+
uDensity: resolved.uDensity,
|
|
2761
|
+
uFrequency: resolved.uFrequency,
|
|
2762
|
+
uAmplitude: resolved.uAmplitude,
|
|
2763
|
+
wireframe: resolved.wireframe,
|
|
2764
|
+
loop: resolved.loop,
|
|
2765
|
+
loopDuration: resolved.loopDuration,
|
|
2766
|
+
range: resolved.range,
|
|
2767
|
+
rangeStart: resolved.rangeStart,
|
|
2768
|
+
rangeEnd: resolved.rangeEnd,
|
|
2769
|
+
positionX: resolved.positionX,
|
|
2770
|
+
positionY: resolved.positionY,
|
|
2771
|
+
positionZ: resolved.positionZ,
|
|
2772
|
+
rotationX: resolved.rotationX,
|
|
2773
|
+
rotationY: resolved.rotationY,
|
|
2774
|
+
rotationZ: resolved.rotationZ,
|
|
2775
|
+
color1: resolved.color1,
|
|
2776
|
+
color2: resolved.color2,
|
|
2777
|
+
color3: resolved.color3,
|
|
2778
|
+
reflection: resolved.reflection,
|
|
2779
|
+
brightness: resolved.brightness,
|
|
2780
|
+
cAzimuthAngle: resolved.cAzimuthAngle,
|
|
2781
|
+
cPolarAngle: resolved.cPolarAngle,
|
|
2782
|
+
cDistance: resolved.cDistance,
|
|
2783
|
+
cameraZoom: resolved.cameraZoom,
|
|
2784
|
+
zoomOut: resolved.zoomOut,
|
|
2785
|
+
lightType: resolved.lightType,
|
|
2786
|
+
envPreset: resolved.envPreset,
|
|
2787
|
+
grain: resolved.grain,
|
|
2788
|
+
grainBlending: resolved.grainBlending
|
|
2789
|
+
}
|
|
2790
|
+
)
|
|
2791
|
+
}
|
|
2792
|
+
) });
|
|
2793
|
+
}
|
|
2376
2794
|
var DEFAULT_LABELS2 = {
|
|
2377
2795
|
play: "Play",
|
|
2378
2796
|
tapToUnmute: "Tap to unmute",
|
|
@@ -2405,8 +2823,8 @@ function probeVideoAudio(el) {
|
|
|
2405
2823
|
return "unknown";
|
|
2406
2824
|
}
|
|
2407
2825
|
function usePrefersReducedMotion() {
|
|
2408
|
-
const [reduced, setReduced] =
|
|
2409
|
-
|
|
2826
|
+
const [reduced, setReduced] = React11__namespace.useState(false);
|
|
2827
|
+
React11__namespace.useEffect(() => {
|
|
2410
2828
|
const media = window.matchMedia("(prefers-reduced-motion: reduce)");
|
|
2411
2829
|
const sync = () => setReduced(media.matches);
|
|
2412
2830
|
sync();
|
|
@@ -2423,11 +2841,11 @@ function CurtainVideo({
|
|
|
2423
2841
|
allowSound,
|
|
2424
2842
|
labels
|
|
2425
2843
|
}) {
|
|
2426
|
-
const videoRef =
|
|
2427
|
-
const [playback, setPlayback] =
|
|
2428
|
-
const [muted, setMuted] =
|
|
2429
|
-
const [audio, setAudio] =
|
|
2430
|
-
|
|
2844
|
+
const videoRef = React11__namespace.useRef(null);
|
|
2845
|
+
const [playback, setPlayback] = React11__namespace.useState("pending");
|
|
2846
|
+
const [muted, setMuted] = React11__namespace.useState(true);
|
|
2847
|
+
const [audio, setAudio] = React11__namespace.useState("unknown");
|
|
2848
|
+
React11__namespace.useEffect(() => {
|
|
2431
2849
|
const el = videoRef.current;
|
|
2432
2850
|
if (!el) return;
|
|
2433
2851
|
el.setAttribute("webkit-playsinline", "");
|
|
@@ -2468,7 +2886,7 @@ function CurtainVideo({
|
|
|
2468
2886
|
el.removeEventListener("loadedmetadata", applyAudio);
|
|
2469
2887
|
};
|
|
2470
2888
|
}, [url, freeze]);
|
|
2471
|
-
const startPlayback =
|
|
2889
|
+
const startPlayback = React11__namespace.useCallback(() => {
|
|
2472
2890
|
const el = videoRef.current;
|
|
2473
2891
|
if (!el) return;
|
|
2474
2892
|
el.muted = true;
|
|
@@ -2484,7 +2902,7 @@ function CurtainVideo({
|
|
|
2484
2902
|
}
|
|
2485
2903
|
);
|
|
2486
2904
|
}, []);
|
|
2487
|
-
const setVideoMuted =
|
|
2905
|
+
const setVideoMuted = React11__namespace.useCallback((next) => {
|
|
2488
2906
|
const el = videoRef.current;
|
|
2489
2907
|
if (el) el.muted = next;
|
|
2490
2908
|
setMuted(next);
|
|
@@ -2546,6 +2964,8 @@ function CurtainStage({
|
|
|
2546
2964
|
url,
|
|
2547
2965
|
alt = "",
|
|
2548
2966
|
className,
|
|
2967
|
+
config,
|
|
2968
|
+
envBasePath,
|
|
2549
2969
|
reducedMotion,
|
|
2550
2970
|
allowSound = false,
|
|
2551
2971
|
labels
|
|
@@ -2553,31 +2973,49 @@ function CurtainStage({
|
|
|
2553
2973
|
const prefersReduced = usePrefersReducedMotion();
|
|
2554
2974
|
const freeze = reducedMotion ?? prefersReduced;
|
|
2555
2975
|
const copy = { ...DEFAULT_LABELS2, ...labels };
|
|
2556
|
-
|
|
2557
|
-
|
|
2558
|
-
|
|
2559
|
-
|
|
2560
|
-
|
|
2561
|
-
|
|
2562
|
-
|
|
2563
|
-
|
|
2564
|
-
|
|
2565
|
-
|
|
2566
|
-
|
|
2567
|
-
|
|
2568
|
-
|
|
2569
|
-
|
|
2570
|
-
|
|
2571
|
-
|
|
2572
|
-
|
|
2573
|
-
|
|
2574
|
-
|
|
2976
|
+
switch (kind) {
|
|
2977
|
+
case "video":
|
|
2978
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
2979
|
+
CurtainVideo,
|
|
2980
|
+
{
|
|
2981
|
+
url,
|
|
2982
|
+
alt,
|
|
2983
|
+
className,
|
|
2984
|
+
freeze,
|
|
2985
|
+
allowSound,
|
|
2986
|
+
labels: copy
|
|
2987
|
+
}
|
|
2988
|
+
);
|
|
2989
|
+
case "shader":
|
|
2990
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
2991
|
+
ShaderCurtain,
|
|
2992
|
+
{
|
|
2993
|
+
config: mergeShaderCurtainConfig(config),
|
|
2994
|
+
posterUrl: url,
|
|
2995
|
+
envBasePath,
|
|
2996
|
+
reducedMotion: freeze,
|
|
2997
|
+
alt,
|
|
2998
|
+
className
|
|
2999
|
+
}
|
|
3000
|
+
);
|
|
3001
|
+
case "image":
|
|
3002
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
3003
|
+
"img",
|
|
3004
|
+
{
|
|
3005
|
+
src: url,
|
|
3006
|
+
alt,
|
|
3007
|
+
className: cn("h-full w-full object-cover", className)
|
|
3008
|
+
}
|
|
3009
|
+
);
|
|
3010
|
+
default: {
|
|
3011
|
+
const _exhaustive = kind;
|
|
3012
|
+
return _exhaustive;
|
|
2575
3013
|
}
|
|
2576
|
-
|
|
3014
|
+
}
|
|
2577
3015
|
}
|
|
2578
3016
|
function useMediaQuery2(query) {
|
|
2579
|
-
const [matches, setMatches] =
|
|
2580
|
-
|
|
3017
|
+
const [matches, setMatches] = React11.useState(false);
|
|
3018
|
+
React11.useEffect(() => {
|
|
2581
3019
|
if (typeof window === "undefined" || !window.matchMedia) return;
|
|
2582
3020
|
const mql = window.matchMedia(query);
|
|
2583
3021
|
const onChange = () => setMatches(mql.matches);
|
|
@@ -2591,9 +3029,9 @@ function isVideoKind(kind) {
|
|
|
2591
3029
|
return kind === "video";
|
|
2592
3030
|
}
|
|
2593
3031
|
function useElementInView(enabled) {
|
|
2594
|
-
const [node, setNode] =
|
|
2595
|
-
const [inView, setInView] =
|
|
2596
|
-
|
|
3032
|
+
const [node, setNode] = React11__namespace.useState(null);
|
|
3033
|
+
const [inView, setInView] = React11__namespace.useState(false);
|
|
3034
|
+
React11__namespace.useEffect(() => {
|
|
2597
3035
|
if (!enabled || !node || typeof IntersectionObserver === "undefined") {
|
|
2598
3036
|
setInView(false);
|
|
2599
3037
|
return;
|
|
@@ -2661,9 +3099,11 @@ var DEFAULT_CURTAIN_PICKER_LABELS = {
|
|
|
2661
3099
|
noneDescription: "Use the default curtain",
|
|
2662
3100
|
defaultBadge: "Default",
|
|
2663
3101
|
makeDefault: "Set as default",
|
|
3102
|
+
edit: "Edit",
|
|
2664
3103
|
delete: "Delete",
|
|
2665
3104
|
image: "Image",
|
|
2666
3105
|
video: "Video",
|
|
3106
|
+
shader: "Shader",
|
|
2667
3107
|
organization: "Organization",
|
|
2668
3108
|
platform: "Catalog",
|
|
2669
3109
|
groupOrganization: "Your curtains",
|
|
@@ -2688,7 +3128,9 @@ function ownerGroup(ownerType) {
|
|
|
2688
3128
|
}
|
|
2689
3129
|
}
|
|
2690
3130
|
function kindLabel(kind, copy) {
|
|
2691
|
-
|
|
3131
|
+
if (kind === "video") return copy.video;
|
|
3132
|
+
if (kind === "shader") return copy.shader;
|
|
3133
|
+
return copy.image;
|
|
2692
3134
|
}
|
|
2693
3135
|
function ownerLabel(ownerType, copy) {
|
|
2694
3136
|
if (ownerType === "organization") return copy.organization;
|
|
@@ -2716,10 +3158,11 @@ function resolvePreviewItem(selectedId, ready, allowNone) {
|
|
|
2716
3158
|
if (allowNone) return null;
|
|
2717
3159
|
return ready[0] ?? null;
|
|
2718
3160
|
}
|
|
2719
|
-
function itemActions(item, onMakeDefault, onDelete, canMakeDefault, canDelete) {
|
|
3161
|
+
function itemActions(item, onMakeDefault, onEdit, onDelete, canMakeDefault, canDelete) {
|
|
2720
3162
|
if (!item) return {};
|
|
2721
3163
|
return {
|
|
2722
3164
|
onMakeDefault: onMakeDefault && (canMakeDefault ? canMakeDefault(item) : !item.isDefault) ? () => onMakeDefault(item) : void 0,
|
|
3165
|
+
onEdit: onEdit ? () => onEdit(item) : void 0,
|
|
2723
3166
|
onDelete: onDelete && (canDelete ? canDelete(item) : true) ? () => onDelete(item) : void 0
|
|
2724
3167
|
};
|
|
2725
3168
|
}
|
|
@@ -2756,6 +3199,7 @@ function CurtainPicker({
|
|
|
2756
3199
|
variant = "default",
|
|
2757
3200
|
groupByOwner = false,
|
|
2758
3201
|
onMakeDefault,
|
|
3202
|
+
onEdit,
|
|
2759
3203
|
onDelete,
|
|
2760
3204
|
canMakeDefault,
|
|
2761
3205
|
canDelete,
|
|
@@ -2765,7 +3209,7 @@ function CurtainPicker({
|
|
|
2765
3209
|
actionsPending = false
|
|
2766
3210
|
}) {
|
|
2767
3211
|
const copy = { ...DEFAULT_CURTAIN_PICKER_LABELS, ...labels };
|
|
2768
|
-
const groupName =
|
|
3212
|
+
const groupName = React11__namespace.useId();
|
|
2769
3213
|
const selectable = typeof onChange === "function";
|
|
2770
3214
|
const compact = variant === "compact";
|
|
2771
3215
|
const selectedId = value === "" ? null : value ?? null;
|
|
@@ -2777,11 +3221,12 @@ function CurtainPicker({
|
|
|
2777
3221
|
const compactActions = compact ? itemActions(
|
|
2778
3222
|
actionTarget,
|
|
2779
3223
|
onMakeDefault,
|
|
3224
|
+
onEdit,
|
|
2780
3225
|
onDelete,
|
|
2781
3226
|
canMakeDefault,
|
|
2782
3227
|
canDelete
|
|
2783
3228
|
) : {};
|
|
2784
|
-
const grouped =
|
|
3229
|
+
const grouped = React11__namespace.useMemo(() => {
|
|
2785
3230
|
if (!groupByOwner) {
|
|
2786
3231
|
return [{ group: null, items: ready }];
|
|
2787
3232
|
}
|
|
@@ -2822,6 +3267,7 @@ function CurtainPicker({
|
|
|
2822
3267
|
disabled,
|
|
2823
3268
|
actionsPending,
|
|
2824
3269
|
onMakeDefault: compactActions.onMakeDefault,
|
|
3270
|
+
onEdit: compactActions.onEdit,
|
|
2825
3271
|
onDelete: compactActions.onDelete
|
|
2826
3272
|
}
|
|
2827
3273
|
) : null,
|
|
@@ -2844,13 +3290,23 @@ function CurtainPicker({
|
|
|
2844
3290
|
onMakeDefault: compact ? void 0 : itemActions(
|
|
2845
3291
|
item,
|
|
2846
3292
|
onMakeDefault,
|
|
3293
|
+
onEdit,
|
|
2847
3294
|
onDelete,
|
|
2848
3295
|
canMakeDefault,
|
|
2849
3296
|
canDelete
|
|
2850
3297
|
).onMakeDefault,
|
|
3298
|
+
onEdit: compact ? void 0 : itemActions(
|
|
3299
|
+
item,
|
|
3300
|
+
onMakeDefault,
|
|
3301
|
+
onEdit,
|
|
3302
|
+
onDelete,
|
|
3303
|
+
canMakeDefault,
|
|
3304
|
+
canDelete
|
|
3305
|
+
).onEdit,
|
|
2851
3306
|
onDelete: compact ? void 0 : itemActions(
|
|
2852
3307
|
item,
|
|
2853
3308
|
onMakeDefault,
|
|
3309
|
+
onEdit,
|
|
2854
3310
|
onDelete,
|
|
2855
3311
|
canMakeDefault,
|
|
2856
3312
|
canDelete
|
|
@@ -2867,6 +3323,7 @@ function SelectedPreview({
|
|
|
2867
3323
|
disabled,
|
|
2868
3324
|
actionsPending,
|
|
2869
3325
|
onMakeDefault,
|
|
3326
|
+
onEdit,
|
|
2870
3327
|
onDelete
|
|
2871
3328
|
}) {
|
|
2872
3329
|
const owner = item ? ownerLabel(item.ownerType, copy) : null;
|
|
@@ -2910,6 +3367,7 @@ function SelectedPreview({
|
|
|
2910
3367
|
actionsPending,
|
|
2911
3368
|
copy,
|
|
2912
3369
|
onMakeDefault,
|
|
3370
|
+
onEdit,
|
|
2913
3371
|
onDelete
|
|
2914
3372
|
}
|
|
2915
3373
|
)
|
|
@@ -2934,9 +3392,10 @@ function ManageActions({
|
|
|
2934
3392
|
actionsPending,
|
|
2935
3393
|
copy,
|
|
2936
3394
|
onMakeDefault,
|
|
3395
|
+
onEdit,
|
|
2937
3396
|
onDelete
|
|
2938
3397
|
}) {
|
|
2939
|
-
if (!onMakeDefault && !onDelete) return null;
|
|
3398
|
+
if (!onMakeDefault && !onEdit && !onDelete) return null;
|
|
2940
3399
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-wrap gap-2", children: [
|
|
2941
3400
|
onMakeDefault ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
2942
3401
|
Button,
|
|
@@ -2949,6 +3408,17 @@ function ManageActions({
|
|
|
2949
3408
|
children: copy.makeDefault
|
|
2950
3409
|
}
|
|
2951
3410
|
) : null,
|
|
3411
|
+
onEdit ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
3412
|
+
Button,
|
|
3413
|
+
{
|
|
3414
|
+
type: "button",
|
|
3415
|
+
size: "sm",
|
|
3416
|
+
variant: "secondary",
|
|
3417
|
+
disabled: disabled || actionsPending,
|
|
3418
|
+
onClick: onEdit,
|
|
3419
|
+
children: copy.edit
|
|
3420
|
+
}
|
|
3421
|
+
) : null,
|
|
2952
3422
|
onDelete ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
2953
3423
|
Button,
|
|
2954
3424
|
{
|
|
@@ -3013,6 +3483,7 @@ function CurtainPickerCard({
|
|
|
3013
3483
|
compact,
|
|
3014
3484
|
onSelect,
|
|
3015
3485
|
onMakeDefault,
|
|
3486
|
+
onEdit,
|
|
3016
3487
|
onDelete
|
|
3017
3488
|
}) {
|
|
3018
3489
|
const owner = ownerLabel(item.ownerType, copy);
|
|
@@ -3078,6 +3549,7 @@ function CurtainPickerCard({
|
|
|
3078
3549
|
actionsPending,
|
|
3079
3550
|
copy,
|
|
3080
3551
|
onMakeDefault,
|
|
3552
|
+
onEdit,
|
|
3081
3553
|
onDelete
|
|
3082
3554
|
}
|
|
3083
3555
|
)
|
|
@@ -3102,12 +3574,14 @@ function WaitingRoom({
|
|
|
3102
3574
|
startsAt,
|
|
3103
3575
|
durationSeconds,
|
|
3104
3576
|
curtain,
|
|
3577
|
+
hideBranding = false,
|
|
3578
|
+
hideStatus = false,
|
|
3105
3579
|
nowMs,
|
|
3106
3580
|
labels,
|
|
3107
3581
|
className
|
|
3108
3582
|
}) {
|
|
3109
|
-
const [now, setNow] =
|
|
3110
|
-
|
|
3583
|
+
const [now, setNow] = React11__namespace.useState(nowMs ?? Date.now());
|
|
3584
|
+
React11__namespace.useEffect(() => {
|
|
3111
3585
|
if (nowMs != null) {
|
|
3112
3586
|
setNow(nowMs);
|
|
3113
3587
|
return;
|
|
@@ -3130,12 +3604,18 @@ function WaitingRoom({
|
|
|
3130
3604
|
{
|
|
3131
3605
|
kind: curtain.kind,
|
|
3132
3606
|
url: curtain.url,
|
|
3607
|
+
config: curtain.config,
|
|
3608
|
+
envBasePath: curtain.envBasePath,
|
|
3133
3609
|
allowSound: true,
|
|
3134
3610
|
className: "absolute inset-0"
|
|
3135
3611
|
}
|
|
3136
3612
|
) : /* @__PURE__ */ jsxRuntime.jsx("div", { className: "absolute inset-0 bg-gradient-to-br from-zinc-900 to-zinc-950" }),
|
|
3137
|
-
/* @__PURE__ */ jsxRuntime.jsxs("
|
|
3138
|
-
|
|
3613
|
+
/* @__PURE__ */ jsxRuntime.jsxs("p", { className: "sr-only", role: "status", children: [
|
|
3614
|
+
title,
|
|
3615
|
+
remaining != null ? remaining > 0 ? ` ${labels?.startsIn ?? "Starts in"} ${formatCountdown(remaining)}` : ` ${labels?.started ?? "Starting soon"}` : ""
|
|
3616
|
+
] }),
|
|
3617
|
+
hideBranding && hideStatus ? null : /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "relative z-10 flex w-full flex-col justify-end gap-3 bg-gradient-to-t from-black/70 via-black/30 to-transparent p-6", children: [
|
|
3618
|
+
hideBranding ? null : /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-3", children: [
|
|
3139
3619
|
organizationImage ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
3140
3620
|
"img",
|
|
3141
3621
|
{
|
|
@@ -3149,14 +3629,627 @@ function WaitingRoom({
|
|
|
3149
3629
|
organizationName ? /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm text-white/80", children: organizationName }) : null
|
|
3150
3630
|
] })
|
|
3151
3631
|
] }),
|
|
3152
|
-
remaining != null ? /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm tabular-nums", children: remaining > 0 ? `${labels?.startsIn ?? "Starts in"} ${formatCountdown(remaining)}` : labels?.started ?? "Starting soon" }) : null,
|
|
3153
|
-
durationMinutes != null ? /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-xs text-white/70", children: labels?.duration ? labels.duration(durationMinutes) : `${durationMinutes} min` }) : null
|
|
3632
|
+
hideStatus ? null : remaining != null ? /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm tabular-nums", children: remaining > 0 ? `${labels?.startsIn ?? "Starts in"} ${formatCountdown(remaining)}` : labels?.started ?? "Starting soon" }) : null,
|
|
3633
|
+
hideStatus ? null : durationMinutes != null ? /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-xs text-white/70", children: labels?.duration ? labels.duration(durationMinutes) : `${durationMinutes} min` }) : null
|
|
3154
3634
|
] })
|
|
3155
3635
|
]
|
|
3156
3636
|
}
|
|
3157
3637
|
);
|
|
3158
3638
|
}
|
|
3159
3639
|
|
|
3640
|
+
// src/components/video/captureShaderPoster.ts
|
|
3641
|
+
function canvasFromRoot(root) {
|
|
3642
|
+
return root.querySelector("canvas");
|
|
3643
|
+
}
|
|
3644
|
+
function captureShaderPoster(root, options = {}) {
|
|
3645
|
+
const canvas = canvasFromRoot(root);
|
|
3646
|
+
if (!canvas) return Promise.resolve(null);
|
|
3647
|
+
const type = options.type ?? "image/jpeg";
|
|
3648
|
+
const quality = options.quality ?? 0.92;
|
|
3649
|
+
return new Promise((resolve) => {
|
|
3650
|
+
canvas.toBlob(
|
|
3651
|
+
(blob) => resolve(blob),
|
|
3652
|
+
type,
|
|
3653
|
+
type === "image/jpeg" ? quality : void 0
|
|
3654
|
+
);
|
|
3655
|
+
});
|
|
3656
|
+
}
|
|
3657
|
+
var DEFAULT_SHADER_CURTAIN_EDITOR_LABELS = {
|
|
3658
|
+
shape: "Shape",
|
|
3659
|
+
colors: "Colors",
|
|
3660
|
+
light: "Light & effects",
|
|
3661
|
+
camera: "Camera",
|
|
3662
|
+
presets: "Presets",
|
|
3663
|
+
importUrl: "Paste a shadergradient.co URL",
|
|
3664
|
+
importApply: "Apply URL",
|
|
3665
|
+
importError: "Could not read that URL"
|
|
3666
|
+
};
|
|
3667
|
+
function NumberField({
|
|
3668
|
+
label,
|
|
3669
|
+
value,
|
|
3670
|
+
min,
|
|
3671
|
+
max,
|
|
3672
|
+
step,
|
|
3673
|
+
onChange
|
|
3674
|
+
}) {
|
|
3675
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("label", { className: "grid gap-1 text-xs", children: [
|
|
3676
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-muted-foreground", children: label }),
|
|
3677
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3678
|
+
"input",
|
|
3679
|
+
{
|
|
3680
|
+
type: "range",
|
|
3681
|
+
min,
|
|
3682
|
+
max,
|
|
3683
|
+
step,
|
|
3684
|
+
value,
|
|
3685
|
+
onChange: (event) => onChange(Number(event.target.value))
|
|
3686
|
+
}
|
|
3687
|
+
),
|
|
3688
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3689
|
+
"input",
|
|
3690
|
+
{
|
|
3691
|
+
type: "number",
|
|
3692
|
+
min,
|
|
3693
|
+
max,
|
|
3694
|
+
step,
|
|
3695
|
+
value,
|
|
3696
|
+
onChange: (event) => onChange(Number(event.target.value)),
|
|
3697
|
+
className: "border-input bg-background rounded-md border px-2 py-1"
|
|
3698
|
+
}
|
|
3699
|
+
)
|
|
3700
|
+
] });
|
|
3701
|
+
}
|
|
3702
|
+
function SelectField({
|
|
3703
|
+
label,
|
|
3704
|
+
value,
|
|
3705
|
+
options,
|
|
3706
|
+
onChange
|
|
3707
|
+
}) {
|
|
3708
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("label", { className: "grid gap-1 text-xs", children: [
|
|
3709
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-muted-foreground", children: label }),
|
|
3710
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3711
|
+
"select",
|
|
3712
|
+
{
|
|
3713
|
+
value,
|
|
3714
|
+
onChange: (event) => onChange(event.target.value),
|
|
3715
|
+
className: "border-input bg-background rounded-md border px-2 py-1",
|
|
3716
|
+
children: options.map((option) => /* @__PURE__ */ jsxRuntime.jsx("option", { value: option, children: option }, option))
|
|
3717
|
+
}
|
|
3718
|
+
)
|
|
3719
|
+
] });
|
|
3720
|
+
}
|
|
3721
|
+
function ColorField({
|
|
3722
|
+
label,
|
|
3723
|
+
value,
|
|
3724
|
+
onChange
|
|
3725
|
+
}) {
|
|
3726
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("label", { className: "grid gap-1 text-xs", children: [
|
|
3727
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-muted-foreground", children: label }),
|
|
3728
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3729
|
+
"input",
|
|
3730
|
+
{
|
|
3731
|
+
type: "color",
|
|
3732
|
+
value,
|
|
3733
|
+
onChange: (event) => onChange(event.target.value),
|
|
3734
|
+
className: "h-9 w-full cursor-pointer rounded-md border"
|
|
3735
|
+
}
|
|
3736
|
+
)
|
|
3737
|
+
] });
|
|
3738
|
+
}
|
|
3739
|
+
var ShaderCurtainEditor = React11__namespace.forwardRef(function ShaderCurtainEditor2({ value, onChange, envBasePath, className, labels }, ref) {
|
|
3740
|
+
const copy = { ...DEFAULT_SHADER_CURTAIN_EDITOR_LABELS, ...labels };
|
|
3741
|
+
const [config, setConfig] = React11__namespace.useState(
|
|
3742
|
+
() => mergeShaderCurtainConfig(value)
|
|
3743
|
+
);
|
|
3744
|
+
const [tab, setTab] = React11__namespace.useState("shape");
|
|
3745
|
+
const [url, setUrl] = React11__namespace.useState("");
|
|
3746
|
+
const [urlError, setUrlError] = React11__namespace.useState(null);
|
|
3747
|
+
const previewRef = React11__namespace.useRef(null);
|
|
3748
|
+
const update = React11__namespace.useCallback(
|
|
3749
|
+
(patch) => {
|
|
3750
|
+
setConfig((current) => {
|
|
3751
|
+
const next = { ...current, ...patch };
|
|
3752
|
+
onChange?.(next);
|
|
3753
|
+
return next;
|
|
3754
|
+
});
|
|
3755
|
+
},
|
|
3756
|
+
[onChange]
|
|
3757
|
+
);
|
|
3758
|
+
const replace = React11__namespace.useCallback(
|
|
3759
|
+
(next) => {
|
|
3760
|
+
setConfig(next);
|
|
3761
|
+
onChange?.(next);
|
|
3762
|
+
},
|
|
3763
|
+
[onChange]
|
|
3764
|
+
);
|
|
3765
|
+
React11__namespace.useImperativeHandle(ref, () => ({
|
|
3766
|
+
getConfig: () => config,
|
|
3767
|
+
capturePoster: async () => {
|
|
3768
|
+
if (!previewRef.current) return null;
|
|
3769
|
+
return captureShaderPoster(previewRef.current);
|
|
3770
|
+
}
|
|
3771
|
+
}));
|
|
3772
|
+
const applyUrl = () => {
|
|
3773
|
+
const parsed = parseShaderGradientUrl(url);
|
|
3774
|
+
if (!parsed) {
|
|
3775
|
+
setUrlError(copy.importError);
|
|
3776
|
+
return;
|
|
3777
|
+
}
|
|
3778
|
+
setUrlError(null);
|
|
3779
|
+
replace(parsed);
|
|
3780
|
+
};
|
|
3781
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
3782
|
+
"div",
|
|
3783
|
+
{
|
|
3784
|
+
className: cn("grid gap-4 lg:grid-cols-[minmax(0,1fr)_20rem]", className),
|
|
3785
|
+
children: [
|
|
3786
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3787
|
+
"div",
|
|
3788
|
+
{
|
|
3789
|
+
ref: previewRef,
|
|
3790
|
+
className: "relative aspect-video overflow-hidden rounded-lg bg-zinc-950",
|
|
3791
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
3792
|
+
ShaderCurtain,
|
|
3793
|
+
{
|
|
3794
|
+
config,
|
|
3795
|
+
envBasePath,
|
|
3796
|
+
preserveDrawingBuffer: true,
|
|
3797
|
+
className: "absolute inset-0"
|
|
3798
|
+
}
|
|
3799
|
+
)
|
|
3800
|
+
}
|
|
3801
|
+
),
|
|
3802
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-4", children: [
|
|
3803
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex flex-wrap gap-1", children: [
|
|
3804
|
+
["shape", copy.shape],
|
|
3805
|
+
["colors", copy.colors],
|
|
3806
|
+
["light", copy.light],
|
|
3807
|
+
["camera", copy.camera]
|
|
3808
|
+
].map(([id, label]) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
3809
|
+
Button,
|
|
3810
|
+
{
|
|
3811
|
+
type: "button",
|
|
3812
|
+
size: "sm",
|
|
3813
|
+
variant: tab === id ? "default" : "secondary",
|
|
3814
|
+
onClick: () => setTab(id),
|
|
3815
|
+
children: label
|
|
3816
|
+
},
|
|
3817
|
+
id
|
|
3818
|
+
)) }),
|
|
3819
|
+
tab === "shape" ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid gap-3", children: [
|
|
3820
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3821
|
+
SelectField,
|
|
3822
|
+
{
|
|
3823
|
+
label: "Type",
|
|
3824
|
+
value: config.type,
|
|
3825
|
+
options: SHADER_CURTAIN_TYPES,
|
|
3826
|
+
onChange: (type) => update({ type })
|
|
3827
|
+
}
|
|
3828
|
+
),
|
|
3829
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3830
|
+
SelectField,
|
|
3831
|
+
{
|
|
3832
|
+
label: "Shader",
|
|
3833
|
+
value: config.shader,
|
|
3834
|
+
options: SHADER_VARIANTS,
|
|
3835
|
+
onChange: (shader) => update({ shader })
|
|
3836
|
+
}
|
|
3837
|
+
),
|
|
3838
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3839
|
+
SelectField,
|
|
3840
|
+
{
|
|
3841
|
+
label: "Animate",
|
|
3842
|
+
value: config.animate,
|
|
3843
|
+
options: ["on", "off"],
|
|
3844
|
+
onChange: (animate) => update({ animate })
|
|
3845
|
+
}
|
|
3846
|
+
),
|
|
3847
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3848
|
+
SelectField,
|
|
3849
|
+
{
|
|
3850
|
+
label: "Loop",
|
|
3851
|
+
value: config.loop,
|
|
3852
|
+
options: ["on", "off"],
|
|
3853
|
+
onChange: (loop) => update({ loop })
|
|
3854
|
+
}
|
|
3855
|
+
),
|
|
3856
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3857
|
+
NumberField,
|
|
3858
|
+
{
|
|
3859
|
+
label: "Speed",
|
|
3860
|
+
value: config.uSpeed,
|
|
3861
|
+
min: 0,
|
|
3862
|
+
max: 4,
|
|
3863
|
+
step: 0.05,
|
|
3864
|
+
onChange: (uSpeed) => update({ uSpeed })
|
|
3865
|
+
}
|
|
3866
|
+
),
|
|
3867
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3868
|
+
NumberField,
|
|
3869
|
+
{
|
|
3870
|
+
label: "Strength",
|
|
3871
|
+
value: config.uStrength,
|
|
3872
|
+
min: 0,
|
|
3873
|
+
max: 10,
|
|
3874
|
+
step: 0.1,
|
|
3875
|
+
onChange: (uStrength) => update({ uStrength })
|
|
3876
|
+
}
|
|
3877
|
+
),
|
|
3878
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3879
|
+
NumberField,
|
|
3880
|
+
{
|
|
3881
|
+
label: "Density",
|
|
3882
|
+
value: config.uDensity,
|
|
3883
|
+
min: 0,
|
|
3884
|
+
max: 8,
|
|
3885
|
+
step: 0.1,
|
|
3886
|
+
onChange: (uDensity) => update({ uDensity })
|
|
3887
|
+
}
|
|
3888
|
+
),
|
|
3889
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3890
|
+
NumberField,
|
|
3891
|
+
{
|
|
3892
|
+
label: "Frequency",
|
|
3893
|
+
value: config.uFrequency,
|
|
3894
|
+
min: 0,
|
|
3895
|
+
max: 12,
|
|
3896
|
+
step: 0.1,
|
|
3897
|
+
onChange: (uFrequency) => update({ uFrequency })
|
|
3898
|
+
}
|
|
3899
|
+
),
|
|
3900
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3901
|
+
NumberField,
|
|
3902
|
+
{
|
|
3903
|
+
label: "Amplitude",
|
|
3904
|
+
value: config.uAmplitude,
|
|
3905
|
+
min: 0,
|
|
3906
|
+
max: 8,
|
|
3907
|
+
step: 0.1,
|
|
3908
|
+
onChange: (uAmplitude) => update({ uAmplitude })
|
|
3909
|
+
}
|
|
3910
|
+
),
|
|
3911
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3912
|
+
NumberField,
|
|
3913
|
+
{
|
|
3914
|
+
label: "Time",
|
|
3915
|
+
value: config.uTime,
|
|
3916
|
+
min: 0,
|
|
3917
|
+
max: 40,
|
|
3918
|
+
step: 0.1,
|
|
3919
|
+
onChange: (uTime) => update({ uTime })
|
|
3920
|
+
}
|
|
3921
|
+
),
|
|
3922
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3923
|
+
NumberField,
|
|
3924
|
+
{
|
|
3925
|
+
label: "Loop duration",
|
|
3926
|
+
value: config.loopDuration,
|
|
3927
|
+
min: 1,
|
|
3928
|
+
max: 60,
|
|
3929
|
+
step: 1,
|
|
3930
|
+
onChange: (loopDuration) => update({ loopDuration })
|
|
3931
|
+
}
|
|
3932
|
+
),
|
|
3933
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3934
|
+
SelectField,
|
|
3935
|
+
{
|
|
3936
|
+
label: "Range",
|
|
3937
|
+
value: config.range,
|
|
3938
|
+
options: ["enabled", "disabled"],
|
|
3939
|
+
onChange: (range) => update({ range })
|
|
3940
|
+
}
|
|
3941
|
+
),
|
|
3942
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3943
|
+
NumberField,
|
|
3944
|
+
{
|
|
3945
|
+
label: "Range start",
|
|
3946
|
+
value: config.rangeStart,
|
|
3947
|
+
min: 0,
|
|
3948
|
+
max: 40,
|
|
3949
|
+
step: 0.1,
|
|
3950
|
+
onChange: (rangeStart) => update({ rangeStart })
|
|
3951
|
+
}
|
|
3952
|
+
),
|
|
3953
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3954
|
+
NumberField,
|
|
3955
|
+
{
|
|
3956
|
+
label: "Range end",
|
|
3957
|
+
value: config.rangeEnd,
|
|
3958
|
+
min: 0,
|
|
3959
|
+
max: 40,
|
|
3960
|
+
step: 0.1,
|
|
3961
|
+
onChange: (rangeEnd) => update({ rangeEnd })
|
|
3962
|
+
}
|
|
3963
|
+
),
|
|
3964
|
+
/* @__PURE__ */ jsxRuntime.jsxs("label", { className: "flex items-center gap-2 text-xs", children: [
|
|
3965
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3966
|
+
"input",
|
|
3967
|
+
{
|
|
3968
|
+
type: "checkbox",
|
|
3969
|
+
checked: config.wireframe,
|
|
3970
|
+
onChange: (event) => update({ wireframe: event.target.checked })
|
|
3971
|
+
}
|
|
3972
|
+
),
|
|
3973
|
+
"Wireframe"
|
|
3974
|
+
] })
|
|
3975
|
+
] }) : null,
|
|
3976
|
+
tab === "colors" ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid gap-3", children: [
|
|
3977
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3978
|
+
ColorField,
|
|
3979
|
+
{
|
|
3980
|
+
label: "Color 1",
|
|
3981
|
+
value: config.color1,
|
|
3982
|
+
onChange: (color1) => update({ color1 })
|
|
3983
|
+
}
|
|
3984
|
+
),
|
|
3985
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3986
|
+
ColorField,
|
|
3987
|
+
{
|
|
3988
|
+
label: "Color 2",
|
|
3989
|
+
value: config.color2,
|
|
3990
|
+
onChange: (color2) => update({ color2 })
|
|
3991
|
+
}
|
|
3992
|
+
),
|
|
3993
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3994
|
+
ColorField,
|
|
3995
|
+
{
|
|
3996
|
+
label: "Color 3",
|
|
3997
|
+
value: config.color3,
|
|
3998
|
+
onChange: (color3) => update({ color3 })
|
|
3999
|
+
}
|
|
4000
|
+
),
|
|
4001
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4002
|
+
NumberField,
|
|
4003
|
+
{
|
|
4004
|
+
label: "Reflection",
|
|
4005
|
+
value: config.reflection,
|
|
4006
|
+
min: 0,
|
|
4007
|
+
max: 1,
|
|
4008
|
+
step: 0.05,
|
|
4009
|
+
onChange: (reflection) => update({ reflection })
|
|
4010
|
+
}
|
|
4011
|
+
),
|
|
4012
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4013
|
+
NumberField,
|
|
4014
|
+
{
|
|
4015
|
+
label: "Brightness",
|
|
4016
|
+
value: config.brightness,
|
|
4017
|
+
min: 0,
|
|
4018
|
+
max: 4,
|
|
4019
|
+
step: 0.05,
|
|
4020
|
+
onChange: (brightness) => update({ brightness })
|
|
4021
|
+
}
|
|
4022
|
+
)
|
|
4023
|
+
] }) : null,
|
|
4024
|
+
tab === "light" ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid gap-3", children: [
|
|
4025
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4026
|
+
SelectField,
|
|
4027
|
+
{
|
|
4028
|
+
label: "Light",
|
|
4029
|
+
value: config.lightType,
|
|
4030
|
+
options: SHADER_LIGHT_TYPES,
|
|
4031
|
+
onChange: (lightType) => update({ lightType })
|
|
4032
|
+
}
|
|
4033
|
+
),
|
|
4034
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4035
|
+
SelectField,
|
|
4036
|
+
{
|
|
4037
|
+
label: "Environment",
|
|
4038
|
+
value: config.envPreset,
|
|
4039
|
+
options: SHADER_ENV_PRESETS,
|
|
4040
|
+
onChange: (envPreset) => update({ envPreset })
|
|
4041
|
+
}
|
|
4042
|
+
),
|
|
4043
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4044
|
+
SelectField,
|
|
4045
|
+
{
|
|
4046
|
+
label: "Grain",
|
|
4047
|
+
value: config.grain,
|
|
4048
|
+
options: ["on", "off"],
|
|
4049
|
+
onChange: (grain) => update({ grain })
|
|
4050
|
+
}
|
|
4051
|
+
),
|
|
4052
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4053
|
+
NumberField,
|
|
4054
|
+
{
|
|
4055
|
+
label: "Grain blending",
|
|
4056
|
+
value: config.grainBlending,
|
|
4057
|
+
min: 0,
|
|
4058
|
+
max: 1,
|
|
4059
|
+
step: 0.05,
|
|
4060
|
+
onChange: (grainBlending) => update({ grainBlending })
|
|
4061
|
+
}
|
|
4062
|
+
)
|
|
4063
|
+
] }) : null,
|
|
4064
|
+
tab === "camera" ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid gap-3", children: [
|
|
4065
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4066
|
+
NumberField,
|
|
4067
|
+
{
|
|
4068
|
+
label: "Azimuth",
|
|
4069
|
+
value: config.cAzimuthAngle,
|
|
4070
|
+
min: 0,
|
|
4071
|
+
max: 360,
|
|
4072
|
+
step: 1,
|
|
4073
|
+
onChange: (cAzimuthAngle) => update({ cAzimuthAngle })
|
|
4074
|
+
}
|
|
4075
|
+
),
|
|
4076
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4077
|
+
NumberField,
|
|
4078
|
+
{
|
|
4079
|
+
label: "Polar",
|
|
4080
|
+
value: config.cPolarAngle,
|
|
4081
|
+
min: 0,
|
|
4082
|
+
max: 180,
|
|
4083
|
+
step: 1,
|
|
4084
|
+
onChange: (cPolarAngle) => update({ cPolarAngle })
|
|
4085
|
+
}
|
|
4086
|
+
),
|
|
4087
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4088
|
+
NumberField,
|
|
4089
|
+
{
|
|
4090
|
+
label: "Distance",
|
|
4091
|
+
value: config.cDistance,
|
|
4092
|
+
min: 0.1,
|
|
4093
|
+
max: 40,
|
|
4094
|
+
step: 0.1,
|
|
4095
|
+
onChange: (cDistance) => update({ cDistance })
|
|
4096
|
+
}
|
|
4097
|
+
),
|
|
4098
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4099
|
+
NumberField,
|
|
4100
|
+
{
|
|
4101
|
+
label: "Zoom",
|
|
4102
|
+
value: config.cameraZoom,
|
|
4103
|
+
min: 0.1,
|
|
4104
|
+
max: 50,
|
|
4105
|
+
step: 0.1,
|
|
4106
|
+
onChange: (cameraZoom) => update({ cameraZoom })
|
|
4107
|
+
}
|
|
4108
|
+
),
|
|
4109
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4110
|
+
NumberField,
|
|
4111
|
+
{
|
|
4112
|
+
label: "FOV",
|
|
4113
|
+
value: config.fov,
|
|
4114
|
+
min: 10,
|
|
4115
|
+
max: 120,
|
|
4116
|
+
step: 1,
|
|
4117
|
+
onChange: (fov) => update({ fov })
|
|
4118
|
+
}
|
|
4119
|
+
),
|
|
4120
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4121
|
+
NumberField,
|
|
4122
|
+
{
|
|
4123
|
+
label: "Pixel density",
|
|
4124
|
+
value: config.pixelDensity,
|
|
4125
|
+
min: 0.5,
|
|
4126
|
+
max: 2,
|
|
4127
|
+
step: 0.1,
|
|
4128
|
+
onChange: (pixelDensity) => update({ pixelDensity })
|
|
4129
|
+
}
|
|
4130
|
+
),
|
|
4131
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4132
|
+
NumberField,
|
|
4133
|
+
{
|
|
4134
|
+
label: "Position X",
|
|
4135
|
+
value: config.positionX,
|
|
4136
|
+
min: -20,
|
|
4137
|
+
max: 20,
|
|
4138
|
+
step: 0.1,
|
|
4139
|
+
onChange: (positionX) => update({ positionX })
|
|
4140
|
+
}
|
|
4141
|
+
),
|
|
4142
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4143
|
+
NumberField,
|
|
4144
|
+
{
|
|
4145
|
+
label: "Position Y",
|
|
4146
|
+
value: config.positionY,
|
|
4147
|
+
min: -20,
|
|
4148
|
+
max: 20,
|
|
4149
|
+
step: 0.1,
|
|
4150
|
+
onChange: (positionY) => update({ positionY })
|
|
4151
|
+
}
|
|
4152
|
+
),
|
|
4153
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4154
|
+
NumberField,
|
|
4155
|
+
{
|
|
4156
|
+
label: "Position Z",
|
|
4157
|
+
value: config.positionZ,
|
|
4158
|
+
min: -20,
|
|
4159
|
+
max: 20,
|
|
4160
|
+
step: 0.1,
|
|
4161
|
+
onChange: (positionZ) => update({ positionZ })
|
|
4162
|
+
}
|
|
4163
|
+
),
|
|
4164
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4165
|
+
NumberField,
|
|
4166
|
+
{
|
|
4167
|
+
label: "Rotation X",
|
|
4168
|
+
value: config.rotationX,
|
|
4169
|
+
min: 0,
|
|
4170
|
+
max: 360,
|
|
4171
|
+
step: 1,
|
|
4172
|
+
onChange: (rotationX) => update({ rotationX })
|
|
4173
|
+
}
|
|
4174
|
+
),
|
|
4175
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4176
|
+
NumberField,
|
|
4177
|
+
{
|
|
4178
|
+
label: "Rotation Y",
|
|
4179
|
+
value: config.rotationY,
|
|
4180
|
+
min: 0,
|
|
4181
|
+
max: 360,
|
|
4182
|
+
step: 1,
|
|
4183
|
+
onChange: (rotationY) => update({ rotationY })
|
|
4184
|
+
}
|
|
4185
|
+
),
|
|
4186
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4187
|
+
NumberField,
|
|
4188
|
+
{
|
|
4189
|
+
label: "Rotation Z",
|
|
4190
|
+
value: config.rotationZ,
|
|
4191
|
+
min: 0,
|
|
4192
|
+
max: 360,
|
|
4193
|
+
step: 1,
|
|
4194
|
+
onChange: (rotationZ) => update({ rotationZ })
|
|
4195
|
+
}
|
|
4196
|
+
),
|
|
4197
|
+
/* @__PURE__ */ jsxRuntime.jsxs("label", { className: "flex items-center gap-2 text-xs", children: [
|
|
4198
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4199
|
+
"input",
|
|
4200
|
+
{
|
|
4201
|
+
type: "checkbox",
|
|
4202
|
+
checked: config.zoomOut,
|
|
4203
|
+
onChange: (event) => update({ zoomOut: event.target.checked })
|
|
4204
|
+
}
|
|
4205
|
+
),
|
|
4206
|
+
"Zoom out"
|
|
4207
|
+
] })
|
|
4208
|
+
] }) : null,
|
|
4209
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-2", children: [
|
|
4210
|
+
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-muted-foreground text-xs", children: copy.presets }),
|
|
4211
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex flex-wrap gap-1", children: SHADER_CURTAIN_PRESETS.map((preset) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
4212
|
+
Button,
|
|
4213
|
+
{
|
|
4214
|
+
type: "button",
|
|
4215
|
+
size: "sm",
|
|
4216
|
+
variant: "secondary",
|
|
4217
|
+
onClick: () => replace(preset.config),
|
|
4218
|
+
children: preset.title
|
|
4219
|
+
},
|
|
4220
|
+
preset.id
|
|
4221
|
+
)) })
|
|
4222
|
+
] }),
|
|
4223
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid gap-2", children: [
|
|
4224
|
+
/* @__PURE__ */ jsxRuntime.jsxs("label", { className: "grid gap-1 text-xs", children: [
|
|
4225
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-muted-foreground", children: copy.importUrl }),
|
|
4226
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4227
|
+
"input",
|
|
4228
|
+
{
|
|
4229
|
+
value: url,
|
|
4230
|
+
onChange: (event) => setUrl(event.target.value),
|
|
4231
|
+
className: "border-input bg-background rounded-md border px-2 py-1"
|
|
4232
|
+
}
|
|
4233
|
+
)
|
|
4234
|
+
] }),
|
|
4235
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4236
|
+
Button,
|
|
4237
|
+
{
|
|
4238
|
+
type: "button",
|
|
4239
|
+
size: "sm",
|
|
4240
|
+
variant: "secondary",
|
|
4241
|
+
onClick: applyUrl,
|
|
4242
|
+
children: copy.importApply
|
|
4243
|
+
}
|
|
4244
|
+
),
|
|
4245
|
+
urlError ? /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-destructive text-xs", role: "alert", children: urlError }) : null
|
|
4246
|
+
] })
|
|
4247
|
+
] })
|
|
4248
|
+
]
|
|
4249
|
+
}
|
|
4250
|
+
);
|
|
4251
|
+
});
|
|
4252
|
+
|
|
3160
4253
|
// src/components/video/castHls.ts
|
|
3161
4254
|
var CAST_SENDER_SRC = "https://www.gstatic.com/cv/js/sender/v1/cast_sender.js?loadCastFramework=1";
|
|
3162
4255
|
var DEFAULT_RECEIVER_ID = "CC1AD845";
|
|
@@ -3297,22 +4390,22 @@ function SeekBar({
|
|
|
3297
4390
|
onSeek,
|
|
3298
4391
|
formatTime: formatTime2
|
|
3299
4392
|
}) {
|
|
3300
|
-
const trackRef =
|
|
3301
|
-
const [hoverTime, setHoverTime] =
|
|
3302
|
-
const [cues, setCues] =
|
|
3303
|
-
const loadedSrc =
|
|
3304
|
-
|
|
4393
|
+
const trackRef = React11__namespace.useRef(null);
|
|
4394
|
+
const [hoverTime, setHoverTime] = React11__namespace.useState(null);
|
|
4395
|
+
const [cues, setCues] = React11__namespace.useState(null);
|
|
4396
|
+
const loadedSrc = React11__namespace.useRef(null);
|
|
4397
|
+
React11__namespace.useEffect(() => {
|
|
3305
4398
|
setCues(null);
|
|
3306
4399
|
loadedSrc.current = null;
|
|
3307
4400
|
}, [src]);
|
|
3308
|
-
const ensureCues =
|
|
4401
|
+
const ensureCues = React11__namespace.useCallback(() => {
|
|
3309
4402
|
if (loadedSrc.current === src) return;
|
|
3310
4403
|
loadedSrc.current = src;
|
|
3311
4404
|
void loadThumbnailsVtt(src).then((next) => {
|
|
3312
4405
|
setCues(next);
|
|
3313
4406
|
});
|
|
3314
4407
|
}, [src]);
|
|
3315
|
-
const updateHover =
|
|
4408
|
+
const updateHover = React11__namespace.useCallback(
|
|
3316
4409
|
(clientX) => {
|
|
3317
4410
|
const rect = trackRef.current?.getBoundingClientRect();
|
|
3318
4411
|
if (!rect) return;
|
|
@@ -3916,40 +5009,40 @@ function useHlsPlayback({
|
|
|
3916
5009
|
onRebuffer,
|
|
3917
5010
|
onQualityChange
|
|
3918
5011
|
}) {
|
|
3919
|
-
const videoRef =
|
|
3920
|
-
const hlsRef =
|
|
3921
|
-
const [state, setState] =
|
|
3922
|
-
const [qualities, setQualities] =
|
|
3923
|
-
const [activeLevel, setActiveLevel] =
|
|
3924
|
-
const [autoplayState, setAutoplayState] =
|
|
3925
|
-
const [error, setError] =
|
|
3926
|
-
const [reloadKey, setReloadKey] =
|
|
3927
|
-
const [sealed, setSealed] =
|
|
3928
|
-
const modeRef =
|
|
3929
|
-
const lastSrcRef =
|
|
3930
|
-
const sealedRef =
|
|
3931
|
-
const sawLiveRef =
|
|
3932
|
-
const sealedDuringSessionRef =
|
|
3933
|
-
|
|
5012
|
+
const videoRef = React11__namespace.useRef(null);
|
|
5013
|
+
const hlsRef = React11__namespace.useRef(null);
|
|
5014
|
+
const [state, setState] = React11__namespace.useState("idle");
|
|
5015
|
+
const [qualities, setQualities] = React11__namespace.useState([]);
|
|
5016
|
+
const [activeLevel, setActiveLevel] = React11__namespace.useState(-1);
|
|
5017
|
+
const [autoplayState, setAutoplayState] = React11__namespace.useState("none");
|
|
5018
|
+
const [error, setError] = React11__namespace.useState(null);
|
|
5019
|
+
const [reloadKey, setReloadKey] = React11__namespace.useState(0);
|
|
5020
|
+
const [sealed, setSealed] = React11__namespace.useState(false);
|
|
5021
|
+
const modeRef = React11__namespace.useRef(mode);
|
|
5022
|
+
const lastSrcRef = React11__namespace.useRef(src);
|
|
5023
|
+
const sealedRef = React11__namespace.useRef(false);
|
|
5024
|
+
const sawLiveRef = React11__namespace.useRef(false);
|
|
5025
|
+
const sealedDuringSessionRef = React11__namespace.useRef(false);
|
|
5026
|
+
React11__namespace.useEffect(() => {
|
|
3934
5027
|
modeRef.current = mode;
|
|
3935
5028
|
}, [mode]);
|
|
3936
|
-
const onErrorRef =
|
|
3937
|
-
const onPlayingChangeRef =
|
|
3938
|
-
const onRebufferRef =
|
|
3939
|
-
const onQualityChangeRef =
|
|
3940
|
-
|
|
5029
|
+
const onErrorRef = React11__namespace.useRef(onError);
|
|
5030
|
+
const onPlayingChangeRef = React11__namespace.useRef(onPlayingChange);
|
|
5031
|
+
const onRebufferRef = React11__namespace.useRef(onRebuffer);
|
|
5032
|
+
const onQualityChangeRef = React11__namespace.useRef(onQualityChange);
|
|
5033
|
+
React11__namespace.useEffect(() => {
|
|
3941
5034
|
onErrorRef.current = onError;
|
|
3942
5035
|
onPlayingChangeRef.current = onPlayingChange;
|
|
3943
5036
|
onRebufferRef.current = onRebuffer;
|
|
3944
5037
|
onQualityChangeRef.current = onQualityChange;
|
|
3945
5038
|
}, [onError, onPlayingChange, onRebuffer, onQualityChange]);
|
|
3946
|
-
const retry =
|
|
5039
|
+
const retry = React11__namespace.useCallback(() => {
|
|
3947
5040
|
setError(null);
|
|
3948
5041
|
setState("loading");
|
|
3949
5042
|
setAutoplayState("none");
|
|
3950
5043
|
setReloadKey((k) => k + 1);
|
|
3951
5044
|
}, []);
|
|
3952
|
-
|
|
5045
|
+
React11__namespace.useEffect(() => {
|
|
3953
5046
|
const media = videoRef.current;
|
|
3954
5047
|
if (!media || !src || !active) {
|
|
3955
5048
|
setState("idle");
|
|
@@ -4296,7 +5389,7 @@ function useHlsPlayback({
|
|
|
4296
5389
|
destroyHls();
|
|
4297
5390
|
};
|
|
4298
5391
|
}, [src, active, autoPlay, muted, reloadKey]);
|
|
4299
|
-
const setLevel =
|
|
5392
|
+
const setLevel = React11__namespace.useCallback((index) => {
|
|
4300
5393
|
const hls = hlsRef.current;
|
|
4301
5394
|
if (!hls) return;
|
|
4302
5395
|
hls.nextLevel = index;
|
|
@@ -4336,9 +5429,9 @@ function isEmbeddedWindow(win = window) {
|
|
|
4336
5429
|
}
|
|
4337
5430
|
}
|
|
4338
5431
|
function CaptionOverlay({ screen }) {
|
|
4339
|
-
const lastSpeakerRef =
|
|
5432
|
+
const lastSpeakerRef = React11__namespace.useRef(void 0);
|
|
4340
5433
|
const lastSpeaker = lastSpeakerRef.current;
|
|
4341
|
-
|
|
5434
|
+
React11__namespace.useLayoutEffect(() => {
|
|
4342
5435
|
if (screen?.speaker != null) lastSpeakerRef.current = screen.speaker;
|
|
4343
5436
|
}, [screen]);
|
|
4344
5437
|
if (!screen) return null;
|
|
@@ -4531,19 +5624,19 @@ function VideoPlayer({
|
|
|
4531
5624
|
liveCaptionsBaseUrl
|
|
4532
5625
|
}) {
|
|
4533
5626
|
const t = { ...DEFAULT_LABELS3, ...labels };
|
|
4534
|
-
const containerRef =
|
|
4535
|
-
const firstPlayFiredRef =
|
|
4536
|
-
const lastProgressAtRef =
|
|
4537
|
-
const onPlaybackProgressRef =
|
|
5627
|
+
const containerRef = React11__namespace.useRef(null);
|
|
5628
|
+
const firstPlayFiredRef = React11__namespace.useRef(false);
|
|
5629
|
+
const lastProgressAtRef = React11__namespace.useRef(-PROGRESS_THROTTLE_MS);
|
|
5630
|
+
const onPlaybackProgressRef = React11__namespace.useRef(onPlaybackProgress);
|
|
4538
5631
|
onPlaybackProgressRef.current = onPlaybackProgress;
|
|
4539
|
-
const applyingTrackModesRef =
|
|
4540
|
-
const captionLocaleRef =
|
|
4541
|
-
const cssFullscreenRef =
|
|
4542
|
-
const webkitFsRef =
|
|
4543
|
-
const [userStarted, setUserStarted] =
|
|
5632
|
+
const applyingTrackModesRef = React11__namespace.useRef(false);
|
|
5633
|
+
const captionLocaleRef = React11__namespace.useRef("off");
|
|
5634
|
+
const cssFullscreenRef = React11__namespace.useRef(false);
|
|
5635
|
+
const webkitFsRef = React11__namespace.useRef(false);
|
|
5636
|
+
const [userStarted, setUserStarted] = React11__namespace.useState(false);
|
|
4544
5637
|
const active = autoPlay || !poster || userStarted;
|
|
4545
5638
|
const autoplayActive = autoPlay || userStarted;
|
|
4546
|
-
const handlePlayingChange =
|
|
5639
|
+
const handlePlayingChange = React11__namespace.useCallback(
|
|
4547
5640
|
(playing) => {
|
|
4548
5641
|
setIsPlaying(playing);
|
|
4549
5642
|
if (playing && !firstPlayFiredRef.current) {
|
|
@@ -4575,45 +5668,45 @@ function VideoPlayer({
|
|
|
4575
5668
|
onRebuffer,
|
|
4576
5669
|
onQualityChange
|
|
4577
5670
|
});
|
|
4578
|
-
const [isPlaying, setIsPlaying] =
|
|
4579
|
-
const [isMuted, setIsMuted] =
|
|
4580
|
-
const isMutedRef =
|
|
5671
|
+
const [isPlaying, setIsPlaying] = React11__namespace.useState(false);
|
|
5672
|
+
const [isMuted, setIsMuted] = React11__namespace.useState(muted);
|
|
5673
|
+
const isMutedRef = React11__namespace.useRef(isMuted);
|
|
4581
5674
|
isMutedRef.current = isMuted;
|
|
4582
|
-
const [volume, setVolume] =
|
|
4583
|
-
const [currentTime, setCurrentTime] =
|
|
4584
|
-
const [duration, setDuration] =
|
|
4585
|
-
const [buffered, setBuffered] =
|
|
4586
|
-
const [isFullscreen, setIsFullscreen] =
|
|
4587
|
-
const [pipActive, setPipActive] =
|
|
4588
|
-
const [controlsVisible, setControlsVisible] =
|
|
4589
|
-
const [playbackRate, setPlaybackRate] =
|
|
4590
|
-
const [openMenu, setOpenMenu] =
|
|
4591
|
-
const [morePane, setMorePane] =
|
|
5675
|
+
const [volume, setVolume] = React11__namespace.useState(1);
|
|
5676
|
+
const [currentTime, setCurrentTime] = React11__namespace.useState(0);
|
|
5677
|
+
const [duration, setDuration] = React11__namespace.useState(0);
|
|
5678
|
+
const [buffered, setBuffered] = React11__namespace.useState(0);
|
|
5679
|
+
const [isFullscreen, setIsFullscreen] = React11__namespace.useState(false);
|
|
5680
|
+
const [pipActive, setPipActive] = React11__namespace.useState(false);
|
|
5681
|
+
const [controlsVisible, setControlsVisible] = React11__namespace.useState(true);
|
|
5682
|
+
const [playbackRate, setPlaybackRate] = React11__namespace.useState(1);
|
|
5683
|
+
const [openMenu, setOpenMenu] = React11__namespace.useState(null);
|
|
5684
|
+
const [morePane, setMorePane] = React11__namespace.useState(
|
|
4592
5685
|
"root"
|
|
4593
5686
|
);
|
|
4594
|
-
const [compactChrome, setCompactChrome] =
|
|
4595
|
-
const [captionLocale, setCaptionLocale] =
|
|
4596
|
-
const [captionCues, setCaptionCues] =
|
|
4597
|
-
const [liveCaptionCues, setLiveCaptionCues] =
|
|
4598
|
-
const [livePlayout, setLivePlayout] =
|
|
5687
|
+
const [compactChrome, setCompactChrome] = React11__namespace.useState(false);
|
|
5688
|
+
const [captionLocale, setCaptionLocale] = React11__namespace.useState(defaultCaptionLocale ?? "off");
|
|
5689
|
+
const [captionCues, setCaptionCues] = React11__namespace.useState([]);
|
|
5690
|
+
const [liveCaptionCues, setLiveCaptionCues] = React11__namespace.useState([]);
|
|
5691
|
+
const [livePlayout, setLivePlayout] = React11__namespace.useState(
|
|
4599
5692
|
EMPTY_LIVE_CAPTION_PLAYOUT
|
|
4600
5693
|
);
|
|
4601
|
-
const [liveLagMs, setLiveLagMs] =
|
|
4602
|
-
const [behindLive, setBehindLive] =
|
|
4603
|
-
const [webkitFullscreenSupported, setWebkitFullscreenSupported] =
|
|
4604
|
-
const [embedded, setEmbedded] =
|
|
4605
|
-
const [cssFullscreen, setCssFullscreen] =
|
|
4606
|
-
const [webkitNativeFs, setWebkitNativeFs] =
|
|
4607
|
-
const hideTimerRef =
|
|
4608
|
-
const liveCaptionCuesRef =
|
|
4609
|
-
const liveLagMsRef =
|
|
4610
|
-
const compactChromeRef =
|
|
5694
|
+
const [liveLagMs, setLiveLagMs] = React11__namespace.useState(null);
|
|
5695
|
+
const [behindLive, setBehindLive] = React11__namespace.useState(false);
|
|
5696
|
+
const [webkitFullscreenSupported, setWebkitFullscreenSupported] = React11__namespace.useState(false);
|
|
5697
|
+
const [embedded, setEmbedded] = React11__namespace.useState(false);
|
|
5698
|
+
const [cssFullscreen, setCssFullscreen] = React11__namespace.useState(false);
|
|
5699
|
+
const [webkitNativeFs, setWebkitNativeFs] = React11__namespace.useState(false);
|
|
5700
|
+
const hideTimerRef = React11__namespace.useRef(null);
|
|
5701
|
+
const liveCaptionCuesRef = React11__namespace.useRef(liveCaptionCues);
|
|
5702
|
+
const liveLagMsRef = React11__namespace.useRef(liveLagMs);
|
|
5703
|
+
const compactChromeRef = React11__namespace.useRef(compactChrome);
|
|
4611
5704
|
liveCaptionCuesRef.current = liveCaptionCues;
|
|
4612
5705
|
liveLagMsRef.current = liveLagMs;
|
|
4613
5706
|
compactChromeRef.current = compactChrome;
|
|
4614
5707
|
cssFullscreenRef.current = cssFullscreen;
|
|
4615
5708
|
captionLocaleRef.current = captionLocale;
|
|
4616
|
-
|
|
5709
|
+
React11__namespace.useEffect(() => {
|
|
4617
5710
|
const el = containerRef.current;
|
|
4618
5711
|
if (!el || typeof ResizeObserver === "undefined") return;
|
|
4619
5712
|
const apply = (width) => {
|
|
@@ -4628,12 +5721,12 @@ function VideoPlayer({
|
|
|
4628
5721
|
observer.observe(el);
|
|
4629
5722
|
return () => observer.disconnect();
|
|
4630
5723
|
}, [active]);
|
|
4631
|
-
|
|
5724
|
+
React11__namespace.useEffect(() => {
|
|
4632
5725
|
if (openMenu !== "more") setMorePane("root");
|
|
4633
5726
|
}, [openMenu]);
|
|
4634
5727
|
const pipSupported = typeof document !== "undefined" && "pictureInPictureEnabled" in document && document.pictureInPictureEnabled;
|
|
4635
5728
|
const fullscreenSupported = hasStandardFullscreen() || webkitFullscreenSupported || !embedded;
|
|
4636
|
-
|
|
5729
|
+
React11__namespace.useEffect(() => {
|
|
4637
5730
|
const video = videoRef.current;
|
|
4638
5731
|
if (!video || !active) return;
|
|
4639
5732
|
const onTimeUpdate = () => {
|
|
@@ -4692,22 +5785,22 @@ function VideoPlayer({
|
|
|
4692
5785
|
video.removeEventListener("playing", onPlaying);
|
|
4693
5786
|
};
|
|
4694
5787
|
}, [videoRef, active, effectiveMode, liveCaptionsBaseUrl]);
|
|
4695
|
-
|
|
5788
|
+
React11__namespace.useLayoutEffect(() => {
|
|
4696
5789
|
const video = videoRef.current;
|
|
4697
5790
|
if (video) video.muted = isMuted;
|
|
4698
5791
|
}, [isMuted, active, videoRef]);
|
|
4699
|
-
|
|
5792
|
+
React11__namespace.useEffect(() => {
|
|
4700
5793
|
const video = videoRef.current;
|
|
4701
5794
|
if (!paused || !video || !isPlaying) return;
|
|
4702
5795
|
video.pause();
|
|
4703
5796
|
}, [paused, videoRef, isPlaying]);
|
|
4704
|
-
|
|
5797
|
+
React11__namespace.useEffect(() => {
|
|
4705
5798
|
setEmbedded(isEmbeddedWindow());
|
|
4706
5799
|
setWebkitFullscreenSupported(hasWebkitVideoFullscreen(videoRef.current));
|
|
4707
5800
|
videoRef.current?.setAttribute("x-webkit-airplay", "allow");
|
|
4708
5801
|
videoRef.current?.setAttribute("webkit-playsinline", "");
|
|
4709
5802
|
}, [videoRef, active]);
|
|
4710
|
-
|
|
5803
|
+
React11__namespace.useEffect(() => {
|
|
4711
5804
|
const onFsChange = () => {
|
|
4712
5805
|
if (document.fullscreenElement === containerRef.current) {
|
|
4713
5806
|
setIsFullscreen(true);
|
|
@@ -4739,7 +5832,7 @@ function VideoPlayer({
|
|
|
4739
5832
|
);
|
|
4740
5833
|
}
|
|
4741
5834
|
}
|
|
4742
|
-
|
|
5835
|
+
React11__namespace.useEffect(() => {
|
|
4743
5836
|
const video = asWebkitVideo(videoRef.current);
|
|
4744
5837
|
if (!video) return;
|
|
4745
5838
|
const onBegin = () => {
|
|
@@ -4761,7 +5854,7 @@ function VideoPlayer({
|
|
|
4761
5854
|
video.removeEventListener("webkitendfullscreen", onEnd);
|
|
4762
5855
|
};
|
|
4763
5856
|
}, [videoRef, active]);
|
|
4764
|
-
|
|
5857
|
+
React11__namespace.useEffect(() => {
|
|
4765
5858
|
if (!cssFullscreen) return;
|
|
4766
5859
|
const previousOverflow = document.body.style.overflow;
|
|
4767
5860
|
document.body.style.overflow = "hidden";
|
|
@@ -4776,7 +5869,7 @@ function VideoPlayer({
|
|
|
4776
5869
|
document.removeEventListener("keydown", onKey);
|
|
4777
5870
|
};
|
|
4778
5871
|
}, [cssFullscreen]);
|
|
4779
|
-
|
|
5872
|
+
React11__namespace.useEffect(() => {
|
|
4780
5873
|
const video = videoRef.current;
|
|
4781
5874
|
if (!video) return;
|
|
4782
5875
|
const onEnter = () => setPipActive(true);
|
|
@@ -4788,23 +5881,23 @@ function VideoPlayer({
|
|
|
4788
5881
|
video.removeEventListener("leavepictureinpicture", onLeave);
|
|
4789
5882
|
};
|
|
4790
5883
|
}, [videoRef]);
|
|
4791
|
-
const scheduleHide =
|
|
5884
|
+
const scheduleHide = React11__namespace.useCallback(() => {
|
|
4792
5885
|
if (hideTimerRef.current) clearTimeout(hideTimerRef.current);
|
|
4793
5886
|
hideTimerRef.current = setTimeout(() => {
|
|
4794
5887
|
setControlsVisible(false);
|
|
4795
5888
|
setOpenMenu(null);
|
|
4796
5889
|
}, CONTROLS_HIDE_MS);
|
|
4797
5890
|
}, []);
|
|
4798
|
-
const revealControls =
|
|
5891
|
+
const revealControls = React11__namespace.useCallback(() => {
|
|
4799
5892
|
setControlsVisible(true);
|
|
4800
5893
|
scheduleHide();
|
|
4801
5894
|
}, [scheduleHide]);
|
|
4802
|
-
|
|
5895
|
+
React11__namespace.useEffect(() => {
|
|
4803
5896
|
return () => {
|
|
4804
5897
|
if (hideTimerRef.current) clearTimeout(hideTimerRef.current);
|
|
4805
5898
|
};
|
|
4806
5899
|
}, []);
|
|
4807
|
-
|
|
5900
|
+
React11__namespace.useEffect(() => {
|
|
4808
5901
|
if (captionLocale === "off") {
|
|
4809
5902
|
setCaptionCues([]);
|
|
4810
5903
|
setLiveCaptionCues([]);
|
|
@@ -4839,7 +5932,7 @@ function VideoPlayer({
|
|
|
4839
5932
|
window.clearInterval(timer);
|
|
4840
5933
|
};
|
|
4841
5934
|
}, [captionLocale, liveCaptionsBaseUrl, src]);
|
|
4842
|
-
|
|
5935
|
+
React11__namespace.useEffect(() => {
|
|
4843
5936
|
if (!liveCaptionsBaseUrl || captionLocale === "off") {
|
|
4844
5937
|
setLivePlayout(EMPTY_LIVE_CAPTION_PLAYOUT);
|
|
4845
5938
|
return;
|
|
@@ -4861,7 +5954,7 @@ function VideoPlayer({
|
|
|
4861
5954
|
}, [liveCaptionsBaseUrl, captionLocale]);
|
|
4862
5955
|
const captionWrapWidth = compactChrome ? CAPTION_COMPACT_CHARS_PER_LINE : CAPTION_MAX_CHARS_PER_LINE;
|
|
4863
5956
|
const captionScreen = liveCaptionsBaseUrl ? livePlayout.screen : captionScreenAtTime(captionCues, currentTime, captionWrapWidth);
|
|
4864
|
-
|
|
5957
|
+
React11__namespace.useEffect(() => {
|
|
4865
5958
|
const video = videoRef.current;
|
|
4866
5959
|
if (!video || !liveCaptionsBaseUrl) return;
|
|
4867
5960
|
try {
|
|
@@ -4883,12 +5976,12 @@ function VideoPlayer({
|
|
|
4883
5976
|
t.captionsEs,
|
|
4884
5977
|
t.captionsPt
|
|
4885
5978
|
]);
|
|
4886
|
-
|
|
5979
|
+
React11__namespace.useEffect(() => {
|
|
4887
5980
|
const video = videoRef.current;
|
|
4888
5981
|
if (!video) return;
|
|
4889
5982
|
applyNativeTrackModes(video, captionLocale, webkitFsRef.current);
|
|
4890
5983
|
}, [videoRef, active, captionLocale, src]);
|
|
4891
|
-
|
|
5984
|
+
React11__namespace.useEffect(() => {
|
|
4892
5985
|
const video = videoRef.current;
|
|
4893
5986
|
if (!video) return;
|
|
4894
5987
|
const onChange = () => {
|
|
@@ -4902,7 +5995,7 @@ function VideoPlayer({
|
|
|
4902
5995
|
};
|
|
4903
5996
|
return listenTextTracksChange(video.textTracks, onChange);
|
|
4904
5997
|
}, [videoRef, active, src, liveCaptionsBaseUrl]);
|
|
4905
|
-
|
|
5998
|
+
React11__namespace.useEffect(() => {
|
|
4906
5999
|
const video = videoRef.current;
|
|
4907
6000
|
if (!video || captionLocale === "off" || !liveCaptionsBaseUrl) return;
|
|
4908
6001
|
const track = findSubtitleTrack(video, captionLocale);
|
|
@@ -5651,16 +6744,16 @@ function videoInPictureInPicture(container) {
|
|
|
5651
6744
|
return container.contains(pip);
|
|
5652
6745
|
}
|
|
5653
6746
|
function useFeedExclusivePlayback(playbackId) {
|
|
5654
|
-
const containerRef =
|
|
5655
|
-
const [forcePaused, setForcePaused] =
|
|
5656
|
-
const requestPause =
|
|
6747
|
+
const containerRef = React11__namespace.useRef(null);
|
|
6748
|
+
const [forcePaused, setForcePaused] = React11__namespace.useState(false);
|
|
6749
|
+
const requestPause = React11__namespace.useCallback(() => {
|
|
5657
6750
|
if (videoInPictureInPicture(containerRef.current)) return;
|
|
5658
6751
|
setForcePaused(true);
|
|
5659
6752
|
}, []);
|
|
5660
|
-
|
|
6753
|
+
React11__namespace.useEffect(() => {
|
|
5661
6754
|
return registerFeedPlayer(playbackId, requestPause);
|
|
5662
6755
|
}, [playbackId, requestPause]);
|
|
5663
|
-
|
|
6756
|
+
React11__namespace.useEffect(() => {
|
|
5664
6757
|
const node = containerRef.current;
|
|
5665
6758
|
if (!node || typeof IntersectionObserver === "undefined") return;
|
|
5666
6759
|
const observer = new IntersectionObserver(
|
|
@@ -5676,14 +6769,14 @@ function useFeedExclusivePlayback(playbackId) {
|
|
|
5676
6769
|
observer.observe(node);
|
|
5677
6770
|
return () => observer.disconnect();
|
|
5678
6771
|
}, [requestPause]);
|
|
5679
|
-
|
|
6772
|
+
React11__namespace.useEffect(() => {
|
|
5680
6773
|
const onVisibility = () => {
|
|
5681
6774
|
if (document.hidden) requestPause();
|
|
5682
6775
|
};
|
|
5683
6776
|
document.addEventListener("visibilitychange", onVisibility);
|
|
5684
6777
|
return () => document.removeEventListener("visibilitychange", onVisibility);
|
|
5685
6778
|
}, [requestPause]);
|
|
5686
|
-
const onPlayingChange =
|
|
6779
|
+
const onPlayingChange = React11__namespace.useCallback(
|
|
5687
6780
|
(playing) => {
|
|
5688
6781
|
if (!playing) return;
|
|
5689
6782
|
setForcePaused(false);
|
|
@@ -5710,7 +6803,7 @@ function FeedVideoPlayer({
|
|
|
5710
6803
|
paused: exclusivePaused,
|
|
5711
6804
|
onPlayingChange: onExclusivePlayingChange
|
|
5712
6805
|
} = useFeedExclusivePlayback(playbackId);
|
|
5713
|
-
const handlePlayingChange =
|
|
6806
|
+
const handlePlayingChange = React11__namespace.useCallback(
|
|
5714
6807
|
(playing) => {
|
|
5715
6808
|
onExclusivePlayingChange(playing);
|
|
5716
6809
|
onPlayingChange?.(playing);
|
|
@@ -5737,8 +6830,8 @@ function FeedVideoPlayer({
|
|
|
5737
6830
|
);
|
|
5738
6831
|
}
|
|
5739
6832
|
function usePlaybackStats(statsUrl, { intervalMs = 15e3, enabled = true } = {}) {
|
|
5740
|
-
const [stats, setStats] =
|
|
5741
|
-
|
|
6833
|
+
const [stats, setStats] = React11__namespace.useState({});
|
|
6834
|
+
React11__namespace.useEffect(() => {
|
|
5742
6835
|
if (!statsUrl || !enabled) return;
|
|
5743
6836
|
let cancelled = false;
|
|
5744
6837
|
const controller = new AbortController();
|
|
@@ -5861,10 +6954,10 @@ function FileDropzone({
|
|
|
5861
6954
|
className
|
|
5862
6955
|
}) {
|
|
5863
6956
|
const labels = { ...DEFAULT_FILE_DROPZONE_LABELS, ...labelOverrides };
|
|
5864
|
-
const inputId =
|
|
5865
|
-
const inputRef =
|
|
5866
|
-
const [dragging, setDragging] =
|
|
5867
|
-
const [message, setMessage] =
|
|
6957
|
+
const inputId = React11.useId();
|
|
6958
|
+
const inputRef = React11.useRef(null);
|
|
6959
|
+
const [dragging, setDragging] = React11.useState(false);
|
|
6960
|
+
const [message, setMessage] = React11.useState(null);
|
|
5868
6961
|
function takeFile(file) {
|
|
5869
6962
|
if (!file || disabled) return;
|
|
5870
6963
|
if (!fileMatchesAccept(file, accept)) {
|
|
@@ -6112,7 +7205,7 @@ function FileUploadMenu({
|
|
|
6112
7205
|
}) {
|
|
6113
7206
|
const labels = { ...DEFAULT_FILE_UPLOAD_TRAY_LABELS, ...labelOverrides };
|
|
6114
7207
|
const visible = jobs.filter((job) => job.status !== "cancelled");
|
|
6115
|
-
const [uncontrolledOpen, setUncontrolledOpen] =
|
|
7208
|
+
const [uncontrolledOpen, setUncontrolledOpen] = React11.useState(false);
|
|
6116
7209
|
const isControlled = open !== void 0;
|
|
6117
7210
|
const resolvedOpen = isControlled ? open : uncontrolledOpen;
|
|
6118
7211
|
function setResolvedOpen(next) {
|
|
@@ -6831,6 +7924,8 @@ exports.DEFAULT_FILE_DROPZONE_LABELS = DEFAULT_FILE_DROPZONE_LABELS;
|
|
|
6831
7924
|
exports.DEFAULT_FILE_UPLOAD_LABELS = DEFAULT_FILE_UPLOAD_LABELS;
|
|
6832
7925
|
exports.DEFAULT_FILE_UPLOAD_TRAY_LABELS = DEFAULT_FILE_UPLOAD_TRAY_LABELS;
|
|
6833
7926
|
exports.DEFAULT_NOTIFICATION_BELL_LABELS = DEFAULT_NOTIFICATION_BELL_LABELS;
|
|
7927
|
+
exports.DEFAULT_SHADER_CURTAIN_CONFIG = DEFAULT_SHADER_CURTAIN_CONFIG;
|
|
7928
|
+
exports.DEFAULT_SHADER_CURTAIN_EDITOR_LABELS = DEFAULT_SHADER_CURTAIN_EDITOR_LABELS;
|
|
6834
7929
|
exports.DataList = DataList;
|
|
6835
7930
|
exports.DataListItem = DataListItem;
|
|
6836
7931
|
exports.DimensionBreakdownTable = DimensionBreakdownTable;
|
|
@@ -6855,7 +7950,10 @@ exports.MetricChartCard = MetricChartCard;
|
|
|
6855
7950
|
exports.MetricEmptyState = MetricEmptyState;
|
|
6856
7951
|
exports.MetricSkeleton = MetricSkeleton;
|
|
6857
7952
|
exports.NotificationBell = NotificationBell;
|
|
7953
|
+
exports.SHADER_CURTAIN_PRESETS = SHADER_CURTAIN_PRESETS;
|
|
6858
7954
|
exports.SafeImage = SafeImage;
|
|
7955
|
+
exports.ShaderCurtain = ShaderCurtain;
|
|
7956
|
+
exports.ShaderCurtainEditor = ShaderCurtainEditor;
|
|
6859
7957
|
exports.SparklineStat = SparklineStat;
|
|
6860
7958
|
exports.StatHighlightCard = StatHighlightCard;
|
|
6861
7959
|
exports.TIME_RANGE_OPTIONS = TIME_RANGE_OPTIONS;
|
|
@@ -6865,6 +7963,7 @@ exports.VideoPlayer = VideoPlayer;
|
|
|
6865
7963
|
exports.WaitingRoom = WaitingRoom;
|
|
6866
7964
|
exports.avatarFallbackStyle = avatarFallbackStyle;
|
|
6867
7965
|
exports.captionsVttUrlFromPlayback = captionsVttUrlFromPlayback;
|
|
7966
|
+
exports.captureShaderPoster = captureShaderPoster;
|
|
6868
7967
|
exports.castHlsUrl = castHlsUrl;
|
|
6869
7968
|
exports.cn = cn;
|
|
6870
7969
|
exports.createLiveHlsConfig = createLiveHlsConfig;
|
|
@@ -6878,10 +7977,14 @@ exports.fileMatchesAccept = fileMatchesAccept;
|
|
|
6878
7977
|
exports.getAvatarColors = getAvatarColors;
|
|
6879
7978
|
exports.getInitials = getInitials;
|
|
6880
7979
|
exports.isCaptionLocale = isCaptionLocale;
|
|
7980
|
+
exports.isShaderCurtainKind = isShaderCurtainKind;
|
|
6881
7981
|
exports.loadCastSender = loadCastSender;
|
|
7982
|
+
exports.mergeShaderCurtainConfig = mergeShaderCurtainConfig;
|
|
7983
|
+
exports.parseShaderGradientUrl = parseShaderGradientUrl;
|
|
6882
7984
|
exports.partRanges = partRanges;
|
|
6883
7985
|
exports.progressFromBytes = progressFromBytes;
|
|
6884
7986
|
exports.shouldRetryLiveEdge404 = shouldRetryLiveEdge404;
|
|
7987
|
+
exports.toShaderGradientUrl = toShaderGradientUrl;
|
|
6885
7988
|
exports.useEditableSection = useEditableSection;
|
|
6886
7989
|
exports.useFeedExclusivePlayback = useFeedExclusivePlayback;
|
|
6887
7990
|
exports.useHlsPlayback = useHlsPlayback;
|